@spaceandtimelabs/makeinfinite-ui 0.37.1 → 0.38.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 +1132 -0
- package/dist/makeinfinite-ui.es.js +34484 -9598
- package/dist/makeinfinite-ui.umd.js +250 -81
- package/package.json +27 -3
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`:(
|
|
3
|
-
`,
|
|
4
|
-
`),a=this._makeRoot(),o=[{indent:-1,node:a},{indent:0,node:null}];for(let s of i){let c=s.match(/^\t*/)[0].length;s=s.slice(c);let[u,...d]=s.split(" "),p=n(d);if(c<=o[o.length-1].indent)for(;c<=o[o.length-1].indent;)o.pop();o.push({indent:c,node:p}),o[o.length-2].node.set(u,p)}return a}_lookup(t,r=!0){let n=this._root,i="/",a=et.split(t);for(let o=0;o<a.length;++o){let s=a[o];if(n=n.get(s),!n)throw new Ah(t);if(r||o<a.length-1){const l=n.get(Ve);if(l.type==="symlink"){let c=et.resolve(i,l.target);n=this._lookup(c)}i?i=et.join(i,s):i=s}}return n}mkdir(t,{mode:r}){if(t==="/")throw new vc;let n=this._lookup(et.dirname(t)),i=et.basename(t);if(n.has(i))throw new vc;let a=new Map,o={mode:r,type:"dir",size:0,mtimeMs:Date.now(),ino:this.autoinc()};a.set(Ve,o),n.set(i,a)}rmdir(t){let r=this._lookup(t);if(r.get(Ve).type!=="dir")throw new xc;if(r.size>1)throw new $h;let n=this._lookup(et.dirname(t)),i=et.basename(t);n.delete(i)}readdir(t){let r=this._lookup(t);if(r.get(Ve).type!=="dir")throw new xc;return[...r.keys()].filter(n=>typeof n=="string")}writeStat(t,r,{mode:n}){let i;try{let c=this.stat(t);n==null&&(n=c.mode),i=c.ino}catch{}n==null&&(n=438),i==null&&(i=this.autoinc());let a=this._lookup(et.dirname(t)),o=et.basename(t),s={mode:n,type:"file",size:r,mtimeMs:Date.now(),ino:i},l=new Map;return l.set(Ve,s),a.set(o,l),s}unlink(t){let r=this._lookup(et.dirname(t)),n=et.basename(t);r.delete(n)}rename(t,r){let n=et.basename(r),i=this._lookup(t);this._lookup(et.dirname(r)).set(n,i),this.unlink(t)}stat(t){return this._lookup(t).get(Ve)}lstat(t){return this._lookup(t,!1).get(Ve)}readlink(t){return this._lookup(t,!1).get(Ve).target}symlink(t,r){let n,i;try{let c=this.stat(r);i===null&&(i=c.mode),n=c.ino}catch{}i==null&&(i=40960),n==null&&(n=this.autoinc());let a=this._lookup(et.dirname(r)),o=et.basename(r),s={mode:i,type:"symlink",target:t,size:0,mtimeMs:Date.now(),ino:n},l=new Map;return l.set(Ve,s),a.set(o,l),s}_du(t){let r=0;for(const[n,i]of t.entries())n===Ve?r+=i.size:r+=this._du(i);return r}du(t){let r=this._lookup(t);return this._du(r)}};class Ec{constructor(t="keyval-store",r="keyval"){this.storeName=r,this._dbName=t,this._storeName=r,this._init()}_init(){this._dbp||(this._dbp=new Promise((t,r)=>{const n=indexedDB.open(this._dbName);n.onerror=()=>r(n.error),n.onsuccess=()=>t(n.result),n.onupgradeneeded=()=>{n.result.createObjectStore(this._storeName)}}))}_withIDBStore(t,r){return this._init(),this._dbp.then(n=>new Promise((i,a)=>{const o=n.transaction(this.storeName,t);o.oncomplete=()=>i(),o.onabort=o.onerror=()=>a(o.error),r(o.objectStore(this.storeName))}))}_close(){return this._init(),this._dbp.then(t=>{t.close(),this._dbp=void 0})}}let Ka;function vr(){return Ka||(Ka=new Ec),Ka}function Ih(e,t=vr()){let r;return t._withIDBStore("readwrite",n=>{r=n.get(e)}).then(()=>r.result)}function jh(e,t,r=vr()){return r._withIDBStore("readwrite",n=>{n.put(t,e)})}function Bh(e,t,r=vr()){return r._withIDBStore("readwrite",n=>{const i=n.get(e);i.onsuccess=()=>{n.put(t(i.result),e)}})}function zh(e,t=vr()){return t._withIDBStore("readwrite",r=>{r.delete(e)})}function Nh(e=vr()){return e._withIDBStore("readwrite",t=>{t.clear()})}function Mh(e=vr()){const t=[];return e._withIDBStore("readwrite",r=>{(r.openKeyCursor||r.openCursor).call(r).onsuccess=function(){this.result&&(t.push(this.result.key),this.result.continue())}}).then(()=>t)}function Lh(e=vr()){return e._close()}const Sc=Xa(Object.freeze(Object.defineProperty({__proto__:null,Store:Ec,clear:Nh,close:Lh,del:zh,get:Ih,keys:Mh,set:jh,update:Bh},Symbol.toStringTag,{value:"Module"}))),tr=Sc;var Fh=class{constructor(t,r){this._database=t,this._storename=r,this._store=new tr.Store(this._database,this._storename)}saveSuperblock(t){return tr.set("!root",t,this._store)}loadSuperblock(){return tr.get("!root",this._store)}readFile(t){return tr.get(t,this._store)}writeFile(t,r){return tr.set(t,r,this._store)}unlink(t){return tr.del(t,this._store)}wipe(){return tr.clear(this._store)}close(){return tr.close(this._store)}},Uh=class{constructor(t){this._url=t}loadSuperblock(){return fetch(this._url+"/.superblock.txt").then(t=>t.ok?t.text():null)}async readFile(t){const r=await fetch(this._url+t);if(r.status===200)return r.arrayBuffer();throw new Error("ENOENT")}async sizeFile(t){const r=await fetch(this._url+t,{method:"HEAD"});if(r.status===200)return r.headers.get("content-length");throw new Error("ENOENT")}};const Cn=Sc,Hh=e=>new Promise(t=>setTimeout(t,e));var Wh=class{constructor(t,r){this._id=Math.random(),this._database=t,this._storename=r,this._store=new Cn.Store(this._database,this._storename),this._lock=null}async has({margin:t=2e3}={}){if(this._lock&&this._lock.holder===this._id){const r=Date.now();return this._lock.expires>r+t?!0:await this.renew()}else return!1}async renew({ttl:t=5e3}={}){let r;return await Cn.update("lock",n=>{const a=Date.now()+t;return r=n&&n.holder===this._id,this._lock=r?{holder:this._id,expires:a}:n,this._lock},this._store),r}async acquire({ttl:t=5e3}={}){let r,n,i;if(await Cn.update("lock",a=>{const o=Date.now(),s=o+t;return n=a&&a.expires<o,r=a===void 0||n,i=a&&a.holder===this._id,this._lock=r?{holder:this._id,expires:s}:a,this._lock},this._store),i)throw new Error("Mutex double-locked");return r}async wait({interval:t=100,limit:r=6e3,ttl:n}={}){for(;r--;){if(await this.acquire({ttl:n}))return!0;await Hh(t)}throw new Error("Mutex timeout")}async release({force:t=!1}={}){let r,n,i;if(await Cn.update("lock",a=>(r=t||a&&a.holder===this._id,n=a===void 0,i=a&&a.holder!==this._id,this._lock=r?void 0:a,this._lock),this._store),await Cn.close(this._store),!r&&!t){if(n)throw new Error("Mutex double-freed");if(i)throw new Error("Mutex lost ownership")}return r}},Gh=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},r=>(this._has=!!r,t(!!r),new Promise(n=>{this._release=n})))})}async wait({timeout:t=6e5}={}){return new Promise((r,n)=>{const i=new AbortController;setTimeout(()=>{i.abort(),n(new Error("Mutex timeout"))},t),navigator.locks.request(this._database+"_lock",{signal:i.signal},a=>(this._has=!!a,r(!!a),new Promise(o=>{this._release=o})))})}async release({force:t=!1}={}){this._has=!1,this._release?this._release():t&&navigator.locks.request(this._database+"_lock",{steal:!0},r=>!0)}};const{encode:qh,decode:kc}=bh,Yh=_h,Xh=Dh,{ENOENT:Zh,ENOTEMPTY:Vh,ETIMEDOUT:Kh}=_c,Jh=Fh,Qh=Uh,ep=Wh,tp=Gh,Tn=Va;var rp=class{constructor(){this.saveSuperblock=Yh(()=>{this.flush()},500)}async init(t,{wipe:r,url:n,urlauto:i,fileDbName:a=t,db:o=null,fileStoreName:s=t+"_files",lockDbName:l=t+"_lock",lockStoreName:c=t+"_lock"}={}){this._name=t,this._idb=o||new Jh(a,s),this._mutex=navigator.locks?new tp(t):new ep(l,c),this._cache=new Xh(t),this._opts={wipe:r,url:n},this._needsWipe=!!r,n&&(this._http=new Qh(n),this._urlauto=!!i)}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 r=await this._http.loadSuperblock();this._cache.activate(r),await this._saveSuperblock()}else this._cache.activate();if(!await this._mutex.has())throw new Kh}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,r,n){let i=Tn.split(Tn.dirname(t)),a=i.shift();for(let o of i){a=Tn.join(a,o);try{this._cache.mkdir(a,{mode:511})}catch{}}return this._cache.writeStat(t,r,n)}async readFile(t,r){const{encoding:n}=r;if(n&&n!=="utf8")throw new Error('Only "utf8" encoding is supported in readFile');let i=null,a=null;try{a=this._cache.stat(t),i=await this._idb.readFile(a.ino)}catch(o){if(!this._urlauto)throw o}if(!i&&this._http){let o=this._cache.lstat(t);for(;o.type==="symlink";)t=Tn.resolve(Tn.dirname(t),o.target),o=this._cache.lstat(t);i=await this._http.readFile(t)}if(i&&((!a||a.size!=i.byteLength)&&(a=await this._writeStat(t,i.byteLength,{mode:a?a.mode:438}),this.saveSuperblock()),n==="utf8"?i=kc(i):i.toString=()=>kc(i)),!a)throw new Zh(t);return i}async writeFile(t,r,n){const{mode:i,encoding:a="utf8"}=n;if(typeof r=="string"){if(a!=="utf8")throw new Error('Only "utf8" encoding is supported in writeFile');r=qh(r)}const o=await this._cache.writeStat(t,r.byteLength,{mode:i});await this._idb.writeFile(o.ino,r)}async unlink(t,r){const n=this._cache.lstat(t);this._cache.unlink(t),n.type!=="symlink"&&await this._idb.unlink(n.ino)}readdir(t,r){return this._cache.readdir(t)}mkdir(t,r){const{mode:n=511}=r;this._cache.mkdir(t,{mode:n})}rmdir(t,r){if(t==="/")throw new Vh;this._cache.rmdir(t)}rename(t,r){this._cache.rename(t,r)}stat(t,r){return this._cache.stat(t)}lstat(t,r){return this._cache.lstat(t)}readlink(t,r){return this._cache.readlink(t)}symlink(t,r){this._cache.symlink(t,r)}async backFile(t,r){let n=await this._http.sizeFile(t);await this._writeStat(t,n,r)}du(t){return this._cache.du(t)}flush(){return this._saveSuperblock()}},np=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 ip=rp,Rc=np,Ti=Va;function Pt(e,t,...r){return e=Ti.normalize(e),(typeof t>"u"||typeof t=="function")&&(t={}),typeof t=="string"&&(t={encoding:t}),[e,t,...r]}function ap(e,t,r,...n){return e=Ti.normalize(e),(typeof r>"u"||typeof r=="function")&&(r={}),typeof r=="string"&&(r={encoding:r}),[e,t,r,...n]}function Oc(e,t,...r){return[Ti.normalize(e),Ti.normalize(t),...r]}var op=class{constructor(t,r={}){this.init=this.init.bind(this),this.readFile=this._wrap(this.readFile,Pt,!1),this.writeFile=this._wrap(this.writeFile,ap,!0),this.unlink=this._wrap(this.unlink,Pt,!0),this.readdir=this._wrap(this.readdir,Pt,!1),this.mkdir=this._wrap(this.mkdir,Pt,!0),this.rmdir=this._wrap(this.rmdir,Pt,!0),this.rename=this._wrap(this.rename,Oc,!0),this.stat=this._wrap(this.stat,Pt,!1),this.lstat=this._wrap(this.lstat,Pt,!1),this.readlink=this._wrap(this.readlink,Pt,!1),this.symlink=this._wrap(this.symlink,Oc,!0),this.backFile=this._wrap(this.backFile,Pt,!0),this.du=this._wrap(this.du,Pt,!1),this._deactivationPromise=null,this._deactivationTimeout=null,this._activationPromise=null,this._operations=new Set,t&&this.init(t,r)}async init(...t){return this._initPromiseResolve&&await this._initPromise,this._initPromise=this._init(...t),this._initPromise}async _init(t,r={}){await this._gracefulShutdown(),this._activationPromise&&await this._deactivate(),this._backend&&this._backend.destroy&&await this._backend.destroy(),this._backend=r.backend||new ip,this._backend.init&&await this._backend.init(t,r),this._initPromiseResolve&&(this._initPromiseResolve(),this._initPromiseResolve=null),r.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,r,n){return async(...i)=>{i=r(...i);let a={name:t.name,args:i};this._operations.add(a);try{return await this._activate(),await t.apply(this,i)}finally{this._operations.delete(a),n&&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,r){return this._backend.readFile(t,r)}async writeFile(t,r,n){return await this._backend.writeFile(t,r,n),null}async unlink(t,r){return await this._backend.unlink(t,r),null}async readdir(t,r){return this._backend.readdir(t,r)}async mkdir(t,r){return await this._backend.mkdir(t,r),null}async rmdir(t,r){return await this._backend.rmdir(t,r),null}async rename(t,r){return await this._backend.rename(t,r),null}async stat(t,r){const n=await this._backend.stat(t,r);return new Rc(n)}async lstat(t,r){const n=await this._backend.lstat(t,r);return new Rc(n)}async readlink(t,r){return this._backend.readlink(t,r)}async symlink(t,r){return await this._backend.symlink(t,r),null}async backFile(t,r){return await this._backend.backFile(t,r),null}async du(t){return this._backend.du(t)}async flush(){return this._backend.flush()}};const sp=gh,cp=op;function ot(e,t){return typeof e=="function"&&(t=e),t=sp(t),[(...n)=>t(null,...n),t]}var lp=class{constructor(...t){this.promises=new cp(...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,r){return this.promises.init(t,r)}readFile(t,r,n){const[i,a]=ot(r,n);this.promises.readFile(t,r).then(i).catch(a)}writeFile(t,r,n,i){const[a,o]=ot(n,i);this.promises.writeFile(t,r,n).then(a).catch(o)}unlink(t,r,n){const[i,a]=ot(r,n);this.promises.unlink(t,r).then(i).catch(a)}readdir(t,r,n){const[i,a]=ot(r,n);this.promises.readdir(t,r).then(i).catch(a)}mkdir(t,r,n){const[i,a]=ot(r,n);this.promises.mkdir(t,r).then(i).catch(a)}rmdir(t,r,n){const[i,a]=ot(r,n);this.promises.rmdir(t,r).then(i).catch(a)}rename(t,r,n){const[i,a]=ot(n);this.promises.rename(t,r).then(i).catch(a)}stat(t,r,n){const[i,a]=ot(r,n);this.promises.stat(t).then(i).catch(a)}lstat(t,r,n){const[i,a]=ot(r,n);this.promises.lstat(t).then(i).catch(a)}readlink(t,r,n){const[i,a]=ot(r,n);this.promises.readlink(t).then(i).catch(a)}symlink(t,r,n){const[i,a]=ot(n);this.promises.symlink(t,r).then(i).catch(a)}backFile(t,r,n){const[i,a]=ot(r,n);this.promises.backFile(t,r).then(i).catch(a)}du(t,r){const[n,i]=ot(r);this.promises.du(t).then(n).catch(i)}flush(t){const[r,n]=ot(t);this.promises.flush().then(r).catch(n)}};const up=St(lp);var Ja={},Pi={};Pi.byteLength=hp,Pi.toByteArray=mp,Pi.fromByteArray=yp;for(var At=[],yt=[],fp=typeof Uint8Array<"u"?Uint8Array:Array,Qa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ur=0,dp=Qa.length;Ur<dp;++Ur)At[Ur]=Qa[Ur],yt[Qa.charCodeAt(Ur)]=Ur;yt[45]=62,yt[95]=63;function Cc(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function hp(e){var t=Cc(e),r=t[0],n=t[1];return(r+n)*3/4-n}function pp(e,t,r){return(t+r)*3/4-r}function mp(e){var t,r=Cc(e),n=r[0],i=r[1],a=new fp(pp(e,n,i)),o=0,s=i>0?n-4:n,l;for(l=0;l<s;l+=4)t=yt[e.charCodeAt(l)]<<18|yt[e.charCodeAt(l+1)]<<12|yt[e.charCodeAt(l+2)]<<6|yt[e.charCodeAt(l+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=t&255;return i===2&&(t=yt[e.charCodeAt(l)]<<2|yt[e.charCodeAt(l+1)]>>4,a[o++]=t&255),i===1&&(t=yt[e.charCodeAt(l)]<<10|yt[e.charCodeAt(l+1)]<<4|yt[e.charCodeAt(l+2)]>>2,a[o++]=t>>8&255,a[o++]=t&255),a}function wp(e){return At[e>>18&63]+At[e>>12&63]+At[e>>6&63]+At[e&63]}function gp(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(wp(n));return i.join("")}function yp(e){for(var t,r=e.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(gp(e,o,o+a>s?s:o+a));return n===1?(t=e[r-1],i.push(At[t>>2]+At[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(At[t>>10]+At[t>>4&63]+At[t<<2&63]+"=")),i.join("")}var eo={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */eo.read=function(e,t,r,n,i){var a,o,s=i*8-n-1,l=(1<<s)-1,c=l>>1,u=-7,d=r?i-1:0,p=r?-1:1,m=e[t+d];for(d+=p,a=m&(1<<-u)-1,m>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=p,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=o*256+e[t+d],d+=p,u-=8);if(a===0)a=1-c;else{if(a===l)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(m?-1:1)*o*Math.pow(2,a-n)},eo.write=function(e,t,r,n,i,a){var o,s,l,c=a*8-i-1,u=(1<<c)-1,d=u>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:a-1,g=n?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+d>=1?t+=p/l:t+=p*Math.pow(2,1-d),t*l>=2&&(o++,l/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*l-1)*Math.pow(2,i),o=o+d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[r+m]=s&255,m+=g,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+m]=o&255,m+=g,o/=256,c-=8);e[r+m-g]|=_*128};/*!
|
|
1
|
+
(function(ze,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):(ze=typeof globalThis<"u"?globalThis:ze||self,E(ze.MakeInfinite={},ze.React,ze.Babel,ze.ReactDOM))})(this,function(ze,E,FA,tr){"use strict";function Qd(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=Qd(E),Nv=Qd(FA),Jl=Qd(tr);var Ql=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ec(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 LA=zA;function zA(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),S=new Uint16Array(x),C=[],N=0;;){var R=b<w.length;if(!R||N>=x-1){var T=S.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 k=w[b++];if(!(k&128))S[N++]=k;else if((k&224)===192){var O=w[b++]&63;S[N++]=(k&31)<<6|O}else if((k&240)===224){var O=w[b++]&63,F=w[b++]&63;S[N++]=(k&31)<<12|O<<6|F}else if((k&248)===240){var O=w[b++]&63,F=w[b++]&63,L=w[b++]&63,K=(k&7)<<18|O<<12|F<<6|L;K>65535&&(K-=65536,S[N++]=K>>>10&1023|55296,K=56320|K&1023),S[N++]=K}}}function o(w){for(var b=0,x=w.length,S=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(S+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[S++]=R>>>6&31|192;else if(!(R&4294901760))N[S++]=R>>>12&15|224,N[S++]=R>>>6&63|128;else if(!(R&4292870144))N[S++]=R>>>18&7|240,N[S++]=R>>>12&63|128,N[S++]=R>>>6&63|128;else continue;else{N[S++]=R;continue}N[S++]=R&63|128}return N.slice?N.slice(0,S):N.subarray(0,S)}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 S=new XMLHttpRequest;return S.open("GET",b,!1),S.send(),S.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:Ql);var BA={encode:e=>new TextEncoder().encode(e),decode:e=>new TextDecoder().decode(e)},HA=UA;function UA(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 Tv(e){if(e.length===0)return".";let t=Mv(e);return t=t.reduce(qA,[]),ef(...t)}function VA(...e){let t="";for(let n of e)n.startsWith("/")?t=n:t=Tv(ef(t,n));return t}function ef(...e){if(e.length===0)return"";let t=e.join("/");return t=t.replace(/\/{2,}/g,"/"),t}function Mv(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 WA(e){const t=e.lastIndexOf("/");if(t===-1)throw new Error(`Cannot get dirname of "${e}"`);return t===0?"/":e.slice(0,t)}function GA(e){if(e==="/")throw new Error(`Cannot get basename of "${e}"`);const t=e.lastIndexOf("/");return t===-1?e:e.slice(t+1)}function qA(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 tf={join:ef,normalize:Tv,split:Mv,basename:GA,dirname:WA,resolve:VA};function Xa(e){return class extends Error{constructor(...t){super(...t),this.code=e,this.message?this.message=e+": "+this.message:this.message=e}}}const YA=Xa("EEXIST"),KA=Xa("ENOENT"),XA=Xa("ENOTDIR"),ZA=Xa("ENOTEMPTY"),JA=Xa("ETIMEDOUT");var Dv={EEXIST:YA,ENOENT:KA,ENOTDIR:XA,ENOTEMPTY:ZA,ETIMEDOUT:JA};const Wt=tf,{EEXIST:kv,ENOENT:QA,ENOTDIR:Ov,ENOTEMPTY:eI}=Dv,At=0;var tI=class{constructor(){}_makeRoot(t=new Map){return t.set(At,{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!==At&&(n+=this._countInodes(o));return n}autoinc(){return this._maxInode(this._root.get("/"))+1}_maxInode(t){let n=t.get(At).ino;for(let[r,o]of t)r!==At&&(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(At),c=l.mode.toString(8);n+=`${" ".repeat(i)}${a} ${c}`,l.type==="file"?n+=` ${l.size} ${l.mtimeMs}
|
|
2
|
+
`:(n+=`
|
|
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([[At,{mode:u,type:c,size:d,mtimeMs:f,ino:l}]])}let o=t.trim().split(`
|
|
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=Wt.split(t);for(let a=0;a<i.length;++a){let s=i[a];if(r=r.get(s),!r)throw new QA(t);if(n||a<i.length-1){const l=r.get(At);if(l.type==="symlink"){let c=Wt.resolve(o,l.target);r=this._lookup(c)}o?o=Wt.join(o,s):o=s}}return r}mkdir(t,{mode:n}){if(t==="/")throw new kv;let r=this._lookup(Wt.dirname(t)),o=Wt.basename(t);if(r.has(o))throw new kv;let i=new Map,a={mode:n,type:"dir",size:0,mtimeMs:Date.now(),ino:this.autoinc()};i.set(At,a),r.set(o,i)}rmdir(t){let n=this._lookup(t);if(n.get(At).type!=="dir")throw new Ov;if(n.size>1)throw new eI;let r=this._lookup(Wt.dirname(t)),o=Wt.basename(t);r.delete(o)}readdir(t){let n=this._lookup(t);if(n.get(At).type!=="dir")throw new Ov;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(Wt.dirname(t)),a=Wt.basename(t),s={mode:r,type:"file",size:n,mtimeMs:Date.now(),ino:o},l=new Map;return l.set(At,s),i.set(a,l),s}unlink(t){let n=this._lookup(Wt.dirname(t)),r=Wt.basename(t);n.delete(r)}rename(t,n){let r=Wt.basename(n),o=this._lookup(t);this._lookup(Wt.dirname(n)).set(r,o),this.unlink(t)}stat(t){return this._lookup(t).get(At)}lstat(t){return this._lookup(t,!1).get(At)}readlink(t){return this._lookup(t,!1).get(At).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(Wt.dirname(n)),a=Wt.basename(n),s={mode:o,type:"symlink",target:t,size:0,mtimeMs:Date.now(),ino:r},l=new Map;return l.set(At,s),i.set(a,l),s}_du(t){let n=0;for(const[r,o]of t.entries())r===At?n+=o.size:n+=this._du(o);return n}du(t){let n=this._lookup(t);return this._du(n)}};class Av{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 nf;function Do(){return nf||(nf=new Av),nf}function nI(e,t=Do()){let n;return t._withIDBStore("readwrite",r=>{n=r.get(e)}).then(()=>n.result)}function rI(e,t,n=Do()){return n._withIDBStore("readwrite",r=>{r.put(t,e)})}function oI(e,t,n=Do()){return n._withIDBStore("readwrite",r=>{const o=r.get(e);o.onsuccess=()=>{r.put(t(o.result),e)}})}function iI(e,t=Do()){return t._withIDBStore("readwrite",n=>{n.delete(e)})}function aI(e=Do()){return e._withIDBStore("readwrite",t=>{t.clear()})}function sI(e=Do()){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 lI(e=Do()){return e._close()}const Iv=ec(Object.freeze(Object.defineProperty({__proto__:null,Store:Av,clear:aI,close:lI,del:iI,get:nI,keys:sI,set:rI,update:oI},Symbol.toStringTag,{value:"Module"}))),Gr=Iv;var cI=class{constructor(t,n){this._database=t,this._storename=n,this._store=new Gr.Store(this._database,this._storename)}saveSuperblock(t){return Gr.set("!root",t,this._store)}loadSuperblock(){return Gr.get("!root",this._store)}readFile(t){return Gr.get(t,this._store)}writeFile(t,n){return Gr.set(t,n,this._store)}unlink(t){return Gr.del(t,this._store)}wipe(){return Gr.clear(this._store)}close(){return Gr.close(this._store)}},uI=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 Za=Iv,dI=e=>new Promise(t=>setTimeout(t,e));var fI=class{constructor(t,n){this._id=Math.random(),this._database=t,this._storename=n,this._store=new Za.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 Za.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 Za.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 dI(t)}throw new Error("Mutex timeout")}async release({force:t=!1}={}){let n,r,o;if(await Za.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 Za.close(this._store),!n&&!t){if(r)throw new Error("Mutex double-freed");if(o)throw new Error("Mutex lost ownership")}return n}},hI=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:pI,decode:jv}=BA,mI=HA,gI=tI,{ENOENT:wI,ENOTEMPTY:vI,ETIMEDOUT:yI}=Dv,bI=cI,xI=uI,_I=fI,SI=hI,Ja=tf;var CI=class{constructor(){this.saveSuperblock=mI(()=>{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 bI(i,s),this._mutex=navigator.locks?new SI(t):new _I(l,c),this._cache=new gI(t),this._opts={wipe:n,url:r},this._needsWipe=!!n,r&&(this._http=new xI(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 yI}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=Ja.split(Ja.dirname(t)),i=o.shift();for(let a of o){i=Ja.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=Ja.resolve(Ja.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=jv(o):o.toString=()=>jv(o)),!i)throw new wI(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=pI(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 vI;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()}},EI=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 PI=CI,$v=EI,tc=tf;function nr(e,t,...n){return e=tc.normalize(e),(typeof t>"u"||typeof t=="function")&&(t={}),typeof t=="string"&&(t={encoding:t}),[e,t,...n]}function RI(e,t,n,...r){return e=tc.normalize(e),(typeof n>"u"||typeof n=="function")&&(n={}),typeof n=="string"&&(n={encoding:n}),[e,t,n,...r]}function Fv(e,t,...n){return[tc.normalize(e),tc.normalize(t),...n]}var NI=class{constructor(t,n={}){this.init=this.init.bind(this),this.readFile=this._wrap(this.readFile,nr,!1),this.writeFile=this._wrap(this.writeFile,RI,!0),this.unlink=this._wrap(this.unlink,nr,!0),this.readdir=this._wrap(this.readdir,nr,!1),this.mkdir=this._wrap(this.mkdir,nr,!0),this.rmdir=this._wrap(this.rmdir,nr,!0),this.rename=this._wrap(this.rename,Fv,!0),this.stat=this._wrap(this.stat,nr,!1),this.lstat=this._wrap(this.lstat,nr,!1),this.readlink=this._wrap(this.readlink,nr,!1),this.symlink=this._wrap(this.symlink,Fv,!0),this.backFile=this._wrap(this.backFile,nr,!0),this.du=this._wrap(this.du,nr,!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 PI,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 $v(r)}async lstat(t,n){const r=await this._backend.lstat(t,n);return new $v(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 TI=LA,MI=NI;function Qt(e,t){return typeof e=="function"&&(t=e),t=TI(t),[(...r)=>t(null,...r),t]}var DI=class{constructor(...t){this.promises=new MI(...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]=Qt(n,r);this.promises.readFile(t,n).then(o).catch(i)}writeFile(t,n,r,o){const[i,a]=Qt(r,o);this.promises.writeFile(t,n,r).then(i).catch(a)}unlink(t,n,r){const[o,i]=Qt(n,r);this.promises.unlink(t,n).then(o).catch(i)}readdir(t,n,r){const[o,i]=Qt(n,r);this.promises.readdir(t,n).then(o).catch(i)}mkdir(t,n,r){const[o,i]=Qt(n,r);this.promises.mkdir(t,n).then(o).catch(i)}rmdir(t,n,r){const[o,i]=Qt(n,r);this.promises.rmdir(t,n).then(o).catch(i)}rename(t,n,r){const[o,i]=Qt(r);this.promises.rename(t,n).then(o).catch(i)}stat(t,n,r){const[o,i]=Qt(n,r);this.promises.stat(t).then(o).catch(i)}lstat(t,n,r){const[o,i]=Qt(n,r);this.promises.lstat(t).then(o).catch(i)}readlink(t,n,r){const[o,i]=Qt(n,r);this.promises.readlink(t).then(o).catch(i)}symlink(t,n,r){const[o,i]=Qt(r);this.promises.symlink(t,n).then(o).catch(i)}backFile(t,n,r){const[o,i]=Qt(n,r);this.promises.backFile(t,n).then(o).catch(i)}du(t,n){const[r,o]=Qt(n);this.promises.du(t).then(r).catch(o)}flush(t){const[n,r]=Qt(t);this.promises.flush().then(n).catch(r)}};const kI=jn(DI);var rf={},nc={};nc.byteLength=II,nc.toByteArray=$I,nc.fromByteArray=zI;for(var rr=[],Nn=[],OI=typeof Uint8Array<"u"?Uint8Array:Array,of="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vi=0,AI=of.length;vi<AI;++vi)rr[vi]=of[vi],Nn[of.charCodeAt(vi)]=vi;Nn[45]=62,Nn[95]=63;function Lv(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 II(e){var t=Lv(e),n=t[0],r=t[1];return(n+r)*3/4-r}function jI(e,t,n){return(t+n)*3/4-n}function $I(e){var t,n=Lv(e),r=n[0],o=n[1],i=new OI(jI(e,r,o)),a=0,s=o>0?r-4:r,l;for(l=0;l<s;l+=4)t=Nn[e.charCodeAt(l)]<<18|Nn[e.charCodeAt(l+1)]<<12|Nn[e.charCodeAt(l+2)]<<6|Nn[e.charCodeAt(l+3)],i[a++]=t>>16&255,i[a++]=t>>8&255,i[a++]=t&255;return o===2&&(t=Nn[e.charCodeAt(l)]<<2|Nn[e.charCodeAt(l+1)]>>4,i[a++]=t&255),o===1&&(t=Nn[e.charCodeAt(l)]<<10|Nn[e.charCodeAt(l+1)]<<4|Nn[e.charCodeAt(l+2)]>>2,i[a++]=t>>8&255,i[a++]=t&255),i}function FI(e){return rr[e>>18&63]+rr[e>>12&63]+rr[e>>6&63]+rr[e&63]}function LI(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(FI(r));return o.join("")}function zI(e){for(var t,n=e.length,r=n%3,o=[],i=16383,a=0,s=n-r;a<s;a+=i)o.push(LI(e,a,a+i>s?s:a+i));return r===1?(t=e[n-1],o.push(rr[t>>2]+rr[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(rr[t>>10]+rr[t>>4&63]+rr[t<<2&63]+"=")),o.join("")}var af={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */af.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)},af.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};/*!
|
|
5
5
|
* The buffer module from node.js, for the browser.
|
|
6
6
|
*
|
|
7
7
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
8
8
|
* @license MIT
|
|
9
|
-
*/(function(e){const t=Pi,r=eo,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!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 a(){try{const w=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(w,f),w.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 o(w){if(w>i)throw new RangeError('The value "'+w+'" is invalid for option "size"');const f=new Uint8Array(w);return Object.setPrototypeOf(f,s.prototype),f}function s(w,f,h){if(typeof w=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(w)}return l(w,f,h)}s.poolSize=8192;function l(w,f,h){if(typeof w=="string")return p(w,f);if(ArrayBuffer.isView(w))return g(w);if(w==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w);if(We(w,ArrayBuffer)||w&&We(w.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(We(w,SharedArrayBuffer)||w&&We(w.buffer,SharedArrayBuffer)))return _(w,f,h);if(typeof w=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const E=w.valueOf&&w.valueOf();if(E!=null&&E!==w)return s.from(E,f,h);const A=x(w);if(A)return A;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof w[Symbol.toPrimitive]=="function")return s.from(w[Symbol.toPrimitive]("string"),f,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w)}s.from=function(w,f,h){return l(w,f,h)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(w){if(typeof w!="number")throw new TypeError('"size" argument must be of type number');if(w<0)throw new RangeError('The value "'+w+'" is invalid for option "size"')}function u(w,f,h){return c(w),w<=0?o(w):f!==void 0?typeof h=="string"?o(w).fill(f,h):o(w).fill(f):o(w)}s.alloc=function(w,f,h){return u(w,f,h)};function d(w){return c(w),o(w<0?0:y(w)|0)}s.allocUnsafe=function(w){return d(w)},s.allocUnsafeSlow=function(w){return d(w)};function p(w,f){if((typeof f!="string"||f==="")&&(f="utf8"),!s.isEncoding(f))throw new TypeError("Unknown encoding: "+f);const h=O(w,f)|0;let E=o(h);const A=E.write(w,f);return A!==h&&(E=E.slice(0,A)),E}function m(w){const f=w.length<0?0:y(w.length)|0,h=o(f);for(let E=0;E<f;E+=1)h[E]=w[E]&255;return h}function g(w){if(We(w,Uint8Array)){const f=new Uint8Array(w);return _(f.buffer,f.byteOffset,f.byteLength)}return m(w)}function _(w,f,h){if(f<0||w.byteLength<f)throw new RangeError('"offset" is outside of buffer bounds');if(w.byteLength<f+(h||0))throw new RangeError('"length" is outside of buffer bounds');let E;return f===void 0&&h===void 0?E=new Uint8Array(w):h===void 0?E=new Uint8Array(w,f):E=new Uint8Array(w,f,h),Object.setPrototypeOf(E,s.prototype),E}function x(w){if(s.isBuffer(w)){const f=y(w.length)|0,h=o(f);return h.length===0||w.copy(h,0,0,f),h}if(w.length!==void 0)return typeof w.length!="number"||Ae(w.length)?o(0):m(w);if(w.type==="Buffer"&&Array.isArray(w.data))return m(w.data)}function y(w){if(w>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return w|0}function v(w){return+w!=w&&(w=0),s.alloc(+w)}s.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==s.prototype},s.compare=function(f,h){if(We(f,Uint8Array)&&(f=s.from(f,f.offset,f.byteLength)),We(h,Uint8Array)&&(h=s.from(h,h.offset,h.byteLength)),!s.isBuffer(f)||!s.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===h)return 0;let E=f.length,A=h.length;for(let j=0,z=Math.min(E,A);j<z;++j)if(f[j]!==h[j]){E=f[j],A=h[j];break}return E<A?-1:A<E?1:0},s.isEncoding=function(f){switch(String(f).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(f,h){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return s.alloc(0);let E;if(h===void 0)for(h=0,E=0;E<f.length;++E)h+=f[E].length;const A=s.allocUnsafe(h);let j=0;for(E=0;E<f.length;++E){let z=f[E];if(We(z,Uint8Array))j+z.length>A.length?(s.isBuffer(z)||(z=s.from(z)),z.copy(A,j)):Uint8Array.prototype.set.call(A,z,j);else if(s.isBuffer(z))z.copy(A,j);else throw new TypeError('"list" argument must be an Array of Buffers');j+=z.length}return A};function O(w,f){if(s.isBuffer(w))return w.length;if(ArrayBuffer.isView(w)||We(w,ArrayBuffer))return w.byteLength;if(typeof w!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof w);const h=w.length,E=arguments.length>2&&arguments[2]===!0;if(!E&&h===0)return 0;let A=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return ne(w).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Ee(w).length;default:if(A)return E?-1:ne(w).length;f=(""+f).toLowerCase(),A=!0}}s.byteLength=O;function R(w,f,h){let E=!1;if((f===void 0||f<0)&&(f=0),f>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,f>>>=0,h<=f))return"";for(w||(w="utf8");;)switch(w){case"hex":return Pe(this,f,h);case"utf8":case"utf-8":return Y(this,f,h);case"ascii":return me(this,f,h);case"latin1":case"binary":return ge(this,f,h);case"base64":return H(this,f,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ue(this,f,h);default:if(E)throw new TypeError("Unknown encoding: "+w);w=(w+"").toLowerCase(),E=!0}}s.prototype._isBuffer=!0;function b(w,f,h){const E=w[f];w[f]=w[h],w[h]=E}s.prototype.swap16=function(){const f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<f;h+=2)b(this,h,h+1);return this},s.prototype.swap32=function(){const f=this.length;if(f%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<f;h+=4)b(this,h,h+3),b(this,h+1,h+2);return this},s.prototype.swap64=function(){const f=this.length;if(f%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<f;h+=8)b(this,h,h+7),b(this,h+1,h+6),b(this,h+2,h+5),b(this,h+3,h+4);return this},s.prototype.toString=function(){const f=this.length;return f===0?"":arguments.length===0?Y(this,0,f):R.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(f){if(!s.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f?!0:s.compare(this,f)===0},s.prototype.inspect=function(){let f="";const h=e.INSPECT_MAX_BYTES;return f=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(f+=" ... "),"<Buffer "+f+">"},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(f,h,E,A,j){if(We(f,Uint8Array)&&(f=s.from(f,f.offset,f.byteLength)),!s.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(h===void 0&&(h=0),E===void 0&&(E=f?f.length:0),A===void 0&&(A=0),j===void 0&&(j=this.length),h<0||E>f.length||A<0||j>this.length)throw new RangeError("out of range index");if(A>=j&&h>=E)return 0;if(A>=j)return-1;if(h>=E)return 1;if(h>>>=0,E>>>=0,A>>>=0,j>>>=0,this===f)return 0;let z=j-A,pe=E-h;const ze=Math.min(z,pe),je=this.slice(A,j),Ne=f.slice(h,E);for(let Ce=0;Ce<ze;++Ce)if(je[Ce]!==Ne[Ce]){z=je[Ce],pe=Ne[Ce];break}return z<pe?-1:pe<z?1:0};function C(w,f,h,E,A){if(w.length===0)return-1;if(typeof h=="string"?(E=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,Ae(h)&&(h=A?0:w.length-1),h<0&&(h=w.length+h),h>=w.length){if(A)return-1;h=w.length-1}else if(h<0)if(A)h=0;else return-1;if(typeof f=="string"&&(f=s.from(f,E)),s.isBuffer(f))return f.length===0?-1:k(w,f,h,E,A);if(typeof f=="number")return f=f&255,typeof Uint8Array.prototype.indexOf=="function"?A?Uint8Array.prototype.indexOf.call(w,f,h):Uint8Array.prototype.lastIndexOf.call(w,f,h):k(w,[f],h,E,A);throw new TypeError("val must be string, number or Buffer")}function k(w,f,h,E,A){let j=1,z=w.length,pe=f.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(w.length<2||f.length<2)return-1;j=2,z/=2,pe/=2,h/=2}function ze(Ne,Ce){return j===1?Ne[Ce]:Ne.readUInt16BE(Ce*j)}let je;if(A){let Ne=-1;for(je=h;je<z;je++)if(ze(w,je)===ze(f,Ne===-1?0:je-Ne)){if(Ne===-1&&(Ne=je),je-Ne+1===pe)return Ne*j}else Ne!==-1&&(je-=je-Ne),Ne=-1}else for(h+pe>z&&(h=z-pe),je=h;je>=0;je--){let Ne=!0;for(let Ce=0;Ce<pe;Ce++)if(ze(w,je+Ce)!==ze(f,Ce)){Ne=!1;break}if(Ne)return je}return-1}s.prototype.includes=function(f,h,E){return this.indexOf(f,h,E)!==-1},s.prototype.indexOf=function(f,h,E){return C(this,f,h,E,!0)},s.prototype.lastIndexOf=function(f,h,E){return C(this,f,h,E,!1)};function S(w,f,h,E){h=Number(h)||0;const A=w.length-h;E?(E=Number(E),E>A&&(E=A)):E=A;const j=f.length;E>j/2&&(E=j/2);let z;for(z=0;z<E;++z){const pe=parseInt(f.substr(z*2,2),16);if(Ae(pe))return z;w[h+z]=pe}return z}function P(w,f,h,E){return Et(ne(f,w.length-h),w,h,E)}function $(w,f,h,E){return Et(ie(f),w,h,E)}function B(w,f,h,E){return Et(Ee(f),w,h,E)}function M(w,f,h,E){return Et(Re(f,w.length-h),w,h,E)}s.prototype.write=function(f,h,E,A){if(h===void 0)A="utf8",E=this.length,h=0;else if(E===void 0&&typeof h=="string")A=h,E=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(E)?(E=E>>>0,A===void 0&&(A="utf8")):(A=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const j=this.length-h;if((E===void 0||E>j)&&(E=j),f.length>0&&(E<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");A||(A="utf8");let z=!1;for(;;)switch(A){case"hex":return S(this,f,h,E);case"utf8":case"utf-8":return P(this,f,h,E);case"ascii":case"latin1":case"binary":return $(this,f,h,E);case"base64":return B(this,f,h,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,f,h,E);default:if(z)throw new TypeError("Unknown encoding: "+A);A=(""+A).toLowerCase(),z=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function H(w,f,h){return f===0&&h===w.length?t.fromByteArray(w):t.fromByteArray(w.slice(f,h))}function Y(w,f,h){h=Math.min(w.length,h);const E=[];let A=f;for(;A<h;){const j=w[A];let z=null,pe=j>239?4:j>223?3:j>191?2:1;if(A+pe<=h){let ze,je,Ne,Ce;switch(pe){case 1:j<128&&(z=j);break;case 2:ze=w[A+1],(ze&192)===128&&(Ce=(j&31)<<6|ze&63,Ce>127&&(z=Ce));break;case 3:ze=w[A+1],je=w[A+2],(ze&192)===128&&(je&192)===128&&(Ce=(j&15)<<12|(ze&63)<<6|je&63,Ce>2047&&(Ce<55296||Ce>57343)&&(z=Ce));break;case 4:ze=w[A+1],je=w[A+2],Ne=w[A+3],(ze&192)===128&&(je&192)===128&&(Ne&192)===128&&(Ce=(j&15)<<18|(ze&63)<<12|(je&63)<<6|Ne&63,Ce>65535&&Ce<1114112&&(z=Ce))}}z===null?(z=65533,pe=1):z>65535&&(z-=65536,E.push(z>>>10&1023|55296),z=56320|z&1023),E.push(z),A+=pe}return Te(E)}const ue=4096;function Te(w){const f=w.length;if(f<=ue)return String.fromCharCode.apply(String,w);let h="",E=0;for(;E<f;)h+=String.fromCharCode.apply(String,w.slice(E,E+=ue));return h}function me(w,f,h){let E="";h=Math.min(w.length,h);for(let A=f;A<h;++A)E+=String.fromCharCode(w[A]&127);return E}function ge(w,f,h){let E="";h=Math.min(w.length,h);for(let A=f;A<h;++A)E+=String.fromCharCode(w[A]);return E}function Pe(w,f,h){const E=w.length;(!f||f<0)&&(f=0),(!h||h<0||h>E)&&(h=E);let A="";for(let j=f;j<h;++j)A+=se[w[j]];return A}function Ue(w,f,h){const E=w.slice(f,h);let A="";for(let j=0;j<E.length-1;j+=2)A+=String.fromCharCode(E[j]+E[j+1]*256);return A}s.prototype.slice=function(f,h){const E=this.length;f=~~f,h=h===void 0?E:~~h,f<0?(f+=E,f<0&&(f=0)):f>E&&(f=E),h<0?(h+=E,h<0&&(h=0)):h>E&&(h=E),h<f&&(h=f);const A=this.subarray(f,h);return Object.setPrototypeOf(A,s.prototype),A};function oe(w,f,h){if(w%1!==0||w<0)throw new RangeError("offset is not uint");if(w+f>h)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(f,h,E){f=f>>>0,h=h>>>0,E||oe(f,h,this.length);let A=this[f],j=1,z=0;for(;++z<h&&(j*=256);)A+=this[f+z]*j;return A},s.prototype.readUintBE=s.prototype.readUIntBE=function(f,h,E){f=f>>>0,h=h>>>0,E||oe(f,h,this.length);let A=this[f+--h],j=1;for(;h>0&&(j*=256);)A+=this[f+--h]*j;return A},s.prototype.readUint8=s.prototype.readUInt8=function(f,h){return f=f>>>0,h||oe(f,1,this.length),this[f]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(f,h){return f=f>>>0,h||oe(f,2,this.length),this[f]|this[f+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(f,h){return f=f>>>0,h||oe(f,2,this.length),this[f]<<8|this[f+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(f,h){return f=f>>>0,h||oe(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(f,h){return f=f>>>0,h||oe(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},s.prototype.readBigUInt64LE=Se(function(f){f=f>>>0,V(f,"offset");const h=this[f],E=this[f+7];(h===void 0||E===void 0)&&re(f,this.length-8);const A=h+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,j=this[++f]+this[++f]*2**8+this[++f]*2**16+E*2**24;return BigInt(A)+(BigInt(j)<<BigInt(32))}),s.prototype.readBigUInt64BE=Se(function(f){f=f>>>0,V(f,"offset");const h=this[f],E=this[f+7];(h===void 0||E===void 0)&&re(f,this.length-8);const A=h*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],j=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+E;return(BigInt(A)<<BigInt(32))+BigInt(j)}),s.prototype.readIntLE=function(f,h,E){f=f>>>0,h=h>>>0,E||oe(f,h,this.length);let A=this[f],j=1,z=0;for(;++z<h&&(j*=256);)A+=this[f+z]*j;return j*=128,A>=j&&(A-=Math.pow(2,8*h)),A},s.prototype.readIntBE=function(f,h,E){f=f>>>0,h=h>>>0,E||oe(f,h,this.length);let A=h,j=1,z=this[f+--A];for(;A>0&&(j*=256);)z+=this[f+--A]*j;return j*=128,z>=j&&(z-=Math.pow(2,8*h)),z},s.prototype.readInt8=function(f,h){return f=f>>>0,h||oe(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},s.prototype.readInt16LE=function(f,h){f=f>>>0,h||oe(f,2,this.length);const E=this[f]|this[f+1]<<8;return E&32768?E|4294901760:E},s.prototype.readInt16BE=function(f,h){f=f>>>0,h||oe(f,2,this.length);const E=this[f+1]|this[f]<<8;return E&32768?E|4294901760:E},s.prototype.readInt32LE=function(f,h){return f=f>>>0,h||oe(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},s.prototype.readInt32BE=function(f,h){return f=f>>>0,h||oe(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},s.prototype.readBigInt64LE=Se(function(f){f=f>>>0,V(f,"offset");const h=this[f],E=this[f+7];(h===void 0||E===void 0)&&re(f,this.length-8);const A=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(E<<24);return(BigInt(A)<<BigInt(32))+BigInt(h+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),s.prototype.readBigInt64BE=Se(function(f){f=f>>>0,V(f,"offset");const h=this[f],E=this[f+7];(h===void 0||E===void 0)&&re(f,this.length-8);const A=(h<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(A)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+E)}),s.prototype.readFloatLE=function(f,h){return f=f>>>0,h||oe(f,4,this.length),r.read(this,f,!0,23,4)},s.prototype.readFloatBE=function(f,h){return f=f>>>0,h||oe(f,4,this.length),r.read(this,f,!1,23,4)},s.prototype.readDoubleLE=function(f,h){return f=f>>>0,h||oe(f,8,this.length),r.read(this,f,!0,52,8)},s.prototype.readDoubleBE=function(f,h){return f=f>>>0,h||oe(f,8,this.length),r.read(this,f,!1,52,8)};function L(w,f,h,E,A,j){if(!s.isBuffer(w))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>A||f<j)throw new RangeError('"value" argument is out of bounds');if(h+E>w.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(f,h,E,A){if(f=+f,h=h>>>0,E=E>>>0,!A){const pe=Math.pow(2,8*E)-1;L(this,f,h,E,pe,0)}let j=1,z=0;for(this[h]=f&255;++z<E&&(j*=256);)this[h+z]=f/j&255;return h+E},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(f,h,E,A){if(f=+f,h=h>>>0,E=E>>>0,!A){const pe=Math.pow(2,8*E)-1;L(this,f,h,E,pe,0)}let j=E-1,z=1;for(this[h+j]=f&255;--j>=0&&(z*=256);)this[h+j]=f/z&255;return h+E},s.prototype.writeUint8=s.prototype.writeUInt8=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,1,255,0),this[h]=f&255,h+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,2,65535,0),this[h]=f&255,this[h+1]=f>>>8,h+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,2,65535,0),this[h]=f>>>8,this[h+1]=f&255,h+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,4,4294967295,0),this[h+3]=f>>>24,this[h+2]=f>>>16,this[h+1]=f>>>8,this[h]=f&255,h+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,4,4294967295,0),this[h]=f>>>24,this[h+1]=f>>>16,this[h+2]=f>>>8,this[h+3]=f&255,h+4};function W(w,f,h,E,A){F(f,E,A,w,h,7);let j=Number(f&BigInt(4294967295));w[h++]=j,j=j>>8,w[h++]=j,j=j>>8,w[h++]=j,j=j>>8,w[h++]=j;let z=Number(f>>BigInt(32)&BigInt(4294967295));return w[h++]=z,z=z>>8,w[h++]=z,z=z>>8,w[h++]=z,z=z>>8,w[h++]=z,h}function G(w,f,h,E,A){F(f,E,A,w,h,7);let j=Number(f&BigInt(4294967295));w[h+7]=j,j=j>>8,w[h+6]=j,j=j>>8,w[h+5]=j,j=j>>8,w[h+4]=j;let z=Number(f>>BigInt(32)&BigInt(4294967295));return w[h+3]=z,z=z>>8,w[h+2]=z,z=z>>8,w[h+1]=z,z=z>>8,w[h]=z,h+8}s.prototype.writeBigUInt64LE=Se(function(f,h=0){return W(this,f,h,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Se(function(f,h=0){return G(this,f,h,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(f,h,E,A){if(f=+f,h=h>>>0,!A){const ze=Math.pow(2,8*E-1);L(this,f,h,E,ze-1,-ze)}let j=0,z=1,pe=0;for(this[h]=f&255;++j<E&&(z*=256);)f<0&&pe===0&&this[h+j-1]!==0&&(pe=1),this[h+j]=(f/z>>0)-pe&255;return h+E},s.prototype.writeIntBE=function(f,h,E,A){if(f=+f,h=h>>>0,!A){const ze=Math.pow(2,8*E-1);L(this,f,h,E,ze-1,-ze)}let j=E-1,z=1,pe=0;for(this[h+j]=f&255;--j>=0&&(z*=256);)f<0&&pe===0&&this[h+j+1]!==0&&(pe=1),this[h+j]=(f/z>>0)-pe&255;return h+E},s.prototype.writeInt8=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,1,127,-128),f<0&&(f=255+f+1),this[h]=f&255,h+1},s.prototype.writeInt16LE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,2,32767,-32768),this[h]=f&255,this[h+1]=f>>>8,h+2},s.prototype.writeInt16BE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,2,32767,-32768),this[h]=f>>>8,this[h+1]=f&255,h+2},s.prototype.writeInt32LE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,4,2147483647,-2147483648),this[h]=f&255,this[h+1]=f>>>8,this[h+2]=f>>>16,this[h+3]=f>>>24,h+4},s.prototype.writeInt32BE=function(f,h,E){return f=+f,h=h>>>0,E||L(this,f,h,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[h]=f>>>24,this[h+1]=f>>>16,this[h+2]=f>>>8,this[h+3]=f&255,h+4},s.prototype.writeBigInt64LE=Se(function(f,h=0){return W(this,f,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Se(function(f,h=0){return G(this,f,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function te(w,f,h,E,A,j){if(h+E>w.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function I(w,f,h,E,A){return f=+f,h=h>>>0,A||te(w,f,h,4),r.write(w,f,h,E,23,4),h+4}s.prototype.writeFloatLE=function(f,h,E){return I(this,f,h,!0,E)},s.prototype.writeFloatBE=function(f,h,E){return I(this,f,h,!1,E)};function ee(w,f,h,E,A){return f=+f,h=h>>>0,A||te(w,f,h,8),r.write(w,f,h,E,52,8),h+8}s.prototype.writeDoubleLE=function(f,h,E){return ee(this,f,h,!0,E)},s.prototype.writeDoubleBE=function(f,h,E){return ee(this,f,h,!1,E)},s.prototype.copy=function(f,h,E,A){if(!s.isBuffer(f))throw new TypeError("argument should be a Buffer");if(E||(E=0),!A&&A!==0&&(A=this.length),h>=f.length&&(h=f.length),h||(h=0),A>0&&A<E&&(A=E),A===E||f.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("sourceEnd out of bounds");A>this.length&&(A=this.length),f.length-h<A-E&&(A=f.length-h+E);const j=A-E;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,E,A):Uint8Array.prototype.set.call(f,this.subarray(E,A),h),j},s.prototype.fill=function(f,h,E,A){if(typeof f=="string"){if(typeof h=="string"?(A=h,h=0,E=this.length):typeof E=="string"&&(A=E,E=this.length),A!==void 0&&typeof A!="string")throw new TypeError("encoding must be a string");if(typeof A=="string"&&!s.isEncoding(A))throw new TypeError("Unknown encoding: "+A);if(f.length===1){const z=f.charCodeAt(0);(A==="utf8"&&z<128||A==="latin1")&&(f=z)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(h<0||this.length<h||this.length<E)throw new RangeError("Out of range index");if(E<=h)return this;h=h>>>0,E=E===void 0?this.length:E>>>0,f||(f=0);let j;if(typeof f=="number")for(j=h;j<E;++j)this[j]=f;else{const z=s.isBuffer(f)?f:s.from(f,A),pe=z.length;if(pe===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(j=0;j<E-h;++j)this[j+h]=z[j%pe]}return this};const D={};function q(w,f,h){D[w]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:f.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${w}]`,this.stack,delete this.name}get code(){return w}set code(A){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:A,writable:!0})}toString(){return`${this.name} [${w}]: ${this.message}`}}}q("ERR_BUFFER_OUT_OF_BOUNDS",function(w){return w?`${w} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),q("ERR_INVALID_ARG_TYPE",function(w,f){return`The "${w}" argument must be of type number. Received type ${typeof f}`},TypeError),q("ERR_OUT_OF_RANGE",function(w,f,h){let E=`The value of "${w}" is out of range.`,A=h;return Number.isInteger(h)&&Math.abs(h)>2**32?A=Z(String(h)):typeof h=="bigint"&&(A=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(A=Z(A)),A+="n"),E+=` It must be ${f}. Received ${A}`,E},RangeError);function Z(w){let f="",h=w.length;const E=w[0]==="-"?1:0;for(;h>=E+4;h-=3)f=`_${w.slice(h-3,h)}${f}`;return`${w.slice(0,h)}${f}`}function X(w,f,h){V(f,"offset"),(w[f]===void 0||w[f+h]===void 0)&&re(f,w.length-(h+1))}function F(w,f,h,E,A,j){if(w>h||w<f){const z=typeof f=="bigint"?"n":"";let pe;throw f===0||f===BigInt(0)?pe=`>= 0${z} and < 2${z} ** ${(j+1)*8}${z}`:pe=`>= -(2${z} ** ${(j+1)*8-1}${z}) and < 2 ** ${(j+1)*8-1}${z}`,new D.ERR_OUT_OF_RANGE("value",pe,w)}X(E,A,j)}function V(w,f){if(typeof w!="number")throw new D.ERR_INVALID_ARG_TYPE(f,"number",w)}function re(w,f,h){throw Math.floor(w)!==w?(V(w,h),new D.ERR_OUT_OF_RANGE("offset","an integer",w)):f<0?new D.ERR_BUFFER_OUT_OF_BOUNDS:new D.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${f}`,w)}const Q=/[^+/0-9A-Za-z-_]/g;function le(w){if(w=w.split("=")[0],w=w.trim().replace(Q,""),w.length<2)return"";for(;w.length%4!==0;)w=w+"=";return w}function ne(w,f){f=f||1/0;let h;const E=w.length;let A=null;const j=[];for(let z=0;z<E;++z){if(h=w.charCodeAt(z),h>55295&&h<57344){if(!A){if(h>56319){(f-=3)>-1&&j.push(239,191,189);continue}else if(z+1===E){(f-=3)>-1&&j.push(239,191,189);continue}A=h;continue}if(h<56320){(f-=3)>-1&&j.push(239,191,189),A=h;continue}h=(A-55296<<10|h-56320)+65536}else A&&(f-=3)>-1&&j.push(239,191,189);if(A=null,h<128){if((f-=1)<0)break;j.push(h)}else if(h<2048){if((f-=2)<0)break;j.push(h>>6|192,h&63|128)}else if(h<65536){if((f-=3)<0)break;j.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((f-=4)<0)break;j.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return j}function ie(w){const f=[];for(let h=0;h<w.length;++h)f.push(w.charCodeAt(h)&255);return f}function Re(w,f){let h,E,A;const j=[];for(let z=0;z<w.length&&!((f-=2)<0);++z)h=w.charCodeAt(z),E=h>>8,A=h%256,j.push(A),j.push(E);return j}function Ee(w){return t.toByteArray(le(w))}function Et(w,f,h,E){let A;for(A=0;A<E&&!(A+h>=f.length||A>=w.length);++A)f[A+h]=w[A];return A}function We(w,f){return w instanceof f||w!=null&&w.constructor!=null&&w.constructor.name!=null&&w.constructor.name===f.name}function Ae(w){return w!==w}const se=function(){const w="0123456789abcdef",f=new Array(256);for(let h=0;h<16;++h){const E=h*16;for(let A=0;A<16;++A)f[E+A]=w[h]+w[A]}return f}();function Se(w){return typeof BigInt>"u"?Oi:w}function Oi(){throw new Error("BigInt not supported")}})(Ja);function bp(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function _p(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:bp(e)}async function vp(e,t){const r=_p(e);for(;;){const{value:n,done:i}=await r.next();if(n&&await t(n),i)break}r.return&&r.return()}async function xp(e){let t=0;const r=[];await vp(e,a=>{r.push(a),t+=a.byteLength});const n=new Uint8Array(t);let i=0;for(const a of r)n.set(a,i),i+=a.byteLength;return n}function Ep(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 Sp({onProgress:e,url:t,method:r="GET",headers:n={},body:i}){i&&(i=await xp(i));const a=await fetch(t,{method:r,headers:n,body:i}),o=a.body&&a.body.getReader?Ep(a.body):[new Uint8Array(await a.arrayBuffer())];n={};for(const[s,l]of a.headers.entries())n[s]=l;return{url:a.url,method:a.method,statusCode:a.status,statusMessage:a.statusText,body:o,headers:n}}var to={request:Sp},ht=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||ht.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||ht.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||ht.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=ht.DEFAULT_MAX_PENDING};ht.DEFAULT_TIMEOUT=0,ht.DEFAULT_MAX_OCCUPATION_TIME=0,ht.DEFAULT_MAX_EXECUTION_TIME=0,ht.DEFAULT_MAX_PENDING=1e3,ht.prototype.acquire=function(e,t,r,n){if(Array.isArray(e))return this._acquireBatch(e,t,r,n);if(typeof t!="function")throw new Error("You must pass a function to execute");var i=null,a=null,o=null;typeof r!="function"&&(n=r,r=null,o=new this.Promise(function(v,O){i=v,a=O})),n=n||{};var s=!1,l=null,c=null,u=null,d=this,p=function(v,O,R){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),v&&(d.queues[e]&&d.queues[e].length===0&&delete d.queues[e],d.domainReentrant&&delete d.domains[e]),s||(o?O?a(O):i(R):typeof r=="function"&&r(O,R),s=!0),v&&d.queues[e]&&d.queues[e].length>0&&d.queues[e].shift()()},m=function(v){if(s)return p(v);l&&(clearTimeout(l),l=null),d.domainReentrant&&v&&(d.domains[e]=process.domain);var O=n.maxExecutionTime||d.maxExecutionTime;if(O&&(u=setTimeout(function(){d.queues[e]&&p(v,new Error("Maximum execution time is exceeded "+e))},O)),t.length===1){var R=!1;try{t(function(b,C){R||(R=!0,p(v,b,C))})}catch(b){R||(R=!0,p(v,b))}}else d._promiseTry(function(){return t()}).then(function(b){p(v,void 0,b)},function(b){p(v,b)})};d.domainReentrant&&process.domain&&(m=process.domain.bind(m));var g=n.maxPending||d.maxPending;if(!d.queues[e])d.queues[e]=[],m(!0);else if(d.domainReentrant&&process.domain&&process.domain===d.domains[e])m(!1);else if(d.queues[e].length>=g)p(!1,new Error("Too many pending tasks in queue "+e));else{var _=function(){m(!0)};n.skipQueue?d.queues[e].unshift(_):d.queues[e].push(_);var x=n.timeout||d.timeout;x&&(l=setTimeout(function(){l=null,p(!1,new Error("async-lock timed out in queue "+e))},x))}var y=n.maxOccupationTime||d.maxOccupationTime;if(y&&(c=setTimeout(function(){d.queues[e]&&p(!1,new Error("Maximum occupation time is exceeded in queue "+e))},y)),o)return o},ht.prototype._acquireBatch=function(e,t,r,n){typeof r!="function"&&(n=r,r=null);var i=this,a=function(s,l){return function(c){i.acquire(s,l,c,n)}},o=e.reduceRight(function(s,l){return a(l,s)},t);if(typeof r=="function")o(r);else return new this.Promise(function(s,l){o.length===1?o(function(c,u){c?l(c):s(u)}):s(o())})},ht.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},ht.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(t){return this.Promise.reject(t)}};var kp=ht,Rp=kp;const Pn=St(Rp);var ro={exports:{}};typeof Object.create=="function"?ro.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ro.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}};var Op=ro.exports,no={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=Ja,n=r.Buffer;function i(o,s){for(var l in o)s[l]=o[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a);function a(o,s,l){return n(o,s,l)}a.prototype=Object.create(n.prototype),i(n,a),a.from=function(o,s,l){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,s,l)},a.alloc=function(o,s,l){if(typeof o!="number")throw new TypeError("Argument must be a number");var c=n(o);return s!==void 0?typeof l=="string"?c.fill(s,l):c.fill(s):c.fill(0),c},a.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},a.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(no,no.exports);var Tc=no.exports,Pc=Tc.Buffer;function Ai(e,t){this._block=Pc.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Ai.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Pc.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,a=this._len,o=0;o<i;){for(var s=a%n,l=Math.min(i-o,n-s),c=0;c<l;c++)r[s+c]=e[o+c];a+=l,o+=l,a%n===0&&this._update(r)}return this._len+=i,this},Ai.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 r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a},Ai.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Cp=Ai,Tp=Op,Ac=Cp,Pp=Tc.Buffer,Ap=[1518500249,1859775393,-1894007588,-899497514],$p=new Array(80);function An(){this.init(),this._w=$p,Ac.call(this,64,56)}Tp(An,Ac),An.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Dp(e){return e<<1|e>>>31}function Ip(e){return e<<5|e>>>27}function jp(e){return e<<30|e>>>2}function Bp(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}An.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,a=this._d|0,o=this._e|0,s=0;s<16;++s)t[s]=e.readInt32BE(s*4);for(;s<80;++s)t[s]=Dp(t[s-3]^t[s-8]^t[s-14]^t[s-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=Ip(r)+Bp(c,n,i,a)+o+t[l]+Ap[c]|0;o=a,a=i,i=jp(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=o+this._e|0},An.prototype._hash=function(){var e=Pp.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 zp=An;const $c=St(zp);function $t(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function Dc(e,t){for(var r="",n=0,i=-1,a=0,o,s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(r.length<2||n!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var l=r.lastIndexOf("/");if(l!==r.length-1){l===-1?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),i=s,a=0;continue}}else if(r.length===2||r.length===1){r="",n=0,i=s,a=0;continue}}t&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+e.slice(i+1,s):r=e.slice(i+1,s),n=s-i-1;i=s,a=0}else o===46&&a!==-1?++a:a=-1}return r}function Np(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}var Hr={resolve:function(){for(var t="",r=!1,n,i=arguments.length-1;i>=-1&&!r;i--){var a;i>=0?a=arguments[i]:(n===void 0&&(n=process.cwd()),a=n),$t(a),a.length!==0&&(t=a+"/"+t,r=a.charCodeAt(0)===47)}return t=Dc(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if($t(t),t.length===0)return".";var r=t.charCodeAt(0)===47,n=t.charCodeAt(t.length-1)===47;return t=Dc(t,!r),t.length===0&&!r&&(t="."),t.length>0&&n&&(t+="/"),r?"/"+t:t},isAbsolute:function(t){return $t(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,r=0;r<arguments.length;++r){var n=arguments[r];$t(n),n.length>0&&(t===void 0?t=n:t+="/"+n)}return t===void 0?".":Hr.normalize(t)},relative:function(t,r){if($t(t),$t(r),t===r||(t=Hr.resolve(t),r=Hr.resolve(r),t===r))return"";for(var n=1;n<t.length&&t.charCodeAt(n)===47;++n);for(var i=t.length,a=i-n,o=1;o<r.length&&r.charCodeAt(o)===47;++o);for(var s=r.length,l=s-o,c=a<l?a:l,u=-1,d=0;d<=c;++d){if(d===c){if(l>c){if(r.charCodeAt(o+d)===47)return r.slice(o+d+1);if(d===0)return r.slice(o+d)}else a>c&&(t.charCodeAt(n+d)===47?u=d:d===0&&(u=0));break}var p=t.charCodeAt(n+d),m=r.charCodeAt(o+d);if(p!==m)break;p===47&&(u=d)}var g="";for(d=n+u+1;d<=i;++d)(d===i||t.charCodeAt(d)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+r.slice(o+u):(o+=u,r.charCodeAt(o)===47&&++o,r.slice(o))},_makeLong:function(t){return t},dirname:function(t){if($t(t),t.length===0)return".";for(var r=t.charCodeAt(0),n=r===47,i=-1,a=!0,o=t.length-1;o>=1;--o)if(r=t.charCodeAt(o),r===47){if(!a){i=o;break}}else a=!1;return i===-1?n?"/":".":n&&i===1?"//":t.slice(0,i)},basename:function(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');$t(t);var n=0,i=-1,a=!0,o;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var s=r.length-1,l=-1;for(o=t.length-1;o>=0;--o){var c=t.charCodeAt(o);if(c===47){if(!a){n=o+1;break}}else l===-1&&(a=!1,l=o+1),s>=0&&(c===r.charCodeAt(s)?--s===-1&&(i=o):(s=-1,i=l))}return n===i?i=l:i===-1&&(i=t.length),t.slice(n,i)}else{for(o=t.length-1;o>=0;--o)if(t.charCodeAt(o)===47){if(!a){n=o+1;break}}else i===-1&&(a=!1,i=o+1);return i===-1?"":t.slice(n,i)}},extname:function(t){$t(t);for(var r=-1,n=0,i=-1,a=!0,o=0,s=t.length-1;s>=0;--s){var l=t.charCodeAt(s);if(l===47){if(!a){n=s+1;break}continue}i===-1&&(a=!1,i=s+1),l===46?r===-1?r=s:o!==1&&(o=1):r!==-1&&(o=-1)}return r===-1||i===-1||o===0||o===1&&r===i-1&&r===n+1?"":t.slice(r,i)},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 Np("/",t)},parse:function(t){$t(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var n=t.charCodeAt(0),i=n===47,a;i?(r.root="/",a=1):a=0;for(var o=-1,s=0,l=-1,c=!0,u=t.length-1,d=0;u>=a;--u){if(n=t.charCodeAt(u),n===47){if(!c){s=u+1;break}continue}l===-1&&(c=!1,l=u+1),n===46?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}return o===-1||l===-1||d===0||d===1&&o===l-1&&o===s+1?l!==-1&&(s===0&&i?r.base=r.name=t.slice(1,l):r.base=r.name=t.slice(s,l)):(s===0&&i?(r.name=t.slice(1,o),r.base=t.slice(1,l)):(r.name=t.slice(s,o),r.base=t.slice(s,l)),r.ext=t.slice(o,l)),s>0?r.dir=t.slice(0,s-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};Hr.posix=Hr;var N=Hr,Ic={};/*! 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 r(){for(var S=0,P=new Array(256),$=0;$!=256;++$)S=$,S=S&1?-306674912^S>>>1:S>>>1,S=S&1?-306674912^S>>>1:S>>>1,S=S&1?-306674912^S>>>1:S>>>1,S=S&1?-306674912^S>>>1:S>>>1,S=S&1?-306674912^S>>>1:S>>>1,S=S&1?-306674912^S>>>1:S>>>1,S=S&1?-306674912^S>>>1:S>>>1,S=S&1?-306674912^S>>>1:S>>>1,P[$]=S;return typeof Int32Array<"u"?new Int32Array(P):P}var n=r();function i(S){var P=0,$=0,B=0,M=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(B=0;B!=256;++B)M[B]=S[B];for(B=0;B!=256;++B)for($=S[B],P=256+B;P<4096;P+=256)$=M[P]=$>>>8^S[$&255];var H=[];for(B=1;B!=16;++B)H[B-1]=typeof Int32Array<"u"?M.subarray(B*256,B*256+256):M.slice(B*256,B*256+256);return H}var a=i(n),o=a[0],s=a[1],l=a[2],c=a[3],u=a[4],d=a[5],p=a[6],m=a[7],g=a[8],_=a[9],x=a[10],y=a[11],v=a[12],O=a[13],R=a[14];function b(S,P){for(var $=P^-1,B=0,M=S.length;B<M;)$=$>>>8^n[($^S.charCodeAt(B++))&255];return~$}function C(S,P){for(var $=P^-1,B=S.length-15,M=0;M<B;)$=R[S[M++]^$&255]^O[S[M++]^$>>8&255]^v[S[M++]^$>>16&255]^y[S[M++]^$>>>24]^x[S[M++]]^_[S[M++]]^g[S[M++]]^m[S[M++]]^p[S[M++]]^d[S[M++]]^u[S[M++]]^c[S[M++]]^l[S[M++]]^s[S[M++]]^o[S[M++]]^n[S[M++]];for(B+=15;M<B;)$=$>>>8^n[($^S[M++])&255];return~$}function k(S,P){for(var $=P^-1,B=0,M=S.length,H=0,Y=0;B<M;)H=S.charCodeAt(B++),H<128?$=$>>>8^n[($^H)&255]:H<2048?($=$>>>8^n[($^(192|H>>6&31))&255],$=$>>>8^n[($^(128|H&63))&255]):H>=55296&&H<57344?(H=(H&1023)+64,Y=S.charCodeAt(B++)&1023,$=$>>>8^n[($^(240|H>>8&7))&255],$=$>>>8^n[($^(128|H>>2&63))&255],$=$>>>8^n[($^(128|Y>>6&15|(H&3)<<4))&255],$=$>>>8^n[($^(128|Y&63))&255]):($=$>>>8^n[($^(224|H>>12&15))&255],$=$>>>8^n[($^(128|H>>6&63))&255],$=$>>>8^n[($^(128|H&63))&255]);return~$}t.table=n,t.bstr=b,t.buf=C,t.str=k})})(Ic);const Mp=St(Ic);var qt={};(function(e){var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function r(a,o){return Object.prototype.hasOwnProperty.call(a,o)}e.assign=function(a){for(var o=Array.prototype.slice.call(arguments,1);o.length;){var s=o.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var l in s)r(s,l)&&(a[l]=s[l])}}return a},e.shrinkBuf=function(a,o){return a.length===o?a:a.subarray?a.subarray(0,o):(a.length=o,a)};var n={arraySet:function(a,o,s,l,c){if(o.subarray&&a.subarray){a.set(o.subarray(s,s+l),c);return}for(var u=0;u<l;u++)a[c+u]=o[s+u]},flattenChunks:function(a){var o,s,l,c,u,d;for(l=0,o=0,s=a.length;o<s;o++)l+=a[o].length;for(d=new Uint8Array(l),c=0,o=0,s=a.length;o<s;o++)u=a[o],d.set(u,c),c+=u.length;return d}},i={arraySet:function(a,o,s,l,c){for(var u=0;u<l;u++)a[c+u]=o[s+u]},flattenChunks:function(a){return[].concat.apply([],a)}};e.setTyped=function(a){a?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)})(qt);var $n={},Dt={},Wr={},Lp=qt,Fp=4,jc=0,Bc=1,Up=2;function Gr(e){for(var t=e.length;--t>=0;)e[t]=0}var Hp=0,zc=1,Wp=2,Gp=3,qp=258,io=29,Dn=256,In=Dn+1+io,qr=30,ao=19,Nc=2*In+1,xr=15,oo=16,Yp=7,so=256,Mc=16,Lc=17,Fc=18,co=[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],$i=[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],Xp=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Uc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Zp=512,Yt=new Array((In+2)*2);Gr(Yt);var jn=new Array(qr*2);Gr(jn);var Bn=new Array(Zp);Gr(Bn);var zn=new Array(qp-Gp+1);Gr(zn);var lo=new Array(io);Gr(lo);var Di=new Array(qr);Gr(Di);function uo(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var Hc,Wc,Gc;function fo(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function qc(e){return e<256?Bn[e]:Bn[256+(e>>>7)]}function Nn(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function st(e,t,r){e.bi_valid>oo-r?(e.bi_buf|=t<<e.bi_valid&65535,Nn(e,e.bi_buf),e.bi_buf=t>>oo-e.bi_valid,e.bi_valid+=r-oo):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function It(e,t,r){st(e,r[t*2],r[t*2+1])}function Yc(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Vp(e){e.bi_valid===16?(Nn(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 Kp(e,t){var r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,c,u,d,p,m,g,_=0;for(p=0;p<=xr;p++)e.bl_count[p]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<Nc;c++)u=e.heap[c],p=r[r[u*2+1]*2+1]+1,p>l&&(p=l,_++),r[u*2+1]=p,!(u>n)&&(e.bl_count[p]++,m=0,u>=s&&(m=o[u-s]),g=r[u*2],e.opt_len+=g*(p+m),a&&(e.static_len+=g*(i[u*2+1]+m)));if(_!==0){do{for(p=l-1;e.bl_count[p]===0;)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[l]--,_-=2}while(_>0);for(p=l;p!==0;p--)for(u=e.bl_count[p];u!==0;)d=e.heap[--c],!(d>n)&&(r[d*2+1]!==p&&(e.opt_len+=(p-r[d*2+1])*r[d*2],r[d*2+1]=p),u--)}}function Xc(e,t,r){var n=new Array(xr+1),i=0,a,o;for(a=1;a<=xr;a++)n[a]=i=i+r[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=Yc(n[s]++,s))}}function Jp(){var e,t,r,n,i,a=new Array(xr+1);for(r=0,n=0;n<io-1;n++)for(lo[n]=r,e=0;e<1<<co[n];e++)zn[r++]=n;for(zn[r-1]=n,i=0,n=0;n<16;n++)for(Di[n]=i,e=0;e<1<<$i[n];e++)Bn[i++]=n;for(i>>=7;n<qr;n++)for(Di[n]=i<<7,e=0;e<1<<$i[n]-7;e++)Bn[256+i++]=n;for(t=0;t<=xr;t++)a[t]=0;for(e=0;e<=143;)Yt[e*2+1]=8,e++,a[8]++;for(;e<=255;)Yt[e*2+1]=9,e++,a[9]++;for(;e<=279;)Yt[e*2+1]=7,e++,a[7]++;for(;e<=287;)Yt[e*2+1]=8,e++,a[8]++;for(Xc(Yt,In+1,a),e=0;e<qr;e++)jn[e*2+1]=5,jn[e*2]=Yc(e,5);Hc=new uo(Yt,co,Dn+1,In,xr),Wc=new uo(jn,$i,0,qr,xr),Gc=new uo(new Array(0),Xp,0,ao,Yp)}function Zc(e){var t;for(t=0;t<In;t++)e.dyn_ltree[t*2]=0;for(t=0;t<qr;t++)e.dyn_dtree[t*2]=0;for(t=0;t<ao;t++)e.bl_tree[t*2]=0;e.dyn_ltree[so*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Vc(e){e.bi_valid>8?Nn(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 Qp(e,t,r,n){Vc(e),Nn(e,r),Nn(e,~r),Lp.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function Kc(e,t,r,n){var i=t*2,a=r*2;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]}function ho(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&Kc(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Kc(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function Jc(e,t,r){var n,i,a=0,o,s;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,n===0?It(e,i,t):(o=zn[i],It(e,o+Dn+1,t),s=co[o],s!==0&&(i-=lo[o],st(e,i,s)),n--,o=qc(n),It(e,o,r),s=$i[o],s!==0&&(n-=Di[o],st(e,n,s)));while(a<e.last_lit);It(e,so,t)}function po(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,l=-1,c;for(e.heap_len=0,e.heap_max=Nc,o=0;o<a;o++)r[o*2]!==0?(e.heap[++e.heap_len]=l=o,e.depth[o]=0):r[o*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=l<2?++l:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,i&&(e.static_len-=n[c*2+1]);for(t.max_code=l,o=e.heap_len>>1;o>=1;o--)ho(e,r,o);c=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ho(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[c*2]=r[o*2]+r[s*2],e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[o*2+1]=r[s*2+1]=c,e.heap[1]=c++,ho(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Kp(e,t),Xc(r,l,e.bl_count)}function Qc(e,t,r){var n,i=-1,a,o=t[0*2+1],s=0,l=7,c=4;for(o===0&&(l=138,c=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=t[(n+1)*2+1],!(++s<l&&a===o)&&(s<c?e.bl_tree[a*2]+=s:a!==0?(a!==i&&e.bl_tree[a*2]++,e.bl_tree[Mc*2]++):s<=10?e.bl_tree[Lc*2]++:e.bl_tree[Fc*2]++,s=0,i=a,o===0?(l=138,c=3):a===o?(l=6,c=3):(l=7,c=4))}function el(e,t,r){var n,i=-1,a,o=t[0*2+1],s=0,l=7,c=4;for(o===0&&(l=138,c=3),n=0;n<=r;n++)if(a=o,o=t[(n+1)*2+1],!(++s<l&&a===o)){if(s<c)do It(e,a,e.bl_tree);while(--s!==0);else a!==0?(a!==i&&(It(e,a,e.bl_tree),s--),It(e,Mc,e.bl_tree),st(e,s-3,2)):s<=10?(It(e,Lc,e.bl_tree),st(e,s-3,3)):(It(e,Fc,e.bl_tree),st(e,s-11,7));s=0,i=a,o===0?(l=138,c=3):a===o?(l=6,c=3):(l=7,c=4)}}function em(e){var t;for(Qc(e,e.dyn_ltree,e.l_desc.max_code),Qc(e,e.dyn_dtree,e.d_desc.max_code),po(e,e.bl_desc),t=ao-1;t>=3&&e.bl_tree[Uc[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function tm(e,t,r,n){var i;for(st(e,t-257,5),st(e,r-1,5),st(e,n-4,4),i=0;i<n;i++)st(e,e.bl_tree[Uc[i]*2+1],3);el(e,e.dyn_ltree,t-1),el(e,e.dyn_dtree,r-1)}function rm(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return jc;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Bc;for(r=32;r<Dn;r++)if(e.dyn_ltree[r*2]!==0)return Bc;return jc}var tl=!1;function nm(e){tl||(Jp(),tl=!0),e.l_desc=new fo(e.dyn_ltree,Hc),e.d_desc=new fo(e.dyn_dtree,Wc),e.bl_desc=new fo(e.bl_tree,Gc),e.bi_buf=0,e.bi_valid=0,Zc(e)}function rl(e,t,r,n){st(e,(Hp<<1)+(n?1:0),3),Qp(e,t,r)}function im(e){st(e,zc<<1,3),It(e,so,Yt),Vp(e)}function am(e,t,r,n){var i,a,o=0;e.level>0?(e.strm.data_type===Up&&(e.strm.data_type=rm(e)),po(e,e.l_desc),po(e,e.d_desc),o=em(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&t!==-1?rl(e,t,r,n):e.strategy===Fp||a===i?(st(e,(zc<<1)+(n?1:0),3),Jc(e,Yt,jn)):(st(e,(Wp<<1)+(n?1:0),3),tm(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Jc(e,e.dyn_ltree,e.dyn_dtree)),Zc(e),n&&Vc(e)}function om(e,t,r){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]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(zn[r]+Dn+1)*2]++,e.dyn_dtree[qc(t)*2]++),e.last_lit===e.lit_bufsize-1}Wr._tr_init=nm,Wr._tr_stored_block=rl,Wr._tr_flush_block=am,Wr._tr_tally=om,Wr._tr_align=im;function sm(e,t,r,n){for(var i=e&65535|0,a=e>>>16&65535|0,o=0;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+t[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}var nl=sm;function cm(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var lm=cm();function um(e,t,r,n){var i=lm,a=n+r;e^=-1;for(var o=n;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1}var il=um,mo={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"},tt=qt,bt=Wr,al=nl,rr=il,fm=mo,Er=0,dm=1,hm=3,nr=4,ol=5,jt=0,sl=1,_t=-2,pm=-3,wo=-5,mm=-1,wm=1,Ii=2,gm=3,ym=4,bm=0,_m=2,ji=8,vm=9,xm=15,Em=8,Sm=29,km=256,go=km+1+Sm,Rm=30,Om=19,Cm=2*go+1,Tm=15,we=3,ir=258,kt=ir+we+1,Pm=32,Bi=42,yo=69,zi=73,Ni=91,Mi=103,Sr=113,Mn=666,He=1,Ln=2,kr=3,Yr=4,Am=3;function ar(e,t){return e.msg=fm[t],t}function cl(e){return(e<<1)-(e>4?9:0)}function or(e){for(var t=e.length;--t>=0;)e[t]=0}function sr(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(tt.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function Ye(e,t){bt._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,sr(e.strm)}function _e(e,t){e.pending_buf[e.pending++]=t}function Fn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function $m(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,tt.arraySet(t,e.input,e.next_in,i,r),e.state.wrap===1?e.adler=al(e.adler,t,i,r):e.state.wrap===2&&(e.adler=rr(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function ll(e,t){var r=e.max_chain_length,n=e.strstart,i,a,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-kt?e.strstart-(e.w_size-kt):0,c=e.window,u=e.w_mask,d=e.prev,p=e.strstart+ir,m=c[n+o-1],g=c[n+o];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(c[i+o]!==g||c[i+o-1]!==m||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<p);if(a=ir-(p-n),n=p-ir,a>o){if(e.match_start=t,o=a,a>=s)break;m=c[n+o-1],g=c[n+o]}}while((t=d[t&u])>l&&--r!==0);return o<=e.lookahead?o:e.lookahead}function Rr(e){var t=e.w_size,r,n,i,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-kt)){tt.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do i=e.head[--r],e.head[r]=i>=t?i-t:0;while(--n);n=t,r=n;do i=e.prev[--r],e.prev[r]=i>=t?i-t:0;while(--n);a+=t}if(e.strm.avail_in===0)break;if(n=$m(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=n,e.lookahead+e.insert>=we)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+we-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<we)););}while(e.lookahead<kt&&e.strm.avail_in!==0)}function Dm(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Rr(e),e.lookahead===0&&t===Er)return He;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Ye(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-kt&&(Ye(e,!1),e.strm.avail_out===0))return He}return e.insert=0,t===nr?(Ye(e,!0),e.strm.avail_out===0?kr:Yr):(e.strstart>e.block_start&&(Ye(e,!1),e.strm.avail_out===0),He)}function bo(e,t){for(var r,n;;){if(e.lookahead<kt){if(Rr(e),e.lookahead<kt&&t===Er)return He;if(e.lookahead===0)break}if(r=0,e.lookahead>=we&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+we-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-kt&&(e.match_length=ll(e,r)),e.match_length>=we)if(n=bt._tr_tally(e,e.strstart-e.match_start,e.match_length-we),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=we){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+we-1])&e.hash_mask,r=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 n=bt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Ye(e,!1),e.strm.avail_out===0))return He}return e.insert=e.strstart<we-1?e.strstart:we-1,t===nr?(Ye(e,!0),e.strm.avail_out===0?kr:Yr):e.last_lit&&(Ye(e,!1),e.strm.avail_out===0)?He:Ln}function Xr(e,t){for(var r,n,i;;){if(e.lookahead<kt){if(Rr(e),e.lookahead<kt&&t===Er)return He;if(e.lookahead===0)break}if(r=0,e.lookahead>=we&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+we-1])&e.hash_mask,r=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=we-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-kt&&(e.match_length=ll(e,r),e.match_length<=5&&(e.strategy===wm||e.match_length===we&&e.strstart-e.match_start>4096)&&(e.match_length=we-1)),e.prev_length>=we&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-we,n=bt._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-we),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+we-1])&e.hash_mask,r=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=we-1,e.strstart++,n&&(Ye(e,!1),e.strm.avail_out===0))return He}else if(e.match_available){if(n=bt._tr_tally(e,0,e.window[e.strstart-1]),n&&Ye(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return He}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=bt._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<we-1?e.strstart:we-1,t===nr?(Ye(e,!0),e.strm.avail_out===0?kr:Yr):e.last_lit&&(Ye(e,!1),e.strm.avail_out===0)?He:Ln}function Im(e,t){for(var r,n,i,a,o=e.window;;){if(e.lookahead<=ir){if(Rr(e),e.lookahead<=ir&&t===Er)return He;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=we&&e.strstart>0&&(i=e.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=e.strstart+ir;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);e.match_length=ir-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=we?(r=bt._tr_tally(e,1,e.match_length-we),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=bt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Ye(e,!1),e.strm.avail_out===0))return He}return e.insert=0,t===nr?(Ye(e,!0),e.strm.avail_out===0?kr:Yr):e.last_lit&&(Ye(e,!1),e.strm.avail_out===0)?He:Ln}function jm(e,t){for(var r;;){if(e.lookahead===0&&(Rr(e),e.lookahead===0)){if(t===Er)return He;break}if(e.match_length=0,r=bt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Ye(e,!1),e.strm.avail_out===0))return He}return e.insert=0,t===nr?(Ye(e,!0),e.strm.avail_out===0?kr:Yr):e.last_lit&&(Ye(e,!1),e.strm.avail_out===0)?He:Ln}function Bt(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}var Zr;Zr=[new Bt(0,0,0,0,Dm),new Bt(4,4,8,4,bo),new Bt(4,5,16,8,bo),new Bt(4,6,32,32,bo),new Bt(4,4,16,16,Xr),new Bt(8,16,32,32,Xr),new Bt(8,16,128,128,Xr),new Bt(8,32,128,256,Xr),new Bt(32,128,258,1024,Xr),new Bt(32,258,258,4096,Xr)];function Bm(e){e.window_size=2*e.w_size,or(e.head),e.max_lazy_match=Zr[e.level].max_lazy,e.good_match=Zr[e.level].good_length,e.nice_match=Zr[e.level].nice_length,e.max_chain_length=Zr[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=we-1,e.match_available=0,e.ins_h=0}function zm(){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=ji,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 tt.Buf16(Cm*2),this.dyn_dtree=new tt.Buf16((2*Rm+1)*2),this.bl_tree=new tt.Buf16((2*Om+1)*2),or(this.dyn_ltree),or(this.dyn_dtree),or(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new tt.Buf16(Tm+1),this.heap=new tt.Buf16(2*go+1),or(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new tt.Buf16(2*go+1),or(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 ul(e){var t;return!e||!e.state?ar(e,_t):(e.total_in=e.total_out=0,e.data_type=_m,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Bi:Sr,e.adler=t.wrap===2?0:1,t.last_flush=Er,bt._tr_init(t),jt)}function fl(e){var t=ul(e);return t===jt&&Bm(e.state),t}function Nm(e,t){return!e||!e.state||e.state.wrap!==2?_t:(e.state.gzhead=t,jt)}function dl(e,t,r,n,i,a){if(!e)return _t;var o=1;if(t===mm&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>vm||r!==ji||n<8||n>15||t<0||t>9||a<0||a>ym)return ar(e,_t);n===8&&(n=9);var s=new zm;return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+we-1)/we),s.window=new tt.Buf8(s.w_size*2),s.head=new tt.Buf16(s.hash_size),s.prev=new tt.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new tt.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=a,s.method=r,fl(e)}function Mm(e,t){return dl(e,t,ji,xm,Em,bm)}function Lm(e,t){var r,n,i,a;if(!e||!e.state||t>ol||t<0)return e?ar(e,_t):_t;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===Mn&&t!==nr)return ar(e,e.avail_out===0?wo:_t);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===Bi)if(n.wrap===2)e.adler=0,_e(n,31),_e(n,139),_e(n,8),n.gzhead?(_e(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),_e(n,n.gzhead.time&255),_e(n,n.gzhead.time>>8&255),_e(n,n.gzhead.time>>16&255),_e(n,n.gzhead.time>>24&255),_e(n,n.level===9?2:n.strategy>=Ii||n.level<2?4:0),_e(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(_e(n,n.gzhead.extra.length&255),_e(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=rr(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=yo):(_e(n,0),_e(n,0),_e(n,0),_e(n,0),_e(n,0),_e(n,n.level===9?2:n.strategy>=Ii||n.level<2?4:0),_e(n,Am),n.status=Sr);else{var o=ji+(n.w_bits-8<<4)<<8,s=-1;n.strategy>=Ii||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,o|=s<<6,n.strstart!==0&&(o|=Pm),o+=31-o%31,n.status=Sr,Fn(n,o),n.strstart!==0&&(Fn(n,e.adler>>>16),Fn(n,e.adler&65535)),e.adler=1}if(n.status===yo)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=rr(e.adler,n.pending_buf,n.pending-i,i)),sr(e),i=n.pending,n.pending===n.pending_buf_size));)_e(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=rr(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=zi)}else n.status=zi;if(n.status===zi)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=rr(e.adler,n.pending_buf,n.pending-i,i)),sr(e),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}n.gzindex<n.gzhead.name.length?a=n.gzhead.name.charCodeAt(n.gzindex++)&255:a=0,_e(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=rr(e.adler,n.pending_buf,n.pending-i,i)),a===0&&(n.gzindex=0,n.status=Ni)}else n.status=Ni;if(n.status===Ni)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=rr(e.adler,n.pending_buf,n.pending-i,i)),sr(e),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}n.gzindex<n.gzhead.comment.length?a=n.gzhead.comment.charCodeAt(n.gzindex++)&255:a=0,_e(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=rr(e.adler,n.pending_buf,n.pending-i,i)),a===0&&(n.status=Mi)}else n.status=Mi;if(n.status===Mi&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&sr(e),n.pending+2<=n.pending_buf_size&&(_e(n,e.adler&255),_e(n,e.adler>>8&255),e.adler=0,n.status=Sr)):n.status=Sr),n.pending!==0){if(sr(e),e.avail_out===0)return n.last_flush=-1,jt}else if(e.avail_in===0&&cl(t)<=cl(r)&&t!==nr)return ar(e,wo);if(n.status===Mn&&e.avail_in!==0)return ar(e,wo);if(e.avail_in!==0||n.lookahead!==0||t!==Er&&n.status!==Mn){var l=n.strategy===Ii?jm(n,t):n.strategy===gm?Im(n,t):Zr[n.level].func(n,t);if((l===kr||l===Yr)&&(n.status=Mn),l===He||l===kr)return e.avail_out===0&&(n.last_flush=-1),jt;if(l===Ln&&(t===dm?bt._tr_align(n):t!==ol&&(bt._tr_stored_block(n,0,0,!1),t===hm&&(or(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),sr(e),e.avail_out===0))return n.last_flush=-1,jt}return t!==nr?jt:n.wrap<=0?sl:(n.wrap===2?(_e(n,e.adler&255),_e(n,e.adler>>8&255),_e(n,e.adler>>16&255),_e(n,e.adler>>24&255),_e(n,e.total_in&255),_e(n,e.total_in>>8&255),_e(n,e.total_in>>16&255),_e(n,e.total_in>>24&255)):(Fn(n,e.adler>>>16),Fn(n,e.adler&65535)),sr(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?jt:sl)}function Fm(e){var t;return!e||!e.state?_t:(t=e.state.status,t!==Bi&&t!==yo&&t!==zi&&t!==Ni&&t!==Mi&&t!==Sr&&t!==Mn?ar(e,_t):(e.state=null,t===Sr?ar(e,pm):jt))}function Um(e,t){var r=t.length,n,i,a,o,s,l,c,u;if(!e||!e.state||(n=e.state,o=n.wrap,o===2||o===1&&n.status!==Bi||n.lookahead))return _t;for(o===1&&(e.adler=al(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(o===0&&(or(n.head),n.strstart=0,n.block_start=0,n.insert=0),u=new tt.Buf8(n.w_size),tt.arraySet(u,t,r-n.w_size,n.w_size,0),t=u,r=n.w_size),s=e.avail_in,l=e.next_in,c=e.input,e.avail_in=r,e.next_in=0,e.input=t,Rr(n);n.lookahead>=we;){i=n.strstart,a=n.lookahead-(we-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+we-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++;while(--a);n.strstart=i,n.lookahead=we-1,Rr(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=we-1,n.match_available=0,e.next_in=l,e.input=c,e.avail_in=s,n.wrap=o,jt}Dt.deflateInit=Mm,Dt.deflateInit2=dl,Dt.deflateReset=fl,Dt.deflateResetKeep=ul,Dt.deflateSetHeader=Nm,Dt.deflate=Lm,Dt.deflateEnd=Fm,Dt.deflateSetDictionary=Um,Dt.deflateInfo="pako deflate (from Nodeca project)";var Or={},Li=qt,hl=!0,pl=!0;try{String.fromCharCode.apply(null,[0])}catch{hl=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{pl=!1}for(var Un=new Li.Buf8(256),cr=0;cr<256;cr++)Un[cr]=cr>=252?6:cr>=248?5:cr>=240?4:cr>=224?3:cr>=192?2:1;Un[254]=Un[254]=1,Or.string2buf=function(e){var t,r,n,i,a,o=e.length,s=0;for(i=0;i<o;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Li.Buf8(s),a=0,i=0;a<s;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|r&63):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63);return t};function ml(e,t){if(t<65534&&(e.subarray&&pl||!e.subarray&&hl))return String.fromCharCode.apply(null,Li.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}Or.buf2binstring=function(e){return ml(e,e.length)},Or.binstring2buf=function(e){for(var t=new Li.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},Or.buf2string=function(e,t){var r,n,i,a,o=t||e.length,s=new Array(o*2);for(n=0,r=0;r<o;){if(i=e[r++],i<128){s[n++]=i;continue}if(a=Un[i],a>4){s[n++]=65533,r+=a-1;continue}for(i&=a===2?31:a===3?15:7;a>1&&r<o;)i=i<<6|e[r++]&63,a--;if(a>1){s[n++]=65533;continue}i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|i&1023)}return ml(s,n)},Or.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+Un[e[r]]>t?r:t};function Hm(){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 wl=Hm,Hn=Dt,Wn=qt,_o=Or,vo=mo,Wm=wl,gl=Object.prototype.toString,Gm=0,xo=4,Vr=0,yl=1,bl=2,qm=-1,Ym=0,Xm=8;function Cr(e){if(!(this instanceof Cr))return new Cr(e);this.options=Wn.assign({level:qm,method:Xm,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ym,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 Wm,this.strm.avail_out=0;var r=Hn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Vr)throw new Error(vo[r]);if(t.header&&Hn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=_o.string2buf(t.dictionary):gl.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=Hn.deflateSetDictionary(this.strm,n),r!==Vr)throw new Error(vo[r]);this._dict_set=!0}}Cr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;a=t===~~t?t:t===!0?xo:Gm,typeof e=="string"?r.input=_o.string2buf(e):gl.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Wn.Buf8(n),r.next_out=0,r.avail_out=n),i=Hn.deflate(r,a),i!==yl&&i!==Vr)return this.onEnd(i),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(a===xo||a===bl))&&(this.options.to==="string"?this.onData(_o.buf2binstring(Wn.shrinkBuf(r.output,r.next_out))):this.onData(Wn.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&i!==yl);return a===xo?(i=Hn.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Vr):(a===bl&&(this.onEnd(Vr),r.avail_out=0),!0)},Cr.prototype.onData=function(e){this.chunks.push(e)},Cr.prototype.onEnd=function(e){e===Vr&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Wn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Eo(e,t){var r=new Cr(t);if(r.push(e,!0),r.err)throw r.msg||vo[r.err];return r.result}function Zm(e,t){return t=t||{},t.raw=!0,Eo(e,t)}function Vm(e,t){return t=t||{},t.gzip=!0,Eo(e,t)}$n.Deflate=Cr,$n.deflate=Eo,$n.deflateRaw=Zm,$n.gzip=Vm;var Gn={},Rt={},Fi=30,Km=12,Jm=function(t,r){var n,i,a,o,s,l,c,u,d,p,m,g,_,x,y,v,O,R,b,C,k,S,P,$,B;n=t.state,i=t.next_in,$=t.input,a=i+(t.avail_in-5),o=t.next_out,B=t.output,s=o-(r-t.avail_out),l=o+(t.avail_out-257),c=n.dmax,u=n.wsize,d=n.whave,p=n.wnext,m=n.window,g=n.hold,_=n.bits,x=n.lencode,y=n.distcode,v=(1<<n.lenbits)-1,O=(1<<n.distbits)-1;e:do{_<15&&(g+=$[i++]<<_,_+=8,g+=$[i++]<<_,_+=8),R=x[g&v];t:for(;;){if(b=R>>>24,g>>>=b,_-=b,b=R>>>16&255,b===0)B[o++]=R&65535;else if(b&16){C=R&65535,b&=15,b&&(_<b&&(g+=$[i++]<<_,_+=8),C+=g&(1<<b)-1,g>>>=b,_-=b),_<15&&(g+=$[i++]<<_,_+=8,g+=$[i++]<<_,_+=8),R=y[g&O];r:for(;;){if(b=R>>>24,g>>>=b,_-=b,b=R>>>16&255,b&16){if(k=R&65535,b&=15,_<b&&(g+=$[i++]<<_,_+=8,_<b&&(g+=$[i++]<<_,_+=8)),k+=g&(1<<b)-1,k>c){t.msg="invalid distance too far back",n.mode=Fi;break e}if(g>>>=b,_-=b,b=o-s,k>b){if(b=k-b,b>d&&n.sane){t.msg="invalid distance too far back",n.mode=Fi;break e}if(S=0,P=m,p===0){if(S+=u-b,b<C){C-=b;do B[o++]=m[S++];while(--b);S=o-k,P=B}}else if(p<b){if(S+=u+p-b,b-=p,b<C){C-=b;do B[o++]=m[S++];while(--b);if(S=0,p<C){b=p,C-=b;do B[o++]=m[S++];while(--b);S=o-k,P=B}}}else if(S+=p-b,b<C){C-=b;do B[o++]=m[S++];while(--b);S=o-k,P=B}for(;C>2;)B[o++]=P[S++],B[o++]=P[S++],B[o++]=P[S++],C-=3;C&&(B[o++]=P[S++],C>1&&(B[o++]=P[S++]))}else{S=o-k;do B[o++]=B[S++],B[o++]=B[S++],B[o++]=B[S++],C-=3;while(C>2);C&&(B[o++]=B[S++],C>1&&(B[o++]=B[S++]))}}else if(b&64){t.msg="invalid distance code",n.mode=Fi;break e}else{R=y[(R&65535)+(g&(1<<b)-1)];continue r}break}}else if(b&64)if(b&32){n.mode=Km;break e}else{t.msg="invalid literal/length code",n.mode=Fi;break e}else{R=x[(R&65535)+(g&(1<<b)-1)];continue t}break}}while(i<a&&o<l);C=_>>3,i-=C,_-=C<<3,g&=(1<<_)-1,t.next_in=i,t.next_out=o,t.avail_in=i<a?5+(a-i):5-(i-a),t.avail_out=o<l?257+(l-o):257-(o-l),n.hold=g,n.bits=_},_l=qt,Kr=15,vl=852,xl=592,El=0,So=1,Sl=2,Qm=[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],e0=[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],t0=[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],r0=[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],n0=function(t,r,n,i,a,o,s,l){var c=l.bits,u=0,d=0,p=0,m=0,g=0,_=0,x=0,y=0,v=0,O=0,R,b,C,k,S,P=null,$=0,B,M=new _l.Buf16(Kr+1),H=new _l.Buf16(Kr+1),Y=null,ue=0,Te,me,ge;for(u=0;u<=Kr;u++)M[u]=0;for(d=0;d<i;d++)M[r[n+d]]++;for(g=c,m=Kr;m>=1&&M[m]===0;m--);if(g>m&&(g=m),m===0)return a[o++]=1<<24|64<<16|0,a[o++]=1<<24|64<<16|0,l.bits=1,0;for(p=1;p<m&&M[p]===0;p++);for(g<p&&(g=p),y=1,u=1;u<=Kr;u++)if(y<<=1,y-=M[u],y<0)return-1;if(y>0&&(t===El||m!==1))return-1;for(H[1]=0,u=1;u<Kr;u++)H[u+1]=H[u]+M[u];for(d=0;d<i;d++)r[n+d]!==0&&(s[H[r[n+d]]++]=d);if(t===El?(P=Y=s,B=19):t===So?(P=Qm,$-=257,Y=e0,ue-=257,B=256):(P=t0,Y=r0,B=-1),O=0,d=0,u=p,S=o,_=g,x=0,C=-1,v=1<<g,k=v-1,t===So&&v>vl||t===Sl&&v>xl)return 1;for(;;){Te=u-x,s[d]<B?(me=0,ge=s[d]):s[d]>B?(me=Y[ue+s[d]],ge=P[$+s[d]]):(me=96,ge=0),R=1<<u-x,b=1<<_,p=b;do b-=R,a[S+(O>>x)+b]=Te<<24|me<<16|ge|0;while(b!==0);for(R=1<<u-1;O&R;)R>>=1;if(R!==0?(O&=R-1,O+=R):O=0,d++,--M[u]===0){if(u===m)break;u=r[n+s[d]]}if(u>g&&(O&k)!==C){for(x===0&&(x=g),S+=p,_=u-x,y=1<<_;_+x<m&&(y-=M[_+x],!(y<=0));)_++,y<<=1;if(v+=1<<_,t===So&&v>vl||t===Sl&&v>xl)return 1;C=O&k,a[C]=g<<24|_<<16|S-o|0}}return O!==0&&(a[S+O]=u-x<<24|64<<16|0),l.bits=g,0},pt=qt,ko=nl,zt=il,i0=Jm,qn=n0,a0=0,kl=1,Rl=2,Ol=4,o0=5,Ui=6,Tr=0,s0=1,c0=2,vt=-2,Cl=-3,Tl=-4,l0=-5,Pl=8,Al=1,$l=2,Dl=3,Il=4,jl=5,Bl=6,zl=7,Nl=8,Ml=9,Ll=10,Hi=11,Xt=12,Ro=13,Fl=14,Oo=15,Ul=16,Hl=17,Wl=18,Gl=19,Wi=20,Gi=21,ql=22,Yl=23,Xl=24,Zl=25,Vl=26,Co=27,Kl=28,Jl=29,$e=30,Ql=31,u0=32,f0=852,d0=592,h0=15,p0=h0;function eu(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function m0(){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 pt.Buf16(320),this.work=new pt.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function tu(e){var t;return!e||!e.state?vt:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Al,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new pt.Buf32(f0),t.distcode=t.distdyn=new pt.Buf32(d0),t.sane=1,t.back=-1,Tr)}function ru(e){var t;return!e||!e.state?vt:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,tu(e))}function nu(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?vt:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ru(e))}function iu(e,t){var r,n;return e?(n=new m0,e.state=n,n.window=null,r=nu(e,t),r!==Tr&&(e.state=null),r):vt}function w0(e){return iu(e,p0)}var au=!0,To,Po;function g0(e){if(au){var t;for(To=new pt.Buf32(512),Po=new pt.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(qn(kl,e.lens,0,288,To,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;qn(Rl,e.lens,0,32,Po,0,e.work,{bits:5}),au=!1}e.lencode=To,e.lenbits=9,e.distcode=Po,e.distbits=5}function ou(e,t,r,n){var i,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new pt.Buf8(a.wsize)),n>=a.wsize?(pt.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),pt.arraySet(a.window,t,r-n,i,a.wnext),n-=i,n?(pt.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0}function y0(e,t){var r,n,i,a,o,s,l,c,u,d,p,m,g,_,x=0,y,v,O,R,b,C,k,S,P=new pt.Buf8(4),$,B,M=[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 vt;r=e.state,r.mode===Xt&&(r.mode=Ro),o=e.next_out,i=e.output,l=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,d=s,p=l,S=Tr;e:for(;;)switch(r.mode){case Al:if(r.wrap===0){r.mode=Ro;break}for(;u<16;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(r.wrap&2&&c===35615){r.check=0,P[0]=c&255,P[1]=c>>>8&255,r.check=zt(r.check,P,2,0),c=0,u=0,r.mode=$l;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=$e;break}if((c&15)!==Pl){e.msg="unknown compression method",r.mode=$e;break}if(c>>>=4,u-=4,k=(c&15)+8,r.wbits===0)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=$e;break}r.dmax=1<<k,e.adler=r.check=1,r.mode=c&512?Ll:Xt,c=0,u=0;break;case $l:for(;u<16;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(r.flags=c,(r.flags&255)!==Pl){e.msg="unknown compression method",r.mode=$e;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=$e;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(P[0]=c&255,P[1]=c>>>8&255,r.check=zt(r.check,P,2,0)),c=0,u=0,r.mode=Dl;case Dl:for(;u<32;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}r.head&&(r.head.time=c),r.flags&512&&(P[0]=c&255,P[1]=c>>>8&255,P[2]=c>>>16&255,P[3]=c>>>24&255,r.check=zt(r.check,P,4,0)),c=0,u=0,r.mode=Il;case Il:for(;u<16;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(P[0]=c&255,P[1]=c>>>8&255,r.check=zt(r.check,P,2,0)),c=0,u=0,r.mode=jl;case jl:if(r.flags&1024){for(;u<16;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(P[0]=c&255,P[1]=c>>>8&255,r.check=zt(r.check,P,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=Bl;case Bl:if(r.flags&1024&&(m=r.length,m>s&&(m=s),m&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),pt.arraySet(r.head.extra,n,a,m,k)),r.flags&512&&(r.check=zt(r.check,n,m,a)),s-=m,a+=m,r.length-=m),r.length))break e;r.length=0,r.mode=zl;case zl:if(r.flags&2048){if(s===0)break e;m=0;do k=n[a+m++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k));while(k&&m<s);if(r.flags&512&&(r.check=zt(r.check,n,m,a)),s-=m,a+=m,k)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Nl;case Nl:if(r.flags&4096){if(s===0)break e;m=0;do k=n[a+m++],r.head&&k&&r.length<65536&&(r.head.comment+=String.fromCharCode(k));while(k&&m<s);if(r.flags&512&&(r.check=zt(r.check,n,m,a)),s-=m,a+=m,k)break e}else r.head&&(r.head.comment=null);r.mode=Ml;case Ml:if(r.flags&512){for(;u<16;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=$e;break}c=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Xt;break;case Ll:for(;u<32;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}e.adler=r.check=eu(c),c=0,u=0,r.mode=Hi;case Hi:if(r.havedict===0)return e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,r.hold=c,r.bits=u,c0;e.adler=r.check=1,r.mode=Xt;case Xt:if(t===o0||t===Ui)break e;case Ro:if(r.last){c>>>=u&7,u-=u&7,r.mode=Co;break}for(;u<3;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}switch(r.last=c&1,c>>>=1,u-=1,c&3){case 0:r.mode=Fl;break;case 1:if(g0(r),r.mode=Wi,t===Ui){c>>>=2,u-=2;break e}break;case 2:r.mode=Hl;break;case 3:e.msg="invalid block type",r.mode=$e}c>>>=2,u-=2;break;case Fl:for(c>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=$e;break}if(r.length=c&65535,c=0,u=0,r.mode=Oo,t===Ui)break e;case Oo:r.mode=Ul;case Ul:if(m=r.length,m){if(m>s&&(m=s),m>l&&(m=l),m===0)break e;pt.arraySet(i,n,a,m,o),s-=m,a+=m,l-=m,o+=m,r.length-=m;break}r.mode=Xt;break;case Hl:for(;u<14;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(r.nlen=(c&31)+257,c>>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=$e;break}r.have=0,r.mode=Wl;case Wl:for(;r.have<r.ncode;){for(;u<3;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}r.lens[M[r.have++]]=c&7,c>>>=3,u-=3}for(;r.have<19;)r.lens[M[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,$={bits:r.lenbits},S=qn(a0,r.lens,0,19,r.lencode,0,r.work,$),r.lenbits=$.bits,S){e.msg="invalid code lengths set",r.mode=$e;break}r.have=0,r.mode=Gl;case Gl:for(;r.have<r.nlen+r.ndist;){for(;x=r.lencode[c&(1<<r.lenbits)-1],y=x>>>24,v=x>>>16&255,O=x&65535,!(y<=u);){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(O<16)c>>>=y,u-=y,r.lens[r.have++]=O;else{if(O===16){for(B=y+2;u<B;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(c>>>=y,u-=y,r.have===0){e.msg="invalid bit length repeat",r.mode=$e;break}k=r.lens[r.have-1],m=3+(c&3),c>>>=2,u-=2}else if(O===17){for(B=y+3;u<B;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}c>>>=y,u-=y,k=0,m=3+(c&7),c>>>=3,u-=3}else{for(B=y+7;u<B;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}c>>>=y,u-=y,k=0,m=11+(c&127),c>>>=7,u-=7}if(r.have+m>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=$e;break}for(;m--;)r.lens[r.have++]=k}}if(r.mode===$e)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=$e;break}if(r.lenbits=9,$={bits:r.lenbits},S=qn(kl,r.lens,0,r.nlen,r.lencode,0,r.work,$),r.lenbits=$.bits,S){e.msg="invalid literal/lengths set",r.mode=$e;break}if(r.distbits=6,r.distcode=r.distdyn,$={bits:r.distbits},S=qn(Rl,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,$),r.distbits=$.bits,S){e.msg="invalid distances set",r.mode=$e;break}if(r.mode=Wi,t===Ui)break e;case Wi:r.mode=Gi;case Gi:if(s>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,r.hold=c,r.bits=u,i0(e,p),o=e.next_out,i=e.output,l=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,r.mode===Xt&&(r.back=-1);break}for(r.back=0;x=r.lencode[c&(1<<r.lenbits)-1],y=x>>>24,v=x>>>16&255,O=x&65535,!(y<=u);){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(v&&!(v&240)){for(R=y,b=v,C=O;x=r.lencode[C+((c&(1<<R+b)-1)>>R)],y=x>>>24,v=x>>>16&255,O=x&65535,!(R+y<=u);){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}c>>>=R,u-=R,r.back+=R}if(c>>>=y,u-=y,r.back+=y,r.length=O,v===0){r.mode=Vl;break}if(v&32){r.back=-1,r.mode=Xt;break}if(v&64){e.msg="invalid literal/length code",r.mode=$e;break}r.extra=v&15,r.mode=ql;case ql:if(r.extra){for(B=r.extra;u<B;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Yl;case Yl:for(;x=r.distcode[c&(1<<r.distbits)-1],y=x>>>24,v=x>>>16&255,O=x&65535,!(y<=u);){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(!(v&240)){for(R=y,b=v,C=O;x=r.distcode[C+((c&(1<<R+b)-1)>>R)],y=x>>>24,v=x>>>16&255,O=x&65535,!(R+y<=u);){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}c>>>=R,u-=R,r.back+=R}if(c>>>=y,u-=y,r.back+=y,v&64){e.msg="invalid distance code",r.mode=$e;break}r.offset=O,r.extra=v&15,r.mode=Xl;case Xl:if(r.extra){for(B=r.extra;u<B;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=$e;break}r.mode=Zl;case Zl:if(l===0)break e;if(m=p-l,r.offset>m){if(m=r.offset-m,m>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=$e;break}m>r.wnext?(m-=r.wnext,g=r.wsize-m):g=r.wnext-m,m>r.length&&(m=r.length),_=r.window}else _=i,g=o-r.offset,m=r.length;m>l&&(m=l),l-=m,r.length-=m;do i[o++]=_[g++];while(--m);r.length===0&&(r.mode=Gi);break;case Vl:if(l===0)break e;i[o++]=r.length,l--,r.mode=Gi;break;case Co:if(r.wrap){for(;u<32;){if(s===0)break e;s--,c|=n[a++]<<u,u+=8}if(p-=l,e.total_out+=p,r.total+=p,p&&(e.adler=r.check=r.flags?zt(r.check,i,p,o-p):ko(r.check,i,p,o-p)),p=l,(r.flags?c:eu(c))!==r.check){e.msg="incorrect data check",r.mode=$e;break}c=0,u=0}r.mode=Kl;case Kl:if(r.wrap&&r.flags){for(;u<32;){if(s===0)break e;s--,c+=n[a++]<<u,u+=8}if(c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=$e;break}c=0,u=0}r.mode=Jl;case Jl:S=s0;break e;case $e:S=Cl;break e;case Ql:return Tl;case u0:default:return vt}return e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,r.hold=c,r.bits=u,(r.wsize||p!==e.avail_out&&r.mode<$e&&(r.mode<Co||t!==Ol))&&ou(e,e.output,e.next_out,p-e.avail_out),d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,r.total+=p,r.wrap&&p&&(e.adler=r.check=r.flags?zt(r.check,i,p,e.next_out-p):ko(r.check,i,p,e.next_out-p)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Xt?128:0)+(r.mode===Wi||r.mode===Oo?256:0),(d===0&&p===0||t===Ol)&&S===Tr&&(S=l0),S}function b0(e){if(!e||!e.state)return vt;var t=e.state;return t.window&&(t.window=null),e.state=null,Tr}function _0(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?vt:(r.head=t,t.done=!1,Tr)}function v0(e,t){var r=t.length,n,i,a;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==Hi)?vt:n.mode===Hi&&(i=1,i=ko(i,t,r,0),i!==n.check)?Cl:(a=ou(e,t,r,r),a?(n.mode=Ql,Tl):(n.havedict=1,Tr))}Rt.inflateReset=ru,Rt.inflateReset2=nu,Rt.inflateResetKeep=tu,Rt.inflateInit=w0,Rt.inflateInit2=iu,Rt.inflate=y0,Rt.inflateEnd=b0,Rt.inflateGetHeader=_0,Rt.inflateSetDictionary=v0,Rt.inflateInfo="pako inflate (from Nodeca project)";var su={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 x0(){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 E0=x0,Jr=Rt,Yn=qt,qi=Or,Me=su,Ao=mo,S0=wl,k0=E0,cu=Object.prototype.toString;function Pr(e){if(!(this instanceof Pr))return new Pr(e);this.options=Yn.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 S0,this.strm.avail_out=0;var r=Jr.inflateInit2(this.strm,t.windowBits);if(r!==Me.Z_OK)throw new Error(Ao[r]);if(this.header=new k0,Jr.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=qi.string2buf(t.dictionary):cu.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Jr.inflateSetDictionary(this.strm,t.dictionary),r!==Me.Z_OK)))throw new Error(Ao[r])}Pr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,o,s,l,c,u=!1;if(this.ended)return!1;o=t===~~t?t:t===!0?Me.Z_FINISH:Me.Z_NO_FLUSH,typeof e=="string"?r.input=qi.binstring2buf(e):cu.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Yn.Buf8(n),r.next_out=0,r.avail_out=n),a=Jr.inflate(r,Me.Z_NO_FLUSH),a===Me.Z_NEED_DICT&&i&&(a=Jr.inflateSetDictionary(this.strm,i)),a===Me.Z_BUF_ERROR&&u===!0&&(a=Me.Z_OK,u=!1),a!==Me.Z_STREAM_END&&a!==Me.Z_OK)return this.onEnd(a),this.ended=!0,!1;r.next_out&&(r.avail_out===0||a===Me.Z_STREAM_END||r.avail_in===0&&(o===Me.Z_FINISH||o===Me.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=qi.utf8border(r.output,r.next_out),l=r.next_out-s,c=qi.buf2string(r.output,s),r.next_out=l,r.avail_out=n-l,l&&Yn.arraySet(r.output,r.output,s,l,0),this.onData(c)):this.onData(Yn.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(u=!0)}while((r.avail_in>0||r.avail_out===0)&&a!==Me.Z_STREAM_END);return a===Me.Z_STREAM_END&&(o=Me.Z_FINISH),o===Me.Z_FINISH?(a=Jr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Me.Z_OK):(o===Me.Z_SYNC_FLUSH&&(this.onEnd(Me.Z_OK),r.avail_out=0),!0)},Pr.prototype.onData=function(e){this.chunks.push(e)},Pr.prototype.onEnd=function(e){e===Me.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Yn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function $o(e,t){var r=new Pr(t);if(r.push(e,!0),r.err)throw r.msg||Ao[r.err];return r.result}function R0(e,t){return t=t||{},t.raw=!0,$o(e,t)}Gn.Inflate=Pr,Gn.inflate=$o,Gn.inflateRaw=R0,Gn.ungzip=$o;var O0=qt.assign,C0=$n,T0=Gn,P0=su,lu={};O0(lu,C0,T0,P0);var A0=lu;const Do=St(A0),uu=(e,t)=>function(...r){const n=t.promiseModule;return new n((i,a)=>{t.multiArgs?r.push((...o)=>{t.errorFirst?o[0]?a(o):(o.shift(),i(o)):i(o)}):t.errorFirst?r.push((o,s)=>{o?a(o):i(s)}):r.push(i),e.apply(this,r)})};var $0=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=a=>{const o=s=>typeof s=="string"?a===s:s.test(a);return t.include?t.include.some(o):!t.exclude.some(o)};let i;r==="function"?i=function(...a){return t.excludeMain?e(...a):uu(e,t).apply(this,a)}:i=Object.create(Object.getPrototypeOf(e));for(const a in e){const o=e[a];i[a]=typeof o=="function"&&n(a)?uu(o,t):o}return i};const Io=St($0);function fu(e){return Array.isArray(e)?e:[e]}const jo="",du=" ",Bo="\\",D0=/^\s+$/,I0=/(?:[^\\]|^)\\$/,j0=/^\\!/,B0=/^\\#/,z0=/\r?\n/g,N0=/^\.*\/|^\.+$/,zo="/";let hu="node-ignore";typeof Symbol<"u"&&(hu=Symbol.for("node-ignore"));const pu=hu,M0=(e,t,r)=>Object.defineProperty(e,t,{value:r}),L0=/([0-z])-([0-z])/g,mu=()=>!1,F0=e=>e.replace(L0,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:jo),U0=e=>{const{length:t}=e;return e.slice(0,t-t%2)},H0=[[/^\uFEFF/,()=>jo],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?du:jo)],[/(\\+?)\s/g,(e,t)=>{const{length:r}=t;return t.slice(0,r-r%2)+du}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,r)=>{const n=r.replace(/\\\*/g,"[^\\/]*");return t+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Bo],[/\\\\/g,()=>Bo],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,i)=>t===Bo?`\\[${r}${U0(n)}${i}`:i==="]"&&n.length%2===0?`[${F0(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`]],wu=Object.create(null),W0=(e,t)=>{let r=wu[e];return r||(r=H0.reduce((n,[i,a])=>n.replace(i,a.bind(e)),e),wu[e]=r),t?new RegExp(r,"i"):new RegExp(r)},No=e=>typeof e=="string",G0=e=>e&&No(e)&&!D0.test(e)&&!I0.test(e)&&e.indexOf("#")!==0,q0=e=>e.split(z0);class Y0{constructor(t,r,n,i){this.origin=t,this.pattern=r,this.negative=n,this.regex=i}}const X0=(e,t)=>{const r=e;let n=!1;e.indexOf("!")===0&&(n=!0,e=e.substr(1)),e=e.replace(j0,"!").replace(B0,"#");const i=W0(e,t);return new Y0(r,e,n,i)},Z0=(e,t)=>{throw new t(e)},Zt=(e,t,r)=>No(e)?e?Zt.isNotRelative(e)?r(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${t}\``,TypeError),gu=e=>N0.test(e);Zt.isNotRelative=gu,Zt.convert=e=>e;class V0{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){M0(this,pu,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[pu]){this._rules=this._rules.concat(t._rules),this._added=!0;return}if(G0(t)){const r=X0(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,fu(No(t)?q0(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,r){let n=!1,i=!1;return this._rules.forEach(a=>{const{negative:o}=a;if(i===o&&n!==i||o&&!n&&!i&&!r)return;a.regex.test(t)&&(n=!o,i=o)}),{ignored:n,unignored:i}}_test(t,r,n,i){const a=t&&Zt.convert(t);return Zt(a,t,this._allowRelativePaths?mu:Z0),this._t(a,r,n,i)}_t(t,r,n,i){if(t in r)return r[t];if(i||(i=t.split(zo)),i.pop(),!i.length)return r[t]=this._testOne(t,n);const a=this._t(i.join(zo)+zo,r,n,i);return r[t]=a.ignored?a:this._testOne(t,n)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return fu(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}}const Yi=e=>new V0(e),K0=e=>Zt(e&&Zt.convert(e),e,mu);Yi.isPathValid=K0,Yi.default=Yi;var J0=Yi;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){const e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Zt.convert=e;const t=/^[a-z]:\//i;Zt.isNotRelative=r=>t.test(r)||gu(r)}const Q0=St(J0);function ew(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Nt(e,t,r){return t=t instanceof RegExp?t:new RegExp(ew(t),"g"),e.replace(t,r)}var tw={clean:function(t){if(typeof t!="string")throw new Error("Expected a string, received: "+t);return t=Nt(t,"./","/"),t=Nt(t,"..","."),t=Nt(t," ","-"),t=Nt(t,/^[~^:?*\\\-]/g,""),t=Nt(t,/[~^:?*\\]/g,"-"),t=Nt(t,/[~^:?*\\\-]$/g,""),t=Nt(t,"@{","-"),t=Nt(t,/\.$/g,""),t=Nt(t,/\/$/g,""),t=Nt(t,/\.lock$/g,""),t}},rw=tw;const Mt=St(rw);var nw=function(e,t){var r=e,n=t,i=r.length,a=n.length,o=!1,s=null,l=i+1,c=[],u=[],d=[],p="",m=-1,g=0,_=1,x,y,v=function(){i>=a&&(x=r,y=i,r=n,n=x,i=a,a=y,o=!0,l=i+1)},O=function(k,S,P){return{x:k,y:S,k:P}},R=function(k,S){return{elem:k,t:S}},b=function(k,S,P){var $,B,M;for(S>P?$=c[k-1+l]:$=c[k+1+l],M=Math.max(S,P),B=M-k;B<i&&M<a&&r[B]===n[M];)++B,++M;return c[k+l]=u.length,u[u.length]=new O(B,M,$),M},C=function(k){var S,P,$;for(S=P=0,$=k.length-1;$>=0;--$)for(;S<k[$].x||P<k[$].y;)k[$].y-k[$].x>P-S?(o?d[d.length]=new R(n[P],m):d[d.length]=new R(n[P],_),++P):k[$].y-k[$].x<P-S?(o?d[d.length]=new R(r[S],_):d[d.length]=new R(r[S],m),++S):(d[d.length]=new R(r[S],g),p+=r[S],++S,++P)};return v(),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:function(){return s},getlcs:function(){return p},getses:function(){return d},compose:function(){var k,S,P,$,B,M,H,Y;for(k=a-i,S=i+a+3,P={},H=0;H<S;++H)P[H]=-1,c[H]=-1;$=-1;do{for(++$,Y=-$;Y<=k-1;++Y)P[Y+l]=b(Y,P[Y-1+l]+1,P[Y+1+l]);for(Y=k+$;Y>=k+1;--Y)P[Y+l]=b(Y,P[Y-1+l]+1,P[Y+1+l]);P[k+l]=b(k,P[k-1+l]+1,P[k+1+l])}while(P[k+l]!==a);for(s=k+2*$,B=c[k+l],M=[];B!==-1;)M[M.length]=new O(u[B].x,u[B].y,null),B=u[B].k;C(M)}}},iw=nw;function aw(e,t){var r=new iw(e,t);r.compose();for(var n=r.getses(),i,a,o=e.length-1,s=t.length-1,l=n.length-1;l>=0;--l)n[l].t===r.SES_COMMON?(a?(a.chain={file1index:o,file2index:s,chain:null},a=a.chain):(i={file1index:o,file2index:s,chain:null},a=i),o--,s--):n[l].t===r.SES_DELETE?o--:n[l].t===r.SES_ADD&&s--;var c={file1index:-1,file2index:-1,chain:null};return a?(a.chain=c,i):c}function yu(e,t){for(var r=[],n=e.length,i=t.length,a=aw(e,t);a!==null;a=a.chain){var o=n-a.file1index-1,s=i-a.file2index-1;n=a.file1index,i=a.file2index,(o||s)&&r.push({file1:[n+1,o],file2:[i+1,s]})}return r.reverse(),r}function ow(e,t,r){var n,i=yu(t,e),a=yu(t,r),o=[];function s(H,Y){o.push([H.file1[0],Y,H.file1[1],H.file2[0],H.file2[1]])}for(n=0;n<i.length;n++)s(i[n],0);for(n=0;n<a.length;n++)s(a[n],2);o.sort(function(H,Y){return H[0]-Y[0]});var l=[],c=0;function u(H){H>c&&(l.push([1,c,H-c]),c=H)}for(var d=0;d<o.length;d++){for(var p=d,m=o[d],g=m[0],_=g+m[2];d<o.length-1;){var x=o[d+1],y=x[0];if(y>_)break;_=Math.max(_,y+x[2]),d++}if(u(g),p==d)m[4]>0&&l.push([m[1],m[3],m[4]]);else{var v={0:[e.length,-1,t.length,-1],2:[r.length,-1,t.length,-1]};for(n=p;n<=d;n++){m=o[n];var O=m[1],R=v[O],b=m[0],C=b+m[2],k=m[3],S=k+m[4];R[0]=Math.min(k,R[0]),R[1]=Math.max(S,R[1]),R[2]=Math.min(b,R[2]),R[3]=Math.max(C,R[3])}var P=v[0][0]+(g-v[0][2]),$=v[0][1]+(_-v[0][3]),B=v[2][0]+(g-v[2][2]),M=v[2][1]+(_-v[2][3]);l.push([-1,P,$-P,g,_-g,B,M-B])}c=_}return u(t.length),l}function sw(e,t,r){var n=[],i=[e,t,r],a=ow(e,t,r),o=[];function s(){o.length&&n.push({ok:o}),o=[]}function l(m){for(var g=0;g<m.length;g++)o.push(m[g])}function c(m){if(m[2]!=m[6])return!0;for(var g=m[1],_=m[5],x=0;x<m[2];x++)if(e[x+g]!=r[x+_])return!0;return!1}for(var u=0;u<a.length;u++){var d=a[u],p=d[0];p==-1?c(d)?(s(),n.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:r.slice(d[5],d[5]+d[6]),bIndex:d[5]}})):l(i[0].slice(d[1],d[1]+d[2])):l(i[p].slice(d[1],d[1]+d[2]))}return s(),n}var cw=sw;const lw=St(cw);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 r=new ye(t.message);return r.code=t.code,r.data=t.data,r.caller=t.caller,r.stack=t.stack,r}get isIsomorphicGitError(){return!0}}class Xn 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=Xn.code,this.data={filepaths:t}}}Xn.code="UnmergedPathsError";class ce 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=ce.code,this.data={message:t}}}ce.code="InternalError";class Qr extends ye{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=Qr.code,this.data={filepath:t}}}Qr.code="UnsafeFilepathError";class Lt{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 r=this.buffer.slice(this._start,this._start+t);return this._start+=t,r}toString(t,r){const n=this.buffer.toString(t,this._start,this._start+r);return this._start+=r,n}write(t,r,n){const i=this.buffer.write(t,this._start,r,n);return this._start+=r,i}copy(t,r,n){const i=t.copy(this.buffer,this._start,r,n);return this._start+=i,i}readUInt8(){const t=this.buffer.readUInt8(this._start);return this._start+=1,t}writeUInt8(t){const r=this.buffer.writeUInt8(t,this._start);return this._start+=1,r}readUInt16BE(){const t=this.buffer.readUInt16BE(this._start);return this._start+=2,t}writeUInt16BE(t){const r=this.buffer.writeUInt16BE(t,this._start);return this._start+=2,r}readUInt32BE(){const t=this.buffer.readUInt32BE(this._start);return this._start+=4,t}writeUInt32BE(t){const r=this.buffer.writeUInt32BE(t,this._start);return this._start+=4,r}}function Xi(e,t){return-(e<t)||+(e>t)}function bu(e,t){return Xi(e.path,t.path)}function _u(e){let t=e>0?e>>12:0;t!==4&&t!==8&&t!==10&&t!==14&&(t=8);let r=e&511;return r&73?r=493:r=420,t!==8&&(r=0),(t<<12)+r}const Ft=2**32;function vu(e,t,r,n){if(e!==void 0&&t!==void 0)return[e,t];r===void 0&&(r=n.valueOf());const i=Math.floor(r/1e3),a=(r-i*1e3)*1e6;return[i,a]}function en(e){const[t,r]=vu(e.ctimeSeconds,e.ctimeNanoseconds,e.ctimeMs,e.ctime),[n,i]=vu(e.mtimeSeconds,e.mtimeNanoseconds,e.mtimeMs,e.mtime);return{ctimeSeconds:t%Ft,ctimeNanoseconds:r%Ft,mtimeSeconds:n%Ft,mtimeNanoseconds:i%Ft,dev:e.dev%Ft,ino:e.ino%Ft,mode:_u(e.mode%Ft),uid:e.uid%Ft,gid:e.gid%Ft,size:e.size>-1?e.size%Ft:0}}function uw(e){let t="";for(const r of new Uint8Array(e))r<16&&(t+="0"),t+=r.toString(16);return t}let Mo=null;async function Vt(e){return Mo===null&&(Mo=await dw()),Mo?xu(e):fw(e)}function fw(e){return new $c().update(e).digest("hex")}async function xu(e){const t=await crypto.subtle.digest("SHA-1",e);return uw(t)}async function dw(){try{if(await xu(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709")return!0}catch{}return!1}function hw(e){return{assumeValid:!!(e&32768),extended:!!(e&16384),stage:(e&12288)>>12,nameLength:e&4095}}function pw(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 Ar{constructor(t,r){this._dirty=!1,this._unmergedPaths=r||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 r=this._entries.get(t.path);r||(this._entries.set(t.path,t),r=t),r.stages[t.flags.stage]=t,this._unmergedPaths.add(t.path)}}static async from(t){if(Buffer.isBuffer(t))return Ar.fromBuffer(t);if(t===null)return new Ar(null);throw new ce("invalid type passed to GitIndex.from")}static async fromBuffer(t){if(t.length===0)throw new ce("Index file is empty (.git/index)");const r=new Ar,n=new Lt(t),i=n.toString("utf8",4);if(i!=="DIRC")throw new ce(`Invalid dircache magic file number: ${i}`);const a=await Vt(t.slice(0,-20)),o=t.slice(-20).toString("hex");if(o!==a)throw new ce(`Invalid checksum in GitIndex buffer: expected ${o} but saw ${a}`);const s=n.readUInt32BE();if(s!==2)throw new ce(`Unsupported dircache version: ${s}`);const l=n.readUInt32BE();let c=0;for(;!n.eof()&&c<l;){const u={};u.ctimeSeconds=n.readUInt32BE(),u.ctimeNanoseconds=n.readUInt32BE(),u.mtimeSeconds=n.readUInt32BE(),u.mtimeNanoseconds=n.readUInt32BE(),u.dev=n.readUInt32BE(),u.ino=n.readUInt32BE(),u.mode=n.readUInt32BE(),u.uid=n.readUInt32BE(),u.gid=n.readUInt32BE(),u.size=n.readUInt32BE(),u.oid=n.slice(20).toString("hex");const d=n.readUInt16BE();u.flags=hw(d);const p=t.indexOf(0,n.tell()+1)-n.tell();if(p<1)throw new ce(`Got a path length of: ${p}`);if(u.path=n.toString("utf8",p),u.path.includes("..\\")||u.path.includes("../"))throw new Qr(u.path);let m=8-(n.tell()-12)%8;for(m===0&&(m=8);m--;){const g=n.readUInt8();if(g!==0)throw new ce(`Expected 1-8 null characters but got '${g}' after ${u.path}`);if(n.eof())throw new ce("Unexpected end of file")}u.stages=[],r._addEntry(u),c++}return r}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(bu)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(t=>t.stages.length>1?t.stages.filter(r=>r):t)}*[Symbol.iterator](){for(const t of this.entries)yield t}insert({filepath:t,stats:r,oid:n,stage:i=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),r=en(r);const a=Buffer.from(t),o={ctimeSeconds:r.ctimeSeconds,ctimeNanoseconds:r.ctimeNanoseconds,mtimeSeconds:r.mtimeSeconds,mtimeNanoseconds:r.mtimeNanoseconds,dev:r.dev,ino:r.ino,mode:r.mode||33188,uid:r.uid,gid:r.gid,size:r.size,path:t,oid:n,flags:{assumeValid:!1,extended:!1,stage:i,nameLength:a.length<4095?a.length:4095},stages:[]};this._addEntry(o),this._dirty=!0}delete({filepath:t}){if(this._entries.has(t))this._entries.delete(t);else for(const r of this._entries.keys())r.startsWith(t+"/")&&this._entries.delete(r);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
|
-
`)}static async _entryToBuffer(t){const
|
|
9
|
+
*/(function(e){const t=nc,n=af,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 D=new Uint8Array(1),_={foo:function(){return 42}};return Object.setPrototypeOf(_,Uint8Array.prototype),Object.setPrototypeOf(D,_),D.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(D){if(D>o)throw new RangeError('The value "'+D+'" is invalid for option "size"');const _=new Uint8Array(D);return Object.setPrototypeOf(_,s.prototype),_}function s(D,_,P){if(typeof D=="number"){if(typeof _=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(D)}return l(D,_,P)}s.poolSize=8192;function l(D,_,P){if(typeof D=="string")return f(D,_);if(ArrayBuffer.isView(D))return p(D);if(D==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof D);if(Ae(D,ArrayBuffer)||D&&Ae(D.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ae(D,SharedArrayBuffer)||D&&Ae(D.buffer,SharedArrayBuffer)))return m(D,_,P);if(typeof D=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const A=D.valueOf&&D.valueOf();if(A!=null&&A!==D)return s.from(A,_,P);const U=v(D);if(U)return U;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof D[Symbol.toPrimitive]=="function")return s.from(D[Symbol.toPrimitive]("string"),_,P);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof D)}s.from=function(D,_,P){return l(D,_,P)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(D){if(typeof D!="number")throw new TypeError('"size" argument must be of type number');if(D<0)throw new RangeError('The value "'+D+'" is invalid for option "size"')}function u(D,_,P){return c(D),D<=0?a(D):_!==void 0?typeof P=="string"?a(D).fill(_,P):a(D).fill(_):a(D)}s.alloc=function(D,_,P){return u(D,_,P)};function d(D){return c(D),a(D<0?0:w(D)|0)}s.allocUnsafe=function(D){return d(D)},s.allocUnsafeSlow=function(D){return d(D)};function f(D,_){if((typeof _!="string"||_==="")&&(_="utf8"),!s.isEncoding(_))throw new TypeError("Unknown encoding: "+_);const P=x(D,_)|0;let A=a(P);const U=A.write(D,_);return U!==P&&(A=A.slice(0,U)),A}function h(D){const _=D.length<0?0:w(D.length)|0,P=a(_);for(let A=0;A<_;A+=1)P[A]=D[A]&255;return P}function p(D){if(Ae(D,Uint8Array)){const _=new Uint8Array(D);return m(_.buffer,_.byteOffset,_.byteLength)}return h(D)}function m(D,_,P){if(_<0||D.byteLength<_)throw new RangeError('"offset" is outside of buffer bounds');if(D.byteLength<_+(P||0))throw new RangeError('"length" is outside of buffer bounds');let A;return _===void 0&&P===void 0?A=new Uint8Array(D):P===void 0?A=new Uint8Array(D,_):A=new Uint8Array(D,_,P),Object.setPrototypeOf(A,s.prototype),A}function v(D){if(s.isBuffer(D)){const _=w(D.length)|0,P=a(_);return P.length===0||D.copy(P,0,0,_),P}if(D.length!==void 0)return typeof D.length!="number"||Me(D.length)?a(0):h(D);if(D.type==="Buffer"&&Array.isArray(D.data))return h(D.data)}function w(D){if(D>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return D|0}function b(D){return+D!=D&&(D=0),s.alloc(+D)}s.isBuffer=function(_){return _!=null&&_._isBuffer===!0&&_!==s.prototype},s.compare=function(_,P){if(Ae(_,Uint8Array)&&(_=s.from(_,_.offset,_.byteLength)),Ae(P,Uint8Array)&&(P=s.from(P,P.offset,P.byteLength)),!s.isBuffer(_)||!s.isBuffer(P))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(_===P)return 0;let A=_.length,U=P.length;for(let Q=0,ce=Math.min(A,U);Q<ce;++Q)if(_[Q]!==P[Q]){A=_[Q],U=P[Q];break}return A<U?-1:U<A?1:0},s.isEncoding=function(_){switch(String(_).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(_,P){if(!Array.isArray(_))throw new TypeError('"list" argument must be an Array of Buffers');if(_.length===0)return s.alloc(0);let A;if(P===void 0)for(P=0,A=0;A<_.length;++A)P+=_[A].length;const U=s.allocUnsafe(P);let Q=0;for(A=0;A<_.length;++A){let ce=_[A];if(Ae(ce,Uint8Array))Q+ce.length>U.length?(s.isBuffer(ce)||(ce=s.from(ce)),ce.copy(U,Q)):Uint8Array.prototype.set.call(U,ce,Q);else if(s.isBuffer(ce))ce.copy(U,Q);else throw new TypeError('"list" argument must be an Array of Buffers');Q+=ce.length}return U};function x(D,_){if(s.isBuffer(D))return D.length;if(ArrayBuffer.isView(D)||Ae(D,ArrayBuffer))return D.byteLength;if(typeof D!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof D);const P=D.length,A=arguments.length>2&&arguments[2]===!0;if(!A&&P===0)return 0;let U=!1;for(;;)switch(_){case"ascii":case"latin1":case"binary":return P;case"utf8":case"utf-8":return pe(D).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P*2;case"hex":return P>>>1;case"base64":return Re(D).length;default:if(U)return A?-1:pe(D).length;_=(""+_).toLowerCase(),U=!0}}s.byteLength=x;function S(D,_,P){let A=!1;if((_===void 0||_<0)&&(_=0),_>this.length||((P===void 0||P>this.length)&&(P=this.length),P<=0)||(P>>>=0,_>>>=0,P<=_))return"";for(D||(D="utf8");;)switch(D){case"hex":return ee(this,_,P);case"utf8":case"utf-8":return K(this,_,P);case"ascii":return X(this,_,P);case"latin1":case"binary":return B(this,_,P);case"base64":return L(this,_,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,_,P);default:if(A)throw new TypeError("Unknown encoding: "+D);D=(D+"").toLowerCase(),A=!0}}s.prototype._isBuffer=!0;function C(D,_,P){const A=D[_];D[_]=D[P],D[P]=A}s.prototype.swap16=function(){const _=this.length;if(_%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let P=0;P<_;P+=2)C(this,P,P+1);return this},s.prototype.swap32=function(){const _=this.length;if(_%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let P=0;P<_;P+=4)C(this,P,P+3),C(this,P+1,P+2);return this},s.prototype.swap64=function(){const _=this.length;if(_%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let P=0;P<_;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 _=this.length;return _===0?"":arguments.length===0?K(this,0,_):S.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(_){if(!s.isBuffer(_))throw new TypeError("Argument must be a Buffer");return this===_?!0:s.compare(this,_)===0},s.prototype.inspect=function(){let _="";const P=e.INSPECT_MAX_BYTES;return _=this.toString("hex",0,P).replace(/(.{2})/g,"$1 ").trim(),this.length>P&&(_+=" ... "),"<Buffer "+_+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(_,P,A,U,Q){if(Ae(_,Uint8Array)&&(_=s.from(_,_.offset,_.byteLength)),!s.isBuffer(_))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof _);if(P===void 0&&(P=0),A===void 0&&(A=_?_.length:0),U===void 0&&(U=0),Q===void 0&&(Q=this.length),P<0||A>_.length||U<0||Q>this.length)throw new RangeError("out of range index");if(U>=Q&&P>=A)return 0;if(U>=Q)return-1;if(P>=A)return 1;if(P>>>=0,A>>>=0,U>>>=0,Q>>>=0,this===_)return 0;let ce=Q-U,ke=A-P;const rt=Math.min(ce,ke),Je=this.slice(U,Q),it=_.slice(P,A);for(let Ue=0;Ue<rt;++Ue)if(Je[Ue]!==it[Ue]){ce=Je[Ue],ke=it[Ue];break}return ce<ke?-1:ke<ce?1:0};function N(D,_,P,A,U){if(D.length===0)return-1;if(typeof P=="string"?(A=P,P=0):P>2147483647?P=2147483647:P<-2147483648&&(P=-2147483648),P=+P,Me(P)&&(P=U?0:D.length-1),P<0&&(P=D.length+P),P>=D.length){if(U)return-1;P=D.length-1}else if(P<0)if(U)P=0;else return-1;if(typeof _=="string"&&(_=s.from(_,A)),s.isBuffer(_))return _.length===0?-1:R(D,_,P,A,U);if(typeof _=="number")return _=_&255,typeof Uint8Array.prototype.indexOf=="function"?U?Uint8Array.prototype.indexOf.call(D,_,P):Uint8Array.prototype.lastIndexOf.call(D,_,P):R(D,[_],P,A,U);throw new TypeError("val must be string, number or Buffer")}function R(D,_,P,A,U){let Q=1,ce=D.length,ke=_.length;if(A!==void 0&&(A=String(A).toLowerCase(),A==="ucs2"||A==="ucs-2"||A==="utf16le"||A==="utf-16le")){if(D.length<2||_.length<2)return-1;Q=2,ce/=2,ke/=2,P/=2}function rt(it,Ue){return Q===1?it[Ue]:it.readUInt16BE(Ue*Q)}let Je;if(U){let it=-1;for(Je=P;Je<ce;Je++)if(rt(D,Je)===rt(_,it===-1?0:Je-it)){if(it===-1&&(it=Je),Je-it+1===ke)return it*Q}else it!==-1&&(Je-=Je-it),it=-1}else for(P+ke>ce&&(P=ce-ke),Je=P;Je>=0;Je--){let it=!0;for(let Ue=0;Ue<ke;Ue++)if(rt(D,Je+Ue)!==rt(_,Ue)){it=!1;break}if(it)return Je}return-1}s.prototype.includes=function(_,P,A){return this.indexOf(_,P,A)!==-1},s.prototype.indexOf=function(_,P,A){return N(this,_,P,A,!0)},s.prototype.lastIndexOf=function(_,P,A){return N(this,_,P,A,!1)};function T(D,_,P,A){P=Number(P)||0;const U=D.length-P;A?(A=Number(A),A>U&&(A=U)):A=U;const Q=_.length;A>Q/2&&(A=Q/2);let ce;for(ce=0;ce<A;++ce){const ke=parseInt(_.substr(ce*2,2),16);if(Me(ke))return ce;D[P+ce]=ke}return ce}function M(D,_,P,A){return nt(pe(_,D.length-P),D,P,A)}function k(D,_,P,A){return nt(me(_),D,P,A)}function O(D,_,P,A){return nt(Re(_),D,P,A)}function F(D,_,P,A){return nt(_e(_,D.length-P),D,P,A)}s.prototype.write=function(_,P,A,U){if(P===void 0)U="utf8",A=this.length,P=0;else if(A===void 0&&typeof P=="string")U=P,A=this.length,P=0;else if(isFinite(P))P=P>>>0,isFinite(A)?(A=A>>>0,U===void 0&&(U="utf8")):(U=A,A=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Q=this.length-P;if((A===void 0||A>Q)&&(A=Q),_.length>0&&(A<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let ce=!1;for(;;)switch(U){case"hex":return T(this,_,P,A);case"utf8":case"utf-8":return M(this,_,P,A);case"ascii":case"latin1":case"binary":return k(this,_,P,A);case"base64":return O(this,_,P,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,_,P,A);default:if(ce)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),ce=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(D,_,P){return _===0&&P===D.length?t.fromByteArray(D):t.fromByteArray(D.slice(_,P))}function K(D,_,P){P=Math.min(D.length,P);const A=[];let U=_;for(;U<P;){const Q=D[U];let ce=null,ke=Q>239?4:Q>223?3:Q>191?2:1;if(U+ke<=P){let rt,Je,it,Ue;switch(ke){case 1:Q<128&&(ce=Q);break;case 2:rt=D[U+1],(rt&192)===128&&(Ue=(Q&31)<<6|rt&63,Ue>127&&(ce=Ue));break;case 3:rt=D[U+1],Je=D[U+2],(rt&192)===128&&(Je&192)===128&&(Ue=(Q&15)<<12|(rt&63)<<6|Je&63,Ue>2047&&(Ue<55296||Ue>57343)&&(ce=Ue));break;case 4:rt=D[U+1],Je=D[U+2],it=D[U+3],(rt&192)===128&&(Je&192)===128&&(it&192)===128&&(Ue=(Q&15)<<18|(rt&63)<<12|(Je&63)<<6|it&63,Ue>65535&&Ue<1114112&&(ce=Ue))}}ce===null?(ce=65533,ke=1):ce>65535&&(ce-=65536,A.push(ce>>>10&1023|55296),ce=56320|ce&1023),A.push(ce),U+=ke}return q(A)}const ne=4096;function q(D){const _=D.length;if(_<=ne)return String.fromCharCode.apply(String,D);let P="",A=0;for(;A<_;)P+=String.fromCharCode.apply(String,D.slice(A,A+=ne));return P}function X(D,_,P){let A="";P=Math.min(D.length,P);for(let U=_;U<P;++U)A+=String.fromCharCode(D[U]&127);return A}function B(D,_,P){let A="";P=Math.min(D.length,P);for(let U=_;U<P;++U)A+=String.fromCharCode(D[U]);return A}function ee(D,_,P){const A=D.length;(!_||_<0)&&(_=0),(!P||P<0||P>A)&&(P=A);let U="";for(let Q=_;Q<P;++Q)U+=Ce[D[Q]];return U}function Z(D,_,P){const A=D.slice(_,P);let U="";for(let Q=0;Q<A.length-1;Q+=2)U+=String.fromCharCode(A[Q]+A[Q+1]*256);return U}s.prototype.slice=function(_,P){const A=this.length;_=~~_,P=P===void 0?A:~~P,_<0?(_+=A,_<0&&(_=0)):_>A&&(_=A),P<0?(P+=A,P<0&&(P=0)):P>A&&(P=A),P<_&&(P=_);const U=this.subarray(_,P);return Object.setPrototypeOf(U,s.prototype),U};function J(D,_,P){if(D%1!==0||D<0)throw new RangeError("offset is not uint");if(D+_>P)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(_,P,A){_=_>>>0,P=P>>>0,A||J(_,P,this.length);let U=this[_],Q=1,ce=0;for(;++ce<P&&(Q*=256);)U+=this[_+ce]*Q;return U},s.prototype.readUintBE=s.prototype.readUIntBE=function(_,P,A){_=_>>>0,P=P>>>0,A||J(_,P,this.length);let U=this[_+--P],Q=1;for(;P>0&&(Q*=256);)U+=this[_+--P]*Q;return U},s.prototype.readUint8=s.prototype.readUInt8=function(_,P){return _=_>>>0,P||J(_,1,this.length),this[_]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(_,P){return _=_>>>0,P||J(_,2,this.length),this[_]|this[_+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(_,P){return _=_>>>0,P||J(_,2,this.length),this[_]<<8|this[_+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(_,P){return _=_>>>0,P||J(_,4,this.length),(this[_]|this[_+1]<<8|this[_+2]<<16)+this[_+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(_,P){return _=_>>>0,P||J(_,4,this.length),this[_]*16777216+(this[_+1]<<16|this[_+2]<<8|this[_+3])},s.prototype.readBigUInt64LE=Fe(function(_){_=_>>>0,se(_,"offset");const P=this[_],A=this[_+7];(P===void 0||A===void 0)&&oe(_,this.length-8);const U=P+this[++_]*2**8+this[++_]*2**16+this[++_]*2**24,Q=this[++_]+this[++_]*2**8+this[++_]*2**16+A*2**24;return BigInt(U)+(BigInt(Q)<<BigInt(32))}),s.prototype.readBigUInt64BE=Fe(function(_){_=_>>>0,se(_,"offset");const P=this[_],A=this[_+7];(P===void 0||A===void 0)&&oe(_,this.length-8);const U=P*2**24+this[++_]*2**16+this[++_]*2**8+this[++_],Q=this[++_]*2**24+this[++_]*2**16+this[++_]*2**8+A;return(BigInt(U)<<BigInt(32))+BigInt(Q)}),s.prototype.readIntLE=function(_,P,A){_=_>>>0,P=P>>>0,A||J(_,P,this.length);let U=this[_],Q=1,ce=0;for(;++ce<P&&(Q*=256);)U+=this[_+ce]*Q;return Q*=128,U>=Q&&(U-=Math.pow(2,8*P)),U},s.prototype.readIntBE=function(_,P,A){_=_>>>0,P=P>>>0,A||J(_,P,this.length);let U=P,Q=1,ce=this[_+--U];for(;U>0&&(Q*=256);)ce+=this[_+--U]*Q;return Q*=128,ce>=Q&&(ce-=Math.pow(2,8*P)),ce},s.prototype.readInt8=function(_,P){return _=_>>>0,P||J(_,1,this.length),this[_]&128?(255-this[_]+1)*-1:this[_]},s.prototype.readInt16LE=function(_,P){_=_>>>0,P||J(_,2,this.length);const A=this[_]|this[_+1]<<8;return A&32768?A|4294901760:A},s.prototype.readInt16BE=function(_,P){_=_>>>0,P||J(_,2,this.length);const A=this[_+1]|this[_]<<8;return A&32768?A|4294901760:A},s.prototype.readInt32LE=function(_,P){return _=_>>>0,P||J(_,4,this.length),this[_]|this[_+1]<<8|this[_+2]<<16|this[_+3]<<24},s.prototype.readInt32BE=function(_,P){return _=_>>>0,P||J(_,4,this.length),this[_]<<24|this[_+1]<<16|this[_+2]<<8|this[_+3]},s.prototype.readBigInt64LE=Fe(function(_){_=_>>>0,se(_,"offset");const P=this[_],A=this[_+7];(P===void 0||A===void 0)&&oe(_,this.length-8);const U=this[_+4]+this[_+5]*2**8+this[_+6]*2**16+(A<<24);return(BigInt(U)<<BigInt(32))+BigInt(P+this[++_]*2**8+this[++_]*2**16+this[++_]*2**24)}),s.prototype.readBigInt64BE=Fe(function(_){_=_>>>0,se(_,"offset");const P=this[_],A=this[_+7];(P===void 0||A===void 0)&&oe(_,this.length-8);const U=(P<<24)+this[++_]*2**16+this[++_]*2**8+this[++_];return(BigInt(U)<<BigInt(32))+BigInt(this[++_]*2**24+this[++_]*2**16+this[++_]*2**8+A)}),s.prototype.readFloatLE=function(_,P){return _=_>>>0,P||J(_,4,this.length),n.read(this,_,!0,23,4)},s.prototype.readFloatBE=function(_,P){return _=_>>>0,P||J(_,4,this.length),n.read(this,_,!1,23,4)},s.prototype.readDoubleLE=function(_,P){return _=_>>>0,P||J(_,8,this.length),n.read(this,_,!0,52,8)},s.prototype.readDoubleBE=function(_,P){return _=_>>>0,P||J(_,8,this.length),n.read(this,_,!1,52,8)};function H(D,_,P,A,U,Q){if(!s.isBuffer(D))throw new TypeError('"buffer" argument must be a Buffer instance');if(_>U||_<Q)throw new RangeError('"value" argument is out of bounds');if(P+A>D.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(_,P,A,U){if(_=+_,P=P>>>0,A=A>>>0,!U){const ke=Math.pow(2,8*A)-1;H(this,_,P,A,ke,0)}let Q=1,ce=0;for(this[P]=_&255;++ce<A&&(Q*=256);)this[P+ce]=_/Q&255;return P+A},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(_,P,A,U){if(_=+_,P=P>>>0,A=A>>>0,!U){const ke=Math.pow(2,8*A)-1;H(this,_,P,A,ke,0)}let Q=A-1,ce=1;for(this[P+Q]=_&255;--Q>=0&&(ce*=256);)this[P+Q]=_/ce&255;return P+A},s.prototype.writeUint8=s.prototype.writeUInt8=function(_,P,A){return _=+_,P=P>>>0,A||H(this,_,P,1,255,0),this[P]=_&255,P+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(_,P,A){return _=+_,P=P>>>0,A||H(this,_,P,2,65535,0),this[P]=_&255,this[P+1]=_>>>8,P+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(_,P,A){return _=+_,P=P>>>0,A||H(this,_,P,2,65535,0),this[P]=_>>>8,this[P+1]=_&255,P+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(_,P,A){return _=+_,P=P>>>0,A||H(this,_,P,4,4294967295,0),this[P+3]=_>>>24,this[P+2]=_>>>16,this[P+1]=_>>>8,this[P]=_&255,P+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(_,P,A){return _=+_,P=P>>>0,A||H(this,_,P,4,4294967295,0),this[P]=_>>>24,this[P+1]=_>>>16,this[P+2]=_>>>8,this[P+3]=_&255,P+4};function I(D,_,P,A,U){z(_,A,U,D,P,7);let Q=Number(_&BigInt(4294967295));D[P++]=Q,Q=Q>>8,D[P++]=Q,Q=Q>>8,D[P++]=Q,Q=Q>>8,D[P++]=Q;let ce=Number(_>>BigInt(32)&BigInt(4294967295));return D[P++]=ce,ce=ce>>8,D[P++]=ce,ce=ce>>8,D[P++]=ce,ce=ce>>8,D[P++]=ce,P}function V(D,_,P,A,U){z(_,A,U,D,P,7);let Q=Number(_&BigInt(4294967295));D[P+7]=Q,Q=Q>>8,D[P+6]=Q,Q=Q>>8,D[P+5]=Q,Q=Q>>8,D[P+4]=Q;let ce=Number(_>>BigInt(32)&BigInt(4294967295));return D[P+3]=ce,ce=ce>>8,D[P+2]=ce,ce=ce>>8,D[P+1]=ce,ce=ce>>8,D[P]=ce,P+8}s.prototype.writeBigUInt64LE=Fe(function(_,P=0){return I(this,_,P,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Fe(function(_,P=0){return V(this,_,P,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(_,P,A,U){if(_=+_,P=P>>>0,!U){const rt=Math.pow(2,8*A-1);H(this,_,P,A,rt-1,-rt)}let Q=0,ce=1,ke=0;for(this[P]=_&255;++Q<A&&(ce*=256);)_<0&&ke===0&&this[P+Q-1]!==0&&(ke=1),this[P+Q]=(_/ce>>0)-ke&255;return P+A},s.prototype.writeIntBE=function(_,P,A,U){if(_=+_,P=P>>>0,!U){const rt=Math.pow(2,8*A-1);H(this,_,P,A,rt-1,-rt)}let Q=A-1,ce=1,ke=0;for(this[P+Q]=_&255;--Q>=0&&(ce*=256);)_<0&&ke===0&&this[P+Q+1]!==0&&(ke=1),this[P+Q]=(_/ce>>0)-ke&255;return P+A},s.prototype.writeInt8=function(_,P,A){return _=+_,P=P>>>0,A||H(this,_,P,1,127,-128),_<0&&(_=255+_+1),this[P]=_&255,P+1},s.prototype.writeInt16LE=function(_,P,A){return _=+_,P=P>>>0,A||H(this,_,P,2,32767,-32768),this[P]=_&255,this[P+1]=_>>>8,P+2},s.prototype.writeInt16BE=function(_,P,A){return _=+_,P=P>>>0,A||H(this,_,P,2,32767,-32768),this[P]=_>>>8,this[P+1]=_&255,P+2},s.prototype.writeInt32LE=function(_,P,A){return _=+_,P=P>>>0,A||H(this,_,P,4,2147483647,-2147483648),this[P]=_&255,this[P+1]=_>>>8,this[P+2]=_>>>16,this[P+3]=_>>>24,P+4},s.prototype.writeInt32BE=function(_,P,A){return _=+_,P=P>>>0,A||H(this,_,P,4,2147483647,-2147483648),_<0&&(_=4294967295+_+1),this[P]=_>>>24,this[P+1]=_>>>16,this[P+2]=_>>>8,this[P+3]=_&255,P+4},s.prototype.writeBigInt64LE=Fe(function(_,P=0){return I(this,_,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Fe(function(_,P=0){return V(this,_,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ae(D,_,P,A,U,Q){if(P+A>D.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("Index out of range")}function j(D,_,P,A,U){return _=+_,P=P>>>0,U||ae(D,_,P,4),n.write(D,_,P,A,23,4),P+4}s.prototype.writeFloatLE=function(_,P,A){return j(this,_,P,!0,A)},s.prototype.writeFloatBE=function(_,P,A){return j(this,_,P,!1,A)};function G(D,_,P,A,U){return _=+_,P=P>>>0,U||ae(D,_,P,8),n.write(D,_,P,A,52,8),P+8}s.prototype.writeDoubleLE=function(_,P,A){return G(this,_,P,!0,A)},s.prototype.writeDoubleBE=function(_,P,A){return G(this,_,P,!1,A)},s.prototype.copy=function(_,P,A,U){if(!s.isBuffer(_))throw new TypeError("argument should be a Buffer");if(A||(A=0),!U&&U!==0&&(U=this.length),P>=_.length&&(P=_.length),P||(P=0),U>0&&U<A&&(U=A),U===A||_.length===0||this.length===0)return 0;if(P<0)throw new RangeError("targetStart out of bounds");if(A<0||A>=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),_.length-P<U-A&&(U=_.length-P+A);const Q=U-A;return this===_&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(P,A,U):Uint8Array.prototype.set.call(_,this.subarray(A,U),P),Q},s.prototype.fill=function(_,P,A,U){if(typeof _=="string"){if(typeof P=="string"?(U=P,P=0,A=this.length):typeof A=="string"&&(U=A,A=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(_.length===1){const ce=_.charCodeAt(0);(U==="utf8"&&ce<128||U==="latin1")&&(_=ce)}}else typeof _=="number"?_=_&255:typeof _=="boolean"&&(_=Number(_));if(P<0||this.length<P||this.length<A)throw new RangeError("Out of range index");if(A<=P)return this;P=P>>>0,A=A===void 0?this.length:A>>>0,_||(_=0);let Q;if(typeof _=="number")for(Q=P;Q<A;++Q)this[Q]=_;else{const ce=s.isBuffer(_)?_:s.from(_,U),ke=ce.length;if(ke===0)throw new TypeError('The value "'+_+'" is invalid for argument "value"');for(Q=0;Q<A-P;++Q)this[Q+P]=ce[Q%ke]}return this};const $={};function te(D,_,P){$[D]=class extends P{constructor(){super(),Object.defineProperty(this,"message",{value:_.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${D}]`,this.stack,delete this.name}get code(){return D}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${D}]: ${this.message}`}}}te("ERR_BUFFER_OUT_OF_BOUNDS",function(D){return D?`${D} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),te("ERR_INVALID_ARG_TYPE",function(D,_){return`The "${D}" argument must be of type number. Received type ${typeof _}`},TypeError),te("ERR_OUT_OF_RANGE",function(D,_,P){let A=`The value of "${D}" is out of range.`,U=P;return Number.isInteger(P)&&Math.abs(P)>2**32?U=ie(String(P)):typeof P=="bigint"&&(U=String(P),(P>BigInt(2)**BigInt(32)||P<-(BigInt(2)**BigInt(32)))&&(U=ie(U)),U+="n"),A+=` It must be ${_}. Received ${U}`,A},RangeError);function ie(D){let _="",P=D.length;const A=D[0]==="-"?1:0;for(;P>=A+4;P-=3)_=`_${D.slice(P-3,P)}${_}`;return`${D.slice(0,P)}${_}`}function re(D,_,P){se(_,"offset"),(D[_]===void 0||D[_+P]===void 0)&&oe(_,D.length-(P+1))}function z(D,_,P,A,U,Q){if(D>P||D<_){const ce=typeof _=="bigint"?"n":"";let ke;throw _===0||_===BigInt(0)?ke=`>= 0${ce} and < 2${ce} ** ${(Q+1)*8}${ce}`:ke=`>= -(2${ce} ** ${(Q+1)*8-1}${ce}) and < 2 ** ${(Q+1)*8-1}${ce}`,new $.ERR_OUT_OF_RANGE("value",ke,D)}re(A,U,Q)}function se(D,_){if(typeof D!="number")throw new $.ERR_INVALID_ARG_TYPE(_,"number",D)}function oe(D,_,P){throw Math.floor(D)!==D?(se(D,P),new $.ERR_OUT_OF_RANGE("offset","an integer",D)):_<0?new $.ERR_BUFFER_OUT_OF_BOUNDS:new $.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${_}`,D)}const fe=/[^+/0-9A-Za-z-_]/g;function ge(D){if(D=D.split("=")[0],D=D.trim().replace(fe,""),D.length<2)return"";for(;D.length%4!==0;)D=D+"=";return D}function pe(D,_){_=_||1/0;let P;const A=D.length;let U=null;const Q=[];for(let ce=0;ce<A;++ce){if(P=D.charCodeAt(ce),P>55295&&P<57344){if(!U){if(P>56319){(_-=3)>-1&&Q.push(239,191,189);continue}else if(ce+1===A){(_-=3)>-1&&Q.push(239,191,189);continue}U=P;continue}if(P<56320){(_-=3)>-1&&Q.push(239,191,189),U=P;continue}P=(U-55296<<10|P-56320)+65536}else U&&(_-=3)>-1&&Q.push(239,191,189);if(U=null,P<128){if((_-=1)<0)break;Q.push(P)}else if(P<2048){if((_-=2)<0)break;Q.push(P>>6|192,P&63|128)}else if(P<65536){if((_-=3)<0)break;Q.push(P>>12|224,P>>6&63|128,P&63|128)}else if(P<1114112){if((_-=4)<0)break;Q.push(P>>18|240,P>>12&63|128,P>>6&63|128,P&63|128)}else throw new Error("Invalid code point")}return Q}function me(D){const _=[];for(let P=0;P<D.length;++P)_.push(D.charCodeAt(P)&255);return _}function _e(D,_){let P,A,U;const Q=[];for(let ce=0;ce<D.length&&!((_-=2)<0);++ce)P=D.charCodeAt(ce),A=P>>8,U=P%256,Q.push(U),Q.push(A);return Q}function Re(D){return t.toByteArray(ge(D))}function nt(D,_,P,A){let U;for(U=0;U<A&&!(U+P>=_.length||U>=D.length);++U)_[U+P]=D[U];return U}function Ae(D,_){return D instanceof _||D!=null&&D.constructor!=null&&D.constructor.name!=null&&D.constructor.name===_.name}function Me(D){return D!==D}const Ce=function(){const D="0123456789abcdef",_=new Array(256);for(let P=0;P<16;++P){const A=P*16;for(let U=0;U<16;++U)_[A+U]=D[P]+D[U]}return _}();function Fe(D){return typeof BigInt>"u"?pn:D}function pn(){throw new Error("BigInt not supported")}})(rf);function BI(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function HI(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:BI(e)}async function UI(e,t){const n=HI(e);for(;;){const{value:r,done:o}=await n.next();if(r&&await t(r),o)break}n.return&&n.return()}async function VI(e){let t=0;const n=[];await UI(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 WI(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 GI({onProgress:e,url:t,method:n="GET",headers:r={},body:o}){o&&(o=await VI(o));const i=await fetch(t,{method:n,headers:r,body:o}),a=i.body&&i.body.getReader?WI(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 sf={request:GI},gn=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||gn.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||gn.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||gn.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=gn.DEFAULT_MAX_PENDING};gn.DEFAULT_TIMEOUT=0,gn.DEFAULT_MAX_OCCUPATION_TIME=0,gn.DEFAULT_MAX_EXECUTION_TIME=0,gn.DEFAULT_MAX_PENDING=1e3,gn.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,S){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(S):typeof n=="function"&&n(x,S),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 S=!1;try{t(function(C,N){S||(S=!0,f(b,C,N))})}catch(C){S||(S=!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},gn.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())})},gn.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},gn.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(t){return this.Promise.reject(t)}};var qI=gn,YI=qI;const Qa=jn(YI);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 KI=lf.exports,cf={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var n=rf,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)}})(cf,cf.exports);var zv=cf.exports,Bv=zv.Buffer;function rc(e,t){this._block=Bv.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}rc.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Bv.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},rc.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},rc.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var XI=rc,ZI=KI,Hv=XI,JI=zv.Buffer,QI=[1518500249,1859775393,-1894007588,-899497514],ej=new Array(80);function es(){this.init(),this._w=ej,Hv.call(this,64,56)}ZI(es,Hv),es.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function tj(e){return e<<1|e>>>31}function nj(e){return e<<5|e>>>27}function rj(e){return e<<30|e>>>2}function oj(e,t,n,r){return e===0?t&n|~t&r:e===2?t&n|t&r|n&r:t^n^r}es.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]=tj(t[s-3]^t[s-8]^t[s-14]^t[s-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=nj(n)+oj(c,r,o,i)+a+t[l]+QI[c]|0;a=i,i=o,o=rj(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},es.prototype._hash=function(){var e=JI.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 ij=es;const Uv=jn(ij);function or(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function Vv(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 aj(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 yi={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),or(i),i.length!==0&&(t=i+"/"+t,n=i.charCodeAt(0)===47)}return t=Vv(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(or(t),t.length===0)return".";var n=t.charCodeAt(0)===47,r=t.charCodeAt(t.length-1)===47;return t=Vv(t,!n),t.length===0&&!n&&(t="."),t.length>0&&r&&(t+="/"),n?"/"+t:t},isAbsolute:function(t){return or(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];or(r),r.length>0&&(t===void 0?t=r:t+="/"+r)}return t===void 0?".":yi.normalize(t)},relative:function(t,n){if(or(t),or(n),t===n||(t=yi.resolve(t),n=yi.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(or(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');or(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){or(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 aj("/",t)},parse:function(t){or(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};yi.posix=yi;var ue=yi,Wv={};/*! 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),k=0;k!=256;++k)T=k,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[k]=T;return typeof Int32Array<"u"?new Int32Array(M):M}var r=n();function o(T){var M=0,k=0,O=0,F=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(O=0;O!=256;++O)F[O]=T[O];for(O=0;O!=256;++O)for(k=T[O],M=256+O;M<4096;M+=256)k=F[M]=k>>>8^T[k&255];var L=[];for(O=1;O!=16;++O)L[O-1]=typeof Int32Array<"u"?F.subarray(O*256,O*256+256):F.slice(O*256,O*256+256);return L}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],S=i[14];function C(T,M){for(var k=M^-1,O=0,F=T.length;O<F;)k=k>>>8^r[(k^T.charCodeAt(O++))&255];return~k}function N(T,M){for(var k=M^-1,O=T.length-15,F=0;F<O;)k=S[T[F++]^k&255]^x[T[F++]^k>>8&255]^b[T[F++]^k>>16&255]^w[T[F++]^k>>>24]^v[T[F++]]^m[T[F++]]^p[T[F++]]^h[T[F++]]^f[T[F++]]^d[T[F++]]^u[T[F++]]^c[T[F++]]^l[T[F++]]^s[T[F++]]^a[T[F++]]^r[T[F++]];for(O+=15;F<O;)k=k>>>8^r[(k^T[F++])&255];return~k}function R(T,M){for(var k=M^-1,O=0,F=T.length,L=0,K=0;O<F;)L=T.charCodeAt(O++),L<128?k=k>>>8^r[(k^L)&255]:L<2048?(k=k>>>8^r[(k^(192|L>>6&31))&255],k=k>>>8^r[(k^(128|L&63))&255]):L>=55296&&L<57344?(L=(L&1023)+64,K=T.charCodeAt(O++)&1023,k=k>>>8^r[(k^(240|L>>8&7))&255],k=k>>>8^r[(k^(128|L>>2&63))&255],k=k>>>8^r[(k^(128|K>>6&15|(L&3)<<4))&255],k=k>>>8^r[(k^(128|K&63))&255]):(k=k>>>8^r[(k^(224|L>>12&15))&255],k=k>>>8^r[(k^(128|L>>6&63))&255],k=k>>>8^r[(k^(128|L&63))&255]);return~k}t.table=r,t.bstr=C,t.buf=N,t.str=R})})(Wv);const sj=jn(Wv);var Tr={};(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)})(Tr);var ts={},ir={},bi={},lj=Tr,cj=4,Gv=0,qv=1,uj=2;function xi(e){for(var t=e.length;--t>=0;)e[t]=0}var dj=0,Yv=1,fj=2,hj=3,pj=258,uf=29,ns=256,rs=ns+1+uf,_i=30,df=19,Kv=2*rs+1,ko=15,ff=16,mj=7,hf=256,Xv=16,Zv=17,Jv=18,pf=[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],oc=[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],gj=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Qv=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],wj=512,Mr=new Array((rs+2)*2);xi(Mr);var os=new Array(_i*2);xi(os);var is=new Array(wj);xi(is);var as=new Array(pj-hj+1);xi(as);var mf=new Array(uf);xi(mf);var ic=new Array(_i);xi(ic);function gf(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 ey,ty,ny;function wf(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function ry(e){return e<256?is[e]:is[256+(e>>>7)]}function ss(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function en(e,t,n){e.bi_valid>ff-n?(e.bi_buf|=t<<e.bi_valid&65535,ss(e,e.bi_buf),e.bi_buf=t>>ff-e.bi_valid,e.bi_valid+=n-ff):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function ar(e,t,n){en(e,n[t*2],n[t*2+1])}function oy(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function vj(e){e.bi_valid===16?(ss(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 yj(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<=ko;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<Kv;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 iy(e,t,n){var r=new Array(ko+1),o=0,i,a;for(i=1;i<=ko;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]=oy(r[s]++,s))}}function bj(){var e,t,n,r,o,i=new Array(ko+1);for(n=0,r=0;r<uf-1;r++)for(mf[r]=n,e=0;e<1<<pf[r];e++)as[n++]=r;for(as[n-1]=r,o=0,r=0;r<16;r++)for(ic[r]=o,e=0;e<1<<oc[r];e++)is[o++]=r;for(o>>=7;r<_i;r++)for(ic[r]=o<<7,e=0;e<1<<oc[r]-7;e++)is[256+o++]=r;for(t=0;t<=ko;t++)i[t]=0;for(e=0;e<=143;)Mr[e*2+1]=8,e++,i[8]++;for(;e<=255;)Mr[e*2+1]=9,e++,i[9]++;for(;e<=279;)Mr[e*2+1]=7,e++,i[7]++;for(;e<=287;)Mr[e*2+1]=8,e++,i[8]++;for(iy(Mr,rs+1,i),e=0;e<_i;e++)os[e*2+1]=5,os[e*2]=oy(e,5);ey=new gf(Mr,pf,ns+1,rs,ko),ty=new gf(os,oc,0,_i,ko),ny=new gf(new Array(0),gj,0,df,mj)}function ay(e){var t;for(t=0;t<rs;t++)e.dyn_ltree[t*2]=0;for(t=0;t<_i;t++)e.dyn_dtree[t*2]=0;for(t=0;t<df;t++)e.bl_tree[t*2]=0;e.dyn_ltree[hf*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function sy(e){e.bi_valid>8?ss(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 xj(e,t,n,r){sy(e),ss(e,n),ss(e,~n),lj.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function ly(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 vf(e,t,n){for(var r=e.heap[n],o=n<<1;o<=e.heap_len&&(o<e.heap_len&&ly(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!ly(t,r,e.heap[o],e.depth));)e.heap[n]=e.heap[o],n=o,o<<=1;e.heap[n]=r}function cy(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?ar(e,o,t):(a=as[o],ar(e,a+ns+1,t),s=pf[a],s!==0&&(o-=mf[a],en(e,o,s)),r--,a=ry(r),ar(e,a,n),s=oc[a],s!==0&&(r-=ic[a],en(e,r,s)));while(i<e.last_lit);ar(e,hf,t)}function yf(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=Kv,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--)vf(e,n,a);c=i;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],vf(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++,vf(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],yj(e,t),iy(n,l,e.bl_count)}function uy(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[Xv*2]++):s<=10?e.bl_tree[Zv*2]++:e.bl_tree[Jv*2]++,s=0,o=i,a===0?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4))}function dy(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 ar(e,i,e.bl_tree);while(--s!==0);else i!==0?(i!==o&&(ar(e,i,e.bl_tree),s--),ar(e,Xv,e.bl_tree),en(e,s-3,2)):s<=10?(ar(e,Zv,e.bl_tree),en(e,s-3,3)):(ar(e,Jv,e.bl_tree),en(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 _j(e){var t;for(uy(e,e.dyn_ltree,e.l_desc.max_code),uy(e,e.dyn_dtree,e.d_desc.max_code),yf(e,e.bl_desc),t=df-1;t>=3&&e.bl_tree[Qv[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Sj(e,t,n,r){var o;for(en(e,t-257,5),en(e,n-1,5),en(e,r-4,4),o=0;o<r;o++)en(e,e.bl_tree[Qv[o]*2+1],3);dy(e,e.dyn_ltree,t-1),dy(e,e.dyn_dtree,n-1)}function Cj(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return Gv;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return qv;for(n=32;n<ns;n++)if(e.dyn_ltree[n*2]!==0)return qv;return Gv}var fy=!1;function Ej(e){fy||(bj(),fy=!0),e.l_desc=new wf(e.dyn_ltree,ey),e.d_desc=new wf(e.dyn_dtree,ty),e.bl_desc=new wf(e.bl_tree,ny),e.bi_buf=0,e.bi_valid=0,ay(e)}function hy(e,t,n,r){en(e,(dj<<1)+(r?1:0),3),xj(e,t,n)}function Pj(e){en(e,Yv<<1,3),ar(e,hf,Mr),vj(e)}function Rj(e,t,n,r){var o,i,a=0;e.level>0?(e.strm.data_type===uj&&(e.strm.data_type=Cj(e)),yf(e,e.l_desc),yf(e,e.d_desc),a=_j(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?hy(e,t,n,r):e.strategy===cj||i===o?(en(e,(Yv<<1)+(r?1:0),3),cy(e,Mr,os)):(en(e,(fj<<1)+(r?1:0),3),Sj(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),cy(e,e.dyn_ltree,e.dyn_dtree)),ay(e),r&&sy(e)}function Nj(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[(as[n]+ns+1)*2]++,e.dyn_dtree[ry(t)*2]++),e.last_lit===e.lit_bufsize-1}bi._tr_init=Ej,bi._tr_stored_block=hy,bi._tr_flush_block=Rj,bi._tr_tally=Nj,bi._tr_align=Pj;function Tj(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 py=Tj;function Mj(){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 Dj=Mj();function kj(e,t,n,r){var o=Dj,i=r+n;e^=-1;for(var a=r;a<i;a++)e=e>>>8^o[(e^t[a])&255];return e^-1}var my=kj,bf={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"},Gt=Tr,Tn=bi,gy=py,qr=my,Oj=bf,Oo=0,Aj=1,Ij=3,Yr=4,wy=5,sr=0,vy=1,Mn=-2,jj=-3,xf=-5,$j=-1,Fj=1,ac=2,Lj=3,zj=4,Bj=0,Hj=2,sc=8,Uj=9,Vj=15,Wj=8,Gj=29,qj=256,_f=qj+1+Gj,Yj=30,Kj=19,Xj=2*_f+1,Zj=15,He=3,Kr=258,$n=Kr+He+1,Jj=32,lc=42,Sf=69,cc=73,uc=91,dc=103,Ao=113,ls=666,Et=1,cs=2,Io=3,Si=4,Qj=3;function Xr(e,t){return e.msg=Oj[t],t}function yy(e){return(e<<1)-(e>4?9:0)}function Zr(e){for(var t=e.length;--t>=0;)e[t]=0}function Jr(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(Gt.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 Dt(e,t){Tn._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Jr(e.strm)}function Ke(e,t){e.pending_buf[e.pending++]=t}function us(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function e2(e,t,n,r){var o=e.avail_in;return o>r&&(o=r),o===0?0:(e.avail_in-=o,Gt.arraySet(t,e.input,e.next_in,o,n),e.state.wrap===1?e.adler=gy(e.adler,t,o,n):e.state.wrap===2&&(e.adler=qr(e.adler,t,o,n)),e.next_in+=o,e.total_in+=o,o)}function by(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-$n?e.strstart-(e.w_size-$n):0,c=e.window,u=e.w_mask,d=e.prev,f=e.strstart+Kr,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=Kr-(f-r),r=f-Kr,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 jo(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-$n)){Gt.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=e2(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=r,e.lookahead+e.insert>=He)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+He-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<He)););}while(e.lookahead<$n&&e.strm.avail_in!==0)}function t2(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(jo(e),e.lookahead===0&&t===Oo)return Et;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,Dt(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-$n&&(Dt(e,!1),e.strm.avail_out===0))return Et}return e.insert=0,t===Yr?(Dt(e,!0),e.strm.avail_out===0?Io:Si):(e.strstart>e.block_start&&(Dt(e,!1),e.strm.avail_out===0),Et)}function Cf(e,t){for(var n,r;;){if(e.lookahead<$n){if(jo(e),e.lookahead<$n&&t===Oo)return Et;if(e.lookahead===0)break}if(n=0,e.lookahead>=He&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+He-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-$n&&(e.match_length=by(e,n)),e.match_length>=He)if(r=Tn._tr_tally(e,e.strstart-e.match_start,e.match_length-He),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=He){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+He-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=Tn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Dt(e,!1),e.strm.avail_out===0))return Et}return e.insert=e.strstart<He-1?e.strstart:He-1,t===Yr?(Dt(e,!0),e.strm.avail_out===0?Io:Si):e.last_lit&&(Dt(e,!1),e.strm.avail_out===0)?Et:cs}function Ci(e,t){for(var n,r,o;;){if(e.lookahead<$n){if(jo(e),e.lookahead<$n&&t===Oo)return Et;if(e.lookahead===0)break}if(n=0,e.lookahead>=He&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+He-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=He-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-$n&&(e.match_length=by(e,n),e.match_length<=5&&(e.strategy===Fj||e.match_length===He&&e.strstart-e.match_start>4096)&&(e.match_length=He-1)),e.prev_length>=He&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-He,r=Tn._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-He),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+He-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=He-1,e.strstart++,r&&(Dt(e,!1),e.strm.avail_out===0))return Et}else if(e.match_available){if(r=Tn._tr_tally(e,0,e.window[e.strstart-1]),r&&Dt(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Et}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Tn._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<He-1?e.strstart:He-1,t===Yr?(Dt(e,!0),e.strm.avail_out===0?Io:Si):e.last_lit&&(Dt(e,!1),e.strm.avail_out===0)?Et:cs}function n2(e,t){for(var n,r,o,i,a=e.window;;){if(e.lookahead<=Kr){if(jo(e),e.lookahead<=Kr&&t===Oo)return Et;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=He&&e.strstart>0&&(o=e.strstart-1,r=a[o],r===a[++o]&&r===a[++o]&&r===a[++o])){i=e.strstart+Kr;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=Kr-(i-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=He?(n=Tn._tr_tally(e,1,e.match_length-He),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Tn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Dt(e,!1),e.strm.avail_out===0))return Et}return e.insert=0,t===Yr?(Dt(e,!0),e.strm.avail_out===0?Io:Si):e.last_lit&&(Dt(e,!1),e.strm.avail_out===0)?Et:cs}function r2(e,t){for(var n;;){if(e.lookahead===0&&(jo(e),e.lookahead===0)){if(t===Oo)return Et;break}if(e.match_length=0,n=Tn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Dt(e,!1),e.strm.avail_out===0))return Et}return e.insert=0,t===Yr?(Dt(e,!0),e.strm.avail_out===0?Io:Si):e.last_lit&&(Dt(e,!1),e.strm.avail_out===0)?Et:cs}function lr(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 Ei;Ei=[new lr(0,0,0,0,t2),new lr(4,4,8,4,Cf),new lr(4,5,16,8,Cf),new lr(4,6,32,32,Cf),new lr(4,4,16,16,Ci),new lr(8,16,32,32,Ci),new lr(8,16,128,128,Ci),new lr(8,32,128,256,Ci),new lr(32,128,258,1024,Ci),new lr(32,258,258,4096,Ci)];function o2(e){e.window_size=2*e.w_size,Zr(e.head),e.max_lazy_match=Ei[e.level].max_lazy,e.good_match=Ei[e.level].good_length,e.nice_match=Ei[e.level].nice_length,e.max_chain_length=Ei[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=He-1,e.match_available=0,e.ins_h=0}function i2(){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=sc,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 Gt.Buf16(Xj*2),this.dyn_dtree=new Gt.Buf16((2*Yj+1)*2),this.bl_tree=new Gt.Buf16((2*Kj+1)*2),Zr(this.dyn_ltree),Zr(this.dyn_dtree),Zr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Gt.Buf16(Zj+1),this.heap=new Gt.Buf16(2*_f+1),Zr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Gt.Buf16(2*_f+1),Zr(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 xy(e){var t;return!e||!e.state?Xr(e,Mn):(e.total_in=e.total_out=0,e.data_type=Hj,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?lc:Ao,e.adler=t.wrap===2?0:1,t.last_flush=Oo,Tn._tr_init(t),sr)}function _y(e){var t=xy(e);return t===sr&&o2(e.state),t}function a2(e,t){return!e||!e.state||e.state.wrap!==2?Mn:(e.state.gzhead=t,sr)}function Sy(e,t,n,r,o,i){if(!e)return Mn;var a=1;if(t===$j&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),o<1||o>Uj||n!==sc||r<8||r>15||t<0||t>9||i<0||i>zj)return Xr(e,Mn);r===8&&(r=9);var s=new i2;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+He-1)/He),s.window=new Gt.Buf8(s.w_size*2),s.head=new Gt.Buf16(s.hash_size),s.prev=new Gt.Buf16(s.w_size),s.lit_bufsize=1<<o+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Gt.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,_y(e)}function s2(e,t){return Sy(e,t,sc,Vj,Wj,Bj)}function l2(e,t){var n,r,o,i;if(!e||!e.state||t>wy||t<0)return e?Xr(e,Mn):Mn;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===ls&&t!==Yr)return Xr(e,e.avail_out===0?xf:Mn);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===lc)if(r.wrap===2)e.adler=0,Ke(r,31),Ke(r,139),Ke(r,8),r.gzhead?(Ke(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)),Ke(r,r.gzhead.time&255),Ke(r,r.gzhead.time>>8&255),Ke(r,r.gzhead.time>>16&255),Ke(r,r.gzhead.time>>24&255),Ke(r,r.level===9?2:r.strategy>=ac||r.level<2?4:0),Ke(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(Ke(r,r.gzhead.extra.length&255),Ke(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=qr(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Sf):(Ke(r,0),Ke(r,0),Ke(r,0),Ke(r,0),Ke(r,0),Ke(r,r.level===9?2:r.strategy>=ac||r.level<2?4:0),Ke(r,Qj),r.status=Ao);else{var a=sc+(r.w_bits-8<<4)<<8,s=-1;r.strategy>=ac||r.level<2?s=0:r.level<6?s=1:r.level===6?s=2:s=3,a|=s<<6,r.strstart!==0&&(a|=Jj),a+=31-a%31,r.status=Ao,us(r,a),r.strstart!==0&&(us(r,e.adler>>>16),us(r,e.adler&65535)),e.adler=1}if(r.status===Sf)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=qr(e.adler,r.pending_buf,r.pending-o,o)),Jr(e),o=r.pending,r.pending===r.pending_buf_size));)Ke(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>o&&(e.adler=qr(e.adler,r.pending_buf,r.pending-o,o)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=cc)}else r.status=cc;if(r.status===cc)if(r.gzhead.name){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=qr(e.adler,r.pending_buf,r.pending-o,o)),Jr(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,Ke(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>o&&(e.adler=qr(e.adler,r.pending_buf,r.pending-o,o)),i===0&&(r.gzindex=0,r.status=uc)}else r.status=uc;if(r.status===uc)if(r.gzhead.comment){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=qr(e.adler,r.pending_buf,r.pending-o,o)),Jr(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,Ke(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>o&&(e.adler=qr(e.adler,r.pending_buf,r.pending-o,o)),i===0&&(r.status=dc)}else r.status=dc;if(r.status===dc&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Jr(e),r.pending+2<=r.pending_buf_size&&(Ke(r,e.adler&255),Ke(r,e.adler>>8&255),e.adler=0,r.status=Ao)):r.status=Ao),r.pending!==0){if(Jr(e),e.avail_out===0)return r.last_flush=-1,sr}else if(e.avail_in===0&&yy(t)<=yy(n)&&t!==Yr)return Xr(e,xf);if(r.status===ls&&e.avail_in!==0)return Xr(e,xf);if(e.avail_in!==0||r.lookahead!==0||t!==Oo&&r.status!==ls){var l=r.strategy===ac?r2(r,t):r.strategy===Lj?n2(r,t):Ei[r.level].func(r,t);if((l===Io||l===Si)&&(r.status=ls),l===Et||l===Io)return e.avail_out===0&&(r.last_flush=-1),sr;if(l===cs&&(t===Aj?Tn._tr_align(r):t!==wy&&(Tn._tr_stored_block(r,0,0,!1),t===Ij&&(Zr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Jr(e),e.avail_out===0))return r.last_flush=-1,sr}return t!==Yr?sr:r.wrap<=0?vy:(r.wrap===2?(Ke(r,e.adler&255),Ke(r,e.adler>>8&255),Ke(r,e.adler>>16&255),Ke(r,e.adler>>24&255),Ke(r,e.total_in&255),Ke(r,e.total_in>>8&255),Ke(r,e.total_in>>16&255),Ke(r,e.total_in>>24&255)):(us(r,e.adler>>>16),us(r,e.adler&65535)),Jr(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?sr:vy)}function c2(e){var t;return!e||!e.state?Mn:(t=e.state.status,t!==lc&&t!==Sf&&t!==cc&&t!==uc&&t!==dc&&t!==Ao&&t!==ls?Xr(e,Mn):(e.state=null,t===Ao?Xr(e,jj):sr))}function u2(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!==lc||r.lookahead))return Mn;for(a===1&&(e.adler=gy(e.adler,t,n,0)),r.wrap=0,n>=r.w_size&&(a===0&&(Zr(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new Gt.Buf8(r.w_size),Gt.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,jo(r);r.lookahead>=He;){o=r.strstart,i=r.lookahead-(He-1);do r.ins_h=(r.ins_h<<r.hash_shift^r.window[o+He-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=He-1,jo(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=He-1,r.match_available=0,e.next_in=l,e.input=c,e.avail_in=s,r.wrap=a,sr}ir.deflateInit=s2,ir.deflateInit2=Sy,ir.deflateReset=_y,ir.deflateResetKeep=xy,ir.deflateSetHeader=a2,ir.deflate=l2,ir.deflateEnd=c2,ir.deflateSetDictionary=u2,ir.deflateInfo="pako deflate (from Nodeca project)";var $o={},fc=Tr,Cy=!0,Ey=!0;try{String.fromCharCode.apply(null,[0])}catch{Cy=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ey=!1}for(var ds=new fc.Buf8(256),Qr=0;Qr<256;Qr++)ds[Qr]=Qr>=252?6:Qr>=248?5:Qr>=240?4:Qr>=224?3:Qr>=192?2:1;ds[254]=ds[254]=1,$o.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 fc.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 Py(e,t){if(t<65534&&(e.subarray&&Ey||!e.subarray&&Cy))return String.fromCharCode.apply(null,fc.shrinkBuf(e,t));for(var n="",r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n}$o.buf2binstring=function(e){return Py(e,e.length)},$o.binstring2buf=function(e){for(var t=new fc.Buf8(e.length),n=0,r=t.length;n<r;n++)t[n]=e.charCodeAt(n);return t},$o.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=ds[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 Py(s,r)},$o.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+ds[e[n]]>t?n:t};function d2(){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 Ry=d2,fs=ir,hs=Tr,Ef=$o,Pf=bf,f2=Ry,Ny=Object.prototype.toString,h2=0,Rf=4,Pi=0,Ty=1,My=2,p2=-1,m2=0,g2=8;function Fo(e){if(!(this instanceof Fo))return new Fo(e);this.options=hs.assign({level:p2,method:g2,chunkSize:16384,windowBits:15,memLevel:8,strategy:m2,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 f2,this.strm.avail_out=0;var n=fs.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Pi)throw new Error(Pf[n]);if(t.header&&fs.deflateSetHeader(this.strm,t.header),t.dictionary){var r;if(typeof t.dictionary=="string"?r=Ef.string2buf(t.dictionary):Ny.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=fs.deflateSetDictionary(this.strm,r),n!==Pi)throw new Error(Pf[n]);this._dict_set=!0}}Fo.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?Rf:h2,typeof e=="string"?n.input=Ef.string2buf(e):Ny.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 hs.Buf8(r),n.next_out=0,n.avail_out=r),o=fs.deflate(n,i),o!==Ty&&o!==Pi)return this.onEnd(o),this.ended=!0,!1;(n.avail_out===0||n.avail_in===0&&(i===Rf||i===My))&&(this.options.to==="string"?this.onData(Ef.buf2binstring(hs.shrinkBuf(n.output,n.next_out))):this.onData(hs.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||n.avail_out===0)&&o!==Ty);return i===Rf?(o=fs.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Pi):(i===My&&(this.onEnd(Pi),n.avail_out=0),!0)},Fo.prototype.onData=function(e){this.chunks.push(e)},Fo.prototype.onEnd=function(e){e===Pi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=hs.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Nf(e,t){var n=new Fo(t);if(n.push(e,!0),n.err)throw n.msg||Pf[n.err];return n.result}function w2(e,t){return t=t||{},t.raw=!0,Nf(e,t)}function v2(e,t){return t=t||{},t.gzip=!0,Nf(e,t)}ts.Deflate=Fo,ts.deflate=Nf,ts.deflateRaw=w2,ts.gzip=v2;var ps={},Fn={},hc=30,y2=12,b2=function(t,n){var r,o,i,a,s,l,c,u,d,f,h,p,m,v,w,b,x,S,C,N,R,T,M,k,O;r=t.state,o=t.next_in,k=t.input,i=o+(t.avail_in-5),a=t.next_out,O=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+=k[o++]<<m,m+=8,p+=k[o++]<<m,m+=8),S=v[p&b];t:for(;;){if(C=S>>>24,p>>>=C,m-=C,C=S>>>16&255,C===0)O[a++]=S&65535;else if(C&16){N=S&65535,C&=15,C&&(m<C&&(p+=k[o++]<<m,m+=8),N+=p&(1<<C)-1,p>>>=C,m-=C),m<15&&(p+=k[o++]<<m,m+=8,p+=k[o++]<<m,m+=8),S=w[p&x];n:for(;;){if(C=S>>>24,p>>>=C,m-=C,C=S>>>16&255,C&16){if(R=S&65535,C&=15,m<C&&(p+=k[o++]<<m,m+=8,m<C&&(p+=k[o++]<<m,m+=8)),R+=p&(1<<C)-1,R>c){t.msg="invalid distance too far back",r.mode=hc;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=hc;break e}if(T=0,M=h,f===0){if(T+=u-C,C<N){N-=C;do O[a++]=h[T++];while(--C);T=a-R,M=O}}else if(f<C){if(T+=u+f-C,C-=f,C<N){N-=C;do O[a++]=h[T++];while(--C);if(T=0,f<N){C=f,N-=C;do O[a++]=h[T++];while(--C);T=a-R,M=O}}}else if(T+=f-C,C<N){N-=C;do O[a++]=h[T++];while(--C);T=a-R,M=O}for(;N>2;)O[a++]=M[T++],O[a++]=M[T++],O[a++]=M[T++],N-=3;N&&(O[a++]=M[T++],N>1&&(O[a++]=M[T++]))}else{T=a-R;do O[a++]=O[T++],O[a++]=O[T++],O[a++]=O[T++],N-=3;while(N>2);N&&(O[a++]=O[T++],N>1&&(O[a++]=O[T++]))}}else if(C&64){t.msg="invalid distance code",r.mode=hc;break e}else{S=w[(S&65535)+(p&(1<<C)-1)];continue n}break}}else if(C&64)if(C&32){r.mode=y2;break e}else{t.msg="invalid literal/length code",r.mode=hc;break e}else{S=v[(S&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},Dy=Tr,Ri=15,ky=852,Oy=592,Ay=0,Tf=1,Iy=2,x2=[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],_2=[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],S2=[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],C2=[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],E2=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,S,C,N,R,T,M=null,k=0,O,F=new Dy.Buf16(Ri+1),L=new Dy.Buf16(Ri+1),K=null,ne=0,q,X,B;for(u=0;u<=Ri;u++)F[u]=0;for(d=0;d<o;d++)F[n[r+d]]++;for(p=c,h=Ri;h>=1&&F[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&&F[f]===0;f++);for(p<f&&(p=f),w=1,u=1;u<=Ri;u++)if(w<<=1,w-=F[u],w<0)return-1;if(w>0&&(t===Ay||h!==1))return-1;for(L[1]=0,u=1;u<Ri;u++)L[u+1]=L[u]+F[u];for(d=0;d<o;d++)n[r+d]!==0&&(s[L[n[r+d]]++]=d);if(t===Ay?(M=K=s,O=19):t===Tf?(M=x2,k-=257,K=_2,ne-=257,O=256):(M=S2,K=C2,O=-1),x=0,d=0,u=f,T=a,m=p,v=0,N=-1,b=1<<p,R=b-1,t===Tf&&b>ky||t===Iy&&b>Oy)return 1;for(;;){q=u-v,s[d]<O?(X=0,B=s[d]):s[d]>O?(X=K[ne+s[d]],B=M[k+s[d]]):(X=96,B=0),S=1<<u-v,C=1<<m,f=C;do C-=S,i[T+(x>>v)+C]=q<<24|X<<16|B|0;while(C!==0);for(S=1<<u-1;x&S;)S>>=1;if(S!==0?(x&=S-1,x+=S):x=0,d++,--F[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-=F[m+v],!(w<=0));)m++,w<<=1;if(b+=1<<m,t===Tf&&b>ky||t===Iy&&b>Oy)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},wn=Tr,Mf=py,cr=my,P2=b2,ms=E2,R2=0,jy=1,$y=2,Fy=4,N2=5,pc=6,Lo=0,T2=1,M2=2,Dn=-2,Ly=-3,zy=-4,D2=-5,By=8,Hy=1,Uy=2,Vy=3,Wy=4,Gy=5,qy=6,Yy=7,Ky=8,Xy=9,Zy=10,mc=11,Dr=12,Df=13,Jy=14,kf=15,Qy=16,e0=17,t0=18,n0=19,gc=20,wc=21,r0=22,o0=23,i0=24,a0=25,s0=26,Of=27,l0=28,c0=29,ut=30,u0=31,k2=32,O2=852,A2=592,I2=15,j2=I2;function d0(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function $2(){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 wn.Buf16(320),this.work=new wn.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f0(e){var t;return!e||!e.state?Dn:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Hy,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new wn.Buf32(O2),t.distcode=t.distdyn=new wn.Buf32(A2),t.sane=1,t.back=-1,Lo)}function h0(e){var t;return!e||!e.state?Dn:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,f0(e))}function p0(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))?Dn:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,h0(e))}function m0(e,t){var n,r;return e?(r=new $2,e.state=r,r.window=null,n=p0(e,t),n!==Lo&&(e.state=null),n):Dn}function F2(e){return m0(e,j2)}var g0=!0,Af,If;function L2(e){if(g0){var t;for(Af=new wn.Buf32(512),If=new wn.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(ms(jy,e.lens,0,288,Af,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ms($y,e.lens,0,32,If,0,e.work,{bits:5}),g0=!1}e.lencode=Af,e.lenbits=9,e.distcode=If,e.distbits=5}function w0(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 wn.Buf8(i.wsize)),r>=i.wsize?(wn.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),wn.arraySet(i.window,t,n-r,o,i.wnext),r-=o,r?(wn.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 z2(e,t){var n,r,o,i,a,s,l,c,u,d,f,h,p,m,v=0,w,b,x,S,C,N,R,T,M=new wn.Buf8(4),k,O,F=[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 Dn;n=e.state,n.mode===Dr&&(n.mode=Df),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=Lo;e:for(;;)switch(n.mode){case Hy:if(n.wrap===0){n.mode=Df;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=cr(n.check,M,2,0),c=0,u=0,n.mode=Uy;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=ut;break}if((c&15)!==By){e.msg="unknown compression method",n.mode=ut;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=ut;break}n.dmax=1<<R,e.adler=n.check=1,n.mode=c&512?Zy:Dr,c=0,u=0;break;case Uy:for(;u<16;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}if(n.flags=c,(n.flags&255)!==By){e.msg="unknown compression method",n.mode=ut;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=ut;break}n.head&&(n.head.text=c>>8&1),n.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,n.check=cr(n.check,M,2,0)),c=0,u=0,n.mode=Vy;case Vy: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=cr(n.check,M,4,0)),c=0,u=0,n.mode=Wy;case Wy: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=cr(n.check,M,2,0)),c=0,u=0,n.mode=Gy;case Gy: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=cr(n.check,M,2,0)),c=0,u=0}else n.head&&(n.head.extra=null);n.mode=qy;case qy: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)),wn.arraySet(n.head.extra,r,i,h,R)),n.flags&512&&(n.check=cr(n.check,r,h,i)),s-=h,i+=h,n.length-=h),n.length))break e;n.length=0,n.mode=Yy;case Yy: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=cr(n.check,r,h,i)),s-=h,i+=h,R)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=Ky;case Ky: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=cr(n.check,r,h,i)),s-=h,i+=h,R)break e}else n.head&&(n.head.comment=null);n.mode=Xy;case Xy: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=ut;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=Dr;break;case Zy:for(;u<32;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}e.adler=n.check=d0(c),c=0,u=0,n.mode=mc;case mc: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,M2;e.adler=n.check=1,n.mode=Dr;case Dr:if(t===N2||t===pc)break e;case Df:if(n.last){c>>>=u&7,u-=u&7,n.mode=Of;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=Jy;break;case 1:if(L2(n),n.mode=gc,t===pc){c>>>=2,u-=2;break e}break;case 2:n.mode=e0;break;case 3:e.msg="invalid block type",n.mode=ut}c>>>=2,u-=2;break;case Jy: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=ut;break}if(n.length=c&65535,c=0,u=0,n.mode=kf,t===pc)break e;case kf:n.mode=Qy;case Qy:if(h=n.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;wn.arraySet(o,r,i,h,a),s-=h,i+=h,l-=h,a+=h,n.length-=h;break}n.mode=Dr;break;case e0: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=ut;break}n.have=0,n.mode=t0;case t0:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}n.lens[F[n.have++]]=c&7,c>>>=3,u-=3}for(;n.have<19;)n.lens[F[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,k={bits:n.lenbits},T=ms(R2,n.lens,0,19,n.lencode,0,n.work,k),n.lenbits=k.bits,T){e.msg="invalid code lengths set",n.mode=ut;break}n.have=0,n.mode=n0;case n0: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(O=w+2;u<O;){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=ut;break}R=n.lens[n.have-1],h=3+(c&3),c>>>=2,u-=2}else if(x===17){for(O=w+3;u<O;){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(O=w+7;u<O;){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=ut;break}for(;h--;)n.lens[n.have++]=R}}if(n.mode===ut)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=ut;break}if(n.lenbits=9,k={bits:n.lenbits},T=ms(jy,n.lens,0,n.nlen,n.lencode,0,n.work,k),n.lenbits=k.bits,T){e.msg="invalid literal/lengths set",n.mode=ut;break}if(n.distbits=6,n.distcode=n.distdyn,k={bits:n.distbits},T=ms($y,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,k),n.distbits=k.bits,T){e.msg="invalid distances set",n.mode=ut;break}if(n.mode=gc,t===pc)break e;case gc:n.mode=wc;case wc: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,P2(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===Dr&&(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(S=w,C=b,N=x;v=n.lencode[N+((c&(1<<S+C)-1)>>S)],w=v>>>24,b=v>>>16&255,x=v&65535,!(S+w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}c>>>=S,u-=S,n.back+=S}if(c>>>=w,u-=w,n.back+=w,n.length=x,b===0){n.mode=s0;break}if(b&32){n.back=-1,n.mode=Dr;break}if(b&64){e.msg="invalid literal/length code",n.mode=ut;break}n.extra=b&15,n.mode=r0;case r0:if(n.extra){for(O=n.extra;u<O;){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=o0;case o0: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(S=w,C=b,N=x;v=n.distcode[N+((c&(1<<S+C)-1)>>S)],w=v>>>24,b=v>>>16&255,x=v&65535,!(S+w<=u);){if(s===0)break e;s--,c+=r[i++]<<u,u+=8}c>>>=S,u-=S,n.back+=S}if(c>>>=w,u-=w,n.back+=w,b&64){e.msg="invalid distance code",n.mode=ut;break}n.offset=x,n.extra=b&15,n.mode=i0;case i0:if(n.extra){for(O=n.extra;u<O;){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=ut;break}n.mode=a0;case a0: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=ut;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=wc);break;case s0:if(l===0)break e;o[a++]=n.length,l--,n.mode=wc;break;case Of: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?cr(n.check,o,f,a-f):Mf(n.check,o,f,a-f)),f=l,(n.flags?c:d0(c))!==n.check){e.msg="incorrect data check",n.mode=ut;break}c=0,u=0}n.mode=l0;case l0: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=ut;break}c=0,u=0}n.mode=c0;case c0:T=T2;break e;case ut:T=Ly;break e;case u0:return zy;case k2:default:return Dn}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<ut&&(n.mode<Of||t!==Fy))&&w0(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?cr(n.check,o,f,e.next_out-f):Mf(n.check,o,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Dr?128:0)+(n.mode===gc||n.mode===kf?256:0),(d===0&&f===0||t===Fy)&&T===Lo&&(T=D2),T}function B2(e){if(!e||!e.state)return Dn;var t=e.state;return t.window&&(t.window=null),e.state=null,Lo}function H2(e,t){var n;return!e||!e.state||(n=e.state,!(n.wrap&2))?Dn:(n.head=t,t.done=!1,Lo)}function U2(e,t){var n=t.length,r,o,i;return!e||!e.state||(r=e.state,r.wrap!==0&&r.mode!==mc)?Dn:r.mode===mc&&(o=1,o=Mf(o,t,n,0),o!==r.check)?Ly:(i=w0(e,t,n,n),i?(r.mode=u0,zy):(r.havedict=1,Lo))}Fn.inflateReset=h0,Fn.inflateReset2=p0,Fn.inflateResetKeep=f0,Fn.inflateInit=F2,Fn.inflateInit2=m0,Fn.inflate=z2,Fn.inflateEnd=B2,Fn.inflateGetHeader=H2,Fn.inflateSetDictionary=U2,Fn.inflateInfo="pako inflate (from Nodeca project)";var v0={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 V2(){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 W2=V2,Ni=Fn,gs=Tr,vc=$o,yt=v0,jf=bf,G2=Ry,q2=W2,y0=Object.prototype.toString;function zo(e){if(!(this instanceof zo))return new zo(e);this.options=gs.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 G2,this.strm.avail_out=0;var n=Ni.inflateInit2(this.strm,t.windowBits);if(n!==yt.Z_OK)throw new Error(jf[n]);if(this.header=new q2,Ni.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=vc.string2buf(t.dictionary):y0.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Ni.inflateSetDictionary(this.strm,t.dictionary),n!==yt.Z_OK)))throw new Error(jf[n])}zo.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?yt.Z_FINISH:yt.Z_NO_FLUSH,typeof e=="string"?n.input=vc.binstring2buf(e):y0.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 gs.Buf8(r),n.next_out=0,n.avail_out=r),i=Ni.inflate(n,yt.Z_NO_FLUSH),i===yt.Z_NEED_DICT&&o&&(i=Ni.inflateSetDictionary(this.strm,o)),i===yt.Z_BUF_ERROR&&u===!0&&(i=yt.Z_OK,u=!1),i!==yt.Z_STREAM_END&&i!==yt.Z_OK)return this.onEnd(i),this.ended=!0,!1;n.next_out&&(n.avail_out===0||i===yt.Z_STREAM_END||n.avail_in===0&&(a===yt.Z_FINISH||a===yt.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=vc.utf8border(n.output,n.next_out),l=n.next_out-s,c=vc.buf2string(n.output,s),n.next_out=l,n.avail_out=r-l,l&&gs.arraySet(n.output,n.output,s,l,0),this.onData(c)):this.onData(gs.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!==yt.Z_STREAM_END);return i===yt.Z_STREAM_END&&(a=yt.Z_FINISH),a===yt.Z_FINISH?(i=Ni.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===yt.Z_OK):(a===yt.Z_SYNC_FLUSH&&(this.onEnd(yt.Z_OK),n.avail_out=0),!0)},zo.prototype.onData=function(e){this.chunks.push(e)},zo.prototype.onEnd=function(e){e===yt.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=gs.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function $f(e,t){var n=new zo(t);if(n.push(e,!0),n.err)throw n.msg||jf[n.err];return n.result}function Y2(e,t){return t=t||{},t.raw=!0,$f(e,t)}ps.Inflate=zo,ps.inflate=$f,ps.inflateRaw=Y2,ps.ungzip=$f;var K2=Tr.assign,X2=ts,Z2=ps,J2=v0,b0={};K2(b0,X2,Z2,J2);var Q2=b0;const Ff=jn(Q2),x0=(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 e$=(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):x0(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)?x0(a,t):a}return o};const Lf=jn(e$);function _0(e){return Array.isArray(e)?e:[e]}const zf="",S0=" ",Bf="\\",t$=/^\s+$/,n$=/(?:[^\\]|^)\\$/,r$=/^\\!/,o$=/^\\#/,i$=/\r?\n/g,a$=/^\.*\/|^\.+$/,Hf="/";let C0="node-ignore";typeof Symbol<"u"&&(C0=Symbol.for("node-ignore"));const E0=C0,s$=(e,t,n)=>Object.defineProperty(e,t,{value:n}),l$=/([0-z])-([0-z])/g,P0=()=>!1,c$=e=>e.replace(l$,(t,n,r)=>n.charCodeAt(0)<=r.charCodeAt(0)?t:zf),u$=e=>{const{length:t}=e;return e.slice(0,t-t%2)},d$=[[/^\uFEFF/,()=>zf],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf("\\")===0?S0:zf)],[/(\\+?)\s/g,(e,t)=>{const{length:n}=t;return t.slice(0,n-n%2)+S0}],[/[\\$.|*+(){^]/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,()=>Bf],[/\\\\/g,()=>Bf],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,o)=>t===Bf?`\\[${n}${u$(r)}${o}`:o==="]"&&r.length%2===0?`[${c$(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`]],R0=Object.create(null),f$=(e,t)=>{let n=R0[e];return n||(n=d$.reduce((r,[o,i])=>r.replace(o,i.bind(e)),e),R0[e]=n),t?new RegExp(n,"i"):new RegExp(n)},Uf=e=>typeof e=="string",h$=e=>e&&Uf(e)&&!t$.test(e)&&!n$.test(e)&&e.indexOf("#")!==0,p$=e=>e.split(i$);class m${constructor(t,n,r,o){this.origin=t,this.pattern=n,this.negative=r,this.regex=o}}const g$=(e,t)=>{const n=e;let r=!1;e.indexOf("!")===0&&(r=!0,e=e.substr(1)),e=e.replace(r$,"!").replace(o$,"#");const o=f$(e,t);return new m$(n,e,r,o)},w$=(e,t)=>{throw new t(e)},kr=(e,t,n)=>Uf(e)?e?kr.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),N0=e=>a$.test(e);kr.isNotRelative=N0,kr.convert=e=>e;class v${constructor({ignorecase:t=!0,ignoreCase:n=t,allowRelativePaths:r=!1}={}){s$(this,E0,!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[E0]){this._rules=this._rules.concat(t._rules),this._added=!0;return}if(h$(t)){const n=g$(t,this._ignoreCase);this._added=!0,this._rules.push(n)}}add(t){return this._added=!1,_0(Uf(t)?p$(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&&kr.convert(t);return kr(i,t,this._allowRelativePaths?P0:w$),this._t(i,n,r,o)}_t(t,n,r,o){if(t in n)return n[t];if(o||(o=t.split(Hf)),o.pop(),!o.length)return n[t]=this._testOne(t,r);const i=this._t(o.join(Hf)+Hf,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 _0(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}}const yc=e=>new v$(e),y$=e=>kr(e&&kr.convert(e),e,P0);yc.isPathValid=y$,yc.default=yc;var b$=yc;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,"/");kr.convert=e;const t=/^[a-z]:\//i;kr.isNotRelative=n=>t.test(n)||N0(n)}const x$=jn(b$);function _$(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ur(e,t,n){return t=t instanceof RegExp?t:new RegExp(_$(t),"g"),e.replace(t,n)}var S$={clean:function(t){if(typeof t!="string")throw new Error("Expected a string, received: "+t);return t=ur(t,"./","/"),t=ur(t,"..","."),t=ur(t," ","-"),t=ur(t,/^[~^:?*\\\-]/g,""),t=ur(t,/[~^:?*\\]/g,"-"),t=ur(t,/[~^:?*\\\-]$/g,""),t=ur(t,"@{","-"),t=ur(t,/\.$/g,""),t=ur(t,/\/$/g,""),t=ur(t,/\.lock$/g,""),t}},C$=S$;const dr=jn(C$);var E$=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}},S=function(R,T){return{elem:R,t:T}},C=function(R,T,M){var k,O,F;for(T>M?k=c[R-1+l]:k=c[R+1+l],F=Math.max(T,M),O=F-R;O<o&&F<i&&n[O]===r[F];)++O,++F;return c[R+l]=u.length,u[u.length]=new x(O,F,k),F},N=function(R){var T,M,k;for(T=M=0,k=R.length-1;k>=0;--k)for(;T<R[k].x||M<R[k].y;)R[k].y-R[k].x>M-T?(a?d[d.length]=new S(r[M],h):d[d.length]=new S(r[M],m),++M):R[k].y-R[k].x<M-T?(a?d[d.length]=new S(n[T],m):d[d.length]=new S(n[T],h),++T):(d[d.length]=new S(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,k,O,F,L,K;for(R=i-o,T=o+i+3,M={},L=0;L<T;++L)M[L]=-1,c[L]=-1;k=-1;do{for(++k,K=-k;K<=R-1;++K)M[K+l]=C(K,M[K-1+l]+1,M[K+1+l]);for(K=R+k;K>=R+1;--K)M[K+l]=C(K,M[K-1+l]+1,M[K+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*k,O=c[R+l],F=[];O!==-1;)F[F.length]=new x(u[O].x,u[O].y,null),O=u[O].k;N(F)}}},P$=E$;function R$(e,t){var n=new P$(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 T0(e,t){for(var n=[],r=e.length,o=t.length,i=R$(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 N$(e,t,n){var r,o=T0(t,e),i=T0(t,n),a=[];function s(L,K){a.push([L.file1[0],K,L.file1[1],L.file2[0],L.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(L,K){return L[0]-K[0]});var l=[],c=0;function u(L){L>c&&(l.push([1,c,L-c]),c=L)}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],S=b[x],C=h[0],N=C+h[2],R=h[3],T=R+h[4];S[0]=Math.min(R,S[0]),S[1]=Math.max(T,S[1]),S[2]=Math.min(C,S[2]),S[3]=Math.max(N,S[3])}var M=b[0][0]+(p-b[0][2]),k=b[0][1]+(m-b[0][3]),O=b[2][0]+(p-b[2][2]),F=b[2][1]+(m-b[2][3]);l.push([-1,M,k-M,p,m-p,O,F-O])}c=m}return u(t.length),l}function T$(e,t,n){var r=[],o=[e,t,n],i=N$(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 M$=T$;const D$=jn(M$);class Ge 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 Ge(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 ws extends Ge{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=ws.code,this.data={filepaths:t}}}ws.code="UnmergedPathsError";class De extends Ge{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=De.code,this.data={message:t}}}De.code="InternalError";class Ti extends Ge{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=Ti.code,this.data={filepath:t}}}Ti.code="UnsafeFilepathError";class fr{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 bc(e,t){return-(e<t)||+(e>t)}function M0(e,t){return bc(e.path,t.path)}function D0(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 hr=2**32;function k0(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 Mi(e){const[t,n]=k0(e.ctimeSeconds,e.ctimeNanoseconds,e.ctimeMs,e.ctime),[r,o]=k0(e.mtimeSeconds,e.mtimeNanoseconds,e.mtimeMs,e.mtime);return{ctimeSeconds:t%hr,ctimeNanoseconds:n%hr,mtimeSeconds:r%hr,mtimeNanoseconds:o%hr,dev:e.dev%hr,ino:e.ino%hr,mode:D0(e.mode%hr),uid:e.uid%hr,gid:e.gid%hr,size:e.size>-1?e.size%hr:0}}function k$(e){let t="";for(const n of new Uint8Array(e))n<16&&(t+="0"),t+=n.toString(16);return t}let Vf=null;async function Or(e){return Vf===null&&(Vf=await A$()),Vf?O0(e):O$(e)}function O$(e){return new Uv().update(e).digest("hex")}async function O0(e){const t=await crypto.subtle.digest("SHA-1",e);return k$(t)}async function A$(){try{if(await O0(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709")return!0}catch{}return!1}function I$(e){return{assumeValid:!!(e&32768),extended:!!(e&16384),stage:(e&12288)>>12,nameLength:e&4095}}function j$(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 Bo{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 Bo.fromBuffer(t);if(t===null)return new Bo(null);throw new De("invalid type passed to GitIndex.from")}static async fromBuffer(t){if(t.length===0)throw new De("Index file is empty (.git/index)");const n=new Bo,r=new fr(t),o=r.toString("utf8",4);if(o!=="DIRC")throw new De(`Invalid dircache magic file number: ${o}`);const i=await Or(t.slice(0,-20)),a=t.slice(-20).toString("hex");if(a!==i)throw new De(`Invalid checksum in GitIndex buffer: expected ${a} but saw ${i}`);const s=r.readUInt32BE();if(s!==2)throw new De(`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=I$(d);const f=t.indexOf(0,r.tell()+1)-r.tell();if(f<1)throw new De(`Got a path length of: ${f}`);if(u.path=r.toString("utf8",f),u.path.includes("..\\")||u.path.includes("../"))throw new Ti(u.path);let h=8-(r.tell()-12)%8;for(h===0&&(h=8);h--;){const p=r.readUInt8();if(p!==0)throw new De(`Expected 1-8 null characters but got '${p}' after ${u.path}`);if(r.eof())throw new De("Unexpected end of file")}u.stages=[],n._addEntry(u),c++}return n}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(M0)}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=Mi(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
|
+
`)}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 fr(o),a=Mi(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(j$(t)),i.write(t.path,n.length,"utf8"),o}async toObject(){const t=Buffer.alloc(12),n=new fr(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(Bo._entryToBuffer(s)),s.stages.length>1)for(const l of s.stages)l&&l!==s&&r.push(Bo._entryToBuffer(l));r=await Promise.all(r);const o=Buffer.concat(r),i=Buffer.concat([t,o]),a=await Or(i);return Buffer.concat([i,Buffer.from(a,"hex")])}}function xc(e,t,n=!0,r=!0){const o=Mi(e),i=Mi(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 Wf=null;const Di=Symbol("IndexCache");function $$(){return{map:new Map,stats:new Map}}async function F$(e,t,n){const r=await e.lstat(t),o=await e.read(t),i=await Bo.from(o);n.map.set(t,i),n.stats.set(t,r)}async function L$(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:xc(r,o)}class Rt{static async acquire({fs:t,gitdir:n,cache:r,allowUnmerged:o=!0},i){r[Di]||(r[Di]=$$());const a=`${n}/index`;Wf===null&&(Wf=new Qa({maxPending:1/0}));let s,l=[];return await Wf.acquire(a,async()=>{await L$(t,a,r[Di])&&await F$(t,a,r[Di]);const c=r[Di].map.get(a);if(l=c.unmergedPaths,l.length&&!o)throw new ws(l);if(s=await i(c),c._dirty){const u=await c.toObject();await t.write(a,u),r[Di].stats.set(a,await t.lstat(a)),c._dirty=!1}}),s}}function _c(e){const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>-1&&(e=e.slice(t+1)),e}function ki(e){const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?".":t===0?"/":e.slice(0,t)}function A0(e){const t=new Map,n=function(o){if(!t.has(o)){const i={type:"tree",fullpath:o,basename:_c(o),metadata:{},children:[]};t.set(o,i),i.parent=n(ki(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:_c(o),metadata:i,parent:n(ki(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 z$(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 De(`Unexpected GitTree entry mode: ${e.toString(8)}`)}class B${constructor({fs:t,gitdir:n,cache:r}){this.treePromise=Rt.acquire({fs:t,gitdir:n,cache:r},async function(i){return A0(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(bc),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"?{}:Mi(r.metadata);t._type=r.type==="tree"?"tree":z$(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 Sc=Symbol("GitWalkSymbol");function Oi(){const e=Object.create(null);return Object.defineProperty(e,Sc,{value:function({fs:t,gitdir:n,cache:r}){return new B$({fs:t,gitdir:n,cache:r})}}),Object.freeze(e),e}class ot extends Ge{constructor(t){super(`Could not find ${t}.`),this.code=this.name=ot.code,this.data={what:t}}}ot.code="NotFoundError";class qt extends Ge{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=qt.code,this.data={oid:t,actual:n,expected:r,filepath:o}}}qt.code="ObjectTypeError";class eo extends Ge{constructor(t){super(`Expected a 40-char hex object id but saw "${t}".`),this.code=this.name=eo.code,this.data={value:t}}}eo.code="InvalidOidError";class vs extends Ge{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/*
|
|
13
|
-
`),this.code=this.name=
|
|
14
|
-
`).map(
|
|
13
|
+
`),this.code=this.name=vs.code,this.data={remote:t}}}vs.code="NoRefspecError";class Cc{constructor(t){if(this.refs=new Map,this.parsedConfig=[],t){let n=null;this.parsedConfig=t.trim().split(`
|
|
14
|
+
`).map(r=>{if(/^\s*#/.test(r))return{line:r,comment:!0};const o=r.indexOf(" ");if(r.startsWith("^")){const i=r.slice(1);return this.refs.set(n+"^{}",i),{line:r,ref:n,peeled:i}}else{const i=r.slice(0,o);return n=r.slice(o+1),this.refs.set(n,i),{line:r,ref:n,oid:i}}})}return this}static from(t){return new Cc(t)}delete(t){this.parsedConfig=this.parsedConfig.filter(n=>n.ref!==t),this.refs.delete(t)}toString(){return this.parsedConfig.map(({line:t})=>t).join(`
|
|
15
15
|
`)+`
|
|
16
|
-
`}}class
|
|
17
|
-
`).map(
|
|
18
|
-
`)}}class
|
|
19
|
-
`,"utf8"));return{pruned:
|
|
20
|
-
`,"utf8"))}static async writeSymbolicRef({fs:t,gitdir:
|
|
21
|
-
`,"utf8"))}static async deleteRef({fs:t,gitdir:
|
|
22
|
-
`)}toObject(){const t=[...this._entries];return t.sort(Dw),Buffer.concat(t.map(r=>{const n=Buffer.from(r.mode.replace(/^0/,"")),i=Buffer.from(" "),a=Buffer.from(r.path,"utf8"),o=Buffer.from([0]),s=Buffer.from(r.oid,"hex");return Buffer.concat([n,i,a,o,s])}))}entries(){return this._entries}*[Symbol.iterator](){for(const t of this._entries)yield t}}class an{static wrap({type:t,object:r}){return Buffer.concat([Buffer.from(`${t} ${r.byteLength.toString()}\0`),Buffer.from(r)])}static unwrap(t){const r=t.indexOf(32),n=t.indexOf(0),i=t.slice(0,r).toString("utf8"),a=t.slice(r+1,n).toString("utf8"),o=t.length-(n+1);if(parseInt(a)!==o)throw new ce(`Length mismatch: expected ${a} bytes but got ${o} instead.`);return{type:i,object:Buffer.from(t.slice(n+1))}}}async function Pu({fs:e,gitdir:t,oid:r}){const n=`objects/${r.slice(0,2)}/${r.slice(2)}`,i=await e.read(`${t}/${n}`);return i?{object:i,format:"deflated",source:n}:null}function zw(e,t){const r=new Lt(e),n=Au(r);if(n!==t.byteLength)throw new ce(`applyDelta expected source buffer to be ${n} bytes but the provided buffer was ${t.length} bytes`);const i=Au(r);let a;const o=Du(r,t);if(o.byteLength===i)a=o;else{a=Buffer.alloc(i);const s=new Lt(a);for(s.copy(o);!r.eof();)s.copy(Du(r,t));const l=s.tell();if(i!==l)throw new ce(`applyDelta expected target buffer to be ${i} bytes but the resulting buffer was ${l} bytes`)}return a}function Au(e){let t=0,r=0,n=null;do n=e.readUInt8(),t|=(n&127)<<r,r+=7;while(n&128);return t}function $u(e,t,r){let n=0,i=0;for(;r--;)t&1&&(n|=e.readUInt8()<<i),t>>=1,i+=8;return n}function Du(e,t){const r=e.readUInt8(),n=128,i=15,a=112;if(r&n){const o=$u(e,r&i,4);let s=$u(e,(r&a)>>4,3);return s===0&&(s=65536),t.slice(o,o+s)}else return e.slice(r)}function Nw(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function Iu(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:Nw(e)}class ju{constructor(t){if(typeof Buffer>"u")throw new Error("Missing Buffer dependency");this.stream=Iu(t),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(t){if(!this.eof())return this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t),this.buffer.slice(this.undoCursor,this.cursor)}async skip(t){this.eof()||(this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:t,value:r}=await this.stream.next();return t&&(this._ended=!0,!r)?Buffer.alloc(0):(r&&(r=Buffer.from(r)),r)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(t){this.undoCursor=this.cursor,this.cursor+=t,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(t){if(this._ended)return;const r=[this.buffer];for(;this.cursor+t>Mw(r);){const n=await this._next();if(this._ended)break;r.push(n)}this.buffer=Buffer.concat(r)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}}function Mw(e){return e.reduce((t,r)=>t+r.length,0)}async function Lw(e,t){const r=new ju(e);let n=await r.read(4);if(n=n.toString("utf8"),n!=="PACK")throw new ce(`Invalid PACK header '${n}'`);let i=await r.read(4);if(i=i.readUInt32BE(0),i!==2)throw new ce(`Invalid packfile version: ${i}`);let a=await r.read(4);if(a=a.readUInt32BE(0),!(a<1))for(;!r.eof()&&a--;){const o=r.tell(),{type:s,length:l,ofs:c,reference:u}=await Fw(r),d=new Do.Inflate;for(;!d.result;){const p=await r.chunk();if(!p)break;if(d.push(p,!1),d.err)throw new ce(`Pako error: ${d.msg}`);if(d.result){if(d.result.length!==l)throw new ce("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(p.length-d.strm.avail_in);const m=r.tell();await t({data:d.result,type:s,num:a,offset:o,end:m,reference:u,ofs:c})}}}}async function Fw(e){let t=await e.byte();const r=t>>4&7;let n=t&15;if(t&128){let o=4;do t=await e.byte(),n|=(t&127)<<o,o+=7;while(t&128)}let i,a;if(r===6){let o=0;i=0;const s=[];do t=await e.byte(),i|=(t&127)<<o,o+=7,s.push(t);while(t&128);a=Buffer.from(s)}return r===7&&(a=await e.read(20)),{type:r,length:n,ofs:i,reference:a}}async function Bu(e){return Do.inflate(e)}function Uw(e){const t=[];let r=0,n=0;do{r=e.readUInt8();const i=r&127;t.push(i),n=r&128}while(n);return t.reduce((i,a)=>i+1<<7|a,-1)}function Hw(e,t){let r=t,n=4,i=null;do i=e.readUInt8(),r|=(i&127)<<n,n+=7;while(i&128);return r}class on{constructor(t){Object.assign(this,t),this.offsetCache={}}static async fromIdx({idx:t,getExternalRefDelta:r}){const n=new Lt(t);if(n.slice(4).toString("hex")!=="ff744f63")return;const a=n.readUInt32BE();if(a!==2)throw new ce(`Unable to read version ${a} packfile IDX. (Only version 2 supported)`);if(t.byteLength>2048*1024*1024)throw new ce("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");n.seek(n.tell()+4*255);const o=n.readUInt32BE(),s=[];for(let u=0;u<o;u++){const d=n.slice(20).toString("hex");s[u]=d}n.seek(n.tell()+4*o);const l=new Map;for(let u=0;u<o;u++)l.set(s[u],n.readUInt32BE());const c=n.slice(20).toString("hex");return new on({hashes:s,crcs:{},offsets:l,packfileSha:c,getExternalRefDelta:r})}static async fromPack({pack:t,getExternalRefDelta:r,onProgress:n}){const i={1:"commit",2:"tree",3:"blob",4:"tag",6:"ofs-delta",7:"ref-delta"},a={},o=t.slice(-20).toString("hex"),s=[],l={},c=new Map;let u=null,d=null;await Lw([t],async({data:x,type:y,reference:v,offset:O,num:R})=>{u===null&&(u=R);const b=Math.floor((u-R)*100/u);b!==d&&n&&await n({phase:"Receiving objects",loaded:u-R,total:u}),d=b,y=i[y],["commit","tree","blob","tag"].includes(y)?a[O]={type:y,offset:O}:y==="ofs-delta"?a[O]={type:y,offset:O}:y==="ref-delta"&&(a[O]={type:y,offset:O})});const p=Object.keys(a).map(Number);for(const[x,y]of p.entries()){const v=x+1===p.length?t.byteLength-20:p[x+1],O=a[y],R=Mp.buf(t.slice(y,v))>>>0;O.end=v,O.crc=R}const m=new on({pack:Promise.resolve(t),packfileSha:o,crcs:l,hashes:s,offsets:c,getExternalRefDelta:r});d=null;let g=0;const _=[0,0,0,0,0,0,0,0,0,0,0,0];for(let x in a){x=Number(x);const y=Math.floor(g*100/u);y!==d&&n&&await n({phase:"Resolving deltas",loaded:g,total:u}),g++,d=y;const v=a[x];if(!v.oid)try{m.readDepth=0,m.externalReadDepth=0;const{type:O,object:R}=await m.readSlice({start:x});_[m.readDepth]+=1;const b=await Vt(an.wrap({type:O,object:R}));v.oid=b,s.push(b),c.set(b,x),l[b]=v.crc}catch{continue}}return s.sort(),m}async toBuffer(){const t=[],r=(c,u)=>{t.push(Buffer.from(c,u))};r("ff744f63","hex"),r("00000002","hex");const n=new Lt(Buffer.alloc(256*4));for(let c=0;c<256;c++){let u=0;for(const d of this.hashes)parseInt(d.slice(0,2),16)<=c&&u++;n.writeUInt32BE(u)}t.push(n.buffer);for(const c of this.hashes)r(c,"hex");const i=new Lt(Buffer.alloc(this.hashes.length*4));for(const c of this.hashes)i.writeUInt32BE(this.crcs[c]);t.push(i.buffer);const a=new Lt(Buffer.alloc(this.hashes.length*4));for(const c of this.hashes)a.writeUInt32BE(this.offsets.get(c));t.push(a.buffer),r(this.packfileSha,"hex");const o=Buffer.concat(t),s=await Vt(o),l=Buffer.alloc(20);return l.write(s,"hex"),Buffer.concat([o,l])}async load({pack:t}){this.pack=t}async unload(){this.pack=null}async read({oid:t}){if(!this.offsets.get(t)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(t);throw new ce(`Could not read object ${t} from packfile`)}const r=this.offsets.get(t);return this.readSlice({start:r})}async readSlice({start:t}){if(this.offsetCache[t])return Object.assign({},this.offsetCache[t]);this.readDepth++;const r={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"};if(!this.pack)throw new ce("Tried to read from a GitPackIndex with no packfile loaded into memory");const n=(await this.pack).slice(t),i=new Lt(n),a=i.readUInt8(),o=a&112;let s=r[o];if(s===void 0)throw new ce("Unrecognized type: 0b"+o.toString(2));const l=a&15;let c=l;a&128&&(c=Hw(i,l));let d=null,p=null;if(s==="ofs_delta"){const g=Uw(i),_=t-g;({object:d,type:s}=await this.readSlice({start:_}))}if(s==="ref_delta"){const g=i.slice(20).toString("hex");({object:d,type:s}=await this.read({oid:g}))}const m=n.slice(i.tell());if(p=Buffer.from(await Bu(m)),p.byteLength!==c)throw new ce(`Packfile told us object would have length ${c} but it had length ${p.byteLength}`);return d&&(p=Buffer.from(zw(p,d))),this.readDepth>3&&(this.offsetCache[t]={type:s,object:p}),{type:s,format:"content",object:p}}}const ta=Symbol("PackfileCache");async function Ww({fs:e,filename:t,getExternalRefDelta:r,emitter:n,emitterPrefix:i}){const a=await e.read(t);return on.fromIdx({idx:a,getExternalRefDelta:r})}function Go({fs:e,cache:t,filename:r,getExternalRefDelta:n,emitter:i,emitterPrefix:a}){t[ta]||(t[ta]=new Map);let o=t[ta].get(r);return o||(o=Ww({fs:e,filename:r,getExternalRefDelta:n,emitter:i,emitterPrefix:a}),t[ta].set(r,o)),o}async function Gw({fs:e,cache:t,gitdir:r,oid:n,format:i="content",getExternalRefDelta:a}){let o=await e.readdir(N.join(r,"objects/pack"));o=o.filter(s=>s.endsWith(".idx"));for(const s of o){const l=`${r}/objects/pack/${s}`,c=await Go({fs:e,cache:t,filename:l,getExternalRefDelta:a});if(c.error)throw new ce(c.error);if(c.offsets.has(n)){if(!c.pack){const d=l.replace(/idx$/,"pack");c.pack=e.read(d)}const u=await c.read({oid:n,getExternalRefDelta:a});return u.format="content",u.source=`objects/pack/${s.replace(/idx$/,"pack")}`,u}}return null}async function De({fs:e,cache:t,gitdir:r,oid:n,format:i="content"}){const a=u=>De({fs:e,cache:t,gitdir:r,oid:u});let o;if(n==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(o={format:"wrapped",object:Buffer.from("tree 0\0")}),o||(o=await Pu({fs:e,gitdir:r,oid:n})),!o){if(o=await Gw({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:a}),!o)throw new Oe(n);return o}if(i==="deflated"||(o.format==="deflated"&&(o.object=Buffer.from(await Bu(o.object)),o.format="wrapped"),i==="wrapped"))return o;const s=await Vt(o.object);if(s!==n)throw new ce(`SHA check failed! Expected ${n}, computed ${s}`);const{object:l,type:c}=an.unwrap(o.object);if(o.type=c,o.object=l,o.format="content",i==="content")return o;throw new ce(`invalid requested format "${i}"`)}class Ot extends ye{constructor(t,r,n=!0){super(`Failed to create ${t} at ${r} because it already exists.${n?` (Hint: use 'force: true' parameter to overwrite existing ${t}.)`:""}`),this.code=this.name=Ot.code,this.data={noun:t,where:r,canForce:n}}}Ot.code="AlreadyExistsError";class Kn extends ye{constructor(t,r,n){super(`Found multiple ${t} matching "${r}" (${n.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=Kn.code,this.data={nouns:t,short:r,matches:n}}}Kn.code="AmbiguousError";class Jn extends ye{constructor(t){super(`Your local changes to the following files would be overwritten by checkout: ${t.join(", ")}`),this.code=this.name=Jn.code,this.data={filepaths:t}}}Jn.code="CheckoutConflictError";class Qn extends ye{constructor(t,r){super(`Failed to checkout "${t}" because commit ${r} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=Qn.code,this.data={ref:t,oid:r}}}Qn.code="CommitNotFetchedError";class ei extends ye{constructor(){super("Empty response from git server."),this.code=this.name=ei.code,this.data={}}}ei.code="EmptyServerResponseError";class ti extends ye{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=ti.code,this.data={}}}ti.code="FastForwardError";class ri extends ye{constructor(t,r){super(`One or more branches were not updated: ${t}`),this.code=this.name=ri.code,this.data={prettyDetails:t,result:r}}}ri.code="GitPushError";class sn extends ye{constructor(t,r,n){super(`HTTP Error: ${t} ${r}`),this.code=this.name=sn.code,this.data={statusCode:t,statusMessage:r,response:n}}}sn.code="HttpError";class fr extends ye{constructor(t){let r="invalid filepath";t==="leading-slash"||t==="trailing-slash"?r='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':t==="directory"&&(r='"filepath" should not be a directory.'),super(r),this.code=this.name=fr.code,this.data={reason:t}}}fr.code="InvalidFilepathError";class Ct extends ye{constructor(t,r){super(`"${t}" would be an invalid git reference. (Hint: a valid alternative would be "${r}".)`),this.code=this.name=Ct.code,this.data={ref:t,suggestion:r}}}Ct.code="InvalidRefNameError";class ni extends ye{constructor(t){super(`Maximum search depth of ${t} exceeded.`),this.code=this.name=ni.code,this.data={depth:t}}}ni.code="MaxDepthError";class cn extends ye{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=cn.code,this.data={}}}cn.code="MergeNotSupportedError";class ln extends ye{constructor(t,r,n,i){super(`Automatic merge failed with one or more merge conflicts in the following files: ${t.toString()}. Fix conflicts then commit the result.`),this.code=this.name=ln.code,this.data={filepaths:t,bothModified:r,deleteByUs:n,deleteByTheirs:i}}}ln.code="MergeConflictError";class Ke extends ye{constructor(t){super(`No name was provided for ${t} in the argument or in the .git/config file.`),this.code=this.name=Ke.code,this.data={role:t}}}Ke.code="MissingNameError";class lt extends ye{constructor(t){super(`The function requires a "${t}" parameter but none was provided.`),this.code=this.name=lt.code,this.data={parameter:t}}}lt.code="MissingParameterError";class ii extends ye{constructor(t){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=ii.code,this.data={errors:t},this.errors=t}}ii.code="MultipleGitError";class $r extends ye{constructor(t,r){super(`Expected "${t}" but received "${r}".`),this.code=this.name=$r.code,this.data={expected:t,actual:r}}}$r.code="ParseError";class un extends ye{constructor(t){let r="";t==="not-fast-forward"?r=" because it was not a simple fast-forward":t==="tag-exists"&&(r=" because tag already exists"),super(`Push rejected${r}. Use "force: true" to override.`),this.code=this.name=un.code,this.data={reason:t}}}un.code="PushRejectedError";class dr extends ye{constructor(t,r){super(`Remote does not support the "${t}" so the "${r}" parameter cannot be used.`),this.code=this.name=dr.code,this.data={capability:t,parameter:r}}}dr.code="RemoteCapabilityError";class ai extends ye{constructor(t,r){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${t}`),this.code=this.name=ai.code,this.data={preview:t,response:r}}}ai.code="SmartHttpError";class oi extends ye{constructor(t,r,n){super(`Git remote "${t}" uses an unrecognized transport protocol: "${r}"`),this.code=this.name=oi.code,this.data={url:t,transport:r,suggestion:n}}}oi.code="UnknownTransportError";class si extends ye{constructor(t){super(`Cannot parse remote URL: "${t}"`),this.code=this.name=si.code,this.data={url:t}}}si.code="UrlParseError";class fn extends ye{constructor(){super("The operation was canceled."),this.code=this.name=fn.code,this.data={}}}fn.code="UserCanceledError";class ci extends ye{constructor(t){super(`Could not merge index: Entry for '${t}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=ci.code,this.data={filepath:t}}}ci.code="IndexResetError";class li extends ye{constructor(t){super(`"${t}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=li.code,this.data={ref:t}}}li.code="NoCommitError";var qw=Object.freeze({__proto__:null,AlreadyExistsError:Ot,AmbiguousError:Kn,CheckoutConflictError:Jn,CommitNotFetchedError:Qn,EmptyServerResponseError:ei,FastForwardError:ti,GitPushError:ri,HttpError:sn,InternalError:ce,InvalidFilepathError:fr,InvalidOidError:lr,InvalidRefNameError:Ct,MaxDepthError:ni,MergeNotSupportedError:cn,MergeConflictError:ln,MissingNameError:Ke,MissingParameterError:lt,MultipleGitError:ii,NoRefspecError:Zn,NotFoundError:Oe,ObjectTypeError:rt,ParseError:$r,PushRejectedError:un,RemoteCapabilityError:dr,SmartHttpError:ai,UnknownTransportError:oi,UnsafeFilepathError:Qr,UrlParseError:si,UserCanceledError:fn,UnmergedPathsError:Xn,IndexResetError:ci,NoCommitError:li});function qo({name:e,email:t,timestamp:r,timezoneOffset:n}){return n=Yw(n),`${e} <${t}> ${r} ${n}`}function Yw(e){const t=Xw(Zw(e));e=Math.abs(e);const r=Math.floor(e/60);e-=r*60;let n=String(r),i=String(e);return n.length<2&&(n="0"+n),i.length<2&&(i="0"+i),(t===-1?"-":"+")+n+i}function Xw(e){return Math.sign(e)||(Object.is(e,-0)?-1:1)}function Zw(e){return e===0?e:-e}function Kt(e){return e=e.replace(/\r/g,""),e=e.replace(/^\n+/,""),e=e.replace(/\n+$/,"")+`
|
|
23
|
-
`,e}function
|
|
16
|
+
`}}class Ec{constructor({remotePath:t,localPath:n,force:r,matchPrefix:o}){Object.assign(this,{remotePath:t,localPath:n,force:r,matchPrefix:o})}static from(t){const[n,r,o,i,a]=t.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),s=n==="+",l=o==="*";if(l!==(a==="*"))throw new De("Invalid refspec");return new Ec({remotePath:r,localPath:i,force:s,matchPrefix:l})}translate(t){if(this.matchPrefix){if(t.startsWith(this.remotePath))return this.localPath+t.replace(this.remotePath,"")}else if(t===this.remotePath)return this.localPath;return null}reverseTranslate(t){if(this.matchPrefix){if(t.startsWith(this.localPath))return this.remotePath+t.replace(this.localPath,"")}else if(t===this.localPath)return this.remotePath;return null}}class Gf{constructor(t=[]){this.rules=t}static from(t){const n=[];for(const r of t)n.push(Ec.from(r));return new Gf(n)}add(t){const n=Ec.from(t);this.rules.push(n)}translate(t){const n=[];for(const r of this.rules)for(const o of t){const i=r.translate(o);i&&n.push([o,i])}return n}translateOne(t){let n=null;for(const r of this.rules){const o=r.translate(t);o&&(n=o)}return n}localNamespaces(){return this.rules.filter(t=>t.matchPrefix).map(t=>t.localPath.replace(/\/$/,""))}}function H$(e,t){const n=e.replace(/\^\{\}$/,""),r=t.replace(/\^\{\}$/,""),o=-(n<r)||+(n>r);return o===0?e.endsWith("^{}")?1:-1:o}const U$=e=>{e=e.toLowerCase();let t=parseInt(e);return e.endsWith("k")&&(t*=1024),e.endsWith("m")&&(t*=1024*1024),e.endsWith("g")&&(t*=1024*1024*1024),t},ys=e=>{if(e=e.trim().toLowerCase(),e==="true"||e==="yes"||e==="on")return!0;if(e==="false"||e==="no"||e==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${e}`)},I0={core:{filemode:ys,bare:ys,logallrefupdates:ys,symlinks:ys,ignorecase:ys,bigFileThreshold:U$}},V$=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,W$=/^[A-Za-z0-9-.]+$/,G$=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,q$=/^[A-Za-z][A-Za-z-]*$/,Y$=/^(.*?)( *[#;].*)$/,K$=e=>{const t=V$.exec(e);if(t!=null){const[n,r]=t.slice(1);return[n,r]}return null},X$=e=>{const t=G$.exec(e);if(t!=null){const[n,r="true"]=t.slice(1),o=Z$(r),i=J$(o);return[n,i]}return null},Z$=e=>{const t=Y$.exec(e);if(t==null)return e;const[n,r]=t.slice(1);return j0(n)&&j0(r)?`${n}${r}`:n},j0=e=>(e.match(/(?:^|[^\\])"/g)||[]).length%2!==0,J$=e=>e.split("").reduce((t,n,r,o)=>{const i=n==='"'&&o[r-1]!=="\\",a=n==="\\"&&o[r+1]==='"';return i||a?t:t+n},""),$0=e=>e!=null?e.toLowerCase():null,qf=(e,t,n)=>[$0(e),t,$0(n)].filter(r=>r!=null).join("."),F0=e=>{const t=e.split("."),n=t.shift(),r=t.pop(),o=t.length?t.join("."):void 0;return{section:n,subsection:o,name:r,path:qf(n,o,r),sectionPath:qf(n,o,null)}},Q$=(e,t)=>e.reduce((n,r,o)=>t(r)?o:n,-1);class Yf{constructor(t){let n=null,r=null;this.parsedConfig=t?t.split(`
|
|
17
|
+
`).map(o=>{let i=null,a=null;const s=o.trim(),l=K$(s),c=l!=null;if(c)[n,r]=l;else{const d=X$(s);d!=null&&([i,a]=d)}const u=qf(n,r,i);return{line:o,isSection:c,section:n,subsection:r,name:i,value:a,path:u}}):[]}static from(t){return new Yf(t)}async get(t,n=!1){const r=F0(t).path,o=this.parsedConfig.filter(i=>i.path===r).map(({section:i,name:a,value:s})=>{const l=I0[i]&&I0[i][a];return l?l(s):s});return n?o:o.pop()}async getall(t){return this.get(t,!0)}async getSubsections(t){return this.parsedConfig.filter(n=>n.section===t&&n.isSection).map(n=>n.subsection)}async deleteSection(t,n){this.parsedConfig=this.parsedConfig.filter(r=>!(r.section===t&&r.subsection===n))}async append(t,n){return this.set(t,n,!0)}async set(t,n,r=!1){const{section:o,subsection:i,name:a,path:s,sectionPath:l}=F0(t),c=Q$(this.parsedConfig,u=>u.path===s);if(n==null)c!==-1&&this.parsedConfig.splice(c,1);else if(c!==-1){const u=this.parsedConfig[c],d=Object.assign({},u,{name:a,value:n,modified:!0});r?this.parsedConfig.splice(c+1,0,d):this.parsedConfig[c]=d}else{const u=this.parsedConfig.findIndex(f=>f.path===l),d={section:o,subsection:i,name:a,value:n,modified:!0,path:s};if(W$.test(o)&&q$.test(a))if(u>=0)this.parsedConfig.splice(u+1,0,d);else{const f={section:o,subsection:i,modified:!0,path:l};this.parsedConfig.push(f,d)}}}toString(){return this.parsedConfig.map(({line:t,section:n,subsection:r,name:o,value:i,modified:a=!1})=>a?o!=null&&i!=null?typeof i=="string"&&/[#;]/.test(i)?` ${o} = "${i}"`:` ${o} = ${i}`:r!=null?`[${n} "${r}"]`:`[${n}]`:t).join(`
|
|
18
|
+
`)}}class bt{static async get({fs:t,gitdir:n}){const r=await t.read(`${n}/config`,{encoding:"utf8"});return Yf.from(r)}static async save({fs:t,gitdir:n,config:r}){await t.write(`${n}/config`,r.toString(),{encoding:"utf8"})}}const Pc=e=>[`${e}`,`refs/${e}`,`refs/tags/${e}`,`refs/heads/${e}`,`refs/remotes/${e}`,`refs/remotes/${e}/HEAD`],eF=["config","description","index","shallow","commondir"];let Kf;async function to(e,t){return Kf===void 0&&(Kf=new Qa),Kf.acquire(e,t)}class de{static async updateRemoteRefs({fs:t,gitdir:n,remote:r,refs:o,symrefs:i,tags:a,refspecs:s=void 0,prune:l=!1,pruneTags:c=!1}){for(const v of o.values())if(!v.match(/[0-9a-f]{40}/))throw new eo(v);const u=await bt.get({fs:t,gitdir:n});if(!s){if(s=await u.getall(`remote.${r}.fetch`),s.length===0)throw new vs(r);s.unshift(`+HEAD:refs/remotes/${r}/HEAD`)}const d=Gf.from(s),f=new Map;if(c){const v=await de.listRefs({fs:t,gitdir:n,filepath:"refs/tags"});await de.deleteRefs({fs:t,gitdir:n,refs:v.map(w=>`refs/tags/${w}`)})}if(a){for(const v of o.keys())if(v.startsWith("refs/tags")&&!v.endsWith("^{}")&&!await de.exists({fs:t,gitdir:n,ref:v})){const w=o.get(v);f.set(v,w)}}const h=d.translate([...o.keys()]);for(const[v,w]of h){const b=o.get(v);f.set(w,b)}const p=d.translate([...i.keys()]);for(const[v,w]of p){const b=i.get(v),x=d.translateOne(b);x&&f.set(w,`ref: ${x}`)}const m=[];if(l){for(const v of d.localNamespaces()){const w=(await de.listRefs({fs:t,gitdir:n,filepath:v})).map(b=>`${v}/${b}`);for(const b of w)f.has(b)||m.push(b)}m.length>0&&await de.deleteRefs({fs:t,gitdir:n,refs:m})}for(const[v,w]of f)await to(v,async()=>t.write(ue.join(n,v),`${w.trim()}
|
|
19
|
+
`,"utf8"));return{pruned:m}}static async writeRef({fs:t,gitdir:n,ref:r,value:o}){if(!o.match(/[0-9a-f]{40}/))throw new eo(o);await to(r,async()=>t.write(ue.join(n,r),`${o.trim()}
|
|
20
|
+
`,"utf8"))}static async writeSymbolicRef({fs:t,gitdir:n,ref:r,value:o}){await to(r,async()=>t.write(ue.join(n,r),`ref: ${o.trim()}
|
|
21
|
+
`,"utf8"))}static async deleteRef({fs:t,gitdir:n,ref:r}){return de.deleteRefs({fs:t,gitdir:n,refs:[r]})}static async deleteRefs({fs:t,gitdir:n,refs:r}){await Promise.all(r.map(s=>t.rm(ue.join(n,s))));let o=await to("packed-refs",async()=>t.read(`${n}/packed-refs`,{encoding:"utf8"}));const i=Cc.from(o),a=i.refs.size;for(const s of r)i.refs.has(s)&&i.delete(s);i.refs.size<a&&(o=i.toString(),await to("packed-refs",async()=>t.write(`${n}/packed-refs`,o,{encoding:"utf8"})))}static async resolve({fs:t,gitdir:n,ref:r,depth:o=void 0}){if(o!==void 0&&(o--,o===-1))return r;if(r.startsWith("ref: "))return r=r.slice(5),de.resolve({fs:t,gitdir:n,ref:r,depth:o});if(r.length===40&&/[0-9a-f]{40}/.test(r))return r;const i=await de.packedRefs({fs:t,gitdir:n}),a=Pc(r).filter(s=>!eF.includes(s));for(const s of a){const l=await to(s,async()=>await t.read(`${n}/${s}`,{encoding:"utf8"})||i.get(s));if(l)return de.resolve({fs:t,gitdir:n,ref:l.trim(),depth:o})}throw new ot(r)}static async exists({fs:t,gitdir:n,ref:r}){try{return await de.expand({fs:t,gitdir:n,ref:r}),!0}catch{return!1}}static async expand({fs:t,gitdir:n,ref:r}){if(r.length===40&&/[0-9a-f]{40}/.test(r))return r;const o=await de.packedRefs({fs:t,gitdir:n}),i=Pc(r);for(const a of i)if(await to(a,async()=>t.exists(`${n}/${a}`))||o.has(a))return a;throw new ot(r)}static async expandAgainstMap({ref:t,map:n}){const r=Pc(t);for(const o of r)if(await n.has(o))return o;throw new ot(t)}static resolveAgainstMap({ref:t,fullref:n=t,depth:r=void 0,map:o}){if(r!==void 0&&(r--,r===-1))return{fullref:n,oid:t};if(t.startsWith("ref: "))return t=t.slice(5),de.resolveAgainstMap({ref:t,fullref:n,depth:r,map:o});if(t.length===40&&/[0-9a-f]{40}/.test(t))return{fullref:n,oid:t};const i=Pc(t);for(const a of i){const s=o.get(a);if(s)return de.resolveAgainstMap({ref:s.trim(),fullref:a,depth:r,map:o})}throw new ot(t)}static async packedRefs({fs:t,gitdir:n}){const r=await to("packed-refs",async()=>t.read(`${n}/packed-refs`,{encoding:"utf8"}));return Cc.from(r).refs}static async listRefs({fs:t,gitdir:n,filepath:r}){const o=de.packedRefs({fs:t,gitdir:n});let i=null;try{i=await t.readdirDeep(`${n}/${r}`),i=i.map(a=>a.replace(`${n}/${r}/`,""))}catch{i=[]}for(let a of(await o).keys())a.startsWith(r)&&(a=a.replace(r+"/",""),i.includes(a)||i.push(a));return i.sort(H$),i}static async listBranches({fs:t,gitdir:n,remote:r}){return r?de.listRefs({fs:t,gitdir:n,filepath:`refs/remotes/${r}`}):de.listRefs({fs:t,gitdir:n,filepath:"refs/heads"})}static async listTags({fs:t,gitdir:n}){return(await de.listRefs({fs:t,gitdir:n,filepath:"refs/tags"})).filter(o=>!o.endsWith("^{}"))}}function tF(e,t){return bc(L0(e),L0(t))}function L0(e){return e.mode==="040000"?e.path+"/":e.path}function z0(e){switch(e){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new De(`Unexpected GitTree entry mode: ${e}`)}function nF(e){const t=[];let n=0;for(;n<e.length;){const r=e.indexOf(32,n);if(r===-1)throw new De(`GitTree: Error parsing buffer at byte location ${n}: Could not find the next space character.`);const o=e.indexOf(0,n);if(o===-1)throw new De(`GitTree: Error parsing buffer at byte location ${n}: Could not find the next null character.`);let i=e.slice(n,r).toString("utf8");i==="40000"&&(i="040000");const a=z0(i),s=e.slice(r+1,o).toString("utf8");if(s.includes("\\")||s.includes("/"))throw new Ti(s);const l=e.slice(o+1,o+21).toString("hex");n=o+21,t.push({mode:i,path:s,oid:l,type:a})}return t}function rF(e){if(typeof e=="number"&&(e=e.toString(8)),e.match(/^0?4.*/))return"040000";if(e.match(/^1006.*/))return"100644";if(e.match(/^1007.*/))return"100755";if(e.match(/^120.*/))return"120000";if(e.match(/^160.*/))return"160000";throw new De(`Could not understand file mode: ${e}`)}function oF(e){return!e.oid&&e.sha&&(e.oid=e.sha),e.mode=rF(e.mode),e.type||(e.type=z0(e.mode)),e}class tn{constructor(t){if(Buffer.isBuffer(t))this._entries=nF(t);else if(Array.isArray(t))this._entries=t.map(oF);else throw new De("invalid type passed to GitTree constructor");this._entries.sort(M0)}static from(t){return new tn(t)}render(){return this._entries.map(t=>`${t.mode} ${t.type} ${t.oid} ${t.path}`).join(`
|
|
22
|
+
`)}toObject(){const t=[...this._entries];return t.sort(tF),Buffer.concat(t.map(n=>{const r=Buffer.from(n.mode.replace(/^0/,"")),o=Buffer.from(" "),i=Buffer.from(n.path,"utf8"),a=Buffer.from([0]),s=Buffer.from(n.oid,"hex");return Buffer.concat([r,o,i,a,s])}))}entries(){return this._entries}*[Symbol.iterator](){for(const t of this._entries)yield t}}class Ai{static wrap({type:t,object:n}){return Buffer.concat([Buffer.from(`${t} ${n.byteLength.toString()}\0`),Buffer.from(n)])}static unwrap(t){const n=t.indexOf(32),r=t.indexOf(0),o=t.slice(0,n).toString("utf8"),i=t.slice(n+1,r).toString("utf8"),a=t.length-(r+1);if(parseInt(i)!==a)throw new De(`Length mismatch: expected ${i} bytes but got ${a} instead.`);return{type:o,object:Buffer.from(t.slice(r+1))}}}async function B0({fs:e,gitdir:t,oid:n}){const r=`objects/${n.slice(0,2)}/${n.slice(2)}`,o=await e.read(`${t}/${r}`);return o?{object:o,format:"deflated",source:r}:null}function iF(e,t){const n=new fr(e),r=H0(n);if(r!==t.byteLength)throw new De(`applyDelta expected source buffer to be ${r} bytes but the provided buffer was ${t.length} bytes`);const o=H0(n);let i;const a=V0(n,t);if(a.byteLength===o)i=a;else{i=Buffer.alloc(o);const s=new fr(i);for(s.copy(a);!n.eof();)s.copy(V0(n,t));const l=s.tell();if(o!==l)throw new De(`applyDelta expected target buffer to be ${o} bytes but the resulting buffer was ${l} bytes`)}return i}function H0(e){let t=0,n=0,r=null;do r=e.readUInt8(),t|=(r&127)<<n,n+=7;while(r&128);return t}function U0(e,t,n){let r=0,o=0;for(;n--;)t&1&&(r|=e.readUInt8()<<o),t>>=1,o+=8;return r}function V0(e,t){const n=e.readUInt8(),r=128,o=15,i=112;if(n&r){const a=U0(e,n&o,4);let s=U0(e,(n&i)>>4,3);return s===0&&(s=65536),t.slice(a,a+s)}else return e.slice(n)}function aF(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function W0(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:aF(e)}class G0{constructor(t){if(typeof Buffer>"u")throw new Error("Missing Buffer dependency");this.stream=W0(t),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(t){if(!this.eof())return this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t),this.buffer.slice(this.undoCursor,this.cursor)}async skip(t){this.eof()||(this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:t,value:n}=await this.stream.next();return t&&(this._ended=!0,!n)?Buffer.alloc(0):(n&&(n=Buffer.from(n)),n)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(t){this.undoCursor=this.cursor,this.cursor+=t,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(t){if(this._ended)return;const n=[this.buffer];for(;this.cursor+t>sF(n);){const r=await this._next();if(this._ended)break;n.push(r)}this.buffer=Buffer.concat(n)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}}function sF(e){return e.reduce((t,n)=>t+n.length,0)}async function lF(e,t){const n=new G0(e);let r=await n.read(4);if(r=r.toString("utf8"),r!=="PACK")throw new De(`Invalid PACK header '${r}'`);let o=await n.read(4);if(o=o.readUInt32BE(0),o!==2)throw new De(`Invalid packfile version: ${o}`);let i=await n.read(4);if(i=i.readUInt32BE(0),!(i<1))for(;!n.eof()&&i--;){const a=n.tell(),{type:s,length:l,ofs:c,reference:u}=await cF(n),d=new Ff.Inflate;for(;!d.result;){const f=await n.chunk();if(!f)break;if(d.push(f,!1),d.err)throw new De(`Pako error: ${d.msg}`);if(d.result){if(d.result.length!==l)throw new De("Inflated object size is different from that stated in packfile.");await n.undo(),await n.read(f.length-d.strm.avail_in);const h=n.tell();await t({data:d.result,type:s,num:i,offset:a,end:h,reference:u,ofs:c})}}}}async function cF(e){let t=await e.byte();const n=t>>4&7;let r=t&15;if(t&128){let a=4;do t=await e.byte(),r|=(t&127)<<a,a+=7;while(t&128)}let o,i;if(n===6){let a=0;o=0;const s=[];do t=await e.byte(),o|=(t&127)<<a,a+=7,s.push(t);while(t&128);i=Buffer.from(s)}return n===7&&(i=await e.read(20)),{type:n,length:r,ofs:o,reference:i}}async function q0(e){return Ff.inflate(e)}function uF(e){const t=[];let n=0,r=0;do{n=e.readUInt8();const o=n&127;t.push(o),r=n&128}while(r);return t.reduce((o,i)=>o+1<<7|i,-1)}function dF(e,t){let n=t,r=4,o=null;do o=e.readUInt8(),n|=(o&127)<<r,r+=7;while(o&128);return n}class Ii{constructor(t){Object.assign(this,t),this.offsetCache={}}static async fromIdx({idx:t,getExternalRefDelta:n}){const r=new fr(t);if(r.slice(4).toString("hex")!=="ff744f63")return;const i=r.readUInt32BE();if(i!==2)throw new De(`Unable to read version ${i} packfile IDX. (Only version 2 supported)`);if(t.byteLength>2048*1024*1024)throw new De("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");r.seek(r.tell()+4*255);const a=r.readUInt32BE(),s=[];for(let u=0;u<a;u++){const d=r.slice(20).toString("hex");s[u]=d}r.seek(r.tell()+4*a);const l=new Map;for(let u=0;u<a;u++)l.set(s[u],r.readUInt32BE());const c=r.slice(20).toString("hex");return new Ii({hashes:s,crcs:{},offsets:l,packfileSha:c,getExternalRefDelta:n})}static async fromPack({pack:t,getExternalRefDelta:n,onProgress:r}){const o={1:"commit",2:"tree",3:"blob",4:"tag",6:"ofs-delta",7:"ref-delta"},i={},a=t.slice(-20).toString("hex"),s=[],l={},c=new Map;let u=null,d=null;await lF([t],async({data:v,type:w,reference:b,offset:x,num:S})=>{u===null&&(u=S);const C=Math.floor((u-S)*100/u);C!==d&&r&&await r({phase:"Receiving objects",loaded:u-S,total:u}),d=C,w=o[w],["commit","tree","blob","tag"].includes(w)?i[x]={type:w,offset:x}:w==="ofs-delta"?i[x]={type:w,offset:x}:w==="ref-delta"&&(i[x]={type:w,offset:x})});const f=Object.keys(i).map(Number);for(const[v,w]of f.entries()){const b=v+1===f.length?t.byteLength-20:f[v+1],x=i[w],S=sj.buf(t.slice(w,b))>>>0;x.end=b,x.crc=S}const h=new Ii({pack:Promise.resolve(t),packfileSha:a,crcs:l,hashes:s,offsets:c,getExternalRefDelta:n});d=null;let p=0;const m=[0,0,0,0,0,0,0,0,0,0,0,0];for(let v in i){v=Number(v);const w=Math.floor(p*100/u);w!==d&&r&&await r({phase:"Resolving deltas",loaded:p,total:u}),p++,d=w;const b=i[v];if(!b.oid)try{h.readDepth=0,h.externalReadDepth=0;const{type:x,object:S}=await h.readSlice({start:v});m[h.readDepth]+=1;const C=await Or(Ai.wrap({type:x,object:S}));b.oid=C,s.push(C),c.set(C,v),l[C]=b.crc}catch{continue}}return s.sort(),h}async toBuffer(){const t=[],n=(c,u)=>{t.push(Buffer.from(c,u))};n("ff744f63","hex"),n("00000002","hex");const r=new fr(Buffer.alloc(256*4));for(let c=0;c<256;c++){let u=0;for(const d of this.hashes)parseInt(d.slice(0,2),16)<=c&&u++;r.writeUInt32BE(u)}t.push(r.buffer);for(const c of this.hashes)n(c,"hex");const o=new fr(Buffer.alloc(this.hashes.length*4));for(const c of this.hashes)o.writeUInt32BE(this.crcs[c]);t.push(o.buffer);const i=new fr(Buffer.alloc(this.hashes.length*4));for(const c of this.hashes)i.writeUInt32BE(this.offsets.get(c));t.push(i.buffer),n(this.packfileSha,"hex");const a=Buffer.concat(t),s=await Or(a),l=Buffer.alloc(20);return l.write(s,"hex"),Buffer.concat([a,l])}async load({pack:t}){this.pack=t}async unload(){this.pack=null}async read({oid:t}){if(!this.offsets.get(t)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(t);throw new De(`Could not read object ${t} from packfile`)}const n=this.offsets.get(t);return this.readSlice({start:n})}async readSlice({start:t}){if(this.offsetCache[t])return Object.assign({},this.offsetCache[t]);this.readDepth++;const n={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"};if(!this.pack)throw new De("Tried to read from a GitPackIndex with no packfile loaded into memory");const r=(await this.pack).slice(t),o=new fr(r),i=o.readUInt8(),a=i&112;let s=n[a];if(s===void 0)throw new De("Unrecognized type: 0b"+a.toString(2));const l=i&15;let c=l;i&128&&(c=dF(o,l));let d=null,f=null;if(s==="ofs_delta"){const p=uF(o),m=t-p;({object:d,type:s}=await this.readSlice({start:m}))}if(s==="ref_delta"){const p=o.slice(20).toString("hex");({object:d,type:s}=await this.read({oid:p}))}const h=r.slice(o.tell());if(f=Buffer.from(await q0(h)),f.byteLength!==c)throw new De(`Packfile told us object would have length ${c} but it had length ${f.byteLength}`);return d&&(f=Buffer.from(iF(f,d))),this.readDepth>3&&(this.offsetCache[t]={type:s,object:f}),{type:s,format:"content",object:f}}}const Rc=Symbol("PackfileCache");async function fF({fs:e,filename:t,getExternalRefDelta:n,emitter:r,emitterPrefix:o}){const i=await e.read(t);return Ii.fromIdx({idx:i,getExternalRefDelta:n})}function Xf({fs:e,cache:t,filename:n,getExternalRefDelta:r,emitter:o,emitterPrefix:i}){t[Rc]||(t[Rc]=new Map);let a=t[Rc].get(n);return a||(a=fF({fs:e,filename:n,getExternalRefDelta:r,emitter:o,emitterPrefix:i}),t[Rc].set(n,a)),a}async function hF({fs:e,cache:t,gitdir:n,oid:r,format:o="content",getExternalRefDelta:i}){let a=await e.readdir(ue.join(n,"objects/pack"));a=a.filter(s=>s.endsWith(".idx"));for(const s of a){const l=`${n}/objects/pack/${s}`,c=await Xf({fs:e,cache:t,filename:l,getExternalRefDelta:i});if(c.error)throw new De(c.error);if(c.offsets.has(r)){if(!c.pack){const d=l.replace(/idx$/,"pack");c.pack=e.read(d)}const u=await c.read({oid:r,getExternalRefDelta:i});return u.format="content",u.source=`objects/pack/${s.replace(/idx$/,"pack")}`,u}}return null}async function dt({fs:e,cache:t,gitdir:n,oid:r,format:o="content"}){const i=u=>dt({fs:e,cache:t,gitdir:n,oid:u});let a;if(r==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(a={format:"wrapped",object:Buffer.from("tree 0\0")}),a||(a=await B0({fs:e,gitdir:n,oid:r})),!a){if(a=await hF({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:i}),!a)throw new ot(r);return a}if(o==="deflated"||(a.format==="deflated"&&(a.object=Buffer.from(await q0(a.object)),a.format="wrapped"),o==="wrapped"))return a;const s=await Or(a.object);if(s!==r)throw new De(`SHA check failed! Expected ${r}, computed ${s}`);const{object:l,type:c}=Ai.unwrap(a.object);if(a.type=c,a.object=l,a.format="content",o==="content")return a;throw new De(`invalid requested format "${o}"`)}class Ln extends Ge{constructor(t,n,r=!0){super(`Failed to create ${t} at ${n} because it already exists.${r?` (Hint: use 'force: true' parameter to overwrite existing ${t}.)`:""}`),this.code=this.name=Ln.code,this.data={noun:t,where:n,canForce:r}}}Ln.code="AlreadyExistsError";class bs extends Ge{constructor(t,n,r){super(`Found multiple ${t} matching "${n}" (${r.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=bs.code,this.data={nouns:t,short:n,matches:r}}}bs.code="AmbiguousError";class xs extends Ge{constructor(t){super(`Your local changes to the following files would be overwritten by checkout: ${t.join(", ")}`),this.code=this.name=xs.code,this.data={filepaths:t}}}xs.code="CheckoutConflictError";class _s extends Ge{constructor(t,n){super(`Failed to checkout "${t}" because commit ${n} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=_s.code,this.data={ref:t,oid:n}}}_s.code="CommitNotFetchedError";class Ss extends Ge{constructor(){super("Empty response from git server."),this.code=this.name=Ss.code,this.data={}}}Ss.code="EmptyServerResponseError";class Cs extends Ge{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=Cs.code,this.data={}}}Cs.code="FastForwardError";class Es extends Ge{constructor(t,n){super(`One or more branches were not updated: ${t}`),this.code=this.name=Es.code,this.data={prettyDetails:t,result:n}}}Es.code="GitPushError";class ji extends Ge{constructor(t,n,r){super(`HTTP Error: ${t} ${n}`),this.code=this.name=ji.code,this.data={statusCode:t,statusMessage:n,response:r}}}ji.code="HttpError";class no extends Ge{constructor(t){let n="invalid filepath";t==="leading-slash"||t==="trailing-slash"?n='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':t==="directory"&&(n='"filepath" should not be a directory.'),super(n),this.code=this.name=no.code,this.data={reason:t}}}no.code="InvalidFilepathError";class zn extends Ge{constructor(t,n){super(`"${t}" would be an invalid git reference. (Hint: a valid alternative would be "${n}".)`),this.code=this.name=zn.code,this.data={ref:t,suggestion:n}}}zn.code="InvalidRefNameError";class Ps extends Ge{constructor(t){super(`Maximum search depth of ${t} exceeded.`),this.code=this.name=Ps.code,this.data={depth:t}}}Ps.code="MaxDepthError";class $i extends Ge{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=$i.code,this.data={}}}$i.code="MergeNotSupportedError";class Fi extends Ge{constructor(t,n,r,o){super(`Automatic merge failed with one or more merge conflicts in the following files: ${t.toString()}. Fix conflicts then commit the result.`),this.code=this.name=Fi.code,this.data={filepaths:t,bothModified:n,deleteByUs:r,deleteByTheirs:o}}}Fi.code="MergeConflictError";class It extends Ge{constructor(t){super(`No name was provided for ${t} in the argument or in the .git/config file.`),this.code=this.name=It.code,this.data={role:t}}}It.code="MissingNameError";class nn extends Ge{constructor(t){super(`The function requires a "${t}" parameter but none was provided.`),this.code=this.name=nn.code,this.data={parameter:t}}}nn.code="MissingParameterError";class Rs extends Ge{constructor(t){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=Rs.code,this.data={errors:t},this.errors=t}}Rs.code="MultipleGitError";class Ho extends Ge{constructor(t,n){super(`Expected "${t}" but received "${n}".`),this.code=this.name=Ho.code,this.data={expected:t,actual:n}}}Ho.code="ParseError";class Li extends Ge{constructor(t){let n="";t==="not-fast-forward"?n=" because it was not a simple fast-forward":t==="tag-exists"&&(n=" because tag already exists"),super(`Push rejected${n}. Use "force: true" to override.`),this.code=this.name=Li.code,this.data={reason:t}}}Li.code="PushRejectedError";class ro extends Ge{constructor(t,n){super(`Remote does not support the "${t}" so the "${n}" parameter cannot be used.`),this.code=this.name=ro.code,this.data={capability:t,parameter:n}}}ro.code="RemoteCapabilityError";class Ns extends Ge{constructor(t,n){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${t}`),this.code=this.name=Ns.code,this.data={preview:t,response:n}}}Ns.code="SmartHttpError";class Ts extends Ge{constructor(t,n,r){super(`Git remote "${t}" uses an unrecognized transport protocol: "${n}"`),this.code=this.name=Ts.code,this.data={url:t,transport:n,suggestion:r}}}Ts.code="UnknownTransportError";class Ms extends Ge{constructor(t){super(`Cannot parse remote URL: "${t}"`),this.code=this.name=Ms.code,this.data={url:t}}}Ms.code="UrlParseError";class zi extends Ge{constructor(){super("The operation was canceled."),this.code=this.name=zi.code,this.data={}}}zi.code="UserCanceledError";class Ds extends Ge{constructor(t){super(`Could not merge index: Entry for '${t}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=Ds.code,this.data={filepath:t}}}Ds.code="IndexResetError";class ks extends Ge{constructor(t){super(`"${t}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=ks.code,this.data={ref:t}}}ks.code="NoCommitError";var pF=Object.freeze({__proto__:null,AlreadyExistsError:Ln,AmbiguousError:bs,CheckoutConflictError:xs,CommitNotFetchedError:_s,EmptyServerResponseError:Ss,FastForwardError:Cs,GitPushError:Es,HttpError:ji,InternalError:De,InvalidFilepathError:no,InvalidOidError:eo,InvalidRefNameError:zn,MaxDepthError:Ps,MergeNotSupportedError:$i,MergeConflictError:Fi,MissingNameError:It,MissingParameterError:nn,MultipleGitError:Rs,NoRefspecError:vs,NotFoundError:ot,ObjectTypeError:qt,ParseError:Ho,PushRejectedError:Li,RemoteCapabilityError:ro,SmartHttpError:Ns,UnknownTransportError:Ts,UnsafeFilepathError:Ti,UrlParseError:Ms,UserCanceledError:zi,UnmergedPathsError:ws,IndexResetError:Ds,NoCommitError:ks});function Zf({name:e,email:t,timestamp:n,timezoneOffset:r}){return r=mF(r),`${e} <${t}> ${n} ${r}`}function mF(e){const t=gF(wF(e));e=Math.abs(e);const n=Math.floor(e/60);e-=n*60;let r=String(n),o=String(e);return r.length<2&&(r="0"+r),o.length<2&&(o="0"+o),(t===-1?"-":"+")+r+o}function gF(e){return Math.sign(e)||(Object.is(e,-0)?-1:1)}function wF(e){return e===0?e:-e}function Ar(e){return e=e.replace(/\r/g,""),e=e.replace(/^\n+/,""),e=e.replace(/\n+$/,"")+`
|
|
23
|
+
`,e}function Nc(e){const[,t,n,r,o]=e.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:t,email:n,timestamp:Number(r),timezoneOffset:vF(o)}}function vF(e){let[,t,n,r]=e.match(/(\+|-)(\d\d)(\d\d)/);return r=(t==="+"?1:-1)*(Number(n)*60+Number(r)),yF(r)}function yF(e){return e===0?e:-e}class Yt{constructor(t){if(typeof t=="string")this._tag=t;else if(Buffer.isBuffer(t))this._tag=t.toString("utf8");else if(typeof t=="object")this._tag=Yt.render(t);else throw new De("invalid type passed to GitAnnotatedTag constructor")}static from(t){return new Yt(t)}static render(t){return`object ${t.object}
|
|
24
24
|
type ${t.type}
|
|
25
25
|
tag ${t.tag}
|
|
26
|
-
tagger ${
|
|
26
|
+
tagger ${Zf(t.tagger)}
|
|
27
27
|
|
|
28
28
|
${t.message}
|
|
29
29
|
${t.gpgsig?t.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(`
|
|
@@ -31,93 +31,93 @@ ${t.gpgsig?t.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexO
|
|
|
31
31
|
`))}message(){const t=this.withoutSignature();return t.slice(t.indexOf(`
|
|
32
32
|
|
|
33
33
|
`)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){const t=this.justHeaders().split(`
|
|
34
|
-
`),
|
|
35
|
-
`+
|
|
34
|
+
`),n=[];for(const o of t)o[0]===" "?n[n.length-1]+=`
|
|
35
|
+
`+o.slice(1):n.push(o);const r={};for(const o of n){const i=o.slice(0,o.indexOf(" ")),a=o.slice(o.indexOf(" ")+1);Array.isArray(r[i])?r[i].push(a):r[i]=a}return r.tagger&&(r.tagger=Nc(r.tagger)),r.committer&&(r.committer=Nc(r.committer)),r}withoutSignature(){const t=Ar(this._tag);return t.indexOf(`
|
|
36
36
|
-----BEGIN PGP SIGNATURE-----`)===-1?t:t.slice(0,t.lastIndexOf(`
|
|
37
37
|
-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(`
|
|
38
|
-
-----BEGIN PGP SIGNATURE-----`)===-1)return;const t=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return
|
|
39
|
-
`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(t,r
|
|
38
|
+
-----BEGIN PGP SIGNATURE-----`)===-1)return;const t=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return Ar(t)}payload(){return this.withoutSignature()+`
|
|
39
|
+
`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(t,n,r){const o=t.payload();let{signature:i}=await n({payload:o,secretKey:r});i=Ar(i);const a=o+i;return Yt.from(a)}}function Jf(e){return e.trim().split(`
|
|
40
40
|
`).map(t=>" "+t).join(`
|
|
41
41
|
`)+`
|
|
42
|
-
`}function
|
|
42
|
+
`}function bF(e){return e.split(`
|
|
43
43
|
`).map(t=>t.replace(/^ /,"")).join(`
|
|
44
|
-
`)}class
|
|
45
|
-
gpgsig`+
|
|
46
|
-
`+
|
|
44
|
+
`)}class ft{constructor(t){if(typeof t=="string")this._commit=t;else if(Buffer.isBuffer(t))this._commit=t.toString("utf8");else if(typeof t=="object")this._commit=ft.render(t);else throw new De("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:t,signature:n}){const r=ft.justHeaders(t),o=ft.justMessage(t),i=Ar(r+`
|
|
45
|
+
gpgsig`+Jf(n)+`
|
|
46
|
+
`+o);return new ft(i)}static from(t){return new ft(t)}toObject(){return Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return ft.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(t){return Ar(t.slice(t.indexOf(`
|
|
47
47
|
|
|
48
48
|
`)+2))}static justHeaders(t){return t.slice(0,t.indexOf(`
|
|
49
49
|
|
|
50
|
-
`))}parseHeaders(){const t=
|
|
51
|
-
`),
|
|
52
|
-
`+
|
|
53
|
-
`:
|
|
54
|
-
`,t.parent){if(t.parent.length===void 0)throw new
|
|
55
|
-
`}const
|
|
56
|
-
`;const
|
|
57
|
-
`,t.gpgsig&&(
|
|
58
|
-
`+
|
|
59
|
-
gpgsig`)===-1)return t;const
|
|
60
|
-
gpgsig`)),
|
|
61
|
-
`)+28);return
|
|
62
|
-
`+
|
|
63
|
-
gpgsig`+
|
|
64
|
-
`+
|
|
65
|
-
`),n=new TextEncoder().encode(n)}catch{}return typeof n!="string"&&(n=Buffer.from(n)),n}catch{return null}}async write(t,r,n={}){try{await this._writeFile(t,r,n);return}catch{await this.mkdir(rn(t)),await this._writeFile(t,r,n)}}async mkdir(t,r=!1){try{await this._mkdir(t);return}catch(n){if(n===null||n.code==="EEXIST")return;if(r)throw n;if(n.code==="ENOENT"){const i=rn(t);if(i==="."||i==="/"||i===t)throw n;await this.mkdir(i),await this.mkdir(t,!0)}}}async rm(t){try{await this._unlink(t)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(t,r){try{r&&r.recursive?await this._rm(t,r):await this._rmdir(t)}catch(n){if(n.code!=="ENOENT")throw n}}async readdir(t){try{const r=await this._readdir(t);return r.sort(Xi),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(t){const r=await this._readdir(t);return(await Promise.all(r.map(async i=>{const a=t+"/"+i;return(await this._stat(a)).isDirectory()?this.readdirDeep(a):a}))).reduce((i,a)=>i.concat(a),[])}async lstat(t){try{return await this._lstat(t)}catch(r){if(r.code==="ENOENT"||(r.code||"").includes("ENS"))return null;throw r}}async readlink(t,r={encoding:"buffer"}){try{const n=await this._readlink(t,r);return Buffer.isBuffer(n)?n:Buffer.from(n)}catch(n){if(n.code==="ENOENT"||(n.code||"").includes("ENS"))return null;throw n}}async writelink(t,r){return this._symlink(r.toString("utf8"),t)}}function T(e,t){if(t===void 0)throw new lt(e)}async function na(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 og({fs:e,dir:t,gitdir:r=N.join(t,".git"),commit:n="HEAD",cache:i={}}){try{T("fs",e),T("dir",t),T("gitdir",r);const a=new J(e),o=[xt({ref:n}),ui(),nn()];let s=[];await Ge.acquire({fs:a,gitdir:r,cache:i},async function(c){s=c.unmergedPaths});const l=await hr({fs:a,cache:i,dir:t,gitdir:r,trees:o,map:async function(c,[u,d,p]){const m=!await na(d,p),g=s.includes(c),_=!await na(p,u);if(m||g)return u?{path:c,mode:await u.mode(),oid:await u.oid(),type:await u.type(),content:await u.content()}:void 0;if(_)return!1;throw new ci(c)}});await Ge.acquire({fs:a,gitdir:r,cache:i},async function(c){for(const u of l)if(u!==!1){if(!u){await a.rmdir(`${t}/${u.path}`,{recursive:!0}),c.delete({filepath:u.path});continue}if(u.type==="blob"){const d=new TextDecoder().decode(u.content);await a.write(`${t}/${u.path}`,d,{mode:u.mode}),c.insert({filepath:u.path,oid:u.oid,stage:0})}}})}catch(a){throw a.caller="git.abortMerge",a}}class hn{static async isIgnored({fs:t,dir:r,gitdir:n=N.join(r,".git"),filepath:i}){if(Vi(i)===".git")return!0;if(i===".")return!1;let a="";const o=N.join(n,"info","exclude");await t.exists(o)&&(a=await t.read(o,"utf8"));const s=[{gitignore:N.join(r,".gitignore"),filepath:i}],l=i.split("/").filter(Boolean);for(let u=1;u<l.length;u++){const d=l.slice(0,u).join("/"),p=l.slice(u).join("/");s.push({gitignore:N.join(r,d,".gitignore"),filepath:p})}let c=!1;for(const u of s){let d;try{d=await t.read(u.gitignore,"utf8")}catch(g){if(g.code==="NOENT")continue}const p=Q0().add(a);p.add(d);const m=rn(u.filepath);if(m!=="."&&p.ignores(m))return!0;c?c=!p.test(u.filepath).unignored:c=p.test(u.filepath).ignored}return c}}async function sg({fs:e,gitdir:t,object:r,format:n,oid:i}){if(n!=="deflated")throw new ce("GitObjectStoreLoose expects objects to write to be in deflated format");const a=`objects/${i.slice(0,2)}/${i.slice(2)}`,o=`${t}/${a}`;await e.exists(o)||await e.write(o,r)}let Zo=null;async function Uu(e){return Zo===null&&(Zo=lg()),Zo?cg(e):Do.deflate(e)}async function cg(e){const t=new CompressionStream("deflate"),r=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(r).arrayBuffer())}function lg(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch{return!1}}async function ut({fs:e,gitdir:t,type:r,object:n,format:i="content",oid:a=void 0,dryRun:o=!1}){return i!=="deflated"&&(i!=="wrapped"&&(n=an.wrap({type:r,object:n})),a=await Vt(n),n=Buffer.from(await Uu(n))),o||await sg({fs:e,gitdir:t,object:n,format:"deflated",oid:a}),a}function Hu(e){let t;for(;~(t=e.indexOf(92));)e[t]=47;return e}async function ug({fs:e,dir:t,gitdir:r=N.join(t,".git"),filepath:n,cache:i={},force:a=!1,parallel:o=!0}){try{T("fs",e),T("dir",t),T("gitdir",r),T("filepath",n);const s=new J(e);await Ge.acquire({fs:s,gitdir:r,cache:i},async l=>Vo({dir:t,gitdir:r,fs:s,filepath:n,index:l,force:a,parallel:o}))}catch(s){throw s.caller="git.add",s}}async function Vo({dir:e,gitdir:t,fs:r,filepath:n,index:i,force:a,parallel:o}){n=Array.isArray(n)?n:[n];const s=n.map(async d=>{if(!a&&await hn.isIgnored({fs:r,dir:e,gitdir:t,filepath:d}))return;const p=await r.lstat(N.join(e,d));if(!p)throw new Oe(d);if(p.isDirectory()){const m=await r.readdir(N.join(e,d));if(o){const g=m.map(_=>Vo({dir:e,gitdir:t,fs:r,filepath:[N.join(d,_)],index:i,force:a,parallel:o}));await Promise.all(g)}else for(const g of m)await Vo({dir:e,gitdir:t,fs:r,filepath:[N.join(d,g)],index:i,force:a,parallel:o})}else{const g=await(await Le.get({fs:r,gitdir:t})).get("core.autocrlf"),_=p.isSymbolicLink()?await r.readlink(N.join(e,d)).then(Hu):await r.read(N.join(e,d),{autocrlf:g});if(_===null)throw new Oe(d);const x=await ut({fs:r,gitdir:t,type:"blob",object:_});i.insert({filepath:d,stats:p,oid:x})}}),l=await Promise.allSettled(s),c=l.filter(d=>d.status==="rejected").map(d=>d.reason);if(c.length>1)throw new ii(c);if(c.length===1)throw c[0];return l.filter(d=>d.status==="fulfilled"&&d.value).map(d=>d.value)}async function fi({fs:e,gitdir:t,path:r}){return(await Le.get({fs:e,gitdir:t})).get(r)}function Wu(e,...t){for(const r of t)if(r)for(const n of Object.keys(r)){const i=r[n];i!==void 0&&(e[n]=i)}return e}async function pr({fs:e,gitdir:t,author:r,commit:n}){const i=Math.floor(Date.now()/1e3),a={name:await fi({fs:e,gitdir:t,path:"user.name"}),email:await fi({fs:e,gitdir:t,path:"user.email"})||"",timestamp:i,timezoneOffset:new Date(i*1e3).getTimezoneOffset()},o=Wu({},a,n?n.author:void 0,r);if(o.name!==void 0)return o}async function pn({fs:e,gitdir:t,author:r,committer:n,commit:i}){const a=Math.floor(Date.now()/1e3),o={name:await fi({fs:e,gitdir:t,path:"user.name"}),email:await fi({fs:e,gitdir:t,path:"user.email"})||"",timestamp:a,timezoneOffset:new Date(a*1e3).getTimezoneOffset()},s=Wu({},o,i?i.committer:void 0,r,n);if(s.name!==void 0)return s}async function Gu({fs:e,cache:t,gitdir:r,oid:n}){const{type:i,object:a}=await De({fs:e,cache:t,gitdir:r,oid:n});if(i==="tag")return n=nt.from(a).parse().object,Gu({fs:e,cache:t,gitdir:r,oid:n});if(i!=="commit")throw new rt(n,i,"commit");return{commit:Ie.from(a),oid:n}}async function mn({fs:e,cache:t,gitdir:r,oid:n}){const{commit:i,oid:a}=await Gu({fs:e,cache:t,gitdir:r,oid:n});return{oid:a,commit:i.parse(),payload:i.withoutSignature()}}async function ia({fs:e,cache:t,onSign:r,gitdir:n,message:i,author:a,committer:o,signingKey:s,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:d,parent:p,tree:m}){let g=!1;d||(d=await U.resolve({fs:e,gitdir:n,ref:"HEAD",depth:2}));let _,x;try{_=await U.resolve({fs:e,gitdir:n,ref:d}),x=await mn({fs:e,gitdir:n,oid:_,cache:{}})}catch{g=!0}if(l&&g)throw new li(d);const y=l?await pr({fs:e,gitdir:n,author:a,commit:x.commit}):await pr({fs:e,gitdir:n,author:a});if(!y)throw new Ke("author");const v=l?await pn({fs:e,gitdir:n,author:y,committer:o,commit:x.commit}):await pn({fs:e,gitdir:n,author:y,committer:o});if(!v)throw new Ke("committer");return Ge.acquire({fs:e,gitdir:n,cache:t,allowUnmerged:!1},async function(O){const b=Eu(O.entries).get(".");if(m||(m=await qu({fs:e,gitdir:n,inode:b,dryRun:c})),p?p=await Promise.all(p.map(S=>U.resolve({fs:e,gitdir:n,ref:S}))):l?p=x.commit.parent:p=_?[_]:[],!i)if(l)i=x.commit.message;else throw new lt("message");let C=Ie.from({tree:m,parent:p,author:y,committer:v,message:i});s&&(C=await Ie.sign(C,r,s));const k=await ut({fs:e,gitdir:n,type:"commit",object:C.toObject(),dryRun:c});return!u&&!c&&await U.writeRef({fs:e,gitdir:n,ref:d,value:k}),k})}async function qu({fs:e,gitdir:t,inode:r,dryRun:n}){const i=r.children;for(const l of i)l.type==="tree"&&(l.metadata.mode="040000",l.metadata.oid=await qu({fs:e,gitdir:t,inode:l,dryRun:n}));const a=i.map(l=>({mode:l.metadata.mode,path:l.basename,oid:l.metadata.oid,type:l.type})),o=ct.from(a);return await ut({fs:e,gitdir:t,type:"tree",object:o.toObject(),dryRun:n})}async function di({fs:e,cache:t,gitdir:r,oid:n,filepath:i}){if(i.startsWith("/"))throw new fr("leading-slash");if(i.endsWith("/"))throw new fr("trailing-slash");const a=n,o=await dn({fs:e,cache:t,gitdir:r,oid:n}),s=o.tree;if(i==="")n=o.oid;else{const l=i.split("/");n=await Yu({fs:e,cache:t,gitdir:r,tree:s,pathArray:l,oid:a,filepath:i})}return n}async function Yu({fs:e,cache:t,gitdir:r,tree:n,pathArray:i,oid:a,filepath:o}){const s=i.shift();for(const l of n)if(l.path===s){if(i.length===0)return l.oid;{const{type:c,object:u}=await De({fs:e,cache:t,gitdir:r,oid:l.oid});if(c!=="tree")throw new rt(a,c,"tree",o);return n=ct.from(u),Yu({fs:e,cache:t,gitdir:r,tree:n,pathArray:i,oid:a,filepath:o})}}throw new Oe(`file or directory found at "${a}:${o}"`)}async function wn({fs:e,cache:t,gitdir:r,oid:n,filepath:i=void 0}){i!==void 0&&(n=await di({fs:e,cache:t,gitdir:r,oid:n,filepath:i}));const{tree:a,oid:o}=await dn({fs:e,cache:t,gitdir:r,oid:n});return{oid:o,tree:a.entries()}}async function hi({fs:e,gitdir:t,tree:r}){const n=ct.from(r).toObject();return await ut({fs:e,gitdir:t,type:"tree",object:n,format:"content"})}async function fg({fs:e,cache:t,onSign:r,gitdir:n,ref:i,oid:a,note:o,force:s,author:l,committer:c,signingKey:u}){let d;try{d=await U.resolve({gitdir:n,fs:e,ref:i})}catch(y){if(!(y instanceof Oe))throw y}let m=(await wn({fs:e,cache:t,gitdir:n,oid:d||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(s)m=m.filter(y=>y.path!==a);else for(const y of m)if(y.path===a)throw new Ot("note",a);typeof o=="string"&&(o=Buffer.from(o,"utf8"));const g=await ut({fs:e,gitdir:n,type:"blob",object:o,format:"content"});m.push({mode:"100644",path:a,oid:g,type:"blob"});const _=await hi({fs:e,gitdir:n,tree:m});return await ia({fs:e,cache:t,onSign:r,gitdir:n,ref:i,tree:_,parent:d&&[d],message:`Note added by 'isomorphic-git addNote'
|
|
66
|
-
`,author:l,committer:c,signingKey:u})}async function dg({fs:e,onSign:t,dir:r,gitdir:n=N.join(r,".git"),ref:i="refs/notes/commits",oid:a,note:o,force:s,author:l,committer:c,signingKey:u,cache:d={}}){try{T("fs",e),T("gitdir",n),T("oid",a),T("note",o),u&&T("onSign",t);const p=new J(e),m=await pr({fs:p,gitdir:n,author:l});if(!m)throw new Ke("author");const g=await pn({fs:p,gitdir:n,author:m,committer:c});if(!g)throw new Ke("committer");return await fg({fs:new J(p),cache:d,onSign:t,gitdir:n,ref:i,oid:a,note:o,force:s,author:m,committer:g,signingKey:u})}catch(p){throw p.caller="git.addNote",p}}async function Xu({fs:e,gitdir:t,remote:r,url:n,force:i}){if(r!==Mt.clean(r))throw new Ct(r,Mt.clean(r));const a=await Le.get({fs:e,gitdir:t});if(!i&&(await a.getSubsections("remote")).includes(r)&&n!==await a.get(`remote.${r}.url`))throw new Ot("remote",r);await a.set(`remote.${r}.url`,n),await a.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await Le.save({fs:e,gitdir:t,config:a})}async function hg({fs:e,dir:t,gitdir:r=N.join(t,".git"),remote:n,url:i,force:a=!1}){try{return T("fs",e),T("gitdir",r),T("remote",n),T("url",i),await Xu({fs:new J(e),gitdir:r,remote:n,url:i,force:a})}catch(o){throw o.caller="git.addRemote",o}}async function pg({fs:e,cache:t,onSign:r,gitdir:n,ref:i,tagger:a,message:o=i,gpgsig:s,object:l,signingKey:c,force:u=!1}){if(i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`,!u&&await U.exists({fs:e,gitdir:n,ref:i}))throw new Ot("tag",i);const d=await U.resolve({fs:e,gitdir:n,ref:l||"HEAD"}),{type:p}=await De({fs:e,cache:t,gitdir:n,oid:d});let m=nt.from({object:d,type:p,tag:i.replace("refs/tags/",""),tagger:a,message:o,gpgsig:s});c&&(m=await nt.sign(m,r,c));const g=await ut({fs:e,gitdir:n,type:"tag",object:m.toObject()});await U.writeRef({fs:e,gitdir:n,ref:i,value:g})}async function mg({fs:e,onSign:t,dir:r,gitdir:n=N.join(r,".git"),ref:i,tagger:a,message:o=i,gpgsig:s,object:l,signingKey:c,force:u=!1,cache:d={}}){try{T("fs",e),T("gitdir",n),T("ref",i),c&&T("onSign",t);const p=new J(e),m=await pr({fs:p,gitdir:n,author:a});if(!m)throw new Ke("tagger");return await pg({fs:p,cache:d,onSign:t,gitdir:n,ref:i,tagger:m,message:o,gpgsig:s,object:l,signingKey:c,force:u})}catch(p){throw p.caller="git.annotatedTag",p}}async function wg({fs:e,gitdir:t,ref:r,object:n,checkout:i=!1,force:a=!1}){if(r!==Mt.clean(r))throw new Ct(r,Mt.clean(r));const o=`refs/heads/${r}`;if(!a&&await U.exists({fs:e,gitdir:t,ref:o}))throw new Ot("branch",r,!1);let s;try{s=await U.resolve({fs:e,gitdir:t,ref:n||"HEAD"})}catch{}s&&await U.writeRef({fs:e,gitdir:t,ref:o,value:s}),i&&await U.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:o})}async function gg({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n,object:i,checkout:a=!1,force:o=!1}){try{return T("fs",e),T("gitdir",r),T("ref",n),await wg({fs:new J(e),gitdir:r,ref:n,object:i,checkout:a,force:o})}catch(s){throw s.caller="git.branch",s}}const Zu=(e,t)=>e==="."||t==null||t.length===0||t==="."?!0:t.length>=e.length?t.startsWith(e):e.startsWith(t);async function Ko({fs:e,cache:t,onProgress:r,onPostCheckout:n,dir:i,gitdir:a,remote:o,ref:s,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:d,force:p,track:m=!0}){let g;if(n)try{g=await U.resolve({fs:e,gitdir:a,ref:"HEAD"})}catch{g="0000000000000000000000000000000000000000"}let _;try{_=await U.resolve({fs:e,gitdir:a,ref:s})}catch(x){if(s==="HEAD")throw x;const y=`${o}/${s}`;if(_=await U.resolve({fs:e,gitdir:a,ref:y}),m){const v=await Le.get({fs:e,gitdir:a});await v.set(`branch.${s}.remote`,o),await v.set(`branch.${s}.merge`,`refs/heads/${s}`),await Le.save({fs:e,gitdir:a,config:v})}await U.writeRef({fs:e,gitdir:a,ref:`refs/heads/${s}`,value:_})}if(!c){let x;try{x=await yg({fs:e,cache:t,onProgress:r,dir:i,gitdir:a,ref:s,force:p,filepaths:l})}catch(b){throw b instanceof Oe&&b.data.what===_?new Qn(s,_):b}const y=x.filter(([b])=>b==="conflict").map(([b,C])=>C);if(y.length>0)throw new Jn(y);const v=x.filter(([b])=>b==="error").map(([b,C])=>C);if(v.length>0)throw new ce(v.join(", "));if(d){n&&await n({previousHead:g,newHead:_,type:l!=null&&l.length>0?"file":"branch"});return}let O=0;const R=x.length;await Ge.acquire({fs:e,gitdir:a,cache:t},async function(b){await Promise.all(x.filter(([C])=>C==="delete"||C==="delete-index").map(async function([C,k]){const S=`${i}/${k}`;C==="delete"&&await e.rm(S),b.delete({filepath:k}),r&&await r({phase:"Updating workdir",loaded:++O,total:R})}))}),await Ge.acquire({fs:e,gitdir:a,cache:t},async function(b){for(const[C,k]of x)if(C==="rmdir"||C==="rmdir-index"){const S=`${i}/${k}`;try{C==="rmdir-index"&&b.delete({filepath:k}),await e.rmdir(S),r&&await r({phase:"Updating workdir",loaded:++O,total:R})}catch(P){if(P.code==="ENOTEMPTY")console.log(`Did not delete ${k} because directory is not empty`);else throw P}}}),await Promise.all(x.filter(([b])=>b==="mkdir"||b==="mkdir-index").map(async function([b,C]){const k=`${i}/${C}`;await e.mkdir(k),r&&await r({phase:"Updating workdir",loaded:++O,total:R})})),await Ge.acquire({fs:e,gitdir:a,cache:t},async function(b){await Promise.all(x.filter(([C])=>C==="create"||C==="create-index"||C==="update"||C==="mkdir-index").map(async function([C,k,S,P,$]){const B=`${i}/${k}`;try{if(C!=="create-index"&&C!=="mkdir-index"){const{object:H}=await De({fs:e,cache:t,gitdir:a,oid:S});if($&&await e.rm(B),P===33188)await e.write(B,H);else if(P===33261)await e.write(B,H,{mode:511});else if(P===40960)await e.writelink(B,H);else throw new ce(`Invalid mode 0o${P.toString(8)} detected in blob ${S}`)}const M=await e.lstat(B);P===33261&&(M.mode=493),C==="mkdir-index"&&(M.mode=57344),b.insert({filepath:k,stats:M,oid:S}),r&&await r({phase:"Updating workdir",loaded:++O,total:R})}catch(M){console.log(M)}}))}),n&&await n({previousHead:g,newHead:_,type:l!=null&&l.length>0?"file":"branch"})}if(!u){const x=await U.expand({fs:e,gitdir:a,ref:s});x.startsWith("refs/heads")?await U.writeSymbolicRef({fs:e,gitdir:a,ref:"HEAD",value:x}):await U.writeRef({fs:e,gitdir:a,ref:"HEAD",value:_})}}async function yg({fs:e,cache:t,onProgress:r,dir:n,gitdir:i,ref:a,force:o,filepaths:s}){let l=0;return hr({fs:e,cache:t,dir:n,gitdir:i,trees:[xt({ref:a}),ui(),nn()],map:async function(c,[u,d,p]){if(c===".")return;if(s&&!s.some(g=>Zu(c,g)))return null;switch(r&&await r({phase:"Analyzing workdir",loaded:++l}),[!!p,!!u,!!d].map(Number).join("")){case"000":return;case"001":return o&&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()?o?["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()]:["conflict",c]:await u.mode()!==await d.mode()?o?["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 p.type()){case"tree":return["rmdir",c];case"blob":return await p.oid()!==await d.oid()?o?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await p.type()}`]}case"110":case"111":switch(`${await p.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await p.oid()===await u.oid()&&await p.mode()===await u.mode()&&!o)return;if(d){if(await d.oid()!==await p.oid()&&await d.oid()!==await u.oid())return o?["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()]:["conflict",c]}else if(o)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await p.mode()];return await u.mode()!==await p.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await p.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 p.type()}-${await u.type()}`]}}},reduce:async function(c,u){return u=zu(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u}})}async function Vu({fs:e,onProgress:t,onPostCheckout:r,dir:n,gitdir:i=N.join(n,".git"),remote:a="origin",ref:o,filepaths:s,noCheckout:l=!1,noUpdateHead:c=o===void 0,dryRun:u=!1,force:d=!1,track:p=!0,cache:m={}}){try{T("fs",e),T("dir",n),T("gitdir",i);const g=o||"HEAD";return await Ko({fs:new J(e),cache:m,onProgress:t,onPostCheckout:r,dir:n,gitdir:i,remote:a,ref:g,filepaths:s,noCheckout:l,noUpdateHead:c,dryRun:u,force:d,track:p})}catch(g){throw g.caller="git.checkout",g}}const bg=new RegExp("^refs/(heads/|tags/|remotes/)?(.*)");function Dr(e){const t=bg.exec(e);return t?t[1]==="remotes/"&&e.endsWith("/HEAD")?t[2].slice(0,-5):t[2]:e}async function mr({fs:e,gitdir:t,fullname:r=!1,test:n=!1}){const i=await U.resolve({fs:e,gitdir:t,ref:"HEAD",depth:2});if(n)try{await U.resolve({fs:e,gitdir:t,ref:i})}catch{return}if(i.startsWith("refs/"))return r?i:Dr(i)}function _g(e){return e=e.replace(/^git@([^:]+):/,"https://$1/"),e=e.replace(/^ssh:\/\//,"https://"),e}function Ku({username:e="",password:t=""}){return`Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`}async function pi(e,t){const r=Iu(e);for(;;){const{value:n,done:i}=await r.next();if(n&&await t(n),i)break}r.return&&r.return()}async function aa(e){let t=0;const r=[];await pi(e,a=>{r.push(a),t+=a.byteLength});const n=new Uint8Array(t);let i=0;for(const a of r)n.set(a,i),i+=a.byteLength;return n}function Ju(e){let t=e.match(/^https?:\/\/([^/]+)@/);if(t==null)return{url:e,auth:{}};t=t[1];const[r,n]=t.split(":");return e=e.replace(`${t}@`,""),{url:e,auth:{username:r,password:n}}}function Jo(e,t){const r=t.toString(16);return"0".repeat(e-r.length)+r}class Fe{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 r=t.length+4,n=Jo(4,r);return Buffer.concat([Buffer.from(n,"utf8"),t])}static streamReader(t){const r=new ju(t);return async function(){try{let i=await r.read(4);if(i==null)return!0;if(i=parseInt(i.toString("utf8"),16),i===0||i===1)return null;const a=await r.read(i-4);return a??!0}catch(i){return t.error=i,!0}}}}async function Qu(e){const t={};let r;for(;r=await e(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");const n=r.indexOf("=");if(n>-1){const i=r.slice(0,n),a=r.slice(n+1);t[i]=a}else t[r]=!0}return{protocolVersion:2,capabilities2:t}}async function ef(e,{service:t}){const r=new Set,n=new Map,i=new Map,a=Fe.streamReader(e);let o=await a();for(;o===null;)o=await a();if(o===!0)throw new ei;if(o.includes("version 2"))return Qu(a);if(o.toString("utf8").replace(/\n$/,"")!==`# service=${t}`)throw new $r(`# service=${t}\\n`,o.toString("utf8"));let s=await a();for(;s===null;)s=await a();if(s===!0)return{capabilities:r,refs:n,symrefs:i};if(s=s.toString("utf8"),s.includes("version 2"))return Qu(a);const[l,c]=Qo(s,"\0","\\x00");if(c.split(" ").map(u=>r.add(u)),l!=="0000000000000000000000000000000000000000 capabilities^{}"){const[u,d]=Qo(l," "," ");for(n.set(d,u);;){const p=await a();if(p===!0)break;if(p!==null){const[m,g]=Qo(p.toString("utf8")," "," ");n.set(g,m)}}}for(const u of r)if(u.startsWith("symref=")){const d=u.match(/symref=([^:]+):(.*)/);d.length===3&&i.set(d[1],d[2])}return{protocolVersion:1,capabilities:r,refs:n,symrefs:i}}function Qo(e,t,r){const n=e.trim().split(t);if(n.length!==2)throw new $r(`Two strings separated by '${r}'`,e.toString("utf8"));return n}const tf=(e,t)=>e.endsWith("?")?`${e}${t}`:`${e}/${t.replace(/^https?:\/\//,"")}`,rf=(e,t)=>{(t.username||t.password)&&(e.Authorization=Ku(t)),t.headers&&Object.assign(e,t.headers)},es=async e=>{try{const t=Buffer.from(await aa(e.body)),r=t.toString("utf8");return{preview:r.length<256?r:r.slice(0,256)+"...",response:r,data:t}}catch{return{}}};class oa{static async capabilities(){return["discover","connect"]}static async discover({http:t,onProgress:r,onAuth:n,onAuthSuccess:i,onAuthFailure:a,corsProxy:o,service:s,url:l,headers:c,protocolVersion:u}){let{url:d,auth:p}=Ju(l);const m=o?tf(o,d):d;(p.username||p.password)&&(c.Authorization=Ku(p)),u===2&&(c["Git-Protocol"]="version=2");let g,_,x=!1;do if(g=await t.request({onProgress:r,method:"GET",url:`${m}/info/refs?service=${s}`,headers:c}),_=!1,g.statusCode===401||g.statusCode===203){const y=x?a:n;if(y){if(p=await y(d,{...p,headers:{...c}}),p&&p.cancel)throw new fn;p&&(rf(c,p),x=!0,_=!0)}}else g.statusCode===200&&x&&i&&await i(d,p);while(_);if(g.statusCode!==200){const{response:y}=await es(g);throw new sn(g.statusCode,g.statusMessage,y)}if(g.headers["content-type"]===`application/x-${s}-advertisement`){const y=await ef(g.body,{service:s});return y.auth=p,y}else{const{preview:y,response:v,data:O}=await es(g);try{const R=await ef([O],{service:s});return R.auth=p,R}catch{throw new ai(y,v)}}}static async connect({http:t,onProgress:r,corsProxy:n,service:i,url:a,auth:o,body:s,headers:l}){const c=Ju(a);c&&(a=c.url),n&&(a=tf(n,a)),l["content-type"]=`application/x-${i}-request`,l.accept=`application/x-${i}-result`,rf(l,o);const u=await t.request({onProgress:r,method:"POST",url:`${a}/${i}`,body:s,headers:l});if(u.statusCode!==200){const{response:d}=es(u);throw new sn(u.statusCode,u.statusMessage,d)}return u}}function vg({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 sa{static getRemoteHelperFor({url:t}){const r=new Map;r.set("http",oa),r.set("https",oa);const n=vg({url:t});if(!n)throw new si(t);if(r.has(n.transport))return r.get(n.transport);throw new oi(t,n.transport,n.transport==="ssh"?_g(t):void 0)}}let Ir=null;class mi{static async read({fs:t,gitdir:r}){Ir===null&&(Ir=new Pn);const n=N.join(r,"shallow"),i=new Set;return await Ir.acquire(n,async function(){const a=await t.read(n,{encoding:"utf8"});if(a===null||a.trim()==="")return i;a.trim().split(`
|
|
67
|
-
`).map(o
|
|
50
|
+
`))}parseHeaders(){const t=ft.justHeaders(this._commit).split(`
|
|
51
|
+
`),n=[];for(const o of t)o[0]===" "?n[n.length-1]+=`
|
|
52
|
+
`+o.slice(1):n.push(o);const r={parent:[]};for(const o of n){const i=o.slice(0,o.indexOf(" ")),a=o.slice(o.indexOf(" ")+1);Array.isArray(r[i])?r[i].push(a):r[i]=a}return r.author&&(r.author=Nc(r.author)),r.committer&&(r.committer=Nc(r.committer)),r}static renderHeaders(t){let n="";if(t.tree?n+=`tree ${t.tree}
|
|
53
|
+
`:n+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
|
54
|
+
`,t.parent){if(t.parent.length===void 0)throw new De("commit 'parent' property should be an array");for(const i of t.parent)n+=`parent ${i}
|
|
55
|
+
`}const r=t.author;n+=`author ${Zf(r)}
|
|
56
|
+
`;const o=t.committer||t.author;return n+=`committer ${Zf(o)}
|
|
57
|
+
`,t.gpgsig&&(n+="gpgsig"+Jf(t.gpgsig)),n}static render(t){return ft.renderHeaders(t)+`
|
|
58
|
+
`+Ar(t.message)}render(){return this._commit}withoutSignature(){const t=Ar(this._commit);if(t.indexOf(`
|
|
59
|
+
gpgsig`)===-1)return t;const n=t.slice(0,t.indexOf(`
|
|
60
|
+
gpgsig`)),r=t.slice(t.indexOf(`-----END PGP SIGNATURE-----
|
|
61
|
+
`)+28);return Ar(n+`
|
|
62
|
+
`+r)}isolateSignature(){const t=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return bF(t)}static async sign(t,n,r){const o=t.withoutSignature(),i=ft.justMessage(t._commit);let{signature:a}=await n({payload:o,secretKey:r});a=Ar(a);const l=ft.justHeaders(t._commit)+`
|
|
63
|
+
gpgsig`+Jf(a)+`
|
|
64
|
+
`+i;return ft.from(l)}}async function Bi({fs:e,cache:t,gitdir:n,oid:r}){if(r==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:tn.from([]),oid:r};const{type:o,object:i}=await dt({fs:e,cache:t,gitdir:n,oid:r});if(o==="tag")return r=Yt.from(i).parse().object,Bi({fs:e,cache:t,gitdir:n,oid:r});if(o==="commit")return r=ft.from(i).parse().tree,Bi({fs:e,cache:t,gitdir:n,oid:r});if(o!=="tree")throw new qt(r,o,"tree");return{tree:tn.from(i),oid:r}}class xF{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 de.resolve({fs:t,gitdir:n,ref:r})}catch(c){c instanceof ot&&(s="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}const l=await Bi({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 dt({fs:r,cache:o,gitdir:i,oid:l});if(c!==s.type)throw new qt(l,c,s.type);const d=tn.from(u);for(const f of d)a.set(ue.join(n,f.path),f);return d.entries().map(f=>ue.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=D0(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 dt({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 kn({ref:e="HEAD"}={}){const t=Object.create(null);return Object.defineProperty(t,Sc,{value:function({fs:n,gitdir:r,cache:o}){return new xF({fs:n,gitdir:r,ref:e,cache:o})}}),Object.freeze(t),t}class _F{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(ue.join(o,n));return i===null?null:i.map(a=>ue.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=Mi(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 bt.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 Rt.acquire({fs:n,gitdir:r,cache:o},async function(a){const s=a.entriesMap.get(t._fullpath),l=await t.stat(),u=await(await bt.get({fs:n,gitdir:r})).get("core.filemode"),d=typeof process<"u"?process.platform!=="win32":!0;!s||xc(l,s,u,d)?await t.content()===void 0?i=void 0:(i=await Or(Ai.wrap({type:"blob",object:await t.content()})),s&&i===s.oid&&(!u||l.mode===s.mode)&&xc(l,s,u,d)&&a.insert({filepath:t._fullpath,stats:l,oid:i})):i=s.oid}),t._oid=i}return t._oid}}function Os(){const e=Object.create(null);return Object.defineProperty(e,Sc,{value:function({fs:t,dir:n,gitdir:r,cache:o}){return new _F({fs:t,dir:n,gitdir:r,cache:o})}}),Object.freeze(e),e}function SF(e,t){const n=t-e;return Array.from({length:n},(r,o)=>e+o)}const Y0=typeof Array.prototype.flat>"u"?e=>e.reduce((t,n)=>t.concat(n),[]):e=>e.flat();class CF{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*EF(e){const t=new CF;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 oo({fs:e,cache:t,dir:n,gitdir:r,trees:o,map:i=async(l,c)=>c,reduce:a=async(l,c)=>{const u=Y0(c);return l!==void 0&&u.unshift(l),u},iterate:s=(l,c)=>Promise.all([...c].map(l))}){const l=o.map(h=>h[Sc]({fs:e,dir:n,gitdir:r,cache:t})),c=new Array(l.length).fill("."),u=SF(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:EF(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 Qf(e,t){const n=await e.readdir(t);n==null?await e.rm(t):n.length?await Promise.all(n.map(r=>{const o=ue.join(t,r);return e.lstat(o).then(i=>{if(i)return i.isDirectory()?Qf(e,o):e.rm(o)})})).then(()=>e.rmdir(t)):await e.rmdir(t)}function PF(e){return RF(e)&&K0(e.then)&&K0(e.catch)}function RF(e){return e&&typeof e=="object"}function K0(e){return typeof e=="function"}function X0(e){return PF((n=>{try{return n.readFile().catch(r=>r)}catch(r){return r}})(e))}const Z0=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function J0(e,t){if(X0(t))for(const n of Z0)e[`_${n}`]=t[n].bind(t);else for(const n of Z0)e[`_${n}`]=Lf(t[n].bind(t));X0(t)?t.rm?e._rm=t.rm.bind(t):t.rmdir.length>1?e._rm=t.rmdir.bind(t):e._rm=Qf.bind(null,e):t.rm?e._rm=Lf(t.rm.bind(t)):t.rmdir.length>2?e._rm=Lf(t.rmdir.bind(t)):e._rm=Qf.bind(null,e)}class be{constructor(t){if(typeof t._original_unwrapped_fs<"u")return t;const n=Object.getOwnPropertyDescriptor(t,"promises");n&&n.enumerable?J0(this,t.promises):J0(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
|
+
`),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(ki(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=ki(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(bc),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 W(e,t){if(t===void 0)throw new nn(e)}async function Tc(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 NF({fs:e,dir:t,gitdir:n=ue.join(t,".git"),commit:r="HEAD",cache:o={}}){try{W("fs",e),W("dir",t),W("gitdir",n);const i=new be(e),a=[kn({ref:r}),Os(),Oi()];let s=[];await Rt.acquire({fs:i,gitdir:n,cache:o},async function(c){s=c.unmergedPaths});const l=await oo({fs:i,cache:o,dir:t,gitdir:n,trees:a,map:async function(c,[u,d,f]){const h=!await Tc(d,f),p=s.includes(c),m=!await Tc(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 Ds(c)}});await Rt.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 Hi{static async isIgnored({fs:t,dir:n,gitdir:r=ue.join(n,".git"),filepath:o}){if(_c(o)===".git")return!0;if(o===".")return!1;let i="";const a=ue.join(r,"info","exclude");await t.exists(a)&&(i=await t.read(a,"utf8"));const s=[{gitignore:ue.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:ue.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=x$().add(i);f.add(d);const h=ki(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 TF({fs:e,gitdir:t,object:n,format:r,oid:o}){if(r!=="deflated")throw new De("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 eh=null;async function Q0(e){return eh===null&&(eh=DF()),eh?MF(e):Ff.deflate(e)}async function MF(e){const t=new CompressionStream("deflate"),n=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}function DF(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch{return!1}}async function rn({fs:e,gitdir:t,type:n,object:r,format:o="content",oid:i=void 0,dryRun:a=!1}){return o!=="deflated"&&(o!=="wrapped"&&(r=Ai.wrap({type:n,object:r})),i=await Or(r),r=Buffer.from(await Q0(r))),a||await TF({fs:e,gitdir:t,object:r,format:"deflated",oid:i}),i}function eb(e){let t;for(;~(t=e.indexOf(92));)e[t]=47;return e}async function kF({fs:e,dir:t,gitdir:n=ue.join(t,".git"),filepath:r,cache:o={},force:i=!1,parallel:a=!0}){try{W("fs",e),W("dir",t),W("gitdir",n),W("filepath",r);const s=new be(e);await Rt.acquire({fs:s,gitdir:n,cache:o},async l=>th({dir:t,gitdir:n,fs:s,filepath:r,index:l,force:i,parallel:a}))}catch(s){throw s.caller="git.add",s}}async function th({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 Hi.isIgnored({fs:n,dir:e,gitdir:t,filepath:d}))return;const f=await n.lstat(ue.join(e,d));if(!f)throw new ot(d);if(f.isDirectory()){const h=await n.readdir(ue.join(e,d));if(a){const p=h.map(m=>th({dir:e,gitdir:t,fs:n,filepath:[ue.join(d,m)],index:o,force:i,parallel:a}));await Promise.all(p)}else for(const p of h)await th({dir:e,gitdir:t,fs:n,filepath:[ue.join(d,p)],index:o,force:i,parallel:a})}else{const p=await(await bt.get({fs:n,gitdir:t})).get("core.autocrlf"),m=f.isSymbolicLink()?await n.readlink(ue.join(e,d)).then(eb):await n.read(ue.join(e,d),{autocrlf:p});if(m===null)throw new ot(d);const v=await rn({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 Rs(c);if(c.length===1)throw c[0];return l.filter(d=>d.status==="fulfilled"&&d.value).map(d=>d.value)}async function As({fs:e,gitdir:t,path:n}){return(await bt.get({fs:e,gitdir:t})).get(n)}function tb(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 io({fs:e,gitdir:t,author:n,commit:r}){const o=Math.floor(Date.now()/1e3),i={name:await As({fs:e,gitdir:t,path:"user.name"}),email:await As({fs:e,gitdir:t,path:"user.email"})||"",timestamp:o,timezoneOffset:new Date(o*1e3).getTimezoneOffset()},a=tb({},i,r?r.author:void 0,n);if(a.name!==void 0)return a}async function Ui({fs:e,gitdir:t,author:n,committer:r,commit:o}){const i=Math.floor(Date.now()/1e3),a={name:await As({fs:e,gitdir:t,path:"user.name"}),email:await As({fs:e,gitdir:t,path:"user.email"})||"",timestamp:i,timezoneOffset:new Date(i*1e3).getTimezoneOffset()},s=tb({},a,o?o.committer:void 0,n,r);if(s.name!==void 0)return s}async function nb({fs:e,cache:t,gitdir:n,oid:r}){const{type:o,object:i}=await dt({fs:e,cache:t,gitdir:n,oid:r});if(o==="tag")return r=Yt.from(i).parse().object,nb({fs:e,cache:t,gitdir:n,oid:r});if(o!=="commit")throw new qt(r,o,"commit");return{commit:ft.from(i),oid:r}}async function Vi({fs:e,cache:t,gitdir:n,oid:r}){const{commit:o,oid:i}=await nb({fs:e,cache:t,gitdir:n,oid:r});return{oid:i,commit:o.parse(),payload:o.withoutSignature()}}async function Mc({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 de.resolve({fs:e,gitdir:r,ref:"HEAD",depth:2}));let m,v;try{m=await de.resolve({fs:e,gitdir:r,ref:d}),v=await Vi({fs:e,gitdir:r,oid:m,cache:{}})}catch{p=!0}if(l&&p)throw new ks(d);const w=l?await io({fs:e,gitdir:r,author:i,commit:v.commit}):await io({fs:e,gitdir:r,author:i});if(!w)throw new It("author");const b=l?await Ui({fs:e,gitdir:r,author:w,committer:a,commit:v.commit}):await Ui({fs:e,gitdir:r,author:w,committer:a});if(!b)throw new It("committer");return Rt.acquire({fs:e,gitdir:r,cache:t,allowUnmerged:!1},async function(x){const C=A0(x.entries).get(".");if(h||(h=await rb({fs:e,gitdir:r,inode:C,dryRun:c})),f?f=await Promise.all(f.map(T=>de.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 nn("message");let N=ft.from({tree:h,parent:f,author:w,committer:b,message:o});s&&(N=await ft.sign(N,n,s));const R=await rn({fs:e,gitdir:r,type:"commit",object:N.toObject(),dryRun:c});return!u&&!c&&await de.writeRef({fs:e,gitdir:r,ref:d,value:R}),R})}async function rb({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 rb({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=tn.from(i);return await rn({fs:e,gitdir:t,type:"tree",object:a.toObject(),dryRun:r})}async function Is({fs:e,cache:t,gitdir:n,oid:r,filepath:o}){if(o.startsWith("/"))throw new no("leading-slash");if(o.endsWith("/"))throw new no("trailing-slash");const i=r,a=await Bi({fs:e,cache:t,gitdir:n,oid:r}),s=a.tree;if(o==="")r=a.oid;else{const l=o.split("/");r=await ob({fs:e,cache:t,gitdir:n,tree:s,pathArray:l,oid:i,filepath:o})}return r}async function ob({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 dt({fs:e,cache:t,gitdir:n,oid:l.oid});if(c!=="tree")throw new qt(i,c,"tree",a);return r=tn.from(u),ob({fs:e,cache:t,gitdir:n,tree:r,pathArray:o,oid:i,filepath:a})}}throw new ot(`file or directory found at "${i}:${a}"`)}async function Wi({fs:e,cache:t,gitdir:n,oid:r,filepath:o=void 0}){o!==void 0&&(r=await Is({fs:e,cache:t,gitdir:n,oid:r,filepath:o}));const{tree:i,oid:a}=await Bi({fs:e,cache:t,gitdir:n,oid:r});return{oid:a,tree:i.entries()}}async function js({fs:e,gitdir:t,tree:n}){const r=tn.from(n).toObject();return await rn({fs:e,gitdir:t,type:"tree",object:r,format:"content"})}async function OF({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 de.resolve({gitdir:r,fs:e,ref:o})}catch(w){if(!(w instanceof ot))throw w}let h=(await Wi({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 Ln("note",i);typeof a=="string"&&(a=Buffer.from(a,"utf8"));const p=await rn({fs:e,gitdir:r,type:"blob",object:a,format:"content"});h.push({mode:"100644",path:i,oid:p,type:"blob"});const m=await js({fs:e,gitdir:r,tree:h});return await Mc({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 AF({fs:e,onSign:t,dir:n,gitdir:r=ue.join(n,".git"),ref:o="refs/notes/commits",oid:i,note:a,force:s,author:l,committer:c,signingKey:u,cache:d={}}){try{W("fs",e),W("gitdir",r),W("oid",i),W("note",a),u&&W("onSign",t);const f=new be(e),h=await io({fs:f,gitdir:r,author:l});if(!h)throw new It("author");const p=await Ui({fs:f,gitdir:r,author:h,committer:c});if(!p)throw new It("committer");return await OF({fs:new be(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 ib({fs:e,gitdir:t,remote:n,url:r,force:o}){if(n!==dr.clean(n))throw new zn(n,dr.clean(n));const i=await bt.get({fs:e,gitdir:t});if(!o&&(await i.getSubsections("remote")).includes(n)&&r!==await i.get(`remote.${n}.url`))throw new Ln("remote",n);await i.set(`remote.${n}.url`,r),await i.set(`remote.${n}.fetch`,`+refs/heads/*:refs/remotes/${n}/*`),await bt.save({fs:e,gitdir:t,config:i})}async function IF({fs:e,dir:t,gitdir:n=ue.join(t,".git"),remote:r,url:o,force:i=!1}){try{return W("fs",e),W("gitdir",n),W("remote",r),W("url",o),await ib({fs:new be(e),gitdir:n,remote:r,url:o,force:i})}catch(a){throw a.caller="git.addRemote",a}}async function jF({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 de.exists({fs:e,gitdir:r,ref:o}))throw new Ln("tag",o);const d=await de.resolve({fs:e,gitdir:r,ref:l||"HEAD"}),{type:f}=await dt({fs:e,cache:t,gitdir:r,oid:d});let h=Yt.from({object:d,type:f,tag:o.replace("refs/tags/",""),tagger:i,message:a,gpgsig:s});c&&(h=await Yt.sign(h,n,c));const p=await rn({fs:e,gitdir:r,type:"tag",object:h.toObject()});await de.writeRef({fs:e,gitdir:r,ref:o,value:p})}async function $F({fs:e,onSign:t,dir:n,gitdir:r=ue.join(n,".git"),ref:o,tagger:i,message:a=o,gpgsig:s,object:l,signingKey:c,force:u=!1,cache:d={}}){try{W("fs",e),W("gitdir",r),W("ref",o),c&&W("onSign",t);const f=new be(e),h=await io({fs:f,gitdir:r,author:i});if(!h)throw new It("tagger");return await jF({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 FF({fs:e,gitdir:t,ref:n,object:r,checkout:o=!1,force:i=!1}){if(n!==dr.clean(n))throw new zn(n,dr.clean(n));const a=`refs/heads/${n}`;if(!i&&await de.exists({fs:e,gitdir:t,ref:a}))throw new Ln("branch",n,!1);let s;try{s=await de.resolve({fs:e,gitdir:t,ref:r||"HEAD"})}catch{}s&&await de.writeRef({fs:e,gitdir:t,ref:a,value:s}),o&&await de.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:a})}async function LF({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r,object:o,checkout:i=!1,force:a=!1}){try{return W("fs",e),W("gitdir",n),W("ref",r),await FF({fs:new be(e),gitdir:n,ref:r,object:o,checkout:i,force:a})}catch(s){throw s.caller="git.branch",s}}const ab=(e,t)=>e==="."||t==null||t.length===0||t==="."?!0:t.length>=e.length?t.startsWith(e):e.startsWith(t);async function nh({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 de.resolve({fs:e,gitdir:i,ref:"HEAD"})}catch{p="0000000000000000000000000000000000000000"}let m;try{m=await de.resolve({fs:e,gitdir:i,ref:s})}catch(v){if(s==="HEAD")throw v;const w=`${a}/${s}`;if(m=await de.resolve({fs:e,gitdir:i,ref:w}),h){const b=await bt.get({fs:e,gitdir:i});await b.set(`branch.${s}.remote`,a),await b.set(`branch.${s}.merge`,`refs/heads/${s}`),await bt.save({fs:e,gitdir:i,config:b})}await de.writeRef({fs:e,gitdir:i,ref:`refs/heads/${s}`,value:m})}if(!c){let v;try{v=await zF({fs:e,cache:t,onProgress:n,dir:o,gitdir:i,ref:s,force:f,filepaths:l})}catch(C){throw C instanceof ot&&C.data.what===m?new _s(s,m):C}const w=v.filter(([C])=>C==="conflict").map(([C,N])=>N);if(w.length>0)throw new xs(w);const b=v.filter(([C])=>C==="error").map(([C,N])=>N);if(b.length>0)throw new De(b.join(", "));if(d){r&&await r({previousHead:p,newHead:m,type:l!=null&&l.length>0?"file":"branch"});return}let x=0;const S=v.length;await Rt.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:S})}))}),await Rt.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:S})}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:S})})),await Rt.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,k]){const O=`${o}/${R}`;try{if(N!=="create-index"&&N!=="mkdir-index"){const{object:L}=await dt({fs:e,cache:t,gitdir:i,oid:T});if(k&&await e.rm(O),M===33188)await e.write(O,L);else if(M===33261)await e.write(O,L,{mode:511});else if(M===40960)await e.writelink(O,L);else throw new De(`Invalid mode 0o${M.toString(8)} detected in blob ${T}`)}const F=await e.lstat(O);M===33261&&(F.mode=493),N==="mkdir-index"&&(F.mode=57344),C.insert({filepath:R,stats:F,oid:T}),n&&await n({phase:"Updating workdir",loaded:++x,total:S})}catch(F){console.log(F)}}))}),r&&await r({previousHead:p,newHead:m,type:l!=null&&l.length>0?"file":"branch"})}if(!u){const v=await de.expand({fs:e,gitdir:i,ref:s});v.startsWith("refs/heads")?await de.writeSymbolicRef({fs:e,gitdir:i,ref:"HEAD",value:v}):await de.writeRef({fs:e,gitdir:i,ref:"HEAD",value:m})}}async function zF({fs:e,cache:t,onProgress:n,dir:r,gitdir:o,ref:i,force:a,filepaths:s}){let l=0;return oo({fs:e,cache:t,dir:r,gitdir:o,trees:[kn({ref:i}),Os(),Oi()],map:async function(c,[u,d,f]){if(c===".")return;if(s&&!s.some(p=>ab(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=Y0(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u}})}async function sb({fs:e,onProgress:t,onPostCheckout:n,dir:r,gitdir:o=ue.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{W("fs",e),W("dir",r),W("gitdir",o);const p=a||"HEAD";return await nh({fs:new be(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 BF=new RegExp("^refs/(heads/|tags/|remotes/)?(.*)");function Uo(e){const t=BF.exec(e);return t?t[1]==="remotes/"&&e.endsWith("/HEAD")?t[2].slice(0,-5):t[2]:e}async function ao({fs:e,gitdir:t,fullname:n=!1,test:r=!1}){const o=await de.resolve({fs:e,gitdir:t,ref:"HEAD",depth:2});if(r)try{await de.resolve({fs:e,gitdir:t,ref:o})}catch{return}if(o.startsWith("refs/"))return n?o:Uo(o)}function HF(e){return e=e.replace(/^git@([^:]+):/,"https://$1/"),e=e.replace(/^ssh:\/\//,"https://"),e}function lb({username:e="",password:t=""}){return`Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`}async function $s(e,t){const n=W0(e);for(;;){const{value:r,done:o}=await n.next();if(r&&await t(r),o)break}n.return&&n.return()}async function Dc(e){let t=0;const n=[];await $s(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 cb(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 rh(e,t){const n=t.toString(16);return"0".repeat(e-n.length)+n}class xt{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=rh(4,n);return Buffer.concat([Buffer.from(r,"utf8"),t])}static streamReader(t){const n=new G0(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 ub(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 db(e,{service:t}){const n=new Set,r=new Map,o=new Map,i=xt.streamReader(e);let a=await i();for(;a===null;)a=await i();if(a===!0)throw new Ss;if(a.includes("version 2"))return ub(i);if(a.toString("utf8").replace(/\n$/,"")!==`# service=${t}`)throw new Ho(`# 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 ub(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 Ho(`Two strings separated by '${n}'`,e.toString("utf8"));return r}const fb=(e,t)=>e.endsWith("?")?`${e}${t}`:`${e}/${t.replace(/^https?:\/\//,"")}`,hb=(e,t)=>{(t.username||t.password)&&(e.Authorization=lb(t)),t.headers&&Object.assign(e,t.headers)},ih=async e=>{try{const t=Buffer.from(await Dc(e.body)),n=t.toString("utf8");return{preview:n.length<256?n:n.slice(0,256)+"...",response:n,data:t}}catch{return{}}};class kc{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}=cb(l);const h=a?fb(a,d):d;(f.username||f.password)&&(c.Authorization=lb(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 zi;f&&(hb(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 ih(p);throw new ji(p.statusCode,p.statusMessage,w)}if(p.headers["content-type"]===`application/x-${s}-advertisement`){const w=await db(p.body,{service:s});return w.auth=f,w}else{const{preview:w,response:b,data:x}=await ih(p);try{const S=await db([x],{service:s});return S.auth=f,S}catch{throw new Ns(w,b)}}}static async connect({http:t,onProgress:n,corsProxy:r,service:o,url:i,auth:a,body:s,headers:l}){const c=cb(i);c&&(i=c.url),r&&(i=fb(r,i)),l["content-type"]=`application/x-${o}-request`,l.accept=`application/x-${o}-result`,hb(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}=ih(u);throw new ji(u.statusCode,u.statusMessage,d)}return u}}function UF({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 Oc{static getRemoteHelperFor({url:t}){const n=new Map;n.set("http",kc),n.set("https",kc);const r=UF({url:t});if(!r)throw new Ms(t);if(n.has(r.transport))return n.get(r.transport);throw new Ts(t,r.transport,r.transport==="ssh"?HF(t):void 0)}}let Vo=null;class Fs{static async read({fs:t,gitdir:n}){Vo===null&&(Vo=new Qa);const r=ue.join(n,"shallow"),o=new Set;return await Vo.acquire(r,async function(){const i=await t.read(r,{encoding:"utf8"});if(i===null||i.trim()==="")return o;i.trim().split(`
|
|
67
|
+
`).map(a=>o.add(a))}),o}static async write({fs:t,gitdir:n,oids:r}){Vo===null&&(Vo=new Qa);const o=ue.join(n,"shallow");if(r.size>0){const i=[...r].join(`
|
|
68
68
|
`)+`
|
|
69
|
-
`;await
|
|
70
|
-
`);return t===-1&&
|
|
71
|
-
`)),l="";for(const c of
|
|
72
|
-
`));
|
|
73
|
-
`)),
|
|
74
|
-
`));for(const c of
|
|
75
|
-
`));s.push(
|
|
76
|
-
`));return s.push(
|
|
77
|
-
`)),s}async function
|
|
69
|
+
`;await Vo.acquire(o,async function(){await t.write(o,i,{encoding:"utf8"})})}else await Vo.acquire(o,async function(){await t.rm(o)})}}async function VF({fs:e,gitdir:t,oid:n}){const r=`objects/${n.slice(0,2)}/${n.slice(2)}`;return e.exists(`${t}/${r}`)}async function WF({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:o}){let i=await e.readdir(ue.join(n,"objects/pack"));i=i.filter(a=>a.endsWith(".idx"));for(const a of i){const s=`${n}/objects/pack/${a}`,l=await Xf({fs:e,cache:t,filename:s,getExternalRefDelta:o});if(l.error)throw new De(l.error);if(l.offsets.has(r))return!0}return!1}async function pb({fs:e,cache:t,gitdir:n,oid:r,format:o="content"}){const i=s=>dt({fs:e,cache:t,gitdir:n,oid:s});let a=await VF({fs:e,gitdir:n,oid:r});return a||(a=await WF({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:i})),a}function GF(e){const o="5041434b"+"00000002"+"00000000";return e.slice(0,12).toString("hex")===o}function mb(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 Ac={name:"isomorphic-git",version:"1.29.0",agent:"git/isomorphic-git@1.29.0"};class Ic{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 qF(e){const t=e.indexOf("\r"),n=e.indexOf(`
|
|
70
|
+
`);return t===-1&&n===-1?-1:t===-1?n+1:n===-1?t+1:n===t+1?n+1:Math.min(t,n)+1}function gb(e){const t=new Ic;let n="";return(async()=>(await $s(e,r=>{for(r=r.toString("utf8"),n+=r;;){const o=qF(n);if(o===-1)break;t.write(n.slice(0,o)),n=n.slice(o)}}),n.length>0&&t.write(n),t.end()))(),t}class wb{static demux(t){const n=xt.streamReader(t),r=new Ic,o=new Ic,i=new Ic,a=async function(){const s=await n();if(s===null)return a();if(s===!0){r.end(),i.end(),t.error?o.destroy(t.error):o.end();return}switch(s[0]){case 1:{o.write(s.slice(1));break}case 2:{i.write(s.slice(1));break}case 3:{const l=s.slice(1);i.write(l),r.end(),i.end(),o.destroy(new Error(l.toString("utf8")));return}default:r.write(s)}a()};return a(),{packetlines:r,packfile:o,progress:i}}}async function YF(e){const{packetlines:t,packfile:n,progress:r}=wb.demux(e),o=[],i=[],a=[];let s=!1,l=!1;return new Promise((c,u)=>{$s(t,d=>{const f=d.toString("utf8").trim();if(f.startsWith("shallow")){const h=f.slice(-41).trim();h.length!==40&&u(new eo(h)),o.push(h)}else if(f.startsWith("unshallow")){const h=f.slice(-41).trim();h.length!==40&&u(new eo(h)),i.push(h)}else if(f.startsWith("ACK")){const[,h,p]=f.split(" ");a.push({oid:h,status:p}),p||(l=!0)}else f.startsWith("NAK")?(s=!0,l=!0):(l=!0,s=!0);l&&(e.error?u(e.error):c({shallows:o,unshallows:i,acks:a,nak:s,packfile:n,progress:r}))}).finally(()=>{l||(e.error?u(e.error):c({shallows:o,unshallows:i,acks:a,nak:s,packfile:n,progress:r}))})})}function KF({capabilities:e=[],wants:t=[],haves:n=[],shallows:r=[],depth:o=null,since:i=null,exclude:a=[]}){const s=[];t=[...new Set(t)];let l=` ${e.join(" ")}`;for(const c of t)s.push(xt.encode(`want ${c}${l}
|
|
71
|
+
`)),l="";for(const c of r)s.push(xt.encode(`shallow ${c}
|
|
72
|
+
`));o!==null&&s.push(xt.encode(`deepen ${o}
|
|
73
|
+
`)),i!==null&&s.push(xt.encode(`deepen-since ${Math.floor(i.valueOf()/1e3)}
|
|
74
|
+
`));for(const c of a)s.push(xt.encode(`deepen-not ${c}
|
|
75
|
+
`));s.push(xt.flush());for(const c of n)s.push(xt.encode(`have ${c}
|
|
76
|
+
`));return s.push(xt.encode(`done
|
|
77
|
+
`)),s}async function ah({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:S={},prune:C=!1,pruneTags:N=!1}){const R=c||await ao({fs:e,gitdir:l,test:!0}),T=await bt.get({fs:e,gitdir:l}),M=d||R&&await T.get(`branch.${R}.remote`)||"origin",k=f||await T.get(`remote.${M}.url`);if(typeof k>"u")throw new nn("remote OR url");const O=u||R&&await T.get(`branch.${R}.merge`)||c||"HEAD";h===void 0&&(h=await T.get("http.corsProxy"));const F=Oc.getRemoteHelperFor({url:k}),L=await F.discover({http:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,corsProxy:h,service:"git-upload-pack",url:k,headers:S,protocolVersion:1}),K=L.auth,ne=L.refs;if(ne.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(p!==null&&!L.capabilities.has("shallow"))throw new ro("shallow","depth");if(m!==null&&!L.capabilities.has("deepen-since"))throw new ro("deepen-since","since");if(v.length>0&&!L.capabilities.has("deepen-not"))throw new ro("deepen-not","exclude");if(w===!0&&!L.capabilities.has("deepen-relative"))throw new ro("deepen-relative","relative");const{oid:q,fullref:X}=de.resolveAgainstMap({ref:O,map:ne});for(const z of ne.keys())z===X||z==="HEAD"||z.startsWith("refs/heads/")||b&&z.startsWith("refs/tags/")||ne.delete(z);const B=mb([...L.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${Ac.agent}`]);w&&B.push("deepen-relative");const ee=x?[q]:ne.values(),Z=x?[R]:await de.listRefs({fs:e,gitdir:l,filepath:"refs"});let J=[];for(let z of Z)try{z=await de.expand({fs:e,gitdir:l,ref:z});const se=await de.resolve({fs:e,gitdir:l,ref:z});await pb({fs:e,cache:t,gitdir:l,oid:se})&&J.push(se)}catch{}J=[...new Set(J)];const H=await Fs.read({fs:e,gitdir:l}),I=L.capabilities.has("shallow")?[...H]:[],V=KF({capabilities:B,wants:ee,haves:J,shallows:I,depth:p,since:m,exclude:v}),ae=Buffer.from(await Dc(V)),j=await F.connect({http:n,onProgress:r,corsProxy:h,service:"git-upload-pack",url:k,auth:K,body:[ae],headers:S}),G=await YF(j.body);j.headers&&(G.headers=j.headers);for(const z of G.shallows)if(!H.has(z))try{const{object:se}=await dt({fs:e,cache:t,gitdir:l,oid:z}),oe=new ft(se),fe=await Promise.all(oe.headers().parent.map(pe=>pb({fs:e,cache:t,gitdir:l,oid:pe})));fe.length===0||fe.every(pe=>pe)||H.add(z)}catch{H.add(z)}for(const z of G.unshallows)H.delete(z);if(await Fs.write({fs:e,gitdir:l,oids:H}),x){const z=new Map([[X,q]]),se=new Map;let oe=10,fe=X;for(;oe--;){const me=L.symrefs.get(fe);if(me===void 0)break;se.set(fe,me),fe=me}const ge=ne.get(fe);ge&&z.set(fe,ge);const{pruned:pe}=await de.updateRemoteRefs({fs:e,gitdir:l,remote:M,refs:z,symrefs:se,tags:b,prune:C});C&&(G.pruned=pe)}else{const{pruned:z}=await de.updateRemoteRefs({fs:e,gitdir:l,remote:M,refs:ne,symrefs:L.symrefs,tags:b,prune:C,pruneTags:N});C&&(G.pruned=z)}if(G.HEAD=L.symrefs.get("HEAD"),G.HEAD===void 0){const{oid:z}=de.resolveAgainstMap({ref:"HEAD",map:ne});for(const[se,oe]of ne.entries())if(se!=="HEAD"&&oe===z){G.HEAD=se;break}}const $=X.startsWith("refs/tags")?"tag":"branch";if(G.FETCH_HEAD={oid:q,description:`${$} '${Uo(X)}' of ${k}`},r||o){const z=gb(G.progress);$s(z,async se=>{if(o&&await o(se),r){const oe=se.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);oe&&await r({phase:oe[1].trim(),loaded:parseInt(oe[2],10),total:parseInt(oe[3],10)})}})}const te=Buffer.from(await Dc(G.packfile));if(j.body.error)throw j.body.error;const ie=te.slice(-20).toString("hex"),re={defaultBranch:G.HEAD,fetchHead:G.FETCH_HEAD.oid,fetchHeadDescription:G.FETCH_HEAD.description};if(G.headers&&(re.headers=G.headers),C&&(re.pruned=G.pruned),ie!==""&&!GF(te)){re.packfile=`objects/pack/pack-${ie}.pack`;const z=ue.join(l,re.packfile);await e.write(z,te);const se=fe=>dt({fs:e,cache:t,gitdir:l,oid:fe}),oe=await Ii.fromPack({pack:te,getExternalRefDelta:se,onProgress:r});await e.write(z.replace(/\.pack$/,".idx"),await oe.toBuffer())}return re}async function vb({fs:e,bare:t=!1,dir:n,gitdir:r=t?n:ue.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}
|
|
81
81
|
`+(t?"":` logallrefupdates = true
|
|
82
82
|
`)+` symlinks = false
|
|
83
83
|
ignorecase = true
|
|
84
|
-
`),await e.write(
|
|
85
|
-
`)}async function
|
|
86
|
-
`,p
|
|
87
|
-
`,p
|
|
88
|
-
`);return{cleanMerge:m,mergedText:p}}async function Gg({fs:e,cache:t,dir:r,gitdir:n=N.join(r,".git"),index:i,ourOid:a,baseOid:o,theirOid:s,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:d=!1,abortOnConflict:p=!0,mergeDriver:m}){const g=xt({ref:a}),_=xt({ref:o}),x=xt({ref:s}),y=[],v=[],O=[],R=[],b=await hr({fs:e,cache:t,dir:r,gitdir:n,trees:[g,_,x],map:async function(C,[k,S,P]){const $=Vi(C),B=await na(k,S),M=await na(P,S);switch(`${B}-${M}`){case"false-false":return{mode:await S.mode(),path:$,oid:await S.oid(),type:await S.type()};case"false-true":return P?{mode:await P.mode(),path:$,oid:await P.oid(),type:await P.type()}:void 0;case"true-false":return k?{mode:await k.mode(),path:$,oid:await k.oid(),type:await k.type()}:void 0;case"true-true":{if(k&&S&&P&&await k.type()==="blob"&&await S.type()==="blob"&&await P.type()==="blob")return qg({fs:e,gitdir:n,path:$,ours:k,base:S,theirs:P,ourName:l,baseName:c,theirName:u,mergeDriver:m}).then(async H=>{if(H.cleanMerge)p||i.insert({filepath:C,oid:H.mergeResult.oid,stage:0});else if(y.push(C),v.push(C),!p){const Y=await S.oid(),ue=await k.oid(),Te=await P.oid();i.delete({filepath:C}),i.insert({filepath:C,oid:Y,stage:1}),i.insert({filepath:C,oid:ue,stage:2}),i.insert({filepath:C,oid:Te,stage:3})}return H.mergeResult});if(S&&!k&&P&&await S.type()==="blob"&&await P.type()==="blob"){if(y.push(C),O.push(C),!p){const H=await S.oid(),Y=await P.oid();i.delete({filepath:C}),i.insert({filepath:C,oid:H,stage:1}),i.insert({filepath:C,oid:Y,stage:3})}return{mode:await P.mode(),oid:await P.oid(),type:"blob",path:$}}if(S&&k&&!P&&await S.type()==="blob"&&await k.type()==="blob"){if(y.push(C),R.push(C),!p){const H=await S.oid(),Y=await k.oid();i.delete({filepath:C}),i.insert({filepath:C,oid:H,stage:1}),i.insert({filepath:C,oid:Y,stage:2})}return{mode:await k.mode(),oid:await k.oid(),type:"blob",path:$}}if(S&&!k&&!P&&await S.type()==="blob")return;throw new cn}}},reduce:y.length!==0&&(!r||p)?void 0:async(C,k)=>{const S=k.filter(Boolean);if(C&&!(C&&C.type==="tree"&&S.length===0)){if(S.length>0){const $=new ct(S).toObject(),B=await ut({fs:e,gitdir:n,type:"tree",object:$,dryRun:d});C.oid=B}return C}}});return y.length!==0?(r&&!p&&await hr({fs:e,cache:t,dir:r,gitdir:n,trees:[xt({ref:b.oid})],map:async function(C,[k]){const S=`${r}/${C}`;if(await k.type()==="blob"){const P=await k.mode(),$=new TextDecoder().decode(await k.content());await e.write(S,$,{mode:P})}return!0}}),new ln(y,v,O,R)):b.oid}async function qg({fs:e,gitdir:t,path:r,ours:n,base:i,theirs:a,ourName:o,theirName:s,baseName:l,dryRun:c,mergeDriver:u=Wg}){const d="blob",p=await i.mode()===await n.mode()?await a.mode():await n.mode();if(await n.oid()===await a.oid())return{cleanMerge:!0,mergeResult:{mode:p,path:r,oid:await n.oid(),type:d}};if(await n.oid()===await i.oid())return{cleanMerge:!0,mergeResult:{mode:p,path:r,oid:await a.oid(),type:d}};if(await a.oid()===await i.oid())return{cleanMerge:!0,mergeResult:{mode:p,path:r,oid:await n.oid(),type:d}};const m=Buffer.from(await n.content()).toString("utf8"),g=Buffer.from(await i.content()).toString("utf8"),_=Buffer.from(await a.content()).toString("utf8"),{mergedText:x,cleanMerge:y}=await u({branches:[l,o,s],contents:[g,m,_],path:r}),v=await ut({fs:e,gitdir:t,type:"blob",object:Buffer.from(x,"utf8"),dryRun:c});return{cleanMerge:y,mergeResult:{mode:p,path:r,oid:v,type:d}}}async function lf({fs:e,cache:t,dir:r,gitdir:n,ours:i,theirs:a,fastForward:o=!0,fastForwardOnly:s=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:d,author:p,committer:m,signingKey:g,onSign:_,mergeDriver:x}){i===void 0&&(i=await mr({fs:e,gitdir:n,fullname:!0})),i=await U.expand({fs:e,gitdir:n,ref:i}),a=await U.expand({fs:e,gitdir:n,ref:a});const y=await U.resolve({fs:e,gitdir:n,ref:i}),v=await U.resolve({fs:e,gitdir:n,ref:a}),O=await rs({fs:e,cache:t,gitdir:n,oids:[y,v]});if(O.length!==1)throw new cn;const R=O[0];if(R===v)return{oid:y,alreadyMerged:!0};if(o&&R===y)return!l&&!c&&await U.writeRef({fs:e,gitdir:n,ref:i,value:v}),{oid:v,fastForward:!0};{if(s)throw new ti;const b=await Ge.acquire({fs:e,gitdir:n,cache:t,allowUnmerged:!1},async k=>Gg({fs:e,cache:t,dir:r,gitdir:n,index:k,ourOid:y,theirOid:v,baseOid:R,ourName:Dr(i),baseName:"base",theirName:Dr(a),dryRun:l,abortOnConflict:u,mergeDriver:x}));if(b instanceof ln)throw b;return d||(d=`Merge branch '${Dr(a)}' into ${Dr(i)}`),{oid:await ia({fs:e,cache:t,gitdir:n,message:d,ref:i,tree:b,parent:[y,v],author:p,committer:m,signingKey:g,onSign:_,dryRun:l,noUpdateBranch:c}),tree:b,mergeCommit:!0}}}async function uf({fs:e,cache:t,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:c,ref:u,url:d,remote:p,remoteRef:m,prune:g,pruneTags:_,fastForward:x,fastForwardOnly:y,corsProxy:v,singleBranch:O,headers:R,author:b,committer:C,signingKey:k}){try{if(!u){const $=await mr({fs:e,gitdir:c});if(!$)throw new lt("ref");u=$}const{fetchHead:S,fetchHeadDescription:P}=await ts({fs:e,cache:t,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:o,onAuthFailure:s,gitdir:c,corsProxy:v,ref:u,url:d,remote:p,remoteRef:m,singleBranch:O,headers:R,prune:g,pruneTags:_});await lf({fs:e,cache:t,gitdir:c,ours:u,theirs:S,fastForward:x,fastForwardOnly:y,message:`Merge ${P}`,author:b,committer:C,signingKey:k,dryRun:!1,noUpdateBranch:!1}),await Ko({fs:e,cache:t,onProgress:n,dir:l,gitdir:c,ref:u,remote:p,noCheckout:!1})}catch(S){throw S.caller="git.pull",S}}async function Yg({fs:e,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:l=N.join(s,".git"),ref:c,url:u,remote:d,remoteRef:p,corsProxy:m,singleBranch:g,headers:_={},cache:x={}}){try{T("fs",e),T("http",t),T("gitdir",l);const y={name:"",email:"",timestamp:Date.now(),timezoneOffset:0};return await uf({fs:new J(e),cache:x,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:l,ref:c,url:u,remote:d,remoteRef:p,fastForwardOnly:!0,corsProxy:m,singleBranch:g,headers:_,author:y,committer:y})}catch(y){throw y.caller="git.fastForward",y}}async function Xg({fs:e,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:l=N.join(s,".git"),ref:c,remote:u,remoteRef:d,url:p,corsProxy:m,depth:g=null,since:_=null,exclude:x=[],relative:y=!1,tags:v=!1,singleBranch:O=!1,headers:R={},prune:b=!1,pruneTags:C=!1,cache:k={}}){try{return T("fs",e),T("http",t),T("gitdir",l),await ts({fs:new J(e),cache:k,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:o,gitdir:l,ref:c,remote:u,remoteRef:d,url:p,corsProxy:m,depth:g,since:_,exclude:x,relative:y,tags:v,singleBranch:O,headers:R,prune:b,pruneTags:C})}catch(S){throw S.caller="git.fetch",S}}async function Zg({fs:e,dir:t,gitdir:r=N.join(t,".git"),oids:n,cache:i={}}){try{return T("fs",e),T("gitdir",r),T("oids",n),await rs({fs:new J(e),cache:i,gitdir:r,oids:n})}catch(a){throw a.caller="git.findMergeBase",a}}async function ff({fs:e,filepath:t}){if(await e.exists(N.join(t,".git")))return t;{const r=rn(t);if(r===t)throw new Oe(`git root for ${t}`);return ff({fs:e,filepath:r})}}async function Vg({fs:e,filepath:t}){try{return T("fs",e),T("filepath",t),await ff({fs:new J(e),filepath:t})}catch(r){throw r.caller="git.findRoot",r}}async function Kg({fs:e,dir:t,gitdir:r=N.join(t,".git"),path:n}){try{return T("fs",e),T("gitdir",r),T("path",n),await fi({fs:new J(e),gitdir:r,path:n})}catch(i){throw i.caller="git.getConfig",i}}async function Jg({fs:e,gitdir:t,path:r}){return(await Le.get({fs:e,gitdir:t})).getall(r)}async function Qg({fs:e,dir:t,gitdir:r=N.join(t,".git"),path:n}){try{return T("fs",e),T("gitdir",r),T("path",n),await Jg({fs:new J(e),gitdir:r,path:n})}catch(i){throw i.caller="git.getConfigAll",i}}async function ey({http:e,onAuth:t,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,url:a,headers:o={},forPush:s=!1}){try{T("http",e),T("url",a);const c=await sa.getRemoteHelperFor({url:a}).discover({http:e,onAuth:t,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,service:s?"git-receive-pack":"git-upload-pack",url:a,headers:o,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(const[d,p]of c.refs){const m=d.split("/"),g=m.pop();let _=u;for(const x of m)_[x]=_[x]||{},_=_[x];_[g]=p}for(const[d,p]of c.symrefs){const m=d.split("/"),g=m.pop();let _=u;for(const x of m)_[x]=_[x]||{},_=_[x];_[g]=p}return u}catch(l){throw l.caller="git.getRemoteInfo",l}}function df(e,t,r,n){const i=[];for(const[a,o]of e.refs){if(t&&!a.startsWith(t))continue;if(a.endsWith("^{}")){if(n){const l=a.replace("^{}",""),c=i[i.length-1],u=c.ref===l?c:i.find(d=>d.ref===l);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=o}continue}const s={ref:a,oid:o};r&&e.symrefs.has(a)&&(s.target=e.symrefs.get(a)),i.push(s)}return i}async function ty({http:e,onAuth:t,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,url:a,headers:o={},forPush:s=!1,protocolVersion:l=2}){try{T("http",e),T("url",a);const u=await sa.getRemoteHelperFor({url:a}).discover({http:e,onAuth:t,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,service:s?"git-receive-pack":"git-upload-pack",url:a,headers:o,protocolVersion:l});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};const d={};for(const p of u.capabilities){const[m,g]=p.split("=");g?d[m]=g:d[m]=!0}return{protocolVersion:1,capabilities:d,refs:df(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}async function ry({type:e,object:t,format:r="content",oid:n=void 0}){return r!=="deflated"&&(r!=="wrapped"&&(t=an.wrap({type:e,object:t})),n=await Vt(t)),{oid:n,object:t}}async function ny({object:e}){try{T("object",e),typeof e=="string"?e=Buffer.from(e,"utf8"):e=Buffer.from(e);const t="blob",{oid:r,object:n}=await ry({type:"blob",format:"content",object:e});return{oid:r,type:t,object:new Uint8Array(n),format:"wrapped"}}catch(t){throw t.caller="git.hashBlob",t}}async function iy({fs:e,cache:t,onProgress:r,dir:n,gitdir:i,filepath:a}){try{a=N.join(n,a);const o=await e.read(a),s=c=>De({fs:e,cache:t,gitdir:i,oid:c}),l=await on.fromPack({pack:o,getExternalRefDelta:s,onProgress:r});return await e.write(a.replace(/\.pack$/,".idx"),await l.toBuffer()),{oids:[...l.hashes]}}catch(o){throw o.caller="git.indexPack",o}}async function ay({fs:e,onProgress:t,dir:r,gitdir:n=N.join(r,".git"),filepath:i,cache:a={}}){try{return T("fs",e),T("dir",r),T("gitdir",r),T("filepath",i),await iy({fs:new J(e),cache:a,onProgress:t,dir:r,gitdir:n,filepath:i})}catch(o){throw o.caller="git.indexPack",o}}async function oy({fs:e,bare:t=!1,dir:r,gitdir:n=t?r:N.join(r,".git"),defaultBranch:i="master"}){try{return T("fs",e),T("gitdir",n),t||T("dir",r),await cf({fs:new J(e),bare:t,dir:r,gitdir:n,defaultBranch:i})}catch(a){throw a.caller="git.init",a}}async function hf({fs:e,cache:t,gitdir:r,oid:n,ancestor:i,depth:a}){const o=await mi.read({fs:e,gitdir:r});if(!n)throw new lt("oid");if(!i)throw new lt("ancestor");if(n===i)return!1;const s=[n],l=new Set;let c=0;for(;s.length;){if(c++===a)throw new ni(a);const u=s.shift(),{type:d,object:p}=await De({fs:e,cache:t,gitdir:r,oid:u});if(d!=="commit")throw new rt(u,d,"commit");const m=Ie.from(p).parse();for(const g of m.parent)if(g===i)return!0;if(!o.has(u))for(const g of m.parent)l.has(g)||(s.push(g),l.add(g))}return!1}async function sy({fs:e,dir:t,gitdir:r=N.join(t,".git"),oid:n,ancestor:i,depth:a=-1,cache:o={}}){try{return T("fs",e),T("gitdir",r),T("oid",n),T("ancestor",i),await hf({fs:new J(e),cache:o,gitdir:r,oid:n,ancestor:i,depth:a})}catch(s){throw s.caller="git.isDescendent",s}}async function cy({fs:e,dir:t,gitdir:r=N.join(t,".git"),filepath:n}){try{return T("fs",e),T("dir",t),T("gitdir",r),T("filepath",n),hn.isIgnored({fs:new J(e),dir:t,gitdir:r,filepath:n})}catch(i){throw i.caller="git.isIgnored",i}}async function ly({fs:e,dir:t,gitdir:r=N.join(t,".git"),remote:n}){try{return T("fs",e),T("gitdir",r),U.listBranches({fs:new J(e),gitdir:r,remote:n})}catch(i){throw i.caller="git.listBranches",i}}async function uy({fs:e,gitdir:t,ref:r,cache:n}){if(r){const i=await U.resolve({gitdir:t,fs:e,ref:r}),a=[];return await pf({fs:e,cache:n,gitdir:t,oid:i,filenames:a,prefix:""}),a}else return Ge.acquire({fs:e,gitdir:t,cache:n},async function(i){return i.entries.map(a=>a.path)})}async function pf({fs:e,cache:t,gitdir:r,oid:n,filenames:i,prefix:a}){const{tree:o}=await wn({fs:e,cache:t,gitdir:r,oid:n});for(const s of o)s.type==="tree"?await pf({fs:e,cache:t,gitdir:r,oid:s.oid,filenames:i,prefix:N.join(a,s.path)}):i.push(N.join(a,s.path))}async function fy({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n,cache:i={}}){try{return T("fs",e),T("gitdir",r),await uy({fs:new J(e),cache:i,gitdir:r,ref:n})}catch(a){throw a.caller="git.listFiles",a}}async function dy({fs:e,cache:t,gitdir:r,ref:n}){let i;try{i=await U.resolve({gitdir:r,fs:e,ref:n})}catch(s){if(s instanceof Oe)return[]}return(await wn({fs:e,cache:t,gitdir:r,oid:i})).tree.map(s=>({target:s.path,note:s.oid}))}async function hy({fs:e,dir:t,gitdir:r=N.join(t,".git"),ref:n="refs/notes/commits",cache:i={}}){try{return T("fs",e),T("gitdir",r),T("ref",n),await dy({fs:new J(e),cache:i,gitdir:r,ref:n})}catch(a){throw a.caller="git.listNotes",a}}async function py({fs:e,dir:t,gitdir:r=N.join(t,".git"),filepath:n}){try{return T("fs",e),T("gitdir",r),U.listRefs({fs:new J(e),gitdir:r,filepath:n})}catch(i){throw i.caller="git.listRefs",i}}async function my({fs:e,gitdir:t}){const r=await Le.get({fs:e,gitdir:t}),n=await r.getSubsections("remote");return Promise.all(n.map(async a=>{const o=await r.get(`remote.${a}.url`);return{remote:a,url:o}}))}async function wy({fs:e,dir:t,gitdir:r=N.join(t,".git")}){try{return T("fs",e),T("gitdir",r),await my({fs:new J(e),gitdir:r})}catch(n){throw n.caller="git.listRemotes",n}}async function gy(e){const t=Fe.streamReader(e),r=[];let n;for(;n=await t(),n!==!0;){if(n===null)continue;n=n.toString("utf8").replace(/\n$/,"");const[i,a,...o]=n.split(" "),s={ref:a,oid:i};for(const l of o){const[c,u]=l.split(":");c==="symref-target"?s.target=u:c==="peeled"&&(s.peeled=u)}r.push(s)}return r}async function yy({prefix:e,symrefs:t,peelTags:r}){const n=[];return n.push(Fe.encode(`command=ls-refs
|
|
89
|
-
`)),
|
|
90
|
-
`)),(
|
|
91
|
-
`),
|
|
92
|
-
`);if(i
|
|
93
|
-
`)),
|
|
94
|
-
- ${
|
|
95
|
-
`,author:
|
|
96
|
-
`}static getStashReflogEntry(t,
|
|
97
|
-
`).filter(
|
|
98
|
-
`),"utf8");const c=s[s.length-1].split(" ")[1];await
|
|
99
|
-
`),
|
|
84
|
+
`),await e.write(r+"/HEAD",`ref: refs/heads/${o}
|
|
85
|
+
`)}async function XF({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:S,noTags:C,headers:N}){try{if(await vb({fs:e,gitdir:u}),await ib({fs:e,gitdir:u,remote:p,url:d,force:!1}),f){const M=await bt.get({fs:e,gitdir:u});await M.set("http.corsProxy",f),await bt.save({fs:e,gitdir:u,config:M})}const{defaultBranch:R,fetchHead:T}=await ah({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 nh({fs:e,cache:t,onProgress:r,onPostCheckout:l,dir:c,gitdir:u,ref:h,remote:p,noCheckout:S})}catch(R){throw await e.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),R}}async function ZF({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,onPostCheckout:s,dir:l,gitdir:c=ue.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:S=!1,headers:C={},cache:N={}}){try{return W("fs",e),W("http",t),W("gitdir",c),x||W("dir",l),W("url",u),await XF({fs:new be(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:S,headers:C})}catch(R){throw R.caller="git.clone",R}}async function JF({fs:e,onSign:t,dir:n,gitdir:r=ue.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{W("fs",e),l||W("message",o),s&&W("onSign",t);const m=new be(e);return await Mc({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 QF({fs:e,dir:t,gitdir:n=ue.join(t,".git"),fullname:r=!1,test:o=!1}){try{return W("fs",e),W("gitdir",n),await ao({fs:new be(e),gitdir:n,fullname:r,test:o})}catch(i){throw i.caller="git.currentBranch",i}}async function eL({fs:e,gitdir:t,ref:n}){if(n=n.startsWith("refs/heads/")?n:`refs/heads/${n}`,!await de.exists({fs:e,gitdir:t,ref:n}))throw new ot(n);const o=await de.expand({fs:e,gitdir:t,ref:n}),i=await ao({fs:e,gitdir:t,fullname:!0});if(o===i){const l=await de.resolve({fs:e,gitdir:t,ref:o});await de.writeRef({fs:e,gitdir:t,ref:"HEAD",value:l})}await de.deleteRef({fs:e,gitdir:t,ref:o});const a=Uo(n),s=await bt.get({fs:e,gitdir:t});await s.deleteSection("branch",a),await bt.save({fs:e,gitdir:t,config:s})}async function tL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r}){try{return W("fs",e),W("ref",r),await eL({fs:new be(e),gitdir:n,ref:r})}catch(o){throw o.caller="git.deleteBranch",o}}async function nL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r}){try{W("fs",e),W("ref",r),await de.deleteRef({fs:new be(e),gitdir:n,ref:r})}catch(o){throw o.caller="git.deleteRef",o}}async function rL({fs:e,gitdir:t,remote:n}){const r=await bt.get({fs:e,gitdir:t});await r.deleteSection("remote",n),await bt.save({fs:e,gitdir:t,config:r})}async function oL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),remote:r}){try{return W("fs",e),W("remote",r),await rL({fs:new be(e),gitdir:n,remote:r})}catch(o){throw o.caller="git.deleteRemote",o}}async function iL({fs:e,gitdir:t,ref:n}){n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,await de.deleteRef({fs:e,gitdir:t,ref:n})}async function aL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r}){try{return W("fs",e),W("ref",r),await iL({fs:new be(e),gitdir:n,ref:r})}catch(o){throw o.caller="git.deleteTag",o}}async function sL({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 lL({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:o}){const i=[];let a=await e.readdir(ue.join(n,"objects/pack"));a=a.filter(s=>s.endsWith(".idx"));for(const s of a){const l=`${n}/objects/pack/${s}`,c=await Xf({fs:e,cache:t,filename:l,getExternalRefDelta:o});if(c.error)throw new De(c.error);for(const u of c.offsets.keys())u.startsWith(r)&&i.push(u)}return i}async function cL({fs:e,cache:t,gitdir:n,oid:r}){const o=s=>dt({fs:e,cache:t,gitdir:n,oid:s}),i=await sL({fs:e,gitdir:n,oid:r}),a=await lL({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 bs("oids",r,i):new ot(`an object matching "${r}"`)}async function uL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oid:r,cache:o={}}){try{return W("fs",e),W("gitdir",n),W("oid",r),await cL({fs:new be(e),cache:o,gitdir:n,oid:r})}catch(i){throw i.caller="git.expandOid",i}}async function dL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r}){try{return W("fs",e),W("gitdir",n),W("ref",r),await de.expand({fs:new be(e),gitdir:n,ref:r})}catch(o){throw o.caller="git.expandRef",o}}async function sh({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 dt({fs:e,cache:t,gitdir:n,oid:c}),f=ft.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 fL({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=D$(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
|
+
`,f+=p.conflict.a.join(""),f+=`${"=".repeat(d)}
|
|
87
|
+
`,f+=p.conflict.b.join(""),f+=`${">".repeat(d)} ${r}
|
|
88
|
+
`);return{cleanMerge:h,mergedText:f}}async function hL({fs:e,cache:t,dir:n,gitdir:r=ue.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=kn({ref:i}),m=kn({ref:a}),v=kn({ref:s}),w=[],b=[],x=[],S=[],C=await oo({fs:e,cache:t,dir:n,gitdir:r,trees:[p,m,v],map:async function(N,[R,T,M]){const k=_c(N),O=await Tc(R,T),F=await Tc(M,T);switch(`${O}-${F}`){case"false-false":return{mode:await T.mode(),path:k,oid:await T.oid(),type:await T.type()};case"false-true":return M?{mode:await M.mode(),path:k,oid:await M.oid(),type:await M.type()}:void 0;case"true-false":return R?{mode:await R.mode(),path:k,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 pL({fs:e,gitdir:r,path:k,ours:R,base:T,theirs:M,ourName:l,baseName:c,theirName:u,mergeDriver:h}).then(async L=>{if(L.cleanMerge)f||o.insert({filepath:N,oid:L.mergeResult.oid,stage:0});else if(w.push(N),b.push(N),!f){const K=await T.oid(),ne=await R.oid(),q=await M.oid();o.delete({filepath:N}),o.insert({filepath:N,oid:K,stage:1}),o.insert({filepath:N,oid:ne,stage:2}),o.insert({filepath:N,oid:q,stage:3})}return L.mergeResult});if(T&&!R&&M&&await T.type()==="blob"&&await M.type()==="blob"){if(w.push(N),x.push(N),!f){const L=await T.oid(),K=await M.oid();o.delete({filepath:N}),o.insert({filepath:N,oid:L,stage:1}),o.insert({filepath:N,oid:K,stage:3})}return{mode:await M.mode(),oid:await M.oid(),type:"blob",path:k}}if(T&&R&&!M&&await T.type()==="blob"&&await R.type()==="blob"){if(w.push(N),S.push(N),!f){const L=await T.oid(),K=await R.oid();o.delete({filepath:N}),o.insert({filepath:N,oid:L,stage:1}),o.insert({filepath:N,oid:K,stage:2})}return{mode:await R.mode(),oid:await R.oid(),type:"blob",path:k}}if(T&&!R&&!M&&await T.type()==="blob")return;throw new $i}}},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 k=new tn(T).toObject(),O=await rn({fs:e,gitdir:r,type:"tree",object:k,dryRun:d});N.oid=O}return N}}});return w.length!==0?(n&&!f&&await oo({fs:e,cache:t,dir:n,gitdir:r,trees:[kn({ref:C.oid})],map:async function(N,[R]){const T=`${n}/${N}`;if(await R.type()==="blob"){const M=await R.mode(),k=new TextDecoder().decode(await R.content());await e.write(T,k,{mode:M})}return!0}}),new Fi(w,b,x,S)):C.oid}async function pL({fs:e,gitdir:t,path:n,ours:r,base:o,theirs:i,ourName:a,theirName:s,baseName:l,dryRun:c,mergeDriver:u=fL}){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 rn({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 yb({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 ao({fs:e,gitdir:r,fullname:!0})),o=await de.expand({fs:e,gitdir:r,ref:o}),i=await de.expand({fs:e,gitdir:r,ref:i});const w=await de.resolve({fs:e,gitdir:r,ref:o}),b=await de.resolve({fs:e,gitdir:r,ref:i}),x=await sh({fs:e,cache:t,gitdir:r,oids:[w,b]});if(x.length!==1)throw new $i;const S=x[0];if(S===b)return{oid:w,alreadyMerged:!0};if(a&&S===w)return!l&&!c&&await de.writeRef({fs:e,gitdir:r,ref:o,value:b}),{oid:b,fastForward:!0};{if(s)throw new Cs;const C=await Rt.acquire({fs:e,gitdir:r,cache:t,allowUnmerged:!1},async R=>hL({fs:e,cache:t,dir:n,gitdir:r,index:R,ourOid:w,theirOid:b,baseOid:S,ourName:Uo(o),baseName:"base",theirName:Uo(i),dryRun:l,abortOnConflict:u,mergeDriver:v}));if(C instanceof Fi)throw C;return d||(d=`Merge branch '${Uo(i)}' into ${Uo(o)}`),{oid:await Mc({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 bb({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:S,author:C,committer:N,signingKey:R}){try{if(!u){const k=await ao({fs:e,gitdir:c});if(!k)throw new nn("ref");u=k}const{fetchHead:T,fetchHeadDescription:M}=await ah({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:S,prune:p,pruneTags:m});await yb({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 nh({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 mL({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l=ue.join(s,".git"),ref:c,url:u,remote:d,remoteRef:f,corsProxy:h,singleBranch:p,headers:m={},cache:v={}}){try{W("fs",e),W("http",t),W("gitdir",l);const w={name:"",email:"",timestamp:Date.now(),timezoneOffset:0};return await bb({fs:new be(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 gL({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l=ue.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:S={},prune:C=!1,pruneTags:N=!1,cache:R={}}){try{return W("fs",e),W("http",t),W("gitdir",l),await ah({fs:new be(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:S,prune:C,pruneTags:N})}catch(T){throw T.caller="git.fetch",T}}async function wL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oids:r,cache:o={}}){try{return W("fs",e),W("gitdir",n),W("oids",r),await sh({fs:new be(e),cache:o,gitdir:n,oids:r})}catch(i){throw i.caller="git.findMergeBase",i}}async function xb({fs:e,filepath:t}){if(await e.exists(ue.join(t,".git")))return t;{const n=ki(t);if(n===t)throw new ot(`git root for ${t}`);return xb({fs:e,filepath:n})}}async function vL({fs:e,filepath:t}){try{return W("fs",e),W("filepath",t),await xb({fs:new be(e),filepath:t})}catch(n){throw n.caller="git.findRoot",n}}async function yL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),path:r}){try{return W("fs",e),W("gitdir",n),W("path",r),await As({fs:new be(e),gitdir:n,path:r})}catch(o){throw o.caller="git.getConfig",o}}async function bL({fs:e,gitdir:t,path:n}){return(await bt.get({fs:e,gitdir:t})).getall(n)}async function xL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),path:r}){try{return W("fs",e),W("gitdir",n),W("path",r),await bL({fs:new be(e),gitdir:n,path:r})}catch(o){throw o.caller="git.getConfigAll",o}}async function _L({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,url:i,headers:a={},forPush:s=!1}){try{W("http",e),W("url",i);const c=await Oc.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 _b(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 SL({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:o,url:i,headers:a={},forPush:s=!1,protocolVersion:l=2}){try{W("http",e),W("url",i);const u=await Oc.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:_b(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}async function CL({type:e,object:t,format:n="content",oid:r=void 0}){return n!=="deflated"&&(n!=="wrapped"&&(t=Ai.wrap({type:e,object:t})),r=await Or(t)),{oid:r,object:t}}async function EL({object:e}){try{W("object",e),typeof e=="string"?e=Buffer.from(e,"utf8"):e=Buffer.from(e);const t="blob",{oid:n,object:r}=await CL({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 PL({fs:e,cache:t,onProgress:n,dir:r,gitdir:o,filepath:i}){try{i=ue.join(r,i);const a=await e.read(i),s=c=>dt({fs:e,cache:t,gitdir:o,oid:c}),l=await Ii.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 RL({fs:e,onProgress:t,dir:n,gitdir:r=ue.join(n,".git"),filepath:o,cache:i={}}){try{return W("fs",e),W("dir",n),W("gitdir",n),W("filepath",o),await PL({fs:new be(e),cache:i,onProgress:t,dir:n,gitdir:r,filepath:o})}catch(a){throw a.caller="git.indexPack",a}}async function NL({fs:e,bare:t=!1,dir:n,gitdir:r=t?n:ue.join(n,".git"),defaultBranch:o="master"}){try{return W("fs",e),W("gitdir",r),t||W("dir",n),await vb({fs:new be(e),bare:t,dir:n,gitdir:r,defaultBranch:o})}catch(i){throw i.caller="git.init",i}}async function Sb({fs:e,cache:t,gitdir:n,oid:r,ancestor:o,depth:i}){const a=await Fs.read({fs:e,gitdir:n});if(!r)throw new nn("oid");if(!o)throw new nn("ancestor");if(r===o)return!1;const s=[r],l=new Set;let c=0;for(;s.length;){if(c++===i)throw new Ps(i);const u=s.shift(),{type:d,object:f}=await dt({fs:e,cache:t,gitdir:n,oid:u});if(d!=="commit")throw new qt(u,d,"commit");const h=ft.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 TL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oid:r,ancestor:o,depth:i=-1,cache:a={}}){try{return W("fs",e),W("gitdir",n),W("oid",r),W("ancestor",o),await Sb({fs:new be(e),cache:a,gitdir:n,oid:r,ancestor:o,depth:i})}catch(s){throw s.caller="git.isDescendent",s}}async function ML({fs:e,dir:t,gitdir:n=ue.join(t,".git"),filepath:r}){try{return W("fs",e),W("dir",t),W("gitdir",n),W("filepath",r),Hi.isIgnored({fs:new be(e),dir:t,gitdir:n,filepath:r})}catch(o){throw o.caller="git.isIgnored",o}}async function DL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),remote:r}){try{return W("fs",e),W("gitdir",n),de.listBranches({fs:new be(e),gitdir:n,remote:r})}catch(o){throw o.caller="git.listBranches",o}}async function kL({fs:e,gitdir:t,ref:n,cache:r}){if(n){const o=await de.resolve({gitdir:t,fs:e,ref:n}),i=[];return await Cb({fs:e,cache:r,gitdir:t,oid:o,filenames:i,prefix:""}),i}else return Rt.acquire({fs:e,gitdir:t,cache:r},async function(o){return o.entries.map(i=>i.path)})}async function Cb({fs:e,cache:t,gitdir:n,oid:r,filenames:o,prefix:i}){const{tree:a}=await Wi({fs:e,cache:t,gitdir:n,oid:r});for(const s of a)s.type==="tree"?await Cb({fs:e,cache:t,gitdir:n,oid:s.oid,filenames:o,prefix:ue.join(i,s.path)}):o.push(ue.join(i,s.path))}async function OL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r,cache:o={}}){try{return W("fs",e),W("gitdir",n),await kL({fs:new be(e),cache:o,gitdir:n,ref:r})}catch(i){throw i.caller="git.listFiles",i}}async function AL({fs:e,cache:t,gitdir:n,ref:r}){let o;try{o=await de.resolve({gitdir:n,fs:e,ref:r})}catch(s){if(s instanceof ot)return[]}return(await Wi({fs:e,cache:t,gitdir:n,oid:o})).tree.map(s=>({target:s.path,note:s.oid}))}async function IL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r="refs/notes/commits",cache:o={}}){try{return W("fs",e),W("gitdir",n),W("ref",r),await AL({fs:new be(e),cache:o,gitdir:n,ref:r})}catch(i){throw i.caller="git.listNotes",i}}async function jL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),filepath:r}){try{return W("fs",e),W("gitdir",n),de.listRefs({fs:new be(e),gitdir:n,filepath:r})}catch(o){throw o.caller="git.listRefs",o}}async function $L({fs:e,gitdir:t}){const n=await bt.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 FL({fs:e,dir:t,gitdir:n=ue.join(t,".git")}){try{return W("fs",e),W("gitdir",n),await $L({fs:new be(e),gitdir:n})}catch(r){throw r.caller="git.listRemotes",r}}async function LL(e){const t=xt.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 zL({prefix:e,symrefs:t,peelTags:n}){const r=[];return r.push(xt.encode(`command=ls-refs
|
|
89
|
+
`)),r.push(xt.encode(`agent=${Ac.agent}
|
|
90
|
+
`)),(n||t||e)&&r.push(xt.delim()),n&&r.push(xt.encode("peel")),t&&r.push(xt.encode("symrefs")),e&&r.push(xt.encode(`ref-prefix ${e}`)),r.push(xt.flush()),r}async function BL({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{W("http",e),W("url",i);const f=await kc.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 _b(f,c,u,d);const h=await zL({prefix:c,symrefs:u,peelTags:d}),p=await kc.connect({http:e,auth:f.auth,headers:a,corsProxy:o,service:s?"git-receive-pack":"git-upload-pack",url:i,body:h});return LL(p.body)}catch(f){throw f.caller="git.listServerRefs",f}}async function HL({fs:e,dir:t,gitdir:n=ue.join(t,".git")}){try{return W("fs",e),W("gitdir",n),de.listTags({fs:new be(e),gitdir:n})}catch(r){throw r.caller="git.listTags",r}}function UL(e,t){return e.committer.timestamp-t.committer.timestamp}const VL="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function Eb({fs:e,cache:t,gitdir:n,oid:r,fileId:o}){if(o===VL)return;const i=r;let a;const s=await Bi({fs:e,cache:t,gitdir:n,oid:r}),l=s.tree;return o===s.oid?a=s.path:(a=await Pb({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 Pb({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=ue.join(s,c.path),a.push(u)):c.type==="tree"&&(u=dt({fs:e,cache:t,gitdir:n,oid:c.oid}).then(function({object:d}){return Pb({fs:e,cache:t,gitdir:n,tree:tn.from(d),fileId:o,oid:i,filepaths:a,parentPath:ue.join(s,c.path)})})),u});return await Promise.all(l),a}async function WL({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 Fs.read({fs:e,gitdir:n}),f=await de.resolve({fs:e,gitdir:n,ref:o}),h=[await Vi({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 Is({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(S){if(S instanceof ot){let C=l&&p;if(C&&(C=await Eb({fs:e,cache:t,gitdir:n,oid:b.commit.tree,fileId:p}),C))if(Array.isArray(C)){if(m){const N=await Eb({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 S}m=b,v=!1}else throw S}}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 S=await Vi({fs:e,cache:t,gitdir:n,oid:x});h.map(C=>C.oid).includes(S.oid)||h.push(S)}h.length===0&&w(b),h.sort((x,S)=>UL(x.commit,S.commit))}return u}async function GL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),filepath:r,ref:o="HEAD",depth:i,since:a,force:s,follow:l,cache:c={}}){try{return W("fs",e),W("gitdir",n),W("ref",o),await WL({fs:new be(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 qL({fs:e,onSign:t,dir:n,gitdir:r=ue.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{W("fs",e),p&&W("onSign",t);const w=new be(e),b=await io({fs:w,gitdir:r,author:f});if(!b&&(!s||!a))throw new It("author");const x=await Ui({fs:w,gitdir:r,author:b,committer:h});if(!x&&(!s||!a))throw new It("committer");return await yb({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 YL={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function Rb({fs:e,cache:t,dir:n,gitdir:r=ue.join(n,".git"),oids:o}){const i=new Uv,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=YL[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(rh(2,v),"hex"),h=h>>>7;s(Buffer.from(await Q0(d)))}s("PACK"),s("00000002","hex"),s(rh(8,o.length),"hex");for(const u of o){const{type:d,object:f}=await dt({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 KL({fs:e,cache:t,gitdir:n,oids:r,write:o}){const i=await Rb({fs:e,cache:t,gitdir:n,oids:r}),a=Buffer.from(await Dc(i)),l=`pack-${a.slice(-20).toString("hex")}.pack`;return o?(await e.write(ue.join(n,`objects/pack/${l}`),a),{filename:l}):{filename:l,packfile:new Uint8Array(a)}}async function XL({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oids:r,write:o=!1,cache:i={}}){try{return W("fs",e),W("gitdir",n),W("oids",r),await KL({fs:new be(e),cache:i,gitdir:n,oids:r,write:o})}catch(a){throw a.caller="git.packObjects",a}}async function ZL({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,dir:s,gitdir:l=ue.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:S,committer:C,signingKey:N,cache:R={}}){try{W("fs",e),W("gitdir",l);const T=new be(e),M=await io({fs:T,gitdir:l,author:S});if(!M)throw new It("author");const k=await Ui({fs:T,gitdir:l,author:M,committer:C});if(!k)throw new It("committer");return await bb({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:k,signingKey:N,prune:h,pruneTags:p})}catch(T){throw T.caller="git.pull",T}}async function JL({fs:e,cache:t,dir:n,gitdir:r=ue.join(n,".git"),start:o,finish:i}){const a=await Fs.read({fs:e,gitdir:r}),s=new Set,l=new Set;for(const d of o)s.add(await de.resolve({fs:e,gitdir:r,ref:d}));for(const d of i)try{const f=await de.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 dt({fs:e,cache:t,gitdir:r,oid:d});if(f==="tag"){const m=Yt.from(h).headers().object;return u(m)}if(f!=="commit")throw new qt(d,f,"commit");if(!a.has(d)){const m=ft.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 ch({fs:e,cache:t,dir:n,gitdir:r=ue.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 dt({fs:e,cache:t,gitdir:r,oid:s});if(l==="tag"){const d=Yt.from(c).headers().object;await a(d)}else if(l==="commit"){const d=ft.from(c).headers().tree;await a(d)}else if(l==="tree"){const u=tn.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 QL(e){const t={};let n="";const r=xt.streamReader(e);let o=await r();for(;o!==!0;)o!==null&&(n+=o.toString("utf8")+`
|
|
91
|
+
`),o=await r();const i=n.toString("utf8").split(`
|
|
92
|
+
`);if(o=i.shift(),!o.startsWith("unpack "))throw new Ho('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 ez({capabilities:e=[],triplets:t=[]}){const n=[];let r=`\0 ${e.join(" ")}`;for(const o of t)n.push(xt.encode(`${o.oldoid} ${o.oid} ${o.fullRef}${r}
|
|
93
|
+
`)),r="";return n.push(xt.flush()),n}async function tz({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 ao({fs:e,gitdir:c});if(typeof b>"u")throw new nn("ref");const x=await bt.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 S=h||await x.get(`remote.${f}.pushurl`)||await x.get(`remote.${f}.url`);if(typeof S>"u")throw new nn("remote OR url");const C=d||await x.get(`branch.${b}.merge`);if(typeof S>"u")throw new nn("remoteRef");v===void 0&&(v=await x.get("http.corsProxy"));const N=await de.expand({fs:e,gitdir:c,ref:b}),R=m?"0000000000000000000000000000000000000000":await de.resolve({fs:e,gitdir:c,ref:N}),T=Oc.getRemoteHelperFor({url:S}),M=await T.discover({http:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,corsProxy:v,service:"git-receive-pack",url:S,headers:w,protocolVersion:1}),k=M.auth;let O;if(!C)O=N;else try{O=await de.expandAgainstMap({ref:C,map:M.refs})}catch(H){if(H instanceof ot)O=C.startsWith("refs/")?C:`refs/heads/${C}`;else throw H}const F=M.refs.get(O)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:f,url:S,localRef:{ref:m?"(delete)":N,oid:R},remoteRef:{ref:O,oid:F}}))throw new zi;const L=!M.capabilities.has("no-thin");let K=new Set;if(!m){const H=[...M.refs.values()];let I=new Set;if(F!=="0000000000000000000000000000000000000000"){const V=await sh({fs:e,cache:t,gitdir:c,oids:[R,F]});for(const ae of V)H.push(ae);L&&(I=await ch({fs:e,cache:t,gitdir:c,oids:V}))}if(!H.includes(R)){const V=await JL({fs:e,cache:t,gitdir:c,start:[R],finish:H});K=await ch({fs:e,cache:t,gitdir:c,oids:V})}if(L){try{const V=await de.resolve({fs:e,gitdir:c,ref:`refs/remotes/${f}/HEAD`,depth:2}),{oid:ae}=await de.resolveAgainstMap({ref:V.replace(`refs/remotes/${f}/`,""),fullref:V,map:M.refs}),j=[ae];for(const G of await ch({fs:e,cache:t,gitdir:c,oids:j}))I.add(G)}catch{}for(const V of I)K.delete(V)}if(R===F&&(p=!0),!p){if(N.startsWith("refs/tags")&&F!=="0000000000000000000000000000000000000000")throw new Li("tag-exists");if(R!=="0000000000000000000000000000000000000000"&&F!=="0000000000000000000000000000000000000000"&&!await Sb({fs:e,cache:t,gitdir:c,oid:R,ancestor:F,depth:-1}))throw new Li("not-fast-forward")}}const ne=mb([...M.capabilities],["report-status","side-band-64k",`agent=${Ac.agent}`]),q=await ez({capabilities:ne,triplets:[{oldoid:F,oid:R,fullRef:O}]}),X=m?[]:await Rb({fs:e,cache:t,gitdir:c,oids:[...K]}),B=await T.connect({http:n,onProgress:r,corsProxy:v,service:"git-receive-pack",url:S,auth:k,headers:w,body:[...q,...X]}),{packfile:ee,progress:Z}=await wb.demux(B.body);if(o){const H=gb(Z);$s(H,async I=>{await o(I)})}const J=await QL(ee);if(B.headers&&(J.headers=B.headers),f&&J.ok&&J.refs[O].ok&&!N.startsWith("refs/tags")){const H=`refs/remotes/${f}/${O.replace("refs/heads","")}`;m?await de.deleteRef({fs:e,gitdir:c,ref:H}):await de.writeRef({fs:e,gitdir:c,ref:H,value:R})}if(J.ok&&Object.values(J.refs).every(H=>H.ok))return J;{const H=Object.entries(J.refs).filter(([I,V])=>!V.ok).map(([I,V])=>`
|
|
94
|
+
- ${I}: ${V.error}`).join("");throw new Es(H,J)}}async function nz({fs:e,http:t,onProgress:n,onMessage:r,onAuth:o,onAuthSuccess:i,onAuthFailure:a,onPrePush:s,dir:l,gitdir:c=ue.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 W("fs",e),W("http",t),W("gitdir",c),await tz({fs:new be(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 Nb({fs:e,cache:t,gitdir:n,oid:r}){const{type:o,object:i}=await dt({fs:e,cache:t,gitdir:n,oid:r});if(o==="tag")return r=Yt.from(i).parse().object,Nb({fs:e,cache:t,gitdir:n,oid:r});if(o!=="blob")throw new qt(r,o,"blob");return{oid:r,blob:new Uint8Array(i)}}async function Tb({fs:e,cache:t,gitdir:n,oid:r,filepath:o=void 0}){return o!==void 0&&(r=await Is({fs:e,cache:t,gitdir:n,oid:r,filepath:o})),await Nb({fs:e,cache:t,gitdir:n,oid:r})}async function rz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oid:r,filepath:o,cache:i={}}){try{return W("fs",e),W("gitdir",n),W("oid",r),await Tb({fs:new be(e),cache:i,gitdir:n,oid:r,filepath:o})}catch(a){throw a.caller="git.readBlob",a}}async function Mb({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oid:r,cache:o={}}){try{return W("fs",e),W("gitdir",n),W("oid",r),await Vi({fs:new be(e),cache:o,gitdir:n,oid:r})}catch(i){throw i.caller="git.readCommit",i}}async function oz({fs:e,cache:t,gitdir:n,ref:r="refs/notes/commits",oid:o}){const i=await de.resolve({gitdir:n,fs:e,ref:r}),{blob:a}=await Tb({fs:e,cache:t,gitdir:n,oid:i,filepath:o});return a}async function iz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r="refs/notes/commits",oid:o,cache:i={}}){try{return W("fs",e),W("gitdir",n),W("ref",r),W("oid",o),await oz({fs:new be(e),cache:i,gitdir:n,ref:r,oid:o})}catch(a){throw a.caller="git.readNote",a}}async function az({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oid:r,format:o="parsed",filepath:i=void 0,encoding:a=void 0,cache:s={}}){try{W("fs",e),W("gitdir",n),W("oid",r);const l=new be(e);i!==void 0&&(r=await Is({fs:l,cache:s,gitdir:n,oid:r,filepath:i}));const u=await dt({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=ft.from(u.object).parse();break;case"tree":u.object=tn.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=Yt.from(u.object).parse();break;default:throw new qt(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 sz({fs:e,cache:t,gitdir:n,oid:r}){const{type:o,object:i}=await dt({fs:e,cache:t,gitdir:n,oid:r,format:"content"});if(o!=="tag")throw new qt(r,o,"tag");const a=Yt.from(i);return{oid:r,tag:a.parse(),payload:a.payload()}}async function lz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oid:r,cache:o={}}){try{return W("fs",e),W("gitdir",n),W("oid",r),await sz({fs:new be(e),cache:o,gitdir:n,oid:r})}catch(i){throw i.caller="git.readTag",i}}async function cz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),oid:r,filepath:o=void 0,cache:i={}}){try{return W("fs",e),W("gitdir",n),W("oid",r),await Wi({fs:new be(e),cache:i,gitdir:n,oid:r,filepath:o})}catch(a){throw a.caller="git.readTree",a}}async function uz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),filepath:r,cache:o={}}){try{W("fs",e),W("gitdir",n),W("filepath",r),await Rt.acquire({fs:new be(e),gitdir:n,cache:o},async function(i){i.delete({filepath:r})})}catch(i){throw i.caller="git.remove",i}}async function dz({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 de.resolve({gitdir:r,fs:e,ref:o})}catch(p){if(!(p instanceof ot))throw p}let d=(await Wi({fs:e,gitdir:r,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;d=d.filter(p=>p.path!==i);const f=await js({fs:e,gitdir:r,tree:d});return await Mc({fs:e,cache:t,onSign:n,gitdir:r,ref:o,tree:f,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote'
|
|
95
|
+
`,author:a,committer:s,signingKey:l})}async function fz({fs:e,onSign:t,dir:n,gitdir:r=ue.join(n,".git"),ref:o="refs/notes/commits",oid:i,author:a,committer:s,signingKey:l,cache:c={}}){try{W("fs",e),W("gitdir",r),W("oid",i);const u=new be(e),d=await io({fs:u,gitdir:r,author:a});if(!d)throw new It("author");const f=await Ui({fs:u,gitdir:r,author:d,committer:s});if(!f)throw new It("committer");return await dz({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 hz({fs:e,gitdir:t,oldref:n,ref:r,checkout:o=!1}){if(r!==dr.clean(r))throw new zn(r,dr.clean(r));if(n!==dr.clean(n))throw new zn(n,dr.clean(n));const i=`refs/heads/${n}`,a=`refs/heads/${r}`;if(await de.exists({fs:e,gitdir:t,ref:a}))throw new Ln("branch",r,!1);const l=await de.resolve({fs:e,gitdir:t,ref:i,depth:1});await de.writeRef({fs:e,gitdir:t,ref:a,value:l}),await de.deleteRef({fs:e,gitdir:t,ref:i});const u=await ao({fs:e,gitdir:t,fullname:!0})===i;(o||u)&&await de.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:a})}async function pz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r,oldref:o,checkout:i=!1}){try{return W("fs",e),W("gitdir",n),W("ref",r),W("oldref",o),await hz({fs:new be(e),gitdir:n,ref:r,oldref:o,checkout:i})}catch(a){throw a.caller="git.renameBranch",a}}async function Db({gitdir:e,type:t,object:n}){return Or(Ai.wrap({type:t,object:n}))}async function mz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),filepath:r,ref:o,cache:i={}}){try{W("fs",e),W("gitdir",n),W("filepath",r);const a=new be(e);let s,l;try{s=await de.resolve({fs:a,gitdir:n,ref:o||"HEAD"})}catch(d){if(o)throw d}if(s)try{s=await Is({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(ue.join(t,r));u&&(l=await Db({gitdir:n,type:"blob",object:u}),s===l&&(c=await a.lstat(ue.join(t,r)))),await Rt.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 gz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r,depth:o}){try{return W("fs",e),W("gitdir",n),W("ref",r),await de.resolve({fs:new be(e),gitdir:n,ref:r,depth:o})}catch(i){throw i.caller="git.resolveRef",i}}async function wz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),path:r,value:o,append:i=!1}){try{W("fs",e),W("gitdir",n),W("path",r);const a=new be(e),s=await bt.get({fs:a,gitdir:n});i?await s.append(r,o):await s.set(r,o),await bt.save({fs:a,gitdir:n,config:s})}catch(a){throw a.caller="git.setConfig",a}}async function kb({fs:e,gitdir:t,commit:n}){const r=ft.from(n).toObject();return await rn({fs:e,gitdir:t,type:"commit",object:r,format:"content"})}class jc{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=jc.timezoneOffsetForRefLogEntry;return`${i} ${n} ${o} ${t.email} ${a} ${s} ${r}
|
|
96
|
+
`}static getStashReflogEntry(t,n=!1){return t.split(`
|
|
97
|
+
`).filter(i=>i).reverse().map((i,a)=>n?`stash@{${a}}: ${i.split(" ")[1]}`:i)}}const vz={stage:Oi,workdir:Os};let uh;async function Gi(e,t){return uh===void 0&&(uh=new Qa),uh.acquire(e,t)}async function yz(e,t,n,r,o=null){const i=ue.join(n,r),a=await e.lstat(i);if(!a)throw new ot(i);if(a.isDirectory())throw new De(`${i}: file expected, but found directory`);const s=o?await B0({fs:e,gitdir:t,oid:o}):void 0;let l=s?o:void 0;return s||await Gi({fs:e,gitdir:t,currentFilepath:i},async()=>{const c=a.isSymbolicLink()?await e.readlink(i).then(eb):await e.read(i);if(c===null)throw new ot(i);l=await rn({fs:e,gitdir:t,type:"blob",object:c})}),l}async function bz({fs:e,dir:t,gitdir:n,entries:r}){async function o(i){if(i.type==="tree"){if(!i.oid){const a=await Promise.all(i.children.map(o));i.oid=await js({fs:e,gitdir:n,tree:a}),i.mode=16384}}else i.type==="blob"&&(i.oid=await yz(e,n,t,i.path,i.oid),i.mode=33188);return i.path=i.path.split("/").pop(),i}return Promise.all(r.map(o))}async function Ob({fs:e,dir:t,gitdir:n,treePair:r}){const o=r[1]==="stage",i=r.map(h=>typeof h=="string"?vz[h]():h),a=[],u=await oo({fs:e,cache:{},dir:t,gitdir:n,trees:i,map:async(h,[p,m])=>{if(!(h==="."||await Hi.isIgnored({fs:e,dir:t,gitdir:n,filepath:h}))&&m)return(!p||await p.oid()!==await m.oid()&&await m.oid()!==void 0)&&a.push([p,m]),{mode:await m.mode(),path:h,oid:await m.oid(),type:await m.type()}},reduce:async(h,p)=>(p=p.filter(Boolean),h?(h.children=p,h):p.length>0?p:void 0),iterate:async(h,p)=>{const m=[];for(const v of p){const[w,b]=v;o?b&&(await e.exists(`${t}/${b.toString()}`)?m.push(v):a.push([null,b])):w&&(b?m.push(v):a.push([w,null]))}return m.length?Promise.all(m.map(h)):[]}});if(a.length===0||u.length===0)return null;const f=(await bz({fs:e,dir:t,gitdir:n,entries:u})).filter(Boolean).map(h=>({mode:h.mode,path:h.path,oid:h.oid,type:h.type}));return js({fs:e,gitdir:n,tree:f})}async function xz({fs:e,dir:t,gitdir:n,stashCommit:r,parentCommit:o,wasStaged:i}){const a=[],s=[],l=await oo({fs:e,cache:{},dir:t,gitdir:n,trees:[kn({ref:o}),kn({ref:r})],map:async(c,[u,d])=>{if(c==="."||await Hi.isIgnored({fs:e,dir:t,gitdir:n,filepath:c}))return;const f=d?await d.type():await u.type();if(f!=="tree"&&f!=="blob")return;if(!d&&u){const p=f==="tree"?"rmdir":"rm";return f==="tree"&&a.push(c),f==="blob"&&i&&s.push({filepath:c,oid:await u.oid()}),{method:p,filepath:c}}const h=await d.oid();if(!u||await u.oid()!==h)return f==="tree"?{method:"mkdir",filepath:c}:(i&&s.push({filepath:c,oid:h,stats:await e.lstat(ue.join(t,c))}),{method:"write",filepath:c,oid:h})}});await Gi({fs:e,gitdir:n,dirRemoved:a,ops:l},async()=>{for(const c of l){const u=ue.join(t,c.filepath);switch(c.method){case"rmdir":await e.rmdir(u);break;case"mkdir":await e.mkdir(u);break;case"rm":await e.rm(u);break;case"write":if(!a.some(d=>u.startsWith(d))){const{object:d}=await dt({fs:e,cache:{},gitdir:n,oid:c.oid});await e.exists(u)&&await e.rm(u),await e.write(u,d)}break}}}),await Rt.acquire({fs:e,gitdir:n,cache:{}},async c=>{s.forEach(({filepath:u,stats:d,oid:f})=>{c.insert({filepath:u,stats:d,oid:f})})})}class Ir{constructor({fs:t,dir:n,gitdir:r=ue.join(n,".git")}){Object.assign(this,{fs:t,dir:n,gitdir:r,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return ue.join(this.gitdir,Ir.refStash)}get refLogsStashPath(){return ue.join(this.gitdir,Ir.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await io({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new It("author");return this._author}async getStashSHA(t,n){return await this.fs.exists(this.refStashPath)?(n||await this.readStashReflogs({parsed:!1}))[t].split(" ")[1]:null}async writeStashCommit({message:t,tree:n,parent:r}){return kb({fs:this.fs,gitdir:this.gitdir,commit:{message:t,tree:n,parent:r,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(t){const n=await this.readStashReflogs({parsed:!1});if(t!==0&&(t<0||t>n.length-1))throw new zn(`stash@${t}`,"number that is in range of [0, num of stash pushed]");const r=await this.getStashSHA(t,n);return r?Vi({fs:this.fs,cache:{},gitdir:this.gitdir,oid:r}):{}}async writeStashRef(t){return de.writeRef({fs:this.fs,gitdir:this.gitdir,ref:Ir.refStash,value:t})}async writeStashReflogEntry({stashCommit:t,message:n}){const r=await this.getAuthor(),o=jc.createStashReflogEntry(r,t,n),i=this.refLogsStashPath;await Gi({filepath:i,entry:o},async()=>{const a=await this.fs.exists(i)?await this.fs.read(i,"utf8"):"";await this.fs.write(i,a+o,"utf8")})}async readStashReflogs({parsed:t=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];const r=(await this.fs.read(this.refLogsStashPath)).toString();return jc.getStashReflogEntry(r,t)}}async function _z({fs:e,dir:t,gitdir:n,message:r=""}){const o=new Ir({fs:e,dir:t,gitdir:n});await o.getAuthor();const i=await ao({fs:e,gitdir:n,fullname:!1}),a=await de.resolve({fs:e,gitdir:n,ref:"HEAD"}),l=(await Mb({fs:e,dir:t,gitdir:n,oid:a})).commit.message,c=[a];let u=null,d=kn({ref:"HEAD"});const f=await Ob({fs:e,dir:t,gitdir:n,treePair:[kn({ref:"HEAD"}),"stage"]});if(f){const v=await o.writeStashCommit({message:`stash-Index: WIP on ${i} - ${new Date().toISOString()}`,tree:f,parent:c});c.push(v),u=f,d=Oi()}const h=await Ob({fs:e,dir:t,gitdir:n,treePair:[d,"workdir"]});if(h){const v=await o.writeStashCommit({message:`stash-WorkDir: WIP on ${i} - ${new Date().toISOString()}`,tree:h,parent:[c[c.length-1]]});c.push(v),u=h}if(!u||!f&&!h)throw new ot("changes, nothing to stash");const p=(r.trim()||`WIP on ${i}`)+`: ${a.substring(0,7)} ${l}`,m=await o.writeStashCommit({message:p,tree:u,parent:c});return await o.writeStashRef(m),await o.writeStashReflogEntry({stashCommit:m,message:p}),await sb({fs:e,dir:t,gitdir:n,ref:i,track:!1,force:!0}),m}async function Ab({fs:e,dir:t,gitdir:n,refIdx:r=0}){const i=await new Ir({fs:e,dir:t,gitdir:n}).readStashCommit(r),{parent:a=null}=i.commit?i.commit:{};if(!(!a||!Array.isArray(a)))for(let s=0;s<a.length-1;s++){const c=(await Vi({fs:e,cache:{},gitdir:n,oid:a[s+1]})).commit.message.startsWith("stash-Index");await xz({fs:e,dir:t,gitdir:n,stashCommit:a[s+1],parentCommit:a[s],wasStaged:c})}}async function Ib({fs:e,dir:t,gitdir:n,refIdx:r=0}){const o=new Ir({fs:e,dir:t,gitdir:n});if(!(await o.readStashCommit(r)).commit)return;const a=o.refStashPath;await Gi(a,async()=>{await e.exists(a)&&await e.rm(a)});const s=await o.readStashReflogs({parsed:!1});if(!s.length)return;s.splice(r,1);const l=o.refLogsStashPath;await Gi({reflogEntries:s,stashReflogPath:l,stashMgr:o},async()=>{if(s.length){await e.write(l,s.join(`
|
|
98
|
+
`),"utf8");const c=s[s.length-1].split(" ")[1];await o.writeStashRef(c)}else await e.rm(l)})}async function Sz({fs:e,dir:t,gitdir:n}){return new Ir({fs:e,dir:t,gitdir:n}).readStashReflogs({parsed:!0})}async function Cz({fs:e,dir:t,gitdir:n}){const r=new Ir({fs:e,dir:t,gitdir:n}),o=[r.refStashPath,r.refLogsStashPath];await Gi(o,async()=>{await Promise.all(o.map(async i=>{if(await e.exists(i))return e.rm(i)}))})}async function Ez({fs:e,dir:t,gitdir:n,refIdx:r=0}){await Ab({fs:e,dir:t,gitdir:n,refIdx:r}),await Ib({fs:e,dir:t,gitdir:n,refIdx:r})}async function Pz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),op:r="push",message:o="",refIdx:i=0}){W("fs",e),W("dir",t),W("gitdir",n),W("op",r);const a={push:_z,apply:Ab,drop:Ib,list:Sz,clear:Cz,pop:Ez},s=["apply","drop","pop"];try{const l=new be(e);["refs","logs","logs/refs"].map(d=>ue.join(n,d)).forEach(async d=>{await l.exists(d)||await l.mkdir(d)});const u=a[r];if(u){if(s.includes(r)&&i<0)throw new zn(`stash@${i}`,"number that is in range of [0, num of stash pushed]");return await u({fs:l,dir:t,gitdir:n,message:o,refIdx:i})}throw new Error(`To be implemented: ${r}`)}catch(l){throw l.caller="git.stash",l}}async function Rz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),filepath:r,cache:o={}}){try{W("fs",e),W("gitdir",n),W("filepath",r);const i=new be(e);if(await Hi.isIgnored({fs:i,gitdir:n,dir:t,filepath:r}))return"ignored";const s=await Nz({fs:i,cache:o,gitdir:n}),l=await jb({fs:i,cache:o,gitdir:n,tree:s,path:r}),c=await Rt.acquire({fs:i,gitdir:n,cache:o},async function(m){for(const v of m)if(v.path===r)return v;return null}),u=await i.lstat(ue.join(t,r)),d=l!==null,f=c!==null,h=u!==null,p=async()=>{if(f&&!xc(c,u))return c.oid;{const m=await i.read(ue.join(t,r)),v=await Db({gitdir:n,type:"blob",object:m});return f&&c.oid===v&&u.size!==-1&&Rt.acquire({fs:i,gitdir:n,cache:o},async function(w){w.insert({filepath:r,stats:u,oid:v})}),v}};if(!d&&!h&&!f)return"absent";if(!d&&!h&&f)return"*absent";if(!d&&h&&!f)return"*added";if(!d&&h&&f)return await p()===c.oid?"added":"*added";if(d&&!h&&!f)return"deleted";if(d&&!h&&f)return l===c.oid,"*deleted";if(d&&h&&!f)return await p()===l?"*undeleted":"*undeletemodified";if(d&&h&&f){const m=await p();return m===l?m===c.oid?"unmodified":"*unmodified":m===c.oid?"modified":"*modified"}}catch(i){throw i.caller="git.status",i}}async function jb({fs:e,cache:t,gitdir:n,tree:r,path:o}){typeof o=="string"&&(o=o.split("/"));const i=o.shift();for(const a of r)if(a.path===i){if(o.length===0)return a.oid;const{type:s,object:l}=await dt({fs:e,cache:t,gitdir:n,oid:a.oid});if(s==="tree"){const c=tn.from(l);return jb({fs:e,cache:t,gitdir:n,tree:c,path:o})}if(s==="blob")throw new qt(a.oid,s,"blob",o.join("/"))}return null}async function Nz({fs:e,cache:t,gitdir:n}){let r;try{r=await de.resolve({fs:e,gitdir:n,ref:"HEAD"})}catch(i){if(i instanceof ot)return[]}const{tree:o}=await Wi({fs:e,cache:t,gitdir:n,oid:r});return o}async function Tz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r="HEAD",filepaths:o=["."],filter:i,cache:a={},ignored:s=!1}){try{W("fs",e),W("gitdir",n),W("ref",r);const l=new be(e);return await oo({fs:l,cache:a,dir:t,gitdir:n,trees:[kn({ref:r}),Os(),Oi()],map:async function(c,[u,d,f]){if(!u&&!f&&d&&!s&&await Hi.isIgnored({fs:l,dir:t,filepath:c})||!o.some(N=>ab(c,N)))return null;if(i&&!i(c))return;const[h,p,m]=await Promise.all([u&&u.type(),d&&d.type(),f&&f.type()]),v=[h,p,m].includes("blob");if((h==="tree"||h==="special")&&!v)return;if(h==="commit")return null;if((p==="tree"||p==="special")&&!v)return;if(m==="commit")return null;if((m==="tree"||m==="special")&&!v)return;const w=h==="blob"?await u.oid():void 0,b=m==="blob"?await f.oid():void 0;let x;h!=="blob"&&p==="blob"&&m!=="blob"?x="42":p==="blob"&&(x=await d.oid());const S=[void 0,w,x,b],C=S.map(N=>S.indexOf(N));return C.shift(),[c,...C]}})}catch(l){throw l.caller="git.statusMatrix",l}}async function Mz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r,object:o,force:i=!1}){try{W("fs",e),W("gitdir",n),W("ref",r);const a=new be(e);if(r===void 0)throw new nn("ref");r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`;const s=await de.resolve({fs:a,gitdir:n,ref:o||"HEAD"});if(!i&&await de.exists({fs:a,gitdir:n,ref:r}))throw new Ln("tag",r);await de.writeRef({fs:a,gitdir:n,ref:r,value:s})}catch(a){throw a.caller="git.tag",a}}async function Dz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),cache:r={},filepath:o,oid:i,mode:a,add:s,remove:l,force:c}){try{W("fs",e),W("gitdir",n),W("filepath",o);const u=new be(e);if(l)return await Rt.acquire({fs:u,gitdir:n,cache:r},async function(f){let h;if(!c&&(h=await u.lstat(ue.join(t,o)),h)){if(h.isDirectory())throw new no("directory");return}f.has({filepath:o})&&f.delete({filepath:o})});let d;if(!i){if(d=await u.lstat(ue.join(t,o)),!d)throw new ot(`file at "${o}" on disk and "remove" not set`);if(d.isDirectory())throw new no("directory")}return await Rt.acquire({fs:u,gitdir:n,cache:r},async function(f){if(!s&&!f.has({filepath:o}))throw new ot(`file at "${o}" in index and "add" not set`);let h={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:a,uid:0,gid:0,size:0};if(!i){h=d;const p=h.isSymbolicLink()?await u.readlink(ue.join(t,o)):await u.read(ue.join(t,o));i=await rn({fs:u,gitdir:n,type:"blob",format:"content",object:p})}return f.insert({filepath:o,oid:i,stats:h}),i})}catch(u){throw u.caller="git.updateIndex",u}}function kz(){try{return Ac.version}catch(e){throw e.caller="git.version",e}}async function Oz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),trees:r,map:o,reduce:i,iterate:a,cache:s={}}){try{return W("fs",e),W("gitdir",n),W("trees",r),await oo({fs:new be(e),cache:s,dir:t,gitdir:n,trees:r,map:o,reduce:i,iterate:a})}catch(l){throw l.caller="git.walk",l}}async function Az({fs:e,dir:t,gitdir:n=ue.join(t,".git"),blob:r}){try{return W("fs",e),W("gitdir",n),W("blob",r),await rn({fs:new be(e),gitdir:n,type:"blob",object:r,format:"content"})}catch(o){throw o.caller="git.writeBlob",o}}async function Iz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),commit:r}){try{return W("fs",e),W("gitdir",n),W("commit",r),await kb({fs:new be(e),gitdir:n,commit:r})}catch(o){throw o.caller="git.writeCommit",o}}async function jz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),type:r,object:o,format:i="parsed",oid:a,encoding:s=void 0}){try{const l=new be(e);if(i==="parsed"){switch(r){case"commit":o=ft.from(o).toObject();break;case"tree":o=tn.from(o).toObject();break;case"blob":o=Buffer.from(o,s);break;case"tag":o=Yt.from(o).toObject();break;default:throw new qt(a||"",r,"blob|commit|tag|tree")}i="content"}return a=await rn({fs:l,gitdir:n,type:r,object:o,oid:a,format:i}),a}catch(l){throw l.caller="git.writeObject",l}}async function $z({fs:e,dir:t,gitdir:n=ue.join(t,".git"),ref:r,value:o,force:i=!1,symbolic:a=!1}){try{W("fs",e),W("gitdir",n),W("ref",r),W("value",o);const s=new be(e);if(r!==dr.clean(r))throw new zn(r,dr.clean(r));if(!i&&await de.exists({fs:s,gitdir:n,ref:r}))throw new Ln("ref",r);a?await de.writeSymbolicRef({fs:s,gitdir:n,ref:r,value:o}):(o=await de.resolve({fs:s,gitdir:n,ref:o}),await de.writeRef({fs:s,gitdir:n,ref:r,value:o}))}catch(s){throw s.caller="git.writeRef",s}}async function Fz({fs:e,gitdir:t,tag:n}){const r=Yt.from(n).toObject();return await rn({fs:e,gitdir:t,type:"tag",object:r,format:"content"})}async function Lz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),tag:r}){try{return W("fs",e),W("gitdir",n),W("tag",r),await Fz({fs:new be(e),gitdir:n,tag:r})}catch(o){throw o.caller="git.writeTag",o}}async function zz({fs:e,dir:t,gitdir:n=ue.join(t,".git"),tree:r}){try{return W("fs",e),W("gitdir",n),W("tree",r),await js({fs:new be(e),gitdir:n,tree:r})}catch(o){throw o.caller="git.writeTree",o}}var Kt={Errors:pF,STAGE:Oi,TREE:kn,WORKDIR:Os,add:kF,abortMerge:NF,addNote:AF,addRemote:IF,annotatedTag:$F,branch:LF,checkout:sb,clone:ZF,commit:JF,getConfig:yL,getConfigAll:xL,setConfig:wz,currentBranch:QF,deleteBranch:tL,deleteRef:nL,deleteRemote:oL,deleteTag:aL,expandOid:uL,expandRef:dL,fastForward:mL,fetch:gL,findMergeBase:wL,findRoot:vL,getRemoteInfo:_L,getRemoteInfo2:SL,hashBlob:EL,indexPack:RL,init:NL,isDescendent:TL,isIgnored:ML,listBranches:DL,listFiles:OL,listNotes:IL,listRefs:jL,listRemotes:FL,listServerRefs:BL,listTags:HL,log:GL,merge:qL,packObjects:XL,pull:ZL,push:nz,readBlob:rz,readCommit:Mb,readNote:iz,readObject:az,readTag:lz,readTree:cz,remove:uz,removeNote:fz,renameBranch:pz,resetIndex:mz,updateIndex:Dz,resolveRef:gz,status:Rz,statusMatrix:Tz,tag:Mz,version:kz,walk:Oz,writeBlob:Az,writeCommit:Iz,writeObject:jz,writeRef:$z,writeTag:Lz,writeTree:zz,stash:Pz};const Bz=async e=>{try{return await(await window.pfs.stat(e)).isDirectory()}catch(t){if(t.code==="ENOENT")return!1;throw t}},$b=async e=>await window.pfs.readdir(e),Fb=async e=>{let t=window.pfs,n;try{n=await t.stat(e)}catch(r){console.debug("recursiveRm: Path does not exist",r);return}if(n.type==="file")await t.unlink(e),console.debug(`recursiveRm: Deleted file: ${e}`);else if(n.type==="dir"){const r=await t.readdir(e);for(const o of r)await Fb(`${e}/${o}`);await t.rmdir(e),console.debug(`recursiveRm: Deleted directory: ${e}`)}},Hz=async e=>{const t=window.pfs,n=`${window.miDir}/${e}`,r="makeinfinite_client",o="makeinfinite_client@spaceandtime.io";await Kt.setConfig({fs:t,dir:n,path:"user.name",value:r}),await Kt.setConfig({fs:t,dir:n,path:"user.email",value:o})},Uz=async(e,t)=>{const n=window.pfs,r=`${window.miDir}/${e}`;await Kt.clone({fs:n,http:sf,dir:r,url:t,ref:"main"}),await Hz(e)},Vz=async(e,t)=>{const n=window.pfs,r=`${window.miDir}/${e}`;await Kt.pull({fs:n,http:sf,dir:r,url:t,ref:"main"})},Wz=async e=>{const t=window.pfs,n=`${window.miDir}/${e}`,r=await Kt.resolveRef({fs:t,dir:n,ref:"refs/tags/published"});await Kt.checkout({fs:t,dir:n,ref:r})},Gz=async(e,t)=>{const n=window.pfs,r=`${window.miDir}/${e}`;await Kt.fetch({fs:n,http:sf,dir:r,url:t,ref:"main",tags:!0,pruneTags:!0})};class qz{constructor(t,n,r){this.targetRef=t,this.sourceRef=n,this.opType=r}}const dh=e=>{var a,s;const t=e.commit.message.trim().split(`
|
|
99
|
+
`),n=t.find(l=>l.startsWith("Git Ref: ")),r=t.find(l=>l.startsWith("Extra Metadata: "));if(!n||!r)return null;const o=(a=n.split("Git Ref: ")[1])==null?void 0:a.trim(),i=JSON.parse(((s=r.split("Extra Metadata: ")[1])==null?void 0:s.trim())||"{}");return!o||!i?null:new qz(o,i.sourceRef,i.opType)},Yz=async e=>{const t=window.pfs,n=`${window.miDir}/${e}`;return await Kt.resolveRef({fs:t,dir:n,ref:"HEAD"})},Lb=async(e,t)=>{const n=window.pfs,r=`${window.miDir}/${e}`,o={fs:n,dir:r,ref:"HEAD",depth:1,filepath:t},i=(await Kt.log(o))[0];if(!i)throw new Error("No commit found");return i.oid},$c=async(e,t,n,r,o=new Set,i=1e3)=>{if(i<=0)throw new Error(`Maximum recursion depth reached while resolving commit: ${n}`);const a=window.pfs,s=`${window.miDir}/${e}`,l={fs:a,dir:s,ref:n,depth:1,filepath:t},c=(await Kt.log(l))[0];if(!c)throw new Error("No commit found");if(o.has(c.oid))throw new Error(`Circular reference detected: ${c.oid} has already been seen`);o.add(c.oid);const u=dh(c);if(u&&u.opType==r)return $c(e,t,u.targetRef,r,o,i-1);if(c.commit.parent.length>1){const d=c.commit.parent[0];if(!d)throw new Error("No parent found");return $c(e,t,d,r,o,i-1)}return c},Kz=async(e,t)=>{const n=window.pfs,r=`${window.miDir}/${e}`,o=await Lb(e,t),i=await $c(e,t,o,"UNDO"),a=dh(i);if(a)return[o,a.sourceRef];{let s=i.oid;const l={fs:n,dir:r,ref:s,depth:2,filepath:t},c=await Kt.log(l);if(!c[1])throw new Error("No previous commit found");const u=c[1].oid;return[o,u]}},Xz=async(e,t)=>{const n=await Lb(e,t),r=await $c(e,t,n,"REDO"),o=dh(r);if(!o)throw new Error("No undos to redo");return[n,o.sourceRef]},Zz=async(e,t)=>{await Bz(`${window.miDir}/${e}`)||await Uz(e,t);try{await Vz(e,t)}catch(r){throw await Fb(`${window.miDir}/${e}`).catch(o=>console.log(`recursiveRm error: ${o}`)),r}},zb=async(e,t)=>{let n=0;const r=5;for(;n<=r;)try{await Zz(e||"",t||"");break}catch(o){if(n++,console.log(`Retrying syncGitSource (Attempt ${n})`),n>r)throw console.error(`syncGitSource failed after ${n} attempts:`,o),o}},fh=async(e,t)=>{const n=window.pfs,r=`${window.miDir}/${e}`;await Gz(e,t);const o=await Kt.listTags({fs:n,dir:r});return await Promise.all(o.map(async a=>{const s=await Kt.resolveRef({fs:n,dir:r,ref:`refs/tags/${a}`});let l=null;try{l=(await Kt.readTag({fs:n,dir:r,oid:s})).tag.object}catch{l=s}const{commit:c}=await Kt.readCommit({fs:n,dir:r,oid:s});return{tag:a,targetCommitTimestamp:c.committer.timestamp,targetCommit:l,ref:`refs/tags/${a}`}}))};var Bb={exports:{}},Ls={};/*
|
|
100
100
|
object-assign
|
|
101
101
|
(c) Sindre Sorhus
|
|
102
102
|
@license MIT
|
|
103
|
-
*/var
|
|
103
|
+
*/var Hb=Object.getOwnPropertySymbols,Jz=Object.prototype.hasOwnProperty,Qz=Object.prototype.propertyIsEnumerable;function eB(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function tB(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(i){return t[i]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}tB();/** @license React v17.0.2
|
|
104
104
|
* react-jsx-runtime.production.min.js
|
|
105
105
|
*
|
|
106
106
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
107
107
|
*
|
|
108
108
|
* This source code is licensed under the MIT license found in the
|
|
109
109
|
* LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/var
|
|
110
|
+
*/var nB=E,Ub=60103;if(Ls.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var Vb=Symbol.for;Ub=Vb("react.element"),Ls.Fragment=Vb("react.fragment")}var rB=nB.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,oB=Object.prototype.hasOwnProperty,iB={key:!0,ref:!0,__self:!0,__source:!0};function Wb(e,t,n){var r,o={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)oB.call(t,r)&&!iB.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Ub,type:e,key:i,ref:a,props:o,_owner:rB.current}}Ls.jsx=Wb,Ls.jsxs=Wb,Bb.exports=Ls;var g=Bb.exports,Gb={exports:{}},Qe={};/** @license React v16.13.1
|
|
111
111
|
* react-is.production.min.js
|
|
112
112
|
*
|
|
113
113
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
114
114
|
*
|
|
115
115
|
* This source code is licensed under the MIT license found in the
|
|
116
116
|
* LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/var qe=typeof Symbol=="function"&&Symbol.for,cs=qe?Symbol.for("react.element"):60103,ls=qe?Symbol.for("react.portal"):60106,da=qe?Symbol.for("react.fragment"):60107,ha=qe?Symbol.for("react.strict_mode"):60108,pa=qe?Symbol.for("react.profiler"):60114,ma=qe?Symbol.for("react.provider"):60109,wa=qe?Symbol.for("react.context"):60110,us=qe?Symbol.for("react.async_mode"):60111,ga=qe?Symbol.for("react.concurrent_mode"):60111,ya=qe?Symbol.for("react.forward_ref"):60112,ba=qe?Symbol.for("react.suspense"):60113,Nb=qe?Symbol.for("react.suspense_list"):60120,_a=qe?Symbol.for("react.memo"):60115,va=qe?Symbol.for("react.lazy"):60116,Mb=qe?Symbol.for("react.block"):60121,Lb=qe?Symbol.for("react.fundamental"):60117,Fb=qe?Symbol.for("react.responder"):60118,Ub=qe?Symbol.for("react.scope"):60119;function mt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case cs:switch(e=e.type,e){case us:case ga:case da:case pa:case ha:case ba:return e;default:switch(e=e&&e.$$typeof,e){case wa:case ya:case va:case _a:case ma:return e;default:return t}}case ls:return t}}}function zf(e){return mt(e)===ga}ke.AsyncMode=us,ke.ConcurrentMode=ga,ke.ContextConsumer=wa,ke.ContextProvider=ma,ke.Element=cs,ke.ForwardRef=ya,ke.Fragment=da,ke.Lazy=va,ke.Memo=_a,ke.Portal=ls,ke.Profiler=pa,ke.StrictMode=ha,ke.Suspense=ba,ke.isAsyncMode=function(e){return zf(e)||mt(e)===us},ke.isConcurrentMode=zf,ke.isContextConsumer=function(e){return mt(e)===wa},ke.isContextProvider=function(e){return mt(e)===ma},ke.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===cs},ke.isForwardRef=function(e){return mt(e)===ya},ke.isFragment=function(e){return mt(e)===da},ke.isLazy=function(e){return mt(e)===va},ke.isMemo=function(e){return mt(e)===_a},ke.isPortal=function(e){return mt(e)===ls},ke.isProfiler=function(e){return mt(e)===pa},ke.isStrictMode=function(e){return mt(e)===ha},ke.isSuspense=function(e){return mt(e)===ba},ke.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===da||e===ga||e===pa||e===ha||e===ba||e===Nb||typeof e=="object"&&e!==null&&(e.$$typeof===va||e.$$typeof===_a||e.$$typeof===ma||e.$$typeof===wa||e.$$typeof===ya||e.$$typeof===Lb||e.$$typeof===Fb||e.$$typeof===Ub||e.$$typeof===Mb)},ke.typeOf=mt,Bf.exports=ke;var fs=Bf.exports;function Hb(e){function t(L,W,G,te,I){for(var ee=0,D=0,q=0,Z=0,X,F,V=0,re=0,Q,le=Q=X=0,ne=0,ie=0,Re=0,Ee=0,Et=G.length,We=Et-1,Ae,se="",Se="",Oi="",w="",f;ne<Et;){if(F=G.charCodeAt(ne),ne===We&&D+Z+q+ee!==0&&(D!==0&&(F=D===47?10:47),Z=q=ee=0,Et++,We++),D+Z+q+ee===0){if(ne===We&&(0<ie&&(se=se.replace(p,"")),0<se.trim().length)){switch(F){case 32:case 9:case 59:case 13:case 10:break;default:se+=G.charAt(ne)}F=59}switch(F){case 123:for(se=se.trim(),X=se.charCodeAt(0),Q=1,Ee=++ne;ne<Et;){switch(F=G.charCodeAt(ne)){case 123:Q++;break;case 125:Q--;break;case 47:switch(F=G.charCodeAt(ne+1)){case 42:case 47:e:{for(le=ne+1;le<We;++le)switch(G.charCodeAt(le)){case 47:if(F===42&&G.charCodeAt(le-1)===42&&ne+2!==le){ne=le+1;break e}break;case 10:if(F===47){ne=le+1;break e}}ne=le}}break;case 91:F++;case 40:F++;case 34:case 39:for(;ne++<We&&G.charCodeAt(ne)!==F;);}if(Q===0)break;ne++}switch(Q=G.substring(Ee,ne),X===0&&(X=(se=se.replace(d,"").trim()).charCodeAt(0)),X){case 64:switch(0<ie&&(se=se.replace(p,"")),F=se.charCodeAt(1),F){case 100:case 109:case 115:case 45:ie=W;break;default:ie=Te}if(Q=t(W,ie,Q,F,I+1),Ee=Q.length,0<ge&&(ie=r(Te,se,Re),f=s(3,Q,ie,W,H,M,Ee,F,I,te),se=ie.join(""),f!==void 0&&(Ee=(Q=f.trim()).length)===0&&(F=0,Q="")),0<Ee)switch(F){case 115:se=se.replace(C,o);case 100:case 109:case 45:Q=se+"{"+Q+"}";break;case 107:se=se.replace(v,"$1 $2"),Q=se+"{"+Q+"}",Q=ue===1||ue===2&&a("@"+Q,3)?"@-webkit-"+Q+"@"+Q:"@"+Q;break;default:Q=se+Q,te===112&&(Q=(Se+=Q,""))}else Q="";break;default:Q=t(W,r(W,se,Re),Q,te,I+1)}Oi+=Q,Q=Re=ie=le=X=0,se="",F=G.charCodeAt(++ne);break;case 125:case 59:if(se=(0<ie?se.replace(p,""):se).trim(),1<(Ee=se.length))switch(le===0&&(X=se.charCodeAt(0),X===45||96<X&&123>X)&&(Ee=(se=se.replace(" ",":")).length),0<ge&&(f=s(1,se,W,L,H,M,Se.length,te,I,te))!==void 0&&(Ee=(se=f.trim()).length)===0&&(se="\0\0"),X=se.charCodeAt(0),F=se.charCodeAt(1),X){case 0:break;case 64:if(F===105||F===99){w+=se+G.charAt(ne);break}default:se.charCodeAt(Ee-1)!==58&&(Se+=i(se,X,F,se.charCodeAt(2)))}Re=ie=le=X=0,se="",F=G.charCodeAt(++ne)}}switch(F){case 13:case 10:D===47?D=0:1+X===0&&te!==107&&0<se.length&&(ie=1,se+="\0"),0<ge*Ue&&s(0,se,W,L,H,M,Se.length,te,I,te),M=1,H++;break;case 59:case 125:if(D+Z+q+ee===0){M++;break}default:switch(M++,Ae=G.charAt(ne),F){case 9:case 32:if(Z+ee+D===0)switch(V){case 44:case 58:case 9:case 32:Ae="";break;default:F!==32&&(Ae=" ")}break;case 0:Ae="\\0";break;case 12:Ae="\\f";break;case 11:Ae="\\v";break;case 38:Z+D+ee===0&&(ie=Re=1,Ae="\f"+Ae);break;case 108:if(Z+D+ee+Y===0&&0<le)switch(ne-le){case 2:V===112&&G.charCodeAt(ne-3)===58&&(Y=V);case 8:re===111&&(Y=re)}break;case 58:Z+D+ee===0&&(le=ne);break;case 44:D+q+Z+ee===0&&(ie=1,Ae+="\r");break;case 34:case 39:D===0&&(Z=Z===F?0:Z===0?F:Z);break;case 91:Z+D+q===0&&ee++;break;case 93:Z+D+q===0&&ee--;break;case 41:Z+D+ee===0&&q--;break;case 40:if(Z+D+ee===0){if(X===0)switch(2*V+3*re){case 533:break;default:X=1}q++}break;case 64:D+q+Z+ee+le+Q===0&&(Q=1);break;case 42:case 47:if(!(0<Z+ee+q))switch(D){case 0:switch(2*F+3*G.charCodeAt(ne+1)){case 235:D=47;break;case 220:Ee=ne,D=42}break;case 42:F===47&&V===42&&Ee+2!==ne&&(G.charCodeAt(Ee+2)===33&&(Se+=G.substring(Ee,ne+1)),Ae="",D=0)}}D===0&&(se+=Ae)}re=V,V=F,ne++}if(Ee=Se.length,0<Ee){if(ie=W,0<ge&&(f=s(2,Se,ie,L,H,M,Ee,te,I,te),f!==void 0&&(Se=f).length===0))return w+Se+Oi;if(Se=ie.join(",")+"{"+Se+"}",ue*Y!==0){switch(ue!==2||a(Se,2)||(Y=0),Y){case 111:Se=Se.replace(R,":-moz-$1")+Se;break;case 112:Se=Se.replace(O,"::-webkit-input-$1")+Se.replace(O,"::-moz-$1")+Se.replace(O,":-ms-input-$1")+Se}Y=0}}return w+Se+Oi}function r(L,W,G){var te=W.trim().split(x);W=te;var I=te.length,ee=L.length;switch(ee){case 0:case 1:var D=0;for(L=ee===0?"":L[0]+" ";D<I;++D)W[D]=n(L,W[D],G).trim();break;default:var q=D=0;for(W=[];D<I;++D)for(var Z=0;Z<ee;++Z)W[q++]=n(L[Z]+" ",te[D],G).trim()}return W}function n(L,W,G){var te=W.charCodeAt(0);switch(33>te&&(te=(W=W.trim()).charCodeAt(0)),te){case 38:return W.replace(y,"$1"+L.trim());case 58:return L.trim()+W.replace(y,"$1"+L.trim());default:if(0<1*G&&0<W.indexOf("\f"))return W.replace(y,(L.charCodeAt(0)===58?"":"$1")+L.trim())}return L+W}function i(L,W,G,te){var I=L+";",ee=2*W+3*G+4*te;if(ee===944){L=I.indexOf(":",9)+1;var D=I.substring(L,I.length-1).trim();return D=I.substring(0,L).trim()+D+";",ue===1||ue===2&&a(D,1)?"-webkit-"+D+D:D}if(ue===0||ue===2&&!a(I,1))return I;switch(ee){case 1015:return I.charCodeAt(10)===97?"-webkit-"+I+I:I;case 951:return I.charCodeAt(3)===116?"-webkit-"+I+I:I;case 963:return I.charCodeAt(5)===110?"-webkit-"+I+I:I;case 1009:if(I.charCodeAt(4)!==100)break;case 969:case 942:return"-webkit-"+I+I;case 978:return"-webkit-"+I+"-moz-"+I+I;case 1019:case 983:return"-webkit-"+I+"-moz-"+I+"-ms-"+I+I;case 883:if(I.charCodeAt(8)===45)return"-webkit-"+I+I;if(0<I.indexOf("image-set(",11))return I.replace(B,"$1-webkit-$2")+I;break;case 932:if(I.charCodeAt(4)===45)switch(I.charCodeAt(5)){case 103:return"-webkit-box-"+I.replace("-grow","")+"-webkit-"+I+"-ms-"+I.replace("grow","positive")+I;case 115:return"-webkit-"+I+"-ms-"+I.replace("shrink","negative")+I;case 98:return"-webkit-"+I+"-ms-"+I.replace("basis","preferred-size")+I}return"-webkit-"+I+"-ms-"+I+I;case 964:return"-webkit-"+I+"-ms-flex-"+I+I;case 1023:if(I.charCodeAt(8)!==99)break;return D=I.substring(I.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),"-webkit-box-pack"+D+"-webkit-"+I+"-ms-flex-pack"+D+I;case 1005:return g.test(I)?I.replace(m,":-webkit-")+I.replace(m,":-moz-")+I:I;case 1e3:switch(D=I.substring(13).trim(),W=D.indexOf("-")+1,D.charCodeAt(0)+D.charCodeAt(W)){case 226:D=I.replace(b,"tb");break;case 232:D=I.replace(b,"tb-rl");break;case 220:D=I.replace(b,"lr");break;default:return I}return"-webkit-"+I+"-ms-"+D+I;case 1017:if(I.indexOf("sticky",9)===-1)break;case 975:switch(W=(I=L).length-10,D=(I.charCodeAt(W)===33?I.substring(0,W):I).substring(L.indexOf(":",7)+1).trim(),ee=D.charCodeAt(0)+(D.charCodeAt(7)|0)){case 203:if(111>D.charCodeAt(8))break;case 115:I=I.replace(D,"-webkit-"+D)+";"+I;break;case 207:case 102:I=I.replace(D,"-webkit-"+(102<ee?"inline-":"")+"box")+";"+I.replace(D,"-webkit-"+D)+";"+I.replace(D,"-ms-"+D+"box")+";"+I}return I+";";case 938:if(I.charCodeAt(5)===45)switch(I.charCodeAt(6)){case 105:return D=I.replace("-items",""),"-webkit-"+I+"-webkit-box-"+D+"-ms-flex-"+D+I;case 115:return"-webkit-"+I+"-ms-flex-item-"+I.replace(S,"")+I;default:return"-webkit-"+I+"-ms-flex-line-pack"+I.replace("align-content","").replace(S,"")+I}break;case 973:case 989:if(I.charCodeAt(3)!==45||I.charCodeAt(4)===122)break;case 931:case 953:if($.test(L)===!0)return(D=L.substring(L.indexOf(":")+1)).charCodeAt(0)===115?i(L.replace("stretch","fill-available"),W,G,te).replace(":fill-available",":stretch"):I.replace(D,"-webkit-"+D)+I.replace(D,"-moz-"+D.replace("fill-",""))+I;break;case 962:if(I="-webkit-"+I+(I.charCodeAt(5)===102?"-ms-"+I:"")+I,G+te===211&&I.charCodeAt(13)===105&&0<I.indexOf("transform",10))return I.substring(0,I.indexOf(";",27)+1).replace(_,"$1-webkit-$2")+I}return I}function a(L,W){var G=L.indexOf(W===1?":":"{"),te=L.substring(0,W!==3?G:10);return G=L.substring(G+1,L.length-1),Pe(W!==2?te:te.replace(P,"$1"),G,W)}function o(L,W){var G=i(W,W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2));return G!==W+";"?G.replace(k," or ($1)").substring(4):"("+W+")"}function s(L,W,G,te,I,ee,D,q,Z,X){for(var F=0,V=W,re;F<ge;++F)switch(re=me[F].call(u,L,V,G,te,I,ee,D,q,Z,X)){case void 0:case!1:case!0:case null:break;default:V=re}if(V!==W)return V}function l(L){switch(L){case void 0:case null:ge=me.length=0;break;default:if(typeof L=="function")me[ge++]=L;else if(typeof L=="object")for(var W=0,G=L.length;W<G;++W)l(L[W]);else Ue=!!L|0}return l}function c(L){return L=L.prefix,L!==void 0&&(Pe=null,L?typeof L!="function"?ue=1:(ue=2,Pe=L):ue=0),c}function u(L,W){var G=L;if(33>G.charCodeAt(0)&&(G=G.trim()),oe=G,G=[oe],0<ge){var te=s(-1,W,G,G,H,M,0,0,0,0);te!==void 0&&typeof te=="string"&&(W=te)}var I=t(Te,G,W,0,0);return 0<ge&&(te=s(-2,I,G,G,H,M,I.length,0,0,0),te!==void 0&&(I=te)),oe="",Y=0,M=H=1,I}var d=/^\0+/g,p=/[\0\r\f]/g,m=/: */g,g=/zoo|gra/,_=/([,: ])(transform)/g,x=/,\r+?/g,y=/([\t\r\n ])*\f?&/g,v=/@(k\w+)\s*(\S*)\s*/,O=/::(place)/g,R=/:(read-only)/g,b=/[svh]\w+-[tblr]{2}/,C=/\(\s*(.*)\s*\)/g,k=/([\s\S]*?);/g,S=/-self|flex-/g,P=/[^]*?(:[rp][el]a[\w-]+)[^]*/,$=/stretch|:\s*\w+\-(?:conte|avail)/,B=/([^-])(image-set\()/,M=1,H=1,Y=0,ue=1,Te=[],me=[],ge=0,Pe=null,Ue=0,oe="";return u.use=l,u.set=c,e!==void 0&&c(e),u}var Wb={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 Gb(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var qb=/^((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)-.*))$/,Nf=Gb(function(e){return qb.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),ds=fs,Yb={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Xb={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Zb={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Mf={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},hs={};hs[ds.ForwardRef]=Zb,hs[ds.Memo]=Mf;function Lf(e){return ds.isMemo(e)?Mf:hs[e.$$typeof]||Yb}var Vb=Object.defineProperty,Kb=Object.getOwnPropertyNames,Ff=Object.getOwnPropertySymbols,Jb=Object.getOwnPropertyDescriptor,Qb=Object.getPrototypeOf,Uf=Object.prototype;function Hf(e,t,r){if(typeof t!="string"){if(Uf){var n=Qb(t);n&&n!==Uf&&Hf(e,n,r)}var i=Kb(t);Ff&&(i=i.concat(Ff(t)));for(var a=Lf(e),o=Lf(t),s=0;s<i.length;++s){var l=i[s];if(!Xb[l]&&!(r&&r[l])&&!(o&&o[l])&&!(a&&a[l])){var c=Jb(t,l);try{Vb(e,l,c)}catch{}}}}return e}var e_=Hf;const t_=St(e_);function Qt(){return(Qt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var Wf=function(e,t){for(var r=[e[0]],n=0,i=t.length;n<i;n+=1)r.push(t[n],e[n+1]);return r},ps=function(e){return e!==null&&typeof e=="object"&&(e.toString?e.toString():Object.prototype.toString.call(e))==="[object Object]"&&!fs.typeOf(e)},xa=Object.freeze([]),wr=Object.freeze({});function gi(e){return typeof e=="function"}function Gf(e){return e.displayName||e.name||"Component"}function ms(e){return e&&typeof e.styledComponentId=="string"}var yn=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",ws=typeof window<"u"&&"HTMLElement"in window,r_=!!(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 yi(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(r.length>0?" Args: "+r.join(", "):""))}var n_=function(){function e(r){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=r}var t=e.prototype;return t.indexOfGroup=function(r){for(var n=0,i=0;i<r;i++)n+=this.groupSizes[i];return n},t.insertRules=function(r,n){if(r>=this.groupSizes.length){for(var i=this.groupSizes,a=i.length,o=a;r>=o;)(o<<=1)<0&&yi(16,""+r);this.groupSizes=new Uint32Array(o),this.groupSizes.set(i),this.length=o;for(var s=a;s<o;s++)this.groupSizes[s]=0}for(var l=this.indexOfGroup(r+1),c=0,u=n.length;c<u;c++)this.tag.insertRule(l,n[c])&&(this.groupSizes[r]++,l++)},t.clearGroup=function(r){if(r<this.length){var n=this.groupSizes[r],i=this.indexOfGroup(r),a=i+n;this.groupSizes[r]=0;for(var o=i;o<a;o++)this.tag.deleteRule(i)}},t.getGroup=function(r){var n="";if(r>=this.length||this.groupSizes[r]===0)return n;for(var i=this.groupSizes[r],a=this.indexOfGroup(r),o=a+i,s=a;s<o;s++)n+=this.tag.getRule(s)+`/*!sc*/
|
|
118
|
-
`;return
|
|
119
|
-
`),
|
|
120
|
-
`}}}return a}(this)},e}(),m_=/(a)(d)/gi,Zf=function(e){return String.fromCharCode(e+(e>25?39:97))};function gs(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=Zf(t%52)+r;return(Zf(t%52)+r).replace(m_,"$1-$2")}var bn=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},Vf=function(e){return bn(5381,e)};function w_(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(gi(r)&&!ms(r))return!1}return!0}var g_=Vf("5.3.11"),y_=function(){function e(t,r,n){this.rules=t,this.staticRulesId="",this.isStatic=(n===void 0||n.isStatic)&&w_(t),this.componentId=r,this.baseHash=bn(g_,r),this.baseStyle=n,Xf.registerId(r)}return e.prototype.generateAndInjectStyles=function(t,r,n){var i=this.componentId,a=[];if(this.baseStyle&&a.push(this.baseStyle.generateAndInjectStyles(t,r,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&r.hasNameForId(i,this.staticRulesId))a.push(this.staticRulesId);else{var o=_n(this.rules,t,r,n).join(""),s=gs(bn(this.baseHash,o)>>>0);if(!r.hasNameForId(i,s)){var l=n(o,"."+s,void 0,i);r.insertRules(i,s,l)}a.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,u=bn(this.baseHash,n.hash),d="",p=0;p<c;p++){var m=this.rules[p];if(typeof m=="string")d+=m;else if(m){var g=_n(m,t,r,n),_=Array.isArray(g)?g.join(""):g;u=bn(u,_+p),d+=_}}if(d){var x=gs(u>>>0);if(!r.hasNameForId(i,x)){var y=n(d,"."+x,void 0,i);r.insertRules(i,x,y)}a.push(x)}}return a.join(" ")},e}(),b_=/^\s*\/\/.*$/gm,__=[":","[",".","#"];function v_(e){var t,r,n,i,a=wr,o=a.options,s=o===void 0?wr:o,l=a.plugins,c=l===void 0?xa:l,u=new Hb(s),d=[],p=function(_){function x(y){if(y)try{_(y+"}")}catch{}}return function(y,v,O,R,b,C,k,S,P,$){switch(y){case 1:if(P===0&&v.charCodeAt(0)===64)return _(v+";"),"";break;case 2:if(S===0)return v+"/*|*/";break;case 3:switch(S){case 102:case 112:return _(O[0]+v),"";default:return v+($===0?"/*|*/":"")}case-2:v.split("/*|*/}").forEach(x)}}}(function(_){d.push(_)}),m=function(_,x,y){return x===0&&__.indexOf(y[r.length])!==-1||y.match(i)?_:"."+t};function g(_,x,y,v){v===void 0&&(v="&");var O=_.replace(b_,""),R=x&&y?y+" "+x+" { "+O+" }":O;return t=v,r=x,n=new RegExp("\\"+r+"\\b","g"),i=new RegExp("(\\"+r+"\\b){2,}"),u(y||!x?"":x,R)}return u.use([].concat(c,[function(_,x,y){_===2&&y.length&&y[0].lastIndexOf(r)>0&&(y[0]=y[0].replace(n,m))},p,function(_){if(_===-2){var x=d;return d=[],x}}])),g.hash=c.length?c.reduce(function(_,x){return x.name||yi(15),bn(_,x.name)},5381).toString():"",g}var Kf=K.createContext();Kf.Consumer;var Jf=K.createContext(),x_=(Jf.Consumer,new Xf),ys=v_();function E_(){return K.useContext(Kf)||x_}function S_(){return K.useContext(Jf)||ys}var k_=function(){function e(t,r){var n=this;this.inject=function(i,a){a===void 0&&(a=ys);var o=n.name+a.hash;i.hasNameForId(n.id,o)||i.insertRules(n.id,o,a(n.rules,o,"@keyframes"))},this.toString=function(){return yi(12,String(n.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=r}return e.prototype.getName=function(t){return t===void 0&&(t=ys),this.name+t.hash},e}(),R_=/([A-Z])/,O_=/([A-Z])/g,C_=/^ms-/,T_=function(e){return"-"+e.toLowerCase()};function Qf(e){return R_.test(e)?e.replace(O_,T_).replace(C_,"-ms-"):e}var ed=function(e){return e==null||e===!1||e===""};function _n(e,t,r,n){if(Array.isArray(e)){for(var i,a=[],o=0,s=e.length;o<s;o+=1)(i=_n(e[o],t,r,n))!==""&&(Array.isArray(i)?a.push.apply(a,i):a.push(i));return a}if(ed(e))return"";if(ms(e))return"."+e.styledComponentId;if(gi(e)){if(typeof(c=e)!="function"||c.prototype&&c.prototype.isReactComponent||!t)return e;var l=e(t);return _n(l,t,r,n)}var c;return e instanceof k_?r?(e.inject(r,n),e.getName(n)):e:ps(e)?function u(d,p){var m,g,_=[];for(var x in d)d.hasOwnProperty(x)&&!ed(d[x])&&(Array.isArray(d[x])&&d[x].isCss||gi(d[x])?_.push(Qf(x)+":",d[x],";"):ps(d[x])?_.push.apply(_,u(d[x],x)):_.push(Qf(x)+": "+(m=x,(g=d[x])==null||typeof g=="boolean"||g===""?"":typeof g!="number"||g===0||m in Wb||m.startsWith("--")?String(g).trim():g+"px")+";"));return p?[p+" {"].concat(_,["}"]):_}(e):e.toString()}var td=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function P_(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return gi(e)||ps(e)?td(_n(Wf(xa,[e].concat(r)))):r.length===0&&e.length===1&&typeof e[0]=="string"?e:td(_n(Wf(e,r)))}var A_=function(e,t,r){return r===void 0&&(r=wr),e.theme!==r.theme&&e.theme||t||r.theme},$_=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,D_=/(^-|-$)/g;function bs(e){return e.replace($_,"-").replace(D_,"")}var I_=function(e){return gs(Vf(e)>>>0)};function Ra(e){return typeof e=="string"&&!0}var _s=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},j_=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function B_(e,t,r){var n=e[r];_s(t)&&_s(n)?rd(n,t):e[r]=t}function rd(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0,a=r;i<a.length;i++){var o=a[i];if(_s(o))for(var s in o)j_(s)&&B_(e,o[s],s)}return e}var nd=K.createContext();nd.Consumer;var vs={};function id(e,t,r){var n=ms(e),i=!Ra(e),a=t.attrs,o=a===void 0?xa:a,s=t.componentId,l=s===void 0?function(v,O){var R=typeof v!="string"?"sc":bs(v);vs[R]=(vs[R]||0)+1;var b=R+"-"+I_("5.3.11"+R+vs[R]);return O?O+"-"+b:b}(t.displayName,t.parentComponentId):s,c=t.displayName,u=c===void 0?function(v){return Ra(v)?"styled."+v:"Styled("+Gf(v)+")"}(e):c,d=t.displayName&&t.componentId?bs(t.displayName)+"-"+t.componentId:t.componentId||l,p=n&&e.attrs?Array.prototype.concat(e.attrs,o).filter(Boolean):o,m=t.shouldForwardProp;n&&e.shouldForwardProp&&(m=t.shouldForwardProp?function(v,O,R){return e.shouldForwardProp(v,O,R)&&t.shouldForwardProp(v,O,R)}:e.shouldForwardProp);var g,_=new y_(r,d,n?e.componentStyle:void 0),x=_.isStatic&&o.length===0,y=function(v,O){return function(R,b,C,k){var S=R.attrs,P=R.componentStyle,$=R.defaultProps,B=R.foldedComponentIds,M=R.shouldForwardProp,H=R.styledComponentId,Y=R.target,ue=function(te,I,ee){te===void 0&&(te=wr);var D=Qt({},I,{theme:te}),q={};return ee.forEach(function(Z){var X,F,V,re=Z;for(X in gi(re)&&(re=re(D)),re)D[X]=q[X]=X==="className"?(F=q[X],V=re[X],F&&V?F+" "+V:F||V):re[X]}),[D,q]}(A_(b,K.useContext(nd),$)||wr,b,S),Te=ue[0],me=ue[1],ge=function(te,I,ee,D){var q=E_(),Z=S_(),X=I?te.generateAndInjectStyles(wr,q,Z):te.generateAndInjectStyles(ee,q,Z);return X}(P,k,Te),Pe=C,Ue=me.$as||b.$as||me.as||b.as||Y,oe=Ra(Ue),L=me!==b?Qt({},b,{},me):b,W={};for(var G in L)G[0]!=="$"&&G!=="as"&&(G==="forwardedAs"?W.as=L[G]:(M?M(G,Nf,Ue):!oe||Nf(G))&&(W[G]=L[G]));return b.style&&me.style!==b.style&&(W.style=Qt({},b.style,{},me.style)),W.className=Array.prototype.concat(B,H,ge!==H?ge:null,b.className,me.className).filter(Boolean).join(" "),W.ref=Pe,K.createElement(Ue,W)}(g,v,O,x)};return y.displayName=u,(g=K.forwardRef(y)).attrs=p,g.componentStyle=_,g.displayName=u,g.shouldForwardProp=m,g.foldedComponentIds=n?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):xa,g.styledComponentId=d,g.target=n?e.target:e,g.withComponent=function(v){var O=t.componentId,R=function(C,k){if(C==null)return{};var S,P,$={},B=Object.keys(C);for(P=0;P<B.length;P++)S=B[P],k.indexOf(S)>=0||($[S]=C[S]);return $}(t,["componentId"]),b=O&&O+"-"+(Ra(v)?v:bs(Gf(v)));return id(v,Qt({},R,{attrs:p,componentId:b}),r)},Object.defineProperty(g,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(v){this._foldedDefaultProps=n?rd({},e.defaultProps,v):v}}),Object.defineProperty(g,"toString",{value:function(){return"."+g.styledComponentId}}),i&&t_(g,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),g}var gr=function(e){return function t(r,n,i){if(i===void 0&&(i=wr),!fs.isValidElementType(n))return yi(1,String(n));var a=function(){return r(n,i,P_.apply(void 0,arguments))};return a.withConfig=function(o){return t(r,n,Qt({},i,{},o))},a.attrs=function(o){return t(r,n,Qt({},i,{attrs:Array.prototype.concat(i.attrs,o).filter(Boolean)}))},a}(id,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){gr[e]=gr(e)});const ad=K.createContext(null),od=()=>{const e=K.useContext(ad);if(!e)throw new Error("useAPI must be used within an APIProvider");return e},z_=({children:e})=>{const[t,r]=K.useState(0),n=K.useCallback(async a=>{r(o=>o+1);try{return await a}finally{r(o=>Math.max(0,o-1))}},[]),i=K.useCallback(async(a,o)=>(r(s=>s+1),new Promise((s,l)=>{const c=a(),u=()=>{r(d=>Math.max(0,d-1))};c.addEventListener("load",()=>{if(u(),c.status>=200&&c.status<300)try{const d=o(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 ve.jsx(ad.Provider,{value:{isLoading:t>0,wrapAPICall:n,wrapXHRCall:i},children:e})},xs=e=>{const t=e;return{createProject:async(k,S)=>{const P={description:k,component_namespace:S};return await fetch(`${t}/create_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})},getProjects:async()=>await fetch(`${t}/fetch_projects`,{method:"GET",headers:{"Content-Type":"application/json"}}),getSubdomains:async k=>await fetch(`${t}/subdomains?project_name=${k}`,{method:"GET",headers:{"Content-Type":"application/json"}}),allocateSubdomain:async(k,S)=>{const P={project_name:k,subdomain:S};return await fetch(`${t}/allocate_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})},updateSubdomain:async(k,S)=>{const P={project_name:k,subdomain:S};return await fetch(`${t}/update_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})},releaseSubdomain:async(k,S)=>{const P={project_name:k,subdomain:S};return await fetch(`${t}/release_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})},publishProject:async(k,S)=>{const P={project_name:k,git_ref:S};return await fetch(`${t}/publish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})},unpublishProject:async k=>{const S={project_name:k};return await fetch(`${t}/unpublish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(S)})},tagCommit:async(k,S,P)=>{const $={project_name:k,commit_hash:S,tag_name:P};return await fetch(`${t}/tag_project_commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})},getComponentLibrary:async()=>await fetch(`${t}/library_components?namespaces=example`,{method:"GET",headers:{"Content-Type":"application/json"}}),addProjectComponent:async(k,S,P,$)=>{const B={project_name:k,component_namespace:S,component_name:P,layout_metadata:$};return await fetch(`${t}/add_project_component`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)})},addProjectChart:async(k,S,P)=>{const $={project_name:k,visual_id:S,layout_metadata:P};return await fetch(`${t}/add_project_chart`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})},updateProjectComponentLayoutMetadata:async(k,S,P)=>{const $={project_name:k,component_id:S,layout_metadata:P};return await fetch(`${t}/update_project_component_layout_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})},updateProjectComponentSourceCode:async(k,S,P)=>{const $={project_name:k,component_id:S,source_code:P};return await fetch(`${t}/update_project_component_source_code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})},updateApplicationMetadata:async(k,S,P,$)=>{const B={project_name:k,application_name:S,application_description:P,application_category:$};return await fetch(`${t}/update_application_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)})},updateApplicationSettings:async(k,S)=>{const P={project_name:k,application_login_enabled:S};return await fetch(`${t}/update_application_settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})},deleteProjectFile:async(k,S)=>{const P={project_name:k,file_path:S};return await fetch(`${t}/delete_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})},resetProjectFile:async(k,S,P,$,B)=>{let M={project_name:k,file_path:S,git_ref:P};return $&&(M.prune=$),B&&(M.extra_metadata=B),await fetch(`${t}/reset_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)})},deleteProject:async k=>{const S={projects:[k]};return await fetch(`${t}/delete_projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(S)})},requestErrorCorrection:async(k,S,P)=>{const $={project_name:k,component_id:S,error_message:P};return await fetch(`${t}/error_correction`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})},addImage:async k=>await fetch(`${t}/add_image`,{method:"POST",body:k})}},sd=e=>{const t=e;return{getQueryContent:async a=>await fetch(`${t}/v1/public/sql/content-queries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({queryId:a,biscuits:[]})}),getVisuals:async(a,o,s,l,c,u,d,p)=>{const m=new URLSearchParams({pageNo:a.toString(),pageSize:o.toString(),scope:s,searchPattern:l,sortBy:c,sortOrder:u,visibility:d,visualType:p}).toString();return await fetch(`${t}/v2/content/visuals?${m}`,{method:"GET",headers:{"Content-Type":"application/json"}})},getSubscription:async()=>await fetch(`${t}/v1/subscription`,{method:"GET",headers:{"Content-Type":"application/json"}})}},Es=e=>{const t=e;return{getSecrets:async()=>await fetch(`${t}/config/secrets`,{method:"GET",headers:{"Content-Type":"application/json"}}),putSecret:async(R,b)=>await fetch(`${t}/config/secrets/${R}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),getSecret:async R=>await fetch(`${t}/config/secrets/${R}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteSecret:async R=>await fetch(`${t}/config/secrets/${R}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getTierKeyMap:async R=>await fetch(`${t}/config/miniapps/${R}/tier-key-map`,{method:"GET",headers:{"Content-Type":"application/json"}}),putTierKeyMap:async(R,b,C)=>await fetch(`${t}/config/miniapps/${R}/tier-key-map/${b}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret_reference:C})}),getTierKeyMapForTier:async(R,b)=>await fetch(`${t}/config/miniapps/${R}/tier-key-map/${b}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteTierKeyMap:async(R,b)=>await fetch(`${t}/config/miniapps/${R}/tier-key-map/${b}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getTierAssignments:async R=>await fetch(`${t}/config/miniapps/${R}/assignments`,{method:"GET",headers:{"Content-Type":"application/json"}}),putTierAssignment:async(R,b,C)=>await fetch(`${t}/config/miniapps/${R}/assignments/${b}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tier:C})}),getTierAssignment:async(R,b)=>await fetch(`${t}/config/miniapps/${R}/assignments/${b}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteTierAssignment:async(R,b)=>await fetch(`${t}/config/miniapps/${R}/assignments/${b}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getRateLimits:async R=>await fetch(`${t}/config/miniapps/${R}/rate-limits`,{method:"GET",headers:{"Content-Type":"application/json"}}),putRateLimit:async(R,b,C,k)=>await fetch(`${t}/config/miniapps/${R}/rate-limits/${b}/${C}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)}),getRateLimit:async(R,b,C)=>await fetch(`${t}/config/miniapps/${R}/rate-limits/${b}/${C}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteRateLimit:async(R,b,C)=>await fetch(`${t}/config/miniapps/${R}/rate-limits/${b}/${C}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),createProxyFetch:R=>async(b,C)=>{const k=b instanceof URL?b:new URL(b.toString());return await fetch(`${t}/proxy/${R.miniappName}/${k.host}${k.pathname}${k.search}${k.hash}`,C)},createProxyGetView:R=>{const b=new URL(R.gwProxyUrl).hostname;return async(C,k,S={})=>{let P=`SELECT * FROM ${C}.${k}`;S&&Object.keys(S).length>0&&(P+=`(${Object.entries(S).map(([M,H])=>`'${M}=${H}'`).join(",")})`);const $=await fetch(`${t}/proxy/${R.miniappName}/${b}/v1/sql`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sqlText:P})});if(!$.ok)throw new Error(`Failed to fetch view: ${$.statusText}`);return await $.json()}}}};for(var Xe=[],Ss=0;Ss<256;++Ss)Xe.push((Ss+256).toString(16).slice(1));function N_(e,t=0){return(Xe[e[t+0]]+Xe[e[t+1]]+Xe[e[t+2]]+Xe[e[t+3]]+"-"+Xe[e[t+4]]+Xe[e[t+5]]+"-"+Xe[e[t+6]]+Xe[e[t+7]]+"-"+Xe[e[t+8]]+Xe[e[t+9]]+"-"+Xe[e[t+10]]+Xe[e[t+11]]+Xe[e[t+12]]+Xe[e[t+13]]+Xe[e[t+14]]+Xe[e[t+15]]).toLowerCase()}var Oa,M_=new Uint8Array(16);function L_(){if(!Oa&&(Oa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Oa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Oa(M_)}var F_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const cd={randomUUID:F_};function ld(e,t,r){if(cd.randomUUID&&!e)return cd.randomUUID();e=e||{};var n=e.random||(e.rng||L_)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,N_(n)}function U_(e){return typeof e=="function"}const H_=e=>{const{wrapAPICall:t}=od(),r=xs(e);return new Proxy(r,{get:(i,a)=>{const o=i[a];return U_(o)?(...s)=>t(o.apply(i,s)):o}})},ks=K.createContext(null);ks.Consumer;const W_=e=>{const[t,r]=K.useState({projectName:null,projectURL:null}),[n,i]=K.useState({API_BASE_URL:null,WS_BASE_URL:null,GW_BASE_URL:null,GW_PROXY_URL:null,PROXY_API_BASE_URL:null}),[a,o]=K.useState(()=>sd(e.config.GW_BASE_URL)),[s,l]=K.useState(!1),[c,u]=K.useState(""),[d,p]=K.useState(""),[m,g]=K.useState(""),[_,x]=K.useState([]),[y,v]=K.useState(ld()),O=H_(e.config.API_BASE_URL),R=xs(e.config.API_BASE_URL),b=O||R,[C,k]=K.useState(()=>Es(e.config.PROXY_API_BASE_URL)),[S,P]=K.useState(null),[$,B]=K.useState(null),[M,H]=K.useState(),[Y,ue]=K.useState(!1),Te=()=>{v(ld())},me=(ge,Pe)=>{if(!ge)return;M&&(M.close(),ue(!1));const Ue=localStorage.getItem("accessToken")||"",oe=`${n.WS_BASE_URL}/ws/chat/${ge}?token=${Ue}`;if(!oe.startsWith("ws://")&&!oe.startsWith("wss://")){Pe.onerror({customWebsocketError:"INVALID_URL"});return}const L=new WebSocket(oe);L.onopen=()=>{ue(!0),Pe.onopen()},L.onclose=W=>{ue(!1),Pe.onclose(W)},L.onerror=W=>{Pe.onerror(W)},L.onmessage=W=>{Pe.onmessage(W)},H(L)};return K.useEffect(()=>{i(e==null?void 0:e.config)},[e.config]),K.useEffect(()=>{if(!(n!=null&&n.PROXY_API_BASE_URL)||!(n!=null&&n.GW_PROXY_URL)||!(t!=null&&t.projectName)){console.log("Missing required config for proxy setup");return}return o(sd(n.GW_BASE_URL)),k(ge=>{const Pe=Es(n.PROXY_API_BASE_URL);P(Pe.createProxyFetch({miniappName:t.projectName}));const Ue=Pe.createProxyGetView({miniappName:t.projectName,gwProxyUrl:n.GW_PROXY_URL}),oe=async(L,W,G={})=>{if(typeof L!="string"||typeof W!="string")throw new Error(`Invalid parameters: schema and viewName must be strings. Got schema: ${typeof L}, viewName: ${typeof W}`);return Ue(L,W,G)};return B(()=>oe),Pe}),()=>{M&&M.close()}},[n,t]),ve.jsx(ks.Provider,{value:{config:n,projectMetadata:t,setProjectMetadata:r,handledRequestComponentIds:_,setHandledRequestComponentIds:x,syncToken:y,setSyncToken:Te,selectedComponentId:c,setSelectedComponentId:u,selectedComponentXPath:d,setSelectedComponentXPath:p,selectedComponentHTML:m,setSelectedComponentHTML:g,isComponentSubselected:s,setIsComponentSubselected:l,APIHandler:b,gwAPIHandler:a,proxyHandler:C,proxyFetch:S,proxyGetView:$,startChatbot:me,chatbotWebsocket:M,chatbotWebsocketConnected:Y},children:e.children})},G_=e=>ve.jsx(z_,{children:ve.jsx(W_,{...e})}),Rs=()=>{const e=K.useContext(ks);if(e===null)throw new Error("Invalid project context.");return{...e}},q_=async e=>{let t=null,r=null;try{const n=e.replace(/import.*?;\n/g,""),i=gc.transform(n,{presets:["react","typescript"],filename:"file.tsx"}).code,a=new Blob([i],{type:"text/javascript"});t=(await import(URL.createObjectURL(a))).component}catch(n){t=null,r=n.stack}return{compileError:r,compiledComponent:t}},Y_=async e=>{let t=[];const r=await e.getComponentLibrary();if(r.status!==200)throw new Error("Could not load library components");let n=(await r.json()).components;for(const i in n)if(i==="example")for(const a of n[i]){let o=a.content["component.tsx"];o=o.replace(/import.*?;\n/g,"");let s=a.content["layout.json"];const l=gc.transform(o,{presets:["react","typescript"],filename:"file.tsx"}).code,c=new Blob([l],{type:"text/javascript"}),p=(await import(URL.createObjectURL(c))).component;t.push({class:a.name,layout:JSON.parse(s),component:ve.jsx(p,{})})}return t},ud=async e=>{let t=[],r=[];const n=`${window.miDir}/${e}`,i="src/ProjectComponents";let a=await Of(`${n}/${i}`);a=a.filter(o=>!(o.includes(".gitkeep")||o.includes("index.ts")));for(const o of a){let s=`${o.replace(i,"")}`,l=`${s}/component.tsx`,c=await window.pfs.readFile(`${n}/${i}/${l}`,"utf8");const{compileError:u,compiledComponent:d}=await q_(c);let p=`${s}/layout.json`;const m=await window.pfs.readFile(`${n}/${i}/${p}`,"utf8");let g={id:o,component:null};if(u){g={...g,overrides:{compileError:{message:u}}},t.push(g),r.push({...JSON.parse(m),i:o});continue}if(s.includes("Chart")){let _=`${s}/chart_config.json`;const x=await window.pfs.readFile(`${n}/${i}/${_}`,"utf8"),y=JSON.parse(x),v=d;g.component=ve.jsx(v,{chartConfig:y})}else{const _=d;g.component=ve.jsx(_,{})}t.push(g),r.push({...JSON.parse(m),i:o})}return{components:t,layout:r}},X_=async(e,t)=>{var u;const r={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp"},i=(await window.pfs.readdir(window.miDir)).find(d=>d.toLowerCase()===e.toLowerCase());if(!i)throw new Error(`Project "${e}" not found`);const a=`${window.miDir}/${i}/src/assets/images/${t}`,o=await window.pfs.readFile(a),s=Buffer.from(o).toString("base64"),l=((u=t.split(".").pop())==null?void 0:u.toLowerCase())||"";return`data:${r[l]??"image/jpeg"};base64,${s}`},Z_=e=>{if(window.tailwind)window.tailwind.config=e;else throw new Error("Could not load tailwind theme: missing tailwind global.")},V_=(e,t)=>{const[r,n]=K.useState("");return K.useEffect(()=>{(async()=>{try{const a=await X_(e,t);n(a)}catch(a){console.error("Error fetching background image URL:",a)}})()},[e,t]),r},K_=(e,t=[])=>{const[r,n]=K.useState(null);return K.useEffect(()=>{(async()=>{n(null);try{const a=`${window.miDir}/${e}/metadata.json`;await window.pfs.readFile(a,"utf8").then(o=>{if(o instanceof Uint8Array)throw new Error("Expected string but received buffer (Uint8Array)");n(JSON.parse(o))})}catch(a){throw console.log("Error: can not read app metadata file."),a}})()},[e,...t]),r},J_=(e,t=[])=>{const[r,n]=K.useState(null);return K.useEffect(()=>{(async()=>{n(null);try{const a=`${window.miDir}/${e}/settings.json`;await window.pfs.readFile(a,"utf8").then(o=>{if(o instanceof Uint8Array)throw new Error("Expected string but received buffer (Uint8Array)");n(JSON.parse(o))})}catch(a){throw console.log("Error: can not read app settings file."),a}})()},[e,...t]),r},Q_=(e,t,r=[])=>{const[n,i]=K.useState(null);return K.useEffect(()=>{(async()=>{i(null);const o=await ss(e,t);if(o){const s=o.filter(c=>c.tag==="published"),l=o.filter(c=>c.tag!=="published");i({publishedVersion:s.length?s[0]:null,versions:l})}})()},[e,t,...r]),n},ev=gr.div`
|
|
117
|
+
*/var Nt=typeof Symbol=="function"&&Symbol.for,hh=Nt?Symbol.for("react.element"):60103,ph=Nt?Symbol.for("react.portal"):60106,Fc=Nt?Symbol.for("react.fragment"):60107,Lc=Nt?Symbol.for("react.strict_mode"):60108,zc=Nt?Symbol.for("react.profiler"):60114,Bc=Nt?Symbol.for("react.provider"):60109,Hc=Nt?Symbol.for("react.context"):60110,mh=Nt?Symbol.for("react.async_mode"):60111,Uc=Nt?Symbol.for("react.concurrent_mode"):60111,Vc=Nt?Symbol.for("react.forward_ref"):60112,Wc=Nt?Symbol.for("react.suspense"):60113,aB=Nt?Symbol.for("react.suspense_list"):60120,Gc=Nt?Symbol.for("react.memo"):60115,qc=Nt?Symbol.for("react.lazy"):60116,sB=Nt?Symbol.for("react.block"):60121,lB=Nt?Symbol.for("react.fundamental"):60117,cB=Nt?Symbol.for("react.responder"):60118,uB=Nt?Symbol.for("react.scope"):60119;function vn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case hh:switch(e=e.type,e){case mh:case Uc:case Fc:case zc:case Lc:case Wc:return e;default:switch(e=e&&e.$$typeof,e){case Hc:case Vc:case qc:case Gc:case Bc:return e;default:return t}}case ph:return t}}}function qb(e){return vn(e)===Uc}Qe.AsyncMode=mh,Qe.ConcurrentMode=Uc,Qe.ContextConsumer=Hc,Qe.ContextProvider=Bc,Qe.Element=hh,Qe.ForwardRef=Vc,Qe.Fragment=Fc,Qe.Lazy=qc,Qe.Memo=Gc,Qe.Portal=ph,Qe.Profiler=zc,Qe.StrictMode=Lc,Qe.Suspense=Wc,Qe.isAsyncMode=function(e){return qb(e)||vn(e)===mh},Qe.isConcurrentMode=qb,Qe.isContextConsumer=function(e){return vn(e)===Hc},Qe.isContextProvider=function(e){return vn(e)===Bc},Qe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===hh},Qe.isForwardRef=function(e){return vn(e)===Vc},Qe.isFragment=function(e){return vn(e)===Fc},Qe.isLazy=function(e){return vn(e)===qc},Qe.isMemo=function(e){return vn(e)===Gc},Qe.isPortal=function(e){return vn(e)===ph},Qe.isProfiler=function(e){return vn(e)===zc},Qe.isStrictMode=function(e){return vn(e)===Lc},Qe.isSuspense=function(e){return vn(e)===Wc},Qe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Fc||e===Uc||e===zc||e===Lc||e===Wc||e===aB||typeof e=="object"&&e!==null&&(e.$$typeof===qc||e.$$typeof===Gc||e.$$typeof===Bc||e.$$typeof===Hc||e.$$typeof===Vc||e.$$typeof===lB||e.$$typeof===cB||e.$$typeof===uB||e.$$typeof===sB)},Qe.typeOf=vn,Gb.exports=Qe;var gh=Gb.exports;function dB(e){function t(H,I,V,ae,j){for(var G=0,$=0,te=0,ie=0,re,z,se=0,oe=0,fe,ge=fe=re=0,pe=0,me=0,_e=0,Re=0,nt=V.length,Ae=nt-1,Me,Ce="",Fe="",pn="",D="",_;pe<nt;){if(z=V.charCodeAt(pe),pe===Ae&&$+ie+te+G!==0&&($!==0&&(z=$===47?10:47),ie=te=G=0,nt++,Ae++),$+ie+te+G===0){if(pe===Ae&&(0<me&&(Ce=Ce.replace(f,"")),0<Ce.trim().length)){switch(z){case 32:case 9:case 59:case 13:case 10:break;default:Ce+=V.charAt(pe)}z=59}switch(z){case 123:for(Ce=Ce.trim(),re=Ce.charCodeAt(0),fe=1,Re=++pe;pe<nt;){switch(z=V.charCodeAt(pe)){case 123:fe++;break;case 125:fe--;break;case 47:switch(z=V.charCodeAt(pe+1)){case 42:case 47:e:{for(ge=pe+1;ge<Ae;++ge)switch(V.charCodeAt(ge)){case 47:if(z===42&&V.charCodeAt(ge-1)===42&&pe+2!==ge){pe=ge+1;break e}break;case 10:if(z===47){pe=ge+1;break e}}pe=ge}}break;case 91:z++;case 40:z++;case 34:case 39:for(;pe++<Ae&&V.charCodeAt(pe)!==z;);}if(fe===0)break;pe++}switch(fe=V.substring(Re,pe),re===0&&(re=(Ce=Ce.replace(d,"").trim()).charCodeAt(0)),re){case 64:switch(0<me&&(Ce=Ce.replace(f,"")),z=Ce.charCodeAt(1),z){case 100:case 109:case 115:case 45:me=I;break;default:me=q}if(fe=t(I,me,fe,z,j+1),Re=fe.length,0<B&&(me=n(q,Ce,_e),_=s(3,fe,me,I,L,F,Re,z,j,ae),Ce=me.join(""),_!==void 0&&(Re=(fe=_.trim()).length)===0&&(z=0,fe="")),0<Re)switch(z){case 115:Ce=Ce.replace(N,a);case 100:case 109:case 45:fe=Ce+"{"+fe+"}";break;case 107:Ce=Ce.replace(b,"$1 $2"),fe=Ce+"{"+fe+"}",fe=ne===1||ne===2&&i("@"+fe,3)?"@-webkit-"+fe+"@"+fe:"@"+fe;break;default:fe=Ce+fe,ae===112&&(fe=(Fe+=fe,""))}else fe="";break;default:fe=t(I,n(I,Ce,_e),fe,ae,j+1)}pn+=fe,fe=_e=me=ge=re=0,Ce="",z=V.charCodeAt(++pe);break;case 125:case 59:if(Ce=(0<me?Ce.replace(f,""):Ce).trim(),1<(Re=Ce.length))switch(ge===0&&(re=Ce.charCodeAt(0),re===45||96<re&&123>re)&&(Re=(Ce=Ce.replace(" ",":")).length),0<B&&(_=s(1,Ce,I,H,L,F,Fe.length,ae,j,ae))!==void 0&&(Re=(Ce=_.trim()).length)===0&&(Ce="\0\0"),re=Ce.charCodeAt(0),z=Ce.charCodeAt(1),re){case 0:break;case 64:if(z===105||z===99){D+=Ce+V.charAt(pe);break}default:Ce.charCodeAt(Re-1)!==58&&(Fe+=o(Ce,re,z,Ce.charCodeAt(2)))}_e=me=ge=re=0,Ce="",z=V.charCodeAt(++pe)}}switch(z){case 13:case 10:$===47?$=0:1+re===0&&ae!==107&&0<Ce.length&&(me=1,Ce+="\0"),0<B*Z&&s(0,Ce,I,H,L,F,Fe.length,ae,j,ae),F=1,L++;break;case 59:case 125:if($+ie+te+G===0){F++;break}default:switch(F++,Me=V.charAt(pe),z){case 9:case 32:if(ie+G+$===0)switch(se){case 44:case 58:case 9:case 32:Me="";break;default:z!==32&&(Me=" ")}break;case 0:Me="\\0";break;case 12:Me="\\f";break;case 11:Me="\\v";break;case 38:ie+$+G===0&&(me=_e=1,Me="\f"+Me);break;case 108:if(ie+$+G+K===0&&0<ge)switch(pe-ge){case 2:se===112&&V.charCodeAt(pe-3)===58&&(K=se);case 8:oe===111&&(K=oe)}break;case 58:ie+$+G===0&&(ge=pe);break;case 44:$+te+ie+G===0&&(me=1,Me+="\r");break;case 34:case 39:$===0&&(ie=ie===z?0:ie===0?z:ie);break;case 91:ie+$+te===0&&G++;break;case 93:ie+$+te===0&&G--;break;case 41:ie+$+G===0&&te--;break;case 40:if(ie+$+G===0){if(re===0)switch(2*se+3*oe){case 533:break;default:re=1}te++}break;case 64:$+te+ie+G+ge+fe===0&&(fe=1);break;case 42:case 47:if(!(0<ie+G+te))switch($){case 0:switch(2*z+3*V.charCodeAt(pe+1)){case 235:$=47;break;case 220:Re=pe,$=42}break;case 42:z===47&&se===42&&Re+2!==pe&&(V.charCodeAt(Re+2)===33&&(Fe+=V.substring(Re,pe+1)),Me="",$=0)}}$===0&&(Ce+=Me)}oe=se,se=z,pe++}if(Re=Fe.length,0<Re){if(me=I,0<B&&(_=s(2,Fe,me,H,L,F,Re,ae,j,ae),_!==void 0&&(Fe=_).length===0))return D+Fe+pn;if(Fe=me.join(",")+"{"+Fe+"}",ne*K!==0){switch(ne!==2||i(Fe,2)||(K=0),K){case 111:Fe=Fe.replace(S,":-moz-$1")+Fe;break;case 112:Fe=Fe.replace(x,"::-webkit-input-$1")+Fe.replace(x,"::-moz-$1")+Fe.replace(x,":-ms-input-$1")+Fe}K=0}}return D+Fe+pn}function n(H,I,V){var ae=I.trim().split(v);I=ae;var j=ae.length,G=H.length;switch(G){case 0:case 1:var $=0;for(H=G===0?"":H[0]+" ";$<j;++$)I[$]=r(H,I[$],V).trim();break;default:var te=$=0;for(I=[];$<j;++$)for(var ie=0;ie<G;++ie)I[te++]=r(H[ie]+" ",ae[$],V).trim()}return I}function r(H,I,V){var ae=I.charCodeAt(0);switch(33>ae&&(ae=(I=I.trim()).charCodeAt(0)),ae){case 38:return I.replace(w,"$1"+H.trim());case 58:return H.trim()+I.replace(w,"$1"+H.trim());default:if(0<1*V&&0<I.indexOf("\f"))return I.replace(w,(H.charCodeAt(0)===58?"":"$1")+H.trim())}return H+I}function o(H,I,V,ae){var j=H+";",G=2*I+3*V+4*ae;if(G===944){H=j.indexOf(":",9)+1;var $=j.substring(H,j.length-1).trim();return $=j.substring(0,H).trim()+$+";",ne===1||ne===2&&i($,1)?"-webkit-"+$+$:$}if(ne===0||ne===2&&!i(j,1))return j;switch(G){case 1015:return j.charCodeAt(10)===97?"-webkit-"+j+j:j;case 951:return j.charCodeAt(3)===116?"-webkit-"+j+j:j;case 963:return j.charCodeAt(5)===110?"-webkit-"+j+j:j;case 1009:if(j.charCodeAt(4)!==100)break;case 969:case 942:return"-webkit-"+j+j;case 978:return"-webkit-"+j+"-moz-"+j+j;case 1019:case 983:return"-webkit-"+j+"-moz-"+j+"-ms-"+j+j;case 883:if(j.charCodeAt(8)===45)return"-webkit-"+j+j;if(0<j.indexOf("image-set(",11))return j.replace(O,"$1-webkit-$2")+j;break;case 932:if(j.charCodeAt(4)===45)switch(j.charCodeAt(5)){case 103:return"-webkit-box-"+j.replace("-grow","")+"-webkit-"+j+"-ms-"+j.replace("grow","positive")+j;case 115:return"-webkit-"+j+"-ms-"+j.replace("shrink","negative")+j;case 98:return"-webkit-"+j+"-ms-"+j.replace("basis","preferred-size")+j}return"-webkit-"+j+"-ms-"+j+j;case 964:return"-webkit-"+j+"-ms-flex-"+j+j;case 1023:if(j.charCodeAt(8)!==99)break;return $=j.substring(j.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),"-webkit-box-pack"+$+"-webkit-"+j+"-ms-flex-pack"+$+j;case 1005:return p.test(j)?j.replace(h,":-webkit-")+j.replace(h,":-moz-")+j:j;case 1e3:switch($=j.substring(13).trim(),I=$.indexOf("-")+1,$.charCodeAt(0)+$.charCodeAt(I)){case 226:$=j.replace(C,"tb");break;case 232:$=j.replace(C,"tb-rl");break;case 220:$=j.replace(C,"lr");break;default:return j}return"-webkit-"+j+"-ms-"+$+j;case 1017:if(j.indexOf("sticky",9)===-1)break;case 975:switch(I=(j=H).length-10,$=(j.charCodeAt(I)===33?j.substring(0,I):j).substring(H.indexOf(":",7)+1).trim(),G=$.charCodeAt(0)+($.charCodeAt(7)|0)){case 203:if(111>$.charCodeAt(8))break;case 115:j=j.replace($,"-webkit-"+$)+";"+j;break;case 207:case 102:j=j.replace($,"-webkit-"+(102<G?"inline-":"")+"box")+";"+j.replace($,"-webkit-"+$)+";"+j.replace($,"-ms-"+$+"box")+";"+j}return j+";";case 938:if(j.charCodeAt(5)===45)switch(j.charCodeAt(6)){case 105:return $=j.replace("-items",""),"-webkit-"+j+"-webkit-box-"+$+"-ms-flex-"+$+j;case 115:return"-webkit-"+j+"-ms-flex-item-"+j.replace(T,"")+j;default:return"-webkit-"+j+"-ms-flex-line-pack"+j.replace("align-content","").replace(T,"")+j}break;case 973:case 989:if(j.charCodeAt(3)!==45||j.charCodeAt(4)===122)break;case 931:case 953:if(k.test(H)===!0)return($=H.substring(H.indexOf(":")+1)).charCodeAt(0)===115?o(H.replace("stretch","fill-available"),I,V,ae).replace(":fill-available",":stretch"):j.replace($,"-webkit-"+$)+j.replace($,"-moz-"+$.replace("fill-",""))+j;break;case 962:if(j="-webkit-"+j+(j.charCodeAt(5)===102?"-ms-"+j:"")+j,V+ae===211&&j.charCodeAt(13)===105&&0<j.indexOf("transform",10))return j.substring(0,j.indexOf(";",27)+1).replace(m,"$1-webkit-$2")+j}return j}function i(H,I){var V=H.indexOf(I===1?":":"{"),ae=H.substring(0,I!==3?V:10);return V=H.substring(V+1,H.length-1),ee(I!==2?ae:ae.replace(M,"$1"),V,I)}function a(H,I){var V=o(I,I.charCodeAt(0),I.charCodeAt(1),I.charCodeAt(2));return V!==I+";"?V.replace(R," or ($1)").substring(4):"("+I+")"}function s(H,I,V,ae,j,G,$,te,ie,re){for(var z=0,se=I,oe;z<B;++z)switch(oe=X[z].call(u,H,se,V,ae,j,G,$,te,ie,re)){case void 0:case!1:case!0:case null:break;default:se=oe}if(se!==I)return se}function l(H){switch(H){case void 0:case null:B=X.length=0;break;default:if(typeof H=="function")X[B++]=H;else if(typeof H=="object")for(var I=0,V=H.length;I<V;++I)l(H[I]);else Z=!!H|0}return l}function c(H){return H=H.prefix,H!==void 0&&(ee=null,H?typeof H!="function"?ne=1:(ne=2,ee=H):ne=0),c}function u(H,I){var V=H;if(33>V.charCodeAt(0)&&(V=V.trim()),J=V,V=[J],0<B){var ae=s(-1,I,V,V,L,F,0,0,0,0);ae!==void 0&&typeof ae=="string"&&(I=ae)}var j=t(q,V,I,0,0);return 0<B&&(ae=s(-2,j,V,V,L,F,j.length,0,0,0),ae!==void 0&&(j=ae)),J="",K=0,F=L=1,j}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,S=/:(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-]+)[^]*/,k=/stretch|:\s*\w+\-(?:conte|avail)/,O=/([^-])(image-set\()/,F=1,L=1,K=0,ne=1,q=[],X=[],B=0,ee=null,Z=0,J="";return u.use=l,u.set=c,e!==void 0&&c(e),u}var fB={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 hB(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var pB=/^((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)-.*))$/,Yb=hB(function(e){return pB.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),wh=gh,mB={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},gB={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},wB={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Kb={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},vh={};vh[wh.ForwardRef]=wB,vh[wh.Memo]=Kb;function Xb(e){return wh.isMemo(e)?Kb:vh[e.$$typeof]||mB}var vB=Object.defineProperty,yB=Object.getOwnPropertyNames,Zb=Object.getOwnPropertySymbols,bB=Object.getOwnPropertyDescriptor,xB=Object.getPrototypeOf,Jb=Object.prototype;function Qb(e,t,n){if(typeof t!="string"){if(Jb){var r=xB(t);r&&r!==Jb&&Qb(e,r,n)}var o=yB(t);Zb&&(o=o.concat(Zb(t)));for(var i=Xb(e),a=Xb(t),s=0;s<o.length;++s){var l=o[s];if(!gB[l]&&!(n&&n[l])&&!(a&&a[l])&&!(i&&i[l])){var c=bB(t,l);try{vB(e,l,c)}catch{}}}}return e}var _B=Qb;const SB=jn(_B);function jr(){return(jr=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 ex=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},yh=function(e){return e!==null&&typeof e=="object"&&(e.toString?e.toString():Object.prototype.toString.call(e))==="[object Object]"&&!gh.typeOf(e)},Yc=Object.freeze([]),so=Object.freeze({});function zs(e){return typeof e=="function"}function tx(e){return e.displayName||e.name||"Component"}function bh(e){return e&&typeof e.styledComponentId=="string"}var qi=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",xh=typeof window<"u"&&"HTMLElement"in window,CB=!!(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 Bs(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 EB=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&&Bs(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
|
+
`;return r},e}(),Kc=new Map,Xc=new Map,Hs=1,Zc=function(e){if(Kc.has(e))return Kc.get(e);for(;Xc.has(Hs);)Hs++;var t=Hs++;return Kc.set(e,t),Xc.set(t,e),t},PB=function(e){return Xc.get(e)},RB=function(e,t){t>=Hs&&(Hs=t+1),Kc.set(e,t),Xc.set(t,e)},NB="style["+qi+'][data-styled-version="5.3.11"]',TB=new RegExp("^"+qi+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),MB=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)},DB=function(e,t){for(var n=(t.textContent||"").split(`/*!sc*/
|
|
119
|
+
`),r=[],o=0,i=n.length;o<i;o++){var a=n[o].trim();if(a){var s=a.match(TB);if(s){var l=0|parseInt(s[1],10),c=s[2];l!==0&&(RB(c,l),MB(e,c,s[3]),e.getTag().insertRules(l,r)),r.length=0}else r.push(a)}}},kB=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null},nx=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(qi))return u}}(n),i=o!==void 0?o.nextSibling:null;r.setAttribute(qi,"active"),r.setAttribute("data-styled-version","5.3.11");var a=kB();return a&&r.setAttribute("nonce",a),n.insertBefore(r,i),r},OB=function(){function e(n){var r=this.element=nx(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}Bs(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}(),AB=function(){function e(n){var r=this.element=nx(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}(),IB=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}(),rx=xh,jB={isServer:!xh,useCSSOMInjection:!CB},ox=function(){function e(n,r,o){n===void 0&&(n=so),r===void 0&&(r={}),this.options=jr({},jB,{},n),this.gs=r,this.names=new Map(o),this.server=!!n.isServer,!this.server&&xh&&rx&&(rx=!1,function(i){for(var a=document.querySelectorAll(NB),s=0,l=a.length;s<l;s++){var c=a[s];c&&c.getAttribute(qi)!=="active"&&(DB(i,c),c.parentNode&&c.parentNode.removeChild(c))}}(this))}e.registerId=function(n){return Zc(n)};var t=e.prototype;return t.reconstructWithOptions=function(n,r){return r===void 0&&(r=!0),new e(jr({},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 IB(a):i?new OB(a):new AB(a),new EB(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(Zc(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(Zc(n),o)},t.clearNames=function(n){this.names.has(n)&&this.names.get(n).clear()},t.clearRules=function(n){this.getTag().clearGroup(Zc(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=PB(a);if(s!==void 0){var l=n.names.get(s),c=r.getGroup(a);if(l&&c&&l.size){var u=qi+".g"+a+'[id="'+s+'"]',d="";l!==void 0&&l.forEach(function(f){f.length>0&&(d+=f+",")}),i+=""+c+u+'{content:"'+d+`"}/*!sc*/
|
|
120
|
+
`}}}return i}(this)},e}(),$B=/(a)(d)/gi,ix=function(e){return String.fromCharCode(e+(e>25?39:97))};function _h(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=ix(t%52)+n;return(ix(t%52)+n).replace($B,"$1-$2")}var Yi=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},ax=function(e){return Yi(5381,e)};function FB(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(zs(n)&&!bh(n))return!1}return!0}var LB=ax("5.3.11"),zB=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&FB(t),this.componentId=n,this.baseHash=Yi(LB,n),this.baseStyle=r,ox.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=Ki(this.rules,t,n,r).join(""),s=_h(Yi(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=Yi(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=Ki(h,t,n,r),m=Array.isArray(p)?p.join(""):p;u=Yi(u,m+f),d+=m}}if(d){var v=_h(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}(),BB=/^\s*\/\/.*$/gm,HB=[":","[",".","#"];function UB(e){var t,n,r,o,i=so,a=i.options,s=a===void 0?so:a,l=i.plugins,c=l===void 0?Yc:l,u=new dB(s),d=[],f=function(m){function v(w){if(w)try{m(w+"}")}catch{}}return function(w,b,x,S,C,N,R,T,M,k){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+(k===0?"/*|*/":"")}case-2:b.split("/*|*/}").forEach(v)}}}(function(m){d.push(m)}),h=function(m,v,w){return v===0&&HB.indexOf(w[n.length])!==-1||w.match(o)?m:"."+t};function p(m,v,w,b){b===void 0&&(b="&");var x=m.replace(BB,""),S=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,S)}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||Bs(15),Yi(m,v.name)},5381).toString():"",p}var sx=E.createContext();sx.Consumer;var lx=E.createContext(),VB=(lx.Consumer,new ox),Sh=UB();function WB(){return E.useContext(sx)||VB}function GB(){return E.useContext(lx)||Sh}var qB=function(){function e(t,n){var r=this;this.inject=function(o,i){i===void 0&&(i=Sh);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 Bs(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=Sh),this.name+t.hash},e}(),YB=/([A-Z])/,KB=/([A-Z])/g,XB=/^ms-/,ZB=function(e){return"-"+e.toLowerCase()};function cx(e){return YB.test(e)?e.replace(KB,ZB).replace(XB,"-ms-"):e}var ux=function(e){return e==null||e===!1||e===""};function Ki(e,t,n,r){if(Array.isArray(e)){for(var o,i=[],a=0,s=e.length;a<s;a+=1)(o=Ki(e[a],t,n,r))!==""&&(Array.isArray(o)?i.push.apply(i,o):i.push(o));return i}if(ux(e))return"";if(bh(e))return"."+e.styledComponentId;if(zs(e)){if(typeof(c=e)!="function"||c.prototype&&c.prototype.isReactComponent||!t)return e;var l=e(t);return Ki(l,t,n,r)}var c;return e instanceof qB?n?(e.inject(n,r),e.getName(r)):e:yh(e)?function u(d,f){var h,p,m=[];for(var v in d)d.hasOwnProperty(v)&&!ux(d[v])&&(Array.isArray(d[v])&&d[v].isCss||zs(d[v])?m.push(cx(v)+":",d[v],";"):yh(d[v])?m.push.apply(m,u(d[v],v)):m.push(cx(v)+": "+(h=v,(p=d[v])==null||typeof p=="boolean"||p===""?"":typeof p!="number"||p===0||h in fB||h.startsWith("--")?String(p).trim():p+"px")+";"));return f?[f+" {"].concat(m,["}"]):m}(e):e.toString()}var dx=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function JB(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 zs(e)||yh(e)?dx(Ki(ex(Yc,[e].concat(n)))):n.length===0&&e.length===1&&typeof e[0]=="string"?e:dx(Ki(ex(e,n)))}var QB=function(e,t,n){return n===void 0&&(n=so),e.theme!==n.theme&&e.theme||t||n.theme},e4=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,t4=/(^-|-$)/g;function Ch(e){return e.replace(e4,"-").replace(t4,"")}var n4=function(e){return _h(ax(e)>>>0)};function Jc(e){return typeof e=="string"&&!0}var Eh=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},r4=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function o4(e,t,n){var r=e[n];Eh(t)&&Eh(r)?fx(r,t):e[n]=t}function fx(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(Eh(a))for(var s in a)r4(s)&&o4(e,a[s],s)}return e}var hx=E.createContext();hx.Consumer;var Ph={};function px(e,t,n){var r=bh(e),o=!Jc(e),i=t.attrs,a=i===void 0?Yc:i,s=t.componentId,l=s===void 0?function(b,x){var S=typeof b!="string"?"sc":Ch(b);Ph[S]=(Ph[S]||0)+1;var C=S+"-"+n4("5.3.11"+S+Ph[S]);return x?x+"-"+C:C}(t.displayName,t.parentComponentId):s,c=t.displayName,u=c===void 0?function(b){return Jc(b)?"styled."+b:"Styled("+tx(b)+")"}(e):c,d=t.displayName&&t.componentId?Ch(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,S){return e.shouldForwardProp(b,x,S)&&t.shouldForwardProp(b,x,S)}:e.shouldForwardProp);var p,m=new zB(n,d,r?e.componentStyle:void 0),v=m.isStatic&&a.length===0,w=function(b,x){return function(S,C,N,R){var T=S.attrs,M=S.componentStyle,k=S.defaultProps,O=S.foldedComponentIds,F=S.shouldForwardProp,L=S.styledComponentId,K=S.target,ne=function(ae,j,G){ae===void 0&&(ae=so);var $=jr({},j,{theme:ae}),te={};return G.forEach(function(ie){var re,z,se,oe=ie;for(re in zs(oe)&&(oe=oe($)),oe)$[re]=te[re]=re==="className"?(z=te[re],se=oe[re],z&&se?z+" "+se:z||se):oe[re]}),[$,te]}(QB(C,E.useContext(hx),k)||so,C,T),q=ne[0],X=ne[1],B=function(ae,j,G,$){var te=WB(),ie=GB(),re=j?ae.generateAndInjectStyles(so,te,ie):ae.generateAndInjectStyles(G,te,ie);return re}(M,R,q),ee=N,Z=X.$as||C.$as||X.as||C.as||K,J=Jc(Z),H=X!==C?jr({},C,{},X):C,I={};for(var V in H)V[0]!=="$"&&V!=="as"&&(V==="forwardedAs"?I.as=H[V]:(F?F(V,Yb,Z):!J||Yb(V))&&(I[V]=H[V]));return C.style&&X.style!==C.style&&(I.style=jr({},C.style,{},X.style)),I.className=Array.prototype.concat(O,L,B!==L?B:null,C.className,X.className).filter(Boolean).join(" "),I.ref=ee,E.createElement(Z,I)}(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):Yc,p.styledComponentId=d,p.target=r?e.target:e,p.withComponent=function(b){var x=t.componentId,S=function(N,R){if(N==null)return{};var T,M,k={},O=Object.keys(N);for(M=0;M<O.length;M++)T=O[M],R.indexOf(T)>=0||(k[T]=N[T]);return k}(t,["componentId"]),C=x&&x+"-"+(Jc(b)?b:Ch(tx(b)));return px(b,jr({},S,{attrs:f,componentId:C}),n)},Object.defineProperty(p,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(b){this._foldedDefaultProps=r?fx({},e.defaultProps,b):b}}),Object.defineProperty(p,"toString",{value:function(){return"."+p.styledComponentId}}),o&&SB(p,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),p}var lo=function(e){return function t(n,r,o){if(o===void 0&&(o=so),!gh.isValidElementType(r))return Bs(1,String(r));var i=function(){return n(r,o,JB.apply(void 0,arguments))};return i.withConfig=function(a){return t(n,r,jr({},o,{},a))},i.attrs=function(a){return t(n,r,jr({},o,{attrs:Array.prototype.concat(o.attrs,a).filter(Boolean)}))},i}(px,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){lo[e]=lo(e)});const mx=E.createContext(null),gx=()=>{const e=E.useContext(mx);if(!e)throw new Error("useAPI must be used within an APIProvider");return e},i4=({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(mx.Provider,{value:{isLoading:t>0,wrapAPICall:r,wrapXHRCall:o},children:e})},Rh=e=>{const t=e;return{createProject:async(T,M)=>{const k={description:T,component_namespace:M};return await fetch(`${t}/create_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},getProjects:async()=>await fetch(`${t}/fetch_projects`,{method:"GET",headers:{"Content-Type":"application/json"}}),getSubdomains:async T=>await fetch(`${t}/subdomains?project_name=${T}`,{method:"GET",headers:{"Content-Type":"application/json"}}),allocateSubdomain:async(T,M)=>{const k={project_name:T,subdomain:M};return await fetch(`${t}/allocate_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},updateSubdomain:async(T,M)=>{const k={project_name:T,subdomain:M};return await fetch(`${t}/update_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},releaseSubdomain:async(T,M)=>{const k={project_name:T,subdomain:M};return await fetch(`${t}/release_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},publishProject:async(T,M)=>{const k={project_name:T,git_ref:M};return await fetch(`${t}/publish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},unpublishProject:async T=>{const M={project_name:T};return await fetch(`${t}/unpublish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)})},tagCommit:async(T,M,k)=>{const O={project_name:T,commit_hash:M,tag_name:k};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(T,M,k,O)=>{const F={project_name:T,component_namespace:M,component_name:k,layout_metadata:O};return await fetch(`${t}/add_project_component`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)})},addProjectChart:async(T,M,k)=>{const O={project_name:T,visual_id:M,layout_metadata:k};return await fetch(`${t}/add_project_chart`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})},updateProjectComponentLayoutMetadata:async(T,M,k)=>{const O={project_name:T,component_id:M,layout_metadata:k};return await fetch(`${t}/update_project_component_layout_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})},updateProjectComponentSourceCode:async(T,M,k)=>{const O={project_name:T,component_id:M,source_code:k};return await fetch(`${t}/update_project_component_source_code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})},updateApplicationMetadata:async(T,M,k,O)=>{const F={project_name:T,application_name:M,application_description:k,application_category:O};return await fetch(`${t}/update_application_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)})},updateApplicationSettings:async(T,M)=>{const k={project_name:T,application_login_enabled:M};return await fetch(`${t}/update_application_settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},updateProjectTheme:async(T,M)=>{const k={project_name:T,theme:M};return await fetch(`${t}/update_project_theme`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},deleteProjectFile:async(T,M)=>{const k={project_name:T,file_path:M};return await fetch(`${t}/delete_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)})},resetProjectFile:async(T,M,k,O,F)=>{let L={project_name:T,file_path:M,git_ref:k};return O&&(L.prune=O),F&&(L.extra_metadata=F),await fetch(`${t}/reset_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})},deleteProject:async T=>{const M={projects:[T]};return await fetch(`${t}/delete_projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)})},requestErrorCorrection:async(T,M,k)=>{const O={project_name:T,component_id:M,error_message:k};return await fetch(`${t}/error_correction`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})},addImage:async T=>await fetch(`${t}/add_image`,{method:"POST",body:T})}},wx=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"}})}},Nh=e=>{const t=e;return{getSecrets:async()=>await fetch(`${t}/config/secrets`,{method:"GET",headers:{"Content-Type":"application/json"}}),putSecret:async(S,C)=>await fetch(`${t}/config/secrets/${S}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)}),getSecret:async S=>await fetch(`${t}/config/secrets/${S}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteSecret:async S=>await fetch(`${t}/config/secrets/${S}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getTierKeyMap:async S=>await fetch(`${t}/config/miniapps/${S}/tier-key-map`,{method:"GET",headers:{"Content-Type":"application/json"}}),putTierKeyMap:async(S,C,N)=>await fetch(`${t}/config/miniapps/${S}/tier-key-map/${C}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret_reference:N})}),getTierKeyMapForTier:async(S,C)=>await fetch(`${t}/config/miniapps/${S}/tier-key-map/${C}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteTierKeyMap:async(S,C)=>await fetch(`${t}/config/miniapps/${S}/tier-key-map/${C}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getTierAssignments:async S=>await fetch(`${t}/config/miniapps/${S}/assignments`,{method:"GET",headers:{"Content-Type":"application/json"}}),putTierAssignment:async(S,C,N)=>await fetch(`${t}/config/miniapps/${S}/assignments/${C}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tier:N})}),getTierAssignment:async(S,C)=>await fetch(`${t}/config/miniapps/${S}/assignments/${C}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteTierAssignment:async(S,C)=>await fetch(`${t}/config/miniapps/${S}/assignments/${C}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),getRateLimits:async S=>await fetch(`${t}/config/miniapps/${S}/rate-limits`,{method:"GET",headers:{"Content-Type":"application/json"}}),putRateLimit:async(S,C,N,R)=>await fetch(`${t}/config/miniapps/${S}/rate-limits/${C}/${N}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)}),getRateLimit:async(S,C,N)=>await fetch(`${t}/config/miniapps/${S}/rate-limits/${C}/${N}`,{method:"GET",headers:{"Content-Type":"application/json"}}),deleteRateLimit:async(S,C,N)=>await fetch(`${t}/config/miniapps/${S}/rate-limits/${C}/${N}`,{method:"DELETE",headers:{"Content-Type":"application/json"}}),createProxyFetch:S=>async(C,N)=>{const R=C instanceof URL?C:new URL(C.toString());return await fetch(`${t}/proxy/${S.miniappName}/${R.host}${R.pathname}${R.search}${R.hash}`,N)},createProxyGetView:S=>{const C=new URL(S.gwProxyUrl).hostname;return async(N,R,T={})=>{let M=`SELECT * FROM ${N}.${R}`;T&&Object.keys(T).length>0&&(M+=`(${Object.entries(T).map(([F,L])=>`'${F}=${L}'`).join(",")})`);const k=await fetch(`${t}/proxy/${S.miniappName}/${C}/v1/sql`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sqlText:M})});if(!k.ok)throw new Error(`Failed to fetch view: ${k.statusText}`);return await k.json()}}}};for(var kt=[],Th=0;Th<256;++Th)kt.push((Th+256).toString(16).slice(1));function a4(e,t=0){return(kt[e[t+0]]+kt[e[t+1]]+kt[e[t+2]]+kt[e[t+3]]+"-"+kt[e[t+4]]+kt[e[t+5]]+"-"+kt[e[t+6]]+kt[e[t+7]]+"-"+kt[e[t+8]]+kt[e[t+9]]+"-"+kt[e[t+10]]+kt[e[t+11]]+kt[e[t+12]]+kt[e[t+13]]+kt[e[t+14]]+kt[e[t+15]]).toLowerCase()}var Qc,s4=new Uint8Array(16);function l4(){if(!Qc&&(Qc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qc(s4)}var c4=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const vx={randomUUID:c4};function yx(e,t,n){if(vx.randomUUID&&!e)return vx.randomUUID();e=e||{};var r=e.random||(e.rng||l4)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,a4(r)}function u4(e){return typeof e=="function"}const d4=e=>{const{wrapAPICall:t}=gx(),n=Rh(e);return new Proxy(n,{get:(o,i)=>{const a=o[i];return u4(a)?(...s)=>t(a.apply(o,s)):a}})},Mh=E.createContext(null);Mh.Consumer;const f4=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(()=>wx(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,b]=E.useState(yx()),x=d4(e.config.API_BASE_URL),S=Rh(e.config.API_BASE_URL),C=x||S,[N,R]=E.useState(()=>Nh(e.config.PROXY_API_BASE_URL)),[T,M]=E.useState(null),[k,O]=E.useState(null),[F,L]=E.useState(),[K,ne]=E.useState(!1),q=()=>{b(yx())},X=(B,ee)=>{if(!B)return;F&&(F.close(),ne(!1));const Z=localStorage.getItem("accessToken")||"",J=`${r.WS_BASE_URL}/ws/chat/${B}?token=${Z}`;if(!J.startsWith("ws://")&&!J.startsWith("wss://")){ee.onerror({customWebsocketError:"INVALID_URL"});return}const H=new WebSocket(J);H.onopen=()=>{ne(!0),ee.onopen()},H.onclose=I=>{ne(!1),ee.onclose(I)},H.onerror=I=>{ee.onerror(I)},H.onmessage=I=>{ee.onmessage(I)},L(H)};return E.useEffect(()=>{o(e==null?void 0:e.config)},[e.config]),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}return a(wx(r.GW_BASE_URL)),R(B=>{const ee=Nh(r.PROXY_API_BASE_URL);M(ee.createProxyFetch({miniappName:t.projectName}));const Z=ee.createProxyGetView({miniappName:t.projectName,gwProxyUrl:r.GW_PROXY_URL}),J=async(H,I,V={})=>{if(typeof H!="string"||typeof I!="string")throw new Error(`Invalid parameters: schema and viewName must be strings. Got schema: ${typeof H}, viewName: ${typeof I}`);return Z(H,I,V)};return O(()=>J),ee}),()=>{F&&F.close()}},[r,t]),g.jsx(Mh.Provider,{value:{config:r,projectMetadata:t,setProjectMetadata:n,handledRequestComponentIds:m,setHandledRequestComponentIds:v,syncToken:w,setSyncToken:q,selectedComponentId:c,setSelectedComponentId:u,selectedComponentXPath:d,setSelectedComponentXPath:f,selectedComponentHTML:h,setSelectedComponentHTML:p,isComponentSubselected:s,setIsComponentSubselected:l,APIHandler:C,gwAPIHandler:i,proxyHandler:N,proxyFetch:T,proxyGetView:k,startChatbot:X,chatbotWebsocket:F,chatbotWebsocketConnected:K},children:e.children})},h4=e=>g.jsx(i4,{children:g.jsx(f4,{...e})}),Dh=()=>{const e=E.useContext(Mh);if(e===null)throw new Error("Invalid project context.");return{...e}},p4=async e=>{let t=null,n=null;try{const r=e.replace(/import.*?;\n/g,""),o=Nv.transform(r,{presets:["react","typescript"],filename:"file.tsx"}).code,i=new Blob([o],{type:"text/javascript"});t=(await import(URL.createObjectURL(i))).component}catch(r){t=null,n=r.stack}return{compileError:n,compiledComponent:t}},m4=async e=>{let t=[];const n=await e.getComponentLibrary();if(n.status!==200)throw new Error("Could not load library components");let r=(await n.json()).components;for(const o in r)if(o==="example")for(const i of r[o]){let a=i.content["component.tsx"];a=a.replace(/import.*?;\n/g,"");let s=i.content["layout.json"];const l=Nv.transform(a,{presets:["react","typescript"],filename:"file.tsx"}).code,c=new Blob([l],{type:"text/javascript"}),f=(await import(URL.createObjectURL(c))).component;t.push({class:i.name,layout:JSON.parse(s),component:g.jsx(f,{})})}return t},bx=async e=>{let t=[],n=[];const r=`${window.miDir}/${e}`,o="src/ProjectComponents";let i=await $b(`${r}/${o}`);i=i.filter(a=>!(a.includes(".gitkeep")||a.includes("index.ts")));for(const a of i){let s=`${a.replace(o,"")}`,l=`${s}/component.tsx`,c=await window.pfs.readFile(`${r}/${o}/${l}`,"utf8");const{compileError:u,compiledComponent:d}=await p4(c);let f=`${s}/layout.json`;const h=await window.pfs.readFile(`${r}/${o}/${f}`,"utf8");let p={id:a,component:null};if(u){p={...p,overrides:{compileError:{message:u}}},t.push(p),n.push({...JSON.parse(h),i:a});continue}if(s.includes("Chart")){let m=`${s}/chart_config.json`;const v=await window.pfs.readFile(`${r}/${o}/${m}`,"utf8"),w=JSON.parse(v),b=d;p.component=g.jsx(b,{chartConfig:w})}else{const m=d;p.component=g.jsx(m,{})}t.push(p),n.push({...JSON.parse(h),i:a})}return{components:t,layout:n}},g4=async(e,t)=>{var u;const n={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp"},o=(await window.pfs.readdir(window.miDir)).find(d=>d.toLowerCase()===e.toLowerCase());if(!o)throw new Error(`Project "${e}" not found`);const i=`${window.miDir}/${o}/src/assets/images/${t}`,a=await window.pfs.readFile(i),s=Buffer.from(a).toString("base64"),l=((u=t.split(".").pop())==null?void 0:u.toLowerCase())||"";return`data:${n[l]??"image/jpeg"};base64,${s}`},w4=e=>{if(window.tailwind)window.tailwind.config=e;else throw new Error("Could not load tailwind theme: missing tailwind global.")},v4=(e,t)=>{const[n,r]=E.useState("");return E.useEffect(()=>{(async()=>{try{const i=await g4(e,t);r(i)}catch(i){console.error("Error fetching background image URL:",i)}})()},[e,t]),n},y4=(e,t=[])=>{const[n,r]=E.useState(null);return E.useEffect(()=>{(async()=>{r(null);try{const i=`${window.miDir}/${e}/metadata.json`;await window.pfs.readFile(i,"utf8").then(a=>{if(a instanceof Uint8Array)throw new Error("Expected string but received buffer (Uint8Array)");r(JSON.parse(a))})}catch(i){throw console.log("Error: can not read app metadata file."),i}})()},[e,...t]),n},b4=(e,t=[])=>{const[n,r]=E.useState(null);return E.useEffect(()=>{(async()=>{r(null);try{const i=`${window.miDir}/${e}/settings.json`;await window.pfs.readFile(i,"utf8").then(a=>{if(a instanceof Uint8Array)throw new Error("Expected string but received buffer (Uint8Array)");r(JSON.parse(a))})}catch(i){throw console.log("Error: can not read app settings file."),i}})()},[e,...t]),n},x4=(e,t,n=[])=>{const[r,o]=E.useState(null);return E.useEffect(()=>{(async()=>{o(null);const a=await fh(e,t);if(a){const s=a.filter(c=>c.tag==="published"),l=a.filter(c=>c.tag!=="published");o({publishedVersion:s.length?s[0]:null,versions:l})}})()},[e,t,...n]),r},_4=lo.div`
|
|
121
121
|
position: fixed;
|
|
122
122
|
top: 0;
|
|
123
123
|
left: 0;
|
|
@@ -128,7 +128,7 @@ object-assign
|
|
|
128
128
|
justify-content: center;
|
|
129
129
|
align-items: center;
|
|
130
130
|
z-index: 10000; /* Increased z-index to be higher than all other components (others use 9999) */
|
|
131
|
-
`,
|
|
131
|
+
`,S4=lo.div`
|
|
132
132
|
border: 4px solid rgba(255, 255, 255, 0.3);
|
|
133
133
|
border-top: 4px solid white;
|
|
134
134
|
border-radius: 50%;
|
|
@@ -144,9 +144,9 @@ object-assign
|
|
|
144
144
|
transform: rotate(360deg);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
`,rv=({isVisible:e})=>e?ve.jsx(ev,{children:ve.jsx(tv,{})}):null;var fd={exports:{}},_i={},Os={exports:{}};(function(e,t){(function(r,n){n(t)})(Ci,function(r){function n(D){return function(Z,X,F,V,re,Q,le){return D(Z,X,le)}}function i(D){return function(Z,X,F,V){if(!Z||!X||typeof Z!="object"||typeof X!="object")return D(Z,X,F,V);var re=V.get(Z),Q=V.get(X);if(re&&Q)return re===X&&Q===Z;V.set(Z,X),V.set(X,Z);var le=D(Z,X,F,V);return V.delete(Z),V.delete(X),le}}function a(D,q){var Z={};for(var X in D)Z[X]=D[X];for(var X in q)Z[X]=q[X];return Z}function o(D){return D.constructor===Object||D.constructor==null}function s(D){return typeof D.then=="function"}function l(D,q){return D===q||D!==D&&q!==q}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",p="[object RegExp]",m="[object Map]",g="[object Number]",_="[object Object]",x="[object Set]",y="[object String]",v=Object.prototype.toString;function O(D){var q=D.areArraysEqual,Z=D.areDatesEqual,X=D.areMapsEqual,F=D.areObjectsEqual,V=D.areRegExpsEqual,re=D.areSetsEqual,Q=D.createIsNestedEqual,le=Q(ne);function ne(ie,Re,Ee){if(ie===Re)return!0;if(!ie||!Re||typeof ie!="object"||typeof Re!="object")return ie!==ie&&Re!==Re;if(o(ie)&&o(Re))return F(ie,Re,le,Ee);var Et=Array.isArray(ie),We=Array.isArray(Re);if(Et||We)return Et===We&&q(ie,Re,le,Ee);var Ae=v.call(ie);return Ae!==v.call(Re)?!1:Ae===d?Z(ie,Re,le,Ee):Ae===p?V(ie,Re,le,Ee):Ae===m?X(ie,Re,le,Ee):Ae===x?re(ie,Re,le,Ee):Ae===_||Ae===c?s(ie)||s(Re)?!1:F(ie,Re,le,Ee):Ae===u||Ae===g||Ae===y?l(ie.valueOf(),Re.valueOf()):!1}return ne}function R(D,q,Z,X){var F=D.length;if(q.length!==F)return!1;for(;F-- >0;)if(!Z(D[F],q[F],F,F,D,q,X))return!1;return!0}var b=i(R);function C(D,q){return l(D.valueOf(),q.valueOf())}function k(D,q,Z,X){var F=D.size===q.size;if(!F)return!1;if(!D.size)return!0;var V={},re=0;return D.forEach(function(Q,le){if(F){var ne=!1,ie=0;q.forEach(function(Re,Ee){!ne&&!V[ie]&&(ne=Z(le,Ee,re,ie,D,q,X)&&Z(Q,Re,le,Ee,D,q,X))&&(V[ie]=!0),ie++}),re++,F=ne}}),F}var S=i(k),P="_owner",$=Object.prototype.hasOwnProperty;function B(D,q,Z,X){var F=Object.keys(D),V=F.length;if(Object.keys(q).length!==V)return!1;for(var re;V-- >0;){if(re=F[V],re===P){var Q=!!D.$$typeof,le=!!q.$$typeof;if((Q||le)&&Q!==le)return!1}if(!$.call(q,re)||!Z(D[re],q[re],re,re,D,q,X))return!1}return!0}var M=i(B);function H(D,q){return D.source===q.source&&D.flags===q.flags}function Y(D,q,Z,X){var F=D.size===q.size;if(!F)return!1;if(!D.size)return!0;var V={};return D.forEach(function(re,Q){if(F){var le=!1,ne=0;q.forEach(function(ie,Re){!le&&!V[ne]&&(le=Z(re,ie,Q,Re,D,q,X))&&(V[ne]=!0),ne++}),F=le}}),F}var ue=i(Y),Te=Object.freeze({areArraysEqual:R,areDatesEqual:C,areMapsEqual:k,areObjectsEqual:B,areRegExpsEqual:H,areSetsEqual:Y,createIsNestedEqual:n}),me=Object.freeze({areArraysEqual:b,areDatesEqual:C,areMapsEqual:S,areObjectsEqual:M,areRegExpsEqual:H,areSetsEqual:ue,createIsNestedEqual:n}),ge=O(Te);function Pe(D,q){return ge(D,q,void 0)}var Ue=O(a(Te,{createIsNestedEqual:function(){return l}}));function oe(D,q){return Ue(D,q,void 0)}var L=O(me);function W(D,q){return L(D,q,new WeakMap)}var G=O(a(me,{createIsNestedEqual:function(){return l}}));function te(D,q){return G(D,q,new WeakMap)}function I(D){return O(a(Te,D(Te)))}function ee(D){var q=O(a(me,D(me)));return function(Z,X,F){return F===void 0&&(F=new WeakMap),q(Z,X,F)}}r.circularDeepEqual=W,r.circularShallowEqual=te,r.createCustomCircularEqual=ee,r.createCustomEqual=I,r.deepEqual=Pe,r.sameValueZeroEqual=l,r.shallowEqual=oe,Object.defineProperty(r,"__esModule",{value:!0})})})(Os,Os.exports);var Cs=Os.exports,Ts={exports:{}};function dd(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=dd(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function hd(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=dd(e))&&(n&&(n+=" "),n+=t);return n}Ts.exports=hd,Ts.exports.clsx=hd;var Ps=Ts.exports,he={},nv=function(t,r,n){return t===r?!0:t.className===r.className&&n(t.style,r.style)&&t.width===r.width&&t.autoSize===r.autoSize&&t.cols===r.cols&&t.draggableCancel===r.draggableCancel&&t.draggableHandle===r.draggableHandle&&n(t.verticalCompact,r.verticalCompact)&&n(t.compactType,r.compactType)&&n(t.layout,r.layout)&&n(t.margin,r.margin)&&n(t.containerPadding,r.containerPadding)&&t.rowHeight===r.rowHeight&&t.maxRows===r.maxRows&&t.isBounded===r.isBounded&&t.isDraggable===r.isDraggable&&t.isResizable===r.isResizable&&t.allowOverlap===r.allowOverlap&&t.preventCollision===r.preventCollision&&t.useCSSTransforms===r.useCSSTransforms&&t.transformScale===r.transformScale&&t.isDroppable===r.isDroppable&&n(t.resizeHandles,r.resizeHandles)&&n(t.resizeHandle,r.resizeHandle)&&t.onLayoutChange===r.onLayoutChange&&t.onDragStart===r.onDragStart&&t.onDrag===r.onDrag&&t.onDragStop===r.onDragStop&&t.onResizeStart===r.onResizeStart&&t.onResize===r.onResize&&t.onResizeStop===r.onResizeStop&&t.onDrop===r.onDrop&&n(t.droppingItem,r.droppingItem)&&n(t.innerRef,r.innerRef)};Object.defineProperty(he,"__esModule",{value:!0}),he.bottom=As,he.childrenEqual=ov,he.cloneLayout=md,he.cloneLayoutItem=jr,he.collides=Ca,he.compact=gd,he.compactItem=yd,he.compactType=wv,he.correctBounds=bd,he.fastPositionEqual=sv,he.fastRGLPropsEqual=void 0,he.getAllCollisions=_d,he.getFirstCollision=Br,he.getLayoutItem=Ds,he.getStatics=Is,he.modifyLayout=wd,he.moveElement=xi,he.moveElementAwayFromCollision=js,he.noop=void 0,he.perc=lv,he.resizeItemInDirection=fv,he.setTopLeft=hv,he.setTransform=dv,he.sortLayoutItems=Fs,he.sortLayoutItemsByColRow=kd,he.sortLayoutItemsByRowCol=Sd,he.synchronizeLayoutWithChildren=pv,he.validateLayout=mv,he.withLayoutItem=av;var pd=Cs,vi=iv(K);function iv(e){return e&&e.__esModule?e:{default:e}}function As(e){let t=0,r;for(let n=0,i=e.length;n<i;n++)r=e[n].y+e[n].h,r>t&&(t=r);return t}function md(e){const t=Array(e.length);for(let r=0,n=e.length;r<n;r++)t[r]=jr(e[r]);return t}function wd(e,t){const r=Array(e.length);for(let n=0,i=e.length;n<i;n++)t.i===e[n].i?r[n]=t:r[n]=e[n];return r}function av(e,t,r){let n=Ds(e,t);return n?(n=r(jr(n)),e=wd(e,n),[e,n]):[e,null]}function jr(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 ov(e,t){return(0,pd.deepEqual)(vi.default.Children.map(e,r=>r==null?void 0:r.key),vi.default.Children.map(t,r=>r==null?void 0:r.key))&&(0,pd.deepEqual)(vi.default.Children.map(e,r=>r==null?void 0:r.props["data-grid"]),vi.default.Children.map(t,r=>r==null?void 0:r.props["data-grid"]))}he.fastRGLPropsEqual=nv;function sv(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Ca(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 gd(e,t,r,n){const i=Is(e),a=Fs(e,t),o=Array(e.length);for(let s=0,l=a.length;s<l;s++){let c=jr(a[s]);c.static||(c=yd(i,c,t,r,a,n),i.push(c)),o[e.indexOf(a[s])]=c,c.moved=!1}return o}const cv={x:"w",y:"h"};function $s(e,t,r,n){const i=cv[n];t[n]+=1;const a=e.map(o=>o.i).indexOf(t.i);for(let o=a+1;o<e.length;o++){const s=e[o];if(!s.static){if(s.y>t.y+t.h)break;Ca(t,s)&&$s(e,s,r+t[i],n)}}t[n]=r}function yd(e,t,r,n,i,a){const o=r==="vertical",s=r==="horizontal";if(o)for(t.y=Math.min(As(e),t.y);t.y>0&&!Br(e,t);)t.y--;else if(s)for(;t.x>0&&!Br(e,t);)t.x--;let l;for(;(l=Br(e,t))&&!(r===null&&a);)if(s?$s(i,t,l.x+l.w,"x"):$s(i,t,l.y+l.h,"y"),s&&t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Br(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function bd(e,t){const r=Is(e);for(let n=0,i=e.length;n<i;n++){const a=e[n];if(a.x+a.w>t.cols&&(a.x=t.cols-a.w),a.x<0&&(a.x=0,a.w=t.cols),!a.static)r.push(a);else for(;Br(r,a);)a.y++}return e}function Ds(e,t){for(let r=0,n=e.length;r<n;r++)if(e[r].i===t)return e[r]}function Br(e,t){for(let r=0,n=e.length;r<n;r++)if(Ca(e[r],t))return e[r]}function _d(e,t){return e.filter(r=>Ca(r,t))}function Is(e){return e.filter(t=>t.static)}function xi(e,t,r,n,i,a,o,s,l){if(t.static&&t.isDraggable!==!0||t.y===n&&t.x===r)return e;`${t.i}${String(r)}${String(n)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof r=="number"&&(t.x=r),typeof n=="number"&&(t.y=n),t.moved=!0;let d=Fs(e,o);(o==="vertical"&&typeof n=="number"?u>=n:o==="horizontal"&&typeof r=="number"?c>=r:!1)&&(d=d.reverse());const m=_d(d,t),g=m.length>0;if(g&&l)return md(e);if(g&&a)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let _=0,x=m.length;_<x;_++){const y=m[_];`${t.i}${t.x}${t.y}${y.i}${y.x}${y.y}`,!y.moved&&(y.static?e=js(e,y,t,i,o):e=js(e,t,y,i,o))}return e}function js(e,t,r,n,i,a){const o=i==="horizontal",s=i==="vertical",l=t.static;if(n){n=!1;const d={x:o?Math.max(t.x-r.w,0):r.x,y:s?Math.max(t.y-r.h,0):r.y,w:r.w,h:r.h,i:"-1"},p=Br(e,d),m=p&&p.y+p.h>t.y,g=p&&t.x+t.w>p.x;if(p){if(m&&s)return xi(e,r,void 0,t.y+1,n,l,i);if(m&&i==null)return t.y=r.y,r.y=r.y+r.h,e;if(g&&o)return xi(e,t,r.x,void 0,n,l,i)}else return`${r.i}${d.x}${d.y}`,xi(e,r,o?d.x:void 0,s?d.y:void 0,n,l,i)}const c=o?r.x+1:void 0,u=s?r.y+1:void 0;return c==null&&u==null?e:xi(e,r,o?r.x+1:void 0,s?r.y+1:void 0,n,l,i)}function lv(e){return e*100+"%"}const vd=(e,t,r,n)=>e+r>n?t:r,xd=(e,t,r)=>e<0?t:r,Ed=e=>Math.max(0,e),Bs=e=>Math.max(0,e),zs=(e,t,r)=>{let{left:n,height:i,width:a}=t;const o=e.top-(i-e.height);return{left:n,width:a,height:xd(o,e.height,i),top:Bs(o)}},Ns=(e,t,r)=>{let{top:n,left:i,height:a,width:o}=t;return{top:n,height:a,width:vd(e.left,e.width,o,r),left:Ed(i)}},Ms=(e,t,r)=>{let{top:n,height:i,width:a}=t;const o=e.left-(a-e.width);return{height:i,width:o<0?e.width:vd(e.left,e.width,a,r),top:Bs(n),left:Ed(o)}},Ls=(e,t,r)=>{let{top:n,left:i,height:a,width:o}=t;return{width:o,left:i,height:xd(n,e.height,a),top:Bs(n)}},uv={n:zs,ne:function(){return zs(arguments.length<=0?void 0:arguments[0],Ns(...arguments))},e:Ns,se:function(){return Ls(arguments.length<=0?void 0:arguments[0],Ns(...arguments))},s:Ls,sw:function(){return Ls(arguments.length<=0?void 0:arguments[0],Ms(...arguments))},w:Ms,nw:function(){return zs(arguments.length<=0?void 0:arguments[0],Ms(...arguments))}};function fv(e,t,r,n){const i=uv[e];return i?i(t,{...t,...r},n):r}function dv(e){let{top:t,left:r,width:n,height:i}=e;const a=`translate(${r}px,${t}px)`;return{transform:a,WebkitTransform:a,MozTransform:a,msTransform:a,OTransform:a,width:`${n}px`,height:`${i}px`,position:"absolute"}}function hv(e){let{top:t,left:r,width:n,height:i}=e;return{top:`${t}px`,left:`${r}px`,width:`${n}px`,height:`${i}px`,position:"absolute"}}function Fs(e,t){return t==="horizontal"?kd(e):t==="vertical"?Sd(e):e}function Sd(e){return e.slice(0).sort(function(t,r){return t.y>r.y||t.y===r.y&&t.x>r.x?1:t.y===r.y&&t.x===r.x?0:-1})}function kd(e){return e.slice(0).sort(function(t,r){return t.x>r.x||t.x===r.x&&t.y>r.y?1:-1})}function pv(e,t,r,n,i){e=e||[];const a=[];vi.default.Children.forEach(t,s=>{if((s==null?void 0:s.key)==null)return;const l=Ds(e,String(s.key)),c=s.props["data-grid"];l&&c==null?a.push(jr(l)):c?a.push(jr({...c,i:s.key})):a.push(jr({w:1,h:1,x:0,y:As(a),i:String(s.key)}))});const o=bd(a,{cols:r});return i?o:gd(o,n,r)}function mv(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const r=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let n=0,i=e.length;n<i;n++){const a=e[n];for(let o=0;o<r.length;o++){const s=r[o],l=a[s];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${n}].${s} must be a number! Received: ${l} (${typeof l})`)}if(typeof a.i<"u"&&typeof a.i!="string")throw new Error(`ReactGridLayout: ${t}[${n}].i must be a string! Received: ${a.i} (${typeof a.i})`)}}function wv(e){const{verticalCompact:t,compactType:r}=e||{};return t===!1?null:r}function Xx(){}const gv=()=>{};he.noop=gv;var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.calcGridColWidth=Ta,Ut.calcGridItemPosition=yv,Ut.calcGridItemWHPx=Us,Ut.calcWH=_v,Ut.calcXY=bv,Ut.clamp=zr;function Ta(e){const{margin:t,containerPadding:r,containerWidth:n,cols:i}=e;return(n-t[0]*(i-1)-r[0]*2)/i}function Us(e,t,r){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*r):e}function yv(e,t,r,n,i,a){const{margin:o,containerPadding:s,rowHeight:l}=e,c=Ta(e),u={};return a&&a.resizing?(u.width=Math.round(a.resizing.width),u.height=Math.round(a.resizing.height)):(u.width=Us(n,c,o[0]),u.height=Us(i,l,o[1])),a&&a.dragging?(u.top=Math.round(a.dragging.top),u.left=Math.round(a.dragging.left)):a&&a.resizing&&typeof a.resizing.top=="number"&&typeof a.resizing.left=="number"?(u.top=Math.round(a.resizing.top),u.left=Math.round(a.resizing.left)):(u.top=Math.round((l+o[1])*r+s[1]),u.left=Math.round((c+o[0])*t+s[0])),u}function bv(e,t,r,n,i){const{margin:a,containerPadding:o,cols:s,rowHeight:l,maxRows:c}=e,u=Ta(e);let d=Math.round((r-o[0])/(u+a[0])),p=Math.round((t-o[1])/(l+a[1]));return d=zr(d,0,s-n),p=zr(p,0,c-i),{x:d,y:p}}function _v(e,t,r,n,i,a){const{margin:o,maxRows:s,cols:l,rowHeight:c}=e,u=Ta(e);let d=Math.round((t+o[0])/(u+o[0])),p=Math.round((r+o[1])/(c+o[1])),m=zr(d,0,l-n),g=zr(p,0,s-i);return["sw","w","nw"].indexOf(a)!==-1&&(m=zr(d,0,l)),["nw","n","ne"].indexOf(a)!==-1&&(g=zr(p,0,s)),{w:m,h:g}}function zr(e,t,r){return Math.max(Math.min(e,r),t)}var Pa={},Rd={exports:{}},vv="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",xv=vv,Ev=xv;function Od(){}function Cd(){}Cd.resetWarningCache=Od;var Sv=function(){function e(n,i,a,o,s,l){if(l!==Ev){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 r={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:Cd,resetWarningCache:Od};return r.PropTypes=r,r};Rd.exports=Sv();var yr=Rd.exports,Aa={exports:{}},Td={};function Pd(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Pd(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Ad(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Pd(e))&&(n&&(n+=" "),n+=t);return n}const kv=Xa(Object.freeze(Object.defineProperty({__proto__:null,clsx:Ad,default:Ad},Symbol.toStringTag,{value:"Module"})));var Be={},Ht={};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.dontSetMe=Pv,Ht.findInArray=Rv,Ht.int=Tv,Ht.isFunction=Ov,Ht.isNum=Cv;function Rv(e,t){for(let r=0,n=e.length;r<n;r++)if(t.apply(t,[e[r],r,e]))return e[r]}function Ov(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Cv(e){return typeof e=="number"&&!isNaN(e)}function Tv(e){return parseInt(e,10)}function Pv(e,t,r){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(r," - do not set this, set it on the child."))}var Nr={};Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.browserPrefixToKey=Dd,Nr.browserPrefixToStyle=Av,Nr.default=void 0,Nr.getPrefix=$d;const Hs=["Moz","Webkit","O","ms"];function $d(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const r=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!r||t in r)return"";for(let n=0;n<Hs.length;n++)if(Dd(t,Hs[n])in r)return Hs[n];return""}function Dd(e,t){return t?"".concat(t).concat($v(e)):e}function Av(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function $v(e){let t="",r=!0;for(let n=0;n<e.length;n++)r?(t+=e[n].toUpperCase(),r=!1):e[n]==="-"?r=!0:t+=e[n];return t}Nr.default=$d(),Object.defineProperty(Be,"__esModule",{value:!0}),Be.addClassName=zd,Be.addEvent=jv,Be.addUserSelectStyles=qv,Be.createCSSTransform=Uv,Be.createSVGTransform=Hv,Be.getTouch=Wv,Be.getTouchIdentifier=Gv,Be.getTranslation=Ws,Be.innerHeight=Mv,Be.innerWidth=Lv,Be.matchesSelector=Bd,Be.matchesSelectorAndParentsTo=Iv,Be.offsetXYFromParent=Fv,Be.outerHeight=zv,Be.outerWidth=Nv,Be.removeClassName=Nd,Be.removeEvent=Bv,Be.removeUserSelectStyles=Yv;var wt=Ht,Id=Dv(Nr);function jd(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(jd=function(n){return n?r:t})(e)}function Dv(e,t){if(e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=jd(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}let $a="";function Bd(e,t){return $a||($a=(0,wt.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(r){return(0,wt.isFunction)(e[r])})),(0,wt.isFunction)(e[$a])?e[$a](t):!1}function Iv(e,t,r){let n=e;do{if(Bd(n,t))return!0;if(n===r)return!1;n=n.parentNode}while(n);return!1}function jv(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.addEventListener?e.addEventListener(t,r,i):e.attachEvent?e.attachEvent("on"+t,r):e["on"+t]=r}function Bv(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.removeEventListener?e.removeEventListener(t,r,i):e.detachEvent?e.detachEvent("on"+t,r):e["on"+t]=null}function zv(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,wt.int)(r.borderTopWidth),t+=(0,wt.int)(r.borderBottomWidth),t}function Nv(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,wt.int)(r.borderLeftWidth),t+=(0,wt.int)(r.borderRightWidth),t}function Mv(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,wt.int)(r.paddingTop),t-=(0,wt.int)(r.paddingBottom),t}function Lv(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,wt.int)(r.paddingLeft),t-=(0,wt.int)(r.paddingRight),t}function Fv(e,t,r){const i=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),a=(e.clientX+t.scrollLeft-i.left)/r,o=(e.clientY+t.scrollTop-i.top)/r;return{x:a,y:o}}function Uv(e,t){const r=Ws(e,t,"px");return{[(0,Id.browserPrefixToKey)("transform",Id.default)]:r}}function Hv(e,t){return Ws(e,t,"")}function Ws(e,t,r){let{x:n,y:i}=e,a="translate(".concat(n).concat(r,",").concat(i).concat(r,")");if(t){const o="".concat(typeof t.x=="string"?t.x:t.x+r),s="".concat(typeof t.y=="string"?t.y:t.y+r);a="translate(".concat(o,", ").concat(s,")")+a}return a}function Wv(e,t){return e.targetTouches&&(0,wt.findInArray)(e.targetTouches,r=>t===r.identifier)||e.changedTouches&&(0,wt.findInArray)(e.changedTouches,r=>t===r.identifier)}function Gv(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function qv(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;}
|
|
147
|
+
`,C4=({isVisible:e})=>e?g.jsx(_4,{children:g.jsx(S4,{})}):null;var xx={exports:{}},Us={},kh={exports:{}};(function(e,t){(function(n,r){r(t)})(Ql,function(n){function r($){return function(ie,re,z,se,oe,fe,ge){return $(ie,re,ge)}}function o($){return function(ie,re,z,se){if(!ie||!re||typeof ie!="object"||typeof re!="object")return $(ie,re,z,se);var oe=se.get(ie),fe=se.get(re);if(oe&&fe)return oe===re&&fe===ie;se.set(ie,re),se.set(re,ie);var ge=$(ie,re,z,se);return se.delete(ie),se.delete(re),ge}}function i($,te){var ie={};for(var re in $)ie[re]=$[re];for(var re in te)ie[re]=te[re];return ie}function a($){return $.constructor===Object||$.constructor==null}function s($){return typeof $.then=="function"}function l($,te){return $===te||$!==$&&te!==te}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($){var te=$.areArraysEqual,ie=$.areDatesEqual,re=$.areMapsEqual,z=$.areObjectsEqual,se=$.areRegExpsEqual,oe=$.areSetsEqual,fe=$.createIsNestedEqual,ge=fe(pe);function pe(me,_e,Re){if(me===_e)return!0;if(!me||!_e||typeof me!="object"||typeof _e!="object")return me!==me&&_e!==_e;if(a(me)&&a(_e))return z(me,_e,ge,Re);var nt=Array.isArray(me),Ae=Array.isArray(_e);if(nt||Ae)return nt===Ae&&te(me,_e,ge,Re);var Me=b.call(me);return Me!==b.call(_e)?!1:Me===d?ie(me,_e,ge,Re):Me===f?se(me,_e,ge,Re):Me===h?re(me,_e,ge,Re):Me===v?oe(me,_e,ge,Re):Me===m||Me===c?s(me)||s(_e)?!1:z(me,_e,ge,Re):Me===u||Me===p||Me===w?l(me.valueOf(),_e.valueOf()):!1}return pe}function S($,te,ie,re){var z=$.length;if(te.length!==z)return!1;for(;z-- >0;)if(!ie($[z],te[z],z,z,$,te,re))return!1;return!0}var C=o(S);function N($,te){return l($.valueOf(),te.valueOf())}function R($,te,ie,re){var z=$.size===te.size;if(!z)return!1;if(!$.size)return!0;var se={},oe=0;return $.forEach(function(fe,ge){if(z){var pe=!1,me=0;te.forEach(function(_e,Re){!pe&&!se[me]&&(pe=ie(ge,Re,oe,me,$,te,re)&&ie(fe,_e,ge,Re,$,te,re))&&(se[me]=!0),me++}),oe++,z=pe}}),z}var T=o(R),M="_owner",k=Object.prototype.hasOwnProperty;function O($,te,ie,re){var z=Object.keys($),se=z.length;if(Object.keys(te).length!==se)return!1;for(var oe;se-- >0;){if(oe=z[se],oe===M){var fe=!!$.$$typeof,ge=!!te.$$typeof;if((fe||ge)&&fe!==ge)return!1}if(!k.call(te,oe)||!ie($[oe],te[oe],oe,oe,$,te,re))return!1}return!0}var F=o(O);function L($,te){return $.source===te.source&&$.flags===te.flags}function K($,te,ie,re){var z=$.size===te.size;if(!z)return!1;if(!$.size)return!0;var se={};return $.forEach(function(oe,fe){if(z){var ge=!1,pe=0;te.forEach(function(me,_e){!ge&&!se[pe]&&(ge=ie(oe,me,fe,_e,$,te,re))&&(se[pe]=!0),pe++}),z=ge}}),z}var ne=o(K),q=Object.freeze({areArraysEqual:S,areDatesEqual:N,areMapsEqual:R,areObjectsEqual:O,areRegExpsEqual:L,areSetsEqual:K,createIsNestedEqual:r}),X=Object.freeze({areArraysEqual:C,areDatesEqual:N,areMapsEqual:T,areObjectsEqual:F,areRegExpsEqual:L,areSetsEqual:ne,createIsNestedEqual:r}),B=x(q);function ee($,te){return B($,te,void 0)}var Z=x(i(q,{createIsNestedEqual:function(){return l}}));function J($,te){return Z($,te,void 0)}var H=x(X);function I($,te){return H($,te,new WeakMap)}var V=x(i(X,{createIsNestedEqual:function(){return l}}));function ae($,te){return V($,te,new WeakMap)}function j($){return x(i(q,$(q)))}function G($){var te=x(i(X,$(X)));return function(ie,re,z){return z===void 0&&(z=new WeakMap),te(ie,re,z)}}n.circularDeepEqual=I,n.circularShallowEqual=ae,n.createCustomCircularEqual=G,n.createCustomEqual=j,n.deepEqual=ee,n.sameValueZeroEqual=l,n.shallowEqual=J,Object.defineProperty(n,"__esModule",{value:!0})})})(kh,kh.exports);var Oh=kh.exports;function _x(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=_x(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=_x(e))&&(r&&(r+=" "),r+=t);return r}const Ah=ec(Object.freeze(Object.defineProperty({__proto__:null,clsx:eu,default:eu},Symbol.toStringTag,{value:"Module"})));var $e={},E4=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($e,"__esModule",{value:!0}),$e.bottom=Ih,$e.childrenEqual=N4,$e.cloneLayout=Cx,$e.cloneLayoutItem=Wo,$e.collides=tu,$e.compact=Px,$e.compactItem=Rx,$e.compactType=F4,$e.correctBounds=Nx,$e.fastPositionEqual=T4,$e.fastRGLPropsEqual=void 0,$e.getAllCollisions=Tx,$e.getFirstCollision=Go,$e.getLayoutItem=$h,$e.getStatics=Fh,$e.modifyLayout=Ex,$e.moveElement=Ws,$e.moveElementAwayFromCollision=Lh,$e.noop=void 0,$e.perc=D4,$e.resizeItemInDirection=O4,$e.setTopLeft=I4,$e.setTransform=A4,$e.sortLayoutItems=Wh,$e.sortLayoutItemsByColRow=Ax,$e.sortLayoutItemsByRowCol=Ox,$e.synchronizeLayoutWithChildren=j4,$e.validateLayout=$4,$e.withLayoutItem=R4;var Sx=Oh,Vs=P4(E);function P4(e){return e&&e.__esModule?e:{default:e}}function Ih(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 Cx(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Wo(e[n]);return t}function Ex(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 R4(e,t,n){let r=$h(e,t);return r?(r=n(Wo(r)),e=Ex(e,r),[e,r]):[e,null]}function Wo(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 N4(e,t){return(0,Sx.deepEqual)(Vs.default.Children.map(e,n=>n==null?void 0:n.key),Vs.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,Sx.deepEqual)(Vs.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Vs.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}$e.fastRGLPropsEqual=E4;function T4(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function tu(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 Px(e,t,n,r){const o=Fh(e),i=Wh(e,t),a=Array(e.length);for(let s=0,l=i.length;s<l;s++){let c=Wo(i[s]);c.static||(c=Rx(o,c,t,n,i,r),o.push(c)),a[e.indexOf(i[s])]=c,c.moved=!1}return a}const M4={x:"w",y:"h"};function jh(e,t,n,r){const o=M4[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;tu(t,s)&&jh(e,s,n+t[o],r)}}t[r]=n}function Rx(e,t,n,r,o,i){const a=n==="vertical",s=n==="horizontal";if(a)for(t.y=Math.min(Ih(e),t.y);t.y>0&&!Go(e,t);)t.y--;else if(s)for(;t.x>0&&!Go(e,t);)t.x--;let l;for(;(l=Go(e,t))&&!(n===null&&i);)if(s?jh(o,t,l.x+l.w,"x"):jh(o,t,l.y+l.h,"y"),s&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Go(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function Nx(e,t){const n=Fh(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(;Go(n,i);)i.y++}return e}function $h(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Go(e,t){for(let n=0,r=e.length;n<r;n++)if(tu(e[n],t))return e[n]}function Tx(e,t){return e.filter(n=>tu(n,t))}function Fh(e){return e.filter(t=>t.static)}function Ws(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=Wh(e,a);(a==="vertical"&&typeof r=="number"?u>=r:a==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const h=Tx(d,t),p=h.length>0;if(p&&l)return Cx(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=Lh(e,w,t,o,a):e=Lh(e,t,w,o,a))}return e}function Lh(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=Go(e,d),h=f&&f.y+f.h>t.y,p=f&&t.x+t.w>f.x;if(f){if(h&&s)return Ws(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 Ws(e,t,n.x,void 0,r,l,o)}else return`${n.i}${d.x}${d.y}`,Ws(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:Ws(e,n,a?n.x+1:void 0,s?n.y+1:void 0,r,l,o)}function D4(e){return e*100+"%"}const Mx=(e,t,n,r)=>e+n>r?t:n,Dx=(e,t,n)=>e<0?t:n,kx=e=>Math.max(0,e),zh=e=>Math.max(0,e),Bh=(e,t,n)=>{let{left:r,height:o,width:i}=t;const a=e.top-(o-e.height);return{left:r,width:i,height:Dx(a,e.height,o),top:zh(a)}},Hh=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{top:r,height:i,width:Mx(e.left,e.width,a,n),left:kx(o)}},Uh=(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:Mx(e.left,e.width,i,n),top:zh(r),left:kx(a)}},Vh=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{width:a,left:o,height:Dx(r,e.height,i),top:zh(r)}},k4={n:Bh,ne:function(){return Bh(arguments.length<=0?void 0:arguments[0],Hh(...arguments))},e:Hh,se:function(){return Vh(arguments.length<=0?void 0:arguments[0],Hh(...arguments))},s:Vh,sw:function(){return Vh(arguments.length<=0?void 0:arguments[0],Uh(...arguments))},w:Uh,nw:function(){return Bh(arguments.length<=0?void 0:arguments[0],Uh(...arguments))}};function O4(e,t,n,r){const o=k4[e];return o?o(t,{...t,...n},r):n}function A4(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 I4(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 Wh(e,t){return t==="horizontal"?Ax(e):t==="vertical"?Ox(e):e}function Ox(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 Ax(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 j4(e,t,n,r,o){e=e||[];const i=[];Vs.default.Children.forEach(t,s=>{if((s==null?void 0:s.key)==null)return;const l=$h(e,String(s.key)),c=s.props["data-grid"];l&&c==null?i.push(Wo(l)):c?i.push(Wo({...c,i:s.key})):i.push(Wo({w:1,h:1,x:0,y:Ih(i),i:String(s.key)}))});const a=Nx(i,{cols:n});return o?a:Px(a,r,n)}function $4(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 F4(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function ene(){}const L4=()=>{};$e.noop=L4;var pr={};Object.defineProperty(pr,"__esModule",{value:!0}),pr.calcGridColWidth=nu,pr.calcGridItemPosition=z4,pr.calcGridItemWHPx=Gh,pr.calcWH=H4,pr.calcXY=B4,pr.clamp=qo;function nu(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Gh(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function z4(e,t,n,r,o,i){const{margin:a,containerPadding:s,rowHeight:l}=e,c=nu(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=Gh(r,c,a[0]),u.height=Gh(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 B4(e,t,n,r,o){const{margin:i,containerPadding:a,cols:s,rowHeight:l,maxRows:c}=e,u=nu(e);let d=Math.round((n-a[0])/(u+i[0])),f=Math.round((t-a[1])/(l+i[1]));return d=qo(d,0,s-r),f=qo(f,0,c-o),{x:d,y:f}}function H4(e,t,n,r,o,i){const{margin:a,maxRows:s,cols:l,rowHeight:c}=e,u=nu(e);let d=Math.round((t+a[0])/(u+a[0])),f=Math.round((n+a[1])/(c+a[1])),h=qo(d,0,l-r),p=qo(f,0,s-o);return["sw","w","nw"].indexOf(i)!==-1&&(h=qo(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(p=qo(f,0,s)),{w:h,h:p}}function qo(e,t,n){return Math.max(Math.min(e,n),t)}var ru={},Ix={exports:{}},U4="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",V4=U4,W4=V4;function jx(){}function $x(){}$x.resetWarningCache=jx;var G4=function(){function e(r,o,i,a,s,l){if(l!==W4){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:$x,resetWarningCache:jx};return n.PropTypes=n,n};Ix.exports=G4();var co=Ix.exports,ou={exports:{}},Fx={};function Lx(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=Lx(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function zx(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Lx(e))&&(r&&(r+=" "),r+=t);return r}const q4=ec(Object.freeze(Object.defineProperty({__proto__:null,clsx:zx,default:zx},Symbol.toStringTag,{value:"Module"})));var wt={},mr={};Object.defineProperty(mr,"__esModule",{value:!0}),mr.dontSetMe=J4,mr.findInArray=Y4,mr.int=Z4,mr.isFunction=K4,mr.isNum=X4;function Y4(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function K4(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function X4(e){return typeof e=="number"&&!isNaN(e)}function Z4(e){return parseInt(e,10)}function J4(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 Yo={};Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.browserPrefixToKey=Hx,Yo.browserPrefixToStyle=Q4,Yo.default=void 0,Yo.getPrefix=Bx;const qh=["Moz","Webkit","O","ms"];function Bx(){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<qh.length;r++)if(Hx(t,qh[r])in n)return qh[r];return""}function Hx(e,t){return t?"".concat(t).concat(e5(e)):e}function Q4(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function e5(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}Yo.default=Bx(),Object.defineProperty(wt,"__esModule",{value:!0}),wt.addClassName=Gx,wt.addEvent=r5,wt.addUserSelectStyles=p5,wt.createCSSTransform=u5,wt.createSVGTransform=d5,wt.getTouch=f5,wt.getTouchIdentifier=h5,wt.getTranslation=Yh,wt.innerHeight=s5,wt.innerWidth=l5,wt.matchesSelector=Wx,wt.matchesSelectorAndParentsTo=n5,wt.offsetXYFromParent=c5,wt.outerHeight=i5,wt.outerWidth=a5,wt.removeClassName=qx,wt.removeEvent=o5,wt.removeUserSelectStyles=m5;var yn=mr,Ux=t5(Yo);function Vx(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Vx=function(r){return r?n:t})(e)}function t5(e,t){if(e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Vx(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 iu="";function Wx(e,t){return iu||(iu=(0,yn.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,yn.isFunction)(e[n])})),(0,yn.isFunction)(e[iu])?e[iu](t):!1}function n5(e,t,n){let r=e;do{if(Wx(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function r5(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 o5(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 i5(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,yn.int)(n.borderTopWidth),t+=(0,yn.int)(n.borderBottomWidth),t}function a5(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,yn.int)(n.borderLeftWidth),t+=(0,yn.int)(n.borderRightWidth),t}function s5(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,yn.int)(n.paddingTop),t-=(0,yn.int)(n.paddingBottom),t}function l5(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,yn.int)(n.paddingLeft),t-=(0,yn.int)(n.paddingRight),t}function c5(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 u5(e,t){const n=Yh(e,t,"px");return{[(0,Ux.browserPrefixToKey)("transform",Ux.default)]:n}}function d5(e,t){return Yh(e,t,"")}function Yh(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 f5(e,t){return e.targetTouches&&(0,yn.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,yn.findInArray)(e.changedTouches,n=>t===n.identifier)}function h5(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function p5(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
148
|
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
149
|
-
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&zd(e.body,"react-draggable-transparent-selection")}function Yv(e){if(e)try{if(e.body&&Nd(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 zd(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function Nd(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Wt={};Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.canDragX=Vv,Wt.canDragY=Kv,Wt.createCoreData=Qv,Wt.createDraggableData=e1,Wt.getBoundPosition=Xv,Wt.getControlPosition=Jv,Wt.snapToGrid=Zv;var gt=Ht,vn=Be;function Xv(e,t,r){if(!e.props.bounds)return[t,r];let{bounds:n}=e.props;n=typeof n=="string"?n:t1(n);const i=Gs(e);if(typeof n=="string"){const{ownerDocument:a}=i,o=a.defaultView;let s;if(n==="parent"?s=i.parentNode:s=a.querySelector(n),!(s instanceof o.HTMLElement))throw new Error('Bounds selector "'+n+'" could not find an element.');const l=s,c=o.getComputedStyle(i),u=o.getComputedStyle(l);n={left:-i.offsetLeft+(0,gt.int)(u.paddingLeft)+(0,gt.int)(c.marginLeft),top:-i.offsetTop+(0,gt.int)(u.paddingTop)+(0,gt.int)(c.marginTop),right:(0,vn.innerWidth)(l)-(0,vn.outerWidth)(i)-i.offsetLeft+(0,gt.int)(u.paddingRight)-(0,gt.int)(c.marginRight),bottom:(0,vn.innerHeight)(l)-(0,vn.outerHeight)(i)-i.offsetTop+(0,gt.int)(u.paddingBottom)-(0,gt.int)(c.marginBottom)}}return(0,gt.isNum)(n.right)&&(t=Math.min(t,n.right)),(0,gt.isNum)(n.bottom)&&(r=Math.min(r,n.bottom)),(0,gt.isNum)(n.left)&&(t=Math.max(t,n.left)),(0,gt.isNum)(n.top)&&(r=Math.max(r,n.top)),[t,r]}function Zv(e,t,r){const n=Math.round(t/e[0])*e[0],i=Math.round(r/e[1])*e[1];return[n,i]}function Vv(e){return e.props.axis==="both"||e.props.axis==="x"}function Kv(e){return e.props.axis==="both"||e.props.axis==="y"}function Jv(e,t,r){const n=typeof t=="number"?(0,vn.getTouch)(e,t):null;if(typeof t=="number"&&!n)return null;const i=Gs(r),a=r.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,vn.offsetXYFromParent)(n||e,a,r.props.scale)}function Qv(e,t,r){const n=!(0,gt.isNum)(e.lastX),i=Gs(e);return n?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:r,x:t,y:r}:{node:i,deltaX:t-e.lastX,deltaY:r-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:r}}function e1(e,t){const r=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/r,y:e.state.y+t.deltaY/r,deltaX:t.deltaX/r,deltaY:t.deltaY/r,lastX:e.state.x,lastY:e.state.y}}function t1(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Gs(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Da={},Ia={};Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.default=r1;function r1(){}Object.defineProperty(Da,"__esModule",{value:!0}),Da.default=void 0;var qs=i1(K),ft=Xs(yr),n1=Xs(wc),Je=Be,br=Wt,Ys=Ht,Ei=Xs(Ia);function Xs(e){return e&&e.__esModule?e:{default:e}}function Md(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(Md=function(n){return n?r:t})(e)}function i1(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=Md(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function at(e,t,r){return t=a1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a1(e){var t=o1(e,"string");return typeof t=="symbol"?t:String(t)}function o1(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Tt={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let _r=Tt.mouse,ja=class extends qs.Component{constructor(){super(...arguments),at(this,"dragging",!1),at(this,"lastX",NaN),at(this,"lastY",NaN),at(this,"touchIdentifier",null),at(this,"mounted",!1),at(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const r=this.findDOMNode();if(!r||!r.ownerDocument||!r.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=r;if(this.props.disabled||!(t.target instanceof n.defaultView.Node)||this.props.handle&&!(0,Je.matchesSelectorAndParentsTo)(t.target,this.props.handle,r)||this.props.cancel&&(0,Je.matchesSelectorAndParentsTo)(t.target,this.props.cancel,r))return;t.type==="touchstart"&&t.preventDefault();const i=(0,Je.getTouchIdentifier)(t);this.touchIdentifier=i;const a=(0,br.getControlPosition)(t,i,this);if(a==null)return;const{x:o,y:s}=a,l=(0,br.createCoreData)(this,o,s);(0,Ei.default)("DraggableCore: handleDragStart: %j",l),(0,Ei.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Je.addUserSelectStyles)(n),this.dragging=!0,this.lastX=o,this.lastY=s,(0,Je.addEvent)(n,_r.move,this.handleDrag),(0,Je.addEvent)(n,_r.stop,this.handleDragStop))}),at(this,"handleDrag",t=>{const r=(0,br.getControlPosition)(t,this.touchIdentifier,this);if(r==null)return;let{x:n,y:i}=r;if(Array.isArray(this.props.grid)){let s=n-this.lastX,l=i-this.lastY;if([s,l]=(0,br.snapToGrid)(this.props.grid,s,l),!s&&!l)return;n=this.lastX+s,i=this.lastY+l}const a=(0,br.createCoreData)(this,n,i);if((0,Ei.default)("DraggableCore: handleDrag: %j",a),this.props.onDrag(t,a)===!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=n,this.lastY=i}),at(this,"handleDragStop",t=>{if(!this.dragging)return;const r=(0,br.getControlPosition)(t,this.touchIdentifier,this);if(r==null)return;let{x:n,y:i}=r;if(Array.isArray(this.props.grid)){let l=n-this.lastX||0,c=i-this.lastY||0;[l,c]=(0,br.snapToGrid)(this.props.grid,l,c),n=this.lastX+l,i=this.lastY+c}const a=(0,br.createCoreData)(this,n,i);if(this.props.onStop(t,a)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,Je.removeUserSelectStyles)(s.ownerDocument),(0,Ei.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,Ei.default)("DraggableCore: Removing handlers"),(0,Je.removeEvent)(s.ownerDocument,_r.move,this.handleDrag),(0,Je.removeEvent)(s.ownerDocument,_r.stop,this.handleDragStop))}),at(this,"onMouseDown",t=>(_r=Tt.mouse,this.handleDragStart(t))),at(this,"onMouseUp",t=>(_r=Tt.mouse,this.handleDragStop(t))),at(this,"onTouchStart",t=>(_r=Tt.touch,this.handleDragStart(t))),at(this,"onTouchEnd",t=>(_r=Tt.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Je.addEvent)(t,Tt.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:r}=t;(0,Je.removeEvent)(r,Tt.mouse.move,this.handleDrag),(0,Je.removeEvent)(r,Tt.touch.move,this.handleDrag),(0,Je.removeEvent)(r,Tt.mouse.stop,this.handleDragStop),(0,Je.removeEvent)(r,Tt.touch.stop,this.handleDragStop),(0,Je.removeEvent)(t,Tt.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Je.removeUserSelectStyles)(r)}}findDOMNode(){var t,r;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(r=this.props)===null||r===void 0||(r=r.nodeRef)===null||r===void 0?void 0:r.current:n1.default.findDOMNode(this)}render(){return qs.cloneElement(qs.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Da.default=ja,at(ja,"displayName","DraggableCore"),at(ja,"propTypes",{allowAnyClick:ft.default.bool,children:ft.default.node.isRequired,disabled:ft.default.bool,enableUserSelectHack:ft.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:ft.default.arrayOf(ft.default.number),handle:ft.default.string,cancel:ft.default.string,nodeRef:ft.default.object,onStart:ft.default.func,onDrag:ft.default.func,onStop:ft.default.func,onMouseDown:ft.default.func,scale:ft.default.number,className:Ys.dontSetMe,style:Ys.dontSetMe,transform:Ys.dontSetMe}),at(ja,"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=p(K),r=u(yr),n=u(wc),i=u(kv),a=Be,o=Wt,s=Ht,l=u(Da),c=u(Ia);function u(v){return v&&v.__esModule?v:{default:v}}function d(v){if(typeof WeakMap!="function")return null;var O=new WeakMap,R=new WeakMap;return(d=function(b){return b?R:O})(v)}function p(v,O){if(v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var R=d(O);if(R&&R.has(v))return R.get(v);var b={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in v)if(k!=="default"&&Object.prototype.hasOwnProperty.call(v,k)){var S=C?Object.getOwnPropertyDescriptor(v,k):null;S&&(S.get||S.set)?Object.defineProperty(b,k,S):b[k]=v[k]}return b.default=v,R&&R.set(v,b),b}function m(){return m=Object.assign?Object.assign.bind():function(v){for(var O=1;O<arguments.length;O++){var R=arguments[O];for(var b in R)Object.prototype.hasOwnProperty.call(R,b)&&(v[b]=R[b])}return v},m.apply(this,arguments)}function g(v,O,R){return O=_(O),O in v?Object.defineProperty(v,O,{value:R,enumerable:!0,configurable:!0,writable:!0}):v[O]=R,v}function _(v){var O=x(v,"string");return typeof O=="symbol"?O:String(O)}function x(v,O){if(typeof v!="object"||v===null)return v;var R=v[Symbol.toPrimitive];if(R!==void 0){var b=R.call(v,O||"default");if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(v)}class y extends t.Component{static getDerivedStateFromProps(O,R){let{position:b}=O,{prevPropsPosition:C}=R;return b&&(!C||b.x!==C.x||b.y!==C.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:b,prevPropsPosition:C}),{x:b.x,y:b.y,prevPropsPosition:{...b}}):null}constructor(O){super(O),g(this,"onDragStart",(R,b)=>{if((0,c.default)("Draggable: onDragStart: %j",b),this.props.onStart(R,(0,o.createDraggableData)(this,b))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),g(this,"onDrag",(R,b)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",b);const C=(0,o.createDraggableData)(this,b),k={x:C.x,y:C.y,slackX:0,slackY:0};if(this.props.bounds){const{x:P,y:$}=k;k.x+=this.state.slackX,k.y+=this.state.slackY;const[B,M]=(0,o.getBoundPosition)(this,k.x,k.y);k.x=B,k.y=M,k.slackX=this.state.slackX+(P-k.x),k.slackY=this.state.slackY+($-k.y),C.x=k.x,C.y=k.y,C.deltaX=k.x-this.state.x,C.deltaY=k.y-this.state.y}if(this.props.onDrag(R,C)===!1)return!1;this.setState(k)}),g(this,"onDragStop",(R,b)=>{if(!this.state.dragging||this.props.onStop(R,(0,o.createDraggableData)(this,b))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",b);const k={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:P,y:$}=this.props.position;k.x=P,k.y=$}this.setState(k)}),this.state={dragging:!1,dragged:!1,x:O.position?O.position.x:O.defaultPosition.x,y:O.position?O.position.y:O.defaultPosition.y,prevPropsPosition:{...O.position},slackX:0,slackY:0,isElementSVG:!1},O.position&&!(O.onDrag||O.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 O,R;return(O=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&O!==void 0?O:n.default.findDOMNode(this)}render(){const{axis:O,bounds:R,children:b,defaultPosition:C,defaultClassName:k,defaultClassNameDragging:S,defaultClassNameDragged:P,position:$,positionOffset:B,scale:M,...H}=this.props;let Y={},ue=null;const me=!!!$||this.state.dragging,ge=$||C,Pe={x:(0,o.canDragX)(this)&&me?this.state.x:ge.x,y:(0,o.canDragY)(this)&&me?this.state.y:ge.y};this.state.isElementSVG?ue=(0,a.createSVGTransform)(Pe,B):Y=(0,a.createCSSTransform)(Pe,B);const Ue=(0,i.default)(b.props.className||"",k,{[S]:this.state.dragging,[P]:this.state.dragged});return t.createElement(l.default,m({},H,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(b),{className:Ue,style:{...b.props.style,...Y},transform:ue}))}}e.default=y,g(y,"displayName","Draggable"),g(y,"propTypes",{...l.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),g(y,"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})}(Td);const{default:Ld,DraggableCore:s1}=Td;Aa.exports=Ld,Aa.exports.default=Ld,Aa.exports.DraggableCore=s1;var Fd=Aa.exports,Ba={exports:{}},Si={},Zs={};Zs.__esModule=!0,Zs.cloneElement=h1;var c1=l1(K);function l1(e){return e&&e.__esModule?e:{default:e}}function Ud(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Hd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ud(Object(r),!0).forEach(function(n){u1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ud(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function u1(e,t,r){return t=f1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f1(e){var t=d1(e,"string");return typeof t=="symbol"?t:String(t)}function d1(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function h1(e,t){return t.style&&e.props.style&&(t.style=Hd(Hd({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),c1.default.cloneElement(e,t)}var ki={};ki.__esModule=!0,ki.resizableProps=void 0;var fe=p1(yr);function p1(e){return e&&e.__esModule?e:{default:e}}var m1={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,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[0];if(i.axis==="both"||i.axis==="y"){var a;return(a=fe.default.number).isRequired.apply(a,r)}return fe.default.number.apply(fe.default,r)},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,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[0];if(i.axis==="both"||i.axis==="x"){var a;return(a=fe.default.number).isRequired.apply(a,r)}return fe.default.number.apply(fe.default,r)}};ki.resizableProps=m1,Si.__esModule=!0,Si.default=void 0;var Ri=_1(K),w1=Fd,g1=Zs,y1=ki,b1=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Wd(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(Wd=function(i){return i?r:t})(e)}function _1(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=Wd(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function Vs(){return Vs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vs.apply(this,arguments)}function v1(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function Gd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ks(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gd(Object(r),!0).forEach(function(n){x1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function x1(e,t,r){return t=E1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E1(e){var t=S1(e,"string");return typeof t=="symbol"?t:String(t)}function S1(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function k1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Js(e,t)}function Js(e,t){return Js=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Js(e,t)}var Qs=function(e){k1(t,e);function t(){for(var n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=e.call.apply(e,[this].concat(a))||this,n.handleRefs={},n.lastHandleRect=null,n.slack=null,n}var r=t.prototype;return r.componentWillUnmount=function(){this.resetData()},r.resetData=function(){this.lastHandleRect=this.slack=null},r.runConstraints=function(i,a){var o=this.props,s=o.minConstraints,l=o.maxConstraints,c=o.lockAspectRatio;if(!s&&!l&&!c)return[i,a];if(c){var u=this.props.width/this.props.height,d=i-this.props.width,p=a-this.props.height;Math.abs(d)>Math.abs(p*u)?a=i/u:i=a*u}var m=i,g=a,_=this.slack||[0,0],x=_[0],y=_[1];return i+=x,a+=y,s&&(i=Math.max(s[0],i),a=Math.max(s[1],a)),l&&(i=Math.min(l[0],i),a=Math.min(l[1],a)),this.slack=[x+(m-i),y+(g-a)],[i,a]},r.resizeHandler=function(i,a){var o=this;return function(s,l){var c=l.node,u=l.deltaX,d=l.deltaY;i==="onResizeStart"&&o.resetData();var p=(o.props.axis==="both"||o.props.axis==="x")&&a!=="n"&&a!=="s",m=(o.props.axis==="both"||o.props.axis==="y")&&a!=="e"&&a!=="w";if(!(!p&&!m)){var g=a[0],_=a[a.length-1],x=c.getBoundingClientRect();if(o.lastHandleRect!=null){if(_==="w"){var y=x.left-o.lastHandleRect.left;u+=y}if(g==="n"){var v=x.top-o.lastHandleRect.top;d+=v}}o.lastHandleRect=x,_==="w"&&(u=-u),g==="n"&&(d=-d);var O=o.props.width+(p?u/o.props.transformScale:0),R=o.props.height+(m?d/o.props.transformScale:0),b=o.runConstraints(O,R);O=b[0],R=b[1];var C=O!==o.props.width||R!==o.props.height,k=typeof o.props[i]=="function"?o.props[i]:null,S=i==="onResize"&&!C;k&&!S&&(s.persist==null||s.persist(),k(s,{node:c,size:{width:O,height:R},handle:a})),i==="onResizeStop"&&o.resetData()}}},r.renderResizeHandle=function(i,a){var o=this.props.handle;if(!o)return Ri.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:a});if(typeof o=="function")return o(i,a);var s=typeof o.type=="string",l=Ks({ref:a},s?{}:{handleAxis:i});return Ri.cloneElement(o,l)},r.render=function(){var i=this,a=this.props,o=a.children,s=a.className,l=a.draggableOpts;a.width,a.height,a.handle,a.handleSize,a.lockAspectRatio,a.axis,a.minConstraints,a.maxConstraints,a.onResize,a.onResizeStop,a.onResizeStart;var c=a.resizeHandles;a.transformScale;var u=v1(a,b1);return(0,g1.cloneElement)(o,Ks(Ks({},u),{},{className:(s?s+" ":"")+"react-resizable",children:[].concat(o.props.children,c.map(function(d){var p,m=(p=i.handleRefs[d])!=null?p:i.handleRefs[d]=Ri.createRef();return Ri.createElement(w1.DraggableCore,Vs({},l,{nodeRef:m,key:"resizableHandle-"+d,onStop:i.resizeHandler("onResizeStop",d),onStart:i.resizeHandler("onResizeStart",d),onDrag:i.resizeHandler("onResize",d)}),i.renderResizeHandle(d,m))}))}))},t}(Ri.Component);Si.default=Qs,Qs.propTypes=y1.resizableProps,Qs.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var za={};za.__esModule=!0,za.default=void 0;var ec=P1(K),R1=qd(yr),O1=qd(Si),C1=ki,T1=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function qd(e){return e&&e.__esModule?e:{default:e}}function Yd(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(Yd=function(i){return i?r:t})(e)}function P1(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=Yd(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function tc(){return tc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tc.apply(this,arguments)}function Xd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Na(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xd(Object(r),!0).forEach(function(n){A1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function A1(e,t,r){return t=$1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $1(e){var t=D1(e,"string");return typeof t=="symbol"?t:String(t)}function D1(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function I1(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function j1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,rc(e,t)}function rc(e,t){return rc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},rc(e,t)}var Zd=function(e){j1(t,e);function t(){for(var n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=e.call.apply(e,[this].concat(a))||this,n.state={width:n.props.width,height:n.props.height,propsWidth:n.props.width,propsHeight:n.props.height},n.onResize=function(s,l){var c=l.size;n.props.onResize?(s.persist==null||s.persist(),n.setState(c,function(){return n.props.onResize&&n.props.onResize(s,l)})):n.setState(c)},n}t.getDerivedStateFromProps=function(i,a){return a.propsWidth!==i.width||a.propsHeight!==i.height?{width:i.width,height:i.height,propsWidth:i.width,propsHeight:i.height}:null};var r=t.prototype;return r.render=function(){var i=this.props,a=i.handle,o=i.handleSize;i.onResize;var s=i.onResizeStart,l=i.onResizeStop,c=i.draggableOpts,u=i.minConstraints,d=i.maxConstraints,p=i.lockAspectRatio,m=i.axis;i.width,i.height;var g=i.resizeHandles,_=i.style,x=i.transformScale,y=I1(i,T1);return ec.createElement(O1.default,{axis:m,draggableOpts:c,handle:a,handleSize:o,height:this.state.height,lockAspectRatio:p,maxConstraints:d,minConstraints:u,onResizeStart:s,onResize:this.onResize,onResizeStop:l,resizeHandles:g,transformScale:x,width:this.state.width},ec.createElement("div",tc({},y,{style:Na(Na({},_),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(ec.Component);za.default=Zd,Zd.propTypes=Na(Na({},C1.resizableProps),{},{children:R1.default.element}),Ba.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Ba.exports.Resizable=Si.default,Ba.exports.ResizableBox=za.default;var B1=Ba.exports,er={};Object.defineProperty(er,"__esModule",{value:!0}),er.resizeHandleType=er.resizeHandleAxesType=er.default=void 0;var de=Vd(yr),z1=Vd(K);function Vd(e){return e&&e.__esModule?e:{default:e}}const N1=er.resizeHandleAxesType=de.default.arrayOf(de.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),M1=er.resizeHandleType=de.default.oneOfType([de.default.node,de.default.func]);er.default={className:de.default.string,style:de.default.object,width:de.default.number,autoSize:de.default.bool,cols:de.default.number,draggableCancel:de.default.string,draggableHandle:de.default.string,verticalCompact:function(e){e.verticalCompact},compactType:de.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&he.validateLayout(t,"layout")},margin:de.default.arrayOf(de.default.number),containerPadding:de.default.arrayOf(de.default.number),rowHeight:de.default.number,maxRows:de.default.number,isBounded:de.default.bool,isDraggable:de.default.bool,isResizable:de.default.bool,allowOverlap:de.default.bool,preventCollision:de.default.bool,useCSSTransforms:de.default.bool,transformScale:de.default.number,isDroppable:de.default.bool,resizeHandles:N1,resizeHandle:M1,onLayoutChange:de.default.func,onDragStart:de.default.func,onDrag:de.default.func,onDragStop:de.default.func,onResizeStart:de.default.func,onResize:de.default.func,onResizeStop:de.default.func,onDrop:de.default.func,droppingItem:de.default.shape({i:de.default.string.isRequired,w:de.default.number.isRequired,h:de.default.number.isRequired}),children:function(e,t){const r=e[t],n={};z1.default.Children.forEach(r,function(i){if((i==null?void 0:i.key)!=null){if(n[i.key])throw new Error('Duplicate child key "'+i.key+'" found! This will cause problems in ReactGridLayout.');n[i.key]=!0}})},innerRef:de.default.any},Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.default=void 0;var xn=nc(K),xe=nc(yr),L1=Fd,F1=B1,En=he,Ze=Ut,Kd=er,U1=nc(Ps);function nc(e){return e&&e.__esModule?e:{default:e}}function Gt(e,t,r){return t=H1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function H1(e){var t=W1(e,"string");return typeof t=="symbol"?t:String(t)}function W1(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class ic extends xn.default.Component{constructor(){super(...arguments),Gt(this,"state",{resizing:null,dragging:null,className:""}),Gt(this,"elementRef",xn.default.createRef()),Gt(this,"onDragStart",(t,r)=>{let{node:n}=r;const{onDragStart:i,transformScale:a}=this.props;if(!i)return;const o={top:0,left:0},{offsetParent:s}=n;if(!s)return;const l=s.getBoundingClientRect(),c=n.getBoundingClientRect(),u=c.left/a,d=l.left/a,p=c.top/a,m=l.top/a;o.left=u-d+s.scrollLeft,o.top=p-m+s.scrollTop,this.setState({dragging:o});const{x:g,y:_}=(0,Ze.calcXY)(this.getPositionParams(),o.top,o.left,this.props.w,this.props.h);return i.call(this,this.props.i,g,_,{e:t,node:n,newPosition:o})}),Gt(this,"onDrag",(t,r)=>{let{node:n,deltaX:i,deltaY:a}=r;const{onDrag:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let s=this.state.dragging.top+a,l=this.state.dragging.left+i;const{isBounded:c,i:u,w:d,h:p,containerWidth:m}=this.props,g=this.getPositionParams();if(c){const{offsetParent:v}=n;if(v){const{margin:O,rowHeight:R,containerPadding:b}=this.props,C=v.clientHeight-(0,Ze.calcGridItemWHPx)(p,R,O[1]);s=(0,Ze.clamp)(s-b[1],0,C);const k=(0,Ze.calcGridColWidth)(g),S=m-(0,Ze.calcGridItemWHPx)(d,k,O[0]);l=(0,Ze.clamp)(l-b[0],0,S)}}const _={top:s,left:l};this.setState({dragging:_});const{x,y}=(0,Ze.calcXY)(g,s,l,d,p);return o.call(this,u,x,y,{e:t,node:n,newPosition:_})}),Gt(this,"onDragStop",(t,r)=>{let{node:n}=r;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:a,h:o,i:s}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:d,y:p}=(0,Ze.calcXY)(this.getPositionParams(),c,l,a,o);return i.call(this,s,d,p,{e:t,node:n,newPosition:u})}),Gt(this,"onResizeStop",(t,r,n)=>this.onResizeHandler(t,r,n,"onResizeStop")),Gt(this,"onResizeStart",(t,r,n)=>this.onResizeHandler(t,r,n,"onResizeStart")),Gt(this,"onResize",(t,r,n)=>this.onResizeHandler(t,r,n,"onResize"))}shouldComponentUpdate(t,r){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const n=(0,Ze.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,Ze.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,r);return!(0,En.fastPositionEqual)(n,i)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:r}=this.props;if(!r)return;const n=this.elementRef.current;if(!n)return;const i=t.droppingPosition||{left:0,top:0},{dragging:a}=this.state,o=a&&r.left!==i.left||r.top!==i.top;if(!a)this.onDragStart(r.e,{node:n,deltaX:r.left,deltaY:r.top});else if(o){const s=r.left-a.left,l=r.top-a.top;this.onDrag(r.e,{node:n,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:r,containerWidth:n,useCSSTransforms:i}=this.props;let a;return i?a=(0,En.setTransform)(t):(a=(0,En.setTopLeft)(t),r&&(a.left=(0,En.perc)(t.left/n),a.width=(0,En.perc)(t.width/n))),a}mixinDraggable(t,r){return xn.default.createElement(L1.DraggableCore,{disabled:!r,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,r){return(n,i)=>r(n,i,t)}mixinResizable(t,r,n){const{cols:i,minW:a,minH:o,maxW:s,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:d}=this.props,p=this.getPositionParams(),m=(0,Ze.calcGridItemPosition)(p,0,0,i,0).width,g=(0,Ze.calcGridItemPosition)(p,0,0,a,o),_=(0,Ze.calcGridItemPosition)(p,0,0,s,l),x=[g.width,g.height],y=[Math.min(_.width,m),Math.min(_.height,1/0)];return xn.default.createElement(F1.Resizable,{draggableOpts:{disabled:!n},className:n?void 0:"react-resizable-hide",width:r.width,height:r.height,minConstraints:x,maxConstraints:y,onResizeStop:this.curryResizeHandler(r,this.onResizeStop),onResizeStart:this.curryResizeHandler(r,this.onResizeStart),onResize:this.curryResizeHandler(r,this.onResize),transformScale:c,resizeHandles:u,handle:d},t)}onResizeHandler(t,r,n,i){let{node:a,size:o,handle:s}=r;const l=this.props[i];if(!l)return;const{x:c,y:u,i:d,maxH:p,minH:m,containerWidth:g}=this.props,{minW:_,maxW:x}=this.props;let y=o;a&&(y=(0,En.resizeItemInDirection)(s,n,o,g),this.setState({resizing:i==="onResizeStop"?null:y}));let{w:v,h:O}=(0,Ze.calcWH)(this.getPositionParams(),y.width,y.height,c,u,s);v=(0,Ze.clamp)(v,Math.max(_,1),x),O=(0,Ze.clamp)(O,m,p),l.call(this,d,v,O,{e:t,node:a,size:y,handle:s})}render(){const{x:t,y:r,w:n,h:i,isDraggable:a,isResizable:o,droppingPosition:s,useCSSTransforms:l}=this.props,c=(0,Ze.calcGridItemPosition)(this.getPositionParams(),t,r,n,i,this.state),u=xn.default.Children.only(this.props.children);let d=xn.default.cloneElement(u,{ref:this.elementRef,className:(0,U1.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":a,"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,o),d=this.mixinDraggable(d,a),d}}Pa.default=ic,Gt(ic,"propTypes",{children:xe.default.element,cols:xe.default.number.isRequired,containerWidth:xe.default.number.isRequired,rowHeight:xe.default.number.isRequired,margin:xe.default.array.isRequired,maxRows:xe.default.number.isRequired,containerPadding:xe.default.array.isRequired,x:xe.default.number.isRequired,y:xe.default.number.isRequired,w:xe.default.number.isRequired,h:xe.default.number.isRequired,minW:function(e,t){const r=e[t];if(typeof r!="number")return new Error("minWidth not Number");if(r>e.w||r>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const r=e[t];if(typeof r!="number")return new Error("maxWidth not Number");if(r<e.w||r<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const r=e[t];if(typeof r!="number")return new Error("minHeight not Number");if(r>e.h||r>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const r=e[t];if(typeof r!="number")return new Error("maxHeight not Number");if(r<e.h||r<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:xe.default.string.isRequired,resizeHandles:Kd.resizeHandleAxesType,resizeHandle:Kd.resizeHandleType,onDragStop:xe.default.func,onDragStart:xe.default.func,onDrag:xe.default.func,onResizeStop:xe.default.func,onResizeStart:xe.default.func,onResize:xe.default.func,isDraggable:xe.default.bool.isRequired,isResizable:xe.default.bool.isRequired,isBounded:xe.default.bool.isRequired,static:xe.default.bool,useCSSTransforms:xe.default.bool.isRequired,transformScale:xe.default.number,className:xe.default.string,handle:xe.default.string,cancel:xe.default.string,droppingPosition:xe.default.shape({e:xe.default.object.isRequired,left:xe.default.number.isRequired,top:xe.default.number.isRequired})}),Gt(ic,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(_i,"__esModule",{value:!0}),_i.default=void 0;var Mr=X1(K),ac=Cs,G1=oc(Ps),ae=he,q1=Ut,Jd=oc(Pa),Y1=oc(er);function oc(e){return e&&e.__esModule?e:{default:e}}function Qd(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(Qd=function(n){return n?r:t})(e)}function X1(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=Qd(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function Qe(e,t,r){return t=Z1(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Z1(e){var t=V1(e,"string");return typeof t=="symbol"?t:String(t)}function V1(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const eh="react-grid-layout";let th=!1;try{th=/firefox/i.test(navigator.userAgent)}catch{}class Ma extends Mr.Component{constructor(){super(...arguments),Qe(this,"state",{activeDrag:null,layout:(0,ae.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,ae.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Qe(this,"dragEnterCounter",0),Qe(this,"onDragStart",(t,r,n,i)=>{let{e:a,node:o}=i;const{layout:s}=this.state,l=(0,ae.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,ae.cloneLayoutItem)(l),oldLayout:s,activeDrag:c}),this.props.onDragStart(s,l,l,null,a,o)}),Qe(this,"onDrag",(t,r,n,i)=>{let{e:a,node:o}=i;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:d}=this.props,p=(0,ae.getLayoutItem)(l,t);if(!p)return;const m={w:p.w,h:p.h,x:p.x,y:p.y,placeholder:!0,i:t};l=(0,ae.moveElement)(l,p,r,n,!0,d,(0,ae.compactType)(this.props),c,u),this.props.onDrag(l,s,p,m,a,o),this.setState({layout:u?l:(0,ae.compact)(l,(0,ae.compactType)(this.props),c),activeDrag:m})}),Qe(this,"onDragStop",(t,r,n,i)=>{let{e:a,node:o}=i;if(!this.state.activeDrag)return;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:d}=this.props,p=(0,ae.getLayoutItem)(l,t);if(!p)return;l=(0,ae.moveElement)(l,p,r,n,!0,u,(0,ae.compactType)(this.props),c,d);const g=d?l:(0,ae.compact)(l,(0,ae.compactType)(this.props),c);this.props.onDragStop(g,s,p,null,a,o);const{oldLayout:_}=this.state;this.setState({activeDrag:null,layout:g,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(g,_)}),Qe(this,"onResizeStart",(t,r,n,i)=>{let{e:a,node:o}=i;const{layout:s}=this.state,l=(0,ae.getLayoutItem)(s,t);l&&(this.setState({oldResizeItem:(0,ae.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(s,l,l,null,a,o))}),Qe(this,"onResize",(t,r,n,i)=>{let{e:a,node:o,size:s,handle:l}=i;const{oldResizeItem:c}=this.state,{layout:u}=this.state,{cols:d,preventCollision:p,allowOverlap:m}=this.props;let g=!1,_,x,y;const[v,O]=(0,ae.withLayoutItem)(u,t,b=>{let C;return x=b.x,y=b.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=b.x+(b.w-r),r=b.x!==x&&x<0?b.w:r,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(y=b.y+(b.h-n),n=b.y!==y&&y<0?b.h:n,y=y<0?0:y),g=!0),p&&!m&&(C=(0,ae.getAllCollisions)(u,{...b,w:r,h:n,x,y}).filter(S=>S.i!==b.i).length>0,C&&(y=b.y,n=b.h,x=b.x,r=b.w,g=!1)),b.w=r,b.h=n,b});if(!O)return;_=v,g&&(_=(0,ae.moveElement)(v,O,x,y,!0,this.props.preventCollision,(0,ae.compactType)(this.props),d,m));const R={w:O.w,h:O.h,x:O.x,y:O.y,static:!0,i:t};this.props.onResize(_,c,O,R,a,o),this.setState({layout:m?_:(0,ae.compact)(_,(0,ae.compactType)(this.props),d),activeDrag:R})}),Qe(this,"onResizeStop",(t,r,n,i)=>{let{e:a,node:o}=i;const{layout:s,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,d=(0,ae.getLayoutItem)(s,t),p=u?s:(0,ae.compact)(s,(0,ae.compactType)(this.props),c);this.props.onResizeStop(p,l,d,null,a,o);const{oldLayout:m}=this.state;this.setState({activeDrag:null,layout:p,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(p,m)}),Qe(this,"onDragOver",t=>{var v;if(t.preventDefault(),t.stopPropagation(),th&&!((v=t.nativeEvent.target)!=null&&v.classList.contains(eh)))return!1;const{droppingItem:r,onDropDragOver:n,margin:i,cols:a,rowHeight:o,maxRows:s,width:l,containerPadding:c,transformScale:u}=this.props,d=n==null?void 0:n(t);if(d===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...d},{layout:m}=this.state,g=t.currentTarget.getBoundingClientRect(),_=t.clientX-g.left,x=t.clientY-g.top,y={left:_/u,top:x/u,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:O,top:R}=this.state.droppingPosition;(O!=_||R!=x)&&this.setState({droppingPosition:y})}}else{const O={cols:a,margin:i,maxRows:s,rowHeight:o,containerWidth:l,containerPadding:c||i},R=(0,q1.calcXY)(O,x,_,p.w,p.h);this.setState({droppingDOMNode:Mr.createElement("div",{key:p.i}),droppingPosition:y,layout:[...m,{...p,x:R.x,y:R.y,static:!1,isDraggable:!0}]})}}),Qe(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:r}=this.props,{layout:n}=this.state,i=(0,ae.compact)(n.filter(a=>a.i!==t.i),(0,ae.compactType)(this.props),r,this.props.allowOverlap);this.setState({layout:i,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Qe(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Qe(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Qe(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:r}=this.props,{layout:n}=this.state,i=n.find(a=>a.i===r.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(n,i,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,r){let n;return r.activeDrag?null:(!(0,ac.deepEqual)(t.layout,r.propsLayout)||t.compactType!==r.compactType?n=t.layout:(0,ae.childrenEqual)(t.children,r.children)||(n=r.layout),n?{layout:(0,ae.synchronizeLayoutWithChildren)(n,t.children,t.cols,(0,ae.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,r){return this.props.children!==t.children||!(0,ae.fastRGLPropsEqual)(this.props,t,ac.deepEqual)||this.state.activeDrag!==r.activeDrag||this.state.mounted!==r.mounted||this.state.droppingPosition!==r.droppingPosition}componentDidUpdate(t,r){if(!this.state.activeDrag){const n=this.state.layout,i=r.layout;this.onLayoutMaybeChanged(n,i)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,ae.bottom)(this.state.layout),r=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+r*2+"px"}onLayoutMaybeChanged(t,r){r||(r=this.state.layout),(0,ac.deepEqual)(r,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:r,cols:n,margin:i,containerPadding:a,rowHeight:o,maxRows:s,useCSSTransforms:l,transformScale:c}=this.props;return Mr.createElement(Jd.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:r,cols:n,margin:i,containerPadding:a||i,maxRows:s,rowHeight:o,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Mr.createElement("div",null))}processGridItem(t,r){if(!t||!t.key)return;const n=(0,ae.getLayoutItem)(this.state.layout,String(t.key));if(!n)return null;const{width:i,cols:a,margin:o,containerPadding:s,rowHeight:l,maxRows:c,isDraggable:u,isResizable:d,isBounded:p,useCSSTransforms:m,transformScale:g,draggableCancel:_,draggableHandle:x,resizeHandles:y,resizeHandle:v}=this.props,{mounted:O,droppingPosition:R}=this.state,b=typeof n.isDraggable=="boolean"?n.isDraggable:!n.static&&u,C=typeof n.isResizable=="boolean"?n.isResizable:!n.static&&d,k=n.resizeHandles||y,S=b&&p&&n.isBounded!==!1;return Mr.createElement(Jd.default,{containerWidth:i,cols:a,margin:o,containerPadding:s||o,maxRows:c,rowHeight:l,cancel:_,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:b,isResizable:C,isBounded:S,useCSSTransforms:m&&O,usePercentages:!O,transformScale:g,w:n.w,h:n.h,x:n.x,y:n.y,i:n.i,minH:n.minH,minW:n.minW,maxH:n.maxH,maxW:n.maxW,static:n.static,droppingPosition:r?R:void 0,resizeHandles:k,resizeHandle:v},t)}render(){const{className:t,style:r,isDroppable:n,innerRef:i}=this.props,a=(0,G1.default)(eh,t),o={height:this.containerHeight(),...r};return Mr.createElement("div",{ref:i,className:a,style:o,onDrop:n?this.onDrop:ae.noop,onDragLeave:n?this.onDragLeave:ae.noop,onDragEnter:n?this.onDragEnter:ae.noop,onDragOver:n?this.onDragOver:ae.noop},Mr.Children.map(this.props.children,s=>this.processGridItem(s)),n&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}_i.default=Ma,Qe(Ma,"displayName","ReactGridLayout"),Qe(Ma,"propTypes",Y1.default),Qe(Ma,"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:ae.noop,onDragStart:ae.noop,onDrag:ae.noop,onDragStop:ae.noop,onResizeStart:ae.noop,onResize:ae.noop,onResizeStop:ae.noop,onDrop:ae.noop,onDropDragOver:ae.noop});var La={},Lr={};Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.findOrGenerateResponsiveLayout=Q1,Lr.getBreakpointFromWidth=K1,Lr.getColsFromBreakpoint=J1,Lr.sortBreakpoints=sc;var Fa=he;function K1(e,t){const r=sc(e);let n=r[0];for(let i=1,a=r.length;i<a;i++){const o=r[i];t>e[o]&&(n=o)}return n}function J1(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function Q1(e,t,r,n,i,a){if(e[r])return(0,Fa.cloneLayout)(e[r]);let o=e[n];const s=sc(t),l=s.slice(s.indexOf(r));for(let c=0,u=l.length;c<u;c++){const d=l[c];if(e[d]){o=e[d];break}}return o=(0,Fa.cloneLayout)(o||[]),(0,Fa.compact)((0,Fa.correctBounds)(o,{cols:i}),a,i)}function sc(e){return Object.keys(e).sort(function(r,n){return e[r]-e[n]})}Object.defineProperty(La,"__esModule",{value:!0}),La.default=void 0;var rh=tx(K),dt=nh(yr),cc=Cs,Sn=he,Fr=Lr,ex=nh(_i);function nh(e){return e&&e.__esModule?e:{default:e}}function ih(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(ih=function(n){return n?r:t})(e)}function tx(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=ih(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function lc(){return lc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lc.apply(this,arguments)}function Ua(e,t,r){return t=rx(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rx(e){var t=nx(e,"string");return typeof t=="symbol"?t:String(t)}function nx(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const ah=e=>Object.prototype.toString.call(e);function Ha(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class uc extends rh.Component{constructor(){super(...arguments),Ua(this,"state",this.generateInitialState()),Ua(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:r,layouts:n,cols:i}=this.props,a=(0,Fr.getBreakpointFromWidth)(r,t),o=(0,Fr.getColsFromBreakpoint)(a,i),s=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Fr.findOrGenerateResponsiveLayout)(n,r,a,a,o,s),breakpoint:a,cols:o}}static getDerivedStateFromProps(t,r){if(!(0,cc.deepEqual)(t.layouts,r.layouts)){const{breakpoint:n,cols:i}=r;return{layout:(0,Fr.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,n,n,i,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,cc.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,cc.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:r,cols:n,layouts:i,compactType:a}=this.props,o=this.props.breakpoint||(0,Fr.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),s=this.state.breakpoint,l=(0,Fr.getColsFromBreakpoint)(o,n),c={...i};if(s!==o||t.breakpoints!==r||t.cols!==n){s in c||(c[s]=(0,Sn.cloneLayout)(this.state.layout));let p=(0,Fr.findOrGenerateResponsiveLayout)(c,r,o,s,l,a);p=(0,Sn.synchronizeLayoutWithChildren)(p,this.props.children,l,a,this.props.allowOverlap),c[o]=p,this.props.onBreakpointChange(o,l),this.props.onLayoutChange(p,c),this.setState({breakpoint:o,layout:p,cols:l})}const u=Ha(this.props.margin,o),d=Ha(this.props.containerPadding,o);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:r,cols:n,layouts:i,margin:a,containerPadding:o,onBreakpointChange:s,onLayoutChange:l,onWidthChange:c,...u}=this.props;return rh.createElement(ex.default,lc({},u,{margin:Ha(a,this.state.breakpoint),containerPadding:Ha(o,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}La.default=uc,Ua(uc,"propTypes",{breakpoint:dt.default.string,breakpoints:dt.default.object,allowOverlap:dt.default.bool,cols:dt.default.object,margin:dt.default.oneOfType([dt.default.array,dt.default.object]),containerPadding:dt.default.oneOfType([dt.default.array,dt.default.object]),layouts(e,t){if(ah(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+ah(e[t]));Object.keys(e[t]).forEach(r=>{if(!(r in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,Sn.validateLayout)(e.layouts[r],"layouts."+r)})},width:dt.default.number.isRequired,onBreakpointChange:dt.default.func,onLayoutChange:dt.default.func,onWidthChange:dt.default.func}),Ua(uc,"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:Sn.noop,onLayoutChange:Sn.noop,onWidthChange:Sn.noop});var fc={},oh=function(){if(typeof Map<"u")return Map;function e(t,r){var n=-1;return t.some(function(i,a){return i[0]===r?(n=a,!0):!1}),n}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(r){var n=e(this.__entries__,r),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(r,n){var i=e(this.__entries__,r);~i?this.__entries__[i][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,i=e(n,r);~i&&n.splice(i,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var i=0,a=this.__entries__;i<a.length;i++){var o=a[i];r.call(n,o[1],o[0])}},t}()}(),dc=typeof window<"u"&&typeof document<"u"&&window.document===document,Wa=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")()}(),ix=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Wa):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),ax=2;function ox(e,t){var r=!1,n=!1,i=0;function a(){r&&(r=!1,e()),n&&s()}function o(){ix(a)}function s(){var l=Date.now();if(r){if(l-i<ax)return;n=!0}else r=!0,n=!1,setTimeout(o,t);i=l}return s}var sx=20,cx=["top","right","bottom","left","width","height","size","weight"],lx=typeof MutationObserver<"u",ux=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=ox(this.refresh.bind(this),sx)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var r=this.observers_,n=r.indexOf(t);~n&&r.splice(n,1),!r.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(r){return r.gatherActive(),r.hasActive()});return t.forEach(function(r){return r.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!dc||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),lx?(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(){!dc||!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 r=t.propertyName,n=r===void 0?"":r,i=cx.some(function(a){return!!~n.indexOf(a)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),sh=function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},kn=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Wa},ch=qa(0,0,0,0);function Ga(e){return parseFloat(e)||0}function lh(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce(function(n,i){var a=e["border-"+i+"-width"];return n+Ga(a)},0)}function fx(e){for(var t=["top","right","bottom","left"],r={},n=0,i=t;n<i.length;n++){var a=i[n],o=e["padding-"+a];r[a]=Ga(o)}return r}function dx(e){var t=e.getBBox();return qa(0,0,t.width,t.height)}function hx(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return ch;var n=kn(e).getComputedStyle(e),i=fx(n),a=i.left+i.right,o=i.top+i.bottom,s=Ga(n.width),l=Ga(n.height);if(n.boxSizing==="border-box"&&(Math.round(s+a)!==t&&(s-=lh(n,"left","right")+a),Math.round(l+o)!==r&&(l-=lh(n,"top","bottom")+o)),!mx(e)){var c=Math.round(s+a)-t,u=Math.round(l+o)-r;Math.abs(c)!==1&&(s-=c),Math.abs(u)!==1&&(l-=u)}return qa(i.left,i.top,s,l)}var px=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof kn(e).SVGGraphicsElement}:function(e){return e instanceof kn(e).SVGElement&&typeof e.getBBox=="function"}}();function mx(e){return e===kn(e).document.documentElement}function wx(e){return dc?px(e)?dx(e):hx(e):ch}function gx(e){var t=e.x,r=e.y,n=e.width,i=e.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(a.prototype);return sh(o,{x:t,y:r,width:n,height:i,top:r,right:t+n,bottom:i+r,left:t}),o}function qa(e,t,r,n){return{x:e,y:t,width:r,height:n}}var yx=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=qa(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=wx(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}(),bx=function(){function e(t,r){var n=gx(r);sh(this,{target:t,contentRect:n})}return e}(),_x=function(){function e(t,r,n){if(this.activeObservations_=[],this.observations_=new oh,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=r,this.callbackCtx_=n}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 kn(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)||(r.set(t,new yx(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 kn(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)&&(r.delete(t),r.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(r){r.isActive()&&t.activeObservations_.push(r)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new bx(n.target,n.broadcastRect())});this.callback_.call(t,r,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),uh=typeof WeakMap<"u"?new WeakMap:new oh,fh=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 r=ux.getInstance(),n=new _x(t,r,this);uh.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){fh.prototype[e]=function(){var t;return(t=uh.get(this))[e].apply(t,arguments)}});var vx=function(){return typeof Wa.ResizeObserver<"u"?Wa.ResizeObserver:fh}();const xx=Xa(Object.freeze(Object.defineProperty({__proto__:null,default:vx},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(fc,"__esModule",{value:!0}),fc.default=Px;var Ya=Rx(K),Ex=hc(yr),Sx=hc(xx),kx=hc(Ps);function hc(e){return e&&e.__esModule?e:{default:e}}function dh(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(dh=function(n){return n?r:t})(e)}function Rx(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=dh(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function pc(){return pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pc.apply(this,arguments)}function Rn(e,t,r){return t=Ox(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ox(e){var t=Cx(e,"string");return typeof t=="symbol"?t:String(t)}function Cx(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Tx="react-grid-layout";function Px(e){var t;return t=class extends Ya.Component{constructor(){super(...arguments),Rn(this,"state",{width:1280}),Rn(this,"elementRef",Ya.createRef()),Rn(this,"mounted",!1),Rn(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new Sx.default(i=>{if(this.elementRef.current instanceof HTMLElement){const o=i[0].contentRect.width;this.setState({width:o})}});const n=this.elementRef.current;n instanceof HTMLElement&&this.resizeObserver.observe(n)}componentWillUnmount(){this.mounted=!1;const n=this.elementRef.current;n instanceof HTMLElement&&this.resizeObserver.unobserve(n),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:n,...i}=this.props;return n&&!this.mounted?Ya.createElement("div",{className:(0,kx.default)(this.props.className,Tx),style:this.props.style,ref:this.elementRef}):Ya.createElement(e,pc({innerRef:this.elementRef},i,this.state))}},Rn(t,"defaultProps",{measureBeforeMount:!1}),Rn(t,"propTypes",{measureBeforeMount:Ex.default.bool}),t}(function(e){e.exports=_i.default,e.exports.utils=he,e.exports.calculateUtils=Ut,e.exports.Responsive=La.default,e.exports.Responsive.utils=Lr,e.exports.WidthProvider=fc.default})(fd);var mc=fd.exports;const hh=St(mc),Ax=mc.WidthProvider(hh),$x=gr.div`
|
|
149
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&Gx(e.body,"react-draggable-transparent-selection")}function m5(e){if(e)try{if(e.body&&qx(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 Gx(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function qx(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var gr={};Object.defineProperty(gr,"__esModule",{value:!0}),gr.canDragX=v5,gr.canDragY=y5,gr.createCoreData=x5,gr.createDraggableData=_5,gr.getBoundPosition=g5,gr.getControlPosition=b5,gr.snapToGrid=w5;var bn=mr,Xi=wt;function g5(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:S5(r);const o=Kh(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,bn.int)(u.paddingLeft)+(0,bn.int)(c.marginLeft),top:-o.offsetTop+(0,bn.int)(u.paddingTop)+(0,bn.int)(c.marginTop),right:(0,Xi.innerWidth)(l)-(0,Xi.outerWidth)(o)-o.offsetLeft+(0,bn.int)(u.paddingRight)-(0,bn.int)(c.marginRight),bottom:(0,Xi.innerHeight)(l)-(0,Xi.outerHeight)(o)-o.offsetTop+(0,bn.int)(u.paddingBottom)-(0,bn.int)(c.marginBottom)}}return(0,bn.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,bn.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,bn.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,bn.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function w5(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function v5(e){return e.props.axis==="both"||e.props.axis==="x"}function y5(e){return e.props.axis==="both"||e.props.axis==="y"}function b5(e,t,n){const r=typeof t=="number"?(0,Xi.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=Kh(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Xi.offsetXYFromParent)(r||e,i,n.props.scale)}function x5(e,t,n){const r=!(0,bn.isNum)(e.lastX),o=Kh(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 _5(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 S5(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Kh(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var au={},su={};Object.defineProperty(su,"__esModule",{value:!0}),su.default=C5;function C5(){}Object.defineProperty(au,"__esModule",{value:!0}),au.default=void 0;var Xh=P5(E),on=Jh(co),E5=Jh(tr),jt=wt,uo=gr,Zh=mr,Gs=Jh(su);function Jh(e){return e&&e.__esModule?e:{default:e}}function Yx(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Yx=function(r){return r?n:t})(e)}function P5(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Yx(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 Xt(e,t,n){return t=R5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R5(e){var t=N5(e,"string");return typeof t=="symbol"?t:String(t)}function N5(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 Bn={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let fo=Bn.mouse,lu=class extends Xh.Component{constructor(){super(...arguments),Xt(this,"dragging",!1),Xt(this,"lastX",NaN),Xt(this,"lastY",NaN),Xt(this,"touchIdentifier",null),Xt(this,"mounted",!1),Xt(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,jt.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,jt.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,jt.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,uo.getControlPosition)(t,o,this);if(i==null)return;const{x:a,y:s}=i,l=(0,uo.createCoreData)(this,a,s);(0,Gs.default)("DraggableCore: handleDragStart: %j",l),(0,Gs.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,jt.addUserSelectStyles)(r),this.dragging=!0,this.lastX=a,this.lastY=s,(0,jt.addEvent)(r,fo.move,this.handleDrag),(0,jt.addEvent)(r,fo.stop,this.handleDragStop))}),Xt(this,"handleDrag",t=>{const n=(0,uo.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,uo.snapToGrid)(this.props.grid,s,l),!s&&!l)return;r=this.lastX+s,o=this.lastY+l}const i=(0,uo.createCoreData)(this,r,o);if((0,Gs.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}),Xt(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,uo.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,uo.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,uo.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,jt.removeUserSelectStyles)(s.ownerDocument),(0,Gs.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,Gs.default)("DraggableCore: Removing handlers"),(0,jt.removeEvent)(s.ownerDocument,fo.move,this.handleDrag),(0,jt.removeEvent)(s.ownerDocument,fo.stop,this.handleDragStop))}),Xt(this,"onMouseDown",t=>(fo=Bn.mouse,this.handleDragStart(t))),Xt(this,"onMouseUp",t=>(fo=Bn.mouse,this.handleDragStop(t))),Xt(this,"onTouchStart",t=>(fo=Bn.touch,this.handleDragStart(t))),Xt(this,"onTouchEnd",t=>(fo=Bn.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,jt.addEvent)(t,Bn.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,jt.removeEvent)(n,Bn.mouse.move,this.handleDrag),(0,jt.removeEvent)(n,Bn.touch.move,this.handleDrag),(0,jt.removeEvent)(n,Bn.mouse.stop,this.handleDragStop),(0,jt.removeEvent)(n,Bn.touch.stop,this.handleDragStop),(0,jt.removeEvent)(t,Bn.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,jt.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:E5.default.findDOMNode(this)}render(){return Xh.cloneElement(Xh.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};au.default=lu,Xt(lu,"displayName","DraggableCore"),Xt(lu,"propTypes",{allowAnyClick:on.default.bool,children:on.default.node.isRequired,disabled:on.default.bool,enableUserSelectHack:on.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:on.default.arrayOf(on.default.number),handle:on.default.string,cancel:on.default.string,nodeRef:on.default.object,onStart:on.default.func,onDrag:on.default.func,onStop:on.default.func,onMouseDown:on.default.func,scale:on.default.number,className:Zh.dontSetMe,style:Zh.dontSetMe,transform:Zh.dontSetMe}),Xt(lu,"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(tr),o=u(q4),i=wt,a=gr,s=mr,l=u(au),c=u(su);function u(b){return b&&b.__esModule?b:{default:b}}function d(b){if(typeof WeakMap!="function")return null;var x=new WeakMap,S=new WeakMap;return(d=function(C){return C?S: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 S=d(x);if(S&&S.has(b))return S.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,S&&S.set(b,C),C}function h(){return h=Object.assign?Object.assign.bind():function(b){for(var x=1;x<arguments.length;x++){var S=arguments[x];for(var C in S)Object.prototype.hasOwnProperty.call(S,C)&&(b[C]=S[C])}return b},h.apply(this,arguments)}function p(b,x,S){return x=m(x),x in b?Object.defineProperty(b,x,{value:S,enumerable:!0,configurable:!0,writable:!0}):b[x]=S,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 S=b[Symbol.toPrimitive];if(S!==void 0){var C=S.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,S){let{position:C}=x,{prevPropsPosition:N}=S;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",(S,C)=>{if((0,c.default)("Draggable: onDragStart: %j",C),this.props.onStart(S,(0,a.createDraggableData)(this,C))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(S,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:k}=R;R.x+=this.state.slackX,R.y+=this.state.slackY;const[O,F]=(0,a.getBoundPosition)(this,R.x,R.y);R.x=O,R.y=F,R.slackX=this.state.slackX+(M-R.x),R.slackY=this.state.slackY+(k-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(S,N)===!1)return!1;this.setState(R)}),p(this,"onDragStop",(S,C)=>{if(!this.state.dragging||this.props.onStop(S,(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:k}=this.props.position;R.x=M,R.y=k}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,S;return(x=(S=this.props)===null||S===void 0||(S=S.nodeRef)===null||S===void 0?void 0:S.current)!==null&&x!==void 0?x:r.default.findDOMNode(this)}render(){const{axis:x,bounds:S,children:C,defaultPosition:N,defaultClassName:R,defaultClassNameDragging:T,defaultClassNameDragged:M,position:k,positionOffset:O,scale:F,...L}=this.props;let K={},ne=null;const X=!!!k||this.state.dragging,B=k||N,ee={x:(0,a.canDragX)(this)&&X?this.state.x:B.x,y:(0,a.canDragY)(this)&&X?this.state.y:B.y};this.state.isElementSVG?ne=(0,i.createSVGTransform)(ee,O):K=(0,i.createCSSTransform)(ee,O);const Z=(0,o.default)(C.props.className||"",R,{[T]:this.state.dragging,[M]:this.state.dragged});return t.createElement(l.default,h({},L,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(C),{className:Z,style:{...C.props.style,...K},transform:ne}))}}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})}(Fx);const{default:Kx,DraggableCore:T5}=Fx;ou.exports=Kx,ou.exports.default=Kx,ou.exports.DraggableCore=T5;var Xx=ou.exports,cu={exports:{}},qs={},Qh={};Qh.__esModule=!0,Qh.cloneElement=I5;var M5=D5(E);function D5(e){return e&&e.__esModule?e:{default:e}}function Zx(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 Jx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zx(Object(n),!0).forEach(function(r){k5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function k5(e,t,n){return t=O5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O5(e){var t=A5(e,"string");return typeof t=="symbol"?t:String(t)}function A5(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 I5(e,t){return t.style&&e.props.style&&(t.style=Jx(Jx({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),M5.default.cloneElement(e,t)}var Ys={};Ys.__esModule=!0,Ys.resizableProps=void 0;var Oe=j5(co);function j5(e){return e&&e.__esModule?e:{default:e}}var $5={axis:Oe.default.oneOf(["both","x","y","none"]),className:Oe.default.string,children:Oe.default.element.isRequired,draggableOpts:Oe.default.shape({allowAnyClick:Oe.default.bool,cancel:Oe.default.string,children:Oe.default.node,disabled:Oe.default.bool,enableUserSelectHack:Oe.default.bool,offsetParent:Oe.default.node,grid:Oe.default.arrayOf(Oe.default.number),handle:Oe.default.string,nodeRef:Oe.default.object,onStart:Oe.default.func,onDrag:Oe.default.func,onStop:Oe.default.func,onMouseDown:Oe.default.func,scale:Oe.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=Oe.default.number).isRequired.apply(i,n)}return Oe.default.number.apply(Oe.default,n)},handle:Oe.default.oneOfType([Oe.default.node,Oe.default.func]),handleSize:Oe.default.arrayOf(Oe.default.number),lockAspectRatio:Oe.default.bool,maxConstraints:Oe.default.arrayOf(Oe.default.number),minConstraints:Oe.default.arrayOf(Oe.default.number),onResizeStop:Oe.default.func,onResizeStart:Oe.default.func,onResize:Oe.default.func,resizeHandles:Oe.default.arrayOf(Oe.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:Oe.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=Oe.default.number).isRequired.apply(i,n)}return Oe.default.number.apply(Oe.default,n)}};Ys.resizableProps=$5,qs.__esModule=!0,qs.default=void 0;var Ks=H5(E),F5=Xx,L5=Qh,z5=Ys,B5=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Qx(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Qx=function(o){return o?n:t})(e)}function H5(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Qx(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 ep(){return ep=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},ep.apply(this,arguments)}function U5(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 e_(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 tp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e_(Object(n),!0).forEach(function(r){V5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V5(e,t,n){return t=W5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W5(e){var t=G5(e,"string");return typeof t=="symbol"?t:String(t)}function G5(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 q5(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,np(e,t)}function np(e,t){return np=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},np(e,t)}var rp=function(e){q5(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),S=a.props.height+(h?d/a.props.transformScale:0),C=a.runConstraints(x,S);x=C[0],S=C[1];var N=x!==a.props.width||S!==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:S},handle:i})),o==="onResizeStop"&&a.resetData()}}},n.renderResizeHandle=function(o,i){var a=this.props.handle;if(!a)return Ks.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=tp({ref:i},s?{}:{handleAxis:o});return Ks.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=U5(i,B5);return(0,L5.cloneElement)(a,tp(tp({},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]=Ks.createRef();return Ks.createElement(F5.DraggableCore,ep({},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}(Ks.Component);qs.default=rp,rp.propTypes=z5.resizableProps,rp.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var uu={};uu.__esModule=!0,uu.default=void 0;var op=J5(E),Y5=t_(co),K5=t_(qs),X5=Ys,Z5=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function t_(e){return e&&e.__esModule?e:{default:e}}function n_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(n_=function(o){return o?n:t})(e)}function J5(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=n_(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 ip(){return ip=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},ip.apply(this,arguments)}function r_(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 du(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r_(Object(n),!0).forEach(function(r){Q5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Q5(e,t,n){return t=e8(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e8(e){var t=t8(e,"string");return typeof t=="symbol"?t:String(t)}function t8(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 n8(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 r8(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ap(e,t)}function ap(e,t){return ap=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},ap(e,t)}var o_=function(e){r8(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=n8(o,Z5);return op.createElement(K5.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},op.createElement("div",ip({},w,{style:du(du({},m),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(op.Component);uu.default=o_,o_.propTypes=du(du({},X5.resizableProps),{},{children:Y5.default.element}),cu.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},cu.exports.Resizable=qs.default,cu.exports.ResizableBox=uu.default;var o8=cu.exports,$r={};Object.defineProperty($r,"__esModule",{value:!0}),$r.resizeHandleType=$r.resizeHandleAxesType=$r.default=void 0;var Ie=i_(co),i8=i_(E);function i_(e){return e&&e.__esModule?e:{default:e}}const a8=$r.resizeHandleAxesType=Ie.default.arrayOf(Ie.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),s8=$r.resizeHandleType=Ie.default.oneOfType([Ie.default.node,Ie.default.func]);$r.default={className:Ie.default.string,style:Ie.default.object,width:Ie.default.number,autoSize:Ie.default.bool,cols:Ie.default.number,draggableCancel:Ie.default.string,draggableHandle:Ie.default.string,verticalCompact:function(e){e.verticalCompact},compactType:Ie.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&$e.validateLayout(t,"layout")},margin:Ie.default.arrayOf(Ie.default.number),containerPadding:Ie.default.arrayOf(Ie.default.number),rowHeight:Ie.default.number,maxRows:Ie.default.number,isBounded:Ie.default.bool,isDraggable:Ie.default.bool,isResizable:Ie.default.bool,allowOverlap:Ie.default.bool,preventCollision:Ie.default.bool,useCSSTransforms:Ie.default.bool,transformScale:Ie.default.number,isDroppable:Ie.default.bool,resizeHandles:a8,resizeHandle:s8,onLayoutChange:Ie.default.func,onDragStart:Ie.default.func,onDrag:Ie.default.func,onDragStop:Ie.default.func,onResizeStart:Ie.default.func,onResize:Ie.default.func,onResizeStop:Ie.default.func,onDrop:Ie.default.func,droppingItem:Ie.default.shape({i:Ie.default.string.isRequired,w:Ie.default.number.isRequired,h:Ie.default.number.isRequired}),children:function(e,t){const n=e[t],r={};i8.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:Ie.default.any},Object.defineProperty(ru,"__esModule",{value:!0}),ru.default=void 0;var Zi=sp(E),Ze=sp(co),l8=Xx,c8=o8,Ji=$e,Ot=pr,a_=$r,u8=sp(Ah);function sp(e){return e&&e.__esModule?e:{default:e}}function wr(e,t,n){return t=d8(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d8(e){var t=f8(e,"string");return typeof t=="symbol"?t:String(t)}function f8(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 lp extends Zi.default.Component{constructor(){super(...arguments),wr(this,"state",{resizing:null,dragging:null,className:""}),wr(this,"elementRef",Zi.default.createRef()),wr(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,Ot.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})}),wr(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:S,containerPadding:C}=this.props,N=b.clientHeight-(0,Ot.calcGridItemWHPx)(f,S,x[1]);s=(0,Ot.clamp)(s-C[1],0,N);const R=(0,Ot.calcGridColWidth)(p),T=h-(0,Ot.calcGridItemWHPx)(d,R,x[0]);l=(0,Ot.clamp)(l-C[0],0,T)}}const m={top:s,left:l};this.setState({dragging:m});const{x:v,y:w}=(0,Ot.calcXY)(p,s,l,d,f);return a.call(this,u,v,w,{e:t,node:r,newPosition:m})}),wr(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,Ot.calcXY)(this.getPositionParams(),c,l,i,a);return o.call(this,s,d,f,{e:t,node:r,newPosition:u})}),wr(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),wr(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),wr(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,Ot.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,Ot.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,Ji.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,Ji.setTransform)(t):(i=(0,Ji.setTopLeft)(t),n&&(i.left=(0,Ji.perc)(t.left/r),i.width=(0,Ji.perc)(t.width/r))),i}mixinDraggable(t,n){return Zi.default.createElement(l8.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,Ot.calcGridItemPosition)(f,0,0,o,0).width,p=(0,Ot.calcGridItemPosition)(f,0,0,i,a),m=(0,Ot.calcGridItemPosition)(f,0,0,s,l),v=[p.width,p.height],w=[Math.min(m.width,h),Math.min(m.height,1/0)];return Zi.default.createElement(c8.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,Ji.resizeItemInDirection)(s,r,a,p),this.setState({resizing:o==="onResizeStop"?null:w}));let{w:b,h:x}=(0,Ot.calcWH)(this.getPositionParams(),w.width,w.height,c,u,s);b=(0,Ot.clamp)(b,Math.max(m,1),v),x=(0,Ot.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,Ot.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=Zi.default.Children.only(this.props.children);let d=Zi.default.cloneElement(u,{ref:this.elementRef,className:(0,u8.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}}ru.default=lp,wr(lp,"propTypes",{children:Ze.default.element,cols:Ze.default.number.isRequired,containerWidth:Ze.default.number.isRequired,rowHeight:Ze.default.number.isRequired,margin:Ze.default.array.isRequired,maxRows:Ze.default.number.isRequired,containerPadding:Ze.default.array.isRequired,x:Ze.default.number.isRequired,y:Ze.default.number.isRequired,w:Ze.default.number.isRequired,h:Ze.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:Ze.default.string.isRequired,resizeHandles:a_.resizeHandleAxesType,resizeHandle:a_.resizeHandleType,onDragStop:Ze.default.func,onDragStart:Ze.default.func,onDrag:Ze.default.func,onResizeStop:Ze.default.func,onResizeStart:Ze.default.func,onResize:Ze.default.func,isDraggable:Ze.default.bool.isRequired,isResizable:Ze.default.bool.isRequired,isBounded:Ze.default.bool.isRequired,static:Ze.default.bool,useCSSTransforms:Ze.default.bool.isRequired,transformScale:Ze.default.number,className:Ze.default.string,handle:Ze.default.string,cancel:Ze.default.string,droppingPosition:Ze.default.shape({e:Ze.default.object.isRequired,left:Ze.default.number.isRequired,top:Ze.default.number.isRequired})}),wr(lp,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(Us,"__esModule",{value:!0}),Us.default=void 0;var Ko=g8(E),cp=Oh,h8=up(Ah),Te=$e,p8=pr,s_=up(ru),m8=up($r);function up(e){return e&&e.__esModule?e:{default:e}}function l_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(l_=function(r){return r?n:t})(e)}function g8(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=l_(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 $t(e,t,n){return t=w8(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w8(e){var t=v8(e,"string");return typeof t=="symbol"?t:String(t)}function v8(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 c_="react-grid-layout";let u_=!1;try{u_=/firefox/i.test(navigator.userAgent)}catch{}class fu extends Ko.Component{constructor(){super(...arguments),$t(this,"state",{activeDrag:null,layout:(0,Te.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Te.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),$t(this,"dragEnterCounter",0),$t(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s}=this.state,l=(0,Te.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,Te.cloneLayoutItem)(l),oldLayout:s,activeDrag:c}),this.props.onDragStart(s,l,l,null,i,a)}),$t(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,Te.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,Te.moveElement)(l,f,n,r,!0,d,(0,Te.compactType)(this.props),c,u),this.props.onDrag(l,s,f,h,i,a),this.setState({layout:u?l:(0,Te.compact)(l,(0,Te.compactType)(this.props),c),activeDrag:h})}),$t(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,Te.getLayoutItem)(l,t);if(!f)return;l=(0,Te.moveElement)(l,f,n,r,!0,u,(0,Te.compactType)(this.props),c,d);const p=d?l:(0,Te.compact)(l,(0,Te.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)}),$t(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s}=this.state,l=(0,Te.getLayoutItem)(s,t);l&&(this.setState({oldResizeItem:(0,Te.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(s,l,l,null,i,a))}),$t(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,Te.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,Te.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,Te.moveElement)(b,x,v,w,!0,this.props.preventCollision,(0,Te.compactType)(this.props),d,h));const S={w:x.w,h:x.h,x:x.x,y:x.y,static:!0,i:t};this.props.onResize(m,c,x,S,i,a),this.setState({layout:h?m:(0,Te.compact)(m,(0,Te.compactType)(this.props),d),activeDrag:S})}),$t(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,Te.getLayoutItem)(s,t),f=u?s:(0,Te.compact)(s,(0,Te.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)}),$t(this,"onDragOver",t=>{var b;if(t.preventDefault(),t.stopPropagation(),u_&&!((b=t.nativeEvent.target)!=null&&b.classList.contains(c_)))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:S}=this.state.droppingPosition;(x!=m||S!=v)&&this.setState({droppingPosition:w})}}else{const x={cols:i,margin:o,maxRows:s,rowHeight:a,containerWidth:l,containerPadding:c||o},S=(0,p8.calcXY)(x,v,m,f.w,f.h);this.setState({droppingDOMNode:Ko.createElement("div",{key:f.i}),droppingPosition:w,layout:[...h,{...f,x:S.x,y:S.y,static:!1,isDraggable:!0}]})}}),$t(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,Te.compact)(r.filter(i=>i.i!==t.i),(0,Te.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),$t(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),$t(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),$t(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,cp.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Te.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Te.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Te.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Te.fastRGLPropsEqual)(this.props,t,cp.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,Te.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,cp.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 Ko.createElement(s_.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},Ko.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Te.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:S}=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 Ko.createElement(s_.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?S:void 0,resizeHandles:R,resizeHandle:b},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,h8.default)(c_,t),a={height:this.containerHeight(),...n};return Ko.createElement("div",{ref:o,className:i,style:a,onDrop:r?this.onDrop:Te.noop,onDragLeave:r?this.onDragLeave:Te.noop,onDragEnter:r?this.onDragEnter:Te.noop,onDragOver:r?this.onDragOver:Te.noop},Ko.Children.map(this.props.children,s=>this.processGridItem(s)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Us.default=fu,$t(fu,"displayName","ReactGridLayout"),$t(fu,"propTypes",m8.default),$t(fu,"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:Te.noop,onDragStart:Te.noop,onDrag:Te.noop,onDragStop:Te.noop,onResizeStart:Te.noop,onResize:Te.noop,onResizeStop:Te.noop,onDrop:Te.noop,onDropDragOver:Te.noop});var hu={},Xo={};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.findOrGenerateResponsiveLayout=x8,Xo.getBreakpointFromWidth=y8,Xo.getColsFromBreakpoint=b8,Xo.sortBreakpoints=dp;var pu=$e;function y8(e,t){const n=dp(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 b8(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function x8(e,t,n,r,o,i){if(e[n])return(0,pu.cloneLayout)(e[n]);let a=e[r];const s=dp(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,pu.cloneLayout)(a||[]),(0,pu.compact)((0,pu.correctBounds)(a,{cols:o}),i,o)}function dp(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(hu,"__esModule",{value:!0}),hu.default=void 0;var d_=S8(E),an=f_(co),fp=Oh,Qi=$e,Zo=Xo,_8=f_(Us);function f_(e){return e&&e.__esModule?e:{default:e}}function h_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(h_=function(r){return r?n:t})(e)}function S8(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=h_(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 hp(){return hp=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},hp.apply(this,arguments)}function mu(e,t,n){return t=C8(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C8(e){var t=E8(e,"string");return typeof t=="symbol"?t:String(t)}function E8(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 p_=e=>Object.prototype.toString.call(e);function gu(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class pp extends d_.Component{constructor(){super(...arguments),mu(this,"state",this.generateInitialState()),mu(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,Zo.getBreakpointFromWidth)(n,t),a=(0,Zo.getColsFromBreakpoint)(i,o),s=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Zo.findOrGenerateResponsiveLayout)(r,n,i,i,a,s),breakpoint:i,cols:a}}static getDerivedStateFromProps(t,n){if(!(0,fp.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Zo.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,fp.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,fp.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,Zo.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),s=this.state.breakpoint,l=(0,Zo.getColsFromBreakpoint)(a,r),c={...o};if(s!==a||t.breakpoints!==n||t.cols!==r){s in c||(c[s]=(0,Qi.cloneLayout)(this.state.layout));let f=(0,Zo.findOrGenerateResponsiveLayout)(c,n,a,s,l,i);f=(0,Qi.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=gu(this.props.margin,a),d=gu(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 d_.createElement(_8.default,hp({},u,{margin:gu(i,this.state.breakpoint),containerPadding:gu(a,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}hu.default=pp,mu(pp,"propTypes",{breakpoint:an.default.string,breakpoints:an.default.object,allowOverlap:an.default.bool,cols:an.default.object,margin:an.default.oneOfType([an.default.array,an.default.object]),containerPadding:an.default.oneOfType([an.default.array,an.default.object]),layouts(e,t){if(p_(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+p_(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,Qi.validateLayout)(e.layouts[n],"layouts."+n)})},width:an.default.number.isRequired,onBreakpointChange:an.default.func,onLayoutChange:an.default.func,onWidthChange:an.default.func}),mu(pp,"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:Qi.noop,onLayoutChange:Qi.noop,onWidthChange:Qi.noop});var mp={},m_=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}()}(),gp=typeof window<"u"&&typeof document<"u"&&window.document===document,wu=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")()}(),P8=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(wu):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),R8=2;function N8(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){P8(i)}function s(){var l=Date.now();if(n){if(l-o<R8)return;r=!0}else n=!0,r=!1,setTimeout(a,t);o=l}return s}var T8=20,M8=["top","right","bottom","left","width","height","size","weight"],D8=typeof MutationObserver<"u",k8=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=N8(this.refresh.bind(this),T8)}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(){!gp||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),D8?(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(){!gp||!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=M8.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}(),g_=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},ea=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||wu},w_=yu(0,0,0,0);function vu(e){return parseFloat(e)||0}function v_(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 O8(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 A8(e){var t=e.getBBox();return yu(0,0,t.width,t.height)}function I8(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return w_;var r=ea(e).getComputedStyle(e),o=O8(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-=v_(r,"left","right")+i),Math.round(l+a)!==n&&(l-=v_(r,"top","bottom")+a)),!$8(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 yu(o.left,o.top,s,l)}var j8=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ea(e).SVGGraphicsElement}:function(e){return e instanceof ea(e).SVGElement&&typeof e.getBBox=="function"}}();function $8(e){return e===ea(e).document.documentElement}function F8(e){return gp?j8(e)?A8(e):I8(e):w_}function L8(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 g_(a,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),a}function yu(e,t,n,r){return{x:e,y:t,width:n,height:r}}var z8=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=yu(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=F8(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}(),B8=function(){function e(t,n){var r=L8(n);g_(this,{target:t,contentRect:r})}return e}(),H8=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new m_,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 ea(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new z8(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 ea(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 B8(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}(),y_=typeof WeakMap<"u"?new WeakMap:new m_,b_=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=k8.getInstance(),r=new H8(t,n,this);y_.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){b_.prototype[e]=function(){var t;return(t=y_.get(this))[e].apply(t,arguments)}});var U8=function(){return typeof wu.ResizeObserver<"u"?wu.ResizeObserver:b_}();const V8=ec(Object.freeze(Object.defineProperty({__proto__:null,default:U8},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(mp,"__esModule",{value:!0}),mp.default=J8;var bu=Y8(E),W8=wp(co),G8=wp(V8),q8=wp(Ah);function wp(e){return e&&e.__esModule?e:{default:e}}function x_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(x_=function(r){return r?n:t})(e)}function Y8(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=x_(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 vp(){return vp=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},vp.apply(this,arguments)}function ta(e,t,n){return t=K8(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K8(e){var t=X8(e,"string");return typeof t=="symbol"?t:String(t)}function X8(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 Z8="react-grid-layout";function J8(e){var t;return t=class extends bu.Component{constructor(){super(...arguments),ta(this,"state",{width:1280}),ta(this,"elementRef",bu.createRef()),ta(this,"mounted",!1),ta(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new G8.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?bu.createElement("div",{className:(0,q8.default)(this.props.className,Z8),style:this.props.style,ref:this.elementRef}):bu.createElement(e,vp({innerRef:this.elementRef},o,this.state))}},ta(t,"defaultProps",{measureBeforeMount:!1}),ta(t,"propTypes",{measureBeforeMount:W8.default.bool}),t}(function(e){e.exports=Us.default,e.exports.utils=$e,e.exports.calculateUtils=pr,e.exports.Responsive=hu.default,e.exports.Responsive.utils=Xo,e.exports.WidthProvider=mp.default})(xx);var yp=xx.exports;const __=jn(yp),Q8=yp.WidthProvider(__),e3=lo.div`
|
|
150
150
|
.grid-container {
|
|
151
151
|
display: flex;
|
|
152
152
|
|
|
@@ -174,7 +174,7 @@ object-assign
|
|
|
174
174
|
.react-grid-drag-handle {
|
|
175
175
|
cursor: move;
|
|
176
176
|
}
|
|
177
|
-
`,
|
|
177
|
+
`,S_=e=>g.jsx(g.Fragment,{children:g.jsx(e3,{children:g.jsx(Q8,{className:"layout",rowHeight:50,cols:12,compactType:null,isResizable:!1,isDraggable:!1,preventCollision:!0,margin:[0,0],layout:e.layout,children:e.components.map(t=>g.jsx("div",{className:"grid-item",children:t.component},t.id))})})}),t3=lo.div`
|
|
178
178
|
.mi-container {
|
|
179
179
|
display: flex;
|
|
180
180
|
flex-direction: row;
|
|
@@ -193,7 +193,7 @@ object-assign
|
|
|
193
193
|
flex-grow: 1;
|
|
194
194
|
overflow: auto;
|
|
195
195
|
}
|
|
196
|
-
`,
|
|
196
|
+
`,n3=()=>{const[e,t]=E.useState([]),[n,r]=E.useState([]),[o,i]=E.useState(!1),{projectMetadata:a}=Dh(),s=async()=>{i(!0),await zb(a.projectName,a.projectURL),i(!1),await fh(a.projectName,a.projectURL),await Wz(a.projectName);const l=await bx(a.projectName);t(l.components),r(l.layout)};return E.useEffect(()=>{!a.projectName&&!a.projectURL||s()},[a.projectName,a.projectURL]),g.jsx(g.Fragment,{children:g.jsxs(t3,{children:[g.jsx(C4,{isVisible:o}),g.jsx("div",{className:"mi-container",children:g.jsx("div",{className:"mi-workspace",style:{backgroundColor:"#6f4d80"},children:g.jsx(S_,{components:e,layout:n})})})]})})},r3=E.forwardRef(({style:e,className:t,onMouseDown:n,onMouseUp:r,onTouchEnd:o,children:i,componentId:a},s)=>{const{selectedComponentId:l}=Dh(),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 o3 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 i3=e=>g.jsx(g.Fragment,{children:g.jsx("div",{className:"droppable-element",draggable:!0,unselectable:"on",onDragStart:t=>{t.dataTransfer.setData("text/plain",""),t.dataTransfer.setData("application/reactgridlayout",JSON.stringify({id:e.id,type:e.type,initialSize:e.initialSize,metadata:e.metadata}))},children:e.node})}),a3=yp.WidthProvider(__),s3=lo.div`
|
|
197
197
|
.react-grid-layout {
|
|
198
198
|
position: relative;
|
|
199
199
|
// transition: height 200ms ease;
|
|
@@ -241,7 +241,7 @@ object-assign
|
|
|
241
241
|
box-sizing: border-box;
|
|
242
242
|
cursor: se-resize;
|
|
243
243
|
}
|
|
244
|
-
`,
|
|
244
|
+
`,l3=lo.div`
|
|
245
245
|
.grid-container {
|
|
246
246
|
display: flex;
|
|
247
247
|
|
|
@@ -269,4 +269,173 @@ object-assign
|
|
|
269
269
|
.react-grid-drag-handle {
|
|
270
270
|
cursor: move;
|
|
271
271
|
}
|
|
272
|
-
`,Fx=e=>ve.jsx(ve.Fragment,{children:ve.jsx(Mx,{children:ve.jsx(Lx,{children:ve.jsx(Nx,{className:"layout",rowHeight:50,cols:12,layout:e.layout,onLayoutChange:e.onLayoutChange,onResizeStop:e.onResize,onDrop:e.onDrop,onDragStop:e.onDrag,compactType:null,preventCollision:!0,draggableCancel:".cancel-drag",isDroppable:!0,draggableHandle:".react-grid-drag-handle",children:e.components})})})}),Ux=()=>{typeof window<"u"&&(window.Buffer=Ja.Buffer,window.fs=new up("fs"),window.pfs=window.fs.promises,window.miDir="/mi")};be.APIHandler=xs,be.APIProxyHandler=Es,be.MiniApp=Ix,be.ProjectProvider=G_,be.RGComponent=jx,be.RGComponentErrorBoundary=Bx,be.RGDroppable=zx,be.RGEditLayout=Fx,be.RGPreviewLayout=ph,be.getHeadCommit=Rb,be.getRedoTargetCommitForFile=Cb,be.getTags=ss,be.getUndoTargetCommitForFile=Ob,be.initializeMakeInfinite=Ux,be.listDir=Of,be.loadLibraryComponents=Y_,be.loadProjectComponents=ud,be.setTailwindTheme=Z_,be.syncAndRetry=Pf,be.useAPI=od,be.useAppMetadata=K_,be.useAppSettings=J_,be.useAppVersions=Q_,be.useB64UrlForProjectImage=V_,be.useProject=Rs,Object.defineProperty(be,Symbol.toStringTag,{value:"Module"})});
|
|
272
|
+
`,c3=e=>g.jsx(g.Fragment,{children:g.jsx(s3,{children:g.jsx(l3,{children:g.jsx(a3,{className:"layout",rowHeight:50,cols:12,layout:e.layout,onLayoutChange:e.onLayoutChange,onResizeStop:e.onResize,onDrop:e.onDrop,onDragStop:e.onDrag,compactType:null,preventCollision:!0,draggableCancel:".cancel-drag",isDroppable:!0,draggableHandle:".react-grid-drag-handle",children:e.components})})})});function C_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xs(...e){return t=>{let n=!1;const r=e.map(o=>{const i=C_(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():C_(e[o],null)}}}}function Se(...e){return y.useCallback(Xs(...e),e)}var Hn=y.forwardRef((e,t)=>{const{children:n,...r}=e,o=y.Children.toArray(n),i=o.find(u3);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(bp,{...r,ref:t,children:y.isValidElement(a)?y.cloneElement(a,void 0,s):null})}return g.jsx(bp,{...r,ref:t,children:n})});Hn.displayName="Slot";var bp=y.forwardRef((e,t)=>{const{children:n,...r}=e;if(y.isValidElement(n)){const o=f3(n),i=d3(r,n.props);return n.type!==y.Fragment&&(i.ref=t?Xs(t,o):o),y.cloneElement(n,i)}return y.Children.count(n)>1?y.Children.only(null):null});bp.displayName="SlotClone";var xu=({children:e})=>g.jsx(g.Fragment,{children:e});function u3(e){return y.isValidElement(e)&&e.type===xu}function d3(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 f3(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 h3=Hn;const p3=Object.freeze(Object.defineProperty({__proto__:null,Root:h3,Slot:Hn,Slottable:xu},Symbol.toStringTag,{value:"Module"}));var m3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],he=m3.reduce((e,t)=>{const n=y.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?Hn: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 _u(e,t){e&&Jl.flushSync(()=>e.dispatchEvent(t))}var g3="VisuallyHidden",xp=y.forwardRef((e,t)=>g.jsx(he.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}}));xp.displayName=g3;var E_=xp;function w3(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 at(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,v3(o,...t)]}function v3(...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 ho(e){const t=e+"CollectionProvider",[n,r]=at(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=Se(p,w.collectionRef);return g.jsx(Hn,{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=Se(p,b),S=i(c,m);return E.useEffect(()=>(S.itemMap.set(b,{ref:b,...w}),()=>void S.itemMap.delete(b))),g.jsx(Hn,{[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((S,C)=>w.indexOf(S.ref.current)-w.indexOf(C.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},f,r]}function le(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 et(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 lt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=y3({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=et(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 y3({defaultProp:e,onChange:t}){const n=y.useState(e),[r]=n,o=y.useRef(r),i=et(t);return y.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var vt=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{};function b3(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var ht=e=>{const{present:t,children:n}=e,r=x3(t),o=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),i=Se(r.ref,_3(o));return typeof n=="function"||r.isPresent?y.cloneElement(o,{ref:i}):null};ht.displayName="Presence";function x3(e){const[t,n]=y.useState(),r=y.useRef({}),o=y.useRef(e),i=y.useRef("none"),a=e?"mounted":"unmounted",[s,l]=b3(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=Su(r.current);i.current=s==="mounted"?c:"none"},[s]),vt(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,h=Su(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]),vt(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const m=Su(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=Su(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 Su(e){return(e==null?void 0:e.animationName)||"none"}function _3(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 S3=y.useId||(()=>{}),C3=0;function _t(e){const[t,n]=y.useState(S3());return vt(()=>{e||n(r=>r??String(C3++))},[e]),e||(t?`radix-${t}`:"")}var _p="Collapsible",[E3,P_]=at(_p),[P3,Sp]=E3(_p),R_=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:a,...s}=e,[l=!1,c]=lt({prop:r,defaultProp:o,onChange:a});return g.jsx(P3,{scope:n,disabled:i,contentId:_t(),open:l,onOpenToggle:y.useCallback(()=>c(u=>!u),[c]),children:g.jsx(he.div,{"data-state":Rp(l),"data-disabled":i?"":void 0,...s,ref:t})})});R_.displayName=_p;var N_="CollapsibleTrigger",Cp=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Sp(N_,n);return g.jsx(he.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Rp(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:le(e.onClick,o.onOpenToggle)})});Cp.displayName=N_;var Ep="CollapsibleContent",Pp=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Sp(Ep,e.__scopeCollapsible);return g.jsx(ht,{present:n||o.open,children:({present:i})=>g.jsx(R3,{...r,ref:t,present:i})})});Pp.displayName=Ep;var R3=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,a=Sp(Ep,n),[s,l]=y.useState(r),c=y.useRef(null),u=Se(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)},[]),vt(()=>{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(he.div,{"data-state":Rp(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 Rp(e){return e?"open":"closed"}var T_=R_,N3=Cp,T3=Pp,M3=y.createContext(void 0);function Un(e){const t=y.useContext(M3);return e||t||"ltr"}var Fr="Accordion",D3=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Np,k3,O3]=ho(Fr),[Cu,rne]=at(Fr,[O3,P_]),Tp=P_(),M_=E.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return g.jsx(Np.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?g.jsx($3,{...i,ref:t}):g.jsx(j3,{...o,ref:t})})});M_.displayName=Fr;var[D_,A3]=Cu(Fr),[k_,I3]=Cu(Fr,{collapsible:!1}),j3=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...a}=e,[s,l]=lt({prop:n,defaultProp:r,onChange:o});return g.jsx(D_,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:l,onItemClose:E.useCallback(()=>i&&l(""),[i,l]),children:g.jsx(k_,{scope:e.__scopeAccordion,collapsible:i,children:g.jsx(O_,{...a,ref:t})})})}),$3=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a=[],s]=lt({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(D_,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:c,children:g.jsx(k_,{scope:e.__scopeAccordion,collapsible:!0,children:g.jsx(O_,{...i,ref:t})})})}),[F3,Eu]=Cu(Fr),O_=E.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...a}=e,s=E.useRef(null),l=Se(s,t),c=k3(n),d=Un(o)==="ltr",f=le(e.onKeyDown,h=>{var T;if(!D3.includes(h.key))return;const p=h.target,m=c().filter(M=>{var k;return!((k=M.ref.current)!=null&&k.disabled)}),v=m.findIndex(M=>M.ref.current===p),w=m.length;if(v===-1)return;h.preventDefault();let b=v;const x=0,S=w-1,C=()=>{b=v+1,b>S&&(b=x)},N=()=>{b=v-1,b<x&&(b=S)};switch(h.key){case"Home":b=x;break;case"End":b=S;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(F3,{scope:n,disabled:r,direction:o,orientation:i,children:g.jsx(Np.Slot,{scope:n,children:g.jsx(he.div,{...a,"data-orientation":i,ref:l,onKeyDown:r?void 0:f})})})}),Pu="AccordionItem",[L3,Mp]=Cu(Pu),A_=E.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Eu(Pu,n),a=A3(Pu,n),s=Tp(n),l=_t(),c=r&&a.value.includes(r)||!1,u=i.disabled||e.disabled;return g.jsx(L3,{scope:n,open:c,disabled:u,triggerId:l,children:g.jsx(T_,{"data-orientation":i.orientation,"data-state":z_(c),...s,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?a.onItemOpen(r):a.onItemClose(r)}})})});A_.displayName=Pu;var I_="AccordionHeader",j_=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Eu(Fr,n),i=Mp(I_,n);return g.jsx(he.h3,{"data-orientation":o.orientation,"data-state":z_(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});j_.displayName=I_;var Dp="AccordionTrigger",$_=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Eu(Fr,n),i=Mp(Dp,n),a=I3(Dp,n),s=Tp(n);return g.jsx(Np.ItemSlot,{scope:n,children:g.jsx(N3,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...s,...r,ref:t})})});$_.displayName=Dp;var F_="AccordionContent",L_=E.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Eu(Fr,n),i=Mp(F_,n),a=Tp(n);return g.jsx(T3,{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}})});L_.displayName=F_;function z_(e){return e?"open":"closed"}var z3=M_,B3=A_,H3=j_,U3=$_,V3=L_;function W3(e,t=globalThis==null?void 0:globalThis.document){const n=et(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 G3="DismissableLayer",kp="dismissableLayer.update",q3="dismissableLayer.pointerDownOutside",Y3="dismissableLayer.focusOutside",B_,H_=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),po=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=y.useContext(H_),[u,d]=y.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=y.useState({}),p=Se(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,S=b>=w,C=Z3(R=>{const T=R.target,M=[...c.branches].some(k=>k.contains(T));!S||M||(o==null||o(R),a==null||a(R),R.defaultPrevented||s==null||s())},f),N=J3(R=>{const T=R.target;[...c.branches].some(k=>k.contains(T))||(i==null||i(R),a==null||a(R),R.defaultPrevented||s==null||s())},f);return W3(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&&(B_=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),U_(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=B_)}},[u,f,n,c]),y.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),U_())},[u,c]),y.useEffect(()=>{const R=()=>h({});return document.addEventListener(kp,R),()=>document.removeEventListener(kp,R)},[]),g.jsx(he.div,{...l,ref:p,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:le(e.onFocusCapture,N.onFocusCapture),onBlurCapture:le(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:le(e.onPointerDownCapture,C.onPointerDownCapture)})});po.displayName=G3;var K3="DismissableLayerBranch",X3=y.forwardRef((e,t)=>{const n=y.useContext(H_),r=y.useRef(null),o=Se(t,r);return y.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(he.div,{...e,ref:o})});X3.displayName=K3;function Z3(e,t=globalThis==null?void 0:globalThis.document){const n=et(e),r=y.useRef(!1),o=y.useRef(()=>{});return y.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let l=function(){V_(q3,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 J3(e,t=globalThis==null?void 0:globalThis.document){const n=et(e),r=y.useRef(!1);return y.useEffect(()=>{const o=i=>{i.target&&!r.current&&V_(Y3,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 U_(){const e=new CustomEvent(kp);document.dispatchEvent(e)}function V_(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?_u(o,i):o.dispatchEvent(i)}var Op="focusScope.autoFocusOnMount",Ap="focusScope.autoFocusOnUnmount",W_={bubbles:!1,cancelable:!0},Q3="FocusScope",Zs=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=y.useState(null),c=et(o),u=et(i),d=y.useRef(null),f=Se(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 S=x.target;s.contains(S)?d.current=S:mo(d.current,{select:!0})},v=function(x){if(h.paused||!s)return;const S=x.relatedTarget;S!==null&&(s.contains(S)||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){Y_.add(h);const m=document.activeElement;if(!s.contains(m)){const w=new CustomEvent(Op,W_);s.addEventListener(Op,c),s.dispatchEvent(w),w.defaultPrevented||(eH(iH(G_(s)),{select:!0}),document.activeElement===m&&mo(s))}return()=>{s.removeEventListener(Op,c),setTimeout(()=>{const w=new CustomEvent(Ap,W_);s.addEventListener(Ap,u),s.dispatchEvent(w),w.defaultPrevented||mo(m??document.body,{select:!0}),s.removeEventListener(Ap,u),Y_.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,S]=tH(b);x&&S?!m.shiftKey&&w===S?(m.preventDefault(),n&&mo(x,{select:!0})):m.shiftKey&&w===x&&(m.preventDefault(),n&&mo(S,{select:!0})):w===b&&m.preventDefault()}},[n,r,h.paused]);return g.jsx(he.div,{tabIndex:-1,...a,ref:f,onKeyDown:p})});Zs.displayName=Q3;function eH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mo(r,{select:t}),document.activeElement!==n)return}function tH(e){const t=G_(e),n=q_(t,e),r=q_(t.reverse(),e);return[n,r]}function G_(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 q_(e,t){for(const n of e)if(!nH(n,{upTo:t}))return n}function nH(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 rH(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&&rH(e)&&t&&e.select()}}var Y_=oH();function oH(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=K_(e,t),e.unshift(t)},remove(t){var n;e=K_(e,t),(n=e[0])==null||n.resume()}}}function K_(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function iH(e){return e.filter(t=>t.tagName!=="A")}var aH="Portal",Js=y.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=y.useState(!1);vt(()=>i(!0),[]);const a=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?tr.createPortal(g.jsx(he.div,{...r,ref:t}),a):null});Js.displayName=aH;var Ip=0;function Ru(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??X_()),document.body.insertAdjacentElement("beforeend",e[1]??X_()),Ip++,()=>{Ip===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ip--}},[])}function X_(){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 Ft=function(){return Ft=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},Ft.apply(this,arguments)};function jp(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 Z_(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 Qs="right-scroll-bar-position",el="width-before-scroll-bar",sH="with-scroll-bars-hidden",lH="--removed-body-scroll-bar-size";function $p(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function cH(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 uH=typeof window<"u"?y.useLayoutEffect:y.useEffect,J_=new WeakMap;function Q_(e,t){var n=cH(null,function(r){return e.forEach(function(o){return $p(o,r)})});return uH(function(){var r=J_.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(s){i.has(s)||$p(s,null)}),i.forEach(function(s){o.has(s)||$p(s,a)})}J_.set(n,e)},[e]),n}function dH(e){return e}function fH(e,t){t===void 0&&(t=dH);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 eS(e){e===void 0&&(e={});var t=fH(null);return t.options=Ft({async:!0,ssr:!1},e),t}var tS=function(e){var t=e.sideCar,n=jp(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,Ft({},n))};tS.isSideCarExport=!0;function nS(e,t){return e.useMedium(t),tS}var rS=eS(),Fp=function(){},Nu=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Fp,onWheelCapture:Fp,onTouchMoveCapture:Fp}),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=jp(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,C=Q_([n,t]),N=Ft(Ft({},x),o);return y.createElement(y.Fragment,null,u&&y.createElement(S,{sideCar:rS,removeScrollBar:c,shards:d,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),a?y.cloneElement(y.Children.only(s),Ft(Ft({},N),{ref:C})):y.createElement(w,Ft({},N,{className:l,ref:C}),s))});Nu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Nu.classNames={fullWidth:el,zeroRight:Qs};var hH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hH();return t&&e.setAttribute("nonce",t),e}function mH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function gH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var wH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=pH())&&(mH(t,n),gH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vH=function(){var e=wH();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Lp=function(){var e=vH(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},yH={left:0,top:0,right:0,gap:0},zp=function(e){return parseInt(e||"",10)||0},bH=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[zp(n),zp(r),zp(o)]},xH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return yH;var t=bH(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])}},_H=Lp(),na="data-scroll-locked",SH=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
273
|
+
.`.concat(sH,` {
|
|
274
|
+
overflow: hidden `).concat(r,`;
|
|
275
|
+
padding-right: `).concat(s,"px ").concat(r,`;
|
|
276
|
+
}
|
|
277
|
+
body[`).concat(na,`] {
|
|
278
|
+
overflow: hidden `).concat(r,`;
|
|
279
|
+
overscroll-behavior: contain;
|
|
280
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
281
|
+
padding-left: `.concat(o,`px;
|
|
282
|
+
padding-top: `).concat(i,`px;
|
|
283
|
+
padding-right: `).concat(a,`px;
|
|
284
|
+
margin-left:0;
|
|
285
|
+
margin-top:0;
|
|
286
|
+
margin-right: `).concat(s,"px ").concat(r,`;
|
|
287
|
+
`),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.`).concat(Qs,` {
|
|
291
|
+
right: `).concat(s,"px ").concat(r,`;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.`).concat(el,` {
|
|
295
|
+
margin-right: `).concat(s,"px ").concat(r,`;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.`).concat(Qs," .").concat(Qs,` {
|
|
299
|
+
right: 0 `).concat(r,`;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.`).concat(el," .").concat(el,` {
|
|
303
|
+
margin-right: 0 `).concat(r,`;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
body[`).concat(na,`] {
|
|
307
|
+
`).concat(lH,": ").concat(s,`px;
|
|
308
|
+
}
|
|
309
|
+
`)},oS=function(){var e=parseInt(document.body.getAttribute(na)||"0",10);return isFinite(e)?e:0},CH=function(){y.useEffect(function(){return document.body.setAttribute(na,(oS()+1).toString()),function(){var e=oS()-1;e<=0?document.body.removeAttribute(na):document.body.setAttribute(na,e.toString())}},[])},iS=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;CH();var i=y.useMemo(function(){return xH(o)},[o]);return y.createElement(_H,{styles:SH(i,!t,o,n?"":"!important")})},Bp=!1;if(typeof window<"u")try{var Tu=Object.defineProperty({},"passive",{get:function(){return Bp=!0,!0}});window.addEventListener("test",Tu,Tu),window.removeEventListener("test",Tu,Tu)}catch{Bp=!1}var ra=Bp?{passive:!1}:!1,EH=function(e){return e.tagName==="TEXTAREA"},aS=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!EH(e)&&n[t]==="visible")},PH=function(e){return aS(e,"overflowY")},RH=function(e){return aS(e,"overflowX")},sS=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=lS(e,r);if(o){var i=cS(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},NH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},TH=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},lS=function(e,t){return e==="v"?PH(t):RH(t)},cS=function(e,t){return e==="v"?NH(t):TH(t)},MH=function(e,t){return e==="h"&&t==="rtl"?-1:1},DH=function(e,t,n,r,o){var i=MH(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=cS(e,s),p=h[0],m=h[1],v=h[2],w=m-v-i*p;(p||w)&&lS(e,s)&&(d+=w,f+=p),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(c=!0),c},Mu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},uS=function(e){return[e.deltaX,e.deltaY]},dS=function(e){return e&&"current"in e?e.current:e},kH=function(e,t){return e[0]===t[0]&&e[1]===t[1]},OH=function(e){return`
|
|
310
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
311
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
312
|
+
`)},AH=0,oa=[];function IH(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),o=y.useState(AH++)[0],i=y.useState(Lp)[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=Z_([e.lockRef.current],(e.shards||[]).map(dS),!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||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var w=Mu(m),b=n.current,x="deltaX"in m?m.deltaX:b[0]-w[0],S="deltaY"in m?m.deltaY:b[1]-w[1],C,N=m.target,R=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&R==="h"&&N.type==="range")return!1;var T=sS(R,N);if(!T)return!0;if(T?C=R:(C=R==="v"?"h":"v",T=sS(R,N)),!T)return!1;if(!r.current&&"changedTouches"in m&&(x||S)&&(r.current=C),!C)return!0;var M=r.current||C;return DH(M,v,m,M==="h"?x:S)},[]),l=y.useCallback(function(m){var v=m;if(!(!oa.length||oa[oa.length-1]!==i)){var w="deltaY"in v?uS(v):Mu(v),b=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&kH(C.delta,w)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var x=(a.current.shards||[]).map(dS).filter(Boolean).filter(function(C){return C.contains(v.target)}),S=x.length>0?s(v,x[0]):!a.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),c=y.useCallback(function(m,v,w,b){var x={name:m,delta:v,target:w,should:b,shadowParent:jH(w)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),u=y.useCallback(function(m){n.current=Mu(m),r.current=void 0},[]),d=y.useCallback(function(m){c(m.type,uS(m),m.target,s(m,e.lockRef.current))},[]),f=y.useCallback(function(m){c(m.type,Mu(m),m.target,s(m,e.lockRef.current))},[]);y.useEffect(function(){return oa.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ra),document.addEventListener("touchmove",l,ra),document.addEventListener("touchstart",u,ra),function(){oa=oa.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,ra),document.removeEventListener("touchmove",l,ra),document.removeEventListener("touchstart",u,ra)}},[]);var h=e.removeScrollBar,p=e.inert;return y.createElement(y.Fragment,null,p?y.createElement(i,{styles:OH(o)}):null,h?y.createElement(iS,{gapMode:e.gapMode}):null)}function jH(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $H=nS(rS,IH);var tl=y.forwardRef(function(e,t){return y.createElement(Nu,Ft({},e,{ref:t,sideCar:$H}))});tl.classNames=Nu.classNames;var FH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ia=new WeakMap,Du=new WeakMap,ku={},Hp=0,fS=function(e){return e&&(e.host||fS(e.parentNode))},LH=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=fS(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},zH=function(e,t,n,r){var o=LH(t,Array.isArray(e)?e:[e]);ku[n]||(ku[n]=new WeakMap);var i=ku[n],a=[],s=new Set,l=new Set(o),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))u(f);else try{var h=f.getAttribute(r),p=h!==null&&h!=="false",m=(ia.get(f)||0)+1,v=(i.get(f)||0)+1;ia.set(f,m),i.set(f,v),a.push(f),m===1&&p&&Du.set(f,!0),v===1&&f.setAttribute(n,"true"),p||f.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",f,w)}})};return u(t),s.clear(),Hp++,function(){a.forEach(function(d){var f=ia.get(d)-1,h=i.get(d)-1;ia.set(d,f),i.set(d,h),f||(Du.has(d)||d.removeAttribute(r),Du.delete(d)),h||d.removeAttribute(n)}),Hp--,Hp||(ia=new WeakMap,ia=new WeakMap,Du=new WeakMap,ku={})}},nl=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=FH(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),zH(r,o,n,"aria-hidden")):function(){return null}},Up="Dialog",[hS,pS]=at(Up),[BH,Vn]=hS(Up),mS=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=y.useRef(null),l=y.useRef(null),[c=!1,u]=lt({prop:r,defaultProp:o,onChange:i});return g.jsx(BH,{scope:t,triggerRef:s,contentRef:l,contentId:_t(),titleId:_t(),descriptionId:_t(),open:c,onOpenChange:u,onOpenToggle:y.useCallback(()=>u(d=>!d),[u]),modal:a,children:n})};mS.displayName=Up;var gS="DialogTrigger",wS=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vn(gS,n),i=Se(t,o.triggerRef);return g.jsx(he.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Gp(o.open),...r,ref:i,onClick:le(e.onClick,o.onOpenToggle)})});wS.displayName=gS;var Vp="DialogPortal",[HH,vS]=hS(Vp,{forceMount:void 0}),yS=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Vn(Vp,t);return g.jsx(HH,{scope:t,forceMount:n,children:y.Children.map(r,a=>g.jsx(ht,{present:n||i.open,children:g.jsx(Js,{asChild:!0,container:o,children:a})}))})};yS.displayName=Vp;var Ou="DialogOverlay",bS=y.forwardRef((e,t)=>{const n=vS(Ou,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Vn(Ou,e.__scopeDialog);return i.modal?g.jsx(ht,{present:r||i.open,children:g.jsx(UH,{...o,ref:t})}):null});bS.displayName=Ou;var UH=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vn(Ou,n);return g.jsx(tl,{as:Hn,allowPinchZoom:!0,shards:[o.contentRef],children:g.jsx(he.div,{"data-state":Gp(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Jo="DialogContent",xS=y.forwardRef((e,t)=>{const n=vS(Jo,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Vn(Jo,e.__scopeDialog);return g.jsx(ht,{present:r||i.open,children:i.modal?g.jsx(VH,{...o,ref:t}):g.jsx(WH,{...o,ref:t})})});xS.displayName=Jo;var VH=y.forwardRef((e,t)=>{const n=Vn(Jo,e.__scopeDialog),r=y.useRef(null),o=Se(t,n.contentRef,r);return y.useEffect(()=>{const i=r.current;if(i)return nl(i)},[]),g.jsx(_S,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:le(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:le(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:le(e.onFocusOutside,i=>i.preventDefault())})}),WH=y.forwardRef((e,t)=>{const n=Vn(Jo,e.__scopeDialog),r=y.useRef(!1),o=y.useRef(!1);return g.jsx(_S,{...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()}})}),_S=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=Vn(Jo,n),l=y.useRef(null),c=Se(t,l);return Ru(),g.jsxs(g.Fragment,{children:[g.jsx(Zs,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:g.jsx(po,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Gp(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(qH,{titleId:s.titleId}),g.jsx(KH,{contentRef:l,descriptionId:s.descriptionId})]})]})}),Wp="DialogTitle",SS=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vn(Wp,n);return g.jsx(he.h2,{id:o.titleId,...r,ref:t})});SS.displayName=Wp;var CS="DialogDescription",ES=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vn(CS,n);return g.jsx(he.p,{id:o.descriptionId,...r,ref:t})});ES.displayName=CS;var PS="DialogClose",RS=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Vn(PS,n);return g.jsx(he.button,{type:"button",...r,ref:t,onClick:le(e.onClick,()=>o.onOpenChange(!1))})});RS.displayName=PS;function Gp(e){return e?"open":"closed"}var NS="DialogTitleWarning",[GH,TS]=w3(NS,{contentName:Jo,titleName:Wp,docsSlug:"dialog"}),qH=({titleId:e})=>{const t=TS(NS),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
313
|
+
|
|
314
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
315
|
+
|
|
316
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},YH="DialogDescriptionWarning",KH=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${TS(YH).contentName}}.`;return y.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Au=mS,Iu=wS,ju=yS,aa=bS,sa=xS,la=SS,ca=ES,ua=RS,MS="AlertDialog",[XH,one]=at(MS,[pS]),Lr=pS(),DS=e=>{const{__scopeAlertDialog:t,...n}=e,r=Lr(t);return g.jsx(Au,{...r,...n,modal:!0})};DS.displayName=MS;var ZH="AlertDialogTrigger",kS=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Lr(n);return g.jsx(Iu,{...o,...r,ref:t})});kS.displayName=ZH;var JH="AlertDialogPortal",OS=e=>{const{__scopeAlertDialog:t,...n}=e,r=Lr(t);return g.jsx(ju,{...r,...n})};OS.displayName=JH;var QH="AlertDialogOverlay",AS=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Lr(n);return g.jsx(aa,{...o,...r,ref:t})});AS.displayName=QH;var da="AlertDialogContent",[eU,tU]=XH(da),IS=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=Lr(n),a=y.useRef(null),s=Se(t,a),l=y.useRef(null);return g.jsx(GH,{contentName:da,titleName:jS,docsSlug:"alert-dialog",children:g.jsx(eU,{scope:n,cancelRef:l,children:g.jsxs(sa,{role:"alertdialog",...i,...o,ref:s,onOpenAutoFocus:le(o.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[g.jsx(xu,{children:r}),g.jsx(rU,{contentRef:a})]})})})});IS.displayName=da;var jS="AlertDialogTitle",$S=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Lr(n);return g.jsx(la,{...o,...r,ref:t})});$S.displayName=jS;var FS="AlertDialogDescription",LS=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Lr(n);return g.jsx(ca,{...o,...r,ref:t})});LS.displayName=FS;var nU="AlertDialogAction",zS=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Lr(n);return g.jsx(ua,{...o,...r,ref:t})});zS.displayName=nU;var BS="AlertDialogCancel",HS=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=tU(BS,n),i=Lr(n),a=Se(t,o);return g.jsx(ua,{...i,...r,ref:a})});HS.displayName=BS;var rU=({contentRef:e})=>{const t=`\`${da}\` requires a description for the component to be accessible for screen reader users.
|
|
317
|
+
|
|
318
|
+
You can add a description to the \`${da}\` by passing a \`${FS}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
319
|
+
|
|
320
|
+
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 \`${da}\`. 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.
|
|
321
|
+
|
|
322
|
+
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},oU=DS,iU=kS,aU=OS,US=AS,VS=IS,WS=zS,GS=HS,qS=$S,YS=LS,sU="AspectRatio",qp=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(he.div,{...o,ref:t,style:{...r,position:"absolute",top:0,right:0,bottom:0,left:0}})})});qp.displayName=sU;var lU=qp;const cU=Object.freeze(Object.defineProperty({__proto__:null,AspectRatio:qp,Root:lU},Symbol.toStringTag,{value:"Module"}));var Yp="Avatar",[uU,ine]=at(Yp),[dU,KS]=uU(Yp),XS=y.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=y.useState("idle");return g.jsx(dU,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:g.jsx(he.span,{...r,ref:t})})});XS.displayName=Yp;var ZS="AvatarImage",JS=y.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,a=KS(ZS,n),s=fU(r,i.referrerPolicy),l=et(c=>{o(c),a.onImageLoadingStatusChange(c)});return vt(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?g.jsx(he.img,{...i,ref:t,src:r}):null});JS.displayName=ZS;var QS="AvatarFallback",e1=y.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=KS(QS,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(he.span,{...o,ref:t}):null});e1.displayName=QS;function fU(e,t){const[n,r]=y.useState("idle");return vt(()=>{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 t1=XS,n1=JS,r1=e1;function fa(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 vt(()=>{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 Kp="Checkbox",[hU,ane]=at(Kp),[pU,mU]=hU(Kp),o1=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=Se(t,S=>h(S)),m=y.useRef(!1),v=f?u||!!f.closest("form"):!0,[w=!1,b]=lt({prop:o,defaultProp:i,onChange:c}),x=y.useRef(w);return y.useEffect(()=>{const S=f==null?void 0:f.form;if(S){const C=()=>b(x.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[f,b]),g.jsxs(pU,{scope:n,state:w,disabled:s,children:[g.jsx(he.button,{type:"button",role:"checkbox","aria-checked":go(w)?"mixed":w,"aria-required":a,"data-state":s1(w),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:p,onKeyDown:le(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:le(e.onClick,S=>{b(C=>go(C)?!0:!C),v&&(m.current=S.isPropagationStopped(),m.current||S.stopPropagation())})}),v&&g.jsx(gU,{control:f,bubbles:!m.current,name:r,value:l,checked:w,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"},defaultChecked:go(i)?!1:i})]})});o1.displayName=Kp;var i1="CheckboxIndicator",a1=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=mU(i1,n);return g.jsx(ht,{present:r||go(i.state)||i.state===!0,children:g.jsx(he.span,{"data-state":s1(i.state),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});a1.displayName=i1;var gU=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...i}=e,a=y.useRef(null),s=fa(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=go(n),h.call(u,go(n)?!1:n),u.dispatchEvent(p)}},[s,n,r]);const c=y.useRef(go(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 go(e){return e==="indeterminate"}function s1(e){return go(e)?"indeterminate":e?"checked":"unchecked"}var l1=o1,wU=a1;const vU=["top","right","bottom","left"],wo=Math.min,xn=Math.max,$u=Math.round,Fu=Math.floor,vr=e=>({x:e,y:e}),yU={left:"right",right:"left",bottom:"top",top:"bottom"},bU={start:"end",end:"start"};function Xp(e,t,n){return xn(e,wo(t,n))}function zr(e,t){return typeof e=="function"?e(t):e}function Br(e){return e.split("-")[0]}function ha(e){return e.split("-")[1]}function Zp(e){return e==="x"?"y":"x"}function Jp(e){return e==="y"?"height":"width"}function vo(e){return["top","bottom"].includes(Br(e))?"y":"x"}function Qp(e){return Zp(vo(e))}function xU(e,t,n){n===void 0&&(n=!1);const r=ha(e),o=Qp(e),i=Jp(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Lu(a)),[a,Lu(a)]}function _U(e){const t=Lu(e);return[em(e),t,em(t)]}function em(e){return e.replace(/start|end/g,t=>bU[t])}function SU(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 CU(e,t,n,r){const o=ha(e);let i=SU(Br(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(em)))),i}function Lu(e){return e.replace(/left|right|bottom|top/g,t=>yU[t])}function EU(e){return{top:0,right:0,bottom:0,left:0,...e}}function c1(e){return typeof e!="number"?EU(e):{top:e,right:e,bottom:e,left:e}}function zu(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 u1(e,t,n){let{reference:r,floating:o}=e;const i=vo(t),a=Qp(t),s=Jp(a),l=Br(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(ha(t)){case"start":h[a]-=f*(n&&c?-1:1);break;case"end":h[a]+=f*(n&&c?-1:1);break}return h}const PU=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}=u1(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:S,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],...S}},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}=u1(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function ol(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}=zr(t,e),p=c1(h),v=s[f?d==="floating"?"reference":"floating":d],w=zu(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)),S=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=zu(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:x,strategy:l}):b);return{top:(w.top-C.top+p.top)/S.y,bottom:(C.bottom-w.bottom+p.bottom)/S.y,left:(w.left-C.left+p.left)/S.x,right:(C.right-w.right+p.right)/S.x}}const RU=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}=zr(e,t)||{};if(c==null)return{};const d=c1(u),f={x:n,y:r},h=Qp(o),p=Jp(h),m=await a.getDimensions(c),v=h==="y",w=v?"top":"left",b=v?"bottom":"right",x=v?"clientHeight":"clientWidth",S=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=S/2-C/2,M=R/2-m[p]/2-1,k=wo(d[w],M),O=wo(d[b],M),F=k,L=R-m[p]-O,K=R/2-m[p]/2+T,ne=Xp(F,K,L),q=!l.arrow&&ha(o)!=null&&K!==ne&&i.reference[p]/2-(K<F?k:O)-m[p]/2<0,X=q?K<F?K-F:K-L:0;return{[h]:f[h]+X,data:{[h]:ne,centerOffset:K-ne-X,...q&&{alignmentOffset:X}},reset:q}}}),NU=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}=zr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Br(o),b=vo(s),x=Br(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=f||(x||!m?[Lu(s)]:_U(s)),N=p!=="none";!f&&N&&C.push(...CU(s,m,p,S));const R=[s,...C],T=await ol(t,v),M=[];let k=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&M.push(T[w]),d){const K=xU(o,a,S);M.push(T[K[0]],T[K[1]])}if(k=[...k,{placement:o,overflows:M}],!M.every(K=>K<=0)){var O,F;const K=(((O=i.flip)==null?void 0:O.index)||0)+1,ne=R[K];if(ne)return{data:{index:K,overflows:k},reset:{placement:ne}};let q=(F=k.filter(X=>X.overflows[0]<=0).sort((X,B)=>X.overflows[1]-B.overflows[1])[0])==null?void 0:F.placement;if(!q)switch(h){case"bestFit":{var L;const X=(L=k.filter(B=>{if(N){const ee=vo(B.placement);return ee===b||ee==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ee=>ee>0).reduce((ee,Z)=>ee+Z,0)]).sort((B,ee)=>B[1]-ee[1])[0])==null?void 0:L[0];X&&(q=X);break}case"initialPlacement":q=s;break}if(o!==q)return{reset:{placement:q}}}return{}}}};function d1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function f1(e){return vU.some(t=>e[t]>=0)}const TU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=zr(e,t);switch(r){case"referenceHidden":{const i=await ol(t,{...o,elementContext:"reference"}),a=d1(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:f1(a)}}}case"escaped":{const i=await ol(t,{...o,altBoundary:!0}),a=d1(i,n.floating);return{data:{escapedOffsets:a,escaped:f1(a)}}}default:return{}}}}};async function MU(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Br(n),s=ha(n),l=vo(n)==="y",c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d=zr(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 DU=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 MU(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}}}}},kU=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}=zr(e,t),c={x:n,y:r},u=await ol(t,l),d=vo(Br(o)),f=Zp(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=Xp(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=Xp(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}}}}}},OU=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}=zr(e,t),u={x:n,y:r},d=vo(o),f=Zp(d);let h=u[f],p=u[d];const m=zr(s,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const x=f==="y"?"height":"width",S=i.reference[f]-i.floating[x]+v.mainAxis,C=i.reference[f]+i.reference[x]-v.mainAxis;h<S?h=S:h>C&&(h=C)}if(c){var w,b;const x=f==="y"?"width":"height",S=["top","left"].includes(Br(o)),C=i.reference[d]-i.floating[x]+(S&&((w=a.offset)==null?void 0:w[d])||0)+(S?0:v.crossAxis),N=i.reference[d]+i.reference[x]+(S?0:((b=a.offset)==null?void 0:b[d])||0)-(S?v.crossAxis:0);p<C?p=C:p>N&&(p=N)}return{[f]:h,[d]:p}}}},AU=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}=zr(e,t),u=await ol(t,c),d=Br(o),f=ha(o),h=vo(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,S=wo(m-u[v],b),C=wo(p-u[w],x),N=!t.middlewareData.shift;let R=S,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 k=xn(u.left,0),O=xn(u.right,0),F=xn(u.top,0),L=xn(u.bottom,0);h?T=p-2*(k!==0||O!==0?k+O:xn(u.left,u.right)):R=m-2*(F!==0||L!==0?F+L:xn(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 Bu(){return typeof window<"u"}function pa(e){return h1(e)?(e.nodeName||"").toLowerCase():"#document"}function _n(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yr(e){var t;return(t=(h1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function h1(e){return Bu()?e instanceof Node||e instanceof _n(e).Node:!1}function Wn(e){return Bu()?e instanceof Element||e instanceof _n(e).Element:!1}function br(e){return Bu()?e instanceof HTMLElement||e instanceof _n(e).HTMLElement:!1}function p1(e){return!Bu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _n(e).ShadowRoot}function il(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Gn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function IU(e){return["table","td","th"].includes(pa(e))}function Hu(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function tm(e){const t=nm(),n=Wn(e)?Gn(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 jU(e){let t=yo(e);for(;br(t)&&!ma(t);){if(tm(t))return t;if(Hu(t))return null;t=yo(t)}return null}function nm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ma(e){return["html","body","#document"].includes(pa(e))}function Gn(e){return _n(e).getComputedStyle(e)}function Uu(e){return Wn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yo(e){if(pa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||p1(e)&&e.host||yr(e);return p1(t)?t.host:t}function m1(e){const t=yo(e);return ma(t)?e.ownerDocument?e.ownerDocument.body:e.body:br(t)&&il(t)?t:m1(t)}function al(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=m1(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=_n(o);if(i){const s=rm(a);return t.concat(a,a.visualViewport||[],il(o)?o:[],s&&n?al(s):[])}return t.concat(o,al(o,[],n))}function rm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function g1(e){const t=Gn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=br(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=$u(n)!==i||$u(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function om(e){return Wn(e)?e:e.contextElement}function ga(e){const t=om(e);if(!br(t))return vr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=g1(t);let a=(i?$u(n.width):n.width)/r,s=(i?$u(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const $U=vr(0);function w1(e){const t=_n(e);return!nm()||!t.visualViewport?$U:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function FU(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_n(e)?!1:t}function Qo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=om(e);let a=vr(1);t&&(r?Wn(r)&&(a=ga(r)):a=ga(e));const s=FU(i,n,r)?w1(i):vr(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=_n(i),h=r&&Wn(r)?_n(r):r;let p=f,m=rm(p);for(;m&&r&&h!==p;){const v=ga(m),w=m.getBoundingClientRect(),b=Gn(m),x=w.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,S=w.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=x,c+=S,p=_n(m),m=rm(p)}}return zu({width:u,height:d,x:l,y:c})}function im(e,t){const n=Uu(e).scrollLeft;return t?t.left+n:Qo(yr(e)).left+n}function v1(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:im(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function LU(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=yr(r),s=t?Hu(t.floating):!1;if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=vr(1);const u=vr(0),d=br(r);if((d||!d&&!i)&&((pa(r)!=="body"||il(a))&&(l=Uu(r)),br(r))){const h=Qo(r);c=ga(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=a&&!d&&!i?v1(a,l,!0):vr(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 zU(e){return Array.from(e.getClientRects())}function BU(e){const t=yr(e),n=Uu(e),r=e.ownerDocument.body,o=xn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=xn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+im(e);const s=-n.scrollTop;return Gn(r).direction==="rtl"&&(a+=xn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function HU(e,t){const n=_n(e),r=yr(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=nm();(!c||c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}function UU(e,t){const n=Qo(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=br(e)?ga(e):vr(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 y1(e,t,n){let r;if(t==="viewport")r=HU(e,n);else if(t==="document")r=BU(yr(e));else if(Wn(t))r=UU(t,n);else{const o=w1(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return zu(r)}function b1(e,t){const n=yo(e);return n===t||!Wn(n)||ma(n)?!1:Gn(n).position==="fixed"||b1(n,t)}function VU(e,t){const n=t.get(e);if(n)return n;let r=al(e,[],!1).filter(s=>Wn(s)&&pa(s)!=="body"),o=null;const i=Gn(e).position==="fixed";let a=i?yo(e):e;for(;Wn(a)&&!ma(a);){const s=Gn(a),l=tm(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||il(a)&&!l&&b1(e,a))?r=r.filter(u=>u!==a):o=s,a=yo(a)}return t.set(e,r),r}function WU(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Hu(t)?[]:VU(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const d=y1(t,u,o);return c.top=xn(d.top,c.top),c.right=wo(d.right,c.right),c.bottom=wo(d.bottom,c.bottom),c.left=xn(d.left,c.left),c},y1(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function GU(e){const{width:t,height:n}=g1(e);return{width:t,height:n}}function qU(e,t,n){const r=br(t),o=yr(t),i=n==="fixed",a=Qo(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=vr(0);if(r||!r&&!i)if((pa(t)!=="body"||il(o))&&(s=Uu(t)),r){const f=Qo(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&(l.x=im(o));const c=o&&!r&&!i?v1(o,s):vr(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 am(e){return Gn(e).position==="static"}function x1(e,t){if(!br(e)||Gn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return yr(e)===n&&(n=n.ownerDocument.body),n}function _1(e,t){const n=_n(e);if(Hu(e))return n;if(!br(e)){let o=yo(e);for(;o&&!ma(o);){if(Wn(o)&&!am(o))return o;o=yo(o)}return n}let r=x1(e,t);for(;r&&IU(r)&&am(r);)r=x1(r,t);return r&&ma(r)&&am(r)&&!tm(r)?n:r||jU(e)||n}const YU=async function(e){const t=this.getOffsetParent||_1,n=this.getDimensions,r=await n(e.floating);return{reference:qU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function KU(e){return Gn(e).direction==="rtl"}const XU={convertOffsetParentRelativeRectToViewportRelativeRect:LU,getDocumentElement:yr,getClippingRect:WU,getOffsetParent:_1,getElementRects:YU,getClientRects:zU,getDimensions:GU,getScale:ga,isElement:Wn,isRTL:KU};function S1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ZU(e,t){let n=null,r;const o=yr(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=Fu(d),m=Fu(o.clientWidth-(u+f)),v=Fu(o.clientHeight-(d+h)),w=Fu(u),x={rootMargin:-p+"px "+-m+"px "+-v+"px "+-w+"px",threshold:xn(0,wo(1,l))||1};let S=!0;function C(N){const R=N[0].intersectionRatio;if(R!==l){if(!S)return a();R?a(!1,R):r=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!S1(c,e.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return a(!0),i}function JU(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=om(e),u=o||i?[...c?al(c):[],...al(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const d=c&&s?ZU(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?Qo(e):null;l&&v();function v(){const w=Qo(e);m&&!S1(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 QU=DU,eV=kU,tV=NU,nV=AU,rV=TU,C1=RU,oV=OU,iV=(e,t,n)=>{const r=new Map,o={platform:XU,...n},i={...o.platform,_c:r};return PU(e,t,{...o,platform:i})};var Vu=typeof document<"u"?E.useLayoutEffect:E.useEffect;function Wu(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(!Wu(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)&&!Wu(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function E1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function P1(e,t){const n=E1(e);return Math.round(t*n)/n}function sm(e){const t=y.useRef(e);return Vu(()=>{t.current=e}),t}function aV(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);Wu(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))},[]),S=i||p,C=a||v,N=y.useRef(null),R=y.useRef(null),T=y.useRef(u),M=l!=null,k=sm(l),O=sm(o),F=sm(c),L=y.useCallback(()=>{if(!N.current||!R.current)return;const B={placement:t,strategy:n,middleware:f};O.current&&(B.platform=O.current),iV(N.current,R.current,B).then(ee=>{const Z={...ee,isPositioned:F.current!==!1};K.current&&!Wu(T.current,Z)&&(T.current=Z,Jl.flushSync(()=>{d(Z)}))})},[f,t,n,O,F]);Vu(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(B=>({...B,isPositioned:!1})))},[c]);const K=y.useRef(!1);Vu(()=>(K.current=!0,()=>{K.current=!1}),[]),Vu(()=>{if(S&&(N.current=S),C&&(R.current=C),S&&C){if(k.current)return k.current(S,C,L);L()}},[S,C,L,k,M]);const ne=y.useMemo(()=>({reference:N,floating:R,setReference:b,setFloating:x}),[b,x]),q=y.useMemo(()=>({reference:S,floating:C}),[S,C]),X=y.useMemo(()=>{const B={position:n,left:0,top:0};if(!q.floating)return B;const ee=P1(q.floating,u.x),Z=P1(q.floating,u.y);return s?{...B,transform:"translate("+ee+"px, "+Z+"px)",...E1(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:Z}},[n,s,q.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:L,refs:ne,elements:q,floatingStyles:X}),[u,L,ne,q,X])}const sV=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?C1({element:r.current,padding:o}).fn(n):{}:r?C1({element:r,padding:o}).fn(n):{}}}},lV=(e,t)=>({...QU(e),options:[e,t]}),cV=(e,t)=>({...eV(e),options:[e,t]}),uV=(e,t)=>({...oV(e),options:[e,t]}),dV=(e,t)=>({...tV(e),options:[e,t]}),fV=(e,t)=>({...nV(e),options:[e,t]}),hV=(e,t)=>({...rV(e),options:[e,t]}),pV=(e,t)=>({...sV(e),options:[e,t]});var mV="Arrow",R1=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return g.jsx(he.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"})})});R1.displayName=mV;var gV=R1,lm="Popper",[N1,xr]=at(lm),[wV,T1]=N1(lm),M1=e=>{const{__scopePopper:t,children:n}=e,[r,o]=y.useState(null);return g.jsx(wV,{scope:t,anchor:r,onAnchorChange:o,children:n})};M1.displayName=lm;var D1="PopperAnchor",k1=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=T1(D1,n),a=y.useRef(null),s=Se(t,a);return y.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:g.jsx(he.div,{...o,ref:s})});k1.displayName=D1;var cm="PopperContent",[vV,yV]=N1(cm),O1=y.forwardRef((e,t)=>{var G,$,te,ie,re,z;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=T1(cm,n),[w,b]=y.useState(null),x=Se(t,se=>b(se)),[S,C]=y.useState(null),N=rl(S),R=(N==null?void 0:N.width)??0,T=(N==null?void 0:N.height)??0,M=r+(i!=="center"?"-"+i:""),k=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(c)?c:[c],F=O.length>0,L={padding:k,boundary:O.filter(xV),altBoundary:F},{refs:K,floatingStyles:ne,placement:q,isPositioned:X,middlewareData:B}=aV({strategy:"fixed",placement:M,whileElementsMounted:(...se)=>JU(...se,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[lV({mainAxis:o+T,alignmentAxis:a}),l&&cV({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?uV():void 0,...L}),l&&dV({...L}),fV({...L,apply:({elements:se,rects:oe,availableWidth:fe,availableHeight:ge})=>{const{width:pe,height:me}=oe.reference,_e=se.floating.style;_e.setProperty("--radix-popper-available-width",`${fe}px`),_e.setProperty("--radix-popper-available-height",`${ge}px`),_e.setProperty("--radix-popper-anchor-width",`${pe}px`),_e.setProperty("--radix-popper-anchor-height",`${me}px`)}}),S&&pV({element:S,padding:s}),_V({arrowWidth:R,arrowHeight:T}),f&&hV({strategy:"referenceHidden",...L})]}),[ee,Z]=j1(q),J=et(p);vt(()=>{X&&(J==null||J())},[X,J]);const H=(G=B.arrow)==null?void 0:G.x,I=($=B.arrow)==null?void 0:$.y,V=((te=B.arrow)==null?void 0:te.centerOffset)!==0,[ae,j]=y.useState();return vt(()=>{w&&j(window.getComputedStyle(w).zIndex)},[w]),g.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:X?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(ie=B.transformOrigin)==null?void 0:ie.x,(re=B.transformOrigin)==null?void 0:re.y].join(" "),...((z=B.hide)==null?void 0:z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(vV,{scope:n,placedSide:ee,onArrowChange:C,arrowX:H,arrowY:I,shouldHideArrow:V,children:g.jsx(he.div,{"data-side":ee,"data-align":Z,...m,ref:x,style:{...m.style,animation:X?void 0:"none"}})})})});O1.displayName=cm;var A1="PopperArrow",bV={top:"bottom",right:"left",bottom:"top",left:"right"},I1=y.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=yV(A1,r),a=bV[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(gV,{...o,ref:n,style:{...o.style,display:"block"}})})});I1.displayName=A1;function xV(e){return e!==null}var _V=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]=j1(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 j1(e){const[t,n="center"]=e.split("-");return[t,n]}var wa=M1,va=k1,sl=O1,ll=I1,um="rovingFocusGroup.onEntryFocus",SV={bubbles:!1,cancelable:!0},Gu="RovingFocusGroup",[dm,$1,CV]=ho(Gu),[EV,_r]=at(Gu,[CV]),[PV,RV]=EV(Gu),F1=y.forwardRef((e,t)=>g.jsx(dm.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(dm.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(NV,{...e,ref:t})})}));F1.displayName=Gu;var NV=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=Se(t,f),p=Un(i),[m=null,v]=lt({prop:a,defaultProp:s,onChange:l}),[w,b]=y.useState(!1),x=et(c),S=$1(n),C=y.useRef(!1),[N,R]=y.useState(0);return y.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(um,x),()=>T.removeEventListener(um,x)},[x]),g.jsx(PV,{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(he.div,{tabIndex:w||N===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:le(e.onMouseDown,()=>{C.current=!0}),onFocus:le(e.onFocus,T=>{const M=!C.current;if(T.target===T.currentTarget&&M&&!w){const k=new CustomEvent(um,SV);if(T.currentTarget.dispatchEvent(k),!k.defaultPrevented){const O=S().filter(q=>q.focusable),F=O.find(q=>q.active),L=O.find(q=>q.id===m),ne=[F,L,...O].filter(Boolean).map(q=>q.ref.current);B1(ne,u)}}C.current=!1}),onBlur:le(e.onBlur,()=>b(!1))})})}),L1="RovingFocusGroupItem",z1=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...a}=e,s=_t(),l=i||s,c=RV(L1,n),u=c.currentTabStopId===l,d=$1(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=c;return y.useEffect(()=>{if(r)return f(),()=>h()},[r,f,h]),g.jsx(dm.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:g.jsx(he.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:le(e.onMouseDown,p=>{r?c.onItemFocus(l):p.preventDefault()}),onFocus:le(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:le(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const m=DV(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?kV(w,b+1):w.slice(b+1)}setTimeout(()=>B1(w))}})})})});z1.displayName=L1;var TV={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function MV(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function DV(e,t,n){const r=MV(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return TV[r]}function B1(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function kV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var cl=F1,ul=z1,fm=["Enter"," "],OV=["ArrowDown","PageUp","Home"],H1=["ArrowUp","PageDown","End"],AV=[...OV,...H1],IV={ltr:[...fm,"ArrowRight"],rtl:[...fm,"ArrowLeft"]},jV={ltr:["ArrowLeft"],rtl:["ArrowRight"]},dl="Menu",[fl,$V,FV]=ho(dl),[ei,hl]=at(dl,[FV,xr,_r]),pl=xr(),U1=_r(),[V1,bo]=ei(dl),[LV,ml]=ei(dl),W1=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=e,s=pl(t),[l,c]=y.useState(null),u=y.useRef(!1),d=et(i),f=Un(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(wa,{...s,children:g.jsx(V1,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:g.jsx(LV,{scope:t,onClose:y.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:a,children:r})})})};W1.displayName=dl;var zV="MenuAnchor",hm=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=pl(n);return g.jsx(va,{...o,...r,ref:t})});hm.displayName=zV;var pm="MenuPortal",[BV,G1]=ei(pm,{forceMount:void 0}),q1=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=bo(pm,t);return g.jsx(BV,{scope:t,forceMount:n,children:g.jsx(ht,{present:n||i.open,children:g.jsx(Js,{asChild:!0,container:o,children:r})})})};q1.displayName=pm;var On="MenuContent",[HV,mm]=ei(On),Y1=y.forwardRef((e,t)=>{const n=G1(On,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=bo(On,e.__scopeMenu),a=ml(On,e.__scopeMenu);return g.jsx(fl.Provider,{scope:e.__scopeMenu,children:g.jsx(ht,{present:r||i.open,children:g.jsx(fl.Slot,{scope:e.__scopeMenu,children:a.modal?g.jsx(UV,{...o,ref:t}):g.jsx(VV,{...o,ref:t})})})})}),UV=y.forwardRef((e,t)=>{const n=bo(On,e.__scopeMenu),r=y.useRef(null),o=Se(t,r);return y.useEffect(()=>{const i=r.current;if(i)return nl(i)},[]),g.jsx(gm,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:le(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),VV=y.forwardRef((e,t)=>{const n=bo(On,e.__scopeMenu);return g.jsx(gm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),gm=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=bo(On,n),w=ml(On,n),b=pl(n),x=U1(n),S=$V(n),[C,N]=y.useState(null),R=y.useRef(null),T=Se(t,R,v.onContentChange),M=y.useRef(0),k=y.useRef(""),O=y.useRef(0),F=y.useRef(null),L=y.useRef("right"),K=y.useRef(0),ne=p?tl:y.Fragment,q=p?{as:Hn,allowPinchZoom:!0}:void 0,X=ee=>{var G,$;const Z=k.current+ee,J=S().filter(te=>!te.disabled),H=document.activeElement,I=(G=J.find(te=>te.ref.current===H))==null?void 0:G.textValue,V=J.map(te=>te.textValue),ae=nW(V,Z,I),j=($=J.find(te=>te.textValue===ae))==null?void 0:$.ref.current;(function te(ie){k.current=ie,window.clearTimeout(M.current),ie!==""&&(M.current=window.setTimeout(()=>te(""),1e3))})(Z),j&&setTimeout(()=>j.focus())};y.useEffect(()=>()=>window.clearTimeout(M.current),[]),Ru();const B=y.useCallback(ee=>{var J,H;return L.current===((J=F.current)==null?void 0:J.side)&&oW(ee,(H=F.current)==null?void 0:H.area)},[]);return g.jsx(HV,{scope:n,searchRef:k,onItemEnter:y.useCallback(ee=>{B(ee)&&ee.preventDefault()},[B]),onItemLeave:y.useCallback(ee=>{var Z;B(ee)||((Z=R.current)==null||Z.focus(),N(null))},[B]),onTriggerLeave:y.useCallback(ee=>{B(ee)&&ee.preventDefault()},[B]),pointerGraceTimerRef:O,onPointerGraceIntentChange:y.useCallback(ee=>{F.current=ee},[]),children:g.jsx(ne,{...q,children:g.jsx(Zs,{asChild:!0,trapped:o,onMountAutoFocus:le(i,ee=>{var Z;ee.preventDefault(),(Z=R.current)==null||Z.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:g.jsx(po,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:g.jsx(cl,{asChild:!0,...x,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:N,onEntryFocus:le(l,ee=>{w.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(sl,{role:"menu","aria-orientation":"vertical","data-state":fC(v.open),"data-radix-menu-content":"",dir:w.dir,...b,...m,ref:T,style:{outline:"none",...m.style},onKeyDown:le(m.onKeyDown,ee=>{const J=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,H=ee.ctrlKey||ee.altKey||ee.metaKey,I=ee.key.length===1;J&&(ee.key==="Tab"&&ee.preventDefault(),!H&&I&&X(ee.key));const V=R.current;if(ee.target!==V||!AV.includes(ee.key))return;ee.preventDefault();const j=S().filter(G=>!G.disabled).map(G=>G.ref.current);H1.includes(ee.key)&&j.reverse(),eW(j)}),onBlur:le(e.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(M.current),k.current="")}),onPointerMove:le(e.onPointerMove,wl(ee=>{const Z=ee.target,J=K.current!==ee.clientX;if(ee.currentTarget.contains(Z)&&J){const H=ee.clientX>K.current?"right":"left";L.current=H,K.current=ee.clientX}}))})})})})})})});Y1.displayName=On;var WV="MenuGroup",wm=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(he.div,{role:"group",...r,ref:t})});wm.displayName=WV;var GV="MenuLabel",K1=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(he.div,{...r,ref:t})});K1.displayName=GV;var qu="MenuItem",X1="menu.itemSelect",Yu=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=y.useRef(null),a=ml(qu,e.__scopeMenu),s=mm(qu,e.__scopeMenu),l=Se(t,i),c=y.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const f=new CustomEvent(X1,{bubbles:!0,cancelable:!0});d.addEventListener(X1,h=>r==null?void 0:r(h),{once:!0}),_u(d,f),f.defaultPrevented?c.current=!1:a.onClose()}};return g.jsx(Z1,{...o,ref:l,disabled:n,onClick:le(e.onClick,u),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),c.current=!0},onPointerUp:le(e.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:le(e.onKeyDown,d=>{const f=s.searchRef.current!=="";n||f&&d.key===" "||fm.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Yu.displayName=qu;var Z1=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,a=mm(qu,n),s=U1(n),l=y.useRef(null),c=Se(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(fl.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:g.jsx(ul,{asChild:!0,...s,focusable:!r,children:g.jsx(he.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:le(e.onPointerMove,wl(p=>{r?a.onItemLeave(p):(a.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:le(e.onPointerLeave,wl(p=>a.onItemLeave(p))),onFocus:le(e.onFocus,()=>d(!0)),onBlur:le(e.onBlur,()=>d(!1))})})})}),qV="MenuCheckboxItem",J1=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return g.jsx(rC,{scope:e.__scopeMenu,checked:n,children:g.jsx(Yu,{role:"menuitemcheckbox","aria-checked":Ku(n)?"mixed":n,...o,ref:t,"data-state":bm(n),onSelect:le(o.onSelect,()=>r==null?void 0:r(Ku(n)?!0:!n),{checkForDefaultPrevented:!1})})})});J1.displayName=qV;var Q1="MenuRadioGroup",[YV,KV]=ei(Q1,{value:void 0,onValueChange:()=>{}}),eC=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=et(r);return g.jsx(YV,{scope:e.__scopeMenu,value:n,onValueChange:i,children:g.jsx(wm,{...o,ref:t})})});eC.displayName=Q1;var tC="MenuRadioItem",nC=y.forwardRef((e,t)=>{const{value:n,...r}=e,o=KV(tC,e.__scopeMenu),i=n===o.value;return g.jsx(rC,{scope:e.__scopeMenu,checked:i,children:g.jsx(Yu,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":bm(i),onSelect:le(r.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})})});nC.displayName=tC;var vm="MenuItemIndicator",[rC,XV]=ei(vm,{checked:!1}),oC=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=XV(vm,n);return g.jsx(ht,{present:r||Ku(i.checked)||i.checked===!0,children:g.jsx(he.span,{...o,ref:t,"data-state":bm(i.checked)})})});oC.displayName=vm;var ZV="MenuSeparator",iC=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(he.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});iC.displayName=ZV;var JV="MenuArrow",aC=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=pl(n);return g.jsx(ll,{...o,...r,ref:t})});aC.displayName=JV;var ym="MenuSub",[QV,sC]=ei(ym),lC=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,i=bo(ym,t),a=pl(t),[s,l]=y.useState(null),[c,u]=y.useState(null),d=et(o);return y.useEffect(()=>(i.open===!1&&d(!1),()=>d(!1)),[i.open,d]),g.jsx(wa,{...a,children:g.jsx(V1,{scope:t,open:r,onOpenChange:d,content:c,onContentChange:u,children:g.jsx(QV,{scope:t,contentId:_t(),triggerId:_t(),trigger:s,onTriggerChange:l,children:n})})})};lC.displayName=ym;var gl="MenuSubTrigger",cC=y.forwardRef((e,t)=>{const n=bo(gl,e.__scopeMenu),r=ml(gl,e.__scopeMenu),o=sC(gl,e.__scopeMenu),i=mm(gl,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(hm,{asChild:!0,...c,children:g.jsx(Z1,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":fC(n.open),...e,ref:Xs(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:le(e.onPointerMove,wl(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:le(e.onPointerLeave,wl(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:le(e.onKeyDown,d=>{var h;const f=i.searchRef.current!=="";e.disabled||f&&d.key===" "||IV[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});cC.displayName=gl;var uC="MenuSubContent",dC=y.forwardRef((e,t)=>{const n=G1(On,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=bo(On,e.__scopeMenu),a=ml(On,e.__scopeMenu),s=sC(uC,e.__scopeMenu),l=y.useRef(null),c=Se(t,l);return g.jsx(fl.Provider,{scope:e.__scopeMenu,children:g.jsx(ht,{present:r||i.open,children:g.jsx(fl.Slot,{scope:e.__scopeMenu,children:g.jsx(gm,{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:le(e.onFocusOutside,u=>{u.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:le(e.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:le(e.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),f=jV[a.dir].includes(u.key);d&&f&&(i.onOpenChange(!1),(h=s.trigger)==null||h.focus(),u.preventDefault())})})})})})});dC.displayName=uC;function fC(e){return e?"open":"closed"}function Ku(e){return e==="indeterminate"}function bm(e){return Ku(e)?"indeterminate":e?"checked":"unchecked"}function eW(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function tW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function nW(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=tW(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 rW(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 oW(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return rW(n,t)}function wl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var xm=W1,_m=hm,Sm=q1,Cm=Y1,Em=wm,Pm=K1,Rm=Yu,Nm=J1,Tm=eC,Mm=nC,Dm=oC,km=iC,Om=aC,Am=lC,Im=cC,jm=dC,$m="ContextMenu",[iW,sne]=at($m,[hl]),Lt=hl(),[aW,hC]=iW($m),pC=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:i=!0}=e,[a,s]=y.useState(!1),l=Lt(t),c=et(r),u=y.useCallback(d=>{s(d),c(d)},[c]);return g.jsx(aW,{scope:t,open:a,onOpenChange:u,modal:i,children:g.jsx(xm,{...l,dir:o,open:a,onOpenChange:u,modal:i,children:n})})};pC.displayName=$m;var mC="ContextMenuTrigger",gC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=e,i=hC(mC,n),a=Lt(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(_m,{...a,virtualRef:l}),g.jsx(he.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:le(e.onContextMenu,f=>{u(),d(f),f.preventDefault()}),onPointerDown:r?e.onPointerDown:le(e.onPointerDown,Xu(f=>{u(),c.current=window.setTimeout(()=>d(f),700)})),onPointerMove:r?e.onPointerMove:le(e.onPointerMove,Xu(u)),onPointerCancel:r?e.onPointerCancel:le(e.onPointerCancel,Xu(u)),onPointerUp:r?e.onPointerUp:le(e.onPointerUp,Xu(u))})]})});gC.displayName=mC;var sW="ContextMenuPortal",wC=e=>{const{__scopeContextMenu:t,...n}=e,r=Lt(t);return g.jsx(Sm,{...r,...n})};wC.displayName=sW;var vC="ContextMenuContent",yC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=hC(vC,n),i=Lt(n),a=y.useRef(!1);return g.jsx(Cm,{...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)"}})});yC.displayName=vC;var lW="ContextMenuGroup",bC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Lt(n);return g.jsx(Em,{...o,...r,ref:t})});bC.displayName=lW;var cW="ContextMenuLabel",xC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Lt(n);return g.jsx(Pm,{...o,...r,ref:t})});xC.displayName=cW;var uW="ContextMenuItem",_C=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Lt(n);return g.jsx(Rm,{...o,...r,ref:t})});_C.displayName=uW;var dW="ContextMenuCheckboxItem",SC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Lt(n);return g.jsx(Nm,{...o,...r,ref:t})});SC.displayName=dW;var fW="ContextMenuRadioGroup",CC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Lt(n);return g.jsx(Tm,{...o,...r,ref:t})});CC.displayName=fW;var hW="ContextMenuRadioItem",EC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Lt(n);return g.jsx(Mm,{...o,...r,ref:t})});EC.displayName=hW;var pW="ContextMenuItemIndicator",PC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Lt(n);return g.jsx(Dm,{...o,...r,ref:t})});PC.displayName=pW;var mW="ContextMenuSeparator",RC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Lt(n);return g.jsx(km,{...o,...r,ref:t})});RC.displayName=mW;var gW="ContextMenuArrow",wW=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Lt(n);return g.jsx(Om,{...o,...r,ref:t})});wW.displayName=gW;var vW="ContextMenuSub",NC=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:o,defaultOpen:i}=e,a=Lt(t),[s,l]=lt({prop:o,defaultProp:i,onChange:r});return g.jsx(Am,{...a,open:s,onOpenChange:l,children:n})};NC.displayName=vW;var yW="ContextMenuSubTrigger",TC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Lt(n);return g.jsx(Im,{...o,...r,ref:t})});TC.displayName=yW;var bW="ContextMenuSubContent",MC=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Lt(n);return g.jsx(jm,{...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)"}})});MC.displayName=bW;function Xu(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var xW=pC,_W=gC,DC=wC,kC=yC,SW=bC,OC=xC,AC=_C,IC=SC,CW=CC,jC=EC,$C=PC,FC=RC,EW=NC,LC=TC,zC=MC,Fm="DropdownMenu",[PW,lne]=at(Fm,[hl]),zt=hl(),[RW,BC]=PW(Fm),HC=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,l=zt(t),c=y.useRef(null),[u=!1,d]=lt({prop:o,defaultProp:i,onChange:a});return g.jsx(RW,{scope:t,triggerId:_t(),triggerRef:c,contentId:_t(),open:u,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(f=>!f),[d]),modal:s,children:g.jsx(xm,{...l,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};HC.displayName=Fm;var UC="DropdownMenuTrigger",VC=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=BC(UC,n),a=zt(n);return g.jsx(_m,{asChild:!0,...a,children:g.jsx(he.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:Xs(t,i.triggerRef),onPointerDown:le(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:le(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});VC.displayName=UC;var NW="DropdownMenuPortal",WC=e=>{const{__scopeDropdownMenu:t,...n}=e,r=zt(t);return g.jsx(Sm,{...r,...n})};WC.displayName=NW;var GC="DropdownMenuContent",qC=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=BC(GC,n),i=zt(n),a=y.useRef(!1);return g.jsx(Cm,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:le(e.onCloseAutoFocus,s=>{var l;a.current||(l=o.triggerRef.current)==null||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:le(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)"}})});qC.displayName=GC;var TW="DropdownMenuGroup",YC=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zt(n);return g.jsx(Em,{...o,...r,ref:t})});YC.displayName=TW;var MW="DropdownMenuLabel",KC=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zt(n);return g.jsx(Pm,{...o,...r,ref:t})});KC.displayName=MW;var DW="DropdownMenuItem",XC=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zt(n);return g.jsx(Rm,{...o,...r,ref:t})});XC.displayName=DW;var kW="DropdownMenuCheckboxItem",ZC=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zt(n);return g.jsx(Nm,{...o,...r,ref:t})});ZC.displayName=kW;var OW="DropdownMenuRadioGroup",JC=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zt(n);return g.jsx(Tm,{...o,...r,ref:t})});JC.displayName=OW;var AW="DropdownMenuRadioItem",QC=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zt(n);return g.jsx(Mm,{...o,...r,ref:t})});QC.displayName=AW;var IW="DropdownMenuItemIndicator",eE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zt(n);return g.jsx(Dm,{...o,...r,ref:t})});eE.displayName=IW;var jW="DropdownMenuSeparator",tE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zt(n);return g.jsx(km,{...o,...r,ref:t})});tE.displayName=jW;var $W="DropdownMenuArrow",FW=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zt(n);return g.jsx(Om,{...o,...r,ref:t})});FW.displayName=$W;var LW=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,a=zt(t),[s=!1,l]=lt({prop:r,defaultProp:i,onChange:o});return g.jsx(Am,{...a,open:s,onOpenChange:l,children:n})},zW="DropdownMenuSubTrigger",nE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zt(n);return g.jsx(Im,{...o,...r,ref:t})});nE.displayName=zW;var BW="DropdownMenuSubContent",rE=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zt(n);return g.jsx(jm,{...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)"}})});rE.displayName=BW;var HW=HC,UW=VC,oE=WC,iE=qC,VW=YC,aE=KC,sE=XC,lE=ZC,WW=JC,cE=QC,uE=eE,dE=tE,GW=LW,fE=nE,hE=rE,qW="Label",pE=y.forwardRef((e,t)=>g.jsx(he.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())}}));pE.displayName=qW;var mE=pE,Lm,zm="HoverCard",[gE,cne]=at(zm,[xr]),Zu=xr(),[YW,Bm]=gE(zm),wE=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:a=700,closeDelay:s=300}=e,l=Zu(t),c=y.useRef(0),u=y.useRef(0),d=y.useRef(!1),f=y.useRef(!1),[h=!1,p]=lt({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(YW,{scope:t,open:h,onOpenChange:p,onOpen:m,onClose:v,onDismiss:w,hasSelectionRef:d,isPointerDownOnContentRef:f,children:g.jsx(wa,{...l,children:n})})};wE.displayName=zm;var vE="HoverCardTrigger",yE=y.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Bm(vE,n),i=Zu(n);return g.jsx(va,{asChild:!0,...i,children:g.jsx(he.a,{"data-state":o.open?"open":"closed",...r,ref:t,onPointerEnter:le(e.onPointerEnter,Qu(o.onOpen)),onPointerLeave:le(e.onPointerLeave,Qu(o.onClose)),onFocus:le(e.onFocus,o.onOpen),onBlur:le(e.onBlur,o.onClose),onTouchStart:le(e.onTouchStart,a=>a.preventDefault())})})});yE.displayName=vE;var KW="HoverCardPortal",[une,XW]=gE(KW,{forceMount:void 0}),Ju="HoverCardContent",bE=y.forwardRef((e,t)=>{const n=XW(Ju,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=Bm(Ju,e.__scopeHoverCard);return g.jsx(ht,{present:r||i.open,children:g.jsx(ZW,{"data-state":i.open?"open":"closed",...o,onPointerEnter:le(e.onPointerEnter,Qu(i.onOpen)),onPointerLeave:le(e.onPointerLeave,Qu(i.onClose)),ref:t})})});bE.displayName=Ju;var ZW=y.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,...s}=e,l=Bm(Ju,n),c=Zu(n),u=y.useRef(null),d=Se(t,u),[f,h]=y.useState(!1);return y.useEffect(()=>{if(f){const p=document.body;return Lm=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=Lm,p.style.webkitUserSelect=Lm}}},[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&&eG(u.current).forEach(m=>m.setAttribute("tabindex","-1"))}),g.jsx(po,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:le(i,p=>{p.preventDefault()}),onDismiss:l.onDismiss,children:g.jsx(sl,{...c,...s,onPointerDown:le(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)"}})})}),JW="HoverCardArrow",QW=y.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Zu(n);return g.jsx(ll,{...o,...r,ref:t})});QW.displayName=JW;function Qu(e){return t=>t.pointerType==="touch"?void 0:e()}function eG(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 tG=wE,nG=yE,xE=bE,ed="Menubar",[Hm,rG,oG]=ho(ed),[_E,dne]=at(ed,[oG,_r]),Bt=hl(),SE=_r(),[iG,Um]=_E(ed),CE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,value:r,onValueChange:o,defaultValue:i,loop:a=!0,dir:s,...l}=e,c=Un(s),u=SE(n),[d="",f]=lt({prop:r,onChange:o,defaultProp:i}),[h,p]=y.useState(null);return g.jsx(iG,{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(Hm.Provider,{scope:n,children:g.jsx(Hm.Slot,{scope:n,children:g.jsx(cl,{asChild:!0,...u,orientation:"horizontal",loop:a,dir:c,currentTabStopId:h,onCurrentTabStopIdChange:p,children:g.jsx(he.div,{role:"menubar",...l,ref:t})})})})})});CE.displayName=ed;var Vm="MenubarMenu",[aG,EE]=_E(Vm),PE=e=>{const{__scopeMenubar:t,value:n,...r}=e,o=_t(),i=n||o||"LEGACY_REACT_AUTO_VALUE",a=Um(Vm,t),s=Bt(t),l=y.useRef(null),c=y.useRef(!1),u=a.value===i;return y.useEffect(()=>{u||(c.current=!1)},[u]),g.jsx(aG,{scope:t,value:i,triggerId:_t(),triggerRef:l,contentId:_t(),wasKeyboardTriggerOpenRef:c,children:g.jsx(xm,{...s,open:u,onOpenChange:d=>{d||a.onMenuClose()},modal:!1,dir:a.dir,...r})})};PE.displayName=Vm;var Wm="MenubarTrigger",RE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,disabled:r=!1,...o}=e,i=SE(n),a=Bt(n),s=Um(Wm,n),l=EE(Wm,n),c=y.useRef(null),u=Se(t,c,l.triggerRef),[d,f]=y.useState(!1),h=s.value===l.value;return g.jsx(Hm.ItemSlot,{scope:n,value:l.value,disabled:r,children:g.jsx(ul,{asChild:!0,...i,focusable:!r,tabStopId:l.value,children:g.jsx(_m,{asChild:!0,...a,children:g.jsx(he.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:le(e.onPointerDown,p=>{!r&&p.button===0&&p.ctrlKey===!1&&(s.onMenuOpen(l.value),h||p.preventDefault())}),onPointerEnter:le(e.onPointerEnter,()=>{var m;!!s.value&&!h&&(s.onMenuOpen(l.value),(m=c.current)==null||m.focus())}),onKeyDown:le(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:le(e.onFocus,()=>f(!0)),onBlur:le(e.onBlur,()=>f(!1))})})})})});RE.displayName=Wm;var sG="MenubarPortal",NE=e=>{const{__scopeMenubar:t,...n}=e,r=Bt(t);return g.jsx(Sm,{...r,...n})};NE.displayName=sG;var Gm="MenubarContent",TE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,align:r="start",...o}=e,i=Bt(n),a=Um(Gm,n),s=EE(Gm,n),l=rG(n),c=y.useRef(!1);return g.jsx(Cm,{id:s.contentId,"aria-labelledby":s.triggerId,"data-radix-menubar-content":"",...i,...o,ref:t,align:r,onCloseAutoFocus:le(e.onCloseAutoFocus,u=>{var f;!!!a.value&&!c.current&&((f=s.triggerRef.current)==null||f.focus()),c.current=!1,u.preventDefault()}),onFocusOutside:le(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:le(e.onInteractOutside,()=>{c.current=!0}),onEntryFocus:u=>{s.wasKeyboardTriggerOpenRef.current||u.preventDefault()},onKeyDown:le(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?xG(b,x+1):b.slice(x+1);const[S]=b;S&&a.onMenuOpen(S)}},{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)"}})});TE.displayName=Gm;var lG="MenubarGroup",ME=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Bt(n);return g.jsx(Em,{...o,...r,ref:t})});ME.displayName=lG;var cG="MenubarLabel",DE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Bt(n);return g.jsx(Pm,{...o,...r,ref:t})});DE.displayName=cG;var uG="MenubarItem",kE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Bt(n);return g.jsx(Rm,{...o,...r,ref:t})});kE.displayName=uG;var dG="MenubarCheckboxItem",OE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Bt(n);return g.jsx(Nm,{...o,...r,ref:t})});OE.displayName=dG;var fG="MenubarRadioGroup",AE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Bt(n);return g.jsx(Tm,{...o,...r,ref:t})});AE.displayName=fG;var hG="MenubarRadioItem",IE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Bt(n);return g.jsx(Mm,{...o,...r,ref:t})});IE.displayName=hG;var pG="MenubarItemIndicator",jE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Bt(n);return g.jsx(Dm,{...o,...r,ref:t})});jE.displayName=pG;var mG="MenubarSeparator",$E=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Bt(n);return g.jsx(km,{...o,...r,ref:t})});$E.displayName=mG;var gG="MenubarArrow",wG=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Bt(n);return g.jsx(Om,{...o,...r,ref:t})});wG.displayName=gG;var vG="MenubarSub",FE=e=>{const{__scopeMenubar:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,a=Bt(t),[s=!1,l]=lt({prop:r,defaultProp:i,onChange:o});return g.jsx(Am,{...a,open:s,onOpenChange:l,children:n})};FE.displayName=vG;var yG="MenubarSubTrigger",LE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Bt(n);return g.jsx(Im,{"data-radix-menubar-subtrigger":"",...o,...r,ref:t})});LE.displayName=yG;var bG="MenubarSubContent",zE=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Bt(n);return g.jsx(jm,{...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)"}})});zE.displayName=bG;function xG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var BE=CE,_G=PE,HE=RE,UE=NE,VE=TE,SG=ME,WE=DE,GE=kE,qE=OE,CG=AE,YE=IE,KE=jE,XE=$E,EG=FE,ZE=LE,JE=zE,ya="NavigationMenu",[qm,QE,PG]=ho(ya),[Ym,RG,NG]=ho(ya),[Km,fne]=at(ya,[PG,NG]),[TG,An]=Km(ya),[MG,DG]=Km(ya),eP=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=Se(t,M=>f(M)),p=Un(c),m=y.useRef(0),v=y.useRef(0),w=y.useRef(0),[b,x]=y.useState(!0),[S="",C]=lt({prop:r,onChange:M=>{const k=M!=="",O=s>0;k?(window.clearTimeout(w.current),O&&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=>{S===M?window.clearTimeout(v.current):m.current=window.setTimeout(()=>{window.clearTimeout(v.current),C(M)},a)},[S,C,a]);return y.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(v.current),window.clearTimeout(w.current)},[]),g.jsx(nP,{scope:n,isRootMenu:!0,value:S,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(k=>k===M?"":M)},onItemDismiss:()=>C(""),children:g.jsx(he.nav,{"aria-label":"Main","data-orientation":l,dir:p,...u,ref:h})})});eP.displayName=ya;var tP="NavigationMenuSub",kG=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",...s}=e,l=An(tP,n),[c="",u]=lt({prop:r,onChange:o,defaultProp:i});return g.jsx(nP,{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(he.div,{"data-orientation":a,...s,ref:t})})});kG.displayName=tP;var nP=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(TG,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:s,previousValue:fa(s),baseId:_t(),dir:o,orientation:i,viewport:p,onViewportChange:m,indicatorTrack:b,onIndicatorTrackChange:x,onTriggerEnter:et(u),onTriggerLeave:et(d),onContentEnter:et(f),onContentLeave:et(h),onItemSelect:et(l),onItemDismiss:et(c),onViewportContentChange:y.useCallback((S,C)=>{w(N=>(N.set(S,C),new Map(N)))},[]),onViewportContentRemove:y.useCallback(S=>{w(C=>C.has(S)?(C.delete(S),new Map(C)):C)},[]),children:g.jsx(qm.Provider,{scope:t,children:g.jsx(MG,{scope:t,items:v,children:a})})})},rP="NavigationMenuList",oP=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=An(rP,n),i=g.jsx(he.ul,{"data-orientation":o.orientation,...r,ref:t});return g.jsx(he.div,{style:{position:"relative"},ref:o.onIndicatorTrackChange,children:g.jsx(qm.Slot,{scope:n,children:o.isRootMenu?g.jsx(mP,{asChild:!0,children:i}):i})})});oP.displayName=rP;var iP="NavigationMenuItem",[OG,aP]=Km(iP),sP=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...o}=e,i=_t(),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=Qm(s.current);m.length&&eg(p==="start"?m:m.reverse())}},[]),h=y.useCallback(()=>{if(s.current){const p=Qm(s.current);p.length&&(u.current=zG(p))}},[]);return g.jsx(OG,{scope:n,value:a,triggerRef:l,contentRef:s,focusProxyRef:c,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:h,onContentFocusOutside:h,children:g.jsx(he.li,{...o,ref:t})})});sP.displayName=iP;var Xm="NavigationMenuTrigger",lP=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...o}=e,i=An(Xm,e.__scopeNavigationMenu),a=aP(Xm,e.__scopeNavigationMenu),s=y.useRef(null),l=Se(s,a.triggerRef,t),c=vP(i.baseId,a.value),u=yP(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(qm.ItemSlot,{scope:n,value:a.value,children:g.jsx(wP,{asChild:!0,children:g.jsx(he.button,{id:c,disabled:r,"data-disabled":r?"":void 0,"data-state":ng(h),"aria-expanded":h,"aria-controls":u,...o,ref:l,onPointerEnter:le(e.onPointerEnter,()=>{f.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:le(e.onPointerMove,nd(()=>{r||f.current||a.wasEscapeCloseRef.current||d.current||(i.onTriggerEnter(a.value),d.current=!0)})),onPointerLeave:le(e.onPointerLeave,nd(()=>{r||(i.onTriggerLeave(),d.current=!1)})),onClick:le(e.onClick,()=>{i.onItemSelect(a.value),f.current=h}),onKeyDown:le(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(E_,{"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})]})]})});lP.displayName=Xm;var AG="NavigationMenuLink",cP="navigationMenu.linkSelect",uP=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:o,...i}=e;return g.jsx(wP,{asChild:!0,children:g.jsx(he.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:t,onClick:le(e.onClick,a=>{const s=a.target,l=new CustomEvent(cP,{bubbles:!0,cancelable:!0});if(s.addEventListener(cP,c=>o==null?void 0:o(c),{once:!0}),_u(s,l),!l.defaultPrevented&&!a.metaKey){const c=new CustomEvent(td,{bubbles:!0,cancelable:!0});_u(s,c)}},{checkForDefaultPrevented:!1})})})});uP.displayName=AG;var Zm="NavigationMenuIndicator",dP=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=An(Zm,e.__scopeNavigationMenu),i=!!o.value;return o.indicatorTrack?tr.createPortal(g.jsx(ht,{present:n||i,children:g.jsx(IG,{...r,ref:t})}),o.indicatorTrack):null});dP.displayName=Zm;var IG=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=An(Zm,n),i=QE(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 tg(a,f),tg(o.indicatorTrack,f),l?g.jsx(he.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}),ba="NavigationMenuContent",fP=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=An(ba,e.__scopeNavigationMenu),i=aP(ba,e.__scopeNavigationMenu),a=Se(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(jG,{forceMount:n,...l,ref:a}):g.jsx(ht,{present:n||s,children:g.jsx(hP,{"data-state":ng(s),...l,ref:a,onPointerEnter:le(e.onPointerEnter,o.onContentEnter),onPointerLeave:le(e.onPointerLeave,nd(o.onContentLeave)),style:{pointerEvents:!s&&o.isRootMenu?"none":void 0,...l.style}})})});fP.displayName=ba;var jG=y.forwardRef((e,t)=>{const n=An(ba,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:o}=n;return vt(()=>{r(e.value,{ref:t,...e})},[e,t,r]),vt(()=>()=>o(e.value),[e.value,o]),null}),td="navigationMenu.rootContentDismiss",hP=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:o,focusProxyRef:i,wasEscapeCloseRef:a,onRootContentClose:s,onContentFocusOutside:l,...c}=e,u=An(ba,n),d=y.useRef(null),f=Se(d,t),h=vP(u.baseId,r),p=yP(u.baseId,r),m=QE(n),v=y.useRef(null),{onItemDismiss:w}=u;y.useEffect(()=>{const x=d.current;if(u.isRootMenu&&x){const S=()=>{var C;w(),s(),x.contains(document.activeElement)&&((C=o.current)==null||C.focus())};return x.addEventListener(td,S),()=>x.removeEventListener(td,S)}},[u.isRootMenu,e.value,o,w,s]);const b=y.useMemo(()=>{const S=m().map(k=>k.value);u.dir==="rtl"&&S.reverse();const C=S.indexOf(u.value),N=S.indexOf(u.previousValue),R=r===u.value,T=N===S.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(mP,{asChild:!0,children:g.jsx(po,{id:p,"aria-labelledby":h,"data-motion":b,"data-orientation":u.orientation,...c,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var S;const x=new Event(td,{bubbles:!0,cancelable:!0});(S=d.current)==null||S.dispatchEvent(x)},onFocusOutside:le(e.onFocusOutside,x=>{var C;l();const S=x.target;(C=u.rootNavigationMenu)!=null&&C.contains(S)&&x.preventDefault()}),onPointerDownOutside:le(e.onPointerDownOutside,x=>{var R;const S=x.target,C=m().some(T=>{var M;return(M=T.ref.current)==null?void 0:M.contains(S)}),N=u.isRootMenu&&((R=u.viewport)==null?void 0:R.contains(S));(C||N||!u.isRootMenu)&&x.preventDefault()}),onKeyDown:le(e.onKeyDown,x=>{var N;const S=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!S){const R=Qm(x.currentTarget),T=document.activeElement,M=R.findIndex(F=>F===T),O=x.shiftKey?R.slice(0,M).reverse():R.slice(M+1,R.length);eg(O)?x.preventDefault():(N=i.current)==null||N.focus()}}),onEscapeKeyDown:le(e.onEscapeKeyDown,x=>{a.current=!0})})})}),Jm="NavigationMenuViewport",pP=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=!!An(Jm,e.__scopeNavigationMenu).value;return g.jsx(ht,{present:n||i,children:g.jsx($G,{...r,ref:t})})});pP.displayName=Jm;var $G=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...o}=e,i=An(Jm,n),a=Se(t,i.onViewportChange),s=DG(ba,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 tg(u,()=>{u&&c({width:u.offsetWidth,height:u.offsetHeight})}),g.jsx(he.div,{"data-state":ng(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:le(e.onPointerEnter,i.onContentEnter),onPointerLeave:le(e.onPointerLeave,nd(i.onContentLeave)),children:Array.from(s.items).map(([w,{ref:b,forceMount:x,...S}])=>{const C=m===w;return g.jsx(ht,{present:x||C,children:g.jsx(hP,{...S,ref:Xs(b,N=>{C&&N&&d(N)})})},w)})})}),FG="FocusGroup",mP=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=An(FG,n);return g.jsx(Ym.Provider,{scope:n,children:g.jsx(Ym.Slot,{scope:n,children:g.jsx(he.div,{dir:o.dir,...r,ref:t})})})}),gP=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],LG="FocusGroupItem",wP=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,o=RG(n),i=An(LG,n);return g.jsx(Ym.ItemSlot,{scope:n,children:g.jsx(he.button,{...r,ref:t,onKeyDown:le(e.onKeyDown,a=>{if(["Home","End",...gP].includes(a.key)){let l=o().map(d=>d.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&l.reverse(),gP.includes(a.key)){const d=l.indexOf(a.currentTarget);l=l.slice(d+1)}setTimeout(()=>eg(l)),a.preventDefault()}})})})});function Qm(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 eg(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function zG(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 tg(e,t){const n=et(t);vt(()=>{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 ng(e){return e?"open":"closed"}function vP(e,t){return`${e}-trigger-${t}`}function yP(e,t){return`${e}-content-${t}`}function nd(e){return t=>t.pointerType==="mouse"?e(t):void 0}var bP=eP,xP=oP,BG=sP,_P=lP,HG=uP,SP=dP,CP=fP,EP=pP,rg="Popover",[PP,hne]=at(rg,[xr]),vl=xr(),[UG,xo]=PP(rg),RP=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,s=vl(t),l=y.useRef(null),[c,u]=y.useState(!1),[d=!1,f]=lt({prop:r,defaultProp:o,onChange:i});return g.jsx(wa,{...s,children:g.jsx(UG,{scope:t,contentId:_t(),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})})};RP.displayName=rg;var NP="PopoverAnchor",VG=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=xo(NP,n),i=vl(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=o;return y.useEffect(()=>(a(),()=>s()),[a,s]),g.jsx(va,{...i,...r,ref:t})});VG.displayName=NP;var TP="PopoverTrigger",MP=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=xo(TP,n),i=vl(n),a=Se(t,o.triggerRef),s=g.jsx(he.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":IP(o.open),...r,ref:a,onClick:le(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:g.jsx(va,{asChild:!0,...i,children:s})});MP.displayName=TP;var og="PopoverPortal",[WG,GG]=PP(og,{forceMount:void 0}),DP=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=xo(og,t);return g.jsx(WG,{scope:t,forceMount:n,children:g.jsx(ht,{present:n||i.open,children:g.jsx(Js,{asChild:!0,container:o,children:r})})})};DP.displayName=og;var xa="PopoverContent",kP=y.forwardRef((e,t)=>{const n=GG(xa,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=xo(xa,e.__scopePopover);return g.jsx(ht,{present:r||i.open,children:i.modal?g.jsx(qG,{...o,ref:t}):g.jsx(YG,{...o,ref:t})})});kP.displayName=xa;var qG=y.forwardRef((e,t)=>{const n=xo(xa,e.__scopePopover),r=y.useRef(null),o=Se(t,r),i=y.useRef(!1);return y.useEffect(()=>{const a=r.current;if(a)return nl(a)},[]),g.jsx(tl,{as:Hn,allowPinchZoom:!0,children:g.jsx(OP,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:le(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),i.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:le(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:le(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),YG=y.forwardRef((e,t)=>{const n=xo(xa,e.__scopePopover),r=y.useRef(!1),o=y.useRef(!1);return g.jsx(OP,{...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()}})}),OP=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=xo(xa,n),h=vl(n);return Ru(),g.jsx(Zs,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:g.jsx(po,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:g.jsx(sl,{"data-state":IP(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)"}})})})}),AP="PopoverClose",KG=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=xo(AP,n);return g.jsx(he.button,{type:"button",...r,ref:t,onClick:le(e.onClick,()=>o.onOpenChange(!1))})});KG.displayName=AP;var XG="PopoverArrow",ZG=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=vl(n);return g.jsx(ll,{...o,...r,ref:t})});ZG.displayName=XG;function IP(e){return e?"open":"closed"}var JG=RP,QG=MP,e7=DP,jP=kP,ig="Progress",ag=100,[t7,pne]=at(ig),[n7,r7]=t7(ig),$P=y.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:i=o7,...a}=e;(o||o===0)&&!BP(o)&&console.error(i7(`${o}`,"Progress"));const s=BP(o)?o:ag;r!==null&&!HP(r,s)&&console.error(a7(`${r}`,"Progress"));const l=HP(r,s)?r:null,c=rd(l)?i(l,s):void 0;return g.jsx(n7,{scope:n,value:l,max:s,children:g.jsx(he.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":rd(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":zP(l,s),"data-value":l??void 0,"data-max":s,...a,ref:t})})});$P.displayName=ig;var FP="ProgressIndicator",LP=y.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=r7(FP,n);return g.jsx(he.div,{"data-state":zP(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});LP.displayName=FP;function o7(e,t){return`${Math.round(e/t*100)}%`}function zP(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function rd(e){return typeof e=="number"}function BP(e){return rd(e)&&!isNaN(e)&&e>0}function HP(e,t){return rd(e)&&!isNaN(e)&&e<=t&&e>=0}function i7(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${ag}\`.`}function a7(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
323
|
+
- a positive number
|
|
324
|
+
- less than the value passed to \`max\` (or ${ag} if no \`max\` prop is set)
|
|
325
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
326
|
+
|
|
327
|
+
Defaulting to \`null\`.`}var UP=$P,s7=LP,sg="Radio",[l7,VP]=at(sg),[c7,u7]=l7(sg),WP=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=Se(t,v=>f(v)),p=y.useRef(!1),m=d?c||!!d.closest("form"):!0;return g.jsxs(c7,{scope:n,checked:o,disabled:a,children:[g.jsx(he.button,{type:"button",role:"radio","aria-checked":o,"data-state":YP(o),"data-disabled":a?"":void 0,disabled:a,value:s,...u,ref:h,onClick:le(e.onClick,v=>{o||l==null||l(),m&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})}),m&&g.jsx(d7,{control:d,bubbles:!p.current,name:r,value:s,checked:o,required:i,disabled:a,form:c,style:{transform:"translateX(-100%)"}})]})});WP.displayName=sg;var GP="RadioIndicator",qP=y.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=u7(GP,n);return g.jsx(ht,{present:r||i.checked,children:g.jsx(he.span,{"data-state":YP(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});qP.displayName=GP;var d7=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=y.useRef(null),a=fa(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 YP(e){return e?"checked":"unchecked"}var f7=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],lg="RadioGroup",[h7,mne]=at(lg,[_r,VP]),KP=_r(),XP=VP(),[p7,m7]=h7(lg),ZP=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=KP(n),p=Un(c),[m,v]=lt({prop:i,defaultProp:o,onChange:d});return g.jsx(p7,{scope:n,name:r,required:a,disabled:s,value:m,onValueChange:v,children:g.jsx(cl,{asChild:!0,...h,orientation:l,dir:p,loop:u,children:g.jsx(he.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":s?"":void 0,dir:p,...f,ref:t})})})});ZP.displayName=lg;var JP="RadioGroupItem",QP=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=m7(JP,n),a=i.disabled||r,s=KP(n),l=XP(n),c=y.useRef(null),u=Se(t,c),d=i.value===o.value,f=y.useRef(!1);return y.useEffect(()=>{const h=m=>{f7.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(ul,{asChild:!0,...s,focusable:!a,active:d,children:g.jsx(WP,{disabled:a,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:le(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:le(o.onFocus,()=>{var h;f.current&&((h=c.current)==null||h.click())})})})});QP.displayName=JP;var g7="RadioGroupIndicator",eR=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=XP(n);return g.jsx(qP,{...o,...r,ref:t})});eR.displayName=g7;var tR=ZP,nR=QP,w7=eR;function yl(e,[t,n]){return Math.min(n,Math.max(t,e))}function v7(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var cg="ScrollArea",[rR,gne]=at(cg),[y7,In]=rR(cg),oR=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,S]=y.useState(0),[C,N]=y.useState(!1),[R,T]=y.useState(!1),M=Se(t,O=>l(O)),k=Un(o);return g.jsx(y7,{scope:n,type:r,dir:k,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:S,children:g.jsx(he.div,{dir:k,...a,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});oR.displayName=cg;var iR="ScrollAreaViewport",aR=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,a=In(iR,n),s=y.useRef(null),l=Se(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(he.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})})]})});aR.displayName=iR;var Sr="ScrollAreaScrollbar",ug=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=In(Sr,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(b7,{...r,ref:t,forceMount:n}):o.type==="scroll"?g.jsx(x7,{...r,ref:t,forceMount:n}):o.type==="auto"?g.jsx(sR,{...r,ref:t,forceMount:n}):o.type==="always"?g.jsx(dg,{...r,ref:t}):null});ug.displayName=Sr;var b7=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=In(Sr,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(ht,{present:n||i,children:g.jsx(sR,{"data-state":i?"visible":"hidden",...r,ref:t})})}),x7=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=In(Sr,e.__scopeScrollArea),i=e.orientation==="horizontal",a=sd(()=>l("SCROLL_END"),100),[s,l]=v7("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(ht,{present:n||s!=="hidden",children:g.jsx(dg,{"data-state":s==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:le(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:le(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),sR=y.forwardRef((e,t)=>{const n=In(Sr,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,a]=y.useState(!1),s=e.orientation==="horizontal",l=sd(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;a(s?c:u)}},10);return _a(n.viewport,l),_a(n.content,l),g.jsx(ht,{present:r||i,children:g.jsx(dg,{"data-state":i?"visible":"hidden",...o,ref:t})})}),dg=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=In(Sr,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=fR(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 R7(f,a.current,s,h)}return n==="horizontal"?g.jsx(_7,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,h=hR(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(S7,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,h=hR(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}),_7=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=In(Sr,e.__scopeScrollArea),[a,s]=y.useState(),l=y.useRef(null),c=Se(t,l,i.onScrollbarXChange);return y.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),g.jsx(cR,{"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":ad(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),mR(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:id(a.paddingLeft),paddingEnd:id(a.paddingRight)}})}})}),S7=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=In(Sr,e.__scopeScrollArea),[a,s]=y.useState(),l=y.useRef(null),c=Se(t,l,i.onScrollbarYChange);return y.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),g.jsx(cR,{"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":ad(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),mR(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:id(a.paddingTop),paddingEnd:id(a.paddingBottom)}})}})}),[C7,lR]=rR(Sr),cR=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=In(Sr,n),[p,m]=y.useState(null),v=Se(t,M=>m(M)),w=y.useRef(null),b=y.useRef(""),x=h.viewport,S=r.content-r.viewport,C=et(u),N=et(l),R=sd(d,10);function T(M){if(w.current){const k=M.clientX-w.current.left,O=M.clientY-w.current.top;c({x:k,y:O})}}return y.useEffect(()=>{const M=k=>{const O=k.target;(p==null?void 0:p.contains(O))&&C(k,S)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[x,p,S,C]),y.useEffect(N,[r,N]),_a(p,R),_a(h.content,R),g.jsx(C7,{scope:n,scrollbar:p,hasThumb:o,onThumbChange:et(i),onThumbPointerUp:et(a),onThumbPositionChange:N,onThumbPointerDown:et(s),children:g.jsx(he.div,{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:le(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:le(e.onPointerMove,T),onPointerUp:le(e.onPointerUp,M=>{const k=M.target;k.hasPointerCapture(M.pointerId)&&k.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=""),w.current=null})})})}),od="ScrollAreaThumb",uR=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=lR(od,e.__scopeScrollArea);return g.jsx(ht,{present:n||o.hasThumb,children:g.jsx(E7,{ref:t,...r})})}),E7=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=In(od,n),a=lR(od,n),{onThumbPositionChange:s}=a,l=Se(t,d=>a.onThumbChange(d)),c=y.useRef(void 0),u=sd(()=>{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=N7(d,s);c.current=h,s()}};return s(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[i.viewport,u,s]),g.jsx(he.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:le(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:le(e.onPointerUp,a.onThumbPointerUp)})});uR.displayName=od;var fg="ScrollAreaCorner",dR=y.forwardRef((e,t)=>{const n=In(fg,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?g.jsx(P7,{...e,ref:t}):null});dR.displayName=fg;var P7=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=In(fg,n),[i,a]=y.useState(0),[s,l]=y.useState(0),c=!!(i&&s);return _a(o.scrollbarX,()=>{var d;const u=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(u),l(u)}),_a(o.scrollbarY,()=>{var d;const u=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(u),a(u)}),c?g.jsx(he.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 id(e){return e?parseInt(e,10):0}function fR(e,t){const n=e/t;return isNaN(n)?0:n}function ad(e){const t=fR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function R7(e,t,n,r="ltr"){const o=ad(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 pR([l,c],d)(e)}function hR(e,t,n="ltr"){const r=ad(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=yl(e,l);return pR([0,a],[0,s])(c)}function pR(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 mR(e,t){return e>0&&e<t}var N7=(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 sd(e,t){const n=et(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 _a(e,t){const n=et(t);vt(()=>{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 gR=oR,T7=aR,M7=dR,D7=[" ","Enter","ArrowUp","ArrowDown"],k7=[" ","Enter"],bl="Select",[ld,cd,O7]=ho(bl),[Sa,wne]=at(bl,[O7,xr]),ud=xr(),[A7,_o]=Sa(bl),[I7,j7]=Sa(bl),wR=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=ud(t),[v,w]=y.useState(null),[b,x]=y.useState(null),[S,C]=y.useState(!1),N=Un(c),[R=!1,T]=lt({prop:r,defaultProp:o,onChange:i}),[M,k]=lt({prop:a,defaultProp:s,onChange:l}),O=y.useRef(null),F=v?p||!!v.closest("form"):!0,[L,K]=y.useState(new Set),ne=Array.from(L).map(q=>q.props.value).join(";");return g.jsx(wa,{...m,children:g.jsxs(A7,{required:h,scope:t,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:_t(),value:M,onValueChange:k,open:R,onOpenChange:T,dir:N,triggerPointerDownPosRef:O,disabled:f,children:[g.jsx(ld.Provider,{scope:t,children:g.jsx(I7,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(q=>{K(X=>new Set(X).add(q))},[]),onNativeOptionRemove:y.useCallback(q=>{K(X=>{const B=new Set(X);return B.delete(q),B})},[]),children:n})}),F?g.jsxs(UR,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:M,onChange:q=>k(q.target.value),disabled:f,form:p,children:[M===void 0?g.jsx("option",{value:""}):null,Array.from(L)]},ne):null]})})};wR.displayName=bl;var vR="SelectTrigger",yR=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=ud(n),a=_o(vR,n),s=a.disabled||r,l=Se(t,a.onTriggerChange),c=cd(n),u=y.useRef("touch"),[d,f,h]=VR(m=>{const v=c().filter(x=>!x.disabled),w=v.find(x=>x.value===a.value),b=WR(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(va,{asChild:!0,...i,children:g.jsx(he.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":HR(a.value)?"":void 0,...o,ref:l,onClick:le(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&p(m)}),onPointerDown:le(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:le(o.onKeyDown,m=>{const v=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(v&&m.key===" ")&&D7.includes(m.key)&&(p(),m.preventDefault())})})})});yR.displayName=vR;var bR="SelectValue",xR=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,l=_o(bR,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=Se(t,l.onValueNodeChange);return vt(()=>{c(u)},[c,u]),g.jsx(he.span,{...s,ref:d,style:{pointerEvents:"none"},children:HR(l.value)?g.jsx(g.Fragment,{children:a}):i})});xR.displayName=bR;var $7="SelectIcon",_R=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return g.jsx(he.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});_R.displayName=$7;var F7="SelectPortal",SR=e=>g.jsx(Js,{asChild:!0,...e});SR.displayName=F7;var ti="SelectContent",CR=y.forwardRef((e,t)=>{const n=_o(ti,e.__scopeSelect),[r,o]=y.useState();if(vt(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Jl.createPortal(g.jsx(ER,{scope:e.__scopeSelect,children:g.jsx(ld.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),i):null}return g.jsx(PR,{...e,ref:t})});CR.displayName=ti;var qn=10,[ER,So]=Sa(ti),L7="SelectContentImpl",PR=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(ti,n),[x,S]=y.useState(null),[C,N]=y.useState(null),R=Se(t,G=>S(G)),[T,M]=y.useState(null),[k,O]=y.useState(null),F=cd(n),[L,K]=y.useState(!1),ne=y.useRef(!1);y.useEffect(()=>{if(x)return nl(x)},[x]),Ru();const q=y.useCallback(G=>{const[$,...te]=F().map(z=>z.ref.current),[ie]=te.slice(-1),re=document.activeElement;for(const z of G)if(z===re||(z==null||z.scrollIntoView({block:"nearest"}),z===$&&C&&(C.scrollTop=0),z===ie&&C&&(C.scrollTop=C.scrollHeight),z==null||z.focus(),document.activeElement!==re))return},[F,C]),X=y.useCallback(()=>q([T,x]),[q,T,x]);y.useEffect(()=>{L&&X()},[L,X]);const{onOpenChange:B,triggerPointerDownPosRef:ee}=b;y.useEffect(()=>{if(x){let G={x:0,y:0};const $=ie=>{var re,z;G={x:Math.abs(Math.round(ie.pageX)-(((re=ee.current)==null?void 0:re.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((z=ee.current)==null?void 0:z.y)??0))}},te=ie=>{G.x<=10&&G.y<=10?ie.preventDefault():x.contains(ie.target)||B(!1),document.removeEventListener("pointermove",$),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",$),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",te,{capture:!0})}}},[x,B,ee]),y.useEffect(()=>{const G=()=>B(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[B]);const[Z,J]=VR(G=>{const $=F().filter(re=>!re.disabled),te=$.find(re=>re.ref.current===document.activeElement),ie=WR($,G,te);ie&&setTimeout(()=>ie.ref.current.focus())}),H=y.useCallback((G,$,te)=>{const ie=!ne.current&&!te;(b.value!==void 0&&b.value===$||ie)&&(M(G),ie&&(ne.current=!0))},[b.value]),I=y.useCallback(()=>x==null?void 0:x.focus(),[x]),V=y.useCallback((G,$,te)=>{const ie=!ne.current&&!te;(b.value!==void 0&&b.value===$||ie)&&O(G)},[b.value]),ae=r==="popper"?hg:RR,j=ae===hg?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:v}:{};return g.jsx(ER,{scope:n,content:x,viewport:C,onViewportChange:N,itemRefCallback:H,selectedItem:T,onItemLeave:I,itemTextRefCallback:V,focusSelectedItem:X,selectedItemText:k,position:r,isPositioned:L,searchRef:Z,children:g.jsx(tl,{as:Hn,allowPinchZoom:!0,children:g.jsx(Zs,{asChild:!0,trapped:b.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:le(o,G=>{var $;($=b.trigger)==null||$.focus({preventScroll:!0}),G.preventDefault()}),children:g.jsx(po,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:g.jsx(ae,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:G=>G.preventDefault(),...w,...j,onPlaced:()=>K(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:le(w.onKeyDown,G=>{const $=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!$&&G.key.length===1&&J(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let ie=F().filter(re=>!re.disabled).map(re=>re.ref.current);if(["ArrowUp","End"].includes(G.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const re=G.target,z=ie.indexOf(re);ie=ie.slice(z+1)}setTimeout(()=>q(ie)),G.preventDefault()}})})})})})})});PR.displayName=L7;var z7="SelectItemAlignedPosition",RR=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=_o(ti,n),a=So(ti,n),[s,l]=y.useState(null),[c,u]=y.useState(null),d=Se(t,R=>u(R)),f=cd(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(),k=w.getBoundingClientRect();if(i.dir!=="rtl"){const re=k.left-T.left,z=M.left-re,se=R.left-z,oe=R.width+se,fe=Math.max(oe,T.width),ge=window.innerWidth-qn,pe=yl(z,[qn,Math.max(qn,ge-fe)]);s.style.minWidth=oe+"px",s.style.left=pe+"px"}else{const re=T.right-k.right,z=window.innerWidth-M.right-re,se=window.innerWidth-R.right-z,oe=R.width+se,fe=Math.max(oe,T.width),ge=window.innerWidth-qn,pe=yl(z,[qn,Math.max(qn,ge-fe)]);s.style.minWidth=oe+"px",s.style.right=pe+"px"}const O=f(),F=window.innerHeight-qn*2,L=m.scrollHeight,K=window.getComputedStyle(c),ne=parseInt(K.borderTopWidth,10),q=parseInt(K.paddingTop,10),X=parseInt(K.borderBottomWidth,10),B=parseInt(K.paddingBottom,10),ee=ne+q+L+B+X,Z=Math.min(v.offsetHeight*5,ee),J=window.getComputedStyle(m),H=parseInt(J.paddingTop,10),I=parseInt(J.paddingBottom,10),V=R.top+R.height/2-qn,ae=F-V,j=v.offsetHeight/2,G=v.offsetTop+j,$=ne+q+G,te=ee-$;if($<=V){const re=O.length>0&&v===O[O.length-1].ref.current;s.style.bottom="0px";const z=c.clientHeight-m.offsetTop-m.offsetHeight,se=Math.max(ae,j+(re?I:0)+z+X),oe=$+se;s.style.height=oe+"px"}else{const re=O.length>0&&v===O[0].ref.current;s.style.top="0px";const se=Math.max(V,ne+m.offsetTop+(re?H:0)+j)+te;s.style.height=se+"px",m.scrollTop=$-V+m.offsetTop}s.style.margin=`${qn}px 0`,s.style.minHeight=Z+"px",s.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,s,c,m,v,w,i.dir,r]);vt(()=>x(),[x]);const[S,C]=y.useState();vt(()=>{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(H7,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:g.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:g.jsx(he.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});RR.displayName=z7;var B7="SelectPopperPosition",hg=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=qn,...i}=e,a=ud(n);return g.jsx(sl,{...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)"}})});hg.displayName=B7;var[H7,pg]=Sa(ti,{}),mg="SelectViewport",NR=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=So(mg,n),a=pg(mg,n),s=Se(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(ld.Slot,{scope:n,children:g.jsx(he.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:le(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-qn*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),S=b-x;d.style.height=x+"px",d.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});NR.displayName=mg;var TR="SelectGroup",[U7,V7]=Sa(TR),MR=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=_t();return g.jsx(U7,{scope:n,id:o,children:g.jsx(he.div,{role:"group","aria-labelledby":o,...r,ref:t})})});MR.displayName=TR;var DR="SelectLabel",kR=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=V7(DR,n);return g.jsx(he.div,{id:o.id,...r,ref:t})});kR.displayName=DR;var dd="SelectItem",[W7,OR]=Sa(dd),AR=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,s=_o(dd,n),l=So(dd,n),c=s.value===r,[u,d]=y.useState(i??""),[f,h]=y.useState(!1),p=Se(t,b=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,b,r,o)}),m=_t(),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(W7,{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(ld.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:g.jsx(he.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:le(a.onFocus,()=>h(!0)),onBlur:le(a.onBlur,()=>h(!1)),onClick:le(a.onClick,()=>{v.current!=="mouse"&&w()}),onPointerUp:le(a.onPointerUp,()=>{v.current==="mouse"&&w()}),onPointerDown:le(a.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:le(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:le(a.onPointerLeave,b=>{var x;b.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:le(a.onKeyDown,b=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&b.key===" "||(k7.includes(b.key)&&w(),b.key===" "&&b.preventDefault())})})})})});AR.displayName=dd;var xl="SelectItemText",IR=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=_o(xl,n),s=So(xl,n),l=OR(xl,n),c=j7(xl,n),[u,d]=y.useState(null),f=Se(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 vt(()=>(m(p),()=>v(p)),[m,v,p]),g.jsxs(g.Fragment,{children:[g.jsx(he.span,{id:l.textId,...i,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Jl.createPortal(i.children,a.valueNode):null]})});IR.displayName=xl;var jR="SelectItemIndicator",$R=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return OR(jR,n).isSelected?g.jsx(he.span,{"aria-hidden":!0,...r,ref:t}):null});$R.displayName=jR;var gg="SelectScrollUpButton",FR=y.forwardRef((e,t)=>{const n=So(gg,e.__scopeSelect),r=pg(gg,e.__scopeSelect),[o,i]=y.useState(!1),a=Se(t,r.onScrollButtonChange);return vt(()=>{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(zR,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});FR.displayName=gg;var wg="SelectScrollDownButton",LR=y.forwardRef((e,t)=>{const n=So(wg,e.__scopeSelect),r=pg(wg,e.__scopeSelect),[o,i]=y.useState(!1),a=Se(t,r.onScrollButtonChange);return vt(()=>{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(zR,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});LR.displayName=wg;var zR=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=So("SelectScrollButton",n),a=y.useRef(null),s=cd(n),l=y.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return y.useEffect(()=>()=>l(),[l]),vt(()=>{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(he.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:le(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:le(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:le(o.onPointerLeave,()=>{l()})})}),G7="SelectSeparator",BR=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(he.div,{"aria-hidden":!0,...r,ref:t})});BR.displayName=G7;var vg="SelectArrow",q7=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ud(n),i=_o(vg,n),a=So(vg,n);return i.open&&a.position==="popper"?g.jsx(ll,{...o,...r,ref:t}):null});q7.displayName=vg;function HR(e){return e===""||e===void 0}var UR=y.forwardRef((e,t)=>{const{value:n,...r}=e,o=y.useRef(null),i=Se(t,o),a=fa(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(xp,{asChild:!0,children:g.jsx("select",{...r,ref:i,defaultValue:n})})});UR.displayName="BubbleSelect";function VR(e){const t=et(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 WR(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=Y7(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 Y7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var K7=wR,GR=yR,X7=xR,Z7=_R,J7=SR,qR=CR,Q7=NR,e9=MR,YR=kR,KR=AR,t9=IR,n9=$R,XR=FR,ZR=LR,JR=BR,r9="Separator",QR="horizontal",o9=["horizontal","vertical"],eN=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=QR,...o}=e,i=i9(r)?r:QR,s=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return g.jsx(he.div,{"data-orientation":i,...s,...o,ref:t})});eN.displayName=r9;function i9(e){return o9.includes(e)}var tN=eN,nN=["PageUp","PageDown"],rN=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],oN={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ca="Slider",[yg,a9,s9]=ho(Ca),[iN,vne]=at(Ca,[s9]),[l9,fd]=iN(Ca),aN=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"?c9:u9,[S=[],C]=lt({prop:u,defaultProp:c,onChange:O=>{var L;(L=[...v.current][w.current])==null||L.focus(),d(O)}}),N=y.useRef(S);function R(O){const F=m9(S,O);k(O,F)}function T(O){k(O,w.current)}function M(){const O=N.current[w.current];S[w.current]!==O&&f(S)}function k(O,F,{commit:L}={commit:!1}){const K=y9(i),ne=b9(Math.round((O-r)/i)*i+r,K),q=yl(ne,[r,o]);C((X=[])=>{const B=h9(X,q,F);if(v9(B,l*i)){w.current=B.indexOf(q);const ee=String(B)!==String(X);return ee&&L&&f(B),ee?B:X}else return X})}return g.jsx(l9,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:w,thumbs:v.current,values:S,orientation:a,form:p,children:g.jsx(yg.Provider,{scope:e.__scopeSlider,children:g.jsx(yg.Slot,{scope:e.__scopeSlider,children:g.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...m,ref:t,onPointerDown:le(m.onPointerDown,()=>{s||(N.current=S)}),min:r,max:o,inverted:h,onSlideStart:s?void 0:R,onSlideMove:s?void 0:T,onSlideEnd:s?void 0:M,onHomeKeyDown:()=>!s&&k(r,0,{commit:!0}),onEndKeyDown:()=>!s&&k(o,S.length-1,{commit:!0}),onStepKeyDown:({event:O,direction:F})=>{if(!s){const ne=nN.includes(O.key)||O.shiftKey&&rN.includes(O.key)?10:1,q=w.current,X=S[q],B=i*ne*F;k(X+B,q,{commit:!0})}}})})})})});aN.displayName=Ca;var[sN,lN]=iN(Ca,{startEdge:"left",endEdge:"right",size:"width",direction:1}),c9=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=Se(t,x=>f(x)),p=y.useRef(void 0),m=Un(o),v=m==="ltr",w=v&&!i||!v&&i;function b(x){const S=p.current||d.getBoundingClientRect(),C=[0,S.width],R=_g(C,w?[n,r]:[r,n]);return p.current=S,R(x-S.left)}return g.jsx(sN,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:g.jsx(cN,{dir:m,"data-orientation":"horizontal",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const S=b(x.clientX);a==null||a(S)},onSlideMove:x=>{const S=b(x.clientX);s==null||s(S)},onSlideEnd:()=>{p.current=void 0,l==null||l()},onStepKeyDown:x=>{const C=oN[w?"from-left":"from-right"].includes(x.key);c==null||c({event:x,direction:C?-1:1})}})})}),u9=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=Se(t,u),f=y.useRef(void 0),h=!o;function p(m){const v=f.current||u.current.getBoundingClientRect(),w=[0,v.height],x=_g(w,h?[r,n]:[n,r]);return f.current=v,x(m-v.top)}return g.jsx(sN,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:g.jsx(cN,{"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=oN[h?"from-bottom":"from-top"].includes(m.key);l==null||l({event:m,direction:w?-1:1})}})})}),cN=y.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:l,...c}=e,u=fd(Ca,n);return g.jsx(he.span,{...c,ref:t,onKeyDown:le(e.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):nN.concat(rN).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:le(e.onPointerDown,d=>{const f=d.target;f.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(f)?f.focus():r(d)}),onPointerMove:le(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&o(d)}),onPointerUp:le(e.onPointerUp,d=>{const f=d.target;f.hasPointerCapture(d.pointerId)&&(f.releasePointerCapture(d.pointerId),i(d))})})}),uN="SliderTrack",dN=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=fd(uN,n);return g.jsx(he.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});dN.displayName=uN;var bg="SliderRange",fN=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=fd(bg,n),i=lN(bg,n),a=y.useRef(null),s=Se(t,a),l=o.values.length,c=o.values.map(f=>pN(f,o.min,o.max)),u=l>1?Math.min(...c):0,d=100-Math.max(...c);return g.jsx(he.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:s,style:{...e.style,[i.startEdge]:u+"%",[i.endEdge]:d+"%"}})});fN.displayName=bg;var xg="SliderThumb",hN=y.forwardRef((e,t)=>{const n=a9(e.__scopeSlider),[r,o]=y.useState(null),i=Se(t,s=>o(s)),a=y.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return g.jsx(d9,{...e,ref:i,index:a})}),d9=y.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,a=fd(xg,n),s=lN(xg,n),[l,c]=y.useState(null),u=Se(t,b=>c(b)),d=l?a.form||!!l.closest("form"):!0,f=rl(l),h=a.values[r],p=h===void 0?0:pN(h,a.min,a.max),m=p9(r,a.values.length),v=f==null?void 0:f[s.size],w=v?g9(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(yg.ItemSlot,{scope:e.__scopeSlider,children:g.jsx(he.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:le(e.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),d&&g.jsx(f9,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:h},r)]})});hN.displayName=xg;var f9=e=>{const{value:t,...n}=e,r=y.useRef(null),o=fa(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 h9(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function pN(e,t,n){const i=100/(n-t)*(e-t);return yl(i,[0,100])}function p9(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function m9(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 g9(e,t,n){const r=e/2,i=_g([0,50],[0,r]);return(r-i(t)*n)*n}function w9(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function v9(e,t){if(t>0){const n=w9(e);return Math.min(...n)>=t}return!0}function _g(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 y9(e){return(String(e).split(".")[1]||"").length}function b9(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var mN=aN,x9=dN,_9=fN,S9=hN,Sg="Switch",[C9,yne]=at(Sg),[E9,P9]=C9(Sg),gN=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=Se(t,x=>h(x)),m=y.useRef(!1),v=f?u||!!f.closest("form"):!0,[w=!1,b]=lt({prop:o,defaultProp:i,onChange:c});return g.jsxs(E9,{scope:n,checked:w,disabled:s,children:[g.jsx(he.button,{type:"button",role:"switch","aria-checked":w,"aria-required":a,"data-state":yN(w),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:p,onClick:le(e.onClick,x=>{b(S=>!S),v&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})}),v&&g.jsx(R9,{control:f,bubbles:!m.current,name:r,value:l,checked:w,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});gN.displayName=Sg;var wN="SwitchThumb",vN=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=P9(wN,n);return g.jsx(he.span,{"data-state":yN(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});vN.displayName=wN;var R9=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=y.useRef(null),a=fa(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 yN(e){return e?"checked":"unchecked"}var bN=gN,N9=vN,Cg="Tabs",[T9,bne]=at(Cg,[_r]),xN=_r(),[M9,Eg]=T9(Cg),_N=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=e,u=Un(s),[d,f]=lt({prop:r,onChange:o,defaultProp:i});return g.jsx(M9,{scope:n,baseId:_t(),value:d,onValueChange:f,orientation:a,dir:u,activationMode:l,children:g.jsx(he.div,{dir:u,"data-orientation":a,...c,ref:t})})});_N.displayName=Cg;var SN="TabsList",CN=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Eg(SN,n),a=xN(n);return g.jsx(cl,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:g.jsx(he.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});CN.displayName=SN;var EN="TabsTrigger",PN=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=Eg(EN,n),s=xN(n),l=TN(a.baseId,r),c=MN(a.baseId,r),u=r===a.value;return g.jsx(ul,{asChild:!0,...s,focusable:!o,active:u,children:g.jsx(he.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:le(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?a.onValueChange(r):d.preventDefault()}),onKeyDown:le(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:le(e.onFocus,()=>{const d=a.activationMode!=="manual";!u&&!o&&d&&a.onValueChange(r)})})})});PN.displayName=EN;var RN="TabsContent",NN=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,s=Eg(RN,n),l=TN(s.baseId,r),c=MN(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(ht,{present:o||u,children:({present:f})=>g.jsx(he.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})})});NN.displayName=RN;function TN(e,t){return`${e}-trigger-${t}`}function MN(e,t){return`${e}-content-${t}`}var D9=_N,DN=CN,kN=PN,ON=NN,k9="Toggle",Pg=y.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[a=!1,s]=lt({prop:n,onChange:o,defaultProp:r});return g.jsx(he.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:le(e.onClick,()=>{e.disabled||s(!a)})})});Pg.displayName=k9;var AN=Pg,Ea="ToggleGroup",[IN,xne]=at(Ea,[_r]),jN=_r(),Rg=E.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return g.jsx(O9,{...o,ref:t})}if(n==="multiple"){const o=r;return g.jsx(A9,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${Ea}\``)});Rg.displayName=Ea;var[$N,FN]=IN(Ea),O9=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a,s]=lt({prop:n,defaultProp:r,onChange:o});return g.jsx($N,{scope:e.__scopeToggleGroup,type:"single",value:a?[a]:[],onItemActivate:s,onItemDeactivate:E.useCallback(()=>s(""),[s]),children:g.jsx(LN,{...i,ref:t})})}),A9=E.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a=[],s]=lt({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($N,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:l,onItemDeactivate:c,children:g.jsx(LN,{...i,ref:t})})});Rg.displayName=Ea;var[I9,j9]=IN(Ea),LN=E.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:i,dir:a,loop:s=!0,...l}=e,c=jN(n),u=Un(a),d={role:"group",dir:u,...l};return g.jsx(I9,{scope:n,rovingFocus:o,disabled:r,children:o?g.jsx(cl,{asChild:!0,...c,orientation:i,dir:u,loop:s,children:g.jsx(he.div,{...d,ref:t})}):g.jsx(he.div,{...d,ref:t})})}),hd="ToggleGroupItem",zN=E.forwardRef((e,t)=>{const n=FN(hd,e.__scopeToggleGroup),r=j9(hd,e.__scopeToggleGroup),o=jN(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(ul,{asChild:!0,...o,focusable:!a,active:i,ref:l,children:g.jsx(BN,{...s,ref:t})}):g.jsx(BN,{...s,ref:t})});zN.displayName=hd;var BN=E.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,i=FN(hd,n),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},s=i.type==="single"?a:void 0;return g.jsx(Pg,{...s,...o,ref:t,onPressedChange:l=>{l?i.onItemActivate(r):i.onItemDeactivate(r)}})}),HN=Rg,UN=zN,[pd,_ne]=at("Tooltip",[xr]),md=xr(),VN="TooltipProvider",$9=700,Ng="tooltip.open",[F9,Tg]=pd(VN),WN=e=>{const{__scopeTooltip:t,delayDuration:n=$9,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(F9,{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})};WN.displayName=VN;var gd="Tooltip",[L9,wd]=pd(gd),GN=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,l=Tg(gd,e.__scopeTooltip),c=md(t),[u,d]=y.useState(null),f=_t(),h=y.useRef(0),p=a??l.disableHoverableContent,m=s??l.delayDuration,v=y.useRef(!1),[w=!1,b]=lt({prop:r,defaultProp:o,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(Ng))):l.onClose(),i==null||i(R)}}),x=y.useMemo(()=>w?v.current?"delayed-open":"instant-open":"closed",[w]),S=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(wa,{...c,children:g.jsx(L9,{scope:t,contentId:f,open:w,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayed?N():S()},[l.isOpenDelayed,N,S]),onTriggerLeave:y.useCallback(()=>{p?C():(window.clearTimeout(h.current),h.current=0)},[C,p]),onOpen:S,onClose:C,disableHoverableContent:p,children:n})})};GN.displayName=gd;var Mg="TooltipTrigger",qN=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=wd(Mg,n),i=Tg(Mg,n),a=md(n),s=y.useRef(null),l=Se(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(va,{asChild:!0,...a,children:g.jsx(he.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:le(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:le(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:le(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:le(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:le(e.onBlur,o.onClose),onClick:le(e.onClick,o.onClose)})})});qN.displayName=Mg;var z9="TooltipPortal",[Sne,B9]=pd(z9,{forceMount:void 0}),Pa="TooltipContent",YN=y.forwardRef((e,t)=>{const n=B9(Pa,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=wd(Pa,e.__scopeTooltip);return g.jsx(ht,{present:r||a.open,children:a.disableHoverableContent?g.jsx(KN,{side:o,...i,ref:t}):g.jsx(H9,{side:o,...i,ref:t})})}),H9=y.forwardRef((e,t)=>{const n=wd(Pa,e.__scopeTooltip),r=Tg(Pa,e.__scopeTooltip),o=y.useRef(null),i=Se(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=G9(w,v.getBoundingClientRect()),x=q9(w,b),S=Y9(m.getBoundingClientRect()),C=X9([...x,...S]);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=!K9(w,a);b?f():x&&(f(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[l,u,a,c,f]),g.jsx(KN,{...e,ref:i})}),[U9,V9]=pd(gd,{isInside:!1}),KN=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,l=wd(Pa,n),c=md(n),{onClose:u}=l;return y.useEffect(()=>(document.addEventListener(Ng,u),()=>document.removeEventListener(Ng,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(po,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:g.jsxs(sl,{"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(xu,{children:r}),g.jsx(U9,{scope:n,isInside:!0,children:g.jsx(E_,{id:l.contentId,role:"tooltip",children:o||r})})]})})});YN.displayName=Pa;var XN="TooltipArrow",W9=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=md(n);return V9(XN,n).isInside?null:g.jsx(ll,{...o,...r,ref:t})});W9.displayName=XN;function G9(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 q9(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 Y9(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 K9(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 X9(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),Z9(t)}function Z9(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 J9=WN,Q9=GN,eq=qN,ZN=YN;/**
|
|
328
|
+
* @license lucide-react v0.475.0 - ISC
|
|
329
|
+
*
|
|
330
|
+
* This source code is licensed under the ISC license.
|
|
331
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
+
*/const tq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),JN=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
333
|
+
* @license lucide-react v0.475.0 - ISC
|
|
334
|
+
*
|
|
335
|
+
* This source code is licensed under the ISC license.
|
|
336
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
+
*/var nq={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
338
|
+
* @license lucide-react v0.475.0 - ISC
|
|
339
|
+
*
|
|
340
|
+
* This source code is licensed under the ISC license.
|
|
341
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
+
*/const rq=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...s},l)=>E.createElement("svg",{ref:l,...nq,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:JN("lucide",o),...s},[...a.map(([c,u])=>E.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
|
|
343
|
+
* @license lucide-react v0.475.0 - ISC
|
|
344
|
+
*
|
|
345
|
+
* This source code is licensed under the ISC license.
|
|
346
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
+
*/const Sn=(e,t)=>{const n=E.forwardRef(({className:r,...o},i)=>E.createElement(rq,{ref:i,iconNode:t,className:JN(`lucide-${tq(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
|
|
348
|
+
* @license lucide-react v0.475.0 - ISC
|
|
349
|
+
*
|
|
350
|
+
* This source code is licensed under the ISC license.
|
|
351
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
+
*/const QN=Sn("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
353
|
+
* @license lucide-react v0.475.0 - ISC
|
|
354
|
+
*
|
|
355
|
+
* This source code is licensed under the ISC license.
|
|
356
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
+
*/const Ra=Sn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
358
|
+
* @license lucide-react v0.475.0 - ISC
|
|
359
|
+
*
|
|
360
|
+
* This source code is licensed under the ISC license.
|
|
361
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
+
*/const vd=Sn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
363
|
+
* @license lucide-react v0.475.0 - ISC
|
|
364
|
+
*
|
|
365
|
+
* This source code is licensed under the ISC license.
|
|
366
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
+
*/const yd=Sn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
368
|
+
* @license lucide-react v0.475.0 - ISC
|
|
369
|
+
*
|
|
370
|
+
* This source code is licensed under the ISC license.
|
|
371
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
+
*/const Co=Sn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
373
|
+
* @license lucide-react v0.475.0 - ISC
|
|
374
|
+
*
|
|
375
|
+
* This source code is licensed under the ISC license.
|
|
376
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
+
*/const oq=Sn("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
378
|
+
* @license lucide-react v0.475.0 - ISC
|
|
379
|
+
*
|
|
380
|
+
* This source code is licensed under the ISC license.
|
|
381
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
+
*/const iq=Sn("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
|
|
383
|
+
* @license lucide-react v0.475.0 - ISC
|
|
384
|
+
*
|
|
385
|
+
* This source code is licensed under the ISC license.
|
|
386
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
+
*/const aq=Sn("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
|
|
388
|
+
* @license lucide-react v0.475.0 - ISC
|
|
389
|
+
*
|
|
390
|
+
* This source code is licensed under the ISC license.
|
|
391
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
+
*/const sq=Sn("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
|
|
393
|
+
* @license lucide-react v0.475.0 - ISC
|
|
394
|
+
*
|
|
395
|
+
* This source code is licensed under the ISC license.
|
|
396
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
+
*/const bd=Sn("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
398
|
+
* @license lucide-react v0.475.0 - ISC
|
|
399
|
+
*
|
|
400
|
+
* This source code is licensed under the ISC license.
|
|
401
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
+
*/const lq=Sn("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
403
|
+
* @license lucide-react v0.475.0 - ISC
|
|
404
|
+
*
|
|
405
|
+
* This source code is licensed under the ISC license.
|
|
406
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
+
*/const cq=Sn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
408
|
+
* @license lucide-react v0.475.0 - ISC
|
|
409
|
+
*
|
|
410
|
+
* This source code is licensed under the ISC license.
|
|
411
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
+
*/const eT=Sn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Dg="-",uq=e=>{const t=fq(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(Dg);return s[0]===""&&s.length!==1&&s.shift(),tT(s,t)||dq(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},tT=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?tT(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Dg);return(a=t.validators.find(({validator:s})=>s(i)))==null?void 0:a.classGroupId},nT=/^\[(.+)\]$/,dq=e=>{if(nT.test(e)){const t=nT.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},fq=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)kg(n[o],r,o,t);return r},kg=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:rT(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(hq(o)){kg(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{kg(a,rT(t,i),n,r)})})},rT=(e,t)=>{let n=e;return t.split(Dg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},hq=e=>e.isThemeGetter,pq=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)}}},Og="!",Ag=":",mq=Ag.length,gq=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===Ag){i.push(o.slice(l,p)),l=p+mq;continue}if(m==="/"){c=p;continue}}m==="["?a++:m==="]"?a--:m==="("?s++:m===")"&&s--}const u=i.length===0?o:o.substring(l),d=wq(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+Ag,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},wq=e=>e.endsWith(Og)?e.substring(0,e.length-1):e.startsWith(Og)?e.substring(1):e,vq=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}},yq=e=>({cache:pq(e.cacheSize),parseClassName:gq(e),sortModifiers:vq(e),...uq(e)}),bq=/\s+/,xq=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,a=[],s=e.trim().split(bq);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+Og:b,S=x+w;if(a.includes(S))continue;a.push(S);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 _q(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=oT(t))&&(r&&(r+=" "),r+=n);return r}const oT=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=oT(e[r]))&&(n&&(n+=" "),n+=t);return n};function Sq(e,...t){let n,r,o,i=a;function a(l){const c=t.reduce((u,d)=>d(u),e());return n=yq(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=xq(l,n);return o(l,u),u}return function(){return i(_q.apply(null,arguments))}}const Tt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},iT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,aT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Cq=/^\d+\/\d+$/,Eq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Pq=/\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$/,Rq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Nq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Tq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Na=e=>Cq.test(e),Be=e=>!!e&&!Number.isNaN(Number(e)),ni=e=>!!e&&Number.isInteger(Number(e)),sT=e=>e.endsWith("%")&&Be(e.slice(0,-1)),Eo=e=>Eq.test(e),Mq=()=>!0,Dq=e=>Pq.test(e)&&!Rq.test(e),Ig=()=>!1,kq=e=>Nq.test(e),Oq=e=>Tq.test(e),Aq=e=>!ve(e)&&!ye(e),Iq=e=>Ta(e,uT,Ig),ve=e=>iT.test(e),ri=e=>Ta(e,dT,Dq),jg=e=>Ta(e,Gq,Be),jq=e=>Ta(e,lT,Ig),$q=e=>Ta(e,cT,Oq),Fq=e=>Ta(e,Ig,kq),ye=e=>aT.test(e),xd=e=>Ma(e,dT),Lq=e=>Ma(e,qq),zq=e=>Ma(e,lT),Bq=e=>Ma(e,uT),Hq=e=>Ma(e,cT),Uq=e=>Ma(e,Yq,!0),Ta=(e,t,n)=>{const r=iT.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ma=(e,t,n=!1)=>{const r=aT.exec(e);return r?r[1]?t(r[1]):n:!1},lT=e=>e==="position",Vq=new Set(["image","url"]),cT=e=>Vq.has(e),Wq=new Set(["length","size","percentage"]),uT=e=>Wq.has(e),dT=e=>e==="length",Gq=e=>e==="number",qq=e=>e==="family-name",Yq=e=>e==="shadow",Kq=Sq(()=>{const e=Tt("color"),t=Tt("font"),n=Tt("text"),r=Tt("font-weight"),o=Tt("tracking"),i=Tt("leading"),a=Tt("breakpoint"),s=Tt("container"),l=Tt("spacing"),c=Tt("radius"),u=Tt("shadow"),d=Tt("inset-shadow"),f=Tt("drop-shadow"),h=Tt("blur"),p=Tt("perspective"),m=Tt("aspect"),v=Tt("ease"),w=Tt("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"],S=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],N=()=>[ye,ve,l],R=()=>[Na,"full","auto",...N()],T=()=>[ni,"none","subgrid",ye,ve],M=()=>["auto",{span:["full",ni,ye,ve]},ye,ve],k=()=>[ni,"auto",ye,ve],O=()=>["auto","min","max","fr",ye,ve],F=()=>["start","end","center","between","around","evenly","stretch","baseline"],L=()=>["start","end","center","stretch"],K=()=>["auto",...N()],ne=()=>[Na,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],q=()=>[e,ye,ve],X=()=>[sT,ri],B=()=>["","none","full",c,ye,ve],ee=()=>["",Be,xd,ri],Z=()=>["solid","dashed","dotted","double"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["","none",h,ye,ve],I=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ye,ve],V=()=>["none",Be,ye,ve],ae=()=>["none",Be,ye,ve],j=()=>[Be,ye,ve],G=()=>[Na,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Eo],breakpoint:[Eo],color:[Mq],container:[Eo],"drop-shadow":[Eo],ease:["in","out","in-out"],font:[Aq],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Eo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Eo],shadow:[Eo],spacing:["px",Be],text:[Eo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Na,ve,ye,m]}],container:["container"],columns:[{columns:[Be,ve,ye,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(),ve,ye]}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],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:[ni,"auto",ye,ve]}],basis:[{basis:[Na,"full","auto",s,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Be,Na,"auto","initial","none",ve]}],grow:[{grow:["",Be,ye,ve]}],shrink:[{shrink:["",Be,ye,ve]}],order:[{order:[ni,"first","last","none",ye,ve]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...L(),"baseline"]}],"align-self":[{self:["auto",...L(),"baseline"]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],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:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:ne()}],w:[{w:[s,"screen",...ne()]}],"min-w":[{"min-w":[s,"screen","none",...ne()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...ne()]}],h:[{h:["screen",...ne()]}],"min-h":[{"min-h":["screen","none",...ne()]}],"max-h":[{"max-h":["screen",...ne()]}],"font-size":[{text:["base",n,xd,ri]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ye,jg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",sT,ve]}],"font-family":[{font:[Lq,ve,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,ye,ve]}],"line-clamp":[{"line-clamp":[Be,"none",ye,jg]}],leading:[{leading:[i,...N()]}],"list-image":[{"list-image":["none",ye,ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[Be,"from-font","auto",ye,ri]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[Be,"auto",ye,ve]}],"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",ye,ve]}],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",ye,ve]}],"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(),zq,jq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",Bq,Iq]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ni,ye,ve],radial:["",ye,ve],conic:[ni,ye,ve]},Hq,$q]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],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:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Be,ye,ve]}],"outline-w":[{outline:["",Be,xd,ri]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",u,Uq,Fq]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",ye,ve,d]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[Be,ri]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":q()}],opacity:[{opacity:[Be,ye,ve]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none",ye,ve]}],blur:[{blur:H()}],brightness:[{brightness:[Be,ye,ve]}],contrast:[{contrast:[Be,ye,ve]}],"drop-shadow":[{"drop-shadow":["","none",f,ye,ve]}],grayscale:[{grayscale:["",Be,ye,ve]}],"hue-rotate":[{"hue-rotate":[Be,ye,ve]}],invert:[{invert:["",Be,ye,ve]}],saturate:[{saturate:[Be,ye,ve]}],sepia:[{sepia:["",Be,ye,ve]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,ve]}],"backdrop-blur":[{"backdrop-blur":H()}],"backdrop-brightness":[{"backdrop-brightness":[Be,ye,ve]}],"backdrop-contrast":[{"backdrop-contrast":[Be,ye,ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Be,ye,ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Be,ye,ve]}],"backdrop-invert":[{"backdrop-invert":["",Be,ye,ve]}],"backdrop-opacity":[{"backdrop-opacity":[Be,ye,ve]}],"backdrop-saturate":[{"backdrop-saturate":[Be,ye,ve]}],"backdrop-sepia":[{"backdrop-sepia":["",Be,ye,ve]}],"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",ye,ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Be,"initial",ye,ve]}],ease:[{ease:["linear","initial",v,ye,ve]}],delay:[{delay:[Be,ye,ve]}],animate:[{animate:["none",w,ye,ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,ye,ve]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:j()}],"skew-x":[{"skew-x":j()}],"skew-y":[{"skew-y":j()}],transform:[{transform:[ye,ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":["translate-none"],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"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",ye,ve]}],"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",ye,ve]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[Be,xd,ri,jg]}],stroke:[{stroke:["none",...q()]}],"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 Y(...e){return Kq(eu(e))}const Xq=z3,fT=y.forwardRef(({className:e,...t},n)=>g.jsx(B3,{ref:n,className:Y("border-b",e),...t}));fT.displayName="AccordionItem";const hT=y.forwardRef(({className:e,children:t,...n},r)=>g.jsx(H3,{className:"flex",children:g.jsxs(U3,{ref:r,className:Y("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(vd,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));hT.displayName="AccordionTrigger";const pT=y.forwardRef(({className:e,children:t,...n},r)=>g.jsx(V3,{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:Y("pb-4 pt-0",e),children:t})}));pT.displayName="AccordionContent";const mT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,gT=eu,Cn=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return gT(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=mT(u)||mT(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 gT(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},wT={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",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-muted hover:text-muted-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"}}},Zq=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT:wT},Symbol.toStringTag,{value:"Module"})),_l=E.createContext(null),Jq=_l.Consumer,Qq=Object.freeze(Object.defineProperty({__proto__:null,TailwindThemeConsumer:Jq,TailwindThemeContext:_l,TailwindThemeProvider:e=>{const[t,n]=E.useState(wT),[r,o]=E.useState("");return g.jsx(_l.Provider,{value:{setVariants:n,variants:t,setFont:o,font:r},children:e.children})}},Symbol.toStringTag,{value:"Module"})),eY=()=>{const e=E.useContext(_l);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{font:e.font,setFont:e.setFont}},Po=()=>{const e=E.useContext(_l);if(e===void 0)throw new Error("Invalid tailwind theme context.");return{variants:e.variants,setVariants:e.setVariants}},tY=Object.freeze(Object.defineProperty({__proto__:null,useFont:eY,useVariants:Po},Symbol.toStringTag,{value:"Module"})),vT=E.forwardRef(({className:e,variant:t,...n},r)=>{const{variants:o}=Po(),i=E.useMemo(()=>Cn(o.alert.defaultStyles,{variants:o.alert.variantStyles,defaultVariants:o.alert.defaultVariants}),[o]);return g.jsx("div",{ref:r,role:"alert",className:Y(i({variant:t}),e),...n})});vT.displayName="Alert";const yT=E.forwardRef(({className:e,...t},n)=>g.jsx("h5",{ref:n,className:Y("mb-1 font-medium leading-none tracking-tight",e),...t}));yT.displayName="AlertTitle";const bT=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Y("text-sm [&_p]:leading-relaxed",e),...t}));bT.displayName="AlertDescription";const nY=oU,rY=iU,oY=aU,xT=y.forwardRef(({className:e,...t},n)=>g.jsx(US,{className:Y("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}));xT.displayName=US.displayName;const _T=y.forwardRef(({className:e,...t},n)=>g.jsxs(oY,{children:[g.jsx(xT,{}),g.jsx(VS,{ref:n,className:Y("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})]}));_T.displayName=VS.displayName;const ST=({className:e,...t})=>g.jsx("div",{className:Y("flex flex-col space-y-2 text-center sm:text-left",e),...t});ST.displayName="AlertDialogHeader";const CT=({className:e,...t})=>g.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});CT.displayName="AlertDialogFooter";const ET=y.forwardRef(({className:e,...t},n)=>g.jsx(qS,{ref:n,className:Y("text-lg font-semibold",e),...t}));ET.displayName=qS.displayName;const PT=y.forwardRef(({className:e,...t},n)=>g.jsx(YS,{ref:n,className:Y("text-sm text-muted-foreground",e),...t}));PT.displayName=YS.displayName;const RT=y.forwardRef(({className:e,...t},n)=>g.jsx(WS,{ref:n,className:Y("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}));RT.displayName=WS.displayName;const NT=y.forwardRef(({className:e,...t},n)=>g.jsx(GS,{ref:n,className:Y("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}));NT.displayName=GS.displayName;const iY=cU,TT=y.forwardRef(({className:e,...t},n)=>g.jsx(t1,{ref:n,className:Y("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));TT.displayName=t1.displayName;const MT=y.forwardRef(({className:e,...t},n)=>g.jsx(n1,{ref:n,className:Y("aspect-square h-full w-full",e),...t}));MT.displayName=n1.displayName;const DT=y.forwardRef(({className:e,...t},n)=>g.jsx(r1,{ref:n,className:Y("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));DT.displayName=r1.displayName;const aY=Cn("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 sY({className:e,variant:t,...n}){const{variants:r}=Po(),o=E.useMemo(()=>Cn(r.badge.defaultStyles,{variants:r.badge.variantStyles,defaultVariants:r.badge.defaultVariants}),[r]);return g.jsx("div",{className:Y(o({variant:t}),e),...n})}const kT=y.forwardRef(({...e},t)=>g.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));kT.displayName="Breadcrumb";const OT=y.forwardRef(({className:e,...t},n)=>g.jsx("ol",{ref:n,className:Y("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));OT.displayName="BreadcrumbList";const AT=y.forwardRef(({className:e,...t},n)=>g.jsx("li",{ref:n,className:Y("inline-flex items-center gap-1.5",e),...t}));AT.displayName="BreadcrumbItem";const IT=y.forwardRef(({className:e,...t},n)=>g.jsx("a",{ref:n,className:Y("transition-colors hover:text-foreground hover:underline",e),...t}));IT.displayName="BreadcrumbLink";const jT=y.forwardRef(({className:e,...t},n)=>g.jsx("span",{ref:n,role:"link","aria-current":"page",className:Y("font-normal text-foreground",e),...t}));jT.displayName="BreadcrumbPage";const $T=({className:e,...t})=>g.jsx("li",{role:"presentation","aria-hidden":"true",className:Y("[&>svg]:size-3.5",e),...t,children:g.jsx(Co,{})});$T.displayName="BreadcrumbSeparator";const lY=Cn("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"}}),Yn=E.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const a=r?p3:"button",{variants:s}=Po(),l=E.useMemo(()=>Cn(s.button.defaultStyles,{variants:s.button.variantStyles,defaultVariants:s.button.defaultVariants}),[s]);return g.jsx(a,{className:Y(l({variant:t,size:n,className:e})),ref:i,...o})});Yn.displayName="Button";function qe(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 En(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Zt(e,t){const n=qe(e);return isNaN(t)?En(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Kn(e,t){const n=qe(e);if(isNaN(t))return En(e,NaN);if(!t)return n;const r=n.getDate(),o=En(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 $g=6048e5,cY=864e5;let uY={};function Sl(){return uY}function Cr(e,t){var s,l,c,u;const n=Sl(),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=qe(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 oi(e){return Cr(e,{weekStartsOn:1})}function FT(e){const t=qe(e),n=t.getFullYear(),r=En(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=oi(r),i=En(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const a=oi(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Da(e){const t=qe(e);return t.setHours(0,0,0,0),t}function _d(e){const t=qe(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 Er(e,t){const n=Da(e),r=Da(t),o=+n-_d(n),i=+r-_d(r);return Math.round((o-i)/cY)}function dY(e){const t=FT(e),n=En(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),oi(n)}function Fg(e,t){const n=t*7;return Zt(e,n)}function fY(e,t){return Kn(e,t*12)}function hY(e){let t;return e.forEach(function(n){const r=qe(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function pY(e){let t;return e.forEach(n=>{const r=qe(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function sn(e,t){const n=Da(e),r=Da(t);return+n==+r}function Lg(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function mY(e){if(!Lg(e)&&typeof e!="number")return!1;const t=qe(e);return!isNaN(Number(t))}function Cl(e,t){const n=qe(e),r=qe(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function gY(e,t,n){const r=Cr(e,n),o=Cr(t,n),i=+r-_d(r),a=+o-_d(o);return Math.round((i-a)/$g)}function zg(e){const t=qe(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function ln(e){const t=qe(e);return t.setDate(1),t.setHours(0,0,0,0),t}function LT(e){const t=qe(e),n=En(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Bg(e,t){var s,l,c,u;const n=Sl(),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=qe(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 zT(e){return Bg(e,{weekStartsOn:1})}const wY={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"}},vY=(e,t,n)=>{let r;const o=wY[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 Hg(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const yY={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bY={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xY={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_Y={date:Hg({formats:yY,defaultWidth:"full"}),time:Hg({formats:bY,defaultWidth:"full"}),dateTime:Hg({formats:xY,defaultWidth:"full"})},SY={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},CY=(e,t,n,r)=>SY[e];function El(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 EY={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},PY={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},RY={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"]},NY={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"]},TY={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"}},MY={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"}},DY={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:El({values:EY,defaultWidth:"wide"}),quarter:El({values:PY,defaultWidth:"wide",argumentCallback:e=>e-1}),month:El({values:RY,defaultWidth:"wide"}),day:El({values:NY,defaultWidth:"wide"}),dayPeriod:El({values:TY,defaultWidth:"wide",formattingValues:MY,defaultFormattingWidth:"wide"})};function Pl(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)?OY(s,d=>d.test(a)):kY(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 kY(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function OY(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function AY(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 IY=/^(\d+)(th|st|nd|rd)?/i,jY=/\d+/i,$Y={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},FY={any:[/^b/i,/^(a|c)/i]},LY={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zY={any:[/1/i,/2/i,/3/i,/4/i]},BY={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},HY={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]},UY={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},VY={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]},WY={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},GY={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}},qY={ordinalNumber:AY({matchPattern:IY,parsePattern:jY,valueCallback:e=>parseInt(e,10)}),era:Pl({matchPatterns:$Y,defaultMatchWidth:"wide",parsePatterns:FY,defaultParseWidth:"any"}),quarter:Pl({matchPatterns:LY,defaultMatchWidth:"wide",parsePatterns:zY,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Pl({matchPatterns:BY,defaultMatchWidth:"wide",parsePatterns:HY,defaultParseWidth:"any"}),day:Pl({matchPatterns:UY,defaultMatchWidth:"wide",parsePatterns:VY,defaultParseWidth:"any"}),dayPeriod:Pl({matchPatterns:WY,defaultMatchWidth:"any",parsePatterns:GY,defaultParseWidth:"any"})},BT={code:"en-US",formatDistance:vY,formatLong:_Y,formatRelative:CY,localize:DY,match:qY,options:{weekStartsOn:0,firstWeekContainsDate:1}};function YY(e){const t=qe(e);return Er(t,LT(t))+1}function HT(e){const t=qe(e),n=+oi(t)-+dY(t);return Math.round(n/$g)+1}function UT(e,t){var u,d,f,h;const n=qe(e),r=n.getFullYear(),o=Sl(),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=En(e,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const s=Cr(a,t),l=En(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=Cr(l,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function KY(e,t){var s,l,c,u;const n=Sl(),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=UT(e,t),i=En(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Cr(i,t)}function VT(e,t){const n=qe(e),r=+Cr(n,t)-+KY(n,t);return Math.round(r/$g)+1}function tt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ro={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return tt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):tt(n+1,2)},d(e,t){return tt(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 tt(e.getHours()%12||12,t.length)},H(e,t){return tt(e.getHours(),t.length)},m(e,t){return tt(e.getMinutes(),t.length)},s(e,t){return tt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return tt(o,t.length)}},ka={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},WT={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 Ro.y(e,t)},Y:function(e,t,n,r){const o=UT(e,r),i=o>0?o:1-o;if(t==="YY"){const a=i%100;return tt(a,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):tt(i,t.length)},R:function(e,t){const n=FT(e);return tt(n,t.length)},u:function(e,t){const n=e.getFullYear();return tt(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 tt(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 tt(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 Ro.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 tt(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=VT(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):tt(o,t.length)},I:function(e,t,n){const r=HT(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):tt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ro.d(e,t)},D:function(e,t,n){const r=YY(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):tt(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 tt(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 tt(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 tt(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=ka.noon:r===0?o=ka.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=ka.evening:r>=12?o=ka.afternoon:r>=4?o=ka.morning:o=ka.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 Ro.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ro.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):tt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):tt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ro.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ro.s(e,t)},S:function(e,t){return Ro.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return qT(r);case"XXXX":case"XX":return ii(r);case"XXXXX":case"XXX":default:return ii(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return qT(r);case"xxxx":case"xx":return ii(r);case"xxxxx":case"xxx":default:return ii(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+GT(r,":");case"OOOO":default:return"GMT"+ii(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+GT(r,":");case"zzzz":default:return"GMT"+ii(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return tt(r,t.length)},T:function(e,t,n){const r=e.getTime();return tt(r,t.length)}};function GT(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+tt(i,2)}function qT(e,t){return e%60===0?(e>0?"-":"+")+tt(Math.abs(e)/60,2):ii(e,t)}function ii(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=tt(Math.trunc(r/60),2),i=tt(r%60,2);return n+o+t+i}const YT=(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"})}},KT=(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"})}},XY={p:KT,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return YT(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}}",YT(r,t)).replace("{{time}}",KT(o,t))}},ZY=/^D+$/,JY=/^Y+$/,QY=["D","DD","YY","YYYY"];function e6(e){return ZY.test(e)}function t6(e){return JY.test(e)}function n6(e,t,n){const r=r6(e,t,n);if(console.warn(r),QY.includes(e))throw new RangeError(r)}function r6(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 o6=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,i6=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,a6=/^'([^]*?)'?$/,s6=/''/g,l6=/[a-zA-Z]/;function Pr(e,t,n){var u,d,f,h,p,m,v,w;const r=Sl(),o=(n==null?void 0:n.locale)??r.locale??BT,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=qe(e);if(!mY(s))throw new RangeError("Invalid time value");let l=t.match(i6).map(b=>{const x=b[0];if(x==="p"||x==="P"){const S=XY[x];return S(b,o.formatLong)}return b}).join("").match(o6).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const x=b[0];if(x==="'")return{isToken:!1,value:c6(b)};if(WT[x])return{isToken:!0,value:b};if(x.match(l6))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)&&t6(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&e6(x))&&n6(x,t,String(e));const S=WT[x[0]];return S(s,x,o.localize,c)}).join("")}function c6(e){const t=e.match(a6);return t?t[1].replace(s6,"'"):e}function u6(e){const t=qe(e),n=t.getFullYear(),r=t.getMonth(),o=En(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function d6(e){return Math.trunc(+qe(e)/1e3)}function f6(e){const t=qe(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function h6(e,t){return gY(f6(e),ln(e),t)+1}function Ug(e,t){const n=qe(e),r=qe(t);return n.getTime()>r.getTime()}function XT(e,t){const n=qe(e),r=qe(t);return+n<+r}function Vg(e,t){const n=qe(e),r=qe(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function p6(e,t){const n=qe(e),r=qe(t);return n.getFullYear()===r.getFullYear()}function Wg(e,t){return Zt(e,-t)}function Gg(e,t){const n=qe(e),r=n.getFullYear(),o=n.getDate(),i=En(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const a=u6(i);return n.setMonth(t,Math.min(o,a)),n}function ZT(e,t){const n=qe(e);return isNaN(+n)?En(e,NaN):(n.setFullYear(t),n)}var Ne=function(){return Ne=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},Ne.apply(this,arguments)};function m6(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 JT(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 Rl(e){return e.mode==="multiple"}function Nl(e){return e.mode==="range"}function Sd(e){return e.mode==="single"}var g6={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 w6(e,t){return Pr(e,"LLLL y",t)}function v6(e,t){return Pr(e,"d",t)}function y6(e,t){return Pr(e,"LLLL",t)}function b6(e){return"".concat(e)}function x6(e,t){return Pr(e,"cccccc",t)}function _6(e,t){return Pr(e,"yyyy",t)}var S6=Object.freeze({__proto__:null,formatCaption:w6,formatDay:v6,formatMonthCaption:y6,formatWeekNumber:b6,formatWeekdayName:x6,formatYearCaption:_6}),C6=function(e,t,n){return Pr(e,"do MMMM (EEEE)",n)},E6=function(){return"Month: "},P6=function(){return"Go to next month"},R6=function(){return"Go to previous month"},N6=function(e,t){return Pr(e,"cccc",t)},T6=function(e){return"Week n. ".concat(e)},M6=function(){return"Year: "},D6=Object.freeze({__proto__:null,labelDay:C6,labelMonthDropdown:E6,labelNext:P6,labelPrevious:R6,labelWeekNumber:T6,labelWeekday:N6,labelYearDropdown:M6});function k6(){var e="buttons",t=g6,n=BT,r={},o={},i=1,a={},s=new Date;return{captionLayout:e,classNames:t,formatters:S6,labels:D6,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:a,today:s,mode:"default"}}function O6(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,a=e.toDate;return r?i=ln(r):t&&(i=new Date(t,0,1)),o?a=zg(o):n&&(a=new Date(n,11,31)),{fromDate:i?Da(i):void 0,toDate:a?Da(a):void 0}}var QT=E.createContext(void 0);function A6(e){var t,n=e.initialProps,r=k6(),o=O6(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;(Sd(n)||Rl(n)||Nl(n))&&(l=n.onSelect);var c=Ne(Ne(Ne({},r),n),{captionLayout:s,classNames:Ne(Ne({},r.classNames),n.classNames),components:Ne({},n.components),formatters:Ne(Ne({},r.formatters),n.formatters),fromDate:i,labels:Ne(Ne({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Ne(Ne({},r.modifiers),n.modifiers),modifiersClassNames:Ne(Ne({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Ne(Ne({},r.styles),n.styles),toDate:a});return g.jsx(QT.Provider,{value:c,children:e.children})}function st(){var e=E.useContext(QT);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function eM(e){var t=st(),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 I6(e){return g.jsx("svg",Ne({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 tM(e){var t,n,r=e.onChange,o=e.value,i=e.children,a=e.caption,s=e.className,l=e.style,c=st(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:I6;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 j6(e){var t,n=st(),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(p6(r,o))for(var f=ln(r),h=r.getMonth();h<=o.getMonth();h++)d.push(Gg(f,h));else for(var f=ln(new Date),h=0;h<=11;h++)d.push(Gg(f,h));var p=function(v){var w=Number(v.target.value),b=Gg(ln(e.displayMonth),w);e.onChange(b)},m=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:tM;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 $6(e){var t,n=e.displayMonth,r=st(),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(ZT(LT(new Date),m));var v=function(b){var x=ZT(ln(n),Number(b.target.value));e.onChange(x)},w=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:tM;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 F6(e,t){var n=E.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function L6(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&&Cl(i,o)<0){var c=-1*(l-1);o=Kn(i,c)}return a&&Cl(o,a)<0&&(o=a),ln(o)}function z6(){var e=st(),t=L6(e),n=F6(t,e.month),r=n[0],o=n[1],i=function(a){var s;if(!e.disableNavigation){var l=ln(a);o(l),(s=e.onMonthChange)===null||s===void 0||s.call(e,l)}};return[r,i]}function B6(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=ln(e),i=ln(Kn(o,r)),a=Cl(i,o),s=[],l=0;l<a;l++){var c=Kn(o,l);s.push(c)}return n&&(s=s.reverse()),s}function H6(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=ln(e);if(!n)return Kn(s,a);var l=Cl(n,e);if(!(l<i))return Kn(s,a)}}function U6(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=ln(e);if(!n)return Kn(s,-a);var l=Cl(s,n);if(!(l<=0))return Kn(s,-a)}}var nM=E.createContext(void 0);function V6(e){var t=st(),n=z6(),r=n[0],o=n[1],i=B6(r,t),a=H6(r,t),s=U6(r,t),l=function(d){return i.some(function(f){return Vg(d,f)})},c=function(d,f){l(d)||(f&&XT(d,f)?o(Kn(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(nM.Provider,{value:u,children:e.children})}function Tl(){var e=E.useContext(nM);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function rM(e){var t,n=st(),r=n.classNames,o=n.styles,i=n.components,a=Tl().goToMonth,s=function(u){a(Kn(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:eM,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(j6,{onChange:s,displayMonth:e.displayMonth}),g.jsx($6,{onChange:s,displayMonth:e.displayMonth})]})}function W6(e){return g.jsx("svg",Ne({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 G6(e){return g.jsx("svg",Ne({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 Cd=E.forwardRef(function(e,t){var n=st(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var a=i.join(" "),s=Ne(Ne({},o.button_reset),o.button);return e.style&&Object.assign(s,e.style),g.jsx("button",Ne({},e,{ref:t,type:"button",className:a,style:s}))});function q6(e){var t,n,r=st(),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:G6,w=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:W6;return g.jsxs("div",{className:a.nav,style:s.nav,children:[!e.hidePrevious&&g.jsx(Cd,{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(Cd,{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 oM(e){var t=st().numberOfMonths,n=Tl(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,a=n.displayMonths,s=a.findIndex(function(p){return Vg(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(q6,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:o,previousMonth:r,onPreviousClick:f,onNextClick:h})}function Y6(e){var t,n=st(),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:eM,c;return o?c=g.jsx(l,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?c=g.jsx(rM,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?c=g.jsxs(g.Fragment,{children:[g.jsx(rM,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),g.jsx(oM,{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(oM,{displayMonth:e.displayMonth,id:e.id})]}),g.jsx("div",{className:r.caption,style:i.caption,children:c})}function K6(e){var t=st(),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 X6(e,t,n){for(var r=n?oi(new Date):Cr(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var a=Zt(r,i);o.push(a)}return o}function Z6(){var e=st(),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=X6(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 J6(){var e,t=st(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:Z6;return g.jsx("thead",{style:r.head,className:n.head,children:g.jsx(i,{})})}function Q6(e){var t=st(),n=t.locale,r=t.formatters.formatDay;return g.jsx(g.Fragment,{children:r(e.date,{locale:n})})}var qg=E.createContext(void 0);function eK(e){if(!Rl(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return g.jsx(qg.Provider,{value:t,children:e.children})}return g.jsx(tK,{initialProps:e.initialProps,children:e.children})}function tK(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?JT([],r):[];if(u.selected){var w=v.findIndex(function(b){return sn(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 sn(f,c)});return!!(u&&!d)});var l={selected:r,onDayClick:a,modifiers:s};return g.jsx(qg.Provider,{value:l,children:n})}function Yg(){var e=E.useContext(qg);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function nK(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?sn(o,e)&&sn(r,e)?void 0:sn(o,e)?{from:o,to:void 0}:sn(r,e)?void 0:Ug(r,e)?{from:e,to:o}:{from:r,to:e}:o?Ug(e,o)?{from:o,to:e}:{from:e,to:o}:r?XT(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var Kg=E.createContext(void 0);function rK(e){if(!Nl(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return g.jsx(Kg.Provider,{value:t,children:e.children})}return g.jsx(oK,{initialProps:e.initialProps,children:e.children})}function oK(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=nK(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],sn(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:Wg(i,s-1),before:Zt(i,s-1)}),i&&a&&u.disabled.push({after:i,before:Zt(i,s-1)}),!i&&a&&u.disabled.push({after:Wg(a,s-1),before:Zt(a,s-1)})),l){if(i&&!a&&(u.disabled.push({before:Zt(i,-l+1)}),u.disabled.push({after:Zt(i,l-1)})),i&&a){var d=Er(a,i)+1,f=l-d;u.disabled.push({before:Wg(i,f)}),u.disabled.push({after:Zt(a,f)})}!i&&a&&(u.disabled.push({before:Zt(a,-l+1)}),u.disabled.push({after:Zt(a,l-1)}))}return g.jsx(Kg.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function Xg(){var e=E.useContext(Kg);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Ed(e){return Array.isArray(e)?JT([],e):e!==void 0?[e]:[]}function iK(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=Ed(o)}),t}var Xn;(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"})(Xn||(Xn={}));var aK=Xn.Selected,Hr=Xn.Disabled,sK=Xn.Hidden,lK=Xn.Today,Zg=Xn.RangeEnd,Jg=Xn.RangeMiddle,Qg=Xn.RangeStart,cK=Xn.Outside;function uK(e,t,n){var r,o=(r={},r[aK]=Ed(e.selected),r[Hr]=Ed(e.disabled),r[sK]=Ed(e.hidden),r[lK]=[e.today],r[Zg]=[],r[Jg]=[],r[Qg]=[],r[cK]=[],r);return e.fromDate&&o[Hr].push({before:e.fromDate}),e.toDate&&o[Hr].push({after:e.toDate}),Rl(e)?o[Hr]=o[Hr].concat(t.modifiers[Hr]):Nl(e)&&(o[Hr]=o[Hr].concat(n.modifiers[Hr]),o[Qg]=n.modifiers[Qg],o[Jg]=n.modifiers[Jg],o[Zg]=n.modifiers[Zg]),o}var iM=E.createContext(void 0);function dK(e){var t=st(),n=Yg(),r=Xg(),o=uK(t,n,r),i=iK(t.modifiers),a=Ne(Ne({},o),i);return g.jsx(iM.Provider,{value:a,children:e.children})}function aM(){var e=E.useContext(iM);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function fK(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function hK(e){return!!(e&&typeof e=="object"&&"from"in e)}function pK(e){return!!(e&&typeof e=="object"&&"after"in e)}function mK(e){return!!(e&&typeof e=="object"&&"before"in e)}function gK(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function wK(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=Er(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var a=Er(e,r)>=0&&Er(o,e)>=0;return a}return o?sn(o,e):r?sn(r,e):!1}function vK(e){return Lg(e)}function yK(e){return Array.isArray(e)&&e.every(Lg)}function bK(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(vK(n))return sn(e,n);if(yK(n))return n.includes(e);if(hK(n))return wK(e,n);if(gK(n))return n.dayOfWeek.includes(e.getDay());if(fK(n)){var r=Er(n.before,e),o=Er(n.after,e),i=r>0,a=o<0,s=Ug(n.before,n.after);return s?a&&i:i||a}return pK(n)?Er(e,n.after)>0:mK(n)?Er(n.before,e)>0:typeof n=="function"?n(e):!1})}function ew(e,t,n){var r=Object.keys(t).reduce(function(i,a){var s=t[a];return bK(e,s)&&i.push(a),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!Vg(e,n)&&(o.outside=!0),o}function xK(e,t){for(var n=ln(e[0]),r=zg(e[e.length-1]),o,i,a=n;a<=r;){var s=ew(a,t),l=!s.disabled&&!s.hidden;if(!l){a=Zt(a,1);continue}if(s.selected)return a;s.today&&!i&&(i=a),o||(o=a),a=Zt(a,1)}return i||o}var _K=365;function sM(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:Zt,week:Fg,month:Kn,year:fY,startOfWeek:function(v){return o.ISOWeek?oi(v):Cr(v,{locale:d,weekStartsOn:l})},endOfWeek:function(v){return o.ISOWeek?zT(v):Bg(v,{locale:d,weekStartsOn:l})}},h=f[n](e,r==="after"?1:-1);r==="before"&&c?h=hY([c,h]):r==="after"&&u&&(h=pY([u,h]));var p=!0;if(i){var m=ew(h,i);p=!m.disabled&&!m.hidden}return p?h:s.count>_K?s.lastFocused:sM(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:Ne(Ne({},s),{count:s.count+1})})}var lM=E.createContext(void 0);function SK(e){var t=Tl(),n=aM(),r=E.useState(),o=r[0],i=r[1],a=E.useState(),s=a[0],l=a[1],c=xK(t.displayMonths,n),u=o??(s&&t.isDateDisplayed(s))?s:c,d=function(){l(o),i(void 0)},f=function(v){i(v)},h=st(),p=function(v,w){if(o){var b=sM(o,{moveBy:v,direction:w,context:h,modifiers:n});sn(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(lM.Provider,{value:m,children:e.children})}function tw(){var e=E.useContext(lM);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function CK(e,t){var n=aM(),r=ew(e,n,t);return r}var nw=E.createContext(void 0);function EK(e){if(!Sd(e.initialProps)){var t={selected:void 0};return g.jsx(nw.Provider,{value:t,children:e.children})}return g.jsx(PK,{initialProps:e.initialProps,children:e.children})}function PK(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(nw.Provider,{value:o,children:n})}function cM(){var e=E.useContext(nw);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function RK(e,t){var n=st(),r=cM(),o=Yg(),i=Xg(),a=tw(),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(X){var B,ee,Z,J;Sd(n)?(B=r.onDayClick)===null||B===void 0||B.call(r,e,t,X):Rl(n)?(ee=o.onDayClick)===null||ee===void 0||ee.call(o,e,t,X):Nl(n)?(Z=i.onDayClick)===null||Z===void 0||Z.call(i,e,t,X):(J=n.onDayClick)===null||J===void 0||J.call(n,e,t,X)},S=function(X){var B;f(e),(B=n.onDayFocus)===null||B===void 0||B.call(n,e,t,X)},C=function(X){var B;d(),(B=n.onDayBlur)===null||B===void 0||B.call(n,e,t,X)},N=function(X){var B;(B=n.onDayMouseEnter)===null||B===void 0||B.call(n,e,t,X)},R=function(X){var B;(B=n.onDayMouseLeave)===null||B===void 0||B.call(n,e,t,X)},T=function(X){var B;(B=n.onDayPointerEnter)===null||B===void 0||B.call(n,e,t,X)},M=function(X){var B;(B=n.onDayPointerLeave)===null||B===void 0||B.call(n,e,t,X)},k=function(X){var B;(B=n.onDayTouchCancel)===null||B===void 0||B.call(n,e,t,X)},O=function(X){var B;(B=n.onDayTouchEnd)===null||B===void 0||B.call(n,e,t,X)},F=function(X){var B;(B=n.onDayTouchMove)===null||B===void 0||B.call(n,e,t,X)},L=function(X){var B;(B=n.onDayTouchStart)===null||B===void 0||B.call(n,e,t,X)},K=function(X){var B;(B=n.onDayKeyUp)===null||B===void 0||B.call(n,e,t,X)},ne=function(X){var B;switch(X.key){case"ArrowLeft":X.preventDefault(),X.stopPropagation(),n.dir==="rtl"?s():l();break;case"ArrowRight":X.preventDefault(),X.stopPropagation(),n.dir==="rtl"?l():s();break;case"ArrowDown":X.preventDefault(),X.stopPropagation(),c();break;case"ArrowUp":X.preventDefault(),X.stopPropagation(),u();break;case"PageUp":X.preventDefault(),X.stopPropagation(),X.shiftKey?m():h();break;case"PageDown":X.preventDefault(),X.stopPropagation(),X.shiftKey?v():p();break;case"Home":X.preventDefault(),X.stopPropagation(),w();break;case"End":X.preventDefault(),X.stopPropagation(),b();break}(B=n.onDayKeyDown)===null||B===void 0||B.call(n,e,t,X)},q={onClick:x,onFocus:S,onBlur:C,onKeyDown:ne,onKeyUp:K,onMouseEnter:N,onMouseLeave:R,onPointerEnter:T,onPointerLeave:M,onTouchCancel:k,onTouchEnd:O,onTouchMove:F,onTouchStart:L};return q}function NK(){var e=st(),t=cM(),n=Yg(),r=Xg(),o=Sd(e)?t.selected:Rl(e)?n.selected:Nl(e)?r.selected:void 0;return o}function TK(e){return Object.values(Xn).includes(e)}function MK(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(TK(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function DK(e,t){var n=Ne({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=Ne(Ne({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function kK(e,t,n){var r,o,i,a=st(),s=tw(),l=CK(e,t),c=RK(e,l),u=NK(),d=!!(a.onDayClick||a.mode!=="default");E.useEffect(function(){var N;l.outside||s.focusedDay&&d&&sn(s.focusedDay,e)&&((N=n.current)===null||N===void 0||N.focus())},[s.focusedDay,e,n,d,l.outside]);var f=MK(a,l).join(" "),h=DK(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:Q6,v=g.jsx(m,{date:e,displayMonth:t,activeModifiers:l}),w={style:h,className:f,children:v,role:"gridcell"},b=s.focusTarget&&sn(s.focusTarget,e)&&!l.outside,x=s.focusedDay&&sn(s.focusedDay,e),S=Ne(Ne(Ne({},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:S,divProps:w};return C}function OK(e){var t=E.useRef(null),n=kK(e.date,e.displayMonth,t);return n.isHidden?g.jsx("div",{role:"gridcell"}):n.isButton?g.jsx(Cd,Ne({name:"day",ref:t},n.buttonProps)):g.jsx("div",Ne({},n.divProps))}function AK(e){var t=e.number,n=e.dates,r=st(),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(Cd,{name:"week-number","aria-label":d,className:a.weeknumber,style:i.weeknumber,onClick:f,children:u})}function IK(e){var t,n,r=st(),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:OK,c=(n=s==null?void 0:s.WeekNumber)!==null&&n!==void 0?n:AK,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})},d6(d))})]})}function uM(e,t,n){for(var r=n!=null&&n.ISOWeek?zT(t):Bg(t,n),o=n!=null&&n.ISOWeek?oi(e):Cr(e,n),i=Er(r,o),a=[],s=0;s<=i;s++)a.push(Zt(o,s));var l=a.reduce(function(c,u){var d=n!=null&&n.ISOWeek?HT(u):VT(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 jK(e,t){var n=uM(ln(e),zg(e),t);if(t!=null&&t.useFixedWeeks){var r=h6(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],a=Fg(i,6-r),s=uM(Fg(i,1),a,t);n.push.apply(n,s)}}return n}function $K(e){var t,n,r,o=st(),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=jK(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:J6,v=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:IK,w=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:K6;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 FK(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var LK=FK()?E.useLayoutEffect:E.useEffect,rw=!1,zK=0;function dM(){return"react-day-picker-".concat(++zK)}function BK(e){var t,n=e??(rw?dM():null),r=E.useState(n),o=r[0],i=r[1];return LK(function(){o===null&&i(dM())},[]),E.useEffect(function(){rw===!1&&(rw=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function HK(e){var t,n,r=st(),o=r.dir,i=r.classNames,a=r.styles,s=r.components,l=Tl().displayMonths,c=BK(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=Ne(Ne({},f),a.caption_start)),p&&(d.push(i.caption_end),f=Ne(Ne({},f),a.caption_end)),m&&(d.push(i.caption_between),f=Ne(Ne({},f),a.caption_between));var v=(n=s==null?void 0:s.Caption)!==null&&n!==void 0?n:Y6;return g.jsxs("div",{className:d.join(" "),style:f,children:[g.jsx(v,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),g.jsx($K,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function UK(e){var t=st(),n=t.classNames,r=t.styles;return g.jsx("div",{className:n.months,style:r.months,children:e.children})}function VK(e){var t,n,r=e.initialProps,o=st(),i=tw(),a=Tl(),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=Ne(Ne({},o.styles.root),o.style),f=Object.keys(r).filter(function(p){return p.startsWith("data-")}).reduce(function(p,m){var v;return Ne(Ne({},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:UK;return g.jsx("div",Ne({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(HK,{displayIndex:m,displayMonth:p},m)})})}))}function WK(e){var t=e.children,n=m6(e,["children"]);return g.jsx(A6,{initialProps:n,children:g.jsx(V6,{children:g.jsx(EK,{initialProps:n,children:g.jsx(eK,{initialProps:n,children:g.jsx(rK,{initialProps:n,children:g.jsx(dK,{children:g.jsx(SK,{children:t})})})})})})})}function GK(e){return g.jsx(WK,Ne({},e,{children:g.jsx(VK,{initialProps:e})}))}function Pd({className:e,classNames:t,showOutsideDays:n=!0,...r}){const{variants:o}=Po(),i=E.useMemo(()=>Cn(o.button.defaultStyles,{variants:o.button.variantStyles,defaultVariants:o.button.defaultVariants}),[o]);return g.jsx(GK,{showOutsideDays:n,className:Y("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:Y(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-muted-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:Y(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-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:()=>g.jsx(yd,{className:"h-4 w-4"}),IconRight:()=>g.jsx(Co,{className:"h-4 w-4"})},...r})}Pd.displayName="Calendar";const fM=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Y("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));fM.displayName="Card";const hM=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Y("flex flex-col space-y-1.5 p-6",e),...t}));hM.displayName="CardHeader";const pM=y.forwardRef(({className:e,...t},n)=>g.jsx("h3",{ref:n,className:Y("text-2xl font-semibold leading-none tracking-tight",e),...t}));pM.displayName="CardTitle";const mM=y.forwardRef(({className:e,...t},n)=>g.jsx("p",{ref:n,className:Y("text-sm text-muted-foreground",e),...t}));mM.displayName="CardDescription";const gM=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Y("p-6 pt-0",e),...t}));gM.displayName="CardContent";const wM=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Y("flex items-center p-6 pt-0",e),...t}));wM.displayName="CardFooter";function qK(e){return Object.prototype.toString.call(e)==="[object Object]"}function vM(e){return qK(e)||Array.isArray(e)}function YK(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function ow(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}`:!vM(s)||!vM(l)?s===l:ow(s,l)})}function yM(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function KK(e,t){if(e.length!==t.length)return!1;const n=yM(e),r=yM(t);return n.every((o,i)=>{const a=r[i];return ow(o,a)})}function iw(e){return typeof e=="number"}function aw(e){return typeof e=="string"}function Rd(e){return typeof e=="boolean"}function bM(e){return Object.prototype.toString.call(e)==="[object Object]"}function mt(e){return Math.abs(e)}function sw(e){return Math.sign(e)}function Ml(e,t){return mt(e-t)}function XK(e,t){if(e===0||t===0||mt(e)<=mt(t))return 0;const n=Ml(mt(e),mt(t));return mt(n/e)}function ZK(e){return Math.round(e*100)/100}function Dl(e){return Ol(e).map(Number)}function Zn(e){return e[kl(e)]}function kl(e){return Math.max(0,e.length-1)}function lw(e,t){return t===kl(e)}function xM(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Ol(e){return Object.keys(e)}function _M(e,t){return[e,t].reduce((n,r)=>(Ol(r).forEach(o=>{const i=n[o],a=r[o],s=bM(i)&&bM(a);n[o]=s?_M(i,a):a}),n),{})}function cw(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function JK(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 aw(e)?n[e](l):e(t,l,c)}return{measure:a}}function Al(){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 QK(e,t,n,r){const o=Al(),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 eX(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 ai(e=0,t=0){const n=mt(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 SM(e,t,n){const{constrain:r}=ai(0,e),o=e+1;let i=a(t);function a(f){return n?mt((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 SM(e,s(),n)}const d={get:s,set:l,add:c,clone:u};return d}function tX(e,t,n,r,o,i,a,s,l,c,u,d,f,h,p,m,v,w,b){const{cross:x,direction:S}=e,C=["INPUT","SELECT","TEXTAREA"],N={passive:!1},R=Al(),T=Al(),M=ai(50,225).constrain(h.measure(20)),k={mouse:300,touch:400},O={mouse:500,touch:600},F=p?43:25;let L=!1,K=0,ne=0,q=!1,X=!1,B=!1,ee=!1;function Z(z){if(!b)return;function se(fe){(Rd(b)||b(z,fe))&&j(fe)}const oe=t;R.add(oe,"dragstart",fe=>fe.preventDefault(),N).add(oe,"touchmove",()=>{},N).add(oe,"touchend",()=>{}).add(oe,"touchstart",se).add(oe,"mousedown",se).add(oe,"touchcancel",$).add(oe,"contextmenu",$).add(oe,"click",te,!0)}function J(){R.clear(),T.clear()}function H(){const z=ee?n:t;T.add(z,"touchmove",G,N).add(z,"touchend",$).add(z,"mousemove",G,N).add(z,"mouseup",$)}function I(z){const se=z.nodeName||"";return C.includes(se)}function V(){return(p?O:k)[ee?"mouse":"touch"]}function ae(z,se){const oe=d.add(sw(z)*-1),fe=u.byDistance(z,!p).distance;return p||mt(z)<M?fe:v&&se?fe*.5:u.byIndex(oe.get(),0).distance}function j(z){const se=cw(z,r);ee=se,B=p&&se&&!z.buttons&&L,L=Ml(o.get(),a.get())>=2,!(se&&z.button!==0)&&(I(z.target)||(q=!0,i.pointerDown(z),c.useFriction(0).useDuration(0),o.set(a),H(),K=i.readPoint(z),ne=i.readPoint(z,x),f.emit("pointerDown")))}function G(z){if(!cw(z,r)&&z.touches.length>=2)return $(z);const oe=i.readPoint(z),fe=i.readPoint(z,x),ge=Ml(oe,K),pe=Ml(fe,ne);if(!X&&!ee&&(!z.cancelable||(X=ge>pe,!X)))return $(z);const me=i.pointerMove(z);ge>m&&(B=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(S(me)),z.preventDefault()}function $(z){const oe=u.byDistance(0,!1).index!==d.get(),fe=i.pointerUp(z)*V(),ge=ae(S(fe),oe),pe=XK(fe,ge),me=F-10*pe,_e=w+pe/50;X=!1,q=!1,T.clear(),c.useDuration(me).useFriction(_e),l.distance(ge,!p),ee=!1,f.emit("pointerUp")}function te(z){B&&(z.stopPropagation(),z.preventDefault(),B=!1)}function ie(){return q}return{init:Z,destroy:J,pointerDown:ie}}function nX(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(cw(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&&mt(m)>.1?m:0}return{pointerDown:s,pointerMove:l,pointerUp:c,readPoint:a}}function rX(){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 oX(e){function t(r){return e*(r/100)}return{measure:t}}function iX(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 S=x.target===e,C=r.indexOf(x.target),N=S?c:u[C],R=f(S?e:r[C]);if(mt(R-N)>=.5){v.reInit(),t.emit("resize");break}}}l=new ResizeObserver(b=>{(Rd(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 aX(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=sw(T),d=u,C}function h(){const N=r.get()-t.get();return mt(N)<.001}function p(){return l}function m(){return s}function v(){return a}function w(){return x(o)}function b(){return S(i)}function x(N){return l=N,C}function S(N){return c=N,C}const C={direction:m,duration:p,velocity:v,seek:f,settled:h,useBaseFriction:b,useBaseDuration:w,useFriction:S,useDuration:x};return C}function sX(e,t,n,r,o){const i=o.measure(10),a=o.measure(50),s=ai(.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=mt(e[p]-t.get()),v=n.get()-t.get(),w=s.constrain(m/a);n.subtract(v*w),!h&&mt(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 lX(e,t,n,r,o){const i=ai(-t+e,0),a=d(),s=u(),l=f();function c(p,m){return Ml(p,m)<=1}function u(){const p=a[0],m=Zn(a),v=a.lastIndexOf(p),w=a.indexOf(m)+1;return ai(v,w)}function d(){return n.map((p,m)=>{const{min:v,max:w}=i,b=i.constrain(p),x=!m,S=lw(n,m);return x?w:S||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 cX(e,t,n){const r=t[0],o=n?r-e:Zn(t);return{limit:ai(o,r)}}function uX(e,t,n,r){const i=t.min+.1,a=t.max+.1,{reachedMin:s,reachedMax:l}=ai(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 dX(e){const{max:t,length:n}=e;function r(i){const a=i-t;return n?a/-n:0}return{get:r}}function fX(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=>Zn(m)[a]-m[0][i]).map(mt)}function f(){return r.map(m=>n[i]-m[i]).map(m=>-mt(m))}function h(){return s(c).map(m=>m[0]).map((m,v)=>m+l[v])}return{snaps:c,snapsAligned:u}}function hX(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=lw(v,m);if(w){const x=Zn(v[0])+1;return xM(x)}if(b){const x=kl(i)-Zn(v)[0]+1;return xM(x,Zn(v)[0])}return p})}return{slideRegistry:c}}function pX(e,t,n,r,o){const{reachedAny:i,removeOffset:a,constrain:s}=r;function l(p){return p.concat().sort((m,v)=>mt(m)-mt(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)=>mt(b.diff)-mt(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=>sw(b)===m);return w.length?l(w):Zn(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 S=t[w]-b,C=p+u(S,0);return{index:w,distance:C}}return{byDistance:f,byIndex:d,shortcut:u}}function mX(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 gX(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));iw(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=>{(Rd(s)||s(h,w))&&p(v)},l)})}function d(h){h.code==="Tab"&&(c=new Date().getTime())}return{init:u}}function Il(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 iw(l)?l:l.get()}return{get:n,set:r,add:o,subtract:i}}function CM(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=ZK(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 wX(e,t,n,r,o,i,a,s,l){const u=Dl(o),d=Dl(o).reverse(),f=w().concat(b());function h(R,T){return R.reduce((M,k)=>M-o[k],T)}function p(R,T){return R.reduce((M,k)=>h(M,T)>0?M.concat([k]):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 k=m(T);return R.map(O=>{const F=M?0:-n,L=M?n:0,K=M?"end":"start",ne=k[O][K];return{index:O,loopPoint:ne,slideLocation:Il(-1),translate:CM(e,l[O]),target:()=>s.get()>ne?F:L}})}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 S(){f.forEach(R=>{const{target:T,translate:M,slideLocation:k}=R,O=T();O!==k.get()&&(M.to(O),k.set(O))})}function C(){f.forEach(R=>R.translate.clear())}return{canLoop:x,clear:C,loop:S,loopPoints:f}}function vX(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||(Rd(n)||n(l,u))&&c(u)}),r.observe(e,{childList:!0})}function a(){r&&r.disconnect(),o=!0}return{init:i,destroy:a}}function yX(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 Ol(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 bX(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 mt(t[s]-b[s])}function m(){if(!c)return 0;const b=i.getComputedStyle(Zn(r));return parseFloat(b.getPropertyValue(`margin-${l}`))}function v(){return n.map((b,x,S)=>{const C=!x,N=lw(S,x);return C?f[x]+u:N?f[x]+d:S[x+1][s]-b[s]}).map(mt)}return{slideSizes:f,slideSizesWithGaps:h,startGap:u,endGap:d}}function xX(e,t,n,r,o,i,a,s,l){const{startEdge:c,endEdge:u,direction:d}=e,f=iw(n);function h(w,b){return Dl(w).filter(x=>x%b===0).map(x=>w.slice(x,x+b))}function p(w){return w.length?Dl(w).reduce((b,x,S)=>{const C=Zn(b)||0,N=C===0,R=x===kl(w),T=o[c]-i[C][c],M=o[c]-i[x][u],k=!r&&N?d(a):0,O=!r&&R?d(s):0,F=mt(M-O-(T+k));return S&&F>t+l&&b.push(x),R&&b.push(w.length),b},[]).map((b,x,S)=>{const C=Math.max(S[x-1]||0);return w.slice(C,b)}):[]}function m(w){return f?h(w,n):p(w)}return{groupSlides:m}}function _X(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:S,watchDrag:C,watchFocus:N}=i,R=2,T=rX(),M=T.measure(t),k=n.map(T.measure),O=eX(l,c),F=O.measureSize(M),L=oX(F),K=JK(s,F),ne=!d&&!!b,q=d||!!b,{slideSizes:X,slideSizesWithGaps:B,startGap:ee,endGap:Z}=bX(O,M,k,n,q,o),J=xX(O,F,v,d,M,k,ee,Z,R),{snaps:H,snapsAligned:I}=fX(O,K,M,k,J),V=-Zn(H)+Zn(B),{snapsContained:ae,scrollContainLimit:j}=lX(F,V,I,b,R),G=ne?ae:I,{limit:$}=cX(V,G,d),te=SM(kl(G),u,d),ie=te.clone(),re=Dl(n),z=({dragHandler:A,scrollBody:U,scrollBounds:Q,options:{loop:ce}})=>{ce||Q.constrain(A.pointerDown()),U.seek()},se=({scrollBody:A,translate:U,location:Q,offsetLocation:ce,previousLocation:ke,scrollLooper:rt,slideLooper:Je,dragHandler:it,animation:Ue,eventHandler:xe,scrollBounds:Ye,options:{loop:Xe}},Le)=>{const we=A.settled(),Ve=!Ye.shouldConstrain(),We=Xe?we:we&&Ve;We&&!it.pointerDown()&&(Ue.stop(),xe.emit("settle")),We||xe.emit("scroll");const pt=Q.get()*Le+ke.get()*(1-Le);ce.set(pt),Xe&&(rt.loop(A.direction()),Je.loop()),U.to(ce.get())},oe=QK(r,o,()=>z(P),A=>se(P,A)),fe=.68,ge=G[te.get()],pe=Il(ge),me=Il(ge),_e=Il(ge),Re=Il(ge),nt=aX(pe,_e,me,Re,f,fe),Ae=pX(d,G,V,$,Re),Me=mX(oe,te,ie,nt,Ae,Re,a),Ce=dX($),Fe=Al(),pn=yX(t,n,a,m),{slideRegistry:D}=hX(ne,b,G,j,J,re),_=gX(e,n,D,Me,nt,Fe,a,N),P={ownerDocument:r,ownerWindow:o,eventHandler:a,containerRect:M,slideRects:k,animation:oe,axis:O,dragHandler:tX(O,e,r,o,Re,nX(O,o),pe,oe,Me,nt,Ae,te,a,L,h,p,w,fe,C),eventStore:Fe,percentOfView:L,index:te,indexPrevious:ie,limit:$,location:pe,offsetLocation:_e,previousLocation:me,options:i,resizeHandler:iX(t,a,o,n,O,x,T),scrollBody:nt,scrollBounds:sX($,_e,Re,nt,L),scrollLooper:uX(V,$,_e,[pe,_e,me,Re]),scrollProgress:Ce,scrollSnapList:G.map(Ce.get),scrollSnaps:G,scrollTarget:Ae,scrollTo:Me,slideLooper:wX(O,F,V,X,B,H,G,_e,n),slideFocus:_,slidesHandler:vX(t,a,S),slidesInView:pn,slideIndexes:re,slideRegistry:D,slidesToScroll:J,target:Re,translate:CM(O,t)};return P}function SX(){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 CX={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 EX(e){function t(i,a){return _M(i,a||{})}function n(i){const a=i.breakpoints||{},s=Ol(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=>Ol(a.breakpoints||{})).reduce((a,s)=>a.concat(s),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function PX(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 Nd(e,t,n){const r=e.ownerDocument,o=r.defaultView,i=EX(o),a=PX(i),s=Al(),l=SX(),{mergeOptions:c,optionsAtMedia:u,optionsMediaQueries:d}=i,{on:f,off:h,emit:p}=l,m=O;let v=!1,w,b=c(CX,Nd.globalOptions),x=c(b),S=[],C,N,R;function T(){const{container:re,slides:z}=x;N=(aw(re)?e.querySelector(re):re)||e.children[0];const oe=aw(z)?N.querySelectorAll(z):z;R=[].slice.call(oe||N.children)}function M(re){const z=_X(e,N,R,r,o,re,l);if(re.loop&&!z.slideLooper.canLoop()){const se=Object.assign({},re,{loop:!1});return M(se)}return z}function k(re,z){v||(b=c(b,re),x=u(b),S=z||S,T(),w=M(x),d([b,...S.map(({options:se})=>se)]).forEach(se=>s.add(se,"change",O)),x.active&&(w.translate.to(w.location.get()),w.animation.init(),w.slidesInView.init(),w.slideFocus.init(ie),w.eventHandler.init(ie),w.resizeHandler.init(ie),w.slidesHandler.init(ie),w.options.loop&&w.slideLooper.loop(),N.offsetParent&&R.length&&w.dragHandler.init(ie),C=a.init(ie,S)))}function O(re,z){const se=J();F(),k(c({startIndex:se},re),z),l.emit("reInit")}function F(){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 L(){v||(v=!0,s.clear(),F(),l.emit("destroy"),l.clear())}function K(re,z,se){!x.active||v||(w.scrollBody.useBaseFriction().useDuration(z===!0?0:x.duration),w.scrollTo.index(re,se||0))}function ne(re){const z=w.index.add(1).get();K(z,re,-1)}function q(re){const z=w.index.add(-1).get();K(z,re,1)}function X(){return w.index.add(1).get()!==J()}function B(){return w.index.add(-1).get()!==J()}function ee(){return w.scrollSnapList}function Z(){return w.scrollProgress.get(w.location.get())}function J(){return w.index.get()}function H(){return w.indexPrevious.get()}function I(){return w.slidesInView.get()}function V(){return w.slidesInView.get(!1)}function ae(){return C}function j(){return w}function G(){return e}function $(){return N}function te(){return R}const ie={canScrollNext:X,canScrollPrev:B,containerNode:$,internalEngine:j,destroy:L,off:h,on:f,emit:p,plugins:ae,previousScrollSnap:H,reInit:m,rootNode:G,scrollNext:ne,scrollPrev:q,scrollProgress:Z,scrollSnapList:ee,scrollTo:K,selectedScrollSnap:J,slideNodes:te,slidesInView:I,slidesNotInView:V};return k(t,n),setTimeout(()=>l.emit("init"),0),ie}Nd.globalOptions=void 0;function uw(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(()=>{ow(n.current,e)||(n.current=e,l())},[e,l]),E.useEffect(()=>{KK(r.current,t)||(r.current=t,l())},[t,l]),E.useEffect(()=>{if(YK()&&a){Nd.globalOptions=uw.globalOptions;const c=Nd(a,n.current,r.current);return i(c),()=>c.destroy()}else i(void 0)},[a,i]),[s,o]}uw.globalOptions=void 0;const EM=E.forwardRef(({orientation:e="horizontal",opts:t,setApi:n,plugins:r,className:o,children:i,...a},s)=>{const[l,c]=uw({...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:Y("relative",o),...a,children:[g.jsx("div",{ref:l,className:"overflow-hidden",dir:"ltr",children:g.jsx("div",{className:Y("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:Y("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(Yn,{variant:"outline",size:"icon",className:Y("h-8 w-8 rounded-full",!u&&"opacity-50"),disabled:!u,onClick:()=>c==null?void 0:c.scrollPrev(),children:[g.jsx(yd,{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(Yn,{variant:"outline",size:"icon",className:Y("h-2 w-2 rounded-full",p===b?"bg-primary":"bg-muted"),onClick:()=>c==null?void 0:c.scrollTo(b),children:g.jsxs("span",{className:"sr-only",children:["Jump to slide ",b+1]})},b))}),g.jsxs(Yn,{variant:"outline",size:"icon",className:Y("h-8 w-8 rounded-full",!f&&"opacity-50"),disabled:!f,onClick:()=>c==null?void 0:c.scrollNext(),children:[g.jsx(Co,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Next slide"})]})]})]})});EM.displayName="Carousel";const PM=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,role:"list",className:Y("",e),...t}));PM.displayName="CarouselContent";const RM=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,role:"listitem",className:Y("",e),...t}));RM.displayName="CarouselItem";const NM=E.forwardRef(({className:e,...t},n)=>g.jsxs(Yn,{ref:n,variant:"outline",size:"icon",className:Y("absolute left-2 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full",e),...t,children:[g.jsx(yd,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Previous slide"})]}));NM.displayName="CarouselPrevious";const TM=E.forwardRef(({className:e,...t},n)=>g.jsxs(Yn,{ref:n,variant:"outline",size:"icon",className:Y("absolute right-2 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full",e),...t,children:[g.jsx(Co,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Next slide"})]}));TM.displayName="CarouselNext";const MM=E.forwardRef(({className:e,...t},n)=>g.jsx(l1,{ref:n,className:Y("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(wU,{className:Y("flex items-center justify-center text-current"),children:g.jsx(Ra,{className:"h-4 w-4"})})}));MM.displayName=l1.displayName;const RX=T_,NX=Cp,DM=E.forwardRef(({children:e,...t},n)=>g.jsx(Pp,{ref:n,className:"data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",...t,children:e}));DM.displayName="CollapsibleContent";var kM=1,TX=.9,MX=.8,DX=.17,dw=.1,fw=.999,kX=.9999,OX=.99,AX=/[\\\/_+.#"@\[\(\{&]/,IX=/[\\\/_+.#"@\[\(\{&]/g,jX=/[\s-]/,OM=/[\s-]/g;function hw(e,t,n,r,o,i,a){if(i===t.length)return o===e.length?kM:OX;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=hw(e,t,n,r,c+1,i+1,a),d>u&&(c===o?d*=kM:AX.test(e.charAt(c-1))?(d*=MX,h=e.slice(o,c-1).match(IX),h&&o>0&&(d*=Math.pow(fw,h.length))):jX.test(e.charAt(c-1))?(d*=TX,p=e.slice(o,c-1).match(OM),p&&o>0&&(d*=Math.pow(fw,p.length))):(d*=DX,o>0&&(d*=Math.pow(fw,c-o))),e.charAt(c)!==t.charAt(i)&&(d*=kX)),(d<dw&&n.charAt(c-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(c-1)!==r.charAt(i))&&(f=hw(e,t,n,r,c+1,i+2,a),f*dw>d&&(d=f*dw)),d>u&&(u=d),c=n.indexOf(l,c+1);return a[s]=u,u}function AM(e){return e.toLowerCase().replace(OM," ")}function $X(e,t){return hw(e,t,AM(e),AM(t),0,0,{})}function Mt(){return Mt=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},Mt.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 FX(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function IM(...e){return t=>e.forEach(n=>FX(n,t))}function jl(...e){return E.useCallback(IM(...e),e)}function LX(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,zX(o,...t)]}function zX(...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 pw=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},BX=y.useId||(()=>{});let HX=0;function mw(e){const[t,n]=y.useState(BX());return pw(()=>{e||n(r=>r??String(HX++))},[e]),e||(t?`radix-${t}`:"")}function li(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 UX({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=VX({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=li(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 VX({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,o=E.useRef(r),i=li(t);return E.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const gw=E.forwardRef((e,t)=>{const{children:n,...r}=e,o=E.Children.toArray(n),i=o.find(GX);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(ww,Mt({},r,{ref:t}),E.isValidElement(a)?E.cloneElement(a,void 0,s):null)}return E.createElement(ww,Mt({},r,{ref:t}),n)});gw.displayName="Slot";const ww=E.forwardRef((e,t)=>{const{children:n,...r}=e;return E.isValidElement(n)?E.cloneElement(n,{...qX(r,n.props),ref:IM(t,n.ref)}):E.Children.count(n)>1?E.Children.only(null):null});ww.displayName="SlotClone";const WX=({children:e})=>E.createElement(E.Fragment,null,e);function GX(e){return E.isValidElement(e)&&e.type===WX}function qX(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 ci=["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?gw:t;return E.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),E.createElement(s,Mt({},a,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function YX(e,t){e&&tr.flushSync(()=>e.dispatchEvent(t))}function KX(e){const t=li(e);E.useEffect(()=>{const n=r=>{r.key==="Escape"&&t(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t])}const vw="dismissableLayer.update",XX="dismissableLayer.pointerDownOutside",ZX="dismissableLayer.focusOutside";let jM;const JX=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),QX=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=E.useContext(JX),[u,d]=E.useState(null),[,f]=E.useState({}),h=jl(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,S=eZ(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=tZ(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 KX(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&&(jM=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),$M(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=jM)}},[u,n,c]),E.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),$M())},[u,c]),E.useEffect(()=>{const N=()=>f({});return document.addEventListener(vw,N),()=>document.removeEventListener(vw,N)},[]),E.createElement(ci.div,Mt({},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,S.onPointerDownCapture)}))});function eZ(e){const t=li(e),n=E.useRef(!1),r=E.useRef(()=>{});return E.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){FM(XX,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 tZ(e){const t=li(e),n=E.useRef(!1);return E.useEffect(()=>{const r=o=>{o.target&&!n.current&&FM(ZX,t,{originalEvent:o},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function $M(){const e=new CustomEvent(vw);document.dispatchEvent(e)}function FM(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?YX(o,i):o.dispatchEvent(i)}const yw="focusScope.autoFocusOnMount",bw="focusScope.autoFocusOnUnmount",LM={bubbles:!1,cancelable:!0},nZ=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=E.useState(null),c=li(o),u=li(i),d=E.useRef(null),f=jl(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:ui(d.current,{select:!0})},v=function(w){h.paused||!s||s.contains(w.relatedTarget)||ui(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){HM.add(h);const m=document.activeElement;if(!s.contains(m)){const w=new CustomEvent(yw,LM);s.addEventListener(yw,c),s.dispatchEvent(w),w.defaultPrevented||(rZ(lZ(zM(s)),{select:!0}),document.activeElement===m&&ui(s))}return()=>{s.removeEventListener(yw,c),setTimeout(()=>{const w=new CustomEvent(bw,LM);s.addEventListener(bw,u),s.dispatchEvent(w),w.defaultPrevented||ui(m??document.body,{select:!0}),s.removeEventListener(bw,u),HM.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,S]=oZ(b);x&&S?!m.shiftKey&&w===S?(m.preventDefault(),n&&ui(x,{select:!0})):m.shiftKey&&w===x&&(m.preventDefault(),n&&ui(S,{select:!0})):w===b&&m.preventDefault()}},[n,r,h.paused]);return E.createElement(ci.div,Mt({tabIndex:-1},a,{ref:f,onKeyDown:p}))});function rZ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ui(r,{select:t}),document.activeElement!==n)return}function oZ(e){const t=zM(e),n=BM(t,e),r=BM(t.reverse(),e);return[n,r]}function zM(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 BM(e,t){for(const n of e)if(!iZ(n,{upTo:t}))return n}function iZ(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 aZ(e){return e instanceof HTMLInputElement&&"select"in e}function ui(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&aZ(e)&&t&&e.select()}}const HM=sZ();function sZ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=UM(e,t),e.unshift(t)},remove(t){var n;e=UM(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function UM(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function lZ(e){return e.filter(t=>t.tagName!=="A")}const cZ=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?tr.createPortal(E.createElement(ci.div,Mt({},o,{ref:t})),r):null});function uZ(e,t){return E.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Td=e=>{const{present:t,children:n}=e,r=dZ(t),o=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),i=jl(r.ref,o.ref);return typeof n=="function"||r.isPresent?E.cloneElement(o,{ref:i}):null};Td.displayName="Presence";function dZ(e){const[t,n]=E.useState(),r=E.useRef({}),o=E.useRef(e),i=E.useRef("none"),a=e?"mounted":"unmounted",[s,l]=uZ(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const c=Md(r.current);i.current=s==="mounted"?c:"none"},[s]),pw(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,h=Md(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]),pw(()=>{if(t){const c=d=>{const h=Md(r.current).includes(d.animationName);d.target===t&&h&&tr.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=Md(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 Md(e){return(e==null?void 0:e.animationName)||"none"}let xw=0;function fZ(){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:VM()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:VM()),xw++,()=>{xw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),xw--}},[])}function VM(){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 WM=eS(),_w=function(){},Dd=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:_w,onWheelCapture:_w,onTouchMoveCapture:_w}),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=jp(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=f,S=Q_([n,t]),C=Ft(Ft({},b),o);return y.createElement(y.Fragment,null,u&&y.createElement(x,{sideCar:WM,removeScrollBar:c,shards:d,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n}),a?y.cloneElement(y.Children.only(s),Ft(Ft({},C),{ref:S})):y.createElement(w,Ft({},C,{className:l,ref:S}),s))});Dd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Dd.classNames={fullWidth:el,zeroRight:Qs};var Sw=!1;if(typeof window<"u")try{var kd=Object.defineProperty({},"passive",{get:function(){return Sw=!0,!0}});window.addEventListener("test",kd,kd),window.removeEventListener("test",kd,kd)}catch{Sw=!1}var Oa=Sw?{passive:!1}:!1,hZ=function(e){var t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},pZ=function(e){var t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},GM=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=qM(e,n);if(r){var o=YM(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},mZ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},gZ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},qM=function(e,t){return e==="v"?hZ(t):pZ(t)},YM=function(e,t){return e==="v"?mZ(t):gZ(t)},wZ=function(e,t){return e==="h"&&t==="rtl"?-1:1},vZ=function(e,t,n,r,o){var i=wZ(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=YM(e,s),p=h[0],m=h[1],v=h[2],w=m-v-i*p;(p||w)&&qM(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},Od=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},KM=function(e){return[e.deltaX,e.deltaY]},XM=function(e){return e&&"current"in e?e.current:e},yZ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bZ=function(e){return`
|
|
413
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
414
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
415
|
+
`)},xZ=0,Aa=[];function _Z(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),o=y.useState(xZ++)[0],i=y.useState(function(){return Lp()})[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=Z_([e.lockRef.current],(e.shards||[]).map(XM),!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=Od(m),b=n.current,x="deltaX"in m?m.deltaX:b[0]-w[0],S="deltaY"in m?m.deltaY:b[1]-w[1],C,N=m.target,R=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&R==="h"&&N.type==="range")return!1;var T=GM(R,N);if(!T)return!0;if(T?C=R:(C=R==="v"?"h":"v",T=GM(R,N)),!T)return!1;if(!r.current&&"changedTouches"in m&&(x||S)&&(r.current=C),!C)return!0;var M=r.current||C;return vZ(M,v,m,M==="h"?x:S)},[]),l=y.useCallback(function(m){var v=m;if(!(!Aa.length||Aa[Aa.length-1]!==i)){var w="deltaY"in v?KM(v):Od(v),b=t.current.filter(function(C){return C.name===v.type&&C.target===v.target&&yZ(C.delta,w)})[0];if(b&&b.should){v.preventDefault();return}if(!b){var x=(a.current.shards||[]).map(XM).filter(Boolean).filter(function(C){return C.contains(v.target)}),S=x.length>0?s(v,x[0]):!a.current.noIsolation;S&&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(S){return S!==x})},1)},[]),u=y.useCallback(function(m){n.current=Od(m),r.current=void 0},[]),d=y.useCallback(function(m){c(m.type,KM(m),m.target,s(m,e.lockRef.current))},[]),f=y.useCallback(function(m){c(m.type,Od(m),m.target,s(m,e.lockRef.current))},[]);y.useEffect(function(){return Aa.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Oa),document.addEventListener("touchmove",l,Oa),document.addEventListener("touchstart",u,Oa),function(){Aa=Aa.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,Oa),document.removeEventListener("touchmove",l,Oa),document.removeEventListener("touchstart",u,Oa)}},[]);var h=e.removeScrollBar,p=e.inert;return y.createElement(y.Fragment,null,p?y.createElement(i,{styles:bZ(o)}):null,h?y.createElement(iS,{gapMode:"margin"}):null)}const SZ=nS(WM,_Z);var ZM=y.forwardRef(function(e,t){return y.createElement(Dd,Ft({},e,{ref:t,sideCar:SZ}))});ZM.classNames=Dd.classNames;const JM="Dialog",[QM,Hne]=LX(JM),[CZ,Rr]=QM(JM),EZ=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]=UX({prop:r,defaultProp:o,onChange:i});return E.createElement(CZ,{scope:t,triggerRef:s,contentRef:l,contentId:mw(),titleId:mw(),descriptionId:mw(),open:c,onOpenChange:u,onOpenToggle:E.useCallback(()=>u(d=>!d),[u]),modal:a},n)},eD="DialogPortal",[PZ,tD]=QM(eD,{forceMount:void 0}),RZ=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Rr(eD,t);return E.createElement(PZ,{scope:t,forceMount:n},E.Children.map(r,a=>E.createElement(Td,{present:n||i.open},E.createElement(cZ,{asChild:!0,container:o},a))))},Cw="DialogOverlay",NZ=E.forwardRef((e,t)=>{const n=tD(Cw,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Rr(Cw,e.__scopeDialog);return i.modal?E.createElement(Td,{present:r||i.open},E.createElement(TZ,Mt({},o,{ref:t}))):null}),TZ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rr(Cw,n);return E.createElement(ZM,{as:gw,allowPinchZoom:!0,shards:[o.contentRef]},E.createElement(ci.div,Mt({"data-state":sD(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Ia="DialogContent",nD=E.forwardRef((e,t)=>{const n=tD(Ia,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Rr(Ia,e.__scopeDialog);return E.createElement(Td,{present:r||i.open},i.modal?E.createElement(MZ,Mt({},o,{ref:t})):E.createElement(DZ,Mt({},o,{ref:t})))}),MZ=E.forwardRef((e,t)=>{const n=Rr(Ia,e.__scopeDialog),r=E.useRef(null),o=jl(t,n.contentRef,r);return E.useEffect(()=>{const i=r.current;if(i)return nl(i)},[]),E.createElement(rD,Mt({},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())}))}),DZ=E.forwardRef((e,t)=>{const n=Rr(Ia,e.__scopeDialog),r=E.useRef(!1);return E.createElement(rD,Mt({},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()}}))}),rD=E.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=Rr(Ia,n),l=E.useRef(null),c=jl(t,l);return fZ(),E.createElement(E.Fragment,null,E.createElement(nZ,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},E.createElement(QX,Mt({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":sD(s.open)},a,{ref:c,onDismiss:()=>s.onOpenChange(!1)}))),!1)}),oD="DialogTitle",kZ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rr(oD,n);return E.createElement(ci.h2,Mt({id:o.titleId},r,{ref:t}))}),iD="DialogDescription",OZ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rr(iD,n);return E.createElement(ci.p,Mt({id:o.descriptionId},r,{ref:t}))}),aD="DialogClose",AZ=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rr(aD,n);return E.createElement(ci.button,Mt({type:"button"},r,{ref:t,onClick:si(e.onClick,()=>o.onOpenChange(!1))}))});function sD(e){return e?"open":"closed"}const IZ=EZ,jZ=RZ,$Z=NZ,FZ=nD;var LZ='[cmdk-list-sizer=""]',$l='[cmdk-group=""]',Ew='[cmdk-group-items=""]',zZ='[cmdk-group-heading=""]',Pw='[cmdk-item=""]',lD=`${Pw}:not([aria-disabled="true"])`,Rw="cmdk-item-select",Ur="data-value",BZ=(e,t)=>$X(e,t),cD=y.createContext(void 0),Fl=()=>y.useContext(cD),uD=y.createContext(void 0),Nw=()=>y.useContext(uD),dD=y.createContext(void 0),fD=y.forwardRef((e,t)=>{let n=y.useRef(null),r=$a(()=>{var Z,J,H;return{search:"",value:(H=(J=e.value)!=null?J:(Z=e.defaultValue)==null?void 0:Z.toLowerCase())!=null?H:"",filtered:{count:0,items:new Map,groups:new Set}}}),o=$a(()=>new Set),i=$a(()=>new Map),a=$a(()=>new Map),s=$a(()=>new Set),l=hD(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(),S=JZ();ja(()=>{if(d!==void 0){let Z=d.trim().toLowerCase();r.current.value=Z,S(6,O),C.emit()}},[d]);let C=y.useMemo(()=>({subscribe:Z=>(s.current.add(Z),()=>s.current.delete(Z)),snapshot:()=>r.current,setState:(Z,J,H)=>{var I,V,ae;if(!Object.is(r.current[Z],J)){if(r.current[Z]=J,Z==="search")k(),T(),S(1,M);else if(Z==="value")if(((I=l.current)==null?void 0:I.value)!==void 0){let j=J??"";(ae=(V=l.current).onValueChange)==null||ae.call(V,j);return}else H||S(5,O);C.emit()}},emit:()=>{s.current.forEach(Z=>Z())}}),[]),N=y.useMemo(()=>({value:(Z,J)=>{J!==a.current.get(Z)&&(a.current.set(Z,J),r.current.filtered.items.set(Z,R(J)),S(2,()=>{T(),C.emit()}))},item:(Z,J)=>(o.current.add(Z),J&&(i.current.has(J)?i.current.get(J).add(Z):i.current.set(J,new Set([Z]))),S(3,()=>{k(),T(),r.current.value||M(),C.emit()}),()=>{a.current.delete(Z),o.current.delete(Z),r.current.filtered.items.delete(Z);let H=F();S(4,()=>{k(),(H==null?void 0:H.getAttribute("id"))===Z&&M(),C.emit()})}),group:Z=>(i.current.has(Z)||i.current.set(Z,new Set),()=>{a.current.delete(Z),i.current.delete(Z)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],commandRef:n,listId:w,inputId:x,labelId:b}),[]);function R(Z){var J,H;let I=(H=(J=l.current)==null?void 0:J.filter)!=null?H:BZ;return Z?I(Z,r.current.search):0}function T(){if(!n.current||!r.current.search||l.current.shouldFilter===!1)return;let Z=r.current.filtered.items,J=[];r.current.filtered.groups.forEach(I=>{let V=i.current.get(I),ae=0;V.forEach(j=>{let G=Z.get(j);ae=Math.max(G,ae)}),J.push([I,ae])});let H=n.current.querySelector(LZ);L().sort((I,V)=>{var ae,j;let G=I.getAttribute(Ur),$=V.getAttribute(Ur);return((ae=Z.get($))!=null?ae:0)-((j=Z.get(G))!=null?j:0)}).forEach(I=>{let V=I.closest(Ew);V?V.appendChild(I.parentElement===V?I:I.closest(`${Ew} > *`)):H.appendChild(I.parentElement===H?I:I.closest(`${Ew} > *`))}),J.sort((I,V)=>V[1]-I[1]).forEach(I=>{let V=n.current.querySelector(`${$l}[${Ur}="${I[0]}"]`);V==null||V.parentElement.appendChild(V)})}function M(){let Z=L().find(H=>!H.ariaDisabled),J=Z==null?void 0:Z.getAttribute(Ur);C.setState("value",J||void 0)}function k(){if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=o.current.size;return}r.current.filtered.groups=new Set;let Z=0;for(let J of o.current){let H=a.current.get(J),I=R(H);r.current.filtered.items.set(J,I),I>0&&Z++}for(let[J,H]of i.current)for(let I of H)if(r.current.filtered.items.get(I)>0){r.current.filtered.groups.add(J);break}r.current.filtered.count=Z}function O(){var Z,J,H;let I=F();I&&(((Z=I.parentElement)==null?void 0:Z.firstChild)===I&&((H=(J=I.closest($l))==null?void 0:J.querySelector(zZ))==null||H.scrollIntoView({block:"nearest"})),I.scrollIntoView({block:"nearest"}))}function F(){var Z;return(Z=n.current)==null?void 0:Z.querySelector(`${Pw}[aria-selected="true"]`)}function L(){return Array.from(n.current.querySelectorAll(lD))}function K(Z){let J=L()[Z];J&&C.setState("value",J.getAttribute(Ur))}function ne(Z){var J;let H=F(),I=L(),V=I.findIndex(j=>j===H),ae=I[V+Z];(J=l.current)!=null&&J.loop&&(ae=V+Z<0?I[I.length-1]:V+Z===I.length?I[0]:I[V+Z]),ae&&C.setState("value",ae.getAttribute(Ur))}function q(Z){let J=F(),H=J==null?void 0:J.closest($l),I;for(;H&&!I;)H=Z>0?XZ(H,$l):ZZ(H,$l),I=H==null?void 0:H.querySelector(lD);I?C.setState("value",I.getAttribute(Ur)):ne(Z)}let X=()=>K(L().length-1),B=Z=>{Z.preventDefault(),Z.metaKey?X():Z.altKey?q(1):ne(1)},ee=Z=>{Z.preventDefault(),Z.metaKey?K(0):Z.altKey?q(-1):ne(-1)};return y.createElement("div",{ref:Ll([n,t]),...v,"cmdk-root":"",onKeyDown:Z=>{var J;if((J=v.onKeyDown)==null||J.call(v,Z),!Z.defaultPrevented)switch(Z.key){case"n":case"j":{m&&Z.ctrlKey&&B(Z);break}case"ArrowDown":{B(Z);break}case"p":case"k":{m&&Z.ctrlKey&&ee(Z);break}case"ArrowUp":{ee(Z);break}case"Home":{Z.preventDefault(),K(0);break}case"End":{Z.preventDefault(),X();break}case"Enter":if(!Z.nativeEvent.isComposing){Z.preventDefault();let H=F();if(H){let I=new Event(Rw);H.dispatchEvent(I)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:QZ},c),y.createElement(uD.Provider,{value:C},y.createElement(cD.Provider,{value:N},u)))}),HZ=y.forwardRef((e,t)=>{var n,r;let o=y.useId(),i=y.useRef(null),a=y.useContext(dD),s=Fl(),l=hD(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;ja(()=>s.item(o,a==null?void 0:a.id),[]);let u=pD(o,i,[e.value,e.children,i]),d=Nw(),f=di(C=>C.value&&C.value===u.current),h=di(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(Rw,p),()=>C.removeEventListener(Rw,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,...S}=e;return y.createElement("div",{ref:Ll([i,t]),...S,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)}),UZ=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=Fl(),d=di(p=>o||u.filter()===!1?!0:p.search?p.filtered.groups.has(a):!0);ja(()=>u.group(a),[]),pD(a,s,[e.value,e.heading,l]);let f=y.useMemo(()=>({id:a,forceMount:o}),[o]),h=y.createElement(dD.Provider,{value:f},r);return y.createElement("div",{ref:Ll([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))}),VZ=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=y.useRef(null),i=di(a=>!a.search);return!n&&!i?null:y.createElement("div",{ref:Ll([o,t]),...r,"cmdk-separator":"",role:"separator"})}),WZ=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=Nw(),a=di(u=>u.search),s=di(u=>u.value),l=Fl(),c=y.useMemo(()=>{var u;let d=(u=l.commandRef.current)==null?void 0:u.querySelector(`${Pw}[${Ur}="${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)}})}),GZ=y.forwardRef((e,t)=>{let{children:n,...r}=e,o=y.useRef(null),i=y.useRef(null),a=Fl();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:Ll([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))}),qZ=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:a,...s}=e;return y.createElement(IZ,{open:n,onOpenChange:r},y.createElement(jZ,{container:a},y.createElement($Z,{"cmdk-overlay":"",className:o}),y.createElement(FZ,{"aria-label":e.label,"cmdk-dialog":"",className:i},y.createElement(fD,{ref:t,...s}))))}),YZ=y.forwardRef((e,t)=>{let n=y.useRef(!0),r=di(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"})}),KZ=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))}),cn=Object.assign(fD,{List:GZ,Item:HZ,Input:WZ,Group:UZ,Separator:VZ,Dialog:qZ,Empty:YZ,Loading:KZ});function XZ(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ZZ(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function hD(e){let t=y.useRef(e);return ja(()=>{t.current=e}),t}var ja=typeof window>"u"?y.useEffect:y.useLayoutEffect;function $a(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function Ll(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function di(e){let t=Nw(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function pD(e,t,n){let r=y.useRef(),o=Fl();return ja(()=>{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(Ur,a),r.current=a}),r}var JZ=()=>{let[e,t]=y.useState(),n=$a(()=>new Map);return ja(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}},QZ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const mD=Au,eJ=Iu,gD=ju,tJ=ua,Tw=E.forwardRef(({className:e,...t},n)=>g.jsx(aa,{ref:n,className:Y("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}));Tw.displayName=aa.displayName;const Mw=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(gD,{children:[g.jsx(Tw,{}),g.jsxs(sa,{ref:r,className:Y("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(ua,{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-muted-foreground",children:[g.jsx(eT,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Mw.displayName=sa.displayName;const wD=({className:e,...t})=>g.jsx("div",{className:Y("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});wD.displayName="DialogHeader";const vD=({className:e,...t})=>g.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});vD.displayName="DialogFooter";const yD=E.forwardRef(({className:e,...t},n)=>g.jsx(la,{ref:n,className:Y("text-lg font-semibold leading-none tracking-tight",e),...t}));yD.displayName=la.displayName;const bD=E.forwardRef(({className:e,...t},n)=>g.jsx(ca,{ref:n,className:Y("text-sm text-muted-foreground",e),...t}));bD.displayName=ca.displayName;const Ad=y.forwardRef(({className:e,...t},n)=>g.jsx(cn,{ref:n,className:Y("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Ad.displayName=cn.displayName;const nJ=({children:e,...t})=>g.jsx(mD,{...t,children:g.jsx(Mw,{className:"overflow-hidden p-0 shadow-lg",children:g.jsx(Ad,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-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})})}),Dw=y.forwardRef(({className:e,...t},n)=>g.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[g.jsx(cq,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),g.jsx(cn.Input,{ref:n,className:Y("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Dw.displayName=cn.Input.displayName;const xD=y.forwardRef(({className:e,...t},n)=>g.jsx(cn.List,{ref:n,className:Y("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));xD.displayName=cn.List.displayName;const kw=y.forwardRef((e,t)=>g.jsx(cn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));kw.displayName=cn.Empty.displayName;const Ow=y.forwardRef(({className:e,...t},n)=>g.jsx(cn.Group,{ref:n,className:Y("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-muted-foreground",e),...t}));Ow.displayName=cn.Group.displayName;const _D=y.forwardRef(({className:e,...t},n)=>g.jsx(cn.Separator,{ref:n,className:Y("-mx-1 h-px bg-border",e),...t}));_D.displayName=cn.Separator.displayName;const Aw=y.forwardRef(({className:e,...t},n)=>g.jsx(cn.Item,{ref:n,className:Y("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}));Aw.displayName=cn.Item.displayName;const SD=({className:e,...t})=>g.jsx("span",{className:Y("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});SD.displayName="CommandShortcut";const Id=JG,jd=QG,zl=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>g.jsx(e7,{children:g.jsx(jP,{ref:o,align:t,sideOffset:n,className:Y("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})}));zl.displayName=jP.displayName;function rJ({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(Id,{open:a,onOpenChange:s,children:[g.jsx(jd,{asChild:!0,children:g.jsxs(Yn,{variant:"outline",role:"combobox","aria-expanded":a,className:Y("w-[200px] justify-between",i),children:[t?(l=e.find(c=>c.value===t))==null?void 0:l.label:r,g.jsx(sq,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),g.jsx(zl,{className:"w-[200px] p-0",children:g.jsxs(Ad,{children:[g.jsx(Dw,{placeholder:r}),g.jsx(kw,{children:o}),g.jsx(Ow,{children:e.map(c=>g.jsxs(Aw,{value:c.value,onSelect:u=>{n==null||n(u),s(!1)},children:[g.jsx(Ra,{className:Y("mr-2 h-4 w-4",t===c.value?"opacity-100":"opacity-0")}),c.label]},c.value))})]})})]})}const oJ=xW,iJ=_W,aJ=SW,sJ=DC,lJ=EW,cJ=CW,CD=E.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(LC,{ref:o,className:Y("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(Co,{className:"ml-auto h-4 w-4"})]}));CD.displayName=LC.displayName;const ED=E.forwardRef(({className:e,...t},n)=>g.jsx(zC,{ref:n,className:Y("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}));ED.displayName=zC.displayName;const PD=E.forwardRef(({className:e,...t},n)=>g.jsx(DC,{children:g.jsx(kC,{ref:n,className:Y("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})}));PD.displayName=kC.displayName;const RD=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(AC,{ref:r,className:Y("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}));RD.displayName=AC.displayName;const ND=E.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(IC,{ref:o,className:Y("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($C,{children:g.jsx(Ra,{className:"h-4 w-4"})})}),t]}));ND.displayName=IC.displayName;const TD=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(jC,{ref:r,className:Y("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($C,{children:g.jsx(bd,{className:"h-2 w-2 fill-current"})})}),t]}));TD.displayName=jC.displayName;const MD=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(OC,{ref:r,className:Y("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));MD.displayName=OC.displayName;const DD=E.forwardRef(({className:e,...t},n)=>g.jsx(FC,{ref:n,className:Y("-mx-1 my-1 h-px bg-border",e),...t}));DD.displayName=FC.displayName;const kD=({className:e,...t})=>g.jsx("span",{className:Y("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});kD.displayName="ContextMenuShortcut";/**
|
|
416
|
+
* table-core
|
|
417
|
+
*
|
|
418
|
+
* Copyright (c) TanStack
|
|
419
|
+
*
|
|
420
|
+
* This source code is licensed under the MIT license found in the
|
|
421
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
422
|
+
*
|
|
423
|
+
* @license MIT
|
|
424
|
+
*/function No(e,t){return typeof e=="function"?e(t):e}function Pn(e,t){return n=>{t.setState(r=>({...r,[e]:No(n,r[e])}))}}function $d(e){return e instanceof Function}function uJ(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function dJ(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const a=t(i);a!=null&&a.length&&r(a)})};return r(e),n}function Ee(e,t,n){let r=[],o;return i=>{let a;n.key&&n.debug&&(a=Date.now());const s=e(i);if(!(s.length!==r.length||s.some((u,d)=>r[d]!==u)))return o;r=s;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...s),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-a)*100)/100,d=Math.round((Date.now()-c)*100)/100,f=d/16,h=(p,m)=>{for(p=String(p);p.length<m;)p=" "+p;return p};console.info(`%c⏱ ${h(d,5)} /${h(u,5)} ms`,`
|
|
425
|
+
font-size: .6rem;
|
|
426
|
+
font-weight: bold;
|
|
427
|
+
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Pe(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function fJ(e,t,n,r){const o=()=>{var a;return(a=i.getValue())!=null?a:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:Ee(()=>[e,n,t,i],(a,s,l,c)=>({table:a,column:s,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Pe(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(i,n,t,e)},{}),i}function hJ(e,t,n,r){var o,i;const s={...e._getDefaultColumnDef(),...t},l=s.accessorKey;let c=(o=(i=s.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof s.header=="string"?s.header:void 0,u;if(s.accessorFn?u=s.accessorFn:l&&(l.includes(".")?u=f=>{let h=f;for(const m of l.split(".")){var p;h=(p=h)==null?void 0:p[m]}return h}:u=f=>f[s.accessorKey]),!c)throw new Error;let d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:s,columns:[],getFlatColumns:Ee(()=>[!0],()=>{var f;return[d,...(f=d.columns)==null?void 0:f.flatMap(h=>h.getFlatColumns())]},Pe(e.options,"debugColumns")),getLeafColumns:Ee(()=>[e._getOrderColumnsFn()],f=>{var h;if((h=d.columns)!=null&&h.length){let p=d.columns.flatMap(m=>m.getLeafColumns());return f(p)}return[d]},Pe(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(d,e);return d}const Ht="debugHeaders";function OD(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],s=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(s),a.push(l)};return s(i),a},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(i,e)}),i}const pJ={createTable:e=>{e.getHeaderGroups=Ee(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,a;const s=(i=r==null?void 0:r.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?i:[],l=(a=o==null?void 0:o.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?a:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return Fd(t,[...s,...c,...l],e)},Pe(e.options,Ht)),e.getCenterHeaderGroups=Ee(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),Fd(t,n,e,"center")),Pe(e.options,Ht)),e.getLeftHeaderGroups=Ee(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(a=>n.find(s=>s.id===a)).filter(Boolean))!=null?o:[];return Fd(t,i,e,"left")},Pe(e.options,Ht)),e.getRightHeaderGroups=Ee(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(a=>n.find(s=>s.id===a)).filter(Boolean))!=null?o:[];return Fd(t,i,e,"right")},Pe(e.options,Ht)),e.getFooterGroups=Ee(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Pe(e.options,Ht)),e.getLeftFooterGroups=Ee(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Pe(e.options,Ht)),e.getCenterFooterGroups=Ee(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Pe(e.options,Ht)),e.getRightFooterGroups=Ee(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Pe(e.options,Ht)),e.getFlatHeaders=Ee(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Pe(e.options,Ht)),e.getLeftFlatHeaders=Ee(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Pe(e.options,Ht)),e.getCenterFlatHeaders=Ee(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Pe(e.options,Ht)),e.getRightFlatHeaders=Ee(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Pe(e.options,Ht)),e.getCenterLeafHeaders=Ee(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Pe(e.options,Ht)),e.getLeftLeafHeaders=Ee(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Pe(e.options,Ht)),e.getRightLeafHeaders=Ee(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Pe(e.options,Ht)),e.getLeafHeaders=Ee(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,a,s,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(a=(s=n[0])==null?void 0:s.headers)!=null?a:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},Pe(e.options,Ht))}};function Fd(e,t,n,r){var o,i;let a=0;const s=function(f,h){h===void 0&&(h=1),a=Math.max(a,h),f.filter(p=>p.getIsVisible()).forEach(p=>{var m;(m=p.columns)!=null&&m.length&&s(p.columns,h+1)},0)};s(e);let l=[];const c=(f,h)=>{const p={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},m=[];f.forEach(v=>{const w=[...m].reverse()[0],b=v.column.depth===p.depth;let x,S=!1;if(b&&v.column.parent?x=v.column.parent:(x=v.column,S=!0),w&&(w==null?void 0:w.column)===x)w.subHeaders.push(v);else{const C=OD(n,x,{id:[r,h,x.id,v==null?void 0:v.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${m.filter(N=>N.column===x).length}`:void 0,depth:h,index:m.length});C.subHeaders.push(v),m.push(C)}p.headers.push(v),v.headerGroup=p}),l.push(p),h>0&&c(m,h-1)},u=t.map((f,h)=>OD(n,f,{depth:a,index:h}));c(u,a-1),l.reverse();const d=f=>f.filter(p=>p.column.getIsVisible()).map(p=>{let m=0,v=0,w=[0];p.subHeaders&&p.subHeaders.length?(w=[],d(p.subHeaders).forEach(x=>{let{colSpan:S,rowSpan:C}=x;m+=S,w.push(C)})):m=1;const b=Math.min(...w);return v=v+b,p.colSpan=m,p.rowSpan=v,{colSpan:m,rowSpan:v}});return d((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const Iw=(e,t,n,r,o,i,a)=>{let s={id:t,index:r,original:n,depth:o,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(s._valuesCache.hasOwnProperty(l))return s._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return s._valuesCache[l]=c.accessorFn(s.original,r),s._valuesCache[l]},getUniqueValues:l=>{if(s._uniqueValuesCache.hasOwnProperty(l))return s._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(s._uniqueValuesCache[l]=c.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[l]):(s._uniqueValuesCache[l]=[s.getValue(l)],s._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=s.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>dJ(s.subRows,l=>l.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let l=[],c=s;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:Ee(()=>[e.getAllLeafColumns()],l=>l.map(c=>fJ(e,s,c,c.id)),Pe(e.options,"debugRows")),_getAllCellsByColumnId:Ee(()=>[s.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),Pe(e.options,"debugRows"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(s,e)}return s},mJ={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},AD=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};AD.autoRemove=e=>Jn(e);const ID=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};ID.autoRemove=e=>Jn(e);const jD=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};jD.autoRemove=e=>Jn(e);const $D=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};$D.autoRemove=e=>Jn(e);const FD=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});FD.autoRemove=e=>Jn(e)||!(e!=null&&e.length);const LD=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});LD.autoRemove=e=>Jn(e)||!(e!=null&&e.length);const zD=(e,t,n)=>e.getValue(t)===n;zD.autoRemove=e=>Jn(e);const BD=(e,t,n)=>e.getValue(t)==n;BD.autoRemove=e=>Jn(e);const jw=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};jw.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(o)?1/0:o;if(i>a){const s=i;i=a,a=s}return[i,a]},jw.autoRemove=e=>Jn(e)||Jn(e[0])&&Jn(e[1]);const Vr={includesString:AD,includesStringSensitive:ID,equalsString:jD,arrIncludes:$D,arrIncludesAll:FD,arrIncludesSome:LD,equals:zD,weakEquals:BD,inNumberRange:jw};function Jn(e){return e==null||e===""}const gJ={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Pn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Vr.includesString:typeof r=="number"?Vr.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Vr.equals:Array.isArray(r)?Vr.arrIncludes:Vr.weakEquals},e.getFilterFn=()=>{var n,r;return $d(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Vr[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(u=>u.id===e.id),a=No(n,i?i.value:void 0);if(HD(o,a,e)){var s;return(s=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?s:[]}const l={id:e.id,value:a};if(i){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=No(t,o))==null?void 0:i.filter(a=>{const s=n.find(l=>l.id===a.id);if(s){const l=s.getFilterFn();if(HD(l,a.value,s))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function HD(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const $w={sum:(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),min:(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},max:(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},extent:(e,t,n)=>{let r,o;return n.forEach(i=>{const a=i.getValue(e);a!=null&&(r===void 0?a>=a&&(r=o=a):(r>a&&(r=a),o<a&&(o=a)))}),[r,o]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!uJ(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,a)=>i-a);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},wJ={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Pn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return $w.sum;if(Object.prototype.toString.call(r)==="[object Date]")return $w.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return $d(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:$w[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function vJ(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(a=>a.id===i)).filter(Boolean),...r]}const yJ={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Pn("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Ee(n=>[Bl(t,n)],n=>n.findIndex(r=>r.id===e.id),Pe(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Bl(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Bl(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Ee(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const a=[...t],s=[...o];for(;s.length&&a.length;){const l=a.shift(),c=s.findIndex(u=>u.id===l);c>-1&&i.push(s.splice(c,1)[0])}i=[...i,...s]}return vJ(i,n,r)},Pe(e.options,"debugTable"))}},Fw=()=>({left:[],right:[]}),bJ={getInitialState:e=>({columnPinning:Fw(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Pn("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,a;if(n==="right"){var s,l;return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d))),right:((a=o==null?void 0:o.right)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,a;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(s=>s.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(s=>r==null?void 0:r.includes(s)),a=n.some(s=>o==null?void 0:o.includes(s));return i?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Ee(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(a=>!i.includes(a.column.id))},Pe(t.options,"debugRows")),e.getLeftVisibleCells=Ee(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Pe(t.options,"debugRows")),e.getRightVisibleCells=Ee(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Pe(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Fw():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Fw())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Ee(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Pe(e.options,"debugColumns")),e.getRightLeafColumns=Ee(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Pe(e.options,"debugColumns")),e.getCenterLeafColumns=Ee(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},Pe(e.options,"debugColumns"))}},Ld={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Lw=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),xJ={getDefaultColumnDef:()=>Ld,getInitialState:e=>({columnSizing:{},columnSizingInfo:Lw(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Pn("columnSizing",e),onColumnSizingInfoChange:Pn("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Ld.minSize,(r=i??e.columnDef.size)!=null?r:Ld.size),(o=e.columnDef.maxSize)!=null?o:Ld.maxSize)},e.getStart=Ee(n=>[n,Bl(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),Pe(t.options,"debugColumns")),e.getAfter=Ee(n=>[n,Bl(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),Pe(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),zw(i)&&i.touches&&i.touches.length>1))return;const a=e.getSize(),s=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],l=zw(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(w,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(x=>{var S,C;const N=t.options.columnResizeDirection==="rtl"?-1:1,R=(b-((S=x==null?void 0:x.startOffset)!=null?S:0))*N,T=Math.max(R/((C=x==null?void 0:x.startSize)!=null?C:0),-.999999);return x.columnSizingStart.forEach(M=>{let[k,O]=M;c[k]=Math.round(Math.max(O+O*T,0)*100)/100}),{...x,deltaOffset:R,deltaPercentage:T}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(x=>({...x,...c})))},d=w=>u("move",w),f=w=>{u("end",w),t.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,p={moveHandler:w=>d(w.clientX),upHandler:w=>{h==null||h.removeEventListener("mousemove",p.moveHandler),h==null||h.removeEventListener("mouseup",p.upHandler),f(w.clientX)}},m={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),d(w.touches[0].clientX),!1),upHandler:w=>{var b;h==null||h.removeEventListener("touchmove",m.moveHandler),h==null||h.removeEventListener("touchend",m.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((b=w.touches[0])==null?void 0:b.clientX)}},v=_J()?{passive:!1}:!1;zw(i)?(h==null||h.addEventListener("touchmove",m.moveHandler,v),h==null||h.addEventListener("touchend",m.upHandler,v)):(h==null||h.addEventListener("mousemove",p.moveHandler,v),h==null||h.addEventListener("mouseup",p.upHandler,v)),t.setColumnSizingInfo(w=>({...w,startOffset:l,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Lw():(n=e.initialState.columnSizingInfo)!=null?n:Lw())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let zd=null;function _J(){if(typeof zd=="boolean")return zd;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return zd=e,zd}function zw(e){return e.type==="touchstart"}const SJ={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Pn("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Ee(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Pe(t.options,"debugRows")),e.getVisibleCells=Ee(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Pe(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Ee(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Pe(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Bl(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const CJ={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},EJ={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Pn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Vr.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return $d(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Vr[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},PJ={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Pn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const a=i.split(".");r=Math.max(r,a.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(s=>{a[s]=!0}):a=r,n=(o=n)!=null?o:!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){const{[e.id]:s,...l}=a;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Bw=0,Hw=10,Uw=()=>({pageIndex:Bw,pageSize:Hw}),RJ={getInitialState:e=>({...e,pagination:{...Uw(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Pn("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>No(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Uw():(o=e.initialState.pagination)!=null?o:Uw())},e.setPageIndex=r=>{e.setPagination(o=>{let i=No(r,o.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,a)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?Bw:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:Bw)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?Hw:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Hw)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,No(r,o.pageSize)),a=o.pageSize*o.pageIndex,s=Math.floor(a/i);return{...o,pageIndex:s,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let a=No(r,(i=e.options.pageCount)!=null?i:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...o,pageCount:a}}),e.getPageOptions=Ee(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,a)=>a)),o},Pe(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Vw=()=>({top:[],bottom:[]}),NJ={getInitialState:e=>({rowPinning:Vw(),...e}),getDefaultOptions:e=>({onRowPinningChange:Pn("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],a=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],s=new Set([...a,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var d,f;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(m=>!(s!=null&&s.has(m))),bottom:[...((f=l==null?void 0:l.bottom)!=null?f:[]).filter(m=>!(s!=null&&s.has(m))),...Array.from(s)]}}if(n==="top"){var h,p;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(m=>!(s!=null&&s.has(m))),...Array.from(s)],bottom:((p=l==null?void 0:l.bottom)!=null?p:[]).filter(m=>!(s!=null&&s.has(m)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(m=>!(s!=null&&s.has(m))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(m=>!(s!=null&&s.has(m)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(s=>r==null?void 0:r.includes(s)),a=n.some(s=>o==null?void 0:o.includes(s));return i?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:s}=a;return s});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Vw():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Vw())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(a=>{const s=e.getRow(a,!0);return s.getIsAllParentsExpanded()?s:null}):(n??[]).map(a=>t.find(s=>s.id===a))).filter(Boolean).map(a=>({...a,position:r}))},e.getTopRows=Ee(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Pe(e.options,"debugRows")),e.getBottomRows=Ee(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Pe(e.options,"debugRows")),e.getCenterRows=Ee(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},Pe(e.options,"debugRows"))}},TJ={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Pn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{Ww(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ee(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Gw(e,n):{rows:[],flatRows:[],rowsById:{}},Pe(e.options,"debugTable")),e.getFilteredSelectedRowModel=Ee(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Gw(e,n):{rows:[],flatRows:[],rowsById:{}},Pe(e.options,"debugTable")),e.getGroupedSelectedRowModel=Ee(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Gw(e,n):{rows:[],flatRows:[],rowsById:{}},Pe(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var a;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const s={...i};return Ww(s,e.id,n,(a=r==null?void 0:r.selectChildren)!=null?a:!0,t),s})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return qw(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Yw(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Yw(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Ww=(e,t,n,r,o)=>{var i;const a=o.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(s=>delete e[s]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=a.subRows)!=null&&i.length&&a.getCanSelectSubRows()&&a.subRows.forEach(s=>Ww(e,s.id,n,r,o))};function Gw(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(a,s){return a.map(l=>{var c;const u=qw(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function qw(e,t){var n;return(n=t[e.id])!=null?n:!1}function Yw(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(a=>{if(!(i&&!o)&&(a.getCanSelect()&&(qw(a,t)?i=!0:o=!1),a.subRows&&a.subRows.length)){const s=Yw(a,t);s==="all"?i=!0:(s==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const Kw=/([0-9]+)/gm,MJ=(e,t,n)=>UD(To(e.getValue(n)).toLowerCase(),To(t.getValue(n)).toLowerCase()),DJ=(e,t,n)=>UD(To(e.getValue(n)),To(t.getValue(n))),kJ=(e,t,n)=>Xw(To(e.getValue(n)).toLowerCase(),To(t.getValue(n)).toLowerCase()),OJ=(e,t,n)=>Xw(To(e.getValue(n)),To(t.getValue(n))),AJ=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},IJ=(e,t,n)=>Xw(e.getValue(n),t.getValue(n));function Xw(e,t){return e===t?0:e>t?1:-1}function To(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function UD(e,t){const n=e.split(Kw).filter(Boolean),r=t.split(Kw).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),a=parseInt(o,10),s=parseInt(i,10),l=[a,s].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(a)?-1:1;if(a>s)return 1;if(s>a)return-1}return n.length-r.length}const Hl={alphanumeric:MJ,alphanumericCaseSensitive:DJ,text:kJ,textCaseSensitive:OJ,datetime:AJ,basic:IJ},jJ=[pJ,SJ,yJ,bJ,mJ,gJ,CJ,EJ,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Pn("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Hl.datetime;if(typeof i=="string"&&(r=!0,i.split(Kw).length>1))return Hl.alphanumeric}return r?Hl.text:Hl.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return $d(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Hl[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(a=>{const s=a==null?void 0:a.find(h=>h.id===e.id),l=a==null?void 0:a.findIndex(h=>h.id===e.id);let c=[],u,d=i?n:o==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?s?u="toggle":u="add":a!=null&&a.length&&l!==a.length-1?u="replace":s?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var f;c=[...a,{id:e.id,desc:d}],c.splice(0,c.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=a.map(h=>h.id===e.id?{...h,desc:d}:h):u==="remove"?c=a.filter(h=>h.id!==e.id):c=[{id:e.id,desc:d}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:a==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},wJ,PJ,RJ,NJ,TJ,xJ];function $J(e){var t,n;const r=[...jJ,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((f,h)=>Object.assign(f,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),a=f=>o.options.mergeOptions?o.options.mergeOptions(i,f):{...i,...f};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(f=>{var h;l=(h=f.getInitialState==null?void 0:f.getInitialState(l))!=null?h:l});const c=[];let u=!1;const d={_features:r,options:{...i,...e},initialState:l,_queue:f=>{c.push(f),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:f=>{const h=No(f,o.options);o.options=a(h)},getState:()=>o.options.state,setState:f=>{o.options.onStateChange==null||o.options.onStateChange(f)},_getRowId:(f,h,p)=>{var m;return(m=o.options.getRowId==null?void 0:o.options.getRowId(f,h,p))!=null?m:`${p?[p.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(f,h)=>{let p=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[f];if(!p&&(p=o.getCoreRowModel().rowsById[f],!p))throw new Error;return p},_getDefaultColumnDef:Ee(()=>[o.options.defaultColumn],f=>{var h;return f=(h=f)!=null?h:{},{header:p=>{const m=p.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:p=>{var m,v;return(m=(v=p.renderValue())==null||v.toString==null?void 0:v.toString())!=null?m:null},...o._features.reduce((p,m)=>Object.assign(p,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...f}},Pe(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:Ee(()=>[o._getColumnDefs()],f=>{const h=function(p,m,v){return v===void 0&&(v=0),p.map(w=>{const b=hJ(o,w,v,m),x=w;return b.columns=x.columns?h(x.columns,b,v+1):[],b})};return h(f)},Pe(e,"debugColumns")),getAllFlatColumns:Ee(()=>[o.getAllColumns()],f=>f.flatMap(h=>h.getFlatColumns()),Pe(e,"debugColumns")),_getAllFlatColumnsById:Ee(()=>[o.getAllFlatColumns()],f=>f.reduce((h,p)=>(h[p.id]=p,h),{}),Pe(e,"debugColumns")),getAllLeafColumns:Ee(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(f,h)=>{let p=f.flatMap(m=>m.getLeafColumns());return h(p)},Pe(e,"debugColumns")),getColumn:f=>o._getAllFlatColumnsById()[f]};Object.assign(o,d);for(let f=0;f<o._features.length;f++){const h=o._features[f];h==null||h.createTable==null||h.createTable(o)}return o}function FJ(){return e=>Ee(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,a){i===void 0&&(i=0);const s=[];for(let c=0;c<o.length;c++){const u=Iw(e,e._getRowId(o[c],c,a),o[c],c,i,void 0,a==null?void 0:a.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,s.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return s};return n.rows=r(t),n},Pe(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function LJ(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function VD(e,t,n){return n.options.filterFromLeafRows?zJ(e,t,n):BJ(e,t,n)}function zJ(e,t,n){var r;const o=[],i={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,s=function(l,c){c===void 0&&(c=0);const u=[];for(let f=0;f<l.length;f++){var d;let h=l[f];const p=Iw(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);if(p.columnFilters=h.columnFilters,(d=h.subRows)!=null&&d.length&&c<a){if(p.subRows=s(h.subRows,c+1),h=p,t(h)&&!p.subRows.length){u.push(h),i[h.id]=h,o.push(h);continue}if(t(h)||p.subRows.length){u.push(h),i[h.id]=h,o.push(h);continue}}else h=p,t(h)&&(u.push(h),i[h.id]=h,o.push(h))}return u};return{rows:s(e),flatRows:o,rowsById:i}}function BJ(e,t,n){var r;const o=[],i={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,s=function(l,c){c===void 0&&(c=0);const u=[];for(let f=0;f<l.length;f++){let h=l[f];if(t(h)){var d;if((d=h.subRows)!=null&&d.length&&c<a){const m=Iw(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);m.subRows=s(h.subRows,c+1),h=m}u.push(h),o.push(h),i[h.id]=h}}return u};return{rows:s(e),flatRows:o,rowsById:i}}function HJ(){return(e,t)=>Ee(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,o)=>{if(!n.rows.length||!(r!=null&&r.length)&&!o)return n;const i=[...r.map(s=>s.id).filter(s=>s!==t),o?"__global__":void 0].filter(Boolean),a=s=>{for(let l=0;l<i.length;l++)if(s.columnFilters[i[l]]===!1)return!1;return!0};return VD(n.rows,a,e)},Pe(e.options,"debugTable"))}function UJ(){return(e,t)=>Ee(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let i=0;i<n.flatRows.length;i++){const a=n.flatRows[i].getUniqueValues(t);for(let s=0;s<a.length;s++){const l=a[s];if(r.has(l)){var o;r.set(l,((o=r.get(l))!=null?o:0)+1)}else r.set(l,1)}}return r},Pe(e.options,"debugTable"))}function VJ(){return e=>Ee(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const o=[],i=[];(n??[]).forEach(f=>{var h;const p=e.getColumn(f.id);if(!p)return;const m=p.getFilterFn();m&&o.push({id:f.id,filterFn:m,resolvedValue:(h=m.resolveFilterValue==null?void 0:m.resolveFilterValue(f.value))!=null?h:f.value})});const a=(n??[]).map(f=>f.id),s=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());r&&s&&l.length&&(a.push("__global__"),l.forEach(f=>{var h;i.push({id:f.id,filterFn:s,resolvedValue:(h=s.resolveFilterValue==null?void 0:s.resolveFilterValue(r))!=null?h:r})}));let c,u;for(let f=0;f<t.flatRows.length;f++){const h=t.flatRows[f];if(h.columnFilters={},o.length)for(let p=0;p<o.length;p++){c=o[p];const m=c.id;h.columnFilters[m]=c.filterFn(h,m,c.resolvedValue,v=>{h.columnFiltersMeta[m]=v})}if(i.length){for(let p=0;p<i.length;p++){u=i[p];const m=u.id;if(u.filterFn(h,m,u.resolvedValue,v=>{h.columnFiltersMeta[m]=v})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const d=f=>{for(let h=0;h<a.length;h++)if(f.columnFilters[a[h]]===!1)return!1;return!0};return VD(t.rows,d,e)},Pe(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function WJ(e){return t=>Ee(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:a,flatRows:s,rowsById:l}=r;const c=o*i,u=c+o;a=a.slice(c,u);let d;t.options.paginateExpandedRows?d={rows:a,flatRows:s,rowsById:l}:d=LJ({rows:a,flatRows:s,rowsById:l}),d.flatRows=[];const f=h=>{d.flatRows.push(h),h.subRows.length&&h.subRows.forEach(f)};return d.rows.forEach(f),d},Pe(t.options,"debugTable"))}function GJ(){return e=>Ee(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),a={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(a[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const s=l=>{const c=l.map(u=>({...u}));return c.sort((u,d)=>{for(let h=0;h<i.length;h+=1){var f;const p=i[h],m=a[p.id],v=m.sortUndefined,w=(f=p==null?void 0:p.desc)!=null?f:!1;let b=0;if(v){const x=u.getValue(p.id),S=d.getValue(p.id),C=x===void 0,N=S===void 0;if(C||N){if(v==="first")return C?-1:1;if(v==="last")return C?1:-1;b=C&&N?0:C?v:-v}}if(b===0&&(b=m.sortingFn(u,d,p.id)),b!==0)return w&&(b*=-1),m.invertSorting&&(b*=-1),b}return u.index-d.index}),c.forEach(u=>{var d;o.push(u),(d=u.subRows)!=null&&d.length&&(u.subRows=s(u.subRows))}),c};return{rows:s(n.rows),flatRows:o,rowsById:n.rowsById}},Pe(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
428
|
+
* react-table
|
|
429
|
+
*
|
|
430
|
+
* Copyright (c) TanStack
|
|
431
|
+
*
|
|
432
|
+
* This source code is licensed under the MIT license found in the
|
|
433
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
434
|
+
*
|
|
435
|
+
* @license MIT
|
|
436
|
+
*/function Zw(e,t){return e?qJ(e)?y.createElement(e,t):e:null}function qJ(e){return YJ(e)||typeof e=="function"||KJ(e)}function YJ(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function KJ(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function XJ(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=y.useState(()=>({current:$J(t)})),[r,o]=y.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:a=>{o(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}function Fa(e,t,n){let r=n.initialDeps??[],o;return()=>{var i,a,s,l;let c;n.key&&((i=n.debug)!=null&&i.call(n))&&(c=Date.now());const u=e();if(!(u.length!==r.length||u.some((h,p)=>r[p]!==h)))return o;r=u;let f;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(f=Date.now()),o=t(...u),n.key&&((s=n.debug)!=null&&s.call(n))){const h=Math.round((Date.now()-c)*100)/100,p=Math.round((Date.now()-f)*100)/100,m=p/16,v=(w,b)=>{for(w=String(w);w.length<b;)w=" "+w;return w};console.info(`%c⏱ ${v(p,5)} /${v(h,5)} ms`,`
|
|
437
|
+
font-size: .6rem;
|
|
438
|
+
font-weight: bold;
|
|
439
|
+
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 Jw(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const ZJ=(e,t)=>Math.abs(e-t)<1,JJ=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},QJ=e=>e,eQ=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},Qw={passive:!0},tQ=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=()=>{t({width:n.innerWidth,height:n.innerHeight})};return r(),n.addEventListener("resize",r,Qw),()=>{n.removeEventListener("resize",r)}},WD=typeof window>"u"?!0:"onscrollend"in window,nQ=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&WD?()=>{}:JJ(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,Qw);const c=e.options.useScrollendEvent&&WD;return c&&n.addEventListener("scrollend",l,Qw),()=>{n.removeEventListener("scroll",s),c&&n.removeEventListener("scrollend",l)}},rQ=(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"])},oQ=(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 iQ{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:QJ,rangeExtractor:eQ,onChange:()=>{},measureElement:rQ,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=Fa(()=>(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=Fa(()=>[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=Fa(()=>[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=Fa(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?aQ({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Fa(()=>{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=Fa(()=>[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 Jw(r[GD(0,r.length-1,o=>Jw(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]=Jw(this.getOffsetForIndex(n,s));ZJ(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 GD=(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 aQ({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1;let a=GD(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 qD=typeof document<"u"?y.useLayoutEffect:y.useEffect;function sQ(e){const t=y.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var a;i?tr.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,i)}},[r]=y.useState(()=>new iQ(n));return r.setOptions(n),qD(()=>r._didMount(),[]),qD(()=>r._willUpdate()),r}function lQ(e){return sQ({getScrollElement:()=>typeof document<"u"?window:null,observeElementRect:tQ,observeElementOffset:nQ,scrollToFn:oQ,initialOffset:()=>typeof document<"u"?window.scrollY:0,...e})}const ev=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:"relative w-full overflow-auto",children:g.jsx("table",{ref:n,className:Y("w-full caption-bottom text-sm",e),...t})}));ev.displayName="Table";const tv=E.forwardRef(({className:e,...t},n)=>g.jsx("thead",{ref:n,className:Y("[&_tr]:border-b",e),...t}));tv.displayName="TableHeader";const nv=E.forwardRef(({className:e,...t},n)=>g.jsx("tbody",{ref:n,className:Y("[&_tr:last-child]:border-0",e),...t}));nv.displayName="TableBody";const YD=E.forwardRef(({className:e,...t},n)=>g.jsx("tfoot",{ref:n,className:Y("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));YD.displayName="TableFooter";const La=E.forwardRef(({className:e,...t},n)=>g.jsx("tr",{ref:n,className:Y("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));La.displayName="TableRow";const rv=E.forwardRef(({className:e,...t},n)=>g.jsx("th",{ref:n,className:Y("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));rv.displayName="TableHead";const Ul=E.forwardRef(({className:e,...t},n)=>g.jsx("td",{ref:n,className:Y("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ul.displayName="TableCell";const KD=E.forwardRef(({className:e,...t},n)=>g.jsx("caption",{ref:n,className:Y("mt-4 text-sm text-muted-foreground",e),...t}));KD.displayName="TableCaption";function cQ({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=XJ({data:t,columns:e,state:{sorting:c,columnVisibility:i,rowSelection:r,columnFilters:s},enableRowSelection:!0,onRowSelectionChange:o,onSortingChange:u,onColumnFiltersChange:l,onColumnVisibilityChange:a,getCoreRowModel:FJ(),getFilteredRowModel:VJ(),getPaginationRowModel:WJ(),getSortedRowModel:GJ(),getFacetedRowModel:HJ(),getFacetedUniqueValues:UJ()}),f=E.useRef(null),{rows:h}=d.getRowModel(),p=lQ({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(ev,{children:[g.jsx(tv,{children:d.getHeaderGroups().map(x=>g.jsx(La,{children:x.headers.map(S=>g.jsxs(rv,{colSpan:S.colSpan,className:Y("select-none",S.column.getCanSort()&&"cursor-pointer"),onClick:S.column.getToggleSortingHandler(),children:[S.isPlaceholder?null:Zw(S.column.columnDef.header,S.getContext()),{asc:" 🔼",desc:" 🔽"}[S.column.getIsSorted()]??null]},S.id))},x.id))}),g.jsx(nv,{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 S=h[x.index];return g.jsx(La,{"data-state":(S==null?void 0:S.getIsSelected())&&"selected",style:{height:`${x.size}px`},children:S==null?void 0:S.getVisibleCells().map(C=>g.jsx(Ul,{children:Zw(C.column.columnDef.cell,C.getContext())},C.id))},S==null?void 0:S.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(La,{"data-state":x.getIsSelected()&&"selected",children:x.getVisibleCells().map(S=>g.jsx(Ul,{children:Zw(S.column.columnDef.cell,S.getContext())},S.id))},x.id)):g.jsx(La,{children:g.jsx(Ul,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})})]})})}function uQ({date:e,onDateChange:t,placeholder:n="Pick a date",disabled:r=!1,className:o}){const[i,a]=E.useState(!1);return g.jsxs(Id,{open:i,onOpenChange:a,children:[g.jsx(jd,{asChild:!0,children:g.jsxs(Yn,{variant:"outline",className:Y("w-[240px] justify-start text-left font-normal",!e&&"text-muted-foreground",o),disabled:r,children:[g.jsx(QN,{className:"mr-2 h-4 w-4"}),e?Pr(e,"PPP"):n]})}),g.jsx(zl,{className:"w-auto p-0",align:"start",children:g.jsx(Pd,{mode:"single",selected:e,onSelect:s=>{t==null||t(s),a(!1)},initialFocus:!0})})]})}function dQ({dateRange:e,onDateRangeChange:t,placeholder:n="Pick a date range",disabled:r=!1,className:o}){const[i,a]=E.useState(!1);return g.jsxs(Id,{open:i,onOpenChange:a,children:[g.jsx(jd,{asChild:!0,children:g.jsxs(Yn,{variant:"outline",className:Y("w-[300px] justify-start text-left font-normal",!(e!=null&&e.from)&&!(e!=null&&e.to)&&"text-muted-foreground",o),disabled:r,children:[g.jsx(QN,{className:"mr-2 h-4 w-4"}),e!=null&&e.from||e!=null&&e.to?g.jsxs(g.Fragment,{children:[e.from&&Pr(e.from,"PPP"),e.to&&" - ",e.to&&Pr(e.to,"PPP")]}):n]})}),g.jsx(zl,{className:"w-auto p-0",align:"start",children:g.jsx(Pd,{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 fQ(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 XD=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}),za=()=>{const e=E.useContext(XD);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};fQ(`[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(
|
|
440
|
+
[data-state=closed]
|
|
441
|
+
){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 hQ(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function pQ(){return ov(/^Mac/)}function mQ(){return ov(/^iPhone/)}function ZD(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function gQ(){return ov(/^iPad/)||pQ()&&navigator.maxTouchPoints>1}function JD(){return mQ()||gQ()}function ov(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const wQ=24,vQ=typeof window<"u"?E.useLayoutEffect:E.useEffect;function QD(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const iv=typeof document<"u"&&window.visualViewport;function ek(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function tk(e){for(ek(e)&&(e=e.parentElement);e&&!ek(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const yQ=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Bd=0,av;function bQ(e={}){let{isDisabled:t}=e;vQ(()=>{if(!t)return Bd++,Bd===1&&JD()&&(av=xQ()),()=>{Bd--,Bd===0&&(av==null||av())}},[t])}function xQ(){let e,t=0,n=d=>{e=tk(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;sv(f)&&f!==document.activeElement&&(d.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=d=>{let f=d.target;sv(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",iv&&(iv.height<window.innerHeight?requestAnimationFrame(()=>{nk(f)}):iv.addEventListener("resize",()=>nk(f),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=QD(_Q(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=QD(Vl(document,"touchstart",n,{passive:!1,capture:!0}),Vl(document,"touchmove",r,{passive:!1,capture:!0}),Vl(document,"touchend",o,{passive:!1,capture:!0}),Vl(document,"focus",i,!0),Vl(window,"scroll",a));return()=>{c(),u(),window.scrollTo(s,l)}}function _Q(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Vl(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function nk(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=tk(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+wQ;i>a&&(n.scrollTop+=o-r)}e=n.parentElement}}function sv(e){return e instanceof HTMLInputElement&&!yQ.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function SQ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function CQ(...e){return t=>e.forEach(n=>SQ(n,t))}function rk(...e){return y.useCallback(CQ(...e),e)}const ok=new WeakMap;function Pt(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&&ok.set(e,r)}function EQ(e,t){if(!e||!(e instanceof HTMLElement))return;let n=ok.get(e);n&&(e.style[t]=n[t])}const Ct=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Hd(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(", ")[Ct(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Ct(t)?5:4]):null)}function PQ(e){return 8*(Math.log(e+1)-2)}function lv(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function RQ(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const gt={DURATION:.5,EASE:[.32,.72,0,1]},ik=.4,NQ=.25,TQ=100,ak=8,Ud=16,cv=26,uv="vaul-dragging";function sk(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 MQ({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,o=E.useRef(r),i=sk(t);return E.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function lk({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=MQ({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=sk(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 DQ({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:a,direction:s="bottom",container:l,snapToSequentialPoint:c}){const[u,d]=lk({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 k=typeof M=="string";let O=0;if(k&&(O=parseInt(M,10)),Ct(s)){const L=k?O:f?M*R.height:0;return f?s==="bottom"?R.height-L:-R.height+L:L}const F=k?O:f?M*R.width:0;return f?s==="right"?R.width-F:-R.width+F:F}))!=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(k=>k===R))!=null?T:null;a(M),Pt(r.current,{transition:`transform ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`,transform:Ct(s)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`}),w&&M!==w.length-1&&i!==void 0&&M!==i&&M<i?Pt(o.current,{transition:`opacity ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`,opacity:"0"}):Pt(o.current,{transition:`opacity ${gt.DURATION}s cubic-bezier(${gt.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 S({draggedDistance:R,closeDrawer:T,velocity:M,dismissible:k}){if(i===void 0)return;const O=s==="bottom"||s==="right"?(b??0)-R:(b??0)+R,F=m===i-1,L=m===0,K=R>0;if(F&&Pt(o.current,{transition:`opacity ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`}),!c&&M>2&&!K){k?T():x(w[0]);return}if(!c&&M>2&&K&&w&&n){x(w[n.length-1]);return}const ne=w==null?void 0:w.reduce((X,B)=>typeof X!="number"||typeof B!="number"?X:Math.abs(B-O)<Math.abs(X-O)?B:X),q=Ct(s)?window.innerHeight:window.innerWidth;if(M>ik&&Math.abs(R)<q*.4){const X=K?1:-1;if(X>0&&p&&n){x(w[n.length-1]);return}if(L&&X<0&&k&&T(),m===null)return;x(w[m+X]);return}x(ne)}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]||Pt(r.current,{transform:Ct(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 O=M?m+1:m-1,F=M?w[O]-w[O-1]:w[O+1]-w[O],L=R/Math.abs(F);return M?1-L:L}return{isLastSnapPoint:p,activeSnapPoint:u,shouldFade:v,getPercentageDragged:N,setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:S,onDrag:C,snapPointsOffset:w}}const kQ=()=>()=>{};function OQ(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=za(),i=E.useRef(null),a=E.useMemo(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-cv)/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;RQ(r&&!o?lv(document.body,{background:"black"}):kQ,lv(l,{transformOrigin:Ct(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${gt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${gt.EASE.join(",")})`}));const c=lv(l,{borderRadius:`${ak}px`,overflow:"hidden",...Ct(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")},gt.DURATION*1e3)}}},[t,n,a])}let Wl=null;function AQ({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(ZD()&&Wl===null&&e&&!i){Wl={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(ZD()&&Wl!==null&&!i){const d=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Wl),window.requestAnimationFrame(()=>{if(o&&a!==window.location.href){s(window.location.href);return}window.scrollTo(f,d)}),Wl=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 ck({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:s=!0,closeThreshold:l=NQ,scrollLockTimeout:c=TQ,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:S="bottom",defaultOpen:C=!1,disablePreventScroll:N=!0,snapToSequentialPoint:R=!1,preventScrollRestoration:T=!1,repositionInputs:M=!0,onAnimationEnd:k,container:O,autoFocus:F=!1}){var L,K;const[ne=!1,q]=lk({defaultProp:C,prop:e,onChange:xe=>{t==null||t(xe),!xe&&!b&&D(),setTimeout(()=>{k==null||k(xe)},gt.DURATION*1e3),xe&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),xe||(document.body.style.pointerEvents="auto")}}),[X,B]=E.useState(!1),[ee,Z]=E.useState(!1),[J,H]=E.useState(!1),I=E.useRef(null),V=E.useRef(null),ae=E.useRef(null),j=E.useRef(null),G=E.useRef(null),$=E.useRef(!1),te=E.useRef(null),ie=E.useRef(0),re=E.useRef(!1),z=E.useRef(!C),se=E.useRef(0),oe=E.useRef(null),fe=E.useRef(((L=oe.current)==null?void 0:L.getBoundingClientRect().height)||0),ge=E.useRef(((K=oe.current)==null?void 0:K.getBoundingClientRect().width)||0),pe=E.useRef(0),me=E.useCallback(xe=>{i&&xe===Me.length-1&&(V.current=new Date)},[]),{activeSnapPoint:_e,activeSnapPointIndex:Re,setActiveSnapPoint:nt,onRelease:Ae,snapPointsOffset:Me,onDrag:Ce,shouldFade:Fe,getPercentageDragged:pn}=DQ({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:p,drawerRef:oe,fadeFromIndex:f,overlayRef:I,onSnapPointChange:me,direction:S,container:O,snapToSequentialPoint:R});bQ({isDisabled:!ne||ee||!v||J||!X||!M||!N});const{restorePositionSetting:D}=AQ({isOpen:ne,modal:v,nested:b??!1,hasBeenOpened:X,preventScrollRestoration:T,noBodyStyles:x});function _(){return(window.innerWidth-cv)/window.innerWidth}function P(xe){var Ye,Xe;!u&&!i||oe.current&&!oe.current.contains(xe.target)||(fe.current=((Ye=oe.current)==null?void 0:Ye.getBoundingClientRect().height)||0,ge.current=((Xe=oe.current)==null?void 0:Xe.getBoundingClientRect().width)||0,Z(!0),ae.current=new Date,JD()&&window.addEventListener("touchend",()=>$.current=!1,{once:!0}),xe.target.setPointerCapture(xe.pointerId),ie.current=Ct(S)?xe.pageY:xe.pageX)}function A(xe,Ye){var Xe;let Le=xe;const we=(Xe=window.getSelection())==null?void 0:Xe.toString(),Ve=oe.current?Hd(oe.current,S):null,We=new Date;if(Le.tagName==="SELECT"||Le.hasAttribute("data-vaul-no-drag")||Le.closest("[data-vaul-no-drag]"))return!1;if(S==="right"||S==="left")return!0;if(V.current&&We.getTime()-V.current.getTime()<500)return!1;if(Ve!==null&&(S==="bottom"?Ve>0:Ve<0))return!0;if(we&&we.length>0)return!1;if(G.current&&We.getTime()-G.current.getTime()<c&&Ve===0||Ye)return G.current=We,!1;for(;Le;){if(Le.scrollHeight>Le.clientHeight){if(Le.scrollTop!==0)return G.current=new Date,!1;if(Le.getAttribute("role")==="dialog")return!0}Le=Le.parentNode}return!0}function U(xe){if(oe.current&&ee){const Ye=S==="bottom"||S==="right"?1:-1,Xe=(ie.current-(Ct(S)?xe.pageY:xe.pageX))*Ye,Le=Xe>0,we=i&&!u&&!Le;if(we&&Re===0)return;const Ve=Math.abs(Xe),We=document.querySelector("[data-vaul-drawer-wrapper]"),pt=S==="bottom"||S==="top"?fe.current:ge.current;let Ut=Ve/pt;const ct=pn(Ve,Le);if(ct!==null&&(Ut=ct),we&&Ut>=1||!$.current&&!A(xe.target,Le))return;if(oe.current.classList.add(uv),$.current=!0,Pt(oe.current,{transition:"none"}),Pt(I.current,{transition:"none"}),i&&Ce({draggedDistance:Xe}),Le&&!i){const Jt=PQ(Xe),Vt=Math.min(Jt*-1,0)*Ye;Pt(oe.current,{transform:Ct(S)?`translate3d(0, ${Vt}px, 0)`:`translate3d(${Vt}px, 0, 0)`});return}const St=1-Ut;if((Fe||f&&Re===f-1)&&(r==null||r(xe,Ut),Pt(I.current,{opacity:`${St}`,transition:"none"},!0)),We&&I.current&&a){const Jt=Math.min(_()+Ut*(1-_()),1),Vt=8-Ut*8,mn=Math.max(0,14-Ut*14);Pt(We,{borderRadius:`${Vt}px`,transform:Ct(S)?`scale(${Jt}) translate3d(0, ${mn}px, 0)`:`scale(${Jt}) translate3d(${mn}px, 0, 0)`,transition:"none"},!0)}if(!i){const Jt=Ve*Ye;Pt(oe.current,{transform:Ct(S)?`translate3d(0, ${Jt}px, 0)`:`translate3d(${Jt}px, 0, 0)`})}}}E.useEffect(()=>{window.requestAnimationFrame(()=>{z.current=!0})},[]),E.useEffect(()=>{var xe;function Ye(){if(!oe.current||!M)return;const Xe=document.activeElement;if(sv(Xe)||re.current){var Le;const we=((Le=window.visualViewport)==null?void 0:Le.height)||0,Ve=window.innerHeight;let We=Ve-we;const pt=oe.current.getBoundingClientRect().height||0,Ut=pt>Ve*.8;pe.current||(pe.current=pt);const ct=oe.current.getBoundingClientRect().top;if(Math.abs(se.current-We)>60&&(re.current=!re.current),i&&i.length>0&&Me&&Re){const St=Me[Re]||0;We+=St}if(se.current=We,pt>we||re.current){const St=oe.current.getBoundingClientRect().height;let Jt=St;St>we&&(Jt=we-(Ut?ct:cv)),m?oe.current.style.height=`${St-Math.max(We,0)}px`:oe.current.style.height=`${Math.max(Jt,we-ct)}px`}else hQ()||(oe.current.style.height=`${pe.current}px`);i&&i.length>0&&!re.current?oe.current.style.bottom="0px":oe.current.style.bottom=`${Math.max(We,0)}px`}}return(xe=window.visualViewport)==null||xe.addEventListener("resize",Ye),()=>{var Xe;return(Xe=window.visualViewport)==null?void 0:Xe.removeEventListener("resize",Ye)}},[Re,i,Me]);function Q(xe){ke(),w==null||w(),xe||q(!1),setTimeout(()=>{i&&nt(i[0])},gt.DURATION*1e3)}function ce(){if(!oe.current)return;const xe=document.querySelector("[data-vaul-drawer-wrapper]"),Ye=Hd(oe.current,S);Pt(oe.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`}),Pt(I.current,{transition:`opacity ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`,opacity:"1"}),a&&Ye&&Ye>0&&ne&&Pt(xe,{borderRadius:`${ak}px`,overflow:"hidden",...Ct(S)?{transform:`scale(${_()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${_()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${gt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${gt.EASE.join(",")})`},!0)}function ke(){!ee||!oe.current||(oe.current.classList.remove(uv),$.current=!1,Z(!1),j.current=new Date)}function rt(xe){if(!ee||!oe.current)return;oe.current.classList.remove(uv),$.current=!1,Z(!1),j.current=new Date;const Ye=Hd(oe.current,S);if(!xe||!A(xe.target,!1)||!Ye||Number.isNaN(Ye)||ae.current===null)return;const Xe=j.current.getTime()-ae.current.getTime(),Le=ie.current-(Ct(S)?xe.pageY:xe.pageX),we=Math.abs(Le)/Xe;if(we>.05&&(H(!0),setTimeout(()=>{H(!1)},200)),i){Ae({draggedDistance:Le*(S==="bottom"||S==="right"?1:-1),closeDrawer:Q,velocity:we,dismissible:u}),o==null||o(xe,!0);return}if(S==="bottom"||S==="right"?Le>0:Le<0){ce(),o==null||o(xe,!0);return}if(we>ik){Q(),o==null||o(xe,!1);return}var Ve;const We=Math.min((Ve=oe.current.getBoundingClientRect().height)!=null?Ve:0,window.innerHeight);var pt;const Ut=Math.min((pt=oe.current.getBoundingClientRect().width)!=null?pt:0,window.innerWidth),ct=S==="left"||S==="right";if(Math.abs(Ye)>=(ct?Ut:We)*l){Q(),o==null||o(xe,!1);return}o==null||o(xe,!0),ce()}E.useEffect(()=>(ne&&(Pt(document.documentElement,{scrollBehavior:"auto"}),V.current=new Date),()=>{EQ(document.documentElement,"scrollBehavior")}),[ne]);function Je(xe){const Ye=xe?(window.innerWidth-Ud)/window.innerWidth:1,Xe=xe?-16:0;te.current&&window.clearTimeout(te.current),Pt(oe.current,{transition:`transform ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`,transform:Ct(S)?`scale(${Ye}) translate3d(0, ${Xe}px, 0)`:`scale(${Ye}) translate3d(${Xe}px, 0, 0)`}),!xe&&oe.current&&(te.current=setTimeout(()=>{const Le=Hd(oe.current,S);Pt(oe.current,{transition:"none",transform:Ct(S)?`translate3d(0, ${Le}px, 0)`:`translate3d(${Le}px, 0, 0)`})},500))}function it(xe,Ye){if(Ye<0)return;const Xe=(window.innerWidth-Ud)/window.innerWidth,Le=Xe+Ye*(1-Xe),we=-16+Ye*Ud;Pt(oe.current,{transform:Ct(S)?`scale(${Le}) translate3d(0, ${we}px, 0)`:`scale(${Le}) translate3d(${we}px, 0, 0)`,transition:"none"})}function Ue(xe,Ye){const Xe=Ct(S)?window.innerHeight:window.innerWidth,Le=Ye?(Xe-Ud)/Xe:1,we=Ye?-16:0;Ye&&Pt(oe.current,{transition:`transform ${gt.DURATION}s cubic-bezier(${gt.EASE.join(",")})`,transform:Ct(S)?`scale(${Le}) translate3d(0, ${we}px, 0)`:`scale(${Le}) translate3d(${we}px, 0, 0)`})}return E.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),E.createElement(Au,{defaultOpen:C,onOpenChange:xe=>{!u&&!xe||(xe?B(!0):Q(!0),q(xe))},open:ne},E.createElement(XD.Provider,{value:{activeSnapPoint:_e,snapPoints:i,setActiveSnapPoint:nt,drawerRef:oe,overlayRef:I,onOpenChange:t,onPress:P,onRelease:rt,onDrag:U,dismissible:u,shouldAnimate:z,handleOnly:d,isOpen:ne,isDragging:ee,shouldFade:Fe,closeDrawer:Q,onNestedDrag:it,onNestedOpenChange:Je,onNestedRelease:Ue,keyboardIsOpen:re,modal:v,snapPointsOffset:Me,activeSnapPointIndex:Re,direction:S,shouldScaleBackground:a,setBackgroundColorOnScale:s,noBodyStyles:x,container:O,autoFocus:F}},n))}const uk=E.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:a,modal:s,shouldAnimate:l}=za(),c=rk(t,n),u=r&&r.length>0;if(!s)return null;const d=E.useCallback(f=>o(f),[o]);return E.createElement(aa,{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})});uk.displayName="Drawer.Overlay";const dk=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}=za(),[S,C]=E.useState(!1),N=rk(o,i),R=E.useRef(null),T=E.useRef(null),M=E.useRef(!1),k=m&&m.length>0;OQ();const O=(L,K,ne=0)=>{if(M.current)return!0;const q=Math.abs(L.y),X=Math.abs(L.x),B=X>q,ee=["bottom","right"].includes(K)?1:-1;if(K==="left"||K==="right"){if(!(L.x*ee<0)&&X>=0&&X<=ne)return B}else if(!(L.y*ee<0)&&q>=0&&q<=ne)return!B;return M.current=!0,!0};E.useEffect(()=>{k&&window.requestAnimationFrame(()=>{C(!0)})},[]);function F(L){R.current=null,M.current=!1,s(L)}return E.createElement(sa,{"data-vaul-drawer-direction":p,"data-vaul-drawer":"","data-vaul-delayed-snap-points":S?"true":"false","data-vaul-snap-points":h&&k?"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:L=>{w||(r.onPointerDown==null||r.onPointerDown.call(r,L),R.current={x:L.pageX,y:L.pageY},a(L))},onOpenAutoFocus:L=>{n==null||n(L),x||L.preventDefault()},onPointerDownOutside:L=>{if(e==null||e(L),!f||L.defaultPrevented){L.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:L=>{if(!f){L.preventDefault();return}},onPointerMove:L=>{if(T.current=L,w||(r.onPointerMove==null||r.onPointerMove.call(r,L),!R.current))return;const K=L.pageY-R.current.y,ne=L.pageX-R.current.x,q=L.pointerType==="touch"?10:2;O({x:ne,y:K},p,q)?l(L):(Math.abs(ne)>q||Math.abs(K)>q)&&(R.current=null)},onPointerUp:L=>{r.onPointerUp==null||r.onPointerUp.call(r,L),R.current=null,M.current=!1,s(L)},onPointerOut:L=>{r.onPointerOut==null||r.onPointerOut.call(r,L),F(T.current)},onContextMenu:L=>{r.onContextMenu==null||r.onContextMenu.call(r,L),T.current&&F(T.current)}})});dk.displayName="Drawer.Content";const IQ=250,jQ=120,fk=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}=za(),p=E.useRef(null),m=E.useRef(!1);function v(){if(m.current){x();return}window.setTimeout(()=>{w()},jQ)}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},IQ)}function x(){p.current&&window.clearTimeout(p.current),m.current=!1}return E.createElement("div",{onClick:v,onPointerCancel:x,onPointerDown:S=>{u&&f(S),b()},onPointerMove:S=>{u&&h(S)},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))});fk.displayName="Drawer.Handle";function $Q({onDrag:e,onOpenChange:t,open:n,...r}){const{onNestedDrag:o,onNestedOpenChange:i,onNestedRelease:a}=za();if(!o)throw new Error("Drawer.NestedRoot must be placed in another drawer");return E.createElement(ck,{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 FQ(e){const t=za(),{container:n=t.container,...r}=e;return E.createElement(ju,{container:n,...r})}const Qn={Root:ck,NestedRoot:$Q,Content:dk,Overlay:uk,Trigger:Iu,Portal:FQ,Handle:fk,Close:ua,Title:la,Description:ca},hk=({shouldScaleBackground:e=!0,...t})=>g.jsx(Qn.Root,{shouldScaleBackground:e,...t});hk.displayName="Drawer";const LQ=Qn.Trigger,pk=Qn.Portal,zQ=Qn.Close,dv=E.forwardRef(({className:e,...t},n)=>g.jsx(Qn.Overlay,{ref:n,className:Y("fixed inset-0 z-50 bg-black/80",e),...t}));dv.displayName=Qn.Overlay.displayName;const mk=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(pk,{children:[g.jsx(dv,{}),g.jsxs(Qn.Content,{ref:r,className:Y("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-muted"}),t]})]}));mk.displayName="DrawerContent";const gk=({className:e,...t})=>g.jsx("div",{className:Y("grid gap-1.5 p-4 text-center sm:text-left",e),...t});gk.displayName="DrawerHeader";const wk=({className:e,...t})=>g.jsx("div",{className:Y("mt-auto flex flex-col gap-2 p-4",e),...t});wk.displayName="DrawerFooter";const vk=E.forwardRef(({className:e,...t},n)=>g.jsx(Qn.Title,{ref:n,className:Y("text-lg font-semibold leading-none tracking-tight",e),...t}));vk.displayName=Qn.Title.displayName;const yk=E.forwardRef(({className:e,...t},n)=>g.jsx(Qn.Description,{ref:n,className:Y("text-sm text-muted-foreground",e),...t}));yk.displayName=Qn.Description.displayName;const BQ=HW,HQ=UW,UQ=VW,VQ=oE,WQ=GW,GQ=WW,bk=E.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(fE,{ref:o,className:Y("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(Co,{className:"ml-auto h-4 w-4"})]}));bk.displayName=fE.displayName;const xk=E.forwardRef(({className:e,...t},n)=>g.jsx(hE,{ref:n,className:Y("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}));xk.displayName=hE.displayName;const _k=E.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(oE,{children:g.jsx(iE,{ref:r,sideOffset:t,className:Y("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})}));_k.displayName=iE.displayName;const Sk=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(sE,{ref:r,className:Y("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}));Sk.displayName=sE.displayName;const Ck=E.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(lE,{ref:o,className:Y("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(uE,{children:g.jsx(Ra,{className:"h-4 w-4"})})}),t]}));Ck.displayName=lE.displayName;const Ek=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(cE,{ref:r,className:Y("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(uE,{children:g.jsx(bd,{className:"h-2 w-2 fill-current"})})}),t]}));Ek.displayName=cE.displayName;const Pk=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(aE,{ref:r,className:Y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Pk.displayName=aE.displayName;const Rk=E.forwardRef(({className:e,...t},n)=>g.jsx(dE,{ref:n,className:Y("-mx-1 my-1 h-px bg-muted",e),...t}));Rk.displayName=dE.displayName;const Nk=({className:e,...t})=>g.jsx("span",{className:Y("ml-auto text-xs tracking-widest opacity-60",e),...t});Nk.displayName="DropdownMenuShortcut";let Tk=0;function qQ(e="id"){const t=E.useRef(null);return t.current===null&&(Tk+=1,t.current=`${e}-${Tk}`),t.current}var YQ=e=>e.type==="checkbox",KQ=e=>e instanceof Date,Mk=e=>e==null;const XQ=e=>typeof e=="object";var Ba=e=>!Mk(e)&&!Array.isArray(e)&&XQ(e)&&!KQ(e),ZQ=e=>Ba(e)&&e.target?YQ(e.target)?e.target.checked:e.target.value:e,JQ=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,QQ=(e,t)=>e.has(JQ(t)),eee=e=>{const t=e.constructor&&e.constructor.prototype;return Ba(t)&&t.hasOwnProperty("isPrototypeOf")},tee=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function fv(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(!(tee&&(e instanceof Blob||r))&&(n||Ba(e)))if(t=n?[]:{},!n&&!eee(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=fv(e[o]));else return e;return t}var Dk=e=>Array.isArray(e)?e.filter(Boolean):[],hv=e=>e===void 0,un=(e,t,n)=>{if(!t||!Ba(e))return n;const r=Dk(t.split(/[,[\].]+?/)).reduce((o,i)=>Mk(o)?o:o[i],e);return hv(r)||r===e?hv(e[t])?n:e[t]:r},kk=e=>typeof e=="boolean",nee=e=>/^\w*$/.test(e),ree=e=>Dk(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ok=(e,t,n)=>{let r=-1;const o=nee(t)?[t]:ree(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=Ba(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 Ak={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ik={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},jk=E.createContext(null),Vd=()=>E.useContext(jk),oee=e=>{const{children:t,...n}=e;return E.createElement(jk.Provider,{value:n},t)};var iee=(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]!==Ik.all&&(t._proxyFormState[a]=!r||Ik.all),n&&(n[a]=!0),e[a]}});return o},aee=e=>Ba(e)&&!Object.keys(e).length,see=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return aee(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===!0)},lee=e=>Array.isArray(e)?e:[e],$k=(e,t,n)=>!e||!t||e===t||lee(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Fk(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 cee(e){const t=Vd(),{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,Fk({disabled:r,next:d=>l.current&&$k(u.current,d.name,i)&&see(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(()=>iee(a,n,c.current,!1),[a,n])}var uee=e=>typeof e=="string",dee=(e,t,n,r,o)=>uee(e)?un(n,e,o):Array.isArray(e)?e.map(i=>un(n,i)):n;function fee(e){const t=Vd(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:a}=e,s=E.useRef(r);s.current=r,Fk({disabled:i,subject:n._subjects.values,next:u=>{$k(s.current,u.name,a)&&c(fv(dee(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 hee(e){const t=Vd(),{name:n,disabled:r,control:o=t.control,shouldUnregister:i}=e,a=QQ(o._names.array,n),s=fee({control:o,name:n,defaultValue:un(o._formValues,n,un(o._defaultValues,n,e.defaultValue)),exact:!0}),l=cee({control:o,name:n,exact:!0}),c=E.useRef(o.register(n,{...e.rules,value:s,...kk(e.disabled)?{disabled:e.disabled}:{}})),u=E.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!un(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!un(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!un(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!un(l.validatingFields,n)},error:{enumerable:!0,get:()=>un(l.errors,n)}}),[l,n]),d=E.useMemo(()=>({name:n,value:s,...kk(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:f=>c.current.onChange({target:{value:ZQ(f),name:n},type:Ak.CHANGE}),onBlur:()=>c.current.onBlur({target:{value:un(o._formValues,n),name:n},type:Ak.BLUR}),ref:f=>{const h=un(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=un(o._fields,p);v&&v._f&&(v._f.mount=m)};if(h(n,!0),f){const p=fv(un(o._options.defaultValues,n));Ok(o._defaultValues,n,p),hv(un(o._formValues,n))&&Ok(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 pee=e=>e.render(hee(e)),mee=Cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),pv=E.forwardRef(({className:e,...t},n)=>g.jsx(mE,{ref:n,className:Y(mee(),e),...t}));pv.displayName=mE.displayName;const gee=oee,Lk=E.createContext({}),wee=({...e})=>g.jsx(Lk.Provider,{value:{name:e.name},children:g.jsx(pee,{...e})}),Gl=()=>{const e=E.useContext(Lk),t=E.useContext(zk),{getFieldState:n,formState:r}=Vd(),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}},zk=E.createContext({}),Bk=E.forwardRef(({className:e,...t},n)=>{const r=qQ();return g.jsx(zk.Provider,{value:{id:r},children:g.jsx("div",{ref:n,className:Y("space-y-2",e),...t})})});Bk.displayName="FormItem";const Hk=E.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:o}=Gl();return g.jsx(pv,{ref:n,className:Y(r&&"text-destructive",e),htmlFor:o,...t})});Hk.displayName="FormLabel";const Uk=E.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:i}=Gl();return g.jsx(Hn,{ref:t,id:r,"aria-describedby":n?`${o} ${i}`:`${o}`,"aria-invalid":!!n,...e})});Uk.displayName="FormControl";const Vk=E.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Gl();return g.jsx("p",{ref:n,id:r,className:Y("text-sm text-muted-foreground",e),...t})});Vk.displayName="FormDescription";const Wk=E.forwardRef(({className:e,children:t,...n},r)=>{const{error:o,formMessageId:i}=Gl(),a=o?String(o==null?void 0:o.message):t;return a?g.jsx("p",{ref:r,id:i,className:Y("text-sm font-medium text-destructive",e),...n,children:a}):null});Wk.displayName="FormMessage";const vee=tG,yee=nG,Gk=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>g.jsx(xE,{ref:o,align:t,sideOffset:n,className:Y("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}));Gk.displayName=xE.displayName;const qk=E.forwardRef(({className:e,type:t,...n},r)=>g.jsx("input",{type:t,className:Y("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-muted-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}));qk.displayName="Input";const bee=_G,xee=SG,_ee=UE,See=EG,Cee=CG,Yk=E.forwardRef(({className:e,...t},n)=>g.jsx(BE,{ref:n,className:Y("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",e),...t}));Yk.displayName=BE.displayName;const Kk=E.forwardRef(({className:e,...t},n)=>g.jsx(HE,{ref:n,className:Y("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}));Kk.displayName=HE.displayName;const Xk=E.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(ZE,{ref:o,className:Y("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(Co,{className:"ml-auto h-4 w-4"})]}));Xk.displayName=ZE.displayName;const Zk=E.forwardRef(({className:e,...t},n)=>g.jsx(JE,{ref:n,className:Y("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}));Zk.displayName=JE.displayName;const Jk=E.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,...o},i)=>g.jsx(UE,{children:g.jsx(VE,{ref:i,align:t,alignOffset:n,sideOffset:r,className:Y("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})}));Jk.displayName=VE.displayName;const Qk=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(GE,{ref:r,className:Y("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}));Qk.displayName=GE.displayName;const eO=E.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(qE,{ref:o,className:Y("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(KE,{children:g.jsx(Ra,{className:"h-4 w-4"})})}),t]}));eO.displayName=qE.displayName;const tO=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(YE,{ref:r,className:Y("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(KE,{children:g.jsx(bd,{className:"h-2 w-2 fill-current"})})}),t]}));tO.displayName=YE.displayName;const nO=E.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(WE,{ref:r,className:Y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));nO.displayName=WE.displayName;const rO=E.forwardRef(({className:e,...t},n)=>g.jsx(XE,{ref:n,className:Y("-mx-1 my-1 h-px bg-muted",e),...t}));rO.displayName=XE.displayName;const oO=({className:e,...t})=>g.jsx("span",{className:Y("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});oO.displayName="MenubarShortcut";const iO=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(bP,{ref:r,className:Y("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,g.jsx(mv,{})]}));iO.displayName=bP.displayName;const aO=E.forwardRef(({className:e,...t},n)=>g.jsx(xP,{ref:n,className:Y("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));aO.displayName=xP.displayName;const Eee=BG,sO=Cn("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"),lO=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(_P,{ref:r,className:Y(sO(),"group",e),...n,children:[t," ",g.jsx(vd,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));lO.displayName=_P.displayName;const cO=E.forwardRef(({className:e,...t},n)=>g.jsx(CP,{ref:n,className:Y("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}));cO.displayName=CP.displayName;const Pee=HG,mv=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:Y("absolute left-0 top-full flex justify-center"),children:g.jsx(EP,{className:Y("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})}));mv.displayName=EP.displayName;const uO=E.forwardRef(({className:e,...t},n)=>g.jsx(SP,{ref:n,className:Y("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"})}));uO.displayName=SP.displayName;const dO=({className:e,...t})=>g.jsx("nav",{role:"navigation","aria-label":"pagination",className:Y("mx-auto flex w-full justify-center",e),...t});dO.displayName="Pagination";const fO=E.forwardRef(({className:e,...t},n)=>g.jsx("ul",{ref:n,className:Y("flex flex-row items-center gap-1",e),...t}));fO.displayName="PaginationContent";const hO=E.forwardRef(({className:e,...t},n)=>g.jsx("li",{ref:n,className:Y("",e),...t}));hO.displayName="PaginationItem";const Ha=E.forwardRef(({className:e,isActive:t,disabled:n,...r},o)=>g.jsx(Yn,{ref:o,"aria-current":t?"page":void 0,disabled:n,className:Y("h-9 w-9",{"pointer-events-none bg-accent":t,"pointer-events-none opacity-50":n},e),...r}));Ha.displayName="PaginationLink";const pO=E.forwardRef(({className:e,...t},n)=>g.jsxs(Ha,{ref:n,"aria-label":"Go to previous page",className:Y("gap-1 px-2 min-w-[100px]",e),...t,children:[g.jsx(yd,{className:"h-4 w-4"}),g.jsx("span",{children:"Previous"})]}));pO.displayName="PaginationPrevious";const mO=E.forwardRef(({className:e,...t},n)=>g.jsxs(Ha,{ref:n,"aria-label":"Go to next page",className:Y("gap-1 px-2 min-w-[100px]",e),...t,children:[g.jsx("span",{children:"Next"}),g.jsx(Co,{className:"h-4 w-4"})]}));mO.displayName="PaginationNext";const gO=E.forwardRef(({className:e,...t},n)=>g.jsx(Ha,{ref:n,"aria-label":"Go to first page",className:Y("",e),...t,children:g.jsx(iq,{className:"h-4 w-4"})}));gO.displayName="PaginationFirst";const wO=E.forwardRef(({className:e,...t},n)=>g.jsx(Ha,{ref:n,"aria-label":"Go to last page",className:Y("",e),...t,children:g.jsx(aq,{className:"h-4 w-4"})}));wO.displayName="PaginationLast";const vO=({className:e,...t})=>g.jsxs("span",{"aria-hidden":!0,className:Y("flex h-9 w-9 items-center justify-center",e),...t,children:[g.jsx(lq,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"More pages"})]});vO.displayName="PaginationEllipsis";const yO=E.forwardRef(({className:e,value:t,...n},r)=>g.jsx(UP,{ref:r,className:Y("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:g.jsx(s7,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));yO.displayName=UP.displayName;const bO=E.forwardRef(({className:e,...t},n)=>g.jsx(tR,{className:Y("grid gap-2",e),...t,ref:n}));bO.displayName=tR.displayName;const xO=E.forwardRef(({className:e,...t},n)=>g.jsx(nR,{ref:n,className:Y("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(w7,{className:"flex items-center justify-center",children:g.jsx(bd,{className:"h-2.5 w-2.5 fill-current text-current"})})}));xO.displayName=nR.displayName;const{createElement:Ua,createContext:Ree,createRef:Qne,forwardRef:_O,useCallback:dn,useContext:SO,useEffect:fi,useImperativeHandle:CO,useLayoutEffect:Nee,useMemo:Tee,useRef:fn,useState:Va}=y,EO=y[`useId${Math.random()}`.slice(0,5)],Mee=Nee,Wd=Ree(null);Wd.displayName="PanelGroupContext";const hi=Mee,Dee=typeof EO=="function"?EO:()=>null;let kee=0;function gv(e=null){const t=Dee(),n=fn(e||t||null);return n.current===null&&(n.current=""+kee++),e??n.current}function PO({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=SO(Wd);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:b,getPanelSize:x,getPanelStyle:S,groupId:C,isPanelCollapsed:N,reevaluatePanelConstraints:R,registerPanel:T,resizePanel:M,unregisterPanel:k}=v,O=gv(a),F=fn({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:s,minSize:l},id:O,idIsFromProps:a!==void 0,order:f});fn({didLogMissingDefaultSizeWarning:!1}),hi(()=>{const{callbacks:K,constraints:ne}=F.current,q={...ne};F.current.id=O,F.current.idIsFromProps=a!==void 0,F.current.order=f,K.onCollapse=c,K.onExpand=u,K.onResize=d,ne.collapsedSize=n,ne.collapsible=r,ne.defaultSize=o,ne.maxSize=s,ne.minSize=l,(q.collapsedSize!==ne.collapsedSize||q.collapsible!==ne.collapsible||q.maxSize!==ne.maxSize||q.minSize!==ne.minSize)&&R(F.current,q)}),hi(()=>{const K=F.current;return T(K),()=>{k(K)}},[f,O,T,k]),CO(i,()=>({collapse:()=>{w(F.current)},expand:K=>{b(F.current,K)},getId(){return O},getSize(){return x(F.current)},isCollapsed(){return N(F.current)},isExpanded(){return!N(F.current)},resize:K=>{M(F.current,K)}}),[w,b,x,N,O,M]);const L=S(F.current,o);return Ua(p,{...m,children:e,className:t,id:a,style:{...L,...h},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":C,"data-panel-id":O,"data-panel-size":parseFloat(""+L.flexGrow).toFixed(1)})}const RO=_O((e,t)=>Ua(PO,{...e,forwardedRef:t}));PO.displayName="Panel",RO.displayName="forwardRef(Panel)";let wv=null,pi=null;function Oee(e,t){if(t){const n=(t&IO)!==0,r=(t&jO)!==0,o=(t&$O)!==0,i=(t&FO)!==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 Aee(){pi!==null&&(document.head.removeChild(pi),wv=null,pi=null)}function vv(e,t){const n=Oee(e,t);wv!==n&&(wv=n,pi===null&&(pi=document.createElement("style"),document.head.appendChild(pi)),pi.innerHTML=`*{cursor: ${n}!important;}`)}function NO(e){return e.type==="keydown"}function TO(e){return e.type.startsWith("pointer")}function MO(e){return e.type.startsWith("mouse")}function Gd(e){if(TO(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(MO(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function Iee(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function jee(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 $ee(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:OO(e),b:OO(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;je(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:kO(DO(n.a)),b:kO(DO(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 Fee=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Lee(e){var t;const n=getComputedStyle((t=AO(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function zee(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Lee(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"||Fee.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function DO(e){let t=e.length;for(;t--;){const n=e[t];if(je(n,"Missing node"),zee(n))return n}return null}function kO(e){return e&&Number(getComputedStyle(e).zIndex)||0}function OO(e){const t=[];for(;e;)t.push(e),e=AO(e);return t}function AO(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const IO=1,jO=2,$O=4,FO=8,Bee=Iee()==="coarse";let er=[],Wa=!1,Mo=new Map,qd=new Map;const ql=new Set;function Hee(e,t,n,r,o){var i;const{ownerDocument:a}=t,s={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},l=(i=Mo.get(a))!==null&&i!==void 0?i:0;return Mo.set(a,l+1),ql.add(s),Yd(),function(){var u;qd.delete(e),ql.delete(s);const d=(u=Mo.get(a))!==null&&u!==void 0?u:1;if(Mo.set(a,d-1),Yd(),d===1&&Mo.delete(a),er.includes(s)){const f=er.indexOf(s);f>=0&&er.splice(f,1),xv(),o("up",!0,null)}}}function LO(e){const{target:t}=e,{x:n,y:r}=Gd(e);Wa=!0,yv({target:t,x:n,y:r}),Yd(),er.length>0&&(Kd("down",e),e.preventDefault(),e.stopPropagation())}function Yl(e){const{x:t,y:n}=Gd(e);if(Wa&&e.buttons===0&&(Wa=!1,Kd("up",e)),!Wa){const{target:r}=e;yv({target:r,x:t,y:n})}Kd("move",e),xv(),er.length>0&&e.preventDefault()}function Ga(e){const{target:t}=e,{x:n,y:r}=Gd(e);qd.clear(),Wa=!1,er.length>0&&e.preventDefault(),Kd("up",e),yv({target:t,x:n,y:r}),xv(),Yd()}function yv({target:e,x:t,y:n}){er.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),ql.forEach(o=>{const{element:i,hitAreaMargins:a}=o,s=i.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=s,f=Bee?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)&&$ee(r,i)>0){let p=r,m=!1;for(;p&&!p.contains(i);){if(jee(p.getBoundingClientRect(),s)){m=!0;break}p=p.parentElement}if(m)return}er.push(o)}})}function bv(e,t){qd.set(e,t)}function xv(){let e=!1,t=!1;er.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;qd.forEach(r=>{n|=r}),e&&t?vv("intersection",n):e?vv("horizontal",n):t?vv("vertical",n):Aee()}function Yd(){Mo.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",Ga),n.removeEventListener("pointerdown",LO),n.removeEventListener("pointerleave",Yl),n.removeEventListener("pointermove",Yl)}),window.removeEventListener("pointerup",Ga),window.removeEventListener("pointercancel",Ga),ql.size>0&&(Wa?(er.length>0&&Mo.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",Ga),n.addEventListener("pointerleave",Yl),n.addEventListener("pointermove",Yl))}),window.addEventListener("pointerup",Ga),window.addEventListener("pointercancel",Ga)):Mo.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",LO,{capture:!0}),n.addEventListener("pointermove",Yl))}))}function Kd(e,t){ql.forEach(n=>{const{setResizeHandlerState:r}=n,o=er.includes(n);r(e,o,t)})}function Uee(){const[e,t]=Va(0);return dn(()=>t(n=>n+1),[])}function je(e,t){if(!e)throw console.error(t),Error(t)}const _v=10;function mi(e,t,n=_v){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Wr(e,t,n=_v){return mi(e,t,n)===0}function Rn(e,t,n){return mi(e,t,n)===0}function Vee(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(!Rn(o,i,n))return!1}return!0}function qa({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];je(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:i,maxSize:a=100,minSize:s=0}=r;if(mi(n,s)<0)if(i){const l=(o+s)/2;mi(n,l)<0?n=o:n=s}else n=s;return n=Math.min(a,n),n=parseFloat(n.toFixed(_v)),n}function Kl({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:i}){if(Rn(e,0))return t;const a=[...t],[s,l]=r;je(s!=null,"Invalid first pivot index"),je(l!=null,"Invalid second pivot index");let c=0;if(i==="keyboard"){{const d=e<0?l:s,f=n[d];je(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(je(v!=null,`Previous layout not found for panel index ${d}`),Rn(v,h)){const w=m-v;mi(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}{const d=e<0?s:l,f=n[d];je(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(je(v!=null,`Previous layout not found for panel index ${d}`),Rn(v,m)){const w=v-h;mi(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];je(m!=null,`Previous layout not found for panel index ${f}`);const w=qa({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];je(p!=null,`Previous layout not found for panel index ${f}`);const m=p-h,v=qa({panelConstraints:n,panelIndex:f,size:m});if(!Rn(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(Vee(o,a))return o;{const d=e<0?l:s,f=t[d];je(f!=null,`Previous layout not found for panel index ${d}`);const h=f+c,p=qa({panelConstraints:n,panelIndex:d,size:h});if(a[d]=p,!Rn(p,h)){let m=h-p,w=e<0?l:s;for(;w>=0&&w<n.length;){const b=a[w];je(b!=null,`Previous layout not found for panel index ${w}`);const x=b+m,S=qa({panelConstraints:n,panelIndex:w,size:x});if(Rn(b,S)||(m-=S-b,a[w]=S),Rn(m,0))break;e>0?w--:w++}}}const u=a.reduce((d,f)=>f+d,0);return Rn(u,100)?a:o}function Wee({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,a=0;const s=n[0];je(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 Xl(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function zO(e,t,n=document){const o=Xl(e,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return o??null}function BO(e,t,n){const r=zO(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function HO(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 Xd(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function Gee(e,t,n,r=document){var o,i,a,s;const l=Xd(t,r),c=Xl(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 qee({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:i,setLayout:a}){fn({didWarnAboutMissingResizeHandle:!1}),hi(()=>{if(!i)return;const s=Xl(n,i);for(let l=0;l<o.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=Wee({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),f=s[l];if(f!=null){const h=o[l];je(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]),fi(()=>{if(!i)return;const s=t.current;je(s,"Eager values not found");const{panelDataArray:l}=s,c=HO(n,i);je(c!=null,`No group found for id "${n}"`);const u=Xl(n,i);je(u,`No resize handles found for group id "${n}"`);const d=u.map(f=>{const h=f.getAttribute("data-panel-resize-handle-id");je(h,"Resize handle element has no handle id attribute");const[p,m]=Gee(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];je(x,`No panel data found for index ${b}`);const S=r[b],{collapsedSize:C=0,collapsible:N,minSize:R=0}=x.constraints;if(S!=null&&N){const T=Kl({delta:Rn(S,C)?R-C:C-S,initialLayout:r,panelConstraints:l.map(M=>M.constraints),pivotIndices:BO(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 UO(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 VO(e,t){const n=e==="horizontal",{x:r,y:o}=Gd(t);return n?r:o}function Yee(e,t,n,r,o){const i=n==="horizontal",a=Xd(t,o);je(a,`No resize handle element found for id "${t}"`);const s=a.getAttribute("data-panel-group-id");je(s,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=VO(n,e),u=HO(s,o);je(u,`No group element found for id "${s}"`);const d=u.getBoundingClientRect(),f=i?d.width:d.height;return(c-l)/f*100}function Kee(e,t,n,r,o,i){if(NO(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:Yee(e,t,n,r,i)}function Xee({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];je(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];je(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 Ya(e,t,n){t.forEach((r,o)=>{const i=e[o];je(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||Wr(d,c))&&!Wr(r,c)&&h(),f&&(d==null||!Wr(d,c))&&Wr(r,c)&&f())}})}function Zd(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 Zee({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 Jee(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function WO(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 GO(e){return`react-resizable-panels:${e}`}function qO(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 YO(e,t){try{const n=GO(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Qee(e,t,n){var r,o;const i=(r=YO(e,n))!==null&&r!==void 0?r:{},a=qO(t);return(o=i[a])!==null&&o!==void 0?o:null}function ete(e,t,n,r,o){var i;const a=GO(e),s=qO(t),l=(i=YO(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 KO({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(!Rn(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const a=n[i];je(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];je(a!=null,`No layout data found for index ${i}`);const s=qa({panelConstraints:t,panelIndex:i,size:a});a!=s&&(o+=a-s,n[i]=s)}if(!Rn(o,0))for(let i=0;i<t.length;i++){const a=n[i];je(a!=null,`No layout data found for index ${i}`);const s=a+o,l=qa({panelConstraints:t,panelIndex:i,size:s});if(a!==l&&(o-=l-a,n[i]=l,Rn(o,0)))break}return n}const tte=100,Zl={getItem:e=>(WO(Zl),Zl.getItem(e)),setItem:(e,t)=>{WO(Zl),Zl.setItem(e,t)}},XO={};function ZO({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:a=null,keyboardResizeBy:s=null,storage:l=Zl,style:c,tagName:u="div",...d}){const f=gv(i),h=fn(null),[p,m]=Va(null),[v,w]=Va([]),b=Uee(),x=fn({}),S=fn(new Map),C=fn(0),N=fn({autoSaveId:e,direction:r,dragState:p,id:f,keyboardResizeBy:s,onLayout:a,storage:l}),R=fn({layout:v,panelDataArray:[],panelDataArrayChanged:!1});fn({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),CO(o,()=>({getId:()=>N.current.id,getLayout:()=>{const{layout:I}=R.current;return I},setLayout:I=>{const{onLayout:V}=N.current,{layout:ae,panelDataArray:j}=R.current,G=KO({layout:I,panelConstraints:j.map($=>$.constraints)});UO(ae,G)||(w(G),R.current.layout=G,V&&V(G),Ya(j,G,x.current))}}),[]),hi(()=>{N.current.autoSaveId=e,N.current.direction=r,N.current.dragState=p,N.current.id=f,N.current.onLayout=a,N.current.storage=l}),qee({committedValuesRef:N,eagerValuesRef:R,groupId:f,layout:v,panelDataArray:R.current.panelDataArray,setLayout:w,panelGroupElement:h.current}),fi(()=>{const{panelDataArray:I}=R.current;if(e){if(v.length===0||v.length!==I.length)return;let V=XO[e];V==null&&(V=Jee(ete,tte),XO[e]=V);const ae=[...I],j=new Map(S.current);V(e,ae,j,v,l)}},[e,v,l]),fi(()=>{});const T=dn(I=>{const{onLayout:V}=N.current,{layout:ae,panelDataArray:j}=R.current;if(I.constraints.collapsible){const G=j.map(re=>re.constraints),{collapsedSize:$=0,panelSize:te,pivotIndices:ie}=gi(j,I,ae);if(je(te!=null,`Panel size not found for panel "${I.id}"`),!Wr(te,$)){S.current.set(I.id,te);const z=Ka(j,I)===j.length-1?te-$:$-te,se=Kl({delta:z,initialLayout:ae,panelConstraints:G,pivotIndices:ie,prevLayout:ae,trigger:"imperative-api"});Zd(ae,se)||(w(se),R.current.layout=se,V&&V(se),Ya(j,se,x.current))}}},[]),M=dn((I,V)=>{const{onLayout:ae}=N.current,{layout:j,panelDataArray:G}=R.current;if(I.constraints.collapsible){const $=G.map(oe=>oe.constraints),{collapsedSize:te=0,panelSize:ie=0,minSize:re=0,pivotIndices:z}=gi(G,I,j),se=V??re;if(Wr(ie,te)){const oe=S.current.get(I.id),fe=oe!=null&&oe>=se?oe:se,pe=Ka(G,I)===G.length-1?ie-fe:fe-ie,me=Kl({delta:pe,initialLayout:j,panelConstraints:$,pivotIndices:z,prevLayout:j,trigger:"imperative-api"});Zd(j,me)||(w(me),R.current.layout=me,ae&&ae(me),Ya(G,me,x.current))}}},[]),k=dn(I=>{const{layout:V,panelDataArray:ae}=R.current,{panelSize:j}=gi(ae,I,V);return je(j!=null,`Panel size not found for panel "${I.id}"`),j},[]),O=dn((I,V)=>{const{panelDataArray:ae}=R.current,j=Ka(ae,I);return Zee({defaultSize:V,dragState:p,layout:v,panelData:ae,panelIndex:j})},[p,v]),F=dn(I=>{const{layout:V,panelDataArray:ae}=R.current,{collapsedSize:j=0,collapsible:G,panelSize:$}=gi(ae,I,V);return je($!=null,`Panel size not found for panel "${I.id}"`),G===!0&&Wr($,j)},[]),L=dn(I=>{const{layout:V,panelDataArray:ae}=R.current,{collapsedSize:j=0,collapsible:G,panelSize:$}=gi(ae,I,V);return je($!=null,`Panel size not found for panel "${I.id}"`),!G||mi($,j)>0},[]),K=dn(I=>{const{panelDataArray:V}=R.current;V.push(I),V.sort((ae,j)=>{const G=ae.order,$=j.order;return G==null&&$==null?0:G==null?-1:$==null?1:G-$}),R.current.panelDataArrayChanged=!0,b()},[b]);hi(()=>{if(R.current.panelDataArrayChanged){R.current.panelDataArrayChanged=!1;const{autoSaveId:I,onLayout:V,storage:ae}=N.current,{layout:j,panelDataArray:G}=R.current;let $=null;if(I){const ie=Qee(I,G,ae);ie&&(S.current=new Map(Object.entries(ie.expandToSizes)),$=ie.layout)}$==null&&($=Xee({panelDataArray:G}));const te=KO({layout:$,panelConstraints:G.map(ie=>ie.constraints)});UO(j,te)||(w(te),R.current.layout=te,V&&V(te),Ya(G,te,x.current))}}),hi(()=>{const I=R.current;return()=>{I.layout=[]}},[]);const ne=dn(I=>{let V=!1;const ae=h.current;return ae&&window.getComputedStyle(ae,null).getPropertyValue("direction")==="rtl"&&(V=!0),function(G){G.preventDefault();const $=h.current;if(!$)return()=>null;const{direction:te,dragState:ie,id:re,keyboardResizeBy:z,onLayout:se}=N.current,{layout:oe,panelDataArray:fe}=R.current,{initialLayout:ge}=ie??{},pe=BO(re,I,$);let me=Kee(G,I,te,ie,z,$);const _e=te==="horizontal";_e&&V&&(me=-me);const Re=fe.map(Me=>Me.constraints),nt=Kl({delta:me,initialLayout:ge??oe,panelConstraints:Re,pivotIndices:pe,prevLayout:oe,trigger:NO(G)?"keyboard":"mouse-or-touch"}),Ae=!Zd(oe,nt);(TO(G)||MO(G))&&C.current!=me&&(C.current=me,!Ae&&me!==0?_e?bv(I,me<0?IO:jO):bv(I,me<0?$O:FO):bv(I,0)),Ae&&(w(nt),R.current.layout=nt,se&&se(nt),Ya(fe,nt,x.current))}},[]),q=dn((I,V)=>{const{onLayout:ae}=N.current,{layout:j,panelDataArray:G}=R.current,$=G.map(oe=>oe.constraints),{panelSize:te,pivotIndices:ie}=gi(G,I,j);je(te!=null,`Panel size not found for panel "${I.id}"`);const z=Ka(G,I)===G.length-1?te-V:V-te,se=Kl({delta:z,initialLayout:j,panelConstraints:$,pivotIndices:ie,prevLayout:j,trigger:"imperative-api"});Zd(j,se)||(w(se),R.current.layout=se,ae&&ae(se),Ya(G,se,x.current))},[]),X=dn((I,V)=>{const{layout:ae,panelDataArray:j}=R.current,{collapsedSize:G=0,collapsible:$}=V,{collapsedSize:te=0,collapsible:ie,maxSize:re=100,minSize:z=0}=I.constraints,{panelSize:se}=gi(j,I,ae);se!=null&&($&&ie&&Wr(se,G)?Wr(G,te)||q(I,te):se<z?q(I,z):se>re&&q(I,re))},[q]),B=dn((I,V)=>{const{direction:ae}=N.current,{layout:j}=R.current;if(!h.current)return;const G=Xd(I,h.current);je(G,`Drag handle element not found for id "${I}"`);const $=VO(ae,V);m({dragHandleId:I,dragHandleRect:G.getBoundingClientRect(),initialCursorPosition:$,initialLayout:j})},[]),ee=dn(()=>{m(null)},[]),Z=dn(I=>{const{panelDataArray:V}=R.current,ae=Ka(V,I);ae>=0&&(V.splice(ae,1),delete x.current[I.id],R.current.panelDataArrayChanged=!0,b())},[b]),J=Tee(()=>({collapsePanel:T,direction:r,dragState:p,expandPanel:M,getPanelSize:k,getPanelStyle:O,groupId:f,isPanelCollapsed:F,isPanelExpanded:L,reevaluatePanelConstraints:X,registerPanel:K,registerResizeHandle:ne,resizePanel:q,startDragging:B,stopDragging:ee,unregisterPanel:Z,panelGroupElement:h.current}),[T,p,r,M,k,O,f,F,L,X,K,ne,q,B,ee,Z]),H={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Ua(Wd.Provider,{value:J},Ua(u,{...d,children:t,className:n,id:i,ref:h,style:{...H,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":f}))}const JO=_O((e,t)=>Ua(ZO,{...e,forwardedRef:t}));ZO.displayName="PanelGroup",JO.displayName="forwardRef(PanelGroup)";function Ka(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function gi(e,t,n){const r=Ka(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t.constraints,panelSize:a,pivotIndices:i}}function nte({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){fi(()=>{if(e||n==null||r==null)return;const o=Xd(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");je(s,`No group element found for id "${s}"`);const l=Xl(s,r),c=zO(s,t,r);je(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 QO({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=fn(null),m=fn({onDragging:a});fi(()=>{m.current.onDragging=a});const v=SO(Wd);if(v===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:w,groupId:b,registerResizeHandle:x,startDragging:S,stopDragging:C,panelGroupElement:N}=v,R=gv(o),[T,M]=Va("inactive"),[k,O]=Va(!1),[F,L]=Va(null),K=fn({state:T});hi(()=>{K.current.state=T}),fi(()=>{if(n)L(null);else{const B=x(R);L(()=>B)}},[n,R,x]);const ne=(f=r==null?void 0:r.coarse)!==null&&f!==void 0?f:15,q=(h=r==null?void 0:r.fine)!==null&&h!==void 0?h:5;return fi(()=>{if(n||F==null)return;const B=p.current;return je(B,"Element ref not attached"),Hee(R,B,w,{coarse:ne,fine:q},(Z,J,H)=>{if(J)switch(Z){case"down":{M("drag"),je(H,'Expected event to be defined for "down" action'),S(R,H);const{onDragging:I}=m.current;I&&I(!0);break}case"move":{const{state:I}=K.current;I!=="drag"&&M("hover"),je(H,'Expected event to be defined for "move" action'),F(H);break}case"up":{M("hover"),C();const{onDragging:I}=m.current;I&&I(!1);break}}else M("inactive")})},[ne,w,n,q,x,R,F,S,C]),nte({disabled:n,handleId:R,resizeHandler:F,panelGroupElement:N}),Ua(u,{...d,children:e,className:t,id:o,onBlur:()=>{O(!1),i==null||i()},onFocus:()=>{O(!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":k?"keyboard":void 0,"data-resize-handle-state":T,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":R})}QO.displayName="PanelResizeHandle";const eA=E.forwardRef(({className:e,...t},n)=>g.jsx(JO,{ref:n,className:Y("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}));eA.displayName="ResizablePanelGroup";const tA=E.forwardRef(({className:e,...t},n)=>g.jsx(RO,{ref:n,className:Y("relative flex h-full w-full",e),...t}));tA.displayName="ResizablePanel";const nA=({className:e,...t})=>g.jsx(QO,{className:Y("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"})]})})});nA.displayName="ResizableHandle";const rA=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(gR,{ref:r,className:Y("relative overflow-hidden",e),...n,children:[g.jsx(T7,{className:"h-full w-full rounded-[inherit]",children:t}),g.jsx(Sv,{}),g.jsx(M7,{})]}));rA.displayName=gR.displayName;const Sv=E.forwardRef(({className:e,orientation:t="vertical",...n},r)=>g.jsx(ug,{ref:r,orientation:t,className:Y("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(uR,{className:"relative flex-1 rounded-full bg-border"})}));Sv.displayName=ug.displayName;const rte=K7,ote=e9,ite=X7,oA=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(GR,{ref:r,className:Y("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-muted-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(Z7,{asChild:!0,children:g.jsx(vd,{className:"h-4 w-4 opacity-50"})})]}));oA.displayName=GR.displayName;const Cv=E.forwardRef(({className:e,...t},n)=>g.jsx(XR,{ref:n,className:Y("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(oq,{className:"h-4 w-4"})}));Cv.displayName=XR.displayName;const Ev=E.forwardRef(({className:e,...t},n)=>g.jsx(ZR,{ref:n,className:Y("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(vd,{className:"h-4 w-4"})}));Ev.displayName=ZR.displayName;const iA=E.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>g.jsx(J7,{children:g.jsxs(qR,{ref:o,className:Y("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(Cv,{}),g.jsx(Q7,{className:Y("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(Ev,{})]})}));iA.displayName=qR.displayName;const aA=E.forwardRef(({className:e,...t},n)=>g.jsx(YR,{ref:n,className:Y("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));aA.displayName=YR.displayName;const sA=E.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(KR,{ref:r,className:Y("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(n9,{children:g.jsx(Ra,{className:"h-4 w-4"})})}),g.jsx(t9,{children:t})]}));sA.displayName=KR.displayName;const lA=E.forwardRef(({className:e,...t},n)=>g.jsx(JR,{ref:n,className:Y("-mx-1 my-1 h-px bg-muted",e),...t}));lA.displayName=JR.displayName;const cA=E.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>g.jsx(tN,{ref:o,decorative:n,orientation:t,className:Y("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));cA.displayName=tN.displayName;const ate=Au,ste=Iu,uA=ua,dA=ju,Pv=E.forwardRef(({className:e,...t},n)=>g.jsx(aa,{className:Y("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}));Pv.displayName=aa.displayName;const lte=Cn("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"}}),fA=E.forwardRef(({side:e="right",className:t,children:n,...r},o)=>g.jsxs(dA,{children:[g.jsx(Pv,{}),g.jsxs(sa,{ref:o,className:Y(lte({side:e}),t),...r,children:[n,g.jsxs(uA,{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(eT,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));fA.displayName=sa.displayName;const hA=({className:e,...t})=>g.jsx("div",{className:Y("flex flex-col space-y-2 text-center sm:text-left",e),...t});hA.displayName="SheetHeader";const pA=({className:e,...t})=>g.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});pA.displayName="SheetFooter";const mA=E.forwardRef(({className:e,...t},n)=>g.jsx(la,{ref:n,className:Y("text-lg font-semibold text-foreground",e),...t}));mA.displayName=la.displayName;const gA=E.forwardRef(({className:e,...t},n)=>g.jsx(ca,{ref:n,className:Y("text-sm text-muted-foreground",e),...t}));gA.displayName=ca.displayName;const wA=E.forwardRef(({className:e,variant:t,size:n,collapsed:r,fixed:o,...i},a)=>{const{variants:s}=Po(),l=E.useMemo(()=>Cn(s.sidebar.defaultStyles,{variants:s.sidebar.variantStyles,defaultVariants:s.sidebar.defaultVariants}),[s]);return g.jsx("div",{ref:a,className:Y(l({variant:t,size:n,collapsed:r}),o&&"fixed inset-y-0 left-0",e),...i})});wA.displayName="Sidebar";const vA=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Y("flex items-center justify-center py-4",e),...t}));vA.displayName="SidebarHeader";const yA=E.forwardRef(({className:e,...t},n)=>g.jsx("nav",{ref:n,className:Y("flex-1 space-y-1",e),...t}));yA.displayName="SidebarNav";const bA=E.forwardRef(({className:e,children:t,icon:n,badge:r,variant:o,active:i,...a},s)=>{const{variants:l}=Po(),c=E.useMemo(()=>Cn(l.sidebarItem.defaultStyles,{variants:l.sidebarItem.variantStyles,defaultVariants:l.sidebarItem.defaultVariants}),[l]);return g.jsxs("div",{ref:s,className:Y(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})]})});bA.displayName="SidebarItem";const xA=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Y("space-y-3 py-2",e),role:"group",...t}));xA.displayName="SidebarGroup";const _A=E.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:Y("mt-auto",e),...t}));_A.displayName="SidebarFooter";function cte({className:e,...t}){return g.jsx("div",{className:Y("animate-pulse rounded-md bg-muted",e),...t})}const SA=E.forwardRef(({className:e,...t},n)=>g.jsxs(mN,{ref:n,className:Y("relative flex w-full touch-none select-none items-center",e),...t,children:[g.jsx(x9,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:g.jsx(_9,{className:"absolute h-full bg-primary"})}),g.jsx(S9,{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"})]}));SA.displayName=mN.displayName;var ute=(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{}},dte=y.createContext(void 0),fte={setTheme:e=>{},themes:[]},hte=()=>{var e;return(e=y.useContext(dte))!=null?e:fte};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:`(${ute.toString()})(${u})`}})});function pte(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 mte=e=>{switch(e){case"success":return vte;case"info":return bte;case"warning":return yte;case"error":return xte;default:return null}},gte=Array(12).fill(0),wte=({visible:e,className:t})=>E.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},E.createElement("div",{className:"sonner-spinner"},gte.map((n,r)=>E.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),vte=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"})),yte=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"})),bte=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"})),xte=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"})),_te=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"})),Ste=()=>{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 Rv=1;class Cte{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:Rv++,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(Pte(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)||Rv++;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 hn=new Cte,Ete=(e,t)=>{const n=(t==null?void 0:t.id)||Rv++;return hn.addToast({title:e,...t,id:n}),n},Pte=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Rte=Ete,Nte=()=>hn.toasts,Tte=()=>hn.getActiveToasts();Object.assign(Rte,{success:hn.success,info:hn.info,warning:hn.warning,error:hn.error,custom:hn.custom,message:hn.message,promise:hn.promise,dismiss:hn.dismiss,loading:hn.loading},{getHistory:Nte,getToasts:Tte}),pte("[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 Jd(e){return e.label!==void 0}const Mte=3,Dte="24px",kte="16px",CA=4e3,Ote=356,Ate=14,Ite=45,jte=200;function Nr(...e){return e.filter(Boolean).join(" ")}function $te(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Fte=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:S,defaultRichColors:C,closeButton:N,style:R,cancelButtonStyle:T,actionButtonStyle:M,className:k="",descriptionClassName:O="",duration:F,position:L,gap:K,expandByDefault:ne,classNames:q,icons:X,closeButtonAriaLabel:B="Close toast"}=e,[ee,Z]=E.useState(null),[J,H]=E.useState(null),[I,V]=E.useState(!1),[ae,j]=E.useState(!1),[G,$]=E.useState(!1),[te,ie]=E.useState(!1),[re,z]=E.useState(!1),[se,oe]=E.useState(0),[fe,ge]=E.useState(0),pe=E.useRef(d.duration||F||CA),me=E.useRef(null),_e=E.useRef(null),Re=w===0,nt=w+1<=m,Ae=d.type,Me=d.dismissible!==!1,Ce=d.className||"",Fe=d.descriptionClassName||"",pn=E.useMemo(()=>v.findIndex(we=>we.toastId===d.id)||0,[v,d.id]),D=E.useMemo(()=>{var we;return(we=d.closeButton)!=null?we:N},[d.closeButton,N]),_=E.useMemo(()=>d.duration||F||CA,[d.duration,F]),P=E.useRef(0),A=E.useRef(0),U=E.useRef(0),Q=E.useRef(null),[ce,ke]=L.split("-"),rt=E.useMemo(()=>v.reduce((we,Ve,We)=>We>=pn?we:we+Ve.height,0),[v,pn]),Je=Ste(),it=d.invert||u,Ue=Ae==="loading";A.current=E.useMemo(()=>pn*K+rt,[pn,rt]),E.useEffect(()=>{pe.current=_},[_]),E.useEffect(()=>{V(!0)},[]),E.useEffect(()=>{const we=_e.current;if(we){const Ve=we.getBoundingClientRect().height;return ge(Ve),p(We=>[{toastId:d.id,height:Ve,position:d.position},...We]),()=>p(We=>We.filter(pt=>pt.toastId!==d.id))}},[p,d.id]),E.useLayoutEffect(()=>{if(!I)return;const we=_e.current,Ve=we.style.height;we.style.height="auto";const We=we.getBoundingClientRect().height;we.style.height=Ve,ge(We),p(pt=>pt.find(ct=>ct.toastId===d.id)?pt.map(ct=>ct.toastId===d.id?{...ct,height:We}:ct):[{toastId:d.id,height:We,position:d.position},...pt])},[I,d.title,d.description,p,d.id]);const xe=E.useCallback(()=>{j(!0),oe(A.current),p(we=>we.filter(Ve=>Ve.toastId!==d.id)),setTimeout(()=>{S(d)},jte)},[d,S,p,A]);E.useEffect(()=>{if(d.promise&&Ae==="loading"||d.duration===1/0||d.type==="loading")return;let we;return x||h||Je?(()=>{if(U.current<P.current){const pt=new Date().getTime()-P.current;pe.current=pe.current-pt}U.current=new Date().getTime()})():(()=>{pe.current!==1/0&&(P.current=new Date().getTime(),we=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),xe()},pe.current))})(),()=>clearTimeout(we)},[x,h,d,Ae,Je,xe]),E.useEffect(()=>{d.delete&&xe()},[xe,d.delete]);function Ye(){var we;if(X!=null&&X.loading){var Ve;return E.createElement("div",{className:Nr(q==null?void 0:q.loader,d==null||(Ve=d.classNames)==null?void 0:Ve.loader,"sonner-loader"),"data-visible":Ae==="loading"},X.loading)}return E.createElement(wte,{className:Nr(q==null?void 0:q.loader,d==null||(we=d.classNames)==null?void 0:we.loader),visible:Ae==="loading"})}var Xe,Le;return E.createElement("li",{tabIndex:0,ref:_e,className:Nr(k,Ce,q==null?void 0:q.toast,d==null||(t=d.classNames)==null?void 0:t.toast,q==null?void 0:q.default,q==null?void 0:q[Ae],d==null||(n=d.classNames)==null?void 0:n[Ae]),"data-sonner-toast":"","data-rich-colors":(Xe=d.richColors)!=null?Xe:C,"data-styled":!(d.jsx||d.unstyled||f),"data-mounted":I,"data-promise":!!d.promise,"data-swiped":re,"data-removed":ae,"data-visible":nt,"data-y-position":ce,"data-x-position":ke,"data-index":w,"data-front":Re,"data-swiping":G,"data-dismissible":Me,"data-type":Ae,"data-invert":it,"data-swipe-out":te,"data-swipe-direction":J,"data-expanded":!!(x||ne&&I),style:{"--index":w,"--toasts-before":w,"--z-index":b.length-w,"--offset":`${ae?se:A.current}px`,"--initial-height":ne?"auto":`${fe}px`,...R,...d.style},onDragEnd:()=>{$(!1),Z(null),Q.current=null},onPointerDown:we=>{Ue||!Me||(me.current=new Date,oe(A.current),we.target.setPointerCapture(we.pointerId),we.target.tagName!=="BUTTON"&&($(!0),Q.current={x:we.clientX,y:we.clientY}))},onPointerUp:()=>{var we,Ve,We;if(te||!Me)return;Q.current=null;const pt=Number(((we=_e.current)==null?void 0:we.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ut=Number(((Ve=_e.current)==null?void 0:Ve.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ct=new Date().getTime()-((We=me.current)==null?void 0:We.getTime()),St=ee==="x"?pt:Ut,Jt=Math.abs(St)/ct;if(Math.abs(St)>=Ite||Jt>.11){oe(A.current),d.onDismiss==null||d.onDismiss.call(d,d),H(ee==="x"?pt>0?"right":"left":Ut>0?"down":"up"),xe(),ie(!0);return}else{var Vt,mn;(Vt=_e.current)==null||Vt.style.setProperty("--swipe-amount-x","0px"),(mn=_e.current)==null||mn.style.setProperty("--swipe-amount-y","0px")}z(!1),$(!1),Z(null)},onPointerMove:we=>{var Ve,We,pt;if(!Q.current||!Me||((Ve=window.getSelection())==null?void 0:Ve.toString().length)>0)return;const ct=we.clientY-Q.current.y,St=we.clientX-Q.current.x;var Jt;const Vt=(Jt=e.swipeDirections)!=null?Jt:$te(L);!ee&&(Math.abs(St)>1||Math.abs(ct)>1)&&Z(Math.abs(St)>Math.abs(ct)?"x":"y");let mn={x:0,y:0};const $A=wi=>1/(1.5+Math.abs(wi)/20);if(ee==="y"){if(Vt.includes("top")||Vt.includes("bottom"))if(Vt.includes("top")&&ct<0||Vt.includes("bottom")&&ct>0)mn.y=ct;else{const wi=ct*$A(ct);mn.y=Math.abs(wi)<Math.abs(ct)?wi:ct}}else if(ee==="x"&&(Vt.includes("left")||Vt.includes("right")))if(Vt.includes("left")&&St<0||Vt.includes("right")&&St>0)mn.x=St;else{const wi=St*$A(St);mn.x=Math.abs(wi)<Math.abs(St)?wi:St}(Math.abs(mn.x)>0||Math.abs(mn.y)>0)&&z(!0),(We=_e.current)==null||We.style.setProperty("--swipe-amount-x",`${mn.x}px`),(pt=_e.current)==null||pt.style.setProperty("--swipe-amount-y",`${mn.y}px`)}},D&&!d.jsx&&Ae!=="loading"?E.createElement("button",{"aria-label":B,"data-disabled":Ue,"data-close-button":!0,onClick:Ue||!Me?()=>{}:()=>{xe(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Nr(q==null?void 0:q.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Le=X==null?void 0:X.close)!=null?Le:_te):null,Ae||d.icon||d.promise?E.createElement("div",{"data-icon":"",className:Nr(q==null?void 0:q.icon,d==null||(o=d.classNames)==null?void 0:o.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Ye():null,d.type!=="loading"?d.icon||(X==null?void 0:X[Ae])||mte(Ae):null):null,E.createElement("div",{"data-content":"",className:Nr(q==null?void 0:q.content,d==null||(i=d.classNames)==null?void 0:i.content)},E.createElement("div",{"data-title":"",className:Nr(q==null?void 0:q.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:Nr(O,Fe,q==null?void 0:q.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&&Jd(d.cancel)?E.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||T,onClick:we=>{Jd(d.cancel)&&Me&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,we),xe())},className:Nr(q==null?void 0:q.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,E.isValidElement(d.action)?d.action:d.action&&Jd(d.action)?E.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:we=>{Jd(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,we),!we.defaultPrevented&&xe())},className:Nr(q==null?void 0:q.actionButton,d==null||(c=d.classNames)==null?void 0:c.actionButton)},d.action.label):null)};function EA(){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 Lte(e,t){const n={};return[e,t].forEach((r,o)=>{const i=o===1,a=i?"--mobile-offset":"--offset",s=i?kte:Dte;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 zte=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=Mte,toastOptions:v,dir:w=EA(),gap:b=Ate,icons:x,containerAriaLabel:S="Notifications"}=t,[C,N]=E.useState([]),R=E.useMemo(()=>Array.from(new Set([o].concat(C.filter(J=>J.position).map(J=>J.position)))),[C,o]),[T,M]=E.useState([]),[k,O]=E.useState(!1),[F,L]=E.useState(!1),[K,ne]=E.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=E.useRef(null),X=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=E.useRef(null),ee=E.useRef(!1),Z=E.useCallback(J=>{N(H=>{var I;return(I=H.find(V=>V.id===J.id))!=null&&I.delete||hn.dismiss(J.id),H.filter(({id:V})=>V!==J.id)})},[]);return E.useEffect(()=>hn.subscribe(J=>{if(J.dismiss){const H=C.map(I=>I.id===J.id?{...I,delete:!0}:I);requestAnimationFrame(()=>{N(H)});return}setTimeout(()=>{tr.flushSync(()=>{N(H=>{const I=H.findIndex(V=>V.id===J.id);return I!==-1?[...H.slice(0,I),{...H[I],...J},...H.slice(I+1)]:[J,...H]})})})}),[C]),E.useEffect(()=>{if(d!=="system"){ne(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ne("dark"):ne("light")),typeof window>"u")return;const J=window.matchMedia("(prefers-color-scheme: dark)");try{J.addEventListener("change",({matches:H})=>{ne(H?"dark":"light")})}catch{J.addListener(({matches:I})=>{try{ne(I?"dark":"light")}catch(V){console.error(V)}})}},[d]),E.useEffect(()=>{C.length<=1&&O(!1)},[C]),E.useEffect(()=>{const J=H=>{var I;if(i.every(j=>H[j]||H.code===j)){var ae;O(!0),(ae=q.current)==null||ae.focus()}H.code==="Escape"&&(document.activeElement===q.current||(I=q.current)!=null&&I.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[i]),E.useEffect(()=>{if(q.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,ee.current=!1)}},[q.current]),E.createElement("section",{ref:n,"aria-label":`${S} ${X}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((J,H)=>{var I;const[V,ae]=J.split("-");return C.length?E.createElement("ol",{key:J,dir:w==="auto"?EA():w,tabIndex:-1,ref:q,className:l,"data-sonner-toaster":!0,"data-sonner-theme":K,"data-y-position":V,"data-lifted":k&&C.length>1&&!a,"data-x-position":ae,style:{"--front-toast-height":`${((I=T[0])==null?void 0:I.height)||0}px`,"--width":`${Ote}px`,"--gap":`${b}px`,...p,...Lte(c,u)},onBlur:j=>{ee.current&&!j.currentTarget.contains(j.relatedTarget)&&(ee.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:j=>{j.target instanceof HTMLElement&&j.target.dataset.dismissible==="false"||ee.current||(ee.current=!0,B.current=j.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{F||O(!1)},onDragEnd:()=>O(!1),onPointerDown:j=>{j.target instanceof HTMLElement&&j.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},C.filter(j=>!j.position&&H===0||j.position===J).map((j,G)=>{var $,te;return E.createElement(Fte,{key:j.id,icons:x,index:G,toast:j,defaultRichColors:f,duration:($=v==null?void 0:v.duration)!=null?$:h,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:r,visibleToasts:m,closeButton:(te=v==null?void 0:v.closeButton)!=null?te:s,interacting:F,position:J,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:Z,toasts:C.filter(ie=>ie.position==j.position),heights:T.filter(ie=>ie.position==j.position),setHeights:M,expandByDefault:a,gap:b,expanded:k,swipeDirections:t.swipeDirections})})):null}))}),Bte=({...e})=>{const{theme:t="system"}=hte();return g.jsx(zte,{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-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},PA=E.forwardRef(({className:e,...t},n)=>g.jsx(bN,{className:Y("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(N9,{className:Y("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")})}));PA.displayName=bN.displayName;const Hte=D9,RA=y.forwardRef(({className:e,...t},n)=>g.jsx(DN,{ref:n,className:Y("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));RA.displayName=DN.displayName;const NA=y.forwardRef(({className:e,...t},n)=>g.jsx(kN,{ref:n,className:Y("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}));NA.displayName=kN.displayName;const TA=y.forwardRef(({className:e,...t},n)=>g.jsx(ON,{ref:n,className:Y("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));TA.displayName=ON.displayName;const MA=E.forwardRef(({className:e,...t},n)=>g.jsx("textarea",{className:Y("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-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}));MA.displayName="Textarea";const DA=Cn("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-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"}}),kA=E.forwardRef(({className:e,variant:t,size:n,...r},o)=>{const{variants:i}=Po(),a=E.useMemo(()=>Cn(i.toggle.defaultStyles,{variants:i.toggle.variantStyles,defaultVariants:i.toggle.defaultVariants}),[i]);return g.jsx(AN,{ref:o,className:Y(a({variant:t,size:n,className:e})),...r})});kA.displayName=AN.displayName;const OA=E.createContext({size:"default",variant:"default"}),AA=E.forwardRef(({className:e,variant:t,size:n,children:r,...o},i)=>g.jsx(HN,{ref:i,className:Y("flex items-center justify-center gap-1",e),...o,children:g.jsx(OA.Provider,{value:{variant:t,size:n},children:r})}));AA.displayName=HN.displayName;const IA=E.forwardRef(({className:e,children:t,variant:n,size:r,...o},i)=>{const a=E.useContext(OA);return g.jsx(UN,{ref:i,className:Y(DA({variant:a.variant||n,size:a.size||r}),e),...o,children:t})});IA.displayName=UN.displayName;const Ute=J9,Vte=Q9,Wte=eq,jA=E.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(ZN,{ref:r,sideOffset:t,className:Y("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}));jA.displayName=ZN.displayName;const Gte=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Xq,AccordionContent:pT,AccordionItem:fT,AccordionTrigger:hT,Alert:vT,AlertDescription:bT,AlertDialog:nY,AlertDialogAction:RT,AlertDialogCancel:NT,AlertDialogContent:_T,AlertDialogDescription:PT,AlertDialogFooter:CT,AlertDialogHeader:ST,AlertDialogTitle:ET,AlertDialogTrigger:rY,AlertTitle:yT,AspectRatio:iY,Avatar:TT,AvatarFallback:DT,AvatarImage:MT,Badge:sY,Breadcrumb:kT,BreadcrumbItem:AT,BreadcrumbLink:IT,BreadcrumbList:OT,BreadcrumbPage:jT,BreadcrumbSeparator:$T,Button:Yn,Calendar:Pd,Card:fM,CardContent:gM,CardDescription:mM,CardFooter:wM,CardHeader:hM,CardTitle:pM,Carousel:EM,CarouselContent:PM,CarouselItem:RM,CarouselNext:TM,CarouselPrevious:NM,Checkbox:MM,Collapsible:RX,CollapsibleContent:DM,CollapsibleTrigger:NX,Combobox:rJ,Command:Ad,CommandDialog:nJ,CommandEmpty:kw,CommandGroup:Ow,CommandInput:Dw,CommandItem:Aw,CommandList:xD,CommandSeparator:_D,CommandShortcut:SD,ContextMenu:oJ,ContextMenuCheckboxItem:ND,ContextMenuContent:PD,ContextMenuGroup:aJ,ContextMenuItem:RD,ContextMenuLabel:MD,ContextMenuPortal:sJ,ContextMenuRadioGroup:cJ,ContextMenuRadioItem:TD,ContextMenuSeparator:DD,ContextMenuShortcut:kD,ContextMenuSub:lJ,ContextMenuSubContent:ED,ContextMenuSubTrigger:CD,ContextMenuTrigger:iJ,DataTable:cQ,DatePicker:uQ,DateRangePicker:dQ,Dialog:mD,DialogClose:tJ,DialogContent:Mw,DialogDescription:bD,DialogFooter:vD,DialogHeader:wD,DialogOverlay:Tw,DialogPortal:gD,DialogTitle:yD,DialogTrigger:eJ,Drawer:hk,DrawerClose:zQ,DrawerContent:mk,DrawerDescription:yk,DrawerFooter:wk,DrawerHeader:gk,DrawerOverlay:dv,DrawerPortal:pk,DrawerTitle:vk,DrawerTrigger:LQ,DropdownMenu:BQ,DropdownMenuCheckboxItem:Ck,DropdownMenuContent:_k,DropdownMenuGroup:UQ,DropdownMenuItem:Sk,DropdownMenuLabel:Pk,DropdownMenuPortal:VQ,DropdownMenuRadioGroup:GQ,DropdownMenuRadioItem:Ek,DropdownMenuSeparator:Rk,DropdownMenuShortcut:Nk,DropdownMenuSub:WQ,DropdownMenuSubContent:xk,DropdownMenuSubTrigger:bk,DropdownMenuTrigger:HQ,Form:gee,FormControl:Uk,FormDescription:Vk,FormField:wee,FormItem:Bk,FormLabel:Hk,FormMessage:Wk,HoverCard:vee,HoverCardContent:Gk,HoverCardTrigger:yee,Input:qk,Label:pv,Menubar:Yk,MenubarCheckboxItem:eO,MenubarContent:Jk,MenubarGroup:xee,MenubarItem:Qk,MenubarLabel:nO,MenubarMenu:bee,MenubarPortal:_ee,MenubarRadioGroup:Cee,MenubarRadioItem:tO,MenubarSeparator:rO,MenubarShortcut:oO,MenubarSub:See,MenubarSubContent:Zk,MenubarSubTrigger:Xk,MenubarTrigger:Kk,NavigationMenu:iO,NavigationMenuContent:cO,NavigationMenuIndicator:uO,NavigationMenuItem:Eee,NavigationMenuLink:Pee,NavigationMenuList:aO,NavigationMenuTrigger:lO,NavigationMenuViewport:mv,Pagination:dO,PaginationContent:fO,PaginationEllipsis:vO,PaginationFirst:gO,PaginationItem:hO,PaginationLast:wO,PaginationLink:Ha,PaginationNext:mO,PaginationPrevious:pO,Popover:Id,PopoverContent:zl,PopoverTrigger:jd,Progress:yO,RadioGroup:bO,RadioGroupItem:xO,ResizableHandle:nA,ResizablePanel:tA,ResizablePanelGroup:eA,ScrollArea:rA,ScrollBar:Sv,Select:rte,SelectContent:iA,SelectGroup:ote,SelectItem:sA,SelectLabel:aA,SelectScrollDownButton:Ev,SelectScrollUpButton:Cv,SelectSeparator:lA,SelectTrigger:oA,SelectValue:ite,Separator:cA,Sheet:ate,SheetClose:uA,SheetContent:fA,SheetDescription:gA,SheetFooter:pA,SheetHeader:hA,SheetOverlay:Pv,SheetPortal:dA,SheetTitle:mA,SheetTrigger:ste,Sidebar:wA,SidebarFooter:_A,SidebarGroup:xA,SidebarHeader:vA,SidebarItem:bA,SidebarNav:yA,Skeleton:cte,Slider:SA,Switch:PA,Table:ev,TableBody:nv,TableCaption:KD,TableCell:Ul,TableFooter:YD,TableHead:rv,TableHeader:tv,TableRow:La,Tabs:Hte,TabsContent:TA,TabsList:RA,TabsTrigger:NA,Textarea:MA,Toaster:Bte,Toggle:kA,ToggleGroup:AA,ToggleGroupItem:IA,Tooltip:Vte,TooltipContent:jA,TooltipProvider:Ute,TooltipTrigger:Wte,Variants:Zq,badgeVariants:aY,buttonVariants:lY,navigationMenuTriggerStyle:sO,toggleVariants:DA,useFormField:Gl},Symbol.toStringTag,{value:"Module"})),qte=()=>{typeof window<"u"&&(window.Buffer=rf.Buffer,window.fs=new kI("fs"),window.pfs=window.fs.promises,window.miDir="/mi")};ze.APIHandler=Rh,ze.APIProxyHandler=Nh,ze.DreamspaceElements=Gte,ze.MiniApp=n3,ze.ProjectProvider=h4,ze.RGComponent=r3,ze.RGComponentErrorBoundary=o3,ze.RGDroppable=i3,ze.RGEditLayout=c3,ze.RGPreviewLayout=S_,ze.TailwindThemeContext=Qq,ze.TailwindThemeHooks=tY,ze.getHeadCommit=Yz,ze.getRedoTargetCommitForFile=Xz,ze.getTags=fh,ze.getUndoTargetCommitForFile=Kz,ze.initializeMakeInfinite=qte,ze.listDir=$b,ze.loadLibraryComponents=m4,ze.loadProjectComponents=bx,ze.setTailwindTheme=w4,ze.syncAndRetry=zb,ze.useAPI=gx,ze.useAppMetadata=y4,ze.useAppSettings=b4,ze.useAppVersions=x4,ze.useB64UrlForProjectImage=v4,ze.useProject=Dh,Object.defineProperty(ze,Symbol.toStringTag,{value:"Module"})});
|