@spaceandtimelabs/makeinfinite-ui 0.51.0 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -3
- package/dist/makeinfinite-ui.es.js +442 -433
- package/dist/makeinfinite-ui.umd.js +16 -16
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function($e,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react"),require("@babel/standalone"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@babel/standalone","react-dom"],E):($e=typeof globalThis<"u"?globalThis:$e||self,E($e.MakeInfinite={},$e.React,$e.Babel,$e.ReactDOM))})(this,function($e,E,rj,ur){"use strict";function kf(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 y=kf(E),vy=kf(rj),xc=kf(ur);var _c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function On(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Sc(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 oj=ij;function ij(e){var t,n;if(typeof e!="function")throw new Error("expected a function but got "+e);return function(){return t||(t=!0,n=e.apply(this,arguments)),n}}(function(e){function t(w,b){var x;return w instanceof Buffer?x=w:x=Buffer.from(w.buffer,w.byteOffset,w.byteLength),x.toString(b)}var n=function(w){return Buffer.from(w)};function r(w){for(var b=0,x=Math.min(256*256,w.length+1),_=new Uint16Array(x),C=[],N=0;;){var R=b<w.length;if(!R||N>=x-1){var T=_.subarray(0,N),M=T;if(C.push(String.fromCharCode.apply(null,M)),!R)return C.join("");w=w.subarray(b),b=0,N=0}var D=w[b++];if(!(D&128))_[N++]=D;else if((D&224)===192){var A=w[b++]&63;_[N++]=(D&31)<<6|A}else if((D&240)===224){var A=w[b++]&63,
|
|
1
|
+
(function($e,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react"),require("@babel/standalone"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@babel/standalone","react-dom"],E):($e=typeof globalThis<"u"?globalThis:$e||self,E($e.MakeInfinite={},$e.React,$e.Babel,$e.ReactDOM))})(this,function($e,E,rj,ur){"use strict";function kf(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 y=kf(E),vy=kf(rj),xc=kf(ur);var _c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function On(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Sc(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 oj=ij;function ij(e){var t,n;if(typeof e!="function")throw new Error("expected a function but got "+e);return function(){return t||(t=!0,n=e.apply(this,arguments)),n}}(function(e){function t(w,b){var x;return w instanceof Buffer?x=w:x=Buffer.from(w.buffer,w.byteOffset,w.byteLength),x.toString(b)}var n=function(w){return Buffer.from(w)};function r(w){for(var b=0,x=Math.min(256*256,w.length+1),_=new Uint16Array(x),C=[],N=0;;){var R=b<w.length;if(!R||N>=x-1){var T=_.subarray(0,N),M=T;if(C.push(String.fromCharCode.apply(null,M)),!R)return C.join("");w=w.subarray(b),b=0,N=0}var D=w[b++];if(!(D&128))_[N++]=D;else if((D&224)===192){var A=w[b++]&63;_[N++]=(D&31)<<6|A}else if((D&240)===224){var A=w[b++]&63,O=w[b++]&63;_[N++]=(D&31)<<12|A<<6|O}else if((D&248)===240){var A=w[b++]&63,O=w[b++]&63,$=w[b++]&63,W=(D&7)<<18|A<<12|O<<6|$;W>65535&&(W-=65536,_[N++]=W>>>10&1023|55296,W=56320|W&1023),_[N++]=W}}}function o(w){for(var b=0,x=w.length,_=0,C=Math.max(32,x+(x>>>1)+7),N=new Uint8Array(C>>>3<<3);b<x;){var R=w.charCodeAt(b++);if(R>=55296&&R<=56319){if(b<x){var T=w.charCodeAt(b);(T&64512)===56320&&(++b,R=((R&1023)<<10)+(T&1023)+65536)}if(R>=55296&&R<=56319)continue}if(_+4>N.length){C+=8,C*=1+b/w.length*2,C=C>>>3<<3;var M=new Uint8Array(C);M.set(N),N=M}if(R&4294967168)if(!(R&4294965248))N[_++]=R>>>6&31|192;else if(!(R&4294901760))N[_++]=R>>>12&15|224,N[_++]=R>>>6&63|128;else if(!(R&4292870144))N[_++]=R>>>18&7|240,N[_++]=R>>>12&63|128,N[_++]=R>>>6&63|128;else continue;else{N[_++]=R;continue}N[_++]=R&63|128}return N.slice?N.slice(0,_):N.subarray(0,_)}var i="Failed to ",a=function(w,b,x){if(w)throw new Error("".concat(i).concat(b,": the '").concat(x,"' option is unsupported."))},s=typeof Buffer=="function"&&Buffer.from,l=s?n:o;function c(){this.encoding="utf-8"}c.prototype.encode=function(w,b){return a(b&&b.stream,"encode","stream"),l(w)};function u(w){var b;try{var x=new Blob([w],{type:"text/plain;charset=UTF-8"});b=URL.createObjectURL(x);var _=new XMLHttpRequest;return _.open("GET",b,!1),_.send(),_.responseText}finally{b&&URL.revokeObjectURL(b)}}var d=!s&&typeof Blob=="function"&&typeof URL=="function"&&typeof URL.createObjectURL=="function",f=["utf-8","utf8","unicode-1-1-utf-8"],h=r;s?h=t:d&&(h=function(w){try{return u(w)}catch{return r(w)}});var p="construct 'TextDecoder'",m="".concat(i," ").concat(p,": the ");function v(w,b){a(b&&b.fatal,p,"fatal"),w=w||"utf-8";var x;if(s?x=Buffer.isEncoding(w):x=f.indexOf(w.toLowerCase())!==-1,!x)throw new RangeError("".concat(m," encoding label provided ('").concat(w,"') is invalid."));this.encoding=w,this.fatal=!1,this.ignoreBOM=!1}v.prototype.decode=function(w,b){a(b&&b.stream,"decode","stream");var x;return w instanceof Uint8Array?x=w:w.buffer instanceof ArrayBuffer?x=new Uint8Array(w.buffer):x=new Uint8Array(w),h(x,this.encoding)},e.TextEncoder=e.TextEncoder||c,e.TextDecoder=e.TextDecoder||v})(typeof window<"u"?window:_c);var aj={encode:e=>new TextEncoder().encode(e),decode:e=>new TextDecoder().decode(e)},sj=lj;function lj(e,t,n){var r;return function(){if(!t)return e.apply(this,arguments);var o=this,i=arguments,a=n&&!r;if(clearTimeout(r),r=setTimeout(function(){if(r=null,!a)return e.apply(o,i)},t),a)return e.apply(this,arguments)}}function yy(e){if(e.length===0)return".";let t=by(e);return t=t.reduce(fj,[]),Df(...t)}function cj(...e){let t="";for(let n of e)n.startsWith("/")?t=n:t=yy(Df(t,n));return t}function Df(...e){if(e.length===0)return"";let t=e.join("/");return t=t.replace(/\/{2,}/g,"/"),t}function by(e){if(e.length===0)return[];if(e==="/")return["/"];let t=e.split("/");return t[t.length-1]===""&&t.pop(),e[0]==="/"?t[0]="/":t[0]!=="."&&t.unshift("."),t}function uj(e){const t=e.lastIndexOf("/");if(t===-1)throw new Error(`Cannot get dirname of "${e}"`);return t===0?"/":e.slice(0,t)}function dj(e){if(e==="/")throw new Error(`Cannot get basename of "${e}"`);const t=e.lastIndexOf("/");return t===-1?e:e.slice(t+1)}function fj(e,t){if(e.length===0)return e.push(t),e;if(t===".")return e;if(t===".."){if(e.length===1){if(e[0]==="/")throw new Error("Unable to normalize path - traverses above root directory");if(e[0]===".")return e.push(t),e}return e[e.length-1]===".."?(e.push(".."),e):(e.pop(),e)}return e.push(t),e}var Af={join:Df,normalize:yy,split:by,basename:dj,dirname:uj,resolve:cj};function hs(e){return class extends Error{constructor(...t){super(...t),this.code=e,this.message?this.message=e+": "+this.message:this.message=e}}}const hj=hs("EEXIST"),pj=hs("ENOENT"),mj=hs("ENOTDIR"),gj=hs("ENOTEMPTY"),wj=hs("ETIMEDOUT");var xy={EEXIST:hj,ENOENT:pj,ENOTDIR:mj,ENOTEMPTY:gj,ETIMEDOUT:wj};const Jt=Af,{EEXIST:_y,ENOENT:vj,ENOTDIR:Sy,ENOTEMPTY:yj}=xy,Bt=0;var bj=class{constructor(){}_makeRoot(t=new Map){return t.set(Bt,{mode:511,type:"dir",size:0,ino:0,mtimeMs:Date.now()}),t}activate(t=null){t===null?this._root=new Map([["/",this._makeRoot()]]):typeof t=="string"?this._root=new Map([["/",this._makeRoot(this.parse(t))]]):this._root=t}get activated(){return!!this._root}deactivate(){this._root=void 0}size(){return this._countInodes(this._root.get("/"))-1}_countInodes(t){let n=1;for(let[r,o]of t)r!==Bt&&(n+=this._countInodes(o));return n}autoinc(){return this._maxInode(this._root.get("/"))+1}_maxInode(t){let n=t.get(Bt).ino;for(let[r,o]of t)r!==Bt&&(n=Math.max(n,this._maxInode(o)));return n}print(t=this._root.get("/")){let n="";const r=(o,i)=>{for(let[a,s]of o){if(a===0)continue;let l=s.get(Bt),c=l.mode.toString(8);n+=`${" ".repeat(i)}${a} ${c}`,l.type==="file"?n+=` ${l.size} ${l.mtimeMs}
|
|
2
2
|
`:(n+=`
|
|
3
3
|
`,r(s,i+1))}};return r(t,0),n}parse(t){let n=0;function r(s){const l=++n,c=s.length===1?"dir":"file";let[u,d,f]=s;return u=parseInt(u,8),d=d?parseInt(d):0,f=f?parseInt(f):Date.now(),new Map([[Bt,{mode:u,type:c,size:d,mtimeMs:f,ino:l}]])}let o=t.trim().split(`
|
|
4
4
|
`),i=this._makeRoot(),a=[{indent:-1,node:i},{indent:0,node:null}];for(let s of o){let c=s.match(/^\t*/)[0].length;s=s.slice(c);let[u,...d]=s.split(" "),f=r(d);if(c<=a[a.length-1].indent)for(;c<=a[a.length-1].indent;)a.pop();a.push({indent:c,node:f}),a[a.length-2].node.set(u,f)}return i}_lookup(t,n=!0){let r=this._root,o="/",i=Jt.split(t);for(let a=0;a<i.length;++a){let s=i[a];if(r=r.get(s),!r)throw new vj(t);if(n||a<i.length-1){const l=r.get(Bt);if(l.type==="symlink"){let c=Jt.resolve(o,l.target);r=this._lookup(c)}o?o=Jt.join(o,s):o=s}}return r}mkdir(t,{mode:n}){if(t==="/")throw new _y;let r=this._lookup(Jt.dirname(t)),o=Jt.basename(t);if(r.has(o))throw new _y;let i=new Map,a={mode:n,type:"dir",size:0,mtimeMs:Date.now(),ino:this.autoinc()};i.set(Bt,a),r.set(o,i)}rmdir(t){let n=this._lookup(t);if(n.get(Bt).type!=="dir")throw new Sy;if(n.size>1)throw new yj;let r=this._lookup(Jt.dirname(t)),o=Jt.basename(t);r.delete(o)}readdir(t){let n=this._lookup(t);if(n.get(Bt).type!=="dir")throw new Sy;return[...n.keys()].filter(r=>typeof r=="string")}writeStat(t,n,{mode:r}){let o;try{let c=this.stat(t);r==null&&(r=c.mode),o=c.ino}catch{}r==null&&(r=438),o==null&&(o=this.autoinc());let i=this._lookup(Jt.dirname(t)),a=Jt.basename(t),s={mode:r,type:"file",size:n,mtimeMs:Date.now(),ino:o},l=new Map;return l.set(Bt,s),i.set(a,l),s}unlink(t){let n=this._lookup(Jt.dirname(t)),r=Jt.basename(t);n.delete(r)}rename(t,n){let r=Jt.basename(n),o=this._lookup(t);this._lookup(Jt.dirname(n)).set(r,o),this.unlink(t)}stat(t){return this._lookup(t).get(Bt)}lstat(t){return this._lookup(t,!1).get(Bt)}readlink(t){return this._lookup(t,!1).get(Bt).target}symlink(t,n){let r,o;try{let c=this.stat(n);o===null&&(o=c.mode),r=c.ino}catch{}o==null&&(o=40960),r==null&&(r=this.autoinc());let i=this._lookup(Jt.dirname(n)),a=Jt.basename(n),s={mode:o,type:"symlink",target:t,size:0,mtimeMs:Date.now(),ino:r},l=new Map;return l.set(Bt,s),i.set(a,l),s}_du(t){let n=0;for(const[r,o]of t.entries())r===Bt?n+=o.size:n+=this._du(o);return n}du(t){let n=this._lookup(t);return this._du(n)}};class Cy{constructor(t="keyval-store",n="keyval"){this.storeName=n,this._dbName=t,this._storeName=n,this._init()}_init(){this._dbp||(this._dbp=new Promise((t,n)=>{const r=indexedDB.open(this._dbName);r.onerror=()=>n(r.error),r.onsuccess=()=>t(r.result),r.onupgradeneeded=()=>{r.result.createObjectStore(this._storeName)}}))}_withIDBStore(t,n){return this._init(),this._dbp.then(r=>new Promise((o,i)=>{const a=r.transaction(this.storeName,t);a.oncomplete=()=>o(),a.onabort=a.onerror=()=>i(a.error),n(a.objectStore(this.storeName))}))}_close(){return this._init(),this._dbp.then(t=>{t.close(),this._dbp=void 0})}}let If;function Go(){return If||(If=new Cy),If}function xj(e,t=Go()){let n;return t._withIDBStore("readwrite",r=>{n=r.get(e)}).then(()=>n.result)}function _j(e,t,n=Go()){return n._withIDBStore("readwrite",r=>{r.put(t,e)})}function Sj(e,t,n=Go()){return n._withIDBStore("readwrite",r=>{const o=r.get(e);o.onsuccess=()=>{r.put(t(o.result),e)}})}function Cj(e,t=Go()){return t._withIDBStore("readwrite",n=>{n.delete(e)})}function Ej(e=Go()){return e._withIDBStore("readwrite",t=>{t.clear()})}function Pj(e=Go()){const t=[];return e._withIDBStore("readwrite",n=>{(n.openKeyCursor||n.openCursor).call(n).onsuccess=function(){this.result&&(t.push(this.result.key),this.result.continue())}}).then(()=>t)}function Rj(e=Go()){return e._close()}const Ey=Sc(Object.freeze(Object.defineProperty({__proto__:null,Store:Cy,clear:Ej,close:Rj,del:Cj,get:xj,keys:Pj,set:_j,update:Sj},Symbol.toStringTag,{value:"Module"}))),ao=Ey;var Nj=class{constructor(t,n){this._database=t,this._storename=n,this._store=new ao.Store(this._database,this._storename)}saveSuperblock(t){return ao.set("!root",t,this._store)}loadSuperblock(){return ao.get("!root",this._store)}readFile(t){return ao.get(t,this._store)}writeFile(t,n){return ao.set(t,n,this._store)}unlink(t){return ao.del(t,this._store)}wipe(){return ao.clear(this._store)}close(){return ao.close(this._store)}},Tj=class{constructor(t){this._url=t}loadSuperblock(){return fetch(this._url+"/.superblock.txt").then(t=>t.ok?t.text():null)}async readFile(t){const n=await fetch(this._url+t);if(n.status===200)return n.arrayBuffer();throw new Error("ENOENT")}async sizeFile(t){const n=await fetch(this._url+t,{method:"HEAD"});if(n.status===200)return n.headers.get("content-length");throw new Error("ENOENT")}};const ps=Ey,Mj=e=>new Promise(t=>setTimeout(t,e));var kj=class{constructor(t,n){this._id=Math.random(),this._database=t,this._storename=n,this._store=new ps.Store(this._database,this._storename),this._lock=null}async has({margin:t=2e3}={}){if(this._lock&&this._lock.holder===this._id){const n=Date.now();return this._lock.expires>n+t?!0:await this.renew()}else return!1}async renew({ttl:t=5e3}={}){let n;return await ps.update("lock",r=>{const i=Date.now()+t;return n=r&&r.holder===this._id,this._lock=n?{holder:this._id,expires:i}:r,this._lock},this._store),n}async acquire({ttl:t=5e3}={}){let n,r,o;if(await ps.update("lock",i=>{const a=Date.now(),s=a+t;return r=i&&i.expires<a,n=i===void 0||r,o=i&&i.holder===this._id,this._lock=n?{holder:this._id,expires:s}:i,this._lock},this._store),o)throw new Error("Mutex double-locked");return n}async wait({interval:t=100,limit:n=6e3,ttl:r}={}){for(;n--;){if(await this.acquire({ttl:r}))return!0;await Mj(t)}throw new Error("Mutex timeout")}async release({force:t=!1}={}){let n,r,o;if(await ps.update("lock",i=>(n=t||i&&i.holder===this._id,r=i===void 0,o=i&&i.holder!==this._id,this._lock=n?void 0:i,this._lock),this._store),await ps.close(this._store),!n&&!t){if(r)throw new Error("Mutex double-freed");if(o)throw new Error("Mutex lost ownership")}return n}},Dj=class{constructor(t){this._id=Math.random(),this._database=t,this._has=!1,this._release=null}async has(){return this._has}async acquire(){return new Promise(t=>{navigator.locks.request(this._database+"_lock",{ifAvailable:!0},n=>(this._has=!!n,t(!!n),new Promise(r=>{this._release=r})))})}async wait({timeout:t=6e5}={}){return new Promise((n,r)=>{const o=new AbortController;setTimeout(()=>{o.abort(),r(new Error("Mutex timeout"))},t),navigator.locks.request(this._database+"_lock",{signal:o.signal},i=>(this._has=!!i,n(!!i),new Promise(a=>{this._release=a})))})}async release({force:t=!1}={}){this._has=!1,this._release?this._release():t&&navigator.locks.request(this._database+"_lock",{steal:!0},n=>!0)}};const{encode:Aj,decode:Py}=aj,Ij=sj,Oj=bj,{ENOENT:jj,ENOTEMPTY:$j,ETIMEDOUT:Fj}=xy,Lj=Nj,zj=Tj,Bj=kj,Hj=Dj,ms=Af;var Vj=class{constructor(){this.saveSuperblock=Ij(()=>{this.flush()},500)}async init(t,{wipe:n,url:r,urlauto:o,fileDbName:i=t,db:a=null,fileStoreName:s=t+"_files",lockDbName:l=t+"_lock",lockStoreName:c=t+"_lock"}={}){this._name=t,this._idb=a||new Lj(i,s),this._mutex=navigator.locks?new Hj(t):new Bj(l,c),this._cache=new Oj(t),this._opts={wipe:n,url:r},this._needsWipe=!!n,r&&(this._http=new zj(r),this._urlauto=!!o)}async activate(){if(this._cache.activated)return;this._needsWipe&&(this._needsWipe=!1,await this._idb.wipe(),await this._mutex.release({force:!0})),await this._mutex.has()||await this._mutex.wait();const t=await this._idb.loadSuperblock();if(t)this._cache.activate(t);else if(this._http){const n=await this._http.loadSuperblock();this._cache.activate(n),await this._saveSuperblock()}else this._cache.activate();if(!await this._mutex.has())throw new Fj}async deactivate(){await this._mutex.has()&&await this._saveSuperblock(),this._cache.deactivate();try{await this._mutex.release()}catch(t){console.log(t)}await this._idb.close()}async _saveSuperblock(){this._cache.activated&&(this._lastSavedAt=Date.now(),await this._idb.saveSuperblock(this._cache._root))}_writeStat(t,n,r){let o=ms.split(ms.dirname(t)),i=o.shift();for(let a of o){i=ms.join(i,a);try{this._cache.mkdir(i,{mode:511})}catch{}}return this._cache.writeStat(t,n,r)}async readFile(t,n){const{encoding:r}=n;if(r&&r!=="utf8")throw new Error('Only "utf8" encoding is supported in readFile');let o=null,i=null;try{i=this._cache.stat(t),o=await this._idb.readFile(i.ino)}catch(a){if(!this._urlauto)throw a}if(!o&&this._http){let a=this._cache.lstat(t);for(;a.type==="symlink";)t=ms.resolve(ms.dirname(t),a.target),a=this._cache.lstat(t);o=await this._http.readFile(t)}if(o&&((!i||i.size!=o.byteLength)&&(i=await this._writeStat(t,o.byteLength,{mode:i?i.mode:438}),this.saveSuperblock()),r==="utf8"?o=Py(o):o.toString=()=>Py(o)),!i)throw new jj(t);return o}async writeFile(t,n,r){const{mode:o,encoding:i="utf8"}=r;if(typeof n=="string"){if(i!=="utf8")throw new Error('Only "utf8" encoding is supported in writeFile');n=Aj(n)}const a=await this._cache.writeStat(t,n.byteLength,{mode:o});await this._idb.writeFile(a.ino,n)}async unlink(t,n){const r=this._cache.lstat(t);this._cache.unlink(t),r.type!=="symlink"&&await this._idb.unlink(r.ino)}readdir(t,n){return this._cache.readdir(t)}mkdir(t,n){const{mode:r=511}=n;this._cache.mkdir(t,{mode:r})}rmdir(t,n){if(t==="/")throw new $j;this._cache.rmdir(t)}rename(t,n){this._cache.rename(t,n)}stat(t,n){return this._cache.stat(t)}lstat(t,n){return this._cache.lstat(t)}readlink(t,n){return this._cache.readlink(t)}symlink(t,n){this._cache.symlink(t,n)}async backFile(t,n){let r=await this._http.sizeFile(t);await this._writeStat(t,r,n)}du(t){return this._cache.du(t)}flush(){return this._saveSuperblock()}},Uj=class{constructor(t){this.type=t.type,this.mode=t.mode,this.size=t.size,this.ino=t.ino,this.mtimeMs=t.mtimeMs,this.ctimeMs=t.ctimeMs||t.mtimeMs,this.uid=1,this.gid=1,this.dev=1}isFile(){return this.type==="file"}isDirectory(){return this.type==="dir"}isSymbolicLink(){return this.type==="symlink"}};const Wj=Vj,Ry=Uj,Cc=Af;function dr(e,t,...n){return e=Cc.normalize(e),(typeof t>"u"||typeof t=="function")&&(t={}),typeof t=="string"&&(t={encoding:t}),[e,t,...n]}function Gj(e,t,n,...r){return e=Cc.normalize(e),(typeof n>"u"||typeof n=="function")&&(n={}),typeof n=="string"&&(n={encoding:n}),[e,t,n,...r]}function Ny(e,t,...n){return[Cc.normalize(e),Cc.normalize(t),...n]}var qj=class{constructor(t,n={}){this.init=this.init.bind(this),this.readFile=this._wrap(this.readFile,dr,!1),this.writeFile=this._wrap(this.writeFile,Gj,!0),this.unlink=this._wrap(this.unlink,dr,!0),this.readdir=this._wrap(this.readdir,dr,!1),this.mkdir=this._wrap(this.mkdir,dr,!0),this.rmdir=this._wrap(this.rmdir,dr,!0),this.rename=this._wrap(this.rename,Ny,!0),this.stat=this._wrap(this.stat,dr,!1),this.lstat=this._wrap(this.lstat,dr,!1),this.readlink=this._wrap(this.readlink,dr,!1),this.symlink=this._wrap(this.symlink,Ny,!0),this.backFile=this._wrap(this.backFile,dr,!0),this.du=this._wrap(this.du,dr,!1),this._deactivationPromise=null,this._deactivationTimeout=null,this._activationPromise=null,this._operations=new Set,t&&this.init(t,n)}async init(...t){return this._initPromiseResolve&&await this._initPromise,this._initPromise=this._init(...t),this._initPromise}async _init(t,n={}){await this._gracefulShutdown(),this._activationPromise&&await this._deactivate(),this._backend&&this._backend.destroy&&await this._backend.destroy(),this._backend=n.backend||new Wj,this._backend.init&&await this._backend.init(t,n),this._initPromiseResolve&&(this._initPromiseResolve(),this._initPromiseResolve=null),n.defer||this.stat("/")}async _gracefulShutdown(){this._operations.size>0&&(this._isShuttingDown=!0,await new Promise(t=>this._gracefulShutdownResolve=t),this._isShuttingDown=!1,this._gracefulShutdownResolve=null)}_wrap(t,n,r){return async(...o)=>{o=n(...o);let i={name:t.name,args:o};this._operations.add(i);try{return await this._activate(),await t.apply(this,o)}finally{this._operations.delete(i),r&&this._backend.saveSuperblock(),this._operations.size===0&&(this._deactivationTimeout||clearTimeout(this._deactivationTimeout),this._deactivationTimeout=setTimeout(this._deactivate.bind(this),500))}}}async _activate(){this._initPromise||console.warn(new Error(`Attempted to use LightningFS ${this._name} before it was initialized.`)),await this._initPromise,this._deactivationTimeout&&(clearTimeout(this._deactivationTimeout),this._deactivationTimeout=null),this._deactivationPromise&&await this._deactivationPromise,this._deactivationPromise=null,this._activationPromise||(this._activationPromise=this._backend.activate?this._backend.activate():Promise.resolve()),await this._activationPromise}async _deactivate(){return this._activationPromise&&await this._activationPromise,this._deactivationPromise||(this._deactivationPromise=this._backend.deactivate?this._backend.deactivate():Promise.resolve()),this._activationPromise=null,this._gracefulShutdownResolve&&this._gracefulShutdownResolve(),this._deactivationPromise}async readFile(t,n){return this._backend.readFile(t,n)}async writeFile(t,n,r){return await this._backend.writeFile(t,n,r),null}async unlink(t,n){return await this._backend.unlink(t,n),null}async readdir(t,n){return this._backend.readdir(t,n)}async mkdir(t,n){return await this._backend.mkdir(t,n),null}async rmdir(t,n){return await this._backend.rmdir(t,n),null}async rename(t,n){return await this._backend.rename(t,n),null}async stat(t,n){const r=await this._backend.stat(t,n);return new Ry(r)}async lstat(t,n){const r=await this._backend.lstat(t,n);return new Ry(r)}async readlink(t,n){return this._backend.readlink(t,n)}async symlink(t,n){return await this._backend.symlink(t,n),null}async backFile(t,n){return await this._backend.backFile(t,n),null}async du(t){return this._backend.du(t)}async flush(){return this._backend.flush()}};const Yj=oj,Kj=qj;function sn(e,t){return typeof e=="function"&&(t=e),t=Yj(t),[(...r)=>t(null,...r),t]}var Xj=class{constructor(...t){this.promises=new Kj(...t),this.init=this.init.bind(this),this.readFile=this.readFile.bind(this),this.writeFile=this.writeFile.bind(this),this.unlink=this.unlink.bind(this),this.readdir=this.readdir.bind(this),this.mkdir=this.mkdir.bind(this),this.rmdir=this.rmdir.bind(this),this.rename=this.rename.bind(this),this.stat=this.stat.bind(this),this.lstat=this.lstat.bind(this),this.readlink=this.readlink.bind(this),this.symlink=this.symlink.bind(this),this.backFile=this.backFile.bind(this),this.du=this.du.bind(this),this.flush=this.flush.bind(this)}init(t,n){return this.promises.init(t,n)}readFile(t,n,r){const[o,i]=sn(n,r);this.promises.readFile(t,n).then(o).catch(i)}writeFile(t,n,r,o){const[i,a]=sn(r,o);this.promises.writeFile(t,n,r).then(i).catch(a)}unlink(t,n,r){const[o,i]=sn(n,r);this.promises.unlink(t,n).then(o).catch(i)}readdir(t,n,r){const[o,i]=sn(n,r);this.promises.readdir(t,n).then(o).catch(i)}mkdir(t,n,r){const[o,i]=sn(n,r);this.promises.mkdir(t,n).then(o).catch(i)}rmdir(t,n,r){const[o,i]=sn(n,r);this.promises.rmdir(t,n).then(o).catch(i)}rename(t,n,r){const[o,i]=sn(r);this.promises.rename(t,n).then(o).catch(i)}stat(t,n,r){const[o,i]=sn(n,r);this.promises.stat(t).then(o).catch(i)}lstat(t,n,r){const[o,i]=sn(n,r);this.promises.lstat(t).then(o).catch(i)}readlink(t,n,r){const[o,i]=sn(n,r);this.promises.readlink(t).then(o).catch(i)}symlink(t,n,r){const[o,i]=sn(r);this.promises.symlink(t,n).then(o).catch(i)}backFile(t,n,r){const[o,i]=sn(n,r);this.promises.backFile(t,n).then(o).catch(i)}du(t,n){const[r,o]=sn(n);this.promises.du(t).then(r).catch(o)}flush(t){const[n,r]=sn(t);this.promises.flush().then(n).catch(r)}};const Zj=On(Xj);var Of={},Ec={};Ec.byteLength=e2,Ec.toByteArray=n2,Ec.fromByteArray=i2;for(var fr=[],jn=[],Jj=typeof Uint8Array<"u"?Uint8Array:Array,jf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ii=0,Qj=jf.length;Ii<Qj;++Ii)fr[Ii]=jf[Ii],jn[jf.charCodeAt(Ii)]=Ii;jn[45]=62,jn[95]=63;function Ty(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function e2(e){var t=Ty(e),n=t[0],r=t[1];return(n+r)*3/4-r}function t2(e,t,n){return(t+n)*3/4-n}function n2(e){var t,n=Ty(e),r=n[0],o=n[1],i=new Jj(t2(e,r,o)),a=0,s=o>0?r-4:r,l;for(l=0;l<s;l+=4)t=jn[e.charCodeAt(l)]<<18|jn[e.charCodeAt(l+1)]<<12|jn[e.charCodeAt(l+2)]<<6|jn[e.charCodeAt(l+3)],i[a++]=t>>16&255,i[a++]=t>>8&255,i[a++]=t&255;return o===2&&(t=jn[e.charCodeAt(l)]<<2|jn[e.charCodeAt(l+1)]>>4,i[a++]=t&255),o===1&&(t=jn[e.charCodeAt(l)]<<10|jn[e.charCodeAt(l+1)]<<4|jn[e.charCodeAt(l+2)]>>2,i[a++]=t>>8&255,i[a++]=t&255),i}function r2(e){return fr[e>>18&63]+fr[e>>12&63]+fr[e>>6&63]+fr[e&63]}function o2(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),o.push(r2(r));return o.join("")}function i2(e){for(var t,n=e.length,r=n%3,o=[],i=16383,a=0,s=n-r;a<s;a+=i)o.push(o2(e,a,a+i>s?s:a+i));return r===1?(t=e[n-1],o.push(fr[t>>2]+fr[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(fr[t>>10]+fr[t>>4&63]+fr[t<<2&63]+"=")),o.join("")}var $f={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */$f.read=function(e,t,n,r,o){var i,a,s=o*8-r-1,l=(1<<s)-1,c=l>>1,u=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=i*256+e[t+d],d+=f,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=a*256+e[t+d],d+=f,u-=8);if(i===0)i=1-c;else{if(i===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,r),i=i-c}return(h?-1:1)*a*Math.pow(2,i-r)},$f.write=function(e,t,n,r,o,i){var a,s,l,c=i*8-o-1,u=(1<<c)-1,d=u>>1,f=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*l-1)*Math.pow(2,o),a=a+d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=s&255,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=a&255,h+=p,a/=256,c-=8);e[n+h-p]|=m*128};/*!
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
8
8
|
* @license MIT
|
|
9
|
-
*/(function(e){const t=Ec,n=$f,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o,s.TYPED_ARRAY_SUPPORT=i(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{const k=new Uint8Array(1),S={foo:function(){return 42}};return Object.setPrototypeOf(S,Uint8Array.prototype),Object.setPrototypeOf(k,S),k.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function a(k){if(k>o)throw new RangeError('The value "'+k+'" is invalid for option "size"');const S=new Uint8Array(k);return Object.setPrototypeOf(S,s.prototype),S}function s(k,S,P){if(typeof k=="number"){if(typeof S=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(k)}return l(k,S,P)}s.poolSize=8192;function l(k,S,P){if(typeof k=="string")return f(k,S);if(ArrayBuffer.isView(k))return p(k);if(k==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k);if(pe(k,ArrayBuffer)||k&&pe(k.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(pe(k,SharedArrayBuffer)||k&&pe(k.buffer,SharedArrayBuffer)))return m(k,S,P);if(typeof k=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const I=k.valueOf&&k.valueOf();if(I!=null&&I!==k)return s.from(I,S,P);const U=v(k);if(U)return U;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof k[Symbol.toPrimitive]=="function")return s.from(k[Symbol.toPrimitive]("string"),S,P);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k)}s.from=function(k,S,P){return l(k,S,P)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(k){if(typeof k!="number")throw new TypeError('"size" argument must be of type number');if(k<0)throw new RangeError('The value "'+k+'" is invalid for option "size"')}function u(k,S,P){return c(k),k<=0?a(k):S!==void 0?typeof P=="string"?a(k).fill(S,P):a(k).fill(S):a(k)}s.alloc=function(k,S,P){return u(k,S,P)};function d(k){return c(k),a(k<0?0:w(k)|0)}s.allocUnsafe=function(k){return d(k)},s.allocUnsafeSlow=function(k){return d(k)};function f(k,S){if((typeof S!="string"||S==="")&&(S="utf8"),!s.isEncoding(S))throw new TypeError("Unknown encoding: "+S);const P=x(k,S)|0;let I=a(P);const U=I.write(k,S);return U!==P&&(I=I.slice(0,U)),I}function h(k){const S=k.length<0?0:w(k.length)|0,P=a(S);for(let I=0;I<S;I+=1)P[I]=k[I]&255;return P}function p(k){if(pe(k,Uint8Array)){const S=new Uint8Array(k);return m(S.buffer,S.byteOffset,S.byteLength)}return h(k)}function m(k,S,P){if(S<0||k.byteLength<S)throw new RangeError('"offset" is outside of buffer bounds');if(k.byteLength<S+(P||0))throw new RangeError('"length" is outside of buffer bounds');let I;return S===void 0&&P===void 0?I=new Uint8Array(k):P===void 0?I=new Uint8Array(k,S):I=new Uint8Array(k,S,P),Object.setPrototypeOf(I,s.prototype),I}function v(k){if(s.isBuffer(k)){const S=w(k.length)|0,P=a(S);return P.length===0||k.copy(P,0,0,S),P}if(k.length!==void 0)return typeof k.length!="number"||fe(k.length)?a(0):h(k);if(k.type==="Buffer"&&Array.isArray(k.data))return h(k.data)}function w(k){if(k>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return k|0}function b(k){return+k!=k&&(k=0),s.alloc(+k)}s.isBuffer=function(S){return S!=null&&S._isBuffer===!0&&S!==s.prototype},s.compare=function(S,P){if(pe(S,Uint8Array)&&(S=s.from(S,S.offset,S.byteLength)),pe(P,Uint8Array)&&(P=s.from(P,P.offset,P.byteLength)),!s.isBuffer(S)||!s.isBuffer(P))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(S===P)return 0;let I=S.length,U=P.length;for(let te=0,he=Math.min(I,U);te<he;++te)if(S[te]!==P[te]){I=S[te],U=P[te];break}return I<U?-1:U<I?1:0},s.isEncoding=function(S){switch(String(S).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(S,P){if(!Array.isArray(S))throw new TypeError('"list" argument must be an Array of Buffers');if(S.length===0)return s.alloc(0);let I;if(P===void 0)for(P=0,I=0;I<S.length;++I)P+=S[I].length;const U=s.allocUnsafe(P);let te=0;for(I=0;I<S.length;++I){let he=S[I];if(pe(he,Uint8Array))te+he.length>U.length?(s.isBuffer(he)||(he=s.from(he)),he.copy(U,te)):Uint8Array.prototype.set.call(U,he,te);else if(s.isBuffer(he))he.copy(U,te);else throw new TypeError('"list" argument must be an Array of Buffers');te+=he.length}return U};function x(k,S){if(s.isBuffer(k))return k.length;if(ArrayBuffer.isView(k)||pe(k,ArrayBuffer))return k.byteLength;if(typeof k!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof k);const P=k.length,I=arguments.length>2&&arguments[2]===!0;if(!I&&P===0)return 0;let U=!1;for(;;)switch(S){case"ascii":case"latin1":case"binary":return P;case"utf8":case"utf-8":return xe(k).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P*2;case"hex":return P>>>1;case"base64":return J(k).length;default:if(U)return I?-1:xe(k).length;S=(""+S).toLowerCase(),U=!0}}s.byteLength=x;function _(k,S,P){let I=!1;if((S===void 0||S<0)&&(S=0),S>this.length||((P===void 0||P>this.length)&&(P=this.length),P<=0)||(P>>>=0,S>>>=0,P<=S))return"";for(k||(k="utf8");;)switch(k){case"hex":return oe(this,S,P);case"utf8":case"utf-8":return W(this,S,P);case"ascii":return Z(this,S,P);case"latin1":case"binary":return B(this,S,P);case"base64":return $(this,S,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee(this,S,P);default:if(I)throw new TypeError("Unknown encoding: "+k);k=(k+"").toLowerCase(),I=!0}}s.prototype._isBuffer=!0;function C(k,S,P){const I=k[S];k[S]=k[P],k[P]=I}s.prototype.swap16=function(){const S=this.length;if(S%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let P=0;P<S;P+=2)C(this,P,P+1);return this},s.prototype.swap32=function(){const S=this.length;if(S%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let P=0;P<S;P+=4)C(this,P,P+3),C(this,P+1,P+2);return this},s.prototype.swap64=function(){const S=this.length;if(S%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let P=0;P<S;P+=8)C(this,P,P+7),C(this,P+1,P+6),C(this,P+2,P+5),C(this,P+3,P+4);return this},s.prototype.toString=function(){const S=this.length;return S===0?"":arguments.length===0?W(this,0,S):_.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(S){if(!s.isBuffer(S))throw new TypeError("Argument must be a Buffer");return this===S?!0:s.compare(this,S)===0},s.prototype.inspect=function(){let S="";const P=e.INSPECT_MAX_BYTES;return S=this.toString("hex",0,P).replace(/(.{2})/g,"$1 ").trim(),this.length>P&&(S+=" ... "),"<Buffer "+S+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(S,P,I,U,te){if(pe(S,Uint8Array)&&(S=s.from(S,S.offset,S.byteLength)),!s.isBuffer(S))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof S);if(P===void 0&&(P=0),I===void 0&&(I=S?S.length:0),U===void 0&&(U=0),te===void 0&&(te=this.length),P<0||I>S.length||U<0||te>this.length)throw new RangeError("out of range index");if(U>=te&&P>=I)return 0;if(U>=te)return-1;if(P>=I)return 1;if(P>>>=0,I>>>=0,U>>>=0,te>>>=0,this===S)return 0;let he=te-U,Oe=I-P;const Qe=Math.min(he,Oe),nt=this.slice(U,te),st=S.slice(P,I);for(let We=0;We<Qe;++We)if(nt[We]!==st[We]){he=nt[We],Oe=st[We];break}return he<Oe?-1:Oe<he?1:0};function N(k,S,P,I,U){if(k.length===0)return-1;if(typeof P=="string"?(I=P,P=0):P>2147483647?P=2147483647:P<-2147483648&&(P=-2147483648),P=+P,fe(P)&&(P=U?0:k.length-1),P<0&&(P=k.length+P),P>=k.length){if(U)return-1;P=k.length-1}else if(P<0)if(U)P=0;else return-1;if(typeof S=="string"&&(S=s.from(S,I)),s.isBuffer(S))return S.length===0?-1:R(k,S,P,I,U);if(typeof S=="number")return S=S&255,typeof Uint8Array.prototype.indexOf=="function"?U?Uint8Array.prototype.indexOf.call(k,S,P):Uint8Array.prototype.lastIndexOf.call(k,S,P):R(k,[S],P,I,U);throw new TypeError("val must be string, number or Buffer")}function R(k,S,P,I,U){let te=1,he=k.length,Oe=S.length;if(I!==void 0&&(I=String(I).toLowerCase(),I==="ucs2"||I==="ucs-2"||I==="utf16le"||I==="utf-16le")){if(k.length<2||S.length<2)return-1;te=2,he/=2,Oe/=2,P/=2}function Qe(st,We){return te===1?st[We]:st.readUInt16BE(We*te)}let nt;if(U){let st=-1;for(nt=P;nt<he;nt++)if(Qe(k,nt)===Qe(S,st===-1?0:nt-st)){if(st===-1&&(st=nt),nt-st+1===Oe)return st*te}else st!==-1&&(nt-=nt-st),st=-1}else for(P+Oe>he&&(P=he-Oe),nt=P;nt>=0;nt--){let st=!0;for(let We=0;We<Oe;We++)if(Qe(k,nt+We)!==Qe(S,We)){st=!1;break}if(st)return nt}return-1}s.prototype.includes=function(S,P,I){return this.indexOf(S,P,I)!==-1},s.prototype.indexOf=function(S,P,I){return N(this,S,P,I,!0)},s.prototype.lastIndexOf=function(S,P,I){return N(this,S,P,I,!1)};function T(k,S,P,I){P=Number(P)||0;const U=k.length-P;I?(I=Number(I),I>U&&(I=U)):I=U;const te=S.length;I>te/2&&(I=te/2);let he;for(he=0;he<I;++he){const Oe=parseInt(S.substr(he*2,2),16);if(fe(Oe))return he;k[P+he]=Oe}return he}function M(k,S,P,I){return we(xe(S,k.length-P),k,P,I)}function D(k,S,P,I){return we(O(S),k,P,I)}function A(k,S,P,I){return we(J(S),k,P,I)}function j(k,S,P,I){return we(V(S,k.length-P),k,P,I)}s.prototype.write=function(S,P,I,U){if(P===void 0)U="utf8",I=this.length,P=0;else if(I===void 0&&typeof P=="string")U=P,I=this.length,P=0;else if(isFinite(P))P=P>>>0,isFinite(I)?(I=I>>>0,U===void 0&&(U="utf8")):(U=I,I=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const te=this.length-P;if((I===void 0||I>te)&&(I=te),S.length>0&&(I<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let he=!1;for(;;)switch(U){case"hex":return T(this,S,P,I);case"utf8":case"utf-8":return M(this,S,P,I);case"ascii":case"latin1":case"binary":return D(this,S,P,I);case"base64":return A(this,S,P,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,S,P,I);default:if(he)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),he=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(k,S,P){return S===0&&P===k.length?t.fromByteArray(k):t.fromByteArray(k.slice(S,P))}function W(k,S,P){P=Math.min(k.length,P);const I=[];let U=S;for(;U<P;){const te=k[U];let he=null,Oe=te>239?4:te>223?3:te>191?2:1;if(U+Oe<=P){let Qe,nt,st,We;switch(Oe){case 1:te<128&&(he=te);break;case 2:Qe=k[U+1],(Qe&192)===128&&(We=(te&31)<<6|Qe&63,We>127&&(he=We));break;case 3:Qe=k[U+1],nt=k[U+2],(Qe&192)===128&&(nt&192)===128&&(We=(te&15)<<12|(Qe&63)<<6|nt&63,We>2047&&(We<55296||We>57343)&&(he=We));break;case 4:Qe=k[U+1],nt=k[U+2],st=k[U+3],(Qe&192)===128&&(nt&192)===128&&(st&192)===128&&(We=(te&15)<<18|(Qe&63)<<12|(nt&63)<<6|st&63,We>65535&&We<1114112&&(he=We))}}he===null?(he=65533,Oe=1):he>65535&&(he-=65536,I.push(he>>>10&1023|55296),he=56320|he&1023),I.push(he),U+=Oe}return Y(I)}const re=4096;function Y(k){const S=k.length;if(S<=re)return String.fromCharCode.apply(String,k);let P="",I=0;for(;I<S;)P+=String.fromCharCode.apply(String,k.slice(I,I+=re));return P}function Z(k,S,P){let I="";P=Math.min(k.length,P);for(let U=S;U<P;++U)I+=String.fromCharCode(k[U]&127);return I}function B(k,S,P){let I="";P=Math.min(k.length,P);for(let U=S;U<P;++U)I+=String.fromCharCode(k[U]);return I}function oe(k,S,P){const I=k.length;(!S||S<0)&&(S=0),(!P||P<0||P>I)&&(P=I);let U="";for(let te=S;te<P;++te)U+=ge[k[te]];return U}function ee(k,S,P){const I=k.slice(S,P);let U="";for(let te=0;te<I.length-1;te+=2)U+=String.fromCharCode(I[te]+I[te+1]*256);return U}s.prototype.slice=function(S,P){const I=this.length;S=~~S,P=P===void 0?I:~~P,S<0?(S+=I,S<0&&(S=0)):S>I&&(S=I),P<0?(P+=I,P<0&&(P=0)):P>I&&(P=I),P<S&&(P=S);const U=this.subarray(S,P);return Object.setPrototypeOf(U,s.prototype),U};function ne(k,S,P){if(k%1!==0||k<0)throw new RangeError("offset is not uint");if(k+S>P)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(S,P,I){S=S>>>0,P=P>>>0,I||ne(S,P,this.length);let U=this[S],te=1,he=0;for(;++he<P&&(te*=256);)U+=this[S+he]*te;return U},s.prototype.readUintBE=s.prototype.readUIntBE=function(S,P,I){S=S>>>0,P=P>>>0,I||ne(S,P,this.length);let U=this[S+--P],te=1;for(;P>0&&(te*=256);)U+=this[S+--P]*te;return U},s.prototype.readUint8=s.prototype.readUInt8=function(S,P){return S=S>>>0,P||ne(S,1,this.length),this[S]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(S,P){return S=S>>>0,P||ne(S,2,this.length),this[S]|this[S+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(S,P){return S=S>>>0,P||ne(S,2,this.length),this[S]<<8|this[S+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(S,P){return S=S>>>0,P||ne(S,4,this.length),(this[S]|this[S+1]<<8|this[S+2]<<16)+this[S+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(S,P){return S=S>>>0,P||ne(S,4,this.length),this[S]*16777216+(this[S+1]<<16|this[S+2]<<8|this[S+3])},s.prototype.readBigUInt64LE=_e(function(S){S=S>>>0,ue(S,"offset");const P=this[S],I=this[S+7];(P===void 0||I===void 0)&&se(S,this.length-8);const U=P+this[++S]*2**8+this[++S]*2**16+this[++S]*2**24,te=this[++S]+this[++S]*2**8+this[++S]*2**16+I*2**24;return BigInt(U)+(BigInt(te)<<BigInt(32))}),s.prototype.readBigUInt64BE=_e(function(S){S=S>>>0,ue(S,"offset");const P=this[S],I=this[S+7];(P===void 0||I===void 0)&&se(S,this.length-8);const U=P*2**24+this[++S]*2**16+this[++S]*2**8+this[++S],te=this[++S]*2**24+this[++S]*2**16+this[++S]*2**8+I;return(BigInt(U)<<BigInt(32))+BigInt(te)}),s.prototype.readIntLE=function(S,P,I){S=S>>>0,P=P>>>0,I||ne(S,P,this.length);let U=this[S],te=1,he=0;for(;++he<P&&(te*=256);)U+=this[S+he]*te;return te*=128,U>=te&&(U-=Math.pow(2,8*P)),U},s.prototype.readIntBE=function(S,P,I){S=S>>>0,P=P>>>0,I||ne(S,P,this.length);let U=P,te=1,he=this[S+--U];for(;U>0&&(te*=256);)he+=this[S+--U]*te;return te*=128,he>=te&&(he-=Math.pow(2,8*P)),he},s.prototype.readInt8=function(S,P){return S=S>>>0,P||ne(S,1,this.length),this[S]&128?(255-this[S]+1)*-1:this[S]},s.prototype.readInt16LE=function(S,P){S=S>>>0,P||ne(S,2,this.length);const I=this[S]|this[S+1]<<8;return I&32768?I|4294901760:I},s.prototype.readInt16BE=function(S,P){S=S>>>0,P||ne(S,2,this.length);const I=this[S+1]|this[S]<<8;return I&32768?I|4294901760:I},s.prototype.readInt32LE=function(S,P){return S=S>>>0,P||ne(S,4,this.length),this[S]|this[S+1]<<8|this[S+2]<<16|this[S+3]<<24},s.prototype.readInt32BE=function(S,P){return S=S>>>0,P||ne(S,4,this.length),this[S]<<24|this[S+1]<<16|this[S+2]<<8|this[S+3]},s.prototype.readBigInt64LE=_e(function(S){S=S>>>0,ue(S,"offset");const P=this[S],I=this[S+7];(P===void 0||I===void 0)&&se(S,this.length-8);const U=this[S+4]+this[S+5]*2**8+this[S+6]*2**16+(I<<24);return(BigInt(U)<<BigInt(32))+BigInt(P+this[++S]*2**8+this[++S]*2**16+this[++S]*2**24)}),s.prototype.readBigInt64BE=_e(function(S){S=S>>>0,ue(S,"offset");const P=this[S],I=this[S+7];(P===void 0||I===void 0)&&se(S,this.length-8);const U=(P<<24)+this[++S]*2**16+this[++S]*2**8+this[++S];return(BigInt(U)<<BigInt(32))+BigInt(this[++S]*2**24+this[++S]*2**16+this[++S]*2**8+I)}),s.prototype.readFloatLE=function(S,P){return S=S>>>0,P||ne(S,4,this.length),n.read(this,S,!0,23,4)},s.prototype.readFloatBE=function(S,P){return S=S>>>0,P||ne(S,4,this.length),n.read(this,S,!1,23,4)},s.prototype.readDoubleLE=function(S,P){return S=S>>>0,P||ne(S,8,this.length),n.read(this,S,!0,52,8)},s.prototype.readDoubleBE=function(S,P){return S=S>>>0,P||ne(S,8,this.length),n.read(this,S,!1,52,8)};function G(k,S,P,I,U,te){if(!s.isBuffer(k))throw new TypeError('"buffer" argument must be a Buffer instance');if(S>U||S<te)throw new RangeError('"value" argument is out of bounds');if(P+I>k.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(S,P,I,U){if(S=+S,P=P>>>0,I=I>>>0,!U){const Oe=Math.pow(2,8*I)-1;G(this,S,P,I,Oe,0)}let te=1,he=0;for(this[P]=S&255;++he<I&&(te*=256);)this[P+he]=S/te&255;return P+I},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(S,P,I,U){if(S=+S,P=P>>>0,I=I>>>0,!U){const Oe=Math.pow(2,8*I)-1;G(this,S,P,I,Oe,0)}let te=I-1,he=1;for(this[P+te]=S&255;--te>=0&&(he*=256);)this[P+te]=S/he&255;return P+I},s.prototype.writeUint8=s.prototype.writeUInt8=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,1,255,0),this[P]=S&255,P+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,2,65535,0),this[P]=S&255,this[P+1]=S>>>8,P+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,2,65535,0),this[P]=S>>>8,this[P+1]=S&255,P+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,4,4294967295,0),this[P+3]=S>>>24,this[P+2]=S>>>16,this[P+1]=S>>>8,this[P]=S&255,P+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,4,4294967295,0),this[P]=S>>>24,this[P+1]=S>>>16,this[P+2]=S>>>8,this[P+3]=S&255,P+4};function F(k,S,P,I,U){H(S,I,U,k,P,7);let te=Number(S&BigInt(4294967295));k[P++]=te,te=te>>8,k[P++]=te,te=te>>8,k[P++]=te,te=te>>8,k[P++]=te;let he=Number(S>>BigInt(32)&BigInt(4294967295));return k[P++]=he,he=he>>8,k[P++]=he,he=he>>8,k[P++]=he,he=he>>8,k[P++]=he,P}function q(k,S,P,I,U){H(S,I,U,k,P,7);let te=Number(S&BigInt(4294967295));k[P+7]=te,te=te>>8,k[P+6]=te,te=te>>8,k[P+5]=te,te=te>>8,k[P+4]=te;let he=Number(S>>BigInt(32)&BigInt(4294967295));return k[P+3]=he,he=he>>8,k[P+2]=he,he=he>>8,k[P+1]=he,he=he>>8,k[P]=he,P+8}s.prototype.writeBigUInt64LE=_e(function(S,P=0){return F(this,S,P,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=_e(function(S,P=0){return q(this,S,P,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(S,P,I,U){if(S=+S,P=P>>>0,!U){const Qe=Math.pow(2,8*I-1);G(this,S,P,I,Qe-1,-Qe)}let te=0,he=1,Oe=0;for(this[P]=S&255;++te<I&&(he*=256);)S<0&&Oe===0&&this[P+te-1]!==0&&(Oe=1),this[P+te]=(S/he>>0)-Oe&255;return P+I},s.prototype.writeIntBE=function(S,P,I,U){if(S=+S,P=P>>>0,!U){const Qe=Math.pow(2,8*I-1);G(this,S,P,I,Qe-1,-Qe)}let te=I-1,he=1,Oe=0;for(this[P+te]=S&255;--te>=0&&(he*=256);)S<0&&Oe===0&&this[P+te+1]!==0&&(Oe=1),this[P+te]=(S/he>>0)-Oe&255;return P+I},s.prototype.writeInt8=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,1,127,-128),S<0&&(S=255+S+1),this[P]=S&255,P+1},s.prototype.writeInt16LE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,2,32767,-32768),this[P]=S&255,this[P+1]=S>>>8,P+2},s.prototype.writeInt16BE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,2,32767,-32768),this[P]=S>>>8,this[P+1]=S&255,P+2},s.prototype.writeInt32LE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,4,2147483647,-2147483648),this[P]=S&255,this[P+1]=S>>>8,this[P+2]=S>>>16,this[P+3]=S>>>24,P+4},s.prototype.writeInt32BE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,4,2147483647,-2147483648),S<0&&(S=4294967295+S+1),this[P]=S>>>24,this[P+1]=S>>>16,this[P+2]=S>>>8,this[P+3]=S&255,P+4},s.prototype.writeBigInt64LE=_e(function(S,P=0){return F(this,S,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=_e(function(S,P=0){return q(this,S,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ce(k,S,P,I,U,te){if(P+I>k.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("Index out of range")}function L(k,S,P,I,U){return S=+S,P=P>>>0,U||ce(k,S,P,4),n.write(k,S,P,I,23,4),P+4}s.prototype.writeFloatLE=function(S,P,I){return L(this,S,P,!0,I)},s.prototype.writeFloatBE=function(S,P,I){return L(this,S,P,!1,I)};function K(k,S,P,I,U){return S=+S,P=P>>>0,U||ce(k,S,P,8),n.write(k,S,P,I,52,8),P+8}s.prototype.writeDoubleLE=function(S,P,I){return K(this,S,P,!0,I)},s.prototype.writeDoubleBE=function(S,P,I){return K(this,S,P,!1,I)},s.prototype.copy=function(S,P,I,U){if(!s.isBuffer(S))throw new TypeError("argument should be a Buffer");if(I||(I=0),!U&&U!==0&&(U=this.length),P>=S.length&&(P=S.length),P||(P=0),U>0&&U<I&&(U=I),U===I||S.length===0||this.length===0)return 0;if(P<0)throw new RangeError("targetStart out of bounds");if(I<0||I>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),S.length-P<U-I&&(U=S.length-P+I);const te=U-I;return this===S&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(P,I,U):Uint8Array.prototype.set.call(S,this.subarray(I,U),P),te},s.prototype.fill=function(S,P,I,U){if(typeof S=="string"){if(typeof P=="string"?(U=P,P=0,I=this.length):typeof I=="string"&&(U=I,I=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!s.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(S.length===1){const he=S.charCodeAt(0);(U==="utf8"&&he<128||U==="latin1")&&(S=he)}}else typeof S=="number"?S=S&255:typeof S=="boolean"&&(S=Number(S));if(P<0||this.length<P||this.length<I)throw new RangeError("Out of range index");if(I<=P)return this;P=P>>>0,I=I===void 0?this.length:I>>>0,S||(S=0);let te;if(typeof S=="number")for(te=P;te<I;++te)this[te]=S;else{const he=s.isBuffer(S)?S:s.from(S,U),Oe=he.length;if(Oe===0)throw new TypeError('The value "'+S+'" is invalid for argument "value"');for(te=0;te<I-P;++te)this[te+P]=he[te%Oe]}return this};const z={};function ie(k,S,P){z[k]=class extends P{constructor(){super(),Object.defineProperty(this,"message",{value:S.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${k}]`,this.stack,delete this.name}get code(){return k}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${k}]: ${this.message}`}}}ie("ERR_BUFFER_OUT_OF_BOUNDS",function(k){return k?`${k} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ie("ERR_INVALID_ARG_TYPE",function(k,S){return`The "${k}" argument must be of type number. Received type ${typeof S}`},TypeError),ie("ERR_OUT_OF_RANGE",function(k,S,P){let I=`The value of "${k}" is out of range.`,U=P;return Number.isInteger(P)&&Math.abs(P)>2**32?U=le(String(P)):typeof P=="bigint"&&(U=String(P),(P>BigInt(2)**BigInt(32)||P<-(BigInt(2)**BigInt(32)))&&(U=le(U)),U+="n"),I+=` It must be ${S}. Received ${U}`,I},RangeError);function le(k){let S="",P=k.length;const I=k[0]==="-"?1:0;for(;P>=I+4;P-=3)S=`_${k.slice(P-3,P)}${S}`;return`${k.slice(0,P)}${S}`}function ae(k,S,P){ue(S,"offset"),(k[S]===void 0||k[S+P]===void 0)&&se(S,k.length-(P+1))}function H(k,S,P,I,U,te){if(k>P||k<S){const he=typeof S=="bigint"?"n":"";let Oe;throw S===0||S===BigInt(0)?Oe=`>= 0${he} and < 2${he} ** ${(te+1)*8}${he}`:Oe=`>= -(2${he} ** ${(te+1)*8-1}${he}) and < 2 ** ${(te+1)*8-1}${he}`,new z.ERR_OUT_OF_RANGE("value",Oe,k)}ae(I,U,te)}function ue(k,S){if(typeof k!="number")throw new z.ERR_INVALID_ARG_TYPE(S,"number",k)}function se(k,S,P){throw Math.floor(k)!==k?(ue(k,P),new z.ERR_OUT_OF_RANGE("offset","an integer",k)):S<0?new z.ERR_BUFFER_OUT_OF_BOUNDS:new z.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${S}`,k)}const ye=/[^+/0-9A-Za-z-_]/g;function Ce(k){if(k=k.split("=")[0],k=k.trim().replace(ye,""),k.length<2)return"";for(;k.length%4!==0;)k=k+"=";return k}function xe(k,S){S=S||1/0;let P;const I=k.length;let U=null;const te=[];for(let he=0;he<I;++he){if(P=k.charCodeAt(he),P>55295&&P<57344){if(!U){if(P>56319){(S-=3)>-1&&te.push(239,191,189);continue}else if(he+1===I){(S-=3)>-1&&te.push(239,191,189);continue}U=P;continue}if(P<56320){(S-=3)>-1&&te.push(239,191,189),U=P;continue}P=(U-55296<<10|P-56320)+65536}else U&&(S-=3)>-1&&te.push(239,191,189);if(U=null,P<128){if((S-=1)<0)break;te.push(P)}else if(P<2048){if((S-=2)<0)break;te.push(P>>6|192,P&63|128)}else if(P<65536){if((S-=3)<0)break;te.push(P>>12|224,P>>6&63|128,P&63|128)}else if(P<1114112){if((S-=4)<0)break;te.push(P>>18|240,P>>12&63|128,P>>6&63|128,P&63|128)}else throw new Error("Invalid code point")}return te}function O(k){const S=[];for(let P=0;P<k.length;++P)S.push(k.charCodeAt(P)&255);return S}function V(k,S){let P,I,U;const te=[];for(let he=0;he<k.length&&!((S-=2)<0);++he)P=k.charCodeAt(he),I=P>>8,U=P%256,te.push(U),te.push(I);return te}function J(k){return t.toByteArray(Ce(k))}function we(k,S,P,I){let U;for(U=0;U<I&&!(U+P>=S.length||U>=k.length);++U)S[U+P]=k[U];return U}function pe(k,S){return k instanceof S||k!=null&&k.constructor!=null&&k.constructor.name!=null&&k.constructor.name===S.name}function fe(k){return k!==k}const ge=function(){const k="0123456789abcdef",S=new Array(256);for(let P=0;P<16;++P){const I=P*16;for(let U=0;U<16;++U)S[I+U]=k[P]+k[U]}return S}();function _e(k){return typeof BigInt>"u"?Xe:k}function Xe(){throw new Error("BigInt not supported")}})(Of);function a2(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function s2(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:a2(e)}async function l2(e,t){const n=s2(e);for(;;){const{value:r,done:o}=await n.next();if(r&&await t(r),o)break}n.return&&n.return()}async function c2(e){let t=0;const n=[];await l2(e,i=>{n.push(i),t+=i.byteLength});const r=new Uint8Array(t);let o=0;for(const i of n)r.set(i,o),o+=i.byteLength;return r}function u2(e){if(e[Symbol.asyncIterator])return e;const t=e.getReader();return{next(){return t.read()},return(){return t.releaseLock(),{}},[Symbol.asyncIterator](){return this}}}async function d2({onProgress:e,url:t,method:n="GET",headers:r={},body:o}){o&&(o=await c2(o));const i=await fetch(t,{method:n,headers:r,body:o}),a=i.body&&i.body.getReader?u2(i.body):[new Uint8Array(await i.arrayBuffer())];r={};for(const[s,l]of i.headers.entries())r[s]=l;return{url:i.url,method:i.method,statusCode:i.status,statusMessage:i.statusText,body:a,headers:r}}var Ff={request:d2},Sn=function(e){if(e=e||{},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(typeof process>"u"||typeof process.domain>"u")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||Sn.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||Sn.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||Sn.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=Sn.DEFAULT_MAX_PENDING};Sn.DEFAULT_TIMEOUT=0,Sn.DEFAULT_MAX_OCCUPATION_TIME=0,Sn.DEFAULT_MAX_EXECUTION_TIME=0,Sn.DEFAULT_MAX_PENDING=1e3,Sn.prototype.acquire=function(e,t,n,r){if(Array.isArray(e))return this._acquireBatch(e,t,n,r);if(typeof t!="function")throw new Error("You must pass a function to execute");var o=null,i=null,a=null;typeof n!="function"&&(r=n,n=null,a=new this.Promise(function(b,x){o=b,i=x})),r=r||{};var s=!1,l=null,c=null,u=null,d=this,f=function(b,x,_){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),b&&(d.queues[e]&&d.queues[e].length===0&&delete d.queues[e],d.domainReentrant&&delete d.domains[e]),s||(a?x?i(x):o(_):typeof n=="function"&&n(x,_),s=!0),b&&d.queues[e]&&d.queues[e].length>0&&d.queues[e].shift()()},h=function(b){if(s)return f(b);l&&(clearTimeout(l),l=null),d.domainReentrant&&b&&(d.domains[e]=process.domain);var x=r.maxExecutionTime||d.maxExecutionTime;if(x&&(u=setTimeout(function(){d.queues[e]&&f(b,new Error("Maximum execution time is exceeded "+e))},x)),t.length===1){var _=!1;try{t(function(C,N){_||(_=!0,f(b,C,N))})}catch(C){_||(_=!0,f(b,C))}}else d._promiseTry(function(){return t()}).then(function(C){f(b,void 0,C)},function(C){f(b,C)})};d.domainReentrant&&process.domain&&(h=process.domain.bind(h));var p=r.maxPending||d.maxPending;if(!d.queues[e])d.queues[e]=[],h(!0);else if(d.domainReentrant&&process.domain&&process.domain===d.domains[e])h(!1);else if(d.queues[e].length>=p)f(!1,new Error("Too many pending tasks in queue "+e));else{var m=function(){h(!0)};r.skipQueue?d.queues[e].unshift(m):d.queues[e].push(m);var v=r.timeout||d.timeout;v&&(l=setTimeout(function(){l=null,f(!1,new Error("async-lock timed out in queue "+e))},v))}var w=r.maxOccupationTime||d.maxOccupationTime;if(w&&(c=setTimeout(function(){d.queues[e]&&f(!1,new Error("Maximum occupation time is exceeded in queue "+e))},w)),a)return a},Sn.prototype._acquireBatch=function(e,t,n,r){typeof n!="function"&&(r=n,n=null);var o=this,i=function(s,l){return function(c){o.acquire(s,l,c,r)}},a=e.reduceRight(function(s,l){return i(l,s)},t);if(typeof n=="function")a(n);else return new this.Promise(function(s,l){a.length===1?a(function(c,u){c?l(c):s(u)}):s(a())})},Sn.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},Sn.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(t){return this.Promise.reject(t)}};var f2=Sn,h2=f2;const gs=On(h2);var Lf={exports:{}};typeof Object.create=="function"?Lf.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Lf.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}};var p2=Lf.exports,zf={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var n=Of,r=n.Buffer;function o(a,s){for(var l in a)s[l]=a[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=i);function i(a,s,l){return r(a,s,l)}i.prototype=Object.create(r.prototype),o(r,i),i.from=function(a,s,l){if(typeof a=="number")throw new TypeError("Argument must not be a number");return r(a,s,l)},i.alloc=function(a,s,l){if(typeof a!="number")throw new TypeError("Argument must be a number");var c=r(a);return s!==void 0?typeof l=="string"?c.fill(s,l):c.fill(s):c.fill(0),c},i.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r(a)},i.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(a)}})(zf,zf.exports);var My=zf.exports,ky=My.Buffer;function Pc(e,t){this._block=ky.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Pc.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=ky.from(e,t));for(var n=this._block,r=this._blockSize,o=e.length,i=this._len,a=0;a<o;){for(var s=i%r,l=Math.min(o-a,r-s),c=0;c<l;c++)n[s+c]=e[a+c];i+=l,a+=l,i%r===0&&this._update(n)}return this._len+=o,this},Pc.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=this._len*8;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(n&4294967295)>>>0,o=(n-r)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},Pc.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var m2=Pc,g2=p2,Dy=m2,w2=My.Buffer,v2=[1518500249,1859775393,-1894007588,-899497514],y2=new Array(80);function ws(){this.init(),this._w=y2,Dy.call(this,64,56)}g2(ws,Dy),ws.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function b2(e){return e<<1|e>>>31}function x2(e){return e<<5|e>>>27}function _2(e){return e<<30|e>>>2}function S2(e,t,n,r){return e===0?t&n|~t&r:e===2?t&n|t&r|n&r:t^n^r}ws.prototype._update=function(e){for(var t=this._w,n=this._a|0,r=this._b|0,o=this._c|0,i=this._d|0,a=this._e|0,s=0;s<16;++s)t[s]=e.readInt32BE(s*4);for(;s<80;++s)t[s]=b2(t[s-3]^t[s-8]^t[s-14]^t[s-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=x2(n)+S2(c,r,o,i)+a+t[l]+v2[c]|0;a=i,i=o,o=_2(r),r=n,n=u}this._a=n+this._a|0,this._b=r+this._b|0,this._c=o+this._c|0,this._d=i+this._d|0,this._e=a+this._e|0},ws.prototype._hash=function(){var e=w2.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var C2=ws;const Ay=On(C2);function hr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function Iy(e,t){for(var n="",r=0,o=-1,i=0,a,s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){l===-1?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length===2||n.length===1){n="",r=0,o=s,i=0;continue}}t&&(n.length>0?n+="/..":n="..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i!==-1?++i:i=-1}return n}function E2(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+e+r:r}var Oi={resolve:function(){for(var t="",n=!1,r,o=arguments.length-1;o>=-1&&!n;o--){var i;o>=0?i=arguments[o]:(r===void 0&&(r=process.cwd()),i=r),hr(i),i.length!==0&&(t=i+"/"+t,n=i.charCodeAt(0)===47)}return t=Iy(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(hr(t),t.length===0)return".";var n=t.charCodeAt(0)===47,r=t.charCodeAt(t.length-1)===47;return t=Iy(t,!n),t.length===0&&!n&&(t="."),t.length>0&&r&&(t+="/"),n?"/"+t:t},isAbsolute:function(t){return hr(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,n=0;n<arguments.length;++n){var r=arguments[n];hr(r),r.length>0&&(t===void 0?t=r:t+="/"+r)}return t===void 0?".":Oi.normalize(t)},relative:function(t,n){if(hr(t),hr(n),t===n||(t=Oi.resolve(t),n=Oi.resolve(n),t===n))return"";for(var r=1;r<t.length&&t.charCodeAt(r)===47;++r);for(var o=t.length,i=o-r,a=1;a<n.length&&n.charCodeAt(a)===47;++a);for(var s=n.length,l=s-a,c=i<l?i:l,u=-1,d=0;d<=c;++d){if(d===c){if(l>c){if(n.charCodeAt(a+d)===47)return n.slice(a+d+1);if(d===0)return n.slice(a+d)}else i>c&&(t.charCodeAt(r+d)===47?u=d:d===0&&(u=0));break}var f=t.charCodeAt(r+d),h=n.charCodeAt(a+d);if(f!==h)break;f===47&&(u=d)}var p="";for(d=r+u+1;d<=o;++d)(d===o||t.charCodeAt(d)===47)&&(p.length===0?p+="..":p+="/..");return p.length>0?p+n.slice(a+u):(a+=u,n.charCodeAt(a)===47&&++a,n.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(hr(t),t.length===0)return".";for(var n=t.charCodeAt(0),r=n===47,o=-1,i=!0,a=t.length-1;a>=1;--a)if(n=t.charCodeAt(a),n===47){if(!i){o=a;break}}else i=!1;return o===-1?r?"/":".":r&&o===1?"//":t.slice(0,o)},basename:function(t,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');hr(t);var r=0,o=-1,i=!0,a;if(n!==void 0&&n.length>0&&n.length<=t.length){if(n.length===t.length&&n===t)return"";var s=n.length-1,l=-1;for(a=t.length-1;a>=0;--a){var c=t.charCodeAt(a);if(c===47){if(!i){r=a+1;break}}else l===-1&&(i=!1,l=a+1),s>=0&&(c===n.charCodeAt(s)?--s===-1&&(o=a):(s=-1,o=l))}return r===o?o=l:o===-1&&(o=t.length),t.slice(r,o)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!i){r=a+1;break}}else o===-1&&(i=!1,o=a+1);return o===-1?"":t.slice(r,o)}},extname:function(t){hr(t);for(var n=-1,r=0,o=-1,i=!0,a=0,s=t.length-1;s>=0;--s){var l=t.charCodeAt(s);if(l===47){if(!i){r=s+1;break}continue}o===-1&&(i=!1,o=s+1),l===46?n===-1?n=s:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||o===-1||a===0||a===1&&n===o-1&&n===r+1?"":t.slice(n,o)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return E2("/",t)},parse:function(t){hr(t);var n={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return n;var r=t.charCodeAt(0),o=r===47,i;o?(n.root="/",i=1):i=0;for(var a=-1,s=0,l=-1,c=!0,u=t.length-1,d=0;u>=i;--u){if(r=t.charCodeAt(u),r===47){if(!c){s=u+1;break}continue}l===-1&&(c=!1,l=u+1),r===46?a===-1?a=u:d!==1&&(d=1):a!==-1&&(d=-1)}return a===-1||l===-1||d===0||d===1&&a===l-1&&a===s+1?l!==-1&&(s===0&&o?n.base=n.name=t.slice(1,l):n.base=n.name=t.slice(s,l)):(s===0&&o?(n.name=t.slice(1,a),n.base=t.slice(1,l)):(n.name=t.slice(s,a),n.base=t.slice(s,l)),n.ext=t.slice(a,l)),s>0?n.dir=t.slice(0,s-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};Oi.posix=Oi;var me=Oi,Oy={};/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */(function(e){(function(t){t(typeof DO_NOT_EXPORT_CRC>"u"?e:{})})(function(t){t.version="1.2.2";function n(){for(var T=0,M=new Array(256),D=0;D!=256;++D)T=D,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,M[D]=T;return typeof Int32Array<"u"?new Int32Array(M):M}var r=n();function o(T){var M=0,D=0,A=0,j=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(A=0;A!=256;++A)j[A]=T[A];for(A=0;A!=256;++A)for(D=T[A],M=256+A;M<4096;M+=256)D=j[M]=D>>>8^T[D&255];var $=[];for(A=1;A!=16;++A)$[A-1]=typeof Int32Array<"u"?j.subarray(A*256,A*256+256):j.slice(A*256,A*256+256);return $}var i=o(r),a=i[0],s=i[1],l=i[2],c=i[3],u=i[4],d=i[5],f=i[6],h=i[7],p=i[8],m=i[9],v=i[10],w=i[11],b=i[12],x=i[13],_=i[14];function C(T,M){for(var D=M^-1,A=0,j=T.length;A<j;)D=D>>>8^r[(D^T.charCodeAt(A++))&255];return~D}function N(T,M){for(var D=M^-1,A=T.length-15,j=0;j<A;)D=_[T[j++]^D&255]^x[T[j++]^D>>8&255]^b[T[j++]^D>>16&255]^w[T[j++]^D>>>24]^v[T[j++]]^m[T[j++]]^p[T[j++]]^h[T[j++]]^f[T[j++]]^d[T[j++]]^u[T[j++]]^c[T[j++]]^l[T[j++]]^s[T[j++]]^a[T[j++]]^r[T[j++]];for(A+=15;j<A;)D=D>>>8^r[(D^T[j++])&255];return~D}function R(T,M){for(var D=M^-1,A=0,j=T.length,$=0,W=0;A<j;)$=T.charCodeAt(A++),$<128?D=D>>>8^r[(D^$)&255]:$<2048?(D=D>>>8^r[(D^(192|$>>6&31))&255],D=D>>>8^r[(D^(128|$&63))&255]):$>=55296&&$<57344?($=($&1023)+64,W=T.charCodeAt(A++)&1023,D=D>>>8^r[(D^(240|$>>8&7))&255],D=D>>>8^r[(D^(128|$>>2&63))&255],D=D>>>8^r[(D^(128|W>>6&15|($&3)<<4))&255],D=D>>>8^r[(D^(128|W&63))&255]):(D=D>>>8^r[(D^(224|$>>12&15))&255],D=D>>>8^r[(D^(128|$>>6&63))&255],D=D>>>8^r[(D^(128|$&63))&255]);return~D}t.table=r,t.bstr=C,t.buf=N,t.str=R})})(Oy);const P2=On(Oy);var zr={};(function(e){var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function n(i,a){return Object.prototype.hasOwnProperty.call(i,a)}e.assign=function(i){for(var a=Array.prototype.slice.call(arguments,1);a.length;){var s=a.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var l in s)n(s,l)&&(i[l]=s[l])}}return i},e.shrinkBuf=function(i,a){return i.length===a?i:i.subarray?i.subarray(0,a):(i.length=a,i)};var r={arraySet:function(i,a,s,l,c){if(a.subarray&&i.subarray){i.set(a.subarray(s,s+l),c);return}for(var u=0;u<l;u++)i[c+u]=a[s+u]},flattenChunks:function(i){var a,s,l,c,u,d;for(l=0,a=0,s=i.length;a<s;a++)l+=i[a].length;for(d=new Uint8Array(l),c=0,a=0,s=i.length;a<s;a++)u=i[a],d.set(u,c),c+=u.length;return d}},o={arraySet:function(i,a,s,l,c){for(var u=0;u<l;u++)i[c+u]=a[s+u]},flattenChunks:function(i){return[].concat.apply([],i)}};e.setTyped=function(i){i?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,o))},e.setTyped(t)})(zr);var vs={},pr={},ji={},R2=zr,N2=4,jy=0,$y=1,T2=2;function $i(e){for(var t=e.length;--t>=0;)e[t]=0}var M2=0,Fy=1,k2=2,D2=3,A2=258,Bf=29,ys=256,bs=ys+1+Bf,Fi=30,Hf=19,Ly=2*bs+1,qo=15,Vf=16,I2=7,Uf=256,zy=16,By=17,Hy=18,Wf=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Rc=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],O2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Vy=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],j2=512,Br=new Array((bs+2)*2);$i(Br);var xs=new Array(Fi*2);$i(xs);var _s=new Array(j2);$i(_s);var Ss=new Array(A2-D2+1);$i(Ss);var Gf=new Array(Bf);$i(Gf);var Nc=new Array(Fi);$i(Nc);function qf(e,t,n,r,o){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=o,this.has_stree=e&&e.length}var Uy,Wy,Gy;function Yf(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function qy(e){return e<256?_s[e]:_s[256+(e>>>7)]}function Cs(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function ln(e,t,n){e.bi_valid>Vf-n?(e.bi_buf|=t<<e.bi_valid&65535,Cs(e,e.bi_buf),e.bi_buf=t>>Vf-e.bi_valid,e.bi_valid+=n-Vf):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function mr(e,t,n){ln(e,n[t*2],n[t*2+1])}function Yy(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function $2(e){e.bi_valid===16?(Cs(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function F2(e,t){var n=t.dyn_tree,r=t.max_code,o=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,c,u,d,f,h,p,m=0;for(f=0;f<=qo;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<Ly;c++)u=e.heap[c],f=n[n[u*2+1]*2+1]+1,f>l&&(f=l,m++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,h=0,u>=s&&(h=a[u-s]),p=n[u*2],e.opt_len+=p*(f+h),i&&(e.static_len+=p*(o[u*2+1]+h)));if(m!==0){do{for(f=l-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(f=l;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--c],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}}function Ky(e,t,n){var r=new Array(qo+1),o=0,i,a;for(i=1;i<=qo;i++)r[i]=o=o+n[i-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=Yy(r[s]++,s))}}function L2(){var e,t,n,r,o,i=new Array(qo+1);for(n=0,r=0;r<Bf-1;r++)for(Gf[r]=n,e=0;e<1<<Wf[r];e++)Ss[n++]=r;for(Ss[n-1]=r,o=0,r=0;r<16;r++)for(Nc[r]=o,e=0;e<1<<Rc[r];e++)_s[o++]=r;for(o>>=7;r<Fi;r++)for(Nc[r]=o<<7,e=0;e<1<<Rc[r]-7;e++)_s[256+o++]=r;for(t=0;t<=qo;t++)i[t]=0;for(e=0;e<=143;)Br[e*2+1]=8,e++,i[8]++;for(;e<=255;)Br[e*2+1]=9,e++,i[9]++;for(;e<=279;)Br[e*2+1]=7,e++,i[7]++;for(;e<=287;)Br[e*2+1]=8,e++,i[8]++;for(Ky(Br,bs+1,i),e=0;e<Fi;e++)xs[e*2+1]=5,xs[e*2]=Yy(e,5);Uy=new qf(Br,Wf,ys+1,bs,qo),Wy=new qf(xs,Rc,0,Fi,qo),Gy=new qf(new Array(0),O2,0,Hf,I2)}function Xy(e){var t;for(t=0;t<bs;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Fi;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Hf;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Uf*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Zy(e){e.bi_valid>8?Cs(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function z2(e,t,n,r){Zy(e),Cs(e,n),Cs(e,~n),R2.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function Jy(e,t,n,r){var o=t*2,i=n*2;return e[o]<e[i]||e[o]===e[i]&&r[t]<=r[n]}function Kf(e,t,n){for(var r=e.heap[n],o=n<<1;o<=e.heap_len&&(o<e.heap_len&&Jy(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!Jy(t,r,e.heap[o],e.depth));)e.heap[n]=e.heap[o],n=o,o<<=1;e.heap[n]=r}function Qy(e,t,n){var r,o,i=0,a,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+i*2]<<8|e.pending_buf[e.d_buf+i*2+1],o=e.pending_buf[e.l_buf+i],i++,r===0?mr(e,o,t):(a=Ss[o],mr(e,a+ys+1,t),s=Wf[a],s!==0&&(o-=Gf[a],ln(e,o,s)),r--,a=qy(r),mr(e,a,n),s=Rc[a],s!==0&&(r-=Nc[a],ln(e,r,s)));while(i<e.last_lit);mr(e,Uf,t)}function Xf(e,t){var n=t.dyn_tree,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,i=t.stat_desc.elems,a,s,l=-1,c;for(e.heap_len=0,e.heap_max=Ly,a=0;a<i;a++)n[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):n[a*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=l<2?++l:0,n[c*2]=1,e.depth[c]=0,e.opt_len--,o&&(e.static_len-=r[c*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)Kf(e,n,a);c=i;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Kf(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[c*2]=n[a*2]+n[s*2],e.depth[c]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[a*2+1]=n[s*2+1]=c,e.heap[1]=c++,Kf(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],F2(e,t),Ky(n,l,e.bl_count)}function e0(e,t,n){var r,o=-1,i,a=t[0*2+1],s=0,l=7,c=4;for(a===0&&(l=138,c=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)i=a,a=t[(r+1)*2+1],!(++s<l&&i===a)&&(s<c?e.bl_tree[i*2]+=s:i!==0?(i!==o&&e.bl_tree[i*2]++,e.bl_tree[zy*2]++):s<=10?e.bl_tree[By*2]++:e.bl_tree[Hy*2]++,s=0,o=i,a===0?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4))}function t0(e,t,n){var r,o=-1,i,a=t[0*2+1],s=0,l=7,c=4;for(a===0&&(l=138,c=3),r=0;r<=n;r++)if(i=a,a=t[(r+1)*2+1],!(++s<l&&i===a)){if(s<c)do mr(e,i,e.bl_tree);while(--s!==0);else i!==0?(i!==o&&(mr(e,i,e.bl_tree),s--),mr(e,zy,e.bl_tree),ln(e,s-3,2)):s<=10?(mr(e,By,e.bl_tree),ln(e,s-3,3)):(mr(e,Hy,e.bl_tree),ln(e,s-11,7));s=0,o=i,a===0?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4)}}function B2(e){var t;for(e0(e,e.dyn_ltree,e.l_desc.max_code),e0(e,e.dyn_dtree,e.d_desc.max_code),Xf(e,e.bl_desc),t=Hf-1;t>=3&&e.bl_tree[Vy[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function H2(e,t,n,r){var o;for(ln(e,t-257,5),ln(e,n-1,5),ln(e,r-4,4),o=0;o<r;o++)ln(e,e.bl_tree[Vy[o]*2+1],3);t0(e,e.dyn_ltree,t-1),t0(e,e.dyn_dtree,n-1)}function V2(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return jy;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return $y;for(n=32;n<ys;n++)if(e.dyn_ltree[n*2]!==0)return $y;return jy}var n0=!1;function U2(e){n0||(L2(),n0=!0),e.l_desc=new Yf(e.dyn_ltree,Uy),e.d_desc=new Yf(e.dyn_dtree,Wy),e.bl_desc=new Yf(e.bl_tree,Gy),e.bi_buf=0,e.bi_valid=0,Xy(e)}function r0(e,t,n,r){ln(e,(M2<<1)+(r?1:0),3),z2(e,t,n)}function W2(e){ln(e,Fy<<1,3),mr(e,Uf,Br),$2(e)}function G2(e,t,n,r){var o,i,a=0;e.level>0?(e.strm.data_type===T2&&(e.strm.data_type=V2(e)),Xf(e,e.l_desc),Xf(e,e.d_desc),a=B2(e),o=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=o&&(o=i)):o=i=n+5,n+4<=o&&t!==-1?r0(e,t,n,r):e.strategy===N2||i===o?(ln(e,(Fy<<1)+(r?1:0),3),Qy(e,Br,xs)):(ln(e,(k2<<1)+(r?1:0),3),H2(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),Qy(e,e.dyn_ltree,e.dyn_dtree)),Xy(e),r&&Zy(e)}function q2(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Ss[n]+ys+1)*2]++,e.dyn_dtree[qy(t)*2]++),e.last_lit===e.lit_bufsize-1}ji._tr_init=U2,ji._tr_stored_block=r0,ji._tr_flush_block=G2,ji._tr_tally=q2,ji._tr_align=W2;function Y2(e,t,n,r){for(var o=e&65535|0,i=e>>>16&65535|0,a=0;n!==0;){a=n>2e3?2e3:n,n-=a;do o=o+t[r++]|0,i=i+o|0;while(--a);o%=65521,i%=65521}return o|i<<16|0}var o0=Y2;function K2(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var X2=K2();function Z2(e,t,n,r){var o=X2,i=r+n;e^=-1;for(var a=r;a<i;a++)e=e>>>8^o[(e^t[a])&255];return e^-1}var i0=Z2,Zf={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Qt=zr,$n=ji,a0=o0,so=i0,J2=Zf,Yo=0,Q2=1,e$=3,lo=4,s0=5,gr=0,l0=1,Fn=-2,t$=-3,Jf=-5,n$=-1,r$=1,Tc=2,o$=3,i$=4,a$=0,s$=2,Mc=8,l$=9,c$=15,u$=8,d$=29,f$=256,Qf=f$+1+d$,h$=30,p$=19,m$=2*Qf+1,g$=15,Ue=3,co=258,Wn=co+Ue+1,w$=32,kc=42,eh=69,Dc=73,Ac=91,Ic=103,Ko=113,Es=666,Mt=1,Ps=2,Xo=3,Li=4,v$=3;function uo(e,t){return e.msg=J2[t],t}function c0(e){return(e<<1)-(e>4?9:0)}function fo(e){for(var t=e.length;--t>=0;)e[t]=0}function ho(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(Qt.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function Ft(e,t){$n._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ho(e.strm)}function Je(e,t){e.pending_buf[e.pending++]=t}function Rs(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function y$(e,t,n,r){var o=e.avail_in;return o>r&&(o=r),o===0?0:(e.avail_in-=o,Qt.arraySet(t,e.input,e.next_in,o,n),e.state.wrap===1?e.adler=a0(e.adler,t,o,n):e.state.wrap===2&&(e.adler=so(e.adler,t,o,n)),e.next_in+=o,e.total_in+=o,o)}function u0(e,t){var n=e.max_chain_length,r=e.strstart,o,i,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-Wn?e.strstart-(e.w_size-Wn):0,c=e.window,u=e.w_mask,d=e.prev,f=e.strstart+co,h=c[r+a-1],p=c[r+a];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(o=t,!(c[o+a]!==p||c[o+a-1]!==h||c[o]!==c[r]||c[++o]!==c[r+1])){r+=2,o++;do;while(c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&r<f);if(i=co-(f-r),r=f-co,i>a){if(e.match_start=t,a=i,i>=s)break;h=c[r+a-1],p=c[r+a]}}while((t=d[t&u])>l&&--n!==0);return a<=e.lookahead?a:e.lookahead}function Zo(e){var t=e.w_size,n,r,o,i,a;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Wn)){Qt.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do o=e.head[--n],e.head[n]=o>=t?o-t:0;while(--r);r=t,n=r;do o=e.prev[--n],e.prev[n]=o>=t?o-t:0;while(--r);i+=t}if(e.strm.avail_in===0)break;if(r=y$(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=r,e.lookahead+e.insert>=Ue)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+Ue-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<Ue)););}while(e.lookahead<Wn&&e.strm.avail_in!==0)}function b$(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Zo(e),e.lookahead===0&&t===Yo)return Mt;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,Ft(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Wn&&(Ft(e,!1),e.strm.avail_out===0))return Mt}return e.insert=0,t===lo?(Ft(e,!0),e.strm.avail_out===0?Xo:Li):(e.strstart>e.block_start&&(Ft(e,!1),e.strm.avail_out===0),Mt)}function th(e,t){for(var n,r;;){if(e.lookahead<Wn){if(Zo(e),e.lookahead<Wn&&t===Yo)return Mt;if(e.lookahead===0)break}if(n=0,e.lookahead>=Ue&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Ue-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Wn&&(e.match_length=u0(e,n)),e.match_length>=Ue)if(r=$n._tr_tally(e,e.strstart-e.match_start,e.match_length-Ue),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Ue){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Ue-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=$n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Ft(e,!1),e.strm.avail_out===0))return Mt}return e.insert=e.strstart<Ue-1?e.strstart:Ue-1,t===lo?(Ft(e,!0),e.strm.avail_out===0?Xo:Li):e.last_lit&&(Ft(e,!1),e.strm.avail_out===0)?Mt:Ps}function zi(e,t){for(var n,r,o;;){if(e.lookahead<Wn){if(Zo(e),e.lookahead<Wn&&t===Yo)return Mt;if(e.lookahead===0)break}if(n=0,e.lookahead>=Ue&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Ue-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Ue-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Wn&&(e.match_length=u0(e,n),e.match_length<=5&&(e.strategy===r$||e.match_length===Ue&&e.strstart-e.match_start>4096)&&(e.match_length=Ue-1)),e.prev_length>=Ue&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-Ue,r=$n._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-Ue),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Ue-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Ue-1,e.strstart++,r&&(Ft(e,!1),e.strm.avail_out===0))return Mt}else if(e.match_available){if(r=$n._tr_tally(e,0,e.window[e.strstart-1]),r&&Ft(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Mt}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=$n._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Ue-1?e.strstart:Ue-1,t===lo?(Ft(e,!0),e.strm.avail_out===0?Xo:Li):e.last_lit&&(Ft(e,!1),e.strm.avail_out===0)?Mt:Ps}function x$(e,t){for(var n,r,o,i,a=e.window;;){if(e.lookahead<=co){if(Zo(e),e.lookahead<=co&&t===Yo)return Mt;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Ue&&e.strstart>0&&(o=e.strstart-1,r=a[o],r===a[++o]&&r===a[++o]&&r===a[++o])){i=e.strstart+co;do;while(r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&o<i);e.match_length=co-(i-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Ue?(n=$n._tr_tally(e,1,e.match_length-Ue),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=$n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Ft(e,!1),e.strm.avail_out===0))return Mt}return e.insert=0,t===lo?(Ft(e,!0),e.strm.avail_out===0?Xo:Li):e.last_lit&&(Ft(e,!1),e.strm.avail_out===0)?Mt:Ps}function _$(e,t){for(var n;;){if(e.lookahead===0&&(Zo(e),e.lookahead===0)){if(t===Yo)return Mt;break}if(e.match_length=0,n=$n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Ft(e,!1),e.strm.avail_out===0))return Mt}return e.insert=0,t===lo?(Ft(e,!0),e.strm.avail_out===0?Xo:Li):e.last_lit&&(Ft(e,!1),e.strm.avail_out===0)?Mt:Ps}function wr(e,t,n,r,o){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=o}var Bi;Bi=[new wr(0,0,0,0,b$),new wr(4,4,8,4,th),new wr(4,5,16,8,th),new wr(4,6,32,32,th),new wr(4,4,16,16,zi),new wr(8,16,32,32,zi),new wr(8,16,128,128,zi),new wr(8,32,128,256,zi),new wr(32,128,258,1024,zi),new wr(32,258,258,4096,zi)];function S$(e){e.window_size=2*e.w_size,fo(e.head),e.max_lazy_match=Bi[e.level].max_lazy,e.good_match=Bi[e.level].good_length,e.nice_match=Bi[e.level].nice_length,e.max_chain_length=Bi[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Ue-1,e.match_available=0,e.ins_h=0}function C$(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Mc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Qt.Buf16(m$*2),this.dyn_dtree=new Qt.Buf16((2*h$+1)*2),this.bl_tree=new Qt.Buf16((2*p$+1)*2),fo(this.dyn_ltree),fo(this.dyn_dtree),fo(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Qt.Buf16(g$+1),this.heap=new Qt.Buf16(2*Qf+1),fo(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Qt.Buf16(2*Qf+1),fo(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function d0(e){var t;return!e||!e.state?uo(e,Fn):(e.total_in=e.total_out=0,e.data_type=s$,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?kc:Ko,e.adler=t.wrap===2?0:1,t.last_flush=Yo,$n._tr_init(t),gr)}function f0(e){var t=d0(e);return t===gr&&S$(e.state),t}function E$(e,t){return!e||!e.state||e.state.wrap!==2?Fn:(e.state.gzhead=t,gr)}function h0(e,t,n,r,o,i){if(!e)return Fn;var a=1;if(t===n$&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),o<1||o>l$||n!==Mc||r<8||r>15||t<0||t>9||i<0||i>i$)return uo(e,Fn);r===8&&(r=9);var s=new C$;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=o+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Ue-1)/Ue),s.window=new Qt.Buf8(s.w_size*2),s.head=new Qt.Buf16(s.hash_size),s.prev=new Qt.Buf16(s.w_size),s.lit_bufsize=1<<o+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Qt.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=i,s.method=n,f0(e)}function P$(e,t){return h0(e,t,Mc,c$,u$,a$)}function R$(e,t){var n,r,o,i;if(!e||!e.state||t>s0||t<0)return e?uo(e,Fn):Fn;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===Es&&t!==lo)return uo(e,e.avail_out===0?Jf:Fn);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===kc)if(r.wrap===2)e.adler=0,Je(r,31),Je(r,139),Je(r,8),r.gzhead?(Je(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Je(r,r.gzhead.time&255),Je(r,r.gzhead.time>>8&255),Je(r,r.gzhead.time>>16&255),Je(r,r.gzhead.time>>24&255),Je(r,r.level===9?2:r.strategy>=Tc||r.level<2?4:0),Je(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(Je(r,r.gzhead.extra.length&255),Je(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=so(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=eh):(Je(r,0),Je(r,0),Je(r,0),Je(r,0),Je(r,0),Je(r,r.level===9?2:r.strategy>=Tc||r.level<2?4:0),Je(r,v$),r.status=Ko);else{var a=Mc+(r.w_bits-8<<4)<<8,s=-1;r.strategy>=Tc||r.level<2?s=0:r.level<6?s=1:r.level===6?s=2:s=3,a|=s<<6,r.strstart!==0&&(a|=w$),a+=31-a%31,r.status=Ko,Rs(r,a),r.strstart!==0&&(Rs(r,e.adler>>>16),Rs(r,e.adler&65535)),e.adler=1}if(r.status===eh)if(r.gzhead.extra){for(o=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=so(e.adler,r.pending_buf,r.pending-o,o)),ho(e),o=r.pending,r.pending===r.pending_buf_size));)Je(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>o&&(e.adler=so(e.adler,r.pending_buf,r.pending-o,o)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=Dc)}else r.status=Dc;if(r.status===Dc)if(r.gzhead.name){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=so(e.adler,r.pending_buf,r.pending-o,o)),ho(e),o=r.pending,r.pending===r.pending_buf_size)){i=1;break}r.gzindex<r.gzhead.name.length?i=r.gzhead.name.charCodeAt(r.gzindex++)&255:i=0,Je(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>o&&(e.adler=so(e.adler,r.pending_buf,r.pending-o,o)),i===0&&(r.gzindex=0,r.status=Ac)}else r.status=Ac;if(r.status===Ac)if(r.gzhead.comment){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=so(e.adler,r.pending_buf,r.pending-o,o)),ho(e),o=r.pending,r.pending===r.pending_buf_size)){i=1;break}r.gzindex<r.gzhead.comment.length?i=r.gzhead.comment.charCodeAt(r.gzindex++)&255:i=0,Je(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>o&&(e.adler=so(e.adler,r.pending_buf,r.pending-o,o)),i===0&&(r.status=Ic)}else r.status=Ic;if(r.status===Ic&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&ho(e),r.pending+2<=r.pending_buf_size&&(Je(r,e.adler&255),Je(r,e.adler>>8&255),e.adler=0,r.status=Ko)):r.status=Ko),r.pending!==0){if(ho(e),e.avail_out===0)return r.last_flush=-1,gr}else if(e.avail_in===0&&c0(t)<=c0(n)&&t!==lo)return uo(e,Jf);if(r.status===Es&&e.avail_in!==0)return uo(e,Jf);if(e.avail_in!==0||r.lookahead!==0||t!==Yo&&r.status!==Es){var l=r.strategy===Tc?_$(r,t):r.strategy===o$?x$(r,t):Bi[r.level].func(r,t);if((l===Xo||l===Li)&&(r.status=Es),l===Mt||l===Xo)return e.avail_out===0&&(r.last_flush=-1),gr;if(l===Ps&&(t===Q2?$n._tr_align(r):t!==s0&&($n._tr_stored_block(r,0,0,!1),t===e$&&(fo(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),ho(e),e.avail_out===0))return r.last_flush=-1,gr}return t!==lo?gr:r.wrap<=0?l0:(r.wrap===2?(Je(r,e.adler&255),Je(r,e.adler>>8&255),Je(r,e.adler>>16&255),Je(r,e.adler>>24&255),Je(r,e.total_in&255),Je(r,e.total_in>>8&255),Je(r,e.total_in>>16&255),Je(r,e.total_in>>24&255)):(Rs(r,e.adler>>>16),Rs(r,e.adler&65535)),ho(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?gr:l0)}function N$(e){var t;return!e||!e.state?Fn:(t=e.state.status,t!==kc&&t!==eh&&t!==Dc&&t!==Ac&&t!==Ic&&t!==Ko&&t!==Es?uo(e,Fn):(e.state=null,t===Ko?uo(e,t$):gr))}function T$(e,t){var n=t.length,r,o,i,a,s,l,c,u;if(!e||!e.state||(r=e.state,a=r.wrap,a===2||a===1&&r.status!==kc||r.lookahead))return Fn;for(a===1&&(e.adler=a0(e.adler,t,n,0)),r.wrap=0,n>=r.w_size&&(a===0&&(fo(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new Qt.Buf8(r.w_size),Qt.arraySet(u,t,n-r.w_size,r.w_size,0),t=u,n=r.w_size),s=e.avail_in,l=e.next_in,c=e.input,e.avail_in=n,e.next_in=0,e.input=t,Zo(r);r.lookahead>=Ue;){o=r.strstart,i=r.lookahead-(Ue-1);do r.ins_h=(r.ins_h<<r.hash_shift^r.window[o+Ue-1])&r.hash_mask,r.prev[o&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=o,o++;while(--i);r.strstart=o,r.lookahead=Ue-1,Zo(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Ue-1,r.match_available=0,e.next_in=l,e.input=c,e.avail_in=s,r.wrap=a,gr}pr.deflateInit=P$,pr.deflateInit2=h0,pr.deflateReset=f0,pr.deflateResetKeep=d0,pr.deflateSetHeader=E$,pr.deflate=R$,pr.deflateEnd=N$,pr.deflateSetDictionary=T$,pr.deflateInfo="pako deflate (from Nodeca project)";var Jo={},Oc=zr,p0=!0,m0=!0;try{String.fromCharCode.apply(null,[0])}catch{p0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{m0=!1}for(var Ns=new Oc.Buf8(256),po=0;po<256;po++)Ns[po]=po>=252?6:po>=248?5:po>=240?4:po>=224?3:po>=192?2:1;Ns[254]=Ns[254]=1,Jo.string2buf=function(e){var t,n,r,o,i,a=e.length,s=0;for(o=0;o<a;o++)n=e.charCodeAt(o),(n&64512)===55296&&o+1<a&&(r=e.charCodeAt(o+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),o++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Oc.Buf8(s),i=0,o=0;i<s;o++)n=e.charCodeAt(o),(n&64512)===55296&&o+1<a&&(r=e.charCodeAt(o+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),o++)),n<128?t[i++]=n:n<2048?(t[i++]=192|n>>>6,t[i++]=128|n&63):n<65536?(t[i++]=224|n>>>12,t[i++]=128|n>>>6&63,t[i++]=128|n&63):(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63,t[i++]=128|n>>>6&63,t[i++]=128|n&63);return t};function g0(e,t){if(t<65534&&(e.subarray&&m0||!e.subarray&&p0))return String.fromCharCode.apply(null,Oc.shrinkBuf(e,t));for(var n="",r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n}Jo.buf2binstring=function(e){return g0(e,e.length)},Jo.binstring2buf=function(e){for(var t=new Oc.Buf8(e.length),n=0,r=t.length;n<r;n++)t[n]=e.charCodeAt(n);return t},Jo.buf2string=function(e,t){var n,r,o,i,a=t||e.length,s=new Array(a*2);for(r=0,n=0;n<a;){if(o=e[n++],o<128){s[r++]=o;continue}if(i=Ns[o],i>4){s[r++]=65533,n+=i-1;continue}for(o&=i===2?31:i===3?15:7;i>1&&n<a;)o=o<<6|e[n++]&63,i--;if(i>1){s[r++]=65533;continue}o<65536?s[r++]=o:(o-=65536,s[r++]=55296|o>>10&1023,s[r++]=56320|o&1023)}return g0(s,r)},Jo.utf8border=function(e,t){var n;for(t=t||e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Ns[e[n]]>t?n:t};function M$(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var w0=M$,Ts=pr,Ms=zr,nh=Jo,rh=Zf,k$=w0,v0=Object.prototype.toString,D$=0,oh=4,Hi=0,y0=1,b0=2,A$=-1,I$=0,O$=8;function Qo(e){if(!(this instanceof Qo))return new Qo(e);this.options=Ms.assign({level:A$,method:O$,chunkSize:16384,windowBits:15,memLevel:8,strategy:I$,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k$,this.strm.avail_out=0;var n=Ts.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Hi)throw new Error(rh[n]);if(t.header&&Ts.deflateSetHeader(this.strm,t.header),t.dictionary){var r;if(typeof t.dictionary=="string"?r=nh.string2buf(t.dictionary):v0.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=Ts.deflateSetDictionary(this.strm,r),n!==Hi)throw new Error(rh[n]);this._dict_set=!0}}Qo.prototype.push=function(e,t){var n=this.strm,r=this.options.chunkSize,o,i;if(this.ended)return!1;i=t===~~t?t:t===!0?oh:D$,typeof e=="string"?n.input=nh.string2buf(e):v0.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new Ms.Buf8(r),n.next_out=0,n.avail_out=r),o=Ts.deflate(n,i),o!==y0&&o!==Hi)return this.onEnd(o),this.ended=!0,!1;(n.avail_out===0||n.avail_in===0&&(i===oh||i===b0))&&(this.options.to==="string"?this.onData(nh.buf2binstring(Ms.shrinkBuf(n.output,n.next_out))):this.onData(Ms.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||n.avail_out===0)&&o!==y0);return i===oh?(o=Ts.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Hi):(i===b0&&(this.onEnd(Hi),n.avail_out=0),!0)},Qo.prototype.onData=function(e){this.chunks.push(e)},Qo.prototype.onEnd=function(e){e===Hi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ms.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function ih(e,t){var n=new Qo(t);if(n.push(e,!0),n.err)throw n.msg||rh[n.err];return n.result}function j$(e,t){return t=t||{},t.raw=!0,ih(e,t)}function $$(e,t){return t=t||{},t.gzip=!0,ih(e,t)}vs.Deflate=Qo,vs.deflate=ih,vs.deflateRaw=j$,vs.gzip=$$;var ks={},Gn={},jc=30,F$=12,L$=function(t,n){var r,o,i,a,s,l,c,u,d,f,h,p,m,v,w,b,x,_,C,N,R,T,M,D,A;r=t.state,o=t.next_in,D=t.input,i=o+(t.avail_in-5),a=t.next_out,A=t.output,s=a-(n-t.avail_out),l=a+(t.avail_out-257),c=r.dmax,u=r.wsize,d=r.whave,f=r.wnext,h=r.window,p=r.hold,m=r.bits,v=r.lencode,w=r.distcode,b=(1<<r.lenbits)-1,x=(1<<r.distbits)-1;e:do{m<15&&(p+=D[o++]<<m,m+=8,p+=D[o++]<<m,m+=8),_=v[p&b];t:for(;;){if(C=_>>>24,p>>>=C,m-=C,C=_>>>16&255,C===0)A[a++]=_&65535;else if(C&16){N=_&65535,C&=15,C&&(m<C&&(p+=D[o++]<<m,m+=8),N+=p&(1<<C)-1,p>>>=C,m-=C),m<15&&(p+=D[o++]<<m,m+=8,p+=D[o++]<<m,m+=8),_=w[p&x];n:for(;;){if(C=_>>>24,p>>>=C,m-=C,C=_>>>16&255,C&16){if(R=_&65535,C&=15,m<C&&(p+=D[o++]<<m,m+=8,m<C&&(p+=D[o++]<<m,m+=8)),R+=p&(1<<C)-1,R>c){t.msg="invalid distance too far back",r.mode=jc;break e}if(p>>>=C,m-=C,C=a-s,R>C){if(C=R-C,C>d&&r.sane){t.msg="invalid distance too far back",r.mode=jc;break e}if(T=0,M=h,f===0){if(T+=u-C,C<N){N-=C;do A[a++]=h[T++];while(--C);T=a-R,M=A}}else if(f<C){if(T+=u+f-C,C-=f,C<N){N-=C;do A[a++]=h[T++];while(--C);if(T=0,f<N){C=f,N-=C;do A[a++]=h[T++];while(--C);T=a-R,M=A}}}else if(T+=f-C,C<N){N-=C;do A[a++]=h[T++];while(--C);T=a-R,M=A}for(;N>2;)A[a++]=M[T++],A[a++]=M[T++],A[a++]=M[T++],N-=3;N&&(A[a++]=M[T++],N>1&&(A[a++]=M[T++]))}else{T=a-R;do A[a++]=A[T++],A[a++]=A[T++],A[a++]=A[T++],N-=3;while(N>2);N&&(A[a++]=A[T++],N>1&&(A[a++]=A[T++]))}}else if(C&64){t.msg="invalid distance code",r.mode=jc;break e}else{_=w[(_&65535)+(p&(1<<C)-1)];continue n}break}}else if(C&64)if(C&32){r.mode=F$;break e}else{t.msg="invalid literal/length code",r.mode=jc;break e}else{_=v[(_&65535)+(p&(1<<C)-1)];continue t}break}}while(o<i&&a<l);N=m>>3,o-=N,m-=N<<3,p&=(1<<m)-1,t.next_in=o,t.next_out=a,t.avail_in=o<i?5+(i-o):5-(o-i),t.avail_out=a<l?257+(l-a):257-(a-l),r.hold=p,r.bits=m},x0=zr,Vi=15,_0=852,S0=592,C0=0,ah=1,E0=2,z$=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],B$=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],H$=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],V$=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],U$=function(t,n,r,o,i,a,s,l){var c=l.bits,u=0,d=0,f=0,h=0,p=0,m=0,v=0,w=0,b=0,x=0,_,C,N,R,T,M=null,D=0,A,j=new x0.Buf16(Vi+1),$=new x0.Buf16(Vi+1),W=null,re=0,Y,Z,B;for(u=0;u<=Vi;u++)j[u]=0;for(d=0;d<o;d++)j[n[r+d]]++;for(p=c,h=Vi;h>=1&&j[h]===0;h--);if(p>h&&(p=h),h===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,l.bits=1,0;for(f=1;f<h&&j[f]===0;f++);for(p<f&&(p=f),w=1,u=1;u<=Vi;u++)if(w<<=1,w-=j[u],w<0)return-1;if(w>0&&(t===C0||h!==1))return-1;for($[1]=0,u=1;u<Vi;u++)$[u+1]=$[u]+j[u];for(d=0;d<o;d++)n[r+d]!==0&&(s[$[n[r+d]]++]=d);if(t===C0?(M=W=s,A=19):t===ah?(M=z$,D-=257,W=B$,re-=257,A=256):(M=H$,W=V$,A=-1),x=0,d=0,u=f,T=a,m=p,v=0,N=-1,b=1<<p,R=b-1,t===ah&&b>_0||t===E0&&b>S0)return 1;for(;;){Y=u-v,s[d]<A?(Z=0,B=s[d]):s[d]>A?(Z=W[re+s[d]],B=M[D+s[d]]):(Z=96,B=0),_=1<<u-v,C=1<<m,f=C;do C-=_,i[T+(x>>v)+C]=Y<<24|Z<<16|B|0;while(C!==0);for(_=1<<u-1;x&_;)_>>=1;if(_!==0?(x&=_-1,x+=_):x=0,d++,--j[u]===0){if(u===h)break;u=n[r+s[d]]}if(u>p&&(x&R)!==N){for(v===0&&(v=p),T+=f,m=u-v,w=1<<m;m+v<h&&(w-=j[m+v],!(w<=0));)m++,w<<=1;if(b+=1<<m,t===ah&&b>_0||t===E0&&b>S0)return 1;N=x&R,i[N]=p<<24|m<<16|T-a|0}}return x!==0&&(i[T+x]=u-v<<24|64<<16|0),l.bits=p,0},Cn=zr,sh=o0,vr=i0,W$=L$,Ds=U$,G$=0,P0=1,R0=2,N0=4,q$=5,$c=6,ei=0,Y$=1,K$=2,Ln=-2,T0=-3,M0=-4,X$=-5,k0=8,D0=1,A0=2,I0=3,O0=4,j0=5,$0=6,F0=7,L0=8,z0=9,B0=10,Fc=11,Hr=12,lh=13,H0=14,ch=15,V0=16,U0=17,W0=18,G0=19,Lc=20,zc=21,q0=22,Y0=23,K0=24,X0=25,Z0=26,uh=27,J0=28,Q0=29,ht=30,eb=31,Z$=32,J$=852,Q$=592,eF=15,tF=eF;function tb(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function nF(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Cn.Buf16(320),this.work=new Cn.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function nb(e){var t;return!e||!e.state?Ln:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=D0,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Cn.Buf32(J$),t.distcode=t.distdyn=new Cn.Buf32(Q$),t.sane=1,t.back=-1,ei)}function rb(e){var t;return!e||!e.state?Ln:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,nb(e))}function ob(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Ln:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,rb(e))}function ib(e,t){var n,r;return e?(r=new nF,e.state=r,r.window=null,n=ob(e,t),n!==ei&&(e.state=null),n):Ln}function rF(e){return ib(e,tF)}var ab=!0,dh,fh;function oF(e){if(ab){var t;for(dh=new Cn.Buf32(512),fh=new Cn.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ds(P0,e.lens,0,288,dh,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ds(R0,e.lens,0,32,fh,0,e.work,{bits:5}),ab=!1}e.lencode=dh,e.lenbits=9,e.distcode=fh,e.distbits=5}function sb(e,t,n,r){var o,i=e.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Cn.Buf8(i.wsize)),r>=i.wsize?(Cn.arraySet(i.window,t,n-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>r&&(o=r),Cn.arraySet(i.window,t,n-r,o,i.wnext),r-=o,r?(Cn.arraySet(i.window,t,n-r,r,0),i.wnext=r,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=o))),0}function iF(e,t){var n,r,o,i,a,s,l,c,u,d,f,h,p,m,v=0,w,b,x,_,C,N,R,T,M=new Cn.Buf8(4),D,A,j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Ln;n=e.state,n.mode===Hr&&(n.mode=lh),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,r=e.input,s=e.avail_in,c=n.hold,u=n.bits,d=s,f=l,T=ei;e:for(;;)switch(n.mode){case D0:if(n.wrap===0){n.mode=lh;break}for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(n.wrap&2&&c===35615){n.check=0,M[0]=c&255,M[1]=c>>>8&255,n.check=vr(n.check,M,2,0),c=0,u=0,n.mode=A0;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=ht;break}if((c&15)!==k0){e.msg="unknown compression method",n.mode=ht;break}if(c>>>=4,u-=4,R=(c&15)+8,n.wbits===0)n.wbits=R;else if(R>n.wbits){e.msg="invalid window size",n.mode=ht;break}n.dmax=1<<R,e.adler=n.check=1,n.mode=c&512?B0:Hr,c=0,u=0;break;case A0:for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(n.flags=c,(n.flags&255)!==k0){e.msg="unknown compression method",n.mode=ht;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=ht;break}n.head&&(n.head.text=c>>8&1),n.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,n.check=vr(n.check,M,2,0)),c=0,u=0,n.mode=I0;case I0:for(;u<32;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.head&&(n.head.time=c),n.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,M[2]=c>>>16&255,M[3]=c>>>24&255,n.check=vr(n.check,M,4,0)),c=0,u=0,n.mode=O0;case O0:for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.head&&(n.head.xflags=c&255,n.head.os=c>>8),n.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,n.check=vr(n.check,M,2,0)),c=0,u=0,n.mode=j0;case j0:if(n.flags&1024){for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.length=c,n.head&&(n.head.extra_len=c),n.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,n.check=vr(n.check,M,2,0)),c=0,u=0}else n.head&&(n.head.extra=null);n.mode=$0;case $0:if(n.flags&1024&&(h=n.length,h>s&&(h=s),h&&(n.head&&(R=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),Cn.arraySet(n.head.extra,r,i,h,R)),n.flags&512&&(n.check=vr(n.check,r,h,i)),s-=h,i+=h,n.length-=h),n.length))break e;n.length=0,n.mode=F0;case F0:if(n.flags&2048){if(s===0)break e;h=0;do R=r[i+h++],n.head&&R&&n.length<65536&&(n.head.name+=String.fromCharCode(R));while(R&&h<s);if(n.flags&512&&(n.check=vr(n.check,r,h,i)),s-=h,i+=h,R)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=L0;case L0:if(n.flags&4096){if(s===0)break e;h=0;do R=r[i+h++],n.head&&R&&n.length<65536&&(n.head.comment+=String.fromCharCode(R));while(R&&h<s);if(n.flags&512&&(n.check=vr(n.check,r,h,i)),s-=h,i+=h,R)break e}else n.head&&(n.head.comment=null);n.mode=z0;case z0:if(n.flags&512){for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(c!==(n.check&65535)){e.msg="header crc mismatch",n.mode=ht;break}c=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Hr;break;case B0:for(;u<32;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}e.adler=n.check=tb(c),c=0,u=0,n.mode=Fc;case Fc:if(n.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,K$;e.adler=n.check=1,n.mode=Hr;case Hr:if(t===q$||t===$c)break e;case lh:if(n.last){c>>>=u&7,u-=u&7,n.mode=uh;break}for(;u<3;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}switch(n.last=c&1,c>>>=1,u-=1,c&3){case 0:n.mode=H0;break;case 1:if(oF(n),n.mode=Lc,t===$c){c>>>=2,u-=2;break e}break;case 2:n.mode=U0;break;case 3:e.msg="invalid block type",n.mode=ht}c>>>=2,u-=2;break;case H0:for(c>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=ht;break}if(n.length=c&65535,c=0,u=0,n.mode=ch,t===$c)break e;case ch:n.mode=V0;case V0:if(h=n.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;Cn.arraySet(o,r,i,h,a),s-=h,i+=h,l-=h,a+=h,n.length-=h;break}n.mode=Hr;break;case U0:for(;u<14;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(n.nlen=(c&31)+257,c>>>=5,u-=5,n.ndist=(c&31)+1,c>>>=5,u-=5,n.ncode=(c&15)+4,c>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=ht;break}n.have=0,n.mode=W0;case W0:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.lens[j[n.have++]]=c&7,c>>>=3,u-=3}for(;n.have<19;)n.lens[j[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,D={bits:n.lenbits},T=Ds(G$,n.lens,0,19,n.lencode,0,n.work,D),n.lenbits=D.bits,T){e.msg="invalid code lengths set",n.mode=ht;break}n.have=0,n.mode=G0;case G0:for(;n.have<n.nlen+n.ndist;){for(;v=n.lencode[c&(1<<n.lenbits)-1],w=v>>>24,b=v>>>16&255,x=v&65535,!(w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(x<16)c>>>=w,u-=w,n.lens[n.have++]=x;else{if(x===16){for(A=w+2;u<A;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(c>>>=w,u-=w,n.have===0){e.msg="invalid bit length repeat",n.mode=ht;break}R=n.lens[n.have-1],h=3+(c&3),c>>>=2,u-=2}else if(x===17){for(A=w+3;u<A;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}c>>>=w,u-=w,R=0,h=3+(c&7),c>>>=3,u-=3}else{for(A=w+7;u<A;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}c>>>=w,u-=w,R=0,h=11+(c&127),c>>>=7,u-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=ht;break}for(;h--;)n.lens[n.have++]=R}}if(n.mode===ht)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=ht;break}if(n.lenbits=9,D={bits:n.lenbits},T=Ds(P0,n.lens,0,n.nlen,n.lencode,0,n.work,D),n.lenbits=D.bits,T){e.msg="invalid literal/lengths set",n.mode=ht;break}if(n.distbits=6,n.distcode=n.distdyn,D={bits:n.distbits},T=Ds(R0,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,D),n.distbits=D.bits,T){e.msg="invalid distances set",n.mode=ht;break}if(n.mode=Lc,t===$c)break e;case Lc:n.mode=zc;case zc:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,W$(e,f),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,r=e.input,s=e.avail_in,c=n.hold,u=n.bits,n.mode===Hr&&(n.back=-1);break}for(n.back=0;v=n.lencode[c&(1<<n.lenbits)-1],w=v>>>24,b=v>>>16&255,x=v&65535,!(w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(b&&!(b&240)){for(_=w,C=b,N=x;v=n.lencode[N+((c&(1<<_+C)-1)>>_)],w=v>>>24,b=v>>>16&255,x=v&65535,!(_+w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}c>>>=_,u-=_,n.back+=_}if(c>>>=w,u-=w,n.back+=w,n.length=x,b===0){n.mode=Z0;break}if(b&32){n.back=-1,n.mode=Hr;break}if(b&64){e.msg="invalid literal/length code",n.mode=ht;break}n.extra=b&15,n.mode=q0;case q0:if(n.extra){for(A=n.extra;u<A;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Y0;case Y0:for(;v=n.distcode[c&(1<<n.distbits)-1],w=v>>>24,b=v>>>16&255,x=v&65535,!(w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(!(b&240)){for(_=w,C=b,N=x;v=n.distcode[N+((c&(1<<_+C)-1)>>_)],w=v>>>24,b=v>>>16&255,x=v&65535,!(_+w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}c>>>=_,u-=_,n.back+=_}if(c>>>=w,u-=w,n.back+=w,b&64){e.msg="invalid distance code",n.mode=ht;break}n.offset=x,n.extra=b&15,n.mode=K0;case K0:if(n.extra){for(A=n.extra;u<A;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=ht;break}n.mode=X0;case X0:if(l===0)break e;if(h=f-l,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=ht;break}h>n.wnext?(h-=n.wnext,p=n.wsize-h):p=n.wnext-h,h>n.length&&(h=n.length),m=n.window}else m=o,p=a-n.offset,h=n.length;h>l&&(h=l),l-=h,n.length-=h;do o[a++]=m[p++];while(--h);n.length===0&&(n.mode=zc);break;case Z0:if(l===0)break e;o[a++]=n.length,l--,n.mode=zc;break;case uh:if(n.wrap){for(;u<32;){if(s===0)break e;s--,c|=r[i++]<<u,u+=8}if(f-=l,e.total_out+=f,n.total+=f,f&&(e.adler=n.check=n.flags?vr(n.check,o,f,a-f):sh(n.check,o,f,a-f)),f=l,(n.flags?c:tb(c))!==n.check){e.msg="incorrect data check",n.mode=ht;break}c=0,u=0}n.mode=J0;case J0:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(c!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=ht;break}c=0,u=0}n.mode=Q0;case Q0:T=Y$;break e;case ht:T=T0;break e;case eb:return M0;case Z$:default:return Ln}return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,(n.wsize||f!==e.avail_out&&n.mode<ht&&(n.mode<uh||t!==N0))&&sb(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&&f&&(e.adler=n.check=n.flags?vr(n.check,o,f,e.next_out-f):sh(n.check,o,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Hr?128:0)+(n.mode===Lc||n.mode===ch?256:0),(d===0&&f===0||t===N0)&&T===ei&&(T=X$),T}function aF(e){if(!e||!e.state)return Ln;var t=e.state;return t.window&&(t.window=null),e.state=null,ei}function sF(e,t){var n;return!e||!e.state||(n=e.state,!(n.wrap&2))?Ln:(n.head=t,t.done=!1,ei)}function lF(e,t){var n=t.length,r,o,i;return!e||!e.state||(r=e.state,r.wrap!==0&&r.mode!==Fc)?Ln:r.mode===Fc&&(o=1,o=sh(o,t,n,0),o!==r.check)?T0:(i=sb(e,t,n,n),i?(r.mode=eb,M0):(r.havedict=1,ei))}Gn.inflateReset=rb,Gn.inflateReset2=ob,Gn.inflateResetKeep=nb,Gn.inflateInit=rF,Gn.inflateInit2=ib,Gn.inflate=iF,Gn.inflateEnd=aF,Gn.inflateGetHeader=sF,Gn.inflateSetDictionary=lF,Gn.inflateInfo="pako inflate (from Nodeca project)";var lb={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};function cF(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var uF=cF,Ui=Gn,As=zr,Bc=Jo,_t=lb,hh=Zf,dF=w0,fF=uF,cb=Object.prototype.toString;function ti(e){if(!(this instanceof ti))return new ti(e);this.options=As.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new dF,this.strm.avail_out=0;var n=Ui.inflateInit2(this.strm,t.windowBits);if(n!==_t.Z_OK)throw new Error(hh[n]);if(this.header=new fF,Ui.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Bc.string2buf(t.dictionary):cb.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Ui.inflateSetDictionary(this.strm,t.dictionary),n!==_t.Z_OK)))throw new Error(hh[n])}ti.prototype.push=function(e,t){var n=this.strm,r=this.options.chunkSize,o=this.options.dictionary,i,a,s,l,c,u=!1;if(this.ended)return!1;a=t===~~t?t:t===!0?_t.Z_FINISH:_t.Z_NO_FLUSH,typeof e=="string"?n.input=Bc.binstring2buf(e):cb.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new As.Buf8(r),n.next_out=0,n.avail_out=r),i=Ui.inflate(n,_t.Z_NO_FLUSH),i===_t.Z_NEED_DICT&&o&&(i=Ui.inflateSetDictionary(this.strm,o)),i===_t.Z_BUF_ERROR&&u===!0&&(i=_t.Z_OK,u=!1),i!==_t.Z_STREAM_END&&i!==_t.Z_OK)return this.onEnd(i),this.ended=!0,!1;n.next_out&&(n.avail_out===0||i===_t.Z_STREAM_END||n.avail_in===0&&(a===_t.Z_FINISH||a===_t.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=Bc.utf8border(n.output,n.next_out),l=n.next_out-s,c=Bc.buf2string(n.output,s),n.next_out=l,n.avail_out=r-l,l&&As.arraySet(n.output,n.output,s,l,0),this.onData(c)):this.onData(As.shrinkBuf(n.output,n.next_out))),n.avail_in===0&&n.avail_out===0&&(u=!0)}while((n.avail_in>0||n.avail_out===0)&&i!==_t.Z_STREAM_END);return i===_t.Z_STREAM_END&&(a=_t.Z_FINISH),a===_t.Z_FINISH?(i=Ui.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===_t.Z_OK):(a===_t.Z_SYNC_FLUSH&&(this.onEnd(_t.Z_OK),n.avail_out=0),!0)},ti.prototype.onData=function(e){this.chunks.push(e)},ti.prototype.onEnd=function(e){e===_t.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=As.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function ph(e,t){var n=new ti(t);if(n.push(e,!0),n.err)throw n.msg||hh[n.err];return n.result}function hF(e,t){return t=t||{},t.raw=!0,ph(e,t)}ks.Inflate=ti,ks.inflate=ph,ks.inflateRaw=hF,ks.ungzip=ph;var pF=zr.assign,mF=vs,gF=ks,wF=lb,ub={};pF(ub,mF,gF,wF);var vF=ub;const mh=On(vF),db=(e,t)=>function(...n){const r=t.promiseModule;return new r((o,i)=>{t.multiArgs?n.push((...a)=>{t.errorFirst?a[0]?i(a):(a.shift(),o(a)):o(a)}):t.errorFirst?n.push((a,s)=>{a?i(a):o(s)}):n.push(o),e.apply(this,n)})};var yF=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const n=typeof e;if(!(e!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":n}\``);const r=i=>{const a=s=>typeof s=="string"?i===s:s.test(i);return t.include?t.include.some(a):!t.exclude.some(a)};let o;n==="function"?o=function(...i){return t.excludeMain?e(...i):db(e,t).apply(this,i)}:o=Object.create(Object.getPrototypeOf(e));for(const i in e){const a=e[i];o[i]=typeof a=="function"&&r(i)?db(a,t):a}return o};const gh=On(yF);function fb(e){return Array.isArray(e)?e:[e]}const wh="",hb=" ",vh="\\",bF=/^\s+$/,xF=/(?:[^\\]|^)\\$/,_F=/^\\!/,SF=/^\\#/,CF=/\r?\n/g,EF=/^\.*\/|^\.+$/,yh="/";let pb="node-ignore";typeof Symbol<"u"&&(pb=Symbol.for("node-ignore"));const mb=pb,PF=(e,t,n)=>Object.defineProperty(e,t,{value:n}),RF=/([0-z])-([0-z])/g,gb=()=>!1,NF=e=>e.replace(RF,(t,n,r)=>n.charCodeAt(0)<=r.charCodeAt(0)?t:wh),TF=e=>{const{length:t}=e;return e.slice(0,t-t%2)},MF=[[/^\uFEFF/,()=>wh],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf("\\")===0?hb:wh)],[/(\\+?)\s/g,(e,t)=>{const{length:n}=t;return t.slice(0,n-n%2)+hb}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>{const r=n.replace(/\\\*/g,"[^\\/]*");return t+r}],[/\\\\\\(?=[$.|*+(){^])/g,()=>vh],[/\\\\/g,()=>vh],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,o)=>t===vh?`\\[${n}${TF(r)}${o}`:o==="]"&&r.length%2===0?`[${NF(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`]],wb=Object.create(null),kF=(e,t)=>{let n=wb[e];return n||(n=MF.reduce((r,[o,i])=>r.replace(o,i.bind(e)),e),wb[e]=n),t?new RegExp(n,"i"):new RegExp(n)},bh=e=>typeof e=="string",DF=e=>e&&bh(e)&&!bF.test(e)&&!xF.test(e)&&e.indexOf("#")!==0,AF=e=>e.split(CF);let IF=class{constructor(t,n,r,o){this.origin=t,this.pattern=n,this.negative=r,this.regex=o}};const OF=(e,t)=>{const n=e;let r=!1;e.indexOf("!")===0&&(r=!0,e=e.substr(1)),e=e.replace(_F,"!").replace(SF,"#");const o=kF(e,t);return new IF(n,e,r,o)},jF=(e,t)=>{throw new t(e)},Vr=(e,t,n)=>bh(e)?e?Vr.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n("path must not be empty",TypeError):n(`path must be a string, but got \`${t}\``,TypeError),vb=e=>EF.test(e);Vr.isNotRelative=vb,Vr.convert=e=>e;let $F=class{constructor({ignorecase:t=!0,ignoreCase:n=t,allowRelativePaths:r=!1}={}){PF(this,mb,!0),this._rules=[],this._ignoreCase=n,this._allowRelativePaths=r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[mb]){this._rules=this._rules.concat(t._rules),this._added=!0;return}if(DF(t)){const n=OF(t,this._ignoreCase);this._added=!0,this._rules.push(n)}}add(t){return this._added=!1,fb(bh(t)?AF(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,n){let r=!1,o=!1;return this._rules.forEach(i=>{const{negative:a}=i;if(o===a&&r!==o||a&&!r&&!o&&!n)return;i.regex.test(t)&&(r=!a,o=a)}),{ignored:r,unignored:o}}_test(t,n,r,o){const i=t&&Vr.convert(t);return Vr(i,t,this._allowRelativePaths?gb:jF),this._t(i,n,r,o)}_t(t,n,r,o){if(t in n)return n[t];if(o||(o=t.split(yh)),o.pop(),!o.length)return n[t]=this._testOne(t,r);const i=this._t(o.join(yh)+yh,n,r,o);return n[t]=i.ignored?i:this._testOne(t,r)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return fb(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}};const Hc=e=>new $F(e),FF=e=>Vr(e&&Vr.convert(e),e,gb);Hc.isPathValid=FF,Hc.default=Hc;var LF=Hc;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){const e=n=>/^\\\\\?\\/.test(n)||/["<>|\u0000-\u001F]+/u.test(n)?n:n.replace(/\\/g,"/");Vr.convert=e;const t=/^[a-z]:\//i;Vr.isNotRelative=n=>t.test(n)||vb(n)}const zF=On(LF);function BF(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yr(e,t,n){return t=t instanceof RegExp?t:new RegExp(BF(t),"g"),e.replace(t,n)}var HF={clean:function(t){if(typeof t!="string")throw new Error("Expected a string, received: "+t);return t=yr(t,"./","/"),t=yr(t,"..","."),t=yr(t," ","-"),t=yr(t,/^[~^:?*\\\-]/g,""),t=yr(t,/[~^:?*\\]/g,"-"),t=yr(t,/[~^:?*\\\-]$/g,""),t=yr(t,"@{","-"),t=yr(t,/\.$/g,""),t=yr(t,/\/$/g,""),t=yr(t,/\.lock$/g,""),t}},VF=HF;const br=On(VF);var UF=function(e,t){var n=e,r=t,o=n.length,i=r.length,a=!1,s=null,l=o+1,c=[],u=[],d=[],f="",h=-1,p=0,m=1,v,w,b=function(){o>=i&&(v=n,w=o,n=r,r=v,o=i,i=w,a=!0,l=o+1)},x=function(R,T,M){return{x:R,y:T,k:M}},_=function(R,T){return{elem:R,t:T}},C=function(R,T,M){var D,A,j;for(T>M?D=c[R-1+l]:D=c[R+1+l],j=Math.max(T,M),A=j-R;A<o&&j<i&&n[A]===r[j];)++A,++j;return c[R+l]=u.length,u[u.length]=new x(A,j,D),j},N=function(R){var T,M,D;for(T=M=0,D=R.length-1;D>=0;--D)for(;T<R[D].x||M<R[D].y;)R[D].y-R[D].x>M-T?(a?d[d.length]=new _(r[M],h):d[d.length]=new _(r[M],m),++M):R[D].y-R[D].x<M-T?(a?d[d.length]=new _(n[T],m):d[d.length]=new _(n[T],h),++T):(d[d.length]=new _(n[T],p),f+=n[T],++T,++M)};return b(),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:function(){return s},getlcs:function(){return f},getses:function(){return d},compose:function(){var R,T,M,D,A,j,$,W;for(R=i-o,T=o+i+3,M={},$=0;$<T;++$)M[$]=-1,c[$]=-1;D=-1;do{for(++D,W=-D;W<=R-1;++W)M[W+l]=C(W,M[W-1+l]+1,M[W+1+l]);for(W=R+D;W>=R+1;--W)M[W+l]=C(W,M[W-1+l]+1,M[W+1+l]);M[R+l]=C(R,M[R-1+l]+1,M[R+1+l])}while(M[R+l]!==i);for(s=R+2*D,A=c[R+l],j=[];A!==-1;)j[j.length]=new x(u[A].x,u[A].y,null),A=u[A].k;N(j)}}},WF=UF;function GF(e,t){var n=new WF(e,t);n.compose();for(var r=n.getses(),o,i,a=e.length-1,s=t.length-1,l=r.length-1;l>=0;--l)r[l].t===n.SES_COMMON?(i?(i.chain={file1index:a,file2index:s,chain:null},i=i.chain):(o={file1index:a,file2index:s,chain:null},i=o),a--,s--):r[l].t===n.SES_DELETE?a--:r[l].t===n.SES_ADD&&s--;var c={file1index:-1,file2index:-1,chain:null};return i?(i.chain=c,o):c}function yb(e,t){for(var n=[],r=e.length,o=t.length,i=GF(e,t);i!==null;i=i.chain){var a=r-i.file1index-1,s=o-i.file2index-1;r=i.file1index,o=i.file2index,(a||s)&&n.push({file1:[r+1,a],file2:[o+1,s]})}return n.reverse(),n}function qF(e,t,n){var r,o=yb(t,e),i=yb(t,n),a=[];function s($,W){a.push([$.file1[0],W,$.file1[1],$.file2[0],$.file2[1]])}for(r=0;r<o.length;r++)s(o[r],0);for(r=0;r<i.length;r++)s(i[r],2);a.sort(function($,W){return $[0]-W[0]});var l=[],c=0;function u($){$>c&&(l.push([1,c,$-c]),c=$)}for(var d=0;d<a.length;d++){for(var f=d,h=a[d],p=h[0],m=p+h[2];d<a.length-1;){var v=a[d+1],w=v[0];if(w>m)break;m=Math.max(m,w+v[2]),d++}if(u(p),f==d)h[4]>0&&l.push([h[1],h[3],h[4]]);else{var b={0:[e.length,-1,t.length,-1],2:[n.length,-1,t.length,-1]};for(r=f;r<=d;r++){h=a[r];var x=h[1],_=b[x],C=h[0],N=C+h[2],R=h[3],T=R+h[4];_[0]=Math.min(R,_[0]),_[1]=Math.max(T,_[1]),_[2]=Math.min(C,_[2]),_[3]=Math.max(N,_[3])}var M=b[0][0]+(p-b[0][2]),D=b[0][1]+(m-b[0][3]),A=b[2][0]+(p-b[2][2]),j=b[2][1]+(m-b[2][3]);l.push([-1,M,D-M,p,m-p,A,j-A])}c=m}return u(t.length),l}function YF(e,t,n){var r=[],o=[e,t,n],i=qF(e,t,n),a=[];function s(){a.length&&r.push({ok:a}),a=[]}function l(h){for(var p=0;p<h.length;p++)a.push(h[p])}function c(h){if(h[2]!=h[6])return!0;for(var p=h[1],m=h[5],v=0;v<h[2];v++)if(e[v+p]!=n[v+m])return!0;return!1}for(var u=0;u<i.length;u++){var d=i[u],f=d[0];f==-1?c(d)?(s(),r.push({conflict:{a:e.slice(d[1],d[1]+d[2]),aIndex:d[1],o:t.slice(d[3],d[3]+d[4]),oIndex:d[3],b:n.slice(d[5],d[5]+d[6]),bIndex:d[5]}})):l(o[0].slice(d[1],d[1]+d[2])):l(o[f].slice(d[1],d[1]+d[2]))}return s(),r}var KF=YF;const XF=On(KF);class Ye extends Error{constructor(t){super(t),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(t){const n=new Ye(t.message);return n.code=t.code,n.data=t.data,n.caller=t.caller,n.stack=t.stack,n}get isIsomorphicGitError(){return!0}}class Is extends Ye{constructor(t){super(`Modifying the index is not possible because you have unmerged files: ${t.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=Is.code,this.data={filepaths:t}}}Is.code="UnmergedPathsError";class je extends Ye{constructor(t){super(`An internal error caused this command to fail. Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${t}`),this.code=this.name=je.code,this.data={message:t}}}je.code="InternalError";class Wi extends Ye{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=Wi.code,this.data={filepath:t}}}Wi.code="UnsafeFilepathError";class xr{constructor(t){this.buffer=t,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(t){this._start=t}slice(t){const n=this.buffer.slice(this._start,this._start+t);return this._start+=t,n}toString(t,n){const r=this.buffer.toString(t,this._start,this._start+n);return this._start+=n,r}write(t,n,r){const o=this.buffer.write(t,this._start,n,r);return this._start+=n,o}copy(t,n,r){const o=t.copy(this.buffer,this._start,n,r);return this._start+=o,o}readUInt8(){const t=this.buffer.readUInt8(this._start);return this._start+=1,t}writeUInt8(t){const n=this.buffer.writeUInt8(t,this._start);return this._start+=1,n}readUInt16BE(){const t=this.buffer.readUInt16BE(this._start);return this._start+=2,t}writeUInt16BE(t){const n=this.buffer.writeUInt16BE(t,this._start);return this._start+=2,n}readUInt32BE(){const t=this.buffer.readUInt32BE(this._start);return this._start+=4,t}writeUInt32BE(t){const n=this.buffer.writeUInt32BE(t,this._start);return this._start+=4,n}}function Vc(e,t){return-(e<t)||+(e>t)}function bb(e,t){return Vc(e.path,t.path)}function xb(e){let t=e>0?e>>12:0;t!==4&&t!==8&&t!==10&&t!==14&&(t=8);let n=e&511;return n&73?n=493:n=420,t!==8&&(n=0),(t<<12)+n}const _r=2**32;function _b(e,t,n,r){if(e!==void 0&&t!==void 0)return[e,t];n===void 0&&(n=r.valueOf());const o=Math.floor(n/1e3),i=(n-o*1e3)*1e6;return[o,i]}function Gi(e){const[t,n]=_b(e.ctimeSeconds,e.ctimeNanoseconds,e.ctimeMs,e.ctime),[r,o]=_b(e.mtimeSeconds,e.mtimeNanoseconds,e.mtimeMs,e.mtime);return{ctimeSeconds:t%_r,ctimeNanoseconds:n%_r,mtimeSeconds:r%_r,mtimeNanoseconds:o%_r,dev:e.dev%_r,ino:e.ino%_r,mode:xb(e.mode%_r),uid:e.uid%_r,gid:e.gid%_r,size:e.size>-1?e.size%_r:0}}function ZF(e){let t="";for(const n of new Uint8Array(e))n<16&&(t+="0"),t+=n.toString(16);return t}let xh=null;async function Ur(e){return xh===null&&(xh=await QF()),xh?Sb(e):JF(e)}function JF(e){return new Ay().update(e).digest("hex")}async function Sb(e){const t=await crypto.subtle.digest("SHA-1",e);return ZF(t)}async function QF(){try{if(await Sb(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709")return!0}catch{}return!1}function eL(e){return{assumeValid:!!(e&32768),extended:!!(e&16384),stage:(e&12288)>>12,nameLength:e&4095}}function tL(e){const t=e.flags;return t.extended=!1,t.nameLength=Math.min(Buffer.from(e.path).length,4095),(t.assumeValid?32768:0)+(t.extended?16384:0)+((t.stage&3)<<12)+(t.nameLength&4095)}class ni{constructor(t,n){this._dirty=!1,this._unmergedPaths=n||new Set,this._entries=t||new Map}_addEntry(t){if(t.flags.stage===0)t.stages=[t],this._entries.set(t.path,t),this._unmergedPaths.delete(t.path);else{let n=this._entries.get(t.path);n||(this._entries.set(t.path,t),n=t),n.stages[t.flags.stage]=t,this._unmergedPaths.add(t.path)}}static async from(t){if(Buffer.isBuffer(t))return ni.fromBuffer(t);if(t===null)return new ni(null);throw new je("invalid type passed to GitIndex.from")}static async fromBuffer(t){if(t.length===0)throw new je("Index file is empty (.git/index)");const n=new ni,r=new xr(t),o=r.toString("utf8",4);if(o!=="DIRC")throw new je(`Invalid dircache magic file number: ${o}`);const i=await Ur(t.slice(0,-20)),a=t.slice(-20).toString("hex");if(a!==i)throw new je(`Invalid checksum in GitIndex buffer: expected ${a} but saw ${i}`);const s=r.readUInt32BE();if(s!==2)throw new je(`Unsupported dircache version: ${s}`);const l=r.readUInt32BE();let c=0;for(;!r.eof()&&c<l;){const u={};u.ctimeSeconds=r.readUInt32BE(),u.ctimeNanoseconds=r.readUInt32BE(),u.mtimeSeconds=r.readUInt32BE(),u.mtimeNanoseconds=r.readUInt32BE(),u.dev=r.readUInt32BE(),u.ino=r.readUInt32BE(),u.mode=r.readUInt32BE(),u.uid=r.readUInt32BE(),u.gid=r.readUInt32BE(),u.size=r.readUInt32BE(),u.oid=r.slice(20).toString("hex");const d=r.readUInt16BE();u.flags=eL(d);const f=t.indexOf(0,r.tell()+1)-r.tell();if(f<1)throw new je(`Got a path length of: ${f}`);if(u.path=r.toString("utf8",f),u.path.includes("..\\")||u.path.includes("../"))throw new Wi(u.path);let h=8-(r.tell()-12)%8;for(h===0&&(h=8);h--;){const p=r.readUInt8();if(p!==0)throw new je(`Expected 1-8 null characters but got '${p}' after ${u.path}`);if(r.eof())throw new je("Unexpected end of file")}u.stages=[],n._addEntry(u),c++}return n}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(bb)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(t=>t.stages.length>1?t.stages.filter(n=>n):t)}*[Symbol.iterator](){for(const t of this.entries)yield t}insert({filepath:t,stats:n,oid:r,stage:o=0}){n||(n={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),n=Gi(n);const i=Buffer.from(t),a={ctimeSeconds:n.ctimeSeconds,ctimeNanoseconds:n.ctimeNanoseconds,mtimeSeconds:n.mtimeSeconds,mtimeNanoseconds:n.mtimeNanoseconds,dev:n.dev,ino:n.ino,mode:n.mode||33188,uid:n.uid,gid:n.gid,size:n.size,path:t,oid:r,flags:{assumeValid:!1,extended:!1,stage:o,nameLength:i.length<4095?i.length:4095},stages:[]};this._addEntry(a),this._dirty=!0}delete({filepath:t}){if(this._entries.has(t))this._entries.delete(t);else for(const n of this._entries.keys())n.startsWith(t+"/")&&this._entries.delete(n);this._unmergedPaths.has(t)&&this._unmergedPaths.delete(t),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:t}){return this._entries.has(t)}render(){return this.entries.map(t=>`${t.mode.toString(8)} ${t.oid} ${t.path}`).join(`
|
|
9
|
+
*/(function(e){const t=Ec,n=$f,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o,s.TYPED_ARRAY_SUPPORT=i(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{const k=new Uint8Array(1),S={foo:function(){return 42}};return Object.setPrototypeOf(S,Uint8Array.prototype),Object.setPrototypeOf(k,S),k.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function a(k){if(k>o)throw new RangeError('The value "'+k+'" is invalid for option "size"');const S=new Uint8Array(k);return Object.setPrototypeOf(S,s.prototype),S}function s(k,S,P){if(typeof k=="number"){if(typeof S=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(k)}return l(k,S,P)}s.poolSize=8192;function l(k,S,P){if(typeof k=="string")return f(k,S);if(ArrayBuffer.isView(k))return p(k);if(k==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k);if(pe(k,ArrayBuffer)||k&&pe(k.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(pe(k,SharedArrayBuffer)||k&&pe(k.buffer,SharedArrayBuffer)))return m(k,S,P);if(typeof k=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const I=k.valueOf&&k.valueOf();if(I!=null&&I!==k)return s.from(I,S,P);const U=v(k);if(U)return U;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof k[Symbol.toPrimitive]=="function")return s.from(k[Symbol.toPrimitive]("string"),S,P);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k)}s.from=function(k,S,P){return l(k,S,P)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(k){if(typeof k!="number")throw new TypeError('"size" argument must be of type number');if(k<0)throw new RangeError('The value "'+k+'" is invalid for option "size"')}function u(k,S,P){return c(k),k<=0?a(k):S!==void 0?typeof P=="string"?a(k).fill(S,P):a(k).fill(S):a(k)}s.alloc=function(k,S,P){return u(k,S,P)};function d(k){return c(k),a(k<0?0:w(k)|0)}s.allocUnsafe=function(k){return d(k)},s.allocUnsafeSlow=function(k){return d(k)};function f(k,S){if((typeof S!="string"||S==="")&&(S="utf8"),!s.isEncoding(S))throw new TypeError("Unknown encoding: "+S);const P=x(k,S)|0;let I=a(P);const U=I.write(k,S);return U!==P&&(I=I.slice(0,U)),I}function h(k){const S=k.length<0?0:w(k.length)|0,P=a(S);for(let I=0;I<S;I+=1)P[I]=k[I]&255;return P}function p(k){if(pe(k,Uint8Array)){const S=new Uint8Array(k);return m(S.buffer,S.byteOffset,S.byteLength)}return h(k)}function m(k,S,P){if(S<0||k.byteLength<S)throw new RangeError('"offset" is outside of buffer bounds');if(k.byteLength<S+(P||0))throw new RangeError('"length" is outside of buffer bounds');let I;return S===void 0&&P===void 0?I=new Uint8Array(k):P===void 0?I=new Uint8Array(k,S):I=new Uint8Array(k,S,P),Object.setPrototypeOf(I,s.prototype),I}function v(k){if(s.isBuffer(k)){const S=w(k.length)|0,P=a(S);return P.length===0||k.copy(P,0,0,S),P}if(k.length!==void 0)return typeof k.length!="number"||fe(k.length)?a(0):h(k);if(k.type==="Buffer"&&Array.isArray(k.data))return h(k.data)}function w(k){if(k>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return k|0}function b(k){return+k!=k&&(k=0),s.alloc(+k)}s.isBuffer=function(S){return S!=null&&S._isBuffer===!0&&S!==s.prototype},s.compare=function(S,P){if(pe(S,Uint8Array)&&(S=s.from(S,S.offset,S.byteLength)),pe(P,Uint8Array)&&(P=s.from(P,P.offset,P.byteLength)),!s.isBuffer(S)||!s.isBuffer(P))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(S===P)return 0;let I=S.length,U=P.length;for(let te=0,he=Math.min(I,U);te<he;++te)if(S[te]!==P[te]){I=S[te],U=P[te];break}return I<U?-1:U<I?1:0},s.isEncoding=function(S){switch(String(S).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(S,P){if(!Array.isArray(S))throw new TypeError('"list" argument must be an Array of Buffers');if(S.length===0)return s.alloc(0);let I;if(P===void 0)for(P=0,I=0;I<S.length;++I)P+=S[I].length;const U=s.allocUnsafe(P);let te=0;for(I=0;I<S.length;++I){let he=S[I];if(pe(he,Uint8Array))te+he.length>U.length?(s.isBuffer(he)||(he=s.from(he)),he.copy(U,te)):Uint8Array.prototype.set.call(U,he,te);else if(s.isBuffer(he))he.copy(U,te);else throw new TypeError('"list" argument must be an Array of Buffers');te+=he.length}return U};function x(k,S){if(s.isBuffer(k))return k.length;if(ArrayBuffer.isView(k)||pe(k,ArrayBuffer))return k.byteLength;if(typeof k!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof k);const P=k.length,I=arguments.length>2&&arguments[2]===!0;if(!I&&P===0)return 0;let U=!1;for(;;)switch(S){case"ascii":case"latin1":case"binary":return P;case"utf8":case"utf-8":return xe(k).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P*2;case"hex":return P>>>1;case"base64":return J(k).length;default:if(U)return I?-1:xe(k).length;S=(""+S).toLowerCase(),U=!0}}s.byteLength=x;function _(k,S,P){let I=!1;if((S===void 0||S<0)&&(S=0),S>this.length||((P===void 0||P>this.length)&&(P=this.length),P<=0)||(P>>>=0,S>>>=0,P<=S))return"";for(k||(k="utf8");;)switch(k){case"hex":return oe(this,S,P);case"utf8":case"utf-8":return W(this,S,P);case"ascii":return Z(this,S,P);case"latin1":case"binary":return B(this,S,P);case"base64":return $(this,S,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee(this,S,P);default:if(I)throw new TypeError("Unknown encoding: "+k);k=(k+"").toLowerCase(),I=!0}}s.prototype._isBuffer=!0;function C(k,S,P){const I=k[S];k[S]=k[P],k[P]=I}s.prototype.swap16=function(){const S=this.length;if(S%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let P=0;P<S;P+=2)C(this,P,P+1);return this},s.prototype.swap32=function(){const S=this.length;if(S%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let P=0;P<S;P+=4)C(this,P,P+3),C(this,P+1,P+2);return this},s.prototype.swap64=function(){const S=this.length;if(S%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let P=0;P<S;P+=8)C(this,P,P+7),C(this,P+1,P+6),C(this,P+2,P+5),C(this,P+3,P+4);return this},s.prototype.toString=function(){const S=this.length;return S===0?"":arguments.length===0?W(this,0,S):_.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(S){if(!s.isBuffer(S))throw new TypeError("Argument must be a Buffer");return this===S?!0:s.compare(this,S)===0},s.prototype.inspect=function(){let S="";const P=e.INSPECT_MAX_BYTES;return S=this.toString("hex",0,P).replace(/(.{2})/g,"$1 ").trim(),this.length>P&&(S+=" ... "),"<Buffer "+S+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(S,P,I,U,te){if(pe(S,Uint8Array)&&(S=s.from(S,S.offset,S.byteLength)),!s.isBuffer(S))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof S);if(P===void 0&&(P=0),I===void 0&&(I=S?S.length:0),U===void 0&&(U=0),te===void 0&&(te=this.length),P<0||I>S.length||U<0||te>this.length)throw new RangeError("out of range index");if(U>=te&&P>=I)return 0;if(U>=te)return-1;if(P>=I)return 1;if(P>>>=0,I>>>=0,U>>>=0,te>>>=0,this===S)return 0;let he=te-U,Oe=I-P;const Qe=Math.min(he,Oe),nt=this.slice(U,te),st=S.slice(P,I);for(let We=0;We<Qe;++We)if(nt[We]!==st[We]){he=nt[We],Oe=st[We];break}return he<Oe?-1:Oe<he?1:0};function N(k,S,P,I,U){if(k.length===0)return-1;if(typeof P=="string"?(I=P,P=0):P>2147483647?P=2147483647:P<-2147483648&&(P=-2147483648),P=+P,fe(P)&&(P=U?0:k.length-1),P<0&&(P=k.length+P),P>=k.length){if(U)return-1;P=k.length-1}else if(P<0)if(U)P=0;else return-1;if(typeof S=="string"&&(S=s.from(S,I)),s.isBuffer(S))return S.length===0?-1:R(k,S,P,I,U);if(typeof S=="number")return S=S&255,typeof Uint8Array.prototype.indexOf=="function"?U?Uint8Array.prototype.indexOf.call(k,S,P):Uint8Array.prototype.lastIndexOf.call(k,S,P):R(k,[S],P,I,U);throw new TypeError("val must be string, number or Buffer")}function R(k,S,P,I,U){let te=1,he=k.length,Oe=S.length;if(I!==void 0&&(I=String(I).toLowerCase(),I==="ucs2"||I==="ucs-2"||I==="utf16le"||I==="utf-16le")){if(k.length<2||S.length<2)return-1;te=2,he/=2,Oe/=2,P/=2}function Qe(st,We){return te===1?st[We]:st.readUInt16BE(We*te)}let nt;if(U){let st=-1;for(nt=P;nt<he;nt++)if(Qe(k,nt)===Qe(S,st===-1?0:nt-st)){if(st===-1&&(st=nt),nt-st+1===Oe)return st*te}else st!==-1&&(nt-=nt-st),st=-1}else for(P+Oe>he&&(P=he-Oe),nt=P;nt>=0;nt--){let st=!0;for(let We=0;We<Oe;We++)if(Qe(k,nt+We)!==Qe(S,We)){st=!1;break}if(st)return nt}return-1}s.prototype.includes=function(S,P,I){return this.indexOf(S,P,I)!==-1},s.prototype.indexOf=function(S,P,I){return N(this,S,P,I,!0)},s.prototype.lastIndexOf=function(S,P,I){return N(this,S,P,I,!1)};function T(k,S,P,I){P=Number(P)||0;const U=k.length-P;I?(I=Number(I),I>U&&(I=U)):I=U;const te=S.length;I>te/2&&(I=te/2);let he;for(he=0;he<I;++he){const Oe=parseInt(S.substr(he*2,2),16);if(fe(Oe))return he;k[P+he]=Oe}return he}function M(k,S,P,I){return we(xe(S,k.length-P),k,P,I)}function D(k,S,P,I){return we(j(S),k,P,I)}function A(k,S,P,I){return we(J(S),k,P,I)}function O(k,S,P,I){return we(V(S,k.length-P),k,P,I)}s.prototype.write=function(S,P,I,U){if(P===void 0)U="utf8",I=this.length,P=0;else if(I===void 0&&typeof P=="string")U=P,I=this.length,P=0;else if(isFinite(P))P=P>>>0,isFinite(I)?(I=I>>>0,U===void 0&&(U="utf8")):(U=I,I=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const te=this.length-P;if((I===void 0||I>te)&&(I=te),S.length>0&&(I<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let he=!1;for(;;)switch(U){case"hex":return T(this,S,P,I);case"utf8":case"utf-8":return M(this,S,P,I);case"ascii":case"latin1":case"binary":return D(this,S,P,I);case"base64":return A(this,S,P,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,S,P,I);default:if(he)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),he=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(k,S,P){return S===0&&P===k.length?t.fromByteArray(k):t.fromByteArray(k.slice(S,P))}function W(k,S,P){P=Math.min(k.length,P);const I=[];let U=S;for(;U<P;){const te=k[U];let he=null,Oe=te>239?4:te>223?3:te>191?2:1;if(U+Oe<=P){let Qe,nt,st,We;switch(Oe){case 1:te<128&&(he=te);break;case 2:Qe=k[U+1],(Qe&192)===128&&(We=(te&31)<<6|Qe&63,We>127&&(he=We));break;case 3:Qe=k[U+1],nt=k[U+2],(Qe&192)===128&&(nt&192)===128&&(We=(te&15)<<12|(Qe&63)<<6|nt&63,We>2047&&(We<55296||We>57343)&&(he=We));break;case 4:Qe=k[U+1],nt=k[U+2],st=k[U+3],(Qe&192)===128&&(nt&192)===128&&(st&192)===128&&(We=(te&15)<<18|(Qe&63)<<12|(nt&63)<<6|st&63,We>65535&&We<1114112&&(he=We))}}he===null?(he=65533,Oe=1):he>65535&&(he-=65536,I.push(he>>>10&1023|55296),he=56320|he&1023),I.push(he),U+=Oe}return Y(I)}const re=4096;function Y(k){const S=k.length;if(S<=re)return String.fromCharCode.apply(String,k);let P="",I=0;for(;I<S;)P+=String.fromCharCode.apply(String,k.slice(I,I+=re));return P}function Z(k,S,P){let I="";P=Math.min(k.length,P);for(let U=S;U<P;++U)I+=String.fromCharCode(k[U]&127);return I}function B(k,S,P){let I="";P=Math.min(k.length,P);for(let U=S;U<P;++U)I+=String.fromCharCode(k[U]);return I}function oe(k,S,P){const I=k.length;(!S||S<0)&&(S=0),(!P||P<0||P>I)&&(P=I);let U="";for(let te=S;te<P;++te)U+=ge[k[te]];return U}function ee(k,S,P){const I=k.slice(S,P);let U="";for(let te=0;te<I.length-1;te+=2)U+=String.fromCharCode(I[te]+I[te+1]*256);return U}s.prototype.slice=function(S,P){const I=this.length;S=~~S,P=P===void 0?I:~~P,S<0?(S+=I,S<0&&(S=0)):S>I&&(S=I),P<0?(P+=I,P<0&&(P=0)):P>I&&(P=I),P<S&&(P=S);const U=this.subarray(S,P);return Object.setPrototypeOf(U,s.prototype),U};function ne(k,S,P){if(k%1!==0||k<0)throw new RangeError("offset is not uint");if(k+S>P)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(S,P,I){S=S>>>0,P=P>>>0,I||ne(S,P,this.length);let U=this[S],te=1,he=0;for(;++he<P&&(te*=256);)U+=this[S+he]*te;return U},s.prototype.readUintBE=s.prototype.readUIntBE=function(S,P,I){S=S>>>0,P=P>>>0,I||ne(S,P,this.length);let U=this[S+--P],te=1;for(;P>0&&(te*=256);)U+=this[S+--P]*te;return U},s.prototype.readUint8=s.prototype.readUInt8=function(S,P){return S=S>>>0,P||ne(S,1,this.length),this[S]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(S,P){return S=S>>>0,P||ne(S,2,this.length),this[S]|this[S+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(S,P){return S=S>>>0,P||ne(S,2,this.length),this[S]<<8|this[S+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(S,P){return S=S>>>0,P||ne(S,4,this.length),(this[S]|this[S+1]<<8|this[S+2]<<16)+this[S+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(S,P){return S=S>>>0,P||ne(S,4,this.length),this[S]*16777216+(this[S+1]<<16|this[S+2]<<8|this[S+3])},s.prototype.readBigUInt64LE=_e(function(S){S=S>>>0,ue(S,"offset");const P=this[S],I=this[S+7];(P===void 0||I===void 0)&&se(S,this.length-8);const U=P+this[++S]*2**8+this[++S]*2**16+this[++S]*2**24,te=this[++S]+this[++S]*2**8+this[++S]*2**16+I*2**24;return BigInt(U)+(BigInt(te)<<BigInt(32))}),s.prototype.readBigUInt64BE=_e(function(S){S=S>>>0,ue(S,"offset");const P=this[S],I=this[S+7];(P===void 0||I===void 0)&&se(S,this.length-8);const U=P*2**24+this[++S]*2**16+this[++S]*2**8+this[++S],te=this[++S]*2**24+this[++S]*2**16+this[++S]*2**8+I;return(BigInt(U)<<BigInt(32))+BigInt(te)}),s.prototype.readIntLE=function(S,P,I){S=S>>>0,P=P>>>0,I||ne(S,P,this.length);let U=this[S],te=1,he=0;for(;++he<P&&(te*=256);)U+=this[S+he]*te;return te*=128,U>=te&&(U-=Math.pow(2,8*P)),U},s.prototype.readIntBE=function(S,P,I){S=S>>>0,P=P>>>0,I||ne(S,P,this.length);let U=P,te=1,he=this[S+--U];for(;U>0&&(te*=256);)he+=this[S+--U]*te;return te*=128,he>=te&&(he-=Math.pow(2,8*P)),he},s.prototype.readInt8=function(S,P){return S=S>>>0,P||ne(S,1,this.length),this[S]&128?(255-this[S]+1)*-1:this[S]},s.prototype.readInt16LE=function(S,P){S=S>>>0,P||ne(S,2,this.length);const I=this[S]|this[S+1]<<8;return I&32768?I|4294901760:I},s.prototype.readInt16BE=function(S,P){S=S>>>0,P||ne(S,2,this.length);const I=this[S+1]|this[S]<<8;return I&32768?I|4294901760:I},s.prototype.readInt32LE=function(S,P){return S=S>>>0,P||ne(S,4,this.length),this[S]|this[S+1]<<8|this[S+2]<<16|this[S+3]<<24},s.prototype.readInt32BE=function(S,P){return S=S>>>0,P||ne(S,4,this.length),this[S]<<24|this[S+1]<<16|this[S+2]<<8|this[S+3]},s.prototype.readBigInt64LE=_e(function(S){S=S>>>0,ue(S,"offset");const P=this[S],I=this[S+7];(P===void 0||I===void 0)&&se(S,this.length-8);const U=this[S+4]+this[S+5]*2**8+this[S+6]*2**16+(I<<24);return(BigInt(U)<<BigInt(32))+BigInt(P+this[++S]*2**8+this[++S]*2**16+this[++S]*2**24)}),s.prototype.readBigInt64BE=_e(function(S){S=S>>>0,ue(S,"offset");const P=this[S],I=this[S+7];(P===void 0||I===void 0)&&se(S,this.length-8);const U=(P<<24)+this[++S]*2**16+this[++S]*2**8+this[++S];return(BigInt(U)<<BigInt(32))+BigInt(this[++S]*2**24+this[++S]*2**16+this[++S]*2**8+I)}),s.prototype.readFloatLE=function(S,P){return S=S>>>0,P||ne(S,4,this.length),n.read(this,S,!0,23,4)},s.prototype.readFloatBE=function(S,P){return S=S>>>0,P||ne(S,4,this.length),n.read(this,S,!1,23,4)},s.prototype.readDoubleLE=function(S,P){return S=S>>>0,P||ne(S,8,this.length),n.read(this,S,!0,52,8)},s.prototype.readDoubleBE=function(S,P){return S=S>>>0,P||ne(S,8,this.length),n.read(this,S,!1,52,8)};function G(k,S,P,I,U,te){if(!s.isBuffer(k))throw new TypeError('"buffer" argument must be a Buffer instance');if(S>U||S<te)throw new RangeError('"value" argument is out of bounds');if(P+I>k.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(S,P,I,U){if(S=+S,P=P>>>0,I=I>>>0,!U){const Oe=Math.pow(2,8*I)-1;G(this,S,P,I,Oe,0)}let te=1,he=0;for(this[P]=S&255;++he<I&&(te*=256);)this[P+he]=S/te&255;return P+I},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(S,P,I,U){if(S=+S,P=P>>>0,I=I>>>0,!U){const Oe=Math.pow(2,8*I)-1;G(this,S,P,I,Oe,0)}let te=I-1,he=1;for(this[P+te]=S&255;--te>=0&&(he*=256);)this[P+te]=S/he&255;return P+I},s.prototype.writeUint8=s.prototype.writeUInt8=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,1,255,0),this[P]=S&255,P+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,2,65535,0),this[P]=S&255,this[P+1]=S>>>8,P+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,2,65535,0),this[P]=S>>>8,this[P+1]=S&255,P+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,4,4294967295,0),this[P+3]=S>>>24,this[P+2]=S>>>16,this[P+1]=S>>>8,this[P]=S&255,P+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,4,4294967295,0),this[P]=S>>>24,this[P+1]=S>>>16,this[P+2]=S>>>8,this[P+3]=S&255,P+4};function F(k,S,P,I,U){H(S,I,U,k,P,7);let te=Number(S&BigInt(4294967295));k[P++]=te,te=te>>8,k[P++]=te,te=te>>8,k[P++]=te,te=te>>8,k[P++]=te;let he=Number(S>>BigInt(32)&BigInt(4294967295));return k[P++]=he,he=he>>8,k[P++]=he,he=he>>8,k[P++]=he,he=he>>8,k[P++]=he,P}function q(k,S,P,I,U){H(S,I,U,k,P,7);let te=Number(S&BigInt(4294967295));k[P+7]=te,te=te>>8,k[P+6]=te,te=te>>8,k[P+5]=te,te=te>>8,k[P+4]=te;let he=Number(S>>BigInt(32)&BigInt(4294967295));return k[P+3]=he,he=he>>8,k[P+2]=he,he=he>>8,k[P+1]=he,he=he>>8,k[P]=he,P+8}s.prototype.writeBigUInt64LE=_e(function(S,P=0){return F(this,S,P,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=_e(function(S,P=0){return q(this,S,P,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(S,P,I,U){if(S=+S,P=P>>>0,!U){const Qe=Math.pow(2,8*I-1);G(this,S,P,I,Qe-1,-Qe)}let te=0,he=1,Oe=0;for(this[P]=S&255;++te<I&&(he*=256);)S<0&&Oe===0&&this[P+te-1]!==0&&(Oe=1),this[P+te]=(S/he>>0)-Oe&255;return P+I},s.prototype.writeIntBE=function(S,P,I,U){if(S=+S,P=P>>>0,!U){const Qe=Math.pow(2,8*I-1);G(this,S,P,I,Qe-1,-Qe)}let te=I-1,he=1,Oe=0;for(this[P+te]=S&255;--te>=0&&(he*=256);)S<0&&Oe===0&&this[P+te+1]!==0&&(Oe=1),this[P+te]=(S/he>>0)-Oe&255;return P+I},s.prototype.writeInt8=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,1,127,-128),S<0&&(S=255+S+1),this[P]=S&255,P+1},s.prototype.writeInt16LE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,2,32767,-32768),this[P]=S&255,this[P+1]=S>>>8,P+2},s.prototype.writeInt16BE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,2,32767,-32768),this[P]=S>>>8,this[P+1]=S&255,P+2},s.prototype.writeInt32LE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,4,2147483647,-2147483648),this[P]=S&255,this[P+1]=S>>>8,this[P+2]=S>>>16,this[P+3]=S>>>24,P+4},s.prototype.writeInt32BE=function(S,P,I){return S=+S,P=P>>>0,I||G(this,S,P,4,2147483647,-2147483648),S<0&&(S=4294967295+S+1),this[P]=S>>>24,this[P+1]=S>>>16,this[P+2]=S>>>8,this[P+3]=S&255,P+4},s.prototype.writeBigInt64LE=_e(function(S,P=0){return F(this,S,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=_e(function(S,P=0){return q(this,S,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ce(k,S,P,I,U,te){if(P+I>k.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("Index out of range")}function L(k,S,P,I,U){return S=+S,P=P>>>0,U||ce(k,S,P,4),n.write(k,S,P,I,23,4),P+4}s.prototype.writeFloatLE=function(S,P,I){return L(this,S,P,!0,I)},s.prototype.writeFloatBE=function(S,P,I){return L(this,S,P,!1,I)};function K(k,S,P,I,U){return S=+S,P=P>>>0,U||ce(k,S,P,8),n.write(k,S,P,I,52,8),P+8}s.prototype.writeDoubleLE=function(S,P,I){return K(this,S,P,!0,I)},s.prototype.writeDoubleBE=function(S,P,I){return K(this,S,P,!1,I)},s.prototype.copy=function(S,P,I,U){if(!s.isBuffer(S))throw new TypeError("argument should be a Buffer");if(I||(I=0),!U&&U!==0&&(U=this.length),P>=S.length&&(P=S.length),P||(P=0),U>0&&U<I&&(U=I),U===I||S.length===0||this.length===0)return 0;if(P<0)throw new RangeError("targetStart out of bounds");if(I<0||I>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),S.length-P<U-I&&(U=S.length-P+I);const te=U-I;return this===S&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(P,I,U):Uint8Array.prototype.set.call(S,this.subarray(I,U),P),te},s.prototype.fill=function(S,P,I,U){if(typeof S=="string"){if(typeof P=="string"?(U=P,P=0,I=this.length):typeof I=="string"&&(U=I,I=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!s.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(S.length===1){const he=S.charCodeAt(0);(U==="utf8"&&he<128||U==="latin1")&&(S=he)}}else typeof S=="number"?S=S&255:typeof S=="boolean"&&(S=Number(S));if(P<0||this.length<P||this.length<I)throw new RangeError("Out of range index");if(I<=P)return this;P=P>>>0,I=I===void 0?this.length:I>>>0,S||(S=0);let te;if(typeof S=="number")for(te=P;te<I;++te)this[te]=S;else{const he=s.isBuffer(S)?S:s.from(S,U),Oe=he.length;if(Oe===0)throw new TypeError('The value "'+S+'" is invalid for argument "value"');for(te=0;te<I-P;++te)this[te+P]=he[te%Oe]}return this};const z={};function ie(k,S,P){z[k]=class extends P{constructor(){super(),Object.defineProperty(this,"message",{value:S.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${k}]`,this.stack,delete this.name}get code(){return k}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${k}]: ${this.message}`}}}ie("ERR_BUFFER_OUT_OF_BOUNDS",function(k){return k?`${k} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ie("ERR_INVALID_ARG_TYPE",function(k,S){return`The "${k}" argument must be of type number. Received type ${typeof S}`},TypeError),ie("ERR_OUT_OF_RANGE",function(k,S,P){let I=`The value of "${k}" is out of range.`,U=P;return Number.isInteger(P)&&Math.abs(P)>2**32?U=le(String(P)):typeof P=="bigint"&&(U=String(P),(P>BigInt(2)**BigInt(32)||P<-(BigInt(2)**BigInt(32)))&&(U=le(U)),U+="n"),I+=` It must be ${S}. Received ${U}`,I},RangeError);function le(k){let S="",P=k.length;const I=k[0]==="-"?1:0;for(;P>=I+4;P-=3)S=`_${k.slice(P-3,P)}${S}`;return`${k.slice(0,P)}${S}`}function ae(k,S,P){ue(S,"offset"),(k[S]===void 0||k[S+P]===void 0)&&se(S,k.length-(P+1))}function H(k,S,P,I,U,te){if(k>P||k<S){const he=typeof S=="bigint"?"n":"";let Oe;throw S===0||S===BigInt(0)?Oe=`>= 0${he} and < 2${he} ** ${(te+1)*8}${he}`:Oe=`>= -(2${he} ** ${(te+1)*8-1}${he}) and < 2 ** ${(te+1)*8-1}${he}`,new z.ERR_OUT_OF_RANGE("value",Oe,k)}ae(I,U,te)}function ue(k,S){if(typeof k!="number")throw new z.ERR_INVALID_ARG_TYPE(S,"number",k)}function se(k,S,P){throw Math.floor(k)!==k?(ue(k,P),new z.ERR_OUT_OF_RANGE("offset","an integer",k)):S<0?new z.ERR_BUFFER_OUT_OF_BOUNDS:new z.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${S}`,k)}const ye=/[^+/0-9A-Za-z-_]/g;function Ce(k){if(k=k.split("=")[0],k=k.trim().replace(ye,""),k.length<2)return"";for(;k.length%4!==0;)k=k+"=";return k}function xe(k,S){S=S||1/0;let P;const I=k.length;let U=null;const te=[];for(let he=0;he<I;++he){if(P=k.charCodeAt(he),P>55295&&P<57344){if(!U){if(P>56319){(S-=3)>-1&&te.push(239,191,189);continue}else if(he+1===I){(S-=3)>-1&&te.push(239,191,189);continue}U=P;continue}if(P<56320){(S-=3)>-1&&te.push(239,191,189),U=P;continue}P=(U-55296<<10|P-56320)+65536}else U&&(S-=3)>-1&&te.push(239,191,189);if(U=null,P<128){if((S-=1)<0)break;te.push(P)}else if(P<2048){if((S-=2)<0)break;te.push(P>>6|192,P&63|128)}else if(P<65536){if((S-=3)<0)break;te.push(P>>12|224,P>>6&63|128,P&63|128)}else if(P<1114112){if((S-=4)<0)break;te.push(P>>18|240,P>>12&63|128,P>>6&63|128,P&63|128)}else throw new Error("Invalid code point")}return te}function j(k){const S=[];for(let P=0;P<k.length;++P)S.push(k.charCodeAt(P)&255);return S}function V(k,S){let P,I,U;const te=[];for(let he=0;he<k.length&&!((S-=2)<0);++he)P=k.charCodeAt(he),I=P>>8,U=P%256,te.push(U),te.push(I);return te}function J(k){return t.toByteArray(Ce(k))}function we(k,S,P,I){let U;for(U=0;U<I&&!(U+P>=S.length||U>=k.length);++U)S[U+P]=k[U];return U}function pe(k,S){return k instanceof S||k!=null&&k.constructor!=null&&k.constructor.name!=null&&k.constructor.name===S.name}function fe(k){return k!==k}const ge=function(){const k="0123456789abcdef",S=new Array(256);for(let P=0;P<16;++P){const I=P*16;for(let U=0;U<16;++U)S[I+U]=k[P]+k[U]}return S}();function _e(k){return typeof BigInt>"u"?Xe:k}function Xe(){throw new Error("BigInt not supported")}})(Of);function a2(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function s2(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:a2(e)}async function l2(e,t){const n=s2(e);for(;;){const{value:r,done:o}=await n.next();if(r&&await t(r),o)break}n.return&&n.return()}async function c2(e){let t=0;const n=[];await l2(e,i=>{n.push(i),t+=i.byteLength});const r=new Uint8Array(t);let o=0;for(const i of n)r.set(i,o),o+=i.byteLength;return r}function u2(e){if(e[Symbol.asyncIterator])return e;const t=e.getReader();return{next(){return t.read()},return(){return t.releaseLock(),{}},[Symbol.asyncIterator](){return this}}}async function d2({onProgress:e,url:t,method:n="GET",headers:r={},body:o}){o&&(o=await c2(o));const i=await fetch(t,{method:n,headers:r,body:o}),a=i.body&&i.body.getReader?u2(i.body):[new Uint8Array(await i.arrayBuffer())];r={};for(const[s,l]of i.headers.entries())r[s]=l;return{url:i.url,method:i.method,statusCode:i.status,statusMessage:i.statusText,body:a,headers:r}}var Ff={request:d2},Sn=function(e){if(e=e||{},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(typeof process>"u"||typeof process.domain>"u")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||Sn.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||Sn.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||Sn.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=Sn.DEFAULT_MAX_PENDING};Sn.DEFAULT_TIMEOUT=0,Sn.DEFAULT_MAX_OCCUPATION_TIME=0,Sn.DEFAULT_MAX_EXECUTION_TIME=0,Sn.DEFAULT_MAX_PENDING=1e3,Sn.prototype.acquire=function(e,t,n,r){if(Array.isArray(e))return this._acquireBatch(e,t,n,r);if(typeof t!="function")throw new Error("You must pass a function to execute");var o=null,i=null,a=null;typeof n!="function"&&(r=n,n=null,a=new this.Promise(function(b,x){o=b,i=x})),r=r||{};var s=!1,l=null,c=null,u=null,d=this,f=function(b,x,_){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),b&&(d.queues[e]&&d.queues[e].length===0&&delete d.queues[e],d.domainReentrant&&delete d.domains[e]),s||(a?x?i(x):o(_):typeof n=="function"&&n(x,_),s=!0),b&&d.queues[e]&&d.queues[e].length>0&&d.queues[e].shift()()},h=function(b){if(s)return f(b);l&&(clearTimeout(l),l=null),d.domainReentrant&&b&&(d.domains[e]=process.domain);var x=r.maxExecutionTime||d.maxExecutionTime;if(x&&(u=setTimeout(function(){d.queues[e]&&f(b,new Error("Maximum execution time is exceeded "+e))},x)),t.length===1){var _=!1;try{t(function(C,N){_||(_=!0,f(b,C,N))})}catch(C){_||(_=!0,f(b,C))}}else d._promiseTry(function(){return t()}).then(function(C){f(b,void 0,C)},function(C){f(b,C)})};d.domainReentrant&&process.domain&&(h=process.domain.bind(h));var p=r.maxPending||d.maxPending;if(!d.queues[e])d.queues[e]=[],h(!0);else if(d.domainReentrant&&process.domain&&process.domain===d.domains[e])h(!1);else if(d.queues[e].length>=p)f(!1,new Error("Too many pending tasks in queue "+e));else{var m=function(){h(!0)};r.skipQueue?d.queues[e].unshift(m):d.queues[e].push(m);var v=r.timeout||d.timeout;v&&(l=setTimeout(function(){l=null,f(!1,new Error("async-lock timed out in queue "+e))},v))}var w=r.maxOccupationTime||d.maxOccupationTime;if(w&&(c=setTimeout(function(){d.queues[e]&&f(!1,new Error("Maximum occupation time is exceeded in queue "+e))},w)),a)return a},Sn.prototype._acquireBatch=function(e,t,n,r){typeof n!="function"&&(r=n,n=null);var o=this,i=function(s,l){return function(c){o.acquire(s,l,c,r)}},a=e.reduceRight(function(s,l){return i(l,s)},t);if(typeof n=="function")a(n);else return new this.Promise(function(s,l){a.length===1?a(function(c,u){c?l(c):s(u)}):s(a())})},Sn.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},Sn.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(t){return this.Promise.reject(t)}};var f2=Sn,h2=f2;const gs=On(h2);var Lf={exports:{}};typeof Object.create=="function"?Lf.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Lf.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}};var p2=Lf.exports,zf={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var n=Of,r=n.Buffer;function o(a,s){for(var l in a)s[l]=a[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=i);function i(a,s,l){return r(a,s,l)}i.prototype=Object.create(r.prototype),o(r,i),i.from=function(a,s,l){if(typeof a=="number")throw new TypeError("Argument must not be a number");return r(a,s,l)},i.alloc=function(a,s,l){if(typeof a!="number")throw new TypeError("Argument must be a number");var c=r(a);return s!==void 0?typeof l=="string"?c.fill(s,l):c.fill(s):c.fill(0),c},i.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r(a)},i.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(a)}})(zf,zf.exports);var My=zf.exports,ky=My.Buffer;function Pc(e,t){this._block=ky.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Pc.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=ky.from(e,t));for(var n=this._block,r=this._blockSize,o=e.length,i=this._len,a=0;a<o;){for(var s=i%r,l=Math.min(o-a,r-s),c=0;c<l;c++)n[s+c]=e[a+c];i+=l,a+=l,i%r===0&&this._update(n)}return this._len+=o,this},Pc.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=this._len*8;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(n&4294967295)>>>0,o=(n-r)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},Pc.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var m2=Pc,g2=p2,Dy=m2,w2=My.Buffer,v2=[1518500249,1859775393,-1894007588,-899497514],y2=new Array(80);function ws(){this.init(),this._w=y2,Dy.call(this,64,56)}g2(ws,Dy),ws.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function b2(e){return e<<1|e>>>31}function x2(e){return e<<5|e>>>27}function _2(e){return e<<30|e>>>2}function S2(e,t,n,r){return e===0?t&n|~t&r:e===2?t&n|t&r|n&r:t^n^r}ws.prototype._update=function(e){for(var t=this._w,n=this._a|0,r=this._b|0,o=this._c|0,i=this._d|0,a=this._e|0,s=0;s<16;++s)t[s]=e.readInt32BE(s*4);for(;s<80;++s)t[s]=b2(t[s-3]^t[s-8]^t[s-14]^t[s-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=x2(n)+S2(c,r,o,i)+a+t[l]+v2[c]|0;a=i,i=o,o=_2(r),r=n,n=u}this._a=n+this._a|0,this._b=r+this._b|0,this._c=o+this._c|0,this._d=i+this._d|0,this._e=a+this._e|0},ws.prototype._hash=function(){var e=w2.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var C2=ws;const Ay=On(C2);function hr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function Iy(e,t){for(var n="",r=0,o=-1,i=0,a,s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){l===-1?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length===2||n.length===1){n="",r=0,o=s,i=0;continue}}t&&(n.length>0?n+="/..":n="..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i!==-1?++i:i=-1}return n}function E2(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+e+r:r}var Oi={resolve:function(){for(var t="",n=!1,r,o=arguments.length-1;o>=-1&&!n;o--){var i;o>=0?i=arguments[o]:(r===void 0&&(r=process.cwd()),i=r),hr(i),i.length!==0&&(t=i+"/"+t,n=i.charCodeAt(0)===47)}return t=Iy(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(hr(t),t.length===0)return".";var n=t.charCodeAt(0)===47,r=t.charCodeAt(t.length-1)===47;return t=Iy(t,!n),t.length===0&&!n&&(t="."),t.length>0&&r&&(t+="/"),n?"/"+t:t},isAbsolute:function(t){return hr(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,n=0;n<arguments.length;++n){var r=arguments[n];hr(r),r.length>0&&(t===void 0?t=r:t+="/"+r)}return t===void 0?".":Oi.normalize(t)},relative:function(t,n){if(hr(t),hr(n),t===n||(t=Oi.resolve(t),n=Oi.resolve(n),t===n))return"";for(var r=1;r<t.length&&t.charCodeAt(r)===47;++r);for(var o=t.length,i=o-r,a=1;a<n.length&&n.charCodeAt(a)===47;++a);for(var s=n.length,l=s-a,c=i<l?i:l,u=-1,d=0;d<=c;++d){if(d===c){if(l>c){if(n.charCodeAt(a+d)===47)return n.slice(a+d+1);if(d===0)return n.slice(a+d)}else i>c&&(t.charCodeAt(r+d)===47?u=d:d===0&&(u=0));break}var f=t.charCodeAt(r+d),h=n.charCodeAt(a+d);if(f!==h)break;f===47&&(u=d)}var p="";for(d=r+u+1;d<=o;++d)(d===o||t.charCodeAt(d)===47)&&(p.length===0?p+="..":p+="/..");return p.length>0?p+n.slice(a+u):(a+=u,n.charCodeAt(a)===47&&++a,n.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(hr(t),t.length===0)return".";for(var n=t.charCodeAt(0),r=n===47,o=-1,i=!0,a=t.length-1;a>=1;--a)if(n=t.charCodeAt(a),n===47){if(!i){o=a;break}}else i=!1;return o===-1?r?"/":".":r&&o===1?"//":t.slice(0,o)},basename:function(t,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');hr(t);var r=0,o=-1,i=!0,a;if(n!==void 0&&n.length>0&&n.length<=t.length){if(n.length===t.length&&n===t)return"";var s=n.length-1,l=-1;for(a=t.length-1;a>=0;--a){var c=t.charCodeAt(a);if(c===47){if(!i){r=a+1;break}}else l===-1&&(i=!1,l=a+1),s>=0&&(c===n.charCodeAt(s)?--s===-1&&(o=a):(s=-1,o=l))}return r===o?o=l:o===-1&&(o=t.length),t.slice(r,o)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!i){r=a+1;break}}else o===-1&&(i=!1,o=a+1);return o===-1?"":t.slice(r,o)}},extname:function(t){hr(t);for(var n=-1,r=0,o=-1,i=!0,a=0,s=t.length-1;s>=0;--s){var l=t.charCodeAt(s);if(l===47){if(!i){r=s+1;break}continue}o===-1&&(i=!1,o=s+1),l===46?n===-1?n=s:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||o===-1||a===0||a===1&&n===o-1&&n===r+1?"":t.slice(n,o)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return E2("/",t)},parse:function(t){hr(t);var n={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return n;var r=t.charCodeAt(0),o=r===47,i;o?(n.root="/",i=1):i=0;for(var a=-1,s=0,l=-1,c=!0,u=t.length-1,d=0;u>=i;--u){if(r=t.charCodeAt(u),r===47){if(!c){s=u+1;break}continue}l===-1&&(c=!1,l=u+1),r===46?a===-1?a=u:d!==1&&(d=1):a!==-1&&(d=-1)}return a===-1||l===-1||d===0||d===1&&a===l-1&&a===s+1?l!==-1&&(s===0&&o?n.base=n.name=t.slice(1,l):n.base=n.name=t.slice(s,l)):(s===0&&o?(n.name=t.slice(1,a),n.base=t.slice(1,l)):(n.name=t.slice(s,a),n.base=t.slice(s,l)),n.ext=t.slice(a,l)),s>0?n.dir=t.slice(0,s-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};Oi.posix=Oi;var me=Oi,Oy={};/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */(function(e){(function(t){t(typeof DO_NOT_EXPORT_CRC>"u"?e:{})})(function(t){t.version="1.2.2";function n(){for(var T=0,M=new Array(256),D=0;D!=256;++D)T=D,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,M[D]=T;return typeof Int32Array<"u"?new Int32Array(M):M}var r=n();function o(T){var M=0,D=0,A=0,O=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(A=0;A!=256;++A)O[A]=T[A];for(A=0;A!=256;++A)for(D=T[A],M=256+A;M<4096;M+=256)D=O[M]=D>>>8^T[D&255];var $=[];for(A=1;A!=16;++A)$[A-1]=typeof Int32Array<"u"?O.subarray(A*256,A*256+256):O.slice(A*256,A*256+256);return $}var i=o(r),a=i[0],s=i[1],l=i[2],c=i[3],u=i[4],d=i[5],f=i[6],h=i[7],p=i[8],m=i[9],v=i[10],w=i[11],b=i[12],x=i[13],_=i[14];function C(T,M){for(var D=M^-1,A=0,O=T.length;A<O;)D=D>>>8^r[(D^T.charCodeAt(A++))&255];return~D}function N(T,M){for(var D=M^-1,A=T.length-15,O=0;O<A;)D=_[T[O++]^D&255]^x[T[O++]^D>>8&255]^b[T[O++]^D>>16&255]^w[T[O++]^D>>>24]^v[T[O++]]^m[T[O++]]^p[T[O++]]^h[T[O++]]^f[T[O++]]^d[T[O++]]^u[T[O++]]^c[T[O++]]^l[T[O++]]^s[T[O++]]^a[T[O++]]^r[T[O++]];for(A+=15;O<A;)D=D>>>8^r[(D^T[O++])&255];return~D}function R(T,M){for(var D=M^-1,A=0,O=T.length,$=0,W=0;A<O;)$=T.charCodeAt(A++),$<128?D=D>>>8^r[(D^$)&255]:$<2048?(D=D>>>8^r[(D^(192|$>>6&31))&255],D=D>>>8^r[(D^(128|$&63))&255]):$>=55296&&$<57344?($=($&1023)+64,W=T.charCodeAt(A++)&1023,D=D>>>8^r[(D^(240|$>>8&7))&255],D=D>>>8^r[(D^(128|$>>2&63))&255],D=D>>>8^r[(D^(128|W>>6&15|($&3)<<4))&255],D=D>>>8^r[(D^(128|W&63))&255]):(D=D>>>8^r[(D^(224|$>>12&15))&255],D=D>>>8^r[(D^(128|$>>6&63))&255],D=D>>>8^r[(D^(128|$&63))&255]);return~D}t.table=r,t.bstr=C,t.buf=N,t.str=R})})(Oy);const P2=On(Oy);var zr={};(function(e){var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function n(i,a){return Object.prototype.hasOwnProperty.call(i,a)}e.assign=function(i){for(var a=Array.prototype.slice.call(arguments,1);a.length;){var s=a.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var l in s)n(s,l)&&(i[l]=s[l])}}return i},e.shrinkBuf=function(i,a){return i.length===a?i:i.subarray?i.subarray(0,a):(i.length=a,i)};var r={arraySet:function(i,a,s,l,c){if(a.subarray&&i.subarray){i.set(a.subarray(s,s+l),c);return}for(var u=0;u<l;u++)i[c+u]=a[s+u]},flattenChunks:function(i){var a,s,l,c,u,d;for(l=0,a=0,s=i.length;a<s;a++)l+=i[a].length;for(d=new Uint8Array(l),c=0,a=0,s=i.length;a<s;a++)u=i[a],d.set(u,c),c+=u.length;return d}},o={arraySet:function(i,a,s,l,c){for(var u=0;u<l;u++)i[c+u]=a[s+u]},flattenChunks:function(i){return[].concat.apply([],i)}};e.setTyped=function(i){i?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,o))},e.setTyped(t)})(zr);var vs={},pr={},ji={},R2=zr,N2=4,jy=0,$y=1,T2=2;function $i(e){for(var t=e.length;--t>=0;)e[t]=0}var M2=0,Fy=1,k2=2,D2=3,A2=258,Bf=29,ys=256,bs=ys+1+Bf,Fi=30,Hf=19,Ly=2*bs+1,qo=15,Vf=16,I2=7,Uf=256,zy=16,By=17,Hy=18,Wf=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Rc=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],O2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Vy=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],j2=512,Br=new Array((bs+2)*2);$i(Br);var xs=new Array(Fi*2);$i(xs);var _s=new Array(j2);$i(_s);var Ss=new Array(A2-D2+1);$i(Ss);var Gf=new Array(Bf);$i(Gf);var Nc=new Array(Fi);$i(Nc);function qf(e,t,n,r,o){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=o,this.has_stree=e&&e.length}var Uy,Wy,Gy;function Yf(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function qy(e){return e<256?_s[e]:_s[256+(e>>>7)]}function Cs(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function ln(e,t,n){e.bi_valid>Vf-n?(e.bi_buf|=t<<e.bi_valid&65535,Cs(e,e.bi_buf),e.bi_buf=t>>Vf-e.bi_valid,e.bi_valid+=n-Vf):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function mr(e,t,n){ln(e,n[t*2],n[t*2+1])}function Yy(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function $2(e){e.bi_valid===16?(Cs(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function F2(e,t){var n=t.dyn_tree,r=t.max_code,o=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,c,u,d,f,h,p,m=0;for(f=0;f<=qo;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<Ly;c++)u=e.heap[c],f=n[n[u*2+1]*2+1]+1,f>l&&(f=l,m++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,h=0,u>=s&&(h=a[u-s]),p=n[u*2],e.opt_len+=p*(f+h),i&&(e.static_len+=p*(o[u*2+1]+h)));if(m!==0){do{for(f=l-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(f=l;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--c],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}}function Ky(e,t,n){var r=new Array(qo+1),o=0,i,a;for(i=1;i<=qo;i++)r[i]=o=o+n[i-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=Yy(r[s]++,s))}}function L2(){var e,t,n,r,o,i=new Array(qo+1);for(n=0,r=0;r<Bf-1;r++)for(Gf[r]=n,e=0;e<1<<Wf[r];e++)Ss[n++]=r;for(Ss[n-1]=r,o=0,r=0;r<16;r++)for(Nc[r]=o,e=0;e<1<<Rc[r];e++)_s[o++]=r;for(o>>=7;r<Fi;r++)for(Nc[r]=o<<7,e=0;e<1<<Rc[r]-7;e++)_s[256+o++]=r;for(t=0;t<=qo;t++)i[t]=0;for(e=0;e<=143;)Br[e*2+1]=8,e++,i[8]++;for(;e<=255;)Br[e*2+1]=9,e++,i[9]++;for(;e<=279;)Br[e*2+1]=7,e++,i[7]++;for(;e<=287;)Br[e*2+1]=8,e++,i[8]++;for(Ky(Br,bs+1,i),e=0;e<Fi;e++)xs[e*2+1]=5,xs[e*2]=Yy(e,5);Uy=new qf(Br,Wf,ys+1,bs,qo),Wy=new qf(xs,Rc,0,Fi,qo),Gy=new qf(new Array(0),O2,0,Hf,I2)}function Xy(e){var t;for(t=0;t<bs;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Fi;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Hf;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Uf*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Zy(e){e.bi_valid>8?Cs(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function z2(e,t,n,r){Zy(e),Cs(e,n),Cs(e,~n),R2.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function Jy(e,t,n,r){var o=t*2,i=n*2;return e[o]<e[i]||e[o]===e[i]&&r[t]<=r[n]}function Kf(e,t,n){for(var r=e.heap[n],o=n<<1;o<=e.heap_len&&(o<e.heap_len&&Jy(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!Jy(t,r,e.heap[o],e.depth));)e.heap[n]=e.heap[o],n=o,o<<=1;e.heap[n]=r}function Qy(e,t,n){var r,o,i=0,a,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+i*2]<<8|e.pending_buf[e.d_buf+i*2+1],o=e.pending_buf[e.l_buf+i],i++,r===0?mr(e,o,t):(a=Ss[o],mr(e,a+ys+1,t),s=Wf[a],s!==0&&(o-=Gf[a],ln(e,o,s)),r--,a=qy(r),mr(e,a,n),s=Rc[a],s!==0&&(r-=Nc[a],ln(e,r,s)));while(i<e.last_lit);mr(e,Uf,t)}function Xf(e,t){var n=t.dyn_tree,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,i=t.stat_desc.elems,a,s,l=-1,c;for(e.heap_len=0,e.heap_max=Ly,a=0;a<i;a++)n[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):n[a*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=l<2?++l:0,n[c*2]=1,e.depth[c]=0,e.opt_len--,o&&(e.static_len-=r[c*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)Kf(e,n,a);c=i;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Kf(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[c*2]=n[a*2]+n[s*2],e.depth[c]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[a*2+1]=n[s*2+1]=c,e.heap[1]=c++,Kf(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],F2(e,t),Ky(n,l,e.bl_count)}function e0(e,t,n){var r,o=-1,i,a=t[0*2+1],s=0,l=7,c=4;for(a===0&&(l=138,c=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)i=a,a=t[(r+1)*2+1],!(++s<l&&i===a)&&(s<c?e.bl_tree[i*2]+=s:i!==0?(i!==o&&e.bl_tree[i*2]++,e.bl_tree[zy*2]++):s<=10?e.bl_tree[By*2]++:e.bl_tree[Hy*2]++,s=0,o=i,a===0?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4))}function t0(e,t,n){var r,o=-1,i,a=t[0*2+1],s=0,l=7,c=4;for(a===0&&(l=138,c=3),r=0;r<=n;r++)if(i=a,a=t[(r+1)*2+1],!(++s<l&&i===a)){if(s<c)do mr(e,i,e.bl_tree);while(--s!==0);else i!==0?(i!==o&&(mr(e,i,e.bl_tree),s--),mr(e,zy,e.bl_tree),ln(e,s-3,2)):s<=10?(mr(e,By,e.bl_tree),ln(e,s-3,3)):(mr(e,Hy,e.bl_tree),ln(e,s-11,7));s=0,o=i,a===0?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4)}}function B2(e){var t;for(e0(e,e.dyn_ltree,e.l_desc.max_code),e0(e,e.dyn_dtree,e.d_desc.max_code),Xf(e,e.bl_desc),t=Hf-1;t>=3&&e.bl_tree[Vy[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function H2(e,t,n,r){var o;for(ln(e,t-257,5),ln(e,n-1,5),ln(e,r-4,4),o=0;o<r;o++)ln(e,e.bl_tree[Vy[o]*2+1],3);t0(e,e.dyn_ltree,t-1),t0(e,e.dyn_dtree,n-1)}function V2(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return jy;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return $y;for(n=32;n<ys;n++)if(e.dyn_ltree[n*2]!==0)return $y;return jy}var n0=!1;function U2(e){n0||(L2(),n0=!0),e.l_desc=new Yf(e.dyn_ltree,Uy),e.d_desc=new Yf(e.dyn_dtree,Wy),e.bl_desc=new Yf(e.bl_tree,Gy),e.bi_buf=0,e.bi_valid=0,Xy(e)}function r0(e,t,n,r){ln(e,(M2<<1)+(r?1:0),3),z2(e,t,n)}function W2(e){ln(e,Fy<<1,3),mr(e,Uf,Br),$2(e)}function G2(e,t,n,r){var o,i,a=0;e.level>0?(e.strm.data_type===T2&&(e.strm.data_type=V2(e)),Xf(e,e.l_desc),Xf(e,e.d_desc),a=B2(e),o=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=o&&(o=i)):o=i=n+5,n+4<=o&&t!==-1?r0(e,t,n,r):e.strategy===N2||i===o?(ln(e,(Fy<<1)+(r?1:0),3),Qy(e,Br,xs)):(ln(e,(k2<<1)+(r?1:0),3),H2(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),Qy(e,e.dyn_ltree,e.dyn_dtree)),Xy(e),r&&Zy(e)}function q2(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Ss[n]+ys+1)*2]++,e.dyn_dtree[qy(t)*2]++),e.last_lit===e.lit_bufsize-1}ji._tr_init=U2,ji._tr_stored_block=r0,ji._tr_flush_block=G2,ji._tr_tally=q2,ji._tr_align=W2;function Y2(e,t,n,r){for(var o=e&65535|0,i=e>>>16&65535|0,a=0;n!==0;){a=n>2e3?2e3:n,n-=a;do o=o+t[r++]|0,i=i+o|0;while(--a);o%=65521,i%=65521}return o|i<<16|0}var o0=Y2;function K2(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var X2=K2();function Z2(e,t,n,r){var o=X2,i=r+n;e^=-1;for(var a=r;a<i;a++)e=e>>>8^o[(e^t[a])&255];return e^-1}var i0=Z2,Zf={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Qt=zr,$n=ji,a0=o0,so=i0,J2=Zf,Yo=0,Q2=1,e$=3,lo=4,s0=5,gr=0,l0=1,Fn=-2,t$=-3,Jf=-5,n$=-1,r$=1,Tc=2,o$=3,i$=4,a$=0,s$=2,Mc=8,l$=9,c$=15,u$=8,d$=29,f$=256,Qf=f$+1+d$,h$=30,p$=19,m$=2*Qf+1,g$=15,Ue=3,co=258,Wn=co+Ue+1,w$=32,kc=42,eh=69,Dc=73,Ac=91,Ic=103,Ko=113,Es=666,Mt=1,Ps=2,Xo=3,Li=4,v$=3;function uo(e,t){return e.msg=J2[t],t}function c0(e){return(e<<1)-(e>4?9:0)}function fo(e){for(var t=e.length;--t>=0;)e[t]=0}function ho(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(Qt.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function Ft(e,t){$n._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ho(e.strm)}function Je(e,t){e.pending_buf[e.pending++]=t}function Rs(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function y$(e,t,n,r){var o=e.avail_in;return o>r&&(o=r),o===0?0:(e.avail_in-=o,Qt.arraySet(t,e.input,e.next_in,o,n),e.state.wrap===1?e.adler=a0(e.adler,t,o,n):e.state.wrap===2&&(e.adler=so(e.adler,t,o,n)),e.next_in+=o,e.total_in+=o,o)}function u0(e,t){var n=e.max_chain_length,r=e.strstart,o,i,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-Wn?e.strstart-(e.w_size-Wn):0,c=e.window,u=e.w_mask,d=e.prev,f=e.strstart+co,h=c[r+a-1],p=c[r+a];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(o=t,!(c[o+a]!==p||c[o+a-1]!==h||c[o]!==c[r]||c[++o]!==c[r+1])){r+=2,o++;do;while(c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&r<f);if(i=co-(f-r),r=f-co,i>a){if(e.match_start=t,a=i,i>=s)break;h=c[r+a-1],p=c[r+a]}}while((t=d[t&u])>l&&--n!==0);return a<=e.lookahead?a:e.lookahead}function Zo(e){var t=e.w_size,n,r,o,i,a;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Wn)){Qt.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do o=e.head[--n],e.head[n]=o>=t?o-t:0;while(--r);r=t,n=r;do o=e.prev[--n],e.prev[n]=o>=t?o-t:0;while(--r);i+=t}if(e.strm.avail_in===0)break;if(r=y$(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=r,e.lookahead+e.insert>=Ue)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+Ue-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<Ue)););}while(e.lookahead<Wn&&e.strm.avail_in!==0)}function b$(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Zo(e),e.lookahead===0&&t===Yo)return Mt;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,Ft(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Wn&&(Ft(e,!1),e.strm.avail_out===0))return Mt}return e.insert=0,t===lo?(Ft(e,!0),e.strm.avail_out===0?Xo:Li):(e.strstart>e.block_start&&(Ft(e,!1),e.strm.avail_out===0),Mt)}function th(e,t){for(var n,r;;){if(e.lookahead<Wn){if(Zo(e),e.lookahead<Wn&&t===Yo)return Mt;if(e.lookahead===0)break}if(n=0,e.lookahead>=Ue&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Ue-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Wn&&(e.match_length=u0(e,n)),e.match_length>=Ue)if(r=$n._tr_tally(e,e.strstart-e.match_start,e.match_length-Ue),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Ue){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Ue-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=$n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Ft(e,!1),e.strm.avail_out===0))return Mt}return e.insert=e.strstart<Ue-1?e.strstart:Ue-1,t===lo?(Ft(e,!0),e.strm.avail_out===0?Xo:Li):e.last_lit&&(Ft(e,!1),e.strm.avail_out===0)?Mt:Ps}function zi(e,t){for(var n,r,o;;){if(e.lookahead<Wn){if(Zo(e),e.lookahead<Wn&&t===Yo)return Mt;if(e.lookahead===0)break}if(n=0,e.lookahead>=Ue&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Ue-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Ue-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Wn&&(e.match_length=u0(e,n),e.match_length<=5&&(e.strategy===r$||e.match_length===Ue&&e.strstart-e.match_start>4096)&&(e.match_length=Ue-1)),e.prev_length>=Ue&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-Ue,r=$n._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-Ue),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Ue-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Ue-1,e.strstart++,r&&(Ft(e,!1),e.strm.avail_out===0))return Mt}else if(e.match_available){if(r=$n._tr_tally(e,0,e.window[e.strstart-1]),r&&Ft(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Mt}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=$n._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Ue-1?e.strstart:Ue-1,t===lo?(Ft(e,!0),e.strm.avail_out===0?Xo:Li):e.last_lit&&(Ft(e,!1),e.strm.avail_out===0)?Mt:Ps}function x$(e,t){for(var n,r,o,i,a=e.window;;){if(e.lookahead<=co){if(Zo(e),e.lookahead<=co&&t===Yo)return Mt;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Ue&&e.strstart>0&&(o=e.strstart-1,r=a[o],r===a[++o]&&r===a[++o]&&r===a[++o])){i=e.strstart+co;do;while(r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&o<i);e.match_length=co-(i-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Ue?(n=$n._tr_tally(e,1,e.match_length-Ue),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=$n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Ft(e,!1),e.strm.avail_out===0))return Mt}return e.insert=0,t===lo?(Ft(e,!0),e.strm.avail_out===0?Xo:Li):e.last_lit&&(Ft(e,!1),e.strm.avail_out===0)?Mt:Ps}function _$(e,t){for(var n;;){if(e.lookahead===0&&(Zo(e),e.lookahead===0)){if(t===Yo)return Mt;break}if(e.match_length=0,n=$n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Ft(e,!1),e.strm.avail_out===0))return Mt}return e.insert=0,t===lo?(Ft(e,!0),e.strm.avail_out===0?Xo:Li):e.last_lit&&(Ft(e,!1),e.strm.avail_out===0)?Mt:Ps}function wr(e,t,n,r,o){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=o}var Bi;Bi=[new wr(0,0,0,0,b$),new wr(4,4,8,4,th),new wr(4,5,16,8,th),new wr(4,6,32,32,th),new wr(4,4,16,16,zi),new wr(8,16,32,32,zi),new wr(8,16,128,128,zi),new wr(8,32,128,256,zi),new wr(32,128,258,1024,zi),new wr(32,258,258,4096,zi)];function S$(e){e.window_size=2*e.w_size,fo(e.head),e.max_lazy_match=Bi[e.level].max_lazy,e.good_match=Bi[e.level].good_length,e.nice_match=Bi[e.level].nice_length,e.max_chain_length=Bi[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Ue-1,e.match_available=0,e.ins_h=0}function C$(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Mc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Qt.Buf16(m$*2),this.dyn_dtree=new Qt.Buf16((2*h$+1)*2),this.bl_tree=new Qt.Buf16((2*p$+1)*2),fo(this.dyn_ltree),fo(this.dyn_dtree),fo(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Qt.Buf16(g$+1),this.heap=new Qt.Buf16(2*Qf+1),fo(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Qt.Buf16(2*Qf+1),fo(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function d0(e){var t;return!e||!e.state?uo(e,Fn):(e.total_in=e.total_out=0,e.data_type=s$,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?kc:Ko,e.adler=t.wrap===2?0:1,t.last_flush=Yo,$n._tr_init(t),gr)}function f0(e){var t=d0(e);return t===gr&&S$(e.state),t}function E$(e,t){return!e||!e.state||e.state.wrap!==2?Fn:(e.state.gzhead=t,gr)}function h0(e,t,n,r,o,i){if(!e)return Fn;var a=1;if(t===n$&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),o<1||o>l$||n!==Mc||r<8||r>15||t<0||t>9||i<0||i>i$)return uo(e,Fn);r===8&&(r=9);var s=new C$;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=o+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Ue-1)/Ue),s.window=new Qt.Buf8(s.w_size*2),s.head=new Qt.Buf16(s.hash_size),s.prev=new Qt.Buf16(s.w_size),s.lit_bufsize=1<<o+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Qt.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=i,s.method=n,f0(e)}function P$(e,t){return h0(e,t,Mc,c$,u$,a$)}function R$(e,t){var n,r,o,i;if(!e||!e.state||t>s0||t<0)return e?uo(e,Fn):Fn;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===Es&&t!==lo)return uo(e,e.avail_out===0?Jf:Fn);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===kc)if(r.wrap===2)e.adler=0,Je(r,31),Je(r,139),Je(r,8),r.gzhead?(Je(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Je(r,r.gzhead.time&255),Je(r,r.gzhead.time>>8&255),Je(r,r.gzhead.time>>16&255),Je(r,r.gzhead.time>>24&255),Je(r,r.level===9?2:r.strategy>=Tc||r.level<2?4:0),Je(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(Je(r,r.gzhead.extra.length&255),Je(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=so(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=eh):(Je(r,0),Je(r,0),Je(r,0),Je(r,0),Je(r,0),Je(r,r.level===9?2:r.strategy>=Tc||r.level<2?4:0),Je(r,v$),r.status=Ko);else{var a=Mc+(r.w_bits-8<<4)<<8,s=-1;r.strategy>=Tc||r.level<2?s=0:r.level<6?s=1:r.level===6?s=2:s=3,a|=s<<6,r.strstart!==0&&(a|=w$),a+=31-a%31,r.status=Ko,Rs(r,a),r.strstart!==0&&(Rs(r,e.adler>>>16),Rs(r,e.adler&65535)),e.adler=1}if(r.status===eh)if(r.gzhead.extra){for(o=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=so(e.adler,r.pending_buf,r.pending-o,o)),ho(e),o=r.pending,r.pending===r.pending_buf_size));)Je(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>o&&(e.adler=so(e.adler,r.pending_buf,r.pending-o,o)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=Dc)}else r.status=Dc;if(r.status===Dc)if(r.gzhead.name){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=so(e.adler,r.pending_buf,r.pending-o,o)),ho(e),o=r.pending,r.pending===r.pending_buf_size)){i=1;break}r.gzindex<r.gzhead.name.length?i=r.gzhead.name.charCodeAt(r.gzindex++)&255:i=0,Je(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>o&&(e.adler=so(e.adler,r.pending_buf,r.pending-o,o)),i===0&&(r.gzindex=0,r.status=Ac)}else r.status=Ac;if(r.status===Ac)if(r.gzhead.comment){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=so(e.adler,r.pending_buf,r.pending-o,o)),ho(e),o=r.pending,r.pending===r.pending_buf_size)){i=1;break}r.gzindex<r.gzhead.comment.length?i=r.gzhead.comment.charCodeAt(r.gzindex++)&255:i=0,Je(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>o&&(e.adler=so(e.adler,r.pending_buf,r.pending-o,o)),i===0&&(r.status=Ic)}else r.status=Ic;if(r.status===Ic&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&ho(e),r.pending+2<=r.pending_buf_size&&(Je(r,e.adler&255),Je(r,e.adler>>8&255),e.adler=0,r.status=Ko)):r.status=Ko),r.pending!==0){if(ho(e),e.avail_out===0)return r.last_flush=-1,gr}else if(e.avail_in===0&&c0(t)<=c0(n)&&t!==lo)return uo(e,Jf);if(r.status===Es&&e.avail_in!==0)return uo(e,Jf);if(e.avail_in!==0||r.lookahead!==0||t!==Yo&&r.status!==Es){var l=r.strategy===Tc?_$(r,t):r.strategy===o$?x$(r,t):Bi[r.level].func(r,t);if((l===Xo||l===Li)&&(r.status=Es),l===Mt||l===Xo)return e.avail_out===0&&(r.last_flush=-1),gr;if(l===Ps&&(t===Q2?$n._tr_align(r):t!==s0&&($n._tr_stored_block(r,0,0,!1),t===e$&&(fo(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),ho(e),e.avail_out===0))return r.last_flush=-1,gr}return t!==lo?gr:r.wrap<=0?l0:(r.wrap===2?(Je(r,e.adler&255),Je(r,e.adler>>8&255),Je(r,e.adler>>16&255),Je(r,e.adler>>24&255),Je(r,e.total_in&255),Je(r,e.total_in>>8&255),Je(r,e.total_in>>16&255),Je(r,e.total_in>>24&255)):(Rs(r,e.adler>>>16),Rs(r,e.adler&65535)),ho(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?gr:l0)}function N$(e){var t;return!e||!e.state?Fn:(t=e.state.status,t!==kc&&t!==eh&&t!==Dc&&t!==Ac&&t!==Ic&&t!==Ko&&t!==Es?uo(e,Fn):(e.state=null,t===Ko?uo(e,t$):gr))}function T$(e,t){var n=t.length,r,o,i,a,s,l,c,u;if(!e||!e.state||(r=e.state,a=r.wrap,a===2||a===1&&r.status!==kc||r.lookahead))return Fn;for(a===1&&(e.adler=a0(e.adler,t,n,0)),r.wrap=0,n>=r.w_size&&(a===0&&(fo(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new Qt.Buf8(r.w_size),Qt.arraySet(u,t,n-r.w_size,r.w_size,0),t=u,n=r.w_size),s=e.avail_in,l=e.next_in,c=e.input,e.avail_in=n,e.next_in=0,e.input=t,Zo(r);r.lookahead>=Ue;){o=r.strstart,i=r.lookahead-(Ue-1);do r.ins_h=(r.ins_h<<r.hash_shift^r.window[o+Ue-1])&r.hash_mask,r.prev[o&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=o,o++;while(--i);r.strstart=o,r.lookahead=Ue-1,Zo(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Ue-1,r.match_available=0,e.next_in=l,e.input=c,e.avail_in=s,r.wrap=a,gr}pr.deflateInit=P$,pr.deflateInit2=h0,pr.deflateReset=f0,pr.deflateResetKeep=d0,pr.deflateSetHeader=E$,pr.deflate=R$,pr.deflateEnd=N$,pr.deflateSetDictionary=T$,pr.deflateInfo="pako deflate (from Nodeca project)";var Jo={},Oc=zr,p0=!0,m0=!0;try{String.fromCharCode.apply(null,[0])}catch{p0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{m0=!1}for(var Ns=new Oc.Buf8(256),po=0;po<256;po++)Ns[po]=po>=252?6:po>=248?5:po>=240?4:po>=224?3:po>=192?2:1;Ns[254]=Ns[254]=1,Jo.string2buf=function(e){var t,n,r,o,i,a=e.length,s=0;for(o=0;o<a;o++)n=e.charCodeAt(o),(n&64512)===55296&&o+1<a&&(r=e.charCodeAt(o+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),o++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Oc.Buf8(s),i=0,o=0;i<s;o++)n=e.charCodeAt(o),(n&64512)===55296&&o+1<a&&(r=e.charCodeAt(o+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),o++)),n<128?t[i++]=n:n<2048?(t[i++]=192|n>>>6,t[i++]=128|n&63):n<65536?(t[i++]=224|n>>>12,t[i++]=128|n>>>6&63,t[i++]=128|n&63):(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63,t[i++]=128|n>>>6&63,t[i++]=128|n&63);return t};function g0(e,t){if(t<65534&&(e.subarray&&m0||!e.subarray&&p0))return String.fromCharCode.apply(null,Oc.shrinkBuf(e,t));for(var n="",r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n}Jo.buf2binstring=function(e){return g0(e,e.length)},Jo.binstring2buf=function(e){for(var t=new Oc.Buf8(e.length),n=0,r=t.length;n<r;n++)t[n]=e.charCodeAt(n);return t},Jo.buf2string=function(e,t){var n,r,o,i,a=t||e.length,s=new Array(a*2);for(r=0,n=0;n<a;){if(o=e[n++],o<128){s[r++]=o;continue}if(i=Ns[o],i>4){s[r++]=65533,n+=i-1;continue}for(o&=i===2?31:i===3?15:7;i>1&&n<a;)o=o<<6|e[n++]&63,i--;if(i>1){s[r++]=65533;continue}o<65536?s[r++]=o:(o-=65536,s[r++]=55296|o>>10&1023,s[r++]=56320|o&1023)}return g0(s,r)},Jo.utf8border=function(e,t){var n;for(t=t||e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Ns[e[n]]>t?n:t};function M$(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var w0=M$,Ts=pr,Ms=zr,nh=Jo,rh=Zf,k$=w0,v0=Object.prototype.toString,D$=0,oh=4,Hi=0,y0=1,b0=2,A$=-1,I$=0,O$=8;function Qo(e){if(!(this instanceof Qo))return new Qo(e);this.options=Ms.assign({level:A$,method:O$,chunkSize:16384,windowBits:15,memLevel:8,strategy:I$,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k$,this.strm.avail_out=0;var n=Ts.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Hi)throw new Error(rh[n]);if(t.header&&Ts.deflateSetHeader(this.strm,t.header),t.dictionary){var r;if(typeof t.dictionary=="string"?r=nh.string2buf(t.dictionary):v0.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=Ts.deflateSetDictionary(this.strm,r),n!==Hi)throw new Error(rh[n]);this._dict_set=!0}}Qo.prototype.push=function(e,t){var n=this.strm,r=this.options.chunkSize,o,i;if(this.ended)return!1;i=t===~~t?t:t===!0?oh:D$,typeof e=="string"?n.input=nh.string2buf(e):v0.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new Ms.Buf8(r),n.next_out=0,n.avail_out=r),o=Ts.deflate(n,i),o!==y0&&o!==Hi)return this.onEnd(o),this.ended=!0,!1;(n.avail_out===0||n.avail_in===0&&(i===oh||i===b0))&&(this.options.to==="string"?this.onData(nh.buf2binstring(Ms.shrinkBuf(n.output,n.next_out))):this.onData(Ms.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||n.avail_out===0)&&o!==y0);return i===oh?(o=Ts.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Hi):(i===b0&&(this.onEnd(Hi),n.avail_out=0),!0)},Qo.prototype.onData=function(e){this.chunks.push(e)},Qo.prototype.onEnd=function(e){e===Hi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ms.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function ih(e,t){var n=new Qo(t);if(n.push(e,!0),n.err)throw n.msg||rh[n.err];return n.result}function j$(e,t){return t=t||{},t.raw=!0,ih(e,t)}function $$(e,t){return t=t||{},t.gzip=!0,ih(e,t)}vs.Deflate=Qo,vs.deflate=ih,vs.deflateRaw=j$,vs.gzip=$$;var ks={},Gn={},jc=30,F$=12,L$=function(t,n){var r,o,i,a,s,l,c,u,d,f,h,p,m,v,w,b,x,_,C,N,R,T,M,D,A;r=t.state,o=t.next_in,D=t.input,i=o+(t.avail_in-5),a=t.next_out,A=t.output,s=a-(n-t.avail_out),l=a+(t.avail_out-257),c=r.dmax,u=r.wsize,d=r.whave,f=r.wnext,h=r.window,p=r.hold,m=r.bits,v=r.lencode,w=r.distcode,b=(1<<r.lenbits)-1,x=(1<<r.distbits)-1;e:do{m<15&&(p+=D[o++]<<m,m+=8,p+=D[o++]<<m,m+=8),_=v[p&b];t:for(;;){if(C=_>>>24,p>>>=C,m-=C,C=_>>>16&255,C===0)A[a++]=_&65535;else if(C&16){N=_&65535,C&=15,C&&(m<C&&(p+=D[o++]<<m,m+=8),N+=p&(1<<C)-1,p>>>=C,m-=C),m<15&&(p+=D[o++]<<m,m+=8,p+=D[o++]<<m,m+=8),_=w[p&x];n:for(;;){if(C=_>>>24,p>>>=C,m-=C,C=_>>>16&255,C&16){if(R=_&65535,C&=15,m<C&&(p+=D[o++]<<m,m+=8,m<C&&(p+=D[o++]<<m,m+=8)),R+=p&(1<<C)-1,R>c){t.msg="invalid distance too far back",r.mode=jc;break e}if(p>>>=C,m-=C,C=a-s,R>C){if(C=R-C,C>d&&r.sane){t.msg="invalid distance too far back",r.mode=jc;break e}if(T=0,M=h,f===0){if(T+=u-C,C<N){N-=C;do A[a++]=h[T++];while(--C);T=a-R,M=A}}else if(f<C){if(T+=u+f-C,C-=f,C<N){N-=C;do A[a++]=h[T++];while(--C);if(T=0,f<N){C=f,N-=C;do A[a++]=h[T++];while(--C);T=a-R,M=A}}}else if(T+=f-C,C<N){N-=C;do A[a++]=h[T++];while(--C);T=a-R,M=A}for(;N>2;)A[a++]=M[T++],A[a++]=M[T++],A[a++]=M[T++],N-=3;N&&(A[a++]=M[T++],N>1&&(A[a++]=M[T++]))}else{T=a-R;do A[a++]=A[T++],A[a++]=A[T++],A[a++]=A[T++],N-=3;while(N>2);N&&(A[a++]=A[T++],N>1&&(A[a++]=A[T++]))}}else if(C&64){t.msg="invalid distance code",r.mode=jc;break e}else{_=w[(_&65535)+(p&(1<<C)-1)];continue n}break}}else if(C&64)if(C&32){r.mode=F$;break e}else{t.msg="invalid literal/length code",r.mode=jc;break e}else{_=v[(_&65535)+(p&(1<<C)-1)];continue t}break}}while(o<i&&a<l);N=m>>3,o-=N,m-=N<<3,p&=(1<<m)-1,t.next_in=o,t.next_out=a,t.avail_in=o<i?5+(i-o):5-(o-i),t.avail_out=a<l?257+(l-a):257-(a-l),r.hold=p,r.bits=m},x0=zr,Vi=15,_0=852,S0=592,C0=0,ah=1,E0=2,z$=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],B$=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],H$=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],V$=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],U$=function(t,n,r,o,i,a,s,l){var c=l.bits,u=0,d=0,f=0,h=0,p=0,m=0,v=0,w=0,b=0,x=0,_,C,N,R,T,M=null,D=0,A,O=new x0.Buf16(Vi+1),$=new x0.Buf16(Vi+1),W=null,re=0,Y,Z,B;for(u=0;u<=Vi;u++)O[u]=0;for(d=0;d<o;d++)O[n[r+d]]++;for(p=c,h=Vi;h>=1&&O[h]===0;h--);if(p>h&&(p=h),h===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,l.bits=1,0;for(f=1;f<h&&O[f]===0;f++);for(p<f&&(p=f),w=1,u=1;u<=Vi;u++)if(w<<=1,w-=O[u],w<0)return-1;if(w>0&&(t===C0||h!==1))return-1;for($[1]=0,u=1;u<Vi;u++)$[u+1]=$[u]+O[u];for(d=0;d<o;d++)n[r+d]!==0&&(s[$[n[r+d]]++]=d);if(t===C0?(M=W=s,A=19):t===ah?(M=z$,D-=257,W=B$,re-=257,A=256):(M=H$,W=V$,A=-1),x=0,d=0,u=f,T=a,m=p,v=0,N=-1,b=1<<p,R=b-1,t===ah&&b>_0||t===E0&&b>S0)return 1;for(;;){Y=u-v,s[d]<A?(Z=0,B=s[d]):s[d]>A?(Z=W[re+s[d]],B=M[D+s[d]]):(Z=96,B=0),_=1<<u-v,C=1<<m,f=C;do C-=_,i[T+(x>>v)+C]=Y<<24|Z<<16|B|0;while(C!==0);for(_=1<<u-1;x&_;)_>>=1;if(_!==0?(x&=_-1,x+=_):x=0,d++,--O[u]===0){if(u===h)break;u=n[r+s[d]]}if(u>p&&(x&R)!==N){for(v===0&&(v=p),T+=f,m=u-v,w=1<<m;m+v<h&&(w-=O[m+v],!(w<=0));)m++,w<<=1;if(b+=1<<m,t===ah&&b>_0||t===E0&&b>S0)return 1;N=x&R,i[N]=p<<24|m<<16|T-a|0}}return x!==0&&(i[T+x]=u-v<<24|64<<16|0),l.bits=p,0},Cn=zr,sh=o0,vr=i0,W$=L$,Ds=U$,G$=0,P0=1,R0=2,N0=4,q$=5,$c=6,ei=0,Y$=1,K$=2,Ln=-2,T0=-3,M0=-4,X$=-5,k0=8,D0=1,A0=2,I0=3,O0=4,j0=5,$0=6,F0=7,L0=8,z0=9,B0=10,Fc=11,Hr=12,lh=13,H0=14,ch=15,V0=16,U0=17,W0=18,G0=19,Lc=20,zc=21,q0=22,Y0=23,K0=24,X0=25,Z0=26,uh=27,J0=28,Q0=29,ht=30,eb=31,Z$=32,J$=852,Q$=592,eF=15,tF=eF;function tb(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function nF(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Cn.Buf16(320),this.work=new Cn.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function nb(e){var t;return!e||!e.state?Ln:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=D0,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Cn.Buf32(J$),t.distcode=t.distdyn=new Cn.Buf32(Q$),t.sane=1,t.back=-1,ei)}function rb(e){var t;return!e||!e.state?Ln:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,nb(e))}function ob(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Ln:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,rb(e))}function ib(e,t){var n,r;return e?(r=new nF,e.state=r,r.window=null,n=ob(e,t),n!==ei&&(e.state=null),n):Ln}function rF(e){return ib(e,tF)}var ab=!0,dh,fh;function oF(e){if(ab){var t;for(dh=new Cn.Buf32(512),fh=new Cn.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ds(P0,e.lens,0,288,dh,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ds(R0,e.lens,0,32,fh,0,e.work,{bits:5}),ab=!1}e.lencode=dh,e.lenbits=9,e.distcode=fh,e.distbits=5}function sb(e,t,n,r){var o,i=e.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Cn.Buf8(i.wsize)),r>=i.wsize?(Cn.arraySet(i.window,t,n-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>r&&(o=r),Cn.arraySet(i.window,t,n-r,o,i.wnext),r-=o,r?(Cn.arraySet(i.window,t,n-r,r,0),i.wnext=r,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=o))),0}function iF(e,t){var n,r,o,i,a,s,l,c,u,d,f,h,p,m,v=0,w,b,x,_,C,N,R,T,M=new Cn.Buf8(4),D,A,O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Ln;n=e.state,n.mode===Hr&&(n.mode=lh),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,r=e.input,s=e.avail_in,c=n.hold,u=n.bits,d=s,f=l,T=ei;e:for(;;)switch(n.mode){case D0:if(n.wrap===0){n.mode=lh;break}for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(n.wrap&2&&c===35615){n.check=0,M[0]=c&255,M[1]=c>>>8&255,n.check=vr(n.check,M,2,0),c=0,u=0,n.mode=A0;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=ht;break}if((c&15)!==k0){e.msg="unknown compression method",n.mode=ht;break}if(c>>>=4,u-=4,R=(c&15)+8,n.wbits===0)n.wbits=R;else if(R>n.wbits){e.msg="invalid window size",n.mode=ht;break}n.dmax=1<<R,e.adler=n.check=1,n.mode=c&512?B0:Hr,c=0,u=0;break;case A0:for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(n.flags=c,(n.flags&255)!==k0){e.msg="unknown compression method",n.mode=ht;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=ht;break}n.head&&(n.head.text=c>>8&1),n.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,n.check=vr(n.check,M,2,0)),c=0,u=0,n.mode=I0;case I0:for(;u<32;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.head&&(n.head.time=c),n.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,M[2]=c>>>16&255,M[3]=c>>>24&255,n.check=vr(n.check,M,4,0)),c=0,u=0,n.mode=O0;case O0:for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.head&&(n.head.xflags=c&255,n.head.os=c>>8),n.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,n.check=vr(n.check,M,2,0)),c=0,u=0,n.mode=j0;case j0:if(n.flags&1024){for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.length=c,n.head&&(n.head.extra_len=c),n.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,n.check=vr(n.check,M,2,0)),c=0,u=0}else n.head&&(n.head.extra=null);n.mode=$0;case $0:if(n.flags&1024&&(h=n.length,h>s&&(h=s),h&&(n.head&&(R=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),Cn.arraySet(n.head.extra,r,i,h,R)),n.flags&512&&(n.check=vr(n.check,r,h,i)),s-=h,i+=h,n.length-=h),n.length))break e;n.length=0,n.mode=F0;case F0:if(n.flags&2048){if(s===0)break e;h=0;do R=r[i+h++],n.head&&R&&n.length<65536&&(n.head.name+=String.fromCharCode(R));while(R&&h<s);if(n.flags&512&&(n.check=vr(n.check,r,h,i)),s-=h,i+=h,R)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=L0;case L0:if(n.flags&4096){if(s===0)break e;h=0;do R=r[i+h++],n.head&&R&&n.length<65536&&(n.head.comment+=String.fromCharCode(R));while(R&&h<s);if(n.flags&512&&(n.check=vr(n.check,r,h,i)),s-=h,i+=h,R)break e}else n.head&&(n.head.comment=null);n.mode=z0;case z0:if(n.flags&512){for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(c!==(n.check&65535)){e.msg="header crc mismatch",n.mode=ht;break}c=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Hr;break;case B0:for(;u<32;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}e.adler=n.check=tb(c),c=0,u=0,n.mode=Fc;case Fc:if(n.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,K$;e.adler=n.check=1,n.mode=Hr;case Hr:if(t===q$||t===$c)break e;case lh:if(n.last){c>>>=u&7,u-=u&7,n.mode=uh;break}for(;u<3;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}switch(n.last=c&1,c>>>=1,u-=1,c&3){case 0:n.mode=H0;break;case 1:if(oF(n),n.mode=Lc,t===$c){c>>>=2,u-=2;break e}break;case 2:n.mode=U0;break;case 3:e.msg="invalid block type",n.mode=ht}c>>>=2,u-=2;break;case H0:for(c>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=ht;break}if(n.length=c&65535,c=0,u=0,n.mode=ch,t===$c)break e;case ch:n.mode=V0;case V0:if(h=n.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;Cn.arraySet(o,r,i,h,a),s-=h,i+=h,l-=h,a+=h,n.length-=h;break}n.mode=Hr;break;case U0:for(;u<14;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(n.nlen=(c&31)+257,c>>>=5,u-=5,n.ndist=(c&31)+1,c>>>=5,u-=5,n.ncode=(c&15)+4,c>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=ht;break}n.have=0,n.mode=W0;case W0:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.lens[O[n.have++]]=c&7,c>>>=3,u-=3}for(;n.have<19;)n.lens[O[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,D={bits:n.lenbits},T=Ds(G$,n.lens,0,19,n.lencode,0,n.work,D),n.lenbits=D.bits,T){e.msg="invalid code lengths set",n.mode=ht;break}n.have=0,n.mode=G0;case G0:for(;n.have<n.nlen+n.ndist;){for(;v=n.lencode[c&(1<<n.lenbits)-1],w=v>>>24,b=v>>>16&255,x=v&65535,!(w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(x<16)c>>>=w,u-=w,n.lens[n.have++]=x;else{if(x===16){for(A=w+2;u<A;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(c>>>=w,u-=w,n.have===0){e.msg="invalid bit length repeat",n.mode=ht;break}R=n.lens[n.have-1],h=3+(c&3),c>>>=2,u-=2}else if(x===17){for(A=w+3;u<A;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}c>>>=w,u-=w,R=0,h=3+(c&7),c>>>=3,u-=3}else{for(A=w+7;u<A;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}c>>>=w,u-=w,R=0,h=11+(c&127),c>>>=7,u-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=ht;break}for(;h--;)n.lens[n.have++]=R}}if(n.mode===ht)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=ht;break}if(n.lenbits=9,D={bits:n.lenbits},T=Ds(P0,n.lens,0,n.nlen,n.lencode,0,n.work,D),n.lenbits=D.bits,T){e.msg="invalid literal/lengths set",n.mode=ht;break}if(n.distbits=6,n.distcode=n.distdyn,D={bits:n.distbits},T=Ds(R0,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,D),n.distbits=D.bits,T){e.msg="invalid distances set",n.mode=ht;break}if(n.mode=Lc,t===$c)break e;case Lc:n.mode=zc;case zc:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,W$(e,f),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,r=e.input,s=e.avail_in,c=n.hold,u=n.bits,n.mode===Hr&&(n.back=-1);break}for(n.back=0;v=n.lencode[c&(1<<n.lenbits)-1],w=v>>>24,b=v>>>16&255,x=v&65535,!(w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(b&&!(b&240)){for(_=w,C=b,N=x;v=n.lencode[N+((c&(1<<_+C)-1)>>_)],w=v>>>24,b=v>>>16&255,x=v&65535,!(_+w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}c>>>=_,u-=_,n.back+=_}if(c>>>=w,u-=w,n.back+=w,n.length=x,b===0){n.mode=Z0;break}if(b&32){n.back=-1,n.mode=Hr;break}if(b&64){e.msg="invalid literal/length code",n.mode=ht;break}n.extra=b&15,n.mode=q0;case q0:if(n.extra){for(A=n.extra;u<A;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Y0;case Y0:for(;v=n.distcode[c&(1<<n.distbits)-1],w=v>>>24,b=v>>>16&255,x=v&65535,!(w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(!(b&240)){for(_=w,C=b,N=x;v=n.distcode[N+((c&(1<<_+C)-1)>>_)],w=v>>>24,b=v>>>16&255,x=v&65535,!(_+w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}c>>>=_,u-=_,n.back+=_}if(c>>>=w,u-=w,n.back+=w,b&64){e.msg="invalid distance code",n.mode=ht;break}n.offset=x,n.extra=b&15,n.mode=K0;case K0:if(n.extra){for(A=n.extra;u<A;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=ht;break}n.mode=X0;case X0:if(l===0)break e;if(h=f-l,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=ht;break}h>n.wnext?(h-=n.wnext,p=n.wsize-h):p=n.wnext-h,h>n.length&&(h=n.length),m=n.window}else m=o,p=a-n.offset,h=n.length;h>l&&(h=l),l-=h,n.length-=h;do o[a++]=m[p++];while(--h);n.length===0&&(n.mode=zc);break;case Z0:if(l===0)break e;o[a++]=n.length,l--,n.mode=zc;break;case uh:if(n.wrap){for(;u<32;){if(s===0)break e;s--,c|=r[i++]<<u,u+=8}if(f-=l,e.total_out+=f,n.total+=f,f&&(e.adler=n.check=n.flags?vr(n.check,o,f,a-f):sh(n.check,o,f,a-f)),f=l,(n.flags?c:tb(c))!==n.check){e.msg="incorrect data check",n.mode=ht;break}c=0,u=0}n.mode=J0;case J0:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(c!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=ht;break}c=0,u=0}n.mode=Q0;case Q0:T=Y$;break e;case ht:T=T0;break e;case eb:return M0;case Z$:default:return Ln}return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,n.hold=c,n.bits=u,(n.wsize||f!==e.avail_out&&n.mode<ht&&(n.mode<uh||t!==N0))&&sb(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&&f&&(e.adler=n.check=n.flags?vr(n.check,o,f,e.next_out-f):sh(n.check,o,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Hr?128:0)+(n.mode===Lc||n.mode===ch?256:0),(d===0&&f===0||t===N0)&&T===ei&&(T=X$),T}function aF(e){if(!e||!e.state)return Ln;var t=e.state;return t.window&&(t.window=null),e.state=null,ei}function sF(e,t){var n;return!e||!e.state||(n=e.state,!(n.wrap&2))?Ln:(n.head=t,t.done=!1,ei)}function lF(e,t){var n=t.length,r,o,i;return!e||!e.state||(r=e.state,r.wrap!==0&&r.mode!==Fc)?Ln:r.mode===Fc&&(o=1,o=sh(o,t,n,0),o!==r.check)?T0:(i=sb(e,t,n,n),i?(r.mode=eb,M0):(r.havedict=1,ei))}Gn.inflateReset=rb,Gn.inflateReset2=ob,Gn.inflateResetKeep=nb,Gn.inflateInit=rF,Gn.inflateInit2=ib,Gn.inflate=iF,Gn.inflateEnd=aF,Gn.inflateGetHeader=sF,Gn.inflateSetDictionary=lF,Gn.inflateInfo="pako inflate (from Nodeca project)";var lb={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};function cF(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var uF=cF,Ui=Gn,As=zr,Bc=Jo,_t=lb,hh=Zf,dF=w0,fF=uF,cb=Object.prototype.toString;function ti(e){if(!(this instanceof ti))return new ti(e);this.options=As.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new dF,this.strm.avail_out=0;var n=Ui.inflateInit2(this.strm,t.windowBits);if(n!==_t.Z_OK)throw new Error(hh[n]);if(this.header=new fF,Ui.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Bc.string2buf(t.dictionary):cb.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Ui.inflateSetDictionary(this.strm,t.dictionary),n!==_t.Z_OK)))throw new Error(hh[n])}ti.prototype.push=function(e,t){var n=this.strm,r=this.options.chunkSize,o=this.options.dictionary,i,a,s,l,c,u=!1;if(this.ended)return!1;a=t===~~t?t:t===!0?_t.Z_FINISH:_t.Z_NO_FLUSH,typeof e=="string"?n.input=Bc.binstring2buf(e):cb.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new As.Buf8(r),n.next_out=0,n.avail_out=r),i=Ui.inflate(n,_t.Z_NO_FLUSH),i===_t.Z_NEED_DICT&&o&&(i=Ui.inflateSetDictionary(this.strm,o)),i===_t.Z_BUF_ERROR&&u===!0&&(i=_t.Z_OK,u=!1),i!==_t.Z_STREAM_END&&i!==_t.Z_OK)return this.onEnd(i),this.ended=!0,!1;n.next_out&&(n.avail_out===0||i===_t.Z_STREAM_END||n.avail_in===0&&(a===_t.Z_FINISH||a===_t.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=Bc.utf8border(n.output,n.next_out),l=n.next_out-s,c=Bc.buf2string(n.output,s),n.next_out=l,n.avail_out=r-l,l&&As.arraySet(n.output,n.output,s,l,0),this.onData(c)):this.onData(As.shrinkBuf(n.output,n.next_out))),n.avail_in===0&&n.avail_out===0&&(u=!0)}while((n.avail_in>0||n.avail_out===0)&&i!==_t.Z_STREAM_END);return i===_t.Z_STREAM_END&&(a=_t.Z_FINISH),a===_t.Z_FINISH?(i=Ui.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===_t.Z_OK):(a===_t.Z_SYNC_FLUSH&&(this.onEnd(_t.Z_OK),n.avail_out=0),!0)},ti.prototype.onData=function(e){this.chunks.push(e)},ti.prototype.onEnd=function(e){e===_t.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=As.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function ph(e,t){var n=new ti(t);if(n.push(e,!0),n.err)throw n.msg||hh[n.err];return n.result}function hF(e,t){return t=t||{},t.raw=!0,ph(e,t)}ks.Inflate=ti,ks.inflate=ph,ks.inflateRaw=hF,ks.ungzip=ph;var pF=zr.assign,mF=vs,gF=ks,wF=lb,ub={};pF(ub,mF,gF,wF);var vF=ub;const mh=On(vF),db=(e,t)=>function(...n){const r=t.promiseModule;return new r((o,i)=>{t.multiArgs?n.push((...a)=>{t.errorFirst?a[0]?i(a):(a.shift(),o(a)):o(a)}):t.errorFirst?n.push((a,s)=>{a?i(a):o(s)}):n.push(o),e.apply(this,n)})};var yF=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const n=typeof e;if(!(e!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":n}\``);const r=i=>{const a=s=>typeof s=="string"?i===s:s.test(i);return t.include?t.include.some(a):!t.exclude.some(a)};let o;n==="function"?o=function(...i){return t.excludeMain?e(...i):db(e,t).apply(this,i)}:o=Object.create(Object.getPrototypeOf(e));for(const i in e){const a=e[i];o[i]=typeof a=="function"&&r(i)?db(a,t):a}return o};const gh=On(yF);function fb(e){return Array.isArray(e)?e:[e]}const wh="",hb=" ",vh="\\",bF=/^\s+$/,xF=/(?:[^\\]|^)\\$/,_F=/^\\!/,SF=/^\\#/,CF=/\r?\n/g,EF=/^\.*\/|^\.+$/,yh="/";let pb="node-ignore";typeof Symbol<"u"&&(pb=Symbol.for("node-ignore"));const mb=pb,PF=(e,t,n)=>Object.defineProperty(e,t,{value:n}),RF=/([0-z])-([0-z])/g,gb=()=>!1,NF=e=>e.replace(RF,(t,n,r)=>n.charCodeAt(0)<=r.charCodeAt(0)?t:wh),TF=e=>{const{length:t}=e;return e.slice(0,t-t%2)},MF=[[/^\uFEFF/,()=>wh],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf("\\")===0?hb:wh)],[/(\\+?)\s/g,(e,t)=>{const{length:n}=t;return t.slice(0,n-n%2)+hb}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>{const r=n.replace(/\\\*/g,"[^\\/]*");return t+r}],[/\\\\\\(?=[$.|*+(){^])/g,()=>vh],[/\\\\/g,()=>vh],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,o)=>t===vh?`\\[${n}${TF(r)}${o}`:o==="]"&&r.length%2===0?`[${NF(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`]],wb=Object.create(null),kF=(e,t)=>{let n=wb[e];return n||(n=MF.reduce((r,[o,i])=>r.replace(o,i.bind(e)),e),wb[e]=n),t?new RegExp(n,"i"):new RegExp(n)},bh=e=>typeof e=="string",DF=e=>e&&bh(e)&&!bF.test(e)&&!xF.test(e)&&e.indexOf("#")!==0,AF=e=>e.split(CF);let IF=class{constructor(t,n,r,o){this.origin=t,this.pattern=n,this.negative=r,this.regex=o}};const OF=(e,t)=>{const n=e;let r=!1;e.indexOf("!")===0&&(r=!0,e=e.substr(1)),e=e.replace(_F,"!").replace(SF,"#");const o=kF(e,t);return new IF(n,e,r,o)},jF=(e,t)=>{throw new t(e)},Vr=(e,t,n)=>bh(e)?e?Vr.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n("path must not be empty",TypeError):n(`path must be a string, but got \`${t}\``,TypeError),vb=e=>EF.test(e);Vr.isNotRelative=vb,Vr.convert=e=>e;let $F=class{constructor({ignorecase:t=!0,ignoreCase:n=t,allowRelativePaths:r=!1}={}){PF(this,mb,!0),this._rules=[],this._ignoreCase=n,this._allowRelativePaths=r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[mb]){this._rules=this._rules.concat(t._rules),this._added=!0;return}if(DF(t)){const n=OF(t,this._ignoreCase);this._added=!0,this._rules.push(n)}}add(t){return this._added=!1,fb(bh(t)?AF(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,n){let r=!1,o=!1;return this._rules.forEach(i=>{const{negative:a}=i;if(o===a&&r!==o||a&&!r&&!o&&!n)return;i.regex.test(t)&&(r=!a,o=a)}),{ignored:r,unignored:o}}_test(t,n,r,o){const i=t&&Vr.convert(t);return Vr(i,t,this._allowRelativePaths?gb:jF),this._t(i,n,r,o)}_t(t,n,r,o){if(t in n)return n[t];if(o||(o=t.split(yh)),o.pop(),!o.length)return n[t]=this._testOne(t,r);const i=this._t(o.join(yh)+yh,n,r,o);return n[t]=i.ignored?i:this._testOne(t,r)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return fb(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}};const Hc=e=>new $F(e),FF=e=>Vr(e&&Vr.convert(e),e,gb);Hc.isPathValid=FF,Hc.default=Hc;var LF=Hc;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){const e=n=>/^\\\\\?\\/.test(n)||/["<>|\u0000-\u001F]+/u.test(n)?n:n.replace(/\\/g,"/");Vr.convert=e;const t=/^[a-z]:\//i;Vr.isNotRelative=n=>t.test(n)||vb(n)}const zF=On(LF);function BF(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yr(e,t,n){return t=t instanceof RegExp?t:new RegExp(BF(t),"g"),e.replace(t,n)}var HF={clean:function(t){if(typeof t!="string")throw new Error("Expected a string, received: "+t);return t=yr(t,"./","/"),t=yr(t,"..","."),t=yr(t," ","-"),t=yr(t,/^[~^:?*\\\-]/g,""),t=yr(t,/[~^:?*\\]/g,"-"),t=yr(t,/[~^:?*\\\-]$/g,""),t=yr(t,"@{","-"),t=yr(t,/\.$/g,""),t=yr(t,/\/$/g,""),t=yr(t,/\.lock$/g,""),t}},VF=HF;const br=On(VF);var UF=function(e,t){var n=e,r=t,o=n.length,i=r.length,a=!1,s=null,l=o+1,c=[],u=[],d=[],f="",h=-1,p=0,m=1,v,w,b=function(){o>=i&&(v=n,w=o,n=r,r=v,o=i,i=w,a=!0,l=o+1)},x=function(R,T,M){return{x:R,y:T,k:M}},_=function(R,T){return{elem:R,t:T}},C=function(R,T,M){var D,A,O;for(T>M?D=c[R-1+l]:D=c[R+1+l],O=Math.max(T,M),A=O-R;A<o&&O<i&&n[A]===r[O];)++A,++O;return c[R+l]=u.length,u[u.length]=new x(A,O,D),O},N=function(R){var T,M,D;for(T=M=0,D=R.length-1;D>=0;--D)for(;T<R[D].x||M<R[D].y;)R[D].y-R[D].x>M-T?(a?d[d.length]=new _(r[M],h):d[d.length]=new _(r[M],m),++M):R[D].y-R[D].x<M-T?(a?d[d.length]=new _(n[T],m):d[d.length]=new _(n[T],h),++T):(d[d.length]=new _(n[T],p),f+=n[T],++T,++M)};return b(),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:function(){return s},getlcs:function(){return f},getses:function(){return d},compose:function(){var R,T,M,D,A,O,$,W;for(R=i-o,T=o+i+3,M={},$=0;$<T;++$)M[$]=-1,c[$]=-1;D=-1;do{for(++D,W=-D;W<=R-1;++W)M[W+l]=C(W,M[W-1+l]+1,M[W+1+l]);for(W=R+D;W>=R+1;--W)M[W+l]=C(W,M[W-1+l]+1,M[W+1+l]);M[R+l]=C(R,M[R-1+l]+1,M[R+1+l])}while(M[R+l]!==i);for(s=R+2*D,A=c[R+l],O=[];A!==-1;)O[O.length]=new x(u[A].x,u[A].y,null),A=u[A].k;N(O)}}},WF=UF;function GF(e,t){var n=new WF(e,t);n.compose();for(var r=n.getses(),o,i,a=e.length-1,s=t.length-1,l=r.length-1;l>=0;--l)r[l].t===n.SES_COMMON?(i?(i.chain={file1index:a,file2index:s,chain:null},i=i.chain):(o={file1index:a,file2index:s,chain:null},i=o),a--,s--):r[l].t===n.SES_DELETE?a--:r[l].t===n.SES_ADD&&s--;var c={file1index:-1,file2index:-1,chain:null};return i?(i.chain=c,o):c}function yb(e,t){for(var n=[],r=e.length,o=t.length,i=GF(e,t);i!==null;i=i.chain){var a=r-i.file1index-1,s=o-i.file2index-1;r=i.file1index,o=i.file2index,(a||s)&&n.push({file1:[r+1,a],file2:[o+1,s]})}return n.reverse(),n}function qF(e,t,n){var r,o=yb(t,e),i=yb(t,n),a=[];function s($,W){a.push([$.file1[0],W,$.file1[1],$.file2[0],$.file2[1]])}for(r=0;r<o.length;r++)s(o[r],0);for(r=0;r<i.length;r++)s(i[r],2);a.sort(function($,W){return $[0]-W[0]});var l=[],c=0;function u($){$>c&&(l.push([1,c,$-c]),c=$)}for(var d=0;d<a.length;d++){for(var f=d,h=a[d],p=h[0],m=p+h[2];d<a.length-1;){var v=a[d+1],w=v[0];if(w>m)break;m=Math.max(m,w+v[2]),d++}if(u(p),f==d)h[4]>0&&l.push([h[1],h[3],h[4]]);else{var b={0:[e.length,-1,t.length,-1],2:[n.length,-1,t.length,-1]};for(r=f;r<=d;r++){h=a[r];var x=h[1],_=b[x],C=h[0],N=C+h[2],R=h[3],T=R+h[4];_[0]=Math.min(R,_[0]),_[1]=Math.max(T,_[1]),_[2]=Math.min(C,_[2]),_[3]=Math.max(N,_[3])}var M=b[0][0]+(p-b[0][2]),D=b[0][1]+(m-b[0][3]),A=b[2][0]+(p-b[2][2]),O=b[2][1]+(m-b[2][3]);l.push([-1,M,D-M,p,m-p,A,O-A])}c=m}return u(t.length),l}function YF(e,t,n){var r=[],o=[e,t,n],i=qF(e,t,n),a=[];function s(){a.length&&r.push({ok:a}),a=[]}function l(h){for(var p=0;p<h.length;p++)a.push(h[p])}function c(h){if(h[2]!=h[6])return!0;for(var p=h[1],m=h[5],v=0;v<h[2];v++)if(e[v+p]!=n[v+m])return!0;return!1}for(var u=0;u<i.length;u++){var d=i[u],f=d[0];f==-1?c(d)?(s(),r.push({conflict:{a:e.slice(d[1],d[1]+d[2]),aIndex:d[1],o:t.slice(d[3],d[3]+d[4]),oIndex:d[3],b:n.slice(d[5],d[5]+d[6]),bIndex:d[5]}})):l(o[0].slice(d[1],d[1]+d[2])):l(o[f].slice(d[1],d[1]+d[2]))}return s(),r}var KF=YF;const XF=On(KF);class Ye extends Error{constructor(t){super(t),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(t){const n=new Ye(t.message);return n.code=t.code,n.data=t.data,n.caller=t.caller,n.stack=t.stack,n}get isIsomorphicGitError(){return!0}}class Is extends Ye{constructor(t){super(`Modifying the index is not possible because you have unmerged files: ${t.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=Is.code,this.data={filepaths:t}}}Is.code="UnmergedPathsError";class je extends Ye{constructor(t){super(`An internal error caused this command to fail. Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${t}`),this.code=this.name=je.code,this.data={message:t}}}je.code="InternalError";class Wi extends Ye{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=Wi.code,this.data={filepath:t}}}Wi.code="UnsafeFilepathError";class xr{constructor(t){this.buffer=t,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(t){this._start=t}slice(t){const n=this.buffer.slice(this._start,this._start+t);return this._start+=t,n}toString(t,n){const r=this.buffer.toString(t,this._start,this._start+n);return this._start+=n,r}write(t,n,r){const o=this.buffer.write(t,this._start,n,r);return this._start+=n,o}copy(t,n,r){const o=t.copy(this.buffer,this._start,n,r);return this._start+=o,o}readUInt8(){const t=this.buffer.readUInt8(this._start);return this._start+=1,t}writeUInt8(t){const n=this.buffer.writeUInt8(t,this._start);return this._start+=1,n}readUInt16BE(){const t=this.buffer.readUInt16BE(this._start);return this._start+=2,t}writeUInt16BE(t){const n=this.buffer.writeUInt16BE(t,this._start);return this._start+=2,n}readUInt32BE(){const t=this.buffer.readUInt32BE(this._start);return this._start+=4,t}writeUInt32BE(t){const n=this.buffer.writeUInt32BE(t,this._start);return this._start+=4,n}}function Vc(e,t){return-(e<t)||+(e>t)}function bb(e,t){return Vc(e.path,t.path)}function xb(e){let t=e>0?e>>12:0;t!==4&&t!==8&&t!==10&&t!==14&&(t=8);let n=e&511;return n&73?n=493:n=420,t!==8&&(n=0),(t<<12)+n}const _r=2**32;function _b(e,t,n,r){if(e!==void 0&&t!==void 0)return[e,t];n===void 0&&(n=r.valueOf());const o=Math.floor(n/1e3),i=(n-o*1e3)*1e6;return[o,i]}function Gi(e){const[t,n]=_b(e.ctimeSeconds,e.ctimeNanoseconds,e.ctimeMs,e.ctime),[r,o]=_b(e.mtimeSeconds,e.mtimeNanoseconds,e.mtimeMs,e.mtime);return{ctimeSeconds:t%_r,ctimeNanoseconds:n%_r,mtimeSeconds:r%_r,mtimeNanoseconds:o%_r,dev:e.dev%_r,ino:e.ino%_r,mode:xb(e.mode%_r),uid:e.uid%_r,gid:e.gid%_r,size:e.size>-1?e.size%_r:0}}function ZF(e){let t="";for(const n of new Uint8Array(e))n<16&&(t+="0"),t+=n.toString(16);return t}let xh=null;async function Ur(e){return xh===null&&(xh=await QF()),xh?Sb(e):JF(e)}function JF(e){return new Ay().update(e).digest("hex")}async function Sb(e){const t=await crypto.subtle.digest("SHA-1",e);return ZF(t)}async function QF(){try{if(await Sb(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709")return!0}catch{}return!1}function eL(e){return{assumeValid:!!(e&32768),extended:!!(e&16384),stage:(e&12288)>>12,nameLength:e&4095}}function tL(e){const t=e.flags;return t.extended=!1,t.nameLength=Math.min(Buffer.from(e.path).length,4095),(t.assumeValid?32768:0)+(t.extended?16384:0)+((t.stage&3)<<12)+(t.nameLength&4095)}class ni{constructor(t,n){this._dirty=!1,this._unmergedPaths=n||new Set,this._entries=t||new Map}_addEntry(t){if(t.flags.stage===0)t.stages=[t],this._entries.set(t.path,t),this._unmergedPaths.delete(t.path);else{let n=this._entries.get(t.path);n||(this._entries.set(t.path,t),n=t),n.stages[t.flags.stage]=t,this._unmergedPaths.add(t.path)}}static async from(t){if(Buffer.isBuffer(t))return ni.fromBuffer(t);if(t===null)return new ni(null);throw new je("invalid type passed to GitIndex.from")}static async fromBuffer(t){if(t.length===0)throw new je("Index file is empty (.git/index)");const n=new ni,r=new xr(t),o=r.toString("utf8",4);if(o!=="DIRC")throw new je(`Invalid dircache magic file number: ${o}`);const i=await Ur(t.slice(0,-20)),a=t.slice(-20).toString("hex");if(a!==i)throw new je(`Invalid checksum in GitIndex buffer: expected ${a} but saw ${i}`);const s=r.readUInt32BE();if(s!==2)throw new je(`Unsupported dircache version: ${s}`);const l=r.readUInt32BE();let c=0;for(;!r.eof()&&c<l;){const u={};u.ctimeSeconds=r.readUInt32BE(),u.ctimeNanoseconds=r.readUInt32BE(),u.mtimeSeconds=r.readUInt32BE(),u.mtimeNanoseconds=r.readUInt32BE(),u.dev=r.readUInt32BE(),u.ino=r.readUInt32BE(),u.mode=r.readUInt32BE(),u.uid=r.readUInt32BE(),u.gid=r.readUInt32BE(),u.size=r.readUInt32BE(),u.oid=r.slice(20).toString("hex");const d=r.readUInt16BE();u.flags=eL(d);const f=t.indexOf(0,r.tell()+1)-r.tell();if(f<1)throw new je(`Got a path length of: ${f}`);if(u.path=r.toString("utf8",f),u.path.includes("..\\")||u.path.includes("../"))throw new Wi(u.path);let h=8-(r.tell()-12)%8;for(h===0&&(h=8);h--;){const p=r.readUInt8();if(p!==0)throw new je(`Expected 1-8 null characters but got '${p}' after ${u.path}`);if(r.eof())throw new je("Unexpected end of file")}u.stages=[],n._addEntry(u),c++}return n}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(bb)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(t=>t.stages.length>1?t.stages.filter(n=>n):t)}*[Symbol.iterator](){for(const t of this.entries)yield t}insert({filepath:t,stats:n,oid:r,stage:o=0}){n||(n={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),n=Gi(n);const i=Buffer.from(t),a={ctimeSeconds:n.ctimeSeconds,ctimeNanoseconds:n.ctimeNanoseconds,mtimeSeconds:n.mtimeSeconds,mtimeNanoseconds:n.mtimeNanoseconds,dev:n.dev,ino:n.ino,mode:n.mode||33188,uid:n.uid,gid:n.gid,size:n.size,path:t,oid:r,flags:{assumeValid:!1,extended:!1,stage:o,nameLength:i.length<4095?i.length:4095},stages:[]};this._addEntry(a),this._dirty=!0}delete({filepath:t}){if(this._entries.has(t))this._entries.delete(t);else for(const n of this._entries.keys())n.startsWith(t+"/")&&this._entries.delete(n);this._unmergedPaths.has(t)&&this._unmergedPaths.delete(t),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:t}){return this._entries.has(t)}render(){return this.entries.map(t=>`${t.mode.toString(8)} ${t.oid} ${t.path}`).join(`
|
|
10
10
|
`)}static async _entryToBuffer(t){const n=Buffer.from(t.path),r=Math.ceil((62+n.length+1)/8)*8,o=Buffer.alloc(r),i=new xr(o),a=Gi(t);return i.writeUInt32BE(a.ctimeSeconds),i.writeUInt32BE(a.ctimeNanoseconds),i.writeUInt32BE(a.mtimeSeconds),i.writeUInt32BE(a.mtimeNanoseconds),i.writeUInt32BE(a.dev),i.writeUInt32BE(a.ino),i.writeUInt32BE(a.mode),i.writeUInt32BE(a.uid),i.writeUInt32BE(a.gid),i.writeUInt32BE(a.size),i.write(t.oid,20,"hex"),i.writeUInt16BE(tL(t)),i.write(t.path,n.length,"utf8"),o}async toObject(){const t=Buffer.alloc(12),n=new xr(t);n.write("DIRC",4,"utf8"),n.writeUInt32BE(2),n.writeUInt32BE(this.entriesFlat.length);let r=[];for(const s of this.entries)if(r.push(ni._entryToBuffer(s)),s.stages.length>1)for(const l of s.stages)l&&l!==s&&r.push(ni._entryToBuffer(l));r=await Promise.all(r);const o=Buffer.concat(r),i=Buffer.concat([t,o]),a=await Ur(i);return Buffer.concat([i,Buffer.from(a,"hex")])}}function Uc(e,t,n=!0,r=!0){const o=Gi(e),i=Gi(t);return n&&o.mode!==i.mode||o.mtimeSeconds!==i.mtimeSeconds||o.ctimeSeconds!==i.ctimeSeconds||o.uid!==i.uid||o.gid!==i.gid||r&&o.ino!==i.ino||o.size!==i.size}let _h=null;const qi=Symbol("IndexCache");function nL(){return{map:new Map,stats:new Map}}async function rL(e,t,n){const r=await e.lstat(t),o=await e.read(t),i=await ni.from(o);n.map.set(t,i),n.stats.set(t,r)}async function oL(e,t,n){const r=n.stats.get(t);if(r===void 0)return!0;const o=await e.lstat(t);return r===null||o===null?!1:Uc(r,o)}class At{static async acquire({fs:t,gitdir:n,cache:r,allowUnmerged:o=!0},i){r[qi]||(r[qi]=nL());const a=`${n}/index`;_h===null&&(_h=new gs({maxPending:1/0}));let s,l=[];return await _h.acquire(a,async()=>{await oL(t,a,r[qi])&&await rL(t,a,r[qi]);const c=r[qi].map.get(a);if(l=c.unmergedPaths,l.length&&!o)throw new Is(l);if(s=await i(c),c._dirty){const u=await c.toObject();await t.write(a,u),r[qi].stats.set(a,await t.lstat(a)),c._dirty=!1}}),s}}function Wc(e){const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>-1&&(e=e.slice(t+1)),e}function Yi(e){const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?".":t===0?"/":e.slice(0,t)}function Cb(e){const t=new Map,n=function(o){if(!t.has(o)){const i={type:"tree",fullpath:o,basename:Wc(o),metadata:{},children:[]};t.set(o,i),i.parent=n(Yi(o)),i.parent&&i.parent!==i&&i.parent.children.push(i)}return t.get(o)},r=function(o,i){if(!t.has(o)){const a={type:"blob",fullpath:o,basename:Wc(o),metadata:i,parent:n(Yi(o)),children:[]};a.parent&&a.parent.children.push(a),t.set(o,a)}return t.get(o)};n(".");for(const o of e)r(o.path,o);return t}function iL(e){switch(e){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new je(`Unexpected GitTree entry mode: ${e.toString(8)}`)}class aL{constructor({fs:t,gitdir:n,cache:r}){this.treePromise=At.acquire({fs:t,gitdir:n,cache:r},async function(i){return Cb(i.entries)});const o=this;this.ConstructEntry=class{constructor(a){this._fullpath=a,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return o.type(this)}async mode(){return o.mode(this)}async stat(){return o.stat(this)}async content(){return o.content(this)}async oid(){return o.oid(this)}}}async readdir(t){const n=t._fullpath,o=(await this.treePromise).get(n);if(!o||o.type==="blob")return null;if(o.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${n}'`);const i=o.children.map(a=>a.fullpath);return i.sort(Vc),i}async type(t){return t._type===!1&&await t.stat(),t._type}async mode(t){return t._mode===!1&&await t.stat(),t._mode}async stat(t){if(t._stat===!1){const r=(await this.treePromise).get(t._fullpath);if(!r)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);const o=r.type==="tree"?{}:Gi(r.metadata);t._type=r.type==="tree"?"tree":iL(o.mode),t._mode=o.mode,r.type==="tree"?t._stat=void 0:t._stat=o}return t._stat}async content(t){}async oid(t){if(t._oid===!1){const r=(await this.treePromise).get(t._fullpath);t._oid=r.metadata.oid}return t._oid}}const Gc=Symbol("GitWalkSymbol");function Ki(){const e=Object.create(null);return Object.defineProperty(e,Gc,{value:function({fs:t,gitdir:n,cache:r}){return new aL({fs:t,gitdir:n,cache:r})}}),Object.freeze(e),e}class at extends Ye{constructor(t){super(`Could not find ${t}.`),this.code=this.name=at.code,this.data={what:t}}}at.code="NotFoundError";class en extends Ye{constructor(t,n,r,o){super(`Object ${t} ${o?`at ${o}`:""}was anticipated to be a ${r} but it is a ${n}.`),this.code=this.name=en.code,this.data={oid:t,actual:n,expected:r,filepath:o}}}en.code="ObjectTypeError";class mo extends Ye{constructor(t){super(`Expected a 40-char hex object id but saw "${t}".`),this.code=this.name=mo.code,this.data={value:t}}}mo.code="InvalidOidError";class Os extends Ye{constructor(t){super(`Could not find a fetch refspec for remote "${t}". Make sure the config file has an entry like the following:
|
|
11
11
|
[remote "${t}"]
|
|
12
12
|
fetch = +refs/heads/*:refs/remotes/origin/*
|
|
@@ -63,7 +63,7 @@ gpgsig`)),r=t.slice(t.indexOf(`-----END PGP SIGNATURE-----
|
|
|
63
63
|
gpgsig`+Th(a)+`
|
|
64
64
|
`+i;return mt.from(l)}}async function ra({fs:e,cache:t,gitdir:n,oid:r}){if(r==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:cn.from([]),oid:r};const{type:o,object:i}=await pt({fs:e,cache:t,gitdir:n,oid:r});if(o==="tag")return r=tn.from(i).parse().object,ra({fs:e,cache:t,gitdir:n,oid:r});if(o==="commit")return r=mt.from(i).parse().tree,ra({fs:e,cache:t,gitdir:n,oid:r});if(o!=="tree")throw new en(r,o,"tree");return{tree:cn.from(i),oid:r}}class zL{constructor({fs:t,gitdir:n,ref:r,cache:o}){this.fs=t,this.cache=o,this.gitdir=n,this.mapPromise=(async()=>{const a=new Map;let s;try{s=await ve.resolve({fs:t,gitdir:n,ref:r})}catch(c){c instanceof at&&(s="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}const l=await ra({fs:t,cache:this.cache,gitdir:n,oid:s});return l.type="tree",l.mode="40000",a.set(".",l),a})();const i=this;this.ConstructEntry=class{constructor(s){this._fullpath=s,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return i.type(this)}async mode(){return i.mode(this)}async stat(){return i.stat(this)}async content(){return i.content(this)}async oid(){return i.oid(this)}}}async readdir(t){const n=t._fullpath,{fs:r,cache:o,gitdir:i}=this,a=await this.mapPromise,s=a.get(n);if(!s)throw new Error(`No obj for ${n}`);const l=s.oid;if(!l)throw new Error(`No oid for obj ${JSON.stringify(s)}`);if(s.type!=="tree")return null;const{type:c,object:u}=await pt({fs:r,cache:o,gitdir:i,oid:l});if(c!==s.type)throw new en(l,c,s.type);const d=cn.from(u);for(const f of d)a.set(me.join(n,f.path),f);return d.entries().map(f=>me.join(n,f.path))}async type(t){if(t._type===!1){const n=await this.mapPromise,{type:r}=n.get(t._fullpath);t._type=r}return t._type}async mode(t){if(t._mode===!1){const n=await this.mapPromise,{mode:r}=n.get(t._fullpath);t._mode=xb(parseInt(r,8))}return t._mode}async stat(t){}async content(t){if(t._content===!1){const n=await this.mapPromise,{fs:r,cache:o,gitdir:i}=this,s=n.get(t._fullpath).oid,{type:l,object:c}=await pt({fs:r,cache:o,gitdir:i,oid:s});l!=="blob"?t._content=void 0:t._content=new Uint8Array(c)}return t._content}async oid(t){if(t._oid===!1){const r=(await this.mapPromise).get(t._fullpath);t._oid=r.oid}return t._oid}}function zn({ref:e="HEAD"}={}){const t=Object.create(null);return Object.defineProperty(t,Gc,{value:function({fs:n,gitdir:r,cache:o}){return new zL({fs:n,gitdir:r,ref:e,cache:o})}}),Object.freeze(t),t}class BL{constructor({fs:t,dir:n,gitdir:r,cache:o}){this.fs=t,this.cache=o,this.dir=n,this.gitdir=r;const i=this;this.ConstructEntry=class{constructor(s){this._fullpath=s,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return i.type(this)}async mode(){return i.mode(this)}async stat(){return i.stat(this)}async content(){return i.content(this)}async oid(){return i.oid(this)}}}async readdir(t){const n=t._fullpath,{fs:r,dir:o}=this,i=await r.readdir(me.join(o,n));return i===null?null:i.map(a=>me.join(n,a))}async type(t){return t._type===!1&&await t.stat(),t._type}async mode(t){return t._mode===!1&&await t.stat(),t._mode}async stat(t){if(t._stat===!1){const{fs:n,dir:r}=this;let o=await n.lstat(`${r}/${t._fullpath}`);if(!o)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);let i=o.isDirectory()?"tree":"blob";i==="blob"&&!o.isFile()&&!o.isSymbolicLink()&&(i="special"),t._type=i,o=Gi(o),t._mode=o.mode,o.size===-1&&t._actualSize&&(o.size=t._actualSize),t._stat=o}return t._stat}async content(t){if(t._content===!1){const{fs:n,dir:r,gitdir:o}=this;if(await t.type()==="tree")t._content=void 0;else{const a=await(await St.get({fs:n,gitdir:o})).get("core.autocrlf"),s=await n.read(`${r}/${t._fullpath}`,{autocrlf:a});t._actualSize=s.length,t._stat&&t._stat.size===-1&&(t._stat.size=t._actualSize),t._content=new Uint8Array(s)}}return t._content}async oid(t){if(t._oid===!1){const{fs:n,gitdir:r,cache:o}=this;let i;await At.acquire({fs:n,gitdir:r,cache:o},async function(a){const s=a.entriesMap.get(t._fullpath),l=await t.stat(),u=await(await St.get({fs:n,gitdir:r})).get("core.filemode"),d=typeof process<"u"?process.platform!=="win32":!0;!s||Uc(l,s,u,d)?await t.content()===void 0?i=void 0:(i=await Ur(Xi.wrap({type:"blob",object:await t.content()})),s&&i===s.oid&&(!u||l.mode===s.mode)&&Uc(l,s,u,d)&&a.insert({filepath:t._fullpath,stats:l,oid:i})):i=s.oid}),t._oid=i}return t._oid}}function Xs(){const e=Object.create(null);return Object.defineProperty(e,Gc,{value:function({fs:t,dir:n,gitdir:r,cache:o}){return new BL({fs:t,dir:n,gitdir:r,cache:o})}}),Object.freeze(e),e}function HL(e,t){const n=t-e;return Array.from({length:n},(r,o)=>e+o)}const Fb=typeof Array.prototype.flat>"u"?e=>e.reduce((t,n)=>t.concat(n),[]):e=>e.flat();class VL{constructor(){this.value=null}consider(t){t!=null&&(this.value===null?this.value=t:t<this.value&&(this.value=t))}reset(){this.value=null}}function*UL(e){const t=new VL;let n;const r=[],o=e.length;for(let i=0;i<o;i++)r[i]=e[i].next().value,r[i]!==void 0&&t.consider(r[i]);if(t.value!==null)for(;;){const i=[];n=t.value,t.reset();for(let a=0;a<o;a++)r[a]!==void 0&&r[a]===n?(i[a]=r[a],r[a]=e[a].next().value):i[a]=null,r[a]!==void 0&&t.consider(r[a]);if(yield i,t.value===null)return}}async function yo({fs:e,cache:t,dir:n,gitdir:r,trees:o,map:i=async(l,c)=>c,reduce:a=async(l,c)=>{const u=Fb(c);return l!==void 0&&u.unshift(l),u},iterate:s=(l,c)=>Promise.all([...c].map(l))}){const l=o.map(h=>h[Gc]({fs:e,dir:n,gitdir:r,cache:t})),c=new Array(l.length).fill("."),u=HL(0,l.length),d=async h=>{u.map(v=>{h[v]=h[v]&&new l[v].ConstructEntry(h[v])});const m=(await Promise.all(u.map(v=>h[v]?l[v].readdir(h[v]):[]))).map(v=>v===null?[]:v).map(v=>v[Symbol.iterator]());return{entries:h,children:UL(m)}},f=async h=>{const{entries:p,children:m}=await d(h),v=p.find(b=>b&&b._fullpath)._fullpath,w=await i(v,p);if(w!==null){let b=await s(f,m);return b=b.filter(x=>x!==void 0),a(w,b)}};return f(c)}async function Mh(e,t){const n=await e.readdir(t);n==null?await e.rm(t):n.length?await Promise.all(n.map(r=>{const o=me.join(t,r);return e.lstat(o).then(i=>{if(i)return i.isDirectory()?Mh(e,o):e.rm(o)})})).then(()=>e.rmdir(t)):await e.rmdir(t)}function WL(e){return GL(e)&&Lb(e.then)&&Lb(e.catch)}function GL(e){return e&&typeof e=="object"}function Lb(e){return typeof e=="function"}function zb(e){return WL((n=>{try{return n.readFile().catch(r=>r)}catch(r){return r}})(e))}const Bb=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function Hb(e,t){if(zb(t))for(const n of Bb)e[`_${n}`]=t[n].bind(t);else for(const n of Bb)e[`_${n}`]=gh(t[n].bind(t));zb(t)?t.rm?e._rm=t.rm.bind(t):t.rmdir.length>1?e._rm=t.rmdir.bind(t):e._rm=Mh.bind(null,e):t.rm?e._rm=gh(t.rm.bind(t)):t.rmdir.length>2?e._rm=gh(t.rmdir.bind(t)):e._rm=Mh.bind(null,e)}class Ne{constructor(t){if(typeof t._original_unwrapped_fs<"u")return t;const n=Object.getOwnPropertyDescriptor(t,"promises");n&&n.enumerable?Hb(this,t.promises):Hb(this,t),this._original_unwrapped_fs=t}async exists(t,n={}){try{return await this._stat(t),!0}catch(r){if(r.code==="ENOENT"||r.code==="ENOTDIR"||(r.code||"").includes("ENS"))return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',r),r}}async read(t,n={}){try{let r=await this._readFile(t,n);if(n.autocrlf==="true")try{r=new TextDecoder("utf8",{fatal:!0}).decode(r),r=r.replace(/\r\n/g,`
|
|
65
65
|
`),r=new TextEncoder().encode(r)}catch{}return typeof r!="string"&&(r=Buffer.from(r)),r}catch{return null}}async write(t,n,r={}){try{await this._writeFile(t,n,r);return}catch{await this.mkdir(Yi(t)),await this._writeFile(t,n,r)}}async mkdir(t,n=!1){try{await this._mkdir(t);return}catch(r){if(r===null||r.code==="EEXIST")return;if(n)throw r;if(r.code==="ENOENT"){const o=Yi(t);if(o==="."||o==="/"||o===t)throw r;await this.mkdir(o),await this.mkdir(t,!0)}}}async rm(t){try{await this._unlink(t)}catch(n){if(n.code!=="ENOENT")throw n}}async rmdir(t,n){try{n&&n.recursive?await this._rm(t,n):await this._rmdir(t)}catch(r){if(r.code!=="ENOENT")throw r}}async readdir(t){try{const n=await this._readdir(t);return n.sort(Vc),n}catch(n){return n.code==="ENOTDIR"?null:[]}}async readdirDeep(t){const n=await this._readdir(t);return(await Promise.all(n.map(async o=>{const i=t+"/"+o;return(await this._stat(i)).isDirectory()?this.readdirDeep(i):i}))).reduce((o,i)=>o.concat(i),[])}async lstat(t){try{return await this._lstat(t)}catch(n){if(n.code==="ENOENT"||(n.code||"").includes("ENS"))return null;throw n}}async readlink(t,n={encoding:"buffer"}){try{const r=await this._readlink(t,n);return Buffer.isBuffer(r)?r:Buffer.from(r)}catch(r){if(r.code==="ENOENT"||(r.code||"").includes("ENS"))return null;throw r}}async writelink(t,n){return this._symlink(n.toString("utf8"),t)}}function X(e,t){if(t===void 0)throw new un(e)}async function Jc(e,t){return!e&&!t?!1:e&&!t||!e&&t?!0:!(await e.type()==="tree"&&await t.type()==="tree"||await e.type()===await t.type()&&await e.mode()===await t.mode()&&await e.oid()===await t.oid())}async function qL({fs:e,dir:t,gitdir:n=me.join(t,".git"),commit:r="HEAD",cache:o={}}){try{X("fs",e),X("dir",t),X("gitdir",n);const i=new Ne(e),a=[zn({ref:r}),Xs(),Ki()];let s=[];await At.acquire({fs:i,gitdir:n,cache:o},async function(c){s=c.unmergedPaths});const l=await yo({fs:i,cache:o,dir:t,gitdir:n,trees:a,map:async function(c,[u,d,f]){const h=!await Jc(d,f),p=s.includes(c),m=!await Jc(f,u);if(h||p)return u?{path:c,mode:await u.mode(),oid:await u.oid(),type:await u.type(),content:await u.content()}:void 0;if(m)return!1;throw new Ys(c)}});await At.acquire({fs:i,gitdir:n,cache:o},async function(c){for(const u of l)if(u!==!1){if(!u){await i.rmdir(`${t}/${u.path}`,{recursive:!0}),c.delete({filepath:u.path});continue}if(u.type==="blob"){const d=new TextDecoder().decode(u.content);await i.write(`${t}/${u.path}`,d,{mode:u.mode}),c.insert({filepath:u.path,oid:u.oid,stage:0})}}})}catch(i){throw i.caller="git.abortMerge",i}}class oa{static async isIgnored({fs:t,dir:n,gitdir:r=me.join(n,".git"),filepath:o}){if(Wc(o)===".git")return!0;if(o===".")return!1;let i="";const a=me.join(r,"info","exclude");await t.exists(a)&&(i=await t.read(a,"utf8"));const s=[{gitignore:me.join(n,".gitignore"),filepath:o}],l=o.split("/").filter(Boolean);for(let u=1;u<l.length;u++){const d=l.slice(0,u).join("/"),f=l.slice(u).join("/");s.push({gitignore:me.join(n,d,".gitignore"),filepath:f})}let c=!1;for(const u of s){let d;try{d=await t.read(u.gitignore,"utf8")}catch(p){if(p.code==="NOENT")continue}const f=zF().add(i);f.add(d);const h=Yi(u.filepath);if(h!=="."&&f.ignores(h))return!0;c?c=!f.test(u.filepath).unignored:c=f.test(u.filepath).ignored}return c}}async function YL({fs:e,gitdir:t,object:n,format:r,oid:o}){if(r!=="deflated")throw new je("GitObjectStoreLoose expects objects to write to be in deflated format");const i=`objects/${o.slice(0,2)}/${o.slice(2)}`,a=`${t}/${i}`;await e.exists(a)||await e.write(a,n)}let kh=null;async function Vb(e){return kh===null&&(kh=XL()),kh?KL(e):mh.deflate(e)}async function KL(e){const t=new CompressionStream("deflate"),n=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}function XL(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch{return!1}}async function dn({fs:e,gitdir:t,type:n,object:r,format:o="content",oid:i=void 0,dryRun:a=!1}){return o!=="deflated"&&(o!=="wrapped"&&(r=Xi.wrap({type:n,object:r})),i=await Ur(r),r=Buffer.from(await Vb(r))),a||await YL({fs:e,gitdir:t,object:r,format:"deflated",oid:i}),i}function Ub(e){let t;for(;~(t=e.indexOf(92));)e[t]=47;return e}async function ZL({fs:e,dir:t,gitdir:n=me.join(t,".git"),filepath:r,cache:o={},force:i=!1,parallel:a=!0}){try{X("fs",e),X("dir",t),X("gitdir",n),X("filepath",r);const s=new Ne(e);await At.acquire({fs:s,gitdir:n,cache:o},async l=>Dh({dir:t,gitdir:n,fs:s,filepath:r,index:l,force:i,parallel:a}))}catch(s){throw s.caller="git.add",s}}async function Dh({dir:e,gitdir:t,fs:n,filepath:r,index:o,force:i,parallel:a}){r=Array.isArray(r)?r:[r];const s=r.map(async d=>{if(!i&&await oa.isIgnored({fs:n,dir:e,gitdir:t,filepath:d}))return;const f=await n.lstat(me.join(e,d));if(!f)throw new at(d);if(f.isDirectory()){const h=await n.readdir(me.join(e,d));if(a){const p=h.map(m=>Dh({dir:e,gitdir:t,fs:n,filepath:[me.join(d,m)],index:o,force:i,parallel:a}));await Promise.all(p)}else for(const p of h)await Dh({dir:e,gitdir:t,fs:n,filepath:[me.join(d,p)],index:o,force:i,parallel:a})}else{const p=await(await St.get({fs:n,gitdir:t})).get("core.autocrlf"),m=f.isSymbolicLink()?await n.readlink(me.join(e,d)).then(Ub):await n.read(me.join(e,d),{autocrlf:p});if(m===null)throw new at(d);const v=await dn({fs:n,gitdir:t,type:"blob",object:m});o.insert({filepath:d,stats:f,oid:v})}}),l=await Promise.allSettled(s),c=l.filter(d=>d.status==="rejected").map(d=>d.reason);if(c.length>1)throw new Us(c);if(c.length===1)throw c[0];return l.filter(d=>d.status==="fulfilled"&&d.value).map(d=>d.value)}async function Zs({fs:e,gitdir:t,path:n}){return(await St.get({fs:e,gitdir:t})).get(n)}function Wb(e,...t){for(const n of t)if(n)for(const r of Object.keys(n)){const o=n[r];o!==void 0&&(e[r]=o)}return e}async function bo({fs:e,gitdir:t,author:n,commit:r}){const o=Math.floor(Date.now()/1e3),i={name:await Zs({fs:e,gitdir:t,path:"user.name"}),email:await Zs({fs:e,gitdir:t,path:"user.email"})||"",timestamp:o,timezoneOffset:new Date(o*1e3).getTimezoneOffset()},a=Wb({},i,r?r.author:void 0,n);if(a.name!==void 0)return a}async function ia({fs:e,gitdir:t,author:n,committer:r,commit:o}){const i=Math.floor(Date.now()/1e3),a={name:await Zs({fs:e,gitdir:t,path:"user.name"}),email:await Zs({fs:e,gitdir:t,path:"user.email"})||"",timestamp:i,timezoneOffset:new Date(i*1e3).getTimezoneOffset()},s=Wb({},a,o?o.committer:void 0,n,r);if(s.name!==void 0)return s}async function Gb({fs:e,cache:t,gitdir:n,oid:r}){const{type:o,object:i}=await pt({fs:e,cache:t,gitdir:n,oid:r});if(o==="tag")return r=tn.from(i).parse().object,Gb({fs:e,cache:t,gitdir:n,oid:r});if(o!=="commit")throw new en(r,o,"commit");return{commit:mt.from(i),oid:r}}async function aa({fs:e,cache:t,gitdir:n,oid:r}){const{commit:o,oid:i}=await Gb({fs:e,cache:t,gitdir:n,oid:r});return{oid:i,commit:o.parse(),payload:o.withoutSignature()}}async function Qc({fs:e,cache:t,onSign:n,gitdir:r,message:o,author:i,committer:a,signingKey:s,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:d,parent:f,tree:h}){let p=!1;d||(d=await ve.resolve({fs:e,gitdir:r,ref:"HEAD",depth:2}));let m,v;try{m=await ve.resolve({fs:e,gitdir:r,ref:d}),v=await aa({fs:e,gitdir:r,oid:m,cache:{}})}catch{p=!0}if(l&&p)throw new Ks(d);const w=l?await bo({fs:e,gitdir:r,author:i,commit:v.commit}):await bo({fs:e,gitdir:r,author:i});if(!w)throw new Ht("author");const b=l?await ia({fs:e,gitdir:r,author:w,committer:a,commit:v.commit}):await ia({fs:e,gitdir:r,author:w,committer:a});if(!b)throw new Ht("committer");return At.acquire({fs:e,gitdir:r,cache:t,allowUnmerged:!1},async function(x){const C=Cb(x.entries).get(".");if(h||(h=await qb({fs:e,gitdir:r,inode:C,dryRun:c})),f?f=await Promise.all(f.map(T=>ve.resolve({fs:e,gitdir:r,ref:T}))):l?f=v.commit.parent:f=m?[m]:[],!o)if(l)o=v.commit.message;else throw new un("message");let N=mt.from({tree:h,parent:f,author:w,committer:b,message:o});s&&(N=await mt.sign(N,n,s));const R=await dn({fs:e,gitdir:r,type:"commit",object:N.toObject(),dryRun:c});return!u&&!c&&await ve.writeRef({fs:e,gitdir:r,ref:d,value:R}),R})}async function qb({fs:e,gitdir:t,inode:n,dryRun:r}){const o=n.children;for(const l of o)l.type==="tree"&&(l.metadata.mode="040000",l.metadata.oid=await qb({fs:e,gitdir:t,inode:l,dryRun:r}));const i=o.map(l=>({mode:l.metadata.mode,path:l.basename,oid:l.metadata.oid,type:l.type})),a=cn.from(i);return await dn({fs:e,gitdir:t,type:"tree",object:a.toObject(),dryRun:r})}async function Js({fs:e,cache:t,gitdir:n,oid:r,filepath:o}){if(o.startsWith("/"))throw new wo("leading-slash");if(o.endsWith("/"))throw new wo("trailing-slash");const i=r,a=await ra({fs:e,cache:t,gitdir:n,oid:r}),s=a.tree;if(o==="")r=a.oid;else{const l=o.split("/");r=await Yb({fs:e,cache:t,gitdir:n,tree:s,pathArray:l,oid:i,filepath:o})}return r}async function Yb({fs:e,cache:t,gitdir:n,tree:r,pathArray:o,oid:i,filepath:a}){const s=o.shift();for(const l of r)if(l.path===s){if(o.length===0)return l.oid;{const{type:c,object:u}=await pt({fs:e,cache:t,gitdir:n,oid:l.oid});if(c!=="tree")throw new en(i,c,"tree",a);return r=cn.from(u),Yb({fs:e,cache:t,gitdir:n,tree:r,pathArray:o,oid:i,filepath:a})}}throw new at(`file or directory found at "${i}:${a}"`)}async function sa({fs:e,cache:t,gitdir:n,oid:r,filepath:o=void 0}){o!==void 0&&(r=await Js({fs:e,cache:t,gitdir:n,oid:r,filepath:o}));const{tree:i,oid:a}=await ra({fs:e,cache:t,gitdir:n,oid:r});return{oid:a,tree:i.entries()}}async function Qs({fs:e,gitdir:t,tree:n}){const r=cn.from(n).toObject();return await dn({fs:e,gitdir:t,type:"tree",object:r,format:"content"})}async function JL({fs:e,cache:t,onSign:n,gitdir:r,ref:o,oid:i,note:a,force:s,author:l,committer:c,signingKey:u}){let d;try{d=await ve.resolve({gitdir:r,fs:e,ref:o})}catch(w){if(!(w instanceof at))throw w}let h=(await sa({fs:e,cache:t,gitdir:r,oid:d||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(s)h=h.filter(w=>w.path!==i);else for(const w of h)if(w.path===i)throw new qn("note",i);typeof a=="string"&&(a=Buffer.from(a,"utf8"));const p=await dn({fs:e,gitdir:r,type:"blob",object:a,format:"content"});h.push({mode:"100644",path:i,oid:p,type:"blob"});const m=await Qs({fs:e,gitdir:r,tree:h});return await Qc({fs:e,cache:t,onSign:n,gitdir:r,ref:o,tree:m,parent:d&&[d],message:`Note added by 'isomorphic-git addNote'
|
|
66
|
-
`,author:l,committer:c,signingKey:u})}async function QL({fs:e,onSign:t,dir:n,gitdir:r=me.join(n,".git"),ref:o="refs/notes/commits",oid:i,note:a,force:s,author:l,committer:c,signingKey:u,cache:d={}}){try{X("fs",e),X("gitdir",r),X("oid",i),X("note",a),u&&X("onSign",t);const f=new Ne(e),h=await bo({fs:f,gitdir:r,author:l});if(!h)throw new Ht("author");const p=await ia({fs:f,gitdir:r,author:h,committer:c});if(!p)throw new Ht("committer");return await JL({fs:new Ne(f),cache:d,onSign:t,gitdir:r,ref:o,oid:i,note:a,force:s,author:h,committer:p,signingKey:u})}catch(f){throw f.caller="git.addNote",f}}async function Kb({fs:e,gitdir:t,remote:n,url:r,force:o}){if(n!==br.clean(n))throw new Yn(n,br.clean(n));const i=await St.get({fs:e,gitdir:t});if(!o&&(await i.getSubsections("remote")).includes(n)&&r!==await i.get(`remote.${n}.url`))throw new qn("remote",n);await i.set(`remote.${n}.url`,r),await i.set(`remote.${n}.fetch`,`+refs/heads/*:refs/remotes/${n}/*`),await St.save({fs:e,gitdir:t,config:i})}async function ez({fs:e,dir:t,gitdir:n=me.join(t,".git"),remote:r,url:o,force:i=!1}){try{return X("fs",e),X("gitdir",n),X("remote",r),X("url",o),await Kb({fs:new Ne(e),gitdir:n,remote:r,url:o,force:i})}catch(a){throw a.caller="git.addRemote",a}}async function tz({fs:e,cache:t,onSign:n,gitdir:r,ref:o,tagger:i,message:a=o,gpgsig:s,object:l,signingKey:c,force:u=!1}){if(o=o.startsWith("refs/tags/")?o:`refs/tags/${o}`,!u&&await ve.exists({fs:e,gitdir:r,ref:o}))throw new qn("tag",o);const d=await ve.resolve({fs:e,gitdir:r,ref:l||"HEAD"}),{type:f}=await pt({fs:e,cache:t,gitdir:r,oid:d});let h=tn.from({object:d,type:f,tag:o.replace("refs/tags/",""),tagger:i,message:a,gpgsig:s});c&&(h=await tn.sign(h,n,c));const p=await dn({fs:e,gitdir:r,type:"tag",object:h.toObject()});await ve.writeRef({fs:e,gitdir:r,ref:o,value:p})}async function nz({fs:e,onSign:t,dir:n,gitdir:r=me.join(n,".git"),ref:o,tagger:i,message:a=o,gpgsig:s,object:l,signingKey:c,force:u=!1,cache:d={}}){try{X("fs",e),X("gitdir",r),X("ref",o),c&&X("onSign",t);const f=new Ne(e),h=await bo({fs:f,gitdir:r,author:i});if(!h)throw new Ht("tagger");return await tz({fs:f,cache:d,onSign:t,gitdir:r,ref:o,tagger:h,message:a,gpgsig:s,object:l,signingKey:c,force:u})}catch(f){throw f.caller="git.annotatedTag",f}}async function rz({fs:e,gitdir:t,ref:n,object:r,checkout:o=!1,force:i=!1}){if(n!==br.clean(n))throw new Yn(n,br.clean(n));const a=`refs/heads/${n}`;if(!i&&await ve.exists({fs:e,gitdir:t,ref:a}))throw new qn("branch",n,!1);let s;try{s=await ve.resolve({fs:e,gitdir:t,ref:r||"HEAD"})}catch{}s&&await ve.writeRef({fs:e,gitdir:t,ref:a,value:s}),o&&await ve.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:a})}async function oz({fs:e,dir:t,gitdir:n=me.join(t,".git"),ref:r,object:o,checkout:i=!1,force:a=!1}){try{return X("fs",e),X("gitdir",n),X("ref",r),await rz({fs:new Ne(e),gitdir:n,ref:r,object:o,checkout:i,force:a})}catch(s){throw s.caller="git.branch",s}}const Xb=(e,t)=>e==="."||t==null||t.length===0||t==="."?!0:t.length>=e.length?t.startsWith(e):e.startsWith(t);async function Ah({fs:e,cache:t,onProgress:n,onPostCheckout:r,dir:o,gitdir:i,remote:a,ref:s,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:d,force:f,track:h=!0}){let p;if(r)try{p=await ve.resolve({fs:e,gitdir:i,ref:"HEAD"})}catch{p="0000000000000000000000000000000000000000"}let m;try{m=await ve.resolve({fs:e,gitdir:i,ref:s})}catch(v){if(s==="HEAD")throw v;const w=`${a}/${s}`;if(m=await ve.resolve({fs:e,gitdir:i,ref:w}),h){const b=await St.get({fs:e,gitdir:i});await b.set(`branch.${s}.remote`,a),await b.set(`branch.${s}.merge`,`refs/heads/${s}`),await St.save({fs:e,gitdir:i,config:b})}await ve.writeRef({fs:e,gitdir:i,ref:`refs/heads/${s}`,value:m})}if(!c){let v;try{v=await iz({fs:e,cache:t,onProgress:n,dir:o,gitdir:i,ref:s,force:f,filepaths:l})}catch(C){throw C instanceof at&&C.data.what===m?new Ls(s,m):C}const w=v.filter(([C])=>C==="conflict").map(([C,N])=>N);if(w.length>0)throw new Fs(w);const b=v.filter(([C])=>C==="error").map(([C,N])=>N);if(b.length>0)throw new je(b.join(", "));if(d){r&&await r({previousHead:p,newHead:m,type:l!=null&&l.length>0?"file":"branch"});return}let x=0;const _=v.length;await At.acquire({fs:e,gitdir:i,cache:t},async function(C){await Promise.all(v.filter(([N])=>N==="delete"||N==="delete-index").map(async function([N,R]){const T=`${o}/${R}`;N==="delete"&&await e.rm(T),C.delete({filepath:R}),n&&await n({phase:"Updating workdir",loaded:++x,total:_})}))}),await At.acquire({fs:e,gitdir:i,cache:t},async function(C){for(const[N,R]of v)if(N==="rmdir"||N==="rmdir-index"){const T=`${o}/${R}`;try{N==="rmdir-index"&&C.delete({filepath:R}),await e.rmdir(T),n&&await n({phase:"Updating workdir",loaded:++x,total:_})}catch(M){if(M.code==="ENOTEMPTY")console.log(`Did not delete ${R} because directory is not empty`);else throw M}}}),await Promise.all(v.filter(([C])=>C==="mkdir"||C==="mkdir-index").map(async function([C,N]){const R=`${o}/${N}`;await e.mkdir(R),n&&await n({phase:"Updating workdir",loaded:++x,total:_})})),await At.acquire({fs:e,gitdir:i,cache:t},async function(C){await Promise.all(v.filter(([N])=>N==="create"||N==="create-index"||N==="update"||N==="mkdir-index").map(async function([N,R,T,M,D]){const A=`${o}/${R}`;try{if(N!=="create-index"&&N!=="mkdir-index"){const{object:$}=await pt({fs:e,cache:t,gitdir:i,oid:T});if(D&&await e.rm(A),M===33188)await e.write(A,$);else if(M===33261)await e.write(A,$,{mode:511});else if(M===40960)await e.writelink(A,$);else throw new je(`Invalid mode 0o${M.toString(8)} detected in blob ${T}`)}const j=await e.lstat(A);M===33261&&(j.mode=493),N==="mkdir-index"&&(j.mode=57344),C.insert({filepath:R,stats:j,oid:T}),n&&await n({phase:"Updating workdir",loaded:++x,total:_})}catch(j){console.log(j)}}))}),r&&await r({previousHead:p,newHead:m,type:l!=null&&l.length>0?"file":"branch"})}if(!u){const v=await ve.expand({fs:e,gitdir:i,ref:s});v.startsWith("refs/heads")?await ve.writeSymbolicRef({fs:e,gitdir:i,ref:"HEAD",value:v}):await ve.writeRef({fs:e,gitdir:i,ref:"HEAD",value:m})}}async function iz({fs:e,cache:t,onProgress:n,dir:r,gitdir:o,ref:i,force:a,filepaths:s}){let l=0;return yo({fs:e,cache:t,dir:r,gitdir:o,trees:[zn({ref:i}),Xs(),Ki()],map:async function(c,[u,d,f]){if(c===".")return;if(s&&!s.some(p=>Xb(c,p)))return null;switch(n&&await n({phase:"Analyzing workdir",loaded:++l}),[!!f,!!u,!!d].map(Number).join("")){case"000":return;case"001":return a&&s&&s.includes(c)?["delete",c]:void 0;case"010":switch(await u.type()){case"tree":return["mkdir",c];case"blob":return["create",c,await u.oid(),await u.mode()];case"commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`new entry Unhandled type ${await u.type()}`]}case"011":switch(`${await u.type()}-${await d.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",c];case"blob-blob":return await u.oid()!==await d.oid()?a?["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()]:["conflict",c]:await u.mode()!==await d.mode()?a?["update",c,await u.oid(),await u.mode(),!0]:["conflict",c]:["create-index",c,await u.oid(),await u.mode()];case"commit-tree":return;case"commit-blob":return["conflict",c];default:return["error",`new entry Unhandled type ${u.type}`]}case"100":return["delete-index",c];case"101":switch(await f.type()){case"tree":return["rmdir",c];case"blob":return await f.oid()!==await d.oid()?a?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await f.type()}`]}case"110":case"111":switch(`${await f.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await f.oid()===await u.oid()&&await f.mode()===await u.mode()&&!a)return;if(d){if(await d.oid()!==await f.oid()&&await d.oid()!==await u.oid())return a?["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()]:["conflict",c]}else if(a)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()];return await u.mode()!==await f.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await f.oid()?["update",c,await u.oid(),await u.mode(),!1]:void 0}case"tree-blob":return["update-dir-to-blob",c,await u.oid()];case"blob-tree":return["update-blob-to-tree",c];case"commit-commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`update entry Unhandled type ${await f.type()}-${await u.type()}`]}}},reduce:async function(c,u){return u=Fb(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u}})}async function Zb({fs:e,onProgress:t,onPostCheckout:n,dir:r,gitdir:o=me.join(r,".git"),remote:i="origin",ref:a,filepaths:s,noCheckout:l=!1,noUpdateHead:c=a===void 0,dryRun:u=!1,force:d=!1,track:f=!0,cache:h={}}){try{X("fs",e),X("dir",r),X("gitdir",o);const p=a||"HEAD";return await Ah({fs:new Ne(e),cache:h,onProgress:t,onPostCheckout:n,dir:r,gitdir:o,remote:i,ref:p,filepaths:s,noCheckout:l,noUpdateHead:c,dryRun:u,force:d,track:f})}catch(p){throw p.caller="git.checkout",p}}const az=new RegExp("^refs/(heads/|tags/|remotes/)?(.*)");function oi(e){const t=az.exec(e);return t?t[1]==="remotes/"&&e.endsWith("/HEAD")?t[2].slice(0,-5):t[2]:e}async function xo({fs:e,gitdir:t,fullname:n=!1,test:r=!1}){const o=await ve.resolve({fs:e,gitdir:t,ref:"HEAD",depth:2});if(r)try{await ve.resolve({fs:e,gitdir:t,ref:o})}catch{return}if(o.startsWith("refs/"))return n?o:oi(o)}function sz(e){return e=e.replace(/^git@([^:]+):/,"https://$1/"),e=e.replace(/^ssh:\/\//,"https://"),e}function Jb({username:e="",password:t=""}){return`Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`}async function el(e,t){const n=Ob(e);for(;;){const{value:r,done:o}=await n.next();if(r&&await t(r),o)break}n.return&&n.return()}async function eu(e){let t=0;const n=[];await el(e,i=>{n.push(i),t+=i.byteLength});const r=new Uint8Array(t);let o=0;for(const i of n)r.set(i,o),o+=i.byteLength;return r}function Qb(e){let t=e.match(/^https?:\/\/([^/]+)@/);if(t==null)return{url:e,auth:{}};t=t[1];const[n,r]=t.split(":");return e=e.replace(`${t}@`,""),{url:e,auth:{username:n,password:r}}}function Ih(e,t){const n=t.toString(16);return"0".repeat(e-n.length)+n}class Ct{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(t){typeof t=="string"&&(t=Buffer.from(t));const n=t.length+4,r=Ih(4,n);return Buffer.concat([Buffer.from(r,"utf8"),t])}static streamReader(t){const n=new jb(t);return async function(){try{let o=await n.read(4);if(o==null)return!0;if(o=parseInt(o.toString("utf8"),16),o===0||o===1)return null;const i=await n.read(o-4);return i??!0}catch(o){return t.error=o,!0}}}}async function ex(e){const t={};let n;for(;n=await e(),n!==!0;){if(n===null)continue;n=n.toString("utf8").replace(/\n$/,"");const r=n.indexOf("=");if(r>-1){const o=n.slice(0,r),i=n.slice(r+1);t[o]=i}else t[n]=!0}return{protocolVersion:2,capabilities2:t}}async function tx(e,{service:t}){const n=new Set,r=new Map,o=new Map,i=Ct.streamReader(e);let a=await i();for(;a===null;)a=await i();if(a===!0)throw new zs;if(a.includes("version 2"))return ex(i);if(a.toString("utf8").replace(/\n$/,"")!==`# service=${t}`)throw new ri(`# service=${t}\\n`,a.toString("utf8"));let s=await i();for(;s===null;)s=await i();if(s===!0)return{capabilities:n,refs:r,symrefs:o};if(s=s.toString("utf8"),s.includes("version 2"))return ex(i);const[l,c]=Oh(s,"\0","\\x00");if(c.split(" ").map(u=>n.add(u)),l!=="0000000000000000000000000000000000000000 capabilities^{}"){const[u,d]=Oh(l," "," ");for(r.set(d,u);;){const f=await i();if(f===!0)break;if(f!==null){const[h,p]=Oh(f.toString("utf8")," "," ");r.set(p,h)}}}for(const u of n)if(u.startsWith("symref=")){const d=u.match(/symref=([^:]+):(.*)/);d.length===3&&o.set(d[1],d[2])}return{protocolVersion:1,capabilities:n,refs:r,symrefs:o}}function Oh(e,t,n){const r=e.trim().split(t);if(r.length!==2)throw new ri(`Two strings separated by '${n}'`,e.toString("utf8"));return r}const nx=(e,t)=>e.endsWith("?")?`${e}${t}`:`${e}/${t.replace(/^https?:\/\//,"")}`,rx=(e,t)=>{(t.username||t.password)&&(e.Authorization=Jb(t)),t.headers&&Object.assign(e,t.headers)},jh=async e=>{try{const t=Buffer.from(await eu(e.body)),n=t.toString("utf8");return{preview:n.length<256?n:n.slice(0,256)+"...",response:n,data:t}}catch{return{}}};class tu{static async capabilities(){return["discover","connect"]}static async discover({http:t,onProgress:n,onAuth:r,onAuthSuccess:o,onAuthFailure:i,corsProxy:a,service:s,url:l,headers:c,protocolVersion:u}){let{url:d,auth:f}=Qb(l);const h=a?nx(a,d):d;(f.username||f.password)&&(c.Authorization=Jb(f)),u===2&&(c["Git-Protocol"]="version=2");let p,m,v=!1;do if(p=await t.request({onProgress:n,method:"GET",url:`${h}/info/refs?service=${s}`,headers:c}),m=!1,p.statusCode===401||p.statusCode===203){const w=v?i:r;if(w){if(f=await w(d,{...f,headers:{...c}}),f&&f.cancel)throw new na;f&&(rx(c,f),v=!0,m=!0)}}else p.statusCode===200&&v&&o&&await o(d,f);while(m);if(p.statusCode!==200){const{response:w}=await jh(p);throw new Ji(p.statusCode,p.statusMessage,w)}if(p.headers["content-type"]===`application/x-${s}-advertisement`){const w=await tx(p.body,{service:s});return w.auth=f,w}else{const{preview:w,response:b,data:x}=await jh(p);try{const _=await tx([x],{service:s});return _.auth=f,_}catch{throw new Ws(w,b)}}}static async connect({http:t,onProgress:n,corsProxy:r,service:o,url:i,auth:a,body:s,headers:l}){const c=Qb(i);c&&(i=c.url),r&&(i=nx(r,i)),l["content-type"]=`application/x-${o}-request`,l.accept=`application/x-${o}-result`,rx(l,a);const u=await t.request({onProgress:n,method:"POST",url:`${i}/${o}`,body:s,headers:l});if(u.statusCode!==200){const{response:d}=jh(u);throw new Ji(u.statusCode,u.statusMessage,d)}return u}}function lz({url:e}){if(e.startsWith("git@"))return{transport:"ssh",address:e};const t=e.match(/(\w+)(:\/\/|::)(.*)/);if(t!==null){if(t[2]==="://")return{transport:t[1],address:t[0]};if(t[2]==="::")return{transport:t[1],address:t[3]}}}class nu{static getRemoteHelperFor({url:t}){const n=new Map;n.set("http",tu),n.set("https",tu);const r=lz({url:t});if(!r)throw new qs(t);if(n.has(r.transport))return n.get(r.transport);throw new Gs(t,r.transport,r.transport==="ssh"?sz(t):void 0)}}let ii=null;class tl{static async read({fs:t,gitdir:n}){ii===null&&(ii=new gs);const r=me.join(n,"shallow"),o=new Set;return await ii.acquire(r,async function(){const i=await t.read(r,{encoding:"utf8"});if(i===null||i.trim()==="")return o;i.trim().split(`
|
|
66
|
+
`,author:l,committer:c,signingKey:u})}async function QL({fs:e,onSign:t,dir:n,gitdir:r=me.join(n,".git"),ref:o="refs/notes/commits",oid:i,note:a,force:s,author:l,committer:c,signingKey:u,cache:d={}}){try{X("fs",e),X("gitdir",r),X("oid",i),X("note",a),u&&X("onSign",t);const f=new Ne(e),h=await bo({fs:f,gitdir:r,author:l});if(!h)throw new Ht("author");const p=await ia({fs:f,gitdir:r,author:h,committer:c});if(!p)throw new Ht("committer");return await JL({fs:new Ne(f),cache:d,onSign:t,gitdir:r,ref:o,oid:i,note:a,force:s,author:h,committer:p,signingKey:u})}catch(f){throw f.caller="git.addNote",f}}async function Kb({fs:e,gitdir:t,remote:n,url:r,force:o}){if(n!==br.clean(n))throw new Yn(n,br.clean(n));const i=await St.get({fs:e,gitdir:t});if(!o&&(await i.getSubsections("remote")).includes(n)&&r!==await i.get(`remote.${n}.url`))throw new qn("remote",n);await i.set(`remote.${n}.url`,r),await i.set(`remote.${n}.fetch`,`+refs/heads/*:refs/remotes/${n}/*`),await St.save({fs:e,gitdir:t,config:i})}async function ez({fs:e,dir:t,gitdir:n=me.join(t,".git"),remote:r,url:o,force:i=!1}){try{return X("fs",e),X("gitdir",n),X("remote",r),X("url",o),await Kb({fs:new Ne(e),gitdir:n,remote:r,url:o,force:i})}catch(a){throw a.caller="git.addRemote",a}}async function tz({fs:e,cache:t,onSign:n,gitdir:r,ref:o,tagger:i,message:a=o,gpgsig:s,object:l,signingKey:c,force:u=!1}){if(o=o.startsWith("refs/tags/")?o:`refs/tags/${o}`,!u&&await ve.exists({fs:e,gitdir:r,ref:o}))throw new qn("tag",o);const d=await ve.resolve({fs:e,gitdir:r,ref:l||"HEAD"}),{type:f}=await pt({fs:e,cache:t,gitdir:r,oid:d});let h=tn.from({object:d,type:f,tag:o.replace("refs/tags/",""),tagger:i,message:a,gpgsig:s});c&&(h=await tn.sign(h,n,c));const p=await dn({fs:e,gitdir:r,type:"tag",object:h.toObject()});await ve.writeRef({fs:e,gitdir:r,ref:o,value:p})}async function nz({fs:e,onSign:t,dir:n,gitdir:r=me.join(n,".git"),ref:o,tagger:i,message:a=o,gpgsig:s,object:l,signingKey:c,force:u=!1,cache:d={}}){try{X("fs",e),X("gitdir",r),X("ref",o),c&&X("onSign",t);const f=new Ne(e),h=await bo({fs:f,gitdir:r,author:i});if(!h)throw new Ht("tagger");return await tz({fs:f,cache:d,onSign:t,gitdir:r,ref:o,tagger:h,message:a,gpgsig:s,object:l,signingKey:c,force:u})}catch(f){throw f.caller="git.annotatedTag",f}}async function rz({fs:e,gitdir:t,ref:n,object:r,checkout:o=!1,force:i=!1}){if(n!==br.clean(n))throw new Yn(n,br.clean(n));const a=`refs/heads/${n}`;if(!i&&await ve.exists({fs:e,gitdir:t,ref:a}))throw new qn("branch",n,!1);let s;try{s=await ve.resolve({fs:e,gitdir:t,ref:r||"HEAD"})}catch{}s&&await ve.writeRef({fs:e,gitdir:t,ref:a,value:s}),o&&await ve.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:a})}async function oz({fs:e,dir:t,gitdir:n=me.join(t,".git"),ref:r,object:o,checkout:i=!1,force:a=!1}){try{return X("fs",e),X("gitdir",n),X("ref",r),await rz({fs:new Ne(e),gitdir:n,ref:r,object:o,checkout:i,force:a})}catch(s){throw s.caller="git.branch",s}}const Xb=(e,t)=>e==="."||t==null||t.length===0||t==="."?!0:t.length>=e.length?t.startsWith(e):e.startsWith(t);async function Ah({fs:e,cache:t,onProgress:n,onPostCheckout:r,dir:o,gitdir:i,remote:a,ref:s,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:d,force:f,track:h=!0}){let p;if(r)try{p=await ve.resolve({fs:e,gitdir:i,ref:"HEAD"})}catch{p="0000000000000000000000000000000000000000"}let m;try{m=await ve.resolve({fs:e,gitdir:i,ref:s})}catch(v){if(s==="HEAD")throw v;const w=`${a}/${s}`;if(m=await ve.resolve({fs:e,gitdir:i,ref:w}),h){const b=await St.get({fs:e,gitdir:i});await b.set(`branch.${s}.remote`,a),await b.set(`branch.${s}.merge`,`refs/heads/${s}`),await St.save({fs:e,gitdir:i,config:b})}await ve.writeRef({fs:e,gitdir:i,ref:`refs/heads/${s}`,value:m})}if(!c){let v;try{v=await iz({fs:e,cache:t,onProgress:n,dir:o,gitdir:i,ref:s,force:f,filepaths:l})}catch(C){throw C instanceof at&&C.data.what===m?new Ls(s,m):C}const w=v.filter(([C])=>C==="conflict").map(([C,N])=>N);if(w.length>0)throw new Fs(w);const b=v.filter(([C])=>C==="error").map(([C,N])=>N);if(b.length>0)throw new je(b.join(", "));if(d){r&&await r({previousHead:p,newHead:m,type:l!=null&&l.length>0?"file":"branch"});return}let x=0;const _=v.length;await At.acquire({fs:e,gitdir:i,cache:t},async function(C){await Promise.all(v.filter(([N])=>N==="delete"||N==="delete-index").map(async function([N,R]){const T=`${o}/${R}`;N==="delete"&&await e.rm(T),C.delete({filepath:R}),n&&await n({phase:"Updating workdir",loaded:++x,total:_})}))}),await At.acquire({fs:e,gitdir:i,cache:t},async function(C){for(const[N,R]of v)if(N==="rmdir"||N==="rmdir-index"){const T=`${o}/${R}`;try{N==="rmdir-index"&&C.delete({filepath:R}),await e.rmdir(T),n&&await n({phase:"Updating workdir",loaded:++x,total:_})}catch(M){if(M.code==="ENOTEMPTY")console.log(`Did not delete ${R} because directory is not empty`);else throw M}}}),await Promise.all(v.filter(([C])=>C==="mkdir"||C==="mkdir-index").map(async function([C,N]){const R=`${o}/${N}`;await e.mkdir(R),n&&await n({phase:"Updating workdir",loaded:++x,total:_})})),await At.acquire({fs:e,gitdir:i,cache:t},async function(C){await Promise.all(v.filter(([N])=>N==="create"||N==="create-index"||N==="update"||N==="mkdir-index").map(async function([N,R,T,M,D]){const A=`${o}/${R}`;try{if(N!=="create-index"&&N!=="mkdir-index"){const{object:$}=await pt({fs:e,cache:t,gitdir:i,oid:T});if(D&&await e.rm(A),M===33188)await e.write(A,$);else if(M===33261)await e.write(A,$,{mode:511});else if(M===40960)await e.writelink(A,$);else throw new je(`Invalid mode 0o${M.toString(8)} detected in blob ${T}`)}const O=await e.lstat(A);M===33261&&(O.mode=493),N==="mkdir-index"&&(O.mode=57344),C.insert({filepath:R,stats:O,oid:T}),n&&await n({phase:"Updating workdir",loaded:++x,total:_})}catch(O){console.log(O)}}))}),r&&await r({previousHead:p,newHead:m,type:l!=null&&l.length>0?"file":"branch"})}if(!u){const v=await ve.expand({fs:e,gitdir:i,ref:s});v.startsWith("refs/heads")?await ve.writeSymbolicRef({fs:e,gitdir:i,ref:"HEAD",value:v}):await ve.writeRef({fs:e,gitdir:i,ref:"HEAD",value:m})}}async function iz({fs:e,cache:t,onProgress:n,dir:r,gitdir:o,ref:i,force:a,filepaths:s}){let l=0;return yo({fs:e,cache:t,dir:r,gitdir:o,trees:[zn({ref:i}),Xs(),Ki()],map:async function(c,[u,d,f]){if(c===".")return;if(s&&!s.some(p=>Xb(c,p)))return null;switch(n&&await n({phase:"Analyzing workdir",loaded:++l}),[!!f,!!u,!!d].map(Number).join("")){case"000":return;case"001":return a&&s&&s.includes(c)?["delete",c]:void 0;case"010":switch(await u.type()){case"tree":return["mkdir",c];case"blob":return["create",c,await u.oid(),await u.mode()];case"commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`new entry Unhandled type ${await u.type()}`]}case"011":switch(`${await u.type()}-${await d.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",c];case"blob-blob":return await u.oid()!==await d.oid()?a?["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()]:["conflict",c]:await u.mode()!==await d.mode()?a?["update",c,await u.oid(),await u.mode(),!0]:["conflict",c]:["create-index",c,await u.oid(),await u.mode()];case"commit-tree":return;case"commit-blob":return["conflict",c];default:return["error",`new entry Unhandled type ${u.type}`]}case"100":return["delete-index",c];case"101":switch(await f.type()){case"tree":return["rmdir",c];case"blob":return await f.oid()!==await d.oid()?a?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await f.type()}`]}case"110":case"111":switch(`${await f.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await f.oid()===await u.oid()&&await f.mode()===await u.mode()&&!a)return;if(d){if(await d.oid()!==await f.oid()&&await d.oid()!==await u.oid())return a?["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()]:["conflict",c]}else if(a)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()];return await u.mode()!==await f.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await f.oid()?["update",c,await u.oid(),await u.mode(),!1]:void 0}case"tree-blob":return["update-dir-to-blob",c,await u.oid()];case"blob-tree":return["update-blob-to-tree",c];case"commit-commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`update entry Unhandled type ${await f.type()}-${await u.type()}`]}}},reduce:async function(c,u){return u=Fb(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u}})}async function Zb({fs:e,onProgress:t,onPostCheckout:n,dir:r,gitdir:o=me.join(r,".git"),remote:i="origin",ref:a,filepaths:s,noCheckout:l=!1,noUpdateHead:c=a===void 0,dryRun:u=!1,force:d=!1,track:f=!0,cache:h={}}){try{X("fs",e),X("dir",r),X("gitdir",o);const p=a||"HEAD";return await Ah({fs:new Ne(e),cache:h,onProgress:t,onPostCheckout:n,dir:r,gitdir:o,remote:i,ref:p,filepaths:s,noCheckout:l,noUpdateHead:c,dryRun:u,force:d,track:f})}catch(p){throw p.caller="git.checkout",p}}const az=new RegExp("^refs/(heads/|tags/|remotes/)?(.*)");function oi(e){const t=az.exec(e);return t?t[1]==="remotes/"&&e.endsWith("/HEAD")?t[2].slice(0,-5):t[2]:e}async function xo({fs:e,gitdir:t,fullname:n=!1,test:r=!1}){const o=await ve.resolve({fs:e,gitdir:t,ref:"HEAD",depth:2});if(r)try{await ve.resolve({fs:e,gitdir:t,ref:o})}catch{return}if(o.startsWith("refs/"))return n?o:oi(o)}function sz(e){return e=e.replace(/^git@([^:]+):/,"https://$1/"),e=e.replace(/^ssh:\/\//,"https://"),e}function Jb({username:e="",password:t=""}){return`Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`}async function el(e,t){const n=Ob(e);for(;;){const{value:r,done:o}=await n.next();if(r&&await t(r),o)break}n.return&&n.return()}async function eu(e){let t=0;const n=[];await el(e,i=>{n.push(i),t+=i.byteLength});const r=new Uint8Array(t);let o=0;for(const i of n)r.set(i,o),o+=i.byteLength;return r}function Qb(e){let t=e.match(/^https?:\/\/([^/]+)@/);if(t==null)return{url:e,auth:{}};t=t[1];const[n,r]=t.split(":");return e=e.replace(`${t}@`,""),{url:e,auth:{username:n,password:r}}}function Ih(e,t){const n=t.toString(16);return"0".repeat(e-n.length)+n}class Ct{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(t){typeof t=="string"&&(t=Buffer.from(t));const n=t.length+4,r=Ih(4,n);return Buffer.concat([Buffer.from(r,"utf8"),t])}static streamReader(t){const n=new jb(t);return async function(){try{let o=await n.read(4);if(o==null)return!0;if(o=parseInt(o.toString("utf8"),16),o===0||o===1)return null;const i=await n.read(o-4);return i??!0}catch(o){return t.error=o,!0}}}}async function ex(e){const t={};let n;for(;n=await e(),n!==!0;){if(n===null)continue;n=n.toString("utf8").replace(/\n$/,"");const r=n.indexOf("=");if(r>-1){const o=n.slice(0,r),i=n.slice(r+1);t[o]=i}else t[n]=!0}return{protocolVersion:2,capabilities2:t}}async function tx(e,{service:t}){const n=new Set,r=new Map,o=new Map,i=Ct.streamReader(e);let a=await i();for(;a===null;)a=await i();if(a===!0)throw new zs;if(a.includes("version 2"))return ex(i);if(a.toString("utf8").replace(/\n$/,"")!==`# service=${t}`)throw new ri(`# service=${t}\\n`,a.toString("utf8"));let s=await i();for(;s===null;)s=await i();if(s===!0)return{capabilities:n,refs:r,symrefs:o};if(s=s.toString("utf8"),s.includes("version 2"))return ex(i);const[l,c]=Oh(s,"\0","\\x00");if(c.split(" ").map(u=>n.add(u)),l!=="0000000000000000000000000000000000000000 capabilities^{}"){const[u,d]=Oh(l," "," ");for(r.set(d,u);;){const f=await i();if(f===!0)break;if(f!==null){const[h,p]=Oh(f.toString("utf8")," "," ");r.set(p,h)}}}for(const u of n)if(u.startsWith("symref=")){const d=u.match(/symref=([^:]+):(.*)/);d.length===3&&o.set(d[1],d[2])}return{protocolVersion:1,capabilities:n,refs:r,symrefs:o}}function Oh(e,t,n){const r=e.trim().split(t);if(r.length!==2)throw new ri(`Two strings separated by '${n}'`,e.toString("utf8"));return r}const nx=(e,t)=>e.endsWith("?")?`${e}${t}`:`${e}/${t.replace(/^https?:\/\//,"")}`,rx=(e,t)=>{(t.username||t.password)&&(e.Authorization=Jb(t)),t.headers&&Object.assign(e,t.headers)},jh=async e=>{try{const t=Buffer.from(await eu(e.body)),n=t.toString("utf8");return{preview:n.length<256?n:n.slice(0,256)+"...",response:n,data:t}}catch{return{}}};class tu{static async capabilities(){return["discover","connect"]}static async discover({http:t,onProgress:n,onAuth:r,onAuthSuccess:o,onAuthFailure:i,corsProxy:a,service:s,url:l,headers:c,protocolVersion:u}){let{url:d,auth:f}=Qb(l);const h=a?nx(a,d):d;(f.username||f.password)&&(c.Authorization=Jb(f)),u===2&&(c["Git-Protocol"]="version=2");let p,m,v=!1;do if(p=await t.request({onProgress:n,method:"GET",url:`${h}/info/refs?service=${s}`,headers:c}),m=!1,p.statusCode===401||p.statusCode===203){const w=v?i:r;if(w){if(f=await w(d,{...f,headers:{...c}}),f&&f.cancel)throw new na;f&&(rx(c,f),v=!0,m=!0)}}else p.statusCode===200&&v&&o&&await o(d,f);while(m);if(p.statusCode!==200){const{response:w}=await jh(p);throw new Ji(p.statusCode,p.statusMessage,w)}if(p.headers["content-type"]===`application/x-${s}-advertisement`){const w=await tx(p.body,{service:s});return w.auth=f,w}else{const{preview:w,response:b,data:x}=await jh(p);try{const _=await tx([x],{service:s});return _.auth=f,_}catch{throw new Ws(w,b)}}}static async connect({http:t,onProgress:n,corsProxy:r,service:o,url:i,auth:a,body:s,headers:l}){const c=Qb(i);c&&(i=c.url),r&&(i=nx(r,i)),l["content-type"]=`application/x-${o}-request`,l.accept=`application/x-${o}-result`,rx(l,a);const u=await t.request({onProgress:n,method:"POST",url:`${i}/${o}`,body:s,headers:l});if(u.statusCode!==200){const{response:d}=jh(u);throw new Ji(u.statusCode,u.statusMessage,d)}return u}}function lz({url:e}){if(e.startsWith("git@"))return{transport:"ssh",address:e};const t=e.match(/(\w+)(:\/\/|::)(.*)/);if(t!==null){if(t[2]==="://")return{transport:t[1],address:t[0]};if(t[2]==="::")return{transport:t[1],address:t[3]}}}class nu{static getRemoteHelperFor({url:t}){const n=new Map;n.set("http",tu),n.set("https",tu);const r=lz({url:t});if(!r)throw new qs(t);if(n.has(r.transport))return n.get(r.transport);throw new Gs(t,r.transport,r.transport==="ssh"?sz(t):void 0)}}let ii=null;class tl{static async read({fs:t,gitdir:n}){ii===null&&(ii=new gs);const r=me.join(n,"shallow"),o=new Set;return await ii.acquire(r,async function(){const i=await t.read(r,{encoding:"utf8"});if(i===null||i.trim()==="")return o;i.trim().split(`
|
|
67
67
|
`).map(a=>o.add(a))}),o}static async write({fs:t,gitdir:n,oids:r}){ii===null&&(ii=new gs);const o=me.join(n,"shallow");if(r.size>0){const i=[...r].join(`
|
|
68
68
|
`)+`
|
|
69
69
|
`;await ii.acquire(o,async function(){await t.write(o,i,{encoding:"utf8"})})}else await ii.acquire(o,async function(){await t.rm(o)})}}async function cz({fs:e,gitdir:t,oid:n}){const r=`objects/${n.slice(0,2)}/${n.slice(2)}`;return e.exists(`${t}/${r}`)}async function uz({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:o}){let i=await e.readdir(me.join(n,"objects/pack"));i=i.filter(a=>a.endsWith(".idx"));for(const a of i){const s=`${n}/objects/pack/${a}`,l=await Rh({fs:e,cache:t,filename:s,getExternalRefDelta:o});if(l.error)throw new je(l.error);if(l.offsets.has(r))return!0}return!1}async function ox({fs:e,cache:t,gitdir:n,oid:r,format:o="content"}){const i=s=>pt({fs:e,cache:t,gitdir:n,oid:s});let a=await cz({fs:e,gitdir:n,oid:r});return a||(a=await uz({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:i})),a}function dz(e){const o="5041434b"+"00000002"+"00000000";return e.slice(0,12).toString("hex")===o}function ix(e,t){const n=e.map(r=>r.split("=",1)[0]);return t.filter(r=>{const o=r.split("=",1)[0];return n.includes(o)})}const ru={name:"isomorphic-git",version:"1.29.0",agent:"git/isomorphic-git@1.29.0"};class ou{constructor(){this._queue=[]}write(t){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){const n=this._waiting;this._waiting=null,n({value:t})}else this._queue.push(t)}end(){if(this._ended=!0,this._waiting){const t=this._waiting;this._waiting=null,t({done:!0})}}destroy(t){this.error=t,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(t=>{this._waiting=t})}}function fz(e){const t=e.indexOf("\r"),n=e.indexOf(`
|
|
@@ -74,7 +74,7 @@ gpgsig`+Th(a)+`
|
|
|
74
74
|
`));for(const c of a)s.push(Ct.encode(`deepen-not ${c}
|
|
75
75
|
`));s.push(Ct.flush());for(const c of n)s.push(Ct.encode(`have ${c}
|
|
76
76
|
`));return s.push(Ct.encode(`done
|
|
77
|
-
`)),s}async function $h({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,gitdir:l,ref:c,remoteRef:u,remote:d,url:f,corsProxy:h,depth:p=null,since:m=null,exclude:v=[],relative:w=!1,tags:b=!1,singleBranch:x=!1,headers:_={},prune:C=!1,pruneTags:N=!1}){const R=c||await xo({fs:e,gitdir:l,test:!0}),T=await St.get({fs:e,gitdir:l}),M=d||R&&await T.get(`branch.${R}.remote`)||"origin",D=f||await T.get(`remote.${M}.url`);if(typeof D>"u")throw new un("remote OR url");const A=u||R&&await T.get(`branch.${R}.merge`)||c||"HEAD";h===void 0&&(h=await T.get("http.corsProxy"));const
|
|
77
|
+
`)),s}async function $h({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,gitdir:l,ref:c,remoteRef:u,remote:d,url:f,corsProxy:h,depth:p=null,since:m=null,exclude:v=[],relative:w=!1,tags:b=!1,singleBranch:x=!1,headers:_={},prune:C=!1,pruneTags:N=!1}){const R=c||await xo({fs:e,gitdir:l,test:!0}),T=await St.get({fs:e,gitdir:l}),M=d||R&&await T.get(`branch.${R}.remote`)||"origin",D=f||await T.get(`remote.${M}.url`);if(typeof D>"u")throw new un("remote OR url");const A=u||R&&await T.get(`branch.${R}.merge`)||c||"HEAD";h===void 0&&(h=await T.get("http.corsProxy"));const O=nu.getRemoteHelperFor({url:D}),$=await O.discover({http:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,corsProxy:h,service:"git-upload-pack",url:D,headers:_,protocolVersion:1}),W=$.auth,re=$.refs;if(re.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(p!==null&&!$.capabilities.has("shallow"))throw new vo("shallow","depth");if(m!==null&&!$.capabilities.has("deepen-since"))throw new vo("deepen-since","since");if(v.length>0&&!$.capabilities.has("deepen-not"))throw new vo("deepen-not","exclude");if(w===!0&&!$.capabilities.has("deepen-relative"))throw new vo("deepen-relative","relative");const{oid:Y,fullref:Z}=ve.resolveAgainstMap({ref:A,map:re});for(const H of re.keys())H===Z||H==="HEAD"||H.startsWith("refs/heads/")||b&&H.startsWith("refs/tags/")||re.delete(H);const B=ix([...$.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${ru.agent}`]);w&&B.push("deepen-relative");const oe=x?[Y]:re.values(),ee=x?[R]:await ve.listRefs({fs:e,gitdir:l,filepath:"refs"});let ne=[];for(let H of ee)try{H=await ve.expand({fs:e,gitdir:l,ref:H});const ue=await ve.resolve({fs:e,gitdir:l,ref:H});await ox({fs:e,cache:t,gitdir:l,oid:ue})&&ne.push(ue)}catch{}ne=[...new Set(ne)];const G=await tl.read({fs:e,gitdir:l}),F=$.capabilities.has("shallow")?[...G]:[],q=pz({capabilities:B,wants:oe,haves:ne,shallows:F,depth:p,since:m,exclude:v}),ce=Buffer.from(await eu(q)),L=await O.connect({http:n,onProgress:r,corsProxy:h,service:"git-upload-pack",url:D,auth:W,body:[ce],headers:_}),K=await hz(L.body);L.headers&&(K.headers=L.headers);for(const H of K.shallows)if(!G.has(H))try{const{object:ue}=await pt({fs:e,cache:t,gitdir:l,oid:H}),se=new mt(ue),ye=await Promise.all(se.headers().parent.map(xe=>ox({fs:e,cache:t,gitdir:l,oid:xe})));ye.length===0||ye.every(xe=>xe)||G.add(H)}catch{G.add(H)}for(const H of K.unshallows)G.delete(H);if(await tl.write({fs:e,gitdir:l,oids:G}),x){const H=new Map([[Z,Y]]),ue=new Map;let se=10,ye=Z;for(;se--;){const j=$.symrefs.get(ye);if(j===void 0)break;ue.set(ye,j),ye=j}const Ce=re.get(ye);Ce&&H.set(ye,Ce);const{pruned:xe}=await ve.updateRemoteRefs({fs:e,gitdir:l,remote:M,refs:H,symrefs:ue,tags:b,prune:C});C&&(K.pruned=xe)}else{const{pruned:H}=await ve.updateRemoteRefs({fs:e,gitdir:l,remote:M,refs:re,symrefs:$.symrefs,tags:b,prune:C,pruneTags:N});C&&(K.pruned=H)}if(K.HEAD=$.symrefs.get("HEAD"),K.HEAD===void 0){const{oid:H}=ve.resolveAgainstMap({ref:"HEAD",map:re});for(const[ue,se]of re.entries())if(ue!=="HEAD"&&se===H){K.HEAD=ue;break}}const z=Z.startsWith("refs/tags")?"tag":"branch";if(K.FETCH_HEAD={oid:Y,description:`${z} '${oi(Z)}' of ${D}`},r||o){const H=ax(K.progress);el(H,async ue=>{if(o&&await o(ue),r){const se=ue.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);se&&await r({phase:se[1].trim(),loaded:parseInt(se[2],10),total:parseInt(se[3],10)})}})}const ie=Buffer.from(await eu(K.packfile));if(L.body.error)throw L.body.error;const le=ie.slice(-20).toString("hex"),ae={defaultBranch:K.HEAD,fetchHead:K.FETCH_HEAD.oid,fetchHeadDescription:K.FETCH_HEAD.description};if(K.headers&&(ae.headers=K.headers),C&&(ae.pruned=K.pruned),le!==""&&!dz(ie)){ae.packfile=`objects/pack/pack-${le}.pack`;const H=me.join(l,ae.packfile);await e.write(H,ie);const ue=ye=>pt({fs:e,cache:t,gitdir:l,oid:ye}),se=await Zi.fromPack({pack:ie,getExternalRefDelta:ue,onProgress:r});await e.write(H.replace(/\.pack$/,".idx"),await se.toBuffer())}return ae}async function lx({fs:e,bare:t=!1,dir:n,gitdir:r=t?n:me.join(n,".git"),defaultBranch:o="master"}){if(await e.exists(r+"/config"))return;let i=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];i=i.map(a=>r+"/"+a);for(const a of i)await e.mkdir(a);await e.write(r+"/config",`[core]
|
|
78
78
|
repositoryformatversion = 0
|
|
79
79
|
filemode = false
|
|
80
80
|
bare = ${t}
|
|
@@ -85,12 +85,12 @@ gpgsig`+Th(a)+`
|
|
|
85
85
|
`)}async function mz({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPostCheckout:l,dir:c,gitdir:u,url:d,corsProxy:f,ref:h,remote:p,depth:m,since:v,exclude:w,relative:b,singleBranch:x,noCheckout:_,noTags:C,headers:N}){try{if(await lx({fs:e,gitdir:u}),await Kb({fs:e,gitdir:u,remote:p,url:d,force:!1}),f){const M=await St.get({fs:e,gitdir:u});await M.set("http.corsProxy",f),await St.save({fs:e,gitdir:u,config:M})}const{defaultBranch:R,fetchHead:T}=await $h({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,gitdir:u,ref:h,remote:p,corsProxy:f,depth:m,since:v,exclude:w,relative:b,singleBranch:x,headers:N,tags:!C});if(T===null)return;h=h||R,h=h.replace("refs/heads/",""),await Ah({fs:e,cache:t,onProgress:r,onPostCheckout:l,dir:c,gitdir:u,ref:h,remote:p,noCheckout:_})}catch(R){throw await e.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),R}}async function gz({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,onPostCheckout:s,dir:l,gitdir:c=me.join(l,".git"),url:u,corsProxy:d=void 0,ref:f=void 0,remote:h="origin",depth:p=void 0,since:m=void 0,exclude:v=[],relative:w=!1,singleBranch:b=!1,noCheckout:x=!1,noTags:_=!1,headers:C={},cache:N={}}){try{return X("fs",e),X("http",t),X("gitdir",c),x||X("dir",l),X("url",u),await mz({fs:new Ne(e),cache:N,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,onPostCheckout:s,dir:l,gitdir:c,url:u,corsProxy:d,ref:f,remote:h,depth:p,since:m,exclude:v,relative:w,singleBranch:b,noCheckout:x,noTags:_,headers:C})}catch(R){throw R.caller="git.clone",R}}async function wz({fs:e,onSign:t,dir:n,gitdir:r=me.join(n,".git"),message:o,author:i,committer:a,signingKey:s,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:d,parent:f,tree:h,cache:p={}}){try{X("fs",e),l||X("message",o),s&&X("onSign",t);const m=new Ne(e);return await Qc({fs:m,cache:p,onSign:t,gitdir:r,message:o,author:i,committer:a,signingKey:s,amend:l,dryRun:c,noUpdateBranch:u,ref:d,parent:f,tree:h})}catch(m){throw m.caller="git.commit",m}}async function vz({fs:e,dir:t,gitdir:n=me.join(t,".git"),fullname:r=!1,test:o=!1}){try{return X("fs",e),X("gitdir",n),await xo({fs:new Ne(e),gitdir:n,fullname:r,test:o})}catch(i){throw i.caller="git.currentBranch",i}}async function yz({fs:e,gitdir:t,ref:n}){if(n=n.startsWith("refs/heads/")?n:`refs/heads/${n}`,!await ve.exists({fs:e,gitdir:t,ref:n}))throw new at(n);const o=await ve.expand({fs:e,gitdir:t,ref:n}),i=await xo({fs:e,gitdir:t,fullname:!0});if(o===i){const l=await ve.resolve({fs:e,gitdir:t,ref:o});await ve.writeRef({fs:e,gitdir:t,ref:"HEAD",value:l})}await ve.deleteRef({fs:e,gitdir:t,ref:o});const a=oi(n),s=await St.get({fs:e,gitdir:t});await s.deleteSection("branch",a),await St.save({fs:e,gitdir:t,config:s})}async function bz({fs:e,dir:t,gitdir:n=me.join(t,".git"),ref:r}){try{return X("fs",e),X("ref",r),await yz({fs:new Ne(e),gitdir:n,ref:r})}catch(o){throw o.caller="git.deleteBranch",o}}async function xz({fs:e,dir:t,gitdir:n=me.join(t,".git"),ref:r}){try{X("fs",e),X("ref",r),await ve.deleteRef({fs:new Ne(e),gitdir:n,ref:r})}catch(o){throw o.caller="git.deleteRef",o}}async function _z({fs:e,gitdir:t,remote:n}){const r=await St.get({fs:e,gitdir:t});await r.deleteSection("remote",n),await St.save({fs:e,gitdir:t,config:r})}async function Sz({fs:e,dir:t,gitdir:n=me.join(t,".git"),remote:r}){try{return X("fs",e),X("remote",r),await _z({fs:new Ne(e),gitdir:n,remote:r})}catch(o){throw o.caller="git.deleteRemote",o}}async function Cz({fs:e,gitdir:t,ref:n}){n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,await ve.deleteRef({fs:e,gitdir:t,ref:n})}async function Ez({fs:e,dir:t,gitdir:n=me.join(t,".git"),ref:r}){try{return X("fs",e),X("ref",r),await Cz({fs:new Ne(e),gitdir:n,ref:r})}catch(o){throw o.caller="git.deleteTag",o}}async function Pz({fs:e,gitdir:t,oid:n}){const r=n.slice(0,2);return(await e.readdir(`${t}/objects/${r}`)).map(i=>`${r}${i}`).filter(i=>i.startsWith(n))}async function Rz({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:o}){const i=[];let a=await e.readdir(me.join(n,"objects/pack"));a=a.filter(s=>s.endsWith(".idx"));for(const s of a){const l=`${n}/objects/pack/${s}`,c=await Rh({fs:e,cache:t,filename:l,getExternalRefDelta:o});if(c.error)throw new je(c.error);for(const u of c.offsets.keys())u.startsWith(r)&&i.push(u)}return i}async function Nz({fs:e,cache:t,gitdir:n,oid:r}){const o=s=>pt({fs:e,cache:t,gitdir:n,oid:s}),i=await Pz({fs:e,gitdir:n,oid:r}),a=await Rz({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:o});for(const s of a)i.indexOf(s)===-1&&i.push(s);if(i.length===1)return i[0];throw i.length>1?new $s("oids",r,i):new at(`an object matching "${r}"`)}async function Tz({fs:e,dir:t,gitdir:n=me.join(t,".git"),oid:r,cache:o={}}){try{return X("fs",e),X("gitdir",n),X("oid",r),await Nz({fs:new Ne(e),cache:o,gitdir:n,oid:r})}catch(i){throw i.caller="git.expandOid",i}}async function Mz({fs:e,dir:t,gitdir:n=me.join(t,".git"),ref:r}){try{return X("fs",e),X("gitdir",n),X("ref",r),await ve.expand({fs:new Ne(e),gitdir:n,ref:r})}catch(o){throw o.caller="git.expandRef",o}}async function Fh({fs:e,cache:t,gitdir:n,oids:r}){const o={},i=r.length;let a=r.map((s,l)=>({index:l,oid:s}));for(;a.length;){const s=new Set;for(const{oid:c,index:u}of a)o[c]||(o[c]=new Set),o[c].add(u),o[c].size===i&&s.add(c);if(s.size>0)return[...s];const l=new Map;for(const{oid:c,index:u}of a)try{const{object:d}=await pt({fs:e,cache:t,gitdir:n,oid:c}),f=mt.from(d),{parent:h}=f.parseHeaders();for(const p of h)(!o[p]||!o[p].has(u))&&l.set(p+":"+u,{oid:p,index:u})}catch{}a=Array.from(l.values())}return[]}const Lh=/^.*(\r?\n|$)/gm;function kz({branches:e,contents:t}){const n=e[1],r=e[2],o=t[0],i=t[1],a=t[2],s=i.match(Lh),l=o.match(Lh),c=a.match(Lh),u=XF(s,l,c),d=7;let f="",h=!0;for(const p of u)p.ok&&(f+=p.ok.join("")),p.conflict&&(h=!1,f+=`${"<".repeat(d)} ${n}
|
|
86
86
|
`,f+=p.conflict.a.join(""),f+=`${"=".repeat(d)}
|
|
87
87
|
`,f+=p.conflict.b.join(""),f+=`${">".repeat(d)} ${r}
|
|
88
|
-
`);return{cleanMerge:h,mergedText:f}}async function Dz({fs:e,cache:t,dir:n,gitdir:r=me.join(n,".git"),index:o,ourOid:i,baseOid:a,theirOid:s,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:d=!1,abortOnConflict:f=!0,mergeDriver:h}){const p=zn({ref:i}),m=zn({ref:a}),v=zn({ref:s}),w=[],b=[],x=[],_=[],C=await yo({fs:e,cache:t,dir:n,gitdir:r,trees:[p,m,v],map:async function(N,[R,T,M]){const D=Wc(N),A=await Jc(R,T),j=await Jc(M,T);switch(`${A}-${j}`){case"false-false":return{mode:await T.mode(),path:D,oid:await T.oid(),type:await T.type()};case"false-true":return M?{mode:await M.mode(),path:D,oid:await M.oid(),type:await M.type()}:void 0;case"true-false":return R?{mode:await R.mode(),path:D,oid:await R.oid(),type:await R.type()}:void 0;case"true-true":{if(R&&T&&M&&await R.type()==="blob"&&await T.type()==="blob"&&await M.type()==="blob")return Az({fs:e,gitdir:r,path:D,ours:R,base:T,theirs:M,ourName:l,baseName:c,theirName:u,mergeDriver:h}).then(async $=>{if($.cleanMerge)f||o.insert({filepath:N,oid:$.mergeResult.oid,stage:0});else if(w.push(N),b.push(N),!f){const W=await T.oid(),re=await R.oid(),Y=await M.oid();o.delete({filepath:N}),o.insert({filepath:N,oid:W,stage:1}),o.insert({filepath:N,oid:re,stage:2}),o.insert({filepath:N,oid:Y,stage:3})}return $.mergeResult});if(T&&!R&&M&&await T.type()==="blob"&&await M.type()==="blob"){if(w.push(N),x.push(N),!f){const $=await T.oid(),W=await M.oid();o.delete({filepath:N}),o.insert({filepath:N,oid:$,stage:1}),o.insert({filepath:N,oid:W,stage:3})}return{mode:await M.mode(),oid:await M.oid(),type:"blob",path:D}}if(T&&R&&!M&&await T.type()==="blob"&&await R.type()==="blob"){if(w.push(N),_.push(N),!f){const $=await T.oid(),W=await R.oid();o.delete({filepath:N}),o.insert({filepath:N,oid:$,stage:1}),o.insert({filepath:N,oid:W,stage:2})}return{mode:await R.mode(),oid:await R.oid(),type:"blob",path:D}}if(T&&!R&&!M&&await T.type()==="blob")return;throw new Qi}}},reduce:w.length!==0&&(!n||f)?void 0:async(N,R)=>{const T=R.filter(Boolean);if(N&&!(N&&N.type==="tree"&&T.length===0)){if(T.length>0){const D=new cn(T).toObject(),A=await dn({fs:e,gitdir:r,type:"tree",object:D,dryRun:d});N.oid=A}return N}}});return w.length!==0?(n&&!f&&await yo({fs:e,cache:t,dir:n,gitdir:r,trees:[zn({ref:C.oid})],map:async function(N,[R]){const T=`${n}/${N}`;if(await R.type()==="blob"){const M=await R.mode(),D=new TextDecoder().decode(await R.content());await e.write(T,D,{mode:M})}return!0}}),new ea(w,b,x,_)):C.oid}async function Az({fs:e,gitdir:t,path:n,ours:r,base:o,theirs:i,ourName:a,theirName:s,baseName:l,dryRun:c,mergeDriver:u=kz}){const d="blob",f=await o.mode()===await r.mode()?await i.mode():await r.mode();if(await r.oid()===await i.oid())return{cleanMerge:!0,mergeResult:{mode:f,path:n,oid:await r.oid(),type:d}};if(await r.oid()===await o.oid())return{cleanMerge:!0,mergeResult:{mode:f,path:n,oid:await i.oid(),type:d}};if(await i.oid()===await o.oid())return{cleanMerge:!0,mergeResult:{mode:f,path:n,oid:await r.oid(),type:d}};const h=Buffer.from(await r.content()).toString("utf8"),p=Buffer.from(await o.content()).toString("utf8"),m=Buffer.from(await i.content()).toString("utf8"),{mergedText:v,cleanMerge:w}=await u({branches:[l,a,s],contents:[p,h,m],path:n}),b=await dn({fs:e,gitdir:t,type:"blob",object:Buffer.from(v,"utf8"),dryRun:c});return{cleanMerge:w,mergeResult:{mode:f,path:n,oid:b,type:d}}}async function cx({fs:e,cache:t,dir:n,gitdir:r,ours:o,theirs:i,fastForward:a=!0,fastForwardOnly:s=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:d,author:f,committer:h,signingKey:p,onSign:m,mergeDriver:v}){o===void 0&&(o=await xo({fs:e,gitdir:r,fullname:!0})),o=await ve.expand({fs:e,gitdir:r,ref:o}),i=await ve.expand({fs:e,gitdir:r,ref:i});const w=await ve.resolve({fs:e,gitdir:r,ref:o}),b=await ve.resolve({fs:e,gitdir:r,ref:i}),x=await Fh({fs:e,cache:t,gitdir:r,oids:[w,b]});if(x.length!==1)throw new Qi;const _=x[0];if(_===b)return{oid:w,alreadyMerged:!0};if(a&&_===w)return!l&&!c&&await ve.writeRef({fs:e,gitdir:r,ref:o,value:b}),{oid:b,fastForward:!0};{if(s)throw new Bs;const C=await At.acquire({fs:e,gitdir:r,cache:t,allowUnmerged:!1},async R=>Dz({fs:e,cache:t,dir:n,gitdir:r,index:R,ourOid:w,theirOid:b,baseOid:_,ourName:oi(o),baseName:"base",theirName:oi(i),dryRun:l,abortOnConflict:u,mergeDriver:v}));if(C instanceof ea)throw C;return d||(d=`Merge branch '${oi(i)}' into ${oi(o)}`),{oid:await Qc({fs:e,cache:t,gitdir:r,message:d,ref:o,tree:C,parent:[w,b],author:f,committer:h,signingKey:p,onSign:m,dryRun:l,noUpdateBranch:c}),tree:C,mergeCommit:!0}}}async function ux({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,dir:l,gitdir:c,ref:u,url:d,remote:f,remoteRef:h,prune:p,pruneTags:m,fastForward:v,fastForwardOnly:w,corsProxy:b,singleBranch:x,headers:_,author:C,committer:N,signingKey:R}){try{if(!u){const D=await xo({fs:e,gitdir:c});if(!D)throw new un("ref");u=D}const{fetchHead:T,fetchHeadDescription:M}=await $h({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,gitdir:c,corsProxy:b,ref:u,url:d,remote:f,remoteRef:h,singleBranch:x,headers:_,prune:p,pruneTags:m});await cx({fs:e,cache:t,gitdir:c,ours:u,theirs:T,fastForward:v,fastForwardOnly:w,message:`Merge ${M}`,author:C,committer:N,signingKey:R,dryRun:!1,noUpdateBranch:!1}),await Ah({fs:e,cache:t,onProgress:r,dir:l,gitdir:c,ref:u,remote:f,noCheckout:!1})}catch(T){throw T.caller="git.pull",T}}async function Iz({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l=me.join(s,".git"),ref:c,url:u,remote:d,remoteRef:f,corsProxy:h,singleBranch:p,headers:m={},cache:v={}}){try{X("fs",e),X("http",t),X("gitdir",l);const w={name:"",email:"",timestamp:Date.now(),timezoneOffset:0};return await ux({fs:new Ne(e),cache:v,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l,ref:c,url:u,remote:d,remoteRef:f,fastForwardOnly:!0,corsProxy:h,singleBranch:p,headers:m,author:w,committer:w})}catch(w){throw w.caller="git.fastForward",w}}async function Oz({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l=me.join(s,".git"),ref:c,remote:u,remoteRef:d,url:f,corsProxy:h,depth:p=null,since:m=null,exclude:v=[],relative:w=!1,tags:b=!1,singleBranch:x=!1,headers:_={},prune:C=!1,pruneTags:N=!1,cache:R={}}){try{return X("fs",e),X("http",t),X("gitdir",l),await $h({fs:new Ne(e),cache:R,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,gitdir:l,ref:c,remote:u,remoteRef:d,url:f,corsProxy:h,depth:p,since:m,exclude:v,relative:w,tags:b,singleBranch:x,headers:_,prune:C,pruneTags:N})}catch(T){throw T.caller="git.fetch",T}}async function jz({fs:e,dir:t,gitdir:n=me.join(t,".git"),oids:r,cache:o={}}){try{return X("fs",e),X("gitdir",n),X("oids",r),await Fh({fs:new Ne(e),cache:o,gitdir:n,oids:r})}catch(i){throw i.caller="git.findMergeBase",i}}async function dx({fs:e,filepath:t}){if(await e.exists(me.join(t,".git")))return t;{const n=Yi(t);if(n===t)throw new at(`git root for ${t}`);return dx({fs:e,filepath:n})}}async function $z({fs:e,filepath:t}){try{return X("fs",e),X("filepath",t),await dx({fs:new Ne(e),filepath:t})}catch(n){throw n.caller="git.findRoot",n}}async function Fz({fs:e,dir:t,gitdir:n=me.join(t,".git"),path:r}){try{return X("fs",e),X("gitdir",n),X("path",r),await Zs({fs:new Ne(e),gitdir:n,path:r})}catch(o){throw o.caller="git.getConfig",o}}async function Lz({fs:e,gitdir:t,path:n}){return(await St.get({fs:e,gitdir:t})).getall(n)}async function zz({fs:e,dir:t,gitdir:n=me.join(t,".git"),path:r}){try{return X("fs",e),X("gitdir",n),X("path",r),await Lz({fs:new Ne(e),gitdir:n,path:r})}catch(o){throw o.caller="git.getConfigAll",o}}async function Bz({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,url:i,headers:a={},forPush:s=!1}){try{X("http",e),X("url",i);const c=await nu.getRemoteHelperFor({url:i}).discover({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,service:s?"git-receive-pack":"git-upload-pack",url:i,headers:a,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(const[d,f]of c.refs){const h=d.split("/"),p=h.pop();let m=u;for(const v of h)m[v]=m[v]||{},m=m[v];m[p]=f}for(const[d,f]of c.symrefs){const h=d.split("/"),p=h.pop();let m=u;for(const v of h)m[v]=m[v]||{},m=m[v];m[p]=f}return u}catch(l){throw l.caller="git.getRemoteInfo",l}}function fx(e,t,n,r){const o=[];for(const[i,a]of e.refs){if(t&&!i.startsWith(t))continue;if(i.endsWith("^{}")){if(r){const l=i.replace("^{}",""),c=o[o.length-1],u=c.ref===l?c:o.find(d=>d.ref===l);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=a}continue}const s={ref:i,oid:a};n&&e.symrefs.has(i)&&(s.target=e.symrefs.get(i)),o.push(s)}return o}async function Hz({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,url:i,headers:a={},forPush:s=!1,protocolVersion:l=2}){try{X("http",e),X("url",i);const u=await nu.getRemoteHelperFor({url:i}).discover({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,service:s?"git-receive-pack":"git-upload-pack",url:i,headers:a,protocolVersion:l});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};const d={};for(const f of u.capabilities){const[h,p]=f.split("=");p?d[h]=p:d[h]=!0}return{protocolVersion:1,capabilities:d,refs:fx(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}async function Vz({type:e,object:t,format:n="content",oid:r=void 0}){return n!=="deflated"&&(n!=="wrapped"&&(t=Xi.wrap({type:e,object:t})),r=await Ur(t)),{oid:r,object:t}}async function Uz({object:e}){try{X("object",e),typeof e=="string"?e=Buffer.from(e,"utf8"):e=Buffer.from(e);const t="blob",{oid:n,object:r}=await Vz({type:"blob",format:"content",object:e});return{oid:n,type:t,object:new Uint8Array(r),format:"wrapped"}}catch(t){throw t.caller="git.hashBlob",t}}async function Wz({fs:e,cache:t,onProgress:n,dir:r,gitdir:o,filepath:i}){try{i=me.join(r,i);const a=await e.read(i),s=c=>pt({fs:e,cache:t,gitdir:o,oid:c}),l=await Zi.fromPack({pack:a,getExternalRefDelta:s,onProgress:n});return await e.write(i.replace(/\.pack$/,".idx"),await l.toBuffer()),{oids:[...l.hashes]}}catch(a){throw a.caller="git.indexPack",a}}async function Gz({fs:e,onProgress:t,dir:n,gitdir:r=me.join(n,".git"),filepath:o,cache:i={}}){try{return X("fs",e),X("dir",n),X("gitdir",n),X("filepath",o),await Wz({fs:new Ne(e),cache:i,onProgress:t,dir:n,gitdir:r,filepath:o})}catch(a){throw a.caller="git.indexPack",a}}async function qz({fs:e,bare:t=!1,dir:n,gitdir:r=t?n:me.join(n,".git"),defaultBranch:o="master"}){try{return X("fs",e),X("gitdir",r),t||X("dir",n),await lx({fs:new Ne(e),bare:t,dir:n,gitdir:r,defaultBranch:o})}catch(i){throw i.caller="git.init",i}}async function hx({fs:e,cache:t,gitdir:n,oid:r,ancestor:o,depth:i}){const a=await tl.read({fs:e,gitdir:n});if(!r)throw new un("oid");if(!o)throw new un("ancestor");if(r===o)return!1;const s=[r],l=new Set;let c=0;for(;s.length;){if(c++===i)throw new Vs(i);const u=s.shift(),{type:d,object:f}=await pt({fs:e,cache:t,gitdir:n,oid:u});if(d!=="commit")throw new en(u,d,"commit");const h=mt.from(f).parse();for(const p of h.parent)if(p===o)return!0;if(!a.has(u))for(const p of h.parent)l.has(p)||(s.push(p),l.add(p))}return!1}async function Yz({fs:e,dir:t,gitdir:n=me.join(t,".git"),oid:r,ancestor:o,depth:i=-1,cache:a={}}){try{return X("fs",e),X("gitdir",n),X("oid",r),X("ancestor",o),await hx({fs:new Ne(e),cache:a,gitdir:n,oid:r,ancestor:o,depth:i})}catch(s){throw s.caller="git.isDescendent",s}}async function Kz({fs:e,dir:t,gitdir:n=me.join(t,".git"),filepath:r}){try{return X("fs",e),X("dir",t),X("gitdir",n),X("filepath",r),oa.isIgnored({fs:new Ne(e),dir:t,gitdir:n,filepath:r})}catch(o){throw o.caller="git.isIgnored",o}}async function Xz({fs:e,dir:t,gitdir:n=me.join(t,".git"),remote:r}){try{return X("fs",e),X("gitdir",n),ve.listBranches({fs:new Ne(e),gitdir:n,remote:r})}catch(o){throw o.caller="git.listBranches",o}}async function Zz({fs:e,gitdir:t,ref:n,cache:r}){if(n){const o=await ve.resolve({gitdir:t,fs:e,ref:n}),i=[];return await px({fs:e,cache:r,gitdir:t,oid:o,filenames:i,prefix:""}),i}else return At.acquire({fs:e,gitdir:t,cache:r},async function(o){return o.entries.map(i=>i.path)})}async function px({fs:e,cache:t,gitdir:n,oid:r,filenames:o,prefix:i}){const{tree:a}=await sa({fs:e,cache:t,gitdir:n,oid:r});for(const s of a)s.type==="tree"?await px({fs:e,cache:t,gitdir:n,oid:s.oid,filenames:o,prefix:me.join(i,s.path)}):o.push(me.join(i,s.path))}async function Jz({fs:e,dir:t,gitdir:n=me.join(t,".git"),ref:r,cache:o={}}){try{return X("fs",e),X("gitdir",n),await Zz({fs:new Ne(e),cache:o,gitdir:n,ref:r})}catch(i){throw i.caller="git.listFiles",i}}async function Qz({fs:e,cache:t,gitdir:n,ref:r}){let o;try{o=await ve.resolve({gitdir:n,fs:e,ref:r})}catch(s){if(s instanceof at)return[]}return(await sa({fs:e,cache:t,gitdir:n,oid:o})).tree.map(s=>({target:s.path,note:s.oid}))}async function eB({fs:e,dir:t,gitdir:n=me.join(t,".git"),ref:r="refs/notes/commits",cache:o={}}){try{return X("fs",e),X("gitdir",n),X("ref",r),await Qz({fs:new Ne(e),cache:o,gitdir:n,ref:r})}catch(i){throw i.caller="git.listNotes",i}}async function tB({fs:e,dir:t,gitdir:n=me.join(t,".git"),filepath:r}){try{return X("fs",e),X("gitdir",n),ve.listRefs({fs:new Ne(e),gitdir:n,filepath:r})}catch(o){throw o.caller="git.listRefs",o}}async function nB({fs:e,gitdir:t}){const n=await St.get({fs:e,gitdir:t}),r=await n.getSubsections("remote");return Promise.all(r.map(async i=>{const a=await n.get(`remote.${i}.url`);return{remote:i,url:a}}))}async function rB({fs:e,dir:t,gitdir:n=me.join(t,".git")}){try{return X("fs",e),X("gitdir",n),await nB({fs:new Ne(e),gitdir:n})}catch(r){throw r.caller="git.listRemotes",r}}async function oB(e){const t=Ct.streamReader(e),n=[];let r;for(;r=await t(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");const[o,i,...a]=r.split(" "),s={ref:i,oid:o};for(const l of a){const[c,u]=l.split(":");c==="symref-target"?s.target=u:c==="peeled"&&(s.peeled=u)}n.push(s)}return n}async function iB({prefix:e,symrefs:t,peelTags:n}){const r=[];return r.push(Ct.encode(`command=ls-refs
|
|
88
|
+
`);return{cleanMerge:h,mergedText:f}}async function Dz({fs:e,cache:t,dir:n,gitdir:r=me.join(n,".git"),index:o,ourOid:i,baseOid:a,theirOid:s,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:d=!1,abortOnConflict:f=!0,mergeDriver:h}){const p=zn({ref:i}),m=zn({ref:a}),v=zn({ref:s}),w=[],b=[],x=[],_=[],C=await yo({fs:e,cache:t,dir:n,gitdir:r,trees:[p,m,v],map:async function(N,[R,T,M]){const D=Wc(N),A=await Jc(R,T),O=await Jc(M,T);switch(`${A}-${O}`){case"false-false":return{mode:await T.mode(),path:D,oid:await T.oid(),type:await T.type()};case"false-true":return M?{mode:await M.mode(),path:D,oid:await M.oid(),type:await M.type()}:void 0;case"true-false":return R?{mode:await R.mode(),path:D,oid:await R.oid(),type:await R.type()}:void 0;case"true-true":{if(R&&T&&M&&await R.type()==="blob"&&await T.type()==="blob"&&await M.type()==="blob")return Az({fs:e,gitdir:r,path:D,ours:R,base:T,theirs:M,ourName:l,baseName:c,theirName:u,mergeDriver:h}).then(async $=>{if($.cleanMerge)f||o.insert({filepath:N,oid:$.mergeResult.oid,stage:0});else if(w.push(N),b.push(N),!f){const W=await T.oid(),re=await R.oid(),Y=await M.oid();o.delete({filepath:N}),o.insert({filepath:N,oid:W,stage:1}),o.insert({filepath:N,oid:re,stage:2}),o.insert({filepath:N,oid:Y,stage:3})}return $.mergeResult});if(T&&!R&&M&&await T.type()==="blob"&&await M.type()==="blob"){if(w.push(N),x.push(N),!f){const $=await T.oid(),W=await M.oid();o.delete({filepath:N}),o.insert({filepath:N,oid:$,stage:1}),o.insert({filepath:N,oid:W,stage:3})}return{mode:await M.mode(),oid:await M.oid(),type:"blob",path:D}}if(T&&R&&!M&&await T.type()==="blob"&&await R.type()==="blob"){if(w.push(N),_.push(N),!f){const $=await T.oid(),W=await R.oid();o.delete({filepath:N}),o.insert({filepath:N,oid:$,stage:1}),o.insert({filepath:N,oid:W,stage:2})}return{mode:await R.mode(),oid:await R.oid(),type:"blob",path:D}}if(T&&!R&&!M&&await T.type()==="blob")return;throw new Qi}}},reduce:w.length!==0&&(!n||f)?void 0:async(N,R)=>{const T=R.filter(Boolean);if(N&&!(N&&N.type==="tree"&&T.length===0)){if(T.length>0){const D=new cn(T).toObject(),A=await dn({fs:e,gitdir:r,type:"tree",object:D,dryRun:d});N.oid=A}return N}}});return w.length!==0?(n&&!f&&await yo({fs:e,cache:t,dir:n,gitdir:r,trees:[zn({ref:C.oid})],map:async function(N,[R]){const T=`${n}/${N}`;if(await R.type()==="blob"){const M=await R.mode(),D=new TextDecoder().decode(await R.content());await e.write(T,D,{mode:M})}return!0}}),new ea(w,b,x,_)):C.oid}async function Az({fs:e,gitdir:t,path:n,ours:r,base:o,theirs:i,ourName:a,theirName:s,baseName:l,dryRun:c,mergeDriver:u=kz}){const d="blob",f=await o.mode()===await r.mode()?await i.mode():await r.mode();if(await r.oid()===await i.oid())return{cleanMerge:!0,mergeResult:{mode:f,path:n,oid:await r.oid(),type:d}};if(await r.oid()===await o.oid())return{cleanMerge:!0,mergeResult:{mode:f,path:n,oid:await i.oid(),type:d}};if(await i.oid()===await o.oid())return{cleanMerge:!0,mergeResult:{mode:f,path:n,oid:await r.oid(),type:d}};const h=Buffer.from(await r.content()).toString("utf8"),p=Buffer.from(await o.content()).toString("utf8"),m=Buffer.from(await i.content()).toString("utf8"),{mergedText:v,cleanMerge:w}=await u({branches:[l,a,s],contents:[p,h,m],path:n}),b=await dn({fs:e,gitdir:t,type:"blob",object:Buffer.from(v,"utf8"),dryRun:c});return{cleanMerge:w,mergeResult:{mode:f,path:n,oid:b,type:d}}}async function cx({fs:e,cache:t,dir:n,gitdir:r,ours:o,theirs:i,fastForward:a=!0,fastForwardOnly:s=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:d,author:f,committer:h,signingKey:p,onSign:m,mergeDriver:v}){o===void 0&&(o=await xo({fs:e,gitdir:r,fullname:!0})),o=await ve.expand({fs:e,gitdir:r,ref:o}),i=await ve.expand({fs:e,gitdir:r,ref:i});const w=await ve.resolve({fs:e,gitdir:r,ref:o}),b=await ve.resolve({fs:e,gitdir:r,ref:i}),x=await Fh({fs:e,cache:t,gitdir:r,oids:[w,b]});if(x.length!==1)throw new Qi;const _=x[0];if(_===b)return{oid:w,alreadyMerged:!0};if(a&&_===w)return!l&&!c&&await ve.writeRef({fs:e,gitdir:r,ref:o,value:b}),{oid:b,fastForward:!0};{if(s)throw new Bs;const C=await At.acquire({fs:e,gitdir:r,cache:t,allowUnmerged:!1},async R=>Dz({fs:e,cache:t,dir:n,gitdir:r,index:R,ourOid:w,theirOid:b,baseOid:_,ourName:oi(o),baseName:"base",theirName:oi(i),dryRun:l,abortOnConflict:u,mergeDriver:v}));if(C instanceof ea)throw C;return d||(d=`Merge branch '${oi(i)}' into ${oi(o)}`),{oid:await Qc({fs:e,cache:t,gitdir:r,message:d,ref:o,tree:C,parent:[w,b],author:f,committer:h,signingKey:p,onSign:m,dryRun:l,noUpdateBranch:c}),tree:C,mergeCommit:!0}}}async function ux({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,dir:l,gitdir:c,ref:u,url:d,remote:f,remoteRef:h,prune:p,pruneTags:m,fastForward:v,fastForwardOnly:w,corsProxy:b,singleBranch:x,headers:_,author:C,committer:N,signingKey:R}){try{if(!u){const D=await xo({fs:e,gitdir:c});if(!D)throw new un("ref");u=D}const{fetchHead:T,fetchHeadDescription:M}=await $h({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,gitdir:c,corsProxy:b,ref:u,url:d,remote:f,remoteRef:h,singleBranch:x,headers:_,prune:p,pruneTags:m});await cx({fs:e,cache:t,gitdir:c,ours:u,theirs:T,fastForward:v,fastForwardOnly:w,message:`Merge ${M}`,author:C,committer:N,signingKey:R,dryRun:!1,noUpdateBranch:!1}),await Ah({fs:e,cache:t,onProgress:r,dir:l,gitdir:c,ref:u,remote:f,noCheckout:!1})}catch(T){throw T.caller="git.pull",T}}async function Iz({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l=me.join(s,".git"),ref:c,url:u,remote:d,remoteRef:f,corsProxy:h,singleBranch:p,headers:m={},cache:v={}}){try{X("fs",e),X("http",t),X("gitdir",l);const w={name:"",email:"",timestamp:Date.now(),timezoneOffset:0};return await ux({fs:new Ne(e),cache:v,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l,ref:c,url:u,remote:d,remoteRef:f,fastForwardOnly:!0,corsProxy:h,singleBranch:p,headers:m,author:w,committer:w})}catch(w){throw w.caller="git.fastForward",w}}async function Oz({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l=me.join(s,".git"),ref:c,remote:u,remoteRef:d,url:f,corsProxy:h,depth:p=null,since:m=null,exclude:v=[],relative:w=!1,tags:b=!1,singleBranch:x=!1,headers:_={},prune:C=!1,pruneTags:N=!1,cache:R={}}){try{return X("fs",e),X("http",t),X("gitdir",l),await $h({fs:new Ne(e),cache:R,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,gitdir:l,ref:c,remote:u,remoteRef:d,url:f,corsProxy:h,depth:p,since:m,exclude:v,relative:w,tags:b,singleBranch:x,headers:_,prune:C,pruneTags:N})}catch(T){throw T.caller="git.fetch",T}}async function jz({fs:e,dir:t,gitdir:n=me.join(t,".git"),oids:r,cache:o={}}){try{return X("fs",e),X("gitdir",n),X("oids",r),await Fh({fs:new Ne(e),cache:o,gitdir:n,oids:r})}catch(i){throw i.caller="git.findMergeBase",i}}async function dx({fs:e,filepath:t}){if(await e.exists(me.join(t,".git")))return t;{const n=Yi(t);if(n===t)throw new at(`git root for ${t}`);return dx({fs:e,filepath:n})}}async function $z({fs:e,filepath:t}){try{return X("fs",e),X("filepath",t),await dx({fs:new Ne(e),filepath:t})}catch(n){throw n.caller="git.findRoot",n}}async function Fz({fs:e,dir:t,gitdir:n=me.join(t,".git"),path:r}){try{return X("fs",e),X("gitdir",n),X("path",r),await Zs({fs:new Ne(e),gitdir:n,path:r})}catch(o){throw o.caller="git.getConfig",o}}async function Lz({fs:e,gitdir:t,path:n}){return(await St.get({fs:e,gitdir:t})).getall(n)}async function zz({fs:e,dir:t,gitdir:n=me.join(t,".git"),path:r}){try{return X("fs",e),X("gitdir",n),X("path",r),await Lz({fs:new Ne(e),gitdir:n,path:r})}catch(o){throw o.caller="git.getConfigAll",o}}async function Bz({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,url:i,headers:a={},forPush:s=!1}){try{X("http",e),X("url",i);const c=await nu.getRemoteHelperFor({url:i}).discover({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,service:s?"git-receive-pack":"git-upload-pack",url:i,headers:a,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(const[d,f]of c.refs){const h=d.split("/"),p=h.pop();let m=u;for(const v of h)m[v]=m[v]||{},m=m[v];m[p]=f}for(const[d,f]of c.symrefs){const h=d.split("/"),p=h.pop();let m=u;for(const v of h)m[v]=m[v]||{},m=m[v];m[p]=f}return u}catch(l){throw l.caller="git.getRemoteInfo",l}}function fx(e,t,n,r){const o=[];for(const[i,a]of e.refs){if(t&&!i.startsWith(t))continue;if(i.endsWith("^{}")){if(r){const l=i.replace("^{}",""),c=o[o.length-1],u=c.ref===l?c:o.find(d=>d.ref===l);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=a}continue}const s={ref:i,oid:a};n&&e.symrefs.has(i)&&(s.target=e.symrefs.get(i)),o.push(s)}return o}async function Hz({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,url:i,headers:a={},forPush:s=!1,protocolVersion:l=2}){try{X("http",e),X("url",i);const u=await nu.getRemoteHelperFor({url:i}).discover({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,service:s?"git-receive-pack":"git-upload-pack",url:i,headers:a,protocolVersion:l});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};const d={};for(const f of u.capabilities){const[h,p]=f.split("=");p?d[h]=p:d[h]=!0}return{protocolVersion:1,capabilities:d,refs:fx(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}async function Vz({type:e,object:t,format:n="content",oid:r=void 0}){return n!=="deflated"&&(n!=="wrapped"&&(t=Xi.wrap({type:e,object:t})),r=await Ur(t)),{oid:r,object:t}}async function Uz({object:e}){try{X("object",e),typeof e=="string"?e=Buffer.from(e,"utf8"):e=Buffer.from(e);const t="blob",{oid:n,object:r}=await Vz({type:"blob",format:"content",object:e});return{oid:n,type:t,object:new Uint8Array(r),format:"wrapped"}}catch(t){throw t.caller="git.hashBlob",t}}async function Wz({fs:e,cache:t,onProgress:n,dir:r,gitdir:o,filepath:i}){try{i=me.join(r,i);const a=await e.read(i),s=c=>pt({fs:e,cache:t,gitdir:o,oid:c}),l=await Zi.fromPack({pack:a,getExternalRefDelta:s,onProgress:n});return await e.write(i.replace(/\.pack$/,".idx"),await l.toBuffer()),{oids:[...l.hashes]}}catch(a){throw a.caller="git.indexPack",a}}async function Gz({fs:e,onProgress:t,dir:n,gitdir:r=me.join(n,".git"),filepath:o,cache:i={}}){try{return X("fs",e),X("dir",n),X("gitdir",n),X("filepath",o),await Wz({fs:new Ne(e),cache:i,onProgress:t,dir:n,gitdir:r,filepath:o})}catch(a){throw a.caller="git.indexPack",a}}async function qz({fs:e,bare:t=!1,dir:n,gitdir:r=t?n:me.join(n,".git"),defaultBranch:o="master"}){try{return X("fs",e),X("gitdir",r),t||X("dir",n),await lx({fs:new Ne(e),bare:t,dir:n,gitdir:r,defaultBranch:o})}catch(i){throw i.caller="git.init",i}}async function hx({fs:e,cache:t,gitdir:n,oid:r,ancestor:o,depth:i}){const a=await tl.read({fs:e,gitdir:n});if(!r)throw new un("oid");if(!o)throw new un("ancestor");if(r===o)return!1;const s=[r],l=new Set;let c=0;for(;s.length;){if(c++===i)throw new Vs(i);const u=s.shift(),{type:d,object:f}=await pt({fs:e,cache:t,gitdir:n,oid:u});if(d!=="commit")throw new en(u,d,"commit");const h=mt.from(f).parse();for(const p of h.parent)if(p===o)return!0;if(!a.has(u))for(const p of h.parent)l.has(p)||(s.push(p),l.add(p))}return!1}async function Yz({fs:e,dir:t,gitdir:n=me.join(t,".git"),oid:r,ancestor:o,depth:i=-1,cache:a={}}){try{return X("fs",e),X("gitdir",n),X("oid",r),X("ancestor",o),await hx({fs:new Ne(e),cache:a,gitdir:n,oid:r,ancestor:o,depth:i})}catch(s){throw s.caller="git.isDescendent",s}}async function Kz({fs:e,dir:t,gitdir:n=me.join(t,".git"),filepath:r}){try{return X("fs",e),X("dir",t),X("gitdir",n),X("filepath",r),oa.isIgnored({fs:new Ne(e),dir:t,gitdir:n,filepath:r})}catch(o){throw o.caller="git.isIgnored",o}}async function Xz({fs:e,dir:t,gitdir:n=me.join(t,".git"),remote:r}){try{return X("fs",e),X("gitdir",n),ve.listBranches({fs:new Ne(e),gitdir:n,remote:r})}catch(o){throw o.caller="git.listBranches",o}}async function Zz({fs:e,gitdir:t,ref:n,cache:r}){if(n){const o=await ve.resolve({gitdir:t,fs:e,ref:n}),i=[];return await px({fs:e,cache:r,gitdir:t,oid:o,filenames:i,prefix:""}),i}else return At.acquire({fs:e,gitdir:t,cache:r},async function(o){return o.entries.map(i=>i.path)})}async function px({fs:e,cache:t,gitdir:n,oid:r,filenames:o,prefix:i}){const{tree:a}=await sa({fs:e,cache:t,gitdir:n,oid:r});for(const s of a)s.type==="tree"?await px({fs:e,cache:t,gitdir:n,oid:s.oid,filenames:o,prefix:me.join(i,s.path)}):o.push(me.join(i,s.path))}async function Jz({fs:e,dir:t,gitdir:n=me.join(t,".git"),ref:r,cache:o={}}){try{return X("fs",e),X("gitdir",n),await Zz({fs:new Ne(e),cache:o,gitdir:n,ref:r})}catch(i){throw i.caller="git.listFiles",i}}async function Qz({fs:e,cache:t,gitdir:n,ref:r}){let o;try{o=await ve.resolve({gitdir:n,fs:e,ref:r})}catch(s){if(s instanceof at)return[]}return(await sa({fs:e,cache:t,gitdir:n,oid:o})).tree.map(s=>({target:s.path,note:s.oid}))}async function eB({fs:e,dir:t,gitdir:n=me.join(t,".git"),ref:r="refs/notes/commits",cache:o={}}){try{return X("fs",e),X("gitdir",n),X("ref",r),await Qz({fs:new Ne(e),cache:o,gitdir:n,ref:r})}catch(i){throw i.caller="git.listNotes",i}}async function tB({fs:e,dir:t,gitdir:n=me.join(t,".git"),filepath:r}){try{return X("fs",e),X("gitdir",n),ve.listRefs({fs:new Ne(e),gitdir:n,filepath:r})}catch(o){throw o.caller="git.listRefs",o}}async function nB({fs:e,gitdir:t}){const n=await St.get({fs:e,gitdir:t}),r=await n.getSubsections("remote");return Promise.all(r.map(async i=>{const a=await n.get(`remote.${i}.url`);return{remote:i,url:a}}))}async function rB({fs:e,dir:t,gitdir:n=me.join(t,".git")}){try{return X("fs",e),X("gitdir",n),await nB({fs:new Ne(e),gitdir:n})}catch(r){throw r.caller="git.listRemotes",r}}async function oB(e){const t=Ct.streamReader(e),n=[];let r;for(;r=await t(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");const[o,i,...a]=r.split(" "),s={ref:i,oid:o};for(const l of a){const[c,u]=l.split(":");c==="symref-target"?s.target=u:c==="peeled"&&(s.peeled=u)}n.push(s)}return n}async function iB({prefix:e,symrefs:t,peelTags:n}){const r=[];return r.push(Ct.encode(`command=ls-refs
|
|
89
89
|
`)),r.push(Ct.encode(`agent=${ru.agent}
|
|
90
90
|
`)),(n||t||e)&&r.push(Ct.delim()),n&&r.push(Ct.encode("peel")),t&&r.push(Ct.encode("symrefs")),e&&r.push(Ct.encode(`ref-prefix ${e}`)),r.push(Ct.flush()),r}async function aB({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,url:i,headers:a={},forPush:s=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:d}){try{X("http",e),X("url",i);const f=await tu.discover({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,service:s?"git-receive-pack":"git-upload-pack",url:i,headers:a,protocolVersion:l});if(f.protocolVersion===1)return fx(f,c,u,d);const h=await iB({prefix:c,symrefs:u,peelTags:d}),p=await tu.connect({http:e,auth:f.auth,headers:a,corsProxy:o,service:s?"git-receive-pack":"git-upload-pack",url:i,body:h});return oB(p.body)}catch(f){throw f.caller="git.listServerRefs",f}}async function sB({fs:e,dir:t,gitdir:n=me.join(t,".git")}){try{return X("fs",e),X("gitdir",n),ve.listTags({fs:new Ne(e),gitdir:n})}catch(r){throw r.caller="git.listTags",r}}function lB(e,t){return e.committer.timestamp-t.committer.timestamp}const cB="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function mx({fs:e,cache:t,gitdir:n,oid:r,fileId:o}){if(o===cB)return;const i=r;let a;const s=await ra({fs:e,cache:t,gitdir:n,oid:r}),l=s.tree;return o===s.oid?a=s.path:(a=await gx({fs:e,cache:t,gitdir:n,tree:l,fileId:o,oid:i}),Array.isArray(a)&&(a.length===0?a=void 0:a.length===1&&(a=a[0]))),a}async function gx({fs:e,cache:t,gitdir:n,tree:r,fileId:o,oid:i,filepaths:a=[],parentPath:s=""}){const l=r.entries().map(function(c){let u;return c.oid===o?(u=me.join(s,c.path),a.push(u)):c.type==="tree"&&(u=pt({fs:e,cache:t,gitdir:n,oid:c.oid}).then(function({object:d}){return gx({fs:e,cache:t,gitdir:n,tree:cn.from(d),fileId:o,oid:i,filepaths:a,parentPath:me.join(s,c.path)})})),u});return await Promise.all(l),a}async function uB({fs:e,cache:t,gitdir:n,filepath:r,ref:o,depth:i,since:a,force:s,follow:l}){const c=typeof a>"u"?void 0:Math.floor(a.valueOf()/1e3),u=[],d=await tl.read({fs:e,gitdir:n}),f=await ve.resolve({fs:e,gitdir:n,ref:o}),h=[await aa({fs:e,cache:t,gitdir:n,oid:f})];let p,m,v;function w(b){v&&r&&u.push(b)}for(;h.length>0;){const b=h.pop();if(c!==void 0&&b.commit.committer.timestamp<=c)break;if(r){let x;try{x=await Js({fs:e,cache:t,gitdir:n,oid:b.commit.tree,filepath:r}),m&&p!==x&&u.push(m),p=x,m=b,v=!0}catch(_){if(_ instanceof at){let C=l&&p;if(C&&(C=await mx({fs:e,cache:t,gitdir:n,oid:b.commit.tree,fileId:p}),C))if(Array.isArray(C)){if(m){const N=await mx({fs:e,cache:t,gitdir:n,oid:m.commit.tree,fileId:p});if(Array.isArray(N))if(C=C.filter(R=>N.indexOf(R)===-1),C.length===1)C=C[0],r=C,m&&u.push(m);else{C=!1,m&&u.push(m);break}}}else r=C,m&&u.push(m);if(!C){if(v&&p&&(u.push(m),!s))break;if(!s&&!l)throw _}m=b,v=!1}else throw _}}else u.push(b);if(i!==void 0&&u.length===i){w(b);break}if(!d.has(b.oid))for(const x of b.commit.parent){const _=await aa({fs:e,cache:t,gitdir:n,oid:x});h.map(C=>C.oid).includes(_.oid)||h.push(_)}h.length===0&&w(b),h.sort((x,_)=>lB(x.commit,_.commit))}return u}async function dB({fs:e,dir:t,gitdir:n=me.join(t,".git"),filepath:r,ref:o="HEAD",depth:i,since:a,force:s,follow:l,cache:c={}}){try{return X("fs",e),X("gitdir",n),X("ref",o),await uB({fs:new Ne(e),cache:c,gitdir:n,filepath:r,ref:o,depth:i,since:a,force:s,follow:l})}catch(u){throw u.caller="git.log",u}}async function fB({fs:e,onSign:t,dir:n,gitdir:r=me.join(n,".git"),ours:o,theirs:i,fastForward:a=!0,fastForwardOnly:s=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:d,author:f,committer:h,signingKey:p,cache:m={},mergeDriver:v}){try{X("fs",e),p&&X("onSign",t);const w=new Ne(e),b=await bo({fs:w,gitdir:r,author:f});if(!b&&(!s||!a))throw new Ht("author");const x=await ia({fs:w,gitdir:r,author:b,committer:h});if(!x&&(!s||!a))throw new Ht("committer");return await cx({fs:w,cache:m,dir:n,gitdir:r,ours:o,theirs:i,fastForward:a,fastForwardOnly:s,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:d,author:b,committer:x,signingKey:p,onSign:t,mergeDriver:v})}catch(w){throw w.caller="git.merge",w}}const hB={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function wx({fs:e,cache:t,dir:n,gitdir:r=me.join(n,".git"),oids:o}){const i=new Ay,a=[];function s(u,d){const f=Buffer.from(u,d);a.push(f),i.update(f)}async function l({stype:u,object:d}){const f=hB[u];let h=d.length,p=h>15?128:0;const m=h&15;h=h>>>4;let v=(p|f|m).toString(16);for(s(v,"hex");p;)p=h>127?128:0,v=p|h&127,s(Ih(2,v),"hex"),h=h>>>7;s(Buffer.from(await Vb(d)))}s("PACK"),s("00000002","hex"),s(Ih(8,o.length),"hex");for(const u of o){const{type:d,object:f}=await pt({fs:e,cache:t,gitdir:r,oid:u});await l({write:s,object:f,stype:d})}const c=i.digest();return a.push(c),a}async function pB({fs:e,cache:t,gitdir:n,oids:r,write:o}){const i=await wx({fs:e,cache:t,gitdir:n,oids:r}),a=Buffer.from(await eu(i)),l=`pack-${a.slice(-20).toString("hex")}.pack`;return o?(await e.write(me.join(n,`objects/pack/${l}`),a),{filename:l}):{filename:l,packfile:new Uint8Array(a)}}async function mB({fs:e,dir:t,gitdir:n=me.join(t,".git"),oids:r,write:o=!1,cache:i={}}){try{return X("fs",e),X("gitdir",n),X("oids",r),await pB({fs:new Ne(e),cache:i,gitdir:n,oids:r,write:o})}catch(a){throw a.caller="git.packObjects",a}}async function gB({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l=me.join(s,".git"),ref:c,url:u,remote:d,remoteRef:f,prune:h=!1,pruneTags:p=!1,fastForward:m=!0,fastForwardOnly:v=!1,corsProxy:w,singleBranch:b,headers:x={},author:_,committer:C,signingKey:N,cache:R={}}){try{X("fs",e),X("gitdir",l);const T=new Ne(e),M=await bo({fs:T,gitdir:l,author:_});if(!M)throw new Ht("author");const D=await ia({fs:T,gitdir:l,author:M,committer:C});if(!D)throw new Ht("committer");return await ux({fs:T,cache:R,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l,ref:c,url:u,remote:d,remoteRef:f,fastForward:m,fastForwardOnly:v,corsProxy:w,singleBranch:b,headers:x,author:M,committer:D,signingKey:N,prune:h,pruneTags:p})}catch(T){throw T.caller="git.pull",T}}async function wB({fs:e,cache:t,dir:n,gitdir:r=me.join(n,".git"),start:o,finish:i}){const a=await tl.read({fs:e,gitdir:r}),s=new Set,l=new Set;for(const d of o)s.add(await ve.resolve({fs:e,gitdir:r,ref:d}));for(const d of i)try{const f=await ve.resolve({fs:e,gitdir:r,ref:d});l.add(f)}catch{}const c=new Set;async function u(d){c.add(d);const{type:f,object:h}=await pt({fs:e,cache:t,gitdir:r,oid:d});if(f==="tag"){const m=tn.from(h).headers().object;return u(m)}if(f!=="commit")throw new en(d,f,"commit");if(!a.has(d)){const m=mt.from(h).headers().parent;for(d of m)!l.has(d)&&!c.has(d)&&await u(d)}}for(const d of s)await u(d);return c}async function zh({fs:e,cache:t,dir:n,gitdir:r=me.join(n,".git"),oids:o}){const i=new Set;async function a(s){if(i.has(s))return;i.add(s);const{type:l,object:c}=await pt({fs:e,cache:t,gitdir:r,oid:s});if(l==="tag"){const d=tn.from(c).headers().object;await a(d)}else if(l==="commit"){const d=mt.from(c).headers().tree;await a(d)}else if(l==="tree"){const u=cn.from(c);for(const d of u)d.type==="blob"&&i.add(d.oid),d.type==="tree"&&await a(d.oid)}}for(const s of o)await a(s);return i}async function vB(e){const t={};let n="";const r=Ct.streamReader(e);let o=await r();for(;o!==!0;)o!==null&&(n+=o.toString("utf8")+`
|
|
91
91
|
`),o=await r();const i=n.toString("utf8").split(`
|
|
92
92
|
`);if(o=i.shift(),!o.startsWith("unpack "))throw new ri('unpack ok" or "unpack [error message]',o);t.ok=o==="unpack ok",t.ok||(t.error=o.slice(7)),t.refs={};for(const a of i){if(a.trim()==="")continue;const s=a.slice(0,2),l=a.slice(3);let c=l.indexOf(" ");c===-1&&(c=l.length);const u=l.slice(0,c),d=l.slice(c+1);t.refs[u]={ok:s==="ok",error:d}}return t}async function yB({capabilities:e=[],triplets:t=[]}){const n=[];let r=`\0 ${e.join(" ")}`;for(const o of t)n.push(Ct.encode(`${o.oldoid} ${o.oid} ${o.fullRef}${r}
|
|
93
|
-
`)),r="";return n.push(Ct.flush()),n}async function bB({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPrePush:l,gitdir:c,ref:u,remoteRef:d,remote:f,url:h,force:p=!1,delete:m=!1,corsProxy:v,headers:w={}}){const b=u||await xo({fs:e,gitdir:c});if(typeof b>"u")throw new un("ref");const x=await St.get({fs:e,gitdir:c});f=f||await x.get(`branch.${b}.pushRemote`)||await x.get("remote.pushDefault")||await x.get(`branch.${b}.remote`)||"origin";const _=h||await x.get(`remote.${f}.pushurl`)||await x.get(`remote.${f}.url`);if(typeof _>"u")throw new un("remote OR url");const C=d||await x.get(`branch.${b}.merge`);if(typeof _>"u")throw new un("remoteRef");v===void 0&&(v=await x.get("http.corsProxy"));const N=await ve.expand({fs:e,gitdir:c,ref:b}),R=m?"0000000000000000000000000000000000000000":await ve.resolve({fs:e,gitdir:c,ref:N}),T=nu.getRemoteHelperFor({url:_}),M=await T.discover({http:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,corsProxy:v,service:"git-receive-pack",url:_,headers:w,protocolVersion:1}),D=M.auth;let A;if(!C)A=N;else try{A=await ve.expandAgainstMap({ref:C,map:M.refs})}catch(G){if(G instanceof at)A=C.startsWith("refs/")?C:`refs/heads/${C}`;else throw G}const
|
|
93
|
+
`)),r="";return n.push(Ct.flush()),n}async function bB({fs:e,cache:t,http:n,onProgress:r,onMessage:o,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPrePush:l,gitdir:c,ref:u,remoteRef:d,remote:f,url:h,force:p=!1,delete:m=!1,corsProxy:v,headers:w={}}){const b=u||await xo({fs:e,gitdir:c});if(typeof b>"u")throw new un("ref");const x=await St.get({fs:e,gitdir:c});f=f||await x.get(`branch.${b}.pushRemote`)||await x.get("remote.pushDefault")||await x.get(`branch.${b}.remote`)||"origin";const _=h||await x.get(`remote.${f}.pushurl`)||await x.get(`remote.${f}.url`);if(typeof _>"u")throw new un("remote OR url");const C=d||await x.get(`branch.${b}.merge`);if(typeof _>"u")throw new un("remoteRef");v===void 0&&(v=await x.get("http.corsProxy"));const N=await ve.expand({fs:e,gitdir:c,ref:b}),R=m?"0000000000000000000000000000000000000000":await ve.resolve({fs:e,gitdir:c,ref:N}),T=nu.getRemoteHelperFor({url:_}),M=await T.discover({http:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,corsProxy:v,service:"git-receive-pack",url:_,headers:w,protocolVersion:1}),D=M.auth;let A;if(!C)A=N;else try{A=await ve.expandAgainstMap({ref:C,map:M.refs})}catch(G){if(G instanceof at)A=C.startsWith("refs/")?C:`refs/heads/${C}`;else throw G}const O=M.refs.get(A)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:f,url:_,localRef:{ref:m?"(delete)":N,oid:R},remoteRef:{ref:A,oid:O}}))throw new na;const $=!M.capabilities.has("no-thin");let W=new Set;if(!m){const G=[...M.refs.values()];let F=new Set;if(O!=="0000000000000000000000000000000000000000"){const q=await Fh({fs:e,cache:t,gitdir:c,oids:[R,O]});for(const ce of q)G.push(ce);$&&(F=await zh({fs:e,cache:t,gitdir:c,oids:q}))}if(!G.includes(R)){const q=await wB({fs:e,cache:t,gitdir:c,start:[R],finish:G});W=await zh({fs:e,cache:t,gitdir:c,oids:q})}if($){try{const q=await ve.resolve({fs:e,gitdir:c,ref:`refs/remotes/${f}/HEAD`,depth:2}),{oid:ce}=await ve.resolveAgainstMap({ref:q.replace(`refs/remotes/${f}/`,""),fullref:q,map:M.refs}),L=[ce];for(const K of await zh({fs:e,cache:t,gitdir:c,oids:L}))F.add(K)}catch{}for(const q of F)W.delete(q)}if(R===O&&(p=!0),!p){if(N.startsWith("refs/tags")&&O!=="0000000000000000000000000000000000000000")throw new ta("tag-exists");if(R!=="0000000000000000000000000000000000000000"&&O!=="0000000000000000000000000000000000000000"&&!await hx({fs:e,cache:t,gitdir:c,oid:R,ancestor:O,depth:-1}))throw new ta("not-fast-forward")}}const re=ix([...M.capabilities],["report-status","side-band-64k",`agent=${ru.agent}`]),Y=await yB({capabilities:re,triplets:[{oldoid:O,oid:R,fullRef:A}]}),Z=m?[]:await wx({fs:e,cache:t,gitdir:c,oids:[...W]}),B=await T.connect({http:n,onProgress:r,corsProxy:v,service:"git-receive-pack",url:_,auth:D,headers:w,body:[...Y,...Z]}),{packfile:oe,progress:ee}=await sx.demux(B.body);if(o){const G=ax(ee);el(G,async F=>{await o(F)})}const ne=await vB(oe);if(B.headers&&(ne.headers=B.headers),f&&ne.ok&&ne.refs[A].ok&&!N.startsWith("refs/tags")){const G=`refs/remotes/${f}/${A.replace("refs/heads","")}`;m?await ve.deleteRef({fs:e,gitdir:c,ref:G}):await ve.writeRef({fs:e,gitdir:c,ref:G,value:R})}if(ne.ok&&Object.values(ne.refs).every(G=>G.ok))return ne;{const G=Object.entries(ne.refs).filter(([F,q])=>!q.ok).map(([F,q])=>`
|
|
94
94
|
- ${F}: ${q.error}`).join("");throw new Hs(G,ne)}}async function xB({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,onPrePush:s,dir:l,gitdir:c=me.join(l,".git"),ref:u,remoteRef:d,remote:f="origin",url:h,force:p=!1,delete:m=!1,corsProxy:v,headers:w={},cache:b={}}){try{return X("fs",e),X("http",t),X("gitdir",c),await bB({fs:new Ne(e),cache:b,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,onPrePush:s,gitdir:c,ref:u,remoteRef:d,remote:f,url:h,force:p,delete:m,corsProxy:v,headers:w})}catch(x){throw x.caller="git.push",x}}async function vx({fs:e,cache:t,gitdir:n,oid:r}){const{type:o,object:i}=await pt({fs:e,cache:t,gitdir:n,oid:r});if(o==="tag")return r=tn.from(i).parse().object,vx({fs:e,cache:t,gitdir:n,oid:r});if(o!=="blob")throw new en(r,o,"blob");return{oid:r,blob:new Uint8Array(i)}}async function yx({fs:e,cache:t,gitdir:n,oid:r,filepath:o=void 0}){return o!==void 0&&(r=await Js({fs:e,cache:t,gitdir:n,oid:r,filepath:o})),await vx({fs:e,cache:t,gitdir:n,oid:r})}async function _B({fs:e,dir:t,gitdir:n=me.join(t,".git"),oid:r,filepath:o,cache:i={}}){try{return X("fs",e),X("gitdir",n),X("oid",r),await yx({fs:new Ne(e),cache:i,gitdir:n,oid:r,filepath:o})}catch(a){throw a.caller="git.readBlob",a}}async function bx({fs:e,dir:t,gitdir:n=me.join(t,".git"),oid:r,cache:o={}}){try{return X("fs",e),X("gitdir",n),X("oid",r),await aa({fs:new Ne(e),cache:o,gitdir:n,oid:r})}catch(i){throw i.caller="git.readCommit",i}}async function SB({fs:e,cache:t,gitdir:n,ref:r="refs/notes/commits",oid:o}){const i=await ve.resolve({gitdir:n,fs:e,ref:r}),{blob:a}=await yx({fs:e,cache:t,gitdir:n,oid:i,filepath:o});return a}async function CB({fs:e,dir:t,gitdir:n=me.join(t,".git"),ref:r="refs/notes/commits",oid:o,cache:i={}}){try{return X("fs",e),X("gitdir",n),X("ref",r),X("oid",o),await SB({fs:new Ne(e),cache:i,gitdir:n,ref:r,oid:o})}catch(a){throw a.caller="git.readNote",a}}async function EB({fs:e,dir:t,gitdir:n=me.join(t,".git"),oid:r,format:o="parsed",filepath:i=void 0,encoding:a=void 0,cache:s={}}){try{X("fs",e),X("gitdir",n),X("oid",r);const l=new Ne(e);i!==void 0&&(r=await Js({fs:l,cache:s,gitdir:n,oid:r,filepath:i}));const u=await pt({fs:l,cache:s,gitdir:n,oid:r,format:o==="parsed"?"content":o});if(u.oid=r,o==="parsed")switch(u.format="parsed",u.type){case"commit":u.object=mt.from(u.object).parse();break;case"tree":u.object=cn.from(u.object).entries();break;case"blob":a?u.object=u.object.toString(a):(u.object=new Uint8Array(u.object),u.format="content");break;case"tag":u.object=tn.from(u.object).parse();break;default:throw new en(u.oid,u.type,"blob|commit|tag|tree")}else(u.format==="deflated"||u.format==="wrapped")&&(u.type=u.format);return u}catch(l){throw l.caller="git.readObject",l}}async function PB({fs:e,cache:t,gitdir:n,oid:r}){const{type:o,object:i}=await pt({fs:e,cache:t,gitdir:n,oid:r,format:"content"});if(o!=="tag")throw new en(r,o,"tag");const a=tn.from(i);return{oid:r,tag:a.parse(),payload:a.payload()}}async function RB({fs:e,dir:t,gitdir:n=me.join(t,".git"),oid:r,cache:o={}}){try{return X("fs",e),X("gitdir",n),X("oid",r),await PB({fs:new Ne(e),cache:o,gitdir:n,oid:r})}catch(i){throw i.caller="git.readTag",i}}async function NB({fs:e,dir:t,gitdir:n=me.join(t,".git"),oid:r,filepath:o=void 0,cache:i={}}){try{return X("fs",e),X("gitdir",n),X("oid",r),await sa({fs:new Ne(e),cache:i,gitdir:n,oid:r,filepath:o})}catch(a){throw a.caller="git.readTree",a}}async function TB({fs:e,dir:t,gitdir:n=me.join(t,".git"),filepath:r,cache:o={}}){try{X("fs",e),X("gitdir",n),X("filepath",r),await At.acquire({fs:new Ne(e),gitdir:n,cache:o},async function(i){i.delete({filepath:r})})}catch(i){throw i.caller="git.remove",i}}async function MB({fs:e,cache:t,onSign:n,gitdir:r,ref:o="refs/notes/commits",oid:i,author:a,committer:s,signingKey:l}){let c;try{c=await ve.resolve({gitdir:r,fs:e,ref:o})}catch(p){if(!(p instanceof at))throw p}let d=(await sa({fs:e,gitdir:r,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;d=d.filter(p=>p.path!==i);const f=await Qs({fs:e,gitdir:r,tree:d});return await Qc({fs:e,cache:t,onSign:n,gitdir:r,ref:o,tree:f,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote'
|
|
95
95
|
`,author:a,committer:s,signingKey:l})}async function kB({fs:e,onSign:t,dir:n,gitdir:r=me.join(n,".git"),ref:o="refs/notes/commits",oid:i,author:a,committer:s,signingKey:l,cache:c={}}){try{X("fs",e),X("gitdir",r),X("oid",i);const u=new Ne(e),d=await bo({fs:u,gitdir:r,author:a});if(!d)throw new Ht("author");const f=await ia({fs:u,gitdir:r,author:d,committer:s});if(!f)throw new Ht("committer");return await MB({fs:u,cache:c,onSign:t,gitdir:r,ref:o,oid:i,author:d,committer:f,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function DB({fs:e,gitdir:t,oldref:n,ref:r,checkout:o=!1}){if(r!==br.clean(r))throw new Yn(r,br.clean(r));if(n!==br.clean(n))throw new Yn(n,br.clean(n));const i=`refs/heads/${n}`,a=`refs/heads/${r}`;if(await ve.exists({fs:e,gitdir:t,ref:a}))throw new qn("branch",r,!1);const l=await ve.resolve({fs:e,gitdir:t,ref:i,depth:1});await ve.writeRef({fs:e,gitdir:t,ref:a,value:l}),await ve.deleteRef({fs:e,gitdir:t,ref:i});const u=await xo({fs:e,gitdir:t,fullname:!0})===i;(o||u)&&await ve.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:a})}async function AB({fs:e,dir:t,gitdir:n=me.join(t,".git"),ref:r,oldref:o,checkout:i=!1}){try{return X("fs",e),X("gitdir",n),X("ref",r),X("oldref",o),await DB({fs:new Ne(e),gitdir:n,ref:r,oldref:o,checkout:i})}catch(a){throw a.caller="git.renameBranch",a}}async function xx({gitdir:e,type:t,object:n}){return Ur(Xi.wrap({type:t,object:n}))}async function IB({fs:e,dir:t,gitdir:n=me.join(t,".git"),filepath:r,ref:o,cache:i={}}){try{X("fs",e),X("gitdir",n),X("filepath",r);const a=new Ne(e);let s,l;try{s=await ve.resolve({fs:a,gitdir:n,ref:o||"HEAD"})}catch(d){if(o)throw d}if(s)try{s=await Js({fs:a,cache:i,gitdir:n,oid:s,filepath:r})}catch{s=null}let c={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0};const u=t&&await a.read(me.join(t,r));u&&(l=await xx({gitdir:n,type:"blob",object:u}),s===l&&(c=await a.lstat(me.join(t,r)))),await At.acquire({fs:a,gitdir:n,cache:i},async function(d){d.delete({filepath:r}),s&&d.insert({filepath:r,stats:c,oid:s})})}catch(a){throw a.caller="git.reset",a}}async function OB({fs:e,dir:t,gitdir:n=me.join(t,".git"),ref:r,depth:o}){try{return X("fs",e),X("gitdir",n),X("ref",r),await ve.resolve({fs:new Ne(e),gitdir:n,ref:r,depth:o})}catch(i){throw i.caller="git.resolveRef",i}}async function jB({fs:e,dir:t,gitdir:n=me.join(t,".git"),path:r,value:o,append:i=!1}){try{X("fs",e),X("gitdir",n),X("path",r);const a=new Ne(e),s=await St.get({fs:a,gitdir:n});i?await s.append(r,o):await s.set(r,o),await St.save({fs:a,gitdir:n,config:s})}catch(a){throw a.caller="git.setConfig",a}}async function _x({fs:e,gitdir:t,commit:n}){const r=mt.from(n).toObject();return await dn({fs:e,gitdir:t,type:"commit",object:r,format:"content"})}class iu{static get timezoneOffsetForRefLogEntry(){const t=new Date().getTimezoneOffset(),n=Math.abs(Math.floor(t/60)),r=Math.abs(t%60).toString().padStart(2,"0");return`${t>0?"-":"+"}${n.toString().padStart(2,"0")}${r}`}static createStashReflogEntry(t,n,r){const o=t.name.replace(/\s/g,""),i="0000000000000000000000000000000000000000",a=Math.floor(Date.now()/1e3),s=iu.timezoneOffsetForRefLogEntry;return`${i} ${n} ${o} ${t.email} ${a} ${s} ${r}
|
|
96
96
|
`}static getStashReflogEntry(t,n=!1){return t.split(`
|
|
@@ -115,10 +115,10 @@ object-assign
|
|
|
115
115
|
*
|
|
116
116
|
* This source code is licensed under the MIT license found in the
|
|
117
117
|
* LICENSE file in the root directory of this source tree.
|
|
118
|
-
*/var Ot=typeof Symbol=="function"&&Symbol.for,Yh=Ot?Symbol.for("react.element"):60103,Kh=Ot?Symbol.for("react.portal"):60106,cu=Ot?Symbol.for("react.fragment"):60107,uu=Ot?Symbol.for("react.strict_mode"):60108,du=Ot?Symbol.for("react.profiler"):60114,fu=Ot?Symbol.for("react.provider"):60109,hu=Ot?Symbol.for("react.context"):60110,Xh=Ot?Symbol.for("react.async_mode"):60111,pu=Ot?Symbol.for("react.concurrent_mode"):60111,mu=Ot?Symbol.for("react.forward_ref"):60112,gu=Ot?Symbol.for("react.suspense"):60113,a5=Ot?Symbol.for("react.suspense_list"):60120,wu=Ot?Symbol.for("react.memo"):60115,vu=Ot?Symbol.for("react.lazy"):60116,s5=Ot?Symbol.for("react.block"):60121,l5=Ot?Symbol.for("react.fundamental"):60117,c5=Ot?Symbol.for("react.responder"):60118,u5=Ot?Symbol.for("react.scope"):60119;function En(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Yh:switch(e=e.type,e){case Xh:case pu:case cu:case du:case uu:case gu:return e;default:switch(e=e&&e.$$typeof,e){case hu:case mu:case vu:case wu:case fu:return e;default:return t}}case Kh:return t}}}function Kx(e){return En(e)===pu}rt.AsyncMode=Xh,rt.ConcurrentMode=pu,rt.ContextConsumer=hu,rt.ContextProvider=fu,rt.Element=Yh,rt.ForwardRef=mu,rt.Fragment=cu,rt.Lazy=vu,rt.Memo=wu,rt.Portal=Kh,rt.Profiler=du,rt.StrictMode=uu,rt.Suspense=gu,rt.isAsyncMode=function(e){return Kx(e)||En(e)===Xh},rt.isConcurrentMode=Kx,rt.isContextConsumer=function(e){return En(e)===hu},rt.isContextProvider=function(e){return En(e)===fu},rt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yh},rt.isForwardRef=function(e){return En(e)===mu},rt.isFragment=function(e){return En(e)===cu},rt.isLazy=function(e){return En(e)===vu},rt.isMemo=function(e){return En(e)===wu},rt.isPortal=function(e){return En(e)===Kh},rt.isProfiler=function(e){return En(e)===du},rt.isStrictMode=function(e){return En(e)===uu},rt.isSuspense=function(e){return En(e)===gu},rt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===cu||e===pu||e===du||e===uu||e===gu||e===a5||typeof e=="object"&&e!==null&&(e.$$typeof===vu||e.$$typeof===wu||e.$$typeof===fu||e.$$typeof===hu||e.$$typeof===mu||e.$$typeof===l5||e.$$typeof===c5||e.$$typeof===u5||e.$$typeof===s5)},rt.typeOf=En,Yx.exports=rt;var Zh=Yx.exports;function d5(e){function t(G,F,q,ce,L){for(var K=0,z=0,ie=0,le=0,ae,H,ue=0,se=0,ye,Ce=ye=ae=0,xe=0,O=0,V=0,J=0,we=q.length,pe=we-1,fe,ge="",_e="",Xe="",k="",S;xe<we;){if(H=q.charCodeAt(xe),xe===pe&&z+le+ie+K!==0&&(z!==0&&(H=z===47?10:47),le=ie=K=0,we++,pe++),z+le+ie+K===0){if(xe===pe&&(0<O&&(ge=ge.replace(f,"")),0<ge.trim().length)){switch(H){case 32:case 9:case 59:case 13:case 10:break;default:ge+=q.charAt(xe)}H=59}switch(H){case 123:for(ge=ge.trim(),ae=ge.charCodeAt(0),ye=1,J=++xe;xe<we;){switch(H=q.charCodeAt(xe)){case 123:ye++;break;case 125:ye--;break;case 47:switch(H=q.charCodeAt(xe+1)){case 42:case 47:e:{for(Ce=xe+1;Ce<pe;++Ce)switch(q.charCodeAt(Ce)){case 47:if(H===42&&q.charCodeAt(Ce-1)===42&&xe+2!==Ce){xe=Ce+1;break e}break;case 10:if(H===47){xe=Ce+1;break e}}xe=Ce}}break;case 91:H++;case 40:H++;case 34:case 39:for(;xe++<pe&&q.charCodeAt(xe)!==H;);}if(ye===0)break;xe++}switch(ye=q.substring(J,xe),ae===0&&(ae=(ge=ge.replace(d,"").trim()).charCodeAt(0)),ae){case 64:switch(0<O&&(ge=ge.replace(f,"")),H=ge.charCodeAt(1),H){case 100:case 109:case 115:case 45:O=F;break;default:O=Y}if(ye=t(F,O,ye,H,L+1),J=ye.length,0<B&&(O=n(Y,ge,V),S=s(3,ye,O,F,$,j,J,H,L,ce),ge=O.join(""),S!==void 0&&(J=(ye=S.trim()).length)===0&&(H=0,ye="")),0<J)switch(H){case 115:ge=ge.replace(N,a);case 100:case 109:case 45:ye=ge+"{"+ye+"}";break;case 107:ge=ge.replace(b,"$1 $2"),ye=ge+"{"+ye+"}",ye=re===1||re===2&&i("@"+ye,3)?"@-webkit-"+ye+"@"+ye:"@"+ye;break;default:ye=ge+ye,ce===112&&(ye=(_e+=ye,""))}else ye="";break;default:ye=t(F,n(F,ge,V),ye,ce,L+1)}Xe+=ye,ye=V=O=Ce=ae=0,ge="",H=q.charCodeAt(++xe);break;case 125:case 59:if(ge=(0<O?ge.replace(f,""):ge).trim(),1<(J=ge.length))switch(Ce===0&&(ae=ge.charCodeAt(0),ae===45||96<ae&&123>ae)&&(J=(ge=ge.replace(" ",":")).length),0<B&&(S=s(1,ge,F,G,$,j,_e.length,ce,L,ce))!==void 0&&(J=(ge=S.trim()).length)===0&&(ge="\0\0"),ae=ge.charCodeAt(0),H=ge.charCodeAt(1),ae){case 0:break;case 64:if(H===105||H===99){k+=ge+q.charAt(xe);break}default:ge.charCodeAt(J-1)!==58&&(_e+=o(ge,ae,H,ge.charCodeAt(2)))}V=O=Ce=ae=0,ge="",H=q.charCodeAt(++xe)}}switch(H){case 13:case 10:z===47?z=0:1+ae===0&&ce!==107&&0<ge.length&&(O=1,ge+="\0"),0<B*ee&&s(0,ge,F,G,$,j,_e.length,ce,L,ce),j=1,$++;break;case 59:case 125:if(z+le+ie+K===0){j++;break}default:switch(j++,fe=q.charAt(xe),H){case 9:case 32:if(le+K+z===0)switch(ue){case 44:case 58:case 9:case 32:fe="";break;default:H!==32&&(fe=" ")}break;case 0:fe="\\0";break;case 12:fe="\\f";break;case 11:fe="\\v";break;case 38:le+z+K===0&&(O=V=1,fe="\f"+fe);break;case 108:if(le+z+K+W===0&&0<Ce)switch(xe-Ce){case 2:ue===112&&q.charCodeAt(xe-3)===58&&(W=ue);case 8:se===111&&(W=se)}break;case 58:le+z+K===0&&(Ce=xe);break;case 44:z+ie+le+K===0&&(O=1,fe+="\r");break;case 34:case 39:z===0&&(le=le===H?0:le===0?H:le);break;case 91:le+z+ie===0&&K++;break;case 93:le+z+ie===0&&K--;break;case 41:le+z+K===0&&ie--;break;case 40:if(le+z+K===0){if(ae===0)switch(2*ue+3*se){case 533:break;default:ae=1}ie++}break;case 64:z+ie+le+K+Ce+ye===0&&(ye=1);break;case 42:case 47:if(!(0<le+K+ie))switch(z){case 0:switch(2*H+3*q.charCodeAt(xe+1)){case 235:z=47;break;case 220:J=xe,z=42}break;case 42:H===47&&ue===42&&J+2!==xe&&(q.charCodeAt(J+2)===33&&(_e+=q.substring(J,xe+1)),fe="",z=0)}}z===0&&(ge+=fe)}se=ue,ue=H,xe++}if(J=_e.length,0<J){if(O=F,0<B&&(S=s(2,_e,O,G,$,j,J,ce,L,ce),S!==void 0&&(_e=S).length===0))return k+_e+Xe;if(_e=O.join(",")+"{"+_e+"}",re*W!==0){switch(re!==2||i(_e,2)||(W=0),W){case 111:_e=_e.replace(_,":-moz-$1")+_e;break;case 112:_e=_e.replace(x,"::-webkit-input-$1")+_e.replace(x,"::-moz-$1")+_e.replace(x,":-ms-input-$1")+_e}W=0}}return k+_e+Xe}function n(G,F,q){var ce=F.trim().split(v);F=ce;var L=ce.length,K=G.length;switch(K){case 0:case 1:var z=0;for(G=K===0?"":G[0]+" ";z<L;++z)F[z]=r(G,F[z],q).trim();break;default:var ie=z=0;for(F=[];z<L;++z)for(var le=0;le<K;++le)F[ie++]=r(G[le]+" ",ce[z],q).trim()}return F}function r(G,F,q){var ce=F.charCodeAt(0);switch(33>ce&&(ce=(F=F.trim()).charCodeAt(0)),ce){case 38:return F.replace(w,"$1"+G.trim());case 58:return G.trim()+F.replace(w,"$1"+G.trim());default:if(0<1*q&&0<F.indexOf("\f"))return F.replace(w,(G.charCodeAt(0)===58?"":"$1")+G.trim())}return G+F}function o(G,F,q,ce){var L=G+";",K=2*F+3*q+4*ce;if(K===944){G=L.indexOf(":",9)+1;var z=L.substring(G,L.length-1).trim();return z=L.substring(0,G).trim()+z+";",re===1||re===2&&i(z,1)?"-webkit-"+z+z:z}if(re===0||re===2&&!i(L,1))return L;switch(K){case 1015:return L.charCodeAt(10)===97?"-webkit-"+L+L:L;case 951:return L.charCodeAt(3)===116?"-webkit-"+L+L:L;case 963:return L.charCodeAt(5)===110?"-webkit-"+L+L:L;case 1009:if(L.charCodeAt(4)!==100)break;case 969:case 942:return"-webkit-"+L+L;case 978:return"-webkit-"+L+"-moz-"+L+L;case 1019:case 983:return"-webkit-"+L+"-moz-"+L+"-ms-"+L+L;case 883:if(L.charCodeAt(8)===45)return"-webkit-"+L+L;if(0<L.indexOf("image-set(",11))return L.replace(A,"$1-webkit-$2")+L;break;case 932:if(L.charCodeAt(4)===45)switch(L.charCodeAt(5)){case 103:return"-webkit-box-"+L.replace("-grow","")+"-webkit-"+L+"-ms-"+L.replace("grow","positive")+L;case 115:return"-webkit-"+L+"-ms-"+L.replace("shrink","negative")+L;case 98:return"-webkit-"+L+"-ms-"+L.replace("basis","preferred-size")+L}return"-webkit-"+L+"-ms-"+L+L;case 964:return"-webkit-"+L+"-ms-flex-"+L+L;case 1023:if(L.charCodeAt(8)!==99)break;return z=L.substring(L.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),"-webkit-box-pack"+z+"-webkit-"+L+"-ms-flex-pack"+z+L;case 1005:return p.test(L)?L.replace(h,":-webkit-")+L.replace(h,":-moz-")+L:L;case 1e3:switch(z=L.substring(13).trim(),F=z.indexOf("-")+1,z.charCodeAt(0)+z.charCodeAt(F)){case 226:z=L.replace(C,"tb");break;case 232:z=L.replace(C,"tb-rl");break;case 220:z=L.replace(C,"lr");break;default:return L}return"-webkit-"+L+"-ms-"+z+L;case 1017:if(L.indexOf("sticky",9)===-1)break;case 975:switch(F=(L=G).length-10,z=(L.charCodeAt(F)===33?L.substring(0,F):L).substring(G.indexOf(":",7)+1).trim(),K=z.charCodeAt(0)+(z.charCodeAt(7)|0)){case 203:if(111>z.charCodeAt(8))break;case 115:L=L.replace(z,"-webkit-"+z)+";"+L;break;case 207:case 102:L=L.replace(z,"-webkit-"+(102<K?"inline-":"")+"box")+";"+L.replace(z,"-webkit-"+z)+";"+L.replace(z,"-ms-"+z+"box")+";"+L}return L+";";case 938:if(L.charCodeAt(5)===45)switch(L.charCodeAt(6)){case 105:return z=L.replace("-items",""),"-webkit-"+L+"-webkit-box-"+z+"-ms-flex-"+z+L;case 115:return"-webkit-"+L+"-ms-flex-item-"+L.replace(T,"")+L;default:return"-webkit-"+L+"-ms-flex-line-pack"+L.replace("align-content","").replace(T,"")+L}break;case 973:case 989:if(L.charCodeAt(3)!==45||L.charCodeAt(4)===122)break;case 931:case 953:if(D.test(G)===!0)return(z=G.substring(G.indexOf(":")+1)).charCodeAt(0)===115?o(G.replace("stretch","fill-available"),F,q,ce).replace(":fill-available",":stretch"):L.replace(z,"-webkit-"+z)+L.replace(z,"-moz-"+z.replace("fill-",""))+L;break;case 962:if(L="-webkit-"+L+(L.charCodeAt(5)===102?"-ms-"+L:"")+L,q+ce===211&&L.charCodeAt(13)===105&&0<L.indexOf("transform",10))return L.substring(0,L.indexOf(";",27)+1).replace(m,"$1-webkit-$2")+L}return L}function i(G,F){var q=G.indexOf(F===1?":":"{"),ce=G.substring(0,F!==3?q:10);return q=G.substring(q+1,G.length-1),oe(F!==2?ce:ce.replace(M,"$1"),q,F)}function a(G,F){var q=o(F,F.charCodeAt(0),F.charCodeAt(1),F.charCodeAt(2));return q!==F+";"?q.replace(R," or ($1)").substring(4):"("+F+")"}function s(G,F,q,ce,L,K,z,ie,le,ae){for(var H=0,ue=F,se;H<B;++H)switch(se=Z[H].call(u,G,ue,q,ce,L,K,z,ie,le,ae)){case void 0:case!1:case!0:case null:break;default:ue=se}if(ue!==F)return ue}function l(G){switch(G){case void 0:case null:B=Z.length=0;break;default:if(typeof G=="function")Z[B++]=G;else if(typeof G=="object")for(var F=0,q=G.length;F<q;++F)l(G[F]);else ee=!!G|0}return l}function c(G){return G=G.prefix,G!==void 0&&(oe=null,G?typeof G!="function"?re=1:(re=2,oe=G):re=0),c}function u(G,F){var q=G;if(33>q.charCodeAt(0)&&(q=q.trim()),ne=q,q=[ne],0<B){var ce=s(-1,F,q,q,$,j,0,0,0,0);ce!==void 0&&typeof ce=="string"&&(F=ce)}var L=t(Y,q,F,0,0);return 0<B&&(ce=s(-2,L,q,q,$,j,L.length,0,0,0),ce!==void 0&&(L=ce)),ne="",W=0,j=$=1,L}var d=/^\0+/g,f=/[\0\r\f]/g,h=/: */g,p=/zoo|gra/,m=/([,: ])(transform)/g,v=/,\r+?/g,w=/([\t\r\n ])*\f?&/g,b=/@(k\w+)\s*(\S*)\s*/,x=/::(place)/g,_=/:(read-only)/g,C=/[svh]\w+-[tblr]{2}/,N=/\(\s*(.*)\s*\)/g,R=/([\s\S]*?);/g,T=/-self|flex-/g,M=/[^]*?(:[rp][el]a[\w-]+)[^]*/,D=/stretch|:\s*\w+\-(?:conte|avail)/,A=/([^-])(image-set\()/,j=1,$=1,W=0,re=1,Y=[],Z=[],B=0,oe=null,ee=0,ne="";return u.use=l,u.set=c,e!==void 0&&c(e),u}var f5={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function h5(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var p5=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Xx=h5(function(e){return p5.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Jh=Zh,m5={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},g5={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},w5={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Zx={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Qh={};Qh[Jh.ForwardRef]=w5,Qh[Jh.Memo]=Zx;function Jx(e){return Jh.isMemo(e)?Zx:Qh[e.$$typeof]||m5}var v5=Object.defineProperty,y5=Object.getOwnPropertyNames,Qx=Object.getOwnPropertySymbols,b5=Object.getOwnPropertyDescriptor,x5=Object.getPrototypeOf,e_=Object.prototype;function t_(e,t,n){if(typeof t!="string"){if(e_){var r=x5(t);r&&r!==e_&&t_(e,r,n)}var o=y5(t);Qx&&(o=o.concat(Qx(t)));for(var i=Jx(e),a=Jx(t),s=0;s<o.length;++s){var l=o[s];if(!g5[l]&&!(n&&n[l])&&!(a&&a[l])&&!(i&&i[l])){var c=b5(t,l);try{v5(e,l,c)}catch{}}}}return e}var _5=t_;const S5=On(_5);function Yr(){return(Yr=Object.assign||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}).apply(this,arguments)}var n_=function(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n},ep=function(e){return e!==null&&typeof e=="object"&&(e.toString?e.toString():Object.prototype.toString.call(e))==="[object Object]"&&!Zh.typeOf(e)},yu=Object.freeze([]),_o=Object.freeze({});function il(e){return typeof e=="function"}function r_(e){return e.displayName||e.name||"Component"}function tp(e){return e&&typeof e.styledComponentId=="string"}var ua=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",np=typeof window<"u"&&"HTMLElement"in window,C5=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""&&process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY));function al(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):""))}var E5=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,o=0;o<n;o++)r+=this.groupSizes[o];return r},t.insertRules=function(n,r){if(n>=this.groupSizes.length){for(var o=this.groupSizes,i=o.length,a=i;n>=a;)(a<<=1)<0&&al(16,""+n);this.groupSizes=new Uint32Array(a),this.groupSizes.set(o),this.length=a;for(var s=i;s<a;s++)this.groupSizes[s]=0}for(var l=this.indexOfGroup(n+1),c=0,u=r.length;c<u;c++)this.tag.insertRule(l,r[c])&&(this.groupSizes[n]++,l++)},t.clearGroup=function(n){if(n<this.length){var r=this.groupSizes[n],o=this.indexOfGroup(n),i=o+r;this.groupSizes[n]=0;for(var a=o;a<i;a++)this.tag.deleteRule(o)}},t.getGroup=function(n){var r="";if(n>=this.length||this.groupSizes[n]===0)return r;for(var o=this.groupSizes[n],i=this.indexOfGroup(n),a=i+o,s=i;s<a;s++)r+=this.tag.getRule(s)+`/*!sc*/
|
|
118
|
+
*/var Ot=typeof Symbol=="function"&&Symbol.for,Yh=Ot?Symbol.for("react.element"):60103,Kh=Ot?Symbol.for("react.portal"):60106,cu=Ot?Symbol.for("react.fragment"):60107,uu=Ot?Symbol.for("react.strict_mode"):60108,du=Ot?Symbol.for("react.profiler"):60114,fu=Ot?Symbol.for("react.provider"):60109,hu=Ot?Symbol.for("react.context"):60110,Xh=Ot?Symbol.for("react.async_mode"):60111,pu=Ot?Symbol.for("react.concurrent_mode"):60111,mu=Ot?Symbol.for("react.forward_ref"):60112,gu=Ot?Symbol.for("react.suspense"):60113,a5=Ot?Symbol.for("react.suspense_list"):60120,wu=Ot?Symbol.for("react.memo"):60115,vu=Ot?Symbol.for("react.lazy"):60116,s5=Ot?Symbol.for("react.block"):60121,l5=Ot?Symbol.for("react.fundamental"):60117,c5=Ot?Symbol.for("react.responder"):60118,u5=Ot?Symbol.for("react.scope"):60119;function En(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Yh:switch(e=e.type,e){case Xh:case pu:case cu:case du:case uu:case gu:return e;default:switch(e=e&&e.$$typeof,e){case hu:case mu:case vu:case wu:case fu:return e;default:return t}}case Kh:return t}}}function Kx(e){return En(e)===pu}rt.AsyncMode=Xh,rt.ConcurrentMode=pu,rt.ContextConsumer=hu,rt.ContextProvider=fu,rt.Element=Yh,rt.ForwardRef=mu,rt.Fragment=cu,rt.Lazy=vu,rt.Memo=wu,rt.Portal=Kh,rt.Profiler=du,rt.StrictMode=uu,rt.Suspense=gu,rt.isAsyncMode=function(e){return Kx(e)||En(e)===Xh},rt.isConcurrentMode=Kx,rt.isContextConsumer=function(e){return En(e)===hu},rt.isContextProvider=function(e){return En(e)===fu},rt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yh},rt.isForwardRef=function(e){return En(e)===mu},rt.isFragment=function(e){return En(e)===cu},rt.isLazy=function(e){return En(e)===vu},rt.isMemo=function(e){return En(e)===wu},rt.isPortal=function(e){return En(e)===Kh},rt.isProfiler=function(e){return En(e)===du},rt.isStrictMode=function(e){return En(e)===uu},rt.isSuspense=function(e){return En(e)===gu},rt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===cu||e===pu||e===du||e===uu||e===gu||e===a5||typeof e=="object"&&e!==null&&(e.$$typeof===vu||e.$$typeof===wu||e.$$typeof===fu||e.$$typeof===hu||e.$$typeof===mu||e.$$typeof===l5||e.$$typeof===c5||e.$$typeof===u5||e.$$typeof===s5)},rt.typeOf=En,Yx.exports=rt;var Zh=Yx.exports;function d5(e){function t(G,F,q,ce,L){for(var K=0,z=0,ie=0,le=0,ae,H,ue=0,se=0,ye,Ce=ye=ae=0,xe=0,j=0,V=0,J=0,we=q.length,pe=we-1,fe,ge="",_e="",Xe="",k="",S;xe<we;){if(H=q.charCodeAt(xe),xe===pe&&z+le+ie+K!==0&&(z!==0&&(H=z===47?10:47),le=ie=K=0,we++,pe++),z+le+ie+K===0){if(xe===pe&&(0<j&&(ge=ge.replace(f,"")),0<ge.trim().length)){switch(H){case 32:case 9:case 59:case 13:case 10:break;default:ge+=q.charAt(xe)}H=59}switch(H){case 123:for(ge=ge.trim(),ae=ge.charCodeAt(0),ye=1,J=++xe;xe<we;){switch(H=q.charCodeAt(xe)){case 123:ye++;break;case 125:ye--;break;case 47:switch(H=q.charCodeAt(xe+1)){case 42:case 47:e:{for(Ce=xe+1;Ce<pe;++Ce)switch(q.charCodeAt(Ce)){case 47:if(H===42&&q.charCodeAt(Ce-1)===42&&xe+2!==Ce){xe=Ce+1;break e}break;case 10:if(H===47){xe=Ce+1;break e}}xe=Ce}}break;case 91:H++;case 40:H++;case 34:case 39:for(;xe++<pe&&q.charCodeAt(xe)!==H;);}if(ye===0)break;xe++}switch(ye=q.substring(J,xe),ae===0&&(ae=(ge=ge.replace(d,"").trim()).charCodeAt(0)),ae){case 64:switch(0<j&&(ge=ge.replace(f,"")),H=ge.charCodeAt(1),H){case 100:case 109:case 115:case 45:j=F;break;default:j=Y}if(ye=t(F,j,ye,H,L+1),J=ye.length,0<B&&(j=n(Y,ge,V),S=s(3,ye,j,F,$,O,J,H,L,ce),ge=j.join(""),S!==void 0&&(J=(ye=S.trim()).length)===0&&(H=0,ye="")),0<J)switch(H){case 115:ge=ge.replace(N,a);case 100:case 109:case 45:ye=ge+"{"+ye+"}";break;case 107:ge=ge.replace(b,"$1 $2"),ye=ge+"{"+ye+"}",ye=re===1||re===2&&i("@"+ye,3)?"@-webkit-"+ye+"@"+ye:"@"+ye;break;default:ye=ge+ye,ce===112&&(ye=(_e+=ye,""))}else ye="";break;default:ye=t(F,n(F,ge,V),ye,ce,L+1)}Xe+=ye,ye=V=j=Ce=ae=0,ge="",H=q.charCodeAt(++xe);break;case 125:case 59:if(ge=(0<j?ge.replace(f,""):ge).trim(),1<(J=ge.length))switch(Ce===0&&(ae=ge.charCodeAt(0),ae===45||96<ae&&123>ae)&&(J=(ge=ge.replace(" ",":")).length),0<B&&(S=s(1,ge,F,G,$,O,_e.length,ce,L,ce))!==void 0&&(J=(ge=S.trim()).length)===0&&(ge="\0\0"),ae=ge.charCodeAt(0),H=ge.charCodeAt(1),ae){case 0:break;case 64:if(H===105||H===99){k+=ge+q.charAt(xe);break}default:ge.charCodeAt(J-1)!==58&&(_e+=o(ge,ae,H,ge.charCodeAt(2)))}V=j=Ce=ae=0,ge="",H=q.charCodeAt(++xe)}}switch(H){case 13:case 10:z===47?z=0:1+ae===0&&ce!==107&&0<ge.length&&(j=1,ge+="\0"),0<B*ee&&s(0,ge,F,G,$,O,_e.length,ce,L,ce),O=1,$++;break;case 59:case 125:if(z+le+ie+K===0){O++;break}default:switch(O++,fe=q.charAt(xe),H){case 9:case 32:if(le+K+z===0)switch(ue){case 44:case 58:case 9:case 32:fe="";break;default:H!==32&&(fe=" ")}break;case 0:fe="\\0";break;case 12:fe="\\f";break;case 11:fe="\\v";break;case 38:le+z+K===0&&(j=V=1,fe="\f"+fe);break;case 108:if(le+z+K+W===0&&0<Ce)switch(xe-Ce){case 2:ue===112&&q.charCodeAt(xe-3)===58&&(W=ue);case 8:se===111&&(W=se)}break;case 58:le+z+K===0&&(Ce=xe);break;case 44:z+ie+le+K===0&&(j=1,fe+="\r");break;case 34:case 39:z===0&&(le=le===H?0:le===0?H:le);break;case 91:le+z+ie===0&&K++;break;case 93:le+z+ie===0&&K--;break;case 41:le+z+K===0&&ie--;break;case 40:if(le+z+K===0){if(ae===0)switch(2*ue+3*se){case 533:break;default:ae=1}ie++}break;case 64:z+ie+le+K+Ce+ye===0&&(ye=1);break;case 42:case 47:if(!(0<le+K+ie))switch(z){case 0:switch(2*H+3*q.charCodeAt(xe+1)){case 235:z=47;break;case 220:J=xe,z=42}break;case 42:H===47&&ue===42&&J+2!==xe&&(q.charCodeAt(J+2)===33&&(_e+=q.substring(J,xe+1)),fe="",z=0)}}z===0&&(ge+=fe)}se=ue,ue=H,xe++}if(J=_e.length,0<J){if(j=F,0<B&&(S=s(2,_e,j,G,$,O,J,ce,L,ce),S!==void 0&&(_e=S).length===0))return k+_e+Xe;if(_e=j.join(",")+"{"+_e+"}",re*W!==0){switch(re!==2||i(_e,2)||(W=0),W){case 111:_e=_e.replace(_,":-moz-$1")+_e;break;case 112:_e=_e.replace(x,"::-webkit-input-$1")+_e.replace(x,"::-moz-$1")+_e.replace(x,":-ms-input-$1")+_e}W=0}}return k+_e+Xe}function n(G,F,q){var ce=F.trim().split(v);F=ce;var L=ce.length,K=G.length;switch(K){case 0:case 1:var z=0;for(G=K===0?"":G[0]+" ";z<L;++z)F[z]=r(G,F[z],q).trim();break;default:var ie=z=0;for(F=[];z<L;++z)for(var le=0;le<K;++le)F[ie++]=r(G[le]+" ",ce[z],q).trim()}return F}function r(G,F,q){var ce=F.charCodeAt(0);switch(33>ce&&(ce=(F=F.trim()).charCodeAt(0)),ce){case 38:return F.replace(w,"$1"+G.trim());case 58:return G.trim()+F.replace(w,"$1"+G.trim());default:if(0<1*q&&0<F.indexOf("\f"))return F.replace(w,(G.charCodeAt(0)===58?"":"$1")+G.trim())}return G+F}function o(G,F,q,ce){var L=G+";",K=2*F+3*q+4*ce;if(K===944){G=L.indexOf(":",9)+1;var z=L.substring(G,L.length-1).trim();return z=L.substring(0,G).trim()+z+";",re===1||re===2&&i(z,1)?"-webkit-"+z+z:z}if(re===0||re===2&&!i(L,1))return L;switch(K){case 1015:return L.charCodeAt(10)===97?"-webkit-"+L+L:L;case 951:return L.charCodeAt(3)===116?"-webkit-"+L+L:L;case 963:return L.charCodeAt(5)===110?"-webkit-"+L+L:L;case 1009:if(L.charCodeAt(4)!==100)break;case 969:case 942:return"-webkit-"+L+L;case 978:return"-webkit-"+L+"-moz-"+L+L;case 1019:case 983:return"-webkit-"+L+"-moz-"+L+"-ms-"+L+L;case 883:if(L.charCodeAt(8)===45)return"-webkit-"+L+L;if(0<L.indexOf("image-set(",11))return L.replace(A,"$1-webkit-$2")+L;break;case 932:if(L.charCodeAt(4)===45)switch(L.charCodeAt(5)){case 103:return"-webkit-box-"+L.replace("-grow","")+"-webkit-"+L+"-ms-"+L.replace("grow","positive")+L;case 115:return"-webkit-"+L+"-ms-"+L.replace("shrink","negative")+L;case 98:return"-webkit-"+L+"-ms-"+L.replace("basis","preferred-size")+L}return"-webkit-"+L+"-ms-"+L+L;case 964:return"-webkit-"+L+"-ms-flex-"+L+L;case 1023:if(L.charCodeAt(8)!==99)break;return z=L.substring(L.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),"-webkit-box-pack"+z+"-webkit-"+L+"-ms-flex-pack"+z+L;case 1005:return p.test(L)?L.replace(h,":-webkit-")+L.replace(h,":-moz-")+L:L;case 1e3:switch(z=L.substring(13).trim(),F=z.indexOf("-")+1,z.charCodeAt(0)+z.charCodeAt(F)){case 226:z=L.replace(C,"tb");break;case 232:z=L.replace(C,"tb-rl");break;case 220:z=L.replace(C,"lr");break;default:return L}return"-webkit-"+L+"-ms-"+z+L;case 1017:if(L.indexOf("sticky",9)===-1)break;case 975:switch(F=(L=G).length-10,z=(L.charCodeAt(F)===33?L.substring(0,F):L).substring(G.indexOf(":",7)+1).trim(),K=z.charCodeAt(0)+(z.charCodeAt(7)|0)){case 203:if(111>z.charCodeAt(8))break;case 115:L=L.replace(z,"-webkit-"+z)+";"+L;break;case 207:case 102:L=L.replace(z,"-webkit-"+(102<K?"inline-":"")+"box")+";"+L.replace(z,"-webkit-"+z)+";"+L.replace(z,"-ms-"+z+"box")+";"+L}return L+";";case 938:if(L.charCodeAt(5)===45)switch(L.charCodeAt(6)){case 105:return z=L.replace("-items",""),"-webkit-"+L+"-webkit-box-"+z+"-ms-flex-"+z+L;case 115:return"-webkit-"+L+"-ms-flex-item-"+L.replace(T,"")+L;default:return"-webkit-"+L+"-ms-flex-line-pack"+L.replace("align-content","").replace(T,"")+L}break;case 973:case 989:if(L.charCodeAt(3)!==45||L.charCodeAt(4)===122)break;case 931:case 953:if(D.test(G)===!0)return(z=G.substring(G.indexOf(":")+1)).charCodeAt(0)===115?o(G.replace("stretch","fill-available"),F,q,ce).replace(":fill-available",":stretch"):L.replace(z,"-webkit-"+z)+L.replace(z,"-moz-"+z.replace("fill-",""))+L;break;case 962:if(L="-webkit-"+L+(L.charCodeAt(5)===102?"-ms-"+L:"")+L,q+ce===211&&L.charCodeAt(13)===105&&0<L.indexOf("transform",10))return L.substring(0,L.indexOf(";",27)+1).replace(m,"$1-webkit-$2")+L}return L}function i(G,F){var q=G.indexOf(F===1?":":"{"),ce=G.substring(0,F!==3?q:10);return q=G.substring(q+1,G.length-1),oe(F!==2?ce:ce.replace(M,"$1"),q,F)}function a(G,F){var q=o(F,F.charCodeAt(0),F.charCodeAt(1),F.charCodeAt(2));return q!==F+";"?q.replace(R," or ($1)").substring(4):"("+F+")"}function s(G,F,q,ce,L,K,z,ie,le,ae){for(var H=0,ue=F,se;H<B;++H)switch(se=Z[H].call(u,G,ue,q,ce,L,K,z,ie,le,ae)){case void 0:case!1:case!0:case null:break;default:ue=se}if(ue!==F)return ue}function l(G){switch(G){case void 0:case null:B=Z.length=0;break;default:if(typeof G=="function")Z[B++]=G;else if(typeof G=="object")for(var F=0,q=G.length;F<q;++F)l(G[F]);else ee=!!G|0}return l}function c(G){return G=G.prefix,G!==void 0&&(oe=null,G?typeof G!="function"?re=1:(re=2,oe=G):re=0),c}function u(G,F){var q=G;if(33>q.charCodeAt(0)&&(q=q.trim()),ne=q,q=[ne],0<B){var ce=s(-1,F,q,q,$,O,0,0,0,0);ce!==void 0&&typeof ce=="string"&&(F=ce)}var L=t(Y,q,F,0,0);return 0<B&&(ce=s(-2,L,q,q,$,O,L.length,0,0,0),ce!==void 0&&(L=ce)),ne="",W=0,O=$=1,L}var d=/^\0+/g,f=/[\0\r\f]/g,h=/: */g,p=/zoo|gra/,m=/([,: ])(transform)/g,v=/,\r+?/g,w=/([\t\r\n ])*\f?&/g,b=/@(k\w+)\s*(\S*)\s*/,x=/::(place)/g,_=/:(read-only)/g,C=/[svh]\w+-[tblr]{2}/,N=/\(\s*(.*)\s*\)/g,R=/([\s\S]*?);/g,T=/-self|flex-/g,M=/[^]*?(:[rp][el]a[\w-]+)[^]*/,D=/stretch|:\s*\w+\-(?:conte|avail)/,A=/([^-])(image-set\()/,O=1,$=1,W=0,re=1,Y=[],Z=[],B=0,oe=null,ee=0,ne="";return u.use=l,u.set=c,e!==void 0&&c(e),u}var f5={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function h5(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var p5=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Xx=h5(function(e){return p5.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Jh=Zh,m5={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},g5={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},w5={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Zx={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Qh={};Qh[Jh.ForwardRef]=w5,Qh[Jh.Memo]=Zx;function Jx(e){return Jh.isMemo(e)?Zx:Qh[e.$$typeof]||m5}var v5=Object.defineProperty,y5=Object.getOwnPropertyNames,Qx=Object.getOwnPropertySymbols,b5=Object.getOwnPropertyDescriptor,x5=Object.getPrototypeOf,e_=Object.prototype;function t_(e,t,n){if(typeof t!="string"){if(e_){var r=x5(t);r&&r!==e_&&t_(e,r,n)}var o=y5(t);Qx&&(o=o.concat(Qx(t)));for(var i=Jx(e),a=Jx(t),s=0;s<o.length;++s){var l=o[s];if(!g5[l]&&!(n&&n[l])&&!(a&&a[l])&&!(i&&i[l])){var c=b5(t,l);try{v5(e,l,c)}catch{}}}}return e}var _5=t_;const S5=On(_5);function Yr(){return(Yr=Object.assign||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}).apply(this,arguments)}var n_=function(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n},ep=function(e){return e!==null&&typeof e=="object"&&(e.toString?e.toString():Object.prototype.toString.call(e))==="[object Object]"&&!Zh.typeOf(e)},yu=Object.freeze([]),_o=Object.freeze({});function il(e){return typeof e=="function"}function r_(e){return e.displayName||e.name||"Component"}function tp(e){return e&&typeof e.styledComponentId=="string"}var ua=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",np=typeof window<"u"&&"HTMLElement"in window,C5=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""&&process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY));function al(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):""))}var E5=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,o=0;o<n;o++)r+=this.groupSizes[o];return r},t.insertRules=function(n,r){if(n>=this.groupSizes.length){for(var o=this.groupSizes,i=o.length,a=i;n>=a;)(a<<=1)<0&&al(16,""+n);this.groupSizes=new Uint32Array(a),this.groupSizes.set(o),this.length=a;for(var s=i;s<a;s++)this.groupSizes[s]=0}for(var l=this.indexOfGroup(n+1),c=0,u=r.length;c<u;c++)this.tag.insertRule(l,r[c])&&(this.groupSizes[n]++,l++)},t.clearGroup=function(n){if(n<this.length){var r=this.groupSizes[n],o=this.indexOfGroup(n),i=o+r;this.groupSizes[n]=0;for(var a=o;a<i;a++)this.tag.deleteRule(o)}},t.getGroup=function(n){var r="";if(n>=this.length||this.groupSizes[n]===0)return r;for(var o=this.groupSizes[n],i=this.indexOfGroup(n),a=i+o,s=i;s<a;s++)r+=this.tag.getRule(s)+`/*!sc*/
|
|
119
119
|
`;return r},e}(),bu=new Map,xu=new Map,sl=1,_u=function(e){if(bu.has(e))return bu.get(e);for(;xu.has(sl);)sl++;var t=sl++;return bu.set(e,t),xu.set(t,e),t},P5=function(e){return xu.get(e)},R5=function(e,t){t>=sl&&(sl=t+1),bu.set(e,t),xu.set(t,e)},N5="style["+ua+'][data-styled-version="5.3.11"]',T5=new RegExp("^"+ua+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),M5=function(e,t,n){for(var r,o=n.split(","),i=0,a=o.length;i<a;i++)(r=o[i])&&e.registerName(t,r)},k5=function(e,t){for(var n=(t.textContent||"").split(`/*!sc*/
|
|
120
120
|
`),r=[],o=0,i=n.length;o<i;o++){var a=n[o].trim();if(a){var s=a.match(T5);if(s){var l=0|parseInt(s[1],10),c=s[2];l!==0&&(R5(c,l),M5(e,c,s[3]),e.getTag().insertRules(l,r)),r.length=0}else r.push(a)}}},D5=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null},o_=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(s){for(var l=s.childNodes,c=l.length;c>=0;c--){var u=l[c];if(u&&u.nodeType===1&&u.hasAttribute(ua))return u}}(n),i=o!==void 0?o.nextSibling:null;r.setAttribute(ua,"active"),r.setAttribute("data-styled-version","5.3.11");var a=D5();return a&&r.setAttribute("nonce",a),n.insertBefore(r,i),r},A5=function(){function e(n){var r=this.element=o_(n);r.appendChild(document.createTextNode("")),this.sheet=function(o){if(o.sheet)return o.sheet;for(var i=document.styleSheets,a=0,s=i.length;a<s;a++){var l=i[a];if(l.ownerNode===o)return l}al(17)}(r),this.length=0}var t=e.prototype;return t.insertRule=function(n,r){try{return this.sheet.insertRule(r,n),this.length++,!0}catch{return!1}},t.deleteRule=function(n){this.sheet.deleteRule(n),this.length--},t.getRule=function(n){var r=this.sheet.cssRules[n];return r!==void 0&&typeof r.cssText=="string"?r.cssText:""},e}(),I5=function(){function e(n){var r=this.element=o_(n);this.nodes=r.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(n,r){if(n<=this.length&&n>=0){var o=document.createTextNode(r),i=this.nodes[n];return this.element.insertBefore(o,i||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n<this.length?this.nodes[n].textContent:""},e}(),O5=function(){function e(n){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(n,r){return n<=this.length&&(this.rules.splice(n,0,r),this.length++,!0)},t.deleteRule=function(n){this.rules.splice(n,1),this.length--},t.getRule=function(n){return n<this.length?this.rules[n]:""},e}(),i_=np,j5={isServer:!np,useCSSOMInjection:!C5},a_=function(){function e(n,r,o){n===void 0&&(n=_o),r===void 0&&(r={}),this.options=Yr({},j5,{},n),this.gs=r,this.names=new Map(o),this.server=!!n.isServer,!this.server&&np&&i_&&(i_=!1,function(i){for(var a=document.querySelectorAll(N5),s=0,l=a.length;s<l;s++){var c=a[s];c&&c.getAttribute(ua)!=="active"&&(k5(i,c),c.parentNode&&c.parentNode.removeChild(c))}}(this))}e.registerId=function(n){return _u(n)};var t=e.prototype;return t.reconstructWithOptions=function(n,r){return r===void 0&&(r=!0),new e(Yr({},this.options,{},n),this.gs,r&&this.names||void 0)},t.allocateGSInstance=function(n){return this.gs[n]=(this.gs[n]||0)+1},t.getTag=function(){return this.tag||(this.tag=(o=(r=this.options).isServer,i=r.useCSSOMInjection,a=r.target,n=o?new O5(a):i?new A5(a):new I5(a),new E5(n)));var n,r,o,i,a},t.hasNameForId=function(n,r){return this.names.has(n)&&this.names.get(n).has(r)},t.registerName=function(n,r){if(_u(n),this.names.has(n))this.names.get(n).add(r);else{var o=new Set;o.add(r),this.names.set(n,o)}},t.insertRules=function(n,r,o){this.registerName(n,r),this.getTag().insertRules(_u(n),o)},t.clearNames=function(n){this.names.has(n)&&this.names.get(n).clear()},t.clearRules=function(n){this.getTag().clearGroup(_u(n)),this.clearNames(n)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(n){for(var r=n.getTag(),o=r.length,i="",a=0;a<o;a++){var s=P5(a);if(s!==void 0){var l=n.names.get(s),c=r.getGroup(a);if(l&&c&&l.size){var u=ua+".g"+a+'[id="'+s+'"]',d="";l!==void 0&&l.forEach(function(f){f.length>0&&(d+=f+",")}),i+=""+c+u+'{content:"'+d+`"}/*!sc*/
|
|
121
|
-
`}}}return i}(this)},e}(),$5=/(a)(d)/gi,s_=function(e){return String.fromCharCode(e+(e>25?39:97))};function rp(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=s_(t%52)+n;return(s_(t%52)+n).replace($5,"$1-$2")}var da=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},l_=function(e){return da(5381,e)};function F5(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(il(n)&&!tp(n))return!1}return!0}var L5=l_("5.3.11"),z5=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&F5(t),this.componentId=n,this.baseHash=da(L5,n),this.baseStyle=r,a_.registerId(n)}return e.prototype.generateAndInjectStyles=function(t,n,r){var o=this.componentId,i=[];if(this.baseStyle&&i.push(this.baseStyle.generateAndInjectStyles(t,n,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(o,this.staticRulesId))i.push(this.staticRulesId);else{var a=fa(this.rules,t,n,r).join(""),s=rp(da(this.baseHash,a)>>>0);if(!n.hasNameForId(o,s)){var l=r(a,"."+s,void 0,o);n.insertRules(o,s,l)}i.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,u=da(this.baseHash,r.hash),d="",f=0;f<c;f++){var h=this.rules[f];if(typeof h=="string")d+=h;else if(h){var p=fa(h,t,n,r),m=Array.isArray(p)?p.join(""):p;u=da(u,m+f),d+=m}}if(d){var v=rp(u>>>0);if(!n.hasNameForId(o,v)){var w=r(d,"."+v,void 0,o);n.insertRules(o,v,w)}i.push(v)}}return i.join(" ")},e}(),B5=/^\s*\/\/.*$/gm,H5=[":","[",".","#"];function V5(e){var t,n,r,o,i=_o,a=i.options,s=a===void 0?_o:a,l=i.plugins,c=l===void 0?yu:l,u=new d5(s),d=[],f=function(m){function v(w){if(w)try{m(w+"}")}catch{}}return function(w,b,x,_,C,N,R,T,M,D){switch(w){case 1:if(M===0&&b.charCodeAt(0)===64)return m(b+";"),"";break;case 2:if(T===0)return b+"/*|*/";break;case 3:switch(T){case 102:case 112:return m(x[0]+b),"";default:return b+(D===0?"/*|*/":"")}case-2:b.split("/*|*/}").forEach(v)}}}(function(m){d.push(m)}),h=function(m,v,w){return v===0&&H5.indexOf(w[n.length])!==-1||w.match(o)?m:"."+t};function p(m,v,w,b){b===void 0&&(b="&");var x=m.replace(B5,""),_=v&&w?w+" "+v+" { "+x+" }":x;return t=b,n=v,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),u(w||!v?"":v,_)}return u.use([].concat(c,[function(m,v,w){m===2&&w.length&&w[0].lastIndexOf(n)>0&&(w[0]=w[0].replace(r,h))},f,function(m){if(m===-2){var v=d;return d=[],v}}])),p.hash=c.length?c.reduce(function(m,v){return v.name||al(15),da(m,v.name)},5381).toString():"",p}var c_=E.createContext();c_.Consumer;var u_=E.createContext(),U5=(u_.Consumer,new a_),op=V5();function W5(){return E.useContext(c_)||U5}function G5(){return E.useContext(u_)||op}var q5=function(){function e(t,n){var r=this;this.inject=function(o,i){i===void 0&&(i=op);var a=r.name+i.hash;o.hasNameForId(r.id,a)||o.insertRules(r.id,a,i(r.rules,a,"@keyframes"))},this.toString=function(){return al(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=op),this.name+t.hash},e}(),Y5=/([A-Z])/,K5=/([A-Z])/g,X5=/^ms-/,Z5=function(e){return"-"+e.toLowerCase()};function d_(e){return Y5.test(e)?e.replace(K5,Z5).replace(X5,"-ms-"):e}var f_=function(e){return e==null||e===!1||e===""};function fa(e,t,n,r){if(Array.isArray(e)){for(var o,i=[],a=0,s=e.length;a<s;a+=1)(o=fa(e[a],t,n,r))!==""&&(Array.isArray(o)?i.push.apply(i,o):i.push(o));return i}if(f_(e))return"";if(tp(e))return"."+e.styledComponentId;if(il(e)){if(typeof(c=e)!="function"||c.prototype&&c.prototype.isReactComponent||!t)return e;var l=e(t);return fa(l,t,n,r)}var c;return e instanceof q5?n?(e.inject(n,r),e.getName(r)):e:ep(e)?function u(d,f){var h,p,m=[];for(var v in d)d.hasOwnProperty(v)&&!f_(d[v])&&(Array.isArray(d[v])&&d[v].isCss||il(d[v])?m.push(d_(v)+":",d[v],";"):ep(d[v])?m.push.apply(m,u(d[v],v)):m.push(d_(v)+": "+(h=v,(p=d[v])==null||typeof p=="boolean"||p===""?"":typeof p!="number"||p===0||h in f5||h.startsWith("--")?String(p).trim():p+"px")+";"));return f?[f+" {"].concat(m,["}"]):m}(e):e.toString()}var h_=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function J5(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return il(e)||ep(e)?h_(fa(n_(yu,[e].concat(n)))):n.length===0&&e.length===1&&typeof e[0]=="string"?e:h_(fa(n_(e,n)))}var Q5=function(e,t,n){return n===void 0&&(n=_o),e.theme!==n.theme&&e.theme||t||n.theme},e8=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,t8=/(^-|-$)/g;function ip(e){return e.replace(e8,"-").replace(t8,"")}var n8=function(e){return rp(l_(e)>>>0)};function Su(e){return typeof e=="string"&&!0}var ap=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},r8=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function o8(e,t,n){var r=e[n];ap(t)&&ap(r)?p_(r,t):e[n]=t}function p_(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,i=n;o<i.length;o++){var a=i[o];if(ap(a))for(var s in a)r8(s)&&o8(e,a[s],s)}return e}var m_=E.createContext();m_.Consumer;var sp={};function g_(e,t,n){var r=tp(e),o=!Su(e),i=t.attrs,a=i===void 0?yu:i,s=t.componentId,l=s===void 0?function(b,x){var _=typeof b!="string"?"sc":ip(b);sp[_]=(sp[_]||0)+1;var C=_+"-"+n8("5.3.11"+_+sp[_]);return x?x+"-"+C:C}(t.displayName,t.parentComponentId):s,c=t.displayName,u=c===void 0?function(b){return Su(b)?"styled."+b:"Styled("+r_(b)+")"}(e):c,d=t.displayName&&t.componentId?ip(t.displayName)+"-"+t.componentId:t.componentId||l,f=r&&e.attrs?Array.prototype.concat(e.attrs,a).filter(Boolean):a,h=t.shouldForwardProp;r&&e.shouldForwardProp&&(h=t.shouldForwardProp?function(b,x,_){return e.shouldForwardProp(b,x,_)&&t.shouldForwardProp(b,x,_)}:e.shouldForwardProp);var p,m=new z5(n,d,r?e.componentStyle:void 0),v=m.isStatic&&a.length===0,w=function(b,x){return function(_,C,N,R){var T=_.attrs,M=_.componentStyle,D=_.defaultProps,A=_.foldedComponentIds,j=_.shouldForwardProp,$=_.styledComponentId,W=_.target,re=function(ce,L,K){ce===void 0&&(ce=_o);var z=Yr({},L,{theme:ce}),ie={};return K.forEach(function(le){var ae,H,ue,se=le;for(ae in il(se)&&(se=se(z)),se)z[ae]=ie[ae]=ae==="className"?(H=ie[ae],ue=se[ae],H&&ue?H+" "+ue:H||ue):se[ae]}),[z,ie]}(Q5(C,E.useContext(m_),D)||_o,C,T),Y=re[0],Z=re[1],B=function(ce,L,K,z){var ie=W5(),le=G5(),ae=L?ce.generateAndInjectStyles(_o,ie,le):ce.generateAndInjectStyles(K,ie,le);return ae}(M,R,Y),oe=N,ee=Z.$as||C.$as||Z.as||C.as||W,ne=Su(ee),G=Z!==C?Yr({},C,{},Z):C,F={};for(var q in G)q[0]!=="$"&&q!=="as"&&(q==="forwardedAs"?F.as=G[q]:(j?j(q,Xx,ee):!ne||Xx(q))&&(F[q]=G[q]));return C.style&&Z.style!==C.style&&(F.style=Yr({},C.style,{},Z.style)),F.className=Array.prototype.concat(A,$,B!==$?B:null,C.className,Z.className).filter(Boolean).join(" "),F.ref=oe,E.createElement(ee,F)}(p,b,x,v)};return w.displayName=u,(p=E.forwardRef(w)).attrs=f,p.componentStyle=m,p.displayName=u,p.shouldForwardProp=h,p.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):yu,p.styledComponentId=d,p.target=r?e.target:e,p.withComponent=function(b){var x=t.componentId,_=function(N,R){if(N==null)return{};var T,M,D={},A=Object.keys(N);for(M=0;M<A.length;M++)T=A[M],R.indexOf(T)>=0||(D[T]=N[T]);return D}(t,["componentId"]),C=x&&x+"-"+(Su(b)?b:ip(r_(b)));return g_(b,Yr({},_,{attrs:f,componentId:C}),n)},Object.defineProperty(p,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(b){this._foldedDefaultProps=r?p_({},e.defaultProps,b):b}}),Object.defineProperty(p,"toString",{value:function(){return"."+p.styledComponentId}}),o&&S5(p,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),p}var So=function(e){return function t(n,r,o){if(o===void 0&&(o=_o),!Zh.isValidElementType(r))return al(1,String(r));var i=function(){return n(r,o,J5.apply(void 0,arguments))};return i.withConfig=function(a){return t(n,r,Yr({},o,{},a))},i.attrs=function(a){return t(n,r,Yr({},o,{attrs:Array.prototype.concat(o.attrs,a).filter(Boolean)}))},i}(g_,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){So[e]=So(e)});const w_=E.createContext(null),v_=()=>{const e=E.useContext(w_);if(!e)throw new Error("useAPI must be used within an APIProvider");return e},i8=({children:e})=>{const[t,n]=E.useState(0),r=E.useCallback(async i=>{n(a=>a+1);try{return await i}finally{n(a=>Math.max(0,a-1))}},[]),o=E.useCallback(async(i,a)=>(n(s=>s+1),new Promise((s,l)=>{const c=i(),u=()=>{n(d=>Math.max(0,d-1))};c.addEventListener("load",()=>{if(u(),c.status>=200&&c.status<300)try{const d=a(c);s(d)}catch(d){l(d)}else l(new Error(`Request failed with status ${c.status}`))}),c.addEventListener("error",()=>{u(),l(new Error("Network error occurred"))}),c.addEventListener("abort",()=>{u(),l(new Error("Request cancelled"))})})),[]);return g.jsx(w_.Provider,{value:{isLoading:t>0,wrapAPICall:r,wrapXHRCall:o},children:e})},y_=E.createContext(null),lp=()=>{const e=E.useContext(y_);if(!e)throw new Error("useRGContext must be used within a RGProvider");return e},b_=e=>{const{children:t}=e,[n,r]=E.useState({w:1,h:1}),o=a=>{r(a)},i=()=>{r({w:1,h:1})};return g.jsx(y_.Provider,{value:{activeCompDimension:n,onDragStart:o,onDragStop:i},children:t})};for(var Lt=[],cp=0;cp<256;++cp)Lt.push((cp+256).toString(16).slice(1));function a8(e,t=0){return(Lt[e[t+0]]+Lt[e[t+1]]+Lt[e[t+2]]+Lt[e[t+3]]+"-"+Lt[e[t+4]]+Lt[e[t+5]]+"-"+Lt[e[t+6]]+Lt[e[t+7]]+"-"+Lt[e[t+8]]+Lt[e[t+9]]+"-"+Lt[e[t+10]]+Lt[e[t+11]]+Lt[e[t+12]]+Lt[e[t+13]]+Lt[e[t+14]]+Lt[e[t+15]]).toLowerCase()}var Cu,s8=new Uint8Array(16);function l8(){if(!Cu&&(Cu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Cu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cu(s8)}var c8=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const x_={randomUUID:c8};function __(e,t,n){if(x_.randomUUID&&!e)return x_.randomUUID();e=e||{};var r=e.random||(e.rng||l8)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,a8(r)}const up=e=>{const t=e;return{createProject:async(M,D)=>{const A={description:M,component_namespace:D};return await fetch(`${t}/create_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)})},getProjects:async()=>await fetch(`${t}/fetch_projects`,{method:"GET",headers:{"Content-Type":"application/json"}}),getSubdomains:async M=>await fetch(`${t}/subdomains?project_name=${M}`,{method:"GET",headers:{"Content-Type":"application/json"}}),allocateSubdomain:async(M,D)=>{const A={project_name:M,subdomain:D};return await fetch(`${t}/allocate_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)})},updateSubdomain:async(M,D)=>{const A={project_name:M,subdomain:D};return await fetch(`${t}/update_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)})},releaseSubdomain:async(M,D)=>{const A={project_name:M,subdomain:D};return await fetch(`${t}/release_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)})},publishProject:async(M,D)=>{const A={project_name:M,git_ref:D};return await fetch(`${t}/publish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)})},unpublishProject:async M=>{const D={project_name:M};return await fetch(`${t}/unpublish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})},tagCommit:async(M,D,A)=>{const j={project_name:M,commit_hash:D,tag_name:A};return await fetch(`${t}/tag_project_commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},getComponentLibrary:async()=>await fetch(`${t}/library_components?namespaces=example`,{method:"GET",headers:{"Content-Type":"application/json"}}),addProjectComponent:async(M,D,A,j)=>{const $={project_name:M,component_namespace:D,component_name:A,layout_metadata:j};return await fetch(`${t}/add_project_component`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})},addProjectChart:async(M,D,A)=>{const j={project_name:M,visual_id:D,layout_metadata:A};return await fetch(`${t}/add_project_chart`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},updateProjectComponentLayoutMetadata:async(M,D,A)=>{const j={project_name:M,component_id:D,layout_metadata:A};return await fetch(`${t}/update_project_component_layout_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},updateProjectComponentSourceCode:async(M,D,A)=>{const j={project_name:M,component_id:D,source_code:A};return await fetch(`${t}/update_project_component_source_code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},updateApplicationMetadata:async(M,D,A,j)=>{const $={project_name:M,application_name:D,application_description:A,application_category:j};return await fetch(`${t}/update_application_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})},updateApplicationSettings:async(M,D=null,A=null)=>{const j={project_name:M,application_login_enabled:D,default_deployment_chain_reference:A};return await fetch(`${t}/update_application_settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},updateProjectFile:async(M,D,A,j)=>{const $={file_path:M,project_name:D,source_code:A};return await fetch(`${t}/update_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($),signal:j})},deleteProjectFile:async(M,D)=>{const A={project_name:M,file_path:D};return await fetch(`${t}/delete_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)})},resetProjectFile:async(M,D,A,j,$)=>{let W={project_name:M,file_path:D,git_ref:A};return j&&(W.prune=j),$&&(W.extra_metadata=$),await fetch(`${t}/reset_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)})},deleteProject:async M=>{const D={projects:[M]};return await fetch(`${t}/delete_projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})},requestErrorCorrection:async(M,D,A)=>{const j={project_name:M,component_id:D,error_message:A};return await fetch(`${t}/error_correction`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},addImage:async M=>await fetch(`${t}/add_image`,{method:"POST",body:M}),initializeProject:async M=>await fetch(`${t}/initialize_project/${M}`,{method:"POST",headers:{"Content-Type":"application/json"}})}},S_=e=>{const t=e;return{getQueryContent:async i=>await fetch(`${t}/v1/public/sql/content-queries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({queryId:i,biscuits:[]})}),getVisuals:async(i,a,s,l,c,u,d,f)=>{const h=new URLSearchParams({pageNo:i.toString(),pageSize:a.toString(),scope:s,searchPattern:l,sortBy:c,sortOrder:u,visibility:d,visualType:f}).toString();return await fetch(`${t}/v2/content/visuals?${h}`,{method:"GET",headers:{"Content-Type":"application/json"}})},getSubscription:async()=>await fetch(`${t}/v1/subscription`,{method:"GET",headers:{"Content-Type":"application/json"}})}},dp=e=>{const t=e;return{getSecrets:async()=>await fetch(`${t}/config/secrets`,{method:"GET",headers:{"Content-Type":"application/json"}}),putSecret:async(_,C)=>await fetch(`${t}/config/secrets/${_}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)}),getSecret:async _=>await fetch(`${t}/config/secrets/${_}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteSecret:async _=>await fetch(`${t}/config/secrets/${_}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getTierKeyMap:async _=>await fetch(`${t}/config/miniapps/${_}/tier-key-map`,{method:"GET",headers:{"Content-Type":"application/json"}}),putTierKeyMap:async(_,C,N)=>await fetch(`${t}/config/miniapps/${_}/tier-key-map/${C}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret_reference:N})}),getTierKeyMapForTier:async(_,C)=>await fetch(`${t}/config/miniapps/${_}/tier-key-map/${C}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteTierKeyMap:async(_,C)=>await fetch(`${t}/config/miniapps/${_}/tier-key-map/${C}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getTierAssignments:async _=>await fetch(`${t}/config/miniapps/${_}/assignments`,{method:"GET",headers:{"Content-Type":"application/json"}}),putTierAssignment:async(_,C,N)=>await fetch(`${t}/config/miniapps/${_}/assignments/${C}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tier:N})}),getTierAssignment:async(_,C)=>await fetch(`${t}/config/miniapps/${_}/assignments/${C}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteTierAssignment:async(_,C)=>await fetch(`${t}/config/miniapps/${_}/assignments/${C}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getRateLimits:async _=>await fetch(`${t}/config/miniapps/${_}/rate-limits`,{method:"GET",headers:{"Content-Type":"application/json"}}),putRateLimit:async(_,C,N,R)=>await fetch(`${t}/config/miniapps/${_}/rate-limits/${C}/${N}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)}),getRateLimit:async(_,C,N)=>await fetch(`${t}/config/miniapps/${_}/rate-limits/${C}/${N}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteRateLimit:async(_,C,N)=>await fetch(`${t}/config/miniapps/${_}/rate-limits/${C}/${N}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),createProxyFetch:_=>async(C,N)=>{const R=C instanceof URL?C:new URL(C.toString());return await fetch(`${t}/proxy/${_.miniappName}/${R.host}${R.pathname}${R.search}${R.hash}`,N)},createProxyGetView:_=>{const C=new URL(_.gwProxyUrl).hostname;return async(N,R,T={})=>{let M=`SELECT * FROM ${N}.${R}`;T&&Object.keys(T).length>0&&(M+=`(${Object.entries(T).map(([j,$])=>`'${j}=${$}'`).join(",")})`);const D=await fetch(`${t}/proxy/${_.miniappName}/${C}/v1/sql/no-injected-authz`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sqlText:M})});if(!D.ok)throw new Error(`Failed to fetch view: ${D.statusText}`);return await D.json()}}}};function u8(e){return typeof e=="function"}const d8=e=>{const{wrapAPICall:t}=v_(),n=up(e);return new Proxy(n,{get:(o,i)=>{const a=o[i];return u8(a)?(...s)=>t(a.apply(o,s)):a}})},fp=E.createContext(null);fp.Consumer;const f8=e=>{const[t,n]=E.useState({projectName:null,projectURL:null}),[r,o]=E.useState({API_BASE_URL:null,WS_BASE_URL:null,GW_BASE_URL:null,GW_PROXY_URL:null,PROXY_API_BASE_URL:null}),[i,a]=E.useState(()=>S_(e.config.GW_BASE_URL)),[s,l]=E.useState(!1),[c,u]=E.useState(""),[d,f]=E.useState(""),[h,p]=E.useState(""),[m,v]=E.useState(__()),w=d8(e.config.API_BASE_URL),b=up(e.config.API_BASE_URL),x=w||b,[_,C]=E.useState(()=>dp(e.config.PROXY_API_BASE_URL)),[N,R]=E.useState(null),[T,M]=E.useState(null),D=()=>{v(__())};return E.useEffect(()=>{o(e==null?void 0:e.config)},[e.config]),E.useEffect(()=>{n(e==null?void 0:e.metadata)},[e.metadata]),E.useEffect(()=>{if(!(r!=null&&r.PROXY_API_BASE_URL)||!(r!=null&&r.GW_PROXY_URL)||!(t!=null&&t.projectName)){console.log("Missing required config for proxy setup");return}a(S_(r.GW_BASE_URL)),C(A=>{const j=dp(r.PROXY_API_BASE_URL),$=j.createProxyFetch({miniappName:t.projectName}),W=async(Z,B)=>$(Z,B);R(()=>W);const re=j.createProxyGetView({miniappName:t.projectName,gwProxyUrl:r.GW_PROXY_URL}),Y=async(Z,B,oe={})=>{if(typeof Z!="string"||typeof B!="string")throw new Error(`Invalid parameters: schema and viewName must be strings. Got schema: ${typeof Z}, viewName: ${typeof B}`);return re(Z,B,oe)};return M(()=>Y),j})},[r,t]),g.jsx(fp.Provider,{value:{config:r,projectMetadata:t,setProjectMetadata:n,syncToken:m,setSyncToken:D,selectedComponentId:c,setSelectedComponentId:u,selectedComponentXPath:d,setSelectedComponentXPath:f,selectedComponentHTML:h,setSelectedComponentHTML:p,isComponentSubselected:s,setIsComponentSubselected:l,APIHandler:x,gwAPIHandler:i,proxyHandler:_,proxyFetch:N,proxyGetView:T},children:e.children})},h8=e=>g.jsx(i8,{children:g.jsx(b_,{children:g.jsx(f8,{...e})})}),hp=()=>{const e=E.useContext(fp);if(e===null)throw new Error("Invalid project context.");return{...e}},p8=So.div`
|
|
121
|
+
`}}}return i}(this)},e}(),$5=/(a)(d)/gi,s_=function(e){return String.fromCharCode(e+(e>25?39:97))};function rp(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=s_(t%52)+n;return(s_(t%52)+n).replace($5,"$1-$2")}var da=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},l_=function(e){return da(5381,e)};function F5(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(il(n)&&!tp(n))return!1}return!0}var L5=l_("5.3.11"),z5=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&F5(t),this.componentId=n,this.baseHash=da(L5,n),this.baseStyle=r,a_.registerId(n)}return e.prototype.generateAndInjectStyles=function(t,n,r){var o=this.componentId,i=[];if(this.baseStyle&&i.push(this.baseStyle.generateAndInjectStyles(t,n,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(o,this.staticRulesId))i.push(this.staticRulesId);else{var a=fa(this.rules,t,n,r).join(""),s=rp(da(this.baseHash,a)>>>0);if(!n.hasNameForId(o,s)){var l=r(a,"."+s,void 0,o);n.insertRules(o,s,l)}i.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,u=da(this.baseHash,r.hash),d="",f=0;f<c;f++){var h=this.rules[f];if(typeof h=="string")d+=h;else if(h){var p=fa(h,t,n,r),m=Array.isArray(p)?p.join(""):p;u=da(u,m+f),d+=m}}if(d){var v=rp(u>>>0);if(!n.hasNameForId(o,v)){var w=r(d,"."+v,void 0,o);n.insertRules(o,v,w)}i.push(v)}}return i.join(" ")},e}(),B5=/^\s*\/\/.*$/gm,H5=[":","[",".","#"];function V5(e){var t,n,r,o,i=_o,a=i.options,s=a===void 0?_o:a,l=i.plugins,c=l===void 0?yu:l,u=new d5(s),d=[],f=function(m){function v(w){if(w)try{m(w+"}")}catch{}}return function(w,b,x,_,C,N,R,T,M,D){switch(w){case 1:if(M===0&&b.charCodeAt(0)===64)return m(b+";"),"";break;case 2:if(T===0)return b+"/*|*/";break;case 3:switch(T){case 102:case 112:return m(x[0]+b),"";default:return b+(D===0?"/*|*/":"")}case-2:b.split("/*|*/}").forEach(v)}}}(function(m){d.push(m)}),h=function(m,v,w){return v===0&&H5.indexOf(w[n.length])!==-1||w.match(o)?m:"."+t};function p(m,v,w,b){b===void 0&&(b="&");var x=m.replace(B5,""),_=v&&w?w+" "+v+" { "+x+" }":x;return t=b,n=v,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),u(w||!v?"":v,_)}return u.use([].concat(c,[function(m,v,w){m===2&&w.length&&w[0].lastIndexOf(n)>0&&(w[0]=w[0].replace(r,h))},f,function(m){if(m===-2){var v=d;return d=[],v}}])),p.hash=c.length?c.reduce(function(m,v){return v.name||al(15),da(m,v.name)},5381).toString():"",p}var c_=E.createContext();c_.Consumer;var u_=E.createContext(),U5=(u_.Consumer,new a_),op=V5();function W5(){return E.useContext(c_)||U5}function G5(){return E.useContext(u_)||op}var q5=function(){function e(t,n){var r=this;this.inject=function(o,i){i===void 0&&(i=op);var a=r.name+i.hash;o.hasNameForId(r.id,a)||o.insertRules(r.id,a,i(r.rules,a,"@keyframes"))},this.toString=function(){return al(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=op),this.name+t.hash},e}(),Y5=/([A-Z])/,K5=/([A-Z])/g,X5=/^ms-/,Z5=function(e){return"-"+e.toLowerCase()};function d_(e){return Y5.test(e)?e.replace(K5,Z5).replace(X5,"-ms-"):e}var f_=function(e){return e==null||e===!1||e===""};function fa(e,t,n,r){if(Array.isArray(e)){for(var o,i=[],a=0,s=e.length;a<s;a+=1)(o=fa(e[a],t,n,r))!==""&&(Array.isArray(o)?i.push.apply(i,o):i.push(o));return i}if(f_(e))return"";if(tp(e))return"."+e.styledComponentId;if(il(e)){if(typeof(c=e)!="function"||c.prototype&&c.prototype.isReactComponent||!t)return e;var l=e(t);return fa(l,t,n,r)}var c;return e instanceof q5?n?(e.inject(n,r),e.getName(r)):e:ep(e)?function u(d,f){var h,p,m=[];for(var v in d)d.hasOwnProperty(v)&&!f_(d[v])&&(Array.isArray(d[v])&&d[v].isCss||il(d[v])?m.push(d_(v)+":",d[v],";"):ep(d[v])?m.push.apply(m,u(d[v],v)):m.push(d_(v)+": "+(h=v,(p=d[v])==null||typeof p=="boolean"||p===""?"":typeof p!="number"||p===0||h in f5||h.startsWith("--")?String(p).trim():p+"px")+";"));return f?[f+" {"].concat(m,["}"]):m}(e):e.toString()}var h_=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function J5(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return il(e)||ep(e)?h_(fa(n_(yu,[e].concat(n)))):n.length===0&&e.length===1&&typeof e[0]=="string"?e:h_(fa(n_(e,n)))}var Q5=function(e,t,n){return n===void 0&&(n=_o),e.theme!==n.theme&&e.theme||t||n.theme},e8=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,t8=/(^-|-$)/g;function ip(e){return e.replace(e8,"-").replace(t8,"")}var n8=function(e){return rp(l_(e)>>>0)};function Su(e){return typeof e=="string"&&!0}var ap=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},r8=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function o8(e,t,n){var r=e[n];ap(t)&&ap(r)?p_(r,t):e[n]=t}function p_(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,i=n;o<i.length;o++){var a=i[o];if(ap(a))for(var s in a)r8(s)&&o8(e,a[s],s)}return e}var m_=E.createContext();m_.Consumer;var sp={};function g_(e,t,n){var r=tp(e),o=!Su(e),i=t.attrs,a=i===void 0?yu:i,s=t.componentId,l=s===void 0?function(b,x){var _=typeof b!="string"?"sc":ip(b);sp[_]=(sp[_]||0)+1;var C=_+"-"+n8("5.3.11"+_+sp[_]);return x?x+"-"+C:C}(t.displayName,t.parentComponentId):s,c=t.displayName,u=c===void 0?function(b){return Su(b)?"styled."+b:"Styled("+r_(b)+")"}(e):c,d=t.displayName&&t.componentId?ip(t.displayName)+"-"+t.componentId:t.componentId||l,f=r&&e.attrs?Array.prototype.concat(e.attrs,a).filter(Boolean):a,h=t.shouldForwardProp;r&&e.shouldForwardProp&&(h=t.shouldForwardProp?function(b,x,_){return e.shouldForwardProp(b,x,_)&&t.shouldForwardProp(b,x,_)}:e.shouldForwardProp);var p,m=new z5(n,d,r?e.componentStyle:void 0),v=m.isStatic&&a.length===0,w=function(b,x){return function(_,C,N,R){var T=_.attrs,M=_.componentStyle,D=_.defaultProps,A=_.foldedComponentIds,O=_.shouldForwardProp,$=_.styledComponentId,W=_.target,re=function(ce,L,K){ce===void 0&&(ce=_o);var z=Yr({},L,{theme:ce}),ie={};return K.forEach(function(le){var ae,H,ue,se=le;for(ae in il(se)&&(se=se(z)),se)z[ae]=ie[ae]=ae==="className"?(H=ie[ae],ue=se[ae],H&&ue?H+" "+ue:H||ue):se[ae]}),[z,ie]}(Q5(C,E.useContext(m_),D)||_o,C,T),Y=re[0],Z=re[1],B=function(ce,L,K,z){var ie=W5(),le=G5(),ae=L?ce.generateAndInjectStyles(_o,ie,le):ce.generateAndInjectStyles(K,ie,le);return ae}(M,R,Y),oe=N,ee=Z.$as||C.$as||Z.as||C.as||W,ne=Su(ee),G=Z!==C?Yr({},C,{},Z):C,F={};for(var q in G)q[0]!=="$"&&q!=="as"&&(q==="forwardedAs"?F.as=G[q]:(O?O(q,Xx,ee):!ne||Xx(q))&&(F[q]=G[q]));return C.style&&Z.style!==C.style&&(F.style=Yr({},C.style,{},Z.style)),F.className=Array.prototype.concat(A,$,B!==$?B:null,C.className,Z.className).filter(Boolean).join(" "),F.ref=oe,E.createElement(ee,F)}(p,b,x,v)};return w.displayName=u,(p=E.forwardRef(w)).attrs=f,p.componentStyle=m,p.displayName=u,p.shouldForwardProp=h,p.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):yu,p.styledComponentId=d,p.target=r?e.target:e,p.withComponent=function(b){var x=t.componentId,_=function(N,R){if(N==null)return{};var T,M,D={},A=Object.keys(N);for(M=0;M<A.length;M++)T=A[M],R.indexOf(T)>=0||(D[T]=N[T]);return D}(t,["componentId"]),C=x&&x+"-"+(Su(b)?b:ip(r_(b)));return g_(b,Yr({},_,{attrs:f,componentId:C}),n)},Object.defineProperty(p,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(b){this._foldedDefaultProps=r?p_({},e.defaultProps,b):b}}),Object.defineProperty(p,"toString",{value:function(){return"."+p.styledComponentId}}),o&&S5(p,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),p}var So=function(e){return function t(n,r,o){if(o===void 0&&(o=_o),!Zh.isValidElementType(r))return al(1,String(r));var i=function(){return n(r,o,J5.apply(void 0,arguments))};return i.withConfig=function(a){return t(n,r,Yr({},o,{},a))},i.attrs=function(a){return t(n,r,Yr({},o,{attrs:Array.prototype.concat(o.attrs,a).filter(Boolean)}))},i}(g_,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){So[e]=So(e)});const w_=E.createContext(null),v_=()=>{const e=E.useContext(w_);if(!e)throw new Error("useAPI must be used within an APIProvider");return e},i8=({children:e})=>{const[t,n]=E.useState(0),r=E.useCallback(async i=>{n(a=>a+1);try{return await i}finally{n(a=>Math.max(0,a-1))}},[]),o=E.useCallback(async(i,a)=>(n(s=>s+1),new Promise((s,l)=>{const c=i(),u=()=>{n(d=>Math.max(0,d-1))};c.addEventListener("load",()=>{if(u(),c.status>=200&&c.status<300)try{const d=a(c);s(d)}catch(d){l(d)}else l(new Error(`Request failed with status ${c.status}`))}),c.addEventListener("error",()=>{u(),l(new Error("Network error occurred"))}),c.addEventListener("abort",()=>{u(),l(new Error("Request cancelled"))})})),[]);return g.jsx(w_.Provider,{value:{isLoading:t>0,wrapAPICall:r,wrapXHRCall:o},children:e})},y_=E.createContext(null),lp=()=>{const e=E.useContext(y_);if(!e)throw new Error("useRGContext must be used within a RGProvider");return e},b_=e=>{const{children:t}=e,[n,r]=E.useState({w:1,h:1}),o=a=>{r(a)},i=()=>{r({w:1,h:1})};return g.jsx(y_.Provider,{value:{activeCompDimension:n,onDragStart:o,onDragStop:i},children:t})};for(var Lt=[],cp=0;cp<256;++cp)Lt.push((cp+256).toString(16).slice(1));function a8(e,t=0){return(Lt[e[t+0]]+Lt[e[t+1]]+Lt[e[t+2]]+Lt[e[t+3]]+"-"+Lt[e[t+4]]+Lt[e[t+5]]+"-"+Lt[e[t+6]]+Lt[e[t+7]]+"-"+Lt[e[t+8]]+Lt[e[t+9]]+"-"+Lt[e[t+10]]+Lt[e[t+11]]+Lt[e[t+12]]+Lt[e[t+13]]+Lt[e[t+14]]+Lt[e[t+15]]).toLowerCase()}var Cu,s8=new Uint8Array(16);function l8(){if(!Cu&&(Cu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Cu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cu(s8)}var c8=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const x_={randomUUID:c8};function __(e,t,n){if(x_.randomUUID&&!e)return x_.randomUUID();e=e||{};var r=e.random||(e.rng||l8)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,a8(r)}const up=e=>{const t=e;return{createProject:async(M,D,A)=>{if(A){const O=new FormData;return O.append("description",M),O.append("theme",D),O.append("background_image",A),await fetch(`${t}/create_project`,{method:"POST",body:O})}else{const O={description:M,theme:D};return await fetch(`${t}/create_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})}},getProjects:async()=>await fetch(`${t}/fetch_projects`,{method:"GET",headers:{"Content-Type":"application/json"}}),getSubdomains:async M=>await fetch(`${t}/subdomains?project_name=${M}`,{method:"GET",headers:{"Content-Type":"application/json"}}),allocateSubdomain:async(M,D)=>{const A={project_name:M,subdomain:D};return await fetch(`${t}/allocate_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)})},updateSubdomain:async(M,D)=>{const A={project_name:M,subdomain:D};return await fetch(`${t}/update_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)})},releaseSubdomain:async(M,D)=>{const A={project_name:M,subdomain:D};return await fetch(`${t}/release_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)})},publishProject:async(M,D)=>{const A={project_name:M,git_ref:D};return await fetch(`${t}/publish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)})},unpublishProject:async M=>{const D={project_name:M};return await fetch(`${t}/unpublish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})},tagCommit:async(M,D,A)=>{const O={project_name:M,commit_hash:D,tag_name:A};return await fetch(`${t}/tag_project_commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})},getComponentLibrary:async()=>await fetch(`${t}/library_components?namespaces=example`,{method:"GET",headers:{"Content-Type":"application/json"}}),addProjectComponent:async(M,D,A,O)=>{const $={project_name:M,component_namespace:D,component_name:A,layout_metadata:O};return await fetch(`${t}/add_project_component`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})},addProjectChart:async(M,D,A)=>{const O={project_name:M,visual_id:D,layout_metadata:A};return await fetch(`${t}/add_project_chart`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})},updateProjectComponentLayoutMetadata:async(M,D,A)=>{const O={project_name:M,component_id:D,layout_metadata:A};return await fetch(`${t}/update_project_component_layout_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})},updateProjectComponentSourceCode:async(M,D,A)=>{const O={project_name:M,component_id:D,source_code:A};return await fetch(`${t}/update_project_component_source_code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})},updateApplicationMetadata:async(M,D,A,O)=>{const $={project_name:M,application_name:D,application_description:A,application_category:O};return await fetch(`${t}/update_application_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})},updateApplicationSettings:async(M,D=null,A=null)=>{const O={project_name:M,application_login_enabled:D,default_deployment_chain_reference:A};return await fetch(`${t}/update_application_settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})},updateProjectFile:async(M,D,A,O)=>{const $={file_path:M,project_name:D,source_code:A};return await fetch(`${t}/update_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($),signal:O})},deleteProjectFile:async(M,D)=>{const A={project_name:M,file_path:D};return await fetch(`${t}/delete_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)})},resetProjectFile:async(M,D,A,O,$)=>{let W={project_name:M,file_path:D,git_ref:A};return O&&(W.prune=O),$&&(W.extra_metadata=$),await fetch(`${t}/reset_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)})},deleteProject:async M=>{const D={projects:[M]};return await fetch(`${t}/delete_projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})},requestErrorCorrection:async(M,D,A)=>{const O={project_name:M,component_id:D,error_message:A};return await fetch(`${t}/error_correction`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})},addImage:async M=>await fetch(`${t}/add_image`,{method:"POST",body:M}),initializeProject:async M=>await fetch(`${t}/initialize_project/${M}`,{method:"POST",headers:{"Content-Type":"application/json"}})}},S_=e=>{const t=e;return{getQueryContent:async i=>await fetch(`${t}/v1/public/sql/content-queries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({queryId:i,biscuits:[]})}),getVisuals:async(i,a,s,l,c,u,d,f)=>{const h=new URLSearchParams({pageNo:i.toString(),pageSize:a.toString(),scope:s,searchPattern:l,sortBy:c,sortOrder:u,visibility:d,visualType:f}).toString();return await fetch(`${t}/v2/content/visuals?${h}`,{method:"GET",headers:{"Content-Type":"application/json"}})},getSubscription:async()=>await fetch(`${t}/v1/subscription`,{method:"GET",headers:{"Content-Type":"application/json"}})}},dp=e=>{const t=e;return{getSecrets:async()=>await fetch(`${t}/config/secrets`,{method:"GET",headers:{"Content-Type":"application/json"}}),putSecret:async(_,C)=>await fetch(`${t}/config/secrets/${_}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)}),getSecret:async _=>await fetch(`${t}/config/secrets/${_}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteSecret:async _=>await fetch(`${t}/config/secrets/${_}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getTierKeyMap:async _=>await fetch(`${t}/config/miniapps/${_}/tier-key-map`,{method:"GET",headers:{"Content-Type":"application/json"}}),putTierKeyMap:async(_,C,N)=>await fetch(`${t}/config/miniapps/${_}/tier-key-map/${C}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret_reference:N})}),getTierKeyMapForTier:async(_,C)=>await fetch(`${t}/config/miniapps/${_}/tier-key-map/${C}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteTierKeyMap:async(_,C)=>await fetch(`${t}/config/miniapps/${_}/tier-key-map/${C}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getTierAssignments:async _=>await fetch(`${t}/config/miniapps/${_}/assignments`,{method:"GET",headers:{"Content-Type":"application/json"}}),putTierAssignment:async(_,C,N)=>await fetch(`${t}/config/miniapps/${_}/assignments/${C}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tier:N})}),getTierAssignment:async(_,C)=>await fetch(`${t}/config/miniapps/${_}/assignments/${C}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteTierAssignment:async(_,C)=>await fetch(`${t}/config/miniapps/${_}/assignments/${C}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getRateLimits:async _=>await fetch(`${t}/config/miniapps/${_}/rate-limits`,{method:"GET",headers:{"Content-Type":"application/json"}}),putRateLimit:async(_,C,N,R)=>await fetch(`${t}/config/miniapps/${_}/rate-limits/${C}/${N}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)}),getRateLimit:async(_,C,N)=>await fetch(`${t}/config/miniapps/${_}/rate-limits/${C}/${N}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteRateLimit:async(_,C,N)=>await fetch(`${t}/config/miniapps/${_}/rate-limits/${C}/${N}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),createProxyFetch:_=>async(C,N)=>{const R=C instanceof URL?C:new URL(C.toString());return await fetch(`${t}/proxy/${_.miniappName}/${R.host}${R.pathname}${R.search}${R.hash}`,N)},createProxyGetView:_=>{const C=new URL(_.gwProxyUrl).hostname;return async(N,R,T={})=>{let M=`SELECT * FROM ${N}.${R}`;T&&Object.keys(T).length>0&&(M+=`(${Object.entries(T).map(([O,$])=>`'${O}=${$}'`).join(",")})`);const D=await fetch(`${t}/proxy/${_.miniappName}/${C}/v1/sql/no-injected-authz`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sqlText:M})});if(!D.ok)throw new Error(`Failed to fetch view: ${D.statusText}`);return await D.json()}}}};function u8(e){return typeof e=="function"}const d8=e=>{const{wrapAPICall:t}=v_(),n=up(e);return new Proxy(n,{get:(o,i)=>{const a=o[i];return u8(a)?(...s)=>t(a.apply(o,s)):a}})},fp=E.createContext(null);fp.Consumer;const f8=e=>{const[t,n]=E.useState({projectName:null,projectURL:null}),[r,o]=E.useState({API_BASE_URL:null,WS_BASE_URL:null,GW_BASE_URL:null,GW_PROXY_URL:null,PROXY_API_BASE_URL:null}),[i,a]=E.useState(()=>S_(e.config.GW_BASE_URL)),[s,l]=E.useState(!1),[c,u]=E.useState(""),[d,f]=E.useState(""),[h,p]=E.useState(""),[m,v]=E.useState(__()),w=d8(e.config.API_BASE_URL),b=up(e.config.API_BASE_URL),x=w||b,[_,C]=E.useState(()=>dp(e.config.PROXY_API_BASE_URL)),[N,R]=E.useState(null),[T,M]=E.useState(null),D=()=>{v(__())};return E.useEffect(()=>{o(e==null?void 0:e.config)},[e.config]),E.useEffect(()=>{n(e==null?void 0:e.metadata)},[e.metadata]),E.useEffect(()=>{if(!(r!=null&&r.PROXY_API_BASE_URL)||!(r!=null&&r.GW_PROXY_URL)||!(t!=null&&t.projectName)){console.log("Missing required config for proxy setup");return}a(S_(r.GW_BASE_URL)),C(A=>{const O=dp(r.PROXY_API_BASE_URL),$=O.createProxyFetch({miniappName:t.projectName}),W=async(Z,B)=>$(Z,B);R(()=>W);const re=O.createProxyGetView({miniappName:t.projectName,gwProxyUrl:r.GW_PROXY_URL}),Y=async(Z,B,oe={})=>{if(typeof Z!="string"||typeof B!="string")throw new Error(`Invalid parameters: schema and viewName must be strings. Got schema: ${typeof Z}, viewName: ${typeof B}`);return re(Z,B,oe)};return M(()=>Y),O})},[r,t]),g.jsx(fp.Provider,{value:{config:r,projectMetadata:t,setProjectMetadata:n,syncToken:m,setSyncToken:D,selectedComponentId:c,setSelectedComponentId:u,selectedComponentXPath:d,setSelectedComponentXPath:f,selectedComponentHTML:h,setSelectedComponentHTML:p,isComponentSubselected:s,setIsComponentSubselected:l,APIHandler:x,gwAPIHandler:i,proxyHandler:_,proxyFetch:N,proxyGetView:T},children:e.children})},h8=e=>g.jsx(i8,{children:g.jsx(b_,{children:g.jsx(f8,{...e})})}),hp=()=>{const e=E.useContext(fp);if(e===null)throw new Error("Invalid project context.");return{...e}},p8=So.div`
|
|
122
122
|
position: fixed;
|
|
123
123
|
top: 0;
|
|
124
124
|
left: 0;
|
|
@@ -145,9 +145,9 @@ object-assign
|
|
|
145
145
|
transform: rotate(360deg);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
`,g8=({isVisible:e})=>e?g.jsx(p8,{children:g.jsx(m8,{})}):null;var C_={exports:{}},ll={},pp={exports:{}};(function(e,t){(function(n,r){r(t)})(_c,function(n){function r(z){return function(le,ae,H,ue,se,ye,Ce){return z(le,ae,Ce)}}function o(z){return function(le,ae,H,ue){if(!le||!ae||typeof le!="object"||typeof ae!="object")return z(le,ae,H,ue);var se=ue.get(le),ye=ue.get(ae);if(se&&ye)return se===ae&&ye===le;ue.set(le,ae),ue.set(ae,le);var Ce=z(le,ae,H,ue);return ue.delete(le),ue.delete(ae),Ce}}function i(z,ie){var le={};for(var ae in z)le[ae]=z[ae];for(var ae in ie)le[ae]=ie[ae];return le}function a(z){return z.constructor===Object||z.constructor==null}function s(z){return typeof z.then=="function"}function l(z,ie){return z===ie||z!==z&&ie!==ie}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",f="[object RegExp]",h="[object Map]",p="[object Number]",m="[object Object]",v="[object Set]",w="[object String]",b=Object.prototype.toString;function x(z){var ie=z.areArraysEqual,le=z.areDatesEqual,ae=z.areMapsEqual,H=z.areObjectsEqual,ue=z.areRegExpsEqual,se=z.areSetsEqual,ye=z.createIsNestedEqual,Ce=ye(xe);function xe(O,V,J){if(O===V)return!0;if(!O||!V||typeof O!="object"||typeof V!="object")return O!==O&&V!==V;if(a(O)&&a(V))return H(O,V,Ce,J);var we=Array.isArray(O),pe=Array.isArray(V);if(we||pe)return we===pe&&ie(O,V,Ce,J);var fe=b.call(O);return fe!==b.call(V)?!1:fe===d?le(O,V,Ce,J):fe===f?ue(O,V,Ce,J):fe===h?ae(O,V,Ce,J):fe===v?se(O,V,Ce,J):fe===m||fe===c?s(O)||s(V)?!1:H(O,V,Ce,J):fe===u||fe===p||fe===w?l(O.valueOf(),V.valueOf()):!1}return xe}function _(z,ie,le,ae){var H=z.length;if(ie.length!==H)return!1;for(;H-- >0;)if(!le(z[H],ie[H],H,H,z,ie,ae))return!1;return!0}var C=o(_);function N(z,ie){return l(z.valueOf(),ie.valueOf())}function R(z,ie,le,ae){var H=z.size===ie.size;if(!H)return!1;if(!z.size)return!0;var ue={},se=0;return z.forEach(function(ye,Ce){if(H){var xe=!1,O=0;ie.forEach(function(V,J){!xe&&!ue[O]&&(xe=le(Ce,J,se,O,z,ie,ae)&&le(ye,V,Ce,J,z,ie,ae))&&(ue[O]=!0),O++}),se++,H=xe}}),H}var T=o(R),M="_owner",D=Object.prototype.hasOwnProperty;function A(z,ie,le,ae){var H=Object.keys(z),ue=H.length;if(Object.keys(ie).length!==ue)return!1;for(var se;ue-- >0;){if(se=H[ue],se===M){var ye=!!z.$$typeof,Ce=!!ie.$$typeof;if((ye||Ce)&&ye!==Ce)return!1}if(!D.call(ie,se)||!le(z[se],ie[se],se,se,z,ie,ae))return!1}return!0}var j=o(A);function $(z,ie){return z.source===ie.source&&z.flags===ie.flags}function W(z,ie,le,ae){var H=z.size===ie.size;if(!H)return!1;if(!z.size)return!0;var ue={};return z.forEach(function(se,ye){if(H){var Ce=!1,xe=0;ie.forEach(function(O,V){!Ce&&!ue[xe]&&(Ce=le(se,O,ye,V,z,ie,ae))&&(ue[xe]=!0),xe++}),H=Ce}}),H}var re=o(W),Y=Object.freeze({areArraysEqual:_,areDatesEqual:N,areMapsEqual:R,areObjectsEqual:A,areRegExpsEqual:$,areSetsEqual:W,createIsNestedEqual:r}),Z=Object.freeze({areArraysEqual:C,areDatesEqual:N,areMapsEqual:T,areObjectsEqual:j,areRegExpsEqual:$,areSetsEqual:re,createIsNestedEqual:r}),B=x(Y);function oe(z,ie){return B(z,ie,void 0)}var ee=x(i(Y,{createIsNestedEqual:function(){return l}}));function ne(z,ie){return ee(z,ie,void 0)}var G=x(Z);function F(z,ie){return G(z,ie,new WeakMap)}var q=x(i(Z,{createIsNestedEqual:function(){return l}}));function ce(z,ie){return q(z,ie,new WeakMap)}function L(z){return x(i(Y,z(Y)))}function K(z){var ie=x(i(Z,z(Z)));return function(le,ae,H){return H===void 0&&(H=new WeakMap),ie(le,ae,H)}}n.circularDeepEqual=F,n.circularShallowEqual=ce,n.createCustomCircularEqual=K,n.createCustomEqual=L,n.deepEqual=oe,n.sameValueZeroEqual=l,n.shallowEqual=ne,Object.defineProperty(n,"__esModule",{value:!0})})})(pp,pp.exports);var mp=pp.exports;function E_(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=E_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Eu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=E_(e))&&(r&&(r+=" "),r+=t);return r}const gp=Sc(Object.freeze(Object.defineProperty({__proto__:null,clsx:Eu,default:Eu},Symbol.toStringTag,{value:"Module"})));var Be={},w8=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(Be,"__esModule",{value:!0}),Be.bottom=wp,Be.childrenEqual=b8,Be.cloneLayout=R_,Be.cloneLayoutItem=ai,Be.collides=Pu,Be.compact=T_,Be.compactItem=M_,Be.compactType=M8,Be.correctBounds=k_,Be.fastPositionEqual=x8,Be.fastRGLPropsEqual=void 0,Be.getAllCollisions=D_,Be.getFirstCollision=si,Be.getLayoutItem=yp,Be.getStatics=bp,Be.modifyLayout=N_,Be.moveElement=ul,Be.moveElementAwayFromCollision=xp,Be.noop=void 0,Be.perc=S8,Be.resizeItemInDirection=E8,Be.setTopLeft=R8,Be.setTransform=P8,Be.sortLayoutItems=Rp,Be.sortLayoutItemsByColRow=$_,Be.sortLayoutItemsByRowCol=j_,Be.synchronizeLayoutWithChildren=N8,Be.validateLayout=T8,Be.withLayoutItem=y8;var P_=mp,cl=v8(E);function v8(e){return e&&e.__esModule?e:{default:e}}function wp(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function R_(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=ai(e[n]);return t}function N_(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function y8(e,t,n){let r=yp(e,t);return r?(r=n(ai(r)),e=N_(e,r),[e,r]):[e,null]}function ai(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function b8(e,t){return(0,P_.deepEqual)(cl.default.Children.map(e,n=>n==null?void 0:n.key),cl.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,P_.deepEqual)(cl.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),cl.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}Be.fastRGLPropsEqual=w8;function x8(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Pu(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function T_(e,t,n,r){const o=bp(e),i=Rp(e,t),a=Array(e.length);for(let s=0,l=i.length;s<l;s++){let c=ai(i[s]);c.static||(c=M_(o,c,t,n,i,r),o.push(c)),a[e.indexOf(i[s])]=c,c.moved=!1}return a}const _8={x:"w",y:"h"};function vp(e,t,n,r){const o=_8[r];t[r]+=1;const i=e.map(a=>a.i).indexOf(t.i);for(let a=i+1;a<e.length;a++){const s=e[a];if(!s.static){if(s.y>t.y+t.h)break;Pu(t,s)&&vp(e,s,n+t[o],r)}}t[r]=n}function M_(e,t,n,r,o,i){const a=n==="vertical",s=n==="horizontal";if(a)for(t.y=Math.min(wp(e),t.y);t.y>0&&!si(e,t);)t.y--;else if(s)for(;t.x>0&&!si(e,t);)t.x--;let l;for(;(l=si(e,t))&&!(n===null&&i);)if(s?vp(o,t,l.x+l.w,"x"):vp(o,t,l.y+l.h,"y"),s&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!si(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function k_(e,t){const n=bp(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;si(n,i);)i.y++}return e}function yp(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function si(e,t){for(let n=0,r=e.length;n<r;n++)if(Pu(e[n],t))return e[n]}function D_(e,t){return e.filter(n=>Pu(n,t))}function bp(e){return e.filter(t=>t.static)}function ul(e,t,n,r,o,i,a,s,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=Rp(e,a);(a==="vertical"&&typeof r=="number"?u>=r:a==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const h=D_(d,t),p=h.length>0;if(p&&l)return R_(e);if(p&&i)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let m=0,v=h.length;m<v;m++){const w=h[m];`${t.i}${t.x}${t.y}${w.i}${w.x}${w.y}`,!w.moved&&(w.static?e=xp(e,w,t,o,a):e=xp(e,t,w,o,a))}return e}function xp(e,t,n,r,o,i){const a=o==="horizontal",s=o==="vertical",l=t.static;if(r){r=!1;const d={x:a?Math.max(t.x-n.w,0):n.x,y:s?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},f=si(e,d),h=f&&f.y+f.h>t.y,p=f&&t.x+t.w>f.x;if(f){if(h&&s)return ul(e,n,void 0,t.y+1,r,l,o);if(h&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(p&&a)return ul(e,t,n.x,void 0,r,l,o)}else return`${n.i}${d.x}${d.y}`,ul(e,n,a?d.x:void 0,s?d.y:void 0,r,l,o)}const c=a?n.x+1:void 0,u=s?n.y+1:void 0;return c==null&&u==null?e:ul(e,n,a?n.x+1:void 0,s?n.y+1:void 0,r,l,o)}function S8(e){return e*100+"%"}const A_=(e,t,n,r)=>e+n>r?t:n,I_=(e,t,n)=>e<0?t:n,O_=e=>Math.max(0,e),_p=e=>Math.max(0,e),Sp=(e,t,n)=>{let{left:r,height:o,width:i}=t;const a=e.top-(o-e.height);return{left:r,width:i,height:I_(a,e.height,o),top:_p(a)}},Cp=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{top:r,height:i,width:A_(e.left,e.width,a,n),left:O_(o)}},Ep=(e,t,n)=>{let{top:r,height:o,width:i}=t;const a=e.left-(i-e.width);return{height:o,width:a<0?e.width:A_(e.left,e.width,i,n),top:_p(r),left:O_(a)}},Pp=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{width:a,left:o,height:I_(r,e.height,i),top:_p(r)}},C8={n:Sp,ne:function(){return Sp(arguments.length<=0?void 0:arguments[0],Cp(...arguments))},e:Cp,se:function(){return Pp(arguments.length<=0?void 0:arguments[0],Cp(...arguments))},s:Pp,sw:function(){return Pp(arguments.length<=0?void 0:arguments[0],Ep(...arguments))},w:Ep,nw:function(){return Sp(arguments.length<=0?void 0:arguments[0],Ep(...arguments))}};function E8(e,t,n,r){const o=C8[e];return o?o(t,{...t,...n},r):n}function P8(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function R8(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function Rp(e,t){return t==="horizontal"?$_(e):t==="vertical"?j_(e):e}function j_(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function $_(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function N8(e,t,n,r,o){e=e||[];const i=[];cl.default.Children.forEach(t,s=>{if((s==null?void 0:s.key)==null)return;const l=yp(e,String(s.key)),c=s.props["data-grid"];l&&c==null?i.push(ai(l)):c?i.push(ai({...c,i:s.key})):i.push(ai({w:1,h:1,x:0,y:wp(i),i:String(s.key)}))});const a=k_(i,{cols:n});return o?a:T_(a,r,n)}function T8(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let a=0;a<n.length;a++){const s=n[a],l=i[s];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${s} must be a number! Received: ${l} (${typeof l})`)}if(typeof i.i<"u"&&typeof i.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${i.i} (${typeof i.i})`)}}function M8(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function Xre(){}const k8=()=>{};Be.noop=k8;var Sr={};Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.calcGridColWidth=Ru,Sr.calcGridItemPosition=D8,Sr.calcGridItemWHPx=Np,Sr.calcWH=I8,Sr.calcXY=A8,Sr.clamp=li;function Ru(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Np(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function D8(e,t,n,r,o,i){const{margin:a,containerPadding:s,rowHeight:l}=e,c=Ru(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=Np(r,c,a[0]),u.height=Np(o,l,a[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+a[1])*n+s[1]),u.left=Math.round((c+a[0])*t+s[0])),u}function A8(e,t,n,r,o){const{margin:i,containerPadding:a,cols:s,rowHeight:l,maxRows:c}=e,u=Ru(e);let d=Math.round((n-a[0])/(u+i[0])),f=Math.round((t-a[1])/(l+i[1]));return d=li(d,0,s-r),f=li(f,0,c-o),{x:d,y:f}}function I8(e,t,n,r,o,i){const{margin:a,maxRows:s,cols:l,rowHeight:c}=e,u=Ru(e);let d=Math.round((t+a[0])/(u+a[0])),f=Math.round((n+a[1])/(c+a[1])),h=li(d,0,l-r),p=li(f,0,s-o);return["sw","w","nw"].indexOf(i)!==-1&&(h=li(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(p=li(f,0,s)),{w:h,h:p}}function li(e,t,n){return Math.max(Math.min(e,n),t)}var Nu={},F_={exports:{}},O8="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",j8=O8,$8=j8;function L_(){}function z_(){}z_.resetWarningCache=L_;var F8=function(){function e(r,o,i,a,s,l){if(l!==$8){var c=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 c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:z_,resetWarningCache:L_};return n.PropTypes=n,n};F_.exports=F8();var Co=F_.exports,Tu={exports:{}},B_={};function H_(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=H_(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function V_(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=H_(e))&&(r&&(r+=" "),r+=t);return r}const L8=Sc(Object.freeze(Object.defineProperty({__proto__:null,clsx:V_,default:V_},Symbol.toStringTag,{value:"Module"})));var bt={},Cr={};Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.dontSetMe=U8,Cr.findInArray=z8,Cr.int=V8,Cr.isFunction=B8,Cr.isNum=H8;function z8(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function B8(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function H8(e){return typeof e=="number"&&!isNaN(e)}function V8(e){return parseInt(e,10)}function U8(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var ci={};Object.defineProperty(ci,"__esModule",{value:!0}),ci.browserPrefixToKey=W_,ci.browserPrefixToStyle=W8,ci.default=void 0,ci.getPrefix=U_;const Tp=["Moz","Webkit","O","ms"];function U_(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<Tp.length;r++)if(W_(t,Tp[r])in n)return Tp[r];return""}function W_(e,t){return t?"".concat(t).concat(G8(e)):e}function W8(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function G8(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}ci.default=U_(),Object.defineProperty(bt,"__esModule",{value:!0}),bt.addClassName=K_,bt.addEvent=K8,bt.addUserSelectStyles=a3,bt.createCSSTransform=n3,bt.createSVGTransform=r3,bt.getTouch=o3,bt.getTouchIdentifier=i3,bt.getTranslation=Mp,bt.innerHeight=Q8,bt.innerWidth=e3,bt.matchesSelector=Y_,bt.matchesSelectorAndParentsTo=Y8,bt.offsetXYFromParent=t3,bt.outerHeight=Z8,bt.outerWidth=J8,bt.removeClassName=X_,bt.removeEvent=X8,bt.removeUserSelectStyles=s3;var Pn=Cr,G_=q8(ci);function q_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(q_=function(r){return r?n:t})(e)}function q8(e,t){if(e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=q_(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let Mu="";function Y_(e,t){return Mu||(Mu=(0,Pn.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Pn.isFunction)(e[n])})),(0,Pn.isFunction)(e[Mu])?e[Mu](t):!1}function Y8(e,t,n){let r=e;do{if(Y_(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function K8(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function X8(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function Z8(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Pn.int)(n.borderTopWidth),t+=(0,Pn.int)(n.borderBottomWidth),t}function J8(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Pn.int)(n.borderLeftWidth),t+=(0,Pn.int)(n.borderRightWidth),t}function Q8(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Pn.int)(n.paddingTop),t-=(0,Pn.int)(n.paddingBottom),t}function e3(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Pn.int)(n.paddingLeft),t-=(0,Pn.int)(n.paddingRight),t}function t3(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,a=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:a}}function n3(e,t){const n=Mp(e,t,"px");return{[(0,G_.browserPrefixToKey)("transform",G_.default)]:n}}function r3(e,t){return Mp(e,t,"")}function Mp(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const a="".concat(typeof t.x=="string"?t.x:t.x+n),s="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(a,", ").concat(s,")")+i}return i}function o3(e,t){return e.targetTouches&&(0,Pn.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Pn.findInArray)(e.changedTouches,n=>t===n.identifier)}function i3(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function a3(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
148
|
+
`,g8=({isVisible:e})=>e?g.jsx(p8,{children:g.jsx(m8,{})}):null;var C_={exports:{}},ll={},pp={exports:{}};(function(e,t){(function(n,r){r(t)})(_c,function(n){function r(z){return function(le,ae,H,ue,se,ye,Ce){return z(le,ae,Ce)}}function o(z){return function(le,ae,H,ue){if(!le||!ae||typeof le!="object"||typeof ae!="object")return z(le,ae,H,ue);var se=ue.get(le),ye=ue.get(ae);if(se&&ye)return se===ae&&ye===le;ue.set(le,ae),ue.set(ae,le);var Ce=z(le,ae,H,ue);return ue.delete(le),ue.delete(ae),Ce}}function i(z,ie){var le={};for(var ae in z)le[ae]=z[ae];for(var ae in ie)le[ae]=ie[ae];return le}function a(z){return z.constructor===Object||z.constructor==null}function s(z){return typeof z.then=="function"}function l(z,ie){return z===ie||z!==z&&ie!==ie}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",f="[object RegExp]",h="[object Map]",p="[object Number]",m="[object Object]",v="[object Set]",w="[object String]",b=Object.prototype.toString;function x(z){var ie=z.areArraysEqual,le=z.areDatesEqual,ae=z.areMapsEqual,H=z.areObjectsEqual,ue=z.areRegExpsEqual,se=z.areSetsEqual,ye=z.createIsNestedEqual,Ce=ye(xe);function xe(j,V,J){if(j===V)return!0;if(!j||!V||typeof j!="object"||typeof V!="object")return j!==j&&V!==V;if(a(j)&&a(V))return H(j,V,Ce,J);var we=Array.isArray(j),pe=Array.isArray(V);if(we||pe)return we===pe&&ie(j,V,Ce,J);var fe=b.call(j);return fe!==b.call(V)?!1:fe===d?le(j,V,Ce,J):fe===f?ue(j,V,Ce,J):fe===h?ae(j,V,Ce,J):fe===v?se(j,V,Ce,J):fe===m||fe===c?s(j)||s(V)?!1:H(j,V,Ce,J):fe===u||fe===p||fe===w?l(j.valueOf(),V.valueOf()):!1}return xe}function _(z,ie,le,ae){var H=z.length;if(ie.length!==H)return!1;for(;H-- >0;)if(!le(z[H],ie[H],H,H,z,ie,ae))return!1;return!0}var C=o(_);function N(z,ie){return l(z.valueOf(),ie.valueOf())}function R(z,ie,le,ae){var H=z.size===ie.size;if(!H)return!1;if(!z.size)return!0;var ue={},se=0;return z.forEach(function(ye,Ce){if(H){var xe=!1,j=0;ie.forEach(function(V,J){!xe&&!ue[j]&&(xe=le(Ce,J,se,j,z,ie,ae)&&le(ye,V,Ce,J,z,ie,ae))&&(ue[j]=!0),j++}),se++,H=xe}}),H}var T=o(R),M="_owner",D=Object.prototype.hasOwnProperty;function A(z,ie,le,ae){var H=Object.keys(z),ue=H.length;if(Object.keys(ie).length!==ue)return!1;for(var se;ue-- >0;){if(se=H[ue],se===M){var ye=!!z.$$typeof,Ce=!!ie.$$typeof;if((ye||Ce)&&ye!==Ce)return!1}if(!D.call(ie,se)||!le(z[se],ie[se],se,se,z,ie,ae))return!1}return!0}var O=o(A);function $(z,ie){return z.source===ie.source&&z.flags===ie.flags}function W(z,ie,le,ae){var H=z.size===ie.size;if(!H)return!1;if(!z.size)return!0;var ue={};return z.forEach(function(se,ye){if(H){var Ce=!1,xe=0;ie.forEach(function(j,V){!Ce&&!ue[xe]&&(Ce=le(se,j,ye,V,z,ie,ae))&&(ue[xe]=!0),xe++}),H=Ce}}),H}var re=o(W),Y=Object.freeze({areArraysEqual:_,areDatesEqual:N,areMapsEqual:R,areObjectsEqual:A,areRegExpsEqual:$,areSetsEqual:W,createIsNestedEqual:r}),Z=Object.freeze({areArraysEqual:C,areDatesEqual:N,areMapsEqual:T,areObjectsEqual:O,areRegExpsEqual:$,areSetsEqual:re,createIsNestedEqual:r}),B=x(Y);function oe(z,ie){return B(z,ie,void 0)}var ee=x(i(Y,{createIsNestedEqual:function(){return l}}));function ne(z,ie){return ee(z,ie,void 0)}var G=x(Z);function F(z,ie){return G(z,ie,new WeakMap)}var q=x(i(Z,{createIsNestedEqual:function(){return l}}));function ce(z,ie){return q(z,ie,new WeakMap)}function L(z){return x(i(Y,z(Y)))}function K(z){var ie=x(i(Z,z(Z)));return function(le,ae,H){return H===void 0&&(H=new WeakMap),ie(le,ae,H)}}n.circularDeepEqual=F,n.circularShallowEqual=ce,n.createCustomCircularEqual=K,n.createCustomEqual=L,n.deepEqual=oe,n.sameValueZeroEqual=l,n.shallowEqual=ne,Object.defineProperty(n,"__esModule",{value:!0})})})(pp,pp.exports);var mp=pp.exports;function E_(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=E_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Eu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=E_(e))&&(r&&(r+=" "),r+=t);return r}const gp=Sc(Object.freeze(Object.defineProperty({__proto__:null,clsx:Eu,default:Eu},Symbol.toStringTag,{value:"Module"})));var Be={},w8=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(Be,"__esModule",{value:!0}),Be.bottom=wp,Be.childrenEqual=b8,Be.cloneLayout=R_,Be.cloneLayoutItem=ai,Be.collides=Pu,Be.compact=T_,Be.compactItem=M_,Be.compactType=M8,Be.correctBounds=k_,Be.fastPositionEqual=x8,Be.fastRGLPropsEqual=void 0,Be.getAllCollisions=D_,Be.getFirstCollision=si,Be.getLayoutItem=yp,Be.getStatics=bp,Be.modifyLayout=N_,Be.moveElement=ul,Be.moveElementAwayFromCollision=xp,Be.noop=void 0,Be.perc=S8,Be.resizeItemInDirection=E8,Be.setTopLeft=R8,Be.setTransform=P8,Be.sortLayoutItems=Rp,Be.sortLayoutItemsByColRow=$_,Be.sortLayoutItemsByRowCol=j_,Be.synchronizeLayoutWithChildren=N8,Be.validateLayout=T8,Be.withLayoutItem=y8;var P_=mp,cl=v8(E);function v8(e){return e&&e.__esModule?e:{default:e}}function wp(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function R_(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=ai(e[n]);return t}function N_(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function y8(e,t,n){let r=yp(e,t);return r?(r=n(ai(r)),e=N_(e,r),[e,r]):[e,null]}function ai(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function b8(e,t){return(0,P_.deepEqual)(cl.default.Children.map(e,n=>n==null?void 0:n.key),cl.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,P_.deepEqual)(cl.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),cl.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}Be.fastRGLPropsEqual=w8;function x8(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Pu(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function T_(e,t,n,r){const o=bp(e),i=Rp(e,t),a=Array(e.length);for(let s=0,l=i.length;s<l;s++){let c=ai(i[s]);c.static||(c=M_(o,c,t,n,i,r),o.push(c)),a[e.indexOf(i[s])]=c,c.moved=!1}return a}const _8={x:"w",y:"h"};function vp(e,t,n,r){const o=_8[r];t[r]+=1;const i=e.map(a=>a.i).indexOf(t.i);for(let a=i+1;a<e.length;a++){const s=e[a];if(!s.static){if(s.y>t.y+t.h)break;Pu(t,s)&&vp(e,s,n+t[o],r)}}t[r]=n}function M_(e,t,n,r,o,i){const a=n==="vertical",s=n==="horizontal";if(a)for(t.y=Math.min(wp(e),t.y);t.y>0&&!si(e,t);)t.y--;else if(s)for(;t.x>0&&!si(e,t);)t.x--;let l;for(;(l=si(e,t))&&!(n===null&&i);)if(s?vp(o,t,l.x+l.w,"x"):vp(o,t,l.y+l.h,"y"),s&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!si(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function k_(e,t){const n=bp(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;si(n,i);)i.y++}return e}function yp(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function si(e,t){for(let n=0,r=e.length;n<r;n++)if(Pu(e[n],t))return e[n]}function D_(e,t){return e.filter(n=>Pu(n,t))}function bp(e){return e.filter(t=>t.static)}function ul(e,t,n,r,o,i,a,s,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=Rp(e,a);(a==="vertical"&&typeof r=="number"?u>=r:a==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const h=D_(d,t),p=h.length>0;if(p&&l)return R_(e);if(p&&i)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let m=0,v=h.length;m<v;m++){const w=h[m];`${t.i}${t.x}${t.y}${w.i}${w.x}${w.y}`,!w.moved&&(w.static?e=xp(e,w,t,o,a):e=xp(e,t,w,o,a))}return e}function xp(e,t,n,r,o,i){const a=o==="horizontal",s=o==="vertical",l=t.static;if(r){r=!1;const d={x:a?Math.max(t.x-n.w,0):n.x,y:s?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},f=si(e,d),h=f&&f.y+f.h>t.y,p=f&&t.x+t.w>f.x;if(f){if(h&&s)return ul(e,n,void 0,t.y+1,r,l,o);if(h&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(p&&a)return ul(e,t,n.x,void 0,r,l,o)}else return`${n.i}${d.x}${d.y}`,ul(e,n,a?d.x:void 0,s?d.y:void 0,r,l,o)}const c=a?n.x+1:void 0,u=s?n.y+1:void 0;return c==null&&u==null?e:ul(e,n,a?n.x+1:void 0,s?n.y+1:void 0,r,l,o)}function S8(e){return e*100+"%"}const A_=(e,t,n,r)=>e+n>r?t:n,I_=(e,t,n)=>e<0?t:n,O_=e=>Math.max(0,e),_p=e=>Math.max(0,e),Sp=(e,t,n)=>{let{left:r,height:o,width:i}=t;const a=e.top-(o-e.height);return{left:r,width:i,height:I_(a,e.height,o),top:_p(a)}},Cp=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{top:r,height:i,width:A_(e.left,e.width,a,n),left:O_(o)}},Ep=(e,t,n)=>{let{top:r,height:o,width:i}=t;const a=e.left-(i-e.width);return{height:o,width:a<0?e.width:A_(e.left,e.width,i,n),top:_p(r),left:O_(a)}},Pp=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{width:a,left:o,height:I_(r,e.height,i),top:_p(r)}},C8={n:Sp,ne:function(){return Sp(arguments.length<=0?void 0:arguments[0],Cp(...arguments))},e:Cp,se:function(){return Pp(arguments.length<=0?void 0:arguments[0],Cp(...arguments))},s:Pp,sw:function(){return Pp(arguments.length<=0?void 0:arguments[0],Ep(...arguments))},w:Ep,nw:function(){return Sp(arguments.length<=0?void 0:arguments[0],Ep(...arguments))}};function E8(e,t,n,r){const o=C8[e];return o?o(t,{...t,...n},r):n}function P8(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function R8(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function Rp(e,t){return t==="horizontal"?$_(e):t==="vertical"?j_(e):e}function j_(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function $_(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function N8(e,t,n,r,o){e=e||[];const i=[];cl.default.Children.forEach(t,s=>{if((s==null?void 0:s.key)==null)return;const l=yp(e,String(s.key)),c=s.props["data-grid"];l&&c==null?i.push(ai(l)):c?i.push(ai({...c,i:s.key})):i.push(ai({w:1,h:1,x:0,y:wp(i),i:String(s.key)}))});const a=k_(i,{cols:n});return o?a:T_(a,r,n)}function T8(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let a=0;a<n.length;a++){const s=n[a],l=i[s];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${s} must be a number! Received: ${l} (${typeof l})`)}if(typeof i.i<"u"&&typeof i.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${i.i} (${typeof i.i})`)}}function M8(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function Xre(){}const k8=()=>{};Be.noop=k8;var Sr={};Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.calcGridColWidth=Ru,Sr.calcGridItemPosition=D8,Sr.calcGridItemWHPx=Np,Sr.calcWH=I8,Sr.calcXY=A8,Sr.clamp=li;function Ru(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Np(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function D8(e,t,n,r,o,i){const{margin:a,containerPadding:s,rowHeight:l}=e,c=Ru(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=Np(r,c,a[0]),u.height=Np(o,l,a[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+a[1])*n+s[1]),u.left=Math.round((c+a[0])*t+s[0])),u}function A8(e,t,n,r,o){const{margin:i,containerPadding:a,cols:s,rowHeight:l,maxRows:c}=e,u=Ru(e);let d=Math.round((n-a[0])/(u+i[0])),f=Math.round((t-a[1])/(l+i[1]));return d=li(d,0,s-r),f=li(f,0,c-o),{x:d,y:f}}function I8(e,t,n,r,o,i){const{margin:a,maxRows:s,cols:l,rowHeight:c}=e,u=Ru(e);let d=Math.round((t+a[0])/(u+a[0])),f=Math.round((n+a[1])/(c+a[1])),h=li(d,0,l-r),p=li(f,0,s-o);return["sw","w","nw"].indexOf(i)!==-1&&(h=li(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(p=li(f,0,s)),{w:h,h:p}}function li(e,t,n){return Math.max(Math.min(e,n),t)}var Nu={},F_={exports:{}},O8="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",j8=O8,$8=j8;function L_(){}function z_(){}z_.resetWarningCache=L_;var F8=function(){function e(r,o,i,a,s,l){if(l!==$8){var c=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 c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:z_,resetWarningCache:L_};return n.PropTypes=n,n};F_.exports=F8();var Co=F_.exports,Tu={exports:{}},B_={};function H_(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=H_(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function V_(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=H_(e))&&(r&&(r+=" "),r+=t);return r}const L8=Sc(Object.freeze(Object.defineProperty({__proto__:null,clsx:V_,default:V_},Symbol.toStringTag,{value:"Module"})));var bt={},Cr={};Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.dontSetMe=U8,Cr.findInArray=z8,Cr.int=V8,Cr.isFunction=B8,Cr.isNum=H8;function z8(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function B8(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function H8(e){return typeof e=="number"&&!isNaN(e)}function V8(e){return parseInt(e,10)}function U8(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var ci={};Object.defineProperty(ci,"__esModule",{value:!0}),ci.browserPrefixToKey=W_,ci.browserPrefixToStyle=W8,ci.default=void 0,ci.getPrefix=U_;const Tp=["Moz","Webkit","O","ms"];function U_(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<Tp.length;r++)if(W_(t,Tp[r])in n)return Tp[r];return""}function W_(e,t){return t?"".concat(t).concat(G8(e)):e}function W8(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function G8(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}ci.default=U_(),Object.defineProperty(bt,"__esModule",{value:!0}),bt.addClassName=K_,bt.addEvent=K8,bt.addUserSelectStyles=a3,bt.createCSSTransform=n3,bt.createSVGTransform=r3,bt.getTouch=o3,bt.getTouchIdentifier=i3,bt.getTranslation=Mp,bt.innerHeight=Q8,bt.innerWidth=e3,bt.matchesSelector=Y_,bt.matchesSelectorAndParentsTo=Y8,bt.offsetXYFromParent=t3,bt.outerHeight=Z8,bt.outerWidth=J8,bt.removeClassName=X_,bt.removeEvent=X8,bt.removeUserSelectStyles=s3;var Pn=Cr,G_=q8(ci);function q_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(q_=function(r){return r?n:t})(e)}function q8(e,t){if(e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=q_(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let Mu="";function Y_(e,t){return Mu||(Mu=(0,Pn.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Pn.isFunction)(e[n])})),(0,Pn.isFunction)(e[Mu])?e[Mu](t):!1}function Y8(e,t,n){let r=e;do{if(Y_(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function K8(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function X8(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function Z8(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Pn.int)(n.borderTopWidth),t+=(0,Pn.int)(n.borderBottomWidth),t}function J8(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Pn.int)(n.borderLeftWidth),t+=(0,Pn.int)(n.borderRightWidth),t}function Q8(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Pn.int)(n.paddingTop),t-=(0,Pn.int)(n.paddingBottom),t}function e3(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Pn.int)(n.paddingLeft),t-=(0,Pn.int)(n.paddingRight),t}function t3(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,a=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:a}}function n3(e,t){const n=Mp(e,t,"px");return{[(0,G_.browserPrefixToKey)("transform",G_.default)]:n}}function r3(e,t){return Mp(e,t,"")}function Mp(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const a="".concat(typeof t.x=="string"?t.x:t.x+n),s="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(a,", ").concat(s,")")+i}return i}function o3(e,t){return e.targetTouches&&(0,Pn.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Pn.findInArray)(e.changedTouches,n=>t===n.identifier)}function i3(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function a3(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
149
149
|
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
150
|
-
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&K_(e.body,"react-draggable-transparent-selection")}function s3(e){if(e)try{if(e.body&&X_(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function K_(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function X_(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Er={};Object.defineProperty(Er,"__esModule",{value:!0}),Er.canDragX=u3,Er.canDragY=d3,Er.createCoreData=h3,Er.createDraggableData=p3,Er.getBoundPosition=l3,Er.getControlPosition=f3,Er.snapToGrid=c3;var Rn=Cr,ha=bt;function l3(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:m3(r);const o=kp(e);if(typeof r=="string"){const{ownerDocument:i}=o,a=i.defaultView;let s;if(r==="parent"?s=o.parentNode:s=i.querySelector(r),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=s,c=a.getComputedStyle(o),u=a.getComputedStyle(l);r={left:-o.offsetLeft+(0,Rn.int)(u.paddingLeft)+(0,Rn.int)(c.marginLeft),top:-o.offsetTop+(0,Rn.int)(u.paddingTop)+(0,Rn.int)(c.marginTop),right:(0,ha.innerWidth)(l)-(0,ha.outerWidth)(o)-o.offsetLeft+(0,Rn.int)(u.paddingRight)-(0,Rn.int)(c.marginRight),bottom:(0,ha.innerHeight)(l)-(0,ha.outerHeight)(o)-o.offsetTop+(0,Rn.int)(u.paddingBottom)-(0,Rn.int)(c.marginBottom)}}return(0,Rn.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Rn.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Rn.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Rn.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function c3(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function u3(e){return e.props.axis==="both"||e.props.axis==="x"}function d3(e){return e.props.axis==="both"||e.props.axis==="y"}function f3(e,t,n){const r=typeof t=="number"?(0,ha.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=kp(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,ha.offsetXYFromParent)(r||e,i,n.props.scale)}function h3(e,t,n){const r=!(0,Rn.isNum)(e.lastX),o=kp(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function p3(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function m3(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function kp(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var ku={},Du={};Object.defineProperty(Du,"__esModule",{value:!0}),Du.default=g3;function g3(){}Object.defineProperty(ku,"__esModule",{value:!0}),ku.default=void 0;var Dp=v3(E),fn=Ip(Co),w3=Ip(ur),Vt=bt,Eo=Er,Ap=Cr,dl=Ip(Du);function Ip(e){return e&&e.__esModule?e:{default:e}}function Z_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Z_=function(r){return r?n:t})(e)}function v3(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Z_(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function nn(e,t,n){return t=y3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y3(e){var t=b3(e,"string");return typeof t=="symbol"?t:String(t)}function b3(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Kn={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Po=Kn.mouse,Au=class extends Dp.Component{constructor(){super(...arguments),nn(this,"dragging",!1),nn(this,"lastX",NaN),nn(this,"lastY",NaN),nn(this,"touchIdentifier",null),nn(this,"mounted",!1),nn(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Vt.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Vt.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,Vt.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,Eo.getControlPosition)(t,o,this);if(i==null)return;const{x:a,y:s}=i,l=(0,Eo.createCoreData)(this,a,s);(0,dl.default)("DraggableCore: handleDragStart: %j",l),(0,dl.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Vt.addUserSelectStyles)(r),this.dragging=!0,this.lastX=a,this.lastY=s,(0,Vt.addEvent)(r,Po.move,this.handleDrag),(0,Vt.addEvent)(r,Po.stop,this.handleDragStop))}),nn(this,"handleDrag",t=>{const n=(0,Eo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let s=r-this.lastX,l=o-this.lastY;if([s,l]=(0,Eo.snapToGrid)(this.props.grid,s,l),!s&&!l)return;r=this.lastX+s,o=this.lastY+l}const i=(0,Eo.createCoreData)(this,r,o);if((0,dl.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),nn(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Eo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,Eo.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,Eo.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,Vt.removeUserSelectStyles)(s.ownerDocument),(0,dl.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,dl.default)("DraggableCore: Removing handlers"),(0,Vt.removeEvent)(s.ownerDocument,Po.move,this.handleDrag),(0,Vt.removeEvent)(s.ownerDocument,Po.stop,this.handleDragStop))}),nn(this,"onMouseDown",t=>(Po=Kn.mouse,this.handleDragStart(t))),nn(this,"onMouseUp",t=>(Po=Kn.mouse,this.handleDragStop(t))),nn(this,"onTouchStart",t=>(Po=Kn.touch,this.handleDragStart(t))),nn(this,"onTouchEnd",t=>(Po=Kn.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Vt.addEvent)(t,Kn.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Vt.removeEvent)(n,Kn.mouse.move,this.handleDrag),(0,Vt.removeEvent)(n,Kn.touch.move,this.handleDrag),(0,Vt.removeEvent)(n,Kn.mouse.stop,this.handleDragStop),(0,Vt.removeEvent)(n,Kn.touch.stop,this.handleDragStop),(0,Vt.removeEvent)(t,Kn.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Vt.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:w3.default.findDOMNode(this)}render(){return Dp.cloneElement(Dp.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};ku.default=Au,nn(Au,"displayName","DraggableCore"),nn(Au,"propTypes",{allowAnyClick:fn.default.bool,children:fn.default.node.isRequired,disabled:fn.default.bool,enableUserSelectHack:fn.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:fn.default.arrayOf(fn.default.number),handle:fn.default.string,cancel:fn.default.string,nodeRef:fn.default.object,onStart:fn.default.func,onDrag:fn.default.func,onStop:fn.default.func,onMouseDown:fn.default.func,scale:fn.default.number,className:Ap.dontSetMe,style:Ap.dontSetMe,transform:Ap.dontSetMe}),nn(Au,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(E),n=u(Co),r=u(ur),o=u(L8),i=bt,a=Er,s=Cr,l=u(ku),c=u(Du);function u(b){return b&&b.__esModule?b:{default:b}}function d(b){if(typeof WeakMap!="function")return null;var x=new WeakMap,_=new WeakMap;return(d=function(C){return C?_:x})(b)}function f(b,x){if(b&&b.__esModule)return b;if(b===null||typeof b!="object"&&typeof b!="function")return{default:b};var _=d(x);if(_&&_.has(b))return _.get(b);var C={},N=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in b)if(R!=="default"&&Object.prototype.hasOwnProperty.call(b,R)){var T=N?Object.getOwnPropertyDescriptor(b,R):null;T&&(T.get||T.set)?Object.defineProperty(C,R,T):C[R]=b[R]}return C.default=b,_&&_.set(b,C),C}function h(){return h=Object.assign?Object.assign.bind():function(b){for(var x=1;x<arguments.length;x++){var _=arguments[x];for(var C in _)Object.prototype.hasOwnProperty.call(_,C)&&(b[C]=_[C])}return b},h.apply(this,arguments)}function p(b,x,_){return x=m(x),x in b?Object.defineProperty(b,x,{value:_,enumerable:!0,configurable:!0,writable:!0}):b[x]=_,b}function m(b){var x=v(b,"string");return typeof x=="symbol"?x:String(x)}function v(b,x){if(typeof b!="object"||b===null)return b;var _=b[Symbol.toPrimitive];if(_!==void 0){var C=_.call(b,x||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(b)}class w extends t.Component{static getDerivedStateFromProps(x,_){let{position:C}=x,{prevPropsPosition:N}=_;return C&&(!N||C.x!==N.x||C.y!==N.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:C,prevPropsPosition:N}),{x:C.x,y:C.y,prevPropsPosition:{...C}}):null}constructor(x){super(x),p(this,"onDragStart",(_,C)=>{if((0,c.default)("Draggable: onDragStart: %j",C),this.props.onStart(_,(0,a.createDraggableData)(this,C))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(_,C)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",C);const N=(0,a.createDraggableData)(this,C),R={x:N.x,y:N.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:D}=R;R.x+=this.state.slackX,R.y+=this.state.slackY;const[A,j]=(0,a.getBoundPosition)(this,R.x,R.y);R.x=A,R.y=j,R.slackX=this.state.slackX+(M-R.x),R.slackY=this.state.slackY+(D-R.y),N.x=R.x,N.y=R.y,N.deltaX=R.x-this.state.x,N.deltaY=R.y-this.state.y}if(this.props.onDrag(_,N)===!1)return!1;this.setState(R)}),p(this,"onDragStop",(_,C)=>{if(!this.state.dragging||this.props.onStop(_,(0,a.createDraggableData)(this,C))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",C);const R={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:D}=this.props.position;R.x=M,R.y=D}this.setState(R)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},x.position&&!(x.onDrag||x.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var x,_;return(x=(_=this.props)===null||_===void 0||(_=_.nodeRef)===null||_===void 0?void 0:_.current)!==null&&x!==void 0?x:r.default.findDOMNode(this)}render(){const{axis:x,bounds:_,children:C,defaultPosition:N,defaultClassName:R,defaultClassNameDragging:T,defaultClassNameDragged:M,position:D,positionOffset:A,scale:j,...$}=this.props;let W={},re=null;const Z=!!!D||this.state.dragging,B=D||N,oe={x:(0,a.canDragX)(this)&&Z?this.state.x:B.x,y:(0,a.canDragY)(this)&&Z?this.state.y:B.y};this.state.isElementSVG?re=(0,i.createSVGTransform)(oe,A):W=(0,i.createCSSTransform)(oe,A);const ee=(0,o.default)(C.props.className||"",R,{[T]:this.state.dragging,[M]:this.state.dragged});return t.createElement(l.default,h({},$,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(C),{className:ee,style:{...C.props.style,...W},transform:re}))}}e.default=w,p(w,"displayName","Draggable"),p(w,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),p(w,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(B_);const{default:J_,DraggableCore:x3}=B_;Tu.exports=J_,Tu.exports.default=J_,Tu.exports.DraggableCore=x3;var Q_=Tu.exports,Iu={exports:{}},fl={},Op={};Op.__esModule=!0,Op.cloneElement=R3;var _3=S3(E);function S3(e){return e&&e.__esModule?e:{default:e}}function eS(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 tS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eS(Object(n),!0).forEach(function(r){C3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C3(e,t,n){return t=E3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E3(e){var t=P3(e,"string");return typeof t=="symbol"?t:String(t)}function P3(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function R3(e,t){return t.style&&e.props.style&&(t.style=tS(tS({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),_3.default.cloneElement(e,t)}var hl={};hl.__esModule=!0,hl.resizableProps=void 0;var Fe=N3(Co);function N3(e){return e&&e.__esModule?e:{default:e}}var T3={axis:Fe.default.oneOf(["both","x","y","none"]),className:Fe.default.string,children:Fe.default.element.isRequired,draggableOpts:Fe.default.shape({allowAnyClick:Fe.default.bool,cancel:Fe.default.string,children:Fe.default.node,disabled:Fe.default.bool,enableUserSelectHack:Fe.default.bool,offsetParent:Fe.default.node,grid:Fe.default.arrayOf(Fe.default.number),handle:Fe.default.string,nodeRef:Fe.default.object,onStart:Fe.default.func,onDrag:Fe.default.func,onStop:Fe.default.func,onMouseDown:Fe.default.func,scale:Fe.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=Fe.default.number).isRequired.apply(i,n)}return Fe.default.number.apply(Fe.default,n)},handle:Fe.default.oneOfType([Fe.default.node,Fe.default.func]),handleSize:Fe.default.arrayOf(Fe.default.number),lockAspectRatio:Fe.default.bool,maxConstraints:Fe.default.arrayOf(Fe.default.number),minConstraints:Fe.default.arrayOf(Fe.default.number),onResizeStop:Fe.default.func,onResizeStart:Fe.default.func,onResize:Fe.default.func,resizeHandles:Fe.default.arrayOf(Fe.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:Fe.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=Fe.default.number).isRequired.apply(i,n)}return Fe.default.number.apply(Fe.default,n)}};hl.resizableProps=T3,fl.__esModule=!0,fl.default=void 0;var pl=I3(E),M3=Q_,k3=Op,D3=hl,A3=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function nS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(nS=function(o){return o?n:t})(e)}function I3(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=nS(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function jp(){return jp=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},jp.apply(this,arguments)}function O3(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function rS(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 $p(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rS(Object(n),!0).forEach(function(r){j3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j3(e,t,n){return t=$3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $3(e){var t=F3(e,"string");return typeof t=="symbol"?t:String(t)}function F3(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function L3(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Fp(e,t)}function Fp(e,t){return Fp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Fp(e,t)}var Lp=function(e){L3(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var a=this.props,s=a.minConstraints,l=a.maxConstraints,c=a.lockAspectRatio;if(!s&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,f=i-this.props.height;Math.abs(d)>Math.abs(f*u)?i=o/u:o=i*u}var h=o,p=i,m=this.slack||[0,0],v=m[0],w=m[1];return o+=v,i+=w,s&&(o=Math.max(s[0],o),i=Math.max(s[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[v+(h-o),w+(p-i)],[o,i]},n.resizeHandler=function(o,i){var a=this;return function(s,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&a.resetData();var f=(a.props.axis==="both"||a.props.axis==="x")&&i!=="n"&&i!=="s",h=(a.props.axis==="both"||a.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!f&&!h)){var p=i[0],m=i[i.length-1],v=c.getBoundingClientRect();if(a.lastHandleRect!=null){if(m==="w"){var w=v.left-a.lastHandleRect.left;u+=w}if(p==="n"){var b=v.top-a.lastHandleRect.top;d+=b}}a.lastHandleRect=v,m==="w"&&(u=-u),p==="n"&&(d=-d);var x=a.props.width+(f?u/a.props.transformScale:0),_=a.props.height+(h?d/a.props.transformScale:0),C=a.runConstraints(x,_);x=C[0],_=C[1];var N=x!==a.props.width||_!==a.props.height,R=typeof a.props[o]=="function"?a.props[o]:null,T=o==="onResize"&&!N;R&&!T&&(s.persist==null||s.persist(),R(s,{node:c,size:{width:x,height:_},handle:i})),o==="onResizeStop"&&a.resetData()}}},n.renderResizeHandle=function(o,i){var a=this.props.handle;if(!a)return pl.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof a=="function")return a(o,i);var s=typeof a.type=="string",l=$p({ref:i},s?{}:{handleAxis:o});return pl.cloneElement(a,l)},n.render=function(){var o=this,i=this.props,a=i.children,s=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=O3(i,A3);return(0,k3.cloneElement)(a,$p($p({},u),{},{className:(s?s+" ":"")+"react-resizable",children:[].concat(a.props.children,c.map(function(d){var f,h=(f=o.handleRefs[d])!=null?f:o.handleRefs[d]=pl.createRef();return pl.createElement(M3.DraggableCore,jp({},l,{nodeRef:h,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,h))}))}))},t}(pl.Component);fl.default=Lp,Lp.propTypes=D3.resizableProps,Lp.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Ou={};Ou.__esModule=!0,Ou.default=void 0;var zp=U3(E),z3=oS(Co),B3=oS(fl),H3=hl,V3=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function oS(e){return e&&e.__esModule?e:{default:e}}function iS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(iS=function(o){return o?n:t})(e)}function U3(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=iS(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Bp(){return Bp=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},Bp.apply(this,arguments)}function aS(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 ju(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aS(Object(n),!0).forEach(function(r){W3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W3(e,t,n){return t=G3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G3(e){var t=q3(e,"string");return typeof t=="symbol"?t:String(t)}function q3(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Y3(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function K3(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Hp(e,t)}function Hp(e,t){return Hp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Hp(e,t)}var sS=function(e){K3(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(s,l){var c=l.size;r.props.onResize?(s.persist==null||s.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(s,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,a=o.handleSize;o.onResize;var s=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,d=o.maxConstraints,f=o.lockAspectRatio,h=o.axis;o.width,o.height;var p=o.resizeHandles,m=o.style,v=o.transformScale,w=Y3(o,V3);return zp.createElement(B3.default,{axis:h,draggableOpts:c,handle:i,handleSize:a,height:this.state.height,lockAspectRatio:f,maxConstraints:d,minConstraints:u,onResizeStart:s,onResize:this.onResize,onResizeStop:l,resizeHandles:p,transformScale:v,width:this.state.width},zp.createElement("div",Bp({},w,{style:ju(ju({},m),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(zp.Component);Ou.default=sS,sS.propTypes=ju(ju({},H3.resizableProps),{},{children:z3.default.element}),Iu.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Iu.exports.Resizable=fl.default,Iu.exports.ResizableBox=Ou.default;var X3=Iu.exports,Kr={};Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.resizeHandleType=Kr.resizeHandleAxesType=Kr.default=void 0;var Le=lS(Co),Z3=lS(E);function lS(e){return e&&e.__esModule?e:{default:e}}const J3=Kr.resizeHandleAxesType=Le.default.arrayOf(Le.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),Q3=Kr.resizeHandleType=Le.default.oneOfType([Le.default.node,Le.default.func]);Kr.default={className:Le.default.string,style:Le.default.object,width:Le.default.number,autoSize:Le.default.bool,cols:Le.default.number,draggableCancel:Le.default.string,draggableHandle:Le.default.string,verticalCompact:function(e){e.verticalCompact},compactType:Le.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Be.validateLayout(t,"layout")},margin:Le.default.arrayOf(Le.default.number),containerPadding:Le.default.arrayOf(Le.default.number),rowHeight:Le.default.number,maxRows:Le.default.number,isBounded:Le.default.bool,isDraggable:Le.default.bool,isResizable:Le.default.bool,allowOverlap:Le.default.bool,preventCollision:Le.default.bool,useCSSTransforms:Le.default.bool,transformScale:Le.default.number,isDroppable:Le.default.bool,resizeHandles:J3,resizeHandle:Q3,onLayoutChange:Le.default.func,onDragStart:Le.default.func,onDrag:Le.default.func,onDragStop:Le.default.func,onResizeStart:Le.default.func,onResize:Le.default.func,onResizeStop:Le.default.func,onDrop:Le.default.func,droppingItem:Le.default.shape({i:Le.default.string.isRequired,w:Le.default.number.isRequired,h:Le.default.number.isRequired}),children:function(e,t){const n=e[t],r={};Z3.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:Le.default.any},Object.defineProperty(Nu,"__esModule",{value:!0}),Nu.default=void 0;var pa=Vp(E),tt=Vp(Co),eH=Q_,tH=X3,ma=Be,zt=Sr,cS=Kr,nH=Vp(gp);function Vp(e){return e&&e.__esModule?e:{default:e}}function Pr(e,t,n){return t=rH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rH(e){var t=oH(e,"string");return typeof t=="symbol"?t:String(t)}function oH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Up extends pa.default.Component{constructor(){super(...arguments),Pr(this,"state",{resizing:null,dragging:null,className:""}),Pr(this,"elementRef",pa.default.createRef()),Pr(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const a={top:0,left:0},{offsetParent:s}=r;if(!s)return;const l=s.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,d=l.left/i,f=c.top/i,h=l.top/i;a.left=u-d+s.scrollLeft,a.top=f-h+s.scrollTop,this.setState({dragging:a});const{x:p,y:m}=(0,zt.calcXY)(this.getPositionParams(),a.top,a.left,this.props.w,this.props.h);return o.call(this,this.props.i,p,m,{e:t,node:r,newPosition:a})}),Pr(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let s=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:d,h:f,containerWidth:h}=this.props,p=this.getPositionParams();if(c){const{offsetParent:b}=r;if(b){const{margin:x,rowHeight:_,containerPadding:C}=this.props,N=b.clientHeight-(0,zt.calcGridItemWHPx)(f,_,x[1]);s=(0,zt.clamp)(s-C[1],0,N);const R=(0,zt.calcGridColWidth)(p),T=h-(0,zt.calcGridItemWHPx)(d,R,x[0]);l=(0,zt.clamp)(l-C[0],0,T)}}const m={top:s,left:l};this.setState({dragging:m});const{x:v,y:w}=(0,zt.calcXY)(p,s,l,d,f);return a.call(this,u,v,w,{e:t,node:r,newPosition:m})}),Pr(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:a,i:s}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:d,y:f}=(0,zt.calcXY)(this.getPositionParams(),c,l,i,a);return o.call(this,s,d,f,{e:t,node:r,newPosition:u})}),Pr(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Pr(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Pr(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,zt.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,zt.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,ma.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,a=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(a){const s=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:s,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,ma.setTransform)(t):(i=(0,ma.setTopLeft)(t),n&&(i.left=(0,ma.perc)(t.left/r),i.width=(0,ma.perc)(t.width/r))),i}mixinDraggable(t,n){return pa.default.createElement(eH.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:a,maxW:s,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:d}=this.props,f=this.getPositionParams(),h=(0,zt.calcGridItemPosition)(f,0,0,o,0).width,p=(0,zt.calcGridItemPosition)(f,0,0,i,a),m=(0,zt.calcGridItemPosition)(f,0,0,s,l),v=[p.width,p.height],w=[Math.min(m.width,h),Math.min(m.height,1/0)];return pa.default.createElement(tH.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:v,maxConstraints:w,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:d},t)}onResizeHandler(t,n,r,o){let{node:i,size:a,handle:s}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:d,maxH:f,minH:h,containerWidth:p}=this.props,{minW:m,maxW:v}=this.props;let w=a;i&&(w=(0,ma.resizeItemInDirection)(s,r,a,p),this.setState({resizing:o==="onResizeStop"?null:w}));let{w:b,h:x}=(0,zt.calcWH)(this.getPositionParams(),w.width,w.height,c,u,s);b=(0,zt.clamp)(b,Math.max(m,1),v),x=(0,zt.clamp)(x,h,f),l.call(this,d,b,x,{e:t,node:i,size:w,handle:s})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:a,droppingPosition:s,useCSSTransforms:l}=this.props,c=(0,zt.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=pa.default.Children.only(this.props.children);let d=pa.default.cloneElement(u,{ref:this.elementRef,className:(0,nH.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!s,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return d=this.mixinResizable(d,c,a),d=this.mixinDraggable(d,i),d}}Nu.default=Up,Pr(Up,"propTypes",{children:tt.default.element,cols:tt.default.number.isRequired,containerWidth:tt.default.number.isRequired,rowHeight:tt.default.number.isRequired,margin:tt.default.array.isRequired,maxRows:tt.default.number.isRequired,containerPadding:tt.default.array.isRequired,x:tt.default.number.isRequired,y:tt.default.number.isRequired,w:tt.default.number.isRequired,h:tt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:tt.default.string.isRequired,resizeHandles:cS.resizeHandleAxesType,resizeHandle:cS.resizeHandleType,onDragStop:tt.default.func,onDragStart:tt.default.func,onDrag:tt.default.func,onResizeStop:tt.default.func,onResizeStart:tt.default.func,onResize:tt.default.func,isDraggable:tt.default.bool.isRequired,isResizable:tt.default.bool.isRequired,isBounded:tt.default.bool.isRequired,static:tt.default.bool,useCSSTransforms:tt.default.bool.isRequired,transformScale:tt.default.number,className:tt.default.string,handle:tt.default.string,cancel:tt.default.string,droppingPosition:tt.default.shape({e:tt.default.object.isRequired,left:tt.default.number.isRequired,top:tt.default.number.isRequired})}),Pr(Up,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(ll,"__esModule",{value:!0}),ll.default=void 0;var ui=lH(E),Wp=mp,iH=Gp(gp),Ie=Be,aH=Sr,uS=Gp(Nu),sH=Gp(Kr);function Gp(e){return e&&e.__esModule?e:{default:e}}function dS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(dS=function(r){return r?n:t})(e)}function lH(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=dS(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Ut(e,t,n){return t=cH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cH(e){var t=uH(e,"string");return typeof t=="symbol"?t:String(t)}function uH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const fS="react-grid-layout";let hS=!1;try{hS=/firefox/i.test(navigator.userAgent)}catch{}class $u extends ui.Component{constructor(){super(...arguments),Ut(this,"state",{activeDrag:null,layout:(0,Ie.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Ie.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Ut(this,"dragEnterCounter",0),Ut(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s}=this.state,l=(0,Ie.getLayoutItem)(s,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,Ie.cloneLayoutItem)(l),oldLayout:s,activeDrag:c}),this.props.onDragStart(s,l,l,null,i,a)}),Ut(this,"onDrag",(t,n,r,o)=>{let{e:i,node:a}=o;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:d}=this.props,f=(0,Ie.getLayoutItem)(l,t);if(!f)return;const h={w:f.w,h:f.h,x:f.x,y:f.y,placeholder:!0,i:t};l=(0,Ie.moveElement)(l,f,n,r,!0,d,(0,Ie.compactType)(this.props),c,u),this.props.onDrag(l,s,f,h,i,a),this.setState({layout:u?l:(0,Ie.compact)(l,(0,Ie.compactType)(this.props),c),activeDrag:h})}),Ut(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:a}=o;if(!this.state.activeDrag)return;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:d}=this.props,f=(0,Ie.getLayoutItem)(l,t);if(!f)return;l=(0,Ie.moveElement)(l,f,n,r,!0,u,(0,Ie.compactType)(this.props),c,d);const p=d?l:(0,Ie.compact)(l,(0,Ie.compactType)(this.props),c);this.props.onDragStop(p,s,f,null,i,a);const{oldLayout:m}=this.state;this.setState({activeDrag:null,layout:p,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(p,m)}),Ut(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s}=this.state,l=(0,Ie.getLayoutItem)(s,t);l&&(this.setState({oldResizeItem:(0,Ie.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(s,l,l,null,i,a))}),Ut(this,"onResize",(t,n,r,o)=>{let{e:i,node:a,size:s,handle:l}=o;const{oldResizeItem:c}=this.state,{layout:u}=this.state,{cols:d,preventCollision:f,allowOverlap:h}=this.props;let p=!1,m,v,w;const[b,x]=(0,Ie.withLayoutItem)(u,t,C=>{let N;return v=C.x,w=C.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(v=C.x+(C.w-n),n=C.x!==v&&v<0?C.w:n,v=v<0?0:v),["ne","n","nw"].indexOf(l)!==-1&&(w=C.y+(C.h-r),r=C.y!==w&&w<0?C.h:r,w=w<0?0:w),p=!0),f&&!h&&(N=(0,Ie.getAllCollisions)(u,{...C,w:n,h:r,x:v,y:w}).filter(T=>T.i!==C.i).length>0,N&&(w=C.y,r=C.h,v=C.x,n=C.w,p=!1)),C.w=n,C.h=r,C});if(!x)return;m=b,p&&(m=(0,Ie.moveElement)(b,x,v,w,!0,this.props.preventCollision,(0,Ie.compactType)(this.props),d,h));const _={w:x.w,h:x.h,x:x.x,y:x.y,static:!0,i:t};this.props.onResize(m,c,x,_,i,a),this.setState({layout:h?m:(0,Ie.compact)(m,(0,Ie.compactType)(this.props),d),activeDrag:_})}),Ut(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,d=(0,Ie.getLayoutItem)(s,t),f=u?s:(0,Ie.compact)(s,(0,Ie.compactType)(this.props),c);this.props.onResizeStop(f,l,d,null,i,a);const{oldLayout:h}=this.state;this.setState({activeDrag:null,layout:f,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(f,h)}),Ut(this,"onDragOver",t=>{var b;if(t.preventDefault(),t.stopPropagation(),hS&&!((b=t.nativeEvent.target)!=null&&b.classList.contains(fS)))return!1;const{droppingItem:n,onDropDragOver:r,margin:o,cols:i,rowHeight:a,maxRows:s,width:l,containerPadding:c,transformScale:u}=this.props,d=r==null?void 0:r(t);if(d===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const f={...n,...d},{layout:h}=this.state,p=t.currentTarget.getBoundingClientRect(),m=t.clientX-p.left,v=t.clientY-p.top,w={left:m/u,top:v/u,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:x,top:_}=this.state.droppingPosition;(x!=m||_!=v)&&this.setState({droppingPosition:w})}}else{const x={cols:i,margin:o,maxRows:s,rowHeight:a,containerWidth:l,containerPadding:c||o},_=(0,aH.calcXY)(x,v,m,f.w,f.h);this.setState({droppingDOMNode:ui.createElement("div",{key:f.i}),droppingPosition:w,layout:[...h,{...f,x:_.x,y:_.y,static:!1,isDraggable:!0}]})}}),Ut(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,Ie.compact)(r.filter(i=>i.i!==t.i),(0,Ie.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Ut(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Ut(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Ut(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,Wp.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Ie.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Ie.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Ie.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Ie.fastRGLPropsEqual)(this.props,t,Wp.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,Ie.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,Wp.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:a,maxRows:s,useCSSTransforms:l,transformScale:c}=this.props;return ui.createElement(uS.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:s,rowHeight:a,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},ui.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Ie.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:a,containerPadding:s,rowHeight:l,maxRows:c,isDraggable:u,isResizable:d,isBounded:f,useCSSTransforms:h,transformScale:p,draggableCancel:m,draggableHandle:v,resizeHandles:w,resizeHandle:b}=this.props,{mounted:x,droppingPosition:_}=this.state,C=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,N=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,R=r.resizeHandles||w,T=C&&f&&r.isBounded!==!1;return ui.createElement(uS.default,{containerWidth:o,cols:i,margin:a,containerPadding:s||a,maxRows:c,rowHeight:l,cancel:m,handle:v,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:C,isResizable:N,isBounded:T,useCSSTransforms:h&&x,usePercentages:!x,transformScale:p,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?_:void 0,resizeHandles:R,resizeHandle:b},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,iH.default)(fS,t),a={height:this.containerHeight(),...n};return ui.createElement("div",{ref:o,className:i,style:a,onDrop:r?this.onDrop:Ie.noop,onDragLeave:r?this.onDragLeave:Ie.noop,onDragEnter:r?this.onDragEnter:Ie.noop,onDragOver:r?this.onDragOver:Ie.noop},ui.Children.map(this.props.children,s=>this.processGridItem(s)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}ll.default=$u,Ut($u,"displayName","ReactGridLayout"),Ut($u,"propTypes",sH.default),Ut($u,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:Ie.noop,onDragStart:Ie.noop,onDrag:Ie.noop,onDragStop:Ie.noop,onResizeStart:Ie.noop,onResize:Ie.noop,onResizeStop:Ie.noop,onDrop:Ie.noop,onDropDragOver:Ie.noop});var Fu={},di={};Object.defineProperty(di,"__esModule",{value:!0}),di.findOrGenerateResponsiveLayout=hH,di.getBreakpointFromWidth=dH,di.getColsFromBreakpoint=fH,di.sortBreakpoints=qp;var Lu=Be;function dH(e,t){const n=qp(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const a=n[o];t>e[a]&&(r=a)}return r}function fH(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function hH(e,t,n,r,o,i){if(e[n])return(0,Lu.cloneLayout)(e[n]);let a=e[r];const s=qp(t),l=s.slice(s.indexOf(n));for(let c=0,u=l.length;c<u;c++){const d=l[c];if(e[d]){a=e[d];break}}return a=(0,Lu.cloneLayout)(a||[]),(0,Lu.compact)((0,Lu.correctBounds)(a,{cols:o}),i,o)}function qp(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.default=void 0;var pS=mH(E),hn=mS(Co),Yp=mp,ga=Be,fi=di,pH=mS(ll);function mS(e){return e&&e.__esModule?e:{default:e}}function gS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(gS=function(r){return r?n:t})(e)}function mH(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=gS(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Kp(){return Kp=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},Kp.apply(this,arguments)}function zu(e,t,n){return t=gH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gH(e){var t=wH(e,"string");return typeof t=="symbol"?t:String(t)}function wH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const wS=e=>Object.prototype.toString.call(e);function Bu(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class Xp extends pS.Component{constructor(){super(...arguments),zu(this,"state",this.generateInitialState()),zu(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,fi.getBreakpointFromWidth)(n,t),a=(0,fi.getColsFromBreakpoint)(i,o),s=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,fi.findOrGenerateResponsiveLayout)(r,n,i,i,a,s),breakpoint:i,cols:a}}static getDerivedStateFromProps(t,n){if(!(0,Yp.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,fi.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,Yp.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Yp.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,a=this.props.breakpoint||(0,fi.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),s=this.state.breakpoint,l=(0,fi.getColsFromBreakpoint)(a,r),c={...o};if(s!==a||t.breakpoints!==n||t.cols!==r){s in c||(c[s]=(0,ga.cloneLayout)(this.state.layout));let f=(0,fi.findOrGenerateResponsiveLayout)(c,n,a,s,l,i);f=(0,ga.synchronizeLayoutWithChildren)(f,this.props.children,l,i,this.props.allowOverlap),c[a]=f,this.props.onBreakpointChange(a,l),this.props.onLayoutChange(f,c),this.setState({breakpoint:a,layout:f,cols:l})}const u=Bu(this.props.margin,a),d=Bu(this.props.containerPadding,a);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:a,onBreakpointChange:s,onLayoutChange:l,onWidthChange:c,...u}=this.props;return pS.createElement(pH.default,Kp({},u,{margin:Bu(i,this.state.breakpoint),containerPadding:Bu(a,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Fu.default=Xp,zu(Xp,"propTypes",{breakpoint:hn.default.string,breakpoints:hn.default.object,allowOverlap:hn.default.bool,cols:hn.default.object,margin:hn.default.oneOfType([hn.default.array,hn.default.object]),containerPadding:hn.default.oneOfType([hn.default.array,hn.default.object]),layouts(e,t){if(wS(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+wS(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,ga.validateLayout)(e.layouts[n],"layouts."+n)})},width:hn.default.number.isRequired,onBreakpointChange:hn.default.func,onLayoutChange:hn.default.func,onWidthChange:hn.default.func}),zu(Xp,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:ga.noop,onLayoutChange:ga.noop,onWidthChange:ga.noop});var Zp={},vS=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var a=i[o];n.call(r,a[1],a[0])}},t}()}(),Jp=typeof window<"u"&&typeof document<"u"&&window.document===document,Hu=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),vH=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Hu):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),yH=2;function bH(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){vH(i)}function s(){var l=Date.now();if(n){if(l-o<yH)return;r=!0}else n=!0,r=!1,setTimeout(a,t);o=l}return s}var xH=20,_H=["top","right","bottom","left","width","height","size","weight"],SH=typeof MutationObserver<"u",CH=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=bH(this.refresh.bind(this),xH)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Jp||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),SH?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Jp||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=_H.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),yS=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},wa=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Hu},bS=Uu(0,0,0,0);function Vu(e){return parseFloat(e)||0}function xS(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+Vu(i)},0)}function EH(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],a=e["padding-"+i];n[i]=Vu(a)}return n}function PH(e){var t=e.getBBox();return Uu(0,0,t.width,t.height)}function RH(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return bS;var r=wa(e).getComputedStyle(e),o=EH(r),i=o.left+o.right,a=o.top+o.bottom,s=Vu(r.width),l=Vu(r.height);if(r.boxSizing==="border-box"&&(Math.round(s+i)!==t&&(s-=xS(r,"left","right")+i),Math.round(l+a)!==n&&(l-=xS(r,"top","bottom")+a)),!TH(e)){var c=Math.round(s+i)-t,u=Math.round(l+a)-n;Math.abs(c)!==1&&(s-=c),Math.abs(u)!==1&&(l-=u)}return Uu(o.left,o.top,s,l)}var NH=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof wa(e).SVGGraphicsElement}:function(e){return e instanceof wa(e).SVGElement&&typeof e.getBBox=="function"}}();function TH(e){return e===wa(e).document.documentElement}function MH(e){return Jp?NH(e)?PH(e):RH(e):bS}function kH(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(i.prototype);return yS(a,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),a}function Uu(e,t,n,r){return{x:e,y:t,width:n,height:r}}var DH=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Uu(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=MH(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),AH=function(){function e(t,n){var r=kH(n);yS(this,{target:t,contentRect:r})}return e}(),IH=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new vS,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof wa(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new DH(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof wa(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new AH(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),_S=typeof WeakMap<"u"?new WeakMap:new vS,SS=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=CH.getInstance(),r=new IH(t,n,this);_S.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){SS.prototype[e]=function(){var t;return(t=_S.get(this))[e].apply(t,arguments)}});var OH=function(){return typeof Hu.ResizeObserver<"u"?Hu.ResizeObserver:SS}();const jH=Sc(Object.freeze(Object.defineProperty({__proto__:null,default:OH},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(Zp,"__esModule",{value:!0}),Zp.default=UH;var Wu=zH(E),$H=Qp(Co),FH=Qp(jH),LH=Qp(gp);function Qp(e){return e&&e.__esModule?e:{default:e}}function CS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(CS=function(r){return r?n:t})(e)}function zH(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=CS(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function em(){return em=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},em.apply(this,arguments)}function va(e,t,n){return t=BH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BH(e){var t=HH(e,"string");return typeof t=="symbol"?t:String(t)}function HH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const VH="react-grid-layout";function UH(e){var t;return t=class extends Wu.Component{constructor(){super(...arguments),va(this,"state",{width:1280}),va(this,"elementRef",Wu.createRef()),va(this,"mounted",!1),va(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new FH.default(o=>{if(this.elementRef.current instanceof HTMLElement){const a=o[0].contentRect.width;this.setState({width:a})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?Wu.createElement("div",{className:(0,LH.default)(this.props.className,VH),style:this.props.style,ref:this.elementRef}):Wu.createElement(e,em({innerRef:this.elementRef},o,this.state))}},va(t,"defaultProps",{measureBeforeMount:!1}),va(t,"propTypes",{measureBeforeMount:$H.default.bool}),t}(function(e){e.exports=ll.default,e.exports.utils=Be,e.exports.calculateUtils=Sr,e.exports.Responsive=Fu.default,e.exports.Responsive.utils=di,e.exports.WidthProvider=Zp.default})(C_);var tm=C_.exports;const ES=On(tm),WH=tm.WidthProvider(ES),GH=So.div`
|
|
150
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&K_(e.body,"react-draggable-transparent-selection")}function s3(e){if(e)try{if(e.body&&X_(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function K_(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function X_(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Er={};Object.defineProperty(Er,"__esModule",{value:!0}),Er.canDragX=u3,Er.canDragY=d3,Er.createCoreData=h3,Er.createDraggableData=p3,Er.getBoundPosition=l3,Er.getControlPosition=f3,Er.snapToGrid=c3;var Rn=Cr,ha=bt;function l3(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:m3(r);const o=kp(e);if(typeof r=="string"){const{ownerDocument:i}=o,a=i.defaultView;let s;if(r==="parent"?s=o.parentNode:s=i.querySelector(r),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=s,c=a.getComputedStyle(o),u=a.getComputedStyle(l);r={left:-o.offsetLeft+(0,Rn.int)(u.paddingLeft)+(0,Rn.int)(c.marginLeft),top:-o.offsetTop+(0,Rn.int)(u.paddingTop)+(0,Rn.int)(c.marginTop),right:(0,ha.innerWidth)(l)-(0,ha.outerWidth)(o)-o.offsetLeft+(0,Rn.int)(u.paddingRight)-(0,Rn.int)(c.marginRight),bottom:(0,ha.innerHeight)(l)-(0,ha.outerHeight)(o)-o.offsetTop+(0,Rn.int)(u.paddingBottom)-(0,Rn.int)(c.marginBottom)}}return(0,Rn.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Rn.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Rn.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Rn.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function c3(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function u3(e){return e.props.axis==="both"||e.props.axis==="x"}function d3(e){return e.props.axis==="both"||e.props.axis==="y"}function f3(e,t,n){const r=typeof t=="number"?(0,ha.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=kp(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,ha.offsetXYFromParent)(r||e,i,n.props.scale)}function h3(e,t,n){const r=!(0,Rn.isNum)(e.lastX),o=kp(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function p3(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function m3(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function kp(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var ku={},Du={};Object.defineProperty(Du,"__esModule",{value:!0}),Du.default=g3;function g3(){}Object.defineProperty(ku,"__esModule",{value:!0}),ku.default=void 0;var Dp=v3(E),fn=Ip(Co),w3=Ip(ur),Vt=bt,Eo=Er,Ap=Cr,dl=Ip(Du);function Ip(e){return e&&e.__esModule?e:{default:e}}function Z_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Z_=function(r){return r?n:t})(e)}function v3(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Z_(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function nn(e,t,n){return t=y3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y3(e){var t=b3(e,"string");return typeof t=="symbol"?t:String(t)}function b3(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Kn={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Po=Kn.mouse,Au=class extends Dp.Component{constructor(){super(...arguments),nn(this,"dragging",!1),nn(this,"lastX",NaN),nn(this,"lastY",NaN),nn(this,"touchIdentifier",null),nn(this,"mounted",!1),nn(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Vt.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Vt.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,Vt.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,Eo.getControlPosition)(t,o,this);if(i==null)return;const{x:a,y:s}=i,l=(0,Eo.createCoreData)(this,a,s);(0,dl.default)("DraggableCore: handleDragStart: %j",l),(0,dl.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Vt.addUserSelectStyles)(r),this.dragging=!0,this.lastX=a,this.lastY=s,(0,Vt.addEvent)(r,Po.move,this.handleDrag),(0,Vt.addEvent)(r,Po.stop,this.handleDragStop))}),nn(this,"handleDrag",t=>{const n=(0,Eo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let s=r-this.lastX,l=o-this.lastY;if([s,l]=(0,Eo.snapToGrid)(this.props.grid,s,l),!s&&!l)return;r=this.lastX+s,o=this.lastY+l}const i=(0,Eo.createCoreData)(this,r,o);if((0,dl.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),nn(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Eo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,Eo.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,Eo.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,Vt.removeUserSelectStyles)(s.ownerDocument),(0,dl.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,dl.default)("DraggableCore: Removing handlers"),(0,Vt.removeEvent)(s.ownerDocument,Po.move,this.handleDrag),(0,Vt.removeEvent)(s.ownerDocument,Po.stop,this.handleDragStop))}),nn(this,"onMouseDown",t=>(Po=Kn.mouse,this.handleDragStart(t))),nn(this,"onMouseUp",t=>(Po=Kn.mouse,this.handleDragStop(t))),nn(this,"onTouchStart",t=>(Po=Kn.touch,this.handleDragStart(t))),nn(this,"onTouchEnd",t=>(Po=Kn.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Vt.addEvent)(t,Kn.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Vt.removeEvent)(n,Kn.mouse.move,this.handleDrag),(0,Vt.removeEvent)(n,Kn.touch.move,this.handleDrag),(0,Vt.removeEvent)(n,Kn.mouse.stop,this.handleDragStop),(0,Vt.removeEvent)(n,Kn.touch.stop,this.handleDragStop),(0,Vt.removeEvent)(t,Kn.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Vt.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:w3.default.findDOMNode(this)}render(){return Dp.cloneElement(Dp.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};ku.default=Au,nn(Au,"displayName","DraggableCore"),nn(Au,"propTypes",{allowAnyClick:fn.default.bool,children:fn.default.node.isRequired,disabled:fn.default.bool,enableUserSelectHack:fn.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:fn.default.arrayOf(fn.default.number),handle:fn.default.string,cancel:fn.default.string,nodeRef:fn.default.object,onStart:fn.default.func,onDrag:fn.default.func,onStop:fn.default.func,onMouseDown:fn.default.func,scale:fn.default.number,className:Ap.dontSetMe,style:Ap.dontSetMe,transform:Ap.dontSetMe}),nn(Au,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(E),n=u(Co),r=u(ur),o=u(L8),i=bt,a=Er,s=Cr,l=u(ku),c=u(Du);function u(b){return b&&b.__esModule?b:{default:b}}function d(b){if(typeof WeakMap!="function")return null;var x=new WeakMap,_=new WeakMap;return(d=function(C){return C?_:x})(b)}function f(b,x){if(b&&b.__esModule)return b;if(b===null||typeof b!="object"&&typeof b!="function")return{default:b};var _=d(x);if(_&&_.has(b))return _.get(b);var C={},N=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in b)if(R!=="default"&&Object.prototype.hasOwnProperty.call(b,R)){var T=N?Object.getOwnPropertyDescriptor(b,R):null;T&&(T.get||T.set)?Object.defineProperty(C,R,T):C[R]=b[R]}return C.default=b,_&&_.set(b,C),C}function h(){return h=Object.assign?Object.assign.bind():function(b){for(var x=1;x<arguments.length;x++){var _=arguments[x];for(var C in _)Object.prototype.hasOwnProperty.call(_,C)&&(b[C]=_[C])}return b},h.apply(this,arguments)}function p(b,x,_){return x=m(x),x in b?Object.defineProperty(b,x,{value:_,enumerable:!0,configurable:!0,writable:!0}):b[x]=_,b}function m(b){var x=v(b,"string");return typeof x=="symbol"?x:String(x)}function v(b,x){if(typeof b!="object"||b===null)return b;var _=b[Symbol.toPrimitive];if(_!==void 0){var C=_.call(b,x||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(b)}class w extends t.Component{static getDerivedStateFromProps(x,_){let{position:C}=x,{prevPropsPosition:N}=_;return C&&(!N||C.x!==N.x||C.y!==N.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:C,prevPropsPosition:N}),{x:C.x,y:C.y,prevPropsPosition:{...C}}):null}constructor(x){super(x),p(this,"onDragStart",(_,C)=>{if((0,c.default)("Draggable: onDragStart: %j",C),this.props.onStart(_,(0,a.createDraggableData)(this,C))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(_,C)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",C);const N=(0,a.createDraggableData)(this,C),R={x:N.x,y:N.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:D}=R;R.x+=this.state.slackX,R.y+=this.state.slackY;const[A,O]=(0,a.getBoundPosition)(this,R.x,R.y);R.x=A,R.y=O,R.slackX=this.state.slackX+(M-R.x),R.slackY=this.state.slackY+(D-R.y),N.x=R.x,N.y=R.y,N.deltaX=R.x-this.state.x,N.deltaY=R.y-this.state.y}if(this.props.onDrag(_,N)===!1)return!1;this.setState(R)}),p(this,"onDragStop",(_,C)=>{if(!this.state.dragging||this.props.onStop(_,(0,a.createDraggableData)(this,C))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",C);const R={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:D}=this.props.position;R.x=M,R.y=D}this.setState(R)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},x.position&&!(x.onDrag||x.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var x,_;return(x=(_=this.props)===null||_===void 0||(_=_.nodeRef)===null||_===void 0?void 0:_.current)!==null&&x!==void 0?x:r.default.findDOMNode(this)}render(){const{axis:x,bounds:_,children:C,defaultPosition:N,defaultClassName:R,defaultClassNameDragging:T,defaultClassNameDragged:M,position:D,positionOffset:A,scale:O,...$}=this.props;let W={},re=null;const Z=!!!D||this.state.dragging,B=D||N,oe={x:(0,a.canDragX)(this)&&Z?this.state.x:B.x,y:(0,a.canDragY)(this)&&Z?this.state.y:B.y};this.state.isElementSVG?re=(0,i.createSVGTransform)(oe,A):W=(0,i.createCSSTransform)(oe,A);const ee=(0,o.default)(C.props.className||"",R,{[T]:this.state.dragging,[M]:this.state.dragged});return t.createElement(l.default,h({},$,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(C),{className:ee,style:{...C.props.style,...W},transform:re}))}}e.default=w,p(w,"displayName","Draggable"),p(w,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),p(w,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(B_);const{default:J_,DraggableCore:x3}=B_;Tu.exports=J_,Tu.exports.default=J_,Tu.exports.DraggableCore=x3;var Q_=Tu.exports,Iu={exports:{}},fl={},Op={};Op.__esModule=!0,Op.cloneElement=R3;var _3=S3(E);function S3(e){return e&&e.__esModule?e:{default:e}}function eS(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 tS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eS(Object(n),!0).forEach(function(r){C3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C3(e,t,n){return t=E3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E3(e){var t=P3(e,"string");return typeof t=="symbol"?t:String(t)}function P3(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function R3(e,t){return t.style&&e.props.style&&(t.style=tS(tS({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),_3.default.cloneElement(e,t)}var hl={};hl.__esModule=!0,hl.resizableProps=void 0;var Fe=N3(Co);function N3(e){return e&&e.__esModule?e:{default:e}}var T3={axis:Fe.default.oneOf(["both","x","y","none"]),className:Fe.default.string,children:Fe.default.element.isRequired,draggableOpts:Fe.default.shape({allowAnyClick:Fe.default.bool,cancel:Fe.default.string,children:Fe.default.node,disabled:Fe.default.bool,enableUserSelectHack:Fe.default.bool,offsetParent:Fe.default.node,grid:Fe.default.arrayOf(Fe.default.number),handle:Fe.default.string,nodeRef:Fe.default.object,onStart:Fe.default.func,onDrag:Fe.default.func,onStop:Fe.default.func,onMouseDown:Fe.default.func,scale:Fe.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=Fe.default.number).isRequired.apply(i,n)}return Fe.default.number.apply(Fe.default,n)},handle:Fe.default.oneOfType([Fe.default.node,Fe.default.func]),handleSize:Fe.default.arrayOf(Fe.default.number),lockAspectRatio:Fe.default.bool,maxConstraints:Fe.default.arrayOf(Fe.default.number),minConstraints:Fe.default.arrayOf(Fe.default.number),onResizeStop:Fe.default.func,onResizeStart:Fe.default.func,onResize:Fe.default.func,resizeHandles:Fe.default.arrayOf(Fe.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:Fe.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=Fe.default.number).isRequired.apply(i,n)}return Fe.default.number.apply(Fe.default,n)}};hl.resizableProps=T3,fl.__esModule=!0,fl.default=void 0;var pl=I3(E),M3=Q_,k3=Op,D3=hl,A3=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function nS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(nS=function(o){return o?n:t})(e)}function I3(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=nS(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function jp(){return jp=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},jp.apply(this,arguments)}function O3(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function rS(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 $p(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rS(Object(n),!0).forEach(function(r){j3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j3(e,t,n){return t=$3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $3(e){var t=F3(e,"string");return typeof t=="symbol"?t:String(t)}function F3(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function L3(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Fp(e,t)}function Fp(e,t){return Fp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Fp(e,t)}var Lp=function(e){L3(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var a=this.props,s=a.minConstraints,l=a.maxConstraints,c=a.lockAspectRatio;if(!s&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,f=i-this.props.height;Math.abs(d)>Math.abs(f*u)?i=o/u:o=i*u}var h=o,p=i,m=this.slack||[0,0],v=m[0],w=m[1];return o+=v,i+=w,s&&(o=Math.max(s[0],o),i=Math.max(s[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[v+(h-o),w+(p-i)],[o,i]},n.resizeHandler=function(o,i){var a=this;return function(s,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&a.resetData();var f=(a.props.axis==="both"||a.props.axis==="x")&&i!=="n"&&i!=="s",h=(a.props.axis==="both"||a.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!f&&!h)){var p=i[0],m=i[i.length-1],v=c.getBoundingClientRect();if(a.lastHandleRect!=null){if(m==="w"){var w=v.left-a.lastHandleRect.left;u+=w}if(p==="n"){var b=v.top-a.lastHandleRect.top;d+=b}}a.lastHandleRect=v,m==="w"&&(u=-u),p==="n"&&(d=-d);var x=a.props.width+(f?u/a.props.transformScale:0),_=a.props.height+(h?d/a.props.transformScale:0),C=a.runConstraints(x,_);x=C[0],_=C[1];var N=x!==a.props.width||_!==a.props.height,R=typeof a.props[o]=="function"?a.props[o]:null,T=o==="onResize"&&!N;R&&!T&&(s.persist==null||s.persist(),R(s,{node:c,size:{width:x,height:_},handle:i})),o==="onResizeStop"&&a.resetData()}}},n.renderResizeHandle=function(o,i){var a=this.props.handle;if(!a)return pl.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof a=="function")return a(o,i);var s=typeof a.type=="string",l=$p({ref:i},s?{}:{handleAxis:o});return pl.cloneElement(a,l)},n.render=function(){var o=this,i=this.props,a=i.children,s=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=O3(i,A3);return(0,k3.cloneElement)(a,$p($p({},u),{},{className:(s?s+" ":"")+"react-resizable",children:[].concat(a.props.children,c.map(function(d){var f,h=(f=o.handleRefs[d])!=null?f:o.handleRefs[d]=pl.createRef();return pl.createElement(M3.DraggableCore,jp({},l,{nodeRef:h,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,h))}))}))},t}(pl.Component);fl.default=Lp,Lp.propTypes=D3.resizableProps,Lp.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Ou={};Ou.__esModule=!0,Ou.default=void 0;var zp=U3(E),z3=oS(Co),B3=oS(fl),H3=hl,V3=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function oS(e){return e&&e.__esModule?e:{default:e}}function iS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(iS=function(o){return o?n:t})(e)}function U3(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=iS(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Bp(){return Bp=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},Bp.apply(this,arguments)}function aS(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 ju(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aS(Object(n),!0).forEach(function(r){W3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W3(e,t,n){return t=G3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G3(e){var t=q3(e,"string");return typeof t=="symbol"?t:String(t)}function q3(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Y3(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function K3(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Hp(e,t)}function Hp(e,t){return Hp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Hp(e,t)}var sS=function(e){K3(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(s,l){var c=l.size;r.props.onResize?(s.persist==null||s.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(s,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,a=o.handleSize;o.onResize;var s=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,d=o.maxConstraints,f=o.lockAspectRatio,h=o.axis;o.width,o.height;var p=o.resizeHandles,m=o.style,v=o.transformScale,w=Y3(o,V3);return zp.createElement(B3.default,{axis:h,draggableOpts:c,handle:i,handleSize:a,height:this.state.height,lockAspectRatio:f,maxConstraints:d,minConstraints:u,onResizeStart:s,onResize:this.onResize,onResizeStop:l,resizeHandles:p,transformScale:v,width:this.state.width},zp.createElement("div",Bp({},w,{style:ju(ju({},m),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(zp.Component);Ou.default=sS,sS.propTypes=ju(ju({},H3.resizableProps),{},{children:z3.default.element}),Iu.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Iu.exports.Resizable=fl.default,Iu.exports.ResizableBox=Ou.default;var X3=Iu.exports,Kr={};Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.resizeHandleType=Kr.resizeHandleAxesType=Kr.default=void 0;var Le=lS(Co),Z3=lS(E);function lS(e){return e&&e.__esModule?e:{default:e}}const J3=Kr.resizeHandleAxesType=Le.default.arrayOf(Le.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),Q3=Kr.resizeHandleType=Le.default.oneOfType([Le.default.node,Le.default.func]);Kr.default={className:Le.default.string,style:Le.default.object,width:Le.default.number,autoSize:Le.default.bool,cols:Le.default.number,draggableCancel:Le.default.string,draggableHandle:Le.default.string,verticalCompact:function(e){e.verticalCompact},compactType:Le.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Be.validateLayout(t,"layout")},margin:Le.default.arrayOf(Le.default.number),containerPadding:Le.default.arrayOf(Le.default.number),rowHeight:Le.default.number,maxRows:Le.default.number,isBounded:Le.default.bool,isDraggable:Le.default.bool,isResizable:Le.default.bool,allowOverlap:Le.default.bool,preventCollision:Le.default.bool,useCSSTransforms:Le.default.bool,transformScale:Le.default.number,isDroppable:Le.default.bool,resizeHandles:J3,resizeHandle:Q3,onLayoutChange:Le.default.func,onDragStart:Le.default.func,onDrag:Le.default.func,onDragStop:Le.default.func,onResizeStart:Le.default.func,onResize:Le.default.func,onResizeStop:Le.default.func,onDrop:Le.default.func,droppingItem:Le.default.shape({i:Le.default.string.isRequired,w:Le.default.number.isRequired,h:Le.default.number.isRequired}),children:function(e,t){const n=e[t],r={};Z3.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:Le.default.any},Object.defineProperty(Nu,"__esModule",{value:!0}),Nu.default=void 0;var pa=Vp(E),tt=Vp(Co),eH=Q_,tH=X3,ma=Be,zt=Sr,cS=Kr,nH=Vp(gp);function Vp(e){return e&&e.__esModule?e:{default:e}}function Pr(e,t,n){return t=rH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rH(e){var t=oH(e,"string");return typeof t=="symbol"?t:String(t)}function oH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Up extends pa.default.Component{constructor(){super(...arguments),Pr(this,"state",{resizing:null,dragging:null,className:""}),Pr(this,"elementRef",pa.default.createRef()),Pr(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const a={top:0,left:0},{offsetParent:s}=r;if(!s)return;const l=s.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,d=l.left/i,f=c.top/i,h=l.top/i;a.left=u-d+s.scrollLeft,a.top=f-h+s.scrollTop,this.setState({dragging:a});const{x:p,y:m}=(0,zt.calcXY)(this.getPositionParams(),a.top,a.left,this.props.w,this.props.h);return o.call(this,this.props.i,p,m,{e:t,node:r,newPosition:a})}),Pr(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let s=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:d,h:f,containerWidth:h}=this.props,p=this.getPositionParams();if(c){const{offsetParent:b}=r;if(b){const{margin:x,rowHeight:_,containerPadding:C}=this.props,N=b.clientHeight-(0,zt.calcGridItemWHPx)(f,_,x[1]);s=(0,zt.clamp)(s-C[1],0,N);const R=(0,zt.calcGridColWidth)(p),T=h-(0,zt.calcGridItemWHPx)(d,R,x[0]);l=(0,zt.clamp)(l-C[0],0,T)}}const m={top:s,left:l};this.setState({dragging:m});const{x:v,y:w}=(0,zt.calcXY)(p,s,l,d,f);return a.call(this,u,v,w,{e:t,node:r,newPosition:m})}),Pr(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:a,i:s}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:d,y:f}=(0,zt.calcXY)(this.getPositionParams(),c,l,i,a);return o.call(this,s,d,f,{e:t,node:r,newPosition:u})}),Pr(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Pr(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Pr(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,zt.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,zt.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,ma.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,a=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(a){const s=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:s,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,ma.setTransform)(t):(i=(0,ma.setTopLeft)(t),n&&(i.left=(0,ma.perc)(t.left/r),i.width=(0,ma.perc)(t.width/r))),i}mixinDraggable(t,n){return pa.default.createElement(eH.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:a,maxW:s,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:d}=this.props,f=this.getPositionParams(),h=(0,zt.calcGridItemPosition)(f,0,0,o,0).width,p=(0,zt.calcGridItemPosition)(f,0,0,i,a),m=(0,zt.calcGridItemPosition)(f,0,0,s,l),v=[p.width,p.height],w=[Math.min(m.width,h),Math.min(m.height,1/0)];return pa.default.createElement(tH.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:v,maxConstraints:w,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:d},t)}onResizeHandler(t,n,r,o){let{node:i,size:a,handle:s}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:d,maxH:f,minH:h,containerWidth:p}=this.props,{minW:m,maxW:v}=this.props;let w=a;i&&(w=(0,ma.resizeItemInDirection)(s,r,a,p),this.setState({resizing:o==="onResizeStop"?null:w}));let{w:b,h:x}=(0,zt.calcWH)(this.getPositionParams(),w.width,w.height,c,u,s);b=(0,zt.clamp)(b,Math.max(m,1),v),x=(0,zt.clamp)(x,h,f),l.call(this,d,b,x,{e:t,node:i,size:w,handle:s})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:a,droppingPosition:s,useCSSTransforms:l}=this.props,c=(0,zt.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=pa.default.Children.only(this.props.children);let d=pa.default.cloneElement(u,{ref:this.elementRef,className:(0,nH.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!s,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return d=this.mixinResizable(d,c,a),d=this.mixinDraggable(d,i),d}}Nu.default=Up,Pr(Up,"propTypes",{children:tt.default.element,cols:tt.default.number.isRequired,containerWidth:tt.default.number.isRequired,rowHeight:tt.default.number.isRequired,margin:tt.default.array.isRequired,maxRows:tt.default.number.isRequired,containerPadding:tt.default.array.isRequired,x:tt.default.number.isRequired,y:tt.default.number.isRequired,w:tt.default.number.isRequired,h:tt.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:tt.default.string.isRequired,resizeHandles:cS.resizeHandleAxesType,resizeHandle:cS.resizeHandleType,onDragStop:tt.default.func,onDragStart:tt.default.func,onDrag:tt.default.func,onResizeStop:tt.default.func,onResizeStart:tt.default.func,onResize:tt.default.func,isDraggable:tt.default.bool.isRequired,isResizable:tt.default.bool.isRequired,isBounded:tt.default.bool.isRequired,static:tt.default.bool,useCSSTransforms:tt.default.bool.isRequired,transformScale:tt.default.number,className:tt.default.string,handle:tt.default.string,cancel:tt.default.string,droppingPosition:tt.default.shape({e:tt.default.object.isRequired,left:tt.default.number.isRequired,top:tt.default.number.isRequired})}),Pr(Up,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(ll,"__esModule",{value:!0}),ll.default=void 0;var ui=lH(E),Wp=mp,iH=Gp(gp),Ie=Be,aH=Sr,uS=Gp(Nu),sH=Gp(Kr);function Gp(e){return e&&e.__esModule?e:{default:e}}function dS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(dS=function(r){return r?n:t})(e)}function lH(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=dS(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Ut(e,t,n){return t=cH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cH(e){var t=uH(e,"string");return typeof t=="symbol"?t:String(t)}function uH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const fS="react-grid-layout";let hS=!1;try{hS=/firefox/i.test(navigator.userAgent)}catch{}class $u extends ui.Component{constructor(){super(...arguments),Ut(this,"state",{activeDrag:null,layout:(0,Ie.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Ie.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Ut(this,"dragEnterCounter",0),Ut(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s}=this.state,l=(0,Ie.getLayoutItem)(s,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,Ie.cloneLayoutItem)(l),oldLayout:s,activeDrag:c}),this.props.onDragStart(s,l,l,null,i,a)}),Ut(this,"onDrag",(t,n,r,o)=>{let{e:i,node:a}=o;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:d}=this.props,f=(0,Ie.getLayoutItem)(l,t);if(!f)return;const h={w:f.w,h:f.h,x:f.x,y:f.y,placeholder:!0,i:t};l=(0,Ie.moveElement)(l,f,n,r,!0,d,(0,Ie.compactType)(this.props),c,u),this.props.onDrag(l,s,f,h,i,a),this.setState({layout:u?l:(0,Ie.compact)(l,(0,Ie.compactType)(this.props),c),activeDrag:h})}),Ut(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:a}=o;if(!this.state.activeDrag)return;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:d}=this.props,f=(0,Ie.getLayoutItem)(l,t);if(!f)return;l=(0,Ie.moveElement)(l,f,n,r,!0,u,(0,Ie.compactType)(this.props),c,d);const p=d?l:(0,Ie.compact)(l,(0,Ie.compactType)(this.props),c);this.props.onDragStop(p,s,f,null,i,a);const{oldLayout:m}=this.state;this.setState({activeDrag:null,layout:p,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(p,m)}),Ut(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s}=this.state,l=(0,Ie.getLayoutItem)(s,t);l&&(this.setState({oldResizeItem:(0,Ie.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(s,l,l,null,i,a))}),Ut(this,"onResize",(t,n,r,o)=>{let{e:i,node:a,size:s,handle:l}=o;const{oldResizeItem:c}=this.state,{layout:u}=this.state,{cols:d,preventCollision:f,allowOverlap:h}=this.props;let p=!1,m,v,w;const[b,x]=(0,Ie.withLayoutItem)(u,t,C=>{let N;return v=C.x,w=C.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(v=C.x+(C.w-n),n=C.x!==v&&v<0?C.w:n,v=v<0?0:v),["ne","n","nw"].indexOf(l)!==-1&&(w=C.y+(C.h-r),r=C.y!==w&&w<0?C.h:r,w=w<0?0:w),p=!0),f&&!h&&(N=(0,Ie.getAllCollisions)(u,{...C,w:n,h:r,x:v,y:w}).filter(T=>T.i!==C.i).length>0,N&&(w=C.y,r=C.h,v=C.x,n=C.w,p=!1)),C.w=n,C.h=r,C});if(!x)return;m=b,p&&(m=(0,Ie.moveElement)(b,x,v,w,!0,this.props.preventCollision,(0,Ie.compactType)(this.props),d,h));const _={w:x.w,h:x.h,x:x.x,y:x.y,static:!0,i:t};this.props.onResize(m,c,x,_,i,a),this.setState({layout:h?m:(0,Ie.compact)(m,(0,Ie.compactType)(this.props),d),activeDrag:_})}),Ut(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,d=(0,Ie.getLayoutItem)(s,t),f=u?s:(0,Ie.compact)(s,(0,Ie.compactType)(this.props),c);this.props.onResizeStop(f,l,d,null,i,a);const{oldLayout:h}=this.state;this.setState({activeDrag:null,layout:f,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(f,h)}),Ut(this,"onDragOver",t=>{var b;if(t.preventDefault(),t.stopPropagation(),hS&&!((b=t.nativeEvent.target)!=null&&b.classList.contains(fS)))return!1;const{droppingItem:n,onDropDragOver:r,margin:o,cols:i,rowHeight:a,maxRows:s,width:l,containerPadding:c,transformScale:u}=this.props,d=r==null?void 0:r(t);if(d===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const f={...n,...d},{layout:h}=this.state,p=t.currentTarget.getBoundingClientRect(),m=t.clientX-p.left,v=t.clientY-p.top,w={left:m/u,top:v/u,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:x,top:_}=this.state.droppingPosition;(x!=m||_!=v)&&this.setState({droppingPosition:w})}}else{const x={cols:i,margin:o,maxRows:s,rowHeight:a,containerWidth:l,containerPadding:c||o},_=(0,aH.calcXY)(x,v,m,f.w,f.h);this.setState({droppingDOMNode:ui.createElement("div",{key:f.i}),droppingPosition:w,layout:[...h,{...f,x:_.x,y:_.y,static:!1,isDraggable:!0}]})}}),Ut(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,Ie.compact)(r.filter(i=>i.i!==t.i),(0,Ie.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Ut(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Ut(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Ut(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,Wp.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Ie.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Ie.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Ie.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Ie.fastRGLPropsEqual)(this.props,t,Wp.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,Ie.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,Wp.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:a,maxRows:s,useCSSTransforms:l,transformScale:c}=this.props;return ui.createElement(uS.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:s,rowHeight:a,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},ui.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Ie.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:a,containerPadding:s,rowHeight:l,maxRows:c,isDraggable:u,isResizable:d,isBounded:f,useCSSTransforms:h,transformScale:p,draggableCancel:m,draggableHandle:v,resizeHandles:w,resizeHandle:b}=this.props,{mounted:x,droppingPosition:_}=this.state,C=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,N=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,R=r.resizeHandles||w,T=C&&f&&r.isBounded!==!1;return ui.createElement(uS.default,{containerWidth:o,cols:i,margin:a,containerPadding:s||a,maxRows:c,rowHeight:l,cancel:m,handle:v,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:C,isResizable:N,isBounded:T,useCSSTransforms:h&&x,usePercentages:!x,transformScale:p,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?_:void 0,resizeHandles:R,resizeHandle:b},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,iH.default)(fS,t),a={height:this.containerHeight(),...n};return ui.createElement("div",{ref:o,className:i,style:a,onDrop:r?this.onDrop:Ie.noop,onDragLeave:r?this.onDragLeave:Ie.noop,onDragEnter:r?this.onDragEnter:Ie.noop,onDragOver:r?this.onDragOver:Ie.noop},ui.Children.map(this.props.children,s=>this.processGridItem(s)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}ll.default=$u,Ut($u,"displayName","ReactGridLayout"),Ut($u,"propTypes",sH.default),Ut($u,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:Ie.noop,onDragStart:Ie.noop,onDrag:Ie.noop,onDragStop:Ie.noop,onResizeStart:Ie.noop,onResize:Ie.noop,onResizeStop:Ie.noop,onDrop:Ie.noop,onDropDragOver:Ie.noop});var Fu={},di={};Object.defineProperty(di,"__esModule",{value:!0}),di.findOrGenerateResponsiveLayout=hH,di.getBreakpointFromWidth=dH,di.getColsFromBreakpoint=fH,di.sortBreakpoints=qp;var Lu=Be;function dH(e,t){const n=qp(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const a=n[o];t>e[a]&&(r=a)}return r}function fH(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function hH(e,t,n,r,o,i){if(e[n])return(0,Lu.cloneLayout)(e[n]);let a=e[r];const s=qp(t),l=s.slice(s.indexOf(n));for(let c=0,u=l.length;c<u;c++){const d=l[c];if(e[d]){a=e[d];break}}return a=(0,Lu.cloneLayout)(a||[]),(0,Lu.compact)((0,Lu.correctBounds)(a,{cols:o}),i,o)}function qp(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.default=void 0;var pS=mH(E),hn=mS(Co),Yp=mp,ga=Be,fi=di,pH=mS(ll);function mS(e){return e&&e.__esModule?e:{default:e}}function gS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(gS=function(r){return r?n:t})(e)}function mH(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=gS(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Kp(){return Kp=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},Kp.apply(this,arguments)}function zu(e,t,n){return t=gH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gH(e){var t=wH(e,"string");return typeof t=="symbol"?t:String(t)}function wH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const wS=e=>Object.prototype.toString.call(e);function Bu(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class Xp extends pS.Component{constructor(){super(...arguments),zu(this,"state",this.generateInitialState()),zu(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,fi.getBreakpointFromWidth)(n,t),a=(0,fi.getColsFromBreakpoint)(i,o),s=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,fi.findOrGenerateResponsiveLayout)(r,n,i,i,a,s),breakpoint:i,cols:a}}static getDerivedStateFromProps(t,n){if(!(0,Yp.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,fi.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,Yp.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Yp.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,a=this.props.breakpoint||(0,fi.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),s=this.state.breakpoint,l=(0,fi.getColsFromBreakpoint)(a,r),c={...o};if(s!==a||t.breakpoints!==n||t.cols!==r){s in c||(c[s]=(0,ga.cloneLayout)(this.state.layout));let f=(0,fi.findOrGenerateResponsiveLayout)(c,n,a,s,l,i);f=(0,ga.synchronizeLayoutWithChildren)(f,this.props.children,l,i,this.props.allowOverlap),c[a]=f,this.props.onBreakpointChange(a,l),this.props.onLayoutChange(f,c),this.setState({breakpoint:a,layout:f,cols:l})}const u=Bu(this.props.margin,a),d=Bu(this.props.containerPadding,a);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:a,onBreakpointChange:s,onLayoutChange:l,onWidthChange:c,...u}=this.props;return pS.createElement(pH.default,Kp({},u,{margin:Bu(i,this.state.breakpoint),containerPadding:Bu(a,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Fu.default=Xp,zu(Xp,"propTypes",{breakpoint:hn.default.string,breakpoints:hn.default.object,allowOverlap:hn.default.bool,cols:hn.default.object,margin:hn.default.oneOfType([hn.default.array,hn.default.object]),containerPadding:hn.default.oneOfType([hn.default.array,hn.default.object]),layouts(e,t){if(wS(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+wS(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,ga.validateLayout)(e.layouts[n],"layouts."+n)})},width:hn.default.number.isRequired,onBreakpointChange:hn.default.func,onLayoutChange:hn.default.func,onWidthChange:hn.default.func}),zu(Xp,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:ga.noop,onLayoutChange:ga.noop,onWidthChange:ga.noop});var Zp={},vS=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var a=i[o];n.call(r,a[1],a[0])}},t}()}(),Jp=typeof window<"u"&&typeof document<"u"&&window.document===document,Hu=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),vH=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Hu):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),yH=2;function bH(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){vH(i)}function s(){var l=Date.now();if(n){if(l-o<yH)return;r=!0}else n=!0,r=!1,setTimeout(a,t);o=l}return s}var xH=20,_H=["top","right","bottom","left","width","height","size","weight"],SH=typeof MutationObserver<"u",CH=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=bH(this.refresh.bind(this),xH)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Jp||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),SH?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Jp||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=_H.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),yS=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},wa=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Hu},bS=Uu(0,0,0,0);function Vu(e){return parseFloat(e)||0}function xS(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+Vu(i)},0)}function EH(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],a=e["padding-"+i];n[i]=Vu(a)}return n}function PH(e){var t=e.getBBox();return Uu(0,0,t.width,t.height)}function RH(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return bS;var r=wa(e).getComputedStyle(e),o=EH(r),i=o.left+o.right,a=o.top+o.bottom,s=Vu(r.width),l=Vu(r.height);if(r.boxSizing==="border-box"&&(Math.round(s+i)!==t&&(s-=xS(r,"left","right")+i),Math.round(l+a)!==n&&(l-=xS(r,"top","bottom")+a)),!TH(e)){var c=Math.round(s+i)-t,u=Math.round(l+a)-n;Math.abs(c)!==1&&(s-=c),Math.abs(u)!==1&&(l-=u)}return Uu(o.left,o.top,s,l)}var NH=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof wa(e).SVGGraphicsElement}:function(e){return e instanceof wa(e).SVGElement&&typeof e.getBBox=="function"}}();function TH(e){return e===wa(e).document.documentElement}function MH(e){return Jp?NH(e)?PH(e):RH(e):bS}function kH(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(i.prototype);return yS(a,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),a}function Uu(e,t,n,r){return{x:e,y:t,width:n,height:r}}var DH=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Uu(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=MH(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),AH=function(){function e(t,n){var r=kH(n);yS(this,{target:t,contentRect:r})}return e}(),IH=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new vS,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof wa(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new DH(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof wa(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new AH(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),_S=typeof WeakMap<"u"?new WeakMap:new vS,SS=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=CH.getInstance(),r=new IH(t,n,this);_S.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){SS.prototype[e]=function(){var t;return(t=_S.get(this))[e].apply(t,arguments)}});var OH=function(){return typeof Hu.ResizeObserver<"u"?Hu.ResizeObserver:SS}();const jH=Sc(Object.freeze(Object.defineProperty({__proto__:null,default:OH},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(Zp,"__esModule",{value:!0}),Zp.default=UH;var Wu=zH(E),$H=Qp(Co),FH=Qp(jH),LH=Qp(gp);function Qp(e){return e&&e.__esModule?e:{default:e}}function CS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(CS=function(r){return r?n:t})(e)}function zH(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=CS(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function em(){return em=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},em.apply(this,arguments)}function va(e,t,n){return t=BH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BH(e){var t=HH(e,"string");return typeof t=="symbol"?t:String(t)}function HH(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const VH="react-grid-layout";function UH(e){var t;return t=class extends Wu.Component{constructor(){super(...arguments),va(this,"state",{width:1280}),va(this,"elementRef",Wu.createRef()),va(this,"mounted",!1),va(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new FH.default(o=>{if(this.elementRef.current instanceof HTMLElement){const a=o[0].contentRect.width;this.setState({width:a})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?Wu.createElement("div",{className:(0,LH.default)(this.props.className,VH),style:this.props.style,ref:this.elementRef}):Wu.createElement(e,em({innerRef:this.elementRef},o,this.state))}},va(t,"defaultProps",{measureBeforeMount:!1}),va(t,"propTypes",{measureBeforeMount:$H.default.bool}),t}(function(e){e.exports=ll.default,e.exports.utils=Be,e.exports.calculateUtils=Sr,e.exports.Responsive=Fu.default,e.exports.Responsive.utils=di,e.exports.WidthProvider=Zp.default})(C_);var tm=C_.exports;const ES=On(tm),WH=tm.WidthProvider(ES),GH=So.div`
|
|
151
151
|
.react-grid-layout {
|
|
152
152
|
position: relative;
|
|
153
153
|
// transition: height 200ms ease;
|
|
@@ -258,7 +258,7 @@ object-assign
|
|
|
258
258
|
.mi-workspace {
|
|
259
259
|
flex: 1;
|
|
260
260
|
}
|
|
261
|
-
`,eV=()=>{const[e,t]=E.useState([]),[n,r]=E.useState([]),[o,i]=E.useState(!1),{projectMetadata:a}=hp(),{siteBackground:s,setSiteBackground:l}=Nw(),{siteBackgroundColor:c,siteBackgroundImage:u}=Nw(),d=async()=>{i(!0),await qx(a.projectName,a.projectURL),i(!1),await qh(a.projectName,a.projectURL),await Y4(a.projectName);const m=await Bx(a.projectName);t(m.components),r(m.layout);const v=`${window.miDir}/${a.projectName}/src/theme.json`,w=await window.pfs.readFile(v,"utf8"),b=JSON.parse(w),x=b.tailwind,_=b.siteBackground;window.tailwind.config=x,Hx(x),l(_)},f=Vx(a.projectName,u),h=E.useMemo(()=>u?{backgroundImage:u?`url(${f})`:"",backgroundSize:"cover",backgroundRepeat:"no-repeat"}:c?{background:c||""}:{},[s,u,c,f]),p=async()=>{Object.assign(document.documentElement.style,{height:"100%"}),Object.assign(document.body.style,{height:"100%",margin:"0",padding:"0",...h})};return E.useEffect(()=>{!a.projectName&&!a.projectURL||d()},[a.projectName,a.projectURL]),E.useEffect(()=>{p()},[h]),g.jsx("div",{children:g.jsxs(QH,{children:[g.jsx(g8,{isVisible:o}),g.jsx("div",{className:"mi-container",children:g.jsx("div",{className:"mi-workspace",children:g.jsx(PS,{components:e,layout:n})})})]})})},tV=E.forwardRef(({style:e,className:t,onMouseDown:n,onMouseUp:r,onTouchEnd:o,children:i,componentId:a},s)=>{const{selectedComponentId:l}=hp(),c=E.useMemo(()=>l===a,[l]),u=E.Children.toArray(i),d=u.filter(h=>h.key===".$resizableHandle-se"),f=u.filter(h=>h.key!==".$resizableHandle-se");return g.jsxs("div",{style:{...e},className:t+(c?" selected":""),ref:s,onMouseDown:n,onMouseUp:r,onTouchEnd:o,children:[g.jsx("div",{className:"grid-item "+(c?"selected":""),children:f}),d]})});class nV extends E.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}render(){const{hasError:t,error:n}=this.state,{children:r,fallback:o,fallbackProps:i}=this.props;return t&&(this.resetState(),o)?g.jsx(o,{error:n,...i}):r}resetState(){this.state={hasError:!1,error:null}}}const rV=e=>{const{onDragStart:t,onDragStop:n}=lp(),r=i=>{t(e.initialSize),i.dataTransfer.setData("text/plain",""),i.dataTransfer.setData("application/reactgridlayout",JSON.stringify({id:e.id,type:e.type,initialSize:e.initialSize,metadata:e.metadata}))},o=()=>{n()};return g.jsx("div",{className:"w-full h-full flex items-center justify-center",draggable:!0,unselectable:"on",onDragStart:r,onDragEnd:o,children:e.node})},oV={maxReconnectAttempts:5,reconnectInitialDelay:1e3,reconnectBackoffFactor:2},iV=(e,t,n)=>{const{maxReconnectAttempts:r,reconnectInitialDelay:o,reconnectBackoffFactor:i}={...oV,...n},a=E.useRef(null),s=E.useRef(0),l=E.useRef(null),c=E.useRef(!1),u=E.useRef([]),d=E.useRef(t),[f,h]=E.useState("idle"),[p,m]=E.useState(null);E.useEffect(()=>{d.current=t},[t]);const v=E.useCallback(()=>{console.log("WebSocket connected"),h("open"),m(null),s.current=0;const R=[...u.current];u.current=[],R.length>0&&(console.log(`Processing ${R.length} queued messages`),R.forEach(T=>{var M,D;try{(M=a.current)==null||M.send(T)}catch(A){console.error("Error sending queued message:",A),((D=a.current)==null?void 0:D.readyState)===WebSocket.OPEN&&u.current.push(T)}}))},[]),w=E.useCallback(R=>{console.log(`WebSocket closed: code=${R.code}, reason=${R.reason}, wasClean=${R.wasClean}`),h("closed"),l.current&&(clearTimeout(l.current),l.current=null);const T=R.code===1e3;if(!c.current&&!T)if(s.current<r){const M=s.current+1,D=o*Math.pow(i,M-1);console.log(`Attempting WebSocket reconnect ${M}/${r} in ${D}ms...`),h("connecting"),l.current=setTimeout(()=>{a.current=null,_(),l.current=null},D),s.current=M}else console.error(`WebSocket max reconnect attempts (${r}) reached.`),m(new Error(`Maximum reconnection attempts reached (${r})`));else c.current=!1},[r,o,i]),b=E.useCallback(R=>{console.error("WebSocket error:",R);const T=R instanceof ErrorEvent?R.message:"Unknown WebSocket error";m(new Error(T))},[]),x=E.useCallback(R=>{try{const T=JSON.parse(R.data);d.current(T)}catch(T){console.error("Failed to parse WebSocket message:",T,R.data),m(T instanceof Error?T:new Error("Invalid message format"))}},[]),_=E.useCallback(()=>{if(!e){console.log("WebSocket connect skipped: No URL provided");return}if(a.current){const R=a.current.readyState;if(R===WebSocket.OPEN||R===WebSocket.CONNECTING){console.log("WebSocket connect skipped: Already connecting/connected",{readyState:R,status:f});return}a.current=null}l.current&&(clearTimeout(l.current),l.current=null),console.log("Initiating WebSocket connection to:",e),h("connecting"),m(null);try{const R=new WebSocket(e);a.current=R,R.onopen=v,R.onclose=w,R.onerror=b,R.onmessage=x}catch(R){console.error("Failed to create WebSocket:",R),m(R instanceof Error?R:new Error("Failed to create WebSocket")),h("closed")}},[e,v,w,b,x]),C=E.useCallback(()=>{if(console.log("Initiating intentional WebSocket disconnect"),c.current=!0,l.current&&(clearTimeout(l.current),l.current=null),a.current){h("closing");try{a.current.close(1e3,"Client disconnecting")}catch(R){console.error("Error during WebSocket close:",R),h("closed"),a.current=null}}else h("closed");s.current=0},[]),N=E.useCallback(R=>{var D,A;const T=JSON.stringify(R);if(((D=a.current)==null?void 0:D.readyState)===WebSocket.OPEN)try{return(A=a.current)==null||A.send(T),!0}catch(j){return console.error("WebSocket send error:",j),m(j instanceof Error?j:new Error("Failed to send message")),!1}else return console.log("WebSocket not open, queuing message"),u.current.push(T),!0},[]);return E.useEffect(()=>(e?_():f!=="idle"&&f!=="closed"&&C(),()=>{a.current&&C()}),[e,_,C]),{connectionStatus:f,sendMessage:N,lastError:p}};var ml=e=>e.type==="checkbox",hi=e=>e instanceof Date,rn=e=>e==null;const RS=e=>typeof e=="object";var Et=e=>!rn(e)&&!Array.isArray(e)&&RS(e)&&!hi(e),NS=e=>Et(e)&&e.target?ml(e.target)?e.target.checked:e.target.value:e,aV=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,TS=(e,t)=>e.has(aV(t)),sV=e=>{const t=e.constructor&&e.constructor.prototype;return Et(t)&&t.hasOwnProperty("isPrototypeOf")},rm=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function pn(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(rm&&(e instanceof Blob||r))&&(n||Et(e)))if(t=n?[]:{},!n&&!sV(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=pn(e[o]));else return e;return t}var Gu=e=>Array.isArray(e)?e.filter(Boolean):[],Pt=e=>e===void 0,Se=(e,t,n)=>{if(!t||!Et(e))return n;const r=Gu(t.split(/[,[\].]+?/)).reduce((o,i)=>rn(o)?o:o[i],e);return Pt(r)||r===e?Pt(e[t])?n:e[t]:r},Bn=e=>typeof e=="boolean",om=e=>/^\w*$/.test(e),MS=e=>Gu(e.replace(/["|']|\]/g,"").split(/\.|\[/)),lt=(e,t,n)=>{let r=-1;const o=om(t)?[t]:MS(t),i=o.length,a=i-1;for(;++r<i;){const s=o[r];let l=n;if(r!==a){const c=e[s];l=Et(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(s==="__proto__"||s==="constructor"||s==="prototype")return;e[s]=l,e=e[s]}return e};const qu={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Xn={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Xr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},kS=E.createContext(null),Yu=()=>E.useContext(kS),lV=e=>{const{children:t,...n}=e;return E.createElement(kS.Provider,{value:n},t)};var DS=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const a=i;return t._proxyFormState[a]!==Xn.all&&(t._proxyFormState[a]=!r||Xn.all),n&&(n[a]=!0),e[a]}});return o},mn=e=>Et(e)&&!Object.keys(e).length,AS=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return mn(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!r||Xn.all))},gl=e=>Array.isArray(e)?e:[e],IS=(e,t,n)=>!e||!t||e===t||gl(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function im(e){const t=E.useRef(e);t.current=e,E.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function cV(e){const t=Yu(),{control:n=t.control,disabled:r,name:o,exact:i}=e,[a,s]=E.useState(n._formState),l=E.useRef(!0),c=E.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=E.useRef(o);return u.current=o,im({disabled:r,next:d=>l.current&&IS(u.current,d.name,i)&&AS(d,c.current,n._updateFormState)&&s({...n._formState,...d}),subject:n._subjects.state}),E.useEffect(()=>(l.current=!0,c.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),E.useMemo(()=>DS(a,n,c.current,!1),[a,n])}var Rr=e=>typeof e=="string",OS=(e,t,n,r,o)=>Rr(e)?(r&&t.watch.add(e),Se(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),Se(n,i))):(r&&(t.watchAll=!0),n);function uV(e){const t=Yu(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:a}=e,s=E.useRef(r);s.current=r,im({disabled:i,subject:n._subjects.values,next:u=>{IS(s.current,u.name,a)&&c(pn(OS(s.current,n._names,u.values||n._formValues,!1,o)))}});const[l,c]=E.useState(n._getWatch(r,o));return E.useEffect(()=>n._removeUnmounted()),l}function dV(e){const t=Yu(),{name:n,disabled:r,control:o=t.control,shouldUnregister:i}=e,a=TS(o._names.array,n),s=uV({control:o,name:n,defaultValue:Se(o._formValues,n,Se(o._defaultValues,n,e.defaultValue)),exact:!0}),l=cV({control:o,name:n,exact:!0}),c=E.useRef(o.register(n,{...e.rules,value:s,...Bn(e.disabled)?{disabled:e.disabled}:{}})),u=E.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Se(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!Se(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Se(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Se(l.validatingFields,n)},error:{enumerable:!0,get:()=>Se(l.errors,n)}}),[l,n]),d=E.useMemo(()=>({name:n,value:s,...Bn(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:f=>c.current.onChange({target:{value:NS(f),name:n},type:qu.CHANGE}),onBlur:()=>c.current.onBlur({target:{value:Se(o._formValues,n),name:n},type:qu.BLUR}),ref:f=>{const h=Se(o._fields,n);h&&f&&(h._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:p=>f.setCustomValidity(p),reportValidity:()=>f.reportValidity()})}}),[n,o._formValues,r,l.disabled,s,o._fields]);return E.useEffect(()=>{const f=o._options.shouldUnregister||i,h=(p,m)=>{const v=Se(o._fields,p);v&&v._f&&(v._f.mount=m)};if(h(n,!0),f){const p=pn(Se(o._options.defaultValues,n));lt(o._defaultValues,n,p),Pt(Se(o._formValues,n))&<(o._formValues,n,p)}return!a&&o.register(n),()=>{(a?f&&!o._state.action:f)?o.unregister(n):h(n,!1)}},[n,o,a,i]),E.useEffect(()=>{o._updateDisabledField({disabled:r,fields:o._fields,name:n})},[r,n,o]),E.useMemo(()=>({field:d,formState:l,fieldState:u}),[d,l,u])}const fV=e=>e.render(dV(e));var hV=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},jS=e=>({isOnSubmit:!e||e===Xn.onSubmit,isOnBlur:e===Xn.onBlur,isOnChange:e===Xn.onChange,isOnAll:e===Xn.all,isOnTouch:e===Xn.onTouched}),$S=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const wl=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=Se(e,o);if(i){const{_f:a,...s}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],o)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(wl(s,t))break}else if(Et(s)&&wl(s,t))break}}};var pV=(e,t,n)=>{const r=gl(Se(e,n));return lt(r,"root",t[n]),lt(e,n,r),e},am=e=>e.type==="file",Nr=e=>typeof e=="function",Ku=e=>{if(!rm)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Xu=e=>Rr(e),sm=e=>e.type==="radio",Zu=e=>e instanceof RegExp;const FS={value:!1,isValid:!1},LS={value:!0,isValid:!0};var zS=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Pt(e[0].attributes.value)?Pt(e[0].value)||e[0].value===""?LS:{value:e[0].value,isValid:!0}:LS:FS}return FS};const BS={isValid:!1,value:null};var HS=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,BS):BS;function VS(e,t,n="validate"){if(Xu(e)||Array.isArray(e)&&e.every(Xu)||Bn(e)&&!e)return{type:n,message:Xu(e)?e:"",ref:t}}var ya=e=>Et(e)&&!Zu(e)?e:{value:e,message:""},US=async(e,t,n,r,o,i)=>{const{ref:a,refs:s,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:h,validate:p,name:m,valueAsNumber:v,mount:w}=e._f,b=Se(n,m);if(!w||t.has(m))return{};const x=s?s[0]:a,_=j=>{o&&x.reportValidity&&(x.setCustomValidity(Bn(j)?"":j||""),x.reportValidity())},C={},N=sm(a),R=ml(a),T=N||R,M=(v||am(a))&&Pt(a.value)&&Pt(b)||Ku(a)&&a.value===""||b===""||Array.isArray(b)&&!b.length,D=hV.bind(null,m,r,C),A=(j,$,W,re=Xr.maxLength,Y=Xr.minLength)=>{const Z=j?$:W;C[m]={type:j?re:Y,message:Z,ref:a,...D(j?re:Y,Z)}};if(i?!Array.isArray(b)||!b.length:l&&(!T&&(M||rn(b))||Bn(b)&&!b||R&&!zS(s).isValid||N&&!HS(s).isValid)){const{value:j,message:$}=Xu(l)?{value:!!l,message:l}:ya(l);if(j&&(C[m]={type:Xr.required,message:$,ref:x,...D(Xr.required,$)},!r))return _($),C}if(!M&&(!rn(d)||!rn(f))){let j,$;const W=ya(f),re=ya(d);if(!rn(b)&&!isNaN(b)){const Y=a.valueAsNumber||b&&+b;rn(W.value)||(j=Y>W.value),rn(re.value)||($=Y<re.value)}else{const Y=a.valueAsDate||new Date(b),Z=ee=>new Date(new Date().toDateString()+" "+ee),B=a.type=="time",oe=a.type=="week";Rr(W.value)&&b&&(j=B?Z(b)>Z(W.value):oe?b>W.value:Y>new Date(W.value)),Rr(re.value)&&b&&($=B?Z(b)<Z(re.value):oe?b<re.value:Y<new Date(re.value))}if((j||$)&&(A(!!j,W.message,re.message,Xr.max,Xr.min),!r))return _(C[m].message),C}if((c||u)&&!M&&(Rr(b)||i&&Array.isArray(b))){const j=ya(c),$=ya(u),W=!rn(j.value)&&b.length>+j.value,re=!rn($.value)&&b.length<+$.value;if((W||re)&&(A(W,j.message,$.message),!r))return _(C[m].message),C}if(h&&!M&&Rr(b)){const{value:j,message:$}=ya(h);if(Zu(j)&&!b.match(j)&&(C[m]={type:Xr.pattern,message:$,ref:a,...D(Xr.pattern,$)},!r))return _($),C}if(p){if(Nr(p)){const j=await p(b,n),$=VS(j,x);if($&&(C[m]={...$,...D(Xr.validate,$.message)},!r))return _($.message),C}else if(Et(p)){let j={};for(const $ in p){if(!mn(j)&&!r)break;const W=VS(await p[$](b,n),x,$);W&&(j={...W,...D($,W.message)},_(W.message),r&&(C[m]=j))}if(!mn(j)&&(C[m]={ref:x,...j},!r))return C}}return _(!0),C};function mV(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Pt(e)?r++:e[t[r++]];return e}function gV(e){for(const t in e)if(e.hasOwnProperty(t)&&!Pt(e[t]))return!1;return!0}function kt(e,t){const n=Array.isArray(t)?t:om(t)?[t]:MS(t),r=n.length===1?e:mV(e,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(Et(r)&&mn(r)||Array.isArray(r)&&gV(r))&&kt(e,n.slice(0,-1)),e}var lm=()=>{let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}},cm=e=>rn(e)||!RS(e);function Ro(e,t){if(cm(e)||cm(t))return e===t;if(hi(e)&&hi(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const a=t[o];if(hi(i)&&hi(a)||Et(i)&&Et(a)||Array.isArray(i)&&Array.isArray(a)?!Ro(i,a):i!==a)return!1}}return!0}var WS=e=>e.type==="select-multiple",wV=e=>sm(e)||ml(e),um=e=>Ku(e)&&e.isConnected,GS=e=>{for(const t in e)if(Nr(e[t]))return!0;return!1};function Ju(e,t={}){const n=Array.isArray(e);if(Et(e)||n)for(const r in e)Array.isArray(e[r])||Et(e[r])&&!GS(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Ju(e[r],t[r])):rn(e[r])||(t[r]=!0);return t}function qS(e,t,n){const r=Array.isArray(e);if(Et(e)||r)for(const o in e)Array.isArray(e[o])||Et(e[o])&&!GS(e[o])?Pt(t)||cm(n[o])?n[o]=Array.isArray(e[o])?Ju(e[o],[]):{...Ju(e[o])}:qS(e[o],rn(t)?{}:t[o],n[o]):n[o]=!Ro(e[o],t[o]);return n}var vl=(e,t)=>qS(e,t,Ju(t)),YS=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Pt(e)?e:t?e===""?NaN:e&&+e:n&&Rr(e)?new Date(e):r?r(e):e;function dm(e){const t=e.ref;return am(t)?t.files:sm(t)?HS(e.refs).value:WS(t)?[...t.selectedOptions].map(({value:n})=>n):ml(t)?zS(e.refs).value:YS(Pt(t.value)?e.ref.value:t.value,e)}var vV=(e,t,n,r)=>{const o={};for(const i of e){const a=Se(t,i);a&<(o,i,a._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},yl=e=>Pt(e)?e:Zu(e)?e.source:Et(e)?Zu(e.value)?e.value.source:e.value:e;const KS="AsyncFunction";var yV=e=>!!e&&!!e.validate&&!!(Nr(e.validate)&&e.validate.constructor.name===KS||Et(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===KS)),bV=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function XS(e,t,n){const r=Se(e,n);if(r||om(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),a=Se(t,i),s=Se(e,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(s&&s.type)return{name:i,error:s};o.pop()}return{name:n}}var xV=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,_V=(e,t)=>!Gu(Se(e,t)).length&&kt(e,t);const SV={mode:Xn.onSubmit,reValidateMode:Xn.onChange,shouldFocusError:!0};function CV(e={}){let t={...SV,...e},n={submitCount:0,isDirty:!1,isLoading:Nr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Et(t.defaultValues)||Et(t.values)?pn(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:pn(o),a={action:!1,mount:!1,watch:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:lm(),array:lm(),state:lm()},f=jS(t.mode),h=jS(t.reValidateMode),p=t.criteriaMode===Xn.all,m=O=>V=>{clearTimeout(c),c=setTimeout(O,V)},v=async O=>{if(!t.disabled&&(u.isValid||O)){const V=t.resolver?mn((await T()).errors):await D(r,!0);V!==n.isValid&&d.state.next({isValid:V})}},w=(O,V)=>{!t.disabled&&(u.isValidating||u.validatingFields)&&((O||Array.from(s.mount)).forEach(J=>{J&&(V?lt(n.validatingFields,J,V):kt(n.validatingFields,J))}),d.state.next({validatingFields:n.validatingFields,isValidating:!mn(n.validatingFields)}))},b=(O,V=[],J,we,pe=!0,fe=!0)=>{if(we&&J&&!t.disabled){if(a.action=!0,fe&&Array.isArray(Se(r,O))){const ge=J(Se(r,O),we.argA,we.argB);pe&<(r,O,ge)}if(fe&&Array.isArray(Se(n.errors,O))){const ge=J(Se(n.errors,O),we.argA,we.argB);pe&<(n.errors,O,ge),_V(n.errors,O)}if(u.touchedFields&&fe&&Array.isArray(Se(n.touchedFields,O))){const ge=J(Se(n.touchedFields,O),we.argA,we.argB);pe&<(n.touchedFields,O,ge)}u.dirtyFields&&(n.dirtyFields=vl(o,i)),d.state.next({name:O,isDirty:j(O,V),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else lt(i,O,V)},x=(O,V)=>{lt(n.errors,O,V),d.state.next({errors:n.errors})},_=O=>{n.errors=O,d.state.next({errors:n.errors,isValid:!1})},C=(O,V,J,we)=>{const pe=Se(r,O);if(pe){const fe=Se(i,O,Pt(J)?Se(o,O):J);Pt(fe)||we&&we.defaultChecked||V?lt(i,O,V?fe:dm(pe._f)):re(O,fe),a.mount&&v()}},N=(O,V,J,we,pe)=>{let fe=!1,ge=!1;const _e={name:O};if(!t.disabled){const Xe=!!(Se(r,O)&&Se(r,O)._f&&Se(r,O)._f.disabled);if(!J||we){u.isDirty&&(ge=n.isDirty,n.isDirty=_e.isDirty=j(),fe=ge!==_e.isDirty);const k=Xe||Ro(Se(o,O),V);ge=!!(!Xe&&Se(n.dirtyFields,O)),k||Xe?kt(n.dirtyFields,O):lt(n.dirtyFields,O,!0),_e.dirtyFields=n.dirtyFields,fe=fe||u.dirtyFields&&ge!==!k}if(J){const k=Se(n.touchedFields,O);k||(lt(n.touchedFields,O,J),_e.touchedFields=n.touchedFields,fe=fe||u.touchedFields&&k!==J)}fe&&pe&&d.state.next(_e)}return fe?_e:{}},R=(O,V,J,we)=>{const pe=Se(n.errors,O),fe=u.isValid&&Bn(V)&&n.isValid!==V;if(t.delayError&&J?(l=m(()=>x(O,J)),l(t.delayError)):(clearTimeout(c),l=null,J?lt(n.errors,O,J):kt(n.errors,O)),(J?!Ro(pe,J):pe)||!mn(we)||fe){const ge={...we,...fe&&Bn(V)?{isValid:V}:{},errors:n.errors,name:O};n={...n,...ge},d.state.next(ge)}},T=async O=>{w(O,!0);const V=await t.resolver(i,t.context,vV(O||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(O),V},M=async O=>{const{errors:V}=await T(O);if(O)for(const J of O){const we=Se(V,J);we?lt(n.errors,J,we):kt(n.errors,J)}else n.errors=V;return V},D=async(O,V,J={valid:!0})=>{for(const we in O){const pe=O[we];if(pe){const{_f:fe,...ge}=pe;if(fe){const _e=s.array.has(fe.name),Xe=pe._f&&yV(pe._f);Xe&&u.validatingFields&&w([we],!0);const k=await US(pe,s.disabled,i,p,t.shouldUseNativeValidation&&!V,_e);if(Xe&&u.validatingFields&&w([we]),k[fe.name]&&(J.valid=!1,V))break;!V&&(Se(k,fe.name)?_e?pV(n.errors,k,fe.name):lt(n.errors,fe.name,k[fe.name]):kt(n.errors,fe.name))}!mn(ge)&&await D(ge,V,J)}}return J.valid},A=()=>{for(const O of s.unMount){const V=Se(r,O);V&&(V._f.refs?V._f.refs.every(J=>!um(J)):!um(V._f.ref))&&L(O)}s.unMount=new Set},j=(O,V)=>!t.disabled&&(O&&V&<(i,O,V),!Ro(ne(),o)),$=(O,V,J)=>OS(O,s,{...a.mount?i:Pt(V)?o:Rr(O)?{[O]:V}:V},J,V),W=O=>Gu(Se(a.mount?i:o,O,t.shouldUnregister?Se(o,O,[]):[])),re=(O,V,J={})=>{const we=Se(r,O);let pe=V;if(we){const fe=we._f;fe&&(!fe.disabled&<(i,O,YS(V,fe)),pe=Ku(fe.ref)&&rn(V)?"":V,WS(fe.ref)?[...fe.ref.options].forEach(ge=>ge.selected=pe.includes(ge.value)):fe.refs?ml(fe.ref)?fe.refs.length>1?fe.refs.forEach(ge=>(!ge.defaultChecked||!ge.disabled)&&(ge.checked=Array.isArray(pe)?!!pe.find(_e=>_e===ge.value):pe===ge.value)):fe.refs[0]&&(fe.refs[0].checked=!!pe):fe.refs.forEach(ge=>ge.checked=ge.value===pe):am(fe.ref)?fe.ref.value="":(fe.ref.value=pe,fe.ref.type||d.values.next({name:O,values:{...i}})))}(J.shouldDirty||J.shouldTouch)&&N(O,pe,J.shouldTouch,J.shouldDirty,!0),J.shouldValidate&&ee(O)},Y=(O,V,J)=>{for(const we in V){const pe=V[we],fe=`${O}.${we}`,ge=Se(r,fe);(s.array.has(O)||Et(pe)||ge&&!ge._f)&&!hi(pe)?Y(fe,pe,J):re(fe,pe,J)}},Z=(O,V,J={})=>{const we=Se(r,O),pe=s.array.has(O),fe=pn(V);lt(i,O,fe),pe?(d.array.next({name:O,values:{...i}}),(u.isDirty||u.dirtyFields)&&J.shouldDirty&&d.state.next({name:O,dirtyFields:vl(o,i),isDirty:j(O,fe)})):we&&!we._f&&!rn(fe)?Y(O,fe,J):re(O,fe,J),$S(O,s)&&d.state.next({...n}),d.values.next({name:a.mount?O:void 0,values:{...i}})},B=async O=>{a.mount=!0;const V=O.target;let J=V.name,we=!0;const pe=Se(r,J),fe=()=>V.type?dm(pe._f):NS(O),ge=_e=>{we=Number.isNaN(_e)||hi(_e)&&isNaN(_e.getTime())||Ro(_e,Se(i,J,_e))};if(pe){let _e,Xe;const k=fe(),S=O.type===qu.BLUR||O.type===qu.FOCUS_OUT,P=!bV(pe._f)&&!t.resolver&&!Se(n.errors,J)&&!pe._f.deps||xV(S,Se(n.touchedFields,J),n.isSubmitted,h,f),I=$S(J,s,S);lt(i,J,k),S?(pe._f.onBlur&&pe._f.onBlur(O),l&&l(0)):pe._f.onChange&&pe._f.onChange(O);const U=N(J,k,S,!1),te=!mn(U)||I;if(!S&&d.values.next({name:J,type:O.type,values:{...i}}),P)return u.isValid&&(t.mode==="onBlur"&&S?v():S||v()),te&&d.state.next({name:J,...I?{}:U});if(!S&&I&&d.state.next({...n}),t.resolver){const{errors:he}=await T([J]);if(ge(k),we){const Oe=XS(n.errors,r,J),Qe=XS(he,r,Oe.name||J);_e=Qe.error,J=Qe.name,Xe=mn(he)}}else w([J],!0),_e=(await US(pe,s.disabled,i,p,t.shouldUseNativeValidation))[J],w([J]),ge(k),we&&(_e?Xe=!1:u.isValid&&(Xe=await D(r,!0)));we&&(pe._f.deps&&ee(pe._f.deps),R(J,Xe,_e,U))}},oe=(O,V)=>{if(Se(n.errors,V)&&O.focus)return O.focus(),1},ee=async(O,V={})=>{let J,we;const pe=gl(O);if(t.resolver){const fe=await M(Pt(O)?O:pe);J=mn(fe),we=O?!pe.some(ge=>Se(fe,ge)):J}else O?(we=(await Promise.all(pe.map(async fe=>{const ge=Se(r,fe);return await D(ge&&ge._f?{[fe]:ge}:ge)}))).every(Boolean),!(!we&&!n.isValid)&&v()):we=J=await D(r);return d.state.next({...!Rr(O)||u.isValid&&J!==n.isValid?{}:{name:O},...t.resolver||!O?{isValid:J}:{},errors:n.errors}),V.shouldFocus&&!we&&wl(r,oe,O?pe:s.mount),we},ne=O=>{const V={...a.mount?i:o};return Pt(O)?V:Rr(O)?Se(V,O):O.map(J=>Se(V,J))},G=(O,V)=>({invalid:!!Se((V||n).errors,O),isDirty:!!Se((V||n).dirtyFields,O),error:Se((V||n).errors,O),isValidating:!!Se(n.validatingFields,O),isTouched:!!Se((V||n).touchedFields,O)}),F=O=>{O&&gl(O).forEach(V=>kt(n.errors,V)),d.state.next({errors:O?n.errors:{}})},q=(O,V,J)=>{const we=(Se(r,O,{_f:{}})._f||{}).ref,pe=Se(n.errors,O)||{},{ref:fe,message:ge,type:_e,...Xe}=pe;lt(n.errors,O,{...Xe,...V,ref:we}),d.state.next({name:O,errors:n.errors,isValid:!1}),J&&J.shouldFocus&&we&&we.focus&&we.focus()},ce=(O,V)=>Nr(O)?d.values.subscribe({next:J=>O($(void 0,V),J)}):$(O,V,!0),L=(O,V={})=>{for(const J of O?gl(O):s.mount)s.mount.delete(J),s.array.delete(J),V.keepValue||(kt(r,J),kt(i,J)),!V.keepError&&kt(n.errors,J),!V.keepDirty&&kt(n.dirtyFields,J),!V.keepTouched&&kt(n.touchedFields,J),!V.keepIsValidating&&kt(n.validatingFields,J),!t.shouldUnregister&&!V.keepDefaultValue&&kt(o,J);d.values.next({values:{...i}}),d.state.next({...n,...V.keepDirty?{isDirty:j()}:{}}),!V.keepIsValid&&v()},K=({disabled:O,name:V,field:J,fields:we})=>{(Bn(O)&&a.mount||O||s.disabled.has(V))&&(O?s.disabled.add(V):s.disabled.delete(V),N(V,dm(J?J._f:Se(we,V)._f),!1,!1,!0))},z=(O,V={})=>{let J=Se(r,O);const we=Bn(V.disabled)||Bn(t.disabled);return lt(r,O,{...J||{},_f:{...J&&J._f?J._f:{ref:{name:O}},name:O,mount:!0,...V}}),s.mount.add(O),J?K({field:J,disabled:Bn(V.disabled)?V.disabled:t.disabled,name:O}):C(O,!0,V.value),{...we?{disabled:V.disabled||t.disabled}:{},...t.progressive?{required:!!V.required,min:yl(V.min),max:yl(V.max),minLength:yl(V.minLength),maxLength:yl(V.maxLength),pattern:yl(V.pattern)}:{},name:O,onChange:B,onBlur:B,ref:pe=>{if(pe){z(O,V),J=Se(r,O);const fe=Pt(pe.value)&&pe.querySelectorAll&&pe.querySelectorAll("input,select,textarea")[0]||pe,ge=wV(fe),_e=J._f.refs||[];if(ge?_e.find(Xe=>Xe===fe):fe===J._f.ref)return;lt(r,O,{_f:{...J._f,...ge?{refs:[..._e.filter(um),fe,...Array.isArray(Se(o,O))?[{}]:[]],ref:{type:fe.type,name:O}}:{ref:fe}}}),C(O,!1,void 0,fe)}else J=Se(r,O,{}),J._f&&(J._f.mount=!1),(t.shouldUnregister||V.shouldUnregister)&&!(TS(s.array,O)&&a.action)&&s.unMount.add(O)}}},ie=()=>t.shouldFocusError&&wl(r,oe,s.mount),le=O=>{Bn(O)&&(d.state.next({disabled:O}),wl(r,(V,J)=>{const we=Se(r,J);we&&(V.disabled=we._f.disabled||O,Array.isArray(we._f.refs)&&we._f.refs.forEach(pe=>{pe.disabled=we._f.disabled||O}))},0,!1))},ae=(O,V)=>async J=>{let we;J&&(J.preventDefault&&J.preventDefault(),J.persist&&J.persist());let pe=pn(i);if(s.disabled.size)for(const fe of s.disabled)lt(pe,fe,void 0);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:fe,values:ge}=await T();n.errors=fe,pe=ge}else await D(r);if(kt(n.errors,"root"),mn(n.errors)){d.state.next({errors:{}});try{await O(pe,J)}catch(fe){we=fe}}else V&&await V({...n.errors},J),ie(),setTimeout(ie);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:mn(n.errors)&&!we,submitCount:n.submitCount+1,errors:n.errors}),we)throw we},H=(O,V={})=>{Se(r,O)&&(Pt(V.defaultValue)?Z(O,pn(Se(o,O))):(Z(O,V.defaultValue),lt(o,O,pn(V.defaultValue))),V.keepTouched||kt(n.touchedFields,O),V.keepDirty||(kt(n.dirtyFields,O),n.isDirty=V.defaultValue?j(O,pn(Se(o,O))):j()),V.keepError||(kt(n.errors,O),u.isValid&&v()),d.state.next({...n}))},ue=(O,V={})=>{const J=O?pn(O):o,we=pn(J),pe=mn(O),fe=pe?o:we;if(V.keepDefaultValues||(o=J),!V.keepValues){if(V.keepDirtyValues){const ge=new Set([...s.mount,...Object.keys(vl(o,i))]);for(const _e of Array.from(ge))Se(n.dirtyFields,_e)?lt(fe,_e,Se(i,_e)):Z(_e,Se(fe,_e))}else{if(rm&&Pt(O))for(const ge of s.mount){const _e=Se(r,ge);if(_e&&_e._f){const Xe=Array.isArray(_e._f.refs)?_e._f.refs[0]:_e._f.ref;if(Ku(Xe)){const k=Xe.closest("form");if(k){k.reset();break}}}}r={}}i=t.shouldUnregister?V.keepDefaultValues?pn(o):{}:pn(fe),d.array.next({values:{...fe}}),d.values.next({values:{...fe}})}s={mount:V.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!V.keepIsValid||!!V.keepDirtyValues,a.watch=!!t.shouldUnregister,d.state.next({submitCount:V.keepSubmitCount?n.submitCount:0,isDirty:pe?!1:V.keepDirty?n.isDirty:!!(V.keepDefaultValues&&!Ro(O,o)),isSubmitted:V.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:pe?{}:V.keepDirtyValues?V.keepDefaultValues&&i?vl(o,i):n.dirtyFields:V.keepDefaultValues&&O?vl(o,O):V.keepDirty?n.dirtyFields:{},touchedFields:V.keepTouched?n.touchedFields:{},errors:V.keepErrors?n.errors:{},isSubmitSuccessful:V.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},se=(O,V)=>ue(Nr(O)?O(i):O,V);return{control:{register:z,unregister:L,getFieldState:G,handleSubmit:ae,setError:q,_executeSchema:T,_getWatch:$,_getDirty:j,_updateValid:v,_removeUnmounted:A,_updateFieldArray:b,_updateDisabledField:K,_getFieldArray:W,_reset:ue,_resetDefaultValues:()=>Nr(t.defaultValues)&&t.defaultValues().then(O=>{se(O,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:O=>{n={...n,...O}},_disableForm:le,_subjects:d,_proxyFormState:u,_setErrors:_,get _fields(){return r},get _formValues(){return i},get _state(){return a},set _state(O){a=O},get _defaultValues(){return o},get _names(){return s},set _names(O){s=O},get _formState(){return n},set _formState(O){n=O},get _options(){return t},set _options(O){t={...t,...O}}},trigger:ee,register:z,handleSubmit:ae,watch:ce,setValue:Z,getValues:ne,reset:se,resetField:H,clearErrors:F,unregister:L,setError:q,setFocus:(O,V={})=>{const J=Se(r,O),we=J&&J._f;if(we){const pe=we.refs?we.refs[0]:we.ref;pe.focus&&(pe.focus(),V.shouldSelect&&Nr(pe.select)&&pe.select())}},getFieldState:G}}function EV(e={}){const t=E.useRef(void 0),n=E.useRef(void 0),[r,o]=E.useState({isDirty:!1,isValidating:!1,isLoading:Nr(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Nr(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...CV(e),formState:r});const i=t.current.control;return i._options=e,im({subject:i._subjects.state,next:a=>{AS(a,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),E.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),E.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==r.isDirty&&i._subjects.state.next({isDirty:a})}},[i,r.isDirty]),E.useEffect(()=>{e.values&&!Ro(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values,o(a=>({...a}))):i._resetDefaultValues()},[e.values,i]),E.useEffect(()=>{e.errors&&i._setErrors(e.errors)},[e.errors,i]),E.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),E.useEffect(()=>{e.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})},[e.shouldUnregister,i]),t.current.formState=DS(r,i),t.current}function ZS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function bl(...e){return t=>{let n=!1;const r=e.map(o=>{const i=ZS(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():ZS(e[o],null)}}}}function Me(...e){return y.useCallback(bl(...e),e)}var Zn=y.forwardRef((e,t)=>{const{children:n,...r}=e,o=y.Children.toArray(n),i=o.find(PV);if(i){const a=i.props.children,s=o.map(l=>l===i?y.Children.count(a)>1?y.Children.only(null):y.isValidElement(a)?a.props.children:null:l);return g.jsx(fm,{...r,ref:t,children:y.isValidElement(a)?y.cloneElement(a,void 0,s):null})}return g.jsx(fm,{...r,ref:t,children:n})});Zn.displayName="Slot";var fm=y.forwardRef((e,t)=>{const{children:n,...r}=e;if(y.isValidElement(n)){const o=NV(n),i=RV(r,n.props);return n.type!==y.Fragment&&(i.ref=t?bl(t,o):o),y.cloneElement(n,i)}return y.Children.count(n)>1?y.Children.only(null):null});fm.displayName="SlotClone";var Qu=({children:e})=>g.jsx(g.Fragment,{children:e});function PV(e){return y.isValidElement(e)&&e.type===Qu}function RV(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function NV(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)}var TV=Zn;const MV=Object.freeze(Object.defineProperty({__proto__:null,Root:TV,Slot:Zn,Slottable:Qu},Symbol.toStringTag,{value:"Module"}));var kV=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],be=kV.reduce((e,t)=>{const n=y.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?Zn:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ed(e,t){e&&xc.flushSync(()=>e.dispatchEvent(t))}var DV="VisuallyHidden",hm=y.forwardRef((e,t)=>g.jsx(be.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}}));hm.displayName=DV;var JS=hm;function AV(e,t){const n=y.createContext(t),r=i=>{const{children:a,...s}=i,l=y.useMemo(()=>s,Object.values(s));return g.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function o(i){const a=y.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function ct(e,t=[]){let n=[];function r(i,a){const s=y.createContext(a),l=n.length;n=[...n,a];const c=d=>{var w;const{scope:f,children:h,...p}=d,m=((w=f==null?void 0:f[e])==null?void 0:w[l])||s,v=y.useMemo(()=>p,Object.values(p));return g.jsx(m.Provider,{value:v,children:h})};c.displayName=i+"Provider";function u(d,f){var m;const h=((m=f==null?void 0:f[e])==null?void 0:m[l])||s,p=y.useContext(h);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(a=>y.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return y.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,IV(o,...t)]}function IV(...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(i){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...s,...d}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function No(e){const t=e+"CollectionProvider",[n,r]=ct(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:p,children:m}=h,v=E.useRef(null),w=E.useRef(new Map).current;return g.jsx(o,{scope:p,itemMap:w,collectionRef:v,children:m})};a.displayName=t;const s=e+"CollectionSlot",l=E.forwardRef((h,p)=>{const{scope:m,children:v}=h,w=i(s,m),b=Me(p,w.collectionRef);return g.jsx(Zn,{ref:b,children:v})});l.displayName=s;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=E.forwardRef((h,p)=>{const{scope:m,children:v,...w}=h,b=E.useRef(null),x=Me(p,b),_=i(c,m);return E.useEffect(()=>(_.itemMap.set(b,{ref:b,...w}),()=>void _.itemMap.delete(b))),g.jsx(Zn,{[u]:"",ref:x,children:v})});d.displayName=c;function f(h){const p=i(e+"CollectionConsumer",h);return E.useCallback(()=>{const v=p.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((_,C)=>w.indexOf(_.ref.current)-w.indexOf(C.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},f,r]}function de(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 ot(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function dt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=OV({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=ot(n),l=y.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function OV({defaultProp:e,onChange:t}){const n=y.useState(e),[r]=n,o=y.useRef(r),i=ot(t);return y.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var xt=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{};function jV(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var gt=e=>{const{present:t,children:n}=e,r=$V(t),o=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),i=Me(r.ref,FV(o));return typeof n=="function"||r.isPresent?y.cloneElement(o,{ref:i}):null};gt.displayName="Presence";function $V(e){const[t,n]=y.useState(),r=y.useRef({}),o=y.useRef(e),i=y.useRef("none"),a=e?"mounted":"unmounted",[s,l]=jV(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=td(r.current);i.current=s==="mounted"?c:"none"},[s]),xt(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,h=td(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]),xt(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const m=td(r.current).includes(h.animationName);if(h.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=h=>{h.target===t&&(i.current=td(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:y.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function td(e){return(e==null?void 0:e.animationName)||"none"}function FV(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)}var LV=y.useId||(()=>{}),zV=0;function Rt(e){const[t,n]=y.useState(LV());return xt(()=>{e||n(r=>r??String(zV++))},[e]),e||(t?`radix-${t}`:"")}var pm="Collapsible",[BV,QS]=ct(pm),[HV,mm]=BV(pm),e1=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:a,...s}=e,[l=!1,c]=dt({prop:r,defaultProp:o,onChange:a});return g.jsx(HV,{scope:n,disabled:i,contentId:Rt(),open:l,onOpenToggle:y.useCallback(()=>c(u=>!u),[c]),children:g.jsx(be.div,{"data-state":ym(l),"data-disabled":i?"":void 0,...s,ref:t})})});e1.displayName=pm;var t1="CollapsibleTrigger",gm=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=mm(t1,n);return g.jsx(be.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ym(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:de(e.onClick,o.onOpenToggle)})});gm.displayName=t1;var wm="CollapsibleContent",vm=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=mm(wm,e.__scopeCollapsible);return g.jsx(gt,{present:n||o.open,children:({present:i})=>g.jsx(VV,{...r,ref:t,present:i})})});vm.displayName=wm;var VV=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,a=mm(wm,n),[s,l]=y.useState(r),c=y.useRef(null),u=Me(t,c),d=y.useRef(0),f=d.current,h=y.useRef(0),p=h.current,m=a.open||s,v=y.useRef(m),w=y.useRef(void 0);return y.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),xt(()=>{const b=c.current;if(b){w.current=w.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const x=b.getBoundingClientRect();d.current=x.height,h.current=x.width,v.current||(b.style.transitionDuration=w.current.transitionDuration,b.style.animationName=w.current.animationName),l(r)}},[a.open,r]),g.jsx(be.div,{"data-state":ym(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!m,...i,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style},children:m&&o})});function ym(e){return e?"open":"closed"}var n1=e1,UV=gm,WV=vm,GV=y.createContext(void 0);function Jn(e){const t=y.useContext(GV);return e||t||"ltr"}var Zr="Accordion",qV=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[bm,YV,KV]=No(Zr),[nd,Qre]=ct(Zr,[KV,QS]),xm=QS(),r1=E.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return g.jsx(bm.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?g.jsx(QV,{...i,ref:t}):g.jsx(JV,{...o,ref:t})})});r1.displayName=Zr;var[o1,XV]=nd(Zr),[i1,ZV]=nd(Zr,{collapsible:!1}),JV=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...a}=e,[s,l]=dt({prop:n,defaultProp:r,onChange:o});return g.jsx(o1,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:l,onItemClose:E.useCallback(()=>i&&l(""),[i,l]),children:g.jsx(i1,{scope:e.__scopeAccordion,collapsible:i,children:g.jsx(a1,{...a,ref:t})})})}),QV=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a=[],s]=dt({prop:n,defaultProp:r,onChange:o}),l=E.useCallback(u=>s((d=[])=>[...d,u]),[s]),c=E.useCallback(u=>s((d=[])=>d.filter(f=>f!==u)),[s]);return g.jsx(o1,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:c,children:g.jsx(i1,{scope:e.__scopeAccordion,collapsible:!0,children:g.jsx(a1,{...i,ref:t})})})}),[eU,rd]=nd(Zr),a1=E.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...a}=e,s=E.useRef(null),l=Me(s,t),c=YV(n),d=Jn(o)==="ltr",f=de(e.onKeyDown,h=>{var T;if(!qV.includes(h.key))return;const p=h.target,m=c().filter(M=>{var D;return!((D=M.ref.current)!=null&&D.disabled)}),v=m.findIndex(M=>M.ref.current===p),w=m.length;if(v===-1)return;h.preventDefault();let b=v;const x=0,_=w-1,C=()=>{b=v+1,b>_&&(b=x)},N=()=>{b=v-1,b<x&&(b=_)};switch(h.key){case"Home":b=x;break;case"End":b=_;break;case"ArrowRight":i==="horizontal"&&(d?C():N());break;case"ArrowDown":i==="vertical"&&C();break;case"ArrowLeft":i==="horizontal"&&(d?N():C());break;case"ArrowUp":i==="vertical"&&N();break}const R=b%w;(T=m[R].ref.current)==null||T.focus()});return g.jsx(eU,{scope:n,disabled:r,direction:o,orientation:i,children:g.jsx(bm.Slot,{scope:n,children:g.jsx(be.div,{...a,"data-orientation":i,ref:l,onKeyDown:r?void 0:f})})})}),od="AccordionItem",[tU,_m]=nd(od),s1=E.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=rd(od,n),a=XV(od,n),s=xm(n),l=Rt(),c=r&&a.value.includes(r)||!1,u=i.disabled||e.disabled;return g.jsx(tU,{scope:n,open:c,disabled:u,triggerId:l,children:g.jsx(n1,{"data-orientation":i.orientation,"data-state":h1(c),...s,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?a.onItemOpen(r):a.onItemClose(r)}})})});s1.displayName=od;var l1="AccordionHeader",c1=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=rd(Zr,n),i=_m(l1,n);return g.jsx(be.h3,{"data-orientation":o.orientation,"data-state":h1(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});c1.displayName=l1;var Sm="AccordionTrigger",u1=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=rd(Zr,n),i=_m(Sm,n),a=ZV(Sm,n),s=xm(n);return g.jsx(bm.ItemSlot,{scope:n,children:g.jsx(UV,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...s,...r,ref:t})})});u1.displayName=Sm;var d1="AccordionContent",f1=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=rd(Zr,n),i=_m(d1,n),a=xm(n);return g.jsx(WV,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation,...a,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});f1.displayName=d1;function h1(e){return e?"open":"closed"}var nU=r1,rU=s1,oU=c1,iU=u1,aU=f1;function sU(e,t=globalThis==null?void 0:globalThis.document){const n=ot(e);y.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 lU="DismissableLayer",Cm="dismissableLayer.update",cU="dismissableLayer.pointerDownOutside",uU="dismissableLayer.focusOutside",p1,m1=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),To=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=y.useContext(m1),[u,d]=y.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=y.useState({}),p=Me(t,R=>d(R)),m=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=m.indexOf(v),b=u?m.indexOf(u):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,_=b>=w,C=hU(R=>{const T=R.target,M=[...c.branches].some(D=>D.contains(T));!_||M||(o==null||o(R),a==null||a(R),R.defaultPrevented||s==null||s())},f),N=pU(R=>{const T=R.target;[...c.branches].some(D=>D.contains(T))||(i==null||i(R),a==null||a(R),R.defaultPrevented||s==null||s())},f);return sU(R=>{b===c.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&s&&(R.preventDefault(),s()))},f),y.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(p1=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),g1(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=p1)}},[u,f,n,c]),y.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),g1())},[u,c]),y.useEffect(()=>{const R=()=>h({});return document.addEventListener(Cm,R),()=>document.removeEventListener(Cm,R)},[]),g.jsx(be.div,{...l,ref:p,style:{pointerEvents:x?_?"auto":"none":void 0,...e.style},onFocusCapture:de(e.onFocusCapture,N.onFocusCapture),onBlurCapture:de(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:de(e.onPointerDownCapture,C.onPointerDownCapture)})});To.displayName=lU;var dU="DismissableLayerBranch",fU=y.forwardRef((e,t)=>{const n=y.useContext(m1),r=y.useRef(null),o=Me(t,r);return y.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(be.div,{...e,ref:o})});fU.displayName=dU;function hU(e,t=globalThis==null?void 0:globalThis.document){const n=ot(e),r=y.useRef(!1),o=y.useRef(()=>{});return y.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let l=function(){w1(cU,n,c,{discrete:!0})};const c={originalEvent:s};s.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},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function pU(e,t=globalThis==null?void 0:globalThis.document){const n=ot(e),r=y.useRef(!1);return y.useEffect(()=>{const o=i=>{i.target&&!r.current&&w1(uU,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function g1(){const e=new CustomEvent(Cm);document.dispatchEvent(e)}function w1(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ed(o,i):o.dispatchEvent(i)}var Em="focusScope.autoFocusOnMount",Pm="focusScope.autoFocusOnUnmount",v1={bubbles:!1,cancelable:!0},mU="FocusScope",xl=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=y.useState(null),c=ot(o),u=ot(i),d=y.useRef(null),f=Me(t,m=>l(m)),h=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let m=function(x){if(h.paused||!s)return;const _=x.target;s.contains(_)?d.current=_:Mo(d.current,{select:!0})},v=function(x){if(h.paused||!s)return;const _=x.relatedTarget;_!==null&&(s.contains(_)||Mo(d.current,{select:!0}))},w=function(x){if(document.activeElement===document.body)for(const C of x)C.removedNodes.length>0&&Mo(s)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const b=new MutationObserver(w);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),b.disconnect()}}},[r,s,h.paused]),y.useEffect(()=>{if(s){x1.add(h);const m=document.activeElement;if(!s.contains(m)){const w=new CustomEvent(Em,v1);s.addEventListener(Em,c),s.dispatchEvent(w),w.defaultPrevented||(gU(xU(y1(s)),{select:!0}),document.activeElement===m&&Mo(s))}return()=>{s.removeEventListener(Em,c),setTimeout(()=>{const w=new CustomEvent(Pm,v1);s.addEventListener(Pm,u),s.dispatchEvent(w),w.defaultPrevented||Mo(m??document.body,{select:!0}),s.removeEventListener(Pm,u),x1.remove(h)},0)}}},[s,c,u,h]);const p=y.useCallback(m=>{if(!n&&!r||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,w=document.activeElement;if(v&&w){const b=m.currentTarget,[x,_]=wU(b);x&&_?!m.shiftKey&&w===_?(m.preventDefault(),n&&Mo(x,{select:!0})):m.shiftKey&&w===x&&(m.preventDefault(),n&&Mo(_,{select:!0})):w===b&&m.preventDefault()}},[n,r,h.paused]);return g.jsx(be.div,{tabIndex:-1,...a,ref:f,onKeyDown:p})});xl.displayName=mU;function gU(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Mo(r,{select:t}),document.activeElement!==n)return}function wU(e){const t=y1(e),n=b1(t,e),r=b1(t.reverse(),e);return[n,r]}function y1(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 b1(e,t){for(const n of e)if(!vU(n,{upTo:t}))return n}function vU(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function yU(e){return e instanceof HTMLInputElement&&"select"in e}function Mo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&yU(e)&&t&&e.select()}}var x1=bU();function bU(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_1(e,t),e.unshift(t)},remove(t){var n;e=_1(e,t),(n=e[0])==null||n.resume()}}}function _1(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function xU(e){return e.filter(t=>t.tagName!=="A")}var _U="Portal",_l=y.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=y.useState(!1);xt(()=>i(!0),[]);const a=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?ur.createPortal(g.jsx(be.div,{...r,ref:t}),a):null});_l.displayName=_U;var Rm=0;function id(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??S1()),document.body.insertAdjacentElement("beforeend",e[1]??S1()),Rm++,()=>{Rm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Rm--}},[])}function S1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Wt=function(){return Wt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Wt.apply(this,arguments)};function Nm(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 C1(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Sl="right-scroll-bar-position",Cl="width-before-scroll-bar",SU="with-scroll-bars-hidden",CU="--removed-body-scroll-bar-size";function Tm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function EU(e,t){var n=E.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 PU=typeof window<"u"?y.useLayoutEffect:y.useEffect,E1=new WeakMap;function P1(e,t){var n=EU(null,function(r){return e.forEach(function(o){return Tm(o,r)})});return PU(function(){var r=E1.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(s){i.has(s)||Tm(s,null)}),i.forEach(function(s){o.has(s)||Tm(s,a)})}E1.set(n,e)},[e]),n}function RU(e){return e}function NU(e,t){t===void 0&&(t=RU);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(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(i),a=n}var l=function(){var u=a;a=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){a.push(u),c()},filter:function(u){return a=a.filter(u),n}}}};return o}function R1(e){e===void 0&&(e={});var t=NU(null);return t.options=Wt({async:!0,ssr:!1},e),t}var N1=function(e){var t=e.sideCar,n=Nm(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 y.createElement(r,Wt({},n))};N1.isSideCarExport=!0;function T1(e,t){return e.useMedium(t),N1}var M1=R1(),Mm=function(){},ad=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Mm,onWheelCapture:Mm,onTouchMoveCapture:Mm}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noIsolation,p=e.inert,m=e.allowPinchZoom,v=e.as,w=v===void 0?"div":v,b=e.gapMode,x=Nm(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=f,C=P1([n,t]),N=Wt(Wt({},x),o);return y.createElement(y.Fragment,null,u&&y.createElement(_,{sideCar:M1,removeScrollBar:c,shards:d,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),a?y.cloneElement(y.Children.only(s),Wt(Wt({},N),{ref:C})):y.createElement(w,Wt({},N,{className:l,ref:C}),s))});ad.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ad.classNames={fullWidth:Cl,zeroRight:Sl};var TU=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function MU(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=TU();return t&&e.setAttribute("nonce",t),e}function kU(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function DU(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var AU=function(){var e=0,t=null;return{add:function(n){e==0&&(t=MU())&&(kU(t,n),DU(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},IU=function(){var e=AU();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},km=function(){var e=IU(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},OU={left:0,top:0,right:0,gap:0},Dm=function(e){return parseInt(e||"",10)||0},jU=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[Dm(n),Dm(r),Dm(o)]},$U=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return OU;var t=jU(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])}},FU=km(),ba="data-scroll-locked",LU=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
261
|
+
`,eV=()=>{const[e,t]=E.useState([]),[n,r]=E.useState([]),[o,i]=E.useState(!1),{projectMetadata:a}=hp(),{siteBackground:s,setSiteBackground:l}=Nw(),{siteBackgroundColor:c,siteBackgroundImage:u}=Nw(),d=async()=>{i(!0),await qx(a.projectName,a.projectURL),i(!1),await qh(a.projectName,a.projectURL),await Y4(a.projectName);const m=await Bx(a.projectName);t(m.components),r(m.layout);const v=`${window.miDir}/${a.projectName}/src/theme.json`,w=await window.pfs.readFile(v,"utf8"),b=JSON.parse(w),x=b.tailwind,_=b.siteBackground;window.tailwind.config=x,Hx(x),l(_)},f=Vx(a.projectName,u),h=E.useMemo(()=>u?{backgroundImage:u?`url(${f})`:"",backgroundSize:"cover",backgroundRepeat:"no-repeat"}:c?{background:c||""}:{},[s,u,c,f]),p=async()=>{Object.assign(document.documentElement.style,{height:"100%"}),Object.assign(document.body.style,{height:"100%",margin:"0",padding:"0",...h})};return E.useEffect(()=>{!a.projectName&&!a.projectURL||d()},[a.projectName,a.projectURL]),E.useEffect(()=>{p()},[h]),g.jsx("div",{children:g.jsxs(QH,{children:[g.jsx(g8,{isVisible:o}),g.jsx("div",{className:"mi-container",children:g.jsx("div",{className:"mi-workspace",children:g.jsx(PS,{components:e,layout:n})})})]})})},tV=E.forwardRef(({style:e,className:t,onMouseDown:n,onMouseUp:r,onTouchEnd:o,children:i,componentId:a},s)=>{const{selectedComponentId:l}=hp(),c=E.useMemo(()=>l===a,[l]),u=E.Children.toArray(i),d=u.filter(h=>h.key===".$resizableHandle-se"),f=u.filter(h=>h.key!==".$resizableHandle-se");return g.jsxs("div",{style:{...e},className:t+(c?" selected":""),ref:s,onMouseDown:n,onMouseUp:r,onTouchEnd:o,children:[g.jsx("div",{className:"grid-item "+(c?"selected":""),children:f}),d]})});class nV extends E.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}render(){const{hasError:t,error:n}=this.state,{children:r,fallback:o,fallbackProps:i}=this.props;return t&&(this.resetState(),o)?g.jsx(o,{error:n,...i}):r}resetState(){this.state={hasError:!1,error:null}}}const rV=e=>{const{onDragStart:t,onDragStop:n}=lp(),r=i=>{t(e.initialSize),i.dataTransfer.setData("text/plain",""),i.dataTransfer.setData("application/reactgridlayout",JSON.stringify({id:e.id,type:e.type,initialSize:e.initialSize,metadata:e.metadata}))},o=()=>{n()};return g.jsx("div",{className:"w-full h-full flex items-center justify-center",draggable:!0,unselectable:"on",onDragStart:r,onDragEnd:o,children:e.node})},oV={maxReconnectAttempts:5,reconnectInitialDelay:1e3,reconnectBackoffFactor:2},iV=(e,t,n)=>{const{maxReconnectAttempts:r,reconnectInitialDelay:o,reconnectBackoffFactor:i}={...oV,...n},a=E.useRef(null),s=E.useRef(0),l=E.useRef(null),c=E.useRef(!1),u=E.useRef([]),d=E.useRef(t),[f,h]=E.useState("idle"),[p,m]=E.useState(null);E.useEffect(()=>{d.current=t},[t]);const v=E.useCallback(()=>{console.log("WebSocket connected"),h("open"),m(null),s.current=0;const R=[...u.current];u.current=[],R.length>0&&(console.log(`Processing ${R.length} queued messages`),R.forEach(T=>{var M,D;try{(M=a.current)==null||M.send(T)}catch(A){console.error("Error sending queued message:",A),((D=a.current)==null?void 0:D.readyState)===WebSocket.OPEN&&u.current.push(T)}}))},[]),w=E.useCallback(R=>{console.log(`WebSocket closed: code=${R.code}, reason=${R.reason}, wasClean=${R.wasClean}`),h("closed"),l.current&&(clearTimeout(l.current),l.current=null);const T=R.code===1e3;if(!c.current&&!T)if(s.current<r){const M=s.current+1,D=o*Math.pow(i,M-1);console.log(`Attempting WebSocket reconnect ${M}/${r} in ${D}ms...`),h("connecting"),l.current=setTimeout(()=>{a.current=null,_(),l.current=null},D),s.current=M}else console.error(`WebSocket max reconnect attempts (${r}) reached.`),m(new Error(`Maximum reconnection attempts reached (${r})`));else c.current=!1},[r,o,i]),b=E.useCallback(R=>{console.error("WebSocket error:",R);const T=R instanceof ErrorEvent?R.message:"Unknown WebSocket error";m(new Error(T))},[]),x=E.useCallback(R=>{try{const T=JSON.parse(R.data);d.current(T)}catch(T){console.error("Failed to parse WebSocket message:",T,R.data),m(T instanceof Error?T:new Error("Invalid message format"))}},[]),_=E.useCallback(()=>{const R=e();if(!R){console.log("WebSocket connect skipped: No URL provided");return}if(a.current){const T=a.current.readyState;if(T===WebSocket.OPEN||T===WebSocket.CONNECTING){console.log("WebSocket connect skipped: Already connecting/connected",{readyState:T,status:f});return}a.current=null}l.current&&(clearTimeout(l.current),l.current=null),console.log("Initiating WebSocket connection to:",R),h("connecting"),m(null);try{const T=new WebSocket(R);a.current=T,T.onopen=v,T.onclose=w,T.onerror=b,T.onmessage=x}catch(T){console.error("Failed to create WebSocket:",T),m(T instanceof Error?T:new Error("Failed to create WebSocket")),h("closed")}},[e,v,w,b,x]),C=E.useCallback(()=>{if(console.log("Initiating intentional WebSocket disconnect"),c.current=!0,l.current&&(clearTimeout(l.current),l.current=null),a.current){h("closing");try{a.current.close(1e3,"Client disconnecting")}catch(R){console.error("Error during WebSocket close:",R),h("closed"),a.current=null}}else h("closed");s.current=0},[]),N=E.useCallback(R=>{var D,A;const T=JSON.stringify(R);if(((D=a.current)==null?void 0:D.readyState)===WebSocket.OPEN)try{return(A=a.current)==null||A.send(T),!0}catch(O){return console.error("WebSocket send error:",O),m(O instanceof Error?O:new Error("Failed to send message")),!1}else return console.log("WebSocket not open, queuing message"),u.current.push(T),!0},[]);return E.useEffect(()=>(e()?_():f!=="idle"&&f!=="closed"&&C(),()=>{a.current&&C()}),[e,_,C]),{connectionStatus:f,sendMessage:N,lastError:p}};var ml=e=>e.type==="checkbox",hi=e=>e instanceof Date,rn=e=>e==null;const RS=e=>typeof e=="object";var Et=e=>!rn(e)&&!Array.isArray(e)&&RS(e)&&!hi(e),NS=e=>Et(e)&&e.target?ml(e.target)?e.target.checked:e.target.value:e,aV=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,TS=(e,t)=>e.has(aV(t)),sV=e=>{const t=e.constructor&&e.constructor.prototype;return Et(t)&&t.hasOwnProperty("isPrototypeOf")},rm=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function pn(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(rm&&(e instanceof Blob||r))&&(n||Et(e)))if(t=n?[]:{},!n&&!sV(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=pn(e[o]));else return e;return t}var Gu=e=>Array.isArray(e)?e.filter(Boolean):[],Pt=e=>e===void 0,Se=(e,t,n)=>{if(!t||!Et(e))return n;const r=Gu(t.split(/[,[\].]+?/)).reduce((o,i)=>rn(o)?o:o[i],e);return Pt(r)||r===e?Pt(e[t])?n:e[t]:r},Bn=e=>typeof e=="boolean",om=e=>/^\w*$/.test(e),MS=e=>Gu(e.replace(/["|']|\]/g,"").split(/\.|\[/)),lt=(e,t,n)=>{let r=-1;const o=om(t)?[t]:MS(t),i=o.length,a=i-1;for(;++r<i;){const s=o[r];let l=n;if(r!==a){const c=e[s];l=Et(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(s==="__proto__"||s==="constructor"||s==="prototype")return;e[s]=l,e=e[s]}return e};const qu={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Xn={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Xr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},kS=E.createContext(null),Yu=()=>E.useContext(kS),lV=e=>{const{children:t,...n}=e;return E.createElement(kS.Provider,{value:n},t)};var DS=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const a=i;return t._proxyFormState[a]!==Xn.all&&(t._proxyFormState[a]=!r||Xn.all),n&&(n[a]=!0),e[a]}});return o},mn=e=>Et(e)&&!Object.keys(e).length,AS=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return mn(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!r||Xn.all))},gl=e=>Array.isArray(e)?e:[e],IS=(e,t,n)=>!e||!t||e===t||gl(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function im(e){const t=E.useRef(e);t.current=e,E.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function cV(e){const t=Yu(),{control:n=t.control,disabled:r,name:o,exact:i}=e,[a,s]=E.useState(n._formState),l=E.useRef(!0),c=E.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=E.useRef(o);return u.current=o,im({disabled:r,next:d=>l.current&&IS(u.current,d.name,i)&&AS(d,c.current,n._updateFormState)&&s({...n._formState,...d}),subject:n._subjects.state}),E.useEffect(()=>(l.current=!0,c.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),E.useMemo(()=>DS(a,n,c.current,!1),[a,n])}var Rr=e=>typeof e=="string",OS=(e,t,n,r,o)=>Rr(e)?(r&&t.watch.add(e),Se(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),Se(n,i))):(r&&(t.watchAll=!0),n);function uV(e){const t=Yu(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:a}=e,s=E.useRef(r);s.current=r,im({disabled:i,subject:n._subjects.values,next:u=>{IS(s.current,u.name,a)&&c(pn(OS(s.current,n._names,u.values||n._formValues,!1,o)))}});const[l,c]=E.useState(n._getWatch(r,o));return E.useEffect(()=>n._removeUnmounted()),l}function dV(e){const t=Yu(),{name:n,disabled:r,control:o=t.control,shouldUnregister:i}=e,a=TS(o._names.array,n),s=uV({control:o,name:n,defaultValue:Se(o._formValues,n,Se(o._defaultValues,n,e.defaultValue)),exact:!0}),l=cV({control:o,name:n,exact:!0}),c=E.useRef(o.register(n,{...e.rules,value:s,...Bn(e.disabled)?{disabled:e.disabled}:{}})),u=E.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Se(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!Se(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Se(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Se(l.validatingFields,n)},error:{enumerable:!0,get:()=>Se(l.errors,n)}}),[l,n]),d=E.useMemo(()=>({name:n,value:s,...Bn(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:f=>c.current.onChange({target:{value:NS(f),name:n},type:qu.CHANGE}),onBlur:()=>c.current.onBlur({target:{value:Se(o._formValues,n),name:n},type:qu.BLUR}),ref:f=>{const h=Se(o._fields,n);h&&f&&(h._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:p=>f.setCustomValidity(p),reportValidity:()=>f.reportValidity()})}}),[n,o._formValues,r,l.disabled,s,o._fields]);return E.useEffect(()=>{const f=o._options.shouldUnregister||i,h=(p,m)=>{const v=Se(o._fields,p);v&&v._f&&(v._f.mount=m)};if(h(n,!0),f){const p=pn(Se(o._options.defaultValues,n));lt(o._defaultValues,n,p),Pt(Se(o._formValues,n))&<(o._formValues,n,p)}return!a&&o.register(n),()=>{(a?f&&!o._state.action:f)?o.unregister(n):h(n,!1)}},[n,o,a,i]),E.useEffect(()=>{o._updateDisabledField({disabled:r,fields:o._fields,name:n})},[r,n,o]),E.useMemo(()=>({field:d,formState:l,fieldState:u}),[d,l,u])}const fV=e=>e.render(dV(e));var hV=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},jS=e=>({isOnSubmit:!e||e===Xn.onSubmit,isOnBlur:e===Xn.onBlur,isOnChange:e===Xn.onChange,isOnAll:e===Xn.all,isOnTouch:e===Xn.onTouched}),$S=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const wl=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=Se(e,o);if(i){const{_f:a,...s}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],o)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(wl(s,t))break}else if(Et(s)&&wl(s,t))break}}};var pV=(e,t,n)=>{const r=gl(Se(e,n));return lt(r,"root",t[n]),lt(e,n,r),e},am=e=>e.type==="file",Nr=e=>typeof e=="function",Ku=e=>{if(!rm)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Xu=e=>Rr(e),sm=e=>e.type==="radio",Zu=e=>e instanceof RegExp;const FS={value:!1,isValid:!1},LS={value:!0,isValid:!0};var zS=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Pt(e[0].attributes.value)?Pt(e[0].value)||e[0].value===""?LS:{value:e[0].value,isValid:!0}:LS:FS}return FS};const BS={isValid:!1,value:null};var HS=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,BS):BS;function VS(e,t,n="validate"){if(Xu(e)||Array.isArray(e)&&e.every(Xu)||Bn(e)&&!e)return{type:n,message:Xu(e)?e:"",ref:t}}var ya=e=>Et(e)&&!Zu(e)?e:{value:e,message:""},US=async(e,t,n,r,o,i)=>{const{ref:a,refs:s,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:h,validate:p,name:m,valueAsNumber:v,mount:w}=e._f,b=Se(n,m);if(!w||t.has(m))return{};const x=s?s[0]:a,_=O=>{o&&x.reportValidity&&(x.setCustomValidity(Bn(O)?"":O||""),x.reportValidity())},C={},N=sm(a),R=ml(a),T=N||R,M=(v||am(a))&&Pt(a.value)&&Pt(b)||Ku(a)&&a.value===""||b===""||Array.isArray(b)&&!b.length,D=hV.bind(null,m,r,C),A=(O,$,W,re=Xr.maxLength,Y=Xr.minLength)=>{const Z=O?$:W;C[m]={type:O?re:Y,message:Z,ref:a,...D(O?re:Y,Z)}};if(i?!Array.isArray(b)||!b.length:l&&(!T&&(M||rn(b))||Bn(b)&&!b||R&&!zS(s).isValid||N&&!HS(s).isValid)){const{value:O,message:$}=Xu(l)?{value:!!l,message:l}:ya(l);if(O&&(C[m]={type:Xr.required,message:$,ref:x,...D(Xr.required,$)},!r))return _($),C}if(!M&&(!rn(d)||!rn(f))){let O,$;const W=ya(f),re=ya(d);if(!rn(b)&&!isNaN(b)){const Y=a.valueAsNumber||b&&+b;rn(W.value)||(O=Y>W.value),rn(re.value)||($=Y<re.value)}else{const Y=a.valueAsDate||new Date(b),Z=ee=>new Date(new Date().toDateString()+" "+ee),B=a.type=="time",oe=a.type=="week";Rr(W.value)&&b&&(O=B?Z(b)>Z(W.value):oe?b>W.value:Y>new Date(W.value)),Rr(re.value)&&b&&($=B?Z(b)<Z(re.value):oe?b<re.value:Y<new Date(re.value))}if((O||$)&&(A(!!O,W.message,re.message,Xr.max,Xr.min),!r))return _(C[m].message),C}if((c||u)&&!M&&(Rr(b)||i&&Array.isArray(b))){const O=ya(c),$=ya(u),W=!rn(O.value)&&b.length>+O.value,re=!rn($.value)&&b.length<+$.value;if((W||re)&&(A(W,O.message,$.message),!r))return _(C[m].message),C}if(h&&!M&&Rr(b)){const{value:O,message:$}=ya(h);if(Zu(O)&&!b.match(O)&&(C[m]={type:Xr.pattern,message:$,ref:a,...D(Xr.pattern,$)},!r))return _($),C}if(p){if(Nr(p)){const O=await p(b,n),$=VS(O,x);if($&&(C[m]={...$,...D(Xr.validate,$.message)},!r))return _($.message),C}else if(Et(p)){let O={};for(const $ in p){if(!mn(O)&&!r)break;const W=VS(await p[$](b,n),x,$);W&&(O={...W,...D($,W.message)},_(W.message),r&&(C[m]=O))}if(!mn(O)&&(C[m]={ref:x,...O},!r))return C}}return _(!0),C};function mV(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Pt(e)?r++:e[t[r++]];return e}function gV(e){for(const t in e)if(e.hasOwnProperty(t)&&!Pt(e[t]))return!1;return!0}function kt(e,t){const n=Array.isArray(t)?t:om(t)?[t]:MS(t),r=n.length===1?e:mV(e,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(Et(r)&&mn(r)||Array.isArray(r)&&gV(r))&&kt(e,n.slice(0,-1)),e}var lm=()=>{let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}},cm=e=>rn(e)||!RS(e);function Ro(e,t){if(cm(e)||cm(t))return e===t;if(hi(e)&&hi(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const a=t[o];if(hi(i)&&hi(a)||Et(i)&&Et(a)||Array.isArray(i)&&Array.isArray(a)?!Ro(i,a):i!==a)return!1}}return!0}var WS=e=>e.type==="select-multiple",wV=e=>sm(e)||ml(e),um=e=>Ku(e)&&e.isConnected,GS=e=>{for(const t in e)if(Nr(e[t]))return!0;return!1};function Ju(e,t={}){const n=Array.isArray(e);if(Et(e)||n)for(const r in e)Array.isArray(e[r])||Et(e[r])&&!GS(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Ju(e[r],t[r])):rn(e[r])||(t[r]=!0);return t}function qS(e,t,n){const r=Array.isArray(e);if(Et(e)||r)for(const o in e)Array.isArray(e[o])||Et(e[o])&&!GS(e[o])?Pt(t)||cm(n[o])?n[o]=Array.isArray(e[o])?Ju(e[o],[]):{...Ju(e[o])}:qS(e[o],rn(t)?{}:t[o],n[o]):n[o]=!Ro(e[o],t[o]);return n}var vl=(e,t)=>qS(e,t,Ju(t)),YS=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Pt(e)?e:t?e===""?NaN:e&&+e:n&&Rr(e)?new Date(e):r?r(e):e;function dm(e){const t=e.ref;return am(t)?t.files:sm(t)?HS(e.refs).value:WS(t)?[...t.selectedOptions].map(({value:n})=>n):ml(t)?zS(e.refs).value:YS(Pt(t.value)?e.ref.value:t.value,e)}var vV=(e,t,n,r)=>{const o={};for(const i of e){const a=Se(t,i);a&<(o,i,a._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},yl=e=>Pt(e)?e:Zu(e)?e.source:Et(e)?Zu(e.value)?e.value.source:e.value:e;const KS="AsyncFunction";var yV=e=>!!e&&!!e.validate&&!!(Nr(e.validate)&&e.validate.constructor.name===KS||Et(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===KS)),bV=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function XS(e,t,n){const r=Se(e,n);if(r||om(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),a=Se(t,i),s=Se(e,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(s&&s.type)return{name:i,error:s};o.pop()}return{name:n}}var xV=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,_V=(e,t)=>!Gu(Se(e,t)).length&&kt(e,t);const SV={mode:Xn.onSubmit,reValidateMode:Xn.onChange,shouldFocusError:!0};function CV(e={}){let t={...SV,...e},n={submitCount:0,isDirty:!1,isLoading:Nr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Et(t.defaultValues)||Et(t.values)?pn(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:pn(o),a={action:!1,mount:!1,watch:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:lm(),array:lm(),state:lm()},f=jS(t.mode),h=jS(t.reValidateMode),p=t.criteriaMode===Xn.all,m=j=>V=>{clearTimeout(c),c=setTimeout(j,V)},v=async j=>{if(!t.disabled&&(u.isValid||j)){const V=t.resolver?mn((await T()).errors):await D(r,!0);V!==n.isValid&&d.state.next({isValid:V})}},w=(j,V)=>{!t.disabled&&(u.isValidating||u.validatingFields)&&((j||Array.from(s.mount)).forEach(J=>{J&&(V?lt(n.validatingFields,J,V):kt(n.validatingFields,J))}),d.state.next({validatingFields:n.validatingFields,isValidating:!mn(n.validatingFields)}))},b=(j,V=[],J,we,pe=!0,fe=!0)=>{if(we&&J&&!t.disabled){if(a.action=!0,fe&&Array.isArray(Se(r,j))){const ge=J(Se(r,j),we.argA,we.argB);pe&<(r,j,ge)}if(fe&&Array.isArray(Se(n.errors,j))){const ge=J(Se(n.errors,j),we.argA,we.argB);pe&<(n.errors,j,ge),_V(n.errors,j)}if(u.touchedFields&&fe&&Array.isArray(Se(n.touchedFields,j))){const ge=J(Se(n.touchedFields,j),we.argA,we.argB);pe&<(n.touchedFields,j,ge)}u.dirtyFields&&(n.dirtyFields=vl(o,i)),d.state.next({name:j,isDirty:O(j,V),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else lt(i,j,V)},x=(j,V)=>{lt(n.errors,j,V),d.state.next({errors:n.errors})},_=j=>{n.errors=j,d.state.next({errors:n.errors,isValid:!1})},C=(j,V,J,we)=>{const pe=Se(r,j);if(pe){const fe=Se(i,j,Pt(J)?Se(o,j):J);Pt(fe)||we&&we.defaultChecked||V?lt(i,j,V?fe:dm(pe._f)):re(j,fe),a.mount&&v()}},N=(j,V,J,we,pe)=>{let fe=!1,ge=!1;const _e={name:j};if(!t.disabled){const Xe=!!(Se(r,j)&&Se(r,j)._f&&Se(r,j)._f.disabled);if(!J||we){u.isDirty&&(ge=n.isDirty,n.isDirty=_e.isDirty=O(),fe=ge!==_e.isDirty);const k=Xe||Ro(Se(o,j),V);ge=!!(!Xe&&Se(n.dirtyFields,j)),k||Xe?kt(n.dirtyFields,j):lt(n.dirtyFields,j,!0),_e.dirtyFields=n.dirtyFields,fe=fe||u.dirtyFields&&ge!==!k}if(J){const k=Se(n.touchedFields,j);k||(lt(n.touchedFields,j,J),_e.touchedFields=n.touchedFields,fe=fe||u.touchedFields&&k!==J)}fe&&pe&&d.state.next(_e)}return fe?_e:{}},R=(j,V,J,we)=>{const pe=Se(n.errors,j),fe=u.isValid&&Bn(V)&&n.isValid!==V;if(t.delayError&&J?(l=m(()=>x(j,J)),l(t.delayError)):(clearTimeout(c),l=null,J?lt(n.errors,j,J):kt(n.errors,j)),(J?!Ro(pe,J):pe)||!mn(we)||fe){const ge={...we,...fe&&Bn(V)?{isValid:V}:{},errors:n.errors,name:j};n={...n,...ge},d.state.next(ge)}},T=async j=>{w(j,!0);const V=await t.resolver(i,t.context,vV(j||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(j),V},M=async j=>{const{errors:V}=await T(j);if(j)for(const J of j){const we=Se(V,J);we?lt(n.errors,J,we):kt(n.errors,J)}else n.errors=V;return V},D=async(j,V,J={valid:!0})=>{for(const we in j){const pe=j[we];if(pe){const{_f:fe,...ge}=pe;if(fe){const _e=s.array.has(fe.name),Xe=pe._f&&yV(pe._f);Xe&&u.validatingFields&&w([we],!0);const k=await US(pe,s.disabled,i,p,t.shouldUseNativeValidation&&!V,_e);if(Xe&&u.validatingFields&&w([we]),k[fe.name]&&(J.valid=!1,V))break;!V&&(Se(k,fe.name)?_e?pV(n.errors,k,fe.name):lt(n.errors,fe.name,k[fe.name]):kt(n.errors,fe.name))}!mn(ge)&&await D(ge,V,J)}}return J.valid},A=()=>{for(const j of s.unMount){const V=Se(r,j);V&&(V._f.refs?V._f.refs.every(J=>!um(J)):!um(V._f.ref))&&L(j)}s.unMount=new Set},O=(j,V)=>!t.disabled&&(j&&V&<(i,j,V),!Ro(ne(),o)),$=(j,V,J)=>OS(j,s,{...a.mount?i:Pt(V)?o:Rr(j)?{[j]:V}:V},J,V),W=j=>Gu(Se(a.mount?i:o,j,t.shouldUnregister?Se(o,j,[]):[])),re=(j,V,J={})=>{const we=Se(r,j);let pe=V;if(we){const fe=we._f;fe&&(!fe.disabled&<(i,j,YS(V,fe)),pe=Ku(fe.ref)&&rn(V)?"":V,WS(fe.ref)?[...fe.ref.options].forEach(ge=>ge.selected=pe.includes(ge.value)):fe.refs?ml(fe.ref)?fe.refs.length>1?fe.refs.forEach(ge=>(!ge.defaultChecked||!ge.disabled)&&(ge.checked=Array.isArray(pe)?!!pe.find(_e=>_e===ge.value):pe===ge.value)):fe.refs[0]&&(fe.refs[0].checked=!!pe):fe.refs.forEach(ge=>ge.checked=ge.value===pe):am(fe.ref)?fe.ref.value="":(fe.ref.value=pe,fe.ref.type||d.values.next({name:j,values:{...i}})))}(J.shouldDirty||J.shouldTouch)&&N(j,pe,J.shouldTouch,J.shouldDirty,!0),J.shouldValidate&&ee(j)},Y=(j,V,J)=>{for(const we in V){const pe=V[we],fe=`${j}.${we}`,ge=Se(r,fe);(s.array.has(j)||Et(pe)||ge&&!ge._f)&&!hi(pe)?Y(fe,pe,J):re(fe,pe,J)}},Z=(j,V,J={})=>{const we=Se(r,j),pe=s.array.has(j),fe=pn(V);lt(i,j,fe),pe?(d.array.next({name:j,values:{...i}}),(u.isDirty||u.dirtyFields)&&J.shouldDirty&&d.state.next({name:j,dirtyFields:vl(o,i),isDirty:O(j,fe)})):we&&!we._f&&!rn(fe)?Y(j,fe,J):re(j,fe,J),$S(j,s)&&d.state.next({...n}),d.values.next({name:a.mount?j:void 0,values:{...i}})},B=async j=>{a.mount=!0;const V=j.target;let J=V.name,we=!0;const pe=Se(r,J),fe=()=>V.type?dm(pe._f):NS(j),ge=_e=>{we=Number.isNaN(_e)||hi(_e)&&isNaN(_e.getTime())||Ro(_e,Se(i,J,_e))};if(pe){let _e,Xe;const k=fe(),S=j.type===qu.BLUR||j.type===qu.FOCUS_OUT,P=!bV(pe._f)&&!t.resolver&&!Se(n.errors,J)&&!pe._f.deps||xV(S,Se(n.touchedFields,J),n.isSubmitted,h,f),I=$S(J,s,S);lt(i,J,k),S?(pe._f.onBlur&&pe._f.onBlur(j),l&&l(0)):pe._f.onChange&&pe._f.onChange(j);const U=N(J,k,S,!1),te=!mn(U)||I;if(!S&&d.values.next({name:J,type:j.type,values:{...i}}),P)return u.isValid&&(t.mode==="onBlur"&&S?v():S||v()),te&&d.state.next({name:J,...I?{}:U});if(!S&&I&&d.state.next({...n}),t.resolver){const{errors:he}=await T([J]);if(ge(k),we){const Oe=XS(n.errors,r,J),Qe=XS(he,r,Oe.name||J);_e=Qe.error,J=Qe.name,Xe=mn(he)}}else w([J],!0),_e=(await US(pe,s.disabled,i,p,t.shouldUseNativeValidation))[J],w([J]),ge(k),we&&(_e?Xe=!1:u.isValid&&(Xe=await D(r,!0)));we&&(pe._f.deps&&ee(pe._f.deps),R(J,Xe,_e,U))}},oe=(j,V)=>{if(Se(n.errors,V)&&j.focus)return j.focus(),1},ee=async(j,V={})=>{let J,we;const pe=gl(j);if(t.resolver){const fe=await M(Pt(j)?j:pe);J=mn(fe),we=j?!pe.some(ge=>Se(fe,ge)):J}else j?(we=(await Promise.all(pe.map(async fe=>{const ge=Se(r,fe);return await D(ge&&ge._f?{[fe]:ge}:ge)}))).every(Boolean),!(!we&&!n.isValid)&&v()):we=J=await D(r);return d.state.next({...!Rr(j)||u.isValid&&J!==n.isValid?{}:{name:j},...t.resolver||!j?{isValid:J}:{},errors:n.errors}),V.shouldFocus&&!we&&wl(r,oe,j?pe:s.mount),we},ne=j=>{const V={...a.mount?i:o};return Pt(j)?V:Rr(j)?Se(V,j):j.map(J=>Se(V,J))},G=(j,V)=>({invalid:!!Se((V||n).errors,j),isDirty:!!Se((V||n).dirtyFields,j),error:Se((V||n).errors,j),isValidating:!!Se(n.validatingFields,j),isTouched:!!Se((V||n).touchedFields,j)}),F=j=>{j&&gl(j).forEach(V=>kt(n.errors,V)),d.state.next({errors:j?n.errors:{}})},q=(j,V,J)=>{const we=(Se(r,j,{_f:{}})._f||{}).ref,pe=Se(n.errors,j)||{},{ref:fe,message:ge,type:_e,...Xe}=pe;lt(n.errors,j,{...Xe,...V,ref:we}),d.state.next({name:j,errors:n.errors,isValid:!1}),J&&J.shouldFocus&&we&&we.focus&&we.focus()},ce=(j,V)=>Nr(j)?d.values.subscribe({next:J=>j($(void 0,V),J)}):$(j,V,!0),L=(j,V={})=>{for(const J of j?gl(j):s.mount)s.mount.delete(J),s.array.delete(J),V.keepValue||(kt(r,J),kt(i,J)),!V.keepError&&kt(n.errors,J),!V.keepDirty&&kt(n.dirtyFields,J),!V.keepTouched&&kt(n.touchedFields,J),!V.keepIsValidating&&kt(n.validatingFields,J),!t.shouldUnregister&&!V.keepDefaultValue&&kt(o,J);d.values.next({values:{...i}}),d.state.next({...n,...V.keepDirty?{isDirty:O()}:{}}),!V.keepIsValid&&v()},K=({disabled:j,name:V,field:J,fields:we})=>{(Bn(j)&&a.mount||j||s.disabled.has(V))&&(j?s.disabled.add(V):s.disabled.delete(V),N(V,dm(J?J._f:Se(we,V)._f),!1,!1,!0))},z=(j,V={})=>{let J=Se(r,j);const we=Bn(V.disabled)||Bn(t.disabled);return lt(r,j,{...J||{},_f:{...J&&J._f?J._f:{ref:{name:j}},name:j,mount:!0,...V}}),s.mount.add(j),J?K({field:J,disabled:Bn(V.disabled)?V.disabled:t.disabled,name:j}):C(j,!0,V.value),{...we?{disabled:V.disabled||t.disabled}:{},...t.progressive?{required:!!V.required,min:yl(V.min),max:yl(V.max),minLength:yl(V.minLength),maxLength:yl(V.maxLength),pattern:yl(V.pattern)}:{},name:j,onChange:B,onBlur:B,ref:pe=>{if(pe){z(j,V),J=Se(r,j);const fe=Pt(pe.value)&&pe.querySelectorAll&&pe.querySelectorAll("input,select,textarea")[0]||pe,ge=wV(fe),_e=J._f.refs||[];if(ge?_e.find(Xe=>Xe===fe):fe===J._f.ref)return;lt(r,j,{_f:{...J._f,...ge?{refs:[..._e.filter(um),fe,...Array.isArray(Se(o,j))?[{}]:[]],ref:{type:fe.type,name:j}}:{ref:fe}}}),C(j,!1,void 0,fe)}else J=Se(r,j,{}),J._f&&(J._f.mount=!1),(t.shouldUnregister||V.shouldUnregister)&&!(TS(s.array,j)&&a.action)&&s.unMount.add(j)}}},ie=()=>t.shouldFocusError&&wl(r,oe,s.mount),le=j=>{Bn(j)&&(d.state.next({disabled:j}),wl(r,(V,J)=>{const we=Se(r,J);we&&(V.disabled=we._f.disabled||j,Array.isArray(we._f.refs)&&we._f.refs.forEach(pe=>{pe.disabled=we._f.disabled||j}))},0,!1))},ae=(j,V)=>async J=>{let we;J&&(J.preventDefault&&J.preventDefault(),J.persist&&J.persist());let pe=pn(i);if(s.disabled.size)for(const fe of s.disabled)lt(pe,fe,void 0);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:fe,values:ge}=await T();n.errors=fe,pe=ge}else await D(r);if(kt(n.errors,"root"),mn(n.errors)){d.state.next({errors:{}});try{await j(pe,J)}catch(fe){we=fe}}else V&&await V({...n.errors},J),ie(),setTimeout(ie);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:mn(n.errors)&&!we,submitCount:n.submitCount+1,errors:n.errors}),we)throw we},H=(j,V={})=>{Se(r,j)&&(Pt(V.defaultValue)?Z(j,pn(Se(o,j))):(Z(j,V.defaultValue),lt(o,j,pn(V.defaultValue))),V.keepTouched||kt(n.touchedFields,j),V.keepDirty||(kt(n.dirtyFields,j),n.isDirty=V.defaultValue?O(j,pn(Se(o,j))):O()),V.keepError||(kt(n.errors,j),u.isValid&&v()),d.state.next({...n}))},ue=(j,V={})=>{const J=j?pn(j):o,we=pn(J),pe=mn(j),fe=pe?o:we;if(V.keepDefaultValues||(o=J),!V.keepValues){if(V.keepDirtyValues){const ge=new Set([...s.mount,...Object.keys(vl(o,i))]);for(const _e of Array.from(ge))Se(n.dirtyFields,_e)?lt(fe,_e,Se(i,_e)):Z(_e,Se(fe,_e))}else{if(rm&&Pt(j))for(const ge of s.mount){const _e=Se(r,ge);if(_e&&_e._f){const Xe=Array.isArray(_e._f.refs)?_e._f.refs[0]:_e._f.ref;if(Ku(Xe)){const k=Xe.closest("form");if(k){k.reset();break}}}}r={}}i=t.shouldUnregister?V.keepDefaultValues?pn(o):{}:pn(fe),d.array.next({values:{...fe}}),d.values.next({values:{...fe}})}s={mount:V.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!V.keepIsValid||!!V.keepDirtyValues,a.watch=!!t.shouldUnregister,d.state.next({submitCount:V.keepSubmitCount?n.submitCount:0,isDirty:pe?!1:V.keepDirty?n.isDirty:!!(V.keepDefaultValues&&!Ro(j,o)),isSubmitted:V.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:pe?{}:V.keepDirtyValues?V.keepDefaultValues&&i?vl(o,i):n.dirtyFields:V.keepDefaultValues&&j?vl(o,j):V.keepDirty?n.dirtyFields:{},touchedFields:V.keepTouched?n.touchedFields:{},errors:V.keepErrors?n.errors:{},isSubmitSuccessful:V.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},se=(j,V)=>ue(Nr(j)?j(i):j,V);return{control:{register:z,unregister:L,getFieldState:G,handleSubmit:ae,setError:q,_executeSchema:T,_getWatch:$,_getDirty:O,_updateValid:v,_removeUnmounted:A,_updateFieldArray:b,_updateDisabledField:K,_getFieldArray:W,_reset:ue,_resetDefaultValues:()=>Nr(t.defaultValues)&&t.defaultValues().then(j=>{se(j,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:j=>{n={...n,...j}},_disableForm:le,_subjects:d,_proxyFormState:u,_setErrors:_,get _fields(){return r},get _formValues(){return i},get _state(){return a},set _state(j){a=j},get _defaultValues(){return o},get _names(){return s},set _names(j){s=j},get _formState(){return n},set _formState(j){n=j},get _options(){return t},set _options(j){t={...t,...j}}},trigger:ee,register:z,handleSubmit:ae,watch:ce,setValue:Z,getValues:ne,reset:se,resetField:H,clearErrors:F,unregister:L,setError:q,setFocus:(j,V={})=>{const J=Se(r,j),we=J&&J._f;if(we){const pe=we.refs?we.refs[0]:we.ref;pe.focus&&(pe.focus(),V.shouldSelect&&Nr(pe.select)&&pe.select())}},getFieldState:G}}function EV(e={}){const t=E.useRef(void 0),n=E.useRef(void 0),[r,o]=E.useState({isDirty:!1,isValidating:!1,isLoading:Nr(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Nr(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...CV(e),formState:r});const i=t.current.control;return i._options=e,im({subject:i._subjects.state,next:a=>{AS(a,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),E.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),E.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==r.isDirty&&i._subjects.state.next({isDirty:a})}},[i,r.isDirty]),E.useEffect(()=>{e.values&&!Ro(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values,o(a=>({...a}))):i._resetDefaultValues()},[e.values,i]),E.useEffect(()=>{e.errors&&i._setErrors(e.errors)},[e.errors,i]),E.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),E.useEffect(()=>{e.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})},[e.shouldUnregister,i]),t.current.formState=DS(r,i),t.current}function ZS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function bl(...e){return t=>{let n=!1;const r=e.map(o=>{const i=ZS(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():ZS(e[o],null)}}}}function Me(...e){return y.useCallback(bl(...e),e)}var Zn=y.forwardRef((e,t)=>{const{children:n,...r}=e,o=y.Children.toArray(n),i=o.find(PV);if(i){const a=i.props.children,s=o.map(l=>l===i?y.Children.count(a)>1?y.Children.only(null):y.isValidElement(a)?a.props.children:null:l);return g.jsx(fm,{...r,ref:t,children:y.isValidElement(a)?y.cloneElement(a,void 0,s):null})}return g.jsx(fm,{...r,ref:t,children:n})});Zn.displayName="Slot";var fm=y.forwardRef((e,t)=>{const{children:n,...r}=e;if(y.isValidElement(n)){const o=NV(n),i=RV(r,n.props);return n.type!==y.Fragment&&(i.ref=t?bl(t,o):o),y.cloneElement(n,i)}return y.Children.count(n)>1?y.Children.only(null):null});fm.displayName="SlotClone";var Qu=({children:e})=>g.jsx(g.Fragment,{children:e});function PV(e){return y.isValidElement(e)&&e.type===Qu}function RV(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function NV(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)}var TV=Zn;const MV=Object.freeze(Object.defineProperty({__proto__:null,Root:TV,Slot:Zn,Slottable:Qu},Symbol.toStringTag,{value:"Module"}));var kV=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],be=kV.reduce((e,t)=>{const n=y.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?Zn:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ed(e,t){e&&xc.flushSync(()=>e.dispatchEvent(t))}var DV="VisuallyHidden",hm=y.forwardRef((e,t)=>g.jsx(be.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}}));hm.displayName=DV;var JS=hm;function AV(e,t){const n=y.createContext(t),r=i=>{const{children:a,...s}=i,l=y.useMemo(()=>s,Object.values(s));return g.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function o(i){const a=y.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function ct(e,t=[]){let n=[];function r(i,a){const s=y.createContext(a),l=n.length;n=[...n,a];const c=d=>{var w;const{scope:f,children:h,...p}=d,m=((w=f==null?void 0:f[e])==null?void 0:w[l])||s,v=y.useMemo(()=>p,Object.values(p));return g.jsx(m.Provider,{value:v,children:h})};c.displayName=i+"Provider";function u(d,f){var m;const h=((m=f==null?void 0:f[e])==null?void 0:m[l])||s,p=y.useContext(h);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(a=>y.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return y.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,IV(o,...t)]}function IV(...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(i){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...s,...d}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function No(e){const t=e+"CollectionProvider",[n,r]=ct(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:p,children:m}=h,v=E.useRef(null),w=E.useRef(new Map).current;return g.jsx(o,{scope:p,itemMap:w,collectionRef:v,children:m})};a.displayName=t;const s=e+"CollectionSlot",l=E.forwardRef((h,p)=>{const{scope:m,children:v}=h,w=i(s,m),b=Me(p,w.collectionRef);return g.jsx(Zn,{ref:b,children:v})});l.displayName=s;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=E.forwardRef((h,p)=>{const{scope:m,children:v,...w}=h,b=E.useRef(null),x=Me(p,b),_=i(c,m);return E.useEffect(()=>(_.itemMap.set(b,{ref:b,...w}),()=>void _.itemMap.delete(b))),g.jsx(Zn,{[u]:"",ref:x,children:v})});d.displayName=c;function f(h){const p=i(e+"CollectionConsumer",h);return E.useCallback(()=>{const v=p.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((_,C)=>w.indexOf(_.ref.current)-w.indexOf(C.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},f,r]}function de(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 ot(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function dt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=OV({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=ot(n),l=y.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function OV({defaultProp:e,onChange:t}){const n=y.useState(e),[r]=n,o=y.useRef(r),i=ot(t);return y.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var xt=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{};function jV(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var gt=e=>{const{present:t,children:n}=e,r=$V(t),o=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),i=Me(r.ref,FV(o));return typeof n=="function"||r.isPresent?y.cloneElement(o,{ref:i}):null};gt.displayName="Presence";function $V(e){const[t,n]=y.useState(),r=y.useRef({}),o=y.useRef(e),i=y.useRef("none"),a=e?"mounted":"unmounted",[s,l]=jV(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=td(r.current);i.current=s==="mounted"?c:"none"},[s]),xt(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,h=td(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]),xt(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const m=td(r.current).includes(h.animationName);if(h.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=h=>{h.target===t&&(i.current=td(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:y.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function td(e){return(e==null?void 0:e.animationName)||"none"}function FV(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)}var LV=y.useId||(()=>{}),zV=0;function Rt(e){const[t,n]=y.useState(LV());return xt(()=>{e||n(r=>r??String(zV++))},[e]),e||(t?`radix-${t}`:"")}var pm="Collapsible",[BV,QS]=ct(pm),[HV,mm]=BV(pm),e1=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:a,...s}=e,[l=!1,c]=dt({prop:r,defaultProp:o,onChange:a});return g.jsx(HV,{scope:n,disabled:i,contentId:Rt(),open:l,onOpenToggle:y.useCallback(()=>c(u=>!u),[c]),children:g.jsx(be.div,{"data-state":ym(l),"data-disabled":i?"":void 0,...s,ref:t})})});e1.displayName=pm;var t1="CollapsibleTrigger",gm=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=mm(t1,n);return g.jsx(be.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ym(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:de(e.onClick,o.onOpenToggle)})});gm.displayName=t1;var wm="CollapsibleContent",vm=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=mm(wm,e.__scopeCollapsible);return g.jsx(gt,{present:n||o.open,children:({present:i})=>g.jsx(VV,{...r,ref:t,present:i})})});vm.displayName=wm;var VV=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,a=mm(wm,n),[s,l]=y.useState(r),c=y.useRef(null),u=Me(t,c),d=y.useRef(0),f=d.current,h=y.useRef(0),p=h.current,m=a.open||s,v=y.useRef(m),w=y.useRef(void 0);return y.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),xt(()=>{const b=c.current;if(b){w.current=w.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const x=b.getBoundingClientRect();d.current=x.height,h.current=x.width,v.current||(b.style.transitionDuration=w.current.transitionDuration,b.style.animationName=w.current.animationName),l(r)}},[a.open,r]),g.jsx(be.div,{"data-state":ym(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!m,...i,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style},children:m&&o})});function ym(e){return e?"open":"closed"}var n1=e1,UV=gm,WV=vm,GV=y.createContext(void 0);function Jn(e){const t=y.useContext(GV);return e||t||"ltr"}var Zr="Accordion",qV=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[bm,YV,KV]=No(Zr),[nd,Qre]=ct(Zr,[KV,QS]),xm=QS(),r1=E.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return g.jsx(bm.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?g.jsx(QV,{...i,ref:t}):g.jsx(JV,{...o,ref:t})})});r1.displayName=Zr;var[o1,XV]=nd(Zr),[i1,ZV]=nd(Zr,{collapsible:!1}),JV=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...a}=e,[s,l]=dt({prop:n,defaultProp:r,onChange:o});return g.jsx(o1,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:l,onItemClose:E.useCallback(()=>i&&l(""),[i,l]),children:g.jsx(i1,{scope:e.__scopeAccordion,collapsible:i,children:g.jsx(a1,{...a,ref:t})})})}),QV=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a=[],s]=dt({prop:n,defaultProp:r,onChange:o}),l=E.useCallback(u=>s((d=[])=>[...d,u]),[s]),c=E.useCallback(u=>s((d=[])=>d.filter(f=>f!==u)),[s]);return g.jsx(o1,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:c,children:g.jsx(i1,{scope:e.__scopeAccordion,collapsible:!0,children:g.jsx(a1,{...i,ref:t})})})}),[eU,rd]=nd(Zr),a1=E.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...a}=e,s=E.useRef(null),l=Me(s,t),c=YV(n),d=Jn(o)==="ltr",f=de(e.onKeyDown,h=>{var T;if(!qV.includes(h.key))return;const p=h.target,m=c().filter(M=>{var D;return!((D=M.ref.current)!=null&&D.disabled)}),v=m.findIndex(M=>M.ref.current===p),w=m.length;if(v===-1)return;h.preventDefault();let b=v;const x=0,_=w-1,C=()=>{b=v+1,b>_&&(b=x)},N=()=>{b=v-1,b<x&&(b=_)};switch(h.key){case"Home":b=x;break;case"End":b=_;break;case"ArrowRight":i==="horizontal"&&(d?C():N());break;case"ArrowDown":i==="vertical"&&C();break;case"ArrowLeft":i==="horizontal"&&(d?N():C());break;case"ArrowUp":i==="vertical"&&N();break}const R=b%w;(T=m[R].ref.current)==null||T.focus()});return g.jsx(eU,{scope:n,disabled:r,direction:o,orientation:i,children:g.jsx(bm.Slot,{scope:n,children:g.jsx(be.div,{...a,"data-orientation":i,ref:l,onKeyDown:r?void 0:f})})})}),od="AccordionItem",[tU,_m]=nd(od),s1=E.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=rd(od,n),a=XV(od,n),s=xm(n),l=Rt(),c=r&&a.value.includes(r)||!1,u=i.disabled||e.disabled;return g.jsx(tU,{scope:n,open:c,disabled:u,triggerId:l,children:g.jsx(n1,{"data-orientation":i.orientation,"data-state":h1(c),...s,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?a.onItemOpen(r):a.onItemClose(r)}})})});s1.displayName=od;var l1="AccordionHeader",c1=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=rd(Zr,n),i=_m(l1,n);return g.jsx(be.h3,{"data-orientation":o.orientation,"data-state":h1(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});c1.displayName=l1;var Sm="AccordionTrigger",u1=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=rd(Zr,n),i=_m(Sm,n),a=ZV(Sm,n),s=xm(n);return g.jsx(bm.ItemSlot,{scope:n,children:g.jsx(UV,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...s,...r,ref:t})})});u1.displayName=Sm;var d1="AccordionContent",f1=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=rd(Zr,n),i=_m(d1,n),a=xm(n);return g.jsx(WV,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation,...a,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});f1.displayName=d1;function h1(e){return e?"open":"closed"}var nU=r1,rU=s1,oU=c1,iU=u1,aU=f1;function sU(e,t=globalThis==null?void 0:globalThis.document){const n=ot(e);y.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 lU="DismissableLayer",Cm="dismissableLayer.update",cU="dismissableLayer.pointerDownOutside",uU="dismissableLayer.focusOutside",p1,m1=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),To=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=y.useContext(m1),[u,d]=y.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=y.useState({}),p=Me(t,R=>d(R)),m=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=m.indexOf(v),b=u?m.indexOf(u):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,_=b>=w,C=hU(R=>{const T=R.target,M=[...c.branches].some(D=>D.contains(T));!_||M||(o==null||o(R),a==null||a(R),R.defaultPrevented||s==null||s())},f),N=pU(R=>{const T=R.target;[...c.branches].some(D=>D.contains(T))||(i==null||i(R),a==null||a(R),R.defaultPrevented||s==null||s())},f);return sU(R=>{b===c.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&s&&(R.preventDefault(),s()))},f),y.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(p1=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),g1(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=p1)}},[u,f,n,c]),y.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),g1())},[u,c]),y.useEffect(()=>{const R=()=>h({});return document.addEventListener(Cm,R),()=>document.removeEventListener(Cm,R)},[]),g.jsx(be.div,{...l,ref:p,style:{pointerEvents:x?_?"auto":"none":void 0,...e.style},onFocusCapture:de(e.onFocusCapture,N.onFocusCapture),onBlurCapture:de(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:de(e.onPointerDownCapture,C.onPointerDownCapture)})});To.displayName=lU;var dU="DismissableLayerBranch",fU=y.forwardRef((e,t)=>{const n=y.useContext(m1),r=y.useRef(null),o=Me(t,r);return y.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(be.div,{...e,ref:o})});fU.displayName=dU;function hU(e,t=globalThis==null?void 0:globalThis.document){const n=ot(e),r=y.useRef(!1),o=y.useRef(()=>{});return y.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let l=function(){w1(cU,n,c,{discrete:!0})};const c={originalEvent:s};s.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},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function pU(e,t=globalThis==null?void 0:globalThis.document){const n=ot(e),r=y.useRef(!1);return y.useEffect(()=>{const o=i=>{i.target&&!r.current&&w1(uU,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function g1(){const e=new CustomEvent(Cm);document.dispatchEvent(e)}function w1(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ed(o,i):o.dispatchEvent(i)}var Em="focusScope.autoFocusOnMount",Pm="focusScope.autoFocusOnUnmount",v1={bubbles:!1,cancelable:!0},mU="FocusScope",xl=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=y.useState(null),c=ot(o),u=ot(i),d=y.useRef(null),f=Me(t,m=>l(m)),h=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let m=function(x){if(h.paused||!s)return;const _=x.target;s.contains(_)?d.current=_:Mo(d.current,{select:!0})},v=function(x){if(h.paused||!s)return;const _=x.relatedTarget;_!==null&&(s.contains(_)||Mo(d.current,{select:!0}))},w=function(x){if(document.activeElement===document.body)for(const C of x)C.removedNodes.length>0&&Mo(s)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const b=new MutationObserver(w);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),b.disconnect()}}},[r,s,h.paused]),y.useEffect(()=>{if(s){x1.add(h);const m=document.activeElement;if(!s.contains(m)){const w=new CustomEvent(Em,v1);s.addEventListener(Em,c),s.dispatchEvent(w),w.defaultPrevented||(gU(xU(y1(s)),{select:!0}),document.activeElement===m&&Mo(s))}return()=>{s.removeEventListener(Em,c),setTimeout(()=>{const w=new CustomEvent(Pm,v1);s.addEventListener(Pm,u),s.dispatchEvent(w),w.defaultPrevented||Mo(m??document.body,{select:!0}),s.removeEventListener(Pm,u),x1.remove(h)},0)}}},[s,c,u,h]);const p=y.useCallback(m=>{if(!n&&!r||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,w=document.activeElement;if(v&&w){const b=m.currentTarget,[x,_]=wU(b);x&&_?!m.shiftKey&&w===_?(m.preventDefault(),n&&Mo(x,{select:!0})):m.shiftKey&&w===x&&(m.preventDefault(),n&&Mo(_,{select:!0})):w===b&&m.preventDefault()}},[n,r,h.paused]);return g.jsx(be.div,{tabIndex:-1,...a,ref:f,onKeyDown:p})});xl.displayName=mU;function gU(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Mo(r,{select:t}),document.activeElement!==n)return}function wU(e){const t=y1(e),n=b1(t,e),r=b1(t.reverse(),e);return[n,r]}function y1(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 b1(e,t){for(const n of e)if(!vU(n,{upTo:t}))return n}function vU(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function yU(e){return e instanceof HTMLInputElement&&"select"in e}function Mo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&yU(e)&&t&&e.select()}}var x1=bU();function bU(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_1(e,t),e.unshift(t)},remove(t){var n;e=_1(e,t),(n=e[0])==null||n.resume()}}}function _1(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function xU(e){return e.filter(t=>t.tagName!=="A")}var _U="Portal",_l=y.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=y.useState(!1);xt(()=>i(!0),[]);const a=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?ur.createPortal(g.jsx(be.div,{...r,ref:t}),a):null});_l.displayName=_U;var Rm=0;function id(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??S1()),document.body.insertAdjacentElement("beforeend",e[1]??S1()),Rm++,()=>{Rm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Rm--}},[])}function S1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Wt=function(){return Wt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Wt.apply(this,arguments)};function Nm(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 C1(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Sl="right-scroll-bar-position",Cl="width-before-scroll-bar",SU="with-scroll-bars-hidden",CU="--removed-body-scroll-bar-size";function Tm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function EU(e,t){var n=E.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 PU=typeof window<"u"?y.useLayoutEffect:y.useEffect,E1=new WeakMap;function P1(e,t){var n=EU(null,function(r){return e.forEach(function(o){return Tm(o,r)})});return PU(function(){var r=E1.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(s){i.has(s)||Tm(s,null)}),i.forEach(function(s){o.has(s)||Tm(s,a)})}E1.set(n,e)},[e]),n}function RU(e){return e}function NU(e,t){t===void 0&&(t=RU);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(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(i),a=n}var l=function(){var u=a;a=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){a.push(u),c()},filter:function(u){return a=a.filter(u),n}}}};return o}function R1(e){e===void 0&&(e={});var t=NU(null);return t.options=Wt({async:!0,ssr:!1},e),t}var N1=function(e){var t=e.sideCar,n=Nm(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 y.createElement(r,Wt({},n))};N1.isSideCarExport=!0;function T1(e,t){return e.useMedium(t),N1}var M1=R1(),Mm=function(){},ad=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Mm,onWheelCapture:Mm,onTouchMoveCapture:Mm}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noIsolation,p=e.inert,m=e.allowPinchZoom,v=e.as,w=v===void 0?"div":v,b=e.gapMode,x=Nm(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=f,C=P1([n,t]),N=Wt(Wt({},x),o);return y.createElement(y.Fragment,null,u&&y.createElement(_,{sideCar:M1,removeScrollBar:c,shards:d,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),a?y.cloneElement(y.Children.only(s),Wt(Wt({},N),{ref:C})):y.createElement(w,Wt({},N,{className:l,ref:C}),s))});ad.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ad.classNames={fullWidth:Cl,zeroRight:Sl};var TU=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function MU(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=TU();return t&&e.setAttribute("nonce",t),e}function kU(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function DU(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var AU=function(){var e=0,t=null;return{add:function(n){e==0&&(t=MU())&&(kU(t,n),DU(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},IU=function(){var e=AU();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},km=function(){var e=IU(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},OU={left:0,top:0,right:0,gap:0},Dm=function(e){return parseInt(e||"",10)||0},jU=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[Dm(n),Dm(r),Dm(o)]},$U=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return OU;var t=jU(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])}},FU=km(),ba="data-scroll-locked",LU=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
262
262
|
.`.concat(SU,` {
|
|
263
263
|
overflow: hidden `).concat(r,`;
|
|
264
264
|
padding-right: `).concat(s,"px ").concat(r,`;
|
|
@@ -308,12 +308,12 @@ You can add a description to the \`${Ta}\` by passing a \`${dC}\` component as a
|
|
|
308
308
|
|
|
309
309
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ta}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
310
310
|
|
|
311
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return y.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},bW=oC,xW=iC,_W=aC,gC=sC,wC=lC,vC=hC,yC=mC,bC=uC,xC=fC,SW="AspectRatio",_C=y.forwardRef((e,t)=>{const{ratio:n=1/1,style:r,...o}=e;return g.jsx("div",{style:{position:"relative",width:"100%",paddingBottom:`${100/n}%`},"data-radix-aspect-ratio-wrapper":"",children:g.jsx(be.div,{...o,ref:t,style:{...r,position:"absolute",top:0,right:0,bottom:0,left:0}})})});_C.displayName=SW;var CW=_C,Lm="Avatar",[EW,toe]=ct(Lm),[PW,SC]=EW(Lm),CC=y.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=y.useState("idle");return g.jsx(PW,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:g.jsx(be.span,{...r,ref:t})})});CC.displayName=Lm;var EC="AvatarImage",PC=y.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,a=SC(EC,n),s=RW(r,i.referrerPolicy),l=ot(c=>{o(c),a.onImageLoadingStatusChange(c)});return xt(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?g.jsx(be.img,{...i,ref:t,src:r}):null});PC.displayName=EC;var RC="AvatarFallback",NC=y.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=SC(RC,n),[a,s]=y.useState(r===void 0);return y.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&i.imageLoadingStatus!=="loaded"?g.jsx(be.span,{...o,ref:t}):null});NC.displayName=RC;function RW(e,t){const[n,r]=y.useState("idle");return xt(()=>{if(!e){r("error");return}let o=!0;const i=new window.Image,a=s=>()=>{o&&r(s)};return r("loading"),i.onload=a("loaded"),i.onerror=a("error"),i.src=e,t&&(i.referrerPolicy=t),()=>{o=!1}},[e,t]),n}var TC=CC,MC=PC,kC=NC;function Ma(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Rl(e){const[t,n]=y.useState(void 0);return xt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var zm="Checkbox",[NW,noe]=ct(zm),[TW,MW]=NW(zm),DC=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=e,[f,h]=y.useState(null),p=Me(t,_=>h(_)),m=y.useRef(!1),v=f?u||!!f.closest("form"):!0,[w=!1,b]=dt({prop:o,defaultProp:i,onChange:c}),x=y.useRef(w);return y.useEffect(()=>{const _=f==null?void 0:f.form;if(_){const C=()=>b(x.current);return _.addEventListener("reset",C),()=>_.removeEventListener("reset",C)}},[f,b]),g.jsxs(TW,{scope:n,state:w,disabled:s,children:[g.jsx(be.button,{type:"button",role:"checkbox","aria-checked":ko(w)?"mixed":w,"aria-required":a,"data-state":OC(w),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:p,onKeyDown:de(e.onKeyDown,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:de(e.onClick,_=>{b(C=>ko(C)?!0:!C),v&&(m.current=_.isPropagationStopped(),m.current||_.stopPropagation())})}),v&&g.jsx(kW,{control:f,bubbles:!m.current,name:r,value:l,checked:w,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"},defaultChecked:ko(i)?!1:i})]})});DC.displayName=zm;var AC="CheckboxIndicator",IC=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=MW(AC,n);return g.jsx(gt,{present:r||ko(i.state)||i.state===!0,children:g.jsx(be.span,{"data-state":OC(i.state),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});IC.displayName=AC;var kW=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...i}=e,a=y.useRef(null),s=Ma(n),l=Rl(t);y.useEffect(()=>{const u=a.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(s!==n&&h){const p=new Event("click",{bubbles:r});u.indeterminate=ko(n),h.call(u,ko(n)?!1:n),u.dispatchEvent(p)}},[s,n,r]);const c=y.useRef(ko(n)?!1:n);return g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...i,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ko(e){return e==="indeterminate"}function OC(e){return ko(e)?"indeterminate":e?"checked":"unchecked"}var jC=DC,DW=IC;const AW=["top","right","bottom","left"],Do=Math.min,Nn=Math.max,md=Math.round,gd=Math.floor,Tr=e=>({x:e,y:e}),IW={left:"right",right:"left",bottom:"top",top:"bottom"},OW={start:"end",end:"start"};function Bm(e,t,n){return Nn(e,Do(t,n))}function Qr(e,t){return typeof e=="function"?e(t):e}function eo(e){return e.split("-")[0]}function ka(e){return e.split("-")[1]}function Hm(e){return e==="x"?"y":"x"}function Vm(e){return e==="y"?"height":"width"}function Ao(e){return["top","bottom"].includes(eo(e))?"y":"x"}function Um(e){return Hm(Ao(e))}function jW(e,t,n){n===void 0&&(n=!1);const r=ka(e),o=Um(e),i=Vm(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=wd(a)),[a,wd(a)]}function $W(e){const t=wd(e);return[Wm(e),t,Wm(t)]}function Wm(e){return e.replace(/start|end/g,t=>OW[t])}function FW(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function LW(e,t,n,r){const o=ka(e);let i=FW(eo(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Wm)))),i}function wd(e){return e.replace(/left|right|bottom|top/g,t=>IW[t])}function zW(e){return{top:0,right:0,bottom:0,left:0,...e}}function $C(e){return typeof e!="number"?zW(e):{top:e,right:e,bottom:e,left:e}}function vd(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}}function FC(e,t,n){let{reference:r,floating:o}=e;const i=Ao(t),a=Um(t),s=Vm(a),l=eo(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/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(ka(t)){case"start":h[a]-=f*(n&&c?-1:1);break;case"end":h[a]+=f*(n&&c?-1:1);break}return h}const BW=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=FC(c,r,l),f=r,h={},p=0;for(let m=0;m<s.length;m++){const{name:v,fn:w}=s[m],{x:b,y:x,data:_,reset:C}=await w({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=b??u,d=x??d,h={...h,[v]:{...h[v],..._}},C&&p<=50&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:d}=FC(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function Nl(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Qr(t,e),p=$C(h),v=s[f?d==="floating"?"reference":"floating":d],w=vd(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),_=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=vd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:x,strategy:l}):b);return{top:(w.top-C.top+p.top)/_.y,bottom:(C.bottom-w.bottom+p.bottom)/_.y,left:(w.left-C.left+p.left)/_.x,right:(C.right-w.right+p.right)/_.x}}const HW=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Qr(e,t)||{};if(c==null)return{};const d=$C(u),f={x:n,y:r},h=Um(o),p=Vm(h),m=await a.getDimensions(c),v=h==="y",w=v?"top":"left",b=v?"bottom":"right",x=v?"clientHeight":"clientWidth",_=i.reference[p]+i.reference[h]-f[h]-i.floating[p],C=f[h]-i.reference[h],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let R=N?N[x]:0;(!R||!await(a.isElement==null?void 0:a.isElement(N)))&&(R=s.floating[x]||i.floating[p]);const T=_/2-C/2,M=R/2-m[p]/2-1,D=Do(d[w],M),A=Do(d[b],M),j=D,$=R-m[p]-A,W=R/2-m[p]/2+T,re=Bm(j,W,$),Y=!l.arrow&&ka(o)!=null&&W!==re&&i.reference[p]/2-(W<j?D:A)-m[p]/2<0,Z=Y?W<j?W-j:W-$:0;return{[h]:f[h]+Z,data:{[h]:re,centerOffset:W-re-Z,...Y&&{alignmentOffset:Z}},reset:Y}}}),VW=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...v}=Qr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=eo(o),b=Ao(s),x=eo(s)===s,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=f||(x||!m?[wd(s)]:$W(s)),N=p!=="none";!f&&N&&C.push(...LW(s,m,p,_));const R=[s,...C],T=await Nl(t,v),M=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&M.push(T[w]),d){const W=jW(o,a,_);M.push(T[W[0]],T[W[1]])}if(D=[...D,{placement:o,overflows:M}],!M.every(W=>W<=0)){var A,j;const W=(((A=i.flip)==null?void 0:A.index)||0)+1,re=R[W];if(re)return{data:{index:W,overflows:D},reset:{placement:re}};let Y=(j=D.filter(Z=>Z.overflows[0]<=0).sort((Z,B)=>Z.overflows[1]-B.overflows[1])[0])==null?void 0:j.placement;if(!Y)switch(h){case"bestFit":{var $;const Z=($=D.filter(B=>{if(N){const oe=Ao(B.placement);return oe===b||oe==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(oe=>oe>0).reduce((oe,ee)=>oe+ee,0)]).sort((B,oe)=>B[1]-oe[1])[0])==null?void 0:$[0];Z&&(Y=Z);break}case"initialPlacement":Y=s;break}if(o!==Y)return{reset:{placement:Y}}}return{}}}};function LC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zC(e){return AW.some(t=>e[t]>=0)}const UW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Qr(e,t);switch(r){case"referenceHidden":{const i=await Nl(t,{...o,elementContext:"reference"}),a=LC(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:zC(a)}}}case"escaped":{const i=await Nl(t,{...o,altBoundary:!0}),a=LC(i,n.floating);return{data:{escapedOffsets:a,escaped:zC(a)}}}default:return{}}}}};async function WW(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=eo(n),s=ka(n),l=Ao(n)==="y",c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d=Qr(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof p=="number"&&(h=s==="end"?p*-1:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const GW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await WW(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},qW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:v=>{let{x:w,y:b}=v;return{x:w,y:b}}},...l}=Qr(e,t),c={x:n,y:r},u=await Nl(t,l),d=Ao(eo(o)),f=Hm(d);let h=c[f],p=c[d];if(i){const v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",b=h+u[v],x=h-u[w];h=Bm(b,h,x)}if(a){const v=d==="y"?"top":"left",w=d==="y"?"bottom":"right",b=p+u[v],x=p-u[w];p=Bm(b,p,x)}const m=s.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:i,[d]:a}}}}}},YW=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Qr(e,t),u={x:n,y:r},d=Ao(o),f=Hm(d);let h=u[f],p=u[d];const m=Qr(s,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const x=f==="y"?"height":"width",_=i.reference[f]-i.floating[x]+v.mainAxis,C=i.reference[f]+i.reference[x]-v.mainAxis;h<_?h=_:h>C&&(h=C)}if(c){var w,b;const x=f==="y"?"width":"height",_=["top","left"].includes(eo(o)),C=i.reference[d]-i.floating[x]+(_&&((w=a.offset)==null?void 0:w[d])||0)+(_?0:v.crossAxis),N=i.reference[d]+i.reference[x]+(_?0:((b=a.offset)==null?void 0:b[d])||0)-(_?v.crossAxis:0);p<C?p=C:p>N&&(p=N)}return{[f]:h,[d]:p}}}},KW=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=Qr(e,t),u=await Nl(t,c),d=eo(o),f=ka(o),h=Ao(o)==="y",{width:p,height:m}=i.floating;let v,w;d==="top"||d==="bottom"?(v=d,w=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(w=d,v=f==="end"?"top":"bottom");const b=m-u.top-u.bottom,x=p-u.left-u.right,_=Do(m-u[v],b),C=Do(p-u[w],x),N=!t.middlewareData.shift;let R=_,T=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=b),N&&!f){const D=Nn(u.left,0),A=Nn(u.right,0),j=Nn(u.top,0),$=Nn(u.bottom,0);h?T=p-2*(D!==0||A!==0?D+A:Nn(u.left,u.right)):R=m-2*(j!==0||$!==0?j+$:Nn(u.top,u.bottom))}await l({...t,availableWidth:T,availableHeight:R});const M=await a.getDimensions(s.floating);return p!==M.width||m!==M.height?{reset:{rects:!0}}:{}}}};function yd(){return typeof window<"u"}function Da(e){return BC(e)?(e.nodeName||"").toLowerCase():"#document"}function Tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mr(e){var t;return(t=(BC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function BC(e){return yd()?e instanceof Node||e instanceof Tn(e).Node:!1}function er(e){return yd()?e instanceof Element||e instanceof Tn(e).Element:!1}function kr(e){return yd()?e instanceof HTMLElement||e instanceof Tn(e).HTMLElement:!1}function HC(e){return!yd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Tn(e).ShadowRoot}function Tl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=tr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function XW(e){return["table","td","th"].includes(Da(e))}function bd(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Gm(e){const t=qm(),n=er(e)?tr(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function ZW(e){let t=Io(e);for(;kr(t)&&!Aa(t);){if(Gm(t))return t;if(bd(t))return null;t=Io(t)}return null}function qm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Aa(e){return["html","body","#document"].includes(Da(e))}function tr(e){return Tn(e).getComputedStyle(e)}function xd(e){return er(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Io(e){if(Da(e)==="html")return e;const t=e.assignedSlot||e.parentNode||HC(e)&&e.host||Mr(e);return HC(t)?t.host:t}function VC(e){const t=Io(e);return Aa(t)?e.ownerDocument?e.ownerDocument.body:e.body:kr(t)&&Tl(t)?t:VC(t)}function Ml(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=VC(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Tn(o);if(i){const s=Ym(a);return t.concat(a,a.visualViewport||[],Tl(o)?o:[],s&&n?Ml(s):[])}return t.concat(o,Ml(o,[],n))}function Ym(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function UC(e){const t=tr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=kr(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=md(n)!==i||md(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Km(e){return er(e)?e:e.contextElement}function Ia(e){const t=Km(e);if(!kr(t))return Tr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=UC(t);let a=(i?md(n.width):n.width)/r,s=(i?md(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const JW=Tr(0);function WC(e){const t=Tn(e);return!qm()||!t.visualViewport?JW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function QW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Tn(e)?!1:t}function mi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Km(e);let a=Tr(1);t&&(r?er(r)&&(a=Ia(r)):a=Ia(e));const s=QW(i,n,r)?WC(i):Tr(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const f=Tn(i),h=r&&er(r)?Tn(r):r;let p=f,m=Ym(p);for(;m&&r&&h!==p;){const v=Ia(m),w=m.getBoundingClientRect(),b=tr(m),x=w.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,_=w.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=x,c+=_,p=Tn(m),m=Ym(p)}}return vd({width:u,height:d,x:l,y:c})}function Xm(e,t){const n=xd(e).scrollLeft;return t?t.left+n:mi(Mr(e)).left+n}function GC(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Xm(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function eG(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=Mr(r),s=t?bd(t.floating):!1;if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Tr(1);const u=Tr(0),d=kr(r);if((d||!d&&!i)&&((Da(r)!=="body"||Tl(a))&&(l=xd(r)),kr(r))){const h=mi(r);c=Ia(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=a&&!d&&!i?GC(a,l,!0):Tr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function tG(e){return Array.from(e.getClientRects())}function nG(e){const t=Mr(e),n=xd(e),r=e.ownerDocument.body,o=Nn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Nn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Xm(e);const s=-n.scrollTop;return tr(r).direction==="rtl"&&(a+=Nn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function rG(e,t){const n=Tn(e),r=Mr(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const c=qm();(!c||c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}function oG(e,t){const n=mi(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=kr(e)?Ia(e):Tr(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:a,height:s,x:l,y:c}}function qC(e,t,n){let r;if(t==="viewport")r=rG(e,n);else if(t==="document")r=nG(Mr(e));else if(er(t))r=oG(t,n);else{const o=WC(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return vd(r)}function YC(e,t){const n=Io(e);return n===t||!er(n)||Aa(n)?!1:tr(n).position==="fixed"||YC(n,t)}function iG(e,t){const n=t.get(e);if(n)return n;let r=Ml(e,[],!1).filter(s=>er(s)&&Da(s)!=="body"),o=null;const i=tr(e).position==="fixed";let a=i?Io(e):e;for(;er(a)&&!Aa(a);){const s=tr(a),l=Gm(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Tl(a)&&!l&&YC(e,a))?r=r.filter(u=>u!==a):o=s,a=Io(a)}return t.set(e,r),r}function aG(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?bd(t)?[]:iG(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const d=qC(t,u,o);return c.top=Nn(d.top,c.top),c.right=Do(d.right,c.right),c.bottom=Do(d.bottom,c.bottom),c.left=Nn(d.left,c.left),c},qC(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function sG(e){const{width:t,height:n}=UC(e);return{width:t,height:n}}function lG(e,t,n){const r=kr(t),o=Mr(t),i=n==="fixed",a=mi(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Tr(0);if(r||!r&&!i)if((Da(t)!=="body"||Tl(o))&&(s=xd(t)),r){const f=mi(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&(l.x=Xm(o));const c=o&&!r&&!i?GC(o,s):Tr(0),u=a.left+s.scrollLeft-l.x-c.x,d=a.top+s.scrollTop-l.y-c.y;return{x:u,y:d,width:a.width,height:a.height}}function Zm(e){return tr(e).position==="static"}function KC(e,t){if(!kr(e)||tr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Mr(e)===n&&(n=n.ownerDocument.body),n}function XC(e,t){const n=Tn(e);if(bd(e))return n;if(!kr(e)){let o=Io(e);for(;o&&!Aa(o);){if(er(o)&&!Zm(o))return o;o=Io(o)}return n}let r=KC(e,t);for(;r&&XW(r)&&Zm(r);)r=KC(r,t);return r&&Aa(r)&&Zm(r)&&!Gm(r)?n:r||ZW(e)||n}const cG=async function(e){const t=this.getOffsetParent||XC,n=this.getDimensions,r=await n(e.floating);return{reference:lG(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uG(e){return tr(e).direction==="rtl"}const dG={convertOffsetParentRelativeRectToViewportRelativeRect:eG,getDocumentElement:Mr,getClippingRect:aG,getOffsetParent:XC,getElementRects:cG,getClientRects:tG,getDimensions:sG,getScale:Ia,isElement:er,isRTL:uG};function ZC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fG(e,t){let n=null,r;const o=Mr(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=c;if(s||t(),!f||!h)return;const p=gd(d),m=gd(o.clientWidth-(u+f)),v=gd(o.clientHeight-(d+h)),w=gd(u),x={rootMargin:-p+"px "+-m+"px "+-v+"px "+-w+"px",threshold:Nn(0,Do(1,l))||1};let _=!0;function C(N){const R=N[0].intersectionRatio;if(R!==l){if(!_)return a();R?a(!1,R):r=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!ZC(c,e.getBoundingClientRect())&&a(),_=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return a(!0),i}function hG(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Km(e),u=o||i?[...c?Ml(c):[],...Ml(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const d=c&&s?fG(c,n):null;let f=-1,h=null;a&&(h=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let p,m=l?mi(e):null;l&&v();function v(){const w=mi(e);m&&!ZC(m,w)&&n(),m=w,p=requestAnimationFrame(v)}return n(),()=>{var w;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d==null||d(),(w=h)==null||w.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const pG=GW,mG=qW,gG=VW,wG=KW,vG=UW,JC=HW,yG=YW,bG=(e,t,n)=>{const r=new Map,o={platform:dG,...n},i={...o.platform,_c:r};return BW(e,t,{...o,platform:i})};var _d=typeof document<"u"?E.useLayoutEffect:E.useEffect;function Sd(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(!Sd(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Sd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function QC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eE(e,t){const n=QC(e);return Math.round(t*n)/n}function Jm(e){const t=y.useRef(e);return _d(()=>{t.current=e}),t}function xG(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=y.useState(r);Sd(f,r)||h(r);const[p,m]=y.useState(null),[v,w]=y.useState(null),b=y.useCallback(B=>{B!==N.current&&(N.current=B,m(B))},[]),x=y.useCallback(B=>{B!==R.current&&(R.current=B,w(B))},[]),_=i||p,C=a||v,N=y.useRef(null),R=y.useRef(null),T=y.useRef(u),M=l!=null,D=Jm(l),A=Jm(o),j=Jm(c),$=y.useCallback(()=>{if(!N.current||!R.current)return;const B={placement:t,strategy:n,middleware:f};A.current&&(B.platform=A.current),bG(N.current,R.current,B).then(oe=>{const ee={...oe,isPositioned:j.current!==!1};W.current&&!Sd(T.current,ee)&&(T.current=ee,xc.flushSync(()=>{d(ee)}))})},[f,t,n,A,j]);_d(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(B=>({...B,isPositioned:!1})))},[c]);const W=y.useRef(!1);_d(()=>(W.current=!0,()=>{W.current=!1}),[]),_d(()=>{if(_&&(N.current=_),C&&(R.current=C),_&&C){if(D.current)return D.current(_,C,$);$()}},[_,C,$,D,M]);const re=y.useMemo(()=>({reference:N,floating:R,setReference:b,setFloating:x}),[b,x]),Y=y.useMemo(()=>({reference:_,floating:C}),[_,C]),Z=y.useMemo(()=>{const B={position:n,left:0,top:0};if(!Y.floating)return B;const oe=eE(Y.floating,u.x),ee=eE(Y.floating,u.y);return s?{...B,transform:"translate("+oe+"px, "+ee+"px)",...QC(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:oe,top:ee}},[n,s,Y.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:$,refs:re,elements:Y,floatingStyles:Z}),[u,$,re,Y,Z])}const _G=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?JC({element:r.current,padding:o}).fn(n):{}:r?JC({element:r,padding:o}).fn(n):{}}}},SG=(e,t)=>({...pG(e),options:[e,t]}),CG=(e,t)=>({...mG(e),options:[e,t]}),EG=(e,t)=>({...yG(e),options:[e,t]}),PG=(e,t)=>({...gG(e),options:[e,t]}),RG=(e,t)=>({...wG(e),options:[e,t]}),NG=(e,t)=>({...vG(e),options:[e,t]}),TG=(e,t)=>({..._G(e),options:[e,t]});var MG="Arrow",tE=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return g.jsx(be.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});tE.displayName=MG;var kG=tE,Qm="Popper",[nE,Dr]=ct(Qm),[DG,rE]=nE(Qm),oE=e=>{const{__scopePopper:t,children:n}=e,[r,o]=y.useState(null);return g.jsx(DG,{scope:t,anchor:r,onAnchorChange:o,children:n})};oE.displayName=Qm;var iE="PopperAnchor",aE=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=rE(iE,n),a=y.useRef(null),s=Me(t,a);return y.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:g.jsx(be.div,{...o,ref:s})});aE.displayName=iE;var eg="PopperContent",[AG,IG]=nE(eg),sE=y.forwardRef((e,t)=>{var K,z,ie,le,ae,H;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:p,...m}=e,v=rE(eg,n),[w,b]=y.useState(null),x=Me(t,ue=>b(ue)),[_,C]=y.useState(null),N=Rl(_),R=(N==null?void 0:N.width)??0,T=(N==null?void 0:N.height)??0,M=r+(i!=="center"?"-"+i:""),D=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},A=Array.isArray(c)?c:[c],j=A.length>0,$={padding:D,boundary:A.filter(jG),altBoundary:j},{refs:W,floatingStyles:re,placement:Y,isPositioned:Z,middlewareData:B}=xG({strategy:"fixed",placement:M,whileElementsMounted:(...ue)=>hG(...ue,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[SG({mainAxis:o+T,alignmentAxis:a}),l&&CG({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?EG():void 0,...$}),l&&PG({...$}),RG({...$,apply:({elements:ue,rects:se,availableWidth:ye,availableHeight:Ce})=>{const{width:xe,height:O}=se.reference,V=ue.floating.style;V.setProperty("--radix-popper-available-width",`${ye}px`),V.setProperty("--radix-popper-available-height",`${Ce}px`),V.setProperty("--radix-popper-anchor-width",`${xe}px`),V.setProperty("--radix-popper-anchor-height",`${O}px`)}}),_&&TG({element:_,padding:s}),$G({arrowWidth:R,arrowHeight:T}),f&&NG({strategy:"referenceHidden",...$})]}),[oe,ee]=uE(Y),ne=ot(p);xt(()=>{Z&&(ne==null||ne())},[Z,ne]);const G=(K=B.arrow)==null?void 0:K.x,F=(z=B.arrow)==null?void 0:z.y,q=((ie=B.arrow)==null?void 0:ie.centerOffset)!==0,[ce,L]=y.useState();return xt(()=>{w&&L(window.getComputedStyle(w).zIndex)},[w]),g.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...re,transform:Z?re.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[(le=B.transformOrigin)==null?void 0:le.x,(ae=B.transformOrigin)==null?void 0:ae.y].join(" "),...((H=B.hide)==null?void 0:H.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(AG,{scope:n,placedSide:oe,onArrowChange:C,arrowX:G,arrowY:F,shouldHideArrow:q,children:g.jsx(be.div,{"data-side":oe,"data-align":ee,...m,ref:x,style:{...m.style,animation:Z?void 0:"none"}})})})});sE.displayName=eg;var lE="PopperArrow",OG={top:"bottom",right:"left",bottom:"top",left:"right"},cE=y.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=IG(lE,r),a=OG[i.placedSide];return g.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:g.jsx(kG,{...o,ref:n,style:{...o.style,display:"block"}})})});cE.displayName=lE;function jG(e){return e!==null}var $G=e=>({name:"transformOrigin",options:e,fn(t){var v,w,b;const{placement:n,rects:r,middlewareData:o}=t,a=((v=o.arrow)==null?void 0:v.centerOffset)!==0,s=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[c,u]=uE(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((w=o.arrow)==null?void 0:w.x)??0)+s/2,h=(((b=o.arrow)==null?void 0:b.y)??0)+l/2;let p="",m="";return c==="bottom"?(p=a?d:`${f}px`,m=`${-l}px`):c==="top"?(p=a?d:`${f}px`,m=`${r.floating.height+l}px`):c==="right"?(p=`${-l}px`,m=a?d:`${h}px`):c==="left"&&(p=`${r.floating.width+l}px`,m=a?d:`${h}px`),{data:{x:p,y:m}}}});function uE(e){const[t,n="center"]=e.split("-");return[t,n]}var Oa=oE,ja=aE,kl=sE,Dl=cE,tg="rovingFocusGroup.onEntryFocus",FG={bubbles:!1,cancelable:!0},Cd="RovingFocusGroup",[ng,dE,LG]=No(Cd),[zG,Ar]=ct(Cd,[LG]),[BG,HG]=zG(Cd),fE=y.forwardRef((e,t)=>g.jsx(ng.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(ng.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(VG,{...e,ref:t})})}));fE.displayName=Cd;var VG=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=y.useRef(null),h=Me(t,f),p=Jn(i),[m=null,v]=dt({prop:a,defaultProp:s,onChange:l}),[w,b]=y.useState(!1),x=ot(c),_=dE(n),C=y.useRef(!1),[N,R]=y.useState(0);return y.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(tg,x),()=>T.removeEventListener(tg,x)},[x]),g.jsx(BG,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:m,onItemFocus:y.useCallback(T=>v(T),[v]),onItemShiftTab:y.useCallback(()=>b(!0),[]),onFocusableItemAdd:y.useCallback(()=>R(T=>T+1),[]),onFocusableItemRemove:y.useCallback(()=>R(T=>T-1),[]),children:g.jsx(be.div,{tabIndex:w||N===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:de(e.onMouseDown,()=>{C.current=!0}),onFocus:de(e.onFocus,T=>{const M=!C.current;if(T.target===T.currentTarget&&M&&!w){const D=new CustomEvent(tg,FG);if(T.currentTarget.dispatchEvent(D),!D.defaultPrevented){const A=_().filter(Y=>Y.focusable),j=A.find(Y=>Y.active),$=A.find(Y=>Y.id===m),re=[j,$,...A].filter(Boolean).map(Y=>Y.ref.current);mE(re,u)}}C.current=!1}),onBlur:de(e.onBlur,()=>b(!1))})})}),hE="RovingFocusGroupItem",pE=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...a}=e,s=Rt(),l=i||s,c=HG(hE,n),u=c.currentTabStopId===l,d=dE(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=c;return y.useEffect(()=>{if(r)return f(),()=>h()},[r,f,h]),g.jsx(ng.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:g.jsx(be.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:de(e.onMouseDown,p=>{r?c.onItemFocus(l):p.preventDefault()}),onFocus:de(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:de(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const m=GG(p,c.orientation,c.dir);if(m!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let w=d().filter(b=>b.focusable).map(b=>b.ref.current);if(m==="last")w.reverse();else if(m==="prev"||m==="next"){m==="prev"&&w.reverse();const b=w.indexOf(p.currentTarget);w=c.loop?qG(w,b+1):w.slice(b+1)}setTimeout(()=>mE(w))}})})})});pE.displayName=hE;var UG={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WG(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function GG(e,t,n){const r=WG(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return UG[r]}function mE(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Al=fE,Il=pE,rg=["Enter"," "],YG=["ArrowDown","PageUp","Home"],gE=["ArrowUp","PageDown","End"],KG=[...YG,...gE],XG={ltr:[...rg,"ArrowRight"],rtl:[...rg,"ArrowLeft"]},ZG={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ol="Menu",[jl,JG,QG]=No(Ol),[gi,$l]=ct(Ol,[QG,Dr,Ar]),Fl=Dr(),wE=Ar(),[vE,Oo]=gi(Ol),[e7,Ll]=gi(Ol),yE=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=e,s=Fl(t),[l,c]=y.useState(null),u=y.useRef(!1),d=ot(i),f=Jn(o);return y.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),g.jsx(Oa,{...s,children:g.jsx(vE,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:g.jsx(e7,{scope:t,onClose:y.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:a,children:r})})})};yE.displayName=Ol;var t7="MenuAnchor",og=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fl(n);return g.jsx(ja,{...o,...r,ref:t})});og.displayName=t7;var ig="MenuPortal",[n7,bE]=gi(ig,{forceMount:void 0}),xE=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Oo(ig,t);return g.jsx(n7,{scope:t,forceMount:n,children:g.jsx(gt,{present:n||i.open,children:g.jsx(_l,{asChild:!0,container:o,children:r})})})};xE.displayName=ig;var Hn="MenuContent",[r7,ag]=gi(Hn),_E=y.forwardRef((e,t)=>{const n=bE(Hn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Oo(Hn,e.__scopeMenu),a=Ll(Hn,e.__scopeMenu);return g.jsx(jl.Provider,{scope:e.__scopeMenu,children:g.jsx(gt,{present:r||i.open,children:g.jsx(jl.Slot,{scope:e.__scopeMenu,children:a.modal?g.jsx(o7,{...o,ref:t}):g.jsx(i7,{...o,ref:t})})})})}),o7=y.forwardRef((e,t)=>{const n=Oo(Hn,e.__scopeMenu),r=y.useRef(null),o=Me(t,r);return y.useEffect(()=>{const i=r.current;if(i)return Pl(i)},[]),g.jsx(sg,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:de(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),i7=y.forwardRef((e,t)=>{const n=Oo(Hn,e.__scopeMenu);return g.jsx(sg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),sg=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:p,...m}=e,v=Oo(Hn,n),w=Ll(Hn,n),b=Fl(n),x=wE(n),_=JG(n),[C,N]=y.useState(null),R=y.useRef(null),T=Me(t,R,v.onContentChange),M=y.useRef(0),D=y.useRef(""),A=y.useRef(0),j=y.useRef(null),$=y.useRef("right"),W=y.useRef(0),re=p?El:y.Fragment,Y=p?{as:Zn,allowPinchZoom:!0}:void 0,Z=oe=>{var K,z;const ee=D.current+oe,ne=_().filter(ie=>!ie.disabled),G=document.activeElement,F=(K=ne.find(ie=>ie.ref.current===G))==null?void 0:K.textValue,q=ne.map(ie=>ie.textValue),ce=w7(q,ee,F),L=(z=ne.find(ie=>ie.textValue===ce))==null?void 0:z.ref.current;(function ie(le){D.current=le,window.clearTimeout(M.current),le!==""&&(M.current=window.setTimeout(()=>ie(""),1e3))})(ee),L&&setTimeout(()=>L.focus())};y.useEffect(()=>()=>window.clearTimeout(M.current),[]),id();const B=y.useCallback(oe=>{var ne,G;return $.current===((ne=j.current)==null?void 0:ne.side)&&y7(oe,(G=j.current)==null?void 0:G.area)},[]);return g.jsx(r7,{scope:n,searchRef:D,onItemEnter:y.useCallback(oe=>{B(oe)&&oe.preventDefault()},[B]),onItemLeave:y.useCallback(oe=>{var ee;B(oe)||((ee=R.current)==null||ee.focus(),N(null))},[B]),onTriggerLeave:y.useCallback(oe=>{B(oe)&&oe.preventDefault()},[B]),pointerGraceTimerRef:A,onPointerGraceIntentChange:y.useCallback(oe=>{j.current=oe},[]),children:g.jsx(re,{...Y,children:g.jsx(xl,{asChild:!0,trapped:o,onMountAutoFocus:de(i,oe=>{var ee;oe.preventDefault(),(ee=R.current)==null||ee.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:g.jsx(To,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:g.jsx(Al,{asChild:!0,...x,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:N,onEntryFocus:de(l,oe=>{w.isUsingKeyboardRef.current||oe.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(kl,{role:"menu","aria-orientation":"vertical","data-state":zE(v.open),"data-radix-menu-content":"",dir:w.dir,...b,...m,ref:T,style:{outline:"none",...m.style},onKeyDown:de(m.onKeyDown,oe=>{const ne=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,G=oe.ctrlKey||oe.altKey||oe.metaKey,F=oe.key.length===1;ne&&(oe.key==="Tab"&&oe.preventDefault(),!G&&F&&Z(oe.key));const q=R.current;if(oe.target!==q||!KG.includes(oe.key))return;oe.preventDefault();const L=_().filter(K=>!K.disabled).map(K=>K.ref.current);gE.includes(oe.key)&&L.reverse(),m7(L)}),onBlur:de(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(M.current),D.current="")}),onPointerMove:de(e.onPointerMove,Bl(oe=>{const ee=oe.target,ne=W.current!==oe.clientX;if(oe.currentTarget.contains(ee)&&ne){const G=oe.clientX>W.current?"right":"left";$.current=G,W.current=oe.clientX}}))})})})})})})});_E.displayName=Hn;var a7="MenuGroup",lg=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{role:"group",...r,ref:t})});lg.displayName=a7;var s7="MenuLabel",SE=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{...r,ref:t})});SE.displayName=s7;var Ed="MenuItem",CE="menu.itemSelect",Pd=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=y.useRef(null),a=Ll(Ed,e.__scopeMenu),s=ag(Ed,e.__scopeMenu),l=Me(t,i),c=y.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const f=new CustomEvent(CE,{bubbles:!0,cancelable:!0});d.addEventListener(CE,h=>r==null?void 0:r(h),{once:!0}),ed(d,f),f.defaultPrevented?c.current=!1:a.onClose()}};return g.jsx(EE,{...o,ref:l,disabled:n,onClick:de(e.onClick,u),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),c.current=!0},onPointerUp:de(e.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:de(e.onKeyDown,d=>{const f=s.searchRef.current!=="";n||f&&d.key===" "||rg.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Pd.displayName=Ed;var EE=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,a=ag(Ed,n),s=wE(n),l=y.useRef(null),c=Me(t,l),[u,d]=y.useState(!1),[f,h]=y.useState("");return y.useEffect(()=>{const p=l.current;p&&h((p.textContent??"").trim())},[i.children]),g.jsx(jl.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:g.jsx(Il,{asChild:!0,...s,focusable:!r,children:g.jsx(be.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:de(e.onPointerMove,Bl(p=>{r?a.onItemLeave(p):(a.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:de(e.onPointerLeave,Bl(p=>a.onItemLeave(p))),onFocus:de(e.onFocus,()=>d(!0)),onBlur:de(e.onBlur,()=>d(!1))})})})}),l7="MenuCheckboxItem",PE=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return g.jsx(kE,{scope:e.__scopeMenu,checked:n,children:g.jsx(Pd,{role:"menuitemcheckbox","aria-checked":Rd(n)?"mixed":n,...o,ref:t,"data-state":dg(n),onSelect:de(o.onSelect,()=>r==null?void 0:r(Rd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});PE.displayName=l7;var RE="MenuRadioGroup",[c7,u7]=gi(RE,{value:void 0,onValueChange:()=>{}}),NE=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=ot(r);return g.jsx(c7,{scope:e.__scopeMenu,value:n,onValueChange:i,children:g.jsx(lg,{...o,ref:t})})});NE.displayName=RE;var TE="MenuRadioItem",ME=y.forwardRef((e,t)=>{const{value:n,...r}=e,o=u7(TE,e.__scopeMenu),i=n===o.value;return g.jsx(kE,{scope:e.__scopeMenu,checked:i,children:g.jsx(Pd,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":dg(i),onSelect:de(r.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})})});ME.displayName=TE;var cg="MenuItemIndicator",[kE,d7]=gi(cg,{checked:!1}),DE=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=d7(cg,n);return g.jsx(gt,{present:r||Rd(i.checked)||i.checked===!0,children:g.jsx(be.span,{...o,ref:t,"data-state":dg(i.checked)})})});DE.displayName=cg;var f7="MenuSeparator",AE=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});AE.displayName=f7;var h7="MenuArrow",IE=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fl(n);return g.jsx(Dl,{...o,...r,ref:t})});IE.displayName=h7;var ug="MenuSub",[p7,OE]=gi(ug),jE=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,i=Oo(ug,t),a=Fl(t),[s,l]=y.useState(null),[c,u]=y.useState(null),d=ot(o);return y.useEffect(()=>(i.open===!1&&d(!1),()=>d(!1)),[i.open,d]),g.jsx(Oa,{...a,children:g.jsx(vE,{scope:t,open:r,onOpenChange:d,content:c,onContentChange:u,children:g.jsx(p7,{scope:t,contentId:Rt(),triggerId:Rt(),trigger:s,onTriggerChange:l,children:n})})})};jE.displayName=ug;var zl="MenuSubTrigger",$E=y.forwardRef((e,t)=>{const n=Oo(zl,e.__scopeMenu),r=Ll(zl,e.__scopeMenu),o=OE(zl,e.__scopeMenu),i=ag(zl,e.__scopeMenu),a=y.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=y.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return y.useEffect(()=>u,[u]),y.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),g.jsx(og,{asChild:!0,...c,children:g.jsx(EE,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":zE(n.open),...e,ref:bl(t,o.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:de(e.onPointerMove,Bl(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:de(e.onPointerLeave,Bl(d=>{var h,p;u();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const m=(p=n.content)==null?void 0:p.dataset.side,v=m==="right",w=v?-5:5,b=f[v?"left":"right"],x=f[v?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+w,y:d.clientY},{x:b,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:b,y:f.bottom}],side:m}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:de(e.onKeyDown,d=>{var h;const f=i.searchRef.current!=="";e.disabled||f&&d.key===" "||XG[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});$E.displayName=zl;var FE="MenuSubContent",LE=y.forwardRef((e,t)=>{const n=bE(Hn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Oo(Hn,e.__scopeMenu),a=Ll(Hn,e.__scopeMenu),s=OE(FE,e.__scopeMenu),l=y.useRef(null),c=Me(t,l);return g.jsx(jl.Provider,{scope:e.__scopeMenu,children:g.jsx(gt,{present:r||i.open,children:g.jsx(jl.Slot,{scope:e.__scopeMenu,children:g.jsx(sg,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:de(e.onFocusOutside,u=>{u.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:de(e.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:de(e.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),f=ZG[a.dir].includes(u.key);d&&f&&(i.onOpenChange(!1),(h=s.trigger)==null||h.focus(),u.preventDefault())})})})})})});LE.displayName=FE;function zE(e){return e?"open":"closed"}function Rd(e){return e==="indeterminate"}function dg(e){return Rd(e)?"indeterminate":e?"checked":"unchecked"}function m7(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function g7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function w7(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=g7(e,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function v7(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i].x,l=t[i].y,c=t[a].x,u=t[a].y;l>r!=u>r&&n<(c-s)*(r-l)/(u-l)+s&&(o=!o)}return o}function y7(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return v7(n,t)}function Bl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var fg=yE,hg=og,pg=xE,mg=_E,gg=lg,wg=SE,vg=Pd,yg=PE,bg=NE,xg=ME,_g=DE,Sg=AE,Cg=IE,Eg=jE,Pg=$E,Rg=LE,Ng="ContextMenu",[b7,roe]=ct(Ng,[$l]),Gt=$l(),[x7,BE]=b7(Ng),HE=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:i=!0}=e,[a,s]=y.useState(!1),l=Gt(t),c=ot(r),u=y.useCallback(d=>{s(d),c(d)},[c]);return g.jsx(x7,{scope:t,open:a,onOpenChange:u,modal:i,children:g.jsx(fg,{...l,dir:o,open:a,onOpenChange:u,modal:i,children:n})})};HE.displayName=Ng;var VE="ContextMenuTrigger",UE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=e,i=BE(VE,n),a=Gt(n),s=y.useRef({x:0,y:0}),l=y.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),c=y.useRef(0),u=y.useCallback(()=>window.clearTimeout(c.current),[]),d=f=>{s.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return y.useEffect(()=>u,[u]),y.useEffect(()=>void(r&&u()),[r,u]),g.jsxs(g.Fragment,{children:[g.jsx(hg,{...a,virtualRef:l}),g.jsx(be.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:de(e.onContextMenu,f=>{u(),d(f),f.preventDefault()}),onPointerDown:r?e.onPointerDown:de(e.onPointerDown,Nd(f=>{u(),c.current=window.setTimeout(()=>d(f),700)})),onPointerMove:r?e.onPointerMove:de(e.onPointerMove,Nd(u)),onPointerCancel:r?e.onPointerCancel:de(e.onPointerCancel,Nd(u)),onPointerUp:r?e.onPointerUp:de(e.onPointerUp,Nd(u))})]})});UE.displayName=VE;var _7="ContextMenuPortal",WE=e=>{const{__scopeContextMenu:t,...n}=e,r=Gt(t);return g.jsx(pg,{...r,...n})};WE.displayName=_7;var GE="ContextMenuContent",qE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=BE(GE,n),i=Gt(n),a=y.useRef(!1);return g.jsx(mg,{...i,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)==null||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)==null||l.call(e,s),!s.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});qE.displayName=GE;var S7="ContextMenuGroup",YE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(gg,{...o,...r,ref:t})});YE.displayName=S7;var C7="ContextMenuLabel",KE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(wg,{...o,...r,ref:t})});KE.displayName=C7;var E7="ContextMenuItem",XE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(vg,{...o,...r,ref:t})});XE.displayName=E7;var P7="ContextMenuCheckboxItem",ZE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(yg,{...o,...r,ref:t})});ZE.displayName=P7;var R7="ContextMenuRadioGroup",JE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(bg,{...o,...r,ref:t})});JE.displayName=R7;var N7="ContextMenuRadioItem",QE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(xg,{...o,...r,ref:t})});QE.displayName=N7;var T7="ContextMenuItemIndicator",eP=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(_g,{...o,...r,ref:t})});eP.displayName=T7;var M7="ContextMenuSeparator",tP=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(Sg,{...o,...r,ref:t})});tP.displayName=M7;var k7="ContextMenuArrow",D7=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(Cg,{...o,...r,ref:t})});D7.displayName=k7;var A7="ContextMenuSub",nP=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:o,defaultOpen:i}=e,a=Gt(t),[s,l]=dt({prop:o,defaultProp:i,onChange:r});return g.jsx(Eg,{...a,open:s,onOpenChange:l,children:n})};nP.displayName=A7;var I7="ContextMenuSubTrigger",rP=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(Pg,{...o,...r,ref:t})});rP.displayName=I7;var O7="ContextMenuSubContent",oP=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(Rg,{...o,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});oP.displayName=O7;function Nd(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var j7=HE,$7=UE,iP=WE,aP=qE,F7=YE,sP=KE,lP=XE,cP=ZE,L7=JE,uP=QE,dP=eP,fP=tP,z7=nP,hP=rP,pP=oP,Tg="DropdownMenu",[B7,ooe]=ct(Tg,[$l]),qt=$l(),[H7,mP]=B7(Tg),gP=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,l=qt(t),c=y.useRef(null),[u=!1,d]=dt({prop:o,defaultProp:i,onChange:a});return g.jsx(H7,{scope:t,triggerId:Rt(),triggerRef:c,contentId:Rt(),open:u,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(f=>!f),[d]),modal:s,children:g.jsx(fg,{...l,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};gP.displayName=Tg;var wP="DropdownMenuTrigger",vP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=mP(wP,n),a=qt(n);return g.jsx(hg,{asChild:!0,...a,children:g.jsx(be.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:bl(t,i.triggerRef),onPointerDown:de(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:de(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});vP.displayName=wP;var V7="DropdownMenuPortal",yP=e=>{const{__scopeDropdownMenu:t,...n}=e,r=qt(t);return g.jsx(pg,{...r,...n})};yP.displayName=V7;var bP="DropdownMenuContent",xP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=mP(bP,n),i=qt(n),a=y.useRef(!1);return g.jsx(mg,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:de(e.onCloseAutoFocus,s=>{var l;a.current||(l=o.triggerRef.current)==null||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:de(e.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xP.displayName=bP;var U7="DropdownMenuGroup",_P=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(gg,{...o,...r,ref:t})});_P.displayName=U7;var W7="DropdownMenuLabel",SP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(wg,{...o,...r,ref:t})});SP.displayName=W7;var G7="DropdownMenuItem",CP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(vg,{...o,...r,ref:t})});CP.displayName=G7;var q7="DropdownMenuCheckboxItem",EP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(yg,{...o,...r,ref:t})});EP.displayName=q7;var Y7="DropdownMenuRadioGroup",PP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(bg,{...o,...r,ref:t})});PP.displayName=Y7;var K7="DropdownMenuRadioItem",RP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(xg,{...o,...r,ref:t})});RP.displayName=K7;var X7="DropdownMenuItemIndicator",NP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(_g,{...o,...r,ref:t})});NP.displayName=X7;var Z7="DropdownMenuSeparator",TP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(Sg,{...o,...r,ref:t})});TP.displayName=Z7;var J7="DropdownMenuArrow",Q7=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(Cg,{...o,...r,ref:t})});Q7.displayName=J7;var e9=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,a=qt(t),[s=!1,l]=dt({prop:r,defaultProp:i,onChange:o});return g.jsx(Eg,{...a,open:s,onOpenChange:l,children:n})},t9="DropdownMenuSubTrigger",MP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(Pg,{...o,...r,ref:t})});MP.displayName=t9;var n9="DropdownMenuSubContent",kP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(Rg,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});kP.displayName=n9;var r9=gP,o9=vP,DP=yP,AP=xP,i9=_P,IP=SP,OP=CP,jP=EP,a9=PP,$P=RP,FP=NP,LP=TP,s9=e9,zP=MP,BP=kP,l9="Label",HP=y.forwardRef((e,t)=>g.jsx(be.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));HP.displayName=l9;var VP=HP,Mg,kg="HoverCard",[UP,ioe]=ct(kg,[Dr]),Td=Dr(),[c9,Dg]=UP(kg),WP=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:a=700,closeDelay:s=300}=e,l=Td(t),c=y.useRef(0),u=y.useRef(0),d=y.useRef(!1),f=y.useRef(!1),[h=!1,p]=dt({prop:r,defaultProp:o,onChange:i}),m=y.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>p(!0),a)},[a,p]),v=y.useCallback(()=>{clearTimeout(c.current),!d.current&&!f.current&&(u.current=window.setTimeout(()=>p(!1),s))},[s,p]),w=y.useCallback(()=>p(!1),[p]);return y.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),g.jsx(c9,{scope:t,open:h,onOpenChange:p,onOpen:m,onClose:v,onDismiss:w,hasSelectionRef:d,isPointerDownOnContentRef:f,children:g.jsx(Oa,{...l,children:n})})};WP.displayName=kg;var GP="HoverCardTrigger",qP=y.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Dg(GP,n),i=Td(n);return g.jsx(ja,{asChild:!0,...i,children:g.jsx(be.a,{"data-state":o.open?"open":"closed",...r,ref:t,onPointerEnter:de(e.onPointerEnter,kd(o.onOpen)),onPointerLeave:de(e.onPointerLeave,kd(o.onClose)),onFocus:de(e.onFocus,o.onOpen),onBlur:de(e.onBlur,o.onClose),onTouchStart:de(e.onTouchStart,a=>a.preventDefault())})})});qP.displayName=GP;var u9="HoverCardPortal",[aoe,d9]=UP(u9,{forceMount:void 0}),Md="HoverCardContent",YP=y.forwardRef((e,t)=>{const n=d9(Md,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=Dg(Md,e.__scopeHoverCard);return g.jsx(gt,{present:r||i.open,children:g.jsx(f9,{"data-state":i.open?"open":"closed",...o,onPointerEnter:de(e.onPointerEnter,kd(i.onOpen)),onPointerLeave:de(e.onPointerLeave,kd(i.onClose)),ref:t})})});YP.displayName=Md;var f9=y.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,...s}=e,l=Dg(Md,n),c=Td(n),u=y.useRef(null),d=Me(t,u),[f,h]=y.useState(!1);return y.useEffect(()=>{if(f){const p=document.body;return Mg=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=Mg,p.style.webkitUserSelect=Mg}}},[f]),y.useEffect(()=>{if(u.current){const p=()=>{h(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var v;((v=document.getSelection())==null?void 0:v.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),y.useEffect(()=>{u.current&&m9(u.current).forEach(m=>m.setAttribute("tabindex","-1"))}),g.jsx(To,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:de(i,p=>{p.preventDefault()}),onDismiss:l.onDismiss,children:g.jsx(kl,{...c,...s,onPointerDown:de(s.onPointerDown,p=>{p.currentTarget.contains(p.target)&&h(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,style:{...s.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),h9="HoverCardArrow",p9=y.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Td(n);return g.jsx(Dl,{...o,...r,ref:t})});p9.displayName=h9;function kd(e){return t=>t.pointerType==="touch"?void 0:e()}function m9(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var g9=WP,w9=qP,KP=YP,Dd="Menubar",[Ag,v9,y9]=No(Dd),[XP,soe]=ct(Dd,[y9,Ar]),Yt=$l(),ZP=Ar(),[b9,Ig]=XP(Dd),JP=y.forwardRef((e,t)=>{const{__scopeMenubar:n,value:r,onValueChange:o,defaultValue:i,loop:a=!0,dir:s,...l}=e,c=Jn(s),u=ZP(n),[d="",f]=dt({prop:r,onChange:o,defaultProp:i}),[h,p]=y.useState(null);return g.jsx(b9,{scope:n,value:d,onMenuOpen:y.useCallback(m=>{f(m),p(m)},[f]),onMenuClose:y.useCallback(()=>f(""),[f]),onMenuToggle:y.useCallback(m=>{f(v=>v?"":m),p(m)},[f]),dir:c,loop:a,children:g.jsx(Ag.Provider,{scope:n,children:g.jsx(Ag.Slot,{scope:n,children:g.jsx(Al,{asChild:!0,...u,orientation:"horizontal",loop:a,dir:c,currentTabStopId:h,onCurrentTabStopIdChange:p,children:g.jsx(be.div,{role:"menubar",...l,ref:t})})})})})});JP.displayName=Dd;var Og="MenubarMenu",[x9,QP]=XP(Og),eR=e=>{const{__scopeMenubar:t,value:n,...r}=e,o=Rt(),i=n||o||"LEGACY_REACT_AUTO_VALUE",a=Ig(Og,t),s=Yt(t),l=y.useRef(null),c=y.useRef(!1),u=a.value===i;return y.useEffect(()=>{u||(c.current=!1)},[u]),g.jsx(x9,{scope:t,value:i,triggerId:Rt(),triggerRef:l,contentId:Rt(),wasKeyboardTriggerOpenRef:c,children:g.jsx(fg,{...s,open:u,onOpenChange:d=>{d||a.onMenuClose()},modal:!1,dir:a.dir,...r})})};eR.displayName=Og;var jg="MenubarTrigger",tR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,disabled:r=!1,...o}=e,i=ZP(n),a=Yt(n),s=Ig(jg,n),l=QP(jg,n),c=y.useRef(null),u=Me(t,c,l.triggerRef),[d,f]=y.useState(!1),h=s.value===l.value;return g.jsx(Ag.ItemSlot,{scope:n,value:l.value,disabled:r,children:g.jsx(Il,{asChild:!0,...i,focusable:!r,tabStopId:l.value,children:g.jsx(hg,{asChild:!0,...a,children:g.jsx(be.button,{type:"button",role:"menuitem",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?l.contentId:void 0,"data-highlighted":d?"":void 0,"data-state":h?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:u,onPointerDown:de(e.onPointerDown,p=>{!r&&p.button===0&&p.ctrlKey===!1&&(s.onMenuOpen(l.value),h||p.preventDefault())}),onPointerEnter:de(e.onPointerEnter,()=>{var m;!!s.value&&!h&&(s.onMenuOpen(l.value),(m=c.current)==null||m.focus())}),onKeyDown:de(e.onKeyDown,p=>{r||(["Enter"," "].includes(p.key)&&s.onMenuToggle(l.value),p.key==="ArrowDown"&&s.onMenuOpen(l.value),["Enter"," ","ArrowDown"].includes(p.key)&&(l.wasKeyboardTriggerOpenRef.current=!0,p.preventDefault()))}),onFocus:de(e.onFocus,()=>f(!0)),onBlur:de(e.onBlur,()=>f(!1))})})})})});tR.displayName=jg;var _9="MenubarPortal",nR=e=>{const{__scopeMenubar:t,...n}=e,r=Yt(t);return g.jsx(pg,{...r,...n})};nR.displayName=_9;var $g="MenubarContent",rR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,align:r="start",...o}=e,i=Yt(n),a=Ig($g,n),s=QP($g,n),l=v9(n),c=y.useRef(!1);return g.jsx(mg,{id:s.contentId,"aria-labelledby":s.triggerId,"data-radix-menubar-content":"",...i,...o,ref:t,align:r,onCloseAutoFocus:de(e.onCloseAutoFocus,u=>{var f;!!!a.value&&!c.current&&((f=s.triggerRef.current)==null||f.focus()),c.current=!1,u.preventDefault()}),onFocusOutside:de(e.onFocusOutside,u=>{const d=u.target;l().some(h=>{var p;return(p=h.ref.current)==null?void 0:p.contains(d)})&&u.preventDefault()}),onInteractOutside:de(e.onInteractOutside,()=>{c.current=!0}),onEntryFocus:u=>{s.wasKeyboardTriggerOpenRef.current||u.preventDefault()},onKeyDown:de(e.onKeyDown,u=>{if(["ArrowRight","ArrowLeft"].includes(u.key)){const d=u.target,f=d.hasAttribute("data-radix-menubar-subtrigger"),h=d.closest("[data-radix-menubar-content]")!==u.currentTarget,m=(a.dir==="rtl"?"ArrowRight":"ArrowLeft")===u.key;if(!m&&f||h&&m)return;let b=l().filter(C=>!C.disabled).map(C=>C.value);m&&b.reverse();const x=b.indexOf(s.value);b=a.loop?j9(b,x+1):b.slice(x+1);const[_]=b;_&&a.onMenuOpen(_)}},{checkForDefaultPrevented:!1}),style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});rR.displayName=$g;var S9="MenubarGroup",oR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(gg,{...o,...r,ref:t})});oR.displayName=S9;var C9="MenubarLabel",iR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(wg,{...o,...r,ref:t})});iR.displayName=C9;var E9="MenubarItem",aR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(vg,{...o,...r,ref:t})});aR.displayName=E9;var P9="MenubarCheckboxItem",sR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(yg,{...o,...r,ref:t})});sR.displayName=P9;var R9="MenubarRadioGroup",lR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(bg,{...o,...r,ref:t})});lR.displayName=R9;var N9="MenubarRadioItem",cR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(xg,{...o,...r,ref:t})});cR.displayName=N9;var T9="MenubarItemIndicator",uR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(_g,{...o,...r,ref:t})});uR.displayName=T9;var M9="MenubarSeparator",dR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(Sg,{...o,...r,ref:t})});dR.displayName=M9;var k9="MenubarArrow",D9=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(Cg,{...o,...r,ref:t})});D9.displayName=k9;var A9="MenubarSub",fR=e=>{const{__scopeMenubar:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,a=Yt(t),[s=!1,l]=dt({prop:r,defaultProp:i,onChange:o});return g.jsx(Eg,{...a,open:s,onOpenChange:l,children:n})};fR.displayName=A9;var I9="MenubarSubTrigger",hR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(Pg,{"data-radix-menubar-subtrigger":"",...o,...r,ref:t})});hR.displayName=I9;var O9="MenubarSubContent",pR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(Rg,{...o,"data-radix-menubar-content":"",...r,ref:t,style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});pR.displayName=O9;function j9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var mR=JP,$9=eR,gR=tR,wR=nR,vR=rR,F9=oR,yR=iR,bR=aR,xR=sR,L9=lR,_R=cR,SR=uR,CR=dR,z9=fR,ER=hR,PR=pR,$a="NavigationMenu",[Fg,RR,B9]=No($a),[Lg,H9,V9]=No($a),[zg,loe]=ct($a,[B9,V9]),[U9,Vn]=zg($a),[W9,G9]=zg($a),NR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:o,defaultValue:i,delayDuration:a=200,skipDelayDuration:s=300,orientation:l="horizontal",dir:c,...u}=e,[d,f]=y.useState(null),h=Me(t,M=>f(M)),p=Jn(c),m=y.useRef(0),v=y.useRef(0),w=y.useRef(0),[b,x]=y.useState(!0),[_="",C]=dt({prop:r,onChange:M=>{const D=M!=="",A=s>0;D?(window.clearTimeout(w.current),A&&x(!1)):(window.clearTimeout(w.current),w.current=window.setTimeout(()=>x(!0),s)),o==null||o(M)},defaultProp:i}),N=y.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>C(""),150)},[C]),R=y.useCallback(M=>{window.clearTimeout(v.current),C(M)},[C]),T=y.useCallback(M=>{_===M?window.clearTimeout(v.current):m.current=window.setTimeout(()=>{window.clearTimeout(v.current),C(M)},a)},[_,C,a]);return y.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(v.current),window.clearTimeout(w.current)},[]),g.jsx(MR,{scope:n,isRootMenu:!0,value:_,dir:p,orientation:l,rootNavigationMenu:d,onTriggerEnter:M=>{window.clearTimeout(m.current),b?T(M):R(M)},onTriggerLeave:()=>{window.clearTimeout(m.current),N()},onContentEnter:()=>window.clearTimeout(v.current),onContentLeave:N,onItemSelect:M=>{C(D=>D===M?"":M)},onItemDismiss:()=>C(""),children:g.jsx(be.nav,{"aria-label":"Main","data-orientation":l,dir:p,...u,ref:h})})});NR.displayName=$a;var TR="NavigationMenuSub",q9=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",...s}=e,l=Vn(TR,n),[c="",u]=dt({prop:r,onChange:o,defaultProp:i});return g.jsx(MR,{scope:n,isRootMenu:!1,value:c,dir:l.dir,orientation:a,rootNavigationMenu:l.rootNavigationMenu,onTriggerEnter:d=>u(d),onItemSelect:d=>u(d),onItemDismiss:()=>u(""),children:g.jsx(be.div,{"data-orientation":a,...s,ref:t})})});q9.displayName=TR;var MR=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:o,orientation:i,children:a,value:s,onItemSelect:l,onItemDismiss:c,onTriggerEnter:u,onTriggerLeave:d,onContentEnter:f,onContentLeave:h}=e,[p,m]=y.useState(null),[v,w]=y.useState(new Map),[b,x]=y.useState(null);return g.jsx(U9,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:s,previousValue:Ma(s),baseId:Rt(),dir:o,orientation:i,viewport:p,onViewportChange:m,indicatorTrack:b,onIndicatorTrackChange:x,onTriggerEnter:ot(u),onTriggerLeave:ot(d),onContentEnter:ot(f),onContentLeave:ot(h),onItemSelect:ot(l),onItemDismiss:ot(c),onViewportContentChange:y.useCallback((_,C)=>{w(N=>(N.set(_,C),new Map(N)))},[]),onViewportContentRemove:y.useCallback(_=>{w(C=>C.has(_)?(C.delete(_),new Map(C)):C)},[]),children:g.jsx(Fg.Provider,{scope:t,children:g.jsx(W9,{scope:t,items:v,children:a})})})},kR="NavigationMenuList",DR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=Vn(kR,n),i=g.jsx(be.ul,{"data-orientation":o.orientation,...r,ref:t});return g.jsx(be.div,{style:{position:"relative"},ref:o.onIndicatorTrackChange,children:g.jsx(Fg.Slot,{scope:n,children:o.isRootMenu?g.jsx(VR,{asChild:!0,children:i}):i})})});DR.displayName=kR;var AR="NavigationMenuItem",[Y9,IR]=zg(AR),OR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...o}=e,i=Rt(),a=r||i||"LEGACY_REACT_AUTO_VALUE",s=y.useRef(null),l=y.useRef(null),c=y.useRef(null),u=y.useRef(()=>{}),d=y.useRef(!1),f=y.useCallback((p="start")=>{if(s.current){u.current();const m=Ug(s.current);m.length&&Wg(p==="start"?m:m.reverse())}},[]),h=y.useCallback(()=>{if(s.current){const p=Ug(s.current);p.length&&(u.current=tq(p))}},[]);return g.jsx(Y9,{scope:n,value:a,triggerRef:l,contentRef:s,focusProxyRef:c,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:h,onContentFocusOutside:h,children:g.jsx(be.li,{...o,ref:t})})});OR.displayName=AR;var Bg="NavigationMenuTrigger",jR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...o}=e,i=Vn(Bg,e.__scopeNavigationMenu),a=IR(Bg,e.__scopeNavigationMenu),s=y.useRef(null),l=Me(s,a.triggerRef,t),c=GR(i.baseId,a.value),u=qR(i.baseId,a.value),d=y.useRef(!1),f=y.useRef(!1),h=a.value===i.value;return g.jsxs(g.Fragment,{children:[g.jsx(Fg.ItemSlot,{scope:n,value:a.value,children:g.jsx(WR,{asChild:!0,children:g.jsx(be.button,{id:c,disabled:r,"data-disabled":r?"":void 0,"data-state":qg(h),"aria-expanded":h,"aria-controls":u,...o,ref:l,onPointerEnter:de(e.onPointerEnter,()=>{f.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:de(e.onPointerMove,Id(()=>{r||f.current||a.wasEscapeCloseRef.current||d.current||(i.onTriggerEnter(a.value),d.current=!0)})),onPointerLeave:de(e.onPointerLeave,Id(()=>{r||(i.onTriggerLeave(),d.current=!1)})),onClick:de(e.onClick,()=>{i.onItemSelect(a.value),f.current=h}),onKeyDown:de(e.onKeyDown,p=>{const v={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];h&&p.key===v&&(a.onEntryKeyDown(),p.preventDefault())})})})}),h&&g.jsxs(g.Fragment,{children:[g.jsx(JS,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:p=>{const m=a.contentRef.current,v=p.relatedTarget,w=v===s.current,b=m==null?void 0:m.contains(v);(w||!b)&&a.onFocusProxyEnter(w?"start":"end")}}),i.viewport&&g.jsx("span",{"aria-owns":u})]})]})});jR.displayName=Bg;var K9="NavigationMenuLink",$R="navigationMenu.linkSelect",FR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:o,...i}=e;return g.jsx(WR,{asChild:!0,children:g.jsx(be.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:t,onClick:de(e.onClick,a=>{const s=a.target,l=new CustomEvent($R,{bubbles:!0,cancelable:!0});if(s.addEventListener($R,c=>o==null?void 0:o(c),{once:!0}),ed(s,l),!l.defaultPrevented&&!a.metaKey){const c=new CustomEvent(Ad,{bubbles:!0,cancelable:!0});ed(s,c)}},{checkForDefaultPrevented:!1})})})});FR.displayName=K9;var Hg="NavigationMenuIndicator",LR=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Vn(Hg,e.__scopeNavigationMenu),i=!!o.value;return o.indicatorTrack?ur.createPortal(g.jsx(gt,{present:n||i,children:g.jsx(X9,{...r,ref:t})}),o.indicatorTrack):null});LR.displayName=Hg;var X9=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=Vn(Hg,n),i=RR(n),[a,s]=y.useState(null),[l,c]=y.useState(null),u=o.orientation==="horizontal",d=!!o.value;y.useEffect(()=>{var m;const p=(m=i().find(v=>v.value===o.value))==null?void 0:m.ref.current;p&&s(p)},[i,o.value]);const f=()=>{a&&c({size:u?a.offsetWidth:a.offsetHeight,offset:u?a.offsetLeft:a.offsetTop})};return Gg(a,f),Gg(o.indicatorTrack,f),l?g.jsx(be.div,{"aria-hidden":!0,"data-state":d?"visible":"hidden","data-orientation":o.orientation,...r,ref:t,style:{position:"absolute",...u?{left:0,width:l.size+"px",transform:`translateX(${l.offset}px)`}:{top:0,height:l.size+"px",transform:`translateY(${l.offset}px)`},...r.style}}):null}),Fa="NavigationMenuContent",zR=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Vn(Fa,e.__scopeNavigationMenu),i=IR(Fa,e.__scopeNavigationMenu),a=Me(i.contentRef,t),s=i.value===o.value,l={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...r};return o.viewport?g.jsx(Z9,{forceMount:n,...l,ref:a}):g.jsx(gt,{present:n||s,children:g.jsx(BR,{"data-state":qg(s),...l,ref:a,onPointerEnter:de(e.onPointerEnter,o.onContentEnter),onPointerLeave:de(e.onPointerLeave,Id(o.onContentLeave)),style:{pointerEvents:!s&&o.isRootMenu?"none":void 0,...l.style}})})});zR.displayName=Fa;var Z9=y.forwardRef((e,t)=>{const n=Vn(Fa,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:o}=n;return xt(()=>{r(e.value,{ref:t,...e})},[e,t,r]),xt(()=>()=>o(e.value),[e.value,o]),null}),Ad="navigationMenu.rootContentDismiss",BR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:o,focusProxyRef:i,wasEscapeCloseRef:a,onRootContentClose:s,onContentFocusOutside:l,...c}=e,u=Vn(Fa,n),d=y.useRef(null),f=Me(d,t),h=GR(u.baseId,r),p=qR(u.baseId,r),m=RR(n),v=y.useRef(null),{onItemDismiss:w}=u;y.useEffect(()=>{const x=d.current;if(u.isRootMenu&&x){const _=()=>{var C;w(),s(),x.contains(document.activeElement)&&((C=o.current)==null||C.focus())};return x.addEventListener(Ad,_),()=>x.removeEventListener(Ad,_)}},[u.isRootMenu,e.value,o,w,s]);const b=y.useMemo(()=>{const _=m().map(D=>D.value);u.dir==="rtl"&&_.reverse();const C=_.indexOf(u.value),N=_.indexOf(u.previousValue),R=r===u.value,T=N===_.indexOf(r);if(!R&&!T)return v.current;const M=(()=>{if(C!==N){if(R&&N!==-1)return C>N?"from-end":"from-start";if(T&&C!==-1)return C>N?"to-start":"to-end"}return null})();return v.current=M,M},[u.previousValue,u.value,u.dir,m,r]);return g.jsx(VR,{asChild:!0,children:g.jsx(To,{id:p,"aria-labelledby":h,"data-motion":b,"data-orientation":u.orientation,...c,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var _;const x=new Event(Ad,{bubbles:!0,cancelable:!0});(_=d.current)==null||_.dispatchEvent(x)},onFocusOutside:de(e.onFocusOutside,x=>{var C;l();const _=x.target;(C=u.rootNavigationMenu)!=null&&C.contains(_)&&x.preventDefault()}),onPointerDownOutside:de(e.onPointerDownOutside,x=>{var R;const _=x.target,C=m().some(T=>{var M;return(M=T.ref.current)==null?void 0:M.contains(_)}),N=u.isRootMenu&&((R=u.viewport)==null?void 0:R.contains(_));(C||N||!u.isRootMenu)&&x.preventDefault()}),onKeyDown:de(e.onKeyDown,x=>{var N;const _=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!_){const R=Ug(x.currentTarget),T=document.activeElement,M=R.findIndex(j=>j===T),A=x.shiftKey?R.slice(0,M).reverse():R.slice(M+1,R.length);Wg(A)?x.preventDefault():(N=i.current)==null||N.focus()}}),onEscapeKeyDown:de(e.onEscapeKeyDown,x=>{a.current=!0})})})}),Vg="NavigationMenuViewport",HR=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=!!Vn(Vg,e.__scopeNavigationMenu).value;return g.jsx(gt,{present:n||i,children:g.jsx(J9,{...r,ref:t})})});HR.displayName=Vg;var J9=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...o}=e,i=Vn(Vg,n),a=Me(t,i.onViewportChange),s=G9(Fa,e.__scopeNavigationMenu),[l,c]=y.useState(null),[u,d]=y.useState(null),f=l?(l==null?void 0:l.width)+"px":void 0,h=l?(l==null?void 0:l.height)+"px":void 0,p=!!i.value,m=p?i.value:i.previousValue;return Gg(u,()=>{u&&c({width:u.offsetWidth,height:u.offsetHeight})}),g.jsx(be.div,{"data-state":qg(p),"data-orientation":i.orientation,...o,ref:a,style:{pointerEvents:!p&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":h,...o.style},onPointerEnter:de(e.onPointerEnter,i.onContentEnter),onPointerLeave:de(e.onPointerLeave,Id(i.onContentLeave)),children:Array.from(s.items).map(([w,{ref:b,forceMount:x,..._}])=>{const C=m===w;return g.jsx(gt,{present:x||C,children:g.jsx(BR,{..._,ref:bl(b,N=>{C&&N&&d(N)})})},w)})})}),Q9="FocusGroup",VR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=Vn(Q9,n);return g.jsx(Lg.Provider,{scope:n,children:g.jsx(Lg.Slot,{scope:n,children:g.jsx(be.div,{dir:o.dir,...r,ref:t})})})}),UR=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],eq="FocusGroupItem",WR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=H9(n),i=Vn(eq,n);return g.jsx(Lg.ItemSlot,{scope:n,children:g.jsx(be.button,{...r,ref:t,onKeyDown:de(e.onKeyDown,a=>{if(["Home","End",...UR].includes(a.key)){let l=o().map(d=>d.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&l.reverse(),UR.includes(a.key)){const d=l.indexOf(a.currentTarget);l=l.slice(d+1)}setTimeout(()=>Wg(l)),a.preventDefault()}})})})});function Ug(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 Wg(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function tq(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function Gg(e,t){const n=ot(t);xt(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}function qg(e){return e?"open":"closed"}function GR(e,t){return`${e}-trigger-${t}`}function qR(e,t){return`${e}-content-${t}`}function Id(e){return t=>t.pointerType==="mouse"?e(t):void 0}var YR=NR,KR=DR,nq=OR,XR=jR,rq=FR,ZR=LR,JR=zR,QR=HR,Yg="Popover",[eN,coe]=ct(Yg,[Dr]),Hl=Dr(),[oq,jo]=eN(Yg),tN=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,s=Hl(t),l=y.useRef(null),[c,u]=y.useState(!1),[d=!1,f]=dt({prop:r,defaultProp:o,onChange:i});return g.jsx(Oa,{...s,children:g.jsx(oq,{scope:t,contentId:Rt(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:c,onCustomAnchorAdd:y.useCallback(()=>u(!0),[]),onCustomAnchorRemove:y.useCallback(()=>u(!1),[]),modal:a,children:n})})};tN.displayName=Yg;var nN="PopoverAnchor",iq=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=jo(nN,n),i=Hl(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=o;return y.useEffect(()=>(a(),()=>s()),[a,s]),g.jsx(ja,{...i,...r,ref:t})});iq.displayName=nN;var rN="PopoverTrigger",oN=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=jo(rN,n),i=Hl(n),a=Me(t,o.triggerRef),s=g.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":cN(o.open),...r,ref:a,onClick:de(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:g.jsx(ja,{asChild:!0,...i,children:s})});oN.displayName=rN;var Kg="PopoverPortal",[aq,sq]=eN(Kg,{forceMount:void 0}),iN=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=jo(Kg,t);return g.jsx(aq,{scope:t,forceMount:n,children:g.jsx(gt,{present:n||i.open,children:g.jsx(_l,{asChild:!0,container:o,children:r})})})};iN.displayName=Kg;var La="PopoverContent",aN=y.forwardRef((e,t)=>{const n=sq(La,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=jo(La,e.__scopePopover);return g.jsx(gt,{present:r||i.open,children:i.modal?g.jsx(lq,{...o,ref:t}):g.jsx(cq,{...o,ref:t})})});aN.displayName=La;var lq=y.forwardRef((e,t)=>{const n=jo(La,e.__scopePopover),r=y.useRef(null),o=Me(t,r),i=y.useRef(!1);return y.useEffect(()=>{const a=r.current;if(a)return Pl(a)},[]),g.jsx(El,{as:Zn,allowPinchZoom:!0,children:g.jsx(sN,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:de(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),i.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:de(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:de(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),cq=y.forwardRef((e,t)=>{const n=jo(La,e.__scopePopover),r=y.useRef(!1),o=y.useRef(!1);return g.jsx(sN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,s;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),sN=y.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=jo(La,n),h=Hl(n);return id(),g.jsx(xl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:g.jsx(To,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:g.jsx(kl,{"data-state":cN(f.open),role:"dialog",id:f.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),lN="PopoverClose",uq=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=jo(lN,n);return g.jsx(be.button,{type:"button",...r,ref:t,onClick:de(e.onClick,()=>o.onOpenChange(!1))})});uq.displayName=lN;var dq="PopoverArrow",fq=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Hl(n);return g.jsx(Dl,{...o,...r,ref:t})});fq.displayName=dq;function cN(e){return e?"open":"closed"}var hq=tN,pq=oN,mq=iN,uN=aN,Xg="Progress",Zg=100,[gq,uoe]=ct(Xg),[wq,vq]=gq(Xg),dN=y.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:i=yq,...a}=e;(o||o===0)&&!mN(o)&&console.error(bq(`${o}`,"Progress"));const s=mN(o)?o:Zg;r!==null&&!gN(r,s)&&console.error(xq(`${r}`,"Progress"));const l=gN(r,s)?r:null,c=Od(l)?i(l,s):void 0;return g.jsx(wq,{scope:n,value:l,max:s,children:g.jsx(be.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Od(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":pN(l,s),"data-value":l??void 0,"data-max":s,...a,ref:t})})});dN.displayName=Xg;var fN="ProgressIndicator",hN=y.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=vq(fN,n);return g.jsx(be.div,{"data-state":pN(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});hN.displayName=fN;function yq(e,t){return`${Math.round(e/t*100)}%`}function pN(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Od(e){return typeof e=="number"}function mN(e){return Od(e)&&!isNaN(e)&&e>0}function gN(e,t){return Od(e)&&!isNaN(e)&&e<=t&&e>=0}function bq(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Zg}\`.`}function xq(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
311
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return y.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},bW=oC,xW=iC,_W=aC,gC=sC,wC=lC,vC=hC,yC=mC,bC=uC,xC=fC,SW="AspectRatio",_C=y.forwardRef((e,t)=>{const{ratio:n=1/1,style:r,...o}=e;return g.jsx("div",{style:{position:"relative",width:"100%",paddingBottom:`${100/n}%`},"data-radix-aspect-ratio-wrapper":"",children:g.jsx(be.div,{...o,ref:t,style:{...r,position:"absolute",top:0,right:0,bottom:0,left:0}})})});_C.displayName=SW;var CW=_C,Lm="Avatar",[EW,toe]=ct(Lm),[PW,SC]=EW(Lm),CC=y.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=y.useState("idle");return g.jsx(PW,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:g.jsx(be.span,{...r,ref:t})})});CC.displayName=Lm;var EC="AvatarImage",PC=y.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,a=SC(EC,n),s=RW(r,i.referrerPolicy),l=ot(c=>{o(c),a.onImageLoadingStatusChange(c)});return xt(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?g.jsx(be.img,{...i,ref:t,src:r}):null});PC.displayName=EC;var RC="AvatarFallback",NC=y.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=SC(RC,n),[a,s]=y.useState(r===void 0);return y.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&i.imageLoadingStatus!=="loaded"?g.jsx(be.span,{...o,ref:t}):null});NC.displayName=RC;function RW(e,t){const[n,r]=y.useState("idle");return xt(()=>{if(!e){r("error");return}let o=!0;const i=new window.Image,a=s=>()=>{o&&r(s)};return r("loading"),i.onload=a("loaded"),i.onerror=a("error"),i.src=e,t&&(i.referrerPolicy=t),()=>{o=!1}},[e,t]),n}var TC=CC,MC=PC,kC=NC;function Ma(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Rl(e){const[t,n]=y.useState(void 0);return xt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var zm="Checkbox",[NW,noe]=ct(zm),[TW,MW]=NW(zm),DC=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=e,[f,h]=y.useState(null),p=Me(t,_=>h(_)),m=y.useRef(!1),v=f?u||!!f.closest("form"):!0,[w=!1,b]=dt({prop:o,defaultProp:i,onChange:c}),x=y.useRef(w);return y.useEffect(()=>{const _=f==null?void 0:f.form;if(_){const C=()=>b(x.current);return _.addEventListener("reset",C),()=>_.removeEventListener("reset",C)}},[f,b]),g.jsxs(TW,{scope:n,state:w,disabled:s,children:[g.jsx(be.button,{type:"button",role:"checkbox","aria-checked":ko(w)?"mixed":w,"aria-required":a,"data-state":OC(w),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:p,onKeyDown:de(e.onKeyDown,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:de(e.onClick,_=>{b(C=>ko(C)?!0:!C),v&&(m.current=_.isPropagationStopped(),m.current||_.stopPropagation())})}),v&&g.jsx(kW,{control:f,bubbles:!m.current,name:r,value:l,checked:w,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"},defaultChecked:ko(i)?!1:i})]})});DC.displayName=zm;var AC="CheckboxIndicator",IC=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=MW(AC,n);return g.jsx(gt,{present:r||ko(i.state)||i.state===!0,children:g.jsx(be.span,{"data-state":OC(i.state),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});IC.displayName=AC;var kW=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...i}=e,a=y.useRef(null),s=Ma(n),l=Rl(t);y.useEffect(()=>{const u=a.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(s!==n&&h){const p=new Event("click",{bubbles:r});u.indeterminate=ko(n),h.call(u,ko(n)?!1:n),u.dispatchEvent(p)}},[s,n,r]);const c=y.useRef(ko(n)?!1:n);return g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...i,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ko(e){return e==="indeterminate"}function OC(e){return ko(e)?"indeterminate":e?"checked":"unchecked"}var jC=DC,DW=IC;const AW=["top","right","bottom","left"],Do=Math.min,Nn=Math.max,md=Math.round,gd=Math.floor,Tr=e=>({x:e,y:e}),IW={left:"right",right:"left",bottom:"top",top:"bottom"},OW={start:"end",end:"start"};function Bm(e,t,n){return Nn(e,Do(t,n))}function Qr(e,t){return typeof e=="function"?e(t):e}function eo(e){return e.split("-")[0]}function ka(e){return e.split("-")[1]}function Hm(e){return e==="x"?"y":"x"}function Vm(e){return e==="y"?"height":"width"}function Ao(e){return["top","bottom"].includes(eo(e))?"y":"x"}function Um(e){return Hm(Ao(e))}function jW(e,t,n){n===void 0&&(n=!1);const r=ka(e),o=Um(e),i=Vm(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=wd(a)),[a,wd(a)]}function $W(e){const t=wd(e);return[Wm(e),t,Wm(t)]}function Wm(e){return e.replace(/start|end/g,t=>OW[t])}function FW(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function LW(e,t,n,r){const o=ka(e);let i=FW(eo(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Wm)))),i}function wd(e){return e.replace(/left|right|bottom|top/g,t=>IW[t])}function zW(e){return{top:0,right:0,bottom:0,left:0,...e}}function $C(e){return typeof e!="number"?zW(e):{top:e,right:e,bottom:e,left:e}}function vd(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}}function FC(e,t,n){let{reference:r,floating:o}=e;const i=Ao(t),a=Um(t),s=Vm(a),l=eo(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/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(ka(t)){case"start":h[a]-=f*(n&&c?-1:1);break;case"end":h[a]+=f*(n&&c?-1:1);break}return h}const BW=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=FC(c,r,l),f=r,h={},p=0;for(let m=0;m<s.length;m++){const{name:v,fn:w}=s[m],{x:b,y:x,data:_,reset:C}=await w({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=b??u,d=x??d,h={...h,[v]:{...h[v],..._}},C&&p<=50&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:d}=FC(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function Nl(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Qr(t,e),p=$C(h),v=s[f?d==="floating"?"reference":"floating":d],w=vd(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),_=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=vd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:x,strategy:l}):b);return{top:(w.top-C.top+p.top)/_.y,bottom:(C.bottom-w.bottom+p.bottom)/_.y,left:(w.left-C.left+p.left)/_.x,right:(C.right-w.right+p.right)/_.x}}const HW=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Qr(e,t)||{};if(c==null)return{};const d=$C(u),f={x:n,y:r},h=Um(o),p=Vm(h),m=await a.getDimensions(c),v=h==="y",w=v?"top":"left",b=v?"bottom":"right",x=v?"clientHeight":"clientWidth",_=i.reference[p]+i.reference[h]-f[h]-i.floating[p],C=f[h]-i.reference[h],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let R=N?N[x]:0;(!R||!await(a.isElement==null?void 0:a.isElement(N)))&&(R=s.floating[x]||i.floating[p]);const T=_/2-C/2,M=R/2-m[p]/2-1,D=Do(d[w],M),A=Do(d[b],M),O=D,$=R-m[p]-A,W=R/2-m[p]/2+T,re=Bm(O,W,$),Y=!l.arrow&&ka(o)!=null&&W!==re&&i.reference[p]/2-(W<O?D:A)-m[p]/2<0,Z=Y?W<O?W-O:W-$:0;return{[h]:f[h]+Z,data:{[h]:re,centerOffset:W-re-Z,...Y&&{alignmentOffset:Z}},reset:Y}}}),VW=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...v}=Qr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=eo(o),b=Ao(s),x=eo(s)===s,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=f||(x||!m?[wd(s)]:$W(s)),N=p!=="none";!f&&N&&C.push(...LW(s,m,p,_));const R=[s,...C],T=await Nl(t,v),M=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&M.push(T[w]),d){const W=jW(o,a,_);M.push(T[W[0]],T[W[1]])}if(D=[...D,{placement:o,overflows:M}],!M.every(W=>W<=0)){var A,O;const W=(((A=i.flip)==null?void 0:A.index)||0)+1,re=R[W];if(re)return{data:{index:W,overflows:D},reset:{placement:re}};let Y=(O=D.filter(Z=>Z.overflows[0]<=0).sort((Z,B)=>Z.overflows[1]-B.overflows[1])[0])==null?void 0:O.placement;if(!Y)switch(h){case"bestFit":{var $;const Z=($=D.filter(B=>{if(N){const oe=Ao(B.placement);return oe===b||oe==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(oe=>oe>0).reduce((oe,ee)=>oe+ee,0)]).sort((B,oe)=>B[1]-oe[1])[0])==null?void 0:$[0];Z&&(Y=Z);break}case"initialPlacement":Y=s;break}if(o!==Y)return{reset:{placement:Y}}}return{}}}};function LC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zC(e){return AW.some(t=>e[t]>=0)}const UW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Qr(e,t);switch(r){case"referenceHidden":{const i=await Nl(t,{...o,elementContext:"reference"}),a=LC(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:zC(a)}}}case"escaped":{const i=await Nl(t,{...o,altBoundary:!0}),a=LC(i,n.floating);return{data:{escapedOffsets:a,escaped:zC(a)}}}default:return{}}}}};async function WW(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=eo(n),s=ka(n),l=Ao(n)==="y",c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d=Qr(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof p=="number"&&(h=s==="end"?p*-1:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const GW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await WW(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},qW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:v=>{let{x:w,y:b}=v;return{x:w,y:b}}},...l}=Qr(e,t),c={x:n,y:r},u=await Nl(t,l),d=Ao(eo(o)),f=Hm(d);let h=c[f],p=c[d];if(i){const v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",b=h+u[v],x=h-u[w];h=Bm(b,h,x)}if(a){const v=d==="y"?"top":"left",w=d==="y"?"bottom":"right",b=p+u[v],x=p-u[w];p=Bm(b,p,x)}const m=s.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:i,[d]:a}}}}}},YW=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Qr(e,t),u={x:n,y:r},d=Ao(o),f=Hm(d);let h=u[f],p=u[d];const m=Qr(s,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const x=f==="y"?"height":"width",_=i.reference[f]-i.floating[x]+v.mainAxis,C=i.reference[f]+i.reference[x]-v.mainAxis;h<_?h=_:h>C&&(h=C)}if(c){var w,b;const x=f==="y"?"width":"height",_=["top","left"].includes(eo(o)),C=i.reference[d]-i.floating[x]+(_&&((w=a.offset)==null?void 0:w[d])||0)+(_?0:v.crossAxis),N=i.reference[d]+i.reference[x]+(_?0:((b=a.offset)==null?void 0:b[d])||0)-(_?v.crossAxis:0);p<C?p=C:p>N&&(p=N)}return{[f]:h,[d]:p}}}},KW=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=Qr(e,t),u=await Nl(t,c),d=eo(o),f=ka(o),h=Ao(o)==="y",{width:p,height:m}=i.floating;let v,w;d==="top"||d==="bottom"?(v=d,w=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(w=d,v=f==="end"?"top":"bottom");const b=m-u.top-u.bottom,x=p-u.left-u.right,_=Do(m-u[v],b),C=Do(p-u[w],x),N=!t.middlewareData.shift;let R=_,T=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=b),N&&!f){const D=Nn(u.left,0),A=Nn(u.right,0),O=Nn(u.top,0),$=Nn(u.bottom,0);h?T=p-2*(D!==0||A!==0?D+A:Nn(u.left,u.right)):R=m-2*(O!==0||$!==0?O+$:Nn(u.top,u.bottom))}await l({...t,availableWidth:T,availableHeight:R});const M=await a.getDimensions(s.floating);return p!==M.width||m!==M.height?{reset:{rects:!0}}:{}}}};function yd(){return typeof window<"u"}function Da(e){return BC(e)?(e.nodeName||"").toLowerCase():"#document"}function Tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mr(e){var t;return(t=(BC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function BC(e){return yd()?e instanceof Node||e instanceof Tn(e).Node:!1}function er(e){return yd()?e instanceof Element||e instanceof Tn(e).Element:!1}function kr(e){return yd()?e instanceof HTMLElement||e instanceof Tn(e).HTMLElement:!1}function HC(e){return!yd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Tn(e).ShadowRoot}function Tl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=tr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function XW(e){return["table","td","th"].includes(Da(e))}function bd(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Gm(e){const t=qm(),n=er(e)?tr(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function ZW(e){let t=Io(e);for(;kr(t)&&!Aa(t);){if(Gm(t))return t;if(bd(t))return null;t=Io(t)}return null}function qm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Aa(e){return["html","body","#document"].includes(Da(e))}function tr(e){return Tn(e).getComputedStyle(e)}function xd(e){return er(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Io(e){if(Da(e)==="html")return e;const t=e.assignedSlot||e.parentNode||HC(e)&&e.host||Mr(e);return HC(t)?t.host:t}function VC(e){const t=Io(e);return Aa(t)?e.ownerDocument?e.ownerDocument.body:e.body:kr(t)&&Tl(t)?t:VC(t)}function Ml(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=VC(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Tn(o);if(i){const s=Ym(a);return t.concat(a,a.visualViewport||[],Tl(o)?o:[],s&&n?Ml(s):[])}return t.concat(o,Ml(o,[],n))}function Ym(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function UC(e){const t=tr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=kr(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=md(n)!==i||md(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Km(e){return er(e)?e:e.contextElement}function Ia(e){const t=Km(e);if(!kr(t))return Tr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=UC(t);let a=(i?md(n.width):n.width)/r,s=(i?md(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const JW=Tr(0);function WC(e){const t=Tn(e);return!qm()||!t.visualViewport?JW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function QW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Tn(e)?!1:t}function mi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Km(e);let a=Tr(1);t&&(r?er(r)&&(a=Ia(r)):a=Ia(e));const s=QW(i,n,r)?WC(i):Tr(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const f=Tn(i),h=r&&er(r)?Tn(r):r;let p=f,m=Ym(p);for(;m&&r&&h!==p;){const v=Ia(m),w=m.getBoundingClientRect(),b=tr(m),x=w.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,_=w.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=x,c+=_,p=Tn(m),m=Ym(p)}}return vd({width:u,height:d,x:l,y:c})}function Xm(e,t){const n=xd(e).scrollLeft;return t?t.left+n:mi(Mr(e)).left+n}function GC(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Xm(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function eG(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=Mr(r),s=t?bd(t.floating):!1;if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Tr(1);const u=Tr(0),d=kr(r);if((d||!d&&!i)&&((Da(r)!=="body"||Tl(a))&&(l=xd(r)),kr(r))){const h=mi(r);c=Ia(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=a&&!d&&!i?GC(a,l,!0):Tr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function tG(e){return Array.from(e.getClientRects())}function nG(e){const t=Mr(e),n=xd(e),r=e.ownerDocument.body,o=Nn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Nn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Xm(e);const s=-n.scrollTop;return tr(r).direction==="rtl"&&(a+=Nn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function rG(e,t){const n=Tn(e),r=Mr(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const c=qm();(!c||c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}function oG(e,t){const n=mi(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=kr(e)?Ia(e):Tr(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:a,height:s,x:l,y:c}}function qC(e,t,n){let r;if(t==="viewport")r=rG(e,n);else if(t==="document")r=nG(Mr(e));else if(er(t))r=oG(t,n);else{const o=WC(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return vd(r)}function YC(e,t){const n=Io(e);return n===t||!er(n)||Aa(n)?!1:tr(n).position==="fixed"||YC(n,t)}function iG(e,t){const n=t.get(e);if(n)return n;let r=Ml(e,[],!1).filter(s=>er(s)&&Da(s)!=="body"),o=null;const i=tr(e).position==="fixed";let a=i?Io(e):e;for(;er(a)&&!Aa(a);){const s=tr(a),l=Gm(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Tl(a)&&!l&&YC(e,a))?r=r.filter(u=>u!==a):o=s,a=Io(a)}return t.set(e,r),r}function aG(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?bd(t)?[]:iG(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const d=qC(t,u,o);return c.top=Nn(d.top,c.top),c.right=Do(d.right,c.right),c.bottom=Do(d.bottom,c.bottom),c.left=Nn(d.left,c.left),c},qC(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function sG(e){const{width:t,height:n}=UC(e);return{width:t,height:n}}function lG(e,t,n){const r=kr(t),o=Mr(t),i=n==="fixed",a=mi(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Tr(0);if(r||!r&&!i)if((Da(t)!=="body"||Tl(o))&&(s=xd(t)),r){const f=mi(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&(l.x=Xm(o));const c=o&&!r&&!i?GC(o,s):Tr(0),u=a.left+s.scrollLeft-l.x-c.x,d=a.top+s.scrollTop-l.y-c.y;return{x:u,y:d,width:a.width,height:a.height}}function Zm(e){return tr(e).position==="static"}function KC(e,t){if(!kr(e)||tr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Mr(e)===n&&(n=n.ownerDocument.body),n}function XC(e,t){const n=Tn(e);if(bd(e))return n;if(!kr(e)){let o=Io(e);for(;o&&!Aa(o);){if(er(o)&&!Zm(o))return o;o=Io(o)}return n}let r=KC(e,t);for(;r&&XW(r)&&Zm(r);)r=KC(r,t);return r&&Aa(r)&&Zm(r)&&!Gm(r)?n:r||ZW(e)||n}const cG=async function(e){const t=this.getOffsetParent||XC,n=this.getDimensions,r=await n(e.floating);return{reference:lG(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uG(e){return tr(e).direction==="rtl"}const dG={convertOffsetParentRelativeRectToViewportRelativeRect:eG,getDocumentElement:Mr,getClippingRect:aG,getOffsetParent:XC,getElementRects:cG,getClientRects:tG,getDimensions:sG,getScale:Ia,isElement:er,isRTL:uG};function ZC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fG(e,t){let n=null,r;const o=Mr(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=c;if(s||t(),!f||!h)return;const p=gd(d),m=gd(o.clientWidth-(u+f)),v=gd(o.clientHeight-(d+h)),w=gd(u),x={rootMargin:-p+"px "+-m+"px "+-v+"px "+-w+"px",threshold:Nn(0,Do(1,l))||1};let _=!0;function C(N){const R=N[0].intersectionRatio;if(R!==l){if(!_)return a();R?a(!1,R):r=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!ZC(c,e.getBoundingClientRect())&&a(),_=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return a(!0),i}function hG(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Km(e),u=o||i?[...c?Ml(c):[],...Ml(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const d=c&&s?fG(c,n):null;let f=-1,h=null;a&&(h=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let p,m=l?mi(e):null;l&&v();function v(){const w=mi(e);m&&!ZC(m,w)&&n(),m=w,p=requestAnimationFrame(v)}return n(),()=>{var w;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d==null||d(),(w=h)==null||w.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const pG=GW,mG=qW,gG=VW,wG=KW,vG=UW,JC=HW,yG=YW,bG=(e,t,n)=>{const r=new Map,o={platform:dG,...n},i={...o.platform,_c:r};return BW(e,t,{...o,platform:i})};var _d=typeof document<"u"?E.useLayoutEffect:E.useEffect;function Sd(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(!Sd(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Sd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function QC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eE(e,t){const n=QC(e);return Math.round(t*n)/n}function Jm(e){const t=y.useRef(e);return _d(()=>{t.current=e}),t}function xG(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=y.useState(r);Sd(f,r)||h(r);const[p,m]=y.useState(null),[v,w]=y.useState(null),b=y.useCallback(B=>{B!==N.current&&(N.current=B,m(B))},[]),x=y.useCallback(B=>{B!==R.current&&(R.current=B,w(B))},[]),_=i||p,C=a||v,N=y.useRef(null),R=y.useRef(null),T=y.useRef(u),M=l!=null,D=Jm(l),A=Jm(o),O=Jm(c),$=y.useCallback(()=>{if(!N.current||!R.current)return;const B={placement:t,strategy:n,middleware:f};A.current&&(B.platform=A.current),bG(N.current,R.current,B).then(oe=>{const ee={...oe,isPositioned:O.current!==!1};W.current&&!Sd(T.current,ee)&&(T.current=ee,xc.flushSync(()=>{d(ee)}))})},[f,t,n,A,O]);_d(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(B=>({...B,isPositioned:!1})))},[c]);const W=y.useRef(!1);_d(()=>(W.current=!0,()=>{W.current=!1}),[]),_d(()=>{if(_&&(N.current=_),C&&(R.current=C),_&&C){if(D.current)return D.current(_,C,$);$()}},[_,C,$,D,M]);const re=y.useMemo(()=>({reference:N,floating:R,setReference:b,setFloating:x}),[b,x]),Y=y.useMemo(()=>({reference:_,floating:C}),[_,C]),Z=y.useMemo(()=>{const B={position:n,left:0,top:0};if(!Y.floating)return B;const oe=eE(Y.floating,u.x),ee=eE(Y.floating,u.y);return s?{...B,transform:"translate("+oe+"px, "+ee+"px)",...QC(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:oe,top:ee}},[n,s,Y.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:$,refs:re,elements:Y,floatingStyles:Z}),[u,$,re,Y,Z])}const _G=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?JC({element:r.current,padding:o}).fn(n):{}:r?JC({element:r,padding:o}).fn(n):{}}}},SG=(e,t)=>({...pG(e),options:[e,t]}),CG=(e,t)=>({...mG(e),options:[e,t]}),EG=(e,t)=>({...yG(e),options:[e,t]}),PG=(e,t)=>({...gG(e),options:[e,t]}),RG=(e,t)=>({...wG(e),options:[e,t]}),NG=(e,t)=>({...vG(e),options:[e,t]}),TG=(e,t)=>({..._G(e),options:[e,t]});var MG="Arrow",tE=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return g.jsx(be.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});tE.displayName=MG;var kG=tE,Qm="Popper",[nE,Dr]=ct(Qm),[DG,rE]=nE(Qm),oE=e=>{const{__scopePopper:t,children:n}=e,[r,o]=y.useState(null);return g.jsx(DG,{scope:t,anchor:r,onAnchorChange:o,children:n})};oE.displayName=Qm;var iE="PopperAnchor",aE=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=rE(iE,n),a=y.useRef(null),s=Me(t,a);return y.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:g.jsx(be.div,{...o,ref:s})});aE.displayName=iE;var eg="PopperContent",[AG,IG]=nE(eg),sE=y.forwardRef((e,t)=>{var K,z,ie,le,ae,H;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:p,...m}=e,v=rE(eg,n),[w,b]=y.useState(null),x=Me(t,ue=>b(ue)),[_,C]=y.useState(null),N=Rl(_),R=(N==null?void 0:N.width)??0,T=(N==null?void 0:N.height)??0,M=r+(i!=="center"?"-"+i:""),D=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},A=Array.isArray(c)?c:[c],O=A.length>0,$={padding:D,boundary:A.filter(jG),altBoundary:O},{refs:W,floatingStyles:re,placement:Y,isPositioned:Z,middlewareData:B}=xG({strategy:"fixed",placement:M,whileElementsMounted:(...ue)=>hG(...ue,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[SG({mainAxis:o+T,alignmentAxis:a}),l&&CG({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?EG():void 0,...$}),l&&PG({...$}),RG({...$,apply:({elements:ue,rects:se,availableWidth:ye,availableHeight:Ce})=>{const{width:xe,height:j}=se.reference,V=ue.floating.style;V.setProperty("--radix-popper-available-width",`${ye}px`),V.setProperty("--radix-popper-available-height",`${Ce}px`),V.setProperty("--radix-popper-anchor-width",`${xe}px`),V.setProperty("--radix-popper-anchor-height",`${j}px`)}}),_&&TG({element:_,padding:s}),$G({arrowWidth:R,arrowHeight:T}),f&&NG({strategy:"referenceHidden",...$})]}),[oe,ee]=uE(Y),ne=ot(p);xt(()=>{Z&&(ne==null||ne())},[Z,ne]);const G=(K=B.arrow)==null?void 0:K.x,F=(z=B.arrow)==null?void 0:z.y,q=((ie=B.arrow)==null?void 0:ie.centerOffset)!==0,[ce,L]=y.useState();return xt(()=>{w&&L(window.getComputedStyle(w).zIndex)},[w]),g.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...re,transform:Z?re.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[(le=B.transformOrigin)==null?void 0:le.x,(ae=B.transformOrigin)==null?void 0:ae.y].join(" "),...((H=B.hide)==null?void 0:H.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(AG,{scope:n,placedSide:oe,onArrowChange:C,arrowX:G,arrowY:F,shouldHideArrow:q,children:g.jsx(be.div,{"data-side":oe,"data-align":ee,...m,ref:x,style:{...m.style,animation:Z?void 0:"none"}})})})});sE.displayName=eg;var lE="PopperArrow",OG={top:"bottom",right:"left",bottom:"top",left:"right"},cE=y.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=IG(lE,r),a=OG[i.placedSide];return g.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:g.jsx(kG,{...o,ref:n,style:{...o.style,display:"block"}})})});cE.displayName=lE;function jG(e){return e!==null}var $G=e=>({name:"transformOrigin",options:e,fn(t){var v,w,b;const{placement:n,rects:r,middlewareData:o}=t,a=((v=o.arrow)==null?void 0:v.centerOffset)!==0,s=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[c,u]=uE(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((w=o.arrow)==null?void 0:w.x)??0)+s/2,h=(((b=o.arrow)==null?void 0:b.y)??0)+l/2;let p="",m="";return c==="bottom"?(p=a?d:`${f}px`,m=`${-l}px`):c==="top"?(p=a?d:`${f}px`,m=`${r.floating.height+l}px`):c==="right"?(p=`${-l}px`,m=a?d:`${h}px`):c==="left"&&(p=`${r.floating.width+l}px`,m=a?d:`${h}px`),{data:{x:p,y:m}}}});function uE(e){const[t,n="center"]=e.split("-");return[t,n]}var Oa=oE,ja=aE,kl=sE,Dl=cE,tg="rovingFocusGroup.onEntryFocus",FG={bubbles:!1,cancelable:!0},Cd="RovingFocusGroup",[ng,dE,LG]=No(Cd),[zG,Ar]=ct(Cd,[LG]),[BG,HG]=zG(Cd),fE=y.forwardRef((e,t)=>g.jsx(ng.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(ng.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(VG,{...e,ref:t})})}));fE.displayName=Cd;var VG=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=y.useRef(null),h=Me(t,f),p=Jn(i),[m=null,v]=dt({prop:a,defaultProp:s,onChange:l}),[w,b]=y.useState(!1),x=ot(c),_=dE(n),C=y.useRef(!1),[N,R]=y.useState(0);return y.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(tg,x),()=>T.removeEventListener(tg,x)},[x]),g.jsx(BG,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:m,onItemFocus:y.useCallback(T=>v(T),[v]),onItemShiftTab:y.useCallback(()=>b(!0),[]),onFocusableItemAdd:y.useCallback(()=>R(T=>T+1),[]),onFocusableItemRemove:y.useCallback(()=>R(T=>T-1),[]),children:g.jsx(be.div,{tabIndex:w||N===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:de(e.onMouseDown,()=>{C.current=!0}),onFocus:de(e.onFocus,T=>{const M=!C.current;if(T.target===T.currentTarget&&M&&!w){const D=new CustomEvent(tg,FG);if(T.currentTarget.dispatchEvent(D),!D.defaultPrevented){const A=_().filter(Y=>Y.focusable),O=A.find(Y=>Y.active),$=A.find(Y=>Y.id===m),re=[O,$,...A].filter(Boolean).map(Y=>Y.ref.current);mE(re,u)}}C.current=!1}),onBlur:de(e.onBlur,()=>b(!1))})})}),hE="RovingFocusGroupItem",pE=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...a}=e,s=Rt(),l=i||s,c=HG(hE,n),u=c.currentTabStopId===l,d=dE(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=c;return y.useEffect(()=>{if(r)return f(),()=>h()},[r,f,h]),g.jsx(ng.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:g.jsx(be.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:de(e.onMouseDown,p=>{r?c.onItemFocus(l):p.preventDefault()}),onFocus:de(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:de(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const m=GG(p,c.orientation,c.dir);if(m!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let w=d().filter(b=>b.focusable).map(b=>b.ref.current);if(m==="last")w.reverse();else if(m==="prev"||m==="next"){m==="prev"&&w.reverse();const b=w.indexOf(p.currentTarget);w=c.loop?qG(w,b+1):w.slice(b+1)}setTimeout(()=>mE(w))}})})})});pE.displayName=hE;var UG={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WG(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function GG(e,t,n){const r=WG(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return UG[r]}function mE(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Al=fE,Il=pE,rg=["Enter"," "],YG=["ArrowDown","PageUp","Home"],gE=["ArrowUp","PageDown","End"],KG=[...YG,...gE],XG={ltr:[...rg,"ArrowRight"],rtl:[...rg,"ArrowLeft"]},ZG={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ol="Menu",[jl,JG,QG]=No(Ol),[gi,$l]=ct(Ol,[QG,Dr,Ar]),Fl=Dr(),wE=Ar(),[vE,Oo]=gi(Ol),[e7,Ll]=gi(Ol),yE=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=e,s=Fl(t),[l,c]=y.useState(null),u=y.useRef(!1),d=ot(i),f=Jn(o);return y.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),g.jsx(Oa,{...s,children:g.jsx(vE,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:g.jsx(e7,{scope:t,onClose:y.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:a,children:r})})})};yE.displayName=Ol;var t7="MenuAnchor",og=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fl(n);return g.jsx(ja,{...o,...r,ref:t})});og.displayName=t7;var ig="MenuPortal",[n7,bE]=gi(ig,{forceMount:void 0}),xE=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Oo(ig,t);return g.jsx(n7,{scope:t,forceMount:n,children:g.jsx(gt,{present:n||i.open,children:g.jsx(_l,{asChild:!0,container:o,children:r})})})};xE.displayName=ig;var Hn="MenuContent",[r7,ag]=gi(Hn),_E=y.forwardRef((e,t)=>{const n=bE(Hn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Oo(Hn,e.__scopeMenu),a=Ll(Hn,e.__scopeMenu);return g.jsx(jl.Provider,{scope:e.__scopeMenu,children:g.jsx(gt,{present:r||i.open,children:g.jsx(jl.Slot,{scope:e.__scopeMenu,children:a.modal?g.jsx(o7,{...o,ref:t}):g.jsx(i7,{...o,ref:t})})})})}),o7=y.forwardRef((e,t)=>{const n=Oo(Hn,e.__scopeMenu),r=y.useRef(null),o=Me(t,r);return y.useEffect(()=>{const i=r.current;if(i)return Pl(i)},[]),g.jsx(sg,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:de(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),i7=y.forwardRef((e,t)=>{const n=Oo(Hn,e.__scopeMenu);return g.jsx(sg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),sg=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:p,...m}=e,v=Oo(Hn,n),w=Ll(Hn,n),b=Fl(n),x=wE(n),_=JG(n),[C,N]=y.useState(null),R=y.useRef(null),T=Me(t,R,v.onContentChange),M=y.useRef(0),D=y.useRef(""),A=y.useRef(0),O=y.useRef(null),$=y.useRef("right"),W=y.useRef(0),re=p?El:y.Fragment,Y=p?{as:Zn,allowPinchZoom:!0}:void 0,Z=oe=>{var K,z;const ee=D.current+oe,ne=_().filter(ie=>!ie.disabled),G=document.activeElement,F=(K=ne.find(ie=>ie.ref.current===G))==null?void 0:K.textValue,q=ne.map(ie=>ie.textValue),ce=w7(q,ee,F),L=(z=ne.find(ie=>ie.textValue===ce))==null?void 0:z.ref.current;(function ie(le){D.current=le,window.clearTimeout(M.current),le!==""&&(M.current=window.setTimeout(()=>ie(""),1e3))})(ee),L&&setTimeout(()=>L.focus())};y.useEffect(()=>()=>window.clearTimeout(M.current),[]),id();const B=y.useCallback(oe=>{var ne,G;return $.current===((ne=O.current)==null?void 0:ne.side)&&y7(oe,(G=O.current)==null?void 0:G.area)},[]);return g.jsx(r7,{scope:n,searchRef:D,onItemEnter:y.useCallback(oe=>{B(oe)&&oe.preventDefault()},[B]),onItemLeave:y.useCallback(oe=>{var ee;B(oe)||((ee=R.current)==null||ee.focus(),N(null))},[B]),onTriggerLeave:y.useCallback(oe=>{B(oe)&&oe.preventDefault()},[B]),pointerGraceTimerRef:A,onPointerGraceIntentChange:y.useCallback(oe=>{O.current=oe},[]),children:g.jsx(re,{...Y,children:g.jsx(xl,{asChild:!0,trapped:o,onMountAutoFocus:de(i,oe=>{var ee;oe.preventDefault(),(ee=R.current)==null||ee.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:g.jsx(To,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:g.jsx(Al,{asChild:!0,...x,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:N,onEntryFocus:de(l,oe=>{w.isUsingKeyboardRef.current||oe.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(kl,{role:"menu","aria-orientation":"vertical","data-state":zE(v.open),"data-radix-menu-content":"",dir:w.dir,...b,...m,ref:T,style:{outline:"none",...m.style},onKeyDown:de(m.onKeyDown,oe=>{const ne=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,G=oe.ctrlKey||oe.altKey||oe.metaKey,F=oe.key.length===1;ne&&(oe.key==="Tab"&&oe.preventDefault(),!G&&F&&Z(oe.key));const q=R.current;if(oe.target!==q||!KG.includes(oe.key))return;oe.preventDefault();const L=_().filter(K=>!K.disabled).map(K=>K.ref.current);gE.includes(oe.key)&&L.reverse(),m7(L)}),onBlur:de(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(M.current),D.current="")}),onPointerMove:de(e.onPointerMove,Bl(oe=>{const ee=oe.target,ne=W.current!==oe.clientX;if(oe.currentTarget.contains(ee)&&ne){const G=oe.clientX>W.current?"right":"left";$.current=G,W.current=oe.clientX}}))})})})})})})});_E.displayName=Hn;var a7="MenuGroup",lg=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{role:"group",...r,ref:t})});lg.displayName=a7;var s7="MenuLabel",SE=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{...r,ref:t})});SE.displayName=s7;var Ed="MenuItem",CE="menu.itemSelect",Pd=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=y.useRef(null),a=Ll(Ed,e.__scopeMenu),s=ag(Ed,e.__scopeMenu),l=Me(t,i),c=y.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const f=new CustomEvent(CE,{bubbles:!0,cancelable:!0});d.addEventListener(CE,h=>r==null?void 0:r(h),{once:!0}),ed(d,f),f.defaultPrevented?c.current=!1:a.onClose()}};return g.jsx(EE,{...o,ref:l,disabled:n,onClick:de(e.onClick,u),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),c.current=!0},onPointerUp:de(e.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:de(e.onKeyDown,d=>{const f=s.searchRef.current!=="";n||f&&d.key===" "||rg.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Pd.displayName=Ed;var EE=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,a=ag(Ed,n),s=wE(n),l=y.useRef(null),c=Me(t,l),[u,d]=y.useState(!1),[f,h]=y.useState("");return y.useEffect(()=>{const p=l.current;p&&h((p.textContent??"").trim())},[i.children]),g.jsx(jl.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:g.jsx(Il,{asChild:!0,...s,focusable:!r,children:g.jsx(be.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:de(e.onPointerMove,Bl(p=>{r?a.onItemLeave(p):(a.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:de(e.onPointerLeave,Bl(p=>a.onItemLeave(p))),onFocus:de(e.onFocus,()=>d(!0)),onBlur:de(e.onBlur,()=>d(!1))})})})}),l7="MenuCheckboxItem",PE=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return g.jsx(kE,{scope:e.__scopeMenu,checked:n,children:g.jsx(Pd,{role:"menuitemcheckbox","aria-checked":Rd(n)?"mixed":n,...o,ref:t,"data-state":dg(n),onSelect:de(o.onSelect,()=>r==null?void 0:r(Rd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});PE.displayName=l7;var RE="MenuRadioGroup",[c7,u7]=gi(RE,{value:void 0,onValueChange:()=>{}}),NE=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=ot(r);return g.jsx(c7,{scope:e.__scopeMenu,value:n,onValueChange:i,children:g.jsx(lg,{...o,ref:t})})});NE.displayName=RE;var TE="MenuRadioItem",ME=y.forwardRef((e,t)=>{const{value:n,...r}=e,o=u7(TE,e.__scopeMenu),i=n===o.value;return g.jsx(kE,{scope:e.__scopeMenu,checked:i,children:g.jsx(Pd,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":dg(i),onSelect:de(r.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})})});ME.displayName=TE;var cg="MenuItemIndicator",[kE,d7]=gi(cg,{checked:!1}),DE=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=d7(cg,n);return g.jsx(gt,{present:r||Rd(i.checked)||i.checked===!0,children:g.jsx(be.span,{...o,ref:t,"data-state":dg(i.checked)})})});DE.displayName=cg;var f7="MenuSeparator",AE=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(be.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});AE.displayName=f7;var h7="MenuArrow",IE=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fl(n);return g.jsx(Dl,{...o,...r,ref:t})});IE.displayName=h7;var ug="MenuSub",[p7,OE]=gi(ug),jE=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,i=Oo(ug,t),a=Fl(t),[s,l]=y.useState(null),[c,u]=y.useState(null),d=ot(o);return y.useEffect(()=>(i.open===!1&&d(!1),()=>d(!1)),[i.open,d]),g.jsx(Oa,{...a,children:g.jsx(vE,{scope:t,open:r,onOpenChange:d,content:c,onContentChange:u,children:g.jsx(p7,{scope:t,contentId:Rt(),triggerId:Rt(),trigger:s,onTriggerChange:l,children:n})})})};jE.displayName=ug;var zl="MenuSubTrigger",$E=y.forwardRef((e,t)=>{const n=Oo(zl,e.__scopeMenu),r=Ll(zl,e.__scopeMenu),o=OE(zl,e.__scopeMenu),i=ag(zl,e.__scopeMenu),a=y.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=y.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return y.useEffect(()=>u,[u]),y.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),g.jsx(og,{asChild:!0,...c,children:g.jsx(EE,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":zE(n.open),...e,ref:bl(t,o.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:de(e.onPointerMove,Bl(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:de(e.onPointerLeave,Bl(d=>{var h,p;u();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const m=(p=n.content)==null?void 0:p.dataset.side,v=m==="right",w=v?-5:5,b=f[v?"left":"right"],x=f[v?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+w,y:d.clientY},{x:b,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:b,y:f.bottom}],side:m}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:de(e.onKeyDown,d=>{var h;const f=i.searchRef.current!=="";e.disabled||f&&d.key===" "||XG[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});$E.displayName=zl;var FE="MenuSubContent",LE=y.forwardRef((e,t)=>{const n=bE(Hn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Oo(Hn,e.__scopeMenu),a=Ll(Hn,e.__scopeMenu),s=OE(FE,e.__scopeMenu),l=y.useRef(null),c=Me(t,l);return g.jsx(jl.Provider,{scope:e.__scopeMenu,children:g.jsx(gt,{present:r||i.open,children:g.jsx(jl.Slot,{scope:e.__scopeMenu,children:g.jsx(sg,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:de(e.onFocusOutside,u=>{u.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:de(e.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:de(e.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),f=ZG[a.dir].includes(u.key);d&&f&&(i.onOpenChange(!1),(h=s.trigger)==null||h.focus(),u.preventDefault())})})})})})});LE.displayName=FE;function zE(e){return e?"open":"closed"}function Rd(e){return e==="indeterminate"}function dg(e){return Rd(e)?"indeterminate":e?"checked":"unchecked"}function m7(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function g7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function w7(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=g7(e,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function v7(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i].x,l=t[i].y,c=t[a].x,u=t[a].y;l>r!=u>r&&n<(c-s)*(r-l)/(u-l)+s&&(o=!o)}return o}function y7(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return v7(n,t)}function Bl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var fg=yE,hg=og,pg=xE,mg=_E,gg=lg,wg=SE,vg=Pd,yg=PE,bg=NE,xg=ME,_g=DE,Sg=AE,Cg=IE,Eg=jE,Pg=$E,Rg=LE,Ng="ContextMenu",[b7,roe]=ct(Ng,[$l]),Gt=$l(),[x7,BE]=b7(Ng),HE=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:i=!0}=e,[a,s]=y.useState(!1),l=Gt(t),c=ot(r),u=y.useCallback(d=>{s(d),c(d)},[c]);return g.jsx(x7,{scope:t,open:a,onOpenChange:u,modal:i,children:g.jsx(fg,{...l,dir:o,open:a,onOpenChange:u,modal:i,children:n})})};HE.displayName=Ng;var VE="ContextMenuTrigger",UE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=e,i=BE(VE,n),a=Gt(n),s=y.useRef({x:0,y:0}),l=y.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),c=y.useRef(0),u=y.useCallback(()=>window.clearTimeout(c.current),[]),d=f=>{s.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return y.useEffect(()=>u,[u]),y.useEffect(()=>void(r&&u()),[r,u]),g.jsxs(g.Fragment,{children:[g.jsx(hg,{...a,virtualRef:l}),g.jsx(be.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:de(e.onContextMenu,f=>{u(),d(f),f.preventDefault()}),onPointerDown:r?e.onPointerDown:de(e.onPointerDown,Nd(f=>{u(),c.current=window.setTimeout(()=>d(f),700)})),onPointerMove:r?e.onPointerMove:de(e.onPointerMove,Nd(u)),onPointerCancel:r?e.onPointerCancel:de(e.onPointerCancel,Nd(u)),onPointerUp:r?e.onPointerUp:de(e.onPointerUp,Nd(u))})]})});UE.displayName=VE;var _7="ContextMenuPortal",WE=e=>{const{__scopeContextMenu:t,...n}=e,r=Gt(t);return g.jsx(pg,{...r,...n})};WE.displayName=_7;var GE="ContextMenuContent",qE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=BE(GE,n),i=Gt(n),a=y.useRef(!1);return g.jsx(mg,{...i,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)==null||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)==null||l.call(e,s),!s.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});qE.displayName=GE;var S7="ContextMenuGroup",YE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(gg,{...o,...r,ref:t})});YE.displayName=S7;var C7="ContextMenuLabel",KE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(wg,{...o,...r,ref:t})});KE.displayName=C7;var E7="ContextMenuItem",XE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(vg,{...o,...r,ref:t})});XE.displayName=E7;var P7="ContextMenuCheckboxItem",ZE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(yg,{...o,...r,ref:t})});ZE.displayName=P7;var R7="ContextMenuRadioGroup",JE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(bg,{...o,...r,ref:t})});JE.displayName=R7;var N7="ContextMenuRadioItem",QE=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(xg,{...o,...r,ref:t})});QE.displayName=N7;var T7="ContextMenuItemIndicator",eP=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(_g,{...o,...r,ref:t})});eP.displayName=T7;var M7="ContextMenuSeparator",tP=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(Sg,{...o,...r,ref:t})});tP.displayName=M7;var k7="ContextMenuArrow",D7=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(Cg,{...o,...r,ref:t})});D7.displayName=k7;var A7="ContextMenuSub",nP=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:o,defaultOpen:i}=e,a=Gt(t),[s,l]=dt({prop:o,defaultProp:i,onChange:r});return g.jsx(Eg,{...a,open:s,onOpenChange:l,children:n})};nP.displayName=A7;var I7="ContextMenuSubTrigger",rP=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(Pg,{...o,...r,ref:t})});rP.displayName=I7;var O7="ContextMenuSubContent",oP=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Gt(n);return g.jsx(Rg,{...o,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});oP.displayName=O7;function Nd(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var j7=HE,$7=UE,iP=WE,aP=qE,F7=YE,sP=KE,lP=XE,cP=ZE,L7=JE,uP=QE,dP=eP,fP=tP,z7=nP,hP=rP,pP=oP,Tg="DropdownMenu",[B7,ooe]=ct(Tg,[$l]),qt=$l(),[H7,mP]=B7(Tg),gP=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,l=qt(t),c=y.useRef(null),[u=!1,d]=dt({prop:o,defaultProp:i,onChange:a});return g.jsx(H7,{scope:t,triggerId:Rt(),triggerRef:c,contentId:Rt(),open:u,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(f=>!f),[d]),modal:s,children:g.jsx(fg,{...l,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};gP.displayName=Tg;var wP="DropdownMenuTrigger",vP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=mP(wP,n),a=qt(n);return g.jsx(hg,{asChild:!0,...a,children:g.jsx(be.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:bl(t,i.triggerRef),onPointerDown:de(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:de(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});vP.displayName=wP;var V7="DropdownMenuPortal",yP=e=>{const{__scopeDropdownMenu:t,...n}=e,r=qt(t);return g.jsx(pg,{...r,...n})};yP.displayName=V7;var bP="DropdownMenuContent",xP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=mP(bP,n),i=qt(n),a=y.useRef(!1);return g.jsx(mg,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:de(e.onCloseAutoFocus,s=>{var l;a.current||(l=o.triggerRef.current)==null||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:de(e.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xP.displayName=bP;var U7="DropdownMenuGroup",_P=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(gg,{...o,...r,ref:t})});_P.displayName=U7;var W7="DropdownMenuLabel",SP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(wg,{...o,...r,ref:t})});SP.displayName=W7;var G7="DropdownMenuItem",CP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(vg,{...o,...r,ref:t})});CP.displayName=G7;var q7="DropdownMenuCheckboxItem",EP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(yg,{...o,...r,ref:t})});EP.displayName=q7;var Y7="DropdownMenuRadioGroup",PP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(bg,{...o,...r,ref:t})});PP.displayName=Y7;var K7="DropdownMenuRadioItem",RP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(xg,{...o,...r,ref:t})});RP.displayName=K7;var X7="DropdownMenuItemIndicator",NP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(_g,{...o,...r,ref:t})});NP.displayName=X7;var Z7="DropdownMenuSeparator",TP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(Sg,{...o,...r,ref:t})});TP.displayName=Z7;var J7="DropdownMenuArrow",Q7=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(Cg,{...o,...r,ref:t})});Q7.displayName=J7;var e9=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,a=qt(t),[s=!1,l]=dt({prop:r,defaultProp:i,onChange:o});return g.jsx(Eg,{...a,open:s,onOpenChange:l,children:n})},t9="DropdownMenuSubTrigger",MP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(Pg,{...o,...r,ref:t})});MP.displayName=t9;var n9="DropdownMenuSubContent",kP=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return g.jsx(Rg,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});kP.displayName=n9;var r9=gP,o9=vP,DP=yP,AP=xP,i9=_P,IP=SP,OP=CP,jP=EP,a9=PP,$P=RP,FP=NP,LP=TP,s9=e9,zP=MP,BP=kP,l9="Label",HP=y.forwardRef((e,t)=>g.jsx(be.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));HP.displayName=l9;var VP=HP,Mg,kg="HoverCard",[UP,ioe]=ct(kg,[Dr]),Td=Dr(),[c9,Dg]=UP(kg),WP=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:a=700,closeDelay:s=300}=e,l=Td(t),c=y.useRef(0),u=y.useRef(0),d=y.useRef(!1),f=y.useRef(!1),[h=!1,p]=dt({prop:r,defaultProp:o,onChange:i}),m=y.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>p(!0),a)},[a,p]),v=y.useCallback(()=>{clearTimeout(c.current),!d.current&&!f.current&&(u.current=window.setTimeout(()=>p(!1),s))},[s,p]),w=y.useCallback(()=>p(!1),[p]);return y.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),g.jsx(c9,{scope:t,open:h,onOpenChange:p,onOpen:m,onClose:v,onDismiss:w,hasSelectionRef:d,isPointerDownOnContentRef:f,children:g.jsx(Oa,{...l,children:n})})};WP.displayName=kg;var GP="HoverCardTrigger",qP=y.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Dg(GP,n),i=Td(n);return g.jsx(ja,{asChild:!0,...i,children:g.jsx(be.a,{"data-state":o.open?"open":"closed",...r,ref:t,onPointerEnter:de(e.onPointerEnter,kd(o.onOpen)),onPointerLeave:de(e.onPointerLeave,kd(o.onClose)),onFocus:de(e.onFocus,o.onOpen),onBlur:de(e.onBlur,o.onClose),onTouchStart:de(e.onTouchStart,a=>a.preventDefault())})})});qP.displayName=GP;var u9="HoverCardPortal",[aoe,d9]=UP(u9,{forceMount:void 0}),Md="HoverCardContent",YP=y.forwardRef((e,t)=>{const n=d9(Md,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=Dg(Md,e.__scopeHoverCard);return g.jsx(gt,{present:r||i.open,children:g.jsx(f9,{"data-state":i.open?"open":"closed",...o,onPointerEnter:de(e.onPointerEnter,kd(i.onOpen)),onPointerLeave:de(e.onPointerLeave,kd(i.onClose)),ref:t})})});YP.displayName=Md;var f9=y.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,...s}=e,l=Dg(Md,n),c=Td(n),u=y.useRef(null),d=Me(t,u),[f,h]=y.useState(!1);return y.useEffect(()=>{if(f){const p=document.body;return Mg=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=Mg,p.style.webkitUserSelect=Mg}}},[f]),y.useEffect(()=>{if(u.current){const p=()=>{h(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var v;((v=document.getSelection())==null?void 0:v.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),y.useEffect(()=>{u.current&&m9(u.current).forEach(m=>m.setAttribute("tabindex","-1"))}),g.jsx(To,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:de(i,p=>{p.preventDefault()}),onDismiss:l.onDismiss,children:g.jsx(kl,{...c,...s,onPointerDown:de(s.onPointerDown,p=>{p.currentTarget.contains(p.target)&&h(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,style:{...s.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),h9="HoverCardArrow",p9=y.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Td(n);return g.jsx(Dl,{...o,...r,ref:t})});p9.displayName=h9;function kd(e){return t=>t.pointerType==="touch"?void 0:e()}function m9(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var g9=WP,w9=qP,KP=YP,Dd="Menubar",[Ag,v9,y9]=No(Dd),[XP,soe]=ct(Dd,[y9,Ar]),Yt=$l(),ZP=Ar(),[b9,Ig]=XP(Dd),JP=y.forwardRef((e,t)=>{const{__scopeMenubar:n,value:r,onValueChange:o,defaultValue:i,loop:a=!0,dir:s,...l}=e,c=Jn(s),u=ZP(n),[d="",f]=dt({prop:r,onChange:o,defaultProp:i}),[h,p]=y.useState(null);return g.jsx(b9,{scope:n,value:d,onMenuOpen:y.useCallback(m=>{f(m),p(m)},[f]),onMenuClose:y.useCallback(()=>f(""),[f]),onMenuToggle:y.useCallback(m=>{f(v=>v?"":m),p(m)},[f]),dir:c,loop:a,children:g.jsx(Ag.Provider,{scope:n,children:g.jsx(Ag.Slot,{scope:n,children:g.jsx(Al,{asChild:!0,...u,orientation:"horizontal",loop:a,dir:c,currentTabStopId:h,onCurrentTabStopIdChange:p,children:g.jsx(be.div,{role:"menubar",...l,ref:t})})})})})});JP.displayName=Dd;var Og="MenubarMenu",[x9,QP]=XP(Og),eR=e=>{const{__scopeMenubar:t,value:n,...r}=e,o=Rt(),i=n||o||"LEGACY_REACT_AUTO_VALUE",a=Ig(Og,t),s=Yt(t),l=y.useRef(null),c=y.useRef(!1),u=a.value===i;return y.useEffect(()=>{u||(c.current=!1)},[u]),g.jsx(x9,{scope:t,value:i,triggerId:Rt(),triggerRef:l,contentId:Rt(),wasKeyboardTriggerOpenRef:c,children:g.jsx(fg,{...s,open:u,onOpenChange:d=>{d||a.onMenuClose()},modal:!1,dir:a.dir,...r})})};eR.displayName=Og;var jg="MenubarTrigger",tR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,disabled:r=!1,...o}=e,i=ZP(n),a=Yt(n),s=Ig(jg,n),l=QP(jg,n),c=y.useRef(null),u=Me(t,c,l.triggerRef),[d,f]=y.useState(!1),h=s.value===l.value;return g.jsx(Ag.ItemSlot,{scope:n,value:l.value,disabled:r,children:g.jsx(Il,{asChild:!0,...i,focusable:!r,tabStopId:l.value,children:g.jsx(hg,{asChild:!0,...a,children:g.jsx(be.button,{type:"button",role:"menuitem",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?l.contentId:void 0,"data-highlighted":d?"":void 0,"data-state":h?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:u,onPointerDown:de(e.onPointerDown,p=>{!r&&p.button===0&&p.ctrlKey===!1&&(s.onMenuOpen(l.value),h||p.preventDefault())}),onPointerEnter:de(e.onPointerEnter,()=>{var m;!!s.value&&!h&&(s.onMenuOpen(l.value),(m=c.current)==null||m.focus())}),onKeyDown:de(e.onKeyDown,p=>{r||(["Enter"," "].includes(p.key)&&s.onMenuToggle(l.value),p.key==="ArrowDown"&&s.onMenuOpen(l.value),["Enter"," ","ArrowDown"].includes(p.key)&&(l.wasKeyboardTriggerOpenRef.current=!0,p.preventDefault()))}),onFocus:de(e.onFocus,()=>f(!0)),onBlur:de(e.onBlur,()=>f(!1))})})})})});tR.displayName=jg;var _9="MenubarPortal",nR=e=>{const{__scopeMenubar:t,...n}=e,r=Yt(t);return g.jsx(pg,{...r,...n})};nR.displayName=_9;var $g="MenubarContent",rR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,align:r="start",...o}=e,i=Yt(n),a=Ig($g,n),s=QP($g,n),l=v9(n),c=y.useRef(!1);return g.jsx(mg,{id:s.contentId,"aria-labelledby":s.triggerId,"data-radix-menubar-content":"",...i,...o,ref:t,align:r,onCloseAutoFocus:de(e.onCloseAutoFocus,u=>{var f;!!!a.value&&!c.current&&((f=s.triggerRef.current)==null||f.focus()),c.current=!1,u.preventDefault()}),onFocusOutside:de(e.onFocusOutside,u=>{const d=u.target;l().some(h=>{var p;return(p=h.ref.current)==null?void 0:p.contains(d)})&&u.preventDefault()}),onInteractOutside:de(e.onInteractOutside,()=>{c.current=!0}),onEntryFocus:u=>{s.wasKeyboardTriggerOpenRef.current||u.preventDefault()},onKeyDown:de(e.onKeyDown,u=>{if(["ArrowRight","ArrowLeft"].includes(u.key)){const d=u.target,f=d.hasAttribute("data-radix-menubar-subtrigger"),h=d.closest("[data-radix-menubar-content]")!==u.currentTarget,m=(a.dir==="rtl"?"ArrowRight":"ArrowLeft")===u.key;if(!m&&f||h&&m)return;let b=l().filter(C=>!C.disabled).map(C=>C.value);m&&b.reverse();const x=b.indexOf(s.value);b=a.loop?j9(b,x+1):b.slice(x+1);const[_]=b;_&&a.onMenuOpen(_)}},{checkForDefaultPrevented:!1}),style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});rR.displayName=$g;var S9="MenubarGroup",oR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(gg,{...o,...r,ref:t})});oR.displayName=S9;var C9="MenubarLabel",iR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(wg,{...o,...r,ref:t})});iR.displayName=C9;var E9="MenubarItem",aR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(vg,{...o,...r,ref:t})});aR.displayName=E9;var P9="MenubarCheckboxItem",sR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(yg,{...o,...r,ref:t})});sR.displayName=P9;var R9="MenubarRadioGroup",lR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(bg,{...o,...r,ref:t})});lR.displayName=R9;var N9="MenubarRadioItem",cR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(xg,{...o,...r,ref:t})});cR.displayName=N9;var T9="MenubarItemIndicator",uR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(_g,{...o,...r,ref:t})});uR.displayName=T9;var M9="MenubarSeparator",dR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(Sg,{...o,...r,ref:t})});dR.displayName=M9;var k9="MenubarArrow",D9=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(Cg,{...o,...r,ref:t})});D9.displayName=k9;var A9="MenubarSub",fR=e=>{const{__scopeMenubar:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,a=Yt(t),[s=!1,l]=dt({prop:r,defaultProp:i,onChange:o});return g.jsx(Eg,{...a,open:s,onOpenChange:l,children:n})};fR.displayName=A9;var I9="MenubarSubTrigger",hR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(Pg,{"data-radix-menubar-subtrigger":"",...o,...r,ref:t})});hR.displayName=I9;var O9="MenubarSubContent",pR=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Yt(n);return g.jsx(Rg,{...o,"data-radix-menubar-content":"",...r,ref:t,style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});pR.displayName=O9;function j9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var mR=JP,$9=eR,gR=tR,wR=nR,vR=rR,F9=oR,yR=iR,bR=aR,xR=sR,L9=lR,_R=cR,SR=uR,CR=dR,z9=fR,ER=hR,PR=pR,$a="NavigationMenu",[Fg,RR,B9]=No($a),[Lg,H9,V9]=No($a),[zg,loe]=ct($a,[B9,V9]),[U9,Vn]=zg($a),[W9,G9]=zg($a),NR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:o,defaultValue:i,delayDuration:a=200,skipDelayDuration:s=300,orientation:l="horizontal",dir:c,...u}=e,[d,f]=y.useState(null),h=Me(t,M=>f(M)),p=Jn(c),m=y.useRef(0),v=y.useRef(0),w=y.useRef(0),[b,x]=y.useState(!0),[_="",C]=dt({prop:r,onChange:M=>{const D=M!=="",A=s>0;D?(window.clearTimeout(w.current),A&&x(!1)):(window.clearTimeout(w.current),w.current=window.setTimeout(()=>x(!0),s)),o==null||o(M)},defaultProp:i}),N=y.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>C(""),150)},[C]),R=y.useCallback(M=>{window.clearTimeout(v.current),C(M)},[C]),T=y.useCallback(M=>{_===M?window.clearTimeout(v.current):m.current=window.setTimeout(()=>{window.clearTimeout(v.current),C(M)},a)},[_,C,a]);return y.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(v.current),window.clearTimeout(w.current)},[]),g.jsx(MR,{scope:n,isRootMenu:!0,value:_,dir:p,orientation:l,rootNavigationMenu:d,onTriggerEnter:M=>{window.clearTimeout(m.current),b?T(M):R(M)},onTriggerLeave:()=>{window.clearTimeout(m.current),N()},onContentEnter:()=>window.clearTimeout(v.current),onContentLeave:N,onItemSelect:M=>{C(D=>D===M?"":M)},onItemDismiss:()=>C(""),children:g.jsx(be.nav,{"aria-label":"Main","data-orientation":l,dir:p,...u,ref:h})})});NR.displayName=$a;var TR="NavigationMenuSub",q9=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",...s}=e,l=Vn(TR,n),[c="",u]=dt({prop:r,onChange:o,defaultProp:i});return g.jsx(MR,{scope:n,isRootMenu:!1,value:c,dir:l.dir,orientation:a,rootNavigationMenu:l.rootNavigationMenu,onTriggerEnter:d=>u(d),onItemSelect:d=>u(d),onItemDismiss:()=>u(""),children:g.jsx(be.div,{"data-orientation":a,...s,ref:t})})});q9.displayName=TR;var MR=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:o,orientation:i,children:a,value:s,onItemSelect:l,onItemDismiss:c,onTriggerEnter:u,onTriggerLeave:d,onContentEnter:f,onContentLeave:h}=e,[p,m]=y.useState(null),[v,w]=y.useState(new Map),[b,x]=y.useState(null);return g.jsx(U9,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:s,previousValue:Ma(s),baseId:Rt(),dir:o,orientation:i,viewport:p,onViewportChange:m,indicatorTrack:b,onIndicatorTrackChange:x,onTriggerEnter:ot(u),onTriggerLeave:ot(d),onContentEnter:ot(f),onContentLeave:ot(h),onItemSelect:ot(l),onItemDismiss:ot(c),onViewportContentChange:y.useCallback((_,C)=>{w(N=>(N.set(_,C),new Map(N)))},[]),onViewportContentRemove:y.useCallback(_=>{w(C=>C.has(_)?(C.delete(_),new Map(C)):C)},[]),children:g.jsx(Fg.Provider,{scope:t,children:g.jsx(W9,{scope:t,items:v,children:a})})})},kR="NavigationMenuList",DR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=Vn(kR,n),i=g.jsx(be.ul,{"data-orientation":o.orientation,...r,ref:t});return g.jsx(be.div,{style:{position:"relative"},ref:o.onIndicatorTrackChange,children:g.jsx(Fg.Slot,{scope:n,children:o.isRootMenu?g.jsx(VR,{asChild:!0,children:i}):i})})});DR.displayName=kR;var AR="NavigationMenuItem",[Y9,IR]=zg(AR),OR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...o}=e,i=Rt(),a=r||i||"LEGACY_REACT_AUTO_VALUE",s=y.useRef(null),l=y.useRef(null),c=y.useRef(null),u=y.useRef(()=>{}),d=y.useRef(!1),f=y.useCallback((p="start")=>{if(s.current){u.current();const m=Ug(s.current);m.length&&Wg(p==="start"?m:m.reverse())}},[]),h=y.useCallback(()=>{if(s.current){const p=Ug(s.current);p.length&&(u.current=tq(p))}},[]);return g.jsx(Y9,{scope:n,value:a,triggerRef:l,contentRef:s,focusProxyRef:c,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:h,onContentFocusOutside:h,children:g.jsx(be.li,{...o,ref:t})})});OR.displayName=AR;var Bg="NavigationMenuTrigger",jR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...o}=e,i=Vn(Bg,e.__scopeNavigationMenu),a=IR(Bg,e.__scopeNavigationMenu),s=y.useRef(null),l=Me(s,a.triggerRef,t),c=GR(i.baseId,a.value),u=qR(i.baseId,a.value),d=y.useRef(!1),f=y.useRef(!1),h=a.value===i.value;return g.jsxs(g.Fragment,{children:[g.jsx(Fg.ItemSlot,{scope:n,value:a.value,children:g.jsx(WR,{asChild:!0,children:g.jsx(be.button,{id:c,disabled:r,"data-disabled":r?"":void 0,"data-state":qg(h),"aria-expanded":h,"aria-controls":u,...o,ref:l,onPointerEnter:de(e.onPointerEnter,()=>{f.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:de(e.onPointerMove,Id(()=>{r||f.current||a.wasEscapeCloseRef.current||d.current||(i.onTriggerEnter(a.value),d.current=!0)})),onPointerLeave:de(e.onPointerLeave,Id(()=>{r||(i.onTriggerLeave(),d.current=!1)})),onClick:de(e.onClick,()=>{i.onItemSelect(a.value),f.current=h}),onKeyDown:de(e.onKeyDown,p=>{const v={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];h&&p.key===v&&(a.onEntryKeyDown(),p.preventDefault())})})})}),h&&g.jsxs(g.Fragment,{children:[g.jsx(JS,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:p=>{const m=a.contentRef.current,v=p.relatedTarget,w=v===s.current,b=m==null?void 0:m.contains(v);(w||!b)&&a.onFocusProxyEnter(w?"start":"end")}}),i.viewport&&g.jsx("span",{"aria-owns":u})]})]})});jR.displayName=Bg;var K9="NavigationMenuLink",$R="navigationMenu.linkSelect",FR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:o,...i}=e;return g.jsx(WR,{asChild:!0,children:g.jsx(be.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:t,onClick:de(e.onClick,a=>{const s=a.target,l=new CustomEvent($R,{bubbles:!0,cancelable:!0});if(s.addEventListener($R,c=>o==null?void 0:o(c),{once:!0}),ed(s,l),!l.defaultPrevented&&!a.metaKey){const c=new CustomEvent(Ad,{bubbles:!0,cancelable:!0});ed(s,c)}},{checkForDefaultPrevented:!1})})})});FR.displayName=K9;var Hg="NavigationMenuIndicator",LR=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Vn(Hg,e.__scopeNavigationMenu),i=!!o.value;return o.indicatorTrack?ur.createPortal(g.jsx(gt,{present:n||i,children:g.jsx(X9,{...r,ref:t})}),o.indicatorTrack):null});LR.displayName=Hg;var X9=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=Vn(Hg,n),i=RR(n),[a,s]=y.useState(null),[l,c]=y.useState(null),u=o.orientation==="horizontal",d=!!o.value;y.useEffect(()=>{var m;const p=(m=i().find(v=>v.value===o.value))==null?void 0:m.ref.current;p&&s(p)},[i,o.value]);const f=()=>{a&&c({size:u?a.offsetWidth:a.offsetHeight,offset:u?a.offsetLeft:a.offsetTop})};return Gg(a,f),Gg(o.indicatorTrack,f),l?g.jsx(be.div,{"aria-hidden":!0,"data-state":d?"visible":"hidden","data-orientation":o.orientation,...r,ref:t,style:{position:"absolute",...u?{left:0,width:l.size+"px",transform:`translateX(${l.offset}px)`}:{top:0,height:l.size+"px",transform:`translateY(${l.offset}px)`},...r.style}}):null}),Fa="NavigationMenuContent",zR=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Vn(Fa,e.__scopeNavigationMenu),i=IR(Fa,e.__scopeNavigationMenu),a=Me(i.contentRef,t),s=i.value===o.value,l={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...r};return o.viewport?g.jsx(Z9,{forceMount:n,...l,ref:a}):g.jsx(gt,{present:n||s,children:g.jsx(BR,{"data-state":qg(s),...l,ref:a,onPointerEnter:de(e.onPointerEnter,o.onContentEnter),onPointerLeave:de(e.onPointerLeave,Id(o.onContentLeave)),style:{pointerEvents:!s&&o.isRootMenu?"none":void 0,...l.style}})})});zR.displayName=Fa;var Z9=y.forwardRef((e,t)=>{const n=Vn(Fa,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:o}=n;return xt(()=>{r(e.value,{ref:t,...e})},[e,t,r]),xt(()=>()=>o(e.value),[e.value,o]),null}),Ad="navigationMenu.rootContentDismiss",BR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:o,focusProxyRef:i,wasEscapeCloseRef:a,onRootContentClose:s,onContentFocusOutside:l,...c}=e,u=Vn(Fa,n),d=y.useRef(null),f=Me(d,t),h=GR(u.baseId,r),p=qR(u.baseId,r),m=RR(n),v=y.useRef(null),{onItemDismiss:w}=u;y.useEffect(()=>{const x=d.current;if(u.isRootMenu&&x){const _=()=>{var C;w(),s(),x.contains(document.activeElement)&&((C=o.current)==null||C.focus())};return x.addEventListener(Ad,_),()=>x.removeEventListener(Ad,_)}},[u.isRootMenu,e.value,o,w,s]);const b=y.useMemo(()=>{const _=m().map(D=>D.value);u.dir==="rtl"&&_.reverse();const C=_.indexOf(u.value),N=_.indexOf(u.previousValue),R=r===u.value,T=N===_.indexOf(r);if(!R&&!T)return v.current;const M=(()=>{if(C!==N){if(R&&N!==-1)return C>N?"from-end":"from-start";if(T&&C!==-1)return C>N?"to-start":"to-end"}return null})();return v.current=M,M},[u.previousValue,u.value,u.dir,m,r]);return g.jsx(VR,{asChild:!0,children:g.jsx(To,{id:p,"aria-labelledby":h,"data-motion":b,"data-orientation":u.orientation,...c,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var _;const x=new Event(Ad,{bubbles:!0,cancelable:!0});(_=d.current)==null||_.dispatchEvent(x)},onFocusOutside:de(e.onFocusOutside,x=>{var C;l();const _=x.target;(C=u.rootNavigationMenu)!=null&&C.contains(_)&&x.preventDefault()}),onPointerDownOutside:de(e.onPointerDownOutside,x=>{var R;const _=x.target,C=m().some(T=>{var M;return(M=T.ref.current)==null?void 0:M.contains(_)}),N=u.isRootMenu&&((R=u.viewport)==null?void 0:R.contains(_));(C||N||!u.isRootMenu)&&x.preventDefault()}),onKeyDown:de(e.onKeyDown,x=>{var N;const _=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!_){const R=Ug(x.currentTarget),T=document.activeElement,M=R.findIndex(O=>O===T),A=x.shiftKey?R.slice(0,M).reverse():R.slice(M+1,R.length);Wg(A)?x.preventDefault():(N=i.current)==null||N.focus()}}),onEscapeKeyDown:de(e.onEscapeKeyDown,x=>{a.current=!0})})})}),Vg="NavigationMenuViewport",HR=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=!!Vn(Vg,e.__scopeNavigationMenu).value;return g.jsx(gt,{present:n||i,children:g.jsx(J9,{...r,ref:t})})});HR.displayName=Vg;var J9=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...o}=e,i=Vn(Vg,n),a=Me(t,i.onViewportChange),s=G9(Fa,e.__scopeNavigationMenu),[l,c]=y.useState(null),[u,d]=y.useState(null),f=l?(l==null?void 0:l.width)+"px":void 0,h=l?(l==null?void 0:l.height)+"px":void 0,p=!!i.value,m=p?i.value:i.previousValue;return Gg(u,()=>{u&&c({width:u.offsetWidth,height:u.offsetHeight})}),g.jsx(be.div,{"data-state":qg(p),"data-orientation":i.orientation,...o,ref:a,style:{pointerEvents:!p&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":h,...o.style},onPointerEnter:de(e.onPointerEnter,i.onContentEnter),onPointerLeave:de(e.onPointerLeave,Id(i.onContentLeave)),children:Array.from(s.items).map(([w,{ref:b,forceMount:x,..._}])=>{const C=m===w;return g.jsx(gt,{present:x||C,children:g.jsx(BR,{..._,ref:bl(b,N=>{C&&N&&d(N)})})},w)})})}),Q9="FocusGroup",VR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=Vn(Q9,n);return g.jsx(Lg.Provider,{scope:n,children:g.jsx(Lg.Slot,{scope:n,children:g.jsx(be.div,{dir:o.dir,...r,ref:t})})})}),UR=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],eq="FocusGroupItem",WR=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=H9(n),i=Vn(eq,n);return g.jsx(Lg.ItemSlot,{scope:n,children:g.jsx(be.button,{...r,ref:t,onKeyDown:de(e.onKeyDown,a=>{if(["Home","End",...UR].includes(a.key)){let l=o().map(d=>d.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&l.reverse(),UR.includes(a.key)){const d=l.indexOf(a.currentTarget);l=l.slice(d+1)}setTimeout(()=>Wg(l)),a.preventDefault()}})})})});function Ug(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 Wg(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function tq(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function Gg(e,t){const n=ot(t);xt(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}function qg(e){return e?"open":"closed"}function GR(e,t){return`${e}-trigger-${t}`}function qR(e,t){return`${e}-content-${t}`}function Id(e){return t=>t.pointerType==="mouse"?e(t):void 0}var YR=NR,KR=DR,nq=OR,XR=jR,rq=FR,ZR=LR,JR=zR,QR=HR,Yg="Popover",[eN,coe]=ct(Yg,[Dr]),Hl=Dr(),[oq,jo]=eN(Yg),tN=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,s=Hl(t),l=y.useRef(null),[c,u]=y.useState(!1),[d=!1,f]=dt({prop:r,defaultProp:o,onChange:i});return g.jsx(Oa,{...s,children:g.jsx(oq,{scope:t,contentId:Rt(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:c,onCustomAnchorAdd:y.useCallback(()=>u(!0),[]),onCustomAnchorRemove:y.useCallback(()=>u(!1),[]),modal:a,children:n})})};tN.displayName=Yg;var nN="PopoverAnchor",iq=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=jo(nN,n),i=Hl(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=o;return y.useEffect(()=>(a(),()=>s()),[a,s]),g.jsx(ja,{...i,...r,ref:t})});iq.displayName=nN;var rN="PopoverTrigger",oN=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=jo(rN,n),i=Hl(n),a=Me(t,o.triggerRef),s=g.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":cN(o.open),...r,ref:a,onClick:de(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:g.jsx(ja,{asChild:!0,...i,children:s})});oN.displayName=rN;var Kg="PopoverPortal",[aq,sq]=eN(Kg,{forceMount:void 0}),iN=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=jo(Kg,t);return g.jsx(aq,{scope:t,forceMount:n,children:g.jsx(gt,{present:n||i.open,children:g.jsx(_l,{asChild:!0,container:o,children:r})})})};iN.displayName=Kg;var La="PopoverContent",aN=y.forwardRef((e,t)=>{const n=sq(La,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=jo(La,e.__scopePopover);return g.jsx(gt,{present:r||i.open,children:i.modal?g.jsx(lq,{...o,ref:t}):g.jsx(cq,{...o,ref:t})})});aN.displayName=La;var lq=y.forwardRef((e,t)=>{const n=jo(La,e.__scopePopover),r=y.useRef(null),o=Me(t,r),i=y.useRef(!1);return y.useEffect(()=>{const a=r.current;if(a)return Pl(a)},[]),g.jsx(El,{as:Zn,allowPinchZoom:!0,children:g.jsx(sN,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:de(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),i.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:de(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:de(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),cq=y.forwardRef((e,t)=>{const n=jo(La,e.__scopePopover),r=y.useRef(!1),o=y.useRef(!1);return g.jsx(sN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,s;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),sN=y.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=jo(La,n),h=Hl(n);return id(),g.jsx(xl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:g.jsx(To,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:g.jsx(kl,{"data-state":cN(f.open),role:"dialog",id:f.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),lN="PopoverClose",uq=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=jo(lN,n);return g.jsx(be.button,{type:"button",...r,ref:t,onClick:de(e.onClick,()=>o.onOpenChange(!1))})});uq.displayName=lN;var dq="PopoverArrow",fq=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Hl(n);return g.jsx(Dl,{...o,...r,ref:t})});fq.displayName=dq;function cN(e){return e?"open":"closed"}var hq=tN,pq=oN,mq=iN,uN=aN,Xg="Progress",Zg=100,[gq,uoe]=ct(Xg),[wq,vq]=gq(Xg),dN=y.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:i=yq,...a}=e;(o||o===0)&&!mN(o)&&console.error(bq(`${o}`,"Progress"));const s=mN(o)?o:Zg;r!==null&&!gN(r,s)&&console.error(xq(`${r}`,"Progress"));const l=gN(r,s)?r:null,c=Od(l)?i(l,s):void 0;return g.jsx(wq,{scope:n,value:l,max:s,children:g.jsx(be.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Od(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":pN(l,s),"data-value":l??void 0,"data-max":s,...a,ref:t})})});dN.displayName=Xg;var fN="ProgressIndicator",hN=y.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=vq(fN,n);return g.jsx(be.div,{"data-state":pN(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});hN.displayName=fN;function yq(e,t){return`${Math.round(e/t*100)}%`}function pN(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Od(e){return typeof e=="number"}function mN(e){return Od(e)&&!isNaN(e)&&e>0}function gN(e,t){return Od(e)&&!isNaN(e)&&e<=t&&e>=0}function bq(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Zg}\`.`}function xq(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
312
312
|
- a positive number
|
|
313
313
|
- less than the value passed to \`max\` (or ${Zg} if no \`max\` prop is set)
|
|
314
314
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
315
315
|
|
|
316
|
-
Defaulting to \`null\`.`}var wN=dN,_q=hN,Jg="Radio",[Sq,vN]=ct(Jg),[Cq,Eq]=Sq(Jg),yN=y.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:a,value:s="on",onCheck:l,form:c,...u}=e,[d,f]=y.useState(null),h=Me(t,v=>f(v)),p=y.useRef(!1),m=d?c||!!d.closest("form"):!0;return g.jsxs(Cq,{scope:n,checked:o,disabled:a,children:[g.jsx(be.button,{type:"button",role:"radio","aria-checked":o,"data-state":_N(o),"data-disabled":a?"":void 0,disabled:a,value:s,...u,ref:h,onClick:de(e.onClick,v=>{o||l==null||l(),m&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})}),m&&g.jsx(Pq,{control:d,bubbles:!p.current,name:r,value:s,checked:o,required:i,disabled:a,form:c,style:{transform:"translateX(-100%)"}})]})});yN.displayName=Jg;var bN="RadioIndicator",xN=y.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=Eq(bN,n);return g.jsx(gt,{present:r||i.checked,children:g.jsx(be.span,{"data-state":_N(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});xN.displayName=bN;var Pq=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=y.useRef(null),a=Ma(n),s=Rl(t);return y.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[a,n,r]),g.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function _N(e){return e?"checked":"unchecked"}var Rq=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Qg="RadioGroup",[Nq,doe]=ct(Qg,[Ar,vN]),SN=Ar(),CN=vN(),[Tq,Mq]=Nq(Qg),EN=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:a=!1,disabled:s=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...f}=e,h=SN(n),p=Jn(c),[m,v]=dt({prop:i,defaultProp:o,onChange:d});return g.jsx(Tq,{scope:n,name:r,required:a,disabled:s,value:m,onValueChange:v,children:g.jsx(Al,{asChild:!0,...h,orientation:l,dir:p,loop:u,children:g.jsx(be.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":s?"":void 0,dir:p,...f,ref:t})})})});EN.displayName=Qg;var PN="RadioGroupItem",RN=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=Mq(PN,n),a=i.disabled||r,s=SN(n),l=CN(n),c=y.useRef(null),u=Me(t,c),d=i.value===o.value,f=y.useRef(!1);return y.useEffect(()=>{const h=m=>{Rq.includes(m.key)&&(f.current=!0)},p=()=>f.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",p)}},[]),g.jsx(Il,{asChild:!0,...s,focusable:!a,active:d,children:g.jsx(yN,{disabled:a,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:de(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:de(o.onFocus,()=>{var h;f.current&&((h=c.current)==null||h.click())})})})});RN.displayName=PN;var kq="RadioGroupIndicator",NN=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=CN(n);return g.jsx(xN,{...o,...r,ref:t})});NN.displayName=kq;var TN=EN,MN=RN,Dq=NN;function Vl(e,[t,n]){return Math.min(n,Math.max(t,e))}function Aq(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var ew="ScrollArea",[kN,foe]=ct(ew),[Iq,Un]=kN(ew),DN=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...a}=e,[s,l]=y.useState(null),[c,u]=y.useState(null),[d,f]=y.useState(null),[h,p]=y.useState(null),[m,v]=y.useState(null),[w,b]=y.useState(0),[x,_]=y.useState(0),[C,N]=y.useState(!1),[R,T]=y.useState(!1),M=Me(t,A=>l(A)),D=Jn(o);return g.jsx(Iq,{scope:n,type:r,dir:D,scrollHideDelay:i,scrollArea:s,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:p,scrollbarXEnabled:C,onScrollbarXEnabledChange:N,scrollbarY:m,onScrollbarYChange:v,scrollbarYEnabled:R,onScrollbarYEnabledChange:T,onCornerWidthChange:b,onCornerHeightChange:_,children:g.jsx(be.div,{dir:D,...a,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});DN.displayName=ew;var AN="ScrollAreaViewport",IN=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,a=Un(AN,n),s=y.useRef(null),l=Me(t,s,a.onViewportChange);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),g.jsx(be.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:g.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});IN.displayName=AN;var Ir="ScrollAreaScrollbar",tw=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Un(Ir,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,s=e.orientation==="horizontal";return y.useEffect(()=>(s?i(!0):a(!0),()=>{s?i(!1):a(!1)}),[s,i,a]),o.type==="hover"?g.jsx(Oq,{...r,ref:t,forceMount:n}):o.type==="scroll"?g.jsx(jq,{...r,ref:t,forceMount:n}):o.type==="auto"?g.jsx(ON,{...r,ref:t,forceMount:n}):o.type==="always"?g.jsx(nw,{...r,ref:t}):null});tw.displayName=Ir;var Oq=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Un(Ir,e.__scopeScrollArea),[i,a]=y.useState(!1);return y.useEffect(()=>{const s=o.scrollArea;let l=0;if(s){const c=()=>{window.clearTimeout(l),a(!0)},u=()=>{l=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return s.addEventListener("pointerenter",c),s.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),s.removeEventListener("pointerenter",c),s.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),g.jsx(gt,{present:n||i,children:g.jsx(ON,{"data-state":i?"visible":"hidden",...r,ref:t})})}),jq=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Un(Ir,e.__scopeScrollArea),i=e.orientation==="horizontal",a=Ld(()=>l("SCROLL_END"),100),[s,l]=Aq("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(s==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[s,o.scrollHideDelay,l]),y.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const f=()=>{const h=c[u];d!==h&&(l("SCROLL"),a()),d=h};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,i,l,a]),g.jsx(gt,{present:n||s!=="hidden",children:g.jsx(nw,{"data-state":s==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:de(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:de(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),ON=y.forwardRef((e,t)=>{const n=Un(Ir,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,a]=y.useState(!1),s=e.orientation==="horizontal",l=Ld(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;a(s?c:u)}},10);return za(n.viewport,l),za(n.content,l),g.jsx(gt,{present:r||i,children:g.jsx(nw,{"data-state":i?"visible":"hidden",...o,ref:t})})}),nw=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=Un(Ir,e.__scopeScrollArea),i=y.useRef(null),a=y.useRef(0),[s,l]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=zN(s.viewport,s.content),u={...r,sizes:s,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:f=>a.current=f};function d(f,h){return Hq(f,a.current,s,h)}return n==="horizontal"?g.jsx($q,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,h=BN(f,s,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):n==="vertical"?g.jsx(Fq,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,h=BN(f,s);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),$q=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Un(Ir,e.__scopeScrollArea),[a,s]=y.useState(),l=y.useRef(null),c=Me(t,l,i.onScrollbarXChange);return y.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),g.jsx($N,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Fd(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),VN(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:$d(a.paddingLeft),paddingEnd:$d(a.paddingRight)}})}})}),Fq=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Un(Ir,e.__scopeScrollArea),[a,s]=y.useState(),l=y.useRef(null),c=Me(t,l,i.onScrollbarYChange);return y.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),g.jsx($N,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Fd(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),VN(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:$d(a.paddingTop),paddingEnd:$d(a.paddingBottom)}})}})}),[Lq,jN]=kN(Ir),$N=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,h=Un(Ir,n),[p,m]=y.useState(null),v=Me(t,M=>m(M)),w=y.useRef(null),b=y.useRef(""),x=h.viewport,_=r.content-r.viewport,C=ot(u),N=ot(l),R=Ld(d,10);function T(M){if(w.current){const D=M.clientX-w.current.left,A=M.clientY-w.current.top;c({x:D,y:A})}}return y.useEffect(()=>{const M=D=>{const A=D.target;(p==null?void 0:p.contains(A))&&C(D,_)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[x,p,_,C]),y.useEffect(N,[r,N]),za(p,R),za(h.content,R),g.jsx(Lq,{scope:n,scrollbar:p,hasThumb:o,onThumbChange:ot(i),onThumbPointerUp:ot(a),onThumbPositionChange:N,onThumbPointerDown:ot(s),children:g.jsx(be.div,{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:de(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),w.current=p.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),T(M))}),onPointerMove:de(e.onPointerMove,T),onPointerUp:de(e.onPointerUp,M=>{const D=M.target;D.hasPointerCapture(M.pointerId)&&D.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=""),w.current=null})})})}),jd="ScrollAreaThumb",FN=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=jN(jd,e.__scopeScrollArea);return g.jsx(gt,{present:n||o.hasThumb,children:g.jsx(zq,{ref:t,...r})})}),zq=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=Un(jd,n),a=jN(jd,n),{onThumbPositionChange:s}=a,l=Me(t,d=>a.onThumbChange(d)),c=y.useRef(void 0),u=Ld(()=>{c.current&&(c.current(),c.current=void 0)},100);return y.useEffect(()=>{const d=i.viewport;if(d){const f=()=>{if(u(),!c.current){const h=Vq(d,s);c.current=h,s()}};return s(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[i.viewport,u,s]),g.jsx(be.div,{"data-state":a.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:de(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),p=d.clientX-h.left,m=d.clientY-h.top;a.onThumbPointerDown({x:p,y:m})}),onPointerUp:de(e.onPointerUp,a.onThumbPointerUp)})});FN.displayName=jd;var rw="ScrollAreaCorner",LN=y.forwardRef((e,t)=>{const n=Un(rw,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?g.jsx(Bq,{...e,ref:t}):null});LN.displayName=rw;var Bq=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=Un(rw,n),[i,a]=y.useState(0),[s,l]=y.useState(0),c=!!(i&&s);return za(o.scrollbarX,()=>{var d;const u=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(u),l(u)}),za(o.scrollbarY,()=>{var d;const u=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(u),a(u)}),c?g.jsx(be.div,{...r,ref:t,style:{width:i,height:s,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function $d(e){return e?parseInt(e,10):0}function zN(e,t){const n=e/t;return isNaN(n)?0:n}function Fd(e){const t=zN(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Hq(e,t,n,r="ltr"){const o=Fd(n),i=o/2,a=t||i,s=o-a,l=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return HN([l,c],d)(e)}function BN(e,t,n="ltr"){const r=Fd(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,s=i-r,l=n==="ltr"?[0,a]:[a*-1,0],c=Vl(e,l);return HN([0,a],[0,s])(c)}function HN(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function VN(e,t){return e>0&&e<t}var Vq=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,s=n.top!==i.top;(a||s)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Ld(e,t){const n=ot(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function za(e,t){const n=ot(t);xt(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var UN=DN,Uq=IN,Wq=LN,Gq=[" ","Enter","ArrowUp","ArrowDown"],qq=[" ","Enter"],Ul="Select",[zd,Bd,Yq]=No(Ul),[Ba,hoe]=ct(Ul,[Yq,Dr]),Hd=Dr(),[Kq,$o]=Ba(Ul),[Xq,Zq]=Ba(Ul),WN=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:h,form:p}=e,m=Hd(t),[v,w]=y.useState(null),[b,x]=y.useState(null),[_,C]=y.useState(!1),N=Jn(c),[R=!1,T]=dt({prop:r,defaultProp:o,onChange:i}),[M,D]=dt({prop:a,defaultProp:s,onChange:l}),A=y.useRef(null),j=v?p||!!v.closest("form"):!0,[$,W]=y.useState(new Set),re=Array.from($).map(Y=>Y.props.value).join(";");return g.jsx(Oa,{...m,children:g.jsxs(Kq,{required:h,scope:t,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:Rt(),value:M,onValueChange:D,open:R,onOpenChange:T,dir:N,triggerPointerDownPosRef:A,disabled:f,children:[g.jsx(zd.Provider,{scope:t,children:g.jsx(Xq,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(Y=>{W(Z=>new Set(Z).add(Y))},[]),onNativeOptionRemove:y.useCallback(Y=>{W(Z=>{const B=new Set(Z);return B.delete(Y),B})},[]),children:n})}),j?g.jsxs(wT,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:M,onChange:Y=>D(Y.target.value),disabled:f,form:p,children:[M===void 0?g.jsx("option",{value:""}):null,Array.from($)]},re):null]})})};WN.displayName=Ul;var GN="SelectTrigger",qN=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Hd(n),a=$o(GN,n),s=a.disabled||r,l=Me(t,a.onTriggerChange),c=Bd(n),u=y.useRef("touch"),[d,f,h]=vT(m=>{const v=c().filter(x=>!x.disabled),w=v.find(x=>x.value===a.value),b=yT(v,m,w);b!==void 0&&a.onValueChange(b.value)}),p=m=>{s||(a.onOpenChange(!0),h()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return g.jsx(ja,{asChild:!0,...i,children:g.jsx(be.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":gT(a.value)?"":void 0,...o,ref:l,onClick:de(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&p(m)}),onPointerDown:de(o.onPointerDown,m=>{u.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(p(m),m.preventDefault())}),onKeyDown:de(o.onKeyDown,m=>{const v=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(v&&m.key===" ")&&Gq.includes(m.key)&&(p(),m.preventDefault())})})})});qN.displayName=GN;var YN="SelectValue",KN=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,l=$o(YN,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=Me(t,l.onValueNodeChange);return xt(()=>{c(u)},[c,u]),g.jsx(be.span,{...s,ref:d,style:{pointerEvents:"none"},children:gT(l.value)?g.jsx(g.Fragment,{children:a}):i})});KN.displayName=YN;var Jq="SelectIcon",XN=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return g.jsx(be.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});XN.displayName=Jq;var Qq="SelectPortal",ZN=e=>g.jsx(_l,{asChild:!0,...e});ZN.displayName=Qq;var wi="SelectContent",JN=y.forwardRef((e,t)=>{const n=$o(wi,e.__scopeSelect),[r,o]=y.useState();if(xt(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?xc.createPortal(g.jsx(QN,{scope:e.__scopeSelect,children:g.jsx(zd.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),i):null}return g.jsx(eT,{...e,ref:t})});JN.displayName=wi;var nr=10,[QN,Fo]=Ba(wi),eY="SelectContentImpl",eT=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:v,...w}=e,b=$o(wi,n),[x,_]=y.useState(null),[C,N]=y.useState(null),R=Me(t,K=>_(K)),[T,M]=y.useState(null),[D,A]=y.useState(null),j=Bd(n),[$,W]=y.useState(!1),re=y.useRef(!1);y.useEffect(()=>{if(x)return Pl(x)},[x]),id();const Y=y.useCallback(K=>{const[z,...ie]=j().map(H=>H.ref.current),[le]=ie.slice(-1),ae=document.activeElement;for(const H of K)if(H===ae||(H==null||H.scrollIntoView({block:"nearest"}),H===z&&C&&(C.scrollTop=0),H===le&&C&&(C.scrollTop=C.scrollHeight),H==null||H.focus(),document.activeElement!==ae))return},[j,C]),Z=y.useCallback(()=>Y([T,x]),[Y,T,x]);y.useEffect(()=>{$&&Z()},[$,Z]);const{onOpenChange:B,triggerPointerDownPosRef:oe}=b;y.useEffect(()=>{if(x){let K={x:0,y:0};const z=le=>{var ae,H;K={x:Math.abs(Math.round(le.pageX)-(((ae=oe.current)==null?void 0:ae.x)??0)),y:Math.abs(Math.round(le.pageY)-(((H=oe.current)==null?void 0:H.y)??0))}},ie=le=>{K.x<=10&&K.y<=10?le.preventDefault():x.contains(le.target)||B(!1),document.removeEventListener("pointermove",z),oe.current=null};return oe.current!==null&&(document.addEventListener("pointermove",z),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",z),document.removeEventListener("pointerup",ie,{capture:!0})}}},[x,B,oe]),y.useEffect(()=>{const K=()=>B(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[B]);const[ee,ne]=vT(K=>{const z=j().filter(ae=>!ae.disabled),ie=z.find(ae=>ae.ref.current===document.activeElement),le=yT(z,K,ie);le&&setTimeout(()=>le.ref.current.focus())}),G=y.useCallback((K,z,ie)=>{const le=!re.current&&!ie;(b.value!==void 0&&b.value===z||le)&&(M(K),le&&(re.current=!0))},[b.value]),F=y.useCallback(()=>x==null?void 0:x.focus(),[x]),q=y.useCallback((K,z,ie)=>{const le=!re.current&&!ie;(b.value!==void 0&&b.value===z||le)&&A(K)},[b.value]),ce=r==="popper"?ow:tT,L=ce===ow?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:v}:{};return g.jsx(QN,{scope:n,content:x,viewport:C,onViewportChange:N,itemRefCallback:G,selectedItem:T,onItemLeave:F,itemTextRefCallback:q,focusSelectedItem:Z,selectedItemText:D,position:r,isPositioned:$,searchRef:ee,children:g.jsx(El,{as:Zn,allowPinchZoom:!0,children:g.jsx(xl,{asChild:!0,trapped:b.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:de(o,K=>{var z;(z=b.trigger)==null||z.focus({preventScroll:!0}),K.preventDefault()}),children:g.jsx(To,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:g.jsx(ce,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:K=>K.preventDefault(),...w,...L,onPlaced:()=>W(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:de(w.onKeyDown,K=>{const z=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!z&&K.key.length===1&&ne(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let le=j().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(K.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const ae=K.target,H=le.indexOf(ae);le=le.slice(H+1)}setTimeout(()=>Y(le)),K.preventDefault()}})})})})})})});eT.displayName=eY;var tY="SelectItemAlignedPosition",tT=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=$o(wi,n),a=Fo(wi,n),[s,l]=y.useState(null),[c,u]=y.useState(null),d=Me(t,R=>u(R)),f=Bd(n),h=y.useRef(!1),p=y.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:w,focusSelectedItem:b}=a,x=y.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&c&&m&&v&&w){const R=i.trigger.getBoundingClientRect(),T=c.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),D=w.getBoundingClientRect();if(i.dir!=="rtl"){const ae=D.left-T.left,H=M.left-ae,ue=R.left-H,se=R.width+ue,ye=Math.max(se,T.width),Ce=window.innerWidth-nr,xe=Vl(H,[nr,Math.max(nr,Ce-ye)]);s.style.minWidth=se+"px",s.style.left=xe+"px"}else{const ae=T.right-D.right,H=window.innerWidth-M.right-ae,ue=window.innerWidth-R.right-H,se=R.width+ue,ye=Math.max(se,T.width),Ce=window.innerWidth-nr,xe=Vl(H,[nr,Math.max(nr,Ce-ye)]);s.style.minWidth=se+"px",s.style.right=xe+"px"}const A=f(),j=window.innerHeight-nr*2,$=m.scrollHeight,W=window.getComputedStyle(c),re=parseInt(W.borderTopWidth,10),Y=parseInt(W.paddingTop,10),Z=parseInt(W.borderBottomWidth,10),B=parseInt(W.paddingBottom,10),oe=re+Y+$+B+Z,ee=Math.min(v.offsetHeight*5,oe),ne=window.getComputedStyle(m),G=parseInt(ne.paddingTop,10),F=parseInt(ne.paddingBottom,10),q=R.top+R.height/2-nr,ce=j-q,L=v.offsetHeight/2,K=v.offsetTop+L,z=re+Y+K,ie=oe-z;if(z<=q){const ae=A.length>0&&v===A[A.length-1].ref.current;s.style.bottom="0px";const H=c.clientHeight-m.offsetTop-m.offsetHeight,ue=Math.max(ce,L+(ae?F:0)+H+Z),se=z+ue;s.style.height=se+"px"}else{const ae=A.length>0&&v===A[0].ref.current;s.style.top="0px";const ue=Math.max(q,re+m.offsetTop+(ae?G:0)+L)+ie;s.style.height=ue+"px",m.scrollTop=z-q+m.offsetTop}s.style.margin=`${nr}px 0`,s.style.minHeight=ee+"px",s.style.maxHeight=j+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,s,c,m,v,w,i.dir,r]);xt(()=>x(),[x]);const[_,C]=y.useState();xt(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const N=y.useCallback(R=>{R&&p.current===!0&&(x(),b==null||b(),p.current=!1)},[x,b]);return g.jsx(rY,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:g.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:g.jsx(be.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});tT.displayName=tY;var nY="SelectPopperPosition",ow=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=nr,...i}=e,a=Hd(n);return g.jsx(kl,{...a,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ow.displayName=nY;var[rY,iw]=Ba(wi,{}),aw="SelectViewport",nT=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Fo(aw,n),a=iw(aw,n),s=Me(t,i.onViewportChange),l=y.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),g.jsx(zd.Slot,{scope:n,children:g.jsx(be.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:de(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&d){const h=Math.abs(l.current-u.scrollTop);if(h>0){const p=window.innerHeight-nr*2,m=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),w=Math.max(m,v);if(w<p){const b=w+h,x=Math.min(p,b),_=b-x;d.style.height=x+"px",d.style.bottom==="0px"&&(u.scrollTop=_>0?_:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});nT.displayName=aw;var rT="SelectGroup",[oY,iY]=Ba(rT),oT=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Rt();return g.jsx(oY,{scope:n,id:o,children:g.jsx(be.div,{role:"group","aria-labelledby":o,...r,ref:t})})});oT.displayName=rT;var iT="SelectLabel",aT=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=iY(iT,n);return g.jsx(be.div,{id:o.id,...r,ref:t})});aT.displayName=iT;var Vd="SelectItem",[aY,sT]=Ba(Vd),lT=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,s=$o(Vd,n),l=Fo(Vd,n),c=s.value===r,[u,d]=y.useState(i??""),[f,h]=y.useState(!1),p=Me(t,b=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,b,r,o)}),m=Rt(),v=y.useRef("touch"),w=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(aY,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:y.useCallback(b=>{d(x=>x||((b==null?void 0:b.textContent)??"").trim())},[]),children:g.jsx(zd.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:g.jsx(be.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:p,onFocus:de(a.onFocus,()=>h(!0)),onBlur:de(a.onBlur,()=>h(!1)),onClick:de(a.onClick,()=>{v.current!=="mouse"&&w()}),onPointerUp:de(a.onPointerUp,()=>{v.current==="mouse"&&w()}),onPointerDown:de(a.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:de(a.onPointerMove,b=>{var x;v.current=b.pointerType,o?(x=l.onItemLeave)==null||x.call(l):v.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:de(a.onPointerLeave,b=>{var x;b.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:de(a.onKeyDown,b=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&b.key===" "||(qq.includes(b.key)&&w(),b.key===" "&&b.preventDefault())})})})})});lT.displayName=Vd;var Wl="SelectItemText",cT=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=$o(Wl,n),s=Fo(Wl,n),l=sT(Wl,n),c=Zq(Wl,n),[u,d]=y.useState(null),f=Me(t,w=>d(w),l.onItemTextChange,w=>{var b;return(b=s.itemTextRefCallback)==null?void 0:b.call(s,w,l.value,l.disabled)}),h=u==null?void 0:u.textContent,p=y.useMemo(()=>g.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=c;return xt(()=>(m(p),()=>v(p)),[m,v,p]),g.jsxs(g.Fragment,{children:[g.jsx(be.span,{id:l.textId,...i,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?xc.createPortal(i.children,a.valueNode):null]})});cT.displayName=Wl;var uT="SelectItemIndicator",dT=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return sT(uT,n).isSelected?g.jsx(be.span,{"aria-hidden":!0,...r,ref:t}):null});dT.displayName=uT;var sw="SelectScrollUpButton",fT=y.forwardRef((e,t)=>{const n=Fo(sw,e.__scopeSelect),r=iw(sw,e.__scopeSelect),[o,i]=y.useState(!1),a=Me(t,r.onScrollButtonChange);return xt(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?g.jsx(pT,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});fT.displayName=sw;var lw="SelectScrollDownButton",hT=y.forwardRef((e,t)=>{const n=Fo(lw,e.__scopeSelect),r=iw(lw,e.__scopeSelect),[o,i]=y.useState(!1),a=Me(t,r.onScrollButtonChange);return xt(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?g.jsx(pT,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});hT.displayName=lw;var pT=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Fo("SelectScrollButton",n),a=y.useRef(null),s=Bd(n),l=y.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return y.useEffect(()=>()=>l(),[l]),xt(()=>{var u;const c=s().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[s]),g.jsx(be.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:de(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:de(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:de(o.onPointerLeave,()=>{l()})})}),sY="SelectSeparator",mT=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(be.div,{"aria-hidden":!0,...r,ref:t})});mT.displayName=sY;var cw="SelectArrow",lY=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Hd(n),i=$o(cw,n),a=Fo(cw,n);return i.open&&a.position==="popper"?g.jsx(Dl,{...o,...r,ref:t}):null});lY.displayName=cw;function gT(e){return e===""||e===void 0}var wT=y.forwardRef((e,t)=>{const{value:n,...r}=e,o=y.useRef(null),i=Me(t,o),a=Ma(n);return y.useEffect(()=>{const s=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==n&&u){const d=new Event("change",{bubbles:!0});u.call(s,n),s.dispatchEvent(d)}},[a,n]),g.jsx(hm,{asChild:!0,children:g.jsx("select",{...r,ref:i,defaultValue:n})})});wT.displayName="BubbleSelect";function vT(e){const t=ot(e),n=y.useRef(""),r=y.useRef(0),o=y.useCallback(a=>{const s=n.current+a;t(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),i=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function yT(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=cY(e,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function cY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var uY=WN,bT=qN,dY=KN,fY=XN,hY=ZN,xT=JN,pY=nT,mY=oT,_T=aT,ST=lT,gY=cT,wY=dT,CT=fT,ET=hT,PT=mT,vY="Separator",RT="horizontal",yY=["horizontal","vertical"],NT=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=RT,...o}=e,i=bY(r)?r:RT,s=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return g.jsx(be.div,{"data-orientation":i,...s,...o,ref:t})});NT.displayName=vY;function bY(e){return yY.includes(e)}var TT=NT,MT=["PageUp","PageDown"],kT=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],DT={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ha="Slider",[uw,xY,_Y]=No(Ha),[AT,poe]=ct(Ha,[_Y]),[SY,Ud]=AT(Ha),IT=y.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:a="horizontal",disabled:s=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:h=!1,form:p,...m}=e,v=y.useRef(new Set),w=y.useRef(0),x=a==="horizontal"?CY:EY,[_=[],C]=dt({prop:u,defaultProp:c,onChange:A=>{var $;($=[...v.current][w.current])==null||$.focus(),d(A)}}),N=y.useRef(_);function R(A){const j=MY(_,A);D(A,j)}function T(A){D(A,w.current)}function M(){const A=N.current[w.current];_[w.current]!==A&&f(_)}function D(A,j,{commit:$}={commit:!1}){const W=IY(i),re=OY(Math.round((A-r)/i)*i+r,W),Y=Vl(re,[r,o]);C((Z=[])=>{const B=NY(Z,Y,j);if(AY(B,l*i)){w.current=B.indexOf(Y);const oe=String(B)!==String(Z);return oe&&$&&f(B),oe?B:Z}else return Z})}return g.jsx(SY,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:w,thumbs:v.current,values:_,orientation:a,form:p,children:g.jsx(uw.Provider,{scope:e.__scopeSlider,children:g.jsx(uw.Slot,{scope:e.__scopeSlider,children:g.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...m,ref:t,onPointerDown:de(m.onPointerDown,()=>{s||(N.current=_)}),min:r,max:o,inverted:h,onSlideStart:s?void 0:R,onSlideMove:s?void 0:T,onSlideEnd:s?void 0:M,onHomeKeyDown:()=>!s&&D(r,0,{commit:!0}),onEndKeyDown:()=>!s&&D(o,_.length-1,{commit:!0}),onStepKeyDown:({event:A,direction:j})=>{if(!s){const re=MT.includes(A.key)||A.shiftKey&&kT.includes(A.key)?10:1,Y=w.current,Z=_[Y],B=i*re*j;D(Z+B,Y,{commit:!0})}}})})})})});IT.displayName=Ha;var[OT,jT]=AT(Ha,{startEdge:"left",endEdge:"right",size:"width",direction:1}),CY=y.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:l,onStepKeyDown:c,...u}=e,[d,f]=y.useState(null),h=Me(t,x=>f(x)),p=y.useRef(void 0),m=Jn(o),v=m==="ltr",w=v&&!i||!v&&i;function b(x){const _=p.current||d.getBoundingClientRect(),C=[0,_.width],R=hw(C,w?[n,r]:[r,n]);return p.current=_,R(x-_.left)}return g.jsx(OT,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:g.jsx($T,{dir:m,"data-orientation":"horizontal",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const _=b(x.clientX);a==null||a(_)},onSlideMove:x=>{const _=b(x.clientX);s==null||s(_)},onSlideEnd:()=>{p.current=void 0,l==null||l()},onStepKeyDown:x=>{const C=DT[w?"from-left":"from-right"].includes(x.key);c==null||c({event:x,direction:C?-1:1})}})})}),EY=y.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:a,onSlideEnd:s,onStepKeyDown:l,...c}=e,u=y.useRef(null),d=Me(t,u),f=y.useRef(void 0),h=!o;function p(m){const v=f.current||u.current.getBoundingClientRect(),w=[0,v.height],x=hw(w,h?[r,n]:[n,r]);return f.current=v,x(m-v.top)}return g.jsx(OT,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:g.jsx($T,{"data-orientation":"vertical",...c,ref:d,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const v=p(m.clientY);i==null||i(v)},onSlideMove:m=>{const v=p(m.clientY);a==null||a(v)},onSlideEnd:()=>{f.current=void 0,s==null||s()},onStepKeyDown:m=>{const w=DT[h?"from-bottom":"from-top"].includes(m.key);l==null||l({event:m,direction:w?-1:1})}})})}),$T=y.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:l,...c}=e,u=Ud(Ha,n);return g.jsx(be.span,{...c,ref:t,onKeyDown:de(e.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):MT.concat(kT).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:de(e.onPointerDown,d=>{const f=d.target;f.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(f)?f.focus():r(d)}),onPointerMove:de(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&o(d)}),onPointerUp:de(e.onPointerUp,d=>{const f=d.target;f.hasPointerCapture(d.pointerId)&&(f.releasePointerCapture(d.pointerId),i(d))})})}),FT="SliderTrack",LT=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Ud(FT,n);return g.jsx(be.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});LT.displayName=FT;var dw="SliderRange",zT=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Ud(dw,n),i=jT(dw,n),a=y.useRef(null),s=Me(t,a),l=o.values.length,c=o.values.map(f=>HT(f,o.min,o.max)),u=l>1?Math.min(...c):0,d=100-Math.max(...c);return g.jsx(be.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:s,style:{...e.style,[i.startEdge]:u+"%",[i.endEdge]:d+"%"}})});zT.displayName=dw;var fw="SliderThumb",BT=y.forwardRef((e,t)=>{const n=xY(e.__scopeSlider),[r,o]=y.useState(null),i=Me(t,s=>o(s)),a=y.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return g.jsx(PY,{...e,ref:i,index:a})}),PY=y.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,a=Ud(fw,n),s=jT(fw,n),[l,c]=y.useState(null),u=Me(t,b=>c(b)),d=l?a.form||!!l.closest("form"):!0,f=Rl(l),h=a.values[r],p=h===void 0?0:HT(h,a.min,a.max),m=TY(r,a.values.length),v=f==null?void 0:f[s.size],w=v?kY(v,p,s.direction):0;return y.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),g.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${p}% + ${w}px)`},children:[g.jsx(uw.ItemSlot,{scope:e.__scopeSlider,children:g.jsx(be.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":a.min,"aria-valuenow":h,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:u,style:h===void 0?{display:"none"}:e.style,onFocus:de(e.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),d&&g.jsx(RY,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:h},r)]})});BT.displayName=fw;var RY=e=>{const{value:t,...n}=e,r=y.useRef(null),o=Ma(t);return y.useEffect(()=>{const i=r.current,a=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(a,"value").set;if(o!==t&&l){const c=new Event("input",{bubbles:!0});l.call(i,t),i.dispatchEvent(c)}},[o,t]),g.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:t})};function NY(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function HT(e,t,n){const i=100/(n-t)*(e-t);return Vl(i,[0,100])}function TY(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function MY(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function kY(e,t,n){const r=e/2,i=hw([0,50],[0,r]);return(r-i(t)*n)*n}function DY(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function AY(e,t){if(t>0){const n=DY(e);return Math.min(...n)>=t}return!0}function hw(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function IY(e){return(String(e).split(".")[1]||"").length}function OY(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var VT=IT,jY=LT,$Y=zT,FY=BT,pw="Switch",[LY,moe]=ct(pw),[zY,BY]=LY(pw),UT=y.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=e,[f,h]=y.useState(null),p=Me(t,x=>h(x)),m=y.useRef(!1),v=f?u||!!f.closest("form"):!0,[w=!1,b]=dt({prop:o,defaultProp:i,onChange:c});return g.jsxs(zY,{scope:n,checked:w,disabled:s,children:[g.jsx(be.button,{type:"button",role:"switch","aria-checked":w,"aria-required":a,"data-state":qT(w),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:p,onClick:de(e.onClick,x=>{b(_=>!_),v&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})}),v&&g.jsx(HY,{control:f,bubbles:!m.current,name:r,value:l,checked:w,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});UT.displayName=pw;var WT="SwitchThumb",GT=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=BY(WT,n);return g.jsx(be.span,{"data-state":qT(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});GT.displayName=WT;var HY=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=y.useRef(null),a=Ma(n),s=Rl(t);return y.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[a,n,r]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function qT(e){return e?"checked":"unchecked"}var YT=UT,VY=GT,mw="Tabs",[UY,goe]=ct(mw,[Ar]),KT=Ar(),[WY,gw]=UY(mw),XT=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=e,u=Jn(s),[d,f]=dt({prop:r,onChange:o,defaultProp:i});return g.jsx(WY,{scope:n,baseId:Rt(),value:d,onValueChange:f,orientation:a,dir:u,activationMode:l,children:g.jsx(be.div,{dir:u,"data-orientation":a,...c,ref:t})})});XT.displayName=mw;var ZT="TabsList",JT=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=gw(ZT,n),a=KT(n);return g.jsx(Al,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:g.jsx(be.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});JT.displayName=ZT;var QT="TabsTrigger",eM=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=gw(QT,n),s=KT(n),l=rM(a.baseId,r),c=oM(a.baseId,r),u=r===a.value;return g.jsx(Il,{asChild:!0,...s,focusable:!o,active:u,children:g.jsx(be.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:de(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?a.onValueChange(r):d.preventDefault()}),onKeyDown:de(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:de(e.onFocus,()=>{const d=a.activationMode!=="manual";!u&&!o&&d&&a.onValueChange(r)})})})});eM.displayName=QT;var tM="TabsContent",nM=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,s=gw(tM,n),l=rM(s.baseId,r),c=oM(s.baseId,r),u=r===s.value,d=y.useRef(u);return y.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),g.jsx(gt,{present:o||u,children:({present:f})=>g.jsx(be.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&i})})});nM.displayName=tM;function rM(e,t){return`${e}-trigger-${t}`}function oM(e,t){return`${e}-content-${t}`}var GY=XT,iM=JT,aM=eM,sM=nM,qY="Toggle",ww=y.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[a=!1,s]=dt({prop:n,onChange:o,defaultProp:r});return g.jsx(be.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:de(e.onClick,()=>{e.disabled||s(!a)})})});ww.displayName=qY;var lM=ww,Va="ToggleGroup",[cM,woe]=ct(Va,[Ar]),uM=Ar(),vw=E.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return g.jsx(YY,{...o,ref:t})}if(n==="multiple"){const o=r;return g.jsx(KY,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${Va}\``)});vw.displayName=Va;var[dM,fM]=cM(Va),YY=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a,s]=dt({prop:n,defaultProp:r,onChange:o});return g.jsx(dM,{scope:e.__scopeToggleGroup,type:"single",value:a?[a]:[],onItemActivate:s,onItemDeactivate:E.useCallback(()=>s(""),[s]),children:g.jsx(hM,{...i,ref:t})})}),KY=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a=[],s]=dt({prop:n,defaultProp:r,onChange:o}),l=E.useCallback(u=>s((d=[])=>[...d,u]),[s]),c=E.useCallback(u=>s((d=[])=>d.filter(f=>f!==u)),[s]);return g.jsx(dM,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:l,onItemDeactivate:c,children:g.jsx(hM,{...i,ref:t})})});vw.displayName=Va;var[XY,ZY]=cM(Va),hM=E.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:i,dir:a,loop:s=!0,...l}=e,c=uM(n),u=Jn(a),d={role:"group",dir:u,...l};return g.jsx(XY,{scope:n,rovingFocus:o,disabled:r,children:o?g.jsx(Al,{asChild:!0,...c,orientation:i,dir:u,loop:s,children:g.jsx(be.div,{...d,ref:t})}):g.jsx(be.div,{...d,ref:t})})}),Wd="ToggleGroupItem",pM=E.forwardRef((e,t)=>{const n=fM(Wd,e.__scopeToggleGroup),r=ZY(Wd,e.__scopeToggleGroup),o=uM(e.__scopeToggleGroup),i=n.value.includes(e.value),a=r.disabled||e.disabled,s={...e,pressed:i,disabled:a},l=E.useRef(null);return r.rovingFocus?g.jsx(Il,{asChild:!0,...o,focusable:!a,active:i,ref:l,children:g.jsx(mM,{...s,ref:t})}):g.jsx(mM,{...s,ref:t})});pM.displayName=Wd;var mM=E.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,i=fM(Wd,n),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},s=i.type==="single"?a:void 0;return g.jsx(ww,{...s,...o,ref:t,onPressedChange:l=>{l?i.onItemActivate(r):i.onItemDeactivate(r)}})}),gM=vw,wM=pM,[Gd,voe]=ct("Tooltip",[Dr]),qd=Dr(),vM="TooltipProvider",JY=700,yw="tooltip.open",[QY,bw]=Gd(vM),yM=e=>{const{__scopeTooltip:t,delayDuration:n=JY,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[a,s]=y.useState(!0),l=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),g.jsx(QY,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(c.current),s(!1)},[]),onClose:y.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:y.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:i})};yM.displayName=vM;var Yd="Tooltip",[e6,Kd]=Gd(Yd),bM=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,l=bw(Yd,e.__scopeTooltip),c=qd(t),[u,d]=y.useState(null),f=Rt(),h=y.useRef(0),p=a??l.disableHoverableContent,m=s??l.delayDuration,v=y.useRef(!1),[w=!1,b]=dt({prop:r,defaultProp:o,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(yw))):l.onClose(),i==null||i(R)}}),x=y.useMemo(()=>w?v.current?"delayed-open":"instant-open":"closed",[w]),_=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),N=y.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},m)},[m,b]);return y.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),g.jsx(Oa,{...c,children:g.jsx(e6,{scope:t,contentId:f,open:w,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayed?N():_()},[l.isOpenDelayed,N,_]),onTriggerLeave:y.useCallback(()=>{p?C():(window.clearTimeout(h.current),h.current=0)},[C,p]),onOpen:_,onClose:C,disableHoverableContent:p,children:n})})};bM.displayName=Yd;var xw="TooltipTrigger",xM=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Kd(xw,n),i=bw(xw,n),a=qd(n),s=y.useRef(null),l=Me(t,s,o.onTriggerChange),c=y.useRef(!1),u=y.useRef(!1),d=y.useCallback(()=>c.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(ja,{asChild:!0,...a,children:g.jsx(be.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:de(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:de(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:de(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:de(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:de(e.onBlur,o.onClose),onClick:de(e.onClick,o.onClose)})})});xM.displayName=xw;var t6="TooltipPortal",[yoe,n6]=Gd(t6,{forceMount:void 0}),Ua="TooltipContent",_M=y.forwardRef((e,t)=>{const n=n6(Ua,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=Kd(Ua,e.__scopeTooltip);return g.jsx(gt,{present:r||a.open,children:a.disableHoverableContent?g.jsx(SM,{side:o,...i,ref:t}):g.jsx(r6,{side:o,...i,ref:t})})}),r6=y.forwardRef((e,t)=>{const n=Kd(Ua,e.__scopeTooltip),r=bw(Ua,e.__scopeTooltip),o=y.useRef(null),i=Me(t,o),[a,s]=y.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,f=y.useCallback(()=>{s(null),d(!1)},[d]),h=y.useCallback((p,m)=>{const v=p.currentTarget,w={x:p.clientX,y:p.clientY},b=s6(w,v.getBoundingClientRect()),x=l6(w,b),_=c6(m.getBoundingClientRect()),C=d6([...x,..._]);s(C),d(!0)},[d]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(l&&u){const p=v=>h(v,u),m=v=>h(v,l);return l.addEventListener("pointerleave",p),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",p),u.removeEventListener("pointerleave",m)}}},[l,u,h,f]),y.useEffect(()=>{if(a){const p=m=>{const v=m.target,w={x:m.clientX,y:m.clientY},b=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),x=!u6(w,a);b?f():x&&(f(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[l,u,a,c,f]),g.jsx(SM,{...e,ref:i})}),[o6,i6]=Gd(Yd,{isInside:!1}),SM=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,l=Kd(Ua,n),c=qd(n),{onClose:u}=l;return y.useEffect(()=>(document.addEventListener(yw,u),()=>document.removeEventListener(yw,u)),[u]),y.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),g.jsx(To,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:g.jsxs(kl,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(Qu,{children:r}),g.jsx(o6,{scope:n,isInside:!0,children:g.jsx(JS,{id:l.contentId,role:"tooltip",children:o||r})})]})})});_M.displayName=Ua;var CM="TooltipArrow",a6=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=qd(n);return i6(CM,n).isInside?null:g.jsx(Dl,{...o,...r,ref:t})});a6.displayName=CM;function s6(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function l6(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function c6(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function u6(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i].x,l=t[i].y,c=t[a].x,u=t[a].y;l>r!=u>r&&n<(c-s)*(r-l)/(u-l)+s&&(o=!o)}return o}function d6(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),f6(t)}function f6(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var h6=yM,p6=bM,m6=xM,EM=_M;/**
|
|
316
|
+
Defaulting to \`null\`.`}var wN=dN,_q=hN,Jg="Radio",[Sq,vN]=ct(Jg),[Cq,Eq]=Sq(Jg),yN=y.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:a,value:s="on",onCheck:l,form:c,...u}=e,[d,f]=y.useState(null),h=Me(t,v=>f(v)),p=y.useRef(!1),m=d?c||!!d.closest("form"):!0;return g.jsxs(Cq,{scope:n,checked:o,disabled:a,children:[g.jsx(be.button,{type:"button",role:"radio","aria-checked":o,"data-state":_N(o),"data-disabled":a?"":void 0,disabled:a,value:s,...u,ref:h,onClick:de(e.onClick,v=>{o||l==null||l(),m&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})}),m&&g.jsx(Pq,{control:d,bubbles:!p.current,name:r,value:s,checked:o,required:i,disabled:a,form:c,style:{transform:"translateX(-100%)"}})]})});yN.displayName=Jg;var bN="RadioIndicator",xN=y.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=Eq(bN,n);return g.jsx(gt,{present:r||i.checked,children:g.jsx(be.span,{"data-state":_N(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});xN.displayName=bN;var Pq=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=y.useRef(null),a=Ma(n),s=Rl(t);return y.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[a,n,r]),g.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function _N(e){return e?"checked":"unchecked"}var Rq=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Qg="RadioGroup",[Nq,doe]=ct(Qg,[Ar,vN]),SN=Ar(),CN=vN(),[Tq,Mq]=Nq(Qg),EN=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:a=!1,disabled:s=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...f}=e,h=SN(n),p=Jn(c),[m,v]=dt({prop:i,defaultProp:o,onChange:d});return g.jsx(Tq,{scope:n,name:r,required:a,disabled:s,value:m,onValueChange:v,children:g.jsx(Al,{asChild:!0,...h,orientation:l,dir:p,loop:u,children:g.jsx(be.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":s?"":void 0,dir:p,...f,ref:t})})})});EN.displayName=Qg;var PN="RadioGroupItem",RN=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=Mq(PN,n),a=i.disabled||r,s=SN(n),l=CN(n),c=y.useRef(null),u=Me(t,c),d=i.value===o.value,f=y.useRef(!1);return y.useEffect(()=>{const h=m=>{Rq.includes(m.key)&&(f.current=!0)},p=()=>f.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",p)}},[]),g.jsx(Il,{asChild:!0,...s,focusable:!a,active:d,children:g.jsx(yN,{disabled:a,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:de(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:de(o.onFocus,()=>{var h;f.current&&((h=c.current)==null||h.click())})})})});RN.displayName=PN;var kq="RadioGroupIndicator",NN=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=CN(n);return g.jsx(xN,{...o,...r,ref:t})});NN.displayName=kq;var TN=EN,MN=RN,Dq=NN;function Vl(e,[t,n]){return Math.min(n,Math.max(t,e))}function Aq(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var ew="ScrollArea",[kN,foe]=ct(ew),[Iq,Un]=kN(ew),DN=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...a}=e,[s,l]=y.useState(null),[c,u]=y.useState(null),[d,f]=y.useState(null),[h,p]=y.useState(null),[m,v]=y.useState(null),[w,b]=y.useState(0),[x,_]=y.useState(0),[C,N]=y.useState(!1),[R,T]=y.useState(!1),M=Me(t,A=>l(A)),D=Jn(o);return g.jsx(Iq,{scope:n,type:r,dir:D,scrollHideDelay:i,scrollArea:s,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:p,scrollbarXEnabled:C,onScrollbarXEnabledChange:N,scrollbarY:m,onScrollbarYChange:v,scrollbarYEnabled:R,onScrollbarYEnabledChange:T,onCornerWidthChange:b,onCornerHeightChange:_,children:g.jsx(be.div,{dir:D,...a,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});DN.displayName=ew;var AN="ScrollAreaViewport",IN=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,a=Un(AN,n),s=y.useRef(null),l=Me(t,s,a.onViewportChange);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),g.jsx(be.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:g.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});IN.displayName=AN;var Ir="ScrollAreaScrollbar",tw=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Un(Ir,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,s=e.orientation==="horizontal";return y.useEffect(()=>(s?i(!0):a(!0),()=>{s?i(!1):a(!1)}),[s,i,a]),o.type==="hover"?g.jsx(Oq,{...r,ref:t,forceMount:n}):o.type==="scroll"?g.jsx(jq,{...r,ref:t,forceMount:n}):o.type==="auto"?g.jsx(ON,{...r,ref:t,forceMount:n}):o.type==="always"?g.jsx(nw,{...r,ref:t}):null});tw.displayName=Ir;var Oq=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Un(Ir,e.__scopeScrollArea),[i,a]=y.useState(!1);return y.useEffect(()=>{const s=o.scrollArea;let l=0;if(s){const c=()=>{window.clearTimeout(l),a(!0)},u=()=>{l=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return s.addEventListener("pointerenter",c),s.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),s.removeEventListener("pointerenter",c),s.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),g.jsx(gt,{present:n||i,children:g.jsx(ON,{"data-state":i?"visible":"hidden",...r,ref:t})})}),jq=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Un(Ir,e.__scopeScrollArea),i=e.orientation==="horizontal",a=Ld(()=>l("SCROLL_END"),100),[s,l]=Aq("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(s==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[s,o.scrollHideDelay,l]),y.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const f=()=>{const h=c[u];d!==h&&(l("SCROLL"),a()),d=h};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,i,l,a]),g.jsx(gt,{present:n||s!=="hidden",children:g.jsx(nw,{"data-state":s==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:de(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:de(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),ON=y.forwardRef((e,t)=>{const n=Un(Ir,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,a]=y.useState(!1),s=e.orientation==="horizontal",l=Ld(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;a(s?c:u)}},10);return za(n.viewport,l),za(n.content,l),g.jsx(gt,{present:r||i,children:g.jsx(nw,{"data-state":i?"visible":"hidden",...o,ref:t})})}),nw=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=Un(Ir,e.__scopeScrollArea),i=y.useRef(null),a=y.useRef(0),[s,l]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=zN(s.viewport,s.content),u={...r,sizes:s,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:f=>a.current=f};function d(f,h){return Hq(f,a.current,s,h)}return n==="horizontal"?g.jsx($q,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,h=BN(f,s,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):n==="vertical"?g.jsx(Fq,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,h=BN(f,s);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),$q=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Un(Ir,e.__scopeScrollArea),[a,s]=y.useState(),l=y.useRef(null),c=Me(t,l,i.onScrollbarXChange);return y.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),g.jsx($N,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Fd(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),VN(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:$d(a.paddingLeft),paddingEnd:$d(a.paddingRight)}})}})}),Fq=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Un(Ir,e.__scopeScrollArea),[a,s]=y.useState(),l=y.useRef(null),c=Me(t,l,i.onScrollbarYChange);return y.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),g.jsx($N,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Fd(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),VN(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:$d(a.paddingTop),paddingEnd:$d(a.paddingBottom)}})}})}),[Lq,jN]=kN(Ir),$N=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,h=Un(Ir,n),[p,m]=y.useState(null),v=Me(t,M=>m(M)),w=y.useRef(null),b=y.useRef(""),x=h.viewport,_=r.content-r.viewport,C=ot(u),N=ot(l),R=Ld(d,10);function T(M){if(w.current){const D=M.clientX-w.current.left,A=M.clientY-w.current.top;c({x:D,y:A})}}return y.useEffect(()=>{const M=D=>{const A=D.target;(p==null?void 0:p.contains(A))&&C(D,_)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[x,p,_,C]),y.useEffect(N,[r,N]),za(p,R),za(h.content,R),g.jsx(Lq,{scope:n,scrollbar:p,hasThumb:o,onThumbChange:ot(i),onThumbPointerUp:ot(a),onThumbPositionChange:N,onThumbPointerDown:ot(s),children:g.jsx(be.div,{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:de(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),w.current=p.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),T(M))}),onPointerMove:de(e.onPointerMove,T),onPointerUp:de(e.onPointerUp,M=>{const D=M.target;D.hasPointerCapture(M.pointerId)&&D.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=""),w.current=null})})})}),jd="ScrollAreaThumb",FN=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=jN(jd,e.__scopeScrollArea);return g.jsx(gt,{present:n||o.hasThumb,children:g.jsx(zq,{ref:t,...r})})}),zq=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=Un(jd,n),a=jN(jd,n),{onThumbPositionChange:s}=a,l=Me(t,d=>a.onThumbChange(d)),c=y.useRef(void 0),u=Ld(()=>{c.current&&(c.current(),c.current=void 0)},100);return y.useEffect(()=>{const d=i.viewport;if(d){const f=()=>{if(u(),!c.current){const h=Vq(d,s);c.current=h,s()}};return s(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[i.viewport,u,s]),g.jsx(be.div,{"data-state":a.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:de(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),p=d.clientX-h.left,m=d.clientY-h.top;a.onThumbPointerDown({x:p,y:m})}),onPointerUp:de(e.onPointerUp,a.onThumbPointerUp)})});FN.displayName=jd;var rw="ScrollAreaCorner",LN=y.forwardRef((e,t)=>{const n=Un(rw,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?g.jsx(Bq,{...e,ref:t}):null});LN.displayName=rw;var Bq=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=Un(rw,n),[i,a]=y.useState(0),[s,l]=y.useState(0),c=!!(i&&s);return za(o.scrollbarX,()=>{var d;const u=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(u),l(u)}),za(o.scrollbarY,()=>{var d;const u=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(u),a(u)}),c?g.jsx(be.div,{...r,ref:t,style:{width:i,height:s,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function $d(e){return e?parseInt(e,10):0}function zN(e,t){const n=e/t;return isNaN(n)?0:n}function Fd(e){const t=zN(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Hq(e,t,n,r="ltr"){const o=Fd(n),i=o/2,a=t||i,s=o-a,l=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return HN([l,c],d)(e)}function BN(e,t,n="ltr"){const r=Fd(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,s=i-r,l=n==="ltr"?[0,a]:[a*-1,0],c=Vl(e,l);return HN([0,a],[0,s])(c)}function HN(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function VN(e,t){return e>0&&e<t}var Vq=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,s=n.top!==i.top;(a||s)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Ld(e,t){const n=ot(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function za(e,t){const n=ot(t);xt(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var UN=DN,Uq=IN,Wq=LN,Gq=[" ","Enter","ArrowUp","ArrowDown"],qq=[" ","Enter"],Ul="Select",[zd,Bd,Yq]=No(Ul),[Ba,hoe]=ct(Ul,[Yq,Dr]),Hd=Dr(),[Kq,$o]=Ba(Ul),[Xq,Zq]=Ba(Ul),WN=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:h,form:p}=e,m=Hd(t),[v,w]=y.useState(null),[b,x]=y.useState(null),[_,C]=y.useState(!1),N=Jn(c),[R=!1,T]=dt({prop:r,defaultProp:o,onChange:i}),[M,D]=dt({prop:a,defaultProp:s,onChange:l}),A=y.useRef(null),O=v?p||!!v.closest("form"):!0,[$,W]=y.useState(new Set),re=Array.from($).map(Y=>Y.props.value).join(";");return g.jsx(Oa,{...m,children:g.jsxs(Kq,{required:h,scope:t,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:Rt(),value:M,onValueChange:D,open:R,onOpenChange:T,dir:N,triggerPointerDownPosRef:A,disabled:f,children:[g.jsx(zd.Provider,{scope:t,children:g.jsx(Xq,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(Y=>{W(Z=>new Set(Z).add(Y))},[]),onNativeOptionRemove:y.useCallback(Y=>{W(Z=>{const B=new Set(Z);return B.delete(Y),B})},[]),children:n})}),O?g.jsxs(wT,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:M,onChange:Y=>D(Y.target.value),disabled:f,form:p,children:[M===void 0?g.jsx("option",{value:""}):null,Array.from($)]},re):null]})})};WN.displayName=Ul;var GN="SelectTrigger",qN=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Hd(n),a=$o(GN,n),s=a.disabled||r,l=Me(t,a.onTriggerChange),c=Bd(n),u=y.useRef("touch"),[d,f,h]=vT(m=>{const v=c().filter(x=>!x.disabled),w=v.find(x=>x.value===a.value),b=yT(v,m,w);b!==void 0&&a.onValueChange(b.value)}),p=m=>{s||(a.onOpenChange(!0),h()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return g.jsx(ja,{asChild:!0,...i,children:g.jsx(be.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":gT(a.value)?"":void 0,...o,ref:l,onClick:de(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&p(m)}),onPointerDown:de(o.onPointerDown,m=>{u.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(p(m),m.preventDefault())}),onKeyDown:de(o.onKeyDown,m=>{const v=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(v&&m.key===" ")&&Gq.includes(m.key)&&(p(),m.preventDefault())})})})});qN.displayName=GN;var YN="SelectValue",KN=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,l=$o(YN,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=Me(t,l.onValueNodeChange);return xt(()=>{c(u)},[c,u]),g.jsx(be.span,{...s,ref:d,style:{pointerEvents:"none"},children:gT(l.value)?g.jsx(g.Fragment,{children:a}):i})});KN.displayName=YN;var Jq="SelectIcon",XN=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return g.jsx(be.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});XN.displayName=Jq;var Qq="SelectPortal",ZN=e=>g.jsx(_l,{asChild:!0,...e});ZN.displayName=Qq;var wi="SelectContent",JN=y.forwardRef((e,t)=>{const n=$o(wi,e.__scopeSelect),[r,o]=y.useState();if(xt(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?xc.createPortal(g.jsx(QN,{scope:e.__scopeSelect,children:g.jsx(zd.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),i):null}return g.jsx(eT,{...e,ref:t})});JN.displayName=wi;var nr=10,[QN,Fo]=Ba(wi),eY="SelectContentImpl",eT=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:v,...w}=e,b=$o(wi,n),[x,_]=y.useState(null),[C,N]=y.useState(null),R=Me(t,K=>_(K)),[T,M]=y.useState(null),[D,A]=y.useState(null),O=Bd(n),[$,W]=y.useState(!1),re=y.useRef(!1);y.useEffect(()=>{if(x)return Pl(x)},[x]),id();const Y=y.useCallback(K=>{const[z,...ie]=O().map(H=>H.ref.current),[le]=ie.slice(-1),ae=document.activeElement;for(const H of K)if(H===ae||(H==null||H.scrollIntoView({block:"nearest"}),H===z&&C&&(C.scrollTop=0),H===le&&C&&(C.scrollTop=C.scrollHeight),H==null||H.focus(),document.activeElement!==ae))return},[O,C]),Z=y.useCallback(()=>Y([T,x]),[Y,T,x]);y.useEffect(()=>{$&&Z()},[$,Z]);const{onOpenChange:B,triggerPointerDownPosRef:oe}=b;y.useEffect(()=>{if(x){let K={x:0,y:0};const z=le=>{var ae,H;K={x:Math.abs(Math.round(le.pageX)-(((ae=oe.current)==null?void 0:ae.x)??0)),y:Math.abs(Math.round(le.pageY)-(((H=oe.current)==null?void 0:H.y)??0))}},ie=le=>{K.x<=10&&K.y<=10?le.preventDefault():x.contains(le.target)||B(!1),document.removeEventListener("pointermove",z),oe.current=null};return oe.current!==null&&(document.addEventListener("pointermove",z),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",z),document.removeEventListener("pointerup",ie,{capture:!0})}}},[x,B,oe]),y.useEffect(()=>{const K=()=>B(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[B]);const[ee,ne]=vT(K=>{const z=O().filter(ae=>!ae.disabled),ie=z.find(ae=>ae.ref.current===document.activeElement),le=yT(z,K,ie);le&&setTimeout(()=>le.ref.current.focus())}),G=y.useCallback((K,z,ie)=>{const le=!re.current&&!ie;(b.value!==void 0&&b.value===z||le)&&(M(K),le&&(re.current=!0))},[b.value]),F=y.useCallback(()=>x==null?void 0:x.focus(),[x]),q=y.useCallback((K,z,ie)=>{const le=!re.current&&!ie;(b.value!==void 0&&b.value===z||le)&&A(K)},[b.value]),ce=r==="popper"?ow:tT,L=ce===ow?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:v}:{};return g.jsx(QN,{scope:n,content:x,viewport:C,onViewportChange:N,itemRefCallback:G,selectedItem:T,onItemLeave:F,itemTextRefCallback:q,focusSelectedItem:Z,selectedItemText:D,position:r,isPositioned:$,searchRef:ee,children:g.jsx(El,{as:Zn,allowPinchZoom:!0,children:g.jsx(xl,{asChild:!0,trapped:b.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:de(o,K=>{var z;(z=b.trigger)==null||z.focus({preventScroll:!0}),K.preventDefault()}),children:g.jsx(To,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:g.jsx(ce,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:K=>K.preventDefault(),...w,...L,onPlaced:()=>W(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:de(w.onKeyDown,K=>{const z=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!z&&K.key.length===1&&ne(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let le=O().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(K.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const ae=K.target,H=le.indexOf(ae);le=le.slice(H+1)}setTimeout(()=>Y(le)),K.preventDefault()}})})})})})})});eT.displayName=eY;var tY="SelectItemAlignedPosition",tT=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=$o(wi,n),a=Fo(wi,n),[s,l]=y.useState(null),[c,u]=y.useState(null),d=Me(t,R=>u(R)),f=Bd(n),h=y.useRef(!1),p=y.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:w,focusSelectedItem:b}=a,x=y.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&c&&m&&v&&w){const R=i.trigger.getBoundingClientRect(),T=c.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),D=w.getBoundingClientRect();if(i.dir!=="rtl"){const ae=D.left-T.left,H=M.left-ae,ue=R.left-H,se=R.width+ue,ye=Math.max(se,T.width),Ce=window.innerWidth-nr,xe=Vl(H,[nr,Math.max(nr,Ce-ye)]);s.style.minWidth=se+"px",s.style.left=xe+"px"}else{const ae=T.right-D.right,H=window.innerWidth-M.right-ae,ue=window.innerWidth-R.right-H,se=R.width+ue,ye=Math.max(se,T.width),Ce=window.innerWidth-nr,xe=Vl(H,[nr,Math.max(nr,Ce-ye)]);s.style.minWidth=se+"px",s.style.right=xe+"px"}const A=f(),O=window.innerHeight-nr*2,$=m.scrollHeight,W=window.getComputedStyle(c),re=parseInt(W.borderTopWidth,10),Y=parseInt(W.paddingTop,10),Z=parseInt(W.borderBottomWidth,10),B=parseInt(W.paddingBottom,10),oe=re+Y+$+B+Z,ee=Math.min(v.offsetHeight*5,oe),ne=window.getComputedStyle(m),G=parseInt(ne.paddingTop,10),F=parseInt(ne.paddingBottom,10),q=R.top+R.height/2-nr,ce=O-q,L=v.offsetHeight/2,K=v.offsetTop+L,z=re+Y+K,ie=oe-z;if(z<=q){const ae=A.length>0&&v===A[A.length-1].ref.current;s.style.bottom="0px";const H=c.clientHeight-m.offsetTop-m.offsetHeight,ue=Math.max(ce,L+(ae?F:0)+H+Z),se=z+ue;s.style.height=se+"px"}else{const ae=A.length>0&&v===A[0].ref.current;s.style.top="0px";const ue=Math.max(q,re+m.offsetTop+(ae?G:0)+L)+ie;s.style.height=ue+"px",m.scrollTop=z-q+m.offsetTop}s.style.margin=`${nr}px 0`,s.style.minHeight=ee+"px",s.style.maxHeight=O+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,s,c,m,v,w,i.dir,r]);xt(()=>x(),[x]);const[_,C]=y.useState();xt(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const N=y.useCallback(R=>{R&&p.current===!0&&(x(),b==null||b(),p.current=!1)},[x,b]);return g.jsx(rY,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:g.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:g.jsx(be.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});tT.displayName=tY;var nY="SelectPopperPosition",ow=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=nr,...i}=e,a=Hd(n);return g.jsx(kl,{...a,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ow.displayName=nY;var[rY,iw]=Ba(wi,{}),aw="SelectViewport",nT=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Fo(aw,n),a=iw(aw,n),s=Me(t,i.onViewportChange),l=y.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),g.jsx(zd.Slot,{scope:n,children:g.jsx(be.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:de(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&d){const h=Math.abs(l.current-u.scrollTop);if(h>0){const p=window.innerHeight-nr*2,m=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),w=Math.max(m,v);if(w<p){const b=w+h,x=Math.min(p,b),_=b-x;d.style.height=x+"px",d.style.bottom==="0px"&&(u.scrollTop=_>0?_:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});nT.displayName=aw;var rT="SelectGroup",[oY,iY]=Ba(rT),oT=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Rt();return g.jsx(oY,{scope:n,id:o,children:g.jsx(be.div,{role:"group","aria-labelledby":o,...r,ref:t})})});oT.displayName=rT;var iT="SelectLabel",aT=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=iY(iT,n);return g.jsx(be.div,{id:o.id,...r,ref:t})});aT.displayName=iT;var Vd="SelectItem",[aY,sT]=Ba(Vd),lT=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,s=$o(Vd,n),l=Fo(Vd,n),c=s.value===r,[u,d]=y.useState(i??""),[f,h]=y.useState(!1),p=Me(t,b=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,b,r,o)}),m=Rt(),v=y.useRef("touch"),w=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(aY,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:y.useCallback(b=>{d(x=>x||((b==null?void 0:b.textContent)??"").trim())},[]),children:g.jsx(zd.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:g.jsx(be.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:p,onFocus:de(a.onFocus,()=>h(!0)),onBlur:de(a.onBlur,()=>h(!1)),onClick:de(a.onClick,()=>{v.current!=="mouse"&&w()}),onPointerUp:de(a.onPointerUp,()=>{v.current==="mouse"&&w()}),onPointerDown:de(a.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:de(a.onPointerMove,b=>{var x;v.current=b.pointerType,o?(x=l.onItemLeave)==null||x.call(l):v.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:de(a.onPointerLeave,b=>{var x;b.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:de(a.onKeyDown,b=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&b.key===" "||(qq.includes(b.key)&&w(),b.key===" "&&b.preventDefault())})})})})});lT.displayName=Vd;var Wl="SelectItemText",cT=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=$o(Wl,n),s=Fo(Wl,n),l=sT(Wl,n),c=Zq(Wl,n),[u,d]=y.useState(null),f=Me(t,w=>d(w),l.onItemTextChange,w=>{var b;return(b=s.itemTextRefCallback)==null?void 0:b.call(s,w,l.value,l.disabled)}),h=u==null?void 0:u.textContent,p=y.useMemo(()=>g.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=c;return xt(()=>(m(p),()=>v(p)),[m,v,p]),g.jsxs(g.Fragment,{children:[g.jsx(be.span,{id:l.textId,...i,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?xc.createPortal(i.children,a.valueNode):null]})});cT.displayName=Wl;var uT="SelectItemIndicator",dT=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return sT(uT,n).isSelected?g.jsx(be.span,{"aria-hidden":!0,...r,ref:t}):null});dT.displayName=uT;var sw="SelectScrollUpButton",fT=y.forwardRef((e,t)=>{const n=Fo(sw,e.__scopeSelect),r=iw(sw,e.__scopeSelect),[o,i]=y.useState(!1),a=Me(t,r.onScrollButtonChange);return xt(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?g.jsx(pT,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});fT.displayName=sw;var lw="SelectScrollDownButton",hT=y.forwardRef((e,t)=>{const n=Fo(lw,e.__scopeSelect),r=iw(lw,e.__scopeSelect),[o,i]=y.useState(!1),a=Me(t,r.onScrollButtonChange);return xt(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?g.jsx(pT,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});hT.displayName=lw;var pT=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Fo("SelectScrollButton",n),a=y.useRef(null),s=Bd(n),l=y.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return y.useEffect(()=>()=>l(),[l]),xt(()=>{var u;const c=s().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[s]),g.jsx(be.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:de(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:de(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:de(o.onPointerLeave,()=>{l()})})}),sY="SelectSeparator",mT=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(be.div,{"aria-hidden":!0,...r,ref:t})});mT.displayName=sY;var cw="SelectArrow",lY=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Hd(n),i=$o(cw,n),a=Fo(cw,n);return i.open&&a.position==="popper"?g.jsx(Dl,{...o,...r,ref:t}):null});lY.displayName=cw;function gT(e){return e===""||e===void 0}var wT=y.forwardRef((e,t)=>{const{value:n,...r}=e,o=y.useRef(null),i=Me(t,o),a=Ma(n);return y.useEffect(()=>{const s=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==n&&u){const d=new Event("change",{bubbles:!0});u.call(s,n),s.dispatchEvent(d)}},[a,n]),g.jsx(hm,{asChild:!0,children:g.jsx("select",{...r,ref:i,defaultValue:n})})});wT.displayName="BubbleSelect";function vT(e){const t=ot(e),n=y.useRef(""),r=y.useRef(0),o=y.useCallback(a=>{const s=n.current+a;t(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),i=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function yT(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=cY(e,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function cY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var uY=WN,bT=qN,dY=KN,fY=XN,hY=ZN,xT=JN,pY=nT,mY=oT,_T=aT,ST=lT,gY=cT,wY=dT,CT=fT,ET=hT,PT=mT,vY="Separator",RT="horizontal",yY=["horizontal","vertical"],NT=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=RT,...o}=e,i=bY(r)?r:RT,s=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return g.jsx(be.div,{"data-orientation":i,...s,...o,ref:t})});NT.displayName=vY;function bY(e){return yY.includes(e)}var TT=NT,MT=["PageUp","PageDown"],kT=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],DT={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ha="Slider",[uw,xY,_Y]=No(Ha),[AT,poe]=ct(Ha,[_Y]),[SY,Ud]=AT(Ha),IT=y.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:a="horizontal",disabled:s=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:h=!1,form:p,...m}=e,v=y.useRef(new Set),w=y.useRef(0),x=a==="horizontal"?CY:EY,[_=[],C]=dt({prop:u,defaultProp:c,onChange:A=>{var $;($=[...v.current][w.current])==null||$.focus(),d(A)}}),N=y.useRef(_);function R(A){const O=MY(_,A);D(A,O)}function T(A){D(A,w.current)}function M(){const A=N.current[w.current];_[w.current]!==A&&f(_)}function D(A,O,{commit:$}={commit:!1}){const W=IY(i),re=OY(Math.round((A-r)/i)*i+r,W),Y=Vl(re,[r,o]);C((Z=[])=>{const B=NY(Z,Y,O);if(AY(B,l*i)){w.current=B.indexOf(Y);const oe=String(B)!==String(Z);return oe&&$&&f(B),oe?B:Z}else return Z})}return g.jsx(SY,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:w,thumbs:v.current,values:_,orientation:a,form:p,children:g.jsx(uw.Provider,{scope:e.__scopeSlider,children:g.jsx(uw.Slot,{scope:e.__scopeSlider,children:g.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...m,ref:t,onPointerDown:de(m.onPointerDown,()=>{s||(N.current=_)}),min:r,max:o,inverted:h,onSlideStart:s?void 0:R,onSlideMove:s?void 0:T,onSlideEnd:s?void 0:M,onHomeKeyDown:()=>!s&&D(r,0,{commit:!0}),onEndKeyDown:()=>!s&&D(o,_.length-1,{commit:!0}),onStepKeyDown:({event:A,direction:O})=>{if(!s){const re=MT.includes(A.key)||A.shiftKey&&kT.includes(A.key)?10:1,Y=w.current,Z=_[Y],B=i*re*O;D(Z+B,Y,{commit:!0})}}})})})})});IT.displayName=Ha;var[OT,jT]=AT(Ha,{startEdge:"left",endEdge:"right",size:"width",direction:1}),CY=y.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:l,onStepKeyDown:c,...u}=e,[d,f]=y.useState(null),h=Me(t,x=>f(x)),p=y.useRef(void 0),m=Jn(o),v=m==="ltr",w=v&&!i||!v&&i;function b(x){const _=p.current||d.getBoundingClientRect(),C=[0,_.width],R=hw(C,w?[n,r]:[r,n]);return p.current=_,R(x-_.left)}return g.jsx(OT,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:g.jsx($T,{dir:m,"data-orientation":"horizontal",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const _=b(x.clientX);a==null||a(_)},onSlideMove:x=>{const _=b(x.clientX);s==null||s(_)},onSlideEnd:()=>{p.current=void 0,l==null||l()},onStepKeyDown:x=>{const C=DT[w?"from-left":"from-right"].includes(x.key);c==null||c({event:x,direction:C?-1:1})}})})}),EY=y.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:a,onSlideEnd:s,onStepKeyDown:l,...c}=e,u=y.useRef(null),d=Me(t,u),f=y.useRef(void 0),h=!o;function p(m){const v=f.current||u.current.getBoundingClientRect(),w=[0,v.height],x=hw(w,h?[r,n]:[n,r]);return f.current=v,x(m-v.top)}return g.jsx(OT,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:g.jsx($T,{"data-orientation":"vertical",...c,ref:d,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const v=p(m.clientY);i==null||i(v)},onSlideMove:m=>{const v=p(m.clientY);a==null||a(v)},onSlideEnd:()=>{f.current=void 0,s==null||s()},onStepKeyDown:m=>{const w=DT[h?"from-bottom":"from-top"].includes(m.key);l==null||l({event:m,direction:w?-1:1})}})})}),$T=y.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:l,...c}=e,u=Ud(Ha,n);return g.jsx(be.span,{...c,ref:t,onKeyDown:de(e.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):MT.concat(kT).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:de(e.onPointerDown,d=>{const f=d.target;f.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(f)?f.focus():r(d)}),onPointerMove:de(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&o(d)}),onPointerUp:de(e.onPointerUp,d=>{const f=d.target;f.hasPointerCapture(d.pointerId)&&(f.releasePointerCapture(d.pointerId),i(d))})})}),FT="SliderTrack",LT=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Ud(FT,n);return g.jsx(be.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});LT.displayName=FT;var dw="SliderRange",zT=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Ud(dw,n),i=jT(dw,n),a=y.useRef(null),s=Me(t,a),l=o.values.length,c=o.values.map(f=>HT(f,o.min,o.max)),u=l>1?Math.min(...c):0,d=100-Math.max(...c);return g.jsx(be.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:s,style:{...e.style,[i.startEdge]:u+"%",[i.endEdge]:d+"%"}})});zT.displayName=dw;var fw="SliderThumb",BT=y.forwardRef((e,t)=>{const n=xY(e.__scopeSlider),[r,o]=y.useState(null),i=Me(t,s=>o(s)),a=y.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return g.jsx(PY,{...e,ref:i,index:a})}),PY=y.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,a=Ud(fw,n),s=jT(fw,n),[l,c]=y.useState(null),u=Me(t,b=>c(b)),d=l?a.form||!!l.closest("form"):!0,f=Rl(l),h=a.values[r],p=h===void 0?0:HT(h,a.min,a.max),m=TY(r,a.values.length),v=f==null?void 0:f[s.size],w=v?kY(v,p,s.direction):0;return y.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),g.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${p}% + ${w}px)`},children:[g.jsx(uw.ItemSlot,{scope:e.__scopeSlider,children:g.jsx(be.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":a.min,"aria-valuenow":h,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:u,style:h===void 0?{display:"none"}:e.style,onFocus:de(e.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),d&&g.jsx(RY,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:h},r)]})});BT.displayName=fw;var RY=e=>{const{value:t,...n}=e,r=y.useRef(null),o=Ma(t);return y.useEffect(()=>{const i=r.current,a=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(a,"value").set;if(o!==t&&l){const c=new Event("input",{bubbles:!0});l.call(i,t),i.dispatchEvent(c)}},[o,t]),g.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:t})};function NY(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function HT(e,t,n){const i=100/(n-t)*(e-t);return Vl(i,[0,100])}function TY(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function MY(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function kY(e,t,n){const r=e/2,i=hw([0,50],[0,r]);return(r-i(t)*n)*n}function DY(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function AY(e,t){if(t>0){const n=DY(e);return Math.min(...n)>=t}return!0}function hw(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function IY(e){return(String(e).split(".")[1]||"").length}function OY(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var VT=IT,jY=LT,$Y=zT,FY=BT,pw="Switch",[LY,moe]=ct(pw),[zY,BY]=LY(pw),UT=y.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=e,[f,h]=y.useState(null),p=Me(t,x=>h(x)),m=y.useRef(!1),v=f?u||!!f.closest("form"):!0,[w=!1,b]=dt({prop:o,defaultProp:i,onChange:c});return g.jsxs(zY,{scope:n,checked:w,disabled:s,children:[g.jsx(be.button,{type:"button",role:"switch","aria-checked":w,"aria-required":a,"data-state":qT(w),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:p,onClick:de(e.onClick,x=>{b(_=>!_),v&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})}),v&&g.jsx(HY,{control:f,bubbles:!m.current,name:r,value:l,checked:w,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});UT.displayName=pw;var WT="SwitchThumb",GT=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=BY(WT,n);return g.jsx(be.span,{"data-state":qT(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});GT.displayName=WT;var HY=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=y.useRef(null),a=Ma(n),s=Rl(t);return y.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[a,n,r]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function qT(e){return e?"checked":"unchecked"}var YT=UT,VY=GT,mw="Tabs",[UY,goe]=ct(mw,[Ar]),KT=Ar(),[WY,gw]=UY(mw),XT=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=e,u=Jn(s),[d,f]=dt({prop:r,onChange:o,defaultProp:i});return g.jsx(WY,{scope:n,baseId:Rt(),value:d,onValueChange:f,orientation:a,dir:u,activationMode:l,children:g.jsx(be.div,{dir:u,"data-orientation":a,...c,ref:t})})});XT.displayName=mw;var ZT="TabsList",JT=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=gw(ZT,n),a=KT(n);return g.jsx(Al,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:g.jsx(be.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});JT.displayName=ZT;var QT="TabsTrigger",eM=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=gw(QT,n),s=KT(n),l=rM(a.baseId,r),c=oM(a.baseId,r),u=r===a.value;return g.jsx(Il,{asChild:!0,...s,focusable:!o,active:u,children:g.jsx(be.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:de(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?a.onValueChange(r):d.preventDefault()}),onKeyDown:de(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:de(e.onFocus,()=>{const d=a.activationMode!=="manual";!u&&!o&&d&&a.onValueChange(r)})})})});eM.displayName=QT;var tM="TabsContent",nM=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,s=gw(tM,n),l=rM(s.baseId,r),c=oM(s.baseId,r),u=r===s.value,d=y.useRef(u);return y.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),g.jsx(gt,{present:o||u,children:({present:f})=>g.jsx(be.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&i})})});nM.displayName=tM;function rM(e,t){return`${e}-trigger-${t}`}function oM(e,t){return`${e}-content-${t}`}var GY=XT,iM=JT,aM=eM,sM=nM,qY="Toggle",ww=y.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[a=!1,s]=dt({prop:n,onChange:o,defaultProp:r});return g.jsx(be.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:de(e.onClick,()=>{e.disabled||s(!a)})})});ww.displayName=qY;var lM=ww,Va="ToggleGroup",[cM,woe]=ct(Va,[Ar]),uM=Ar(),vw=E.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return g.jsx(YY,{...o,ref:t})}if(n==="multiple"){const o=r;return g.jsx(KY,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${Va}\``)});vw.displayName=Va;var[dM,fM]=cM(Va),YY=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a,s]=dt({prop:n,defaultProp:r,onChange:o});return g.jsx(dM,{scope:e.__scopeToggleGroup,type:"single",value:a?[a]:[],onItemActivate:s,onItemDeactivate:E.useCallback(()=>s(""),[s]),children:g.jsx(hM,{...i,ref:t})})}),KY=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a=[],s]=dt({prop:n,defaultProp:r,onChange:o}),l=E.useCallback(u=>s((d=[])=>[...d,u]),[s]),c=E.useCallback(u=>s((d=[])=>d.filter(f=>f!==u)),[s]);return g.jsx(dM,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:l,onItemDeactivate:c,children:g.jsx(hM,{...i,ref:t})})});vw.displayName=Va;var[XY,ZY]=cM(Va),hM=E.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:i,dir:a,loop:s=!0,...l}=e,c=uM(n),u=Jn(a),d={role:"group",dir:u,...l};return g.jsx(XY,{scope:n,rovingFocus:o,disabled:r,children:o?g.jsx(Al,{asChild:!0,...c,orientation:i,dir:u,loop:s,children:g.jsx(be.div,{...d,ref:t})}):g.jsx(be.div,{...d,ref:t})})}),Wd="ToggleGroupItem",pM=E.forwardRef((e,t)=>{const n=fM(Wd,e.__scopeToggleGroup),r=ZY(Wd,e.__scopeToggleGroup),o=uM(e.__scopeToggleGroup),i=n.value.includes(e.value),a=r.disabled||e.disabled,s={...e,pressed:i,disabled:a},l=E.useRef(null);return r.rovingFocus?g.jsx(Il,{asChild:!0,...o,focusable:!a,active:i,ref:l,children:g.jsx(mM,{...s,ref:t})}):g.jsx(mM,{...s,ref:t})});pM.displayName=Wd;var mM=E.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,i=fM(Wd,n),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},s=i.type==="single"?a:void 0;return g.jsx(ww,{...s,...o,ref:t,onPressedChange:l=>{l?i.onItemActivate(r):i.onItemDeactivate(r)}})}),gM=vw,wM=pM,[Gd,voe]=ct("Tooltip",[Dr]),qd=Dr(),vM="TooltipProvider",JY=700,yw="tooltip.open",[QY,bw]=Gd(vM),yM=e=>{const{__scopeTooltip:t,delayDuration:n=JY,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[a,s]=y.useState(!0),l=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),g.jsx(QY,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(c.current),s(!1)},[]),onClose:y.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:y.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:i})};yM.displayName=vM;var Yd="Tooltip",[e6,Kd]=Gd(Yd),bM=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,l=bw(Yd,e.__scopeTooltip),c=qd(t),[u,d]=y.useState(null),f=Rt(),h=y.useRef(0),p=a??l.disableHoverableContent,m=s??l.delayDuration,v=y.useRef(!1),[w=!1,b]=dt({prop:r,defaultProp:o,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(yw))):l.onClose(),i==null||i(R)}}),x=y.useMemo(()=>w?v.current?"delayed-open":"instant-open":"closed",[w]),_=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),N=y.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},m)},[m,b]);return y.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),g.jsx(Oa,{...c,children:g.jsx(e6,{scope:t,contentId:f,open:w,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayed?N():_()},[l.isOpenDelayed,N,_]),onTriggerLeave:y.useCallback(()=>{p?C():(window.clearTimeout(h.current),h.current=0)},[C,p]),onOpen:_,onClose:C,disableHoverableContent:p,children:n})})};bM.displayName=Yd;var xw="TooltipTrigger",xM=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Kd(xw,n),i=bw(xw,n),a=qd(n),s=y.useRef(null),l=Me(t,s,o.onTriggerChange),c=y.useRef(!1),u=y.useRef(!1),d=y.useCallback(()=>c.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(ja,{asChild:!0,...a,children:g.jsx(be.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:de(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:de(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:de(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:de(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:de(e.onBlur,o.onClose),onClick:de(e.onClick,o.onClose)})})});xM.displayName=xw;var t6="TooltipPortal",[yoe,n6]=Gd(t6,{forceMount:void 0}),Ua="TooltipContent",_M=y.forwardRef((e,t)=>{const n=n6(Ua,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=Kd(Ua,e.__scopeTooltip);return g.jsx(gt,{present:r||a.open,children:a.disableHoverableContent?g.jsx(SM,{side:o,...i,ref:t}):g.jsx(r6,{side:o,...i,ref:t})})}),r6=y.forwardRef((e,t)=>{const n=Kd(Ua,e.__scopeTooltip),r=bw(Ua,e.__scopeTooltip),o=y.useRef(null),i=Me(t,o),[a,s]=y.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,f=y.useCallback(()=>{s(null),d(!1)},[d]),h=y.useCallback((p,m)=>{const v=p.currentTarget,w={x:p.clientX,y:p.clientY},b=s6(w,v.getBoundingClientRect()),x=l6(w,b),_=c6(m.getBoundingClientRect()),C=d6([...x,..._]);s(C),d(!0)},[d]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(l&&u){const p=v=>h(v,u),m=v=>h(v,l);return l.addEventListener("pointerleave",p),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",p),u.removeEventListener("pointerleave",m)}}},[l,u,h,f]),y.useEffect(()=>{if(a){const p=m=>{const v=m.target,w={x:m.clientX,y:m.clientY},b=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),x=!u6(w,a);b?f():x&&(f(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[l,u,a,c,f]),g.jsx(SM,{...e,ref:i})}),[o6,i6]=Gd(Yd,{isInside:!1}),SM=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,l=Kd(Ua,n),c=qd(n),{onClose:u}=l;return y.useEffect(()=>(document.addEventListener(yw,u),()=>document.removeEventListener(yw,u)),[u]),y.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),g.jsx(To,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:g.jsxs(kl,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(Qu,{children:r}),g.jsx(o6,{scope:n,isInside:!0,children:g.jsx(JS,{id:l.contentId,role:"tooltip",children:o||r})})]})})});_M.displayName=Ua;var CM="TooltipArrow",a6=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=qd(n);return i6(CM,n).isInside?null:g.jsx(Dl,{...o,...r,ref:t})});a6.displayName=CM;function s6(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function l6(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function c6(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function u6(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i].x,l=t[i].y,c=t[a].x,u=t[a].y;l>r!=u>r&&n<(c-s)*(r-l)/(u-l)+s&&(o=!o)}return o}function d6(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),f6(t)}function f6(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var h6=yM,p6=bM,m6=xM,EM=_M;/**
|
|
317
317
|
* @license lucide-react v0.475.0 - ISC
|
|
318
318
|
*
|
|
319
319
|
* This source code is licensed under the ISC license.
|
|
@@ -398,10 +398,10 @@ Defaulting to \`null\`.`}var wN=dN,_q=hN,Jg="Radio",[Sq,vN]=ct(Jg),[Cq,Eq]=Sq(Jg
|
|
|
398
398
|
*
|
|
399
399
|
* This source code is licensed under the ISC license.
|
|
400
400
|
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
-
*/const NM=Mn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),_w="-",E6=e=>{const t=R6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(_w);return s[0]===""&&s.length!==1&&s.shift(),TM(s,t)||P6(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},TM=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?TM(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(_w);return(a=t.validators.find(({validator:s})=>s(i)))==null?void 0:a.classGroupId},MM=/^\[(.+)\]$/,P6=e=>{if(MM.test(e)){const t=MM.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},R6=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)Sw(n[o],r,o,t);return r},Sw=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:kM(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(N6(o)){Sw(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{Sw(a,kM(t,i),n,r)})})},kM=(e,t)=>{let n=e;return t.split(_w).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},N6=e=>e.isThemeGetter,T6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return o(i,a),a},set(i,a){n.has(i)?n.set(i,a):o(i,a)}}},Cw="!",Ew=":",M6=Ew.length,k6=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let a=0,s=0,l=0,c;for(let p=0;p<o.length;p++){let m=o[p];if(a===0&&s===0){if(m===Ew){i.push(o.slice(l,p)),l=p+M6;continue}if(m==="/"){c=p;continue}}m==="["?a++:m==="]"?a--:m==="("?s++:m===")"&&s--}const u=i.length===0?o:o.substring(l),d=D6(u),f=d!==u,h=c&&c>l?c-l:void 0;return{modifiers:i,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:h}};if(t){const o=t+Ew,i=r;r=a=>a.startsWith(o)?i(a.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},D6=e=>e.endsWith(Cw)?e.substring(0,e.length-1):e.startsWith(Cw)?e.substring(1):e,A6=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let i=[];return r.forEach(a=>{a[0]==="["||t[a]?(o.push(...i.sort(),a),i=[]):i.push(a)}),o.push(...i.sort()),o}},I6=e=>({cache:T6(e.cacheSize),parseClassName:k6(e),sortModifiers:A6(e),...E6(e)}),O6=/\s+/,j6=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,a=[],s=e.trim().split(O6);let l="";for(let c=s.length-1;c>=0;c-=1){const u=s[c],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let v=!!m,w=r(v?p.substring(0,m):p);if(!w){if(!v){l=u+(l.length>0?" "+l:l);continue}if(w=r(p),!w){l=u+(l.length>0?" "+l:l);continue}v=!1}const b=i(f).join(":"),x=h?b+Cw:b,_=x+w;if(a.includes(_))continue;a.push(_);const C=o(w,v);for(let N=0;N<C.length;++N){const R=C[N];a.push(x+R)}l=u+(l.length>0?" "+l:l)}return l};function $6(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=DM(t))&&(r&&(r+=" "),r+=n);return r}const DM=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=DM(e[r]))&&(n&&(n+=" "),n+=t);return n};function F6(e,...t){let n,r,o,i=a;function a(l){const c=t.reduce((u,d)=>d(u),e());return n=I6(c),r=n.cache.get,o=n.cache.set,i=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=j6(l,n);return o(l,u),u}return function(){return i($6.apply(null,arguments))}}const jt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},AM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,IM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,L6=/^\d+\/\d+$/,z6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,B6=/\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$/,H6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,V6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,U6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ga=e=>L6.test(e),Ve=e=>!!e&&!Number.isNaN(Number(e)),vi=e=>!!e&&Number.isInteger(Number(e)),OM=e=>e.endsWith("%")&&Ve(e.slice(0,-1)),zo=e=>z6.test(e),W6=()=>!0,G6=e=>B6.test(e)&&!H6.test(e),Pw=()=>!1,q6=e=>V6.test(e),Y6=e=>U6.test(e),K6=e=>!Pe(e)&&!Re(e),X6=e=>qa(e,FM,Pw),Pe=e=>AM.test(e),yi=e=>qa(e,LM,G6),Rw=e=>qa(e,sK,Ve),Z6=e=>qa(e,jM,Pw),J6=e=>qa(e,$M,Y6),Q6=e=>qa(e,Pw,q6),Re=e=>IM.test(e),Qd=e=>Ya(e,LM),eK=e=>Ya(e,lK),tK=e=>Ya(e,jM),nK=e=>Ya(e,FM),rK=e=>Ya(e,$M),oK=e=>Ya(e,cK,!0),qa=(e,t,n)=>{const r=AM.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ya=(e,t,n=!1)=>{const r=IM.exec(e);return r?r[1]?t(r[1]):n:!1},jM=e=>e==="position",iK=new Set(["image","url"]),$M=e=>iK.has(e),aK=new Set(["length","size","percentage"]),FM=e=>aK.has(e),LM=e=>e==="length",sK=e=>e==="number",lK=e=>e==="family-name",cK=e=>e==="shadow",uK=F6(()=>{const e=jt("color"),t=jt("font"),n=jt("text"),r=jt("font-weight"),o=jt("tracking"),i=jt("leading"),a=jt("breakpoint"),s=jt("container"),l=jt("spacing"),c=jt("radius"),u=jt("shadow"),d=jt("inset-shadow"),f=jt("drop-shadow"),h=jt("blur"),p=jt("perspective"),m=jt("aspect"),v=jt("ease"),w=jt("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],N=()=>[Re,Pe,l],R=()=>[Ga,"full","auto",...N()],T=()=>[vi,"none","subgrid",Re,Pe],M=()=>["auto",{span:["full",vi,Re,Pe]},Re,Pe],D=()=>[vi,"auto",Re,Pe],A=()=>["auto","min","max","fr",Re,Pe],j=()=>["start","end","center","between","around","evenly","stretch","baseline"],$=()=>["start","end","center","stretch"],W=()=>["auto",...N()],re=()=>[Ga,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],Y=()=>[e,Re,Pe],Z=()=>[OM,yi],B=()=>["","none","full",c,Re,Pe],oe=()=>["",Ve,Qd,yi],ee=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["","none",h,Re,Pe],F=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Re,Pe],q=()=>["none",Ve,Re,Pe],ce=()=>["none",Ve,Re,Pe],L=()=>[Ve,Re,Pe],K=()=>[Ga,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[zo],breakpoint:[zo],color:[W6],container:[zo],"drop-shadow":[zo],ease:["in","out","in-out"],font:[K6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[zo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[zo],shadow:[zo],spacing:["px",Ve],text:[zo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ga,Pe,Re,m]}],container:["container"],columns:[{columns:[Ve,Pe,Re,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"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"],sr:["sr-only","not-sr-only"],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:[...x(),Pe,Re]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[vi,"auto",Re,Pe]}],basis:[{basis:[Ga,"full","auto",s,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ve,Ga,"auto","initial","none",Pe]}],grow:[{grow:["",Ve,Re,Pe]}],shrink:[{shrink:["",Ve,Re,Pe]}],order:[{order:[vi,"first","last","none",Re,Pe]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...$(),"baseline"]}],"align-self":[{self:["auto",...$(),"baseline"]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],w:[{w:[s,"screen",...re()]}],"min-w":[{"min-w":[s,"screen","none",...re()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...re()]}],h:[{h:["screen",...re()]}],"min-h":[{"min-h":["screen","none",...re()]}],"max-h":[{"max-h":["screen",...re()]}],"font-size":[{text:["base",n,Qd,yi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Re,Rw]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",OM,Pe]}],"font-family":[{font:[eK,Pe,t]}],"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-fractions"],tracking:[{tracking:[o,Re,Pe]}],"line-clamp":[{"line-clamp":[Ve,"none",Re,Rw]}],leading:[{leading:[i,...N()]}],"list-image":[{"list-image":["none",Re,Pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Re,Pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ve,"from-font","auto",Re,yi]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[Ve,"auto",Re,Pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re,Pe]}],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",Re,Pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...x(),tK,Z6]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",nK,X6]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vi,Re,Pe],radial:["",Re,Pe],conic:[vi,Re,Pe]},rK,J6]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ee(),"hidden","none"]}],"divide-style":[{divide:[...ee(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ve,Re,Pe]}],"outline-w":[{outline:["",Ve,Qd,yi]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",u,oK,Q6]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",Re,Pe,d]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[Ve,yi]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":Y()}],opacity:[{opacity:[Ve,Re,Pe]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],filter:[{filter:["","none",Re,Pe]}],blur:[{blur:G()}],brightness:[{brightness:[Ve,Re,Pe]}],contrast:[{contrast:[Ve,Re,Pe]}],"drop-shadow":[{"drop-shadow":["","none",f,Re,Pe]}],grayscale:[{grayscale:["",Ve,Re,Pe]}],"hue-rotate":[{"hue-rotate":[Ve,Re,Pe]}],invert:[{invert:["",Ve,Re,Pe]}],saturate:[{saturate:[Ve,Re,Pe]}],sepia:[{sepia:["",Ve,Re,Pe]}],"backdrop-filter":[{"backdrop-filter":["","none",Re,Pe]}],"backdrop-blur":[{"backdrop-blur":G()}],"backdrop-brightness":[{"backdrop-brightness":[Ve,Re,Pe]}],"backdrop-contrast":[{"backdrop-contrast":[Ve,Re,Pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ve,Re,Pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ve,Re,Pe]}],"backdrop-invert":[{"backdrop-invert":["",Ve,Re,Pe]}],"backdrop-opacity":[{"backdrop-opacity":[Ve,Re,Pe]}],"backdrop-saturate":[{"backdrop-saturate":[Ve,Re,Pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ve,Re,Pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Re,Pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ve,"initial",Re,Pe]}],ease:[{ease:["linear","initial",v,Re,Pe]}],delay:[{delay:[Ve,Re,Pe]}],animate:[{animate:["none",w,Re,Pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,Re,Pe]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:q()}],"rotate-x":[{"rotate-x":q()}],"rotate-y":[{"rotate-y":q()}],"rotate-z":[{"rotate-z":q()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":["scale-3d"],skew:[{skew:L()}],"skew-x":[{"skew-x":L()}],"skew-y":[{"skew-y":L()}],transform:[{transform:[Re,Pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:K()}],"translate-x":[{"translate-x":K()}],"translate-y":[{"translate-y":K()}],"translate-z":[{"translate-z":K()}],"translate-none":["translate-none"],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",Re,Pe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",Re,Pe]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[Ve,Qd,yi,Rw]}],stroke:[{stroke:["none",...Y()]}],"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-s","border-color-e","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}});function Q(...e){return uK(Eu(e))}const dK=nU,zM=y.forwardRef(({className:e,...t},n)=>g.jsx(rU,{ref:n,className:Q("border-b",e),...t}));zM.displayName="AccordionItem";const BM=y.forwardRef(({className:e,children:t,...n},r)=>g.jsx(oU,{className:"flex",children:g.jsxs(iU,{ref:r,className:Q("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,g.jsx(Xd,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));BM.displayName="AccordionTrigger";const HM=y.forwardRef(({className:e,children:t,...n},r)=>g.jsx(aU,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:g.jsx("div",{className:Q("pb-4 pt-0",e),children:t})}));HM.displayName="AccordionContent";const VM=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,UM=Eu,kn=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return UM(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const f=VM(u)||VM(d);return o[c][f]}),s=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(p=>{let[m,v]=p;return Array.isArray(v)?v.includes({...i,...s}[m]):{...i,...s}[m]===v})?[...c,d,f]:c},[]);return UM(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},WM={alert:{defaultStyles:"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",variantStyles:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}},badge:{defaultStyles:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",variantStyles:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"text-foreground"}},defaultVariants:{variant:"default"}},button:{defaultStyles:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",variantStyles:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",primary:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}},sidebar:{defaultStyles:"relative flex flex-col gap-2 h-screen p-4 bg-background border-r transition-all duration-300 ease-in-out",variantStyles:{variant:{default:"border-r",floating:"rounded-lg border shadow-lg m-2 h-[calc(100vh-1rem)]"},size:{default:"w-64",sm:"w-48",lg:"w-72"},collapsed:{true:"w-16",false:""}},defaultVariants:{variant:"default",size:"default",collapsed:!1}},sidebarItem:{defaultStyles:"flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",variantStyles:{variant:{default:"hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-transparent hover:text-foreground/80",active:"bg-accent text-accent-foreground"}},defaultVariants:{variant:"default"}},toggle:{defaultStyles:"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-primary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",variantStyles:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}},fK=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT:WM},Symbol.toStringTag,{value:"Module"})),to=E.createContext(null),hK=to.Consumer,pK=Object.freeze(Object.defineProperty({__proto__:null,TailwindThemeConsumer:hK,TailwindThemeContext:to,TailwindThemeProvider:e=>{const[t,n]=E.useState(WM),[r,o]=E.useState({tailwind:{},siteBackground:{}}),i=s=>{o(l=>({...l,tailwind:s}))},a=s=>{o(l=>({...l,siteBackground:s}))};return g.jsx(to.Provider,{value:{variants:t,setVariants:n,theme:r,setTheme:o,tailwind:(r==null?void 0:r.tailwind)??{},setTailwind:i,siteBackground:(r==null?void 0:r.siteBackground)??{},setSiteBackground:a},children:e.children})}},Symbol.toStringTag,{value:"Module"})),Bo=()=>{const e=E.useContext(to);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{variants:e.variants,setVariants:e.setVariants}},mK=()=>{const e=E.useContext(to);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{theme:e.theme,setTheme:e.setTheme}},gK=()=>{var n,r,o,i;const e=E.useContext(to);if(e===void 0)throw new Error("Invalid tailwind theme context.");const t=a=>{e.setTailwind({theme:{extend:{...e.tailwind.theme.extend,fontFamily:{custom:a}}}})};return{fontFamily:((i=(o=(r=(n=e.tailwind)==null?void 0:n.theme)==null?void 0:r.extend)==null?void 0:o.fontFamily)==null?void 0:i.custom)??null,setFontFamily:t}},wK=()=>{var n,r,o;const e=E.useContext(to);if(e===void 0)throw new Error("Invalid tailwind theme context.");const t=i=>{e.setTailwind({theme:{extend:{...e.tailwind.theme.extend,colors:i}}})};return{colors:((o=(r=(n=e.tailwind)==null?void 0:n.theme)==null?void 0:r.extend)==null?void 0:o.colors)??null,setColors:t}},Nw=()=>{const e=E.useContext(to);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{siteBackground:e.siteBackground,siteBackgroundColor:e.siteBackground.color,siteBackgroundImage:e.siteBackground.image,setSiteBackground:e.setSiteBackground}},vK=Object.freeze(Object.defineProperty({__proto__:null,useColors:wK,useFontFamily:gK,useSiteBackground:Nw,useTailwind:()=>{const e=E.useContext(to);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{tailwind:e.tailwind,setTailwind:e.setTailwind}},useTheme:mK,useVariants:Bo},Symbol.toStringTag,{value:"Module"})),GM=E.forwardRef(({className:e,variant:t,...n},r)=>{const{variants:o}=Bo(),i=E.useMemo(()=>kn(o.alert.defaultStyles,{variants:o.alert.variantStyles,defaultVariants:o.alert.defaultVariants}),[o]);return g.jsx("div",{ref:r,role:"alert",className:Q(i({variant:t}),e),...n})});GM.displayName="Alert";const qM=E.forwardRef(({className:e,...t},n)=>g.jsx("h5",{ref:n,className:Q("mb-1 font-medium leading-none tracking-tight",e),...t}));qM.displayName="AlertTitle";const YM=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("text-sm [&_p]:leading-relaxed",e),...t}));YM.displayName="AlertDescription";const yK=bW,bK=xW,xK=_W,KM=y.forwardRef(({className:e,...t},n)=>g.jsx(gC,{className:Q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));KM.displayName=gC.displayName;const XM=y.forwardRef(({className:e,...t},n)=>g.jsxs(xK,{children:[g.jsx(KM,{}),g.jsx(wC,{ref:n,className:Q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));XM.displayName=wC.displayName;const ZM=({className:e,...t})=>g.jsx("div",{className:Q("flex flex-col space-y-2 text-center sm:text-left",e),...t});ZM.displayName="AlertDialogHeader";const JM=({className:e,...t})=>g.jsx("div",{className:Q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});JM.displayName="AlertDialogFooter";const QM=y.forwardRef(({className:e,...t},n)=>g.jsx(bC,{ref:n,className:Q("text-lg font-semibold",e),...t}));QM.displayName=bC.displayName;const ek=y.forwardRef(({className:e,...t},n)=>g.jsx(xC,{ref:n,className:Q("text-sm text-foreground",e),...t}));ek.displayName=xC.displayName;const tk=y.forwardRef(({className:e,...t},n)=>g.jsx(vC,{ref:n,className:Q("inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground ring-offset-background transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));tk.displayName=vC.displayName;const nk=y.forwardRef(({className:e,...t},n)=>g.jsx(yC,{ref:n,className:Q("mt-2 inline-flex h-10 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-semibold ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 sm:mt-0",e),...t}));nk.displayName=yC.displayName;const _K=CW,rk=y.forwardRef(({className:e,...t},n)=>g.jsx(TC,{ref:n,className:Q("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));rk.displayName=TC.displayName;const ok=y.forwardRef(({className:e,...t},n)=>g.jsx(MC,{ref:n,className:Q("aspect-square h-full w-full",e),...t}));ok.displayName=MC.displayName;const ik=y.forwardRef(({className:e,...t},n)=>g.jsx(kC,{ref:n,className:Q("flex h-full w-full items-center justify-center rounded-full bg-primary",e),...t}));ik.displayName=kC.displayName;const SK=kn("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function CK({className:e,variant:t,...n}){const{variants:r}=Bo(),o=E.useMemo(()=>kn(r.badge.defaultStyles,{variants:r.badge.variantStyles,defaultVariants:r.badge.defaultVariants}),[r]);return g.jsx("div",{className:Q(o({variant:t}),e),...n})}const ak=y.forwardRef(({...e},t)=>g.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));ak.displayName="Breadcrumb";const sk=y.forwardRef(({className:e,...t},n)=>g.jsx("ol",{ref:n,className:Q("flex flex-wrap items-center gap-1.5 break-words text-sm text-foreground sm:gap-2.5",e),...t}));sk.displayName="BreadcrumbList";const lk=y.forwardRef(({className:e,...t},n)=>g.jsx("li",{ref:n,className:Q("inline-flex items-center gap-1.5",e),...t}));lk.displayName="BreadcrumbItem";const ck=y.forwardRef(({className:e,...t},n)=>g.jsx("a",{ref:n,className:Q("transition-colors hover:text-foreground hover:underline",e),...t}));ck.displayName="BreadcrumbLink";const uk=y.forwardRef(({className:e,...t},n)=>g.jsx("span",{ref:n,role:"link","aria-current":"page",className:Q("font-normal text-foreground",e),...t}));uk.displayName="BreadcrumbPage";const dk=({className:e,...t})=>g.jsx("li",{role:"presentation","aria-hidden":"true",className:Q("[&>svg]:size-3.5",e),...t,children:g.jsx(Lo,{})});dk.displayName="BreadcrumbSeparator";const EK=kn("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),rr=E.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const a=r?MV:"button",{variants:s}=Bo(),l=E.useMemo(()=>kn(s.button.defaultStyles,{variants:s.button.variantStyles,defaultVariants:s.button.defaultVariants}),[s]);return g.jsx(a,{className:Q(l({variant:t,size:n,className:e})),ref:i,...o})});rr.displayName="Button";function Ke(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 Dn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function on(e,t){const n=Ke(e);return isNaN(t)?Dn(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function or(e,t){const n=Ke(e);if(isNaN(t))return Dn(e,NaN);if(!t)return n;const r=n.getDate(),o=Dn(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const i=o.getDate();return r>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}const Tw=6048e5,PK=864e5;let RK={};function Gl(){return RK}function Or(e,t){var s,l,c,u;const n=Gl(),r=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Ke(e),i=o.getDay(),a=(i<r?7:0)+i-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function bi(e){return Or(e,{weekStartsOn:1})}function fk(e){const t=Ke(e),n=t.getFullYear(),r=Dn(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=bi(r),i=Dn(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const a=bi(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Ka(e){const t=Ke(e);return t.setHours(0,0,0,0),t}function ef(e){const t=Ke(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 jr(e,t){const n=Ka(e),r=Ka(t),o=+n-ef(n),i=+r-ef(r);return Math.round((o-i)/PK)}function NK(e){const t=fk(e),n=Dn(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),bi(n)}function Mw(e,t){const n=t*7;return on(e,n)}function TK(e,t){return or(e,t*12)}function MK(e){let t;return e.forEach(function(n){const r=Ke(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function kK(e){let t;return e.forEach(n=>{const r=Ke(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function gn(e,t){const n=Ka(e),r=Ka(t);return+n==+r}function kw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function DK(e){if(!kw(e)&&typeof e!="number")return!1;const t=Ke(e);return!isNaN(Number(t))}function ql(e,t){const n=Ke(e),r=Ke(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function AK(e,t,n){const r=Or(e,n),o=Or(t,n),i=+r-ef(r),a=+o-ef(o);return Math.round((i-a)/Tw)}function Dw(e){const t=Ke(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function wn(e){const t=Ke(e);return t.setDate(1),t.setHours(0,0,0,0),t}function hk(e){const t=Ke(e),n=Dn(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Aw(e,t){var s,l,c,u;const n=Gl(),r=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Ke(e),i=o.getDay(),a=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+a),o.setHours(23,59,59,999),o}function pk(e){return Aw(e,{weekStartsOn:1})}const IK={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"}},OK=(e,t,n)=>{let r;const o=IK[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 Iw(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const jK={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},$K={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},FK={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},LK={date:Iw({formats:jK,defaultWidth:"full"}),time:Iw({formats:$K,defaultWidth:"full"}),dateTime:Iw({formats:FK,defaultWidth:"full"})},zK={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},BK=(e,t,n,r)=>zK[e];function Yl(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):a;o=e.formattingValues[s]||e.formattingValues[a]}else{const a=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[s]||e.values[a]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const HK={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},VK={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},UK={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"]},WK={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"]},GK={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"}},qK={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"}},YK={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:Yl({values:HK,defaultWidth:"wide"}),quarter:Yl({values:VK,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yl({values:UK,defaultWidth:"wide"}),day:Yl({values:WK,defaultWidth:"wide"}),dayPeriod:Yl({values:GK,defaultWidth:"wide",formattingValues:qK,defaultFormattingWidth:"wide"})};function Kl(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const a=i[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?XK(s,d=>d.test(a)):KK(s,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function KK(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function XK(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function ZK(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let a=e.valueCallback?e.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const s=t.slice(o.length);return{value:a,rest:s}}}const JK=/^(\d+)(th|st|nd|rd)?/i,QK=/\d+/i,eX={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},tX={any:[/^b/i,/^(a|c)/i]},nX={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},rX={any:[/1/i,/2/i,/3/i,/4/i]},oX={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},iX={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]},aX={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},sX={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]},lX={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},cX={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}},uX={ordinalNumber:ZK({matchPattern:JK,parsePattern:QK,valueCallback:e=>parseInt(e,10)}),era:Kl({matchPatterns:eX,defaultMatchWidth:"wide",parsePatterns:tX,defaultParseWidth:"any"}),quarter:Kl({matchPatterns:nX,defaultMatchWidth:"wide",parsePatterns:rX,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Kl({matchPatterns:oX,defaultMatchWidth:"wide",parsePatterns:iX,defaultParseWidth:"any"}),day:Kl({matchPatterns:aX,defaultMatchWidth:"wide",parsePatterns:sX,defaultParseWidth:"any"}),dayPeriod:Kl({matchPatterns:lX,defaultMatchWidth:"any",parsePatterns:cX,defaultParseWidth:"any"})},mk={code:"en-US",formatDistance:OK,formatLong:LK,formatRelative:BK,localize:YK,match:uX,options:{weekStartsOn:0,firstWeekContainsDate:1}};function dX(e){const t=Ke(e);return jr(t,hk(t))+1}function gk(e){const t=Ke(e),n=+bi(t)-+NK(t);return Math.round(n/Tw)+1}function wk(e,t){var u,d,f,h;const n=Ke(e),r=n.getFullYear(),o=Gl(),i=(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,a=Dn(e,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const s=Or(a,t),l=Dn(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=Or(l,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function fX(e,t){var s,l,c,u;const n=Gl(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,o=wk(e,t),i=Dn(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Or(i,t)}function vk(e,t){const n=Ke(e),r=+Or(n,t)-+fX(n,t);return Math.round(r/Tw)+1}function it(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ho={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return it(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):it(n+1,2)},d(e,t){return it(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 it(e.getHours()%12||12,t.length)},H(e,t){return it(e.getHours(),t.length)},m(e,t){return it(e.getMinutes(),t.length)},s(e,t){return it(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return it(o,t.length)}},Xa={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},yk={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 Ho.y(e,t)},Y:function(e,t,n,r){const o=wk(e,r),i=o>0?o:1-o;if(t==="YY"){const a=i%100;return it(a,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):it(i,t.length)},R:function(e,t){const n=fk(e);return it(n,t.length)},u:function(e,t){const n=e.getFullYear();return it(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 it(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 it(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 Ho.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 it(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=vk(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):it(o,t.length)},I:function(e,t,n){const r=gk(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):it(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ho.d(e,t)},D:function(e,t,n){const r=dX(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):it(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(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return it(i,2);case"eo":return n.ordinalNumber(i,{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(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return it(i,t.length);case"co":return n.ordinalNumber(i,{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 it(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=Xa.noon:r===0?o=Xa.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=Xa.evening:r>=12?o=Xa.afternoon:r>=4?o=Xa.morning:o=Xa.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 Ho.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ho.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):it(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):it(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ho.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ho.s(e,t)},S:function(e,t){return Ho.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return xk(r);case"XXXX":case"XX":return xi(r);case"XXXXX":case"XXX":default:return xi(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return xk(r);case"xxxx":case"xx":return xi(r);case"xxxxx":case"xxx":default:return xi(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+bk(r,":");case"OOOO":default:return"GMT"+xi(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+bk(r,":");case"zzzz":default:return"GMT"+xi(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return it(r,t.length)},T:function(e,t,n){const r=e.getTime();return it(r,t.length)}};function bk(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+it(i,2)}function xk(e,t){return e%60===0?(e>0?"-":"+")+it(Math.abs(e)/60,2):xi(e,t)}function xi(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=it(Math.trunc(r/60),2),i=it(r%60,2);return n+o+t+i}const _k=(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"})}},Sk=(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"})}},hX={p:Sk,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return _k(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",_k(r,t)).replace("{{time}}",Sk(o,t))}},pX=/^D+$/,mX=/^Y+$/,gX=["D","DD","YY","YYYY"];function wX(e){return pX.test(e)}function vX(e){return mX.test(e)}function yX(e,t,n){const r=bX(e,t,n);if(console.warn(r),gX.includes(e))throw new RangeError(r)}function bX(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 xX=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_X=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,SX=/^'([^]*?)'?$/,CX=/''/g,EX=/[a-zA-Z]/;function $r(e,t,n){var u,d,f,h,p,m,v,w;const r=Gl(),o=(n==null?void 0:n.locale)??r.locale??mk,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((m=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((w=(v=r.locale)==null?void 0:v.options)==null?void 0:w.weekStartsOn)??0,s=Ke(e);if(!DK(s))throw new RangeError("Invalid time value");let l=t.match(_X).map(b=>{const x=b[0];if(x==="p"||x==="P"){const _=hX[x];return _(b,o.formatLong)}return b}).join("").match(xX).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const x=b[0];if(x==="'")return{isToken:!1,value:PX(b)};if(yk[x])return{isToken:!0,value:b};if(x.match(EX))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:b}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const c={firstWeekContainsDate:i,weekStartsOn:a,locale:o};return l.map(b=>{if(!b.isToken)return b.value;const x=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&vX(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&wX(x))&&yX(x,t,String(e));const _=yk[x[0]];return _(s,x,o.localize,c)}).join("")}function PX(e){const t=e.match(SX);return t?t[1].replace(CX,"'"):e}function RX(e){const t=Ke(e),n=t.getFullYear(),r=t.getMonth(),o=Dn(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function NX(e){return Math.trunc(+Ke(e)/1e3)}function TX(e){const t=Ke(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function MX(e,t){return AK(TX(e),wn(e),t)+1}function Ow(e,t){const n=Ke(e),r=Ke(t);return n.getTime()>r.getTime()}function Ck(e,t){const n=Ke(e),r=Ke(t);return+n<+r}function jw(e,t){const n=Ke(e),r=Ke(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function kX(e,t){const n=Ke(e),r=Ke(t);return n.getFullYear()===r.getFullYear()}function $w(e,t){return on(e,-t)}function Fw(e,t){const n=Ke(e),r=n.getFullYear(),o=n.getDate(),i=Dn(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const a=RX(i);return n.setMonth(t,Math.min(o,a)),n}function Ek(e,t){const n=Ke(e);return isNaN(+n)?Dn(e,NaN):(n.setFullYear(t),n)}var Ae=function(){return Ae=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ae.apply(this,arguments)};function DX(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 Pk(e,t,n){for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function Xl(e){return e.mode==="multiple"}function Zl(e){return e.mode==="range"}function tf(e){return e.mode==="single"}var AX={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function IX(e,t){return $r(e,"LLLL y",t)}function OX(e,t){return $r(e,"d",t)}function jX(e,t){return $r(e,"LLLL",t)}function $X(e){return"".concat(e)}function FX(e,t){return $r(e,"cccccc",t)}function LX(e,t){return $r(e,"yyyy",t)}var zX=Object.freeze({__proto__:null,formatCaption:IX,formatDay:OX,formatMonthCaption:jX,formatWeekNumber:$X,formatWeekdayName:FX,formatYearCaption:LX}),BX=function(e,t,n){return $r(e,"do MMMM (EEEE)",n)},HX=function(){return"Month: "},VX=function(){return"Go to next month"},UX=function(){return"Go to previous month"},WX=function(e,t){return $r(e,"cccc",t)},GX=function(e){return"Week n. ".concat(e)},qX=function(){return"Year: "},YX=Object.freeze({__proto__:null,labelDay:BX,labelMonthDropdown:HX,labelNext:VX,labelPrevious:UX,labelWeekNumber:GX,labelWeekday:WX,labelYearDropdown:qX});function KX(){var e="buttons",t=AX,n=mk,r={},o={},i=1,a={},s=new Date;return{captionLayout:e,classNames:t,formatters:zX,labels:YX,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:a,today:s,mode:"default"}}function XX(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,a=e.toDate;return r?i=wn(r):t&&(i=new Date(t,0,1)),o?a=Dw(o):n&&(a=new Date(n,11,31)),{fromDate:i?Ka(i):void 0,toDate:a?Ka(a):void 0}}var Rk=E.createContext(void 0);function ZX(e){var t,n=e.initialProps,r=KX(),o=XX(n),i=o.fromDate,a=o.toDate,s=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;s!=="buttons"&&(!i||!a)&&(s="buttons");var l;(tf(n)||Xl(n)||Zl(n))&&(l=n.onSelect);var c=Ae(Ae(Ae({},r),n),{captionLayout:s,classNames:Ae(Ae({},r.classNames),n.classNames),components:Ae({},n.components),formatters:Ae(Ae({},r.formatters),n.formatters),fromDate:i,labels:Ae(Ae({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Ae(Ae({},r.modifiers),n.modifiers),modifiersClassNames:Ae(Ae({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Ae(Ae({},r.styles),n.styles),toDate:a});return g.jsx(Rk.Provider,{value:c,children:e.children})}function ut(){var e=E.useContext(Rk);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function Nk(e){var t=ut(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return g.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function JX(e){return g.jsx("svg",Ae({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:g.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Tk(e){var t,n,r=e.onChange,o=e.value,i=e.children,a=e.caption,s=e.className,l=e.style,c=ut(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:JX;return g.jsxs("div",{className:s,style:l,children:[g.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),g.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),g.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[a,g.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function QX(e){var t,n=ut(),r=n.fromDate,o=n.toDate,i=n.styles,a=n.locale,s=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return g.jsx(g.Fragment,{});if(!o)return g.jsx(g.Fragment,{});var d=[];if(kX(r,o))for(var f=wn(r),h=r.getMonth();h<=o.getMonth();h++)d.push(Fw(f,h));else for(var f=wn(new Date),h=0;h<=11;h++)d.push(Fw(f,h));var p=function(v){var w=Number(v.target.value),b=Fw(wn(e.displayMonth),w);e.onChange(b)},m=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:Tk;return g.jsx(m,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:p,value:e.displayMonth.getMonth(),caption:s(e.displayMonth,{locale:a}),children:d.map(function(v){return g.jsx("option",{value:v.getMonth(),children:s(v,{locale:a})},v.getMonth())})})}function eZ(e){var t,n=e.displayMonth,r=ut(),o=r.fromDate,i=r.toDate,a=r.locale,s=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,f=[];if(!o)return g.jsx(g.Fragment,{});if(!i)return g.jsx(g.Fragment,{});for(var h=o.getFullYear(),p=i.getFullYear(),m=h;m<=p;m++)f.push(Ek(hk(new Date),m));var v=function(b){var x=Ek(wn(n),Number(b.target.value));e.onChange(x)},w=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:Tk;return g.jsx(w,{name:"years","aria-label":d(),className:l.dropdown_year,style:s.dropdown_year,onChange:v,value:n.getFullYear(),caption:u(n,{locale:a}),children:f.map(function(b){return g.jsx("option",{value:b.getFullYear(),children:u(b,{locale:a})},b.getFullYear())})})}function tZ(e,t){var n=E.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function nZ(e){var t=e.month,n=e.defaultMonth,r=e.today,o=t||n||r||new Date,i=e.toDate,a=e.fromDate,s=e.numberOfMonths,l=s===void 0?1:s;if(i&&ql(i,o)<0){var c=-1*(l-1);o=or(i,c)}return a&&ql(o,a)<0&&(o=a),wn(o)}function rZ(){var e=ut(),t=nZ(e),n=tZ(t,e.month),r=n[0],o=n[1],i=function(a){var s;if(!e.disableNavigation){var l=wn(a);o(l),(s=e.onMonthChange)===null||s===void 0||s.call(e,l)}};return[r,i]}function oZ(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=wn(e),i=wn(or(o,r)),a=ql(i,o),s=[],l=0;l<a;l++){var c=or(o,l);s.push(c)}return n&&(s=s.reverse()),s}function iZ(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,a=r?i:1,s=wn(e);if(!n)return or(s,a);var l=ql(n,e);if(!(l<i))return or(s,a)}}function aZ(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,a=r?i:1,s=wn(e);if(!n)return or(s,-a);var l=ql(s,n);if(!(l<=0))return or(s,-a)}}var Mk=E.createContext(void 0);function sZ(e){var t=ut(),n=rZ(),r=n[0],o=n[1],i=oZ(r,t),a=iZ(r,t),s=aZ(r,t),l=function(d){return i.some(function(f){return jw(d,f)})},c=function(d,f){l(d)||(f&&Ck(d,f)?o(or(d,1+t.numberOfMonths*-1)):o(d))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:s,nextMonth:a,isDateDisplayed:l};return g.jsx(Mk.Provider,{value:u,children:e.children})}function Jl(){var e=E.useContext(Mk);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function kk(e){var t,n=ut(),r=n.classNames,o=n.styles,i=n.components,a=Jl().goToMonth,s=function(u){a(or(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:Nk,c=g.jsx(l,{id:e.id,displayMonth:e.displayMonth});return g.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[g.jsx("div",{className:r.vhidden,children:c}),g.jsx(QX,{onChange:s,displayMonth:e.displayMonth}),g.jsx(eZ,{onChange:s,displayMonth:e.displayMonth})]})}function lZ(e){return g.jsx("svg",Ae({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:g.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function cZ(e){return g.jsx("svg",Ae({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:g.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var nf=E.forwardRef(function(e,t){var n=ut(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var a=i.join(" "),s=Ae(Ae({},o.button_reset),o.button);return e.style&&Object.assign(s,e.style),g.jsx("button",Ae({},e,{ref:t,type:"button",className:a,style:s}))});function uZ(e){var t,n,r=ut(),o=r.dir,i=r.locale,a=r.classNames,s=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return g.jsx(g.Fragment,{});var f=c(e.previousMonth,{locale:i}),h=[a.nav_button,a.nav_button_previous].join(" "),p=u(e.nextMonth,{locale:i}),m=[a.nav_button,a.nav_button_next].join(" "),v=(t=d==null?void 0:d.IconRight)!==null&&t!==void 0?t:cZ,w=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:lZ;return g.jsxs("div",{className:a.nav,style:s.nav,children:[!e.hidePrevious&&g.jsx(nf,{name:"previous-month","aria-label":f,className:h,style:s.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?g.jsx(v,{className:a.nav_icon,style:s.nav_icon}):g.jsx(w,{className:a.nav_icon,style:s.nav_icon})}),!e.hideNext&&g.jsx(nf,{name:"next-month","aria-label":p,className:m,style:s.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?g.jsx(w,{className:a.nav_icon,style:s.nav_icon}):g.jsx(v,{className:a.nav_icon,style:s.nav_icon})})]})}function Dk(e){var t=ut().numberOfMonths,n=Jl(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,a=n.displayMonths,s=a.findIndex(function(p){return jw(e.displayMonth,p)}),l=s===0,c=s===a.length-1,u=t>1&&(l||!c),d=t>1&&(c||!l),f=function(){r&&i(r)},h=function(){o&&i(o)};return g.jsx(uZ,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:o,previousMonth:r,onPreviousClick:f,onNextClick:h})}function dZ(e){var t,n=ut(),r=n.classNames,o=n.disableNavigation,i=n.styles,a=n.captionLayout,s=n.components,l=(t=s==null?void 0:s.CaptionLabel)!==null&&t!==void 0?t:Nk,c;return o?c=g.jsx(l,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?c=g.jsx(kk,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?c=g.jsxs(g.Fragment,{children:[g.jsx(kk,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),g.jsx(Dk,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=g.jsxs(g.Fragment,{children:[g.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),g.jsx(Dk,{displayMonth:e.displayMonth,id:e.id})]}),g.jsx("div",{className:r.caption,style:i.caption,children:c})}function fZ(e){var t=ut(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?g.jsx("tfoot",{className:o,style:r.tfoot,children:g.jsx("tr",{children:g.jsx("td",{colSpan:8,children:n})})}):g.jsx(g.Fragment,{})}function hZ(e,t,n){for(var r=n?bi(new Date):Or(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var a=on(r,i);o.push(a)}return o}function pZ(){var e=ut(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,i=e.weekStartsOn,a=e.ISOWeek,s=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=hZ(o,i,a);return g.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&g.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,d){return g.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:o}),children:s(u,{locale:o})},d)})]})}function mZ(){var e,t=ut(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:pZ;return g.jsx("thead",{style:r.head,className:n.head,children:g.jsx(i,{})})}function gZ(e){var t=ut(),n=t.locale,r=t.formatters.formatDay;return g.jsx(g.Fragment,{children:r(e.date,{locale:n})})}var Lw=E.createContext(void 0);function wZ(e){if(!Xl(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return g.jsx(Lw.Provider,{value:t,children:e.children})}return g.jsx(vZ,{initialProps:e.initialProps,children:e.children})}function vZ(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,a=function(c,u,d){var f,h;(f=t.onDayClick)===null||f===void 0||f.call(t,c,u,d);var p=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!p){var m=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!m){var v=r?Pk([],r):[];if(u.selected){var w=v.findIndex(function(b){return gn(c,b)});v.splice(w,1)}else v.push(c);(h=t.onSelect)===null||h===void 0||h.call(t,v,c,u,d)}}},s={disabled:[]};r&&s.disabled.push(function(c){var u=i&&r.length>i-1,d=r.some(function(f){return gn(f,c)});return!!(u&&!d)});var l={selected:r,onDayClick:a,modifiers:s};return g.jsx(Lw.Provider,{value:l,children:n})}function zw(){var e=E.useContext(Lw);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function yZ(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?gn(o,e)&&gn(r,e)?void 0:gn(o,e)?{from:o,to:void 0}:gn(r,e)?void 0:Ow(r,e)?{from:e,to:o}:{from:r,to:e}:o?Ow(e,o)?{from:o,to:e}:{from:e,to:o}:r?Ck(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var Bw=E.createContext(void 0);function bZ(e){if(!Zl(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return g.jsx(Bw.Provider,{value:t,children:e.children})}return g.jsx(xZ,{initialProps:e.initialProps,children:e.children})}function xZ(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},i=o.from,a=o.to,s=t.min,l=t.max,c=function(h,p,m){var v,w;(v=t.onDayClick)===null||v===void 0||v.call(t,h,p,m);var b=yZ(h,r);(w=t.onSelect)===null||w===void 0||w.call(t,b,h,p,m)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],a?(u.range_end=[a],gn(i,a)||(u.range_middle=[{after:i,before:a}])):u.range_end=[i]):a&&(u.range_start=[a],u.range_end=[a]),s&&(i&&!a&&u.disabled.push({after:$w(i,s-1),before:on(i,s-1)}),i&&a&&u.disabled.push({after:i,before:on(i,s-1)}),!i&&a&&u.disabled.push({after:$w(a,s-1),before:on(a,s-1)})),l){if(i&&!a&&(u.disabled.push({before:on(i,-l+1)}),u.disabled.push({after:on(i,l-1)})),i&&a){var d=jr(a,i)+1,f=l-d;u.disabled.push({before:$w(i,f)}),u.disabled.push({after:on(a,f)})}!i&&a&&(u.disabled.push({before:on(a,-l+1)}),u.disabled.push({after:on(a,l-1)}))}return g.jsx(Bw.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function Hw(){var e=E.useContext(Bw);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function rf(e){return Array.isArray(e)?Pk([],e):e!==void 0?[e]:[]}function _Z(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=rf(o)}),t}var ir;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(ir||(ir={}));var SZ=ir.Selected,no=ir.Disabled,CZ=ir.Hidden,EZ=ir.Today,Vw=ir.RangeEnd,Uw=ir.RangeMiddle,Ww=ir.RangeStart,PZ=ir.Outside;function RZ(e,t,n){var r,o=(r={},r[SZ]=rf(e.selected),r[no]=rf(e.disabled),r[CZ]=rf(e.hidden),r[EZ]=[e.today],r[Vw]=[],r[Uw]=[],r[Ww]=[],r[PZ]=[],r);return e.fromDate&&o[no].push({before:e.fromDate}),e.toDate&&o[no].push({after:e.toDate}),Xl(e)?o[no]=o[no].concat(t.modifiers[no]):Zl(e)&&(o[no]=o[no].concat(n.modifiers[no]),o[Ww]=n.modifiers[Ww],o[Uw]=n.modifiers[Uw],o[Vw]=n.modifiers[Vw]),o}var Ak=E.createContext(void 0);function NZ(e){var t=ut(),n=zw(),r=Hw(),o=RZ(t,n,r),i=_Z(t.modifiers),a=Ae(Ae({},o),i);return g.jsx(Ak.Provider,{value:a,children:e.children})}function Ik(){var e=E.useContext(Ak);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function TZ(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function MZ(e){return!!(e&&typeof e=="object"&&"from"in e)}function kZ(e){return!!(e&&typeof e=="object"&&"after"in e)}function DZ(e){return!!(e&&typeof e=="object"&&"before"in e)}function AZ(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function IZ(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=jr(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var a=jr(e,r)>=0&&jr(o,e)>=0;return a}return o?gn(o,e):r?gn(r,e):!1}function OZ(e){return kw(e)}function jZ(e){return Array.isArray(e)&&e.every(kw)}function $Z(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(OZ(n))return gn(e,n);if(jZ(n))return n.includes(e);if(MZ(n))return IZ(e,n);if(AZ(n))return n.dayOfWeek.includes(e.getDay());if(TZ(n)){var r=jr(n.before,e),o=jr(n.after,e),i=r>0,a=o<0,s=Ow(n.before,n.after);return s?a&&i:i||a}return kZ(n)?jr(e,n.after)>0:DZ(n)?jr(n.before,e)>0:typeof n=="function"?n(e):!1})}function Gw(e,t,n){var r=Object.keys(t).reduce(function(i,a){var s=t[a];return $Z(e,s)&&i.push(a),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!jw(e,n)&&(o.outside=!0),o}function FZ(e,t){for(var n=wn(e[0]),r=Dw(e[e.length-1]),o,i,a=n;a<=r;){var s=Gw(a,t),l=!s.disabled&&!s.hidden;if(!l){a=on(a,1);continue}if(s.selected)return a;s.today&&!i&&(i=a),o||(o=a),a=on(a,1)}return i||o}var LZ=365;function Ok(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,a=t.retry,s=a===void 0?{count:0,lastFocused:e}:a,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,f={day:on,week:Mw,month:or,year:TK,startOfWeek:function(v){return o.ISOWeek?bi(v):Or(v,{locale:d,weekStartsOn:l})},endOfWeek:function(v){return o.ISOWeek?pk(v):Aw(v,{locale:d,weekStartsOn:l})}},h=f[n](e,r==="after"?1:-1);r==="before"&&c?h=MK([c,h]):r==="after"&&u&&(h=kK([u,h]));var p=!0;if(i){var m=Gw(h,i);p=!m.disabled&&!m.hidden}return p?h:s.count>LZ?s.lastFocused:Ok(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:Ae(Ae({},s),{count:s.count+1})})}var jk=E.createContext(void 0);function zZ(e){var t=Jl(),n=Ik(),r=E.useState(),o=r[0],i=r[1],a=E.useState(),s=a[0],l=a[1],c=FZ(t.displayMonths,n),u=o??(s&&t.isDateDisplayed(s))?s:c,d=function(){l(o),i(void 0)},f=function(v){i(v)},h=ut(),p=function(v,w){if(o){var b=Ok(o,{moveBy:v,direction:w,context:h,modifiers:n});gn(o,b)||(t.goToDate(b,o),f(b))}},m={focusedDay:o,focusTarget:u,blur:d,focus:f,focusDayAfter:function(){return p("day","after")},focusDayBefore:function(){return p("day","before")},focusWeekAfter:function(){return p("week","after")},focusWeekBefore:function(){return p("week","before")},focusMonthBefore:function(){return p("month","before")},focusMonthAfter:function(){return p("month","after")},focusYearBefore:function(){return p("year","before")},focusYearAfter:function(){return p("year","after")},focusStartOfWeek:function(){return p("startOfWeek","before")},focusEndOfWeek:function(){return p("endOfWeek","after")}};return g.jsx(jk.Provider,{value:m,children:e.children})}function qw(){var e=E.useContext(jk);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function BZ(e,t){var n=Ik(),r=Gw(e,n,t);return r}var Yw=E.createContext(void 0);function HZ(e){if(!tf(e.initialProps)){var t={selected:void 0};return g.jsx(Yw.Provider,{value:t,children:e.children})}return g.jsx(VZ,{initialProps:e.initialProps,children:e.children})}function VZ(e){var t=e.initialProps,n=e.children,r=function(i,a,s){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,a,s),a.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,i,a,s);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,a,s)},o={selected:t.selected,onDayClick:r};return g.jsx(Yw.Provider,{value:o,children:n})}function $k(){var e=E.useContext(Yw);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function UZ(e,t){var n=ut(),r=$k(),o=zw(),i=Hw(),a=qw(),s=a.focusDayAfter,l=a.focusDayBefore,c=a.focusWeekAfter,u=a.focusWeekBefore,d=a.blur,f=a.focus,h=a.focusMonthBefore,p=a.focusMonthAfter,m=a.focusYearBefore,v=a.focusYearAfter,w=a.focusStartOfWeek,b=a.focusEndOfWeek,x=function(Z){var B,oe,ee,ne;tf(n)?(B=r.onDayClick)===null||B===void 0||B.call(r,e,t,Z):Xl(n)?(oe=o.onDayClick)===null||oe===void 0||oe.call(o,e,t,Z):Zl(n)?(ee=i.onDayClick)===null||ee===void 0||ee.call(i,e,t,Z):(ne=n.onDayClick)===null||ne===void 0||ne.call(n,e,t,Z)},_=function(Z){var B;f(e),(B=n.onDayFocus)===null||B===void 0||B.call(n,e,t,Z)},C=function(Z){var B;d(),(B=n.onDayBlur)===null||B===void 0||B.call(n,e,t,Z)},N=function(Z){var B;(B=n.onDayMouseEnter)===null||B===void 0||B.call(n,e,t,Z)},R=function(Z){var B;(B=n.onDayMouseLeave)===null||B===void 0||B.call(n,e,t,Z)},T=function(Z){var B;(B=n.onDayPointerEnter)===null||B===void 0||B.call(n,e,t,Z)},M=function(Z){var B;(B=n.onDayPointerLeave)===null||B===void 0||B.call(n,e,t,Z)},D=function(Z){var B;(B=n.onDayTouchCancel)===null||B===void 0||B.call(n,e,t,Z)},A=function(Z){var B;(B=n.onDayTouchEnd)===null||B===void 0||B.call(n,e,t,Z)},j=function(Z){var B;(B=n.onDayTouchMove)===null||B===void 0||B.call(n,e,t,Z)},$=function(Z){var B;(B=n.onDayTouchStart)===null||B===void 0||B.call(n,e,t,Z)},W=function(Z){var B;(B=n.onDayKeyUp)===null||B===void 0||B.call(n,e,t,Z)},re=function(Z){var B;switch(Z.key){case"ArrowLeft":Z.preventDefault(),Z.stopPropagation(),n.dir==="rtl"?s():l();break;case"ArrowRight":Z.preventDefault(),Z.stopPropagation(),n.dir==="rtl"?l():s();break;case"ArrowDown":Z.preventDefault(),Z.stopPropagation(),c();break;case"ArrowUp":Z.preventDefault(),Z.stopPropagation(),u();break;case"PageUp":Z.preventDefault(),Z.stopPropagation(),Z.shiftKey?m():h();break;case"PageDown":Z.preventDefault(),Z.stopPropagation(),Z.shiftKey?v():p();break;case"Home":Z.preventDefault(),Z.stopPropagation(),w();break;case"End":Z.preventDefault(),Z.stopPropagation(),b();break}(B=n.onDayKeyDown)===null||B===void 0||B.call(n,e,t,Z)},Y={onClick:x,onFocus:_,onBlur:C,onKeyDown:re,onKeyUp:W,onMouseEnter:N,onMouseLeave:R,onPointerEnter:T,onPointerLeave:M,onTouchCancel:D,onTouchEnd:A,onTouchMove:j,onTouchStart:$};return Y}function WZ(){var e=ut(),t=$k(),n=zw(),r=Hw(),o=tf(e)?t.selected:Xl(e)?n.selected:Zl(e)?r.selected:void 0;return o}function GZ(e){return Object.values(ir).includes(e)}function qZ(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var o=e.modifiersClassNames[r];if(o)n.push(o);else if(GZ(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function YZ(e,t){var n=Ae({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=Ae(Ae({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function KZ(e,t,n){var r,o,i,a=ut(),s=qw(),l=BZ(e,t),c=UZ(e,l),u=WZ(),d=!!(a.onDayClick||a.mode!=="default");E.useEffect(function(){var N;l.outside||s.focusedDay&&d&&gn(s.focusedDay,e)&&((N=n.current)===null||N===void 0||N.focus())},[s.focusedDay,e,n,d,l.outside]);var f=qZ(a,l).join(" "),h=YZ(a,l),p=!!(l.outside&&!a.showOutsideDays||l.hidden),m=(i=(o=a.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:gZ,v=g.jsx(m,{date:e,displayMonth:t,activeModifiers:l}),w={style:h,className:f,children:v,role:"gridcell"},b=s.focusTarget&&gn(s.focusTarget,e)&&!l.outside,x=s.focusedDay&&gn(s.focusedDay,e),_=Ae(Ae(Ae({},w),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=x||b?0:-1,r)),c),C={isButton:d,isHidden:p,activeModifiers:l,selectedDays:u,buttonProps:_,divProps:w};return C}function XZ(e){var t=E.useRef(null),n=KZ(e.date,e.displayMonth,t);return n.isHidden?g.jsx("div",{role:"gridcell"}):n.isButton?g.jsx(nf,Ae({name:"day",ref:t},n.buttonProps)):g.jsx("div",Ae({},n.divProps))}function ZZ(e){var t=e.number,n=e.dates,r=ut(),o=r.onWeekNumberClick,i=r.styles,a=r.classNames,s=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:s});if(!o)return g.jsx("span",{className:a.weeknumber,style:i.weeknumber,children:u});var d=l(Number(t),{locale:s}),f=function(h){o(t,n,h)};return g.jsx(nf,{name:"week-number","aria-label":d,className:a.weeknumber,style:i.weeknumber,onClick:f,children:u})}function JZ(e){var t,n,r=ut(),o=r.styles,i=r.classNames,a=r.showWeekNumber,s=r.components,l=(t=s==null?void 0:s.Day)!==null&&t!==void 0?t:XZ,c=(n=s==null?void 0:s.WeekNumber)!==null&&n!==void 0?n:ZZ,u;return a&&(u=g.jsx("td",{className:i.cell,style:o.cell,children:g.jsx(c,{number:e.weekNumber,dates:e.dates})})),g.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(d){return g.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:g.jsx(l,{displayMonth:e.displayMonth,date:d})},NX(d))})]})}function Fk(e,t,n){for(var r=n!=null&&n.ISOWeek?pk(t):Aw(t,n),o=n!=null&&n.ISOWeek?bi(e):Or(e,n),i=jr(r,o),a=[],s=0;s<=i;s++)a.push(on(o,s));var l=a.reduce(function(c,u){var d=n!=null&&n.ISOWeek?gk(u):vk(u,n),f=c.find(function(h){return h.weekNumber===d});return f?(f.dates.push(u),c):(c.push({weekNumber:d,dates:[u]}),c)},[]);return l}function QZ(e,t){var n=Fk(wn(e),Dw(e),t);if(t!=null&&t.useFixedWeeks){var r=MX(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],a=Mw(i,6-r),s=Fk(Mw(i,1),a,t);n.push.apply(n,s)}}return n}function eJ(e){var t,n,r,o=ut(),i=o.locale,a=o.classNames,s=o.styles,l=o.hideHead,c=o.fixedWeeks,u=o.components,d=o.weekStartsOn,f=o.firstWeekContainsDate,h=o.ISOWeek,p=QZ(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:h,locale:i,weekStartsOn:d,firstWeekContainsDate:f}),m=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:mZ,v=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:JZ,w=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:fZ;return g.jsxs("table",{id:e.id,className:a.table,style:s.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&g.jsx(m,{}),g.jsx("tbody",{className:a.tbody,style:s.tbody,children:p.map(function(b){return g.jsx(v,{displayMonth:e.displayMonth,dates:b.dates,weekNumber:b.weekNumber},b.weekNumber)})}),g.jsx(w,{displayMonth:e.displayMonth})]})}function tJ(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var nJ=tJ()?E.useLayoutEffect:E.useEffect,Kw=!1,rJ=0;function Lk(){return"react-day-picker-".concat(++rJ)}function oJ(e){var t,n=e??(Kw?Lk():null),r=E.useState(n),o=r[0],i=r[1];return nJ(function(){o===null&&i(Lk())},[]),E.useEffect(function(){Kw===!1&&(Kw=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function iJ(e){var t,n,r=ut(),o=r.dir,i=r.classNames,a=r.styles,s=r.components,l=Jl().displayMonths,c=oJ(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,d=[i.month],f=a.month,h=e.displayIndex===0,p=e.displayIndex===l.length-1,m=!h&&!p;o==="rtl"&&(t=[h,p],p=t[0],h=t[1]),h&&(d.push(i.caption_start),f=Ae(Ae({},f),a.caption_start)),p&&(d.push(i.caption_end),f=Ae(Ae({},f),a.caption_end)),m&&(d.push(i.caption_between),f=Ae(Ae({},f),a.caption_between));var v=(n=s==null?void 0:s.Caption)!==null&&n!==void 0?n:dZ;return g.jsxs("div",{className:d.join(" "),style:f,children:[g.jsx(v,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),g.jsx(eJ,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function aJ(e){var t=ut(),n=t.classNames,r=t.styles;return g.jsx("div",{className:n.months,style:r.months,children:e.children})}function sJ(e){var t,n,r=e.initialProps,o=ut(),i=qw(),a=Jl(),s=E.useState(!1),l=s[0],c=s[1];E.useEffect(function(){o.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),c(!0)))},[o.initialFocus,l,i.focus,i.focusTarget,i]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var d=Ae(Ae({},o.styles.root),o.style),f=Object.keys(r).filter(function(p){return p.startsWith("data-")}).reduce(function(p,m){var v;return Ae(Ae({},p),(v={},v[m]=r[m],v))},{}),h=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:aJ;return g.jsx("div",Ae({className:u.join(" "),style:d,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},f,{children:g.jsx(h,{children:a.displayMonths.map(function(p,m){return g.jsx(iJ,{displayIndex:m,displayMonth:p},m)})})}))}function lJ(e){var t=e.children,n=DX(e,["children"]);return g.jsx(ZX,{initialProps:n,children:g.jsx(sZ,{children:g.jsx(HZ,{initialProps:n,children:g.jsx(wZ,{initialProps:n,children:g.jsx(bZ,{initialProps:n,children:g.jsx(NZ,{children:g.jsx(zZ,{children:t})})})})})})})}function cJ(e){return g.jsx(lJ,Ae({},e,{children:g.jsx(sJ,{initialProps:e})}))}function of({className:e,classNames:t,showOutsideDays:n=!0,...r}){const{variants:o}=Bo(),i=E.useMemo(()=>kn(o.button.defaultStyles,{variants:o.button.variantStyles,defaultVariants:o.button.defaultVariants}),[o]);return g.jsx(cJ,{showOutsideDays:n,className:Q("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Q(i({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:Q(i({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-foreground aria-selected:opacity-30",day_disabled:"text-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:()=>g.jsx(Zd,{className:"h-4 w-4"}),IconRight:()=>g.jsx(Lo,{className:"h-4 w-4"})},...r})}of.displayName="Calendar";const zk=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));zk.displayName="Card";const Bk=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("flex flex-col space-y-1.5 p-6",e),...t}));Bk.displayName="CardHeader";const Hk=y.forwardRef(({className:e,...t},n)=>g.jsx("h3",{ref:n,className:Q("text-2xl font-semibold leading-none tracking-tight",e),...t}));Hk.displayName="CardTitle";const Vk=y.forwardRef(({className:e,...t},n)=>g.jsx("p",{ref:n,className:Q("text-sm text-foreground",e),...t}));Vk.displayName="CardDescription";const Uk=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("p-6 pt-0",e),...t}));Uk.displayName="CardContent";const Wk=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("flex items-center p-6 pt-0",e),...t}));Wk.displayName="CardFooter";function uJ(e){return Object.prototype.toString.call(e)==="[object Object]"}function Gk(e){return uJ(e)||Array.isArray(e)}function dJ(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Xw(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const o=JSON.stringify(Object.keys(e.breakpoints||{})),i=JSON.stringify(Object.keys(t.breakpoints||{}));return o!==i?!1:n.every(a=>{const s=e[a],l=t[a];return typeof s=="function"?`${s}`==`${l}`:!Gk(s)||!Gk(l)?s===l:Xw(s,l)})}function qk(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function fJ(e,t){if(e.length!==t.length)return!1;const n=qk(e),r=qk(t);return n.every((o,i)=>{const a=r[i];return Xw(o,a)})}function Zw(e){return typeof e=="number"}function Jw(e){return typeof e=="string"}function af(e){return typeof e=="boolean"}function Yk(e){return Object.prototype.toString.call(e)==="[object Object]"}function vt(e){return Math.abs(e)}function Qw(e){return Math.sign(e)}function Ql(e,t){return vt(e-t)}function hJ(e,t){if(e===0||t===0||vt(e)<=vt(t))return 0;const n=Ql(vt(e),vt(t));return vt(n/e)}function pJ(e){return Math.round(e*100)/100}function ec(e){return nc(e).map(Number)}function ar(e){return e[tc(e)]}function tc(e){return Math.max(0,e.length-1)}function ev(e,t){return t===tc(e)}function Kk(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function nc(e){return Object.keys(e)}function Xk(e,t){return[e,t].reduce((n,r)=>(nc(r).forEach(o=>{const i=n[o],a=r[o],s=Yk(i)&&Yk(a);n[o]=s?Xk(i,a):a}),n),{})}function tv(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function mJ(e,t){const n={start:r,center:o,end:i};function r(){return 0}function o(l){return i(l)/2}function i(l){return t-l}function a(l,c){return Jw(e)?n[e](l):e(t,l,c)}return{measure:a}}function rc(){let e=[];function t(o,i,a,s={passive:!0}){let l;if("addEventListener"in o)o.addEventListener(i,a,s),l=()=>o.removeEventListener(i,a,s);else{const c=o;c.addListener(a),l=()=>c.removeListener(a)}return e.push(l),r}function n(){e=e.filter(o=>o())}const r={add:t,clear:n};return r}function gJ(e,t,n,r){const o=rc(),i=1e3/60;let a=null,s=0,l=0;function c(){o.add(e,"visibilitychange",()=>{e.hidden&&p()})}function u(){h(),o.clear()}function d(v){if(!l)return;a||(a=v,n(),n());const w=v-a;for(a=v,s+=w;s>=i;)n(),s-=i;const b=s/i;r(b),l&&(l=t.requestAnimationFrame(d))}function f(){l||(l=t.requestAnimationFrame(d))}function h(){t.cancelAnimationFrame(l),a=null,s=0,l=0}function p(){a=null,s=0}return{init:c,destroy:u,start:f,stop:h,update:n,render:r}}function wJ(e,t){const n=t==="rtl",r=e==="y",o=r?"y":"x",i=r?"x":"y",a=!r&&n?-1:1,s=u(),l=d();function c(p){const{height:m,width:v}=p;return r?m:v}function u(){return r?"top":n?"right":"left"}function d(){return r?"bottom":n?"left":"right"}function f(p){return p*a}return{scroll:o,cross:i,startEdge:s,endEdge:l,measureSize:c,direction:f}}function _i(e=0,t=0){const n=vt(e-t);function r(c){return c<e}function o(c){return c>t}function i(c){return r(c)||o(c)}function a(c){return i(c)?r(c)?e:t:c}function s(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:a,reachedAny:i,reachedMax:o,reachedMin:r,removeOffset:s}}function Zk(e,t,n){const{constrain:r}=_i(0,e),o=e+1;let i=a(t);function a(f){return n?vt((o+f)%o):r(f)}function s(){return i}function l(f){return i=a(f),d}function c(f){return u().set(s()+f)}function u(){return Zk(e,s(),n)}const d={get:s,set:l,add:c,clone:u};return d}function vJ(e,t,n,r,o,i,a,s,l,c,u,d,f,h,p,m,v,w,b){const{cross:x,direction:_}=e,C=["INPUT","SELECT","TEXTAREA"],N={passive:!1},R=rc(),T=rc(),M=_i(50,225).constrain(h.measure(20)),D={mouse:300,touch:400},A={mouse:500,touch:600},j=p?43:25;let $=!1,W=0,re=0,Y=!1,Z=!1,B=!1,oe=!1;function ee(H){if(!b)return;function ue(ye){(af(b)||b(H,ye))&&L(ye)}const se=t;R.add(se,"dragstart",ye=>ye.preventDefault(),N).add(se,"touchmove",()=>{},N).add(se,"touchend",()=>{}).add(se,"touchstart",ue).add(se,"mousedown",ue).add(se,"touchcancel",z).add(se,"contextmenu",z).add(se,"click",ie,!0)}function ne(){R.clear(),T.clear()}function G(){const H=oe?n:t;T.add(H,"touchmove",K,N).add(H,"touchend",z).add(H,"mousemove",K,N).add(H,"mouseup",z)}function F(H){const ue=H.nodeName||"";return C.includes(ue)}function q(){return(p?A:D)[oe?"mouse":"touch"]}function ce(H,ue){const se=d.add(Qw(H)*-1),ye=u.byDistance(H,!p).distance;return p||vt(H)<M?ye:v&&ue?ye*.5:u.byIndex(se.get(),0).distance}function L(H){const ue=tv(H,r);oe=ue,B=p&&ue&&!H.buttons&&$,$=Ql(o.get(),a.get())>=2,!(ue&&H.button!==0)&&(F(H.target)||(Y=!0,i.pointerDown(H),c.useFriction(0).useDuration(0),o.set(a),G(),W=i.readPoint(H),re=i.readPoint(H,x),f.emit("pointerDown")))}function K(H){if(!tv(H,r)&&H.touches.length>=2)return z(H);const se=i.readPoint(H),ye=i.readPoint(H,x),Ce=Ql(se,W),xe=Ql(ye,re);if(!Z&&!oe&&(!H.cancelable||(Z=Ce>xe,!Z)))return z(H);const O=i.pointerMove(H);Ce>m&&(B=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(_(O)),H.preventDefault()}function z(H){const se=u.byDistance(0,!1).index!==d.get(),ye=i.pointerUp(H)*q(),Ce=ce(_(ye),se),xe=hJ(ye,Ce),O=j-10*xe,V=w+xe/50;Z=!1,Y=!1,T.clear(),c.useDuration(O).useFriction(V),l.distance(Ce,!p),oe=!1,f.emit("pointerUp")}function ie(H){B&&(H.stopPropagation(),H.preventDefault(),B=!1)}function le(){return Y}return{init:ee,destroy:ne,pointerDown:le}}function yJ(e,t){let r,o;function i(d){return d.timeStamp}function a(d,f){const p=`client${(f||e.scroll)==="x"?"X":"Y"}`;return(tv(d,t)?d:d.touches[0])[p]}function s(d){return r=d,o=d,a(d)}function l(d){const f=a(d)-a(o),h=i(d)-i(r)>170;return o=d,h&&(r=d),f}function c(d){if(!r||!o)return 0;const f=a(o)-a(r),h=i(d)-i(r),p=i(d)-i(o)>170,m=f/h;return h&&!p&&vt(m)>.1?m:0}return{pointerDown:s,pointerMove:l,pointerUp:c,readPoint:a}}function bJ(){function e(n){const{offsetTop:r,offsetLeft:o,offsetWidth:i,offsetHeight:a}=n;return{top:r,right:o+i,bottom:r+a,left:o,width:i,height:a}}return{measure:e}}function xJ(e){function t(r){return e*(r/100)}return{measure:t}}function _J(e,t,n,r,o,i,a){const s=[e].concat(r);let l,c,u=[],d=!1;function f(v){return o.measureSize(a.measure(v))}function h(v){if(!i)return;c=f(e),u=r.map(f);function w(b){for(const x of b){if(d)return;const _=x.target===e,C=r.indexOf(x.target),N=_?c:u[C],R=f(_?e:r[C]);if(vt(R-N)>=.5){v.reInit(),t.emit("resize");break}}}l=new ResizeObserver(b=>{(af(i)||i(v,b))&&w(b)}),n.requestAnimationFrame(()=>{s.forEach(b=>l.observe(b))})}function p(){d=!0,l&&l.disconnect()}return{init:h,destroy:p}}function SJ(e,t,n,r,o,i){let a=0,s=0,l=o,c=i,u=e.get(),d=0;function f(){const N=r.get()-e.get(),R=!l;let T=0;return R?(a=0,n.set(r),e.set(r),T=N):(n.set(e),a+=N/l,a*=c,u+=a,e.add(a),T=u-d),s=Qw(T),d=u,C}function h(){const N=r.get()-t.get();return vt(N)<.001}function p(){return l}function m(){return s}function v(){return a}function w(){return x(o)}function b(){return _(i)}function x(N){return l=N,C}function _(N){return c=N,C}const C={direction:m,duration:p,velocity:v,seek:f,settled:h,useBaseFriction:b,useBaseDuration:w,useFriction:_,useDuration:x};return C}function CJ(e,t,n,r,o){const i=o.measure(10),a=o.measure(50),s=_i(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(h){if(!c())return;const p=e.reachedMin(t.get())?"min":"max",m=vt(e[p]-t.get()),v=n.get()-t.get(),w=s.constrain(m/a);n.subtract(v*w),!h&&vt(v)<i&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function d(h){l=!h}return{shouldConstrain:c,constrain:u,toggleActive:d}}function EJ(e,t,n,r,o){const i=_i(-t+e,0),a=d(),s=u(),l=f();function c(p,m){return Ql(p,m)<=1}function u(){const p=a[0],m=ar(a),v=a.lastIndexOf(p),w=a.indexOf(m)+1;return _i(v,w)}function d(){return n.map((p,m)=>{const{min:v,max:w}=i,b=i.constrain(p),x=!m,_=ev(n,m);return x?w:_||c(v,b)?v:c(w,b)?w:b}).map(p=>parseFloat(p.toFixed(3)))}function f(){if(t<=e+o)return[i.max];if(r==="keepSnaps")return a;const{min:p,max:m}=s;return a.slice(p,m)}return{snapsContained:l,scrollContainLimit:s}}function PJ(e,t,n){const r=t[0],o=n?r-e:ar(t);return{limit:_i(o,r)}}function RJ(e,t,n,r){const i=t.min+.1,a=t.max+.1,{reachedMin:s,reachedMax:l}=_i(i,a);function c(f){return f===1?l(n.get()):f===-1?s(n.get()):!1}function u(f){if(!c(f))return;const h=e*(f*-1);r.forEach(p=>p.add(h))}return{loop:u}}function NJ(e){const{max:t,length:n}=e;function r(i){const a=i-t;return n?a/-n:0}return{get:r}}function TJ(e,t,n,r,o){const{startEdge:i,endEdge:a}=e,{groupSlides:s}=o,l=d().map(t.measure),c=f(),u=h();function d(){return s(r).map(m=>ar(m)[a]-m[0][i]).map(vt)}function f(){return r.map(m=>n[i]-m[i]).map(m=>-vt(m))}function h(){return s(c).map(m=>m[0]).map((m,v)=>m+l[v])}return{snaps:c,snapsAligned:u}}function MJ(e,t,n,r,o,i){const{groupSlides:a}=o,{min:s,max:l}=r,c=u();function u(){const f=a(i),h=!e||t==="keepSnaps";return n.length===1?[i]:h?f:f.slice(s,l).map((p,m,v)=>{const w=!m,b=ev(v,m);if(w){const x=ar(v[0])+1;return Kk(x)}if(b){const x=tc(i)-ar(v)[0]+1;return Kk(x,ar(v)[0])}return p})}return{slideRegistry:c}}function kJ(e,t,n,r,o){const{reachedAny:i,removeOffset:a,constrain:s}=r;function l(p){return p.concat().sort((m,v)=>vt(m)-vt(v))[0]}function c(p){const m=e?a(p):s(p),v=t.map((b,x)=>({diff:u(b-m,0),index:x})).sort((b,x)=>vt(b.diff)-vt(x.diff)),{index:w}=v[0];return{index:w,distance:m}}function u(p,m){const v=[p,p+n,p-n];if(!e)return p;if(!m)return l(v);const w=v.filter(b=>Qw(b)===m);return w.length?l(w):ar(v)-n}function d(p,m){const v=t[p]-o.get(),w=u(v,m);return{index:p,distance:w}}function f(p,m){const v=o.get()+p,{index:w,distance:b}=c(v),x=!e&&i(v);if(!m||x)return{index:w,distance:p};const _=t[w]-b,C=p+u(_,0);return{index:w,distance:C}}return{byDistance:f,byIndex:d,shortcut:u}}function DJ(e,t,n,r,o,i,a){function s(d){const f=d.distance,h=d.index!==t.get();i.add(f),f&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),h&&(n.set(t.get()),t.set(d.index),a.emit("select"))}function l(d,f){const h=o.byDistance(d,f);s(h)}function c(d,f){const h=t.clone().set(d),p=o.byIndex(h.get(),f);s(p)}return{distance:l,index:c}}function AJ(e,t,n,r,o,i,a,s){const l={passive:!0,capture:!0};let c=0;function u(h){if(!s)return;function p(m){if(new Date().getTime()-c>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const b=n.findIndex(x=>x.includes(m));Zw(b)&&(o.useDuration(0),r.index(b,0),a.emit("slideFocus"))}i.add(document,"keydown",d,!1),t.forEach((m,v)=>{i.add(m,"focus",w=>{(af(s)||s(h,w))&&p(v)},l)})}function d(h){h.code==="Tab"&&(c=new Date().getTime())}return{init:u}}function oc(e){let t=e;function n(){return t}function r(l){t=a(l)}function o(l){t+=a(l)}function i(l){t-=a(l)}function a(l){return Zw(l)?l:l.get()}return{get:n,set:r,add:o,subtract:i}}function Jk(e,t){const n=e.scroll==="x"?a:s,r=t.style;let o=null,i=!1;function a(f){return`translate3d(${f}px,0px,0px)`}function s(f){return`translate3d(0px,${f}px,0px)`}function l(f){if(i)return;const h=pJ(e.direction(f));h!==o&&(r.transform=n(h),o=h)}function c(f){i=!f}function u(){i||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:u,to:l,toggleActive:c}}function IJ(e,t,n,r,o,i,a,s,l){const u=ec(o),d=ec(o).reverse(),f=w().concat(b());function h(R,T){return R.reduce((M,D)=>M-o[D],T)}function p(R,T){return R.reduce((M,D)=>h(M,T)>0?M.concat([D]):M,[])}function m(R){return i.map((T,M)=>({start:T-r[M]+.5+R,end:T+t-.5+R}))}function v(R,T,M){const D=m(T);return R.map(A=>{const j=M?0:-n,$=M?n:0,W=M?"end":"start",re=D[A][W];return{index:A,loopPoint:re,slideLocation:oc(-1),translate:Jk(e,l[A]),target:()=>s.get()>re?j:$}})}function w(){const R=a[0],T=p(d,R);return v(T,n,!1)}function b(){const R=t-a[0]-1,T=p(u,R);return v(T,-n,!0)}function x(){return f.every(({index:R})=>{const T=u.filter(M=>M!==R);return h(T,t)<=.1})}function _(){f.forEach(R=>{const{target:T,translate:M,slideLocation:D}=R,A=T();A!==D.get()&&(M.to(A),D.set(A))})}function C(){f.forEach(R=>R.translate.clear())}return{canLoop:x,clear:C,loop:_,loopPoints:f}}function OJ(e,t,n){let r,o=!1;function i(l){if(!n)return;function c(u){for(const d of u)if(d.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(u=>{o||(af(n)||n(l,u))&&c(u)}),r.observe(e,{childList:!0})}function a(){r&&r.disconnect(),o=!0}return{init:i,destroy:a}}function jJ(e,t,n,r){const o={};let i=null,a=null,s,l=!1;function c(){s=new IntersectionObserver(p=>{l||(p.forEach(m=>{const v=t.indexOf(m.target);o[v]=m}),i=null,a=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(p=>s.observe(p))}function u(){s&&s.disconnect(),l=!0}function d(p){return nc(o).reduce((m,v)=>{const w=parseInt(v),{isIntersecting:b}=o[w];return(p&&b||!p&&!b)&&m.push(w),m},[])}function f(p=!0){if(p&&i)return i;if(!p&&a)return a;const m=d(p);return p&&(i=m),p||(a=m),m}return{init:c,destroy:u,get:f}}function $J(e,t,n,r,o,i){const{measureSize:a,startEdge:s,endEdge:l}=e,c=n[0]&&o,u=p(),d=m(),f=n.map(a),h=v();function p(){if(!c)return 0;const b=n[0];return vt(t[s]-b[s])}function m(){if(!c)return 0;const b=i.getComputedStyle(ar(r));return parseFloat(b.getPropertyValue(`margin-${l}`))}function v(){return n.map((b,x,_)=>{const C=!x,N=ev(_,x);return C?f[x]+u:N?f[x]+d:_[x+1][s]-b[s]}).map(vt)}return{slideSizes:f,slideSizesWithGaps:h,startGap:u,endGap:d}}function FJ(e,t,n,r,o,i,a,s,l){const{startEdge:c,endEdge:u,direction:d}=e,f=Zw(n);function h(w,b){return ec(w).filter(x=>x%b===0).map(x=>w.slice(x,x+b))}function p(w){return w.length?ec(w).reduce((b,x,_)=>{const C=ar(b)||0,N=C===0,R=x===tc(w),T=o[c]-i[C][c],M=o[c]-i[x][u],D=!r&&N?d(a):0,A=!r&&R?d(s):0,j=vt(M-A-(T+D));return _&&j>t+l&&b.push(x),R&&b.push(w.length),b},[]).map((b,x,_)=>{const C=Math.max(_[x-1]||0);return w.slice(C,b)}):[]}function m(w){return f?h(w,n):p(w)}return{groupSlides:m}}function LJ(e,t,n,r,o,i,a){const{align:s,axis:l,direction:c,startIndex:u,loop:d,duration:f,dragFree:h,dragThreshold:p,inViewThreshold:m,slidesToScroll:v,skipSnaps:w,containScroll:b,watchResize:x,watchSlides:_,watchDrag:C,watchFocus:N}=i,R=2,T=bJ(),M=T.measure(t),D=n.map(T.measure),A=wJ(l,c),j=A.measureSize(M),$=xJ(j),W=mJ(s,j),re=!d&&!!b,Y=d||!!b,{slideSizes:Z,slideSizesWithGaps:B,startGap:oe,endGap:ee}=$J(A,M,D,n,Y,o),ne=FJ(A,j,v,d,M,D,oe,ee,R),{snaps:G,snapsAligned:F}=TJ(A,W,M,D,ne),q=-ar(G)+ar(B),{snapsContained:ce,scrollContainLimit:L}=EJ(j,q,F,b,R),K=re?ce:F,{limit:z}=PJ(q,K,d),ie=Zk(tc(K),u,d),le=ie.clone(),ae=ec(n),H=({dragHandler:I,scrollBody:U,scrollBounds:te,options:{loop:he}})=>{he||te.constrain(I.pointerDown()),U.seek()},ue=({scrollBody:I,translate:U,location:te,offsetLocation:he,previousLocation:Oe,scrollLooper:Qe,slideLooper:nt,dragHandler:st,animation:We,eventHandler:Te,scrollBounds:Ze,options:{loop:et}},He)=>{const Ee=I.settled(),Ge=!Ze.shouldConstrain(),qe=et?Ee:Ee&&Ge;qe&&!st.pointerDown()&&(We.stop(),Te.emit("settle")),qe||Te.emit("scroll");const wt=te.get()*He+Oe.get()*(1-He);he.set(wt),et&&(Qe.loop(I.direction()),nt.loop()),U.to(he.get())},se=gJ(r,o,()=>H(P),I=>ue(P,I)),ye=.68,Ce=K[ie.get()],xe=oc(Ce),O=oc(Ce),V=oc(Ce),J=oc(Ce),we=SJ(xe,V,O,J,f,ye),pe=kJ(d,K,q,z,J),fe=DJ(se,ie,le,we,pe,J,a),ge=NJ(z),_e=rc(),Xe=jJ(t,n,a,m),{slideRegistry:k}=MJ(re,b,K,L,ne,ae),S=AJ(e,n,k,fe,we,_e,a,N),P={ownerDocument:r,ownerWindow:o,eventHandler:a,containerRect:M,slideRects:D,animation:se,axis:A,dragHandler:vJ(A,e,r,o,J,yJ(A,o),xe,se,fe,we,pe,ie,a,$,h,p,w,ye,C),eventStore:_e,percentOfView:$,index:ie,indexPrevious:le,limit:z,location:xe,offsetLocation:V,previousLocation:O,options:i,resizeHandler:_J(t,a,o,n,A,x,T),scrollBody:we,scrollBounds:CJ(z,V,J,we,$),scrollLooper:RJ(q,z,V,[xe,V,O,J]),scrollProgress:ge,scrollSnapList:K.map(ge.get),scrollSnaps:K,scrollTarget:pe,scrollTo:fe,slideLooper:IJ(A,j,q,Z,B,G,K,V,n),slideFocus:S,slidesHandler:OJ(t,a,_),slidesInView:Xe,slideIndexes:ae,slideRegistry:k,slidesToScroll:ne,target:J,translate:Jk(A,t)};return P}function zJ(){let e={},t;function n(c){t=c}function r(c){return e[c]||[]}function o(c){return r(c).forEach(u=>u(t,c)),l}function i(c,u){return e[c]=r(c).concat([u]),l}function a(c,u){return e[c]=r(c).filter(d=>d!==u),l}function s(){e={}}const l={init:n,emit:o,off:a,on:i,clear:s};return l}const BJ={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function HJ(e){function t(i,a){return Xk(i,a||{})}function n(i){const a=i.breakpoints||{},s=nc(a).filter(l=>e.matchMedia(l).matches).map(l=>a[l]).reduce((l,c)=>t(l,c),{});return t(i,s)}function r(i){return i.map(a=>nc(a.breakpoints||{})).reduce((a,s)=>a.concat(s),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function VJ(e){let t=[];function n(i,a){return t=a.filter(({options:s})=>e.optionsAtMedia(s).active!==!1),t.forEach(s=>s.init(i,e)),a.reduce((s,l)=>Object.assign(s,{[l.name]:l}),{})}function r(){t=t.filter(i=>i.destroy())}return{init:n,destroy:r}}function sf(e,t,n){const r=e.ownerDocument,o=r.defaultView,i=HJ(o),a=VJ(i),s=rc(),l=zJ(),{mergeOptions:c,optionsAtMedia:u,optionsMediaQueries:d}=i,{on:f,off:h,emit:p}=l,m=A;let v=!1,w,b=c(BJ,sf.globalOptions),x=c(b),_=[],C,N,R;function T(){const{container:ae,slides:H}=x;N=(Jw(ae)?e.querySelector(ae):ae)||e.children[0];const se=Jw(H)?N.querySelectorAll(H):H;R=[].slice.call(se||N.children)}function M(ae){const H=LJ(e,N,R,r,o,ae,l);if(ae.loop&&!H.slideLooper.canLoop()){const ue=Object.assign({},ae,{loop:!1});return M(ue)}return H}function D(ae,H){v||(b=c(b,ae),x=u(b),_=H||_,T(),w=M(x),d([b,..._.map(({options:ue})=>ue)]).forEach(ue=>s.add(ue,"change",A)),x.active&&(w.translate.to(w.location.get()),w.animation.init(),w.slidesInView.init(),w.slideFocus.init(le),w.eventHandler.init(le),w.resizeHandler.init(le),w.slidesHandler.init(le),w.options.loop&&w.slideLooper.loop(),N.offsetParent&&R.length&&w.dragHandler.init(le),C=a.init(le,_)))}function A(ae,H){const ue=ne();j(),D(c({startIndex:ue},ae),H),l.emit("reInit")}function j(){w.dragHandler.destroy(),w.eventStore.clear(),w.translate.clear(),w.slideLooper.clear(),w.resizeHandler.destroy(),w.slidesHandler.destroy(),w.slidesInView.destroy(),w.animation.destroy(),a.destroy(),s.clear()}function $(){v||(v=!0,s.clear(),j(),l.emit("destroy"),l.clear())}function W(ae,H,ue){!x.active||v||(w.scrollBody.useBaseFriction().useDuration(H===!0?0:x.duration),w.scrollTo.index(ae,ue||0))}function re(ae){const H=w.index.add(1).get();W(H,ae,-1)}function Y(ae){const H=w.index.add(-1).get();W(H,ae,1)}function Z(){return w.index.add(1).get()!==ne()}function B(){return w.index.add(-1).get()!==ne()}function oe(){return w.scrollSnapList}function ee(){return w.scrollProgress.get(w.location.get())}function ne(){return w.index.get()}function G(){return w.indexPrevious.get()}function F(){return w.slidesInView.get()}function q(){return w.slidesInView.get(!1)}function ce(){return C}function L(){return w}function K(){return e}function z(){return N}function ie(){return R}const le={canScrollNext:Z,canScrollPrev:B,containerNode:z,internalEngine:L,destroy:$,off:h,on:f,emit:p,plugins:ce,previousScrollSnap:G,reInit:m,rootNode:K,scrollNext:re,scrollPrev:Y,scrollProgress:ee,scrollSnapList:oe,scrollTo:W,selectedScrollSnap:ne,slideNodes:ie,slidesInView:F,slidesNotInView:q};return D(t,n),setTimeout(()=>l.emit("init"),0),le}sf.globalOptions=void 0;function nv(e={},t=[]){const n=E.useRef(e),r=E.useRef(t),[o,i]=E.useState(),[a,s]=E.useState(),l=E.useCallback(()=>{o&&o.reInit(n.current,r.current)},[o]);return E.useEffect(()=>{Xw(n.current,e)||(n.current=e,l())},[e,l]),E.useEffect(()=>{fJ(r.current,t)||(r.current=t,l())},[t,l]),E.useEffect(()=>{if(dJ()&&a){sf.globalOptions=nv.globalOptions;const c=sf(a,n.current,r.current);return i(c),()=>c.destroy()}else i(void 0)},[a,i]),[s,o]}nv.globalOptions=void 0;const Qk=E.forwardRef(({orientation:e="horizontal",opts:t,setApi:n,plugins:r,className:o,children:i,...a},s)=>{const[l,c]=nv({...t,axis:e==="horizontal"?"x":"y"},r),[u,d]=E.useState(!1),[f,h]=E.useState(!1),[p,m]=E.useState(0),v=E.useCallback(()=>{c&&(m(c.selectedScrollSnap()),d(c.canScrollPrev()),h(c.canScrollNext()))},[c]);return E.useEffect(()=>{c&&(v(),c.on("select",v),c.on("reInit",v),n&&n(c))},[c,v,n]),g.jsxs("div",{ref:s,className:Q("relative",o),...a,children:[g.jsx("div",{ref:l,className:"overflow-hidden",dir:"ltr",children:g.jsx("div",{className:Q("flex",e==="horizontal"?"-ml-4":"-mt-4 flex-col",[e==="horizontal"?"touch-pan-x":"touch-pan-y"]),children:E.Children.map(i,w=>g.jsx("div",{className:Q("min-w-0 flex-[0_0_100%]",e==="horizontal"?"pl-4":"pt-4"),children:w}))})}),g.jsxs("div",{className:"flex items-center justify-center gap-2 py-2",children:[g.jsxs(rr,{variant:"outline",size:"icon",className:Q("h-8 w-8 rounded-full",!u&&"opacity-50"),disabled:!u,onClick:()=>c==null?void 0:c.scrollPrev(),children:[g.jsx(Zd,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Previous slide"})]}),g.jsx("div",{className:"flex gap-1",children:E.Children.map(i,(w,b)=>g.jsx(rr,{variant:"outline",size:"icon",className:Q("h-2 w-2 rounded-full","bg-primary"),onClick:()=>c==null?void 0:c.scrollTo(b),children:g.jsxs("span",{className:"sr-only",children:["Jump to slide ",b+1]})},b))}),g.jsxs(rr,{variant:"outline",size:"icon",className:Q("h-8 w-8 rounded-full",!f&&"opacity-50"),disabled:!f,onClick:()=>c==null?void 0:c.scrollNext(),children:[g.jsx(Lo,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Next slide"})]})]})]})});Qk.displayName="Carousel";const eD=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,role:"list",className:Q("",e),...t}));eD.displayName="CarouselContent";const tD=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,role:"listitem",className:Q("",e),...t}));tD.displayName="CarouselItem";const nD=E.forwardRef(({className:e,...t},n)=>g.jsxs(rr,{ref:n,variant:"outline",size:"icon",className:Q("absolute left-2 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full",e),...t,children:[g.jsx(Zd,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Previous slide"})]}));nD.displayName="CarouselPrevious";const rD=E.forwardRef(({className:e,...t},n)=>g.jsxs(rr,{ref:n,variant:"outline",size:"icon",className:Q("absolute right-2 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full",e),...t,children:[g.jsx(Lo,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Next slide"})]}));rD.displayName="CarouselNext";const oD=E.forwardRef(({className:e,...t},n)=>g.jsx(jC,{ref:n,className:Q("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:g.jsx(DW,{className:Q("flex items-center justify-center text-current"),children:g.jsx(Wa,{className:"h-4 w-4"})})}));oD.displayName=jC.displayName;const UJ=n1,WJ=gm,iD=E.forwardRef(({children:e,...t},n)=>g.jsx(vm,{ref:n,className:"data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",...t,children:e}));iD.displayName="CollapsibleContent";var aD=1,GJ=.9,qJ=.8,YJ=.17,rv=.1,ov=.999,KJ=.9999,XJ=.99,ZJ=/[\\\/_+.#"@\[\(\{&]/,JJ=/[\\\/_+.#"@\[\(\{&]/g,QJ=/[\s-]/,sD=/[\s-]/g;function iv(e,t,n,r,o,i,a){if(i===t.length)return o===e.length?aD:XJ;var s=`${o},${i}`;if(a[s]!==void 0)return a[s];for(var l=r.charAt(i),c=n.indexOf(l,o),u=0,d,f,h,p;c>=0;)d=iv(e,t,n,r,c+1,i+1,a),d>u&&(c===o?d*=aD:ZJ.test(e.charAt(c-1))?(d*=qJ,h=e.slice(o,c-1).match(JJ),h&&o>0&&(d*=Math.pow(ov,h.length))):QJ.test(e.charAt(c-1))?(d*=GJ,p=e.slice(o,c-1).match(sD),p&&o>0&&(d*=Math.pow(ov,p.length))):(d*=YJ,o>0&&(d*=Math.pow(ov,c-o))),e.charAt(c)!==t.charAt(i)&&(d*=KJ)),(d<rv&&n.charAt(c-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(c-1)!==r.charAt(i))&&(f=iv(e,t,n,r,c+1,i+2,a),f*rv>d&&(d=f*rv)),d>u&&(u=d),c=n.indexOf(l,c+1);return a[s]=u,u}function lD(e){return e.toLowerCase().replace(sD," ")}function eQ(e,t){return iv(e,t,lD(e),lD(t),0,0,{})}function $t(){return $t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$t.apply(null,arguments)}function Si(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 tQ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function cD(...e){return t=>e.forEach(n=>tQ(n,t))}function ic(...e){return E.useCallback(cD(...e),e)}function nQ(e,t=[]){let n=[];function r(i,a){const s=E.createContext(a),l=n.length;n=[...n,a];function c(d){const{scope:f,children:h,...p}=d,m=(f==null?void 0:f[e][l])||s,v=E.useMemo(()=>p,Object.values(p));return E.createElement(m.Provider,{value:v},h)}function u(d,f){const h=(f==null?void 0:f[e][l])||s,p=E.useContext(h);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(a=>E.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return E.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,rQ(o,...t)]}function rQ(...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(i){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...s,...d}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}const av=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},oQ=y.useId||(()=>{});let iQ=0;function sv(e){const[t,n]=y.useState(oQ());return av(()=>{e||n(r=>r??String(iQ++))},[e]),e||(t?`radix-${t}`:"")}function Ci(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function aQ({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=sQ({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=Ci(n),l=E.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function sQ({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,o=E.useRef(r),i=Ci(t);return E.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const lv=E.forwardRef((e,t)=>{const{children:n,...r}=e,o=E.Children.toArray(n),i=o.find(cQ);if(i){const a=i.props.children,s=o.map(l=>l===i?E.Children.count(a)>1?E.Children.only(null):E.isValidElement(a)?a.props.children:null:l);return E.createElement(cv,$t({},r,{ref:t}),E.isValidElement(a)?E.cloneElement(a,void 0,s):null)}return E.createElement(cv,$t({},r,{ref:t}),n)});lv.displayName="Slot";const cv=E.forwardRef((e,t)=>{const{children:n,...r}=e;return E.isValidElement(n)?E.cloneElement(n,{...uQ(r,n.props),ref:cD(t,n.ref)}):E.Children.count(n)>1?E.Children.only(null):null});cv.displayName="SlotClone";const lQ=({children:e})=>E.createElement(E.Fragment,null,e);function cQ(e){return E.isValidElement(e)&&e.type===lQ}function uQ(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?n[r]=(...s)=>{i==null||i(...s),o==null||o(...s)}:r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const Ei=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=E.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?lv:t;return E.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),E.createElement(s,$t({},a,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function dQ(e,t){e&&ur.flushSync(()=>e.dispatchEvent(t))}function fQ(e){const t=Ci(e);E.useEffect(()=>{const n=r=>{r.key==="Escape"&&t(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t])}const uv="dismissableLayer.update",hQ="dismissableLayer.pointerDownOutside",pQ="dismissableLayer.focusOutside";let uD;const mQ=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gQ=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=E.useContext(mQ),[u,d]=E.useState(null),[,f]=E.useState({}),h=ic(t,N=>d(N)),p=Array.from(c.layers),[m]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(m),w=u?p.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,x=w>=v,_=wQ(N=>{const R=N.target,T=[...c.branches].some(M=>M.contains(R));!x||T||(o==null||o(N),a==null||a(N),N.defaultPrevented||s==null||s())}),C=vQ(N=>{const R=N.target;[...c.branches].some(M=>M.contains(R))||(i==null||i(N),a==null||a(N),N.defaultPrevented||s==null||s())});return fQ(N=>{w===c.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&s&&(N.preventDefault(),s()))}),E.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(uD=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),dD(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=uD)}},[u,n,c]),E.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),dD())},[u,c]),E.useEffect(()=>{const N=()=>f({});return document.addEventListener(uv,N),()=>document.removeEventListener(uv,N)},[]),E.createElement(Ei.div,$t({},l,{ref:h,style:{pointerEvents:b?x?"auto":"none":void 0,...e.style},onFocusCapture:Si(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Si(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Si(e.onPointerDownCapture,_.onPointerDownCapture)}))});function wQ(e){const t=Ci(e),n=E.useRef(!1),r=E.useRef(()=>{});return E.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){fD(hQ,t,s,{discrete:!0})};const s={originalEvent:a};a.pointerType==="touch"?(document.removeEventListener("click",r.current),r.current=l,document.addEventListener("click",r.current,{once:!0})):l()}n.current=!1},i=window.setTimeout(()=>{document.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),document.removeEventListener("pointerdown",o),document.removeEventListener("click",r.current)}},[t]),{onPointerDownCapture:()=>n.current=!0}}function vQ(e){const t=Ci(e),n=E.useRef(!1);return E.useEffect(()=>{const r=o=>{o.target&&!n.current&&fD(pQ,t,{originalEvent:o},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function dD(){const e=new CustomEvent(uv);document.dispatchEvent(e)}function fD(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?dQ(o,i):o.dispatchEvent(i)}const dv="focusScope.autoFocusOnMount",fv="focusScope.autoFocusOnUnmount",hD={bubbles:!1,cancelable:!0},yQ=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=E.useState(null),c=Ci(o),u=Ci(i),d=E.useRef(null),f=ic(t,m=>l(m)),h=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let m=function(w){if(h.paused||!s)return;const b=w.target;s.contains(b)?d.current=b:Pi(d.current,{select:!0})},v=function(w){h.paused||!s||s.contains(w.relatedTarget)||Pi(d.current,{select:!0})};return document.addEventListener("focusin",m),document.addEventListener("focusout",v),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v)}}},[r,s,h.paused]),E.useEffect(()=>{if(s){gD.add(h);const m=document.activeElement;if(!s.contains(m)){const w=new CustomEvent(dv,hD);s.addEventListener(dv,c),s.dispatchEvent(w),w.defaultPrevented||(bQ(EQ(pD(s)),{select:!0}),document.activeElement===m&&Pi(s))}return()=>{s.removeEventListener(dv,c),setTimeout(()=>{const w=new CustomEvent(fv,hD);s.addEventListener(fv,u),s.dispatchEvent(w),w.defaultPrevented||Pi(m??document.body,{select:!0}),s.removeEventListener(fv,u),gD.remove(h)},0)}}},[s,c,u,h]);const p=E.useCallback(m=>{if(!n&&!r||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,w=document.activeElement;if(v&&w){const b=m.currentTarget,[x,_]=xQ(b);x&&_?!m.shiftKey&&w===_?(m.preventDefault(),n&&Pi(x,{select:!0})):m.shiftKey&&w===x&&(m.preventDefault(),n&&Pi(_,{select:!0})):w===b&&m.preventDefault()}},[n,r,h.paused]);return E.createElement(Ei.div,$t({tabIndex:-1},a,{ref:f,onKeyDown:p}))});function bQ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pi(r,{select:t}),document.activeElement!==n)return}function xQ(e){const t=pD(e),n=mD(t,e),r=mD(t.reverse(),e);return[n,r]}function pD(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 mD(e,t){for(const n of e)if(!_Q(n,{upTo:t}))return n}function _Q(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function SQ(e){return e instanceof HTMLInputElement&&"select"in e}function Pi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&SQ(e)&&t&&e.select()}}const gD=CQ();function CQ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=wD(e,t),e.unshift(t)},remove(t){var n;e=wD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function wD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function EQ(e){return e.filter(t=>t.tagName!=="A")}const PQ=E.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?ur.createPortal(E.createElement(Ei.div,$t({},o,{ref:t})),r):null});function RQ(e,t){return E.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const lf=e=>{const{present:t,children:n}=e,r=NQ(t),o=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),i=ic(r.ref,o.ref);return typeof n=="function"||r.isPresent?E.cloneElement(o,{ref:i}):null};lf.displayName="Presence";function NQ(e){const[t,n]=E.useState(),r=E.useRef({}),o=E.useRef(e),i=E.useRef("none"),a=e?"mounted":"unmounted",[s,l]=RQ(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const c=cf(r.current);i.current=s==="mounted"?c:"none"},[s]),av(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,h=cf(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]),av(()=>{if(t){const c=d=>{const h=cf(r.current).includes(d.animationName);d.target===t&&h&&ur.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=cf(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(s),ref:E.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function cf(e){return(e==null?void 0:e.animationName)||"none"}let hv=0;function TQ(){E.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:vD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:vD()),hv++,()=>{hv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),hv--}},[])}function vD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var yD=R1(),pv=function(){},uf=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:pv,onWheelCapture:pv,onTouchMoveCapture:pv}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noIsolation,p=e.inert,m=e.allowPinchZoom,v=e.as,w=v===void 0?"div":v,b=Nm(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=f,_=P1([n,t]),C=Wt(Wt({},b),o);return y.createElement(y.Fragment,null,u&&y.createElement(x,{sideCar:yD,removeScrollBar:c,shards:d,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n}),a?y.cloneElement(y.Children.only(s),Wt(Wt({},C),{ref:_})):y.createElement(w,Wt({},C,{className:l,ref:_}),s))});uf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},uf.classNames={fullWidth:Cl,zeroRight:Sl};var mv=!1;if(typeof window<"u")try{var df=Object.defineProperty({},"passive",{get:function(){return mv=!0,!0}});window.addEventListener("test",df,df),window.removeEventListener("test",df,df)}catch{mv=!1}var Za=mv?{passive:!1}:!1,MQ=function(e){var t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},kQ=function(e){var t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},bD=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=xD(e,n);if(r){var o=_D(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},DQ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},AQ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},xD=function(e,t){return e==="v"?MQ(t):kQ(t)},_D=function(e,t){return e==="v"?DQ(t):AQ(t)},IQ=function(e,t){return e==="h"&&t==="rtl"?-1:1},OQ=function(e,t,n,r,o){var i=IQ(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,f=0;do{var h=_D(e,s),p=h[0],m=h[1],v=h[2],w=m-v-i*p;(p||w)&&xD(e,s)&&(d+=w,f+=p),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&d===0||!u&&f===0)&&(c=!0),c},ff=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},SD=function(e){return[e.deltaX,e.deltaY]},CD=function(e){return e&&"current"in e?e.current:e},jQ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$Q=function(e){return`
|
|
401
|
+
*/const NM=Mn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),_w="-",E6=e=>{const t=R6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(_w);return s[0]===""&&s.length!==1&&s.shift(),TM(s,t)||P6(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},TM=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?TM(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(_w);return(a=t.validators.find(({validator:s})=>s(i)))==null?void 0:a.classGroupId},MM=/^\[(.+)\]$/,P6=e=>{if(MM.test(e)){const t=MM.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},R6=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)Sw(n[o],r,o,t);return r},Sw=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:kM(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(N6(o)){Sw(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{Sw(a,kM(t,i),n,r)})})},kM=(e,t)=>{let n=e;return t.split(_w).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},N6=e=>e.isThemeGetter,T6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return o(i,a),a},set(i,a){n.has(i)?n.set(i,a):o(i,a)}}},Cw="!",Ew=":",M6=Ew.length,k6=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let a=0,s=0,l=0,c;for(let p=0;p<o.length;p++){let m=o[p];if(a===0&&s===0){if(m===Ew){i.push(o.slice(l,p)),l=p+M6;continue}if(m==="/"){c=p;continue}}m==="["?a++:m==="]"?a--:m==="("?s++:m===")"&&s--}const u=i.length===0?o:o.substring(l),d=D6(u),f=d!==u,h=c&&c>l?c-l:void 0;return{modifiers:i,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:h}};if(t){const o=t+Ew,i=r;r=a=>a.startsWith(o)?i(a.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},D6=e=>e.endsWith(Cw)?e.substring(0,e.length-1):e.startsWith(Cw)?e.substring(1):e,A6=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let i=[];return r.forEach(a=>{a[0]==="["||t[a]?(o.push(...i.sort(),a),i=[]):i.push(a)}),o.push(...i.sort()),o}},I6=e=>({cache:T6(e.cacheSize),parseClassName:k6(e),sortModifiers:A6(e),...E6(e)}),O6=/\s+/,j6=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,a=[],s=e.trim().split(O6);let l="";for(let c=s.length-1;c>=0;c-=1){const u=s[c],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let v=!!m,w=r(v?p.substring(0,m):p);if(!w){if(!v){l=u+(l.length>0?" "+l:l);continue}if(w=r(p),!w){l=u+(l.length>0?" "+l:l);continue}v=!1}const b=i(f).join(":"),x=h?b+Cw:b,_=x+w;if(a.includes(_))continue;a.push(_);const C=o(w,v);for(let N=0;N<C.length;++N){const R=C[N];a.push(x+R)}l=u+(l.length>0?" "+l:l)}return l};function $6(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=DM(t))&&(r&&(r+=" "),r+=n);return r}const DM=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=DM(e[r]))&&(n&&(n+=" "),n+=t);return n};function F6(e,...t){let n,r,o,i=a;function a(l){const c=t.reduce((u,d)=>d(u),e());return n=I6(c),r=n.cache.get,o=n.cache.set,i=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=j6(l,n);return o(l,u),u}return function(){return i($6.apply(null,arguments))}}const jt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},AM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,IM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,L6=/^\d+\/\d+$/,z6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,B6=/\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$/,H6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,V6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,U6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ga=e=>L6.test(e),Ve=e=>!!e&&!Number.isNaN(Number(e)),vi=e=>!!e&&Number.isInteger(Number(e)),OM=e=>e.endsWith("%")&&Ve(e.slice(0,-1)),zo=e=>z6.test(e),W6=()=>!0,G6=e=>B6.test(e)&&!H6.test(e),Pw=()=>!1,q6=e=>V6.test(e),Y6=e=>U6.test(e),K6=e=>!Pe(e)&&!Re(e),X6=e=>qa(e,FM,Pw),Pe=e=>AM.test(e),yi=e=>qa(e,LM,G6),Rw=e=>qa(e,sK,Ve),Z6=e=>qa(e,jM,Pw),J6=e=>qa(e,$M,Y6),Q6=e=>qa(e,Pw,q6),Re=e=>IM.test(e),Qd=e=>Ya(e,LM),eK=e=>Ya(e,lK),tK=e=>Ya(e,jM),nK=e=>Ya(e,FM),rK=e=>Ya(e,$M),oK=e=>Ya(e,cK,!0),qa=(e,t,n)=>{const r=AM.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ya=(e,t,n=!1)=>{const r=IM.exec(e);return r?r[1]?t(r[1]):n:!1},jM=e=>e==="position",iK=new Set(["image","url"]),$M=e=>iK.has(e),aK=new Set(["length","size","percentage"]),FM=e=>aK.has(e),LM=e=>e==="length",sK=e=>e==="number",lK=e=>e==="family-name",cK=e=>e==="shadow",uK=F6(()=>{const e=jt("color"),t=jt("font"),n=jt("text"),r=jt("font-weight"),o=jt("tracking"),i=jt("leading"),a=jt("breakpoint"),s=jt("container"),l=jt("spacing"),c=jt("radius"),u=jt("shadow"),d=jt("inset-shadow"),f=jt("drop-shadow"),h=jt("blur"),p=jt("perspective"),m=jt("aspect"),v=jt("ease"),w=jt("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],N=()=>[Re,Pe,l],R=()=>[Ga,"full","auto",...N()],T=()=>[vi,"none","subgrid",Re,Pe],M=()=>["auto",{span:["full",vi,Re,Pe]},Re,Pe],D=()=>[vi,"auto",Re,Pe],A=()=>["auto","min","max","fr",Re,Pe],O=()=>["start","end","center","between","around","evenly","stretch","baseline"],$=()=>["start","end","center","stretch"],W=()=>["auto",...N()],re=()=>[Ga,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],Y=()=>[e,Re,Pe],Z=()=>[OM,yi],B=()=>["","none","full",c,Re,Pe],oe=()=>["",Ve,Qd,yi],ee=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["","none",h,Re,Pe],F=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Re,Pe],q=()=>["none",Ve,Re,Pe],ce=()=>["none",Ve,Re,Pe],L=()=>[Ve,Re,Pe],K=()=>[Ga,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[zo],breakpoint:[zo],color:[W6],container:[zo],"drop-shadow":[zo],ease:["in","out","in-out"],font:[K6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[zo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[zo],shadow:[zo],spacing:["px",Ve],text:[zo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ga,Pe,Re,m]}],container:["container"],columns:[{columns:[Ve,Pe,Re,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"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"],sr:["sr-only","not-sr-only"],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:[...x(),Pe,Re]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[vi,"auto",Re,Pe]}],basis:[{basis:[Ga,"full","auto",s,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ve,Ga,"auto","initial","none",Pe]}],grow:[{grow:["",Ve,Re,Pe]}],shrink:[{shrink:["",Ve,Re,Pe]}],order:[{order:[vi,"first","last","none",Re,Pe]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...O(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...O()]}],"align-items":[{items:[...$(),"baseline"]}],"align-self":[{self:["auto",...$(),"baseline"]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],w:[{w:[s,"screen",...re()]}],"min-w":[{"min-w":[s,"screen","none",...re()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...re()]}],h:[{h:["screen",...re()]}],"min-h":[{"min-h":["screen","none",...re()]}],"max-h":[{"max-h":["screen",...re()]}],"font-size":[{text:["base",n,Qd,yi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Re,Rw]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",OM,Pe]}],"font-family":[{font:[eK,Pe,t]}],"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-fractions"],tracking:[{tracking:[o,Re,Pe]}],"line-clamp":[{"line-clamp":[Ve,"none",Re,Rw]}],leading:[{leading:[i,...N()]}],"list-image":[{"list-image":["none",Re,Pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Re,Pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ve,"from-font","auto",Re,yi]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[Ve,"auto",Re,Pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re,Pe]}],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",Re,Pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...x(),tK,Z6]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",nK,X6]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vi,Re,Pe],radial:["",Re,Pe],conic:[vi,Re,Pe]},rK,J6]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ee(),"hidden","none"]}],"divide-style":[{divide:[...ee(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ve,Re,Pe]}],"outline-w":[{outline:["",Ve,Qd,yi]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",u,oK,Q6]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",Re,Pe,d]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[Ve,yi]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":Y()}],opacity:[{opacity:[Ve,Re,Pe]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],filter:[{filter:["","none",Re,Pe]}],blur:[{blur:G()}],brightness:[{brightness:[Ve,Re,Pe]}],contrast:[{contrast:[Ve,Re,Pe]}],"drop-shadow":[{"drop-shadow":["","none",f,Re,Pe]}],grayscale:[{grayscale:["",Ve,Re,Pe]}],"hue-rotate":[{"hue-rotate":[Ve,Re,Pe]}],invert:[{invert:["",Ve,Re,Pe]}],saturate:[{saturate:[Ve,Re,Pe]}],sepia:[{sepia:["",Ve,Re,Pe]}],"backdrop-filter":[{"backdrop-filter":["","none",Re,Pe]}],"backdrop-blur":[{"backdrop-blur":G()}],"backdrop-brightness":[{"backdrop-brightness":[Ve,Re,Pe]}],"backdrop-contrast":[{"backdrop-contrast":[Ve,Re,Pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ve,Re,Pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ve,Re,Pe]}],"backdrop-invert":[{"backdrop-invert":["",Ve,Re,Pe]}],"backdrop-opacity":[{"backdrop-opacity":[Ve,Re,Pe]}],"backdrop-saturate":[{"backdrop-saturate":[Ve,Re,Pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ve,Re,Pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Re,Pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ve,"initial",Re,Pe]}],ease:[{ease:["linear","initial",v,Re,Pe]}],delay:[{delay:[Ve,Re,Pe]}],animate:[{animate:["none",w,Re,Pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,Re,Pe]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:q()}],"rotate-x":[{"rotate-x":q()}],"rotate-y":[{"rotate-y":q()}],"rotate-z":[{"rotate-z":q()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":["scale-3d"],skew:[{skew:L()}],"skew-x":[{"skew-x":L()}],"skew-y":[{"skew-y":L()}],transform:[{transform:[Re,Pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:K()}],"translate-x":[{"translate-x":K()}],"translate-y":[{"translate-y":K()}],"translate-z":[{"translate-z":K()}],"translate-none":["translate-none"],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",Re,Pe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",Re,Pe]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[Ve,Qd,yi,Rw]}],stroke:[{stroke:["none",...Y()]}],"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-s","border-color-e","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}});function Q(...e){return uK(Eu(e))}const dK=nU,zM=y.forwardRef(({className:e,...t},n)=>g.jsx(rU,{ref:n,className:Q("border-b",e),...t}));zM.displayName="AccordionItem";const BM=y.forwardRef(({className:e,children:t,...n},r)=>g.jsx(oU,{className:"flex",children:g.jsxs(iU,{ref:r,className:Q("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,g.jsx(Xd,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));BM.displayName="AccordionTrigger";const HM=y.forwardRef(({className:e,children:t,...n},r)=>g.jsx(aU,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:g.jsx("div",{className:Q("pb-4 pt-0",e),children:t})}));HM.displayName="AccordionContent";const VM=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,UM=Eu,kn=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return UM(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const f=VM(u)||VM(d);return o[c][f]}),s=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(p=>{let[m,v]=p;return Array.isArray(v)?v.includes({...i,...s}[m]):{...i,...s}[m]===v})?[...c,d,f]:c},[]);return UM(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},WM={alert:{defaultStyles:"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",variantStyles:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}},badge:{defaultStyles:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",variantStyles:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"text-foreground"}},defaultVariants:{variant:"default"}},button:{defaultStyles:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",variantStyles:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",primary:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}},sidebar:{defaultStyles:"relative flex flex-col gap-2 h-screen p-4 bg-background border-r transition-all duration-300 ease-in-out",variantStyles:{variant:{default:"border-r",floating:"rounded-lg border shadow-lg m-2 h-[calc(100vh-1rem)]"},size:{default:"w-64",sm:"w-48",lg:"w-72"},collapsed:{true:"w-16",false:""}},defaultVariants:{variant:"default",size:"default",collapsed:!1}},sidebarItem:{defaultStyles:"flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",variantStyles:{variant:{default:"hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-transparent hover:text-foreground/80",active:"bg-accent text-accent-foreground"}},defaultVariants:{variant:"default"}},toggle:{defaultStyles:"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-primary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",variantStyles:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}},fK=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT:WM},Symbol.toStringTag,{value:"Module"})),to=E.createContext(null),hK=to.Consumer,pK=Object.freeze(Object.defineProperty({__proto__:null,TailwindThemeConsumer:hK,TailwindThemeContext:to,TailwindThemeProvider:e=>{const[t,n]=E.useState(WM),[r,o]=E.useState({tailwind:{},siteBackground:{}}),i=s=>{o(l=>({...l,tailwind:s}))},a=s=>{o(l=>({...l,siteBackground:s}))};return g.jsx(to.Provider,{value:{variants:t,setVariants:n,theme:r,setTheme:o,tailwind:(r==null?void 0:r.tailwind)??{},setTailwind:i,siteBackground:(r==null?void 0:r.siteBackground)??{},setSiteBackground:a},children:e.children})}},Symbol.toStringTag,{value:"Module"})),Bo=()=>{const e=E.useContext(to);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{variants:e.variants,setVariants:e.setVariants}},mK=()=>{const e=E.useContext(to);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{theme:e.theme,setTheme:e.setTheme}},gK=()=>{var n,r,o,i;const e=E.useContext(to);if(e===void 0)throw new Error("Invalid tailwind theme context.");const t=a=>{e.setTailwind({theme:{extend:{...e.tailwind.theme.extend,fontFamily:{custom:a}}}})};return{fontFamily:((i=(o=(r=(n=e.tailwind)==null?void 0:n.theme)==null?void 0:r.extend)==null?void 0:o.fontFamily)==null?void 0:i.custom)??null,setFontFamily:t}},wK=()=>{var n,r,o;const e=E.useContext(to);if(e===void 0)throw new Error("Invalid tailwind theme context.");const t=i=>{e.setTailwind({theme:{extend:{...e.tailwind.theme.extend,colors:i}}})};return{colors:((o=(r=(n=e.tailwind)==null?void 0:n.theme)==null?void 0:r.extend)==null?void 0:o.colors)??null,setColors:t}},Nw=()=>{const e=E.useContext(to);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{siteBackground:e.siteBackground,siteBackgroundColor:e.siteBackground.color,siteBackgroundImage:e.siteBackground.image,setSiteBackground:e.setSiteBackground}},vK=Object.freeze(Object.defineProperty({__proto__:null,useColors:wK,useFontFamily:gK,useSiteBackground:Nw,useTailwind:()=>{const e=E.useContext(to);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{tailwind:e.tailwind,setTailwind:e.setTailwind}},useTheme:mK,useVariants:Bo},Symbol.toStringTag,{value:"Module"})),GM=E.forwardRef(({className:e,variant:t,...n},r)=>{const{variants:o}=Bo(),i=E.useMemo(()=>kn(o.alert.defaultStyles,{variants:o.alert.variantStyles,defaultVariants:o.alert.defaultVariants}),[o]);return g.jsx("div",{ref:r,role:"alert",className:Q(i({variant:t}),e),...n})});GM.displayName="Alert";const qM=E.forwardRef(({className:e,...t},n)=>g.jsx("h5",{ref:n,className:Q("mb-1 font-medium leading-none tracking-tight",e),...t}));qM.displayName="AlertTitle";const YM=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("text-sm [&_p]:leading-relaxed",e),...t}));YM.displayName="AlertDescription";const yK=bW,bK=xW,xK=_W,KM=y.forwardRef(({className:e,...t},n)=>g.jsx(gC,{className:Q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));KM.displayName=gC.displayName;const XM=y.forwardRef(({className:e,...t},n)=>g.jsxs(xK,{children:[g.jsx(KM,{}),g.jsx(wC,{ref:n,className:Q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));XM.displayName=wC.displayName;const ZM=({className:e,...t})=>g.jsx("div",{className:Q("flex flex-col space-y-2 text-center sm:text-left",e),...t});ZM.displayName="AlertDialogHeader";const JM=({className:e,...t})=>g.jsx("div",{className:Q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});JM.displayName="AlertDialogFooter";const QM=y.forwardRef(({className:e,...t},n)=>g.jsx(bC,{ref:n,className:Q("text-lg font-semibold",e),...t}));QM.displayName=bC.displayName;const ek=y.forwardRef(({className:e,...t},n)=>g.jsx(xC,{ref:n,className:Q("text-sm text-foreground",e),...t}));ek.displayName=xC.displayName;const tk=y.forwardRef(({className:e,...t},n)=>g.jsx(vC,{ref:n,className:Q("inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground ring-offset-background transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));tk.displayName=vC.displayName;const nk=y.forwardRef(({className:e,...t},n)=>g.jsx(yC,{ref:n,className:Q("mt-2 inline-flex h-10 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-semibold ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 sm:mt-0",e),...t}));nk.displayName=yC.displayName;const _K=CW,rk=y.forwardRef(({className:e,...t},n)=>g.jsx(TC,{ref:n,className:Q("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));rk.displayName=TC.displayName;const ok=y.forwardRef(({className:e,...t},n)=>g.jsx(MC,{ref:n,className:Q("aspect-square h-full w-full",e),...t}));ok.displayName=MC.displayName;const ik=y.forwardRef(({className:e,...t},n)=>g.jsx(kC,{ref:n,className:Q("flex h-full w-full items-center justify-center rounded-full bg-primary",e),...t}));ik.displayName=kC.displayName;const SK=kn("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function CK({className:e,variant:t,...n}){const{variants:r}=Bo(),o=E.useMemo(()=>kn(r.badge.defaultStyles,{variants:r.badge.variantStyles,defaultVariants:r.badge.defaultVariants}),[r]);return g.jsx("div",{className:Q(o({variant:t}),e),...n})}const ak=y.forwardRef(({...e},t)=>g.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));ak.displayName="Breadcrumb";const sk=y.forwardRef(({className:e,...t},n)=>g.jsx("ol",{ref:n,className:Q("flex flex-wrap items-center gap-1.5 break-words text-sm text-foreground sm:gap-2.5",e),...t}));sk.displayName="BreadcrumbList";const lk=y.forwardRef(({className:e,...t},n)=>g.jsx("li",{ref:n,className:Q("inline-flex items-center gap-1.5",e),...t}));lk.displayName="BreadcrumbItem";const ck=y.forwardRef(({className:e,...t},n)=>g.jsx("a",{ref:n,className:Q("transition-colors hover:text-foreground hover:underline",e),...t}));ck.displayName="BreadcrumbLink";const uk=y.forwardRef(({className:e,...t},n)=>g.jsx("span",{ref:n,role:"link","aria-current":"page",className:Q("font-normal text-foreground",e),...t}));uk.displayName="BreadcrumbPage";const dk=({className:e,...t})=>g.jsx("li",{role:"presentation","aria-hidden":"true",className:Q("[&>svg]:size-3.5",e),...t,children:g.jsx(Lo,{})});dk.displayName="BreadcrumbSeparator";const EK=kn("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),rr=E.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const a=r?MV:"button",{variants:s}=Bo(),l=E.useMemo(()=>kn(s.button.defaultStyles,{variants:s.button.variantStyles,defaultVariants:s.button.defaultVariants}),[s]);return g.jsx(a,{className:Q(l({variant:t,size:n,className:e})),ref:i,...o})});rr.displayName="Button";function Ke(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 Dn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function on(e,t){const n=Ke(e);return isNaN(t)?Dn(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function or(e,t){const n=Ke(e);if(isNaN(t))return Dn(e,NaN);if(!t)return n;const r=n.getDate(),o=Dn(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const i=o.getDate();return r>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}const Tw=6048e5,PK=864e5;let RK={};function Gl(){return RK}function Or(e,t){var s,l,c,u;const n=Gl(),r=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Ke(e),i=o.getDay(),a=(i<r?7:0)+i-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function bi(e){return Or(e,{weekStartsOn:1})}function fk(e){const t=Ke(e),n=t.getFullYear(),r=Dn(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=bi(r),i=Dn(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const a=bi(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Ka(e){const t=Ke(e);return t.setHours(0,0,0,0),t}function ef(e){const t=Ke(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 jr(e,t){const n=Ka(e),r=Ka(t),o=+n-ef(n),i=+r-ef(r);return Math.round((o-i)/PK)}function NK(e){const t=fk(e),n=Dn(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),bi(n)}function Mw(e,t){const n=t*7;return on(e,n)}function TK(e,t){return or(e,t*12)}function MK(e){let t;return e.forEach(function(n){const r=Ke(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function kK(e){let t;return e.forEach(n=>{const r=Ke(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function gn(e,t){const n=Ka(e),r=Ka(t);return+n==+r}function kw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function DK(e){if(!kw(e)&&typeof e!="number")return!1;const t=Ke(e);return!isNaN(Number(t))}function ql(e,t){const n=Ke(e),r=Ke(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function AK(e,t,n){const r=Or(e,n),o=Or(t,n),i=+r-ef(r),a=+o-ef(o);return Math.round((i-a)/Tw)}function Dw(e){const t=Ke(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function wn(e){const t=Ke(e);return t.setDate(1),t.setHours(0,0,0,0),t}function hk(e){const t=Ke(e),n=Dn(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Aw(e,t){var s,l,c,u;const n=Gl(),r=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Ke(e),i=o.getDay(),a=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+a),o.setHours(23,59,59,999),o}function pk(e){return Aw(e,{weekStartsOn:1})}const IK={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"}},OK=(e,t,n)=>{let r;const o=IK[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 Iw(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const jK={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},$K={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},FK={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},LK={date:Iw({formats:jK,defaultWidth:"full"}),time:Iw({formats:$K,defaultWidth:"full"}),dateTime:Iw({formats:FK,defaultWidth:"full"})},zK={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},BK=(e,t,n,r)=>zK[e];function Yl(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):a;o=e.formattingValues[s]||e.formattingValues[a]}else{const a=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[s]||e.values[a]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const HK={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},VK={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},UK={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"]},WK={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"]},GK={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"}},qK={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"}},YK={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:Yl({values:HK,defaultWidth:"wide"}),quarter:Yl({values:VK,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yl({values:UK,defaultWidth:"wide"}),day:Yl({values:WK,defaultWidth:"wide"}),dayPeriod:Yl({values:GK,defaultWidth:"wide",formattingValues:qK,defaultFormattingWidth:"wide"})};function Kl(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const a=i[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?XK(s,d=>d.test(a)):KK(s,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function KK(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function XK(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function ZK(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let a=e.valueCallback?e.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const s=t.slice(o.length);return{value:a,rest:s}}}const JK=/^(\d+)(th|st|nd|rd)?/i,QK=/\d+/i,eX={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},tX={any:[/^b/i,/^(a|c)/i]},nX={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},rX={any:[/1/i,/2/i,/3/i,/4/i]},oX={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},iX={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]},aX={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},sX={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]},lX={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},cX={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}},uX={ordinalNumber:ZK({matchPattern:JK,parsePattern:QK,valueCallback:e=>parseInt(e,10)}),era:Kl({matchPatterns:eX,defaultMatchWidth:"wide",parsePatterns:tX,defaultParseWidth:"any"}),quarter:Kl({matchPatterns:nX,defaultMatchWidth:"wide",parsePatterns:rX,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Kl({matchPatterns:oX,defaultMatchWidth:"wide",parsePatterns:iX,defaultParseWidth:"any"}),day:Kl({matchPatterns:aX,defaultMatchWidth:"wide",parsePatterns:sX,defaultParseWidth:"any"}),dayPeriod:Kl({matchPatterns:lX,defaultMatchWidth:"any",parsePatterns:cX,defaultParseWidth:"any"})},mk={code:"en-US",formatDistance:OK,formatLong:LK,formatRelative:BK,localize:YK,match:uX,options:{weekStartsOn:0,firstWeekContainsDate:1}};function dX(e){const t=Ke(e);return jr(t,hk(t))+1}function gk(e){const t=Ke(e),n=+bi(t)-+NK(t);return Math.round(n/Tw)+1}function wk(e,t){var u,d,f,h;const n=Ke(e),r=n.getFullYear(),o=Gl(),i=(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,a=Dn(e,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const s=Or(a,t),l=Dn(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=Or(l,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function fX(e,t){var s,l,c,u;const n=Gl(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,o=wk(e,t),i=Dn(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Or(i,t)}function vk(e,t){const n=Ke(e),r=+Or(n,t)-+fX(n,t);return Math.round(r/Tw)+1}function it(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ho={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return it(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):it(n+1,2)},d(e,t){return it(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 it(e.getHours()%12||12,t.length)},H(e,t){return it(e.getHours(),t.length)},m(e,t){return it(e.getMinutes(),t.length)},s(e,t){return it(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return it(o,t.length)}},Xa={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},yk={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 Ho.y(e,t)},Y:function(e,t,n,r){const o=wk(e,r),i=o>0?o:1-o;if(t==="YY"){const a=i%100;return it(a,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):it(i,t.length)},R:function(e,t){const n=fk(e);return it(n,t.length)},u:function(e,t){const n=e.getFullYear();return it(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 it(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 it(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 Ho.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 it(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=vk(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):it(o,t.length)},I:function(e,t,n){const r=gk(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):it(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ho.d(e,t)},D:function(e,t,n){const r=dX(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):it(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(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return it(i,2);case"eo":return n.ordinalNumber(i,{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(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return it(i,t.length);case"co":return n.ordinalNumber(i,{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 it(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=Xa.noon:r===0?o=Xa.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=Xa.evening:r>=12?o=Xa.afternoon:r>=4?o=Xa.morning:o=Xa.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 Ho.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ho.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):it(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):it(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ho.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ho.s(e,t)},S:function(e,t){return Ho.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return xk(r);case"XXXX":case"XX":return xi(r);case"XXXXX":case"XXX":default:return xi(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return xk(r);case"xxxx":case"xx":return xi(r);case"xxxxx":case"xxx":default:return xi(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+bk(r,":");case"OOOO":default:return"GMT"+xi(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+bk(r,":");case"zzzz":default:return"GMT"+xi(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return it(r,t.length)},T:function(e,t,n){const r=e.getTime();return it(r,t.length)}};function bk(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+it(i,2)}function xk(e,t){return e%60===0?(e>0?"-":"+")+it(Math.abs(e)/60,2):xi(e,t)}function xi(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=it(Math.trunc(r/60),2),i=it(r%60,2);return n+o+t+i}const _k=(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"})}},Sk=(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"})}},hX={p:Sk,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return _k(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",_k(r,t)).replace("{{time}}",Sk(o,t))}},pX=/^D+$/,mX=/^Y+$/,gX=["D","DD","YY","YYYY"];function wX(e){return pX.test(e)}function vX(e){return mX.test(e)}function yX(e,t,n){const r=bX(e,t,n);if(console.warn(r),gX.includes(e))throw new RangeError(r)}function bX(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 xX=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_X=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,SX=/^'([^]*?)'?$/,CX=/''/g,EX=/[a-zA-Z]/;function $r(e,t,n){var u,d,f,h,p,m,v,w;const r=Gl(),o=(n==null?void 0:n.locale)??r.locale??mk,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((m=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((w=(v=r.locale)==null?void 0:v.options)==null?void 0:w.weekStartsOn)??0,s=Ke(e);if(!DK(s))throw new RangeError("Invalid time value");let l=t.match(_X).map(b=>{const x=b[0];if(x==="p"||x==="P"){const _=hX[x];return _(b,o.formatLong)}return b}).join("").match(xX).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const x=b[0];if(x==="'")return{isToken:!1,value:PX(b)};if(yk[x])return{isToken:!0,value:b};if(x.match(EX))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:b}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const c={firstWeekContainsDate:i,weekStartsOn:a,locale:o};return l.map(b=>{if(!b.isToken)return b.value;const x=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&vX(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&wX(x))&&yX(x,t,String(e));const _=yk[x[0]];return _(s,x,o.localize,c)}).join("")}function PX(e){const t=e.match(SX);return t?t[1].replace(CX,"'"):e}function RX(e){const t=Ke(e),n=t.getFullYear(),r=t.getMonth(),o=Dn(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function NX(e){return Math.trunc(+Ke(e)/1e3)}function TX(e){const t=Ke(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function MX(e,t){return AK(TX(e),wn(e),t)+1}function Ow(e,t){const n=Ke(e),r=Ke(t);return n.getTime()>r.getTime()}function Ck(e,t){const n=Ke(e),r=Ke(t);return+n<+r}function jw(e,t){const n=Ke(e),r=Ke(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function kX(e,t){const n=Ke(e),r=Ke(t);return n.getFullYear()===r.getFullYear()}function $w(e,t){return on(e,-t)}function Fw(e,t){const n=Ke(e),r=n.getFullYear(),o=n.getDate(),i=Dn(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const a=RX(i);return n.setMonth(t,Math.min(o,a)),n}function Ek(e,t){const n=Ke(e);return isNaN(+n)?Dn(e,NaN):(n.setFullYear(t),n)}var Ae=function(){return Ae=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ae.apply(this,arguments)};function DX(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 Pk(e,t,n){for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function Xl(e){return e.mode==="multiple"}function Zl(e){return e.mode==="range"}function tf(e){return e.mode==="single"}var AX={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function IX(e,t){return $r(e,"LLLL y",t)}function OX(e,t){return $r(e,"d",t)}function jX(e,t){return $r(e,"LLLL",t)}function $X(e){return"".concat(e)}function FX(e,t){return $r(e,"cccccc",t)}function LX(e,t){return $r(e,"yyyy",t)}var zX=Object.freeze({__proto__:null,formatCaption:IX,formatDay:OX,formatMonthCaption:jX,formatWeekNumber:$X,formatWeekdayName:FX,formatYearCaption:LX}),BX=function(e,t,n){return $r(e,"do MMMM (EEEE)",n)},HX=function(){return"Month: "},VX=function(){return"Go to next month"},UX=function(){return"Go to previous month"},WX=function(e,t){return $r(e,"cccc",t)},GX=function(e){return"Week n. ".concat(e)},qX=function(){return"Year: "},YX=Object.freeze({__proto__:null,labelDay:BX,labelMonthDropdown:HX,labelNext:VX,labelPrevious:UX,labelWeekNumber:GX,labelWeekday:WX,labelYearDropdown:qX});function KX(){var e="buttons",t=AX,n=mk,r={},o={},i=1,a={},s=new Date;return{captionLayout:e,classNames:t,formatters:zX,labels:YX,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:a,today:s,mode:"default"}}function XX(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,a=e.toDate;return r?i=wn(r):t&&(i=new Date(t,0,1)),o?a=Dw(o):n&&(a=new Date(n,11,31)),{fromDate:i?Ka(i):void 0,toDate:a?Ka(a):void 0}}var Rk=E.createContext(void 0);function ZX(e){var t,n=e.initialProps,r=KX(),o=XX(n),i=o.fromDate,a=o.toDate,s=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;s!=="buttons"&&(!i||!a)&&(s="buttons");var l;(tf(n)||Xl(n)||Zl(n))&&(l=n.onSelect);var c=Ae(Ae(Ae({},r),n),{captionLayout:s,classNames:Ae(Ae({},r.classNames),n.classNames),components:Ae({},n.components),formatters:Ae(Ae({},r.formatters),n.formatters),fromDate:i,labels:Ae(Ae({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Ae(Ae({},r.modifiers),n.modifiers),modifiersClassNames:Ae(Ae({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Ae(Ae({},r.styles),n.styles),toDate:a});return g.jsx(Rk.Provider,{value:c,children:e.children})}function ut(){var e=E.useContext(Rk);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function Nk(e){var t=ut(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return g.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function JX(e){return g.jsx("svg",Ae({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:g.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Tk(e){var t,n,r=e.onChange,o=e.value,i=e.children,a=e.caption,s=e.className,l=e.style,c=ut(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:JX;return g.jsxs("div",{className:s,style:l,children:[g.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),g.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),g.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[a,g.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function QX(e){var t,n=ut(),r=n.fromDate,o=n.toDate,i=n.styles,a=n.locale,s=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return g.jsx(g.Fragment,{});if(!o)return g.jsx(g.Fragment,{});var d=[];if(kX(r,o))for(var f=wn(r),h=r.getMonth();h<=o.getMonth();h++)d.push(Fw(f,h));else for(var f=wn(new Date),h=0;h<=11;h++)d.push(Fw(f,h));var p=function(v){var w=Number(v.target.value),b=Fw(wn(e.displayMonth),w);e.onChange(b)},m=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:Tk;return g.jsx(m,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:p,value:e.displayMonth.getMonth(),caption:s(e.displayMonth,{locale:a}),children:d.map(function(v){return g.jsx("option",{value:v.getMonth(),children:s(v,{locale:a})},v.getMonth())})})}function eZ(e){var t,n=e.displayMonth,r=ut(),o=r.fromDate,i=r.toDate,a=r.locale,s=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,f=[];if(!o)return g.jsx(g.Fragment,{});if(!i)return g.jsx(g.Fragment,{});for(var h=o.getFullYear(),p=i.getFullYear(),m=h;m<=p;m++)f.push(Ek(hk(new Date),m));var v=function(b){var x=Ek(wn(n),Number(b.target.value));e.onChange(x)},w=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:Tk;return g.jsx(w,{name:"years","aria-label":d(),className:l.dropdown_year,style:s.dropdown_year,onChange:v,value:n.getFullYear(),caption:u(n,{locale:a}),children:f.map(function(b){return g.jsx("option",{value:b.getFullYear(),children:u(b,{locale:a})},b.getFullYear())})})}function tZ(e,t){var n=E.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function nZ(e){var t=e.month,n=e.defaultMonth,r=e.today,o=t||n||r||new Date,i=e.toDate,a=e.fromDate,s=e.numberOfMonths,l=s===void 0?1:s;if(i&&ql(i,o)<0){var c=-1*(l-1);o=or(i,c)}return a&&ql(o,a)<0&&(o=a),wn(o)}function rZ(){var e=ut(),t=nZ(e),n=tZ(t,e.month),r=n[0],o=n[1],i=function(a){var s;if(!e.disableNavigation){var l=wn(a);o(l),(s=e.onMonthChange)===null||s===void 0||s.call(e,l)}};return[r,i]}function oZ(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=wn(e),i=wn(or(o,r)),a=ql(i,o),s=[],l=0;l<a;l++){var c=or(o,l);s.push(c)}return n&&(s=s.reverse()),s}function iZ(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,a=r?i:1,s=wn(e);if(!n)return or(s,a);var l=ql(n,e);if(!(l<i))return or(s,a)}}function aZ(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,a=r?i:1,s=wn(e);if(!n)return or(s,-a);var l=ql(s,n);if(!(l<=0))return or(s,-a)}}var Mk=E.createContext(void 0);function sZ(e){var t=ut(),n=rZ(),r=n[0],o=n[1],i=oZ(r,t),a=iZ(r,t),s=aZ(r,t),l=function(d){return i.some(function(f){return jw(d,f)})},c=function(d,f){l(d)||(f&&Ck(d,f)?o(or(d,1+t.numberOfMonths*-1)):o(d))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:s,nextMonth:a,isDateDisplayed:l};return g.jsx(Mk.Provider,{value:u,children:e.children})}function Jl(){var e=E.useContext(Mk);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function kk(e){var t,n=ut(),r=n.classNames,o=n.styles,i=n.components,a=Jl().goToMonth,s=function(u){a(or(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:Nk,c=g.jsx(l,{id:e.id,displayMonth:e.displayMonth});return g.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[g.jsx("div",{className:r.vhidden,children:c}),g.jsx(QX,{onChange:s,displayMonth:e.displayMonth}),g.jsx(eZ,{onChange:s,displayMonth:e.displayMonth})]})}function lZ(e){return g.jsx("svg",Ae({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:g.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function cZ(e){return g.jsx("svg",Ae({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:g.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var nf=E.forwardRef(function(e,t){var n=ut(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var a=i.join(" "),s=Ae(Ae({},o.button_reset),o.button);return e.style&&Object.assign(s,e.style),g.jsx("button",Ae({},e,{ref:t,type:"button",className:a,style:s}))});function uZ(e){var t,n,r=ut(),o=r.dir,i=r.locale,a=r.classNames,s=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return g.jsx(g.Fragment,{});var f=c(e.previousMonth,{locale:i}),h=[a.nav_button,a.nav_button_previous].join(" "),p=u(e.nextMonth,{locale:i}),m=[a.nav_button,a.nav_button_next].join(" "),v=(t=d==null?void 0:d.IconRight)!==null&&t!==void 0?t:cZ,w=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:lZ;return g.jsxs("div",{className:a.nav,style:s.nav,children:[!e.hidePrevious&&g.jsx(nf,{name:"previous-month","aria-label":f,className:h,style:s.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?g.jsx(v,{className:a.nav_icon,style:s.nav_icon}):g.jsx(w,{className:a.nav_icon,style:s.nav_icon})}),!e.hideNext&&g.jsx(nf,{name:"next-month","aria-label":p,className:m,style:s.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?g.jsx(w,{className:a.nav_icon,style:s.nav_icon}):g.jsx(v,{className:a.nav_icon,style:s.nav_icon})})]})}function Dk(e){var t=ut().numberOfMonths,n=Jl(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,a=n.displayMonths,s=a.findIndex(function(p){return jw(e.displayMonth,p)}),l=s===0,c=s===a.length-1,u=t>1&&(l||!c),d=t>1&&(c||!l),f=function(){r&&i(r)},h=function(){o&&i(o)};return g.jsx(uZ,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:o,previousMonth:r,onPreviousClick:f,onNextClick:h})}function dZ(e){var t,n=ut(),r=n.classNames,o=n.disableNavigation,i=n.styles,a=n.captionLayout,s=n.components,l=(t=s==null?void 0:s.CaptionLabel)!==null&&t!==void 0?t:Nk,c;return o?c=g.jsx(l,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?c=g.jsx(kk,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?c=g.jsxs(g.Fragment,{children:[g.jsx(kk,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),g.jsx(Dk,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=g.jsxs(g.Fragment,{children:[g.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),g.jsx(Dk,{displayMonth:e.displayMonth,id:e.id})]}),g.jsx("div",{className:r.caption,style:i.caption,children:c})}function fZ(e){var t=ut(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?g.jsx("tfoot",{className:o,style:r.tfoot,children:g.jsx("tr",{children:g.jsx("td",{colSpan:8,children:n})})}):g.jsx(g.Fragment,{})}function hZ(e,t,n){for(var r=n?bi(new Date):Or(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var a=on(r,i);o.push(a)}return o}function pZ(){var e=ut(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,i=e.weekStartsOn,a=e.ISOWeek,s=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=hZ(o,i,a);return g.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&g.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,d){return g.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:o}),children:s(u,{locale:o})},d)})]})}function mZ(){var e,t=ut(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:pZ;return g.jsx("thead",{style:r.head,className:n.head,children:g.jsx(i,{})})}function gZ(e){var t=ut(),n=t.locale,r=t.formatters.formatDay;return g.jsx(g.Fragment,{children:r(e.date,{locale:n})})}var Lw=E.createContext(void 0);function wZ(e){if(!Xl(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return g.jsx(Lw.Provider,{value:t,children:e.children})}return g.jsx(vZ,{initialProps:e.initialProps,children:e.children})}function vZ(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,a=function(c,u,d){var f,h;(f=t.onDayClick)===null||f===void 0||f.call(t,c,u,d);var p=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!p){var m=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!m){var v=r?Pk([],r):[];if(u.selected){var w=v.findIndex(function(b){return gn(c,b)});v.splice(w,1)}else v.push(c);(h=t.onSelect)===null||h===void 0||h.call(t,v,c,u,d)}}},s={disabled:[]};r&&s.disabled.push(function(c){var u=i&&r.length>i-1,d=r.some(function(f){return gn(f,c)});return!!(u&&!d)});var l={selected:r,onDayClick:a,modifiers:s};return g.jsx(Lw.Provider,{value:l,children:n})}function zw(){var e=E.useContext(Lw);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function yZ(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?gn(o,e)&&gn(r,e)?void 0:gn(o,e)?{from:o,to:void 0}:gn(r,e)?void 0:Ow(r,e)?{from:e,to:o}:{from:r,to:e}:o?Ow(e,o)?{from:o,to:e}:{from:e,to:o}:r?Ck(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var Bw=E.createContext(void 0);function bZ(e){if(!Zl(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return g.jsx(Bw.Provider,{value:t,children:e.children})}return g.jsx(xZ,{initialProps:e.initialProps,children:e.children})}function xZ(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},i=o.from,a=o.to,s=t.min,l=t.max,c=function(h,p,m){var v,w;(v=t.onDayClick)===null||v===void 0||v.call(t,h,p,m);var b=yZ(h,r);(w=t.onSelect)===null||w===void 0||w.call(t,b,h,p,m)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],a?(u.range_end=[a],gn(i,a)||(u.range_middle=[{after:i,before:a}])):u.range_end=[i]):a&&(u.range_start=[a],u.range_end=[a]),s&&(i&&!a&&u.disabled.push({after:$w(i,s-1),before:on(i,s-1)}),i&&a&&u.disabled.push({after:i,before:on(i,s-1)}),!i&&a&&u.disabled.push({after:$w(a,s-1),before:on(a,s-1)})),l){if(i&&!a&&(u.disabled.push({before:on(i,-l+1)}),u.disabled.push({after:on(i,l-1)})),i&&a){var d=jr(a,i)+1,f=l-d;u.disabled.push({before:$w(i,f)}),u.disabled.push({after:on(a,f)})}!i&&a&&(u.disabled.push({before:on(a,-l+1)}),u.disabled.push({after:on(a,l-1)}))}return g.jsx(Bw.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function Hw(){var e=E.useContext(Bw);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function rf(e){return Array.isArray(e)?Pk([],e):e!==void 0?[e]:[]}function _Z(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=rf(o)}),t}var ir;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(ir||(ir={}));var SZ=ir.Selected,no=ir.Disabled,CZ=ir.Hidden,EZ=ir.Today,Vw=ir.RangeEnd,Uw=ir.RangeMiddle,Ww=ir.RangeStart,PZ=ir.Outside;function RZ(e,t,n){var r,o=(r={},r[SZ]=rf(e.selected),r[no]=rf(e.disabled),r[CZ]=rf(e.hidden),r[EZ]=[e.today],r[Vw]=[],r[Uw]=[],r[Ww]=[],r[PZ]=[],r);return e.fromDate&&o[no].push({before:e.fromDate}),e.toDate&&o[no].push({after:e.toDate}),Xl(e)?o[no]=o[no].concat(t.modifiers[no]):Zl(e)&&(o[no]=o[no].concat(n.modifiers[no]),o[Ww]=n.modifiers[Ww],o[Uw]=n.modifiers[Uw],o[Vw]=n.modifiers[Vw]),o}var Ak=E.createContext(void 0);function NZ(e){var t=ut(),n=zw(),r=Hw(),o=RZ(t,n,r),i=_Z(t.modifiers),a=Ae(Ae({},o),i);return g.jsx(Ak.Provider,{value:a,children:e.children})}function Ik(){var e=E.useContext(Ak);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function TZ(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function MZ(e){return!!(e&&typeof e=="object"&&"from"in e)}function kZ(e){return!!(e&&typeof e=="object"&&"after"in e)}function DZ(e){return!!(e&&typeof e=="object"&&"before"in e)}function AZ(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function IZ(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=jr(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var a=jr(e,r)>=0&&jr(o,e)>=0;return a}return o?gn(o,e):r?gn(r,e):!1}function OZ(e){return kw(e)}function jZ(e){return Array.isArray(e)&&e.every(kw)}function $Z(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(OZ(n))return gn(e,n);if(jZ(n))return n.includes(e);if(MZ(n))return IZ(e,n);if(AZ(n))return n.dayOfWeek.includes(e.getDay());if(TZ(n)){var r=jr(n.before,e),o=jr(n.after,e),i=r>0,a=o<0,s=Ow(n.before,n.after);return s?a&&i:i||a}return kZ(n)?jr(e,n.after)>0:DZ(n)?jr(n.before,e)>0:typeof n=="function"?n(e):!1})}function Gw(e,t,n){var r=Object.keys(t).reduce(function(i,a){var s=t[a];return $Z(e,s)&&i.push(a),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!jw(e,n)&&(o.outside=!0),o}function FZ(e,t){for(var n=wn(e[0]),r=Dw(e[e.length-1]),o,i,a=n;a<=r;){var s=Gw(a,t),l=!s.disabled&&!s.hidden;if(!l){a=on(a,1);continue}if(s.selected)return a;s.today&&!i&&(i=a),o||(o=a),a=on(a,1)}return i||o}var LZ=365;function Ok(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,a=t.retry,s=a===void 0?{count:0,lastFocused:e}:a,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,f={day:on,week:Mw,month:or,year:TK,startOfWeek:function(v){return o.ISOWeek?bi(v):Or(v,{locale:d,weekStartsOn:l})},endOfWeek:function(v){return o.ISOWeek?pk(v):Aw(v,{locale:d,weekStartsOn:l})}},h=f[n](e,r==="after"?1:-1);r==="before"&&c?h=MK([c,h]):r==="after"&&u&&(h=kK([u,h]));var p=!0;if(i){var m=Gw(h,i);p=!m.disabled&&!m.hidden}return p?h:s.count>LZ?s.lastFocused:Ok(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:Ae(Ae({},s),{count:s.count+1})})}var jk=E.createContext(void 0);function zZ(e){var t=Jl(),n=Ik(),r=E.useState(),o=r[0],i=r[1],a=E.useState(),s=a[0],l=a[1],c=FZ(t.displayMonths,n),u=o??(s&&t.isDateDisplayed(s))?s:c,d=function(){l(o),i(void 0)},f=function(v){i(v)},h=ut(),p=function(v,w){if(o){var b=Ok(o,{moveBy:v,direction:w,context:h,modifiers:n});gn(o,b)||(t.goToDate(b,o),f(b))}},m={focusedDay:o,focusTarget:u,blur:d,focus:f,focusDayAfter:function(){return p("day","after")},focusDayBefore:function(){return p("day","before")},focusWeekAfter:function(){return p("week","after")},focusWeekBefore:function(){return p("week","before")},focusMonthBefore:function(){return p("month","before")},focusMonthAfter:function(){return p("month","after")},focusYearBefore:function(){return p("year","before")},focusYearAfter:function(){return p("year","after")},focusStartOfWeek:function(){return p("startOfWeek","before")},focusEndOfWeek:function(){return p("endOfWeek","after")}};return g.jsx(jk.Provider,{value:m,children:e.children})}function qw(){var e=E.useContext(jk);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function BZ(e,t){var n=Ik(),r=Gw(e,n,t);return r}var Yw=E.createContext(void 0);function HZ(e){if(!tf(e.initialProps)){var t={selected:void 0};return g.jsx(Yw.Provider,{value:t,children:e.children})}return g.jsx(VZ,{initialProps:e.initialProps,children:e.children})}function VZ(e){var t=e.initialProps,n=e.children,r=function(i,a,s){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,a,s),a.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,i,a,s);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,a,s)},o={selected:t.selected,onDayClick:r};return g.jsx(Yw.Provider,{value:o,children:n})}function $k(){var e=E.useContext(Yw);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function UZ(e,t){var n=ut(),r=$k(),o=zw(),i=Hw(),a=qw(),s=a.focusDayAfter,l=a.focusDayBefore,c=a.focusWeekAfter,u=a.focusWeekBefore,d=a.blur,f=a.focus,h=a.focusMonthBefore,p=a.focusMonthAfter,m=a.focusYearBefore,v=a.focusYearAfter,w=a.focusStartOfWeek,b=a.focusEndOfWeek,x=function(Z){var B,oe,ee,ne;tf(n)?(B=r.onDayClick)===null||B===void 0||B.call(r,e,t,Z):Xl(n)?(oe=o.onDayClick)===null||oe===void 0||oe.call(o,e,t,Z):Zl(n)?(ee=i.onDayClick)===null||ee===void 0||ee.call(i,e,t,Z):(ne=n.onDayClick)===null||ne===void 0||ne.call(n,e,t,Z)},_=function(Z){var B;f(e),(B=n.onDayFocus)===null||B===void 0||B.call(n,e,t,Z)},C=function(Z){var B;d(),(B=n.onDayBlur)===null||B===void 0||B.call(n,e,t,Z)},N=function(Z){var B;(B=n.onDayMouseEnter)===null||B===void 0||B.call(n,e,t,Z)},R=function(Z){var B;(B=n.onDayMouseLeave)===null||B===void 0||B.call(n,e,t,Z)},T=function(Z){var B;(B=n.onDayPointerEnter)===null||B===void 0||B.call(n,e,t,Z)},M=function(Z){var B;(B=n.onDayPointerLeave)===null||B===void 0||B.call(n,e,t,Z)},D=function(Z){var B;(B=n.onDayTouchCancel)===null||B===void 0||B.call(n,e,t,Z)},A=function(Z){var B;(B=n.onDayTouchEnd)===null||B===void 0||B.call(n,e,t,Z)},O=function(Z){var B;(B=n.onDayTouchMove)===null||B===void 0||B.call(n,e,t,Z)},$=function(Z){var B;(B=n.onDayTouchStart)===null||B===void 0||B.call(n,e,t,Z)},W=function(Z){var B;(B=n.onDayKeyUp)===null||B===void 0||B.call(n,e,t,Z)},re=function(Z){var B;switch(Z.key){case"ArrowLeft":Z.preventDefault(),Z.stopPropagation(),n.dir==="rtl"?s():l();break;case"ArrowRight":Z.preventDefault(),Z.stopPropagation(),n.dir==="rtl"?l():s();break;case"ArrowDown":Z.preventDefault(),Z.stopPropagation(),c();break;case"ArrowUp":Z.preventDefault(),Z.stopPropagation(),u();break;case"PageUp":Z.preventDefault(),Z.stopPropagation(),Z.shiftKey?m():h();break;case"PageDown":Z.preventDefault(),Z.stopPropagation(),Z.shiftKey?v():p();break;case"Home":Z.preventDefault(),Z.stopPropagation(),w();break;case"End":Z.preventDefault(),Z.stopPropagation(),b();break}(B=n.onDayKeyDown)===null||B===void 0||B.call(n,e,t,Z)},Y={onClick:x,onFocus:_,onBlur:C,onKeyDown:re,onKeyUp:W,onMouseEnter:N,onMouseLeave:R,onPointerEnter:T,onPointerLeave:M,onTouchCancel:D,onTouchEnd:A,onTouchMove:O,onTouchStart:$};return Y}function WZ(){var e=ut(),t=$k(),n=zw(),r=Hw(),o=tf(e)?t.selected:Xl(e)?n.selected:Zl(e)?r.selected:void 0;return o}function GZ(e){return Object.values(ir).includes(e)}function qZ(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var o=e.modifiersClassNames[r];if(o)n.push(o);else if(GZ(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function YZ(e,t){var n=Ae({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=Ae(Ae({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function KZ(e,t,n){var r,o,i,a=ut(),s=qw(),l=BZ(e,t),c=UZ(e,l),u=WZ(),d=!!(a.onDayClick||a.mode!=="default");E.useEffect(function(){var N;l.outside||s.focusedDay&&d&&gn(s.focusedDay,e)&&((N=n.current)===null||N===void 0||N.focus())},[s.focusedDay,e,n,d,l.outside]);var f=qZ(a,l).join(" "),h=YZ(a,l),p=!!(l.outside&&!a.showOutsideDays||l.hidden),m=(i=(o=a.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:gZ,v=g.jsx(m,{date:e,displayMonth:t,activeModifiers:l}),w={style:h,className:f,children:v,role:"gridcell"},b=s.focusTarget&&gn(s.focusTarget,e)&&!l.outside,x=s.focusedDay&&gn(s.focusedDay,e),_=Ae(Ae(Ae({},w),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=x||b?0:-1,r)),c),C={isButton:d,isHidden:p,activeModifiers:l,selectedDays:u,buttonProps:_,divProps:w};return C}function XZ(e){var t=E.useRef(null),n=KZ(e.date,e.displayMonth,t);return n.isHidden?g.jsx("div",{role:"gridcell"}):n.isButton?g.jsx(nf,Ae({name:"day",ref:t},n.buttonProps)):g.jsx("div",Ae({},n.divProps))}function ZZ(e){var t=e.number,n=e.dates,r=ut(),o=r.onWeekNumberClick,i=r.styles,a=r.classNames,s=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:s});if(!o)return g.jsx("span",{className:a.weeknumber,style:i.weeknumber,children:u});var d=l(Number(t),{locale:s}),f=function(h){o(t,n,h)};return g.jsx(nf,{name:"week-number","aria-label":d,className:a.weeknumber,style:i.weeknumber,onClick:f,children:u})}function JZ(e){var t,n,r=ut(),o=r.styles,i=r.classNames,a=r.showWeekNumber,s=r.components,l=(t=s==null?void 0:s.Day)!==null&&t!==void 0?t:XZ,c=(n=s==null?void 0:s.WeekNumber)!==null&&n!==void 0?n:ZZ,u;return a&&(u=g.jsx("td",{className:i.cell,style:o.cell,children:g.jsx(c,{number:e.weekNumber,dates:e.dates})})),g.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(d){return g.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:g.jsx(l,{displayMonth:e.displayMonth,date:d})},NX(d))})]})}function Fk(e,t,n){for(var r=n!=null&&n.ISOWeek?pk(t):Aw(t,n),o=n!=null&&n.ISOWeek?bi(e):Or(e,n),i=jr(r,o),a=[],s=0;s<=i;s++)a.push(on(o,s));var l=a.reduce(function(c,u){var d=n!=null&&n.ISOWeek?gk(u):vk(u,n),f=c.find(function(h){return h.weekNumber===d});return f?(f.dates.push(u),c):(c.push({weekNumber:d,dates:[u]}),c)},[]);return l}function QZ(e,t){var n=Fk(wn(e),Dw(e),t);if(t!=null&&t.useFixedWeeks){var r=MX(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],a=Mw(i,6-r),s=Fk(Mw(i,1),a,t);n.push.apply(n,s)}}return n}function eJ(e){var t,n,r,o=ut(),i=o.locale,a=o.classNames,s=o.styles,l=o.hideHead,c=o.fixedWeeks,u=o.components,d=o.weekStartsOn,f=o.firstWeekContainsDate,h=o.ISOWeek,p=QZ(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:h,locale:i,weekStartsOn:d,firstWeekContainsDate:f}),m=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:mZ,v=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:JZ,w=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:fZ;return g.jsxs("table",{id:e.id,className:a.table,style:s.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&g.jsx(m,{}),g.jsx("tbody",{className:a.tbody,style:s.tbody,children:p.map(function(b){return g.jsx(v,{displayMonth:e.displayMonth,dates:b.dates,weekNumber:b.weekNumber},b.weekNumber)})}),g.jsx(w,{displayMonth:e.displayMonth})]})}function tJ(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var nJ=tJ()?E.useLayoutEffect:E.useEffect,Kw=!1,rJ=0;function Lk(){return"react-day-picker-".concat(++rJ)}function oJ(e){var t,n=e??(Kw?Lk():null),r=E.useState(n),o=r[0],i=r[1];return nJ(function(){o===null&&i(Lk())},[]),E.useEffect(function(){Kw===!1&&(Kw=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function iJ(e){var t,n,r=ut(),o=r.dir,i=r.classNames,a=r.styles,s=r.components,l=Jl().displayMonths,c=oJ(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,d=[i.month],f=a.month,h=e.displayIndex===0,p=e.displayIndex===l.length-1,m=!h&&!p;o==="rtl"&&(t=[h,p],p=t[0],h=t[1]),h&&(d.push(i.caption_start),f=Ae(Ae({},f),a.caption_start)),p&&(d.push(i.caption_end),f=Ae(Ae({},f),a.caption_end)),m&&(d.push(i.caption_between),f=Ae(Ae({},f),a.caption_between));var v=(n=s==null?void 0:s.Caption)!==null&&n!==void 0?n:dZ;return g.jsxs("div",{className:d.join(" "),style:f,children:[g.jsx(v,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),g.jsx(eJ,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function aJ(e){var t=ut(),n=t.classNames,r=t.styles;return g.jsx("div",{className:n.months,style:r.months,children:e.children})}function sJ(e){var t,n,r=e.initialProps,o=ut(),i=qw(),a=Jl(),s=E.useState(!1),l=s[0],c=s[1];E.useEffect(function(){o.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),c(!0)))},[o.initialFocus,l,i.focus,i.focusTarget,i]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var d=Ae(Ae({},o.styles.root),o.style),f=Object.keys(r).filter(function(p){return p.startsWith("data-")}).reduce(function(p,m){var v;return Ae(Ae({},p),(v={},v[m]=r[m],v))},{}),h=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:aJ;return g.jsx("div",Ae({className:u.join(" "),style:d,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},f,{children:g.jsx(h,{children:a.displayMonths.map(function(p,m){return g.jsx(iJ,{displayIndex:m,displayMonth:p},m)})})}))}function lJ(e){var t=e.children,n=DX(e,["children"]);return g.jsx(ZX,{initialProps:n,children:g.jsx(sZ,{children:g.jsx(HZ,{initialProps:n,children:g.jsx(wZ,{initialProps:n,children:g.jsx(bZ,{initialProps:n,children:g.jsx(NZ,{children:g.jsx(zZ,{children:t})})})})})})})}function cJ(e){return g.jsx(lJ,Ae({},e,{children:g.jsx(sJ,{initialProps:e})}))}function of({className:e,classNames:t,showOutsideDays:n=!0,...r}){const{variants:o}=Bo(),i=E.useMemo(()=>kn(o.button.defaultStyles,{variants:o.button.variantStyles,defaultVariants:o.button.defaultVariants}),[o]);return g.jsx(cJ,{showOutsideDays:n,className:Q("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Q(i({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:Q(i({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-foreground aria-selected:opacity-30",day_disabled:"text-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:()=>g.jsx(Zd,{className:"h-4 w-4"}),IconRight:()=>g.jsx(Lo,{className:"h-4 w-4"})},...r})}of.displayName="Calendar";const zk=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));zk.displayName="Card";const Bk=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("flex flex-col space-y-1.5 p-6",e),...t}));Bk.displayName="CardHeader";const Hk=y.forwardRef(({className:e,...t},n)=>g.jsx("h3",{ref:n,className:Q("text-2xl font-semibold leading-none tracking-tight",e),...t}));Hk.displayName="CardTitle";const Vk=y.forwardRef(({className:e,...t},n)=>g.jsx("p",{ref:n,className:Q("text-sm text-foreground",e),...t}));Vk.displayName="CardDescription";const Uk=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("p-6 pt-0",e),...t}));Uk.displayName="CardContent";const Wk=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("flex items-center p-6 pt-0",e),...t}));Wk.displayName="CardFooter";function uJ(e){return Object.prototype.toString.call(e)==="[object Object]"}function Gk(e){return uJ(e)||Array.isArray(e)}function dJ(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Xw(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const o=JSON.stringify(Object.keys(e.breakpoints||{})),i=JSON.stringify(Object.keys(t.breakpoints||{}));return o!==i?!1:n.every(a=>{const s=e[a],l=t[a];return typeof s=="function"?`${s}`==`${l}`:!Gk(s)||!Gk(l)?s===l:Xw(s,l)})}function qk(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function fJ(e,t){if(e.length!==t.length)return!1;const n=qk(e),r=qk(t);return n.every((o,i)=>{const a=r[i];return Xw(o,a)})}function Zw(e){return typeof e=="number"}function Jw(e){return typeof e=="string"}function af(e){return typeof e=="boolean"}function Yk(e){return Object.prototype.toString.call(e)==="[object Object]"}function vt(e){return Math.abs(e)}function Qw(e){return Math.sign(e)}function Ql(e,t){return vt(e-t)}function hJ(e,t){if(e===0||t===0||vt(e)<=vt(t))return 0;const n=Ql(vt(e),vt(t));return vt(n/e)}function pJ(e){return Math.round(e*100)/100}function ec(e){return nc(e).map(Number)}function ar(e){return e[tc(e)]}function tc(e){return Math.max(0,e.length-1)}function ev(e,t){return t===tc(e)}function Kk(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function nc(e){return Object.keys(e)}function Xk(e,t){return[e,t].reduce((n,r)=>(nc(r).forEach(o=>{const i=n[o],a=r[o],s=Yk(i)&&Yk(a);n[o]=s?Xk(i,a):a}),n),{})}function tv(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function mJ(e,t){const n={start:r,center:o,end:i};function r(){return 0}function o(l){return i(l)/2}function i(l){return t-l}function a(l,c){return Jw(e)?n[e](l):e(t,l,c)}return{measure:a}}function rc(){let e=[];function t(o,i,a,s={passive:!0}){let l;if("addEventListener"in o)o.addEventListener(i,a,s),l=()=>o.removeEventListener(i,a,s);else{const c=o;c.addListener(a),l=()=>c.removeListener(a)}return e.push(l),r}function n(){e=e.filter(o=>o())}const r={add:t,clear:n};return r}function gJ(e,t,n,r){const o=rc(),i=1e3/60;let a=null,s=0,l=0;function c(){o.add(e,"visibilitychange",()=>{e.hidden&&p()})}function u(){h(),o.clear()}function d(v){if(!l)return;a||(a=v,n(),n());const w=v-a;for(a=v,s+=w;s>=i;)n(),s-=i;const b=s/i;r(b),l&&(l=t.requestAnimationFrame(d))}function f(){l||(l=t.requestAnimationFrame(d))}function h(){t.cancelAnimationFrame(l),a=null,s=0,l=0}function p(){a=null,s=0}return{init:c,destroy:u,start:f,stop:h,update:n,render:r}}function wJ(e,t){const n=t==="rtl",r=e==="y",o=r?"y":"x",i=r?"x":"y",a=!r&&n?-1:1,s=u(),l=d();function c(p){const{height:m,width:v}=p;return r?m:v}function u(){return r?"top":n?"right":"left"}function d(){return r?"bottom":n?"left":"right"}function f(p){return p*a}return{scroll:o,cross:i,startEdge:s,endEdge:l,measureSize:c,direction:f}}function _i(e=0,t=0){const n=vt(e-t);function r(c){return c<e}function o(c){return c>t}function i(c){return r(c)||o(c)}function a(c){return i(c)?r(c)?e:t:c}function s(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:a,reachedAny:i,reachedMax:o,reachedMin:r,removeOffset:s}}function Zk(e,t,n){const{constrain:r}=_i(0,e),o=e+1;let i=a(t);function a(f){return n?vt((o+f)%o):r(f)}function s(){return i}function l(f){return i=a(f),d}function c(f){return u().set(s()+f)}function u(){return Zk(e,s(),n)}const d={get:s,set:l,add:c,clone:u};return d}function vJ(e,t,n,r,o,i,a,s,l,c,u,d,f,h,p,m,v,w,b){const{cross:x,direction:_}=e,C=["INPUT","SELECT","TEXTAREA"],N={passive:!1},R=rc(),T=rc(),M=_i(50,225).constrain(h.measure(20)),D={mouse:300,touch:400},A={mouse:500,touch:600},O=p?43:25;let $=!1,W=0,re=0,Y=!1,Z=!1,B=!1,oe=!1;function ee(H){if(!b)return;function ue(ye){(af(b)||b(H,ye))&&L(ye)}const se=t;R.add(se,"dragstart",ye=>ye.preventDefault(),N).add(se,"touchmove",()=>{},N).add(se,"touchend",()=>{}).add(se,"touchstart",ue).add(se,"mousedown",ue).add(se,"touchcancel",z).add(se,"contextmenu",z).add(se,"click",ie,!0)}function ne(){R.clear(),T.clear()}function G(){const H=oe?n:t;T.add(H,"touchmove",K,N).add(H,"touchend",z).add(H,"mousemove",K,N).add(H,"mouseup",z)}function F(H){const ue=H.nodeName||"";return C.includes(ue)}function q(){return(p?A:D)[oe?"mouse":"touch"]}function ce(H,ue){const se=d.add(Qw(H)*-1),ye=u.byDistance(H,!p).distance;return p||vt(H)<M?ye:v&&ue?ye*.5:u.byIndex(se.get(),0).distance}function L(H){const ue=tv(H,r);oe=ue,B=p&&ue&&!H.buttons&&$,$=Ql(o.get(),a.get())>=2,!(ue&&H.button!==0)&&(F(H.target)||(Y=!0,i.pointerDown(H),c.useFriction(0).useDuration(0),o.set(a),G(),W=i.readPoint(H),re=i.readPoint(H,x),f.emit("pointerDown")))}function K(H){if(!tv(H,r)&&H.touches.length>=2)return z(H);const se=i.readPoint(H),ye=i.readPoint(H,x),Ce=Ql(se,W),xe=Ql(ye,re);if(!Z&&!oe&&(!H.cancelable||(Z=Ce>xe,!Z)))return z(H);const j=i.pointerMove(H);Ce>m&&(B=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(_(j)),H.preventDefault()}function z(H){const se=u.byDistance(0,!1).index!==d.get(),ye=i.pointerUp(H)*q(),Ce=ce(_(ye),se),xe=hJ(ye,Ce),j=O-10*xe,V=w+xe/50;Z=!1,Y=!1,T.clear(),c.useDuration(j).useFriction(V),l.distance(Ce,!p),oe=!1,f.emit("pointerUp")}function ie(H){B&&(H.stopPropagation(),H.preventDefault(),B=!1)}function le(){return Y}return{init:ee,destroy:ne,pointerDown:le}}function yJ(e,t){let r,o;function i(d){return d.timeStamp}function a(d,f){const p=`client${(f||e.scroll)==="x"?"X":"Y"}`;return(tv(d,t)?d:d.touches[0])[p]}function s(d){return r=d,o=d,a(d)}function l(d){const f=a(d)-a(o),h=i(d)-i(r)>170;return o=d,h&&(r=d),f}function c(d){if(!r||!o)return 0;const f=a(o)-a(r),h=i(d)-i(r),p=i(d)-i(o)>170,m=f/h;return h&&!p&&vt(m)>.1?m:0}return{pointerDown:s,pointerMove:l,pointerUp:c,readPoint:a}}function bJ(){function e(n){const{offsetTop:r,offsetLeft:o,offsetWidth:i,offsetHeight:a}=n;return{top:r,right:o+i,bottom:r+a,left:o,width:i,height:a}}return{measure:e}}function xJ(e){function t(r){return e*(r/100)}return{measure:t}}function _J(e,t,n,r,o,i,a){const s=[e].concat(r);let l,c,u=[],d=!1;function f(v){return o.measureSize(a.measure(v))}function h(v){if(!i)return;c=f(e),u=r.map(f);function w(b){for(const x of b){if(d)return;const _=x.target===e,C=r.indexOf(x.target),N=_?c:u[C],R=f(_?e:r[C]);if(vt(R-N)>=.5){v.reInit(),t.emit("resize");break}}}l=new ResizeObserver(b=>{(af(i)||i(v,b))&&w(b)}),n.requestAnimationFrame(()=>{s.forEach(b=>l.observe(b))})}function p(){d=!0,l&&l.disconnect()}return{init:h,destroy:p}}function SJ(e,t,n,r,o,i){let a=0,s=0,l=o,c=i,u=e.get(),d=0;function f(){const N=r.get()-e.get(),R=!l;let T=0;return R?(a=0,n.set(r),e.set(r),T=N):(n.set(e),a+=N/l,a*=c,u+=a,e.add(a),T=u-d),s=Qw(T),d=u,C}function h(){const N=r.get()-t.get();return vt(N)<.001}function p(){return l}function m(){return s}function v(){return a}function w(){return x(o)}function b(){return _(i)}function x(N){return l=N,C}function _(N){return c=N,C}const C={direction:m,duration:p,velocity:v,seek:f,settled:h,useBaseFriction:b,useBaseDuration:w,useFriction:_,useDuration:x};return C}function CJ(e,t,n,r,o){const i=o.measure(10),a=o.measure(50),s=_i(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(h){if(!c())return;const p=e.reachedMin(t.get())?"min":"max",m=vt(e[p]-t.get()),v=n.get()-t.get(),w=s.constrain(m/a);n.subtract(v*w),!h&&vt(v)<i&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function d(h){l=!h}return{shouldConstrain:c,constrain:u,toggleActive:d}}function EJ(e,t,n,r,o){const i=_i(-t+e,0),a=d(),s=u(),l=f();function c(p,m){return Ql(p,m)<=1}function u(){const p=a[0],m=ar(a),v=a.lastIndexOf(p),w=a.indexOf(m)+1;return _i(v,w)}function d(){return n.map((p,m)=>{const{min:v,max:w}=i,b=i.constrain(p),x=!m,_=ev(n,m);return x?w:_||c(v,b)?v:c(w,b)?w:b}).map(p=>parseFloat(p.toFixed(3)))}function f(){if(t<=e+o)return[i.max];if(r==="keepSnaps")return a;const{min:p,max:m}=s;return a.slice(p,m)}return{snapsContained:l,scrollContainLimit:s}}function PJ(e,t,n){const r=t[0],o=n?r-e:ar(t);return{limit:_i(o,r)}}function RJ(e,t,n,r){const i=t.min+.1,a=t.max+.1,{reachedMin:s,reachedMax:l}=_i(i,a);function c(f){return f===1?l(n.get()):f===-1?s(n.get()):!1}function u(f){if(!c(f))return;const h=e*(f*-1);r.forEach(p=>p.add(h))}return{loop:u}}function NJ(e){const{max:t,length:n}=e;function r(i){const a=i-t;return n?a/-n:0}return{get:r}}function TJ(e,t,n,r,o){const{startEdge:i,endEdge:a}=e,{groupSlides:s}=o,l=d().map(t.measure),c=f(),u=h();function d(){return s(r).map(m=>ar(m)[a]-m[0][i]).map(vt)}function f(){return r.map(m=>n[i]-m[i]).map(m=>-vt(m))}function h(){return s(c).map(m=>m[0]).map((m,v)=>m+l[v])}return{snaps:c,snapsAligned:u}}function MJ(e,t,n,r,o,i){const{groupSlides:a}=o,{min:s,max:l}=r,c=u();function u(){const f=a(i),h=!e||t==="keepSnaps";return n.length===1?[i]:h?f:f.slice(s,l).map((p,m,v)=>{const w=!m,b=ev(v,m);if(w){const x=ar(v[0])+1;return Kk(x)}if(b){const x=tc(i)-ar(v)[0]+1;return Kk(x,ar(v)[0])}return p})}return{slideRegistry:c}}function kJ(e,t,n,r,o){const{reachedAny:i,removeOffset:a,constrain:s}=r;function l(p){return p.concat().sort((m,v)=>vt(m)-vt(v))[0]}function c(p){const m=e?a(p):s(p),v=t.map((b,x)=>({diff:u(b-m,0),index:x})).sort((b,x)=>vt(b.diff)-vt(x.diff)),{index:w}=v[0];return{index:w,distance:m}}function u(p,m){const v=[p,p+n,p-n];if(!e)return p;if(!m)return l(v);const w=v.filter(b=>Qw(b)===m);return w.length?l(w):ar(v)-n}function d(p,m){const v=t[p]-o.get(),w=u(v,m);return{index:p,distance:w}}function f(p,m){const v=o.get()+p,{index:w,distance:b}=c(v),x=!e&&i(v);if(!m||x)return{index:w,distance:p};const _=t[w]-b,C=p+u(_,0);return{index:w,distance:C}}return{byDistance:f,byIndex:d,shortcut:u}}function DJ(e,t,n,r,o,i,a){function s(d){const f=d.distance,h=d.index!==t.get();i.add(f),f&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),h&&(n.set(t.get()),t.set(d.index),a.emit("select"))}function l(d,f){const h=o.byDistance(d,f);s(h)}function c(d,f){const h=t.clone().set(d),p=o.byIndex(h.get(),f);s(p)}return{distance:l,index:c}}function AJ(e,t,n,r,o,i,a,s){const l={passive:!0,capture:!0};let c=0;function u(h){if(!s)return;function p(m){if(new Date().getTime()-c>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const b=n.findIndex(x=>x.includes(m));Zw(b)&&(o.useDuration(0),r.index(b,0),a.emit("slideFocus"))}i.add(document,"keydown",d,!1),t.forEach((m,v)=>{i.add(m,"focus",w=>{(af(s)||s(h,w))&&p(v)},l)})}function d(h){h.code==="Tab"&&(c=new Date().getTime())}return{init:u}}function oc(e){let t=e;function n(){return t}function r(l){t=a(l)}function o(l){t+=a(l)}function i(l){t-=a(l)}function a(l){return Zw(l)?l:l.get()}return{get:n,set:r,add:o,subtract:i}}function Jk(e,t){const n=e.scroll==="x"?a:s,r=t.style;let o=null,i=!1;function a(f){return`translate3d(${f}px,0px,0px)`}function s(f){return`translate3d(0px,${f}px,0px)`}function l(f){if(i)return;const h=pJ(e.direction(f));h!==o&&(r.transform=n(h),o=h)}function c(f){i=!f}function u(){i||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:u,to:l,toggleActive:c}}function IJ(e,t,n,r,o,i,a,s,l){const u=ec(o),d=ec(o).reverse(),f=w().concat(b());function h(R,T){return R.reduce((M,D)=>M-o[D],T)}function p(R,T){return R.reduce((M,D)=>h(M,T)>0?M.concat([D]):M,[])}function m(R){return i.map((T,M)=>({start:T-r[M]+.5+R,end:T+t-.5+R}))}function v(R,T,M){const D=m(T);return R.map(A=>{const O=M?0:-n,$=M?n:0,W=M?"end":"start",re=D[A][W];return{index:A,loopPoint:re,slideLocation:oc(-1),translate:Jk(e,l[A]),target:()=>s.get()>re?O:$}})}function w(){const R=a[0],T=p(d,R);return v(T,n,!1)}function b(){const R=t-a[0]-1,T=p(u,R);return v(T,-n,!0)}function x(){return f.every(({index:R})=>{const T=u.filter(M=>M!==R);return h(T,t)<=.1})}function _(){f.forEach(R=>{const{target:T,translate:M,slideLocation:D}=R,A=T();A!==D.get()&&(M.to(A),D.set(A))})}function C(){f.forEach(R=>R.translate.clear())}return{canLoop:x,clear:C,loop:_,loopPoints:f}}function OJ(e,t,n){let r,o=!1;function i(l){if(!n)return;function c(u){for(const d of u)if(d.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(u=>{o||(af(n)||n(l,u))&&c(u)}),r.observe(e,{childList:!0})}function a(){r&&r.disconnect(),o=!0}return{init:i,destroy:a}}function jJ(e,t,n,r){const o={};let i=null,a=null,s,l=!1;function c(){s=new IntersectionObserver(p=>{l||(p.forEach(m=>{const v=t.indexOf(m.target);o[v]=m}),i=null,a=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(p=>s.observe(p))}function u(){s&&s.disconnect(),l=!0}function d(p){return nc(o).reduce((m,v)=>{const w=parseInt(v),{isIntersecting:b}=o[w];return(p&&b||!p&&!b)&&m.push(w),m},[])}function f(p=!0){if(p&&i)return i;if(!p&&a)return a;const m=d(p);return p&&(i=m),p||(a=m),m}return{init:c,destroy:u,get:f}}function $J(e,t,n,r,o,i){const{measureSize:a,startEdge:s,endEdge:l}=e,c=n[0]&&o,u=p(),d=m(),f=n.map(a),h=v();function p(){if(!c)return 0;const b=n[0];return vt(t[s]-b[s])}function m(){if(!c)return 0;const b=i.getComputedStyle(ar(r));return parseFloat(b.getPropertyValue(`margin-${l}`))}function v(){return n.map((b,x,_)=>{const C=!x,N=ev(_,x);return C?f[x]+u:N?f[x]+d:_[x+1][s]-b[s]}).map(vt)}return{slideSizes:f,slideSizesWithGaps:h,startGap:u,endGap:d}}function FJ(e,t,n,r,o,i,a,s,l){const{startEdge:c,endEdge:u,direction:d}=e,f=Zw(n);function h(w,b){return ec(w).filter(x=>x%b===0).map(x=>w.slice(x,x+b))}function p(w){return w.length?ec(w).reduce((b,x,_)=>{const C=ar(b)||0,N=C===0,R=x===tc(w),T=o[c]-i[C][c],M=o[c]-i[x][u],D=!r&&N?d(a):0,A=!r&&R?d(s):0,O=vt(M-A-(T+D));return _&&O>t+l&&b.push(x),R&&b.push(w.length),b},[]).map((b,x,_)=>{const C=Math.max(_[x-1]||0);return w.slice(C,b)}):[]}function m(w){return f?h(w,n):p(w)}return{groupSlides:m}}function LJ(e,t,n,r,o,i,a){const{align:s,axis:l,direction:c,startIndex:u,loop:d,duration:f,dragFree:h,dragThreshold:p,inViewThreshold:m,slidesToScroll:v,skipSnaps:w,containScroll:b,watchResize:x,watchSlides:_,watchDrag:C,watchFocus:N}=i,R=2,T=bJ(),M=T.measure(t),D=n.map(T.measure),A=wJ(l,c),O=A.measureSize(M),$=xJ(O),W=mJ(s,O),re=!d&&!!b,Y=d||!!b,{slideSizes:Z,slideSizesWithGaps:B,startGap:oe,endGap:ee}=$J(A,M,D,n,Y,o),ne=FJ(A,O,v,d,M,D,oe,ee,R),{snaps:G,snapsAligned:F}=TJ(A,W,M,D,ne),q=-ar(G)+ar(B),{snapsContained:ce,scrollContainLimit:L}=EJ(O,q,F,b,R),K=re?ce:F,{limit:z}=PJ(q,K,d),ie=Zk(tc(K),u,d),le=ie.clone(),ae=ec(n),H=({dragHandler:I,scrollBody:U,scrollBounds:te,options:{loop:he}})=>{he||te.constrain(I.pointerDown()),U.seek()},ue=({scrollBody:I,translate:U,location:te,offsetLocation:he,previousLocation:Oe,scrollLooper:Qe,slideLooper:nt,dragHandler:st,animation:We,eventHandler:Te,scrollBounds:Ze,options:{loop:et}},He)=>{const Ee=I.settled(),Ge=!Ze.shouldConstrain(),qe=et?Ee:Ee&&Ge;qe&&!st.pointerDown()&&(We.stop(),Te.emit("settle")),qe||Te.emit("scroll");const wt=te.get()*He+Oe.get()*(1-He);he.set(wt),et&&(Qe.loop(I.direction()),nt.loop()),U.to(he.get())},se=gJ(r,o,()=>H(P),I=>ue(P,I)),ye=.68,Ce=K[ie.get()],xe=oc(Ce),j=oc(Ce),V=oc(Ce),J=oc(Ce),we=SJ(xe,V,j,J,f,ye),pe=kJ(d,K,q,z,J),fe=DJ(se,ie,le,we,pe,J,a),ge=NJ(z),_e=rc(),Xe=jJ(t,n,a,m),{slideRegistry:k}=MJ(re,b,K,L,ne,ae),S=AJ(e,n,k,fe,we,_e,a,N),P={ownerDocument:r,ownerWindow:o,eventHandler:a,containerRect:M,slideRects:D,animation:se,axis:A,dragHandler:vJ(A,e,r,o,J,yJ(A,o),xe,se,fe,we,pe,ie,a,$,h,p,w,ye,C),eventStore:_e,percentOfView:$,index:ie,indexPrevious:le,limit:z,location:xe,offsetLocation:V,previousLocation:j,options:i,resizeHandler:_J(t,a,o,n,A,x,T),scrollBody:we,scrollBounds:CJ(z,V,J,we,$),scrollLooper:RJ(q,z,V,[xe,V,j,J]),scrollProgress:ge,scrollSnapList:K.map(ge.get),scrollSnaps:K,scrollTarget:pe,scrollTo:fe,slideLooper:IJ(A,O,q,Z,B,G,K,V,n),slideFocus:S,slidesHandler:OJ(t,a,_),slidesInView:Xe,slideIndexes:ae,slideRegistry:k,slidesToScroll:ne,target:J,translate:Jk(A,t)};return P}function zJ(){let e={},t;function n(c){t=c}function r(c){return e[c]||[]}function o(c){return r(c).forEach(u=>u(t,c)),l}function i(c,u){return e[c]=r(c).concat([u]),l}function a(c,u){return e[c]=r(c).filter(d=>d!==u),l}function s(){e={}}const l={init:n,emit:o,off:a,on:i,clear:s};return l}const BJ={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function HJ(e){function t(i,a){return Xk(i,a||{})}function n(i){const a=i.breakpoints||{},s=nc(a).filter(l=>e.matchMedia(l).matches).map(l=>a[l]).reduce((l,c)=>t(l,c),{});return t(i,s)}function r(i){return i.map(a=>nc(a.breakpoints||{})).reduce((a,s)=>a.concat(s),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function VJ(e){let t=[];function n(i,a){return t=a.filter(({options:s})=>e.optionsAtMedia(s).active!==!1),t.forEach(s=>s.init(i,e)),a.reduce((s,l)=>Object.assign(s,{[l.name]:l}),{})}function r(){t=t.filter(i=>i.destroy())}return{init:n,destroy:r}}function sf(e,t,n){const r=e.ownerDocument,o=r.defaultView,i=HJ(o),a=VJ(i),s=rc(),l=zJ(),{mergeOptions:c,optionsAtMedia:u,optionsMediaQueries:d}=i,{on:f,off:h,emit:p}=l,m=A;let v=!1,w,b=c(BJ,sf.globalOptions),x=c(b),_=[],C,N,R;function T(){const{container:ae,slides:H}=x;N=(Jw(ae)?e.querySelector(ae):ae)||e.children[0];const se=Jw(H)?N.querySelectorAll(H):H;R=[].slice.call(se||N.children)}function M(ae){const H=LJ(e,N,R,r,o,ae,l);if(ae.loop&&!H.slideLooper.canLoop()){const ue=Object.assign({},ae,{loop:!1});return M(ue)}return H}function D(ae,H){v||(b=c(b,ae),x=u(b),_=H||_,T(),w=M(x),d([b,..._.map(({options:ue})=>ue)]).forEach(ue=>s.add(ue,"change",A)),x.active&&(w.translate.to(w.location.get()),w.animation.init(),w.slidesInView.init(),w.slideFocus.init(le),w.eventHandler.init(le),w.resizeHandler.init(le),w.slidesHandler.init(le),w.options.loop&&w.slideLooper.loop(),N.offsetParent&&R.length&&w.dragHandler.init(le),C=a.init(le,_)))}function A(ae,H){const ue=ne();O(),D(c({startIndex:ue},ae),H),l.emit("reInit")}function O(){w.dragHandler.destroy(),w.eventStore.clear(),w.translate.clear(),w.slideLooper.clear(),w.resizeHandler.destroy(),w.slidesHandler.destroy(),w.slidesInView.destroy(),w.animation.destroy(),a.destroy(),s.clear()}function $(){v||(v=!0,s.clear(),O(),l.emit("destroy"),l.clear())}function W(ae,H,ue){!x.active||v||(w.scrollBody.useBaseFriction().useDuration(H===!0?0:x.duration),w.scrollTo.index(ae,ue||0))}function re(ae){const H=w.index.add(1).get();W(H,ae,-1)}function Y(ae){const H=w.index.add(-1).get();W(H,ae,1)}function Z(){return w.index.add(1).get()!==ne()}function B(){return w.index.add(-1).get()!==ne()}function oe(){return w.scrollSnapList}function ee(){return w.scrollProgress.get(w.location.get())}function ne(){return w.index.get()}function G(){return w.indexPrevious.get()}function F(){return w.slidesInView.get()}function q(){return w.slidesInView.get(!1)}function ce(){return C}function L(){return w}function K(){return e}function z(){return N}function ie(){return R}const le={canScrollNext:Z,canScrollPrev:B,containerNode:z,internalEngine:L,destroy:$,off:h,on:f,emit:p,plugins:ce,previousScrollSnap:G,reInit:m,rootNode:K,scrollNext:re,scrollPrev:Y,scrollProgress:ee,scrollSnapList:oe,scrollTo:W,selectedScrollSnap:ne,slideNodes:ie,slidesInView:F,slidesNotInView:q};return D(t,n),setTimeout(()=>l.emit("init"),0),le}sf.globalOptions=void 0;function nv(e={},t=[]){const n=E.useRef(e),r=E.useRef(t),[o,i]=E.useState(),[a,s]=E.useState(),l=E.useCallback(()=>{o&&o.reInit(n.current,r.current)},[o]);return E.useEffect(()=>{Xw(n.current,e)||(n.current=e,l())},[e,l]),E.useEffect(()=>{fJ(r.current,t)||(r.current=t,l())},[t,l]),E.useEffect(()=>{if(dJ()&&a){sf.globalOptions=nv.globalOptions;const c=sf(a,n.current,r.current);return i(c),()=>c.destroy()}else i(void 0)},[a,i]),[s,o]}nv.globalOptions=void 0;const Qk=E.forwardRef(({orientation:e="horizontal",opts:t,setApi:n,plugins:r,className:o,children:i,...a},s)=>{const[l,c]=nv({...t,axis:e==="horizontal"?"x":"y"},r),[u,d]=E.useState(!1),[f,h]=E.useState(!1),[p,m]=E.useState(0),v=E.useCallback(()=>{c&&(m(c.selectedScrollSnap()),d(c.canScrollPrev()),h(c.canScrollNext()))},[c]);return E.useEffect(()=>{c&&(v(),c.on("select",v),c.on("reInit",v),n&&n(c))},[c,v,n]),g.jsxs("div",{ref:s,className:Q("relative",o),...a,children:[g.jsx("div",{ref:l,className:"overflow-hidden",dir:"ltr",children:g.jsx("div",{className:Q("flex",e==="horizontal"?"-ml-4":"-mt-4 flex-col",[e==="horizontal"?"touch-pan-x":"touch-pan-y"]),children:E.Children.map(i,w=>g.jsx("div",{className:Q("min-w-0 flex-[0_0_100%]",e==="horizontal"?"pl-4":"pt-4"),children:w}))})}),g.jsxs("div",{className:"flex items-center justify-center gap-2 py-2",children:[g.jsxs(rr,{variant:"outline",size:"icon",className:Q("h-8 w-8 rounded-full",!u&&"opacity-50"),disabled:!u,onClick:()=>c==null?void 0:c.scrollPrev(),children:[g.jsx(Zd,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Previous slide"})]}),g.jsx("div",{className:"flex gap-1",children:E.Children.map(i,(w,b)=>g.jsx(rr,{variant:"outline",size:"icon",className:Q("h-2 w-2 rounded-full","bg-primary"),onClick:()=>c==null?void 0:c.scrollTo(b),children:g.jsxs("span",{className:"sr-only",children:["Jump to slide ",b+1]})},b))}),g.jsxs(rr,{variant:"outline",size:"icon",className:Q("h-8 w-8 rounded-full",!f&&"opacity-50"),disabled:!f,onClick:()=>c==null?void 0:c.scrollNext(),children:[g.jsx(Lo,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Next slide"})]})]})]})});Qk.displayName="Carousel";const eD=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,role:"list",className:Q("",e),...t}));eD.displayName="CarouselContent";const tD=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,role:"listitem",className:Q("",e),...t}));tD.displayName="CarouselItem";const nD=E.forwardRef(({className:e,...t},n)=>g.jsxs(rr,{ref:n,variant:"outline",size:"icon",className:Q("absolute left-2 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full",e),...t,children:[g.jsx(Zd,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Previous slide"})]}));nD.displayName="CarouselPrevious";const rD=E.forwardRef(({className:e,...t},n)=>g.jsxs(rr,{ref:n,variant:"outline",size:"icon",className:Q("absolute right-2 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full",e),...t,children:[g.jsx(Lo,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Next slide"})]}));rD.displayName="CarouselNext";const oD=E.forwardRef(({className:e,...t},n)=>g.jsx(jC,{ref:n,className:Q("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:g.jsx(DW,{className:Q("flex items-center justify-center text-current"),children:g.jsx(Wa,{className:"h-4 w-4"})})}));oD.displayName=jC.displayName;const UJ=n1,WJ=gm,iD=E.forwardRef(({children:e,...t},n)=>g.jsx(vm,{ref:n,className:"data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",...t,children:e}));iD.displayName="CollapsibleContent";var aD=1,GJ=.9,qJ=.8,YJ=.17,rv=.1,ov=.999,KJ=.9999,XJ=.99,ZJ=/[\\\/_+.#"@\[\(\{&]/,JJ=/[\\\/_+.#"@\[\(\{&]/g,QJ=/[\s-]/,sD=/[\s-]/g;function iv(e,t,n,r,o,i,a){if(i===t.length)return o===e.length?aD:XJ;var s=`${o},${i}`;if(a[s]!==void 0)return a[s];for(var l=r.charAt(i),c=n.indexOf(l,o),u=0,d,f,h,p;c>=0;)d=iv(e,t,n,r,c+1,i+1,a),d>u&&(c===o?d*=aD:ZJ.test(e.charAt(c-1))?(d*=qJ,h=e.slice(o,c-1).match(JJ),h&&o>0&&(d*=Math.pow(ov,h.length))):QJ.test(e.charAt(c-1))?(d*=GJ,p=e.slice(o,c-1).match(sD),p&&o>0&&(d*=Math.pow(ov,p.length))):(d*=YJ,o>0&&(d*=Math.pow(ov,c-o))),e.charAt(c)!==t.charAt(i)&&(d*=KJ)),(d<rv&&n.charAt(c-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(c-1)!==r.charAt(i))&&(f=iv(e,t,n,r,c+1,i+2,a),f*rv>d&&(d=f*rv)),d>u&&(u=d),c=n.indexOf(l,c+1);return a[s]=u,u}function lD(e){return e.toLowerCase().replace(sD," ")}function eQ(e,t){return iv(e,t,lD(e),lD(t),0,0,{})}function $t(){return $t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$t.apply(null,arguments)}function Si(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 tQ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function cD(...e){return t=>e.forEach(n=>tQ(n,t))}function ic(...e){return E.useCallback(cD(...e),e)}function nQ(e,t=[]){let n=[];function r(i,a){const s=E.createContext(a),l=n.length;n=[...n,a];function c(d){const{scope:f,children:h,...p}=d,m=(f==null?void 0:f[e][l])||s,v=E.useMemo(()=>p,Object.values(p));return E.createElement(m.Provider,{value:v},h)}function u(d,f){const h=(f==null?void 0:f[e][l])||s,p=E.useContext(h);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(a=>E.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return E.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,rQ(o,...t)]}function rQ(...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(i){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...s,...d}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}const av=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},oQ=y.useId||(()=>{});let iQ=0;function sv(e){const[t,n]=y.useState(oQ());return av(()=>{e||n(r=>r??String(iQ++))},[e]),e||(t?`radix-${t}`:"")}function Ci(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function aQ({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=sQ({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=Ci(n),l=E.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function sQ({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,o=E.useRef(r),i=Ci(t);return E.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const lv=E.forwardRef((e,t)=>{const{children:n,...r}=e,o=E.Children.toArray(n),i=o.find(cQ);if(i){const a=i.props.children,s=o.map(l=>l===i?E.Children.count(a)>1?E.Children.only(null):E.isValidElement(a)?a.props.children:null:l);return E.createElement(cv,$t({},r,{ref:t}),E.isValidElement(a)?E.cloneElement(a,void 0,s):null)}return E.createElement(cv,$t({},r,{ref:t}),n)});lv.displayName="Slot";const cv=E.forwardRef((e,t)=>{const{children:n,...r}=e;return E.isValidElement(n)?E.cloneElement(n,{...uQ(r,n.props),ref:cD(t,n.ref)}):E.Children.count(n)>1?E.Children.only(null):null});cv.displayName="SlotClone";const lQ=({children:e})=>E.createElement(E.Fragment,null,e);function cQ(e){return E.isValidElement(e)&&e.type===lQ}function uQ(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?n[r]=(...s)=>{i==null||i(...s),o==null||o(...s)}:r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const Ei=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=E.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?lv:t;return E.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),E.createElement(s,$t({},a,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function dQ(e,t){e&&ur.flushSync(()=>e.dispatchEvent(t))}function fQ(e){const t=Ci(e);E.useEffect(()=>{const n=r=>{r.key==="Escape"&&t(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t])}const uv="dismissableLayer.update",hQ="dismissableLayer.pointerDownOutside",pQ="dismissableLayer.focusOutside";let uD;const mQ=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gQ=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=E.useContext(mQ),[u,d]=E.useState(null),[,f]=E.useState({}),h=ic(t,N=>d(N)),p=Array.from(c.layers),[m]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(m),w=u?p.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,x=w>=v,_=wQ(N=>{const R=N.target,T=[...c.branches].some(M=>M.contains(R));!x||T||(o==null||o(N),a==null||a(N),N.defaultPrevented||s==null||s())}),C=vQ(N=>{const R=N.target;[...c.branches].some(M=>M.contains(R))||(i==null||i(N),a==null||a(N),N.defaultPrevented||s==null||s())});return fQ(N=>{w===c.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&s&&(N.preventDefault(),s()))}),E.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(uD=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),dD(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=uD)}},[u,n,c]),E.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),dD())},[u,c]),E.useEffect(()=>{const N=()=>f({});return document.addEventListener(uv,N),()=>document.removeEventListener(uv,N)},[]),E.createElement(Ei.div,$t({},l,{ref:h,style:{pointerEvents:b?x?"auto":"none":void 0,...e.style},onFocusCapture:Si(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Si(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Si(e.onPointerDownCapture,_.onPointerDownCapture)}))});function wQ(e){const t=Ci(e),n=E.useRef(!1),r=E.useRef(()=>{});return E.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){fD(hQ,t,s,{discrete:!0})};const s={originalEvent:a};a.pointerType==="touch"?(document.removeEventListener("click",r.current),r.current=l,document.addEventListener("click",r.current,{once:!0})):l()}n.current=!1},i=window.setTimeout(()=>{document.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),document.removeEventListener("pointerdown",o),document.removeEventListener("click",r.current)}},[t]),{onPointerDownCapture:()=>n.current=!0}}function vQ(e){const t=Ci(e),n=E.useRef(!1);return E.useEffect(()=>{const r=o=>{o.target&&!n.current&&fD(pQ,t,{originalEvent:o},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function dD(){const e=new CustomEvent(uv);document.dispatchEvent(e)}function fD(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?dQ(o,i):o.dispatchEvent(i)}const dv="focusScope.autoFocusOnMount",fv="focusScope.autoFocusOnUnmount",hD={bubbles:!1,cancelable:!0},yQ=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=E.useState(null),c=Ci(o),u=Ci(i),d=E.useRef(null),f=ic(t,m=>l(m)),h=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let m=function(w){if(h.paused||!s)return;const b=w.target;s.contains(b)?d.current=b:Pi(d.current,{select:!0})},v=function(w){h.paused||!s||s.contains(w.relatedTarget)||Pi(d.current,{select:!0})};return document.addEventListener("focusin",m),document.addEventListener("focusout",v),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v)}}},[r,s,h.paused]),E.useEffect(()=>{if(s){gD.add(h);const m=document.activeElement;if(!s.contains(m)){const w=new CustomEvent(dv,hD);s.addEventListener(dv,c),s.dispatchEvent(w),w.defaultPrevented||(bQ(EQ(pD(s)),{select:!0}),document.activeElement===m&&Pi(s))}return()=>{s.removeEventListener(dv,c),setTimeout(()=>{const w=new CustomEvent(fv,hD);s.addEventListener(fv,u),s.dispatchEvent(w),w.defaultPrevented||Pi(m??document.body,{select:!0}),s.removeEventListener(fv,u),gD.remove(h)},0)}}},[s,c,u,h]);const p=E.useCallback(m=>{if(!n&&!r||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,w=document.activeElement;if(v&&w){const b=m.currentTarget,[x,_]=xQ(b);x&&_?!m.shiftKey&&w===_?(m.preventDefault(),n&&Pi(x,{select:!0})):m.shiftKey&&w===x&&(m.preventDefault(),n&&Pi(_,{select:!0})):w===b&&m.preventDefault()}},[n,r,h.paused]);return E.createElement(Ei.div,$t({tabIndex:-1},a,{ref:f,onKeyDown:p}))});function bQ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pi(r,{select:t}),document.activeElement!==n)return}function xQ(e){const t=pD(e),n=mD(t,e),r=mD(t.reverse(),e);return[n,r]}function pD(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 mD(e,t){for(const n of e)if(!_Q(n,{upTo:t}))return n}function _Q(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function SQ(e){return e instanceof HTMLInputElement&&"select"in e}function Pi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&SQ(e)&&t&&e.select()}}const gD=CQ();function CQ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=wD(e,t),e.unshift(t)},remove(t){var n;e=wD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function wD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function EQ(e){return e.filter(t=>t.tagName!=="A")}const PQ=E.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?ur.createPortal(E.createElement(Ei.div,$t({},o,{ref:t})),r):null});function RQ(e,t){return E.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const lf=e=>{const{present:t,children:n}=e,r=NQ(t),o=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),i=ic(r.ref,o.ref);return typeof n=="function"||r.isPresent?E.cloneElement(o,{ref:i}):null};lf.displayName="Presence";function NQ(e){const[t,n]=E.useState(),r=E.useRef({}),o=E.useRef(e),i=E.useRef("none"),a=e?"mounted":"unmounted",[s,l]=RQ(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const c=cf(r.current);i.current=s==="mounted"?c:"none"},[s]),av(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,h=cf(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]),av(()=>{if(t){const c=d=>{const h=cf(r.current).includes(d.animationName);d.target===t&&h&&ur.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=cf(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(s),ref:E.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function cf(e){return(e==null?void 0:e.animationName)||"none"}let hv=0;function TQ(){E.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:vD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:vD()),hv++,()=>{hv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),hv--}},[])}function vD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var yD=R1(),pv=function(){},uf=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:pv,onWheelCapture:pv,onTouchMoveCapture:pv}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noIsolation,p=e.inert,m=e.allowPinchZoom,v=e.as,w=v===void 0?"div":v,b=Nm(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=f,_=P1([n,t]),C=Wt(Wt({},b),o);return y.createElement(y.Fragment,null,u&&y.createElement(x,{sideCar:yD,removeScrollBar:c,shards:d,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n}),a?y.cloneElement(y.Children.only(s),Wt(Wt({},C),{ref:_})):y.createElement(w,Wt({},C,{className:l,ref:_}),s))});uf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},uf.classNames={fullWidth:Cl,zeroRight:Sl};var mv=!1;if(typeof window<"u")try{var df=Object.defineProperty({},"passive",{get:function(){return mv=!0,!0}});window.addEventListener("test",df,df),window.removeEventListener("test",df,df)}catch{mv=!1}var Za=mv?{passive:!1}:!1,MQ=function(e){var t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},kQ=function(e){var t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},bD=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=xD(e,n);if(r){var o=_D(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},DQ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},AQ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},xD=function(e,t){return e==="v"?MQ(t):kQ(t)},_D=function(e,t){return e==="v"?DQ(t):AQ(t)},IQ=function(e,t){return e==="h"&&t==="rtl"?-1:1},OQ=function(e,t,n,r,o){var i=IQ(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,f=0;do{var h=_D(e,s),p=h[0],m=h[1],v=h[2],w=m-v-i*p;(p||w)&&xD(e,s)&&(d+=w,f+=p),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&d===0||!u&&f===0)&&(c=!0),c},ff=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},SD=function(e){return[e.deltaX,e.deltaY]},CD=function(e){return e&&"current"in e?e.current:e},jQ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$Q=function(e){return`
|
|
402
402
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
403
403
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
404
|
-
`)},FQ=0,Ja=[];function LQ(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),o=y.useState(FQ++)[0],i=y.useState(function(){return km()})[0],a=y.useRef(e);y.useEffect(function(){a.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=C1([e.lockRef.current],(e.shards||[]).map(CD),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(m,v){if("touches"in m&&m.touches.length===2)return!a.current.allowPinchZoom;var w=ff(m),b=n.current,x="deltaX"in m?m.deltaX:b[0]-w[0],_="deltaY"in m?m.deltaY:b[1]-w[1],C,N=m.target,R=Math.abs(x)>Math.abs(_)?"h":"v";if("touches"in m&&R==="h"&&N.type==="range")return!1;var T=bD(R,N);if(!T)return!0;if(T?C=R:(C=R==="v"?"h":"v",T=bD(R,N)),!T)return!1;if(!r.current&&"changedTouches"in m&&(x||_)&&(r.current=C),!C)return!0;var M=r.current||C;return OQ(M,v,m,M==="h"?x:_)},[]),l=y.useCallback(function(m){var v=m;if(!(!Ja.length||Ja[Ja.length-1]!==i)){var w="deltaY"in v?SD(v):ff(v),b=t.current.filter(function(C){return C.name===v.type&&C.target===v.target&&jQ(C.delta,w)})[0];if(b&&b.should){v.preventDefault();return}if(!b){var x=(a.current.shards||[]).map(CD).filter(Boolean).filter(function(C){return C.contains(v.target)}),_=x.length>0?s(v,x[0]):!a.current.noIsolation;_&&v.preventDefault()}}},[]),c=y.useCallback(function(m,v,w,b){var x={name:m,delta:v,target:w,should:b};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(_){return _!==x})},1)},[]),u=y.useCallback(function(m){n.current=ff(m),r.current=void 0},[]),d=y.useCallback(function(m){c(m.type,SD(m),m.target,s(m,e.lockRef.current))},[]),f=y.useCallback(function(m){c(m.type,ff(m),m.target,s(m,e.lockRef.current))},[]);y.useEffect(function(){return Ja.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Za),document.addEventListener("touchmove",l,Za),document.addEventListener("touchstart",u,Za),function(){Ja=Ja.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,Za),document.removeEventListener("touchmove",l,Za),document.removeEventListener("touchstart",u,Za)}},[]);var h=e.removeScrollBar,p=e.inert;return y.createElement(y.Fragment,null,p?y.createElement(i,{styles:$Q(o)}):null,h?y.createElement(D1,{gapMode:"margin"}):null)}const zQ=T1(yD,LQ);var ED=y.forwardRef(function(e,t){return y.createElement(uf,Wt({},e,{ref:t,sideCar:zQ}))});ED.classNames=uf.classNames;const PD="Dialog",[RD,Loe]=nQ(PD),[BQ,Fr]=RD(PD),HQ=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=E.useRef(null),l=E.useRef(null),[c=!1,u]=aQ({prop:r,defaultProp:o,onChange:i});return E.createElement(BQ,{scope:t,triggerRef:s,contentRef:l,contentId:sv(),titleId:sv(),descriptionId:sv(),open:c,onOpenChange:u,onOpenToggle:E.useCallback(()=>u(d=>!d),[u]),modal:a},n)},ND="DialogPortal",[VQ,TD]=RD(ND,{forceMount:void 0}),UQ=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Fr(ND,t);return E.createElement(VQ,{scope:t,forceMount:n},E.Children.map(r,a=>E.createElement(lf,{present:n||i.open},E.createElement(PQ,{asChild:!0,container:o},a))))},gv="DialogOverlay",WQ=E.forwardRef((e,t)=>{const n=TD(gv,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Fr(gv,e.__scopeDialog);return i.modal?E.createElement(lf,{present:r||i.open},E.createElement(GQ,$t({},o,{ref:t}))):null}),GQ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fr(gv,n);return E.createElement(ED,{as:lv,allowPinchZoom:!0,shards:[o.contentRef]},E.createElement(Ei.div,$t({"data-state":OD(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Qa="DialogContent",MD=E.forwardRef((e,t)=>{const n=TD(Qa,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Fr(Qa,e.__scopeDialog);return E.createElement(lf,{present:r||i.open},i.modal?E.createElement(qQ,$t({},o,{ref:t})):E.createElement(YQ,$t({},o,{ref:t})))}),qQ=E.forwardRef((e,t)=>{const n=Fr(Qa,e.__scopeDialog),r=E.useRef(null),o=ic(t,n.contentRef,r);return E.useEffect(()=>{const i=r.current;if(i)return Pl(i)},[]),E.createElement(kD,$t({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Si(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Si(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:Si(e.onFocusOutside,i=>i.preventDefault())}))}),YQ=E.forwardRef((e,t)=>{const n=Fr(Qa,e.__scopeDialog),r=E.useRef(!1);return E.createElement(kD,$t({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i;if((i=e.onCloseAutoFocus)===null||i===void 0||i.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1},onInteractOutside:o=>{var i,a;(i=e.onInteractOutside)===null||i===void 0||i.call(e,o),o.defaultPrevented||(r.current=!0);const s=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(s))&&o.preventDefault()}}))}),kD=E.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=Fr(Qa,n),l=E.useRef(null),c=ic(t,l);return TQ(),E.createElement(E.Fragment,null,E.createElement(yQ,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},E.createElement(gQ,$t({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":OD(s.open)},a,{ref:c,onDismiss:()=>s.onOpenChange(!1)}))),!1)}),DD="DialogTitle",KQ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fr(DD,n);return E.createElement(Ei.h2,$t({id:o.titleId},r,{ref:t}))}),AD="DialogDescription",XQ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fr(AD,n);return E.createElement(Ei.p,$t({id:o.descriptionId},r,{ref:t}))}),ID="DialogClose",ZQ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fr(ID,n);return E.createElement(Ei.button,$t({type:"button"},r,{ref:t,onClick:Si(e.onClick,()=>o.onOpenChange(!1))}))});function OD(e){return e?"open":"closed"}const JQ=HQ,QQ=UQ,eee=WQ,tee=MD;var nee='[cmdk-list-sizer=""]',ac='[cmdk-group=""]',wv='[cmdk-group-items=""]',ree='[cmdk-group-heading=""]',vv='[cmdk-item=""]',jD=`${vv}:not([aria-disabled="true"])`,yv="cmdk-item-select",ro="data-value",oee=(e,t)=>eQ(e,t),$D=y.createContext(void 0),sc=()=>y.useContext($D),FD=y.createContext(void 0),bv=()=>y.useContext(FD),LD=y.createContext(void 0),zD=y.forwardRef((e,t)=>{let n=y.useRef(null),r=ts(()=>{var ee,ne,G;return{search:"",value:(G=(ne=e.value)!=null?ne:(ee=e.defaultValue)==null?void 0:ee.toLowerCase())!=null?G:"",filtered:{count:0,items:new Map,groups:new Set}}}),o=ts(()=>new Set),i=ts(()=>new Map),a=ts(()=>new Map),s=ts(()=>new Set),l=BD(e),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:p,vimBindings:m=!0,...v}=e,w=y.useId(),b=y.useId(),x=y.useId(),_=mee();es(()=>{if(d!==void 0){let ee=d.trim().toLowerCase();r.current.value=ee,_(6,A),C.emit()}},[d]);let C=y.useMemo(()=>({subscribe:ee=>(s.current.add(ee),()=>s.current.delete(ee)),snapshot:()=>r.current,setState:(ee,ne,G)=>{var F,q,ce;if(!Object.is(r.current[ee],ne)){if(r.current[ee]=ne,ee==="search")D(),T(),_(1,M);else if(ee==="value")if(((F=l.current)==null?void 0:F.value)!==void 0){let L=ne??"";(ce=(q=l.current).onValueChange)==null||ce.call(q,L);return}else G||_(5,A);C.emit()}},emit:()=>{s.current.forEach(ee=>ee())}}),[]),N=y.useMemo(()=>({value:(ee,ne)=>{ne!==a.current.get(ee)&&(a.current.set(ee,ne),r.current.filtered.items.set(ee,R(ne)),_(2,()=>{T(),C.emit()}))},item:(ee,ne)=>(o.current.add(ee),ne&&(i.current.has(ne)?i.current.get(ne).add(ee):i.current.set(ne,new Set([ee]))),_(3,()=>{D(),T(),r.current.value||M(),C.emit()}),()=>{a.current.delete(ee),o.current.delete(ee),r.current.filtered.items.delete(ee);let G=j();_(4,()=>{D(),(G==null?void 0:G.getAttribute("id"))===ee&&M(),C.emit()})}),group:ee=>(i.current.has(ee)||i.current.set(ee,new Set),()=>{a.current.delete(ee),i.current.delete(ee)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],commandRef:n,listId:w,inputId:x,labelId:b}),[]);function R(ee){var ne,G;let F=(G=(ne=l.current)==null?void 0:ne.filter)!=null?G:oee;return ee?F(ee,r.current.search):0}function T(){if(!n.current||!r.current.search||l.current.shouldFilter===!1)return;let ee=r.current.filtered.items,ne=[];r.current.filtered.groups.forEach(F=>{let q=i.current.get(F),ce=0;q.forEach(L=>{let K=ee.get(L);ce=Math.max(K,ce)}),ne.push([F,ce])});let G=n.current.querySelector(nee);$().sort((F,q)=>{var ce,L;let K=F.getAttribute(ro),z=q.getAttribute(ro);return((ce=ee.get(z))!=null?ce:0)-((L=ee.get(K))!=null?L:0)}).forEach(F=>{let q=F.closest(wv);q?q.appendChild(F.parentElement===q?F:F.closest(`${wv} > *`)):G.appendChild(F.parentElement===G?F:F.closest(`${wv} > *`))}),ne.sort((F,q)=>q[1]-F[1]).forEach(F=>{let q=n.current.querySelector(`${ac}[${ro}="${F[0]}"]`);q==null||q.parentElement.appendChild(q)})}function M(){let ee=$().find(G=>!G.ariaDisabled),ne=ee==null?void 0:ee.getAttribute(ro);C.setState("value",ne||void 0)}function D(){if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=o.current.size;return}r.current.filtered.groups=new Set;let ee=0;for(let ne of o.current){let G=a.current.get(ne),F=R(G);r.current.filtered.items.set(ne,F),F>0&&ee++}for(let[ne,G]of i.current)for(let F of G)if(r.current.filtered.items.get(F)>0){r.current.filtered.groups.add(ne);break}r.current.filtered.count=ee}function A(){var ee,ne,G;let F=j();F&&(((ee=F.parentElement)==null?void 0:ee.firstChild)===F&&((G=(ne=F.closest(ac))==null?void 0:ne.querySelector(ree))==null||G.scrollIntoView({block:"nearest"})),F.scrollIntoView({block:"nearest"}))}function j(){var ee;return(ee=n.current)==null?void 0:ee.querySelector(`${vv}[aria-selected="true"]`)}function $(){return Array.from(n.current.querySelectorAll(jD))}function W(ee){let ne=$()[ee];ne&&C.setState("value",ne.getAttribute(ro))}function re(ee){var ne;let G=j(),F=$(),q=F.findIndex(L=>L===G),ce=F[q+ee];(ne=l.current)!=null&&ne.loop&&(ce=q+ee<0?F[F.length-1]:q+ee===F.length?F[0]:F[q+ee]),ce&&C.setState("value",ce.getAttribute(ro))}function Y(ee){let ne=j(),G=ne==null?void 0:ne.closest(ac),F;for(;G&&!F;)G=ee>0?hee(G,ac):pee(G,ac),F=G==null?void 0:G.querySelector(jD);F?C.setState("value",F.getAttribute(ro)):re(ee)}let Z=()=>W($().length-1),B=ee=>{ee.preventDefault(),ee.metaKey?Z():ee.altKey?Y(1):re(1)},oe=ee=>{ee.preventDefault(),ee.metaKey?W(0):ee.altKey?Y(-1):re(-1)};return y.createElement("div",{ref:lc([n,t]),...v,"cmdk-root":"",onKeyDown:ee=>{var ne;if((ne=v.onKeyDown)==null||ne.call(v,ee),!ee.defaultPrevented)switch(ee.key){case"n":case"j":{m&&ee.ctrlKey&&B(ee);break}case"ArrowDown":{B(ee);break}case"p":case"k":{m&&ee.ctrlKey&&oe(ee);break}case"ArrowUp":{oe(ee);break}case"Home":{ee.preventDefault(),W(0);break}case"End":{ee.preventDefault(),Z();break}case"Enter":if(!ee.nativeEvent.isComposing){ee.preventDefault();let G=j();if(G){let F=new Event(yv);G.dispatchEvent(F)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:gee},c),y.createElement(FD.Provider,{value:C},y.createElement($D.Provider,{value:N},u)))}),iee=y.forwardRef((e,t)=>{var n,r;let o=y.useId(),i=y.useRef(null),a=y.useContext(LD),s=sc(),l=BD(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;es(()=>s.item(o,a==null?void 0:a.id),[]);let u=HD(o,i,[e.value,e.children,i]),d=bv(),f=Ri(C=>C.value&&C.value===u.current),h=Ri(C=>c||s.filter()===!1?!0:C.search?C.filtered.items.get(o)>0:!0);y.useEffect(()=>{let C=i.current;if(!(!C||e.disabled))return C.addEventListener(yv,p),()=>C.removeEventListener(yv,p)},[h,e.onSelect,e.disabled]);function p(){var C,N;m(),(N=(C=l.current).onSelect)==null||N.call(C,u.current)}function m(){d.setState("value",u.current,!0)}if(!h)return null;let{disabled:v,value:w,onSelect:b,forceMount:x,..._}=e;return y.createElement("div",{ref:lc([i,t]),..._,id:o,"cmdk-item":"",role:"option","aria-disabled":v||void 0,"aria-selected":f||void 0,"data-disabled":v||void 0,"data-selected":f||void 0,onPointerMove:v?void 0:m,onClick:v?void 0:p},e.children)}),aee=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,a=y.useId(),s=y.useRef(null),l=y.useRef(null),c=y.useId(),u=sc(),d=Ri(p=>o||u.filter()===!1?!0:p.search?p.filtered.groups.has(a):!0);es(()=>u.group(a),[]),HD(a,s,[e.value,e.heading,l]);let f=y.useMemo(()=>({id:a,forceMount:o}),[o]),h=y.createElement(LD.Provider,{value:f},r);return y.createElement("div",{ref:lc([s,t]),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&y.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},h))}),see=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=y.useRef(null),i=Ri(a=>!a.search);return!n&&!i?null:y.createElement("div",{ref:lc([o,t]),...r,"cmdk-separator":"",role:"separator"})}),lee=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=bv(),a=Ri(u=>u.search),s=Ri(u=>u.value),l=sc(),c=y.useMemo(()=>{var u;let d=(u=l.commandRef.current)==null?void 0:u.querySelector(`${vv}[${ro}="${s}"]`);return d==null?void 0:d.getAttribute("id")},[s,l.commandRef]);return y.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),y.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:o?e.value:a,onChange:u=>{o||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),cee=y.forwardRef((e,t)=>{let{children:n,...r}=e,o=y.useRef(null),i=y.useRef(null),a=sc();return y.useEffect(()=>{if(i.current&&o.current){let s=i.current,l=o.current,c,u=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let d=s.offsetHeight;l.style.setProperty("--cmdk-list-height",d.toFixed(1)+"px")})});return u.observe(s),()=>{cancelAnimationFrame(c),u.unobserve(s)}}},[]),y.createElement("div",{ref:lc([o,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:a.listId,"aria-labelledby":a.inputId},y.createElement("div",{ref:i,"cmdk-list-sizer":""},n))}),uee=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:a,...s}=e;return y.createElement(JQ,{open:n,onOpenChange:r},y.createElement(QQ,{container:a},y.createElement(eee,{"cmdk-overlay":"",className:o}),y.createElement(tee,{"aria-label":e.label,"cmdk-dialog":"",className:i},y.createElement(zD,{ref:t,...s}))))}),dee=y.forwardRef((e,t)=>{let n=y.useRef(!0),r=Ri(o=>o.filtered.count===0);return y.useEffect(()=>{n.current=!1},[]),n.current||!r?null:y.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})}),fee=y.forwardRef((e,t)=>{let{progress:n,children:r,...o}=e;return y.createElement("div",{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},y.createElement("div",{"aria-hidden":!0},r))}),vn=Object.assign(zD,{List:cee,Item:iee,Input:lee,Group:aee,Separator:see,Dialog:uee,Empty:dee,Loading:fee});function hee(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function pee(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function BD(e){let t=y.useRef(e);return es(()=>{t.current=e}),t}var es=typeof window>"u"?y.useEffect:y.useLayoutEffect;function ts(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function lc(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ri(e){let t=bv(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function HD(e,t,n){let r=y.useRef(),o=sc();return es(()=>{var i;let a=(()=>{var s;for(let l of n){if(typeof l=="string")return l.trim().toLowerCase();if(typeof l=="object"&&"current"in l)return l.current?(s=l.current.textContent)==null?void 0:s.trim().toLowerCase():r.current}})();o.value(e,a),(i=t.current)==null||i.setAttribute(ro,a),r.current=a}),r}var mee=()=>{let[e,t]=y.useState(),n=ts(()=>new Map);return es(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}},gee={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const VD=fd,wee=hd,UD=pd,vee=Na,xv=E.forwardRef(({className:e,...t},n)=>g.jsx(Ca,{ref:n,className:Q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));xv.displayName=Ca.displayName;const _v=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(UD,{children:[g.jsx(xv,{}),g.jsxs(Ea,{ref:r,className:Q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,g.jsxs(Na,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-foreground",children:[g.jsx(NM,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));_v.displayName=Ea.displayName;const WD=({className:e,...t})=>g.jsx("div",{className:Q("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});WD.displayName="DialogHeader";const GD=({className:e,...t})=>g.jsx("div",{className:Q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});GD.displayName="DialogFooter";const qD=E.forwardRef(({className:e,...t},n)=>g.jsx(Pa,{ref:n,className:Q("text-lg font-semibold leading-none tracking-tight",e),...t}));qD.displayName=Pa.displayName;const YD=E.forwardRef(({className:e,...t},n)=>g.jsx(Ra,{ref:n,className:Q("text-sm text-foreground",e),...t}));YD.displayName=Ra.displayName;const hf=y.forwardRef(({className:e,...t},n)=>g.jsx(vn,{ref:n,className:Q("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));hf.displayName=vn.displayName;const yee=({children:e,...t})=>g.jsx(VD,{...t,children:g.jsx(_v,{className:"overflow-hidden p-0 shadow-lg",children:g.jsx(hf,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Sv=y.forwardRef(({className:e,...t},n)=>g.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[g.jsx(C6,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),g.jsx(vn.Input,{ref:n,className:Q("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Sv.displayName=vn.Input.displayName;const KD=y.forwardRef(({className:e,...t},n)=>g.jsx(vn.List,{ref:n,className:Q("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));KD.displayName=vn.List.displayName;const Cv=y.forwardRef((e,t)=>g.jsx(vn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Cv.displayName=vn.Empty.displayName;const Ev=y.forwardRef(({className:e,...t},n)=>g.jsx(vn.Group,{ref:n,className:Q("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-foreground",e),...t}));Ev.displayName=vn.Group.displayName;const XD=y.forwardRef(({className:e,...t},n)=>g.jsx(vn.Separator,{ref:n,className:Q("-mx-1 h-px bg-border",e),...t}));XD.displayName=vn.Separator.displayName;const Pv=y.forwardRef(({className:e,...t},n)=>g.jsx(vn.Item,{ref:n,className:Q("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Pv.displayName=vn.Item.displayName;const ZD=({className:e,...t})=>g.jsx("span",{className:Q("ml-auto text-xs tracking-widest text-foreground",e),...t});ZD.displayName="CommandShortcut";const pf=hq,mf=pq,cc=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>g.jsx(mq,{children:g.jsx(uN,{ref:o,align:t,sideOffset:n,className:Q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));cc.displayName=uN.displayName;function bee({options:e,value:t,onValueChange:n,placeholder:r="Select an option...",emptyText:o="No results found.",className:i}){var l;const[a,s]=E.useState(!1);return g.jsxs(pf,{open:a,onOpenChange:s,children:[g.jsx(mf,{asChild:!0,children:g.jsxs(rr,{variant:"outline",role:"combobox","aria-expanded":a,className:Q("w-[200px] justify-between",i),children:[t?(l=e.find(c=>c.value===t))==null?void 0:l.label:r,g.jsx(_6,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),g.jsx(cc,{className:"w-[200px] p-0",children:g.jsxs(hf,{children:[g.jsx(Sv,{placeholder:r}),g.jsx(Cv,{children:o}),g.jsx(Ev,{children:e.map(c=>g.jsxs(Pv,{value:c.value,onSelect:u=>{n==null||n(u),s(!1)},children:[g.jsx(Wa,{className:Q("mr-2 h-4 w-4",t===c.value?"opacity-100":"opacity-0")}),c.label]},c.value))})]})})]})}const xee=j7,_ee=$7,See=F7,Cee=iP,Eee=z7,Pee=L7,JD=E.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(hP,{ref:o,className:Q("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,g.jsx(Lo,{className:"ml-auto h-4 w-4"})]}));JD.displayName=hP.displayName;const QD=E.forwardRef(({className:e,...t},n)=>g.jsx(pP,{ref:n,className:Q("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));QD.displayName=pP.displayName;const eA=E.forwardRef(({className:e,...t},n)=>g.jsx(iP,{children:g.jsx(aP,{ref:n,className:Q("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));eA.displayName=aP.displayName;const tA=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(lP,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));tA.displayName=lP.displayName;const nA=E.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(cP,{ref:o,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(dP,{children:g.jsx(Wa,{className:"h-4 w-4"})})}),t]}));nA.displayName=cP.displayName;const rA=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(uP,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(dP,{children:g.jsx(Jd,{className:"h-2 w-2 fill-current"})})}),t]}));rA.displayName=uP.displayName;const oA=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(sP,{ref:r,className:Q("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));oA.displayName=sP.displayName;const iA=E.forwardRef(({className:e,...t},n)=>g.jsx(fP,{ref:n,className:Q("-mx-1 my-1 h-px bg-border",e),...t}));iA.displayName=fP.displayName;const aA=({className:e,...t})=>g.jsx("span",{className:Q("ml-auto text-xs tracking-widest text-foreground",e),...t});aA.displayName="ContextMenuShortcut";/**
|
|
404
|
+
`)},FQ=0,Ja=[];function LQ(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),o=y.useState(FQ++)[0],i=y.useState(function(){return km()})[0],a=y.useRef(e);y.useEffect(function(){a.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=C1([e.lockRef.current],(e.shards||[]).map(CD),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(m,v){if("touches"in m&&m.touches.length===2)return!a.current.allowPinchZoom;var w=ff(m),b=n.current,x="deltaX"in m?m.deltaX:b[0]-w[0],_="deltaY"in m?m.deltaY:b[1]-w[1],C,N=m.target,R=Math.abs(x)>Math.abs(_)?"h":"v";if("touches"in m&&R==="h"&&N.type==="range")return!1;var T=bD(R,N);if(!T)return!0;if(T?C=R:(C=R==="v"?"h":"v",T=bD(R,N)),!T)return!1;if(!r.current&&"changedTouches"in m&&(x||_)&&(r.current=C),!C)return!0;var M=r.current||C;return OQ(M,v,m,M==="h"?x:_)},[]),l=y.useCallback(function(m){var v=m;if(!(!Ja.length||Ja[Ja.length-1]!==i)){var w="deltaY"in v?SD(v):ff(v),b=t.current.filter(function(C){return C.name===v.type&&C.target===v.target&&jQ(C.delta,w)})[0];if(b&&b.should){v.preventDefault();return}if(!b){var x=(a.current.shards||[]).map(CD).filter(Boolean).filter(function(C){return C.contains(v.target)}),_=x.length>0?s(v,x[0]):!a.current.noIsolation;_&&v.preventDefault()}}},[]),c=y.useCallback(function(m,v,w,b){var x={name:m,delta:v,target:w,should:b};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(_){return _!==x})},1)},[]),u=y.useCallback(function(m){n.current=ff(m),r.current=void 0},[]),d=y.useCallback(function(m){c(m.type,SD(m),m.target,s(m,e.lockRef.current))},[]),f=y.useCallback(function(m){c(m.type,ff(m),m.target,s(m,e.lockRef.current))},[]);y.useEffect(function(){return Ja.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Za),document.addEventListener("touchmove",l,Za),document.addEventListener("touchstart",u,Za),function(){Ja=Ja.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,Za),document.removeEventListener("touchmove",l,Za),document.removeEventListener("touchstart",u,Za)}},[]);var h=e.removeScrollBar,p=e.inert;return y.createElement(y.Fragment,null,p?y.createElement(i,{styles:$Q(o)}):null,h?y.createElement(D1,{gapMode:"margin"}):null)}const zQ=T1(yD,LQ);var ED=y.forwardRef(function(e,t){return y.createElement(uf,Wt({},e,{ref:t,sideCar:zQ}))});ED.classNames=uf.classNames;const PD="Dialog",[RD,Loe]=nQ(PD),[BQ,Fr]=RD(PD),HQ=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=E.useRef(null),l=E.useRef(null),[c=!1,u]=aQ({prop:r,defaultProp:o,onChange:i});return E.createElement(BQ,{scope:t,triggerRef:s,contentRef:l,contentId:sv(),titleId:sv(),descriptionId:sv(),open:c,onOpenChange:u,onOpenToggle:E.useCallback(()=>u(d=>!d),[u]),modal:a},n)},ND="DialogPortal",[VQ,TD]=RD(ND,{forceMount:void 0}),UQ=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Fr(ND,t);return E.createElement(VQ,{scope:t,forceMount:n},E.Children.map(r,a=>E.createElement(lf,{present:n||i.open},E.createElement(PQ,{asChild:!0,container:o},a))))},gv="DialogOverlay",WQ=E.forwardRef((e,t)=>{const n=TD(gv,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Fr(gv,e.__scopeDialog);return i.modal?E.createElement(lf,{present:r||i.open},E.createElement(GQ,$t({},o,{ref:t}))):null}),GQ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fr(gv,n);return E.createElement(ED,{as:lv,allowPinchZoom:!0,shards:[o.contentRef]},E.createElement(Ei.div,$t({"data-state":OD(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Qa="DialogContent",MD=E.forwardRef((e,t)=>{const n=TD(Qa,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Fr(Qa,e.__scopeDialog);return E.createElement(lf,{present:r||i.open},i.modal?E.createElement(qQ,$t({},o,{ref:t})):E.createElement(YQ,$t({},o,{ref:t})))}),qQ=E.forwardRef((e,t)=>{const n=Fr(Qa,e.__scopeDialog),r=E.useRef(null),o=ic(t,n.contentRef,r);return E.useEffect(()=>{const i=r.current;if(i)return Pl(i)},[]),E.createElement(kD,$t({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Si(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Si(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:Si(e.onFocusOutside,i=>i.preventDefault())}))}),YQ=E.forwardRef((e,t)=>{const n=Fr(Qa,e.__scopeDialog),r=E.useRef(!1);return E.createElement(kD,$t({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i;if((i=e.onCloseAutoFocus)===null||i===void 0||i.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1},onInteractOutside:o=>{var i,a;(i=e.onInteractOutside)===null||i===void 0||i.call(e,o),o.defaultPrevented||(r.current=!0);const s=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(s))&&o.preventDefault()}}))}),kD=E.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=Fr(Qa,n),l=E.useRef(null),c=ic(t,l);return TQ(),E.createElement(E.Fragment,null,E.createElement(yQ,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},E.createElement(gQ,$t({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":OD(s.open)},a,{ref:c,onDismiss:()=>s.onOpenChange(!1)}))),!1)}),DD="DialogTitle",KQ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fr(DD,n);return E.createElement(Ei.h2,$t({id:o.titleId},r,{ref:t}))}),AD="DialogDescription",XQ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fr(AD,n);return E.createElement(Ei.p,$t({id:o.descriptionId},r,{ref:t}))}),ID="DialogClose",ZQ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fr(ID,n);return E.createElement(Ei.button,$t({type:"button"},r,{ref:t,onClick:Si(e.onClick,()=>o.onOpenChange(!1))}))});function OD(e){return e?"open":"closed"}const JQ=HQ,QQ=UQ,eee=WQ,tee=MD;var nee='[cmdk-list-sizer=""]',ac='[cmdk-group=""]',wv='[cmdk-group-items=""]',ree='[cmdk-group-heading=""]',vv='[cmdk-item=""]',jD=`${vv}:not([aria-disabled="true"])`,yv="cmdk-item-select",ro="data-value",oee=(e,t)=>eQ(e,t),$D=y.createContext(void 0),sc=()=>y.useContext($D),FD=y.createContext(void 0),bv=()=>y.useContext(FD),LD=y.createContext(void 0),zD=y.forwardRef((e,t)=>{let n=y.useRef(null),r=ts(()=>{var ee,ne,G;return{search:"",value:(G=(ne=e.value)!=null?ne:(ee=e.defaultValue)==null?void 0:ee.toLowerCase())!=null?G:"",filtered:{count:0,items:new Map,groups:new Set}}}),o=ts(()=>new Set),i=ts(()=>new Map),a=ts(()=>new Map),s=ts(()=>new Set),l=BD(e),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:p,vimBindings:m=!0,...v}=e,w=y.useId(),b=y.useId(),x=y.useId(),_=mee();es(()=>{if(d!==void 0){let ee=d.trim().toLowerCase();r.current.value=ee,_(6,A),C.emit()}},[d]);let C=y.useMemo(()=>({subscribe:ee=>(s.current.add(ee),()=>s.current.delete(ee)),snapshot:()=>r.current,setState:(ee,ne,G)=>{var F,q,ce;if(!Object.is(r.current[ee],ne)){if(r.current[ee]=ne,ee==="search")D(),T(),_(1,M);else if(ee==="value")if(((F=l.current)==null?void 0:F.value)!==void 0){let L=ne??"";(ce=(q=l.current).onValueChange)==null||ce.call(q,L);return}else G||_(5,A);C.emit()}},emit:()=>{s.current.forEach(ee=>ee())}}),[]),N=y.useMemo(()=>({value:(ee,ne)=>{ne!==a.current.get(ee)&&(a.current.set(ee,ne),r.current.filtered.items.set(ee,R(ne)),_(2,()=>{T(),C.emit()}))},item:(ee,ne)=>(o.current.add(ee),ne&&(i.current.has(ne)?i.current.get(ne).add(ee):i.current.set(ne,new Set([ee]))),_(3,()=>{D(),T(),r.current.value||M(),C.emit()}),()=>{a.current.delete(ee),o.current.delete(ee),r.current.filtered.items.delete(ee);let G=O();_(4,()=>{D(),(G==null?void 0:G.getAttribute("id"))===ee&&M(),C.emit()})}),group:ee=>(i.current.has(ee)||i.current.set(ee,new Set),()=>{a.current.delete(ee),i.current.delete(ee)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],commandRef:n,listId:w,inputId:x,labelId:b}),[]);function R(ee){var ne,G;let F=(G=(ne=l.current)==null?void 0:ne.filter)!=null?G:oee;return ee?F(ee,r.current.search):0}function T(){if(!n.current||!r.current.search||l.current.shouldFilter===!1)return;let ee=r.current.filtered.items,ne=[];r.current.filtered.groups.forEach(F=>{let q=i.current.get(F),ce=0;q.forEach(L=>{let K=ee.get(L);ce=Math.max(K,ce)}),ne.push([F,ce])});let G=n.current.querySelector(nee);$().sort((F,q)=>{var ce,L;let K=F.getAttribute(ro),z=q.getAttribute(ro);return((ce=ee.get(z))!=null?ce:0)-((L=ee.get(K))!=null?L:0)}).forEach(F=>{let q=F.closest(wv);q?q.appendChild(F.parentElement===q?F:F.closest(`${wv} > *`)):G.appendChild(F.parentElement===G?F:F.closest(`${wv} > *`))}),ne.sort((F,q)=>q[1]-F[1]).forEach(F=>{let q=n.current.querySelector(`${ac}[${ro}="${F[0]}"]`);q==null||q.parentElement.appendChild(q)})}function M(){let ee=$().find(G=>!G.ariaDisabled),ne=ee==null?void 0:ee.getAttribute(ro);C.setState("value",ne||void 0)}function D(){if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=o.current.size;return}r.current.filtered.groups=new Set;let ee=0;for(let ne of o.current){let G=a.current.get(ne),F=R(G);r.current.filtered.items.set(ne,F),F>0&&ee++}for(let[ne,G]of i.current)for(let F of G)if(r.current.filtered.items.get(F)>0){r.current.filtered.groups.add(ne);break}r.current.filtered.count=ee}function A(){var ee,ne,G;let F=O();F&&(((ee=F.parentElement)==null?void 0:ee.firstChild)===F&&((G=(ne=F.closest(ac))==null?void 0:ne.querySelector(ree))==null||G.scrollIntoView({block:"nearest"})),F.scrollIntoView({block:"nearest"}))}function O(){var ee;return(ee=n.current)==null?void 0:ee.querySelector(`${vv}[aria-selected="true"]`)}function $(){return Array.from(n.current.querySelectorAll(jD))}function W(ee){let ne=$()[ee];ne&&C.setState("value",ne.getAttribute(ro))}function re(ee){var ne;let G=O(),F=$(),q=F.findIndex(L=>L===G),ce=F[q+ee];(ne=l.current)!=null&&ne.loop&&(ce=q+ee<0?F[F.length-1]:q+ee===F.length?F[0]:F[q+ee]),ce&&C.setState("value",ce.getAttribute(ro))}function Y(ee){let ne=O(),G=ne==null?void 0:ne.closest(ac),F;for(;G&&!F;)G=ee>0?hee(G,ac):pee(G,ac),F=G==null?void 0:G.querySelector(jD);F?C.setState("value",F.getAttribute(ro)):re(ee)}let Z=()=>W($().length-1),B=ee=>{ee.preventDefault(),ee.metaKey?Z():ee.altKey?Y(1):re(1)},oe=ee=>{ee.preventDefault(),ee.metaKey?W(0):ee.altKey?Y(-1):re(-1)};return y.createElement("div",{ref:lc([n,t]),...v,"cmdk-root":"",onKeyDown:ee=>{var ne;if((ne=v.onKeyDown)==null||ne.call(v,ee),!ee.defaultPrevented)switch(ee.key){case"n":case"j":{m&&ee.ctrlKey&&B(ee);break}case"ArrowDown":{B(ee);break}case"p":case"k":{m&&ee.ctrlKey&&oe(ee);break}case"ArrowUp":{oe(ee);break}case"Home":{ee.preventDefault(),W(0);break}case"End":{ee.preventDefault(),Z();break}case"Enter":if(!ee.nativeEvent.isComposing){ee.preventDefault();let G=O();if(G){let F=new Event(yv);G.dispatchEvent(F)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:gee},c),y.createElement(FD.Provider,{value:C},y.createElement($D.Provider,{value:N},u)))}),iee=y.forwardRef((e,t)=>{var n,r;let o=y.useId(),i=y.useRef(null),a=y.useContext(LD),s=sc(),l=BD(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;es(()=>s.item(o,a==null?void 0:a.id),[]);let u=HD(o,i,[e.value,e.children,i]),d=bv(),f=Ri(C=>C.value&&C.value===u.current),h=Ri(C=>c||s.filter()===!1?!0:C.search?C.filtered.items.get(o)>0:!0);y.useEffect(()=>{let C=i.current;if(!(!C||e.disabled))return C.addEventListener(yv,p),()=>C.removeEventListener(yv,p)},[h,e.onSelect,e.disabled]);function p(){var C,N;m(),(N=(C=l.current).onSelect)==null||N.call(C,u.current)}function m(){d.setState("value",u.current,!0)}if(!h)return null;let{disabled:v,value:w,onSelect:b,forceMount:x,..._}=e;return y.createElement("div",{ref:lc([i,t]),..._,id:o,"cmdk-item":"",role:"option","aria-disabled":v||void 0,"aria-selected":f||void 0,"data-disabled":v||void 0,"data-selected":f||void 0,onPointerMove:v?void 0:m,onClick:v?void 0:p},e.children)}),aee=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,a=y.useId(),s=y.useRef(null),l=y.useRef(null),c=y.useId(),u=sc(),d=Ri(p=>o||u.filter()===!1?!0:p.search?p.filtered.groups.has(a):!0);es(()=>u.group(a),[]),HD(a,s,[e.value,e.heading,l]);let f=y.useMemo(()=>({id:a,forceMount:o}),[o]),h=y.createElement(LD.Provider,{value:f},r);return y.createElement("div",{ref:lc([s,t]),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&y.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},h))}),see=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=y.useRef(null),i=Ri(a=>!a.search);return!n&&!i?null:y.createElement("div",{ref:lc([o,t]),...r,"cmdk-separator":"",role:"separator"})}),lee=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=bv(),a=Ri(u=>u.search),s=Ri(u=>u.value),l=sc(),c=y.useMemo(()=>{var u;let d=(u=l.commandRef.current)==null?void 0:u.querySelector(`${vv}[${ro}="${s}"]`);return d==null?void 0:d.getAttribute("id")},[s,l.commandRef]);return y.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),y.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:o?e.value:a,onChange:u=>{o||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),cee=y.forwardRef((e,t)=>{let{children:n,...r}=e,o=y.useRef(null),i=y.useRef(null),a=sc();return y.useEffect(()=>{if(i.current&&o.current){let s=i.current,l=o.current,c,u=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let d=s.offsetHeight;l.style.setProperty("--cmdk-list-height",d.toFixed(1)+"px")})});return u.observe(s),()=>{cancelAnimationFrame(c),u.unobserve(s)}}},[]),y.createElement("div",{ref:lc([o,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:a.listId,"aria-labelledby":a.inputId},y.createElement("div",{ref:i,"cmdk-list-sizer":""},n))}),uee=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:a,...s}=e;return y.createElement(JQ,{open:n,onOpenChange:r},y.createElement(QQ,{container:a},y.createElement(eee,{"cmdk-overlay":"",className:o}),y.createElement(tee,{"aria-label":e.label,"cmdk-dialog":"",className:i},y.createElement(zD,{ref:t,...s}))))}),dee=y.forwardRef((e,t)=>{let n=y.useRef(!0),r=Ri(o=>o.filtered.count===0);return y.useEffect(()=>{n.current=!1},[]),n.current||!r?null:y.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})}),fee=y.forwardRef((e,t)=>{let{progress:n,children:r,...o}=e;return y.createElement("div",{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},y.createElement("div",{"aria-hidden":!0},r))}),vn=Object.assign(zD,{List:cee,Item:iee,Input:lee,Group:aee,Separator:see,Dialog:uee,Empty:dee,Loading:fee});function hee(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function pee(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function BD(e){let t=y.useRef(e);return es(()=>{t.current=e}),t}var es=typeof window>"u"?y.useEffect:y.useLayoutEffect;function ts(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function lc(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ri(e){let t=bv(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function HD(e,t,n){let r=y.useRef(),o=sc();return es(()=>{var i;let a=(()=>{var s;for(let l of n){if(typeof l=="string")return l.trim().toLowerCase();if(typeof l=="object"&&"current"in l)return l.current?(s=l.current.textContent)==null?void 0:s.trim().toLowerCase():r.current}})();o.value(e,a),(i=t.current)==null||i.setAttribute(ro,a),r.current=a}),r}var mee=()=>{let[e,t]=y.useState(),n=ts(()=>new Map);return es(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}},gee={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const VD=fd,wee=hd,UD=pd,vee=Na,xv=E.forwardRef(({className:e,...t},n)=>g.jsx(Ca,{ref:n,className:Q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));xv.displayName=Ca.displayName;const _v=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(UD,{children:[g.jsx(xv,{}),g.jsxs(Ea,{ref:r,className:Q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,g.jsxs(Na,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-foreground",children:[g.jsx(NM,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));_v.displayName=Ea.displayName;const WD=({className:e,...t})=>g.jsx("div",{className:Q("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});WD.displayName="DialogHeader";const GD=({className:e,...t})=>g.jsx("div",{className:Q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});GD.displayName="DialogFooter";const qD=E.forwardRef(({className:e,...t},n)=>g.jsx(Pa,{ref:n,className:Q("text-lg font-semibold leading-none tracking-tight",e),...t}));qD.displayName=Pa.displayName;const YD=E.forwardRef(({className:e,...t},n)=>g.jsx(Ra,{ref:n,className:Q("text-sm text-foreground",e),...t}));YD.displayName=Ra.displayName;const hf=y.forwardRef(({className:e,...t},n)=>g.jsx(vn,{ref:n,className:Q("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));hf.displayName=vn.displayName;const yee=({children:e,...t})=>g.jsx(VD,{...t,children:g.jsx(_v,{className:"overflow-hidden p-0 shadow-lg",children:g.jsx(hf,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Sv=y.forwardRef(({className:e,...t},n)=>g.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[g.jsx(C6,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),g.jsx(vn.Input,{ref:n,className:Q("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Sv.displayName=vn.Input.displayName;const KD=y.forwardRef(({className:e,...t},n)=>g.jsx(vn.List,{ref:n,className:Q("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));KD.displayName=vn.List.displayName;const Cv=y.forwardRef((e,t)=>g.jsx(vn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Cv.displayName=vn.Empty.displayName;const Ev=y.forwardRef(({className:e,...t},n)=>g.jsx(vn.Group,{ref:n,className:Q("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-foreground",e),...t}));Ev.displayName=vn.Group.displayName;const XD=y.forwardRef(({className:e,...t},n)=>g.jsx(vn.Separator,{ref:n,className:Q("-mx-1 h-px bg-border",e),...t}));XD.displayName=vn.Separator.displayName;const Pv=y.forwardRef(({className:e,...t},n)=>g.jsx(vn.Item,{ref:n,className:Q("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Pv.displayName=vn.Item.displayName;const ZD=({className:e,...t})=>g.jsx("span",{className:Q("ml-auto text-xs tracking-widest text-foreground",e),...t});ZD.displayName="CommandShortcut";const pf=hq,mf=pq,cc=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>g.jsx(mq,{children:g.jsx(uN,{ref:o,align:t,sideOffset:n,className:Q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));cc.displayName=uN.displayName;function bee({options:e,value:t,onValueChange:n,placeholder:r="Select an option...",emptyText:o="No results found.",className:i}){var l;const[a,s]=E.useState(!1);return g.jsxs(pf,{open:a,onOpenChange:s,children:[g.jsx(mf,{asChild:!0,children:g.jsxs(rr,{variant:"outline",role:"combobox","aria-expanded":a,className:Q("w-[200px] justify-between",i),children:[t?(l=e.find(c=>c.value===t))==null?void 0:l.label:r,g.jsx(_6,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),g.jsx(cc,{className:"w-[200px] p-0",children:g.jsxs(hf,{children:[g.jsx(Sv,{placeholder:r}),g.jsx(Cv,{children:o}),g.jsx(Ev,{children:e.map(c=>g.jsxs(Pv,{value:c.value,onSelect:u=>{n==null||n(u),s(!1)},children:[g.jsx(Wa,{className:Q("mr-2 h-4 w-4",t===c.value?"opacity-100":"opacity-0")}),c.label]},c.value))})]})})]})}const xee=j7,_ee=$7,See=F7,Cee=iP,Eee=z7,Pee=L7,JD=E.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(hP,{ref:o,className:Q("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,g.jsx(Lo,{className:"ml-auto h-4 w-4"})]}));JD.displayName=hP.displayName;const QD=E.forwardRef(({className:e,...t},n)=>g.jsx(pP,{ref:n,className:Q("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));QD.displayName=pP.displayName;const eA=E.forwardRef(({className:e,...t},n)=>g.jsx(iP,{children:g.jsx(aP,{ref:n,className:Q("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));eA.displayName=aP.displayName;const tA=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(lP,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));tA.displayName=lP.displayName;const nA=E.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(cP,{ref:o,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(dP,{children:g.jsx(Wa,{className:"h-4 w-4"})})}),t]}));nA.displayName=cP.displayName;const rA=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(uP,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(dP,{children:g.jsx(Jd,{className:"h-2 w-2 fill-current"})})}),t]}));rA.displayName=uP.displayName;const oA=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(sP,{ref:r,className:Q("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));oA.displayName=sP.displayName;const iA=E.forwardRef(({className:e,...t},n)=>g.jsx(fP,{ref:n,className:Q("-mx-1 my-1 h-px bg-border",e),...t}));iA.displayName=fP.displayName;const aA=({className:e,...t})=>g.jsx("span",{className:Q("ml-auto text-xs tracking-widest text-foreground",e),...t});aA.displayName="ContextMenuShortcut";/**
|
|
405
405
|
* table-core
|
|
406
406
|
*
|
|
407
407
|
* Copyright (c) TanStack
|
|
@@ -427,4 +427,4 @@ Defaulting to \`null\`.`}var wN=dN,_q=hN,Jg="Radio",[Sq,vN]=ct(Jg),[Cq,Eq]=Sq(Jg
|
|
|
427
427
|
font-weight: bold;
|
|
428
428
|
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,o),o}}function Uv(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const pte=(e,t)=>Math.abs(e-t)<1,mte=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},gte=e=>e,wte=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},Wv={passive:!0},vte=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=()=>{t({width:n.innerWidth,height:n.innerHeight})};return r(),n.addEventListener("resize",r,Wv),()=>{n.removeEventListener("resize",r)}},yA=typeof window>"u"?!0:"onscrollend"in window,yte=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&yA?()=>{}:mte(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),a=u=>()=>{o=n[e.options.horizontal?"scrollX":"scrollY"],i(),t(o,u)},s=a(!0),l=a(!1);l(),n.addEventListener("scroll",s,Wv);const c=e.options.useScrollendEvent&&yA;return c&&n.addEventListener("scrollend",l,Wv),()=>{n.removeEventListener("scroll",s),c&&n.removeEventListener("scrollend",l)}},bte=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},xte=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const a=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class _te{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const a=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:gte,rangeExtractor:wte,onChange:()=>{},measureElement:bte,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=ns(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let a=r-1;a>=0;a--){const s=n[a];if(o.has(s.lane))continue;const l=i.get(s.lane);if(l==null||s.end>l.end?i.set(s.lane,s):s.end<l.end&&o.set(s.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((a,s)=>a.end===s.end?a.index-s.index:a.end-s.end)[0]:void 0},this.getMeasurementOptions=ns(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,o,i,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:a}),{key:!1}),this.getMeasurements=ns(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:a},s)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<n;u++){const d=i(u),f=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),h=f?f.end+this.options.gap:r+o,p=s.get(d),m=typeof p=="number"?p:this.options.estimateSize(u),v=h+m,w=f?f.lane:u%this.options.lanes;c[u]={index:u,start:h,size:m,end:v,key:d,lane:w}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ns(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?Ste({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ns(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,a)=>i===null||a===null?[]:n({startIndex:i,endIndex:a,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const a=i.key,s=this.elementsCache.get(a);s!==n&&(s&&this.observer.unobserve(s),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,a=r-i;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=ns(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,a=n.length;i<a;i++){const s=n[i],l=r[s];o.push(l)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Uv(r[bA(0,r.length-1,o=>Uv(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const s=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-i;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(o.end>=a+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];const s=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const i=this.getOffsetForIndex(n,r);if(!i)return;const[a,s]=i;this._scrollToOffset(a,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=Uv(this.getOffsetForIndex(n,s));pte(c,this.getScrollOffset())||this.scrollToIndex(n,{align:s,behavior:o})}else this.scrollToIndex(n,{align:s,behavior:o})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;return r.length===0?o=this.options.paddingStart:o=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(i=>i.end)),Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const bA=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function Ste({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1;let a=bA(0,o,l=>e[l].start,n),s=a;for(;s<o&&e[s].end<n+t;)s++;return r>1&&(a=Math.max(0,a-a%r),s=Math.min(o,s+(r-1-s%r))),{startIndex:a,endIndex:s}}const xA=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Cte(e){const t=y.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var a;i?ur.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,i)}},[r]=y.useState(()=>new _te(n));return r.setOptions(n),xA(()=>r._didMount(),[]),xA(()=>r._willUpdate()),r}function Ete(e){return Cte({getScrollElement:()=>typeof document<"u"?window:null,observeElementRect:vte,observeElementOffset:yte,scrollToFn:xte,initialOffset:()=>typeof document<"u"?window.scrollY:0,...e})}const Gv=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:"relative w-full overflow-auto",children:g.jsx("table",{ref:n,className:Q("w-full caption-bottom text-sm",e),...t})}));Gv.displayName="Table";const qv=E.forwardRef(({className:e,...t},n)=>g.jsx("thead",{ref:n,className:Q("[&_tr]:border-b",e),...t}));qv.displayName="TableHeader";const Yv=E.forwardRef(({className:e,...t},n)=>g.jsx("tbody",{ref:n,className:Q("[&_tr:last-child]:border-0",e),...t}));Yv.displayName="TableBody";const _A=E.forwardRef(({className:e,...t},n)=>g.jsx("tfoot",{ref:n,className:Q("border-t bg-primary/50 font-medium [&>tr]:last:border-b-0",e),...t}));_A.displayName="TableFooter";const rs=E.forwardRef(({className:e,...t},n)=>g.jsx("tr",{ref:n,className:Q("border-b transition-colors hover:bg-primary/50 data-[state=selected]:bg-primary",e),...t}));rs.displayName="TableRow";const Kv=E.forwardRef(({className:e,...t},n)=>g.jsx("th",{ref:n,className:Q("h-12 px-4 text-left align-middle font-medium text-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Kv.displayName="TableHead";const fc=E.forwardRef(({className:e,...t},n)=>g.jsx("td",{ref:n,className:Q("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));fc.displayName="TableCell";const SA=E.forwardRef(({className:e,...t},n)=>g.jsx("caption",{ref:n,className:Q("mt-4 text-sm text-foreground",e),...t}));SA.displayName="TableCaption";function Pte({columns:e,data:t,virtualizeRows:n=!1}){var m,v,w,b;const[r,o]=E.useState({}),[i,a]=E.useState({}),[s,l]=E.useState([]),[c,u]=E.useState([]),d=hte({data:t,columns:e,state:{sorting:c,columnVisibility:i,rowSelection:r,columnFilters:s},enableRowSelection:!0,onRowSelectionChange:o,onSortingChange:u,onColumnFiltersChange:l,onColumnVisibilityChange:a,getCoreRowModel:tte(),getFilteredRowModel:ste(),getPaginationRowModel:lte(),getSortedRowModel:cte(),getFacetedRowModel:ite(),getFacetedUniqueValues:ate()}),f=E.useRef(null),{rows:h}=d.getRowModel(),p=Ete({count:h.length,estimateSize:()=>40,scrollMargin:((m=f.current)==null?void 0:m.offsetTop)??0});return g.jsx("div",{ref:f,className:"relative w-full overflow-auto",children:g.jsxs(Gv,{children:[g.jsx(qv,{children:d.getHeaderGroups().map(x=>g.jsx(rs,{children:x.headers.map(_=>g.jsxs(Kv,{colSpan:_.colSpan,className:Q("select-none",_.column.getCanSort()&&"cursor-pointer"),onClick:_.column.getToggleSortingHandler(),children:[_.isPlaceholder?null:Vv(_.column.columnDef.header,_.getContext()),{asc:" 🔼",desc:" 🔽"}[_.column.getIsSorted()]??null]},_.id))},x.id))}),g.jsx(Yv,{children:n?g.jsxs(g.Fragment,{children:[g.jsx("tr",{children:g.jsx("td",{style:{height:`${((v=p.getVirtualItems()[0])==null?void 0:v.start)??0}px`}})}),p.getVirtualItems().map(x=>{const _=h[x.index];return g.jsx(rs,{"data-state":(_==null?void 0:_.getIsSelected())&&"selected",style:{height:`${x.size}px`},children:_==null?void 0:_.getVisibleCells().map(C=>g.jsx(fc,{children:Vv(C.column.columnDef.cell,C.getContext())},C.id))},_==null?void 0:_.id)}),g.jsx("tr",{children:g.jsx("td",{style:{height:`${p.getTotalSize()-(((w=p.getVirtualItems()[p.getVirtualItems().length-1])==null?void 0:w.end)??0)}px`}})})]}):g.jsx(g.Fragment,{children:(b=d.getRowModel().rows)!=null&&b.length?d.getRowModel().rows.map(x=>g.jsx(rs,{"data-state":x.getIsSelected()&&"selected",children:x.getVisibleCells().map(_=>g.jsx(fc,{children:Vv(_.column.columnDef.cell,_.getContext())},_.id))},x.id)):g.jsx(rs,{children:g.jsx(fc,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})})]})})}function Rte({date:e,onDateChange:t,placeholder:n="Pick a date",disabled:r=!1,className:o}){const[i,a]=E.useState(!1);return g.jsxs(pf,{open:i,onOpenChange:a,children:[g.jsx(mf,{asChild:!0,children:g.jsxs(rr,{variant:"outline",className:Q("w-[240px] justify-start text-left font-normal",!e&&"text-foreground",o),disabled:r,children:[g.jsx(RM,{className:"mr-2 h-4 w-4"}),e?$r(e,"PPP"):n]})}),g.jsx(cc,{className:"w-auto p-0",align:"start",children:g.jsx(of,{mode:"single",selected:e,onSelect:s=>{t==null||t(s),a(!1)},initialFocus:!0})})]})}function Nte({dateRange:e,onDateRangeChange:t,placeholder:n="Pick a date range",disabled:r=!1,className:o}){const[i,a]=E.useState(!1);return g.jsxs(pf,{open:i,onOpenChange:a,children:[g.jsx(mf,{asChild:!0,children:g.jsxs(rr,{variant:"outline",className:Q("w-[300px] justify-start text-left font-normal",!(e!=null&&e.from)&&!(e!=null&&e.to)&&"text-foreground",o),disabled:r,children:[g.jsx(RM,{className:"mr-2 h-4 w-4"}),e!=null&&e.from||e!=null&&e.to?g.jsxs(g.Fragment,{children:[e.from&&$r(e.from,"PPP"),e.to&&" - ",e.to&&$r(e.to,"PPP")]}):n]})}),g.jsx(cc,{className:"w-auto p-0",align:"start",children:g.jsx(of,{mode:"range",selected:{from:e==null?void 0:e.from,to:e==null?void 0:e.to},onSelect:s=>{t==null||t(s??{}),s!=null&&s.from&&(s!=null&&s.to)&&a(!1)},initialFocus:!0,numberOfMonths:2})})]})}function Tte(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const CA=E.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),os=()=>{const e=E.useContext(CA);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Tte(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
429
429
|
[data-state=closed]
|
|
430
|
-
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function Mte(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function kte(){return Xv(/^Mac/)}function Dte(){return Xv(/^iPhone/)}function EA(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Ate(){return Xv(/^iPad/)||kte()&&navigator.maxTouchPoints>1}function PA(){return Dte()||Ate()}function Xv(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const Ite=24,Ote=typeof window<"u"?E.useLayoutEffect:E.useEffect;function RA(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Zv=typeof document<"u"&&window.visualViewport;function NA(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function TA(e){for(NA(e)&&(e=e.parentElement);e&&!NA(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const jte=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let bf=0,Jv;function $te(e={}){let{isDisabled:t}=e;Ote(()=>{if(!t)return bf++,bf===1&&PA()&&(Jv=Fte()),()=>{bf--,bf===0&&(Jv==null||Jv())}},[t])}function Fte(){let e,t=0,n=d=>{e=TA(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let f=d.changedTouches[0].pageY,h=e.scrollTop,p=e.scrollHeight-e.clientHeight;p!==0&&((h<=0&&f>t||h>=p&&f<t)&&d.preventDefault(),t=f)},o=d=>{let f=d.target;Qv(f)&&f!==document.activeElement&&(d.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=d=>{let f=d.target;Qv(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",Zv&&(Zv.height<window.innerHeight?requestAnimationFrame(()=>{MA(f)}):Zv.addEventListener("resize",()=>MA(f),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=RA(Lte(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=RA(hc(document,"touchstart",n,{passive:!1,capture:!0}),hc(document,"touchmove",r,{passive:!1,capture:!0}),hc(document,"touchend",o,{passive:!1,capture:!0}),hc(document,"focus",i,!0),hc(window,"scroll",a));return()=>{c(),u(),window.scrollTo(s,l)}}function Lte(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function hc(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function MA(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=TA(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const a=n.getBoundingClientRect().bottom+Ite;i>a&&(n.scrollTop+=o-r)}e=n.parentElement}}function Qv(e){return e instanceof HTMLInputElement&&!jte.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function zte(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Bte(...e){return t=>e.forEach(n=>zte(n,t))}function kA(...e){return y.useCallback(Bte(...e),e)}const DA=new WeakMap;function Dt(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&DA.set(e,r)}function Hte(e,t){if(!e||!(e instanceof HTMLElement))return;let n=DA.get(e);n&&(e.style[t]=n[t])}const Tt=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function xf(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[Tt(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Tt(t)?5:4]):null)}function Vte(e){return 8*(Math.log(e+1)-2)}function ey(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function Ute(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const yt={DURATION:.5,EASE:[.32,.72,0,1]},AA=.4,Wte=.25,Gte=100,IA=8,_f=16,ty=26,ny="vaul-dragging";function OA(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function qte({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,o=E.useRef(r),i=OA(t);return E.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function jA({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=qte({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=OA(n),l=E.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function Yte({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:a,direction:s="bottom",container:l,snapToSequentialPoint:c}){const[u,d]=jA({prop:e,defaultProp:n==null?void 0:n[0],onChange:t}),[f,h]=E.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);E.useEffect(()=>{function R(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]);const p=E.useMemo(()=>u===(n==null?void 0:n[n.length-1])||null,[n,u]),m=E.useMemo(()=>{var R;return(R=n==null?void 0:n.findIndex(T=>T===u))!=null?R:null},[n,u]),v=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===u||!n,w=E.useMemo(()=>{const R=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var T;return(T=n==null?void 0:n.map(M=>{const D=typeof M=="string";let A=0;if(D&&(A=parseInt(M,10)),Tt(s)){const $=D?A:f?M*R.height:0;return f?s==="bottom"?R.height-$:-R.height+$:$}const j=D?A:f?M*R.width:0;return f?s==="right"?R.width-j:-R.width+j:j}))!=null?T:[]},[n,f,l]),b=E.useMemo(()=>m!==null?w==null?void 0:w[m]:null,[w,m]),x=E.useCallback(R=>{var T;const M=(T=w==null?void 0:w.findIndex(D=>D===R))!=null?T:null;a(M),Dt(r.current,{transition:`transform ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,transform:Tt(s)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`}),w&&M!==w.length-1&&i!==void 0&&M!==i&&M<i?Dt(o.current,{transition:`opacity ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,opacity:"0"}):Dt(o.current,{transition:`opacity ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,opacity:"1"}),d(n==null?void 0:n[Math.max(M,0)])},[r.current,n,w,i,o,d]);E.useEffect(()=>{if(u||e){var R;const T=(R=n==null?void 0:n.findIndex(M=>M===e||M===u))!=null?R:-1;w&&T!==-1&&typeof w[T]=="number"&&x(w[T])}},[u,e,n,w,x]);function _({draggedDistance:R,closeDrawer:T,velocity:M,dismissible:D}){if(i===void 0)return;const A=s==="bottom"||s==="right"?(b??0)-R:(b??0)+R,j=m===i-1,$=m===0,W=R>0;if(j&&Dt(o.current,{transition:`opacity ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`}),!c&&M>2&&!W){D?T():x(w[0]);return}if(!c&&M>2&&W&&w&&n){x(w[n.length-1]);return}const re=w==null?void 0:w.reduce((Z,B)=>typeof Z!="number"||typeof B!="number"?Z:Math.abs(B-A)<Math.abs(Z-A)?B:Z),Y=Tt(s)?window.innerHeight:window.innerWidth;if(M>AA&&Math.abs(R)<Y*.4){const Z=W?1:-1;if(Z>0&&p&&n){x(w[n.length-1]);return}if($&&Z<0&&D&&T(),m===null)return;x(w[m+Z]);return}x(re)}function C({draggedDistance:R}){if(b===null)return;const T=s==="bottom"||s==="right"?b-R:b+R;(s==="bottom"||s==="right")&&T<w[w.length-1]||(s==="top"||s==="left")&&T>w[w.length-1]||Dt(r.current,{transform:Tt(s)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`})}function N(R,T){if(!n||typeof m!="number"||!w||i===void 0)return null;const M=m===i-1;if(m>=i&&T)return 0;if(M&&!T)return 1;if(!v&&!M)return null;const A=M?m+1:m-1,j=M?w[A]-w[A-1]:w[A+1]-w[A],$=R/Math.abs(j);return M?1-$:$}return{isLastSnapPoint:p,activeSnapPoint:u,shouldFade:v,getPercentageDragged:N,setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:_,onDrag:C,snapPointsOffset:w}}const Kte=()=>()=>{};function Xte(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=os(),i=E.useRef(null),a=E.useMemo(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-ty)/window.innerWidth}E.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;Ute(r&&!o?ey(document.body,{background:"black"}):Kte,ey(l,{transformOrigin:Tt(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${yt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${yt.EASE.join(",")})`}));const c=ey(l,{borderRadius:`${IA}px`,overflow:"hidden",...Tt(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{c(),i.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},yt.DURATION*1e3)}}},[t,n,a])}let pc=null;function Zte({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[a,s]=E.useState(()=>typeof window<"u"?window.location.href:""),l=E.useRef(0),c=E.useCallback(()=>{if(EA()&&pc===null&&e&&!i){pc={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const h=f-window.innerHeight;h&&l.current>=f&&(document.body.style.top=`${-(l.current+h)}px`)}),300)}},[e]),u=E.useCallback(()=>{if(EA()&&pc!==null&&!i){const d=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,pc),window.requestAnimationFrame(()=>{if(o&&a!==window.location.href){s(window.location.href);return}window.scrollTo(f,d)}),pc=null}},[a]);return E.useEffect(()=>{function d(){l.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),E.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),E.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),t||window.setTimeout(()=>{u()},500)):u())},[e,r,a,t,n,c,u]),{restorePositionSetting:u}}function $A({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:s=!0,closeThreshold:l=Wte,scrollLockTimeout:c=Gte,dismissible:u=!0,handleOnly:d=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:h,setActiveSnapPoint:p,fixed:m,modal:v=!0,onClose:w,nested:b,noBodyStyles:x=!1,direction:_="bottom",defaultOpen:C=!1,disablePreventScroll:N=!0,snapToSequentialPoint:R=!1,preventScrollRestoration:T=!1,repositionInputs:M=!0,onAnimationEnd:D,container:A,autoFocus:j=!1}){var $,W;const[re=!1,Y]=jA({defaultProp:C,prop:e,onChange:Te=>{t==null||t(Te),!Te&&!b&&k(),setTimeout(()=>{D==null||D(Te)},yt.DURATION*1e3),Te&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Te||(document.body.style.pointerEvents="auto")}}),[Z,B]=E.useState(!1),[oe,ee]=E.useState(!1),[ne,G]=E.useState(!1),F=E.useRef(null),q=E.useRef(null),ce=E.useRef(null),L=E.useRef(null),K=E.useRef(null),z=E.useRef(!1),ie=E.useRef(null),le=E.useRef(0),ae=E.useRef(!1),H=E.useRef(!C),ue=E.useRef(0),se=E.useRef(null),ye=E.useRef((($=se.current)==null?void 0:$.getBoundingClientRect().height)||0),Ce=E.useRef(((W=se.current)==null?void 0:W.getBoundingClientRect().width)||0),xe=E.useRef(0),O=E.useCallback(Te=>{i&&Te===fe.length-1&&(q.current=new Date)},[]),{activeSnapPoint:V,activeSnapPointIndex:J,setActiveSnapPoint:we,onRelease:pe,snapPointsOffset:fe,onDrag:ge,shouldFade:_e,getPercentageDragged:Xe}=Yte({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:p,drawerRef:se,fadeFromIndex:f,overlayRef:F,onSnapPointChange:O,direction:_,container:A,snapToSequentialPoint:R});$te({isDisabled:!re||oe||!v||ne||!Z||!M||!N});const{restorePositionSetting:k}=Zte({isOpen:re,modal:v,nested:b??!1,hasBeenOpened:Z,preventScrollRestoration:T,noBodyStyles:x});function S(){return(window.innerWidth-ty)/window.innerWidth}function P(Te){var Ze,et;!u&&!i||se.current&&!se.current.contains(Te.target)||(ye.current=((Ze=se.current)==null?void 0:Ze.getBoundingClientRect().height)||0,Ce.current=((et=se.current)==null?void 0:et.getBoundingClientRect().width)||0,ee(!0),ce.current=new Date,PA()&&window.addEventListener("touchend",()=>z.current=!1,{once:!0}),Te.target.setPointerCapture(Te.pointerId),le.current=Tt(_)?Te.pageY:Te.pageX)}function I(Te,Ze){var et;let He=Te;const Ee=(et=window.getSelection())==null?void 0:et.toString(),Ge=se.current?xf(se.current,_):null,qe=new Date;if(He.tagName==="SELECT"||He.hasAttribute("data-vaul-no-drag")||He.closest("[data-vaul-no-drag]"))return!1;if(_==="right"||_==="left")return!0;if(q.current&&qe.getTime()-q.current.getTime()<500)return!1;if(Ge!==null&&(_==="bottom"?Ge>0:Ge<0))return!0;if(Ee&&Ee.length>0)return!1;if(K.current&&qe.getTime()-K.current.getTime()<c&&Ge===0||Ze)return K.current=qe,!1;for(;He;){if(He.scrollHeight>He.clientHeight){if(He.scrollTop!==0)return K.current=new Date,!1;if(He.getAttribute("role")==="dialog")return!0}He=He.parentNode}return!0}function U(Te){if(se.current&&oe){const Ze=_==="bottom"||_==="right"?1:-1,et=(le.current-(Tt(_)?Te.pageY:Te.pageX))*Ze,He=et>0,Ee=i&&!u&&!He;if(Ee&&J===0)return;const Ge=Math.abs(et),qe=document.querySelector("[data-vaul-drawer-wrapper]"),wt=_==="bottom"||_==="top"?ye.current:Ce.current;let Xt=Ge/wt;const ft=Xe(Ge,He);if(ft!==null&&(Xt=ft),Ee&&Xt>=1||!z.current&&!I(Te.target,He))return;if(se.current.classList.add(ny),z.current=!0,Dt(se.current,{transition:"none"}),Dt(F.current,{transition:"none"}),i&&ge({draggedDistance:et}),He&&!i){const an=Vte(et),Zt=Math.min(an*-1,0)*Ze;Dt(se.current,{transform:Tt(_)?`translate3d(0, ${Zt}px, 0)`:`translate3d(${Zt}px, 0, 0)`});return}const Nt=1-Xt;if((_e||f&&J===f-1)&&(r==null||r(Te,Xt),Dt(F.current,{opacity:`${Nt}`,transition:"none"},!0)),qe&&F.current&&a){const an=Math.min(S()+Xt*(1-S()),1),Zt=8-Xt*8,_n=Math.max(0,14-Xt*14);Dt(qe,{borderRadius:`${Zt}px`,transform:Tt(_)?`scale(${an}) translate3d(0, ${_n}px, 0)`:`scale(${an}) translate3d(${_n}px, 0, 0)`,transition:"none"},!0)}if(!i){const an=Ge*Ze;Dt(se.current,{transform:Tt(_)?`translate3d(0, ${an}px, 0)`:`translate3d(${an}px, 0, 0)`})}}}E.useEffect(()=>{window.requestAnimationFrame(()=>{H.current=!0})},[]),E.useEffect(()=>{var Te;function Ze(){if(!se.current||!M)return;const et=document.activeElement;if(Qv(et)||ae.current){var He;const Ee=((He=window.visualViewport)==null?void 0:He.height)||0,Ge=window.innerHeight;let qe=Ge-Ee;const wt=se.current.getBoundingClientRect().height||0,Xt=wt>Ge*.8;xe.current||(xe.current=wt);const ft=se.current.getBoundingClientRect().top;if(Math.abs(ue.current-qe)>60&&(ae.current=!ae.current),i&&i.length>0&&fe&&J){const Nt=fe[J]||0;qe+=Nt}if(ue.current=qe,wt>Ee||ae.current){const Nt=se.current.getBoundingClientRect().height;let an=Nt;Nt>Ee&&(an=Ee-(Xt?ft:ty)),m?se.current.style.height=`${Nt-Math.max(qe,0)}px`:se.current.style.height=`${Math.max(an,Ee-ft)}px`}else Mte()||(se.current.style.height=`${xe.current}px`);i&&i.length>0&&!ae.current?se.current.style.bottom="0px":se.current.style.bottom=`${Math.max(qe,0)}px`}}return(Te=window.visualViewport)==null||Te.addEventListener("resize",Ze),()=>{var et;return(et=window.visualViewport)==null?void 0:et.removeEventListener("resize",Ze)}},[J,i,fe]);function te(Te){Oe(),w==null||w(),Te||Y(!1),setTimeout(()=>{i&&we(i[0])},yt.DURATION*1e3)}function he(){if(!se.current)return;const Te=document.querySelector("[data-vaul-drawer-wrapper]"),Ze=xf(se.current,_);Dt(se.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`}),Dt(F.current,{transition:`opacity ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,opacity:"1"}),a&&Ze&&Ze>0&&re&&Dt(Te,{borderRadius:`${IA}px`,overflow:"hidden",...Tt(_)?{transform:`scale(${S()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${S()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${yt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${yt.EASE.join(",")})`},!0)}function Oe(){!oe||!se.current||(se.current.classList.remove(ny),z.current=!1,ee(!1),L.current=new Date)}function Qe(Te){if(!oe||!se.current)return;se.current.classList.remove(ny),z.current=!1,ee(!1),L.current=new Date;const Ze=xf(se.current,_);if(!Te||!I(Te.target,!1)||!Ze||Number.isNaN(Ze)||ce.current===null)return;const et=L.current.getTime()-ce.current.getTime(),He=le.current-(Tt(_)?Te.pageY:Te.pageX),Ee=Math.abs(He)/et;if(Ee>.05&&(G(!0),setTimeout(()=>{G(!1)},200)),i){pe({draggedDistance:He*(_==="bottom"||_==="right"?1:-1),closeDrawer:te,velocity:Ee,dismissible:u}),o==null||o(Te,!0);return}if(_==="bottom"||_==="right"?He>0:He<0){he(),o==null||o(Te,!0);return}if(Ee>AA){te(),o==null||o(Te,!1);return}var Ge;const qe=Math.min((Ge=se.current.getBoundingClientRect().height)!=null?Ge:0,window.innerHeight);var wt;const Xt=Math.min((wt=se.current.getBoundingClientRect().width)!=null?wt:0,window.innerWidth),ft=_==="left"||_==="right";if(Math.abs(Ze)>=(ft?Xt:qe)*l){te(),o==null||o(Te,!1);return}o==null||o(Te,!0),he()}E.useEffect(()=>(re&&(Dt(document.documentElement,{scrollBehavior:"auto"}),q.current=new Date),()=>{Hte(document.documentElement,"scrollBehavior")}),[re]);function nt(Te){const Ze=Te?(window.innerWidth-_f)/window.innerWidth:1,et=Te?-16:0;ie.current&&window.clearTimeout(ie.current),Dt(se.current,{transition:`transform ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,transform:Tt(_)?`scale(${Ze}) translate3d(0, ${et}px, 0)`:`scale(${Ze}) translate3d(${et}px, 0, 0)`}),!Te&&se.current&&(ie.current=setTimeout(()=>{const He=xf(se.current,_);Dt(se.current,{transition:"none",transform:Tt(_)?`translate3d(0, ${He}px, 0)`:`translate3d(${He}px, 0, 0)`})},500))}function st(Te,Ze){if(Ze<0)return;const et=(window.innerWidth-_f)/window.innerWidth,He=et+Ze*(1-et),Ee=-16+Ze*_f;Dt(se.current,{transform:Tt(_)?`scale(${He}) translate3d(0, ${Ee}px, 0)`:`scale(${He}) translate3d(${Ee}px, 0, 0)`,transition:"none"})}function We(Te,Ze){const et=Tt(_)?window.innerHeight:window.innerWidth,He=Ze?(et-_f)/et:1,Ee=Ze?-16:0;Ze&&Dt(se.current,{transition:`transform ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,transform:Tt(_)?`scale(${He}) translate3d(0, ${Ee}px, 0)`:`scale(${He}) translate3d(${Ee}px, 0, 0)`})}return E.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),E.createElement(fd,{defaultOpen:C,onOpenChange:Te=>{!u&&!Te||(Te?B(!0):te(!0),Y(Te))},open:re},E.createElement(CA.Provider,{value:{activeSnapPoint:V,snapPoints:i,setActiveSnapPoint:we,drawerRef:se,overlayRef:F,onOpenChange:t,onPress:P,onRelease:Qe,onDrag:U,dismissible:u,shouldAnimate:H,handleOnly:d,isOpen:re,isDragging:oe,shouldFade:_e,closeDrawer:te,onNestedDrag:st,onNestedOpenChange:nt,onNestedRelease:We,keyboardIsOpen:ae,modal:v,snapPointsOffset:fe,activeSnapPointIndex:J,direction:_,shouldScaleBackground:a,setBackgroundColorOnScale:s,noBodyStyles:x,container:A,autoFocus:j}},n))}const FA=E.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:a,modal:s,shouldAnimate:l}=os(),c=kA(t,n),u=r&&r.length>0;if(!s)return null;const d=E.useCallback(f=>o(f),[o]);return E.createElement(Ca,{onMouseUp:d,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":a&&u?"true":"false","data-vaul-snap-points-overlay":a&&i?"true":"false","data-vaul-animate":l!=null&&l.current?"true":"false",...e})});FA.displayName="Drawer.Overlay";const LA=E.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:a,onRelease:s,onDrag:l,keyboardIsOpen:c,snapPointsOffset:u,activeSnapPointIndex:d,modal:f,isOpen:h,direction:p,snapPoints:m,container:v,handleOnly:w,shouldAnimate:b,autoFocus:x}=os(),[_,C]=E.useState(!1),N=kA(o,i),R=E.useRef(null),T=E.useRef(null),M=E.useRef(!1),D=m&&m.length>0;Xte();const A=($,W,re=0)=>{if(M.current)return!0;const Y=Math.abs($.y),Z=Math.abs($.x),B=Z>Y,oe=["bottom","right"].includes(W)?1:-1;if(W==="left"||W==="right"){if(!($.x*oe<0)&&Z>=0&&Z<=re)return B}else if(!($.y*oe<0)&&Y>=0&&Y<=re)return!B;return M.current=!0,!0};E.useEffect(()=>{D&&window.requestAnimationFrame(()=>{C(!0)})},[]);function j($){R.current=null,M.current=!1,s($)}return E.createElement(Ea,{"data-vaul-drawer-direction":p,"data-vaul-drawer":"","data-vaul-delayed-snap-points":_?"true":"false","data-vaul-snap-points":h&&D?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":b!=null&&b.current?"true":"false",...r,ref:N,style:u&&u.length>0?{"--snap-point-height":`${u[d??0]}px`,...t}:t,onPointerDown:$=>{w||(r.onPointerDown==null||r.onPointerDown.call(r,$),R.current={x:$.pageX,y:$.pageY},a($))},onOpenAutoFocus:$=>{n==null||n($),x||$.preventDefault()},onPointerDownOutside:$=>{if(e==null||e($),!f||$.defaultPrevented){$.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:$=>{if(!f){$.preventDefault();return}},onPointerMove:$=>{if(T.current=$,w||(r.onPointerMove==null||r.onPointerMove.call(r,$),!R.current))return;const W=$.pageY-R.current.y,re=$.pageX-R.current.x,Y=$.pointerType==="touch"?10:2;A({x:re,y:W},p,Y)?l($):(Math.abs(re)>Y||Math.abs(W)>Y)&&(R.current=null)},onPointerUp:$=>{r.onPointerUp==null||r.onPointerUp.call(r,$),R.current=null,M.current=!1,s($)},onPointerOut:$=>{r.onPointerOut==null||r.onPointerOut.call(r,$),j(T.current)},onContextMenu:$=>{r.onContextMenu==null||r.onContextMenu.call(r,$),T.current&&j(T.current)}})});LA.displayName="Drawer.Content";const Jte=250,Qte=120,zA=E.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:a,activeSnapPoint:s,setActiveSnapPoint:l,dismissible:c,handleOnly:u,isOpen:d,onPress:f,onDrag:h}=os(),p=E.useRef(null),m=E.useRef(!1);function v(){if(m.current){x();return}window.setTimeout(()=>{w()},Qte)}function w(){if(i||e||m.current){x();return}if(x(),!a||a.length===0){c||o();return}if(s===a[a.length-1]&&c){o();return}const C=a.findIndex(R=>R===s);if(C===-1)return;const N=a[C+1];l(N)}function b(){p.current=window.setTimeout(()=>{m.current=!0},Jte)}function x(){p.current&&window.clearTimeout(p.current),m.current=!1}return E.createElement("div",{onClick:v,onPointerCancel:x,onPointerDown:_=>{u&&f(_),b()},onPointerMove:_=>{u&&h(_)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},E.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});zA.displayName="Drawer.Handle";function ene({onDrag:e,onOpenChange:t,open:n,...r}){const{onNestedDrag:o,onNestedOpenChange:i,onNestedRelease:a}=os();if(!o)throw new Error("Drawer.NestedRoot must be placed in another drawer");return E.createElement($A,{nested:!0,open:n,onClose:()=>{i(!1)},onDrag:(s,l)=>{o(s,l),e==null||e(s,l)},onOpenChange:s=>{s&&i(s),t==null||t(s)},onRelease:a,...r})}function tne(e){const t=os(),{container:n=t.container,...r}=e;return E.createElement(pd,{container:n,...r})}const lr={Root:$A,NestedRoot:ene,Content:LA,Overlay:FA,Trigger:hd,Portal:tne,Handle:zA,Close:Na,Title:Pa,Description:Ra},BA=({shouldScaleBackground:e=!0,...t})=>g.jsx(lr.Root,{shouldScaleBackground:e,...t});BA.displayName="Drawer";const nne=lr.Trigger,HA=lr.Portal,rne=lr.Close,ry=E.forwardRef(({className:e,...t},n)=>g.jsx(lr.Overlay,{ref:n,className:Q("fixed inset-0 z-50 bg-black/80",e),...t}));ry.displayName=lr.Overlay.displayName;const VA=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(HA,{children:[g.jsx(ry,{}),g.jsxs(lr.Content,{ref:r,className:Q("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n,children:[g.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-primary"}),t]})]}));VA.displayName="DrawerContent";const UA=({className:e,...t})=>g.jsx("div",{className:Q("grid gap-1.5 p-4 text-center sm:text-left",e),...t});UA.displayName="DrawerHeader";const WA=({className:e,...t})=>g.jsx("div",{className:Q("mt-auto flex flex-col gap-2 p-4",e),...t});WA.displayName="DrawerFooter";const GA=E.forwardRef(({className:e,...t},n)=>g.jsx(lr.Title,{ref:n,className:Q("text-lg font-semibold leading-none tracking-tight",e),...t}));GA.displayName=lr.Title.displayName;const qA=E.forwardRef(({className:e,...t},n)=>g.jsx(lr.Description,{ref:n,className:Q("text-sm text-foreground",e),...t}));qA.displayName=lr.Description.displayName;const one=r9,ine=o9,ane=i9,sne=DP,lne=s9,cne=a9,YA=E.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(zP,{ref:o,className:Q("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,g.jsx(Lo,{className:"ml-auto h-4 w-4"})]}));YA.displayName=zP.displayName;const KA=E.forwardRef(({className:e,...t},n)=>g.jsx(BP,{ref:n,className:Q("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));KA.displayName=BP.displayName;const XA=E.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(DP,{children:g.jsx(AP,{ref:r,sideOffset:t,className:Q("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));XA.displayName=AP.displayName;const ZA=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(OP,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));ZA.displayName=OP.displayName;const JA=E.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(jP,{ref:o,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(FP,{children:g.jsx(Wa,{className:"h-4 w-4"})})}),t]}));JA.displayName=jP.displayName;const QA=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs($P,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(FP,{children:g.jsx(Jd,{className:"h-2 w-2 fill-current"})})}),t]}));QA.displayName=$P.displayName;const eI=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(IP,{ref:r,className:Q("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));eI.displayName=IP.displayName;const tI=E.forwardRef(({className:e,...t},n)=>g.jsx(LP,{ref:n,className:Q("-mx-1 my-1 h-px bg-primary",e),...t}));tI.displayName=LP.displayName;const nI=({className:e,...t})=>g.jsx("span",{className:Q("ml-auto text-xs tracking-widest opacity-60",e),...t});nI.displayName="DropdownMenuShortcut";let rI=0;function une(e="id"){const t=E.useRef(null);return t.current===null&&(rI+=1,t.current=`${e}-${rI}`),t.current}const dne=kn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),oy=E.forwardRef(({className:e,...t},n)=>g.jsx(VP,{ref:n,className:Q(dne(),e),...t}));oy.displayName=VP.displayName;const fne=lV,oI=E.createContext({}),hne=({...e})=>g.jsx(oI.Provider,{value:{name:e.name},children:g.jsx(fV,{...e})}),mc=()=>{const e=E.useContext(oI),t=E.useContext(iI),{getFieldState:n,formState:r}=Yu(),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},iI=E.createContext({}),aI=E.forwardRef(({className:e,...t},n)=>{const r=une();return g.jsx(iI.Provider,{value:{id:r},children:g.jsx("div",{ref:n,className:Q("space-y-2",e),...t})})});aI.displayName="FormItem";const sI=E.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:o}=mc();return g.jsx(oy,{ref:n,className:Q(r&&"text-destructive",e),htmlFor:o,...t})});sI.displayName="FormLabel";const lI=E.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:i}=mc();return g.jsx(Zn,{ref:t,id:r,"aria-describedby":n?`${o} ${i}`:`${o}`,"aria-invalid":!!n,...e})});lI.displayName="FormControl";const cI=E.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=mc();return g.jsx("p",{ref:n,id:r,className:Q("text-sm text-foreground",e),...t})});cI.displayName="FormDescription";const uI=E.forwardRef(({className:e,children:t,...n},r)=>{const{error:o,formMessageId:i}=mc(),a=o?String(o==null?void 0:o.message):t;return a?g.jsx("p",{ref:r,id:i,className:Q("text-sm font-medium text-destructive",e),...n,children:a}):null});uI.displayName="FormMessage";const pne=g9,mne=w9,dI=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>g.jsx(KP,{ref:o,align:t,sideOffset:n,className:Q("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));dI.displayName=KP.displayName;const fI=E.forwardRef(({className:e,type:t,...n},r)=>g.jsx("input",{type:t,className:Q("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));fI.displayName="Input";const gne=$9,wne=F9,vne=wR,yne=z9,bne=L9,hI=E.forwardRef(({className:e,...t},n)=>g.jsx(mR,{ref:n,className:Q("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",e),...t}));hI.displayName=mR.displayName;const pI=E.forwardRef(({className:e,...t},n)=>g.jsx(gR,{ref:n,className:Q("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e),...t}));pI.displayName=gR.displayName;const mI=E.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(ER,{ref:o,className:Q("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,g.jsx(Lo,{className:"ml-auto h-4 w-4"})]}));mI.displayName=ER.displayName;const gI=E.forwardRef(({className:e,...t},n)=>g.jsx(PR,{ref:n,className:Q("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));gI.displayName=PR.displayName;const wI=E.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,...o},i)=>g.jsx(wR,{children:g.jsx(vR,{ref:i,align:t,alignOffset:n,sideOffset:r,className:Q("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));wI.displayName=vR.displayName;const vI=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(bR,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));vI.displayName=bR.displayName;const yI=E.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(xR,{ref:o,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(SR,{children:g.jsx(Wa,{className:"h-4 w-4"})})}),t]}));yI.displayName=xR.displayName;const bI=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(_R,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(SR,{children:g.jsx(Jd,{className:"h-2 w-2 fill-current"})})}),t]}));bI.displayName=_R.displayName;const xI=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(yR,{ref:r,className:Q("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));xI.displayName=yR.displayName;const _I=E.forwardRef(({className:e,...t},n)=>g.jsx(CR,{ref:n,className:Q("-mx-1 my-1 h-px bg-primary",e),...t}));_I.displayName=CR.displayName;const SI=({className:e,...t})=>g.jsx("span",{className:Q("ml-auto text-xs tracking-widest text-foreground",e),...t});SI.displayName="MenubarShortcut";const CI=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(YR,{ref:r,className:Q("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,g.jsx(iy,{})]}));CI.displayName=YR.displayName;const EI=E.forwardRef(({className:e,...t},n)=>g.jsx(KR,{ref:n,className:Q("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));EI.displayName=KR.displayName;const xne=nq,PI=kn("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),RI=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(XR,{ref:r,className:Q(PI(),"group",e),...n,children:[t," ",g.jsx(Xd,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));RI.displayName=XR.displayName;const NI=E.forwardRef(({className:e,...t},n)=>g.jsx(JR,{ref:n,className:Q("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",e),...t}));NI.displayName=JR.displayName;const _ne=rq,iy=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:Q("absolute left-0 top-full flex justify-center"),children:g.jsx(QR,{className:Q("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:n,...t})}));iy.displayName=QR.displayName;const TI=E.forwardRef(({className:e,...t},n)=>g.jsx(ZR,{ref:n,className:Q("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:g.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));TI.displayName=ZR.displayName;const MI=({className:e,...t})=>g.jsx("nav",{role:"navigation","aria-label":"pagination",className:Q("mx-auto flex w-full justify-center",e),...t});MI.displayName="Pagination";const kI=E.forwardRef(({className:e,...t},n)=>g.jsx("ul",{ref:n,className:Q("flex flex-row items-center gap-1",e),...t}));kI.displayName="PaginationContent";const DI=E.forwardRef(({className:e,...t},n)=>g.jsx("li",{ref:n,className:Q("",e),...t}));DI.displayName="PaginationItem";const is=E.forwardRef(({className:e,isActive:t,disabled:n,...r},o)=>g.jsx(rr,{ref:o,"aria-current":t?"page":void 0,disabled:n,className:Q("h-9 w-9",{"pointer-events-none bg-accent":t,"pointer-events-none opacity-50":n},e),...r}));is.displayName="PaginationLink";const AI=E.forwardRef(({className:e,...t},n)=>g.jsxs(is,{ref:n,"aria-label":"Go to previous page",className:Q("gap-1 px-2 min-w-[100px]",e),...t,children:[g.jsx(Zd,{className:"h-4 w-4"}),g.jsx("span",{children:"Previous"})]}));AI.displayName="PaginationPrevious";const II=E.forwardRef(({className:e,...t},n)=>g.jsxs(is,{ref:n,"aria-label":"Go to next page",className:Q("gap-1 px-2 min-w-[100px]",e),...t,children:[g.jsx("span",{children:"Next"}),g.jsx(Lo,{className:"h-4 w-4"})]}));II.displayName="PaginationNext";const OI=E.forwardRef(({className:e,...t},n)=>g.jsx(is,{ref:n,"aria-label":"Go to first page",className:Q("",e),...t,children:g.jsx(b6,{className:"h-4 w-4"})}));OI.displayName="PaginationFirst";const jI=E.forwardRef(({className:e,...t},n)=>g.jsx(is,{ref:n,"aria-label":"Go to last page",className:Q("",e),...t,children:g.jsx(x6,{className:"h-4 w-4"})}));jI.displayName="PaginationLast";const $I=({className:e,...t})=>g.jsxs("span",{"aria-hidden":!0,className:Q("flex h-9 w-9 items-center justify-center",e),...t,children:[g.jsx(S6,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"More pages"})]});$I.displayName="PaginationEllipsis";const FI=E.forwardRef(({className:e,value:t,...n},r)=>g.jsx(wN,{ref:r,className:Q("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:g.jsx(_q,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));FI.displayName=wN.displayName;const LI=E.forwardRef(({className:e,...t},n)=>g.jsx(TN,{className:Q("grid gap-2",e),...t,ref:n}));LI.displayName=TN.displayName;const zI=E.forwardRef(({className:e,...t},n)=>g.jsx(MN,{ref:n,className:Q("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:g.jsx(Dq,{className:"flex items-center justify-center",children:g.jsx(Jd,{className:"h-2.5 w-2.5 fill-current text-current"})})}));zI.displayName=MN.displayName;const{createElement:as,createContext:Sne,createRef:Xoe,forwardRef:BI,useCallback:yn,useContext:HI,useEffect:Ni,useImperativeHandle:VI,useLayoutEffect:Cne,useMemo:Ene,useRef:bn,useState:ss}=y,UI=y[`useId${Math.random()}`.slice(0,5)],Pne=Cne,Sf=Sne(null);Sf.displayName="PanelGroupContext";const Ti=Pne,Rne=typeof UI=="function"?UI:()=>null;let Nne=0;function ay(e=null){const t=Rne(),n=bn(e||t||null);return n.current===null&&(n.current=""+Nne++),e??n.current}function WI({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:a,maxSize:s,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:f,style:h,tagName:p="div",...m}){const v=HI(Sf);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:b,getPanelSize:x,getPanelStyle:_,groupId:C,isPanelCollapsed:N,reevaluatePanelConstraints:R,registerPanel:T,resizePanel:M,unregisterPanel:D}=v,A=ay(a),j=bn({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:s,minSize:l},id:A,idIsFromProps:a!==void 0,order:f});bn({didLogMissingDefaultSizeWarning:!1}),Ti(()=>{const{callbacks:W,constraints:re}=j.current,Y={...re};j.current.id=A,j.current.idIsFromProps=a!==void 0,j.current.order=f,W.onCollapse=c,W.onExpand=u,W.onResize=d,re.collapsedSize=n,re.collapsible=r,re.defaultSize=o,re.maxSize=s,re.minSize=l,(Y.collapsedSize!==re.collapsedSize||Y.collapsible!==re.collapsible||Y.maxSize!==re.maxSize||Y.minSize!==re.minSize)&&R(j.current,Y)}),Ti(()=>{const W=j.current;return T(W),()=>{D(W)}},[f,A,T,D]),VI(i,()=>({collapse:()=>{w(j.current)},expand:W=>{b(j.current,W)},getId(){return A},getSize(){return x(j.current)},isCollapsed(){return N(j.current)},isExpanded(){return!N(j.current)},resize:W=>{M(j.current,W)}}),[w,b,x,N,A,M]);const $=_(j.current,o);return as(p,{...m,children:e,className:t,id:a,style:{...$,...h},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":C,"data-panel-id":A,"data-panel-size":parseFloat(""+$.flexGrow).toFixed(1)})}const GI=BI((e,t)=>as(WI,{...e,forwardedRef:t}));WI.displayName="Panel",GI.displayName="forwardRef(Panel)";let sy=null,Mi=null;function Tne(e,t){if(t){const n=(t&eO)!==0,r=(t&tO)!==0,o=(t&nO)!==0,i=(t&rO)!==0;if(n)return o?"se-resize":i?"ne-resize":"e-resize";if(r)return o?"sw-resize":i?"nw-resize":"w-resize";if(o)return"s-resize";if(i)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Mne(){Mi!==null&&(document.head.removeChild(Mi),sy=null,Mi=null)}function ly(e,t){const n=Tne(e,t);sy!==n&&(sy=n,Mi===null&&(Mi=document.createElement("style"),document.head.appendChild(Mi)),Mi.innerHTML=`*{cursor: ${n}!important;}`)}function qI(e){return e.type==="keydown"}function YI(e){return e.type.startsWith("pointer")}function KI(e){return e.type.startsWith("mouse")}function Cf(e){if(YI(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(KI(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function kne(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Dne(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Ane(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:JI(e),b:JI(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;ze(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:ZI(XI(n.a)),b:ZI(XI(n.b))};if(o.a===o.b){const i=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let s=i.length;for(;s--;){const l=i[s];if(l===a.a)return 1;if(l===a.b)return-1}}return Math.sign(o.a-o.b)}const Ine=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function One(e){var t;const n=getComputedStyle((t=QI(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function jne(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||One(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Ine.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function XI(e){let t=e.length;for(;t--;){const n=e[t];if(ze(n,"Missing node"),jne(n))return n}return null}function ZI(e){return e&&Number(getComputedStyle(e).zIndex)||0}function JI(e){const t=[];for(;e;)t.push(e),e=QI(e);return t}function QI(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const eO=1,tO=2,nO=4,rO=8,$ne=kne()==="coarse";let cr=[],ls=!1,Wo=new Map,Ef=new Map;const gc=new Set;function Fne(e,t,n,r,o){var i;const{ownerDocument:a}=t,s={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},l=(i=Wo.get(a))!==null&&i!==void 0?i:0;return Wo.set(a,l+1),gc.add(s),Pf(),function(){var u;Ef.delete(e),gc.delete(s);const d=(u=Wo.get(a))!==null&&u!==void 0?u:1;if(Wo.set(a,d-1),Pf(),d===1&&Wo.delete(a),cr.includes(s)){const f=cr.indexOf(s);f>=0&&cr.splice(f,1),dy(),o("up",!0,null)}}}function oO(e){const{target:t}=e,{x:n,y:r}=Cf(e);ls=!0,cy({target:t,x:n,y:r}),Pf(),cr.length>0&&(Rf("down",e),e.preventDefault(),e.stopPropagation())}function wc(e){const{x:t,y:n}=Cf(e);if(ls&&e.buttons===0&&(ls=!1,Rf("up",e)),!ls){const{target:r}=e;cy({target:r,x:t,y:n})}Rf("move",e),dy(),cr.length>0&&e.preventDefault()}function cs(e){const{target:t}=e,{x:n,y:r}=Cf(e);Ef.clear(),ls=!1,cr.length>0&&e.preventDefault(),Rf("up",e),cy({target:t,x:n,y:r}),dy(),Pf()}function cy({target:e,x:t,y:n}){cr.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),gc.forEach(o=>{const{element:i,hitAreaMargins:a}=o,s=i.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=s,f=$ne?a.coarse:a.fine;if(t>=c-f&&t<=u+f&&n>=d-f&&n<=l+f){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&Ane(r,i)>0){let p=r,m=!1;for(;p&&!p.contains(i);){if(Dne(p.getBoundingClientRect(),s)){m=!0;break}p=p.parentElement}if(m)return}cr.push(o)}})}function uy(e,t){Ef.set(e,t)}function dy(){let e=!1,t=!1;cr.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;Ef.forEach(r=>{n|=r}),e&&t?ly("intersection",n):e?ly("horizontal",n):t?ly("vertical",n):Mne()}function Pf(){Wo.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",cs),n.removeEventListener("pointerdown",oO),n.removeEventListener("pointerleave",wc),n.removeEventListener("pointermove",wc)}),window.removeEventListener("pointerup",cs),window.removeEventListener("pointercancel",cs),gc.size>0&&(ls?(cr.length>0&&Wo.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",cs),n.addEventListener("pointerleave",wc),n.addEventListener("pointermove",wc))}),window.addEventListener("pointerup",cs),window.addEventListener("pointercancel",cs)):Wo.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",oO,{capture:!0}),n.addEventListener("pointermove",wc))}))}function Rf(e,t){gc.forEach(n=>{const{setResizeHandlerState:r}=n,o=cr.includes(n);r(e,o,t)})}function Lne(){const[e,t]=ss(0);return yn(()=>t(n=>n+1),[])}function ze(e,t){if(!e)throw console.error(t),Error(t)}const fy=10;function ki(e,t,n=fy){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function io(e,t,n=fy){return ki(e,t,n)===0}function In(e,t,n){return ki(e,t,n)===0}function zne(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const o=e[r],i=t[r];if(!In(o,i,n))return!1}return!0}function us({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];ze(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:i,maxSize:a=100,minSize:s=0}=r;if(ki(n,s)<0)if(i){const l=(o+s)/2;ki(n,l)<0?n=o:n=s}else n=s;return n=Math.min(a,n),n=parseFloat(n.toFixed(fy)),n}function vc({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:i}){if(In(e,0))return t;const a=[...t],[s,l]=r;ze(s!=null,"Invalid first pivot index"),ze(l!=null,"Invalid second pivot index");let c=0;if(i==="keyboard"){{const d=e<0?l:s,f=n[d];ze(f,`Panel constraints not found for index ${d}`);const{collapsedSize:h=0,collapsible:p,minSize:m=0}=f;if(p){const v=t[d];if(ze(v!=null,`Previous layout not found for panel index ${d}`),In(v,h)){const w=m-v;ki(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}{const d=e<0?s:l,f=n[d];ze(f,`No panel constraints found for index ${d}`);const{collapsedSize:h=0,collapsible:p,minSize:m=0}=f;if(p){const v=t[d];if(ze(v!=null,`Previous layout not found for panel index ${d}`),In(v,m)){const w=v-h;ki(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}}{const d=e<0?1:-1;let f=e<0?l:s,h=0;for(;;){const m=t[f];ze(m!=null,`Previous layout not found for panel index ${f}`);const w=us({panelConstraints:n,panelIndex:f,size:100})-m;if(h+=w,f+=d,f<0||f>=n.length)break}const p=Math.min(Math.abs(e),Math.abs(h));e=e<0?0-p:p}{let f=e<0?s:l;for(;f>=0&&f<n.length;){const h=Math.abs(e)-Math.abs(c),p=t[f];ze(p!=null,`Previous layout not found for panel index ${f}`);const m=p-h,v=us({panelConstraints:n,panelIndex:f,size:m});if(!In(p,v)&&(c+=p-v,a[f]=v,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(zne(o,a))return o;{const d=e<0?l:s,f=t[d];ze(f!=null,`Previous layout not found for panel index ${d}`);const h=f+c,p=us({panelConstraints:n,panelIndex:d,size:h});if(a[d]=p,!In(p,h)){let m=h-p,w=e<0?l:s;for(;w>=0&&w<n.length;){const b=a[w];ze(b!=null,`Previous layout not found for panel index ${w}`);const x=b+m,_=us({panelConstraints:n,panelIndex:w,size:x});if(In(b,_)||(m-=_-b,a[w]=_),In(m,0))break;e>0?w--:w++}}}const u=a.reduce((d,f)=>f+d,0);return In(u,100)?a:o}function Bne({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,a=0;const s=n[0];ze(s!=null,"No pivot index found"),t.forEach((d,f)=>{const{constraints:h}=d,{maxSize:p=100,minSize:m=0}=h;f===s?(r=m,o=p):(i+=m,a+=p)});const l=Math.min(o,100-i),c=Math.max(r,100-a),u=e[s];return{valueMax:l,valueMin:c,valueNow:u}}function yc(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function iO(e,t,n=document){const o=yc(e,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return o??null}function aO(e,t,n){const r=iO(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function sO(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Nf(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function Hne(e,t,n,r=document){var o,i,a,s;const l=Nf(t,r),c=yc(e,r),u=l?c.indexOf(l):-1,d=(o=(i=n[u])===null||i===void 0?void 0:i.id)!==null&&o!==void 0?o:null,f=(a=(s=n[u+1])===null||s===void 0?void 0:s.id)!==null&&a!==void 0?a:null;return[d,f]}function Vne({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:i,setLayout:a}){bn({didWarnAboutMissingResizeHandle:!1}),Ti(()=>{if(!i)return;const s=yc(n,i);for(let l=0;l<o.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=Bne({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),f=s[l];if(f!=null){const h=o[l];ze(h,`No panel data found for index "${l}"`),f.setAttribute("aria-controls",h.id),f.setAttribute("aria-valuemax",""+Math.round(c)),f.setAttribute("aria-valuemin",""+Math.round(u)),f.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{s.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,o,i]),Ni(()=>{if(!i)return;const s=t.current;ze(s,"Eager values not found");const{panelDataArray:l}=s,c=sO(n,i);ze(c!=null,`No group found for id "${n}"`);const u=yc(n,i);ze(u,`No resize handles found for group id "${n}"`);const d=u.map(f=>{const h=f.getAttribute("data-panel-resize-handle-id");ze(h,"Resize handle element has no handle id attribute");const[p,m]=Hne(n,h,l,i);if(p==null||m==null)return()=>{};const v=w=>{if(!w.defaultPrevented)switch(w.key){case"Enter":{w.preventDefault();const b=l.findIndex(x=>x.id===p);if(b>=0){const x=l[b];ze(x,`No panel data found for index ${b}`);const _=r[b],{collapsedSize:C=0,collapsible:N,minSize:R=0}=x.constraints;if(_!=null&&N){const T=vc({delta:In(_,C)?R-C:C-_,initialLayout:r,panelConstraints:l.map(M=>M.constraints),pivotIndices:aO(n,h,i),prevLayout:r,trigger:"keyboard"});r!==T&&a(T)}}break}}};return f.addEventListener("keydown",v),()=>{f.removeEventListener("keydown",v)}});return()=>{d.forEach(f=>f())}},[i,e,t,n,r,o,a])}function lO(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function cO(e,t){const n=e==="horizontal",{x:r,y:o}=Cf(t);return n?r:o}function Une(e,t,n,r,o){const i=n==="horizontal",a=Nf(t,o);ze(a,`No resize handle element found for id "${t}"`);const s=a.getAttribute("data-panel-group-id");ze(s,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=cO(n,e),u=sO(s,o);ze(u,`No group element found for id "${s}"`);const d=u.getBoundingClientRect(),f=i?d.width:d.height;return(c-l)/f*100}function Wne(e,t,n,r,o,i){if(qI(e)){const a=n==="horizontal";let s=0;e.shiftKey?s=100:o!=null?s=o:s=10;let l=0;switch(e.key){case"ArrowDown":l=a?0:s;break;case"ArrowLeft":l=a?-s:0;break;case"ArrowRight":l=a?s:0;break;case"ArrowUp":l=a?0:-s;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:Une(e,t,n,r,i)}function Gne({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,o=100;for(let i=0;i<e.length;i++){const a=n[i];ze(a,`Panel constraints not found for index ${i}`);const{defaultSize:s}=a;s!=null&&(r++,t[i]=s,o-=s)}for(let i=0;i<e.length;i++){const a=n[i];ze(a,`Panel constraints not found for index ${i}`);const{defaultSize:s}=a;if(s!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function ds(e,t,n){t.forEach((r,o)=>{const i=e[o];ze(i,`Panel data not found for index ${o}`);const{callbacks:a,constraints:s,id:l}=i,{collapsedSize:c=0,collapsible:u}=s,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:f,onExpand:h,onResize:p}=a;p&&p(r,d),u&&(f||h)&&(h&&(d==null||io(d,c))&&!io(r,c)&&h(),f&&(d==null||!io(d,c))&&io(r,c)&&f())}})}function Tf(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function qne({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const a=n[o];let s;return a==null?s=e!=null?e.toPrecision(i):"1":r.length===1?s="1":s=a.toPrecision(i),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function Yne(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function uO(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function dO(e){return`react-resizable-panels:${e}`}function fO(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=t;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function hO(e,t){try{const n=dO(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Kne(e,t,n){var r,o;const i=(r=hO(e,n))!==null&&r!==void 0?r:{},a=fO(t);return(o=i[a])!==null&&o!==void 0?o:null}function Xne(e,t,n,r,o){var i;const a=dO(e),s=fO(t),l=(i=hO(e,o))!==null&&i!==void 0?i:{};l[s]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(a,JSON.stringify(l))}catch(c){console.error(c)}}function pO({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,a)=>i+a,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!In(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const a=n[i];ze(a!=null,`No layout data found for index ${i}`);const s=100/r*a;n[i]=s}let o=0;for(let i=0;i<t.length;i++){const a=n[i];ze(a!=null,`No layout data found for index ${i}`);const s=us({panelConstraints:t,panelIndex:i,size:a});a!=s&&(o+=a-s,n[i]=s)}if(!In(o,0))for(let i=0;i<t.length;i++){const a=n[i];ze(a!=null,`No layout data found for index ${i}`);const s=a+o,l=us({panelConstraints:t,panelIndex:i,size:s});if(a!==l&&(o-=l-a,n[i]=l,In(o,0)))break}return n}const Zne=100,bc={getItem:e=>(uO(bc),bc.getItem(e)),setItem:(e,t)=>{uO(bc),bc.setItem(e,t)}},mO={};function gO({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:a=null,keyboardResizeBy:s=null,storage:l=bc,style:c,tagName:u="div",...d}){const f=ay(i),h=bn(null),[p,m]=ss(null),[v,w]=ss([]),b=Lne(),x=bn({}),_=bn(new Map),C=bn(0),N=bn({autoSaveId:e,direction:r,dragState:p,id:f,keyboardResizeBy:s,onLayout:a,storage:l}),R=bn({layout:v,panelDataArray:[],panelDataArrayChanged:!1});bn({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),VI(o,()=>({getId:()=>N.current.id,getLayout:()=>{const{layout:F}=R.current;return F},setLayout:F=>{const{onLayout:q}=N.current,{layout:ce,panelDataArray:L}=R.current,K=pO({layout:F,panelConstraints:L.map(z=>z.constraints)});lO(ce,K)||(w(K),R.current.layout=K,q&&q(K),ds(L,K,x.current))}}),[]),Ti(()=>{N.current.autoSaveId=e,N.current.direction=r,N.current.dragState=p,N.current.id=f,N.current.onLayout=a,N.current.storage=l}),Vne({committedValuesRef:N,eagerValuesRef:R,groupId:f,layout:v,panelDataArray:R.current.panelDataArray,setLayout:w,panelGroupElement:h.current}),Ni(()=>{const{panelDataArray:F}=R.current;if(e){if(v.length===0||v.length!==F.length)return;let q=mO[e];q==null&&(q=Yne(Xne,Zne),mO[e]=q);const ce=[...F],L=new Map(_.current);q(e,ce,L,v,l)}},[e,v,l]),Ni(()=>{});const T=yn(F=>{const{onLayout:q}=N.current,{layout:ce,panelDataArray:L}=R.current;if(F.constraints.collapsible){const K=L.map(ae=>ae.constraints),{collapsedSize:z=0,panelSize:ie,pivotIndices:le}=Di(L,F,ce);if(ze(ie!=null,`Panel size not found for panel "${F.id}"`),!io(ie,z)){_.current.set(F.id,ie);const H=fs(L,F)===L.length-1?ie-z:z-ie,ue=vc({delta:H,initialLayout:ce,panelConstraints:K,pivotIndices:le,prevLayout:ce,trigger:"imperative-api"});Tf(ce,ue)||(w(ue),R.current.layout=ue,q&&q(ue),ds(L,ue,x.current))}}},[]),M=yn((F,q)=>{const{onLayout:ce}=N.current,{layout:L,panelDataArray:K}=R.current;if(F.constraints.collapsible){const z=K.map(se=>se.constraints),{collapsedSize:ie=0,panelSize:le=0,minSize:ae=0,pivotIndices:H}=Di(K,F,L),ue=q??ae;if(io(le,ie)){const se=_.current.get(F.id),ye=se!=null&&se>=ue?se:ue,xe=fs(K,F)===K.length-1?le-ye:ye-le,O=vc({delta:xe,initialLayout:L,panelConstraints:z,pivotIndices:H,prevLayout:L,trigger:"imperative-api"});Tf(L,O)||(w(O),R.current.layout=O,ce&&ce(O),ds(K,O,x.current))}}},[]),D=yn(F=>{const{layout:q,panelDataArray:ce}=R.current,{panelSize:L}=Di(ce,F,q);return ze(L!=null,`Panel size not found for panel "${F.id}"`),L},[]),A=yn((F,q)=>{const{panelDataArray:ce}=R.current,L=fs(ce,F);return qne({defaultSize:q,dragState:p,layout:v,panelData:ce,panelIndex:L})},[p,v]),j=yn(F=>{const{layout:q,panelDataArray:ce}=R.current,{collapsedSize:L=0,collapsible:K,panelSize:z}=Di(ce,F,q);return ze(z!=null,`Panel size not found for panel "${F.id}"`),K===!0&&io(z,L)},[]),$=yn(F=>{const{layout:q,panelDataArray:ce}=R.current,{collapsedSize:L=0,collapsible:K,panelSize:z}=Di(ce,F,q);return ze(z!=null,`Panel size not found for panel "${F.id}"`),!K||ki(z,L)>0},[]),W=yn(F=>{const{panelDataArray:q}=R.current;q.push(F),q.sort((ce,L)=>{const K=ce.order,z=L.order;return K==null&&z==null?0:K==null?-1:z==null?1:K-z}),R.current.panelDataArrayChanged=!0,b()},[b]);Ti(()=>{if(R.current.panelDataArrayChanged){R.current.panelDataArrayChanged=!1;const{autoSaveId:F,onLayout:q,storage:ce}=N.current,{layout:L,panelDataArray:K}=R.current;let z=null;if(F){const le=Kne(F,K,ce);le&&(_.current=new Map(Object.entries(le.expandToSizes)),z=le.layout)}z==null&&(z=Gne({panelDataArray:K}));const ie=pO({layout:z,panelConstraints:K.map(le=>le.constraints)});lO(L,ie)||(w(ie),R.current.layout=ie,q&&q(ie),ds(K,ie,x.current))}}),Ti(()=>{const F=R.current;return()=>{F.layout=[]}},[]);const re=yn(F=>{let q=!1;const ce=h.current;return ce&&window.getComputedStyle(ce,null).getPropertyValue("direction")==="rtl"&&(q=!0),function(K){K.preventDefault();const z=h.current;if(!z)return()=>null;const{direction:ie,dragState:le,id:ae,keyboardResizeBy:H,onLayout:ue}=N.current,{layout:se,panelDataArray:ye}=R.current,{initialLayout:Ce}=le??{},xe=aO(ae,F,z);let O=Wne(K,F,ie,le,H,z);const V=ie==="horizontal";V&&q&&(O=-O);const J=ye.map(fe=>fe.constraints),we=vc({delta:O,initialLayout:Ce??se,panelConstraints:J,pivotIndices:xe,prevLayout:se,trigger:qI(K)?"keyboard":"mouse-or-touch"}),pe=!Tf(se,we);(YI(K)||KI(K))&&C.current!=O&&(C.current=O,!pe&&O!==0?V?uy(F,O<0?eO:tO):uy(F,O<0?nO:rO):uy(F,0)),pe&&(w(we),R.current.layout=we,ue&&ue(we),ds(ye,we,x.current))}},[]),Y=yn((F,q)=>{const{onLayout:ce}=N.current,{layout:L,panelDataArray:K}=R.current,z=K.map(se=>se.constraints),{panelSize:ie,pivotIndices:le}=Di(K,F,L);ze(ie!=null,`Panel size not found for panel "${F.id}"`);const H=fs(K,F)===K.length-1?ie-q:q-ie,ue=vc({delta:H,initialLayout:L,panelConstraints:z,pivotIndices:le,prevLayout:L,trigger:"imperative-api"});Tf(L,ue)||(w(ue),R.current.layout=ue,ce&&ce(ue),ds(K,ue,x.current))},[]),Z=yn((F,q)=>{const{layout:ce,panelDataArray:L}=R.current,{collapsedSize:K=0,collapsible:z}=q,{collapsedSize:ie=0,collapsible:le,maxSize:ae=100,minSize:H=0}=F.constraints,{panelSize:ue}=Di(L,F,ce);ue!=null&&(z&&le&&io(ue,K)?io(K,ie)||Y(F,ie):ue<H?Y(F,H):ue>ae&&Y(F,ae))},[Y]),B=yn((F,q)=>{const{direction:ce}=N.current,{layout:L}=R.current;if(!h.current)return;const K=Nf(F,h.current);ze(K,`Drag handle element not found for id "${F}"`);const z=cO(ce,q);m({dragHandleId:F,dragHandleRect:K.getBoundingClientRect(),initialCursorPosition:z,initialLayout:L})},[]),oe=yn(()=>{m(null)},[]),ee=yn(F=>{const{panelDataArray:q}=R.current,ce=fs(q,F);ce>=0&&(q.splice(ce,1),delete x.current[F.id],R.current.panelDataArrayChanged=!0,b())},[b]),ne=Ene(()=>({collapsePanel:T,direction:r,dragState:p,expandPanel:M,getPanelSize:D,getPanelStyle:A,groupId:f,isPanelCollapsed:j,isPanelExpanded:$,reevaluatePanelConstraints:Z,registerPanel:W,registerResizeHandle:re,resizePanel:Y,startDragging:B,stopDragging:oe,unregisterPanel:ee,panelGroupElement:h.current}),[T,p,r,M,D,A,f,j,$,Z,W,re,Y,B,oe,ee]),G={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return as(Sf.Provider,{value:ne},as(u,{...d,children:t,className:n,id:i,ref:h,style:{...G,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":f}))}const wO=BI((e,t)=>as(gO,{...e,forwardedRef:t}));gO.displayName="PanelGroup",wO.displayName="forwardRef(PanelGroup)";function fs(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Di(e,t,n){const r=fs(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t.constraints,panelSize:a,pivotIndices:i}}function Jne({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){Ni(()=>{if(e||n==null||r==null)return;const o=Nf(t,r);if(o==null)return;const i=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const s=o.getAttribute("data-panel-group-id");ze(s,`No group element found for id "${s}"`);const l=yc(s,r),c=iO(s,t,r);ze(c!==null,`No resize element found for id "${t}"`);const u=a.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return o.addEventListener("keydown",i),()=>{o.removeEventListener("keydown",i)}},[r,e,t,n])}function vO({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:i,onDragging:a,onFocus:s,style:l={},tabIndex:c=0,tagName:u="div",...d}){var f,h;const p=bn(null),m=bn({onDragging:a});Ni(()=>{m.current.onDragging=a});const v=HI(Sf);if(v===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:w,groupId:b,registerResizeHandle:x,startDragging:_,stopDragging:C,panelGroupElement:N}=v,R=ay(o),[T,M]=ss("inactive"),[D,A]=ss(!1),[j,$]=ss(null),W=bn({state:T});Ti(()=>{W.current.state=T}),Ni(()=>{if(n)$(null);else{const B=x(R);$(()=>B)}},[n,R,x]);const re=(f=r==null?void 0:r.coarse)!==null&&f!==void 0?f:15,Y=(h=r==null?void 0:r.fine)!==null&&h!==void 0?h:5;return Ni(()=>{if(n||j==null)return;const B=p.current;return ze(B,"Element ref not attached"),Fne(R,B,w,{coarse:re,fine:Y},(ee,ne,G)=>{if(ne)switch(ee){case"down":{M("drag"),ze(G,'Expected event to be defined for "down" action'),_(R,G);const{onDragging:F}=m.current;F&&F(!0);break}case"move":{const{state:F}=W.current;F!=="drag"&&M("hover"),ze(G,'Expected event to be defined for "move" action'),j(G);break}case"up":{M("hover"),C();const{onDragging:F}=m.current;F&&F(!1);break}}else M("inactive")})},[re,w,n,Y,x,R,j,_,C]),Jne({disabled:n,handleId:R,resizeHandler:j,panelGroupElement:N}),as(u,{...d,children:e,className:t,id:o,onBlur:()=>{A(!1),i==null||i()},onFocus:()=>{A(!0),s==null||s()},ref:p,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...l},tabIndex:c,"data-panel-group-direction":w,"data-panel-group-id":b,"data-resize-handle":"","data-resize-handle-active":T==="drag"?"pointer":D?"keyboard":void 0,"data-resize-handle-state":T,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":R})}vO.displayName="PanelResizeHandle";const yO=E.forwardRef(({className:e,...t},n)=>g.jsx(wO,{ref:n,className:Q("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}));yO.displayName="ResizablePanelGroup";const bO=E.forwardRef(({className:e,...t},n)=>g.jsx(GI,{ref:n,className:Q("relative flex h-full w-full",e),...t}));bO.displayName="ResizablePanel";const xO=({className:e,...t})=>g.jsx(vO,{className:Q("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-4 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-4 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...t,children:g.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",viewBox:"0 0 8 8",fill:"currentColor",children:[g.jsx("circle",{cx:"2",cy:"4",r:"0.75"}),g.jsx("circle",{cx:"6",cy:"4",r:"0.75"})]})})});xO.displayName="ResizableHandle";const _O=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(UN,{ref:r,className:Q("relative overflow-hidden",e),...n,children:[g.jsx(Uq,{className:"h-full w-full rounded-[inherit]",children:t}),g.jsx(hy,{}),g.jsx(Wq,{})]}));_O.displayName=UN.displayName;const hy=E.forwardRef(({className:e,orientation:t="vertical",...n},r)=>g.jsx(tw,{ref:r,orientation:t,className:Q("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:g.jsx(FN,{className:"relative flex-1 rounded-full bg-border"})}));hy.displayName=tw.displayName;const Qne=uY,ere=mY,tre=dY,SO=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(bT,{ref:r,className:Q("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,g.jsx(fY,{asChild:!0,children:g.jsx(Xd,{className:"h-4 w-4 opacity-50"})})]}));SO.displayName=bT.displayName;const py=E.forwardRef(({className:e,...t},n)=>g.jsx(CT,{ref:n,className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(y6,{className:"h-4 w-4"})}));py.displayName=CT.displayName;const my=E.forwardRef(({className:e,...t},n)=>g.jsx(ET,{ref:n,className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Xd,{className:"h-4 w-4"})}));my.displayName=ET.displayName;const CO=E.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>g.jsx(hY,{children:g.jsxs(xT,{ref:o,className:Q("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[g.jsx(py,{}),g.jsx(pY,{className:Q("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(my,{})]})}));CO.displayName=xT.displayName;const EO=E.forwardRef(({className:e,...t},n)=>g.jsx(_T,{ref:n,className:Q("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));EO.displayName=_T.displayName;const PO=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(ST,{ref:r,className:Q("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(wY,{children:g.jsx(Wa,{className:"h-4 w-4"})})}),g.jsx(gY,{children:t})]}));PO.displayName=ST.displayName;const RO=E.forwardRef(({className:e,...t},n)=>g.jsx(PT,{ref:n,className:Q("-mx-1 my-1 h-px bg-primary",e),...t}));RO.displayName=PT.displayName;const NO=E.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>g.jsx(TT,{ref:o,decorative:n,orientation:t,className:Q("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));NO.displayName=TT.displayName;const nre=fd,rre=hd,TO=Na,MO=pd,gy=E.forwardRef(({className:e,...t},n)=>g.jsx(Ca,{className:Q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));gy.displayName=Ca.displayName;const ore=kn("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),kO=E.forwardRef(({side:e="right",className:t,children:n,...r},o)=>g.jsxs(MO,{children:[g.jsx(gy,{}),g.jsxs(Ea,{ref:o,className:Q(ore({side:e}),t),...r,children:[n,g.jsxs(TO,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[g.jsx(NM,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));kO.displayName=Ea.displayName;const DO=({className:e,...t})=>g.jsx("div",{className:Q("flex flex-col space-y-2 text-center sm:text-left",e),...t});DO.displayName="SheetHeader";const AO=({className:e,...t})=>g.jsx("div",{className:Q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});AO.displayName="SheetFooter";const IO=E.forwardRef(({className:e,...t},n)=>g.jsx(Pa,{ref:n,className:Q("text-lg font-semibold text-foreground",e),...t}));IO.displayName=Pa.displayName;const OO=E.forwardRef(({className:e,...t},n)=>g.jsx(Ra,{ref:n,className:Q("text-sm text-foreground",e),...t}));OO.displayName=Ra.displayName;const jO=E.forwardRef(({className:e,variant:t,size:n,collapsed:r,fixed:o,...i},a)=>{const{variants:s}=Bo(),l=E.useMemo(()=>kn(s.sidebar.defaultStyles,{variants:s.sidebar.variantStyles,defaultVariants:s.sidebar.defaultVariants}),[s]);return g.jsx("div",{ref:a,className:Q(l({variant:t,size:n,collapsed:r}),o&&"fixed inset-y-0 left-0",e),...i})});jO.displayName="Sidebar";const $O=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("flex items-center justify-center py-4",e),...t}));$O.displayName="SidebarHeader";const FO=E.forwardRef(({className:e,...t},n)=>g.jsx("nav",{ref:n,className:Q("flex-1 space-y-1",e),...t}));FO.displayName="SidebarNav";const LO=E.forwardRef(({className:e,children:t,icon:n,badge:r,variant:o,active:i,...a},s)=>{const{variants:l}=Bo(),c=E.useMemo(()=>kn(l.sidebarItem.defaultStyles,{variants:l.sidebarItem.variantStyles,defaultVariants:l.sidebarItem.defaultVariants}),[l]);return g.jsxs("div",{ref:s,className:Q(c({variant:i?"active":o}),e),...a,children:[n&&g.jsx("span",{className:"shrink-0",children:n}),g.jsx("span",{className:"flex-1 truncate",children:t}),r&&g.jsx("span",{children:r})]})});LO.displayName="SidebarItem";const zO=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("space-y-3 py-2",e),role:"group",...t}));zO.displayName="SidebarGroup";const BO=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("mt-auto",e),...t}));BO.displayName="SidebarFooter";function ire({className:e,...t}){return g.jsx("div",{className:Q("animate-pulse rounded-md bg-primary",e),...t})}const HO=E.forwardRef(({className:e,...t},n)=>g.jsxs(VT,{ref:n,className:Q("relative flex w-full touch-none select-none items-center",e),...t,children:[g.jsx(jY,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:g.jsx($Y,{className:"absolute h-full bg-primary"})}),g.jsx(FY,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));HO.displayName=VT.displayName;var are=(e,t,n,r,o,i,a,s)=>{let l=document.documentElement,c=["light","dark"];function u(h){(Array.isArray(e)?e:[e]).forEach(p=>{let m=p==="class",v=m&&i?o.map(w=>i[w]||w):o;m?(l.classList.remove(...v),l.classList.add(h)):l.setAttribute(p,h)}),d(h)}function d(h){s&&c.includes(h)&&(l.style.colorScheme=h)}function f(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)u(r);else try{let h=localStorage.getItem(t)||n,p=a&&h==="system"?f():h;u(p)}catch{}},sre=y.createContext(void 0),lre={setTheme:e=>{},themes:[]},cre=()=>{var e;return(e=y.useContext(sre))!=null?e:lre};y.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:i,value:a,themes:s,nonce:l,scriptProps:c})=>{let u=JSON.stringify([n,t,i,e,s,a,r,o]).slice(1,-1);return y.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?l:"",dangerouslySetInnerHTML:{__html:`(${are.toString()})(${u})`}})});function ure(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const dre=e=>{switch(e){case"success":return pre;case"info":return gre;case"warning":return mre;case"error":return wre;default:return null}},fre=Array(12).fill(0),hre=({visible:e,className:t})=>E.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},E.createElement("div",{className:"sonner-spinner"},fre.map((n,r)=>E.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),pre=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),mre=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),gre=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),wre=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),vre=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},E.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),yre=()=>{const[e,t]=E.useState(document.hidden);return E.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let wy=1;class bre{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:wy++,a=this.toasts.find(l=>l.id===i),s=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...t,id:i,title:r}),{...l,...t,id:i,dismissible:s,title:r}):l):this.addToast({title:r,...o,dismissible:s,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0}))),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,a;const s=o.then(async c=>{if(a=["resolve",c],E.isValidElement(c))i=!1,this.create({id:r,type:"default",message:c});else if(_re(c)&&!c.ok){i=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,h=typeof d=="object"?d:{message:d};this.create({id:r,type:"error",description:f,...h})}else if(c instanceof Error){i=!1;const d=typeof n.error=="function"?await n.error(c):n.error,f=typeof n.description=="function"?await n.description(c):n.description,h=typeof d=="object"?d:{message:d};this.create({id:r,type:"error",description:f,...h})}else if(n.success!==void 0){i=!1;const d=typeof n.success=="function"?await n.success(c):n.success,f=typeof n.description=="function"?await n.description(c):n.description,h=typeof d=="object"?d:{message:d};this.create({id:r,type:"success",description:f,...h})}}).catch(async c=>{if(a=["reject",c],n.error!==void 0){i=!1;const u=typeof n.error=="function"?await n.error(c):n.error,d=typeof n.description=="function"?await n.description(c):n.description,f=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:d,...f})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,u)=>s.then(()=>a[0]==="reject"?u(a[1]):c(a[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||wy++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const xn=new bre,xre=(e,t)=>{const n=(t==null?void 0:t.id)||wy++;return xn.addToast({title:e,...t,id:n}),n},_re=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Sre=xre,Cre=()=>xn.toasts,Ere=()=>xn.getActiveToasts();Object.assign(Sre,{success:xn.success,info:xn.info,warning:xn.warning,error:xn.error,custom:xn.custom,message:xn.message,promise:xn.promise,dismiss:xn.dismiss,loading:xn.loading},{getHistory:Cre,getToasts:Ere}),ure("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Mf(e){return e.label!==void 0}const Pre=3,Rre="24px",Nre="16px",VO=4e3,Tre=356,Mre=14,kre=45,Dre=200;function Lr(...e){return e.filter(Boolean).join(" ")}function Are(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Ire=e=>{var t,n,r,o,i,a,s,l,c;const{invert:u,toast:d,unstyled:f,interacting:h,setHeights:p,visibleToasts:m,heights:v,index:w,toasts:b,expanded:x,removeToast:_,defaultRichColors:C,closeButton:N,style:R,cancelButtonStyle:T,actionButtonStyle:M,className:D="",descriptionClassName:A="",duration:j,position:$,gap:W,expandByDefault:re,classNames:Y,icons:Z,closeButtonAriaLabel:B="Close toast"}=e,[oe,ee]=E.useState(null),[ne,G]=E.useState(null),[F,q]=E.useState(!1),[ce,L]=E.useState(!1),[K,z]=E.useState(!1),[ie,le]=E.useState(!1),[ae,H]=E.useState(!1),[ue,se]=E.useState(0),[ye,Ce]=E.useState(0),xe=E.useRef(d.duration||j||VO),O=E.useRef(null),V=E.useRef(null),J=w===0,we=w+1<=m,pe=d.type,fe=d.dismissible!==!1,ge=d.className||"",_e=d.descriptionClassName||"",Xe=E.useMemo(()=>v.findIndex(Ee=>Ee.toastId===d.id)||0,[v,d.id]),k=E.useMemo(()=>{var Ee;return(Ee=d.closeButton)!=null?Ee:N},[d.closeButton,N]),S=E.useMemo(()=>d.duration||j||VO,[d.duration,j]),P=E.useRef(0),I=E.useRef(0),U=E.useRef(0),te=E.useRef(null),[he,Oe]=$.split("-"),Qe=E.useMemo(()=>v.reduce((Ee,Ge,qe)=>qe>=Xe?Ee:Ee+Ge.height,0),[v,Xe]),nt=yre(),st=d.invert||u,We=pe==="loading";I.current=E.useMemo(()=>Xe*W+Qe,[Xe,Qe]),E.useEffect(()=>{xe.current=S},[S]),E.useEffect(()=>{q(!0)},[]),E.useEffect(()=>{const Ee=V.current;if(Ee){const Ge=Ee.getBoundingClientRect().height;return Ce(Ge),p(qe=>[{toastId:d.id,height:Ge,position:d.position},...qe]),()=>p(qe=>qe.filter(wt=>wt.toastId!==d.id))}},[p,d.id]),E.useLayoutEffect(()=>{if(!F)return;const Ee=V.current,Ge=Ee.style.height;Ee.style.height="auto";const qe=Ee.getBoundingClientRect().height;Ee.style.height=Ge,Ce(qe),p(wt=>wt.find(ft=>ft.toastId===d.id)?wt.map(ft=>ft.toastId===d.id?{...ft,height:qe}:ft):[{toastId:d.id,height:qe,position:d.position},...wt])},[F,d.title,d.description,p,d.id]);const Te=E.useCallback(()=>{L(!0),se(I.current),p(Ee=>Ee.filter(Ge=>Ge.toastId!==d.id)),setTimeout(()=>{_(d)},Dre)},[d,_,p,I]);E.useEffect(()=>{if(d.promise&&pe==="loading"||d.duration===1/0||d.type==="loading")return;let Ee;return x||h||nt?(()=>{if(U.current<P.current){const wt=new Date().getTime()-P.current;xe.current=xe.current-wt}U.current=new Date().getTime()})():(()=>{xe.current!==1/0&&(P.current=new Date().getTime(),Ee=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Te()},xe.current))})(),()=>clearTimeout(Ee)},[x,h,d,pe,nt,Te]),E.useEffect(()=>{d.delete&&Te()},[Te,d.delete]);function Ze(){var Ee;if(Z!=null&&Z.loading){var Ge;return E.createElement("div",{className:Lr(Y==null?void 0:Y.loader,d==null||(Ge=d.classNames)==null?void 0:Ge.loader,"sonner-loader"),"data-visible":pe==="loading"},Z.loading)}return E.createElement(hre,{className:Lr(Y==null?void 0:Y.loader,d==null||(Ee=d.classNames)==null?void 0:Ee.loader),visible:pe==="loading"})}var et,He;return E.createElement("li",{tabIndex:0,ref:V,className:Lr(D,ge,Y==null?void 0:Y.toast,d==null||(t=d.classNames)==null?void 0:t.toast,Y==null?void 0:Y.default,Y==null?void 0:Y[pe],d==null||(n=d.classNames)==null?void 0:n[pe]),"data-sonner-toast":"","data-rich-colors":(et=d.richColors)!=null?et:C,"data-styled":!(d.jsx||d.unstyled||f),"data-mounted":F,"data-promise":!!d.promise,"data-swiped":ae,"data-removed":ce,"data-visible":we,"data-y-position":he,"data-x-position":Oe,"data-index":w,"data-front":J,"data-swiping":K,"data-dismissible":fe,"data-type":pe,"data-invert":st,"data-swipe-out":ie,"data-swipe-direction":ne,"data-expanded":!!(x||re&&F),style:{"--index":w,"--toasts-before":w,"--z-index":b.length-w,"--offset":`${ce?ue:I.current}px`,"--initial-height":re?"auto":`${ye}px`,...R,...d.style},onDragEnd:()=>{z(!1),ee(null),te.current=null},onPointerDown:Ee=>{We||!fe||(O.current=new Date,se(I.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(z(!0),te.current={x:Ee.clientX,y:Ee.clientY}))},onPointerUp:()=>{var Ee,Ge,qe;if(ie||!fe)return;te.current=null;const wt=Number(((Ee=V.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Xt=Number(((Ge=V.current)==null?void 0:Ge.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ft=new Date().getTime()-((qe=O.current)==null?void 0:qe.getTime()),Nt=oe==="x"?wt:Xt,an=Math.abs(Nt)/ft;if(Math.abs(Nt)>=kre||an>.11){se(I.current),d.onDismiss==null||d.onDismiss.call(d,d),G(oe==="x"?wt>0?"right":"left":Xt>0?"down":"up"),Te(),le(!0);return}else{var Zt,_n;(Zt=V.current)==null||Zt.style.setProperty("--swipe-amount-x","0px"),(_n=V.current)==null||_n.style.setProperty("--swipe-amount-y","0px")}H(!1),z(!1),ee(null)},onPointerMove:Ee=>{var Ge,qe,wt;if(!te.current||!fe||((Ge=window.getSelection())==null?void 0:Ge.toString().length)>0)return;const ft=Ee.clientY-te.current.y,Nt=Ee.clientX-te.current.x;var an;const Zt=(an=e.swipeDirections)!=null?an:Are($);!oe&&(Math.abs(Nt)>1||Math.abs(ft)>1)&&ee(Math.abs(Nt)>Math.abs(ft)?"x":"y");let _n={x:0,y:0};const nj=Ai=>1/(1.5+Math.abs(Ai)/20);if(oe==="y"){if(Zt.includes("top")||Zt.includes("bottom"))if(Zt.includes("top")&&ft<0||Zt.includes("bottom")&&ft>0)_n.y=ft;else{const Ai=ft*nj(ft);_n.y=Math.abs(Ai)<Math.abs(ft)?Ai:ft}}else if(oe==="x"&&(Zt.includes("left")||Zt.includes("right")))if(Zt.includes("left")&&Nt<0||Zt.includes("right")&&Nt>0)_n.x=Nt;else{const Ai=Nt*nj(Nt);_n.x=Math.abs(Ai)<Math.abs(Nt)?Ai:Nt}(Math.abs(_n.x)>0||Math.abs(_n.y)>0)&&H(!0),(qe=V.current)==null||qe.style.setProperty("--swipe-amount-x",`${_n.x}px`),(wt=V.current)==null||wt.style.setProperty("--swipe-amount-y",`${_n.y}px`)}},k&&!d.jsx&&pe!=="loading"?E.createElement("button",{"aria-label":B,"data-disabled":We,"data-close-button":!0,onClick:We||!fe?()=>{}:()=>{Te(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Lr(Y==null?void 0:Y.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(He=Z==null?void 0:Z.close)!=null?He:vre):null,pe||d.icon||d.promise?E.createElement("div",{"data-icon":"",className:Lr(Y==null?void 0:Y.icon,d==null||(o=d.classNames)==null?void 0:o.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Ze():null,d.type!=="loading"?d.icon||(Z==null?void 0:Z[pe])||dre(pe):null):null,E.createElement("div",{"data-content":"",className:Lr(Y==null?void 0:Y.content,d==null||(i=d.classNames)==null?void 0:i.content)},E.createElement("div",{"data-title":"",className:Lr(Y==null?void 0:Y.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?E.createElement("div",{"data-description":"",className:Lr(A,_e,Y==null?void 0:Y.description,d==null||(s=d.classNames)==null?void 0:s.description)},typeof d.description=="function"?d.description():d.description):null),E.isValidElement(d.cancel)?d.cancel:d.cancel&&Mf(d.cancel)?E.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||T,onClick:Ee=>{Mf(d.cancel)&&fe&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,Ee),Te())},className:Lr(Y==null?void 0:Y.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,E.isValidElement(d.action)?d.action:d.action&&Mf(d.action)?E.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:Ee=>{Mf(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,Ee),!Ee.defaultPrevented&&Te())},className:Lr(Y==null?void 0:Y.actionButton,d==null||(c=d.classNames)==null?void 0:c.actionButton)},d.action.label):null)};function UO(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Ore(e,t){const n={};return[e,t].forEach((r,o)=>{const i=o===1,a=i?"--mobile-offset":"--offset",s=i?Nre:Rre;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=s:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(s)}),n}const jre=E.forwardRef(function(t,n){const{invert:r,position:o="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:s,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:h,style:p,visibleToasts:m=Pre,toastOptions:v,dir:w=UO(),gap:b=Mre,icons:x,containerAriaLabel:_="Notifications"}=t,[C,N]=E.useState([]),R=E.useMemo(()=>Array.from(new Set([o].concat(C.filter(ne=>ne.position).map(ne=>ne.position)))),[C,o]),[T,M]=E.useState([]),[D,A]=E.useState(!1),[j,$]=E.useState(!1),[W,re]=E.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=E.useRef(null),Z=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=E.useRef(null),oe=E.useRef(!1),ee=E.useCallback(ne=>{N(G=>{var F;return(F=G.find(q=>q.id===ne.id))!=null&&F.delete||xn.dismiss(ne.id),G.filter(({id:q})=>q!==ne.id)})},[]);return E.useEffect(()=>xn.subscribe(ne=>{if(ne.dismiss){const G=C.map(F=>F.id===ne.id?{...F,delete:!0}:F);requestAnimationFrame(()=>{N(G)});return}setTimeout(()=>{ur.flushSync(()=>{N(G=>{const F=G.findIndex(q=>q.id===ne.id);return F!==-1?[...G.slice(0,F),{...G[F],...ne},...G.slice(F+1)]:[ne,...G]})})})}),[C]),E.useEffect(()=>{if(d!=="system"){re(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?re("dark"):re("light")),typeof window>"u")return;const ne=window.matchMedia("(prefers-color-scheme: dark)");try{ne.addEventListener("change",({matches:G})=>{re(G?"dark":"light")})}catch{ne.addListener(({matches:F})=>{try{re(F?"dark":"light")}catch(q){console.error(q)}})}},[d]),E.useEffect(()=>{C.length<=1&&A(!1)},[C]),E.useEffect(()=>{const ne=G=>{var F;if(i.every(L=>G[L]||G.code===L)){var ce;A(!0),(ce=Y.current)==null||ce.focus()}G.code==="Escape"&&(document.activeElement===Y.current||(F=Y.current)!=null&&F.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[i]),E.useEffect(()=>{if(Y.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,oe.current=!1)}},[Y.current]),E.createElement("section",{ref:n,"aria-label":`${_} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((ne,G)=>{var F;const[q,ce]=ne.split("-");return C.length?E.createElement("ol",{key:ne,dir:w==="auto"?UO():w,tabIndex:-1,ref:Y,className:l,"data-sonner-toaster":!0,"data-sonner-theme":W,"data-y-position":q,"data-lifted":D&&C.length>1&&!a,"data-x-position":ce,style:{"--front-toast-height":`${((F=T[0])==null?void 0:F.height)||0}px`,"--width":`${Tre}px`,"--gap":`${b}px`,...p,...Ore(c,u)},onBlur:L=>{oe.current&&!L.currentTarget.contains(L.relatedTarget)&&(oe.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:L=>{L.target instanceof HTMLElement&&L.target.dataset.dismissible==="false"||oe.current||(oe.current=!0,B.current=L.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:L=>{L.target instanceof HTMLElement&&L.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},C.filter(L=>!L.position&&G===0||L.position===ne).map((L,K)=>{var z,ie;return E.createElement(Ire,{key:L.id,icons:x,index:K,toast:L,defaultRichColors:f,duration:(z=v==null?void 0:v.duration)!=null?z:h,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:r,visibleToasts:m,closeButton:(ie=v==null?void 0:v.closeButton)!=null?ie:s,interacting:j,position:ne,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,closeButtonAriaLabel:v==null?void 0:v.closeButtonAriaLabel,removeToast:ee,toasts:C.filter(le=>le.position==L.position),heights:T.filter(le=>le.position==L.position),setHeights:M,expandByDefault:a,gap:b,expanded:D,swipeDirections:t.swipeDirections})})):null}))}),$re=({...e})=>{const{theme:t="system"}=cre();return g.jsx(jre,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-primary group-[.toast]:text-foreground"}},...e})},WO=E.forwardRef(({className:e,...t},n)=>g.jsx(YT,{className:Q("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:g.jsx(VY,{className:Q("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));WO.displayName=YT.displayName;const Fre=GY,GO=y.forwardRef(({className:e,...t},n)=>g.jsx(iM,{ref:n,className:Q("inline-flex h-10 items-center justify-center rounded-md bg-primary p-1 text-foreground",e),...t}));GO.displayName=iM.displayName;const qO=y.forwardRef(({className:e,...t},n)=>g.jsx(aM,{ref:n,className:Q("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));qO.displayName=aM.displayName;const YO=y.forwardRef(({className:e,...t},n)=>g.jsx(sM,{ref:n,className:Q("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));YO.displayName=sM.displayName;const KO=E.forwardRef(({className:e,...t},n)=>g.jsx("textarea",{className:Q("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));KO.displayName="Textarea";const XO=kn("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-primary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),ZO=E.forwardRef(({className:e,variant:t,size:n,...r},o)=>{const{variants:i}=Bo(),a=E.useMemo(()=>kn(i.toggle.defaultStyles,{variants:i.toggle.variantStyles,defaultVariants:i.toggle.defaultVariants}),[i]);return g.jsx(lM,{ref:o,className:Q(a({variant:t,size:n,className:e})),...r})});ZO.displayName=lM.displayName;const JO=E.createContext({size:"default",variant:"default"}),QO=E.forwardRef(({className:e,variant:t,size:n,children:r,...o},i)=>g.jsx(gM,{ref:i,className:Q("flex items-center justify-center gap-1",e),...o,children:g.jsx(JO.Provider,{value:{variant:t,size:n},children:r})}));QO.displayName=gM.displayName;const ej=E.forwardRef(({className:e,children:t,variant:n,size:r,...o},i)=>{const a=E.useContext(JO);return g.jsx(wM,{ref:i,className:Q(XO({variant:a.variant||n,size:a.size||r}),e),...o,children:t})});ej.displayName=wM.displayName;const Lre=h6,zre=p6,Bre=m6,tj=E.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(EM,{ref:r,sideOffset:t,className:Q("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));tj.displayName=EM.displayName;const Hre=Object.freeze(Object.defineProperty({__proto__:null,Accordion:dK,AccordionContent:HM,AccordionItem:zM,AccordionTrigger:BM,Alert:GM,AlertDescription:YM,AlertDialog:yK,AlertDialogAction:tk,AlertDialogCancel:nk,AlertDialogContent:XM,AlertDialogDescription:ek,AlertDialogFooter:JM,AlertDialogHeader:ZM,AlertDialogTitle:QM,AlertDialogTrigger:bK,AlertTitle:qM,AspectRatio:_K,Avatar:rk,AvatarFallback:ik,AvatarImage:ok,Badge:CK,Breadcrumb:ak,BreadcrumbItem:lk,BreadcrumbLink:ck,BreadcrumbList:sk,BreadcrumbPage:uk,BreadcrumbSeparator:dk,Button:rr,Calendar:of,Card:zk,CardContent:Uk,CardDescription:Vk,CardFooter:Wk,CardHeader:Bk,CardTitle:Hk,Carousel:Qk,CarouselContent:eD,CarouselItem:tD,CarouselNext:rD,CarouselPrevious:nD,Checkbox:oD,Collapsible:UJ,CollapsibleContent:iD,CollapsibleTrigger:WJ,Combobox:bee,Command:hf,CommandDialog:yee,CommandEmpty:Cv,CommandGroup:Ev,CommandInput:Sv,CommandItem:Pv,CommandList:KD,CommandSeparator:XD,CommandShortcut:ZD,ContextMenu:xee,ContextMenuCheckboxItem:nA,ContextMenuContent:eA,ContextMenuGroup:See,ContextMenuItem:tA,ContextMenuLabel:oA,ContextMenuPortal:Cee,ContextMenuRadioGroup:Pee,ContextMenuRadioItem:rA,ContextMenuSeparator:iA,ContextMenuShortcut:aA,ContextMenuSub:Eee,ContextMenuSubContent:QD,ContextMenuSubTrigger:JD,ContextMenuTrigger:_ee,DataTable:Pte,DatePicker:Rte,DateRangePicker:Nte,Dialog:VD,DialogClose:vee,DialogContent:_v,DialogDescription:YD,DialogFooter:GD,DialogHeader:WD,DialogOverlay:xv,DialogPortal:UD,DialogTitle:qD,DialogTrigger:wee,Drawer:BA,DrawerClose:rne,DrawerContent:VA,DrawerDescription:qA,DrawerFooter:WA,DrawerHeader:UA,DrawerOverlay:ry,DrawerPortal:HA,DrawerTitle:GA,DrawerTrigger:nne,DropdownMenu:one,DropdownMenuCheckboxItem:JA,DropdownMenuContent:XA,DropdownMenuGroup:ane,DropdownMenuItem:ZA,DropdownMenuLabel:eI,DropdownMenuPortal:sne,DropdownMenuRadioGroup:cne,DropdownMenuRadioItem:QA,DropdownMenuSeparator:tI,DropdownMenuShortcut:nI,DropdownMenuSub:lne,DropdownMenuSubContent:KA,DropdownMenuSubTrigger:YA,DropdownMenuTrigger:ine,Form:fne,FormControl:lI,FormDescription:cI,FormField:hne,FormItem:aI,FormLabel:sI,FormMessage:uI,HoverCard:pne,HoverCardContent:dI,HoverCardTrigger:mne,Input:fI,Label:oy,Menubar:hI,MenubarCheckboxItem:yI,MenubarContent:wI,MenubarGroup:wne,MenubarItem:vI,MenubarLabel:xI,MenubarMenu:gne,MenubarPortal:vne,MenubarRadioGroup:bne,MenubarRadioItem:bI,MenubarSeparator:_I,MenubarShortcut:SI,MenubarSub:yne,MenubarSubContent:gI,MenubarSubTrigger:mI,MenubarTrigger:pI,NavigationMenu:CI,NavigationMenuContent:NI,NavigationMenuIndicator:TI,NavigationMenuItem:xne,NavigationMenuLink:_ne,NavigationMenuList:EI,NavigationMenuTrigger:RI,NavigationMenuViewport:iy,Pagination:MI,PaginationContent:kI,PaginationEllipsis:$I,PaginationFirst:OI,PaginationItem:DI,PaginationLast:jI,PaginationLink:is,PaginationNext:II,PaginationPrevious:AI,Popover:pf,PopoverContent:cc,PopoverTrigger:mf,Progress:FI,RadioGroup:LI,RadioGroupItem:zI,ResizableHandle:xO,ResizablePanel:bO,ResizablePanelGroup:yO,ScrollArea:_O,ScrollBar:hy,Select:Qne,SelectContent:CO,SelectGroup:ere,SelectItem:PO,SelectLabel:EO,SelectScrollDownButton:my,SelectScrollUpButton:py,SelectSeparator:RO,SelectTrigger:SO,SelectValue:tre,Separator:NO,Sheet:nre,SheetClose:TO,SheetContent:kO,SheetDescription:OO,SheetFooter:AO,SheetHeader:DO,SheetOverlay:gy,SheetPortal:MO,SheetTitle:IO,SheetTrigger:rre,Sidebar:jO,SidebarFooter:BO,SidebarGroup:zO,SidebarHeader:$O,SidebarItem:LO,SidebarNav:FO,Skeleton:ire,Slider:HO,Switch:WO,Table:Gv,TableBody:Yv,TableCaption:SA,TableCell:fc,TableFooter:_A,TableHead:Kv,TableHeader:qv,TableRow:rs,Tabs:Fre,TabsContent:YO,TabsList:GO,TabsTrigger:qO,Textarea:KO,Toaster:$re,Toggle:ZO,ToggleGroup:QO,ToggleGroupItem:ej,Tooltip:zre,TooltipContent:tj,TooltipProvider:Lre,TooltipTrigger:Bre,Variants:fK,badgeVariants:SK,buttonVariants:EK,navigationMenuTriggerStyle:PI,toggleVariants:XO,useForm:EV,useFormField:mc},Symbol.toStringTag,{value:"Module"})),Vre=()=>{typeof window<"u"&&(window.Buffer=Of.Buffer,window.fs=new Zj("fs"),window.pfs=window.fs.promises,window.miDir="/mi")};$e.APIHandler=up,$e.APIProxyHandler=dp,$e.DreamspaceElements=Hre,$e.MiniApp=eV,$e.ProjectProvider=h8,$e.RGComponent=tV,$e.RGComponentErrorBoundary=nV,$e.RGDroppable=rV,$e.RGEditLayout=XH,$e.RGPreviewLayout=PS,$e.RGProvider=b_,$e.TailwindThemeContext=pK,$e.TailwindThemeHooks=vK,$e.applySxtIgnore=n5,$e.checkoutCommit=i5,$e.getCommits=o5,$e.getHeadCommit=Z4,$e.getRedoTargetCommitForFile=Q4,$e.getTags=qh,$e.getUndoTargetCommitForFile=J4,$e.initializeMakeInfinite=Vre,$e.listAllFiles=r5,$e.listDir=Ix,$e.loadLibraryComponents=B4,$e.loadProjectComponents=Bx,$e.setTailwindTheme=Hx,$e.syncAndRetry=qx,$e.useAPI=v_,$e.useAppMetadata=V4,$e.useAppSettings=U4,$e.useAppVersions=W4,$e.useB64UrlForProjectImage=Vx,$e.useProject=hp,$e.useRGContext=lp,$e.useWebSocketManager=iV,Object.defineProperty($e,Symbol.toStringTag,{value:"Module"})});
|
|
430
|
+
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function Mte(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function kte(){return Xv(/^Mac/)}function Dte(){return Xv(/^iPhone/)}function EA(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Ate(){return Xv(/^iPad/)||kte()&&navigator.maxTouchPoints>1}function PA(){return Dte()||Ate()}function Xv(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const Ite=24,Ote=typeof window<"u"?E.useLayoutEffect:E.useEffect;function RA(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Zv=typeof document<"u"&&window.visualViewport;function NA(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function TA(e){for(NA(e)&&(e=e.parentElement);e&&!NA(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const jte=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let bf=0,Jv;function $te(e={}){let{isDisabled:t}=e;Ote(()=>{if(!t)return bf++,bf===1&&PA()&&(Jv=Fte()),()=>{bf--,bf===0&&(Jv==null||Jv())}},[t])}function Fte(){let e,t=0,n=d=>{e=TA(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let f=d.changedTouches[0].pageY,h=e.scrollTop,p=e.scrollHeight-e.clientHeight;p!==0&&((h<=0&&f>t||h>=p&&f<t)&&d.preventDefault(),t=f)},o=d=>{let f=d.target;Qv(f)&&f!==document.activeElement&&(d.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=d=>{let f=d.target;Qv(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",Zv&&(Zv.height<window.innerHeight?requestAnimationFrame(()=>{MA(f)}):Zv.addEventListener("resize",()=>MA(f),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=RA(Lte(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=RA(hc(document,"touchstart",n,{passive:!1,capture:!0}),hc(document,"touchmove",r,{passive:!1,capture:!0}),hc(document,"touchend",o,{passive:!1,capture:!0}),hc(document,"focus",i,!0),hc(window,"scroll",a));return()=>{c(),u(),window.scrollTo(s,l)}}function Lte(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function hc(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function MA(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=TA(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const a=n.getBoundingClientRect().bottom+Ite;i>a&&(n.scrollTop+=o-r)}e=n.parentElement}}function Qv(e){return e instanceof HTMLInputElement&&!jte.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function zte(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Bte(...e){return t=>e.forEach(n=>zte(n,t))}function kA(...e){return y.useCallback(Bte(...e),e)}const DA=new WeakMap;function Dt(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&DA.set(e,r)}function Hte(e,t){if(!e||!(e instanceof HTMLElement))return;let n=DA.get(e);n&&(e.style[t]=n[t])}const Tt=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function xf(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[Tt(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Tt(t)?5:4]):null)}function Vte(e){return 8*(Math.log(e+1)-2)}function ey(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function Ute(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const yt={DURATION:.5,EASE:[.32,.72,0,1]},AA=.4,Wte=.25,Gte=100,IA=8,_f=16,ty=26,ny="vaul-dragging";function OA(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function qte({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,o=E.useRef(r),i=OA(t);return E.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function jA({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=qte({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=OA(n),l=E.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function Yte({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:a,direction:s="bottom",container:l,snapToSequentialPoint:c}){const[u,d]=jA({prop:e,defaultProp:n==null?void 0:n[0],onChange:t}),[f,h]=E.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);E.useEffect(()=>{function R(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]);const p=E.useMemo(()=>u===(n==null?void 0:n[n.length-1])||null,[n,u]),m=E.useMemo(()=>{var R;return(R=n==null?void 0:n.findIndex(T=>T===u))!=null?R:null},[n,u]),v=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===u||!n,w=E.useMemo(()=>{const R=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var T;return(T=n==null?void 0:n.map(M=>{const D=typeof M=="string";let A=0;if(D&&(A=parseInt(M,10)),Tt(s)){const $=D?A:f?M*R.height:0;return f?s==="bottom"?R.height-$:-R.height+$:$}const O=D?A:f?M*R.width:0;return f?s==="right"?R.width-O:-R.width+O:O}))!=null?T:[]},[n,f,l]),b=E.useMemo(()=>m!==null?w==null?void 0:w[m]:null,[w,m]),x=E.useCallback(R=>{var T;const M=(T=w==null?void 0:w.findIndex(D=>D===R))!=null?T:null;a(M),Dt(r.current,{transition:`transform ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,transform:Tt(s)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`}),w&&M!==w.length-1&&i!==void 0&&M!==i&&M<i?Dt(o.current,{transition:`opacity ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,opacity:"0"}):Dt(o.current,{transition:`opacity ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,opacity:"1"}),d(n==null?void 0:n[Math.max(M,0)])},[r.current,n,w,i,o,d]);E.useEffect(()=>{if(u||e){var R;const T=(R=n==null?void 0:n.findIndex(M=>M===e||M===u))!=null?R:-1;w&&T!==-1&&typeof w[T]=="number"&&x(w[T])}},[u,e,n,w,x]);function _({draggedDistance:R,closeDrawer:T,velocity:M,dismissible:D}){if(i===void 0)return;const A=s==="bottom"||s==="right"?(b??0)-R:(b??0)+R,O=m===i-1,$=m===0,W=R>0;if(O&&Dt(o.current,{transition:`opacity ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`}),!c&&M>2&&!W){D?T():x(w[0]);return}if(!c&&M>2&&W&&w&&n){x(w[n.length-1]);return}const re=w==null?void 0:w.reduce((Z,B)=>typeof Z!="number"||typeof B!="number"?Z:Math.abs(B-A)<Math.abs(Z-A)?B:Z),Y=Tt(s)?window.innerHeight:window.innerWidth;if(M>AA&&Math.abs(R)<Y*.4){const Z=W?1:-1;if(Z>0&&p&&n){x(w[n.length-1]);return}if($&&Z<0&&D&&T(),m===null)return;x(w[m+Z]);return}x(re)}function C({draggedDistance:R}){if(b===null)return;const T=s==="bottom"||s==="right"?b-R:b+R;(s==="bottom"||s==="right")&&T<w[w.length-1]||(s==="top"||s==="left")&&T>w[w.length-1]||Dt(r.current,{transform:Tt(s)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`})}function N(R,T){if(!n||typeof m!="number"||!w||i===void 0)return null;const M=m===i-1;if(m>=i&&T)return 0;if(M&&!T)return 1;if(!v&&!M)return null;const A=M?m+1:m-1,O=M?w[A]-w[A-1]:w[A+1]-w[A],$=R/Math.abs(O);return M?1-$:$}return{isLastSnapPoint:p,activeSnapPoint:u,shouldFade:v,getPercentageDragged:N,setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:_,onDrag:C,snapPointsOffset:w}}const Kte=()=>()=>{};function Xte(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=os(),i=E.useRef(null),a=E.useMemo(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-ty)/window.innerWidth}E.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;Ute(r&&!o?ey(document.body,{background:"black"}):Kte,ey(l,{transformOrigin:Tt(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${yt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${yt.EASE.join(",")})`}));const c=ey(l,{borderRadius:`${IA}px`,overflow:"hidden",...Tt(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{c(),i.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},yt.DURATION*1e3)}}},[t,n,a])}let pc=null;function Zte({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[a,s]=E.useState(()=>typeof window<"u"?window.location.href:""),l=E.useRef(0),c=E.useCallback(()=>{if(EA()&&pc===null&&e&&!i){pc={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const h=f-window.innerHeight;h&&l.current>=f&&(document.body.style.top=`${-(l.current+h)}px`)}),300)}},[e]),u=E.useCallback(()=>{if(EA()&&pc!==null&&!i){const d=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,pc),window.requestAnimationFrame(()=>{if(o&&a!==window.location.href){s(window.location.href);return}window.scrollTo(f,d)}),pc=null}},[a]);return E.useEffect(()=>{function d(){l.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),E.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),E.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),t||window.setTimeout(()=>{u()},500)):u())},[e,r,a,t,n,c,u]),{restorePositionSetting:u}}function $A({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:s=!0,closeThreshold:l=Wte,scrollLockTimeout:c=Gte,dismissible:u=!0,handleOnly:d=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:h,setActiveSnapPoint:p,fixed:m,modal:v=!0,onClose:w,nested:b,noBodyStyles:x=!1,direction:_="bottom",defaultOpen:C=!1,disablePreventScroll:N=!0,snapToSequentialPoint:R=!1,preventScrollRestoration:T=!1,repositionInputs:M=!0,onAnimationEnd:D,container:A,autoFocus:O=!1}){var $,W;const[re=!1,Y]=jA({defaultProp:C,prop:e,onChange:Te=>{t==null||t(Te),!Te&&!b&&k(),setTimeout(()=>{D==null||D(Te)},yt.DURATION*1e3),Te&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Te||(document.body.style.pointerEvents="auto")}}),[Z,B]=E.useState(!1),[oe,ee]=E.useState(!1),[ne,G]=E.useState(!1),F=E.useRef(null),q=E.useRef(null),ce=E.useRef(null),L=E.useRef(null),K=E.useRef(null),z=E.useRef(!1),ie=E.useRef(null),le=E.useRef(0),ae=E.useRef(!1),H=E.useRef(!C),ue=E.useRef(0),se=E.useRef(null),ye=E.useRef((($=se.current)==null?void 0:$.getBoundingClientRect().height)||0),Ce=E.useRef(((W=se.current)==null?void 0:W.getBoundingClientRect().width)||0),xe=E.useRef(0),j=E.useCallback(Te=>{i&&Te===fe.length-1&&(q.current=new Date)},[]),{activeSnapPoint:V,activeSnapPointIndex:J,setActiveSnapPoint:we,onRelease:pe,snapPointsOffset:fe,onDrag:ge,shouldFade:_e,getPercentageDragged:Xe}=Yte({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:p,drawerRef:se,fadeFromIndex:f,overlayRef:F,onSnapPointChange:j,direction:_,container:A,snapToSequentialPoint:R});$te({isDisabled:!re||oe||!v||ne||!Z||!M||!N});const{restorePositionSetting:k}=Zte({isOpen:re,modal:v,nested:b??!1,hasBeenOpened:Z,preventScrollRestoration:T,noBodyStyles:x});function S(){return(window.innerWidth-ty)/window.innerWidth}function P(Te){var Ze,et;!u&&!i||se.current&&!se.current.contains(Te.target)||(ye.current=((Ze=se.current)==null?void 0:Ze.getBoundingClientRect().height)||0,Ce.current=((et=se.current)==null?void 0:et.getBoundingClientRect().width)||0,ee(!0),ce.current=new Date,PA()&&window.addEventListener("touchend",()=>z.current=!1,{once:!0}),Te.target.setPointerCapture(Te.pointerId),le.current=Tt(_)?Te.pageY:Te.pageX)}function I(Te,Ze){var et;let He=Te;const Ee=(et=window.getSelection())==null?void 0:et.toString(),Ge=se.current?xf(se.current,_):null,qe=new Date;if(He.tagName==="SELECT"||He.hasAttribute("data-vaul-no-drag")||He.closest("[data-vaul-no-drag]"))return!1;if(_==="right"||_==="left")return!0;if(q.current&&qe.getTime()-q.current.getTime()<500)return!1;if(Ge!==null&&(_==="bottom"?Ge>0:Ge<0))return!0;if(Ee&&Ee.length>0)return!1;if(K.current&&qe.getTime()-K.current.getTime()<c&&Ge===0||Ze)return K.current=qe,!1;for(;He;){if(He.scrollHeight>He.clientHeight){if(He.scrollTop!==0)return K.current=new Date,!1;if(He.getAttribute("role")==="dialog")return!0}He=He.parentNode}return!0}function U(Te){if(se.current&&oe){const Ze=_==="bottom"||_==="right"?1:-1,et=(le.current-(Tt(_)?Te.pageY:Te.pageX))*Ze,He=et>0,Ee=i&&!u&&!He;if(Ee&&J===0)return;const Ge=Math.abs(et),qe=document.querySelector("[data-vaul-drawer-wrapper]"),wt=_==="bottom"||_==="top"?ye.current:Ce.current;let Xt=Ge/wt;const ft=Xe(Ge,He);if(ft!==null&&(Xt=ft),Ee&&Xt>=1||!z.current&&!I(Te.target,He))return;if(se.current.classList.add(ny),z.current=!0,Dt(se.current,{transition:"none"}),Dt(F.current,{transition:"none"}),i&&ge({draggedDistance:et}),He&&!i){const an=Vte(et),Zt=Math.min(an*-1,0)*Ze;Dt(se.current,{transform:Tt(_)?`translate3d(0, ${Zt}px, 0)`:`translate3d(${Zt}px, 0, 0)`});return}const Nt=1-Xt;if((_e||f&&J===f-1)&&(r==null||r(Te,Xt),Dt(F.current,{opacity:`${Nt}`,transition:"none"},!0)),qe&&F.current&&a){const an=Math.min(S()+Xt*(1-S()),1),Zt=8-Xt*8,_n=Math.max(0,14-Xt*14);Dt(qe,{borderRadius:`${Zt}px`,transform:Tt(_)?`scale(${an}) translate3d(0, ${_n}px, 0)`:`scale(${an}) translate3d(${_n}px, 0, 0)`,transition:"none"},!0)}if(!i){const an=Ge*Ze;Dt(se.current,{transform:Tt(_)?`translate3d(0, ${an}px, 0)`:`translate3d(${an}px, 0, 0)`})}}}E.useEffect(()=>{window.requestAnimationFrame(()=>{H.current=!0})},[]),E.useEffect(()=>{var Te;function Ze(){if(!se.current||!M)return;const et=document.activeElement;if(Qv(et)||ae.current){var He;const Ee=((He=window.visualViewport)==null?void 0:He.height)||0,Ge=window.innerHeight;let qe=Ge-Ee;const wt=se.current.getBoundingClientRect().height||0,Xt=wt>Ge*.8;xe.current||(xe.current=wt);const ft=se.current.getBoundingClientRect().top;if(Math.abs(ue.current-qe)>60&&(ae.current=!ae.current),i&&i.length>0&&fe&&J){const Nt=fe[J]||0;qe+=Nt}if(ue.current=qe,wt>Ee||ae.current){const Nt=se.current.getBoundingClientRect().height;let an=Nt;Nt>Ee&&(an=Ee-(Xt?ft:ty)),m?se.current.style.height=`${Nt-Math.max(qe,0)}px`:se.current.style.height=`${Math.max(an,Ee-ft)}px`}else Mte()||(se.current.style.height=`${xe.current}px`);i&&i.length>0&&!ae.current?se.current.style.bottom="0px":se.current.style.bottom=`${Math.max(qe,0)}px`}}return(Te=window.visualViewport)==null||Te.addEventListener("resize",Ze),()=>{var et;return(et=window.visualViewport)==null?void 0:et.removeEventListener("resize",Ze)}},[J,i,fe]);function te(Te){Oe(),w==null||w(),Te||Y(!1),setTimeout(()=>{i&&we(i[0])},yt.DURATION*1e3)}function he(){if(!se.current)return;const Te=document.querySelector("[data-vaul-drawer-wrapper]"),Ze=xf(se.current,_);Dt(se.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`}),Dt(F.current,{transition:`opacity ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,opacity:"1"}),a&&Ze&&Ze>0&&re&&Dt(Te,{borderRadius:`${IA}px`,overflow:"hidden",...Tt(_)?{transform:`scale(${S()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${S()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${yt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${yt.EASE.join(",")})`},!0)}function Oe(){!oe||!se.current||(se.current.classList.remove(ny),z.current=!1,ee(!1),L.current=new Date)}function Qe(Te){if(!oe||!se.current)return;se.current.classList.remove(ny),z.current=!1,ee(!1),L.current=new Date;const Ze=xf(se.current,_);if(!Te||!I(Te.target,!1)||!Ze||Number.isNaN(Ze)||ce.current===null)return;const et=L.current.getTime()-ce.current.getTime(),He=le.current-(Tt(_)?Te.pageY:Te.pageX),Ee=Math.abs(He)/et;if(Ee>.05&&(G(!0),setTimeout(()=>{G(!1)},200)),i){pe({draggedDistance:He*(_==="bottom"||_==="right"?1:-1),closeDrawer:te,velocity:Ee,dismissible:u}),o==null||o(Te,!0);return}if(_==="bottom"||_==="right"?He>0:He<0){he(),o==null||o(Te,!0);return}if(Ee>AA){te(),o==null||o(Te,!1);return}var Ge;const qe=Math.min((Ge=se.current.getBoundingClientRect().height)!=null?Ge:0,window.innerHeight);var wt;const Xt=Math.min((wt=se.current.getBoundingClientRect().width)!=null?wt:0,window.innerWidth),ft=_==="left"||_==="right";if(Math.abs(Ze)>=(ft?Xt:qe)*l){te(),o==null||o(Te,!1);return}o==null||o(Te,!0),he()}E.useEffect(()=>(re&&(Dt(document.documentElement,{scrollBehavior:"auto"}),q.current=new Date),()=>{Hte(document.documentElement,"scrollBehavior")}),[re]);function nt(Te){const Ze=Te?(window.innerWidth-_f)/window.innerWidth:1,et=Te?-16:0;ie.current&&window.clearTimeout(ie.current),Dt(se.current,{transition:`transform ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,transform:Tt(_)?`scale(${Ze}) translate3d(0, ${et}px, 0)`:`scale(${Ze}) translate3d(${et}px, 0, 0)`}),!Te&&se.current&&(ie.current=setTimeout(()=>{const He=xf(se.current,_);Dt(se.current,{transition:"none",transform:Tt(_)?`translate3d(0, ${He}px, 0)`:`translate3d(${He}px, 0, 0)`})},500))}function st(Te,Ze){if(Ze<0)return;const et=(window.innerWidth-_f)/window.innerWidth,He=et+Ze*(1-et),Ee=-16+Ze*_f;Dt(se.current,{transform:Tt(_)?`scale(${He}) translate3d(0, ${Ee}px, 0)`:`scale(${He}) translate3d(${Ee}px, 0, 0)`,transition:"none"})}function We(Te,Ze){const et=Tt(_)?window.innerHeight:window.innerWidth,He=Ze?(et-_f)/et:1,Ee=Ze?-16:0;Ze&&Dt(se.current,{transition:`transform ${yt.DURATION}s cubic-bezier(${yt.EASE.join(",")})`,transform:Tt(_)?`scale(${He}) translate3d(0, ${Ee}px, 0)`:`scale(${He}) translate3d(${Ee}px, 0, 0)`})}return E.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),E.createElement(fd,{defaultOpen:C,onOpenChange:Te=>{!u&&!Te||(Te?B(!0):te(!0),Y(Te))},open:re},E.createElement(CA.Provider,{value:{activeSnapPoint:V,snapPoints:i,setActiveSnapPoint:we,drawerRef:se,overlayRef:F,onOpenChange:t,onPress:P,onRelease:Qe,onDrag:U,dismissible:u,shouldAnimate:H,handleOnly:d,isOpen:re,isDragging:oe,shouldFade:_e,closeDrawer:te,onNestedDrag:st,onNestedOpenChange:nt,onNestedRelease:We,keyboardIsOpen:ae,modal:v,snapPointsOffset:fe,activeSnapPointIndex:J,direction:_,shouldScaleBackground:a,setBackgroundColorOnScale:s,noBodyStyles:x,container:A,autoFocus:O}},n))}const FA=E.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:a,modal:s,shouldAnimate:l}=os(),c=kA(t,n),u=r&&r.length>0;if(!s)return null;const d=E.useCallback(f=>o(f),[o]);return E.createElement(Ca,{onMouseUp:d,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":a&&u?"true":"false","data-vaul-snap-points-overlay":a&&i?"true":"false","data-vaul-animate":l!=null&&l.current?"true":"false",...e})});FA.displayName="Drawer.Overlay";const LA=E.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:a,onRelease:s,onDrag:l,keyboardIsOpen:c,snapPointsOffset:u,activeSnapPointIndex:d,modal:f,isOpen:h,direction:p,snapPoints:m,container:v,handleOnly:w,shouldAnimate:b,autoFocus:x}=os(),[_,C]=E.useState(!1),N=kA(o,i),R=E.useRef(null),T=E.useRef(null),M=E.useRef(!1),D=m&&m.length>0;Xte();const A=($,W,re=0)=>{if(M.current)return!0;const Y=Math.abs($.y),Z=Math.abs($.x),B=Z>Y,oe=["bottom","right"].includes(W)?1:-1;if(W==="left"||W==="right"){if(!($.x*oe<0)&&Z>=0&&Z<=re)return B}else if(!($.y*oe<0)&&Y>=0&&Y<=re)return!B;return M.current=!0,!0};E.useEffect(()=>{D&&window.requestAnimationFrame(()=>{C(!0)})},[]);function O($){R.current=null,M.current=!1,s($)}return E.createElement(Ea,{"data-vaul-drawer-direction":p,"data-vaul-drawer":"","data-vaul-delayed-snap-points":_?"true":"false","data-vaul-snap-points":h&&D?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":b!=null&&b.current?"true":"false",...r,ref:N,style:u&&u.length>0?{"--snap-point-height":`${u[d??0]}px`,...t}:t,onPointerDown:$=>{w||(r.onPointerDown==null||r.onPointerDown.call(r,$),R.current={x:$.pageX,y:$.pageY},a($))},onOpenAutoFocus:$=>{n==null||n($),x||$.preventDefault()},onPointerDownOutside:$=>{if(e==null||e($),!f||$.defaultPrevented){$.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:$=>{if(!f){$.preventDefault();return}},onPointerMove:$=>{if(T.current=$,w||(r.onPointerMove==null||r.onPointerMove.call(r,$),!R.current))return;const W=$.pageY-R.current.y,re=$.pageX-R.current.x,Y=$.pointerType==="touch"?10:2;A({x:re,y:W},p,Y)?l($):(Math.abs(re)>Y||Math.abs(W)>Y)&&(R.current=null)},onPointerUp:$=>{r.onPointerUp==null||r.onPointerUp.call(r,$),R.current=null,M.current=!1,s($)},onPointerOut:$=>{r.onPointerOut==null||r.onPointerOut.call(r,$),O(T.current)},onContextMenu:$=>{r.onContextMenu==null||r.onContextMenu.call(r,$),T.current&&O(T.current)}})});LA.displayName="Drawer.Content";const Jte=250,Qte=120,zA=E.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:a,activeSnapPoint:s,setActiveSnapPoint:l,dismissible:c,handleOnly:u,isOpen:d,onPress:f,onDrag:h}=os(),p=E.useRef(null),m=E.useRef(!1);function v(){if(m.current){x();return}window.setTimeout(()=>{w()},Qte)}function w(){if(i||e||m.current){x();return}if(x(),!a||a.length===0){c||o();return}if(s===a[a.length-1]&&c){o();return}const C=a.findIndex(R=>R===s);if(C===-1)return;const N=a[C+1];l(N)}function b(){p.current=window.setTimeout(()=>{m.current=!0},Jte)}function x(){p.current&&window.clearTimeout(p.current),m.current=!1}return E.createElement("div",{onClick:v,onPointerCancel:x,onPointerDown:_=>{u&&f(_),b()},onPointerMove:_=>{u&&h(_)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},E.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});zA.displayName="Drawer.Handle";function ene({onDrag:e,onOpenChange:t,open:n,...r}){const{onNestedDrag:o,onNestedOpenChange:i,onNestedRelease:a}=os();if(!o)throw new Error("Drawer.NestedRoot must be placed in another drawer");return E.createElement($A,{nested:!0,open:n,onClose:()=>{i(!1)},onDrag:(s,l)=>{o(s,l),e==null||e(s,l)},onOpenChange:s=>{s&&i(s),t==null||t(s)},onRelease:a,...r})}function tne(e){const t=os(),{container:n=t.container,...r}=e;return E.createElement(pd,{container:n,...r})}const lr={Root:$A,NestedRoot:ene,Content:LA,Overlay:FA,Trigger:hd,Portal:tne,Handle:zA,Close:Na,Title:Pa,Description:Ra},BA=({shouldScaleBackground:e=!0,...t})=>g.jsx(lr.Root,{shouldScaleBackground:e,...t});BA.displayName="Drawer";const nne=lr.Trigger,HA=lr.Portal,rne=lr.Close,ry=E.forwardRef(({className:e,...t},n)=>g.jsx(lr.Overlay,{ref:n,className:Q("fixed inset-0 z-50 bg-black/80",e),...t}));ry.displayName=lr.Overlay.displayName;const VA=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(HA,{children:[g.jsx(ry,{}),g.jsxs(lr.Content,{ref:r,className:Q("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n,children:[g.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-primary"}),t]})]}));VA.displayName="DrawerContent";const UA=({className:e,...t})=>g.jsx("div",{className:Q("grid gap-1.5 p-4 text-center sm:text-left",e),...t});UA.displayName="DrawerHeader";const WA=({className:e,...t})=>g.jsx("div",{className:Q("mt-auto flex flex-col gap-2 p-4",e),...t});WA.displayName="DrawerFooter";const GA=E.forwardRef(({className:e,...t},n)=>g.jsx(lr.Title,{ref:n,className:Q("text-lg font-semibold leading-none tracking-tight",e),...t}));GA.displayName=lr.Title.displayName;const qA=E.forwardRef(({className:e,...t},n)=>g.jsx(lr.Description,{ref:n,className:Q("text-sm text-foreground",e),...t}));qA.displayName=lr.Description.displayName;const one=r9,ine=o9,ane=i9,sne=DP,lne=s9,cne=a9,YA=E.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(zP,{ref:o,className:Q("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,g.jsx(Lo,{className:"ml-auto h-4 w-4"})]}));YA.displayName=zP.displayName;const KA=E.forwardRef(({className:e,...t},n)=>g.jsx(BP,{ref:n,className:Q("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));KA.displayName=BP.displayName;const XA=E.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(DP,{children:g.jsx(AP,{ref:r,sideOffset:t,className:Q("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));XA.displayName=AP.displayName;const ZA=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(OP,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));ZA.displayName=OP.displayName;const JA=E.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(jP,{ref:o,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(FP,{children:g.jsx(Wa,{className:"h-4 w-4"})})}),t]}));JA.displayName=jP.displayName;const QA=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs($P,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(FP,{children:g.jsx(Jd,{className:"h-2 w-2 fill-current"})})}),t]}));QA.displayName=$P.displayName;const eI=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(IP,{ref:r,className:Q("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));eI.displayName=IP.displayName;const tI=E.forwardRef(({className:e,...t},n)=>g.jsx(LP,{ref:n,className:Q("-mx-1 my-1 h-px bg-primary",e),...t}));tI.displayName=LP.displayName;const nI=({className:e,...t})=>g.jsx("span",{className:Q("ml-auto text-xs tracking-widest opacity-60",e),...t});nI.displayName="DropdownMenuShortcut";let rI=0;function une(e="id"){const t=E.useRef(null);return t.current===null&&(rI+=1,t.current=`${e}-${rI}`),t.current}const dne=kn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),oy=E.forwardRef(({className:e,...t},n)=>g.jsx(VP,{ref:n,className:Q(dne(),e),...t}));oy.displayName=VP.displayName;const fne=lV,oI=E.createContext({}),hne=({...e})=>g.jsx(oI.Provider,{value:{name:e.name},children:g.jsx(fV,{...e})}),mc=()=>{const e=E.useContext(oI),t=E.useContext(iI),{getFieldState:n,formState:r}=Yu(),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},iI=E.createContext({}),aI=E.forwardRef(({className:e,...t},n)=>{const r=une();return g.jsx(iI.Provider,{value:{id:r},children:g.jsx("div",{ref:n,className:Q("space-y-2",e),...t})})});aI.displayName="FormItem";const sI=E.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:o}=mc();return g.jsx(oy,{ref:n,className:Q(r&&"text-destructive",e),htmlFor:o,...t})});sI.displayName="FormLabel";const lI=E.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:i}=mc();return g.jsx(Zn,{ref:t,id:r,"aria-describedby":n?`${o} ${i}`:`${o}`,"aria-invalid":!!n,...e})});lI.displayName="FormControl";const cI=E.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=mc();return g.jsx("p",{ref:n,id:r,className:Q("text-sm text-foreground",e),...t})});cI.displayName="FormDescription";const uI=E.forwardRef(({className:e,children:t,...n},r)=>{const{error:o,formMessageId:i}=mc(),a=o?String(o==null?void 0:o.message):t;return a?g.jsx("p",{ref:r,id:i,className:Q("text-sm font-medium text-destructive",e),...n,children:a}):null});uI.displayName="FormMessage";const pne=g9,mne=w9,dI=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>g.jsx(KP,{ref:o,align:t,sideOffset:n,className:Q("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));dI.displayName=KP.displayName;const fI=E.forwardRef(({className:e,type:t,...n},r)=>g.jsx("input",{type:t,className:Q("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));fI.displayName="Input";const gne=$9,wne=F9,vne=wR,yne=z9,bne=L9,hI=E.forwardRef(({className:e,...t},n)=>g.jsx(mR,{ref:n,className:Q("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",e),...t}));hI.displayName=mR.displayName;const pI=E.forwardRef(({className:e,...t},n)=>g.jsx(gR,{ref:n,className:Q("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e),...t}));pI.displayName=gR.displayName;const mI=E.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(ER,{ref:o,className:Q("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,g.jsx(Lo,{className:"ml-auto h-4 w-4"})]}));mI.displayName=ER.displayName;const gI=E.forwardRef(({className:e,...t},n)=>g.jsx(PR,{ref:n,className:Q("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));gI.displayName=PR.displayName;const wI=E.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,...o},i)=>g.jsx(wR,{children:g.jsx(vR,{ref:i,align:t,alignOffset:n,sideOffset:r,className:Q("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));wI.displayName=vR.displayName;const vI=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(bR,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));vI.displayName=bR.displayName;const yI=E.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(xR,{ref:o,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(SR,{children:g.jsx(Wa,{className:"h-4 w-4"})})}),t]}));yI.displayName=xR.displayName;const bI=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(_R,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(SR,{children:g.jsx(Jd,{className:"h-2 w-2 fill-current"})})}),t]}));bI.displayName=_R.displayName;const xI=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(yR,{ref:r,className:Q("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));xI.displayName=yR.displayName;const _I=E.forwardRef(({className:e,...t},n)=>g.jsx(CR,{ref:n,className:Q("-mx-1 my-1 h-px bg-primary",e),...t}));_I.displayName=CR.displayName;const SI=({className:e,...t})=>g.jsx("span",{className:Q("ml-auto text-xs tracking-widest text-foreground",e),...t});SI.displayName="MenubarShortcut";const CI=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(YR,{ref:r,className:Q("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,g.jsx(iy,{})]}));CI.displayName=YR.displayName;const EI=E.forwardRef(({className:e,...t},n)=>g.jsx(KR,{ref:n,className:Q("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));EI.displayName=KR.displayName;const xne=nq,PI=kn("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),RI=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(XR,{ref:r,className:Q(PI(),"group",e),...n,children:[t," ",g.jsx(Xd,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));RI.displayName=XR.displayName;const NI=E.forwardRef(({className:e,...t},n)=>g.jsx(JR,{ref:n,className:Q("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",e),...t}));NI.displayName=JR.displayName;const _ne=rq,iy=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:Q("absolute left-0 top-full flex justify-center"),children:g.jsx(QR,{className:Q("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:n,...t})}));iy.displayName=QR.displayName;const TI=E.forwardRef(({className:e,...t},n)=>g.jsx(ZR,{ref:n,className:Q("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:g.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));TI.displayName=ZR.displayName;const MI=({className:e,...t})=>g.jsx("nav",{role:"navigation","aria-label":"pagination",className:Q("mx-auto flex w-full justify-center",e),...t});MI.displayName="Pagination";const kI=E.forwardRef(({className:e,...t},n)=>g.jsx("ul",{ref:n,className:Q("flex flex-row items-center gap-1",e),...t}));kI.displayName="PaginationContent";const DI=E.forwardRef(({className:e,...t},n)=>g.jsx("li",{ref:n,className:Q("",e),...t}));DI.displayName="PaginationItem";const is=E.forwardRef(({className:e,isActive:t,disabled:n,...r},o)=>g.jsx(rr,{ref:o,"aria-current":t?"page":void 0,disabled:n,className:Q("h-9 w-9",{"pointer-events-none bg-accent":t,"pointer-events-none opacity-50":n},e),...r}));is.displayName="PaginationLink";const AI=E.forwardRef(({className:e,...t},n)=>g.jsxs(is,{ref:n,"aria-label":"Go to previous page",className:Q("gap-1 px-2 min-w-[100px]",e),...t,children:[g.jsx(Zd,{className:"h-4 w-4"}),g.jsx("span",{children:"Previous"})]}));AI.displayName="PaginationPrevious";const II=E.forwardRef(({className:e,...t},n)=>g.jsxs(is,{ref:n,"aria-label":"Go to next page",className:Q("gap-1 px-2 min-w-[100px]",e),...t,children:[g.jsx("span",{children:"Next"}),g.jsx(Lo,{className:"h-4 w-4"})]}));II.displayName="PaginationNext";const OI=E.forwardRef(({className:e,...t},n)=>g.jsx(is,{ref:n,"aria-label":"Go to first page",className:Q("",e),...t,children:g.jsx(b6,{className:"h-4 w-4"})}));OI.displayName="PaginationFirst";const jI=E.forwardRef(({className:e,...t},n)=>g.jsx(is,{ref:n,"aria-label":"Go to last page",className:Q("",e),...t,children:g.jsx(x6,{className:"h-4 w-4"})}));jI.displayName="PaginationLast";const $I=({className:e,...t})=>g.jsxs("span",{"aria-hidden":!0,className:Q("flex h-9 w-9 items-center justify-center",e),...t,children:[g.jsx(S6,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"More pages"})]});$I.displayName="PaginationEllipsis";const FI=E.forwardRef(({className:e,value:t,...n},r)=>g.jsx(wN,{ref:r,className:Q("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:g.jsx(_q,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));FI.displayName=wN.displayName;const LI=E.forwardRef(({className:e,...t},n)=>g.jsx(TN,{className:Q("grid gap-2",e),...t,ref:n}));LI.displayName=TN.displayName;const zI=E.forwardRef(({className:e,...t},n)=>g.jsx(MN,{ref:n,className:Q("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:g.jsx(Dq,{className:"flex items-center justify-center",children:g.jsx(Jd,{className:"h-2.5 w-2.5 fill-current text-current"})})}));zI.displayName=MN.displayName;const{createElement:as,createContext:Sne,createRef:Xoe,forwardRef:BI,useCallback:yn,useContext:HI,useEffect:Ni,useImperativeHandle:VI,useLayoutEffect:Cne,useMemo:Ene,useRef:bn,useState:ss}=y,UI=y[`useId${Math.random()}`.slice(0,5)],Pne=Cne,Sf=Sne(null);Sf.displayName="PanelGroupContext";const Ti=Pne,Rne=typeof UI=="function"?UI:()=>null;let Nne=0;function ay(e=null){const t=Rne(),n=bn(e||t||null);return n.current===null&&(n.current=""+Nne++),e??n.current}function WI({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:a,maxSize:s,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:f,style:h,tagName:p="div",...m}){const v=HI(Sf);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:b,getPanelSize:x,getPanelStyle:_,groupId:C,isPanelCollapsed:N,reevaluatePanelConstraints:R,registerPanel:T,resizePanel:M,unregisterPanel:D}=v,A=ay(a),O=bn({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:s,minSize:l},id:A,idIsFromProps:a!==void 0,order:f});bn({didLogMissingDefaultSizeWarning:!1}),Ti(()=>{const{callbacks:W,constraints:re}=O.current,Y={...re};O.current.id=A,O.current.idIsFromProps=a!==void 0,O.current.order=f,W.onCollapse=c,W.onExpand=u,W.onResize=d,re.collapsedSize=n,re.collapsible=r,re.defaultSize=o,re.maxSize=s,re.minSize=l,(Y.collapsedSize!==re.collapsedSize||Y.collapsible!==re.collapsible||Y.maxSize!==re.maxSize||Y.minSize!==re.minSize)&&R(O.current,Y)}),Ti(()=>{const W=O.current;return T(W),()=>{D(W)}},[f,A,T,D]),VI(i,()=>({collapse:()=>{w(O.current)},expand:W=>{b(O.current,W)},getId(){return A},getSize(){return x(O.current)},isCollapsed(){return N(O.current)},isExpanded(){return!N(O.current)},resize:W=>{M(O.current,W)}}),[w,b,x,N,A,M]);const $=_(O.current,o);return as(p,{...m,children:e,className:t,id:a,style:{...$,...h},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":C,"data-panel-id":A,"data-panel-size":parseFloat(""+$.flexGrow).toFixed(1)})}const GI=BI((e,t)=>as(WI,{...e,forwardedRef:t}));WI.displayName="Panel",GI.displayName="forwardRef(Panel)";let sy=null,Mi=null;function Tne(e,t){if(t){const n=(t&eO)!==0,r=(t&tO)!==0,o=(t&nO)!==0,i=(t&rO)!==0;if(n)return o?"se-resize":i?"ne-resize":"e-resize";if(r)return o?"sw-resize":i?"nw-resize":"w-resize";if(o)return"s-resize";if(i)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Mne(){Mi!==null&&(document.head.removeChild(Mi),sy=null,Mi=null)}function ly(e,t){const n=Tne(e,t);sy!==n&&(sy=n,Mi===null&&(Mi=document.createElement("style"),document.head.appendChild(Mi)),Mi.innerHTML=`*{cursor: ${n}!important;}`)}function qI(e){return e.type==="keydown"}function YI(e){return e.type.startsWith("pointer")}function KI(e){return e.type.startsWith("mouse")}function Cf(e){if(YI(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(KI(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function kne(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Dne(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Ane(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:JI(e),b:JI(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;ze(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:ZI(XI(n.a)),b:ZI(XI(n.b))};if(o.a===o.b){const i=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let s=i.length;for(;s--;){const l=i[s];if(l===a.a)return 1;if(l===a.b)return-1}}return Math.sign(o.a-o.b)}const Ine=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function One(e){var t;const n=getComputedStyle((t=QI(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function jne(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||One(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Ine.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function XI(e){let t=e.length;for(;t--;){const n=e[t];if(ze(n,"Missing node"),jne(n))return n}return null}function ZI(e){return e&&Number(getComputedStyle(e).zIndex)||0}function JI(e){const t=[];for(;e;)t.push(e),e=QI(e);return t}function QI(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const eO=1,tO=2,nO=4,rO=8,$ne=kne()==="coarse";let cr=[],ls=!1,Wo=new Map,Ef=new Map;const gc=new Set;function Fne(e,t,n,r,o){var i;const{ownerDocument:a}=t,s={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},l=(i=Wo.get(a))!==null&&i!==void 0?i:0;return Wo.set(a,l+1),gc.add(s),Pf(),function(){var u;Ef.delete(e),gc.delete(s);const d=(u=Wo.get(a))!==null&&u!==void 0?u:1;if(Wo.set(a,d-1),Pf(),d===1&&Wo.delete(a),cr.includes(s)){const f=cr.indexOf(s);f>=0&&cr.splice(f,1),dy(),o("up",!0,null)}}}function oO(e){const{target:t}=e,{x:n,y:r}=Cf(e);ls=!0,cy({target:t,x:n,y:r}),Pf(),cr.length>0&&(Rf("down",e),e.preventDefault(),e.stopPropagation())}function wc(e){const{x:t,y:n}=Cf(e);if(ls&&e.buttons===0&&(ls=!1,Rf("up",e)),!ls){const{target:r}=e;cy({target:r,x:t,y:n})}Rf("move",e),dy(),cr.length>0&&e.preventDefault()}function cs(e){const{target:t}=e,{x:n,y:r}=Cf(e);Ef.clear(),ls=!1,cr.length>0&&e.preventDefault(),Rf("up",e),cy({target:t,x:n,y:r}),dy(),Pf()}function cy({target:e,x:t,y:n}){cr.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),gc.forEach(o=>{const{element:i,hitAreaMargins:a}=o,s=i.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=s,f=$ne?a.coarse:a.fine;if(t>=c-f&&t<=u+f&&n>=d-f&&n<=l+f){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&Ane(r,i)>0){let p=r,m=!1;for(;p&&!p.contains(i);){if(Dne(p.getBoundingClientRect(),s)){m=!0;break}p=p.parentElement}if(m)return}cr.push(o)}})}function uy(e,t){Ef.set(e,t)}function dy(){let e=!1,t=!1;cr.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;Ef.forEach(r=>{n|=r}),e&&t?ly("intersection",n):e?ly("horizontal",n):t?ly("vertical",n):Mne()}function Pf(){Wo.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",cs),n.removeEventListener("pointerdown",oO),n.removeEventListener("pointerleave",wc),n.removeEventListener("pointermove",wc)}),window.removeEventListener("pointerup",cs),window.removeEventListener("pointercancel",cs),gc.size>0&&(ls?(cr.length>0&&Wo.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",cs),n.addEventListener("pointerleave",wc),n.addEventListener("pointermove",wc))}),window.addEventListener("pointerup",cs),window.addEventListener("pointercancel",cs)):Wo.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",oO,{capture:!0}),n.addEventListener("pointermove",wc))}))}function Rf(e,t){gc.forEach(n=>{const{setResizeHandlerState:r}=n,o=cr.includes(n);r(e,o,t)})}function Lne(){const[e,t]=ss(0);return yn(()=>t(n=>n+1),[])}function ze(e,t){if(!e)throw console.error(t),Error(t)}const fy=10;function ki(e,t,n=fy){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function io(e,t,n=fy){return ki(e,t,n)===0}function In(e,t,n){return ki(e,t,n)===0}function zne(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const o=e[r],i=t[r];if(!In(o,i,n))return!1}return!0}function us({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];ze(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:i,maxSize:a=100,minSize:s=0}=r;if(ki(n,s)<0)if(i){const l=(o+s)/2;ki(n,l)<0?n=o:n=s}else n=s;return n=Math.min(a,n),n=parseFloat(n.toFixed(fy)),n}function vc({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:i}){if(In(e,0))return t;const a=[...t],[s,l]=r;ze(s!=null,"Invalid first pivot index"),ze(l!=null,"Invalid second pivot index");let c=0;if(i==="keyboard"){{const d=e<0?l:s,f=n[d];ze(f,`Panel constraints not found for index ${d}`);const{collapsedSize:h=0,collapsible:p,minSize:m=0}=f;if(p){const v=t[d];if(ze(v!=null,`Previous layout not found for panel index ${d}`),In(v,h)){const w=m-v;ki(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}{const d=e<0?s:l,f=n[d];ze(f,`No panel constraints found for index ${d}`);const{collapsedSize:h=0,collapsible:p,minSize:m=0}=f;if(p){const v=t[d];if(ze(v!=null,`Previous layout not found for panel index ${d}`),In(v,m)){const w=v-h;ki(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}}{const d=e<0?1:-1;let f=e<0?l:s,h=0;for(;;){const m=t[f];ze(m!=null,`Previous layout not found for panel index ${f}`);const w=us({panelConstraints:n,panelIndex:f,size:100})-m;if(h+=w,f+=d,f<0||f>=n.length)break}const p=Math.min(Math.abs(e),Math.abs(h));e=e<0?0-p:p}{let f=e<0?s:l;for(;f>=0&&f<n.length;){const h=Math.abs(e)-Math.abs(c),p=t[f];ze(p!=null,`Previous layout not found for panel index ${f}`);const m=p-h,v=us({panelConstraints:n,panelIndex:f,size:m});if(!In(p,v)&&(c+=p-v,a[f]=v,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(zne(o,a))return o;{const d=e<0?l:s,f=t[d];ze(f!=null,`Previous layout not found for panel index ${d}`);const h=f+c,p=us({panelConstraints:n,panelIndex:d,size:h});if(a[d]=p,!In(p,h)){let m=h-p,w=e<0?l:s;for(;w>=0&&w<n.length;){const b=a[w];ze(b!=null,`Previous layout not found for panel index ${w}`);const x=b+m,_=us({panelConstraints:n,panelIndex:w,size:x});if(In(b,_)||(m-=_-b,a[w]=_),In(m,0))break;e>0?w--:w++}}}const u=a.reduce((d,f)=>f+d,0);return In(u,100)?a:o}function Bne({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,a=0;const s=n[0];ze(s!=null,"No pivot index found"),t.forEach((d,f)=>{const{constraints:h}=d,{maxSize:p=100,minSize:m=0}=h;f===s?(r=m,o=p):(i+=m,a+=p)});const l=Math.min(o,100-i),c=Math.max(r,100-a),u=e[s];return{valueMax:l,valueMin:c,valueNow:u}}function yc(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function iO(e,t,n=document){const o=yc(e,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return o??null}function aO(e,t,n){const r=iO(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function sO(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Nf(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function Hne(e,t,n,r=document){var o,i,a,s;const l=Nf(t,r),c=yc(e,r),u=l?c.indexOf(l):-1,d=(o=(i=n[u])===null||i===void 0?void 0:i.id)!==null&&o!==void 0?o:null,f=(a=(s=n[u+1])===null||s===void 0?void 0:s.id)!==null&&a!==void 0?a:null;return[d,f]}function Vne({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:i,setLayout:a}){bn({didWarnAboutMissingResizeHandle:!1}),Ti(()=>{if(!i)return;const s=yc(n,i);for(let l=0;l<o.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=Bne({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),f=s[l];if(f!=null){const h=o[l];ze(h,`No panel data found for index "${l}"`),f.setAttribute("aria-controls",h.id),f.setAttribute("aria-valuemax",""+Math.round(c)),f.setAttribute("aria-valuemin",""+Math.round(u)),f.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{s.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,o,i]),Ni(()=>{if(!i)return;const s=t.current;ze(s,"Eager values not found");const{panelDataArray:l}=s,c=sO(n,i);ze(c!=null,`No group found for id "${n}"`);const u=yc(n,i);ze(u,`No resize handles found for group id "${n}"`);const d=u.map(f=>{const h=f.getAttribute("data-panel-resize-handle-id");ze(h,"Resize handle element has no handle id attribute");const[p,m]=Hne(n,h,l,i);if(p==null||m==null)return()=>{};const v=w=>{if(!w.defaultPrevented)switch(w.key){case"Enter":{w.preventDefault();const b=l.findIndex(x=>x.id===p);if(b>=0){const x=l[b];ze(x,`No panel data found for index ${b}`);const _=r[b],{collapsedSize:C=0,collapsible:N,minSize:R=0}=x.constraints;if(_!=null&&N){const T=vc({delta:In(_,C)?R-C:C-_,initialLayout:r,panelConstraints:l.map(M=>M.constraints),pivotIndices:aO(n,h,i),prevLayout:r,trigger:"keyboard"});r!==T&&a(T)}}break}}};return f.addEventListener("keydown",v),()=>{f.removeEventListener("keydown",v)}});return()=>{d.forEach(f=>f())}},[i,e,t,n,r,o,a])}function lO(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function cO(e,t){const n=e==="horizontal",{x:r,y:o}=Cf(t);return n?r:o}function Une(e,t,n,r,o){const i=n==="horizontal",a=Nf(t,o);ze(a,`No resize handle element found for id "${t}"`);const s=a.getAttribute("data-panel-group-id");ze(s,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=cO(n,e),u=sO(s,o);ze(u,`No group element found for id "${s}"`);const d=u.getBoundingClientRect(),f=i?d.width:d.height;return(c-l)/f*100}function Wne(e,t,n,r,o,i){if(qI(e)){const a=n==="horizontal";let s=0;e.shiftKey?s=100:o!=null?s=o:s=10;let l=0;switch(e.key){case"ArrowDown":l=a?0:s;break;case"ArrowLeft":l=a?-s:0;break;case"ArrowRight":l=a?s:0;break;case"ArrowUp":l=a?0:-s;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:Une(e,t,n,r,i)}function Gne({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,o=100;for(let i=0;i<e.length;i++){const a=n[i];ze(a,`Panel constraints not found for index ${i}`);const{defaultSize:s}=a;s!=null&&(r++,t[i]=s,o-=s)}for(let i=0;i<e.length;i++){const a=n[i];ze(a,`Panel constraints not found for index ${i}`);const{defaultSize:s}=a;if(s!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function ds(e,t,n){t.forEach((r,o)=>{const i=e[o];ze(i,`Panel data not found for index ${o}`);const{callbacks:a,constraints:s,id:l}=i,{collapsedSize:c=0,collapsible:u}=s,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:f,onExpand:h,onResize:p}=a;p&&p(r,d),u&&(f||h)&&(h&&(d==null||io(d,c))&&!io(r,c)&&h(),f&&(d==null||!io(d,c))&&io(r,c)&&f())}})}function Tf(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function qne({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const a=n[o];let s;return a==null?s=e!=null?e.toPrecision(i):"1":r.length===1?s="1":s=a.toPrecision(i),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function Yne(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function uO(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function dO(e){return`react-resizable-panels:${e}`}function fO(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=t;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function hO(e,t){try{const n=dO(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Kne(e,t,n){var r,o;const i=(r=hO(e,n))!==null&&r!==void 0?r:{},a=fO(t);return(o=i[a])!==null&&o!==void 0?o:null}function Xne(e,t,n,r,o){var i;const a=dO(e),s=fO(t),l=(i=hO(e,o))!==null&&i!==void 0?i:{};l[s]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(a,JSON.stringify(l))}catch(c){console.error(c)}}function pO({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,a)=>i+a,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!In(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const a=n[i];ze(a!=null,`No layout data found for index ${i}`);const s=100/r*a;n[i]=s}let o=0;for(let i=0;i<t.length;i++){const a=n[i];ze(a!=null,`No layout data found for index ${i}`);const s=us({panelConstraints:t,panelIndex:i,size:a});a!=s&&(o+=a-s,n[i]=s)}if(!In(o,0))for(let i=0;i<t.length;i++){const a=n[i];ze(a!=null,`No layout data found for index ${i}`);const s=a+o,l=us({panelConstraints:t,panelIndex:i,size:s});if(a!==l&&(o-=l-a,n[i]=l,In(o,0)))break}return n}const Zne=100,bc={getItem:e=>(uO(bc),bc.getItem(e)),setItem:(e,t)=>{uO(bc),bc.setItem(e,t)}},mO={};function gO({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:a=null,keyboardResizeBy:s=null,storage:l=bc,style:c,tagName:u="div",...d}){const f=ay(i),h=bn(null),[p,m]=ss(null),[v,w]=ss([]),b=Lne(),x=bn({}),_=bn(new Map),C=bn(0),N=bn({autoSaveId:e,direction:r,dragState:p,id:f,keyboardResizeBy:s,onLayout:a,storage:l}),R=bn({layout:v,panelDataArray:[],panelDataArrayChanged:!1});bn({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),VI(o,()=>({getId:()=>N.current.id,getLayout:()=>{const{layout:F}=R.current;return F},setLayout:F=>{const{onLayout:q}=N.current,{layout:ce,panelDataArray:L}=R.current,K=pO({layout:F,panelConstraints:L.map(z=>z.constraints)});lO(ce,K)||(w(K),R.current.layout=K,q&&q(K),ds(L,K,x.current))}}),[]),Ti(()=>{N.current.autoSaveId=e,N.current.direction=r,N.current.dragState=p,N.current.id=f,N.current.onLayout=a,N.current.storage=l}),Vne({committedValuesRef:N,eagerValuesRef:R,groupId:f,layout:v,panelDataArray:R.current.panelDataArray,setLayout:w,panelGroupElement:h.current}),Ni(()=>{const{panelDataArray:F}=R.current;if(e){if(v.length===0||v.length!==F.length)return;let q=mO[e];q==null&&(q=Yne(Xne,Zne),mO[e]=q);const ce=[...F],L=new Map(_.current);q(e,ce,L,v,l)}},[e,v,l]),Ni(()=>{});const T=yn(F=>{const{onLayout:q}=N.current,{layout:ce,panelDataArray:L}=R.current;if(F.constraints.collapsible){const K=L.map(ae=>ae.constraints),{collapsedSize:z=0,panelSize:ie,pivotIndices:le}=Di(L,F,ce);if(ze(ie!=null,`Panel size not found for panel "${F.id}"`),!io(ie,z)){_.current.set(F.id,ie);const H=fs(L,F)===L.length-1?ie-z:z-ie,ue=vc({delta:H,initialLayout:ce,panelConstraints:K,pivotIndices:le,prevLayout:ce,trigger:"imperative-api"});Tf(ce,ue)||(w(ue),R.current.layout=ue,q&&q(ue),ds(L,ue,x.current))}}},[]),M=yn((F,q)=>{const{onLayout:ce}=N.current,{layout:L,panelDataArray:K}=R.current;if(F.constraints.collapsible){const z=K.map(se=>se.constraints),{collapsedSize:ie=0,panelSize:le=0,minSize:ae=0,pivotIndices:H}=Di(K,F,L),ue=q??ae;if(io(le,ie)){const se=_.current.get(F.id),ye=se!=null&&se>=ue?se:ue,xe=fs(K,F)===K.length-1?le-ye:ye-le,j=vc({delta:xe,initialLayout:L,panelConstraints:z,pivotIndices:H,prevLayout:L,trigger:"imperative-api"});Tf(L,j)||(w(j),R.current.layout=j,ce&&ce(j),ds(K,j,x.current))}}},[]),D=yn(F=>{const{layout:q,panelDataArray:ce}=R.current,{panelSize:L}=Di(ce,F,q);return ze(L!=null,`Panel size not found for panel "${F.id}"`),L},[]),A=yn((F,q)=>{const{panelDataArray:ce}=R.current,L=fs(ce,F);return qne({defaultSize:q,dragState:p,layout:v,panelData:ce,panelIndex:L})},[p,v]),O=yn(F=>{const{layout:q,panelDataArray:ce}=R.current,{collapsedSize:L=0,collapsible:K,panelSize:z}=Di(ce,F,q);return ze(z!=null,`Panel size not found for panel "${F.id}"`),K===!0&&io(z,L)},[]),$=yn(F=>{const{layout:q,panelDataArray:ce}=R.current,{collapsedSize:L=0,collapsible:K,panelSize:z}=Di(ce,F,q);return ze(z!=null,`Panel size not found for panel "${F.id}"`),!K||ki(z,L)>0},[]),W=yn(F=>{const{panelDataArray:q}=R.current;q.push(F),q.sort((ce,L)=>{const K=ce.order,z=L.order;return K==null&&z==null?0:K==null?-1:z==null?1:K-z}),R.current.panelDataArrayChanged=!0,b()},[b]);Ti(()=>{if(R.current.panelDataArrayChanged){R.current.panelDataArrayChanged=!1;const{autoSaveId:F,onLayout:q,storage:ce}=N.current,{layout:L,panelDataArray:K}=R.current;let z=null;if(F){const le=Kne(F,K,ce);le&&(_.current=new Map(Object.entries(le.expandToSizes)),z=le.layout)}z==null&&(z=Gne({panelDataArray:K}));const ie=pO({layout:z,panelConstraints:K.map(le=>le.constraints)});lO(L,ie)||(w(ie),R.current.layout=ie,q&&q(ie),ds(K,ie,x.current))}}),Ti(()=>{const F=R.current;return()=>{F.layout=[]}},[]);const re=yn(F=>{let q=!1;const ce=h.current;return ce&&window.getComputedStyle(ce,null).getPropertyValue("direction")==="rtl"&&(q=!0),function(K){K.preventDefault();const z=h.current;if(!z)return()=>null;const{direction:ie,dragState:le,id:ae,keyboardResizeBy:H,onLayout:ue}=N.current,{layout:se,panelDataArray:ye}=R.current,{initialLayout:Ce}=le??{},xe=aO(ae,F,z);let j=Wne(K,F,ie,le,H,z);const V=ie==="horizontal";V&&q&&(j=-j);const J=ye.map(fe=>fe.constraints),we=vc({delta:j,initialLayout:Ce??se,panelConstraints:J,pivotIndices:xe,prevLayout:se,trigger:qI(K)?"keyboard":"mouse-or-touch"}),pe=!Tf(se,we);(YI(K)||KI(K))&&C.current!=j&&(C.current=j,!pe&&j!==0?V?uy(F,j<0?eO:tO):uy(F,j<0?nO:rO):uy(F,0)),pe&&(w(we),R.current.layout=we,ue&&ue(we),ds(ye,we,x.current))}},[]),Y=yn((F,q)=>{const{onLayout:ce}=N.current,{layout:L,panelDataArray:K}=R.current,z=K.map(se=>se.constraints),{panelSize:ie,pivotIndices:le}=Di(K,F,L);ze(ie!=null,`Panel size not found for panel "${F.id}"`);const H=fs(K,F)===K.length-1?ie-q:q-ie,ue=vc({delta:H,initialLayout:L,panelConstraints:z,pivotIndices:le,prevLayout:L,trigger:"imperative-api"});Tf(L,ue)||(w(ue),R.current.layout=ue,ce&&ce(ue),ds(K,ue,x.current))},[]),Z=yn((F,q)=>{const{layout:ce,panelDataArray:L}=R.current,{collapsedSize:K=0,collapsible:z}=q,{collapsedSize:ie=0,collapsible:le,maxSize:ae=100,minSize:H=0}=F.constraints,{panelSize:ue}=Di(L,F,ce);ue!=null&&(z&&le&&io(ue,K)?io(K,ie)||Y(F,ie):ue<H?Y(F,H):ue>ae&&Y(F,ae))},[Y]),B=yn((F,q)=>{const{direction:ce}=N.current,{layout:L}=R.current;if(!h.current)return;const K=Nf(F,h.current);ze(K,`Drag handle element not found for id "${F}"`);const z=cO(ce,q);m({dragHandleId:F,dragHandleRect:K.getBoundingClientRect(),initialCursorPosition:z,initialLayout:L})},[]),oe=yn(()=>{m(null)},[]),ee=yn(F=>{const{panelDataArray:q}=R.current,ce=fs(q,F);ce>=0&&(q.splice(ce,1),delete x.current[F.id],R.current.panelDataArrayChanged=!0,b())},[b]),ne=Ene(()=>({collapsePanel:T,direction:r,dragState:p,expandPanel:M,getPanelSize:D,getPanelStyle:A,groupId:f,isPanelCollapsed:O,isPanelExpanded:$,reevaluatePanelConstraints:Z,registerPanel:W,registerResizeHandle:re,resizePanel:Y,startDragging:B,stopDragging:oe,unregisterPanel:ee,panelGroupElement:h.current}),[T,p,r,M,D,A,f,O,$,Z,W,re,Y,B,oe,ee]),G={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return as(Sf.Provider,{value:ne},as(u,{...d,children:t,className:n,id:i,ref:h,style:{...G,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":f}))}const wO=BI((e,t)=>as(gO,{...e,forwardedRef:t}));gO.displayName="PanelGroup",wO.displayName="forwardRef(PanelGroup)";function fs(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Di(e,t,n){const r=fs(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t.constraints,panelSize:a,pivotIndices:i}}function Jne({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){Ni(()=>{if(e||n==null||r==null)return;const o=Nf(t,r);if(o==null)return;const i=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const s=o.getAttribute("data-panel-group-id");ze(s,`No group element found for id "${s}"`);const l=yc(s,r),c=iO(s,t,r);ze(c!==null,`No resize element found for id "${t}"`);const u=a.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return o.addEventListener("keydown",i),()=>{o.removeEventListener("keydown",i)}},[r,e,t,n])}function vO({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:i,onDragging:a,onFocus:s,style:l={},tabIndex:c=0,tagName:u="div",...d}){var f,h;const p=bn(null),m=bn({onDragging:a});Ni(()=>{m.current.onDragging=a});const v=HI(Sf);if(v===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:w,groupId:b,registerResizeHandle:x,startDragging:_,stopDragging:C,panelGroupElement:N}=v,R=ay(o),[T,M]=ss("inactive"),[D,A]=ss(!1),[O,$]=ss(null),W=bn({state:T});Ti(()=>{W.current.state=T}),Ni(()=>{if(n)$(null);else{const B=x(R);$(()=>B)}},[n,R,x]);const re=(f=r==null?void 0:r.coarse)!==null&&f!==void 0?f:15,Y=(h=r==null?void 0:r.fine)!==null&&h!==void 0?h:5;return Ni(()=>{if(n||O==null)return;const B=p.current;return ze(B,"Element ref not attached"),Fne(R,B,w,{coarse:re,fine:Y},(ee,ne,G)=>{if(ne)switch(ee){case"down":{M("drag"),ze(G,'Expected event to be defined for "down" action'),_(R,G);const{onDragging:F}=m.current;F&&F(!0);break}case"move":{const{state:F}=W.current;F!=="drag"&&M("hover"),ze(G,'Expected event to be defined for "move" action'),O(G);break}case"up":{M("hover"),C();const{onDragging:F}=m.current;F&&F(!1);break}}else M("inactive")})},[re,w,n,Y,x,R,O,_,C]),Jne({disabled:n,handleId:R,resizeHandler:O,panelGroupElement:N}),as(u,{...d,children:e,className:t,id:o,onBlur:()=>{A(!1),i==null||i()},onFocus:()=>{A(!0),s==null||s()},ref:p,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...l},tabIndex:c,"data-panel-group-direction":w,"data-panel-group-id":b,"data-resize-handle":"","data-resize-handle-active":T==="drag"?"pointer":D?"keyboard":void 0,"data-resize-handle-state":T,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":R})}vO.displayName="PanelResizeHandle";const yO=E.forwardRef(({className:e,...t},n)=>g.jsx(wO,{ref:n,className:Q("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}));yO.displayName="ResizablePanelGroup";const bO=E.forwardRef(({className:e,...t},n)=>g.jsx(GI,{ref:n,className:Q("relative flex h-full w-full",e),...t}));bO.displayName="ResizablePanel";const xO=({className:e,...t})=>g.jsx(vO,{className:Q("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-4 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-4 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...t,children:g.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",viewBox:"0 0 8 8",fill:"currentColor",children:[g.jsx("circle",{cx:"2",cy:"4",r:"0.75"}),g.jsx("circle",{cx:"6",cy:"4",r:"0.75"})]})})});xO.displayName="ResizableHandle";const _O=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(UN,{ref:r,className:Q("relative overflow-hidden",e),...n,children:[g.jsx(Uq,{className:"h-full w-full rounded-[inherit]",children:t}),g.jsx(hy,{}),g.jsx(Wq,{})]}));_O.displayName=UN.displayName;const hy=E.forwardRef(({className:e,orientation:t="vertical",...n},r)=>g.jsx(tw,{ref:r,orientation:t,className:Q("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:g.jsx(FN,{className:"relative flex-1 rounded-full bg-border"})}));hy.displayName=tw.displayName;const Qne=uY,ere=mY,tre=dY,SO=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(bT,{ref:r,className:Q("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,g.jsx(fY,{asChild:!0,children:g.jsx(Xd,{className:"h-4 w-4 opacity-50"})})]}));SO.displayName=bT.displayName;const py=E.forwardRef(({className:e,...t},n)=>g.jsx(CT,{ref:n,className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(y6,{className:"h-4 w-4"})}));py.displayName=CT.displayName;const my=E.forwardRef(({className:e,...t},n)=>g.jsx(ET,{ref:n,className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Xd,{className:"h-4 w-4"})}));my.displayName=ET.displayName;const CO=E.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>g.jsx(hY,{children:g.jsxs(xT,{ref:o,className:Q("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[g.jsx(py,{}),g.jsx(pY,{className:Q("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(my,{})]})}));CO.displayName=xT.displayName;const EO=E.forwardRef(({className:e,...t},n)=>g.jsx(_T,{ref:n,className:Q("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));EO.displayName=_T.displayName;const PO=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(ST,{ref:r,className:Q("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(wY,{children:g.jsx(Wa,{className:"h-4 w-4"})})}),g.jsx(gY,{children:t})]}));PO.displayName=ST.displayName;const RO=E.forwardRef(({className:e,...t},n)=>g.jsx(PT,{ref:n,className:Q("-mx-1 my-1 h-px bg-primary",e),...t}));RO.displayName=PT.displayName;const NO=E.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>g.jsx(TT,{ref:o,decorative:n,orientation:t,className:Q("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));NO.displayName=TT.displayName;const nre=fd,rre=hd,TO=Na,MO=pd,gy=E.forwardRef(({className:e,...t},n)=>g.jsx(Ca,{className:Q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));gy.displayName=Ca.displayName;const ore=kn("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),kO=E.forwardRef(({side:e="right",className:t,children:n,...r},o)=>g.jsxs(MO,{children:[g.jsx(gy,{}),g.jsxs(Ea,{ref:o,className:Q(ore({side:e}),t),...r,children:[n,g.jsxs(TO,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[g.jsx(NM,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));kO.displayName=Ea.displayName;const DO=({className:e,...t})=>g.jsx("div",{className:Q("flex flex-col space-y-2 text-center sm:text-left",e),...t});DO.displayName="SheetHeader";const AO=({className:e,...t})=>g.jsx("div",{className:Q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});AO.displayName="SheetFooter";const IO=E.forwardRef(({className:e,...t},n)=>g.jsx(Pa,{ref:n,className:Q("text-lg font-semibold text-foreground",e),...t}));IO.displayName=Pa.displayName;const OO=E.forwardRef(({className:e,...t},n)=>g.jsx(Ra,{ref:n,className:Q("text-sm text-foreground",e),...t}));OO.displayName=Ra.displayName;const jO=E.forwardRef(({className:e,variant:t,size:n,collapsed:r,fixed:o,...i},a)=>{const{variants:s}=Bo(),l=E.useMemo(()=>kn(s.sidebar.defaultStyles,{variants:s.sidebar.variantStyles,defaultVariants:s.sidebar.defaultVariants}),[s]);return g.jsx("div",{ref:a,className:Q(l({variant:t,size:n,collapsed:r}),o&&"fixed inset-y-0 left-0",e),...i})});jO.displayName="Sidebar";const $O=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("flex items-center justify-center py-4",e),...t}));$O.displayName="SidebarHeader";const FO=E.forwardRef(({className:e,...t},n)=>g.jsx("nav",{ref:n,className:Q("flex-1 space-y-1",e),...t}));FO.displayName="SidebarNav";const LO=E.forwardRef(({className:e,children:t,icon:n,badge:r,variant:o,active:i,...a},s)=>{const{variants:l}=Bo(),c=E.useMemo(()=>kn(l.sidebarItem.defaultStyles,{variants:l.sidebarItem.variantStyles,defaultVariants:l.sidebarItem.defaultVariants}),[l]);return g.jsxs("div",{ref:s,className:Q(c({variant:i?"active":o}),e),...a,children:[n&&g.jsx("span",{className:"shrink-0",children:n}),g.jsx("span",{className:"flex-1 truncate",children:t}),r&&g.jsx("span",{children:r})]})});LO.displayName="SidebarItem";const zO=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("space-y-3 py-2",e),role:"group",...t}));zO.displayName="SidebarGroup";const BO=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Q("mt-auto",e),...t}));BO.displayName="SidebarFooter";function ire({className:e,...t}){return g.jsx("div",{className:Q("animate-pulse rounded-md bg-primary",e),...t})}const HO=E.forwardRef(({className:e,...t},n)=>g.jsxs(VT,{ref:n,className:Q("relative flex w-full touch-none select-none items-center",e),...t,children:[g.jsx(jY,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:g.jsx($Y,{className:"absolute h-full bg-primary"})}),g.jsx(FY,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));HO.displayName=VT.displayName;var are=(e,t,n,r,o,i,a,s)=>{let l=document.documentElement,c=["light","dark"];function u(h){(Array.isArray(e)?e:[e]).forEach(p=>{let m=p==="class",v=m&&i?o.map(w=>i[w]||w):o;m?(l.classList.remove(...v),l.classList.add(h)):l.setAttribute(p,h)}),d(h)}function d(h){s&&c.includes(h)&&(l.style.colorScheme=h)}function f(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)u(r);else try{let h=localStorage.getItem(t)||n,p=a&&h==="system"?f():h;u(p)}catch{}},sre=y.createContext(void 0),lre={setTheme:e=>{},themes:[]},cre=()=>{var e;return(e=y.useContext(sre))!=null?e:lre};y.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:i,value:a,themes:s,nonce:l,scriptProps:c})=>{let u=JSON.stringify([n,t,i,e,s,a,r,o]).slice(1,-1);return y.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?l:"",dangerouslySetInnerHTML:{__html:`(${are.toString()})(${u})`}})});function ure(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const dre=e=>{switch(e){case"success":return pre;case"info":return gre;case"warning":return mre;case"error":return wre;default:return null}},fre=Array(12).fill(0),hre=({visible:e,className:t})=>E.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},E.createElement("div",{className:"sonner-spinner"},fre.map((n,r)=>E.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),pre=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),mre=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),gre=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),wre=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),vre=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},E.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),yre=()=>{const[e,t]=E.useState(document.hidden);return E.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let wy=1;class bre{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:wy++,a=this.toasts.find(l=>l.id===i),s=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...t,id:i,title:r}),{...l,...t,id:i,dismissible:s,title:r}):l):this.addToast({title:r,...o,dismissible:s,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0}))),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,a;const s=o.then(async c=>{if(a=["resolve",c],E.isValidElement(c))i=!1,this.create({id:r,type:"default",message:c});else if(_re(c)&&!c.ok){i=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,h=typeof d=="object"?d:{message:d};this.create({id:r,type:"error",description:f,...h})}else if(c instanceof Error){i=!1;const d=typeof n.error=="function"?await n.error(c):n.error,f=typeof n.description=="function"?await n.description(c):n.description,h=typeof d=="object"?d:{message:d};this.create({id:r,type:"error",description:f,...h})}else if(n.success!==void 0){i=!1;const d=typeof n.success=="function"?await n.success(c):n.success,f=typeof n.description=="function"?await n.description(c):n.description,h=typeof d=="object"?d:{message:d};this.create({id:r,type:"success",description:f,...h})}}).catch(async c=>{if(a=["reject",c],n.error!==void 0){i=!1;const u=typeof n.error=="function"?await n.error(c):n.error,d=typeof n.description=="function"?await n.description(c):n.description,f=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:d,...f})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,u)=>s.then(()=>a[0]==="reject"?u(a[1]):c(a[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||wy++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const xn=new bre,xre=(e,t)=>{const n=(t==null?void 0:t.id)||wy++;return xn.addToast({title:e,...t,id:n}),n},_re=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Sre=xre,Cre=()=>xn.toasts,Ere=()=>xn.getActiveToasts();Object.assign(Sre,{success:xn.success,info:xn.info,warning:xn.warning,error:xn.error,custom:xn.custom,message:xn.message,promise:xn.promise,dismiss:xn.dismiss,loading:xn.loading},{getHistory:Cre,getToasts:Ere}),ure("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Mf(e){return e.label!==void 0}const Pre=3,Rre="24px",Nre="16px",VO=4e3,Tre=356,Mre=14,kre=45,Dre=200;function Lr(...e){return e.filter(Boolean).join(" ")}function Are(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Ire=e=>{var t,n,r,o,i,a,s,l,c;const{invert:u,toast:d,unstyled:f,interacting:h,setHeights:p,visibleToasts:m,heights:v,index:w,toasts:b,expanded:x,removeToast:_,defaultRichColors:C,closeButton:N,style:R,cancelButtonStyle:T,actionButtonStyle:M,className:D="",descriptionClassName:A="",duration:O,position:$,gap:W,expandByDefault:re,classNames:Y,icons:Z,closeButtonAriaLabel:B="Close toast"}=e,[oe,ee]=E.useState(null),[ne,G]=E.useState(null),[F,q]=E.useState(!1),[ce,L]=E.useState(!1),[K,z]=E.useState(!1),[ie,le]=E.useState(!1),[ae,H]=E.useState(!1),[ue,se]=E.useState(0),[ye,Ce]=E.useState(0),xe=E.useRef(d.duration||O||VO),j=E.useRef(null),V=E.useRef(null),J=w===0,we=w+1<=m,pe=d.type,fe=d.dismissible!==!1,ge=d.className||"",_e=d.descriptionClassName||"",Xe=E.useMemo(()=>v.findIndex(Ee=>Ee.toastId===d.id)||0,[v,d.id]),k=E.useMemo(()=>{var Ee;return(Ee=d.closeButton)!=null?Ee:N},[d.closeButton,N]),S=E.useMemo(()=>d.duration||O||VO,[d.duration,O]),P=E.useRef(0),I=E.useRef(0),U=E.useRef(0),te=E.useRef(null),[he,Oe]=$.split("-"),Qe=E.useMemo(()=>v.reduce((Ee,Ge,qe)=>qe>=Xe?Ee:Ee+Ge.height,0),[v,Xe]),nt=yre(),st=d.invert||u,We=pe==="loading";I.current=E.useMemo(()=>Xe*W+Qe,[Xe,Qe]),E.useEffect(()=>{xe.current=S},[S]),E.useEffect(()=>{q(!0)},[]),E.useEffect(()=>{const Ee=V.current;if(Ee){const Ge=Ee.getBoundingClientRect().height;return Ce(Ge),p(qe=>[{toastId:d.id,height:Ge,position:d.position},...qe]),()=>p(qe=>qe.filter(wt=>wt.toastId!==d.id))}},[p,d.id]),E.useLayoutEffect(()=>{if(!F)return;const Ee=V.current,Ge=Ee.style.height;Ee.style.height="auto";const qe=Ee.getBoundingClientRect().height;Ee.style.height=Ge,Ce(qe),p(wt=>wt.find(ft=>ft.toastId===d.id)?wt.map(ft=>ft.toastId===d.id?{...ft,height:qe}:ft):[{toastId:d.id,height:qe,position:d.position},...wt])},[F,d.title,d.description,p,d.id]);const Te=E.useCallback(()=>{L(!0),se(I.current),p(Ee=>Ee.filter(Ge=>Ge.toastId!==d.id)),setTimeout(()=>{_(d)},Dre)},[d,_,p,I]);E.useEffect(()=>{if(d.promise&&pe==="loading"||d.duration===1/0||d.type==="loading")return;let Ee;return x||h||nt?(()=>{if(U.current<P.current){const wt=new Date().getTime()-P.current;xe.current=xe.current-wt}U.current=new Date().getTime()})():(()=>{xe.current!==1/0&&(P.current=new Date().getTime(),Ee=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Te()},xe.current))})(),()=>clearTimeout(Ee)},[x,h,d,pe,nt,Te]),E.useEffect(()=>{d.delete&&Te()},[Te,d.delete]);function Ze(){var Ee;if(Z!=null&&Z.loading){var Ge;return E.createElement("div",{className:Lr(Y==null?void 0:Y.loader,d==null||(Ge=d.classNames)==null?void 0:Ge.loader,"sonner-loader"),"data-visible":pe==="loading"},Z.loading)}return E.createElement(hre,{className:Lr(Y==null?void 0:Y.loader,d==null||(Ee=d.classNames)==null?void 0:Ee.loader),visible:pe==="loading"})}var et,He;return E.createElement("li",{tabIndex:0,ref:V,className:Lr(D,ge,Y==null?void 0:Y.toast,d==null||(t=d.classNames)==null?void 0:t.toast,Y==null?void 0:Y.default,Y==null?void 0:Y[pe],d==null||(n=d.classNames)==null?void 0:n[pe]),"data-sonner-toast":"","data-rich-colors":(et=d.richColors)!=null?et:C,"data-styled":!(d.jsx||d.unstyled||f),"data-mounted":F,"data-promise":!!d.promise,"data-swiped":ae,"data-removed":ce,"data-visible":we,"data-y-position":he,"data-x-position":Oe,"data-index":w,"data-front":J,"data-swiping":K,"data-dismissible":fe,"data-type":pe,"data-invert":st,"data-swipe-out":ie,"data-swipe-direction":ne,"data-expanded":!!(x||re&&F),style:{"--index":w,"--toasts-before":w,"--z-index":b.length-w,"--offset":`${ce?ue:I.current}px`,"--initial-height":re?"auto":`${ye}px`,...R,...d.style},onDragEnd:()=>{z(!1),ee(null),te.current=null},onPointerDown:Ee=>{We||!fe||(j.current=new Date,se(I.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(z(!0),te.current={x:Ee.clientX,y:Ee.clientY}))},onPointerUp:()=>{var Ee,Ge,qe;if(ie||!fe)return;te.current=null;const wt=Number(((Ee=V.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Xt=Number(((Ge=V.current)==null?void 0:Ge.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ft=new Date().getTime()-((qe=j.current)==null?void 0:qe.getTime()),Nt=oe==="x"?wt:Xt,an=Math.abs(Nt)/ft;if(Math.abs(Nt)>=kre||an>.11){se(I.current),d.onDismiss==null||d.onDismiss.call(d,d),G(oe==="x"?wt>0?"right":"left":Xt>0?"down":"up"),Te(),le(!0);return}else{var Zt,_n;(Zt=V.current)==null||Zt.style.setProperty("--swipe-amount-x","0px"),(_n=V.current)==null||_n.style.setProperty("--swipe-amount-y","0px")}H(!1),z(!1),ee(null)},onPointerMove:Ee=>{var Ge,qe,wt;if(!te.current||!fe||((Ge=window.getSelection())==null?void 0:Ge.toString().length)>0)return;const ft=Ee.clientY-te.current.y,Nt=Ee.clientX-te.current.x;var an;const Zt=(an=e.swipeDirections)!=null?an:Are($);!oe&&(Math.abs(Nt)>1||Math.abs(ft)>1)&&ee(Math.abs(Nt)>Math.abs(ft)?"x":"y");let _n={x:0,y:0};const nj=Ai=>1/(1.5+Math.abs(Ai)/20);if(oe==="y"){if(Zt.includes("top")||Zt.includes("bottom"))if(Zt.includes("top")&&ft<0||Zt.includes("bottom")&&ft>0)_n.y=ft;else{const Ai=ft*nj(ft);_n.y=Math.abs(Ai)<Math.abs(ft)?Ai:ft}}else if(oe==="x"&&(Zt.includes("left")||Zt.includes("right")))if(Zt.includes("left")&&Nt<0||Zt.includes("right")&&Nt>0)_n.x=Nt;else{const Ai=Nt*nj(Nt);_n.x=Math.abs(Ai)<Math.abs(Nt)?Ai:Nt}(Math.abs(_n.x)>0||Math.abs(_n.y)>0)&&H(!0),(qe=V.current)==null||qe.style.setProperty("--swipe-amount-x",`${_n.x}px`),(wt=V.current)==null||wt.style.setProperty("--swipe-amount-y",`${_n.y}px`)}},k&&!d.jsx&&pe!=="loading"?E.createElement("button",{"aria-label":B,"data-disabled":We,"data-close-button":!0,onClick:We||!fe?()=>{}:()=>{Te(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Lr(Y==null?void 0:Y.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(He=Z==null?void 0:Z.close)!=null?He:vre):null,pe||d.icon||d.promise?E.createElement("div",{"data-icon":"",className:Lr(Y==null?void 0:Y.icon,d==null||(o=d.classNames)==null?void 0:o.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Ze():null,d.type!=="loading"?d.icon||(Z==null?void 0:Z[pe])||dre(pe):null):null,E.createElement("div",{"data-content":"",className:Lr(Y==null?void 0:Y.content,d==null||(i=d.classNames)==null?void 0:i.content)},E.createElement("div",{"data-title":"",className:Lr(Y==null?void 0:Y.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?E.createElement("div",{"data-description":"",className:Lr(A,_e,Y==null?void 0:Y.description,d==null||(s=d.classNames)==null?void 0:s.description)},typeof d.description=="function"?d.description():d.description):null),E.isValidElement(d.cancel)?d.cancel:d.cancel&&Mf(d.cancel)?E.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||T,onClick:Ee=>{Mf(d.cancel)&&fe&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,Ee),Te())},className:Lr(Y==null?void 0:Y.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,E.isValidElement(d.action)?d.action:d.action&&Mf(d.action)?E.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:Ee=>{Mf(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,Ee),!Ee.defaultPrevented&&Te())},className:Lr(Y==null?void 0:Y.actionButton,d==null||(c=d.classNames)==null?void 0:c.actionButton)},d.action.label):null)};function UO(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Ore(e,t){const n={};return[e,t].forEach((r,o)=>{const i=o===1,a=i?"--mobile-offset":"--offset",s=i?Nre:Rre;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=s:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(s)}),n}const jre=E.forwardRef(function(t,n){const{invert:r,position:o="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:s,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:h,style:p,visibleToasts:m=Pre,toastOptions:v,dir:w=UO(),gap:b=Mre,icons:x,containerAriaLabel:_="Notifications"}=t,[C,N]=E.useState([]),R=E.useMemo(()=>Array.from(new Set([o].concat(C.filter(ne=>ne.position).map(ne=>ne.position)))),[C,o]),[T,M]=E.useState([]),[D,A]=E.useState(!1),[O,$]=E.useState(!1),[W,re]=E.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=E.useRef(null),Z=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=E.useRef(null),oe=E.useRef(!1),ee=E.useCallback(ne=>{N(G=>{var F;return(F=G.find(q=>q.id===ne.id))!=null&&F.delete||xn.dismiss(ne.id),G.filter(({id:q})=>q!==ne.id)})},[]);return E.useEffect(()=>xn.subscribe(ne=>{if(ne.dismiss){const G=C.map(F=>F.id===ne.id?{...F,delete:!0}:F);requestAnimationFrame(()=>{N(G)});return}setTimeout(()=>{ur.flushSync(()=>{N(G=>{const F=G.findIndex(q=>q.id===ne.id);return F!==-1?[...G.slice(0,F),{...G[F],...ne},...G.slice(F+1)]:[ne,...G]})})})}),[C]),E.useEffect(()=>{if(d!=="system"){re(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?re("dark"):re("light")),typeof window>"u")return;const ne=window.matchMedia("(prefers-color-scheme: dark)");try{ne.addEventListener("change",({matches:G})=>{re(G?"dark":"light")})}catch{ne.addListener(({matches:F})=>{try{re(F?"dark":"light")}catch(q){console.error(q)}})}},[d]),E.useEffect(()=>{C.length<=1&&A(!1)},[C]),E.useEffect(()=>{const ne=G=>{var F;if(i.every(L=>G[L]||G.code===L)){var ce;A(!0),(ce=Y.current)==null||ce.focus()}G.code==="Escape"&&(document.activeElement===Y.current||(F=Y.current)!=null&&F.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[i]),E.useEffect(()=>{if(Y.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,oe.current=!1)}},[Y.current]),E.createElement("section",{ref:n,"aria-label":`${_} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((ne,G)=>{var F;const[q,ce]=ne.split("-");return C.length?E.createElement("ol",{key:ne,dir:w==="auto"?UO():w,tabIndex:-1,ref:Y,className:l,"data-sonner-toaster":!0,"data-sonner-theme":W,"data-y-position":q,"data-lifted":D&&C.length>1&&!a,"data-x-position":ce,style:{"--front-toast-height":`${((F=T[0])==null?void 0:F.height)||0}px`,"--width":`${Tre}px`,"--gap":`${b}px`,...p,...Ore(c,u)},onBlur:L=>{oe.current&&!L.currentTarget.contains(L.relatedTarget)&&(oe.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:L=>{L.target instanceof HTMLElement&&L.target.dataset.dismissible==="false"||oe.current||(oe.current=!0,B.current=L.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{O||A(!1)},onDragEnd:()=>A(!1),onPointerDown:L=>{L.target instanceof HTMLElement&&L.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},C.filter(L=>!L.position&&G===0||L.position===ne).map((L,K)=>{var z,ie;return E.createElement(Ire,{key:L.id,icons:x,index:K,toast:L,defaultRichColors:f,duration:(z=v==null?void 0:v.duration)!=null?z:h,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:r,visibleToasts:m,closeButton:(ie=v==null?void 0:v.closeButton)!=null?ie:s,interacting:O,position:ne,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,closeButtonAriaLabel:v==null?void 0:v.closeButtonAriaLabel,removeToast:ee,toasts:C.filter(le=>le.position==L.position),heights:T.filter(le=>le.position==L.position),setHeights:M,expandByDefault:a,gap:b,expanded:D,swipeDirections:t.swipeDirections})})):null}))}),$re=({...e})=>{const{theme:t="system"}=cre();return g.jsx(jre,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-primary group-[.toast]:text-foreground"}},...e})},WO=E.forwardRef(({className:e,...t},n)=>g.jsx(YT,{className:Q("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:g.jsx(VY,{className:Q("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));WO.displayName=YT.displayName;const Fre=GY,GO=y.forwardRef(({className:e,...t},n)=>g.jsx(iM,{ref:n,className:Q("inline-flex h-10 items-center justify-center rounded-md bg-primary p-1 text-foreground",e),...t}));GO.displayName=iM.displayName;const qO=y.forwardRef(({className:e,...t},n)=>g.jsx(aM,{ref:n,className:Q("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));qO.displayName=aM.displayName;const YO=y.forwardRef(({className:e,...t},n)=>g.jsx(sM,{ref:n,className:Q("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));YO.displayName=sM.displayName;const KO=E.forwardRef(({className:e,...t},n)=>g.jsx("textarea",{className:Q("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));KO.displayName="Textarea";const XO=kn("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-primary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),ZO=E.forwardRef(({className:e,variant:t,size:n,...r},o)=>{const{variants:i}=Bo(),a=E.useMemo(()=>kn(i.toggle.defaultStyles,{variants:i.toggle.variantStyles,defaultVariants:i.toggle.defaultVariants}),[i]);return g.jsx(lM,{ref:o,className:Q(a({variant:t,size:n,className:e})),...r})});ZO.displayName=lM.displayName;const JO=E.createContext({size:"default",variant:"default"}),QO=E.forwardRef(({className:e,variant:t,size:n,children:r,...o},i)=>g.jsx(gM,{ref:i,className:Q("flex items-center justify-center gap-1",e),...o,children:g.jsx(JO.Provider,{value:{variant:t,size:n},children:r})}));QO.displayName=gM.displayName;const ej=E.forwardRef(({className:e,children:t,variant:n,size:r,...o},i)=>{const a=E.useContext(JO);return g.jsx(wM,{ref:i,className:Q(XO({variant:a.variant||n,size:a.size||r}),e),...o,children:t})});ej.displayName=wM.displayName;const Lre=h6,zre=p6,Bre=m6,tj=E.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(EM,{ref:r,sideOffset:t,className:Q("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));tj.displayName=EM.displayName;const Hre=Object.freeze(Object.defineProperty({__proto__:null,Accordion:dK,AccordionContent:HM,AccordionItem:zM,AccordionTrigger:BM,Alert:GM,AlertDescription:YM,AlertDialog:yK,AlertDialogAction:tk,AlertDialogCancel:nk,AlertDialogContent:XM,AlertDialogDescription:ek,AlertDialogFooter:JM,AlertDialogHeader:ZM,AlertDialogTitle:QM,AlertDialogTrigger:bK,AlertTitle:qM,AspectRatio:_K,Avatar:rk,AvatarFallback:ik,AvatarImage:ok,Badge:CK,Breadcrumb:ak,BreadcrumbItem:lk,BreadcrumbLink:ck,BreadcrumbList:sk,BreadcrumbPage:uk,BreadcrumbSeparator:dk,Button:rr,Calendar:of,Card:zk,CardContent:Uk,CardDescription:Vk,CardFooter:Wk,CardHeader:Bk,CardTitle:Hk,Carousel:Qk,CarouselContent:eD,CarouselItem:tD,CarouselNext:rD,CarouselPrevious:nD,Checkbox:oD,Collapsible:UJ,CollapsibleContent:iD,CollapsibleTrigger:WJ,Combobox:bee,Command:hf,CommandDialog:yee,CommandEmpty:Cv,CommandGroup:Ev,CommandInput:Sv,CommandItem:Pv,CommandList:KD,CommandSeparator:XD,CommandShortcut:ZD,ContextMenu:xee,ContextMenuCheckboxItem:nA,ContextMenuContent:eA,ContextMenuGroup:See,ContextMenuItem:tA,ContextMenuLabel:oA,ContextMenuPortal:Cee,ContextMenuRadioGroup:Pee,ContextMenuRadioItem:rA,ContextMenuSeparator:iA,ContextMenuShortcut:aA,ContextMenuSub:Eee,ContextMenuSubContent:QD,ContextMenuSubTrigger:JD,ContextMenuTrigger:_ee,DataTable:Pte,DatePicker:Rte,DateRangePicker:Nte,Dialog:VD,DialogClose:vee,DialogContent:_v,DialogDescription:YD,DialogFooter:GD,DialogHeader:WD,DialogOverlay:xv,DialogPortal:UD,DialogTitle:qD,DialogTrigger:wee,Drawer:BA,DrawerClose:rne,DrawerContent:VA,DrawerDescription:qA,DrawerFooter:WA,DrawerHeader:UA,DrawerOverlay:ry,DrawerPortal:HA,DrawerTitle:GA,DrawerTrigger:nne,DropdownMenu:one,DropdownMenuCheckboxItem:JA,DropdownMenuContent:XA,DropdownMenuGroup:ane,DropdownMenuItem:ZA,DropdownMenuLabel:eI,DropdownMenuPortal:sne,DropdownMenuRadioGroup:cne,DropdownMenuRadioItem:QA,DropdownMenuSeparator:tI,DropdownMenuShortcut:nI,DropdownMenuSub:lne,DropdownMenuSubContent:KA,DropdownMenuSubTrigger:YA,DropdownMenuTrigger:ine,Form:fne,FormControl:lI,FormDescription:cI,FormField:hne,FormItem:aI,FormLabel:sI,FormMessage:uI,HoverCard:pne,HoverCardContent:dI,HoverCardTrigger:mne,Input:fI,Label:oy,Menubar:hI,MenubarCheckboxItem:yI,MenubarContent:wI,MenubarGroup:wne,MenubarItem:vI,MenubarLabel:xI,MenubarMenu:gne,MenubarPortal:vne,MenubarRadioGroup:bne,MenubarRadioItem:bI,MenubarSeparator:_I,MenubarShortcut:SI,MenubarSub:yne,MenubarSubContent:gI,MenubarSubTrigger:mI,MenubarTrigger:pI,NavigationMenu:CI,NavigationMenuContent:NI,NavigationMenuIndicator:TI,NavigationMenuItem:xne,NavigationMenuLink:_ne,NavigationMenuList:EI,NavigationMenuTrigger:RI,NavigationMenuViewport:iy,Pagination:MI,PaginationContent:kI,PaginationEllipsis:$I,PaginationFirst:OI,PaginationItem:DI,PaginationLast:jI,PaginationLink:is,PaginationNext:II,PaginationPrevious:AI,Popover:pf,PopoverContent:cc,PopoverTrigger:mf,Progress:FI,RadioGroup:LI,RadioGroupItem:zI,ResizableHandle:xO,ResizablePanel:bO,ResizablePanelGroup:yO,ScrollArea:_O,ScrollBar:hy,Select:Qne,SelectContent:CO,SelectGroup:ere,SelectItem:PO,SelectLabel:EO,SelectScrollDownButton:my,SelectScrollUpButton:py,SelectSeparator:RO,SelectTrigger:SO,SelectValue:tre,Separator:NO,Sheet:nre,SheetClose:TO,SheetContent:kO,SheetDescription:OO,SheetFooter:AO,SheetHeader:DO,SheetOverlay:gy,SheetPortal:MO,SheetTitle:IO,SheetTrigger:rre,Sidebar:jO,SidebarFooter:BO,SidebarGroup:zO,SidebarHeader:$O,SidebarItem:LO,SidebarNav:FO,Skeleton:ire,Slider:HO,Switch:WO,Table:Gv,TableBody:Yv,TableCaption:SA,TableCell:fc,TableFooter:_A,TableHead:Kv,TableHeader:qv,TableRow:rs,Tabs:Fre,TabsContent:YO,TabsList:GO,TabsTrigger:qO,Textarea:KO,Toaster:$re,Toggle:ZO,ToggleGroup:QO,ToggleGroupItem:ej,Tooltip:zre,TooltipContent:tj,TooltipProvider:Lre,TooltipTrigger:Bre,Variants:fK,badgeVariants:SK,buttonVariants:EK,navigationMenuTriggerStyle:PI,toggleVariants:XO,useForm:EV,useFormField:mc},Symbol.toStringTag,{value:"Module"})),Vre=()=>{typeof window<"u"&&(window.Buffer=Of.Buffer,window.fs=new Zj("fs"),window.pfs=window.fs.promises,window.miDir="/mi")};$e.APIHandler=up,$e.APIProxyHandler=dp,$e.DreamspaceElements=Hre,$e.MiniApp=eV,$e.ProjectProvider=h8,$e.RGComponent=tV,$e.RGComponentErrorBoundary=nV,$e.RGDroppable=rV,$e.RGEditLayout=XH,$e.RGPreviewLayout=PS,$e.RGProvider=b_,$e.TailwindThemeContext=pK,$e.TailwindThemeHooks=vK,$e.applySxtIgnore=n5,$e.checkoutCommit=i5,$e.getCommits=o5,$e.getHeadCommit=Z4,$e.getRedoTargetCommitForFile=Q4,$e.getTags=qh,$e.getUndoTargetCommitForFile=J4,$e.initializeMakeInfinite=Vre,$e.listAllFiles=r5,$e.listDir=Ix,$e.loadLibraryComponents=B4,$e.loadProjectComponents=Bx,$e.setTailwindTheme=Hx,$e.syncAndRetry=qx,$e.useAPI=v_,$e.useAppMetadata=V4,$e.useAppSettings=U4,$e.useAppVersions=W4,$e.useB64UrlForProjectImage=Vx,$e.useProject=hp,$e.useRGContext=lp,$e.useWebSocketManager=iV,Object.defineProperty($e,Symbol.toStringTag,{value:"Module"})});
|