@meridianjs/admin-dashboard 0.1.22 → 0.1.24

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.
@@ -1,4 +1,4 @@
1
- import{s as Qs}from"./vendor-radix-CvpS4Cp5.js";import{r as Q,c as mt,b as ru}from"./vendor-react-GAVzOgi0.js";import{j as Ee}from"./vendor-query-B9zjiv_I.js";function G(n){this.content=n}G.prototype={constructor:G,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new G(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new G(t)},addToStart:function(n,e){return new G([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new G(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new G(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=G.from(n),n.size?new G(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=G.from(n),n.size?new G(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=G.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};G.from=function(n){if(n instanceof G)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new G(e)};function gl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=gl(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function yl(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=yl(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new k(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new k(r,s)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new k(s,i)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return gl(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return yl(this,e,t,r)}findIndex(e){if(e==0)return En(0,e);if(e==this.size)return En(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?En(t+1,i):En(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const Jr={index:0,offset:0};function En(n,e){return Jr.index=n,Jr.offset=e,Jr}function _n(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!_n(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!_n(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let L=class Cs{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&_n(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Cs.none;if(e instanceof Cs)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};L.none=[];class Wn extends Error{}class C{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=kl(this.content,e+this.openStart,t);return r&&new C(r,this.openStart,this.openEnd)}removeBetween(e,t){return new C(bl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return C.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new C(k.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new C(e,r,s)}}C.empty=new C(k.empty,0,0);function bl(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(bl(i.content,e-s-1,t-s-1)))}function kl(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=kl(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function su(n,e,t){if(t.openStart>n.depth)throw new Wn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Wn("Inconsistent open depths");return xl(n,e,t,0)}function xl(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=xl(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return dt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=iu(t,n);return dt(i,Cl(n,o,l,e,r))}else return dt(i,qn(n,e,r))}function Sl(n,e){if(!e.type.compatibleContent(n.type))throw new Wn("Cannot join "+e.type.name+" onto "+n.type.name)}function ws(n,e,t){let r=n.node(t);return Sl(r,e.node(t)),r}function ut(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Zt(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(ut(n.nodeAfter,r),i++));for(let l=i;l<o;l++)ut(s.child(l),r);e&&e.depth==t&&e.textOffset&&ut(e.nodeBefore,r)}function dt(n,e){return n.type.checkContent(e),n.copy(e)}function Cl(n,e,t,r,s){let i=n.depth>s&&ws(n,e,s+1),o=r.depth>s&&ws(t,r,s+1),l=[];return Zt(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Sl(i,o),ut(dt(i,Cl(n,e,t,r,s+1)),l)):(i&&ut(dt(i,qn(n,e,s+1)),l),Zt(e,t,s,l),o&&ut(dt(o,qn(t,r,s+1)),l)),Zt(r,null,s,l),new k(l)}function qn(n,e,t){let r=[];if(Zt(null,n,t,r),n.depth>t){let s=ws(n,e,t+1);ut(dt(s,qn(n,e,t+1)),r)}return Zt(e,null,t,r),new k(r)}function iu(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(k.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class dn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return L.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Un(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new dn(t,r,i)}static resolveCached(e,t){let r=Fi.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else Fi.set(e,r=new ou);let s=r.elts[r.i]=dn.resolve(e,t);return r.i=(r.i+1)%lu,s}}class ou{constructor(){this.elts=[],this.i=0}}const lu=12,Fi=new WeakMap;class Un{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const au=Object.create(null);class Ce{constructor(e,t,r,s=L.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&_n(this.attrs,t||e.defaultAttrs||au)&&L.sameSet(this.marks,r||L.none)}copy(e=null){return e==this.content?this:new Ce(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ce(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return C.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new C(c,s.depth-o,i.depth-o)}replace(e,t,r){return su(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return dn.resolveCached(this,e)}resolveNoCache(e){return dn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),wl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=L.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!L.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=k.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Ce.prototype.text=void 0;class Kn extends Ce{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):wl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Kn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Kn(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function wl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class gt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new cu(e,t);if(r.next==null)return gt.empty;let s=Ml(r);r.next&&r.err("Unexpected trailing text");let i=gu(mu(s));return yu(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
1
+ import{s as Qs}from"./vendor-radix-C0hGJ1gZ.js";import{r as Q,c as mt,b as ru}from"./vendor-react-GAVzOgi0.js";import{j as Ee}from"./vendor-query-B9zjiv_I.js";function G(n){this.content=n}G.prototype={constructor:G,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new G(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new G(t)},addToStart:function(n,e){return new G([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new G(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new G(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=G.from(n),n.size?new G(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=G.from(n),n.size?new G(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=G.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};G.from=function(n){if(n instanceof G)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new G(e)};function gl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=gl(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function yl(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=yl(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new k(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new k(r,s)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new k(s,i)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return gl(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return yl(this,e,t,r)}findIndex(e){if(e==0)return En(0,e);if(e==this.size)return En(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?En(t+1,i):En(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const Jr={index:0,offset:0};function En(n,e){return Jr.index=n,Jr.offset=e,Jr}function _n(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!_n(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!_n(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let L=class Cs{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&_n(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Cs.none;if(e instanceof Cs)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};L.none=[];class Wn extends Error{}class C{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=kl(this.content,e+this.openStart,t);return r&&new C(r,this.openStart,this.openEnd)}removeBetween(e,t){return new C(bl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return C.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new C(k.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new C(e,r,s)}}C.empty=new C(k.empty,0,0);function bl(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(bl(i.content,e-s-1,t-s-1)))}function kl(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=kl(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function su(n,e,t){if(t.openStart>n.depth)throw new Wn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Wn("Inconsistent open depths");return xl(n,e,t,0)}function xl(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=xl(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return dt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=iu(t,n);return dt(i,Cl(n,o,l,e,r))}else return dt(i,qn(n,e,r))}function Sl(n,e){if(!e.type.compatibleContent(n.type))throw new Wn("Cannot join "+e.type.name+" onto "+n.type.name)}function ws(n,e,t){let r=n.node(t);return Sl(r,e.node(t)),r}function ut(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Zt(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(ut(n.nodeAfter,r),i++));for(let l=i;l<o;l++)ut(s.child(l),r);e&&e.depth==t&&e.textOffset&&ut(e.nodeBefore,r)}function dt(n,e){return n.type.checkContent(e),n.copy(e)}function Cl(n,e,t,r,s){let i=n.depth>s&&ws(n,e,s+1),o=r.depth>s&&ws(t,r,s+1),l=[];return Zt(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Sl(i,o),ut(dt(i,Cl(n,e,t,r,s+1)),l)):(i&&ut(dt(i,qn(n,e,s+1)),l),Zt(e,t,s,l),o&&ut(dt(o,qn(t,r,s+1)),l)),Zt(r,null,s,l),new k(l)}function qn(n,e,t){let r=[];if(Zt(null,n,t,r),n.depth>t){let s=ws(n,e,t+1);ut(dt(s,qn(n,e,t+1)),r)}return Zt(e,null,t,r),new k(r)}function iu(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(k.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class dn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return L.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Un(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new dn(t,r,i)}static resolveCached(e,t){let r=Fi.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else Fi.set(e,r=new ou);let s=r.elts[r.i]=dn.resolve(e,t);return r.i=(r.i+1)%lu,s}}class ou{constructor(){this.elts=[],this.i=0}}const lu=12,Fi=new WeakMap;class Un{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const au=Object.create(null);class Ce{constructor(e,t,r,s=L.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&_n(this.attrs,t||e.defaultAttrs||au)&&L.sameSet(this.marks,r||L.none)}copy(e=null){return e==this.content?this:new Ce(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ce(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return C.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new C(c,s.depth-o,i.depth-o)}replace(e,t,r){return su(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return dn.resolveCached(this,e)}resolveNoCache(e){return dn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),wl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=L.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!L.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=k.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Ce.prototype.text=void 0;class Kn extends Ce{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):wl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Kn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Kn(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function wl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class gt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new cu(e,t);if(r.next==null)return gt.empty;let s=Ml(r);r.next&&r.err("Unexpected trailing text");let i=gu(mu(s));return yu(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
2
2
  `)}}gt.empty=new gt(!0);class cu{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ml(n){let e=[];do e.push(uu(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function uu(n){let e=[];do e.push(du(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function du(n){let e=pu(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=fu(n,e);else break;return e}function Vi(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function fu(n,e){let t=Vi(n),r=t;return n.eat(",")&&(n.next!="}"?r=Vi(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function hu(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let i in t){let o=t[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function pu(n){if(n.eat("(")){let e=Ml(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=hu(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function mu(n){let e=[[]];return s(i(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=t();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=t();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Tl(n,e){return e-n}function Hi(n,e){let t=[];return r(e),t.sort(Tl);function r(s){let i=n[s];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&t.indexOf(a)==-1&&r(a)}}}function gu(n){let e=Object.create(null);return t(Hi(n,0));function t(r){let s=[];r.forEach(o=>{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);Hi(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new gt(r.indexOf(n.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(Tl);i.next.push({type:s[o][0],next:e[l.join(",")]||t(l)})}return i}}function yu(n,e){for(let t=0,r=[n];t<r.length;t++){let s=r[t],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function El(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function vl(n,e){let t=Object.create(null);for(let r in n){let s=e&&e[r];if(s===void 0){let i=n[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=s}return t}function Al(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in n){let i=n[s];i.validate&&i.validate(e[s])}}function Ol(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new ku(n,r,e[r]);return t}let ji=class Nl{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Ol(e,r.attrs),this.defaultAttrs=El(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==gt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:vl(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ce(this,this.computeAttrs(e),k.from(t),L.setFrom(r))}createChecked(e=null,t,r){return t=k.from(t),this.checkContent(t),new Ce(this,this.computeAttrs(e),t,L.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=k.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),i=s&&s.fillBefore(k.empty,!0);return i?new Ce(this,e,t.append(i),L.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Al(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:L.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,o)=>r[i]=new Nl(i,t,o));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function bu(n,e,t){let r=t.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class ku{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?bu(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Dr{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=Ol(e,s.attrs),this.excluded=null;let i=El(this.attrs);this.instance=i?new L(this,i):null}create(e=null){return!e&&this.instance?this.instance:new L(this,vl(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new Dr(i,s++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Al(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Il{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=G.from(e.nodes),t.marks=G.from(e.marks||{}),this.nodes=ji.compile(this.spec.nodes,this),this.marks=Dr.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=gt.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?_i(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:_i(this,o.split(" "))}this.nodeFromJSON=s=>Ce.fromJSON(this,s),this.markFromJSON=s=>L.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof ji){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new Kn(r,r.defaultAttrs,e,L.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function _i(n,e){let t=[];for(let r=0;r<e.length;r++){let s=e[r],i=n.marks[s],o=i;if(i)t.push(i);else for(let l in n.marks){let a=n.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function xu(n){return n.tag!=null}function Su(n){return n.style!=null}class Ge{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(xu(s))this.tags.push(s);else if(Su(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new qi(this,t,!1);return r.addAll(e,L.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new qi(this,t,!0);return r.addAll(e,L.none,t.from,t.to),C.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(Mu(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,t,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<i)break}t.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Ui(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Ui(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ge(e,Ge.schemaRules(e)))}}const Dl={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Cu={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Rl={ol:!0,ul:!0},fn=1,Ms=2,en=4;function Wi(n,e,t){return e!=null?(e?fn:0)|(e==="full"?Ms:0):n&&n.whitespace=="pre"?fn|Ms:t&~en}class vn{constructor(e,t,r,s,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=L.none,this.match=i||(o&en?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(k.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&fn)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let t=k.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Dl.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class qi{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,i,o=Wi(null,t.preserveWhitespace,0)|(r?en:0);s?i=new vn(s.type,s.attrs,L.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new vn(null,null,L.none,!0,null,o):i=new vn(e.schema.topNodeType,null,L.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,i=s.options&Ms?"full":this.localPreserveWS||(s.options&fn)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
3
3
  `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;Rl.hasOwnProperty(o)&&this.parser.normalizeLists&&wu(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Cu.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(Dl.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)t=this.enterInner(s[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let s=this.findPlace(e,t,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=L.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):Ki(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,t,r,s){let i=this.findPlace(e.create(t),r,!1);return i&&(i=this.enterInner(e,t,r,!0,s)),i}enterInner(e,t,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=Wi(e,i,o.options);o.options&en&&o.content.length==0&&(l|=en);let a=L.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):Ki(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new vn(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=fn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function wu(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Rl.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Mu(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Ui(n){let e={};for(let t in n)e[t]=n[t];return e}function Ki(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class St{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Gr(t).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,t);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:s}=$n(Gr(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&$n(Gr(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return $n(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new St(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Ji(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Ji(e.marks)}}function Ji(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Gr(n){return n.document||window.document}const Gi=new WeakMap;function Tu(n){let e=Gi.get(n);return e===void 0&&Gi.set(n,e=Eu(n)),e}function Eu(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)t(r[s]);else for(let s in r)t(r[s])}return t(n),e}function $n(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=Tu(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=$n(n,f,t,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const Pl=65535,Ll=Math.pow(2,16);function vu(n,e){return n+e*Ll}function Yi(n){return n&Pl}function Au(n){return(n-(n&Pl))/Ll}const Bl=1,zl=2,Fn=4,$l=8;class Ts{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&$l)>0}get deletedBefore(){return(this.delInfo&(Bl|Fn))>0}get deletedAfter(){return(this.delInfo&(zl|Fn))>0}get deletedAcross(){return(this.delInfo&Fn)>0}}class ue{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ue.empty)return ue.empty}recover(e){let t=0,r=Yi(e);if(!this.inverted)for(let s=0;s<r;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+t+Au(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+s+(f<0?0:u);if(r)return h;let p=e==(t<0?a:d)?null:vu(l/3,e-a),m=e==a?zl:e==d?Bl:Fn;return(t<0?e!=a:e!=d)&&(m|=$l),new Ts(h,m,p)}s+=u-c}return r?e+s:new Ts(e+s,0,null)}touches(e,t){let r=0,s=Yi(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+t],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new ue(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ue.empty:new ue(e<0?[0,-e,0]:[0,0,e])}}ue.empty=new ue([]);class hn{constructor(e,t,r=0,s=e?e.length:0){this.mirror=t,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new hn(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?r+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new hn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new Ts(e,s,null)}}const Yr=Object.create(null);class ne{getMap(){return ue.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Yr[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Yr)throw new RangeError("Duplicate use of step JSON ID "+e);return Yr[e]=t,t.prototype.jsonID=e,t}}class j{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new j(e,null)}static fail(e){return new j(null,e)}static fromReplace(e,t,r,s){try{return j.ok(e.replace(t,r,s))}catch(i){if(i instanceof Wn)return j.fail(i.message);throw i}}}function Zs(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let i=n.child(s);i.content.size&&(i=i.copy(Zs(i.content,e,i))),i.isInline&&(i=e(i,t,s)),r.push(i)}return k.fromArray(r)}class Ue extends ne{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new C(Zs(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return j.fromReplace(e,this.from,this.to,i)}invert(){return new Se(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ue(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ue&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ue(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ue(t.from,t.to,e.markFromJSON(t.mark))}}ne.jsonID("addMark",Ue);class Se extends ne{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new C(Zs(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return j.fromReplace(e,this.from,this.to,r)}invert(){return new Ue(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Se(t.pos,r.pos,this.mark)}merge(e){return e instanceof Se&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Se(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Se(t.from,t.to,e.markFromJSON(t.mark))}}ne.jsonID("removeMark",Se);class Ke extends ne{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return j.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return j.fromReplace(e,this.pos,this.pos+1,new C(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(r))return new Ke(this.pos,t.marks[s]);return new Ke(this.pos,this.mark)}}return new yt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ke(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ke(t.pos,e.markFromJSON(t.mark))}}ne.jsonID("addNodeMark",Ke);class yt extends ne{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return j.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return j.fromReplace(e,this.pos,this.pos+1,new C(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Ke(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new yt(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new yt(t.pos,e.markFromJSON(t.mark))}}ne.jsonID("removeNodeMark",yt);class U extends ne{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&Es(e,this.from,this.to)?j.fail("Structure replace would overwrite content"):j.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ue([this.from,this.to-this.from,this.slice.size])}invert(e){return new U(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new U(t.pos,Math.max(t.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof U)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?C.empty:new C(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new U(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?C.empty:new C(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new U(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new U(t.from,t.to,C.fromJSON(e,t.slice),!!t.structure)}}ne.jsonID("replace",U);class K extends ne{constructor(e,t,r,s,i,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Es(e,this.from,this.gapFrom)||Es(e,this.gapTo,this.to)))return j.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return j.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?j.fromReplace(e,this.from,this.to,r):j.fail("Content does not fit in gap")}getMap(){return new ue([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new K(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||s<t.pos||i>r.pos?null:new K(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new K(t.from,t.to,t.gapFrom,t.gapTo,C.fromJSON(e,t.slice),t.insert,!!t.structure)}}ne.jsonID("replaceAround",K);function Es(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function Ou(n,e,t,r){let s=[],i=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[m])?o.to=h:s.push(o=new Se(f,h,d[m])));l&&l.to==f?l.to=h:i.push(l=new Ue(f,h,r))}}),s.forEach(a=>n.step(a)),i.forEach(a=>n.step(a))}function Nu(n,e,t,r){let s=[],i=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof Dr){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<s.length;h++){let p=s[h];p.step==i-1&&d.eq(s[h].style)&&(f=p)}f?(f.to=c,f.step=i):s.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>n.step(new Se(o.from,o.to,o.style)))}function ei(n,e,t,r=t.contentMatch,s=!0){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new U(l,u,C.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new Se(l,u,c.marks[f]));if(s&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new C(k.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new U(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(k.empty,!0);n.replace(l,l,new C(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function Iu(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function jt(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,i=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-i;if(r<n.depth&&o.canReplace(l,a,t))return r;if(r==0||o.type.spec.isolating||!Iu(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function Du(n,e,t){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=k.empty,d=0;for(let p=i,m=!1;p>t;p--)m||r.index(p)>0?(m=!0,u=k.from(r.node(p).copy(u)),d++):a--;let f=k.empty,h=0;for(let p=i,m=!1;p>t;p--)m||s.after(p+1)<s.end(p)?(m=!0,f=k.from(s.node(p).copy(f)),h++):c++;n.step(new K(a,c,o,l,new C(u.append(f),d,h),u.size-d,!0))}function ti(n,e,t=null,r=n){let s=Ru(n,e),i=s&&Pu(r,e);return i?s.map(Xi).concat({type:e,attrs:t}).concat(i.map(Xi)):null}function Xi(n){return{type:n,attrs:null}}function Ru(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return t.canReplaceWith(r,s,o)?i:null}function Pu(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function Lu(n,e,t){let r=k.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=k.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new K(s,i,s,i,new C(r,0,0),t.length,!0))}function Bu(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&zu(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Vl(n,o,l,i),ei(n,n.mapping.slice(i).map(l,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new K(d,f,d+1,f-1,new C(k.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&Fl(n,o,l,i),!1}})}function Fl(n,e,t,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+i+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Vl(n,e,t,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+i);n.replaceWith(o,o+1,e.type.schema.text(`
@@ -50,4 +50,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
50
50
  *
51
51
  * This source code is licensed under the MIT license found in the
52
52
  * LICENSE file in the root directory of this source tree.
53
- */var Ge=s;function Op(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Np=typeof Object.is=="function"?Object.is:Op,Ip=Ge.useState,Mp=Ge.useEffect,Dp=Ge.useLayoutEffect,$p=Ge.useDebugValue;function jp(e,t){var n=t(),r=Ip({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return Dp(function(){o.value=n,o.getSnapshot=t,En(o)&&i({inst:o})},[e,n,t]),Mp(function(){return En(o)&&i({inst:o}),e(function(){En(o)&&i({inst:o})})},[e]),$p(n),n}function En(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Np(e,n)}catch{return!0}}function Lp(e,t){return t()}var Fp=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Lp:jp;Gi.useSyncExternalStore=Ge.useSyncExternalStore!==void 0?Ge.useSyncExternalStore:Fp;Ki.exports=Gi;var kp=Ki.exports;function Wp(){return kp.useSyncExternalStore(Vp,()=>!0,()=>!1)}function Vp(){return()=>{}}var cr="Avatar",[Bp]=Ap(cr),[Hp,zi]=Bp(cr),Yi=s.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=s.useState("idle");return m.jsx(Hp,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:m.jsx(dt.span,{...r,ref:t})})});Yi.displayName=cr;var Xi="AvatarImage",Zi=s.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,a=zi(Xi,n),c=Up(r,i),l=Z(u=>{o(u),a.onImageLoadingStatusChange(u)});return Y(()=>{c!=="idle"&&l(c)},[c,l]),c==="loaded"?m.jsx(dt.img,{...i,ref:t,src:r}):null});Zi.displayName=Xi;var qi="AvatarFallback",Qi=s.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=zi(qi,n),[a,c]=s.useState(r===void 0);return s.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>c(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&i.imageLoadingStatus!=="loaded"?m.jsx(dt.span,{...o,ref:t}):null});Qi.displayName=qi;function Wr(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Up(e,{referrerPolicy:t,crossOrigin:n}){const r=Wp(),o=s.useRef(null),i=r?(o.current||(o.current=new window.Image),o.current):null,[a,c]=s.useState(()=>Wr(i,e));return Y(()=>{c(Wr(i,e))},[i,e]),Y(()=>{const l=f=>()=>{c(f)};if(!i)return;const u=l("loaded"),d=l("error");return i.addEventListener("load",u),i.addEventListener("error",d),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",d)}},[i,n,t]),a}var Wv=Yi,Vv=Zi,Bv=Qi,Kp="Label",Ji=s.forwardRef((e,t)=>m.jsx(dt.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())}}));Ji.displayName=Kp;var Hv=Ji;function Dn(e,[t,n]){return Math.min(n,Math.max(t,e))}function Gp(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,zp(o,...t)]}function zp(...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((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function es(e){const t=Yp(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Zp);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Yp(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Qp(o),c=qp(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xp=Symbol("radix.slottable");function Zp(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xp}function qp(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Qp(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 Jp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oe=Jp.reduce((e,t)=>{const n=es(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function em(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var tm=[" ","Enter","ArrowUp","ArrowDown"],nm=[" ","Enter"],$e="Select",[an,ln,rm]=Jn($e),[Qe]=Gp($e,[rm,_e]),un=_e(),[om,Ae]=Qe($e),[im,sm]=Qe($e),ts=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:g}=e,v=un(t),[y,x]=s.useState(null),[w,S]=s.useState(null),[C,E]=s.useState(!1),R=rn(u),[b,A]=Me({prop:r,defaultProp:o??!1,onChange:i,caller:$e}),[T,O]=Me({prop:a,defaultProp:c,onChange:l,caller:$e}),D=s.useRef(null),L=y?g||!!y.closest("form"):!0,[F,j]=s.useState(new Set),U=Array.from(F).map(M=>M.props.value).join(";");return m.jsx(zt,{...v,children:m.jsxs(om,{required:h,scope:t,trigger:y,onTriggerChange:x,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:le(),value:T,onValueChange:O,open:b,onOpenChange:A,dir:R,triggerPointerDownPosRef:D,disabled:p,children:[m.jsx(an.Provider,{scope:t,children:m.jsx(im,{scope:e.__scopeSelect,onNativeOptionAdd:s.useCallback(M=>{j(k=>new Set(k).add(M))},[]),onNativeOptionRemove:s.useCallback(M=>{j(k=>{const N=new Set(k);return N.delete(M),N})},[]),children:n})}),L?m.jsxs(Ps,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:T,onChange:M=>O(M.target.value),disabled:p,form:g,children:[T===void 0?m.jsx("option",{value:""}):null,Array.from(F)]},U):null]})})};ts.displayName=$e;var ns="SelectTrigger",rs=s.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=un(n),a=Ae(ns,n),c=a.disabled||r,l=$(t,a.onTriggerChange),u=ln(n),d=s.useRef("touch"),[f,p,h]=_s(v=>{const y=u().filter(S=>!S.disabled),x=y.find(S=>S.value===a.value),w=As(y,v,x);w!==void 0&&a.onValueChange(w.value)}),g=v=>{c||(a.onOpenChange(!0),h()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return m.jsx(ut,{asChild:!0,...i,children:m.jsx(oe.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:c,"data-disabled":c?"":void 0,"data-placeholder":Rs(a.value)?"":void 0,...o,ref:l,onClick:P(o.onClick,v=>{v.currentTarget.focus(),d.current!=="mouse"&&g(v)}),onPointerDown:P(o.onPointerDown,v=>{d.current=v.pointerType;const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(g(v),v.preventDefault())}),onKeyDown:P(o.onKeyDown,v=>{const y=f.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&p(v.key),!(y&&v.key===" ")&&tm.includes(v.key)&&(g(),v.preventDefault())})})})});rs.displayName=ns;var os="SelectValue",is=s.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...c}=e,l=Ae(os,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,f=$(t,l.onValueNodeChange);return Y(()=>{u(d)},[u,d]),m.jsx(oe.span,{...c,ref:f,style:{pointerEvents:"none"},children:Rs(l.value)?m.jsx(m.Fragment,{children:a}):i})});is.displayName=os;var cm="SelectIcon",ss=s.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.jsx(oe.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});ss.displayName=cm;var am="SelectPortal",cs=e=>m.jsx(ft,{asChild:!0,...e});cs.displayName=am;var je="SelectContent",as=s.forwardRef((e,t)=>{const n=Ae(je,e.__scopeSelect),[r,o]=s.useState();if(Y(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?at.createPortal(m.jsx(ls,{scope:e.__scopeSelect,children:m.jsx(an.Slot,{scope:e.__scopeSelect,children:m.jsx("div",{children:e.children})})}),i):null}return m.jsx(us,{...e,ref:t})});as.displayName=je;var ae=10,[ls,Te]=Qe(je),lm="SelectContentImpl",um=es("SelectContent.RemoveScroll"),us=s.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:y,...x}=e,w=Ae(je,n),[S,C]=s.useState(null),[E,R]=s.useState(null),b=$(t,I=>C(I)),[A,T]=s.useState(null),[O,D]=s.useState(null),L=ln(n),[F,j]=s.useState(!1),U=s.useRef(!1);s.useEffect(()=>{if(S)return tn(S)},[S]),Jt();const M=s.useCallback(I=>{const[V,...G]=L().map(H=>H.ref.current),[W]=G.slice(-1),B=document.activeElement;for(const H of I)if(H===B||(H==null||H.scrollIntoView({block:"nearest"}),H===V&&E&&(E.scrollTop=0),H===W&&E&&(E.scrollTop=E.scrollHeight),H==null||H.focus(),document.activeElement!==B))return},[L,E]),k=s.useCallback(()=>M([A,S]),[M,A,S]);s.useEffect(()=>{F&&k()},[F,k]);const{onOpenChange:N,triggerPointerDownPosRef:_}=w;s.useEffect(()=>{if(S){let I={x:0,y:0};const V=W=>{var B,H;I={x:Math.abs(Math.round(W.pageX)-(((B=_.current)==null?void 0:B.x)??0)),y:Math.abs(Math.round(W.pageY)-(((H=_.current)==null?void 0:H.y)??0))}},G=W=>{I.x<=10&&I.y<=10?W.preventDefault():S.contains(W.target)||N(!1),document.removeEventListener("pointermove",V),_.current=null};return _.current!==null&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",G,{capture:!0})}}},[S,N,_]),s.useEffect(()=>{const I=()=>N(!1);return window.addEventListener("blur",I),window.addEventListener("resize",I),()=>{window.removeEventListener("blur",I),window.removeEventListener("resize",I)}},[N]);const[K,z]=_s(I=>{const V=L().filter(B=>!B.disabled),G=V.find(B=>B.ref.current===document.activeElement),W=As(V,I,G);W&&setTimeout(()=>W.ref.current.focus())}),J=s.useCallback((I,V,G)=>{const W=!U.current&&!G;(w.value!==void 0&&w.value===V||W)&&(T(I),W&&(U.current=!0))},[w.value]),we=s.useCallback(()=>S==null?void 0:S.focus(),[S]),ie=s.useCallback((I,V,G)=>{const W=!U.current&&!G;(w.value!==void 0&&w.value===V||W)&&D(I)},[w.value]),Se=r==="popper"?$n:fs,ee=Se===$n?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:y}:{};return m.jsx(ls,{scope:n,content:S,viewport:E,onViewportChange:R,itemRefCallback:J,selectedItem:A,onItemLeave:we,itemTextRefCallback:ie,focusSelectedItem:k,selectedItemText:O,position:r,isPositioned:F,searchRef:K,children:m.jsx(vt,{as:um,allowPinchZoom:!0,children:m.jsx(pt,{asChild:!0,trapped:w.open,onMountAutoFocus:I=>{I.preventDefault()},onUnmountAutoFocus:P(o,I=>{var V;(V=w.trigger)==null||V.focus({preventScroll:!0}),I.preventDefault()}),children:m.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:I=>I.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:m.jsx(Se,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:I=>I.preventDefault(),...x,...ee,onPlaced:()=>j(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:P(x.onKeyDown,I=>{const V=I.ctrlKey||I.altKey||I.metaKey;if(I.key==="Tab"&&I.preventDefault(),!V&&I.key.length===1&&z(I.key),["ArrowUp","ArrowDown","Home","End"].includes(I.key)){let W=L().filter(B=>!B.disabled).map(B=>B.ref.current);if(["ArrowUp","End"].includes(I.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(I.key)){const B=I.target,H=W.indexOf(B);W=W.slice(H+1)}setTimeout(()=>M(W)),I.preventDefault()}})})})})})})});us.displayName=lm;var fm="SelectItemAlignedPosition",fs=s.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Ae(je,n),a=Te(je,n),[c,l]=s.useState(null),[u,d]=s.useState(null),f=$(t,b=>d(b)),p=ln(n),h=s.useRef(!1),g=s.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:x,focusSelectedItem:w}=a,S=s.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&u&&v&&y&&x){const b=i.trigger.getBoundingClientRect(),A=u.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),O=x.getBoundingClientRect();if(i.dir!=="rtl"){const B=O.left-A.left,H=T.left-B,te=b.left-H,pe=b.width+te,Je=Math.max(pe,A.width),et=window.innerWidth-ae,tt=Dn(H,[ae,Math.max(ae,et-Je)]);c.style.minWidth=pe+"px",c.style.left=tt+"px"}else{const B=A.right-O.right,H=window.innerWidth-T.right-B,te=window.innerWidth-b.right-H,pe=b.width+te,Je=Math.max(pe,A.width),et=window.innerWidth-ae,tt=Dn(H,[ae,Math.max(ae,et-Je)]);c.style.minWidth=pe+"px",c.style.right=tt+"px"}const D=p(),L=window.innerHeight-ae*2,F=v.scrollHeight,j=window.getComputedStyle(u),U=parseInt(j.borderTopWidth,10),M=parseInt(j.paddingTop,10),k=parseInt(j.borderBottomWidth,10),N=parseInt(j.paddingBottom,10),_=U+M+F+N+k,K=Math.min(y.offsetHeight*5,_),z=window.getComputedStyle(v),J=parseInt(z.paddingTop,10),we=parseInt(z.paddingBottom,10),ie=b.top+b.height/2-ae,Se=L-ie,ee=y.offsetHeight/2,I=y.offsetTop+ee,V=U+M+I,G=_-V;if(V<=ie){const B=D.length>0&&y===D[D.length-1].ref.current;c.style.bottom="0px";const H=u.clientHeight-v.offsetTop-v.offsetHeight,te=Math.max(Se,ee+(B?we:0)+H+k),pe=V+te;c.style.height=pe+"px"}else{const B=D.length>0&&y===D[0].ref.current;c.style.top="0px";const te=Math.max(ie,U+v.offsetTop+(B?J:0)+ee)+G;c.style.height=te+"px",v.scrollTop=V-ie+v.offsetTop}c.style.margin=`${ae}px 0`,c.style.minHeight=K+"px",c.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,c,u,v,y,x,i.dir,r]);Y(()=>S(),[S]);const[C,E]=s.useState();Y(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const R=s.useCallback(b=>{b&&g.current===!0&&(S(),w==null||w(),g.current=!1)},[S,w]);return m.jsx(pm,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:R,children:m.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:m.jsx(oe.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});fs.displayName=fm;var dm="SelectPopperPosition",$n=s.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=ae,...i}=e,a=un(n);return m.jsx(Yt,{...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)"}})});$n.displayName=dm;var[pm,ar]=Qe(je,{}),jn="SelectViewport",ds=s.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Te(jn,n),a=ar(jn,n),c=$(t,i.onViewportChange),l=s.useRef(0);return m.jsxs(m.Fragment,{children:[m.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}),m.jsx(an.Slot,{scope:n,children:m.jsx(oe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:P(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=a;if(p!=null&&p.current&&f){const h=Math.abs(l.current-d.scrollTop);if(h>0){const g=window.innerHeight-ae*2,v=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),x=Math.max(v,y);if(x<g){const w=x+h,S=Math.min(g,w),C=w-S;f.style.height=S+"px",f.style.bottom==="0px"&&(d.scrollTop=C>0?C:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});ds.displayName=jn;var ps="SelectGroup",[mm,vm]=Qe(ps),hm=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=le();return m.jsx(mm,{scope:n,id:o,children:m.jsx(oe.div,{role:"group","aria-labelledby":o,...r,ref:t})})});hm.displayName=ps;var ms="SelectLabel",vs=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=vm(ms,n);return m.jsx(oe.div,{id:o.id,...r,ref:t})});vs.displayName=ms;var Wt="SelectItem",[gm,hs]=Qe(Wt),gs=s.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,c=Ae(Wt,n),l=Te(Wt,n),u=c.value===r,[d,f]=s.useState(i??""),[p,h]=s.useState(!1),g=$(t,w=>{var S;return(S=l.itemRefCallback)==null?void 0:S.call(l,w,r,o)}),v=le(),y=s.useRef("touch"),x=()=>{o||(c.onValueChange(r),c.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 m.jsx(gm,{scope:n,value:r,disabled:o,textId:v,isSelected:u,onItemTextChange:s.useCallback(w=>{f(S=>S||((w==null?void 0:w.textContent)??"").trim())},[]),children:m.jsx(an.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:m.jsx(oe.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:g,onFocus:P(a.onFocus,()=>h(!0)),onBlur:P(a.onBlur,()=>h(!1)),onClick:P(a.onClick,()=>{y.current!=="mouse"&&x()}),onPointerUp:P(a.onPointerUp,()=>{y.current==="mouse"&&x()}),onPointerDown:P(a.onPointerDown,w=>{y.current=w.pointerType}),onPointerMove:P(a.onPointerMove,w=>{var S;y.current=w.pointerType,o?(S=l.onItemLeave)==null||S.call(l):y.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(a.onPointerLeave,w=>{var S;w.currentTarget===document.activeElement&&((S=l.onItemLeave)==null||S.call(l))}),onKeyDown:P(a.onKeyDown,w=>{var C;((C=l.searchRef)==null?void 0:C.current)!==""&&w.key===" "||(nm.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})});gs.displayName=Wt;var rt="SelectItemText",ys=s.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=Ae(rt,n),c=Te(rt,n),l=hs(rt,n),u=sm(rt,n),[d,f]=s.useState(null),p=$(t,x=>f(x),l.onItemTextChange,x=>{var w;return(w=c.itemTextRefCallback)==null?void 0:w.call(c,x,l.value,l.disabled)}),h=d==null?void 0:d.textContent,g=s.useMemo(()=>m.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=u;return Y(()=>(v(g),()=>y(g)),[v,y,g]),m.jsxs(m.Fragment,{children:[m.jsx(oe.span,{id:l.textId,...i,ref:p}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?at.createPortal(i.children,a.valueNode):null]})});ys.displayName=rt;var xs="SelectItemIndicator",ws=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return hs(xs,n).isSelected?m.jsx(oe.span,{"aria-hidden":!0,...r,ref:t}):null});ws.displayName=xs;var Ln="SelectScrollUpButton",Ss=s.forwardRef((e,t)=>{const n=Te(Ln,e.__scopeSelect),r=ar(Ln,e.__scopeSelect),[o,i]=s.useState(!1),a=$(t,r.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollTop>0;i(u)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?m.jsx(bs,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});Ss.displayName=Ln;var Fn="SelectScrollDownButton",Cs=s.forwardRef((e,t)=>{const n=Te(Fn,e.__scopeSelect),r=ar(Fn,e.__scopeSelect),[o,i]=s.useState(!1),a=$(t,r.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;i(d)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?m.jsx(bs,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});Cs.displayName=Fn;var bs=s.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Te("SelectScrollButton",n),a=s.useRef(null),c=ln(n),l=s.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return s.useEffect(()=>()=>l(),[l]),Y(()=>{var d;const u=c().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[c]),m.jsx(oe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:P(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:P(o.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:P(o.onPointerLeave,()=>{l()})})}),ym="SelectSeparator",Es=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.jsx(oe.div,{"aria-hidden":!0,...r,ref:t})});Es.displayName=ym;var kn="SelectArrow",xm=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=un(n),i=Ae(kn,n),a=Te(kn,n);return i.open&&a.position==="popper"?m.jsx(Xt,{...o,...r,ref:t}):null});xm.displayName=kn;var wm="SelectBubbleInput",Ps=s.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=s.useRef(null),i=$(r,o),a=em(t);return s.useEffect(()=>{const c=o.current;if(!c)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&d){const f=new Event("change",{bubbles:!0});d.call(c,t),c.dispatchEvent(f)}},[a,t]),m.jsx(oe.select,{...n,style:{...vo,...n.style},ref:i,defaultValue:t})});Ps.displayName=wm;function Rs(e){return e===""||e===void 0}function _s(e){const t=Z(e),n=s.useRef(""),r=s.useRef(0),o=s.useCallback(a=>{const c=n.current+a;t(c),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(c)},[t]),i=s.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function As(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=Sm(e,Math.max(i,0));o.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Sm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Uv=ts,Kv=rs,Gv=is,zv=ss,Yv=cs,Xv=as,Zv=ds,qv=vs,Qv=gs,Jv=ys,eh=ws,th=Ss,nh=Cs,rh=Es;function Cm(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,bm(o,...t)]}function bm(...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((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ts(e){const t=Em(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Rm);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Em(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Am(o),c=_m(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pm=Symbol("radix.slottable");function Rm(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pm}function _m(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Am(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 Tm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Os=Tm.reduce((e,t)=>{const n=Ts(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),fn="Popover",[Ns]=Cm(fn,[_e]),wt=_e(),[Om,Oe]=Ns(fn),Is=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,c=wt(t),l=s.useRef(null),[u,d]=s.useState(!1),[f,p]=Me({prop:r,defaultProp:o??!1,onChange:i,caller:fn});return m.jsx(zt,{...c,children:m.jsx(Om,{scope:t,contentId:le(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:u,onCustomAnchorAdd:s.useCallback(()=>d(!0),[]),onCustomAnchorRemove:s.useCallback(()=>d(!1),[]),modal:a,children:n})})};Is.displayName=fn;var Ms="PopoverAnchor",Nm=s.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Oe(Ms,n),i=wt(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:c}=o;return s.useEffect(()=>(a(),()=>c()),[a,c]),m.jsx(ut,{...i,...r,ref:t})});Nm.displayName=Ms;var Ds="PopoverTrigger",$s=s.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Oe(Ds,n),i=wt(n),a=$(t,o.triggerRef),c=m.jsx(Os.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ws(o.open),...r,ref:a,onClick:P(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?c:m.jsx(ut,{asChild:!0,...i,children:c})});$s.displayName=Ds;var lr="PopoverPortal",[Im,Mm]=Ns(lr,{forceMount:void 0}),js=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Oe(lr,t);return m.jsx(Im,{scope:t,forceMount:n,children:m.jsx(q,{present:n||i.open,children:m.jsx(ft,{asChild:!0,container:o,children:r})})})};js.displayName=lr;var ze="PopoverContent",Ls=s.forwardRef((e,t)=>{const n=Mm(ze,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Oe(ze,e.__scopePopover);return m.jsx(q,{present:r||i.open,children:i.modal?m.jsx($m,{...o,ref:t}):m.jsx(jm,{...o,ref:t})})});Ls.displayName=ze;var Dm=Ts("PopoverContent.RemoveScroll"),$m=s.forwardRef((e,t)=>{const n=Oe(ze,e.__scopePopover),r=s.useRef(null),o=$(t,r),i=s.useRef(!1);return s.useEffect(()=>{const a=r.current;if(a)return tn(a)},[]),m.jsx(vt,{as:Dm,allowPinchZoom:!0,children:m.jsx(Fs,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,a=>{var c;a.preventDefault(),i.current||(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),jm=s.forwardRef((e,t)=>{const n=Oe(ze,e.__scopePopover),r=s.useRef(!1),o=s.useRef(!1);return m.jsx(Fs,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,u;(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;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Fs=s.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=Oe(ze,n),h=wt(n);return Jt(),m.jsx(pt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:m.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:m.jsx(Yt,{"data-state":Ws(p.open),role:"dialog",id:p.contentId,...h,...f,ref:t,style:{...f.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)"}})})})}),ks="PopoverClose",Lm=s.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Oe(ks,n);return m.jsx(Os.button,{type:"button",...r,ref:t,onClick:P(e.onClick,()=>o.onOpenChange(!1))})});Lm.displayName=ks;var Fm="PopoverArrow",km=s.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=wt(n);return m.jsx(Xt,{...o,...r,ref:t})});km.displayName=Fm;function Ws(e){return e?"open":"closed"}var oh=Is,ih=$s,sh=js,ch=Ls;function Wm(e){const t=Vm(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Hm);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Vm(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Km(o),c=Um(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bm=Symbol("radix.slottable");function Hm(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bm}function Um(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Km(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 Gm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],St=Gm.reduce((e,t)=>{const n=Wm(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function zm(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,Ym(o,...t)]}function Ym(...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((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Xm(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}var ur="ScrollArea",[Vs]=zm(ur),[Zm,ce]=Vs(ur),Bs=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...a}=e,[c,l]=s.useState(null),[u,d]=s.useState(null),[f,p]=s.useState(null),[h,g]=s.useState(null),[v,y]=s.useState(null),[x,w]=s.useState(0),[S,C]=s.useState(0),[E,R]=s.useState(!1),[b,A]=s.useState(!1),T=$(t,D=>l(D)),O=rn(o);return m.jsx(Zm,{scope:n,type:r,dir:O,scrollHideDelay:i,scrollArea:c,viewport:u,onViewportChange:d,content:f,onContentChange:p,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:E,onScrollbarXEnabledChange:R,scrollbarY:v,onScrollbarYChange:y,scrollbarYEnabled:b,onScrollbarYEnabledChange:A,onCornerWidthChange:w,onCornerHeightChange:C,children:m.jsx(St.div,{dir:O,...a,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})});Bs.displayName=ur;var Hs="ScrollAreaViewport",Us=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,a=ce(Hs,n),c=s.useRef(null),l=$(t,c,a.onViewportChange);return m.jsxs(m.Fragment,{children:[m.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}),m.jsx(St.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:m.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Us.displayName=Hs;var xe="ScrollAreaScrollbar",qm=s.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ce(xe,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,c=e.orientation==="horizontal";return s.useEffect(()=>(c?i(!0):a(!0),()=>{c?i(!1):a(!1)}),[c,i,a]),o.type==="hover"?m.jsx(Qm,{...r,ref:t,forceMount:n}):o.type==="scroll"?m.jsx(Jm,{...r,ref:t,forceMount:n}):o.type==="auto"?m.jsx(Ks,{...r,ref:t,forceMount:n}):o.type==="always"?m.jsx(fr,{...r,ref:t}):null});qm.displayName=xe;var Qm=s.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ce(xe,e.__scopeScrollArea),[i,a]=s.useState(!1);return s.useEffect(()=>{const c=o.scrollArea;let l=0;if(c){const u=()=>{window.clearTimeout(l),a(!0)},d=()=>{l=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),m.jsx(q,{present:n||i,children:m.jsx(Ks,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Jm=s.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ce(xe,e.__scopeScrollArea),i=e.orientation==="horizontal",a=pn(()=>l("SCROLL_END"),100),[c,l]=Xm("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 s.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,o.scrollHideDelay,l]),s.useEffect(()=>{const u=o.viewport,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const p=()=>{const h=u[d];f!==h&&(l("SCROLL"),a()),f=h};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,i,l,a]),m.jsx(q,{present:n||c!=="hidden",children:m.jsx(fr,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:P(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:P(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Ks=s.forwardRef((e,t)=>{const n=ce(xe,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,a]=s.useState(!1),c=e.orientation==="horizontal",l=pn(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;a(c?u:d)}},10);return Ye(n.viewport,l),Ye(n.content,l),m.jsx(q,{present:r||i,children:m.jsx(fr,{"data-state":i?"visible":"hidden",...o,ref:t})})}),fr=s.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ce(xe,e.__scopeScrollArea),i=s.useRef(null),a=s.useRef(0),[c,l]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Xs(c.viewport,c.content),d={...r,sizes:c,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:p=>a.current=p};function f(p,h){return sv(p,a.current,c,h)}return n==="horizontal"?m.jsx(ev,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,h=Vr(p,c,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=f(p,o.dir))}}):n==="vertical"?m.jsx(tv,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,h=Vr(p,c);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=f(p))}}):null}),ev=s.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ce(xe,e.__scopeScrollArea),[a,c]=s.useState(),l=s.useRef(null),u=$(t,l,i.onScrollbarXChange);return s.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),m.jsx(zs,{"data-orientation":"horizontal",...o,ref:u,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":dn(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(i.viewport){const p=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),qs(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Bt(a.paddingLeft),paddingEnd:Bt(a.paddingRight)}})}})}),tv=s.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ce(xe,e.__scopeScrollArea),[a,c]=s.useState(),l=s.useRef(null),u=$(t,l,i.onScrollbarYChange);return s.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),m.jsx(zs,{"data-orientation":"vertical",...o,ref:u,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":dn(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(i.viewport){const p=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),qs(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Bt(a.paddingTop),paddingEnd:Bt(a.paddingBottom)}})}})}),[nv,Gs]=Vs(xe),zs=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:c,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...p}=e,h=ce(xe,n),[g,v]=s.useState(null),y=$(t,T=>v(T)),x=s.useRef(null),w=s.useRef(""),S=h.viewport,C=r.content-r.viewport,E=Z(d),R=Z(l),b=pn(f,10);function A(T){if(x.current){const O=T.clientX-x.current.left,D=T.clientY-x.current.top;u({x:O,y:D})}}return s.useEffect(()=>{const T=O=>{const D=O.target;(g==null?void 0:g.contains(D))&&E(O,C)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[S,g,C,E]),s.useEffect(R,[r,R]),Ye(g,b),Ye(h.content,b),m.jsx(nv,{scope:n,scrollbar:g,hasThumb:o,onThumbChange:Z(i),onThumbPointerUp:Z(a),onThumbPositionChange:R,onThumbPointerDown:Z(c),children:m.jsx(St.div,{...p,ref:y,style:{position:"absolute",...p.style},onPointerDown:P(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),x.current=g.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),A(T))}),onPointerMove:P(e.onPointerMove,A),onPointerUp:P(e.onPointerUp,T=>{const O=T.target;O.hasPointerCapture(T.pointerId)&&O.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=w.current,h.viewport&&(h.viewport.style.scrollBehavior=""),x.current=null})})})}),Vt="ScrollAreaThumb",rv=s.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Gs(Vt,e.__scopeScrollArea);return m.jsx(q,{present:n||o.hasThumb,children:m.jsx(ov,{ref:t,...r})})}),ov=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=ce(Vt,n),a=Gs(Vt,n),{onThumbPositionChange:c}=a,l=$(t,f=>a.onThumbChange(f)),u=s.useRef(void 0),d=pn(()=>{u.current&&(u.current(),u.current=void 0)},100);return s.useEffect(()=>{const f=i.viewport;if(f){const p=()=>{if(d(),!u.current){const h=cv(f,c);u.current=h,c()}};return c(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,d,c]),m.jsx(St.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:P(e.onPointerDownCapture,f=>{const h=f.target.getBoundingClientRect(),g=f.clientX-h.left,v=f.clientY-h.top;a.onThumbPointerDown({x:g,y:v})}),onPointerUp:P(e.onPointerUp,a.onThumbPointerUp)})});rv.displayName=Vt;var dr="ScrollAreaCorner",Ys=s.forwardRef((e,t)=>{const n=ce(dr,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.jsx(iv,{...e,ref:t}):null});Ys.displayName=dr;var iv=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ce(dr,n),[i,a]=s.useState(0),[c,l]=s.useState(0),u=!!(i&&c);return Ye(o.scrollbarX,()=>{var f;const d=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),Ye(o.scrollbarY,()=>{var f;const d=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(d),a(d)}),u?m.jsx(St.div,{...r,ref:t,style:{width:i,height:c,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Bt(e){return e?parseInt(e,10):0}function Xs(e,t){const n=e/t;return isNaN(n)?0:n}function dn(e){const t=Xs(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function sv(e,t,n,r="ltr"){const o=dn(n),i=o/2,a=t||i,c=o-a,l=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-c,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return Zs([l,u],f)(e)}function Vr(e,t,n="ltr"){const r=dn(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,c=i-r,l=n==="ltr"?[0,a]:[a*-1,0],u=Dn(e,l);return Zs([0,a],[0,c])(u)}function Zs(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 qs(e,t){return e>0&&e<t}var cv=(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,c=n.top!==i.top;(a||c)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function pn(e,t){const n=Z(e),r=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),s.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ye(e,t){const n=Z(t);Y(()=>{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 ah=Bs,lh=Us,uh=Ys;export{qm as $,Yv as A,Xv as B,mv as C,Pv as D,qv as E,Bv as F,Qv as G,eh as H,Mv as I,Jv as J,rh as K,Iv as L,Uv as M,Gv as N,Cv as O,fv as P,sh as Q,dv as R,vv as S,pv as T,ch as U,Zv as V,oh as W,ih as X,ah as Y,lh as Z,uh as _,hv as a,rv as a0,$ as a1,yv as a2,P as a3,gv as a4,wv as a5,X as a6,Z as a7,Zd as a8,qd as a9,ai as aa,Qd as ab,Jd as ac,np as ad,ep as ae,tp as af,rp as ag,op as ah,ip as ai,sp as aj,cp as ak,ap as al,lp as am,up as an,Sv as b,bv as c,Rv as d,Ev as e,xv as f,Fv as g,kv as h,Ov as i,Nv as j,Dv as k,jv as l,$v as m,Lv as n,Av as o,Tv as p,Wv as q,Vv as r,kp as s,dt as t,le as u,Hv as v,Kv as w,zv as x,th as y,nh as z};
53
+ */var Ge=s;function Op(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Np=typeof Object.is=="function"?Object.is:Op,Ip=Ge.useState,Mp=Ge.useEffect,Dp=Ge.useLayoutEffect,$p=Ge.useDebugValue;function jp(e,t){var n=t(),r=Ip({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return Dp(function(){o.value=n,o.getSnapshot=t,En(o)&&i({inst:o})},[e,n,t]),Mp(function(){return En(o)&&i({inst:o}),e(function(){En(o)&&i({inst:o})})},[e]),$p(n),n}function En(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Np(e,n)}catch{return!0}}function Lp(e,t){return t()}var Fp=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Lp:jp;Gi.useSyncExternalStore=Ge.useSyncExternalStore!==void 0?Ge.useSyncExternalStore:Fp;Ki.exports=Gi;var kp=Ki.exports;function Wp(){return kp.useSyncExternalStore(Vp,()=>!0,()=>!1)}function Vp(){return()=>{}}var cr="Avatar",[Bp]=Ap(cr),[Hp,zi]=Bp(cr),Yi=s.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=s.useState("idle");return m.jsx(Hp,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:m.jsx(dt.span,{...r,ref:t})})});Yi.displayName=cr;var Xi="AvatarImage",Zi=s.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,a=zi(Xi,n),c=Up(r,i),l=Z(u=>{o(u),a.onImageLoadingStatusChange(u)});return Y(()=>{c!=="idle"&&l(c)},[c,l]),c==="loaded"?m.jsx(dt.img,{...i,ref:t,src:r}):null});Zi.displayName=Xi;var qi="AvatarFallback",Qi=s.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=zi(qi,n),[a,c]=s.useState(r===void 0);return s.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>c(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&i.imageLoadingStatus!=="loaded"?m.jsx(dt.span,{...o,ref:t}):null});Qi.displayName=qi;function Wr(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Up(e,{referrerPolicy:t,crossOrigin:n}){const r=Wp(),o=s.useRef(null),i=r?(o.current||(o.current=new window.Image),o.current):null,[a,c]=s.useState(()=>Wr(i,e));return Y(()=>{c(Wr(i,e))},[i,e]),Y(()=>{const l=f=>()=>{c(f)};if(!i)return;const u=l("loaded"),d=l("error");return i.addEventListener("load",u),i.addEventListener("error",d),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",d)}},[i,n,t]),a}var Wv=Yi,Vv=Zi,Bv=Qi,Kp="Label",Ji=s.forwardRef((e,t)=>m.jsx(dt.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())}}));Ji.displayName=Kp;var Hv=Ji;function Dn(e,[t,n]){return Math.min(n,Math.max(t,e))}function Gp(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,zp(o,...t)]}function zp(...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((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function es(e){const t=Yp(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Zp);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Yp(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Qp(o),c=qp(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xp=Symbol("radix.slottable");function Zp(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xp}function qp(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Qp(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 Jp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oe=Jp.reduce((e,t)=>{const n=es(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function em(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var tm=[" ","Enter","ArrowUp","ArrowDown"],nm=[" ","Enter"],$e="Select",[an,ln,rm]=Jn($e),[Qe]=Gp($e,[rm,_e]),un=_e(),[om,Ae]=Qe($e),[im,sm]=Qe($e),ts=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:g}=e,v=un(t),[y,x]=s.useState(null),[w,S]=s.useState(null),[C,E]=s.useState(!1),R=rn(u),[b,A]=Me({prop:r,defaultProp:o??!1,onChange:i,caller:$e}),[T,O]=Me({prop:a,defaultProp:c,onChange:l,caller:$e}),D=s.useRef(null),L=y?g||!!y.closest("form"):!0,[F,j]=s.useState(new Set),U=Array.from(F).map(M=>M.props.value).join(";");return m.jsx(zt,{...v,children:m.jsxs(om,{required:h,scope:t,trigger:y,onTriggerChange:x,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:le(),value:T,onValueChange:O,open:b,onOpenChange:A,dir:R,triggerPointerDownPosRef:D,disabled:p,children:[m.jsx(an.Provider,{scope:t,children:m.jsx(im,{scope:e.__scopeSelect,onNativeOptionAdd:s.useCallback(M=>{j(k=>new Set(k).add(M))},[]),onNativeOptionRemove:s.useCallback(M=>{j(k=>{const N=new Set(k);return N.delete(M),N})},[]),children:n})}),L?m.jsxs(Ps,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:T,onChange:M=>O(M.target.value),disabled:p,form:g,children:[T===void 0?m.jsx("option",{value:""}):null,Array.from(F)]},U):null]})})};ts.displayName=$e;var ns="SelectTrigger",rs=s.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=un(n),a=Ae(ns,n),c=a.disabled||r,l=$(t,a.onTriggerChange),u=ln(n),d=s.useRef("touch"),[f,p,h]=_s(v=>{const y=u().filter(S=>!S.disabled),x=y.find(S=>S.value===a.value),w=As(y,v,x);w!==void 0&&a.onValueChange(w.value)}),g=v=>{c||(a.onOpenChange(!0),h()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return m.jsx(ut,{asChild:!0,...i,children:m.jsx(oe.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:c,"data-disabled":c?"":void 0,"data-placeholder":Rs(a.value)?"":void 0,...o,ref:l,onClick:P(o.onClick,v=>{v.currentTarget.focus(),d.current!=="mouse"&&g(v)}),onPointerDown:P(o.onPointerDown,v=>{d.current=v.pointerType;const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(g(v),v.preventDefault())}),onKeyDown:P(o.onKeyDown,v=>{const y=f.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&p(v.key),!(y&&v.key===" ")&&tm.includes(v.key)&&(g(),v.preventDefault())})})})});rs.displayName=ns;var os="SelectValue",is=s.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...c}=e,l=Ae(os,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,f=$(t,l.onValueNodeChange);return Y(()=>{u(d)},[u,d]),m.jsx(oe.span,{...c,ref:f,style:{pointerEvents:"none"},children:Rs(l.value)?m.jsx(m.Fragment,{children:a}):i})});is.displayName=os;var cm="SelectIcon",ss=s.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.jsx(oe.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});ss.displayName=cm;var am="SelectPortal",cs=e=>m.jsx(ft,{asChild:!0,...e});cs.displayName=am;var je="SelectContent",as=s.forwardRef((e,t)=>{const n=Ae(je,e.__scopeSelect),[r,o]=s.useState();if(Y(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?at.createPortal(m.jsx(ls,{scope:e.__scopeSelect,children:m.jsx(an.Slot,{scope:e.__scopeSelect,children:m.jsx("div",{children:e.children})})}),i):null}return m.jsx(us,{...e,ref:t})});as.displayName=je;var ae=10,[ls,Te]=Qe(je),lm="SelectContentImpl",um=es("SelectContent.RemoveScroll"),us=s.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:y,...x}=e,w=Ae(je,n),[S,C]=s.useState(null),[E,R]=s.useState(null),b=$(t,I=>C(I)),[A,T]=s.useState(null),[O,D]=s.useState(null),L=ln(n),[F,j]=s.useState(!1),U=s.useRef(!1);s.useEffect(()=>{if(S)return tn(S)},[S]),Jt();const M=s.useCallback(I=>{const[V,...G]=L().map(H=>H.ref.current),[W]=G.slice(-1),B=document.activeElement;for(const H of I)if(H===B||(H==null||H.scrollIntoView({block:"nearest"}),H===V&&E&&(E.scrollTop=0),H===W&&E&&(E.scrollTop=E.scrollHeight),H==null||H.focus(),document.activeElement!==B))return},[L,E]),k=s.useCallback(()=>M([A,S]),[M,A,S]);s.useEffect(()=>{F&&k()},[F,k]);const{onOpenChange:N,triggerPointerDownPosRef:_}=w;s.useEffect(()=>{if(S){let I={x:0,y:0};const V=W=>{var B,H;I={x:Math.abs(Math.round(W.pageX)-(((B=_.current)==null?void 0:B.x)??0)),y:Math.abs(Math.round(W.pageY)-(((H=_.current)==null?void 0:H.y)??0))}},G=W=>{I.x<=10&&I.y<=10?W.preventDefault():S.contains(W.target)||N(!1),document.removeEventListener("pointermove",V),_.current=null};return _.current!==null&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",G,{capture:!0})}}},[S,N,_]),s.useEffect(()=>{const I=()=>N(!1);return window.addEventListener("blur",I),window.addEventListener("resize",I),()=>{window.removeEventListener("blur",I),window.removeEventListener("resize",I)}},[N]);const[K,z]=_s(I=>{const V=L().filter(B=>!B.disabled),G=V.find(B=>B.ref.current===document.activeElement),W=As(V,I,G);W&&setTimeout(()=>W.ref.current.focus())}),J=s.useCallback((I,V,G)=>{const W=!U.current&&!G;(w.value!==void 0&&w.value===V||W)&&(T(I),W&&(U.current=!0))},[w.value]),we=s.useCallback(()=>S==null?void 0:S.focus(),[S]),ie=s.useCallback((I,V,G)=>{const W=!U.current&&!G;(w.value!==void 0&&w.value===V||W)&&D(I)},[w.value]),Se=r==="popper"?$n:fs,ee=Se===$n?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:y}:{};return m.jsx(ls,{scope:n,content:S,viewport:E,onViewportChange:R,itemRefCallback:J,selectedItem:A,onItemLeave:we,itemTextRefCallback:ie,focusSelectedItem:k,selectedItemText:O,position:r,isPositioned:F,searchRef:K,children:m.jsx(vt,{as:um,allowPinchZoom:!0,children:m.jsx(pt,{asChild:!0,trapped:w.open,onMountAutoFocus:I=>{I.preventDefault()},onUnmountAutoFocus:P(o,I=>{var V;(V=w.trigger)==null||V.focus({preventScroll:!0}),I.preventDefault()}),children:m.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:I=>I.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:m.jsx(Se,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:I=>I.preventDefault(),...x,...ee,onPlaced:()=>j(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:P(x.onKeyDown,I=>{const V=I.ctrlKey||I.altKey||I.metaKey;if(I.key==="Tab"&&I.preventDefault(),!V&&I.key.length===1&&z(I.key),["ArrowUp","ArrowDown","Home","End"].includes(I.key)){let W=L().filter(B=>!B.disabled).map(B=>B.ref.current);if(["ArrowUp","End"].includes(I.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(I.key)){const B=I.target,H=W.indexOf(B);W=W.slice(H+1)}setTimeout(()=>M(W)),I.preventDefault()}})})})})})})});us.displayName=lm;var fm="SelectItemAlignedPosition",fs=s.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Ae(je,n),a=Te(je,n),[c,l]=s.useState(null),[u,d]=s.useState(null),f=$(t,b=>d(b)),p=ln(n),h=s.useRef(!1),g=s.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:x,focusSelectedItem:w}=a,S=s.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&u&&v&&y&&x){const b=i.trigger.getBoundingClientRect(),A=u.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),O=x.getBoundingClientRect();if(i.dir!=="rtl"){const B=O.left-A.left,H=T.left-B,te=b.left-H,pe=b.width+te,Je=Math.max(pe,A.width),et=window.innerWidth-ae,tt=Dn(H,[ae,Math.max(ae,et-Je)]);c.style.minWidth=pe+"px",c.style.left=tt+"px"}else{const B=A.right-O.right,H=window.innerWidth-T.right-B,te=window.innerWidth-b.right-H,pe=b.width+te,Je=Math.max(pe,A.width),et=window.innerWidth-ae,tt=Dn(H,[ae,Math.max(ae,et-Je)]);c.style.minWidth=pe+"px",c.style.right=tt+"px"}const D=p(),L=window.innerHeight-ae*2,F=v.scrollHeight,j=window.getComputedStyle(u),U=parseInt(j.borderTopWidth,10),M=parseInt(j.paddingTop,10),k=parseInt(j.borderBottomWidth,10),N=parseInt(j.paddingBottom,10),_=U+M+F+N+k,K=Math.min(y.offsetHeight*5,_),z=window.getComputedStyle(v),J=parseInt(z.paddingTop,10),we=parseInt(z.paddingBottom,10),ie=b.top+b.height/2-ae,Se=L-ie,ee=y.offsetHeight/2,I=y.offsetTop+ee,V=U+M+I,G=_-V;if(V<=ie){const B=D.length>0&&y===D[D.length-1].ref.current;c.style.bottom="0px";const H=u.clientHeight-v.offsetTop-v.offsetHeight,te=Math.max(Se,ee+(B?we:0)+H+k),pe=V+te;c.style.height=pe+"px"}else{const B=D.length>0&&y===D[0].ref.current;c.style.top="0px";const te=Math.max(ie,U+v.offsetTop+(B?J:0)+ee)+G;c.style.height=te+"px",v.scrollTop=V-ie+v.offsetTop}c.style.margin=`${ae}px 0`,c.style.minHeight=K+"px",c.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,c,u,v,y,x,i.dir,r]);Y(()=>S(),[S]);const[C,E]=s.useState();Y(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const R=s.useCallback(b=>{b&&g.current===!0&&(S(),w==null||w(),g.current=!1)},[S,w]);return m.jsx(pm,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:R,children:m.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:m.jsx(oe.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});fs.displayName=fm;var dm="SelectPopperPosition",$n=s.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=ae,...i}=e,a=un(n);return m.jsx(Yt,{...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)"}})});$n.displayName=dm;var[pm,ar]=Qe(je,{}),jn="SelectViewport",ds=s.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Te(jn,n),a=ar(jn,n),c=$(t,i.onViewportChange),l=s.useRef(0);return m.jsxs(m.Fragment,{children:[m.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}),m.jsx(an.Slot,{scope:n,children:m.jsx(oe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:P(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=a;if(p!=null&&p.current&&f){const h=Math.abs(l.current-d.scrollTop);if(h>0){const g=window.innerHeight-ae*2,v=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),x=Math.max(v,y);if(x<g){const w=x+h,S=Math.min(g,w),C=w-S;f.style.height=S+"px",f.style.bottom==="0px"&&(d.scrollTop=C>0?C:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});ds.displayName=jn;var ps="SelectGroup",[mm,vm]=Qe(ps),hm=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=le();return m.jsx(mm,{scope:n,id:o,children:m.jsx(oe.div,{role:"group","aria-labelledby":o,...r,ref:t})})});hm.displayName=ps;var ms="SelectLabel",vs=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=vm(ms,n);return m.jsx(oe.div,{id:o.id,...r,ref:t})});vs.displayName=ms;var Wt="SelectItem",[gm,hs]=Qe(Wt),gs=s.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,c=Ae(Wt,n),l=Te(Wt,n),u=c.value===r,[d,f]=s.useState(i??""),[p,h]=s.useState(!1),g=$(t,w=>{var S;return(S=l.itemRefCallback)==null?void 0:S.call(l,w,r,o)}),v=le(),y=s.useRef("touch"),x=()=>{o||(c.onValueChange(r),c.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 m.jsx(gm,{scope:n,value:r,disabled:o,textId:v,isSelected:u,onItemTextChange:s.useCallback(w=>{f(S=>S||((w==null?void 0:w.textContent)??"").trim())},[]),children:m.jsx(an.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:m.jsx(oe.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:g,onFocus:P(a.onFocus,()=>h(!0)),onBlur:P(a.onBlur,()=>h(!1)),onClick:P(a.onClick,()=>{y.current!=="mouse"&&x()}),onPointerUp:P(a.onPointerUp,()=>{y.current==="mouse"&&x()}),onPointerDown:P(a.onPointerDown,w=>{y.current=w.pointerType}),onPointerMove:P(a.onPointerMove,w=>{var S;y.current=w.pointerType,o?(S=l.onItemLeave)==null||S.call(l):y.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(a.onPointerLeave,w=>{var S;w.currentTarget===document.activeElement&&((S=l.onItemLeave)==null||S.call(l))}),onKeyDown:P(a.onKeyDown,w=>{var C;((C=l.searchRef)==null?void 0:C.current)!==""&&w.key===" "||(nm.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})});gs.displayName=Wt;var rt="SelectItemText",ys=s.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=Ae(rt,n),c=Te(rt,n),l=hs(rt,n),u=sm(rt,n),[d,f]=s.useState(null),p=$(t,x=>f(x),l.onItemTextChange,x=>{var w;return(w=c.itemTextRefCallback)==null?void 0:w.call(c,x,l.value,l.disabled)}),h=d==null?void 0:d.textContent,g=s.useMemo(()=>m.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=u;return Y(()=>(v(g),()=>y(g)),[v,y,g]),m.jsxs(m.Fragment,{children:[m.jsx(oe.span,{id:l.textId,...i,ref:p}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?at.createPortal(i.children,a.valueNode):null]})});ys.displayName=rt;var xs="SelectItemIndicator",ws=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return hs(xs,n).isSelected?m.jsx(oe.span,{"aria-hidden":!0,...r,ref:t}):null});ws.displayName=xs;var Ln="SelectScrollUpButton",Ss=s.forwardRef((e,t)=>{const n=Te(Ln,e.__scopeSelect),r=ar(Ln,e.__scopeSelect),[o,i]=s.useState(!1),a=$(t,r.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollTop>0;i(u)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?m.jsx(bs,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});Ss.displayName=Ln;var Fn="SelectScrollDownButton",Cs=s.forwardRef((e,t)=>{const n=Te(Fn,e.__scopeSelect),r=ar(Fn,e.__scopeSelect),[o,i]=s.useState(!1),a=$(t,r.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;i(d)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?m.jsx(bs,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});Cs.displayName=Fn;var bs=s.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Te("SelectScrollButton",n),a=s.useRef(null),c=ln(n),l=s.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return s.useEffect(()=>()=>l(),[l]),Y(()=>{var d;const u=c().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[c]),m.jsx(oe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:P(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:P(o.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:P(o.onPointerLeave,()=>{l()})})}),ym="SelectSeparator",Es=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.jsx(oe.div,{"aria-hidden":!0,...r,ref:t})});Es.displayName=ym;var kn="SelectArrow",xm=s.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=un(n),i=Ae(kn,n),a=Te(kn,n);return i.open&&a.position==="popper"?m.jsx(Xt,{...o,...r,ref:t}):null});xm.displayName=kn;var wm="SelectBubbleInput",Ps=s.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=s.useRef(null),i=$(r,o),a=em(t);return s.useEffect(()=>{const c=o.current;if(!c)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&d){const f=new Event("change",{bubbles:!0});d.call(c,t),c.dispatchEvent(f)}},[a,t]),m.jsx(oe.select,{...n,style:{...vo,...n.style},ref:i,defaultValue:t})});Ps.displayName=wm;function Rs(e){return e===""||e===void 0}function _s(e){const t=Z(e),n=s.useRef(""),r=s.useRef(0),o=s.useCallback(a=>{const c=n.current+a;t(c),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(c)},[t]),i=s.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function As(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=Sm(e,Math.max(i,0));o.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Sm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Uv=ts,Kv=rs,Gv=is,zv=ss,Yv=cs,Xv=as,Zv=ds,qv=vs,Qv=gs,Jv=ys,eh=ws,th=Ss,nh=Cs,rh=Es;function Cm(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,bm(o,...t)]}function bm(...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((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ts(e){const t=Em(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Rm);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Em(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Am(o),c=_m(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pm=Symbol("radix.slottable");function Rm(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pm}function _m(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Am(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 Tm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Os=Tm.reduce((e,t)=>{const n=Ts(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),fn="Popover",[Ns]=Cm(fn,[_e]),wt=_e(),[Om,Oe]=Ns(fn),Is=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,c=wt(t),l=s.useRef(null),[u,d]=s.useState(!1),[f,p]=Me({prop:r,defaultProp:o??!1,onChange:i,caller:fn});return m.jsx(zt,{...c,children:m.jsx(Om,{scope:t,contentId:le(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:u,onCustomAnchorAdd:s.useCallback(()=>d(!0),[]),onCustomAnchorRemove:s.useCallback(()=>d(!1),[]),modal:a,children:n})})};Is.displayName=fn;var Ms="PopoverAnchor",Nm=s.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Oe(Ms,n),i=wt(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:c}=o;return s.useEffect(()=>(a(),()=>c()),[a,c]),m.jsx(ut,{...i,...r,ref:t})});Nm.displayName=Ms;var Ds="PopoverTrigger",$s=s.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Oe(Ds,n),i=wt(n),a=$(t,o.triggerRef),c=m.jsx(Os.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ws(o.open),...r,ref:a,onClick:P(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?c:m.jsx(ut,{asChild:!0,...i,children:c})});$s.displayName=Ds;var lr="PopoverPortal",[Im,Mm]=Ns(lr,{forceMount:void 0}),js=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Oe(lr,t);return m.jsx(Im,{scope:t,forceMount:n,children:m.jsx(q,{present:n||i.open,children:m.jsx(ft,{asChild:!0,container:o,children:r})})})};js.displayName=lr;var ze="PopoverContent",Ls=s.forwardRef((e,t)=>{const n=Mm(ze,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Oe(ze,e.__scopePopover);return m.jsx(q,{present:r||i.open,children:i.modal?m.jsx($m,{...o,ref:t}):m.jsx(jm,{...o,ref:t})})});Ls.displayName=ze;var Dm=Ts("PopoverContent.RemoveScroll"),$m=s.forwardRef((e,t)=>{const n=Oe(ze,e.__scopePopover),r=s.useRef(null),o=$(t,r),i=s.useRef(!1);return s.useEffect(()=>{const a=r.current;if(a)return tn(a)},[]),m.jsx(vt,{as:Dm,allowPinchZoom:!0,children:m.jsx(Fs,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,a=>{var c;a.preventDefault(),i.current||(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),jm=s.forwardRef((e,t)=>{const n=Oe(ze,e.__scopePopover),r=s.useRef(!1),o=s.useRef(!1);return m.jsx(Fs,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,u;(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;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Fs=s.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=Oe(ze,n),h=wt(n);return Jt(),m.jsx(pt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:m.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:m.jsx(Yt,{"data-state":Ws(p.open),role:"dialog",id:p.contentId,...h,...f,ref:t,style:{...f.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)"}})})})}),ks="PopoverClose",Lm=s.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Oe(ks,n);return m.jsx(Os.button,{type:"button",...r,ref:t,onClick:P(e.onClick,()=>o.onOpenChange(!1))})});Lm.displayName=ks;var Fm="PopoverArrow",km=s.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=wt(n);return m.jsx(Xt,{...o,...r,ref:t})});km.displayName=Fm;function Ws(e){return e?"open":"closed"}var oh=Is,ih=$s,sh=js,ch=Ls;function Wm(e){const t=Vm(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Hm);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Vm(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Km(o),c=Um(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bm=Symbol("radix.slottable");function Hm(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bm}function Um(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]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Km(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 Gm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],St=Gm.reduce((e,t)=>{const n=Wm(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function zm(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,Ym(o,...t)]}function Ym(...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((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Xm(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}var ur="ScrollArea",[Vs]=zm(ur),[Zm,ce]=Vs(ur),Bs=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...a}=e,[c,l]=s.useState(null),[u,d]=s.useState(null),[f,p]=s.useState(null),[h,g]=s.useState(null),[v,y]=s.useState(null),[x,w]=s.useState(0),[S,C]=s.useState(0),[E,R]=s.useState(!1),[b,A]=s.useState(!1),T=$(t,D=>l(D)),O=rn(o);return m.jsx(Zm,{scope:n,type:r,dir:O,scrollHideDelay:i,scrollArea:c,viewport:u,onViewportChange:d,content:f,onContentChange:p,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:E,onScrollbarXEnabledChange:R,scrollbarY:v,onScrollbarYChange:y,scrollbarYEnabled:b,onScrollbarYEnabledChange:A,onCornerWidthChange:w,onCornerHeightChange:C,children:m.jsx(St.div,{dir:O,...a,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})});Bs.displayName=ur;var Hs="ScrollAreaViewport",Us=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,a=ce(Hs,n),c=s.useRef(null),l=$(t,c,a.onViewportChange);return m.jsxs(m.Fragment,{children:[m.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}),m.jsx(St.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:m.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Us.displayName=Hs;var xe="ScrollAreaScrollbar",qm=s.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ce(xe,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,c=e.orientation==="horizontal";return s.useEffect(()=>(c?i(!0):a(!0),()=>{c?i(!1):a(!1)}),[c,i,a]),o.type==="hover"?m.jsx(Qm,{...r,ref:t,forceMount:n}):o.type==="scroll"?m.jsx(Jm,{...r,ref:t,forceMount:n}):o.type==="auto"?m.jsx(Ks,{...r,ref:t,forceMount:n}):o.type==="always"?m.jsx(fr,{...r,ref:t}):null});qm.displayName=xe;var Qm=s.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ce(xe,e.__scopeScrollArea),[i,a]=s.useState(!1);return s.useEffect(()=>{const c=o.scrollArea;let l=0;if(c){const u=()=>{window.clearTimeout(l),a(!0)},d=()=>{l=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),m.jsx(q,{present:n||i,children:m.jsx(Ks,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Jm=s.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ce(xe,e.__scopeScrollArea),i=e.orientation==="horizontal",a=pn(()=>l("SCROLL_END"),100),[c,l]=Xm("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 s.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,o.scrollHideDelay,l]),s.useEffect(()=>{const u=o.viewport,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const p=()=>{const h=u[d];f!==h&&(l("SCROLL"),a()),f=h};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,i,l,a]),m.jsx(q,{present:n||c!=="hidden",children:m.jsx(fr,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:P(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:P(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Ks=s.forwardRef((e,t)=>{const n=ce(xe,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,a]=s.useState(!1),c=e.orientation==="horizontal",l=pn(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;a(c?u:d)}},10);return Ye(n.viewport,l),Ye(n.content,l),m.jsx(q,{present:r||i,children:m.jsx(fr,{"data-state":i?"visible":"hidden",...o,ref:t})})}),fr=s.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ce(xe,e.__scopeScrollArea),i=s.useRef(null),a=s.useRef(0),[c,l]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Xs(c.viewport,c.content),d={...r,sizes:c,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:p=>a.current=p};function f(p,h){return sv(p,a.current,c,h)}return n==="horizontal"?m.jsx(ev,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,h=Vr(p,c,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=f(p,o.dir))}}):n==="vertical"?m.jsx(tv,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,h=Vr(p,c);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=f(p))}}):null}),ev=s.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ce(xe,e.__scopeScrollArea),[a,c]=s.useState(),l=s.useRef(null),u=$(t,l,i.onScrollbarXChange);return s.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),m.jsx(zs,{"data-orientation":"horizontal",...o,ref:u,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":dn(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(i.viewport){const p=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),qs(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Bt(a.paddingLeft),paddingEnd:Bt(a.paddingRight)}})}})}),tv=s.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ce(xe,e.__scopeScrollArea),[a,c]=s.useState(),l=s.useRef(null),u=$(t,l,i.onScrollbarYChange);return s.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),m.jsx(zs,{"data-orientation":"vertical",...o,ref:u,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":dn(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(i.viewport){const p=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),qs(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Bt(a.paddingTop),paddingEnd:Bt(a.paddingBottom)}})}})}),[nv,Gs]=Vs(xe),zs=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:c,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...p}=e,h=ce(xe,n),[g,v]=s.useState(null),y=$(t,T=>v(T)),x=s.useRef(null),w=s.useRef(""),S=h.viewport,C=r.content-r.viewport,E=Z(d),R=Z(l),b=pn(f,10);function A(T){if(x.current){const O=T.clientX-x.current.left,D=T.clientY-x.current.top;u({x:O,y:D})}}return s.useEffect(()=>{const T=O=>{const D=O.target;(g==null?void 0:g.contains(D))&&E(O,C)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[S,g,C,E]),s.useEffect(R,[r,R]),Ye(g,b),Ye(h.content,b),m.jsx(nv,{scope:n,scrollbar:g,hasThumb:o,onThumbChange:Z(i),onThumbPointerUp:Z(a),onThumbPositionChange:R,onThumbPointerDown:Z(c),children:m.jsx(St.div,{...p,ref:y,style:{position:"absolute",...p.style},onPointerDown:P(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),x.current=g.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),A(T))}),onPointerMove:P(e.onPointerMove,A),onPointerUp:P(e.onPointerUp,T=>{const O=T.target;O.hasPointerCapture(T.pointerId)&&O.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=w.current,h.viewport&&(h.viewport.style.scrollBehavior=""),x.current=null})})})}),Vt="ScrollAreaThumb",rv=s.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Gs(Vt,e.__scopeScrollArea);return m.jsx(q,{present:n||o.hasThumb,children:m.jsx(ov,{ref:t,...r})})}),ov=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=ce(Vt,n),a=Gs(Vt,n),{onThumbPositionChange:c}=a,l=$(t,f=>a.onThumbChange(f)),u=s.useRef(void 0),d=pn(()=>{u.current&&(u.current(),u.current=void 0)},100);return s.useEffect(()=>{const f=i.viewport;if(f){const p=()=>{if(d(),!u.current){const h=cv(f,c);u.current=h,c()}};return c(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,d,c]),m.jsx(St.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:P(e.onPointerDownCapture,f=>{const h=f.target.getBoundingClientRect(),g=f.clientX-h.left,v=f.clientY-h.top;a.onThumbPointerDown({x:g,y:v})}),onPointerUp:P(e.onPointerUp,a.onThumbPointerUp)})});rv.displayName=Vt;var dr="ScrollAreaCorner",Ys=s.forwardRef((e,t)=>{const n=ce(dr,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.jsx(iv,{...e,ref:t}):null});Ys.displayName=dr;var iv=s.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ce(dr,n),[i,a]=s.useState(0),[c,l]=s.useState(0),u=!!(i&&c);return Ye(o.scrollbarX,()=>{var f;const d=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),Ye(o.scrollbarY,()=>{var f;const d=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(d),a(d)}),u?m.jsx(St.div,{...r,ref:t,style:{width:i,height:c,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Bt(e){return e?parseInt(e,10):0}function Xs(e,t){const n=e/t;return isNaN(n)?0:n}function dn(e){const t=Xs(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function sv(e,t,n,r="ltr"){const o=dn(n),i=o/2,a=t||i,c=o-a,l=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-c,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return Zs([l,u],f)(e)}function Vr(e,t,n="ltr"){const r=dn(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,c=i-r,l=n==="ltr"?[0,a]:[a*-1,0],u=Dn(e,l);return Zs([0,a],[0,c])(u)}function Zs(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 qs(e,t){return e>0&&e<t}var cv=(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,c=n.top!==i.top;(a||c)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function pn(e,t){const n=Z(e),r=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),s.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ye(e,t){const n=Z(t);Y(()=>{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 ah=Bs,lh=Us,uh=Ys;export{P as $,Yv as A,Xv as B,mv as C,Pv as D,qv as E,Bv as F,Qv as G,eh as H,Mv as I,Jv as J,rh as K,Iv as L,Uv as M,Gv as N,Cv as O,fv as P,sh as Q,dv as R,vv as S,pv as T,ch as U,Zv as V,oh as W,ih as X,X as Y,$ as Z,Me as _,hv as a,em as a0,Za as a1,ah as a2,lh as a3,uh as a4,qm as a5,rv as a6,yv as a7,gv as a8,wv as a9,Z as aa,Zd as ab,qd as ac,ai as ad,Qd as ae,Jd as af,np as ag,ep as ah,tp as ai,rp as aj,op as ak,ip as al,sp as am,cp as an,ap as ao,lp as ap,up as aq,Sv as b,bv as c,Rv as d,Ev as e,xv as f,Fv as g,kv as h,Ov as i,Nv as j,Dv as k,jv as l,$v as m,Lv as n,Av as o,Tv as p,Wv as q,Vv as r,kp as s,dt as t,le as u,Hv as v,Kv as w,zv as x,th as y,nh as z};
package/dist/index.html CHANGED
@@ -11,13 +11,13 @@
11
11
  href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap"
12
12
  rel="stylesheet"
13
13
  />
14
- <script type="module" crossorigin src="/assets/index-BlR7GTV2.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-RA9kdCUt.js"></script>
15
15
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-GAVzOgi0.js">
16
16
  <link rel="modulepreload" crossorigin href="/assets/vendor-query-B9zjiv_I.js">
17
- <link rel="modulepreload" crossorigin href="/assets/vendor-radix-CvpS4Cp5.js">
17
+ <link rel="modulepreload" crossorigin href="/assets/vendor-radix-C0hGJ1gZ.js">
18
18
  <link rel="modulepreload" crossorigin href="/assets/vendor-dnd-DY2LDzZ0.js">
19
- <link rel="modulepreload" crossorigin href="/assets/vendor-editor-CLgv8mN6.js">
20
- <link rel="stylesheet" crossorigin href="/assets/index-CHk8ddli.css">
19
+ <link rel="modulepreload" crossorigin href="/assets/vendor-editor-B6IH0QIT.js">
20
+ <link rel="stylesheet" crossorigin href="/assets/index-Baa7Rmrm.css">
21
21
  </head>
22
22
  <body>
23
23
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meridianjs/admin-dashboard",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -15,6 +15,7 @@
15
15
  "@dnd-kit/utilities": "^3.2.2",
16
16
  "@radix-ui/react-alert-dialog": "1.1.15",
17
17
  "@radix-ui/react-avatar": "^1.1.2",
18
+ "@radix-ui/react-checkbox": "1.3.3",
18
19
  "@radix-ui/react-context-menu": "2.2.16",
19
20
  "@radix-ui/react-dialog": "^1.1.4",
20
21
  "@radix-ui/react-dropdown-menu": "^2.1.4",
@@ -24,6 +25,7 @@
24
25
  "@radix-ui/react-select": "^2.1.4",
25
26
  "@radix-ui/react-separator": "^1.1.1",
26
27
  "@radix-ui/react-slot": "^1.1.1",
28
+ "@radix-ui/react-switch": "1.2.6",
27
29
  "@radix-ui/react-tabs": "^1.1.2",
28
30
  "@radix-ui/react-tooltip": "^1.1.6",
29
31
  "@tanstack/react-query": "^5.62.0",