hasting-swatchcart-module 1.0.37 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index.css +66 -16
- package/dist/cdn/main.css +66 -16
- package/dist/cdn/main.js +21 -21
- package/dist/main.cjs +19 -19
- package/dist/main.cjs.map +1 -1
- package/dist/main.js +21 -21
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -56,7 +56,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
56
56
|
font-medium text-sm cursor-pointer transition-all duration-[400ms] ease-in-out
|
|
57
57
|
outline-none focus:ring-2 focus:ring-[var(--main-accent-color)] focus:ring-offset-2
|
|
58
58
|
${t?"bg-[var(--main-accent-color)] text-white hover:brightness-90":"bg-[var(--label-bg)] hover:brightness-95"}
|
|
59
|
-
`,children:e})},ro=e=>m.jsx("svg",{width:"7",height:"12",viewBox:"0 0 7 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",...e,children:m.jsx("path",{d:"M5.75 0.75L0.75 5.75L5.75 10.75",stroke:"current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ao=({items:e,activeId:t,onSelect:n,className:r="",stepRatio:a=.8})=>{const s=D.useRef(null),i=D.useRef(null),o=D.useRef(null),[l,c]=D.useState(!1),[d,f]=D.useState(!1),p=D.useCallback(()=>{const x=s.current;if(!x)return;const g=x.scrollWidth-x.clientWidth-x.scrollLeft,A=.5;c(x.scrollLeft>A),f(g>A)},[]);D.useLayoutEffect(()=>(o.current=requestAnimationFrame(p),()=>{o.current&&cancelAnimationFrame(o.current)}),[e.length,p]),D.useEffect(()=>{const x=s.current,g=i.current;if(!x||!g)return;p();const A=new ResizeObserver(()=>p()),E=new ResizeObserver(()=>p());A.observe(x),E.observe(g);const S=()=>p();return x.addEventListener("scroll",S,{passive:!0}),"fonts"in document&&document.fonts?.ready?.then(()=>p()),()=>{A.disconnect(),E.disconnect(),x.removeEventListener("scroll",S)}},[p]);const h=x=>{const g=s.current;if(!g)return;const A=g.clientWidth*a*(x==="left"?-1:1);g.scrollBy({left:A,behavior:"smooth"})};return m.jsxs("div",{className:`flex flex-row items-center gap-[8px] lg:w-[50%] xl:max-w-[68%] xl:w-full ${r}`,role:"region","aria-label":"Category slider",children:[m.jsxs("button",{type:"button","aria-label":"Scroll left",disabled:!l,onClick:()=>h("left"),className:`flex-shrink-0 h-8 w-8 rounded-full flex flex-row items-center justify-center shadow
|
|
59
|
+
`,children:e})},ro=e=>m.jsx("svg",{width:"7",height:"12",viewBox:"0 0 7 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",...e,children:m.jsx("path",{d:"M5.75 0.75L0.75 5.75L5.75 10.75",stroke:"current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ao=({items:e,activeId:t,onSelect:n,className:r="",stepRatio:a=.8})=>{const s=D.useRef(null),i=D.useRef(null),o=D.useRef(null),[l,c]=D.useState(!1),[d,f]=D.useState(!1),p=D.useCallback(()=>{const x=s.current;if(!x)return;const g=x.scrollWidth-x.clientWidth-x.scrollLeft,A=.5;c(x.scrollLeft>A),f(g>A)},[]);D.useLayoutEffect(()=>(o.current=requestAnimationFrame(p),()=>{o.current&&cancelAnimationFrame(o.current)}),[e.length,p]),D.useEffect(()=>{const x=s.current,g=i.current;if(!x||!g)return;p();const A=new ResizeObserver(()=>p()),E=new ResizeObserver(()=>p());A.observe(x),E.observe(g);const S=()=>p();return x.addEventListener("scroll",S,{passive:!0}),"fonts"in document&&document.fonts?.ready?.then(()=>p()),()=>{A.disconnect(),E.disconnect(),x.removeEventListener("scroll",S)}},[p]);const h=x=>{const g=s.current;if(!g)return;const A=g.clientWidth*a*(x==="left"?-1:1);g.scrollBy({left:A,behavior:"smooth"})};return m.jsxs("div",{className:`flex! flex-row! items-center! gap-[8px]! lg:w-[50%]! xl:max-w-[68%]! xl:w-full! ${r}`,role:"region","aria-label":"Category slider",children:[m.jsxs("button",{type:"button","aria-label":"Scroll left",disabled:!l,onClick:()=>h("left"),className:`flex-shrink-0 h-8 w-8 rounded-full flex flex-row items-center justify-center shadow
|
|
60
60
|
${l?"bg-black text-white hover:brightness-110":"bg-gray-200 text-gray-500 opacity-60 cursor-not-allowed"}`,children:[m.jsx(ro,{className:"w-[16px] h-4 rotate-360"})," "]}),m.jsx("div",{ref:s,className:"no-scrollbar flex-1 overflow-hidden scroll-smooth",style:{WebkitOverflowScrolling:"touch"},children:m.jsx("div",{ref:i,className:"flex flex-row gap-[12px] sm:gap-[16px] py-2 px-3",children:e.map(x=>{const g=x.productId,A=t===g;return m.jsx("div",{className:"shrink-0",children:m.jsx(jp,{text:x.name,isActive:A,onClick:()=>n(x)})},g)})})}),m.jsxs("button",{type:"button","aria-label":"Scroll right",disabled:!d,onClick:()=>h("right"),className:`flex-shrink-0 h-8 w-8 rounded-full flex flex-row items-center justify-center shadow
|
|
61
61
|
${d?"bg-black text-white hover:brightness-110":"bg-gray-200 text-gray-400 opacity-60 cursor-not-allowed"}`,children:[m.jsx(ro,{className:"w-[16px] h-4 rotate-180"})," "]})]})},zp=["top","right","bottom","left"],Dt=Math.min,$e=Math.max,Wr=Math.round,wr=Math.floor,ft=e=>({x:e,y:e}),Yp={left:"right",right:"left",bottom:"top",top:"bottom"},Wp={start:"end",end:"start"};function cs(e,t,n){return $e(e,Dt(t,n))}function Ct(e,t){return typeof e=="function"?e(t):e}function At(e){return e.split("-")[0]}function Sn(e){return e.split("-")[1]}function Gs(e){return e==="x"?"y":"x"}function Xs(e){return e==="y"?"height":"width"}const Vp=new Set(["top","bottom"]);function ct(e){return Vp.has(At(e))?"y":"x"}function Ks(e){return Gs(ct(e))}function $p(e,t,n){n===void 0&&(n=!1);const r=Sn(e),a=Ks(e),s=Xs(a);let i=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Vr(i)),[i,Vr(i)]}function qp(e){const t=Vr(e);return[ds(e),t,ds(t)]}function ds(e){return e.replace(/start|end/g,t=>Wp[t])}const so=["left","right"],io=["right","left"],Gp=["top","bottom"],Xp=["bottom","top"];function Kp(e,t,n){switch(e){case"top":case"bottom":return n?t?io:so:t?so:io;case"left":case"right":return t?Gp:Xp;default:return[]}}function Qp(e,t,n,r){const a=Sn(e);let s=Kp(At(e),n==="start",r);return a&&(s=s.map(i=>i+"-"+a),t&&(s=s.concat(s.map(ds)))),s}function Vr(e){return e.replace(/left|right|bottom|top/g,t=>Yp[t])}function Zp(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ql(e){return typeof e!="number"?Zp(e):{top:e,right:e,bottom:e,left:e}}function $r(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function oo(e,t,n){let{reference:r,floating:a}=e;const s=ct(t),i=Ks(t),o=Xs(i),l=At(t),c=s==="y",d=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,p=r[o]/2-a[o]/2;let h;switch(l){case"top":h={x:d,y:r.y-a.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-a.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Sn(t)){case"start":h[i]-=p*(n&&c?-1:1);break;case"end":h[i]+=p*(n&&c?-1:1);break}return h}const Jp=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:i}=n,o=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:f}=oo(c,r,l),p=r,h={},x=0;for(let g=0;g<o.length;g++){const{name:A,fn:E}=o[g],{x:S,y:N,data:O,reset:k}=await E({x:d,y:f,initialPlacement:r,placement:p,strategy:a,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});d=S??d,f=N??f,h={...h,[A]:{...h[A],...O}},k&&x<=50&&(x++,typeof k=="object"&&(k.placement&&(p=k.placement),k.rects&&(c=k.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:a}):k.rects),{x:d,y:f}=oo(c,p,l)),g=-1)}return{x:d,y:f,placement:p,strategy:a,middlewareData:h}};async function nr(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:s,rects:i,elements:o,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=Ct(t,e),x=Ql(h),A=o[p?f==="floating"?"reference":"floating":f],E=$r(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(A)))==null||n?A:A.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:c,rootBoundary:d,strategy:l})),S=f==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),O=await(s.isElement==null?void 0:s.isElement(N))?await(s.getScale==null?void 0:s.getScale(N))||{x:1,y:1}:{x:1,y:1},k=$r(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:S,offsetParent:N,strategy:l}):S);return{top:(E.top-k.top+x.top)/O.y,bottom:(k.bottom-E.bottom+x.bottom)/O.y,left:(E.left-k.left+x.left)/O.x,right:(k.right-E.right+x.right)/O.x}}const eg=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:s,platform:i,elements:o,middlewareData:l}=t,{element:c,padding:d=0}=Ct(e,t)||{};if(c==null)return{};const f=Ql(d),p={x:n,y:r},h=Ks(a),x=Xs(h),g=await i.getDimensions(c),A=h==="y",E=A?"top":"left",S=A?"bottom":"right",N=A?"clientHeight":"clientWidth",O=s.reference[x]+s.reference[h]-p[h]-s.floating[x],k=p[h]-s.reference[h],w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let R=w?w[N]:0;(!R||!await(i.isElement==null?void 0:i.isElement(w)))&&(R=o.floating[N]||s.floating[x]);const P=O/2-k/2,$=R/2-g[x]/2-1,X=Dt(f[E],$),U=Dt(f[S],$),Y=X,K=R-g[x]-U,F=R/2-g[x]/2+P,H=cs(Y,F,K),q=!l.arrow&&Sn(a)!=null&&F!==H&&s.reference[x]/2-(F<Y?X:U)-g[x]/2<0,Q=q?F<Y?F-Y:F-K:0;return{[h]:p[h]+Q,data:{[h]:H,centerOffset:F-H-Q,...q&&{alignmentOffset:Q}},reset:q}}}),tg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:s,rects:i,initialPlacement:o,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:g=!0,...A}=Ct(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=At(a),S=ct(o),N=At(o)===o,O=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=p||(N||!g?[Vr(o)]:qp(o)),w=x!=="none";!p&&w&&k.push(...Qp(o,g,x,O));const R=[o,...k],P=await nr(t,A),$=[];let X=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&$.push(P[E]),f){const F=$p(a,i,O);$.push(P[F[0]],P[F[1]])}if(X=[...X,{placement:a,overflows:$}],!$.every(F=>F<=0)){var U,Y;const F=(((U=s.flip)==null?void 0:U.index)||0)+1,H=R[F];if(H&&(!(f==="alignment"?S!==ct(H):!1)||X.every(B=>ct(B.placement)===S?B.overflows[0]>0:!0)))return{data:{index:F,overflows:X},reset:{placement:H}};let q=(Y=X.filter(Q=>Q.overflows[0]<=0).sort((Q,B)=>Q.overflows[1]-B.overflows[1])[0])==null?void 0:Y.placement;if(!q)switch(h){case"bestFit":{var K;const Q=(K=X.filter(B=>{if(w){const ae=ct(B.placement);return ae===S||ae==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ae=>ae>0).reduce((ae,y)=>ae+y,0)]).sort((B,ae)=>B[1]-ae[1])[0])==null?void 0:K[0];Q&&(q=Q);break}case"initialPlacement":q=o;break}if(a!==q)return{reset:{placement:q}}}return{}}}};function uo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function lo(e){return zp.some(t=>e[t]>=0)}const ng=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Ct(e,t);switch(r){case"referenceHidden":{const s=await nr(t,{...a,elementContext:"reference"}),i=uo(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:lo(i)}}}case"escaped":{const s=await nr(t,{...a,altBoundary:!0}),i=uo(s,n.floating);return{data:{escapedOffsets:i,escaped:lo(i)}}}default:return{}}}}},Zl=new Set(["left","top"]);async function rg(e,t){const{placement:n,platform:r,elements:a}=e,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=At(n),o=Sn(n),l=ct(n)==="y",c=Zl.has(i)?-1:1,d=s&&l?-1:1,f=Ct(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return o&&typeof x=="number"&&(h=o==="end"?x*-1:x),l?{x:h*d,y:p*c}:{x:p*c,y:h*d}}const ag=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:s,placement:i,middlewareData:o}=t,l=await rg(t,e);return i===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:a+l.x,y:s+l.y,data:{...l,placement:i}}}}},sg=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:o={fn:A=>{let{x:E,y:S}=A;return{x:E,y:S}}},...l}=Ct(e,t),c={x:n,y:r},d=await nr(t,l),f=ct(At(a)),p=Gs(f);let h=c[p],x=c[f];if(s){const A=p==="y"?"top":"left",E=p==="y"?"bottom":"right",S=h+d[A],N=h-d[E];h=cs(S,h,N)}if(i){const A=f==="y"?"top":"left",E=f==="y"?"bottom":"right",S=x+d[A],N=x-d[E];x=cs(S,x,N)}const g=o.fn({...t,[p]:h,[f]:x});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:s,[f]:i}}}}}},ig=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:s,middlewareData:i}=t,{offset:o=0,mainAxis:l=!0,crossAxis:c=!0}=Ct(e,t),d={x:n,y:r},f=ct(a),p=Gs(f);let h=d[p],x=d[f];const g=Ct(o,t),A=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const N=p==="y"?"height":"width",O=s.reference[p]-s.floating[N]+A.mainAxis,k=s.reference[p]+s.reference[N]-A.mainAxis;h<O?h=O:h>k&&(h=k)}if(c){var E,S;const N=p==="y"?"width":"height",O=Zl.has(At(a)),k=s.reference[f]-s.floating[N]+(O&&((E=i.offset)==null?void 0:E[f])||0)+(O?0:A.crossAxis),w=s.reference[f]+s.reference[N]+(O?0:((S=i.offset)==null?void 0:S[f])||0)-(O?A.crossAxis:0);x<k?x=k:x>w&&(x=w)}return{[p]:h,[f]:x}}}},og=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:s,platform:i,elements:o}=t,{apply:l=()=>{},...c}=Ct(e,t),d=await nr(t,c),f=At(a),p=Sn(a),h=ct(a)==="y",{width:x,height:g}=s.floating;let A,E;f==="top"||f==="bottom"?(A=f,E=p===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(E=f,A=p==="end"?"top":"bottom");const S=g-d.top-d.bottom,N=x-d.left-d.right,O=Dt(g-d[A],S),k=Dt(x-d[E],N),w=!t.middlewareData.shift;let R=O,P=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=S),w&&!p){const X=$e(d.left,0),U=$e(d.right,0),Y=$e(d.top,0),K=$e(d.bottom,0);h?P=x-2*(X!==0||U!==0?X+U:$e(d.left,d.right)):R=g-2*(Y!==0||K!==0?Y+K:$e(d.top,d.bottom))}await l({...t,availableWidth:P,availableHeight:R});const $=await i.getDimensions(o.floating);return x!==$.width||g!==$.height?{reset:{rects:!0}}:{}}}};function la(){return typeof window<"u"}function In(e){return Jl(e)?(e.nodeName||"").toLowerCase():"#document"}function Ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gt(e){var t;return(t=(Jl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Jl(e){return la()?e instanceof Node||e instanceof Ge(e).Node:!1}function tt(e){return la()?e instanceof Element||e instanceof Ge(e).Element:!1}function ht(e){return la()?e instanceof HTMLElement||e instanceof Ge(e).HTMLElement:!1}function co(e){return!la()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ge(e).ShadowRoot}const ug=new Set(["inline","contents"]);function hr(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ug.has(a)}const lg=new Set(["table","td","th"]);function cg(e){return lg.has(In(e))}const dg=[":popover-open",":modal"];function ca(e){return dg.some(t=>{try{return e.matches(t)}catch{return!1}})}const fg=["transform","translate","scale","rotate","perspective"],hg=["transform","translate","scale","rotate","perspective","filter"],mg=["paint","layout","strict","content"];function Qs(e){const t=Zs(),n=tt(e)?nt(e):e;return fg.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||hg.some(r=>(n.willChange||"").includes(r))||mg.some(r=>(n.contain||"").includes(r))}function pg(e){let t=Mt(e);for(;ht(t)&&!gn(t);){if(Qs(t))return t;if(ca(t))return null;t=Mt(t)}return null}function Zs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const gg=new Set(["html","body","#document"]);function gn(e){return gg.has(In(e))}function nt(e){return Ge(e).getComputedStyle(e)}function da(e){return tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mt(e){if(In(e)==="html")return e;const t=e.assignedSlot||e.parentNode||co(e)&&e.host||gt(e);return co(t)?t.host:t}function ec(e){const t=Mt(e);return gn(t)?e.ownerDocument?e.ownerDocument.body:e.body:ht(t)&&hr(t)?t:ec(t)}function rr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=ec(e),s=a===((r=e.ownerDocument)==null?void 0:r.body),i=Ge(a);if(s){const o=fs(i);return t.concat(i,i.visualViewport||[],hr(a)?a:[],o&&n?rr(o):[])}return t.concat(a,rr(a,[],n))}function fs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tc(e){const t=nt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=ht(e),s=a?e.offsetWidth:n,i=a?e.offsetHeight:r,o=Wr(n)!==s||Wr(r)!==i;return o&&(n=s,r=i),{width:n,height:r,$:o}}function Js(e){return tt(e)?e:e.contextElement}function dn(e){const t=Js(e);if(!ht(t))return ft(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:s}=tc(t);let i=(s?Wr(n.width):n.width)/r,o=(s?Wr(n.height):n.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}const bg=ft(0);function nc(e){const t=Ge(e);return!Zs()||!t.visualViewport?bg:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Eg(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ge(e)?!1:t}function Vt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),s=Js(e);let i=ft(1);t&&(r?tt(r)&&(i=dn(r)):i=dn(e));const o=Eg(s,n,r)?nc(s):ft(0);let l=(a.left+o.x)/i.x,c=(a.top+o.y)/i.y,d=a.width/i.x,f=a.height/i.y;if(s){const p=Ge(s),h=r&&tt(r)?Ge(r):r;let x=p,g=fs(x);for(;g&&r&&h!==x;){const A=dn(g),E=g.getBoundingClientRect(),S=nt(g),N=E.left+(g.clientLeft+parseFloat(S.paddingLeft))*A.x,O=E.top+(g.clientTop+parseFloat(S.paddingTop))*A.y;l*=A.x,c*=A.y,d*=A.x,f*=A.y,l+=N,c+=O,x=Ge(g),g=fs(x)}}return $r({width:d,height:f,x:l,y:c})}function fa(e,t){const n=da(e).scrollLeft;return t?t.left+n:Vt(gt(e)).left+n}function rc(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-fa(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function Tg(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const s=a==="fixed",i=gt(r),o=t?ca(t.floating):!1;if(r===i||o&&s)return n;let l={scrollLeft:0,scrollTop:0},c=ft(1);const d=ft(0),f=ht(r);if((f||!f&&!s)&&((In(r)!=="body"||hr(i))&&(l=da(r)),ht(r))){const h=Vt(r);c=dn(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=i&&!f&&!s?rc(i,l):ft(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}}function xg(e){return Array.from(e.getClientRects())}function yg(e){const t=gt(e),n=da(e),r=e.ownerDocument.body,a=$e(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=$e(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+fa(e);const o=-n.scrollTop;return nt(r).direction==="rtl"&&(i+=$e(t.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:o}}const fo=25;function _g(e,t){const n=Ge(e),r=gt(e),a=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,o=0,l=0;if(a){s=a.width,i=a.height;const d=Zs();(!d||d&&t==="fixed")&&(o=a.offsetLeft,l=a.offsetTop)}const c=fa(r);if(c<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,x=Math.abs(r.clientWidth-f.clientWidth-h);x<=fo&&(s-=x)}else c<=fo&&(s+=c);return{width:s,height:i,x:o,y:l}}const Cg=new Set(["absolute","fixed"]);function Ag(e,t){const n=Vt(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,s=ht(e)?dn(e):ft(1),i=e.clientWidth*s.x,o=e.clientHeight*s.y,l=a*s.x,c=r*s.y;return{width:i,height:o,x:l,y:c}}function ho(e,t,n){let r;if(t==="viewport")r=_g(e,n);else if(t==="document")r=yg(gt(e));else if(tt(t))r=Ag(t,n);else{const a=nc(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return $r(r)}function ac(e,t){const n=Mt(e);return n===t||!tt(n)||gn(n)?!1:nt(n).position==="fixed"||ac(n,t)}function Sg(e,t){const n=t.get(e);if(n)return n;let r=rr(e,[],!1).filter(o=>tt(o)&&In(o)!=="body"),a=null;const s=nt(e).position==="fixed";let i=s?Mt(e):e;for(;tt(i)&&!gn(i);){const o=nt(i),l=Qs(i);!l&&o.position==="fixed"&&(a=null),(s?!l&&!a:!l&&o.position==="static"&&!!a&&Cg.has(a.position)||hr(i)&&!l&&ac(e,i))?r=r.filter(d=>d!==i):a=o,i=Mt(i)}return t.set(e,r),r}function Ig(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const i=[...n==="clippingAncestors"?ca(t)?[]:Sg(t,this._c):[].concat(n),r],o=i[0],l=i.reduce((c,d)=>{const f=ho(t,d,a);return c.top=$e(f.top,c.top),c.right=Dt(f.right,c.right),c.bottom=Dt(f.bottom,c.bottom),c.left=$e(f.left,c.left),c},ho(t,o,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ng(e){const{width:t,height:n}=tc(e);return{width:t,height:n}}function wg(e,t,n){const r=ht(t),a=gt(t),s=n==="fixed",i=Vt(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const l=ft(0);function c(){l.x=fa(a)}if(r||!r&&!s)if((In(t)!=="body"||hr(a))&&(o=da(t)),r){const h=Vt(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else a&&c();s&&!r&&a&&c();const d=a&&!r&&!s?rc(a,o):ft(0),f=i.left+o.scrollLeft-l.x-d.x,p=i.top+o.scrollTop-l.y-d.y;return{x:f,y:p,width:i.width,height:i.height}}function Da(e){return nt(e).position==="static"}function mo(e,t){if(!ht(e)||nt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return gt(e)===n&&(n=n.ownerDocument.body),n}function sc(e,t){const n=Ge(e);if(ca(e))return n;if(!ht(e)){let a=Mt(e);for(;a&&!gn(a);){if(tt(a)&&!Da(a))return a;a=Mt(a)}return n}let r=mo(e,t);for(;r&&cg(r)&&Da(r);)r=mo(r,t);return r&&gn(r)&&Da(r)&&!Qs(r)?n:r||pg(e)||n}const vg=async function(e){const t=this.getOffsetParent||sc,n=this.getDimensions,r=await n(e.floating);return{reference:wg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kg(e){return nt(e).direction==="rtl"}const Og={convertOffsetParentRelativeRectToViewportRelativeRect:Tg,getDocumentElement:gt,getClippingRect:Ig,getOffsetParent:sc,getElementRects:vg,getClientRects:xg,getDimensions:Ng,getScale:dn,isElement:tt,isRTL:kg};function ic(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rg(e,t){let n=null,r;const a=gt(e);function s(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function i(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:f,width:p,height:h}=c;if(o||t(),!p||!h)return;const x=wr(f),g=wr(a.clientWidth-(d+p)),A=wr(a.clientHeight-(f+h)),E=wr(d),N={rootMargin:-x+"px "+-g+"px "+-A+"px "+-E+"px",threshold:$e(0,Dt(1,l))||1};let O=!0;function k(w){const R=w[0].intersectionRatio;if(R!==l){if(!O)return i();R?i(!1,R):r=setTimeout(()=>{i(!1,1e-7)},1e3)}R===1&&!ic(c,e.getBoundingClientRect())&&i(),O=!1}try{n=new IntersectionObserver(k,{...N,root:a.ownerDocument})}catch{n=new IntersectionObserver(k,N)}n.observe(e)}return i(!0),s}function Lg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Js(e),d=a||s?[...c?rr(c):[],...rr(t)]:[];d.forEach(E=>{a&&E.addEventListener("scroll",n,{passive:!0}),s&&E.addEventListener("resize",n)});const f=c&&o?Rg(c,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(E=>{let[S]=E;S&&S.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var N;(N=h)==null||N.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let x,g=l?Vt(e):null;l&&A();function A(){const E=Vt(e);g&&!ic(g,E)&&n(),g=E,x=requestAnimationFrame(A)}return n(),()=>{var E;d.forEach(S=>{a&&S.removeEventListener("scroll",n),s&&S.removeEventListener("resize",n)}),f?.(),(E=h)==null||E.disconnect(),h=null,l&&cancelAnimationFrame(x)}}const Pg=ag,Dg=sg,Mg=tg,Bg=og,Fg=ng,po=eg,Hg=ig,Ug=(e,t,n)=>{const r=new Map,a={platform:Og,...n},s={...a.platform,_c:r};return Jp(e,t,{...a,platform:s})};var jg=typeof document<"u",zg=function(){},Mr=jg?D.useLayoutEffect:zg;function qr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!qr(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const s=a[r];if(!(s==="_owner"&&e.$$typeof)&&!qr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function oc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function go(e,t){const n=oc(e);return Math.round(t*n)/n}function Ma(e){const t=_.useRef(e);return Mr(()=>{t.current=e}),t}function Yg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:s,floating:i}={},transform:o=!0,whileElementsMounted:l,open:c}=e,[d,f]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=_.useState(r);qr(p,r)||h(r);const[x,g]=_.useState(null),[A,E]=_.useState(null),S=_.useCallback(B=>{B!==w.current&&(w.current=B,g(B))},[]),N=_.useCallback(B=>{B!==R.current&&(R.current=B,E(B))},[]),O=s||x,k=i||A,w=_.useRef(null),R=_.useRef(null),P=_.useRef(d),$=l!=null,X=Ma(l),U=Ma(a),Y=Ma(c),K=_.useCallback(()=>{if(!w.current||!R.current)return;const B={placement:t,strategy:n,middleware:p};U.current&&(B.platform=U.current),Ug(w.current,R.current,B).then(ae=>{const y={...ae,isPositioned:Y.current!==!1};F.current&&!qr(P.current,y)&&(P.current=y,ku.flushSync(()=>{f(y)}))})},[p,t,n,U,Y]);Mr(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(B=>({...B,isPositioned:!1})))},[c]);const F=_.useRef(!1);Mr(()=>(F.current=!0,()=>{F.current=!1}),[]),Mr(()=>{if(O&&(w.current=O),k&&(R.current=k),O&&k){if(X.current)return X.current(O,k,K);K()}},[O,k,K,X,$]);const H=_.useMemo(()=>({reference:w,floating:R,setReference:S,setFloating:N}),[S,N]),q=_.useMemo(()=>({reference:O,floating:k}),[O,k]),Q=_.useMemo(()=>{const B={position:n,left:0,top:0};if(!q.floating)return B;const ae=go(q.floating,d.x),y=go(q.floating,d.y);return o?{...B,transform:"translate("+ae+"px, "+y+"px)",...oc(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ae,top:y}},[n,o,q.floating,d.x,d.y]);return _.useMemo(()=>({...d,update:K,refs:H,elements:q,floatingStyles:Q}),[d,K,H,q,Q])}const Wg=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?po({element:r.current,padding:a}).fn(n):{}:r?po({element:r,padding:a}).fn(n):{}}}},Vg=(e,t)=>({...Pg(e),options:[e,t]}),$g=(e,t)=>({...Dg(e),options:[e,t]}),qg=(e,t)=>({...Hg(e),options:[e,t]}),Gg=(e,t)=>({...Mg(e),options:[e,t]}),Xg=(e,t)=>({...Bg(e),options:[e,t]}),Kg=(e,t)=>({...Fg(e),options:[e,t]}),Qg=(e,t)=>({...Wg(e),options:[e,t]});var Zg="Arrow",uc=_.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...s}=e;return m.jsx(Ne.svg,{...s,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});uc.displayName=Zg;var Jg=uc;function lc(e){const[t,n]=_.useState(void 0);return Pt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const s=a[0];let i,o;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,o=c.blockSize}else i=e.offsetWidth,o=e.offsetHeight;n({width:i,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ei="Popper",[cc,dc]=ra(ei),[e1,fc]=cc(ei),hc=e=>{const{__scopePopper:t,children:n}=e,[r,a]=_.useState(null);return m.jsx(e1,{scope:t,anchor:r,onAnchorChange:a,children:n})};hc.displayName=ei;var mc="PopperAnchor",pc=_.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,s=fc(mc,n),i=_.useRef(null),o=Xe(t,i),l=_.useRef(null);return _.useEffect(()=>{const c=l.current;l.current=r?.current||i.current,c!==l.current&&s.onAnchorChange(l.current)}),r?null:m.jsx(Ne.div,{...a,ref:o})});pc.displayName=mc;var ti="PopperContent",[t1,n1]=cc(ti),gc=_.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:s="center",alignOffset:i=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:x,...g}=e,A=fc(ti,n),[E,S]=_.useState(null),N=Xe(t,ce=>S(ce)),[O,k]=_.useState(null),w=lc(O),R=w?.width??0,P=w?.height??0,$=r+(s!=="center"?"-"+s:""),X=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},U=Array.isArray(c)?c:[c],Y=U.length>0,K={padding:X,boundary:U.filter(a1),altBoundary:Y},{refs:F,floatingStyles:H,placement:q,isPositioned:Q,middlewareData:B}=Yg({strategy:"fixed",placement:$,whileElementsMounted:(...ce)=>Lg(...ce,{animationFrame:h==="always"}),elements:{reference:A.anchor},middleware:[Vg({mainAxis:a+P,alignmentAxis:i}),l&&$g({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?qg():void 0,...K}),l&&Gg({...K}),Xg({...K,apply:({elements:ce,rects:Me,availableWidth:je,availableHeight:ze})=>{const{width:st,height:St}=Me.reference,Zt=ce.floating.style;Zt.setProperty("--radix-popper-available-width",`${je}px`),Zt.setProperty("--radix-popper-available-height",`${ze}px`),Zt.setProperty("--radix-popper-anchor-width",`${st}px`),Zt.setProperty("--radix-popper-anchor-height",`${St}px`)}}),O&&Qg({element:O,padding:o}),s1({arrowWidth:R,arrowHeight:P}),p&&Kg({strategy:"referenceHidden",...K})]}),[ae,y]=Tc(q),he=pn(x);Pt(()=>{Q&&he?.()},[Q,he]);const Te=B.arrow?.x,I=B.arrow?.y,de=B.arrow?.centerOffset!==0,[De,xe]=_.useState();return Pt(()=>{E&&xe(window.getComputedStyle(E).zIndex)},[E]),m.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:Q?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:De,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(t1,{scope:n,placedSide:ae,onArrowChange:k,arrowX:Te,arrowY:I,shouldHideArrow:de,children:m.jsx(Ne.div,{"data-side":ae,"data-align":y,...g,ref:N,style:{...g.style,animation:Q?void 0:"none"}})})})});gc.displayName=ti;var bc="PopperArrow",r1={top:"bottom",right:"left",bottom:"top",left:"right"},Ec=_.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,s=n1(bc,r),i=r1[s.placedSide];return m.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:m.jsx(Jg,{...a,ref:n,style:{...a.style,display:"block"}})})});Ec.displayName=bc;function a1(e){return e!==null}var s1=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,i=a.arrow?.centerOffset!==0,o=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,d]=Tc(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(a.arrow?.x??0)+o/2,h=(a.arrow?.y??0)+l/2;let x="",g="";return c==="bottom"?(x=i?f:`${p}px`,g=`${-l}px`):c==="top"?(x=i?f:`${p}px`,g=`${r.floating.height+l}px`):c==="right"?(x=`${-l}px`,g=i?f:`${h}px`):c==="left"&&(x=`${r.floating.width+l}px`,g=i?f:`${h}px`),{data:{x,y:g}}}});function Tc(e){const[t,n="center"]=e.split("-");return[t,n]}var i1=hc,xc=pc,o1=gc,u1=Ec;function l1(e){const t=c1(e),n=_.forwardRef((r,a)=>{const{children:s,...i}=r,o=_.Children.toArray(s),l=o.find(f1);if(l){const c=l.props.children,d=o.map(f=>f===l?_.Children.count(c)>1?_.Children.only(null):_.isValidElement(c)?c.props.children:null:f);return m.jsx(t,{...i,ref:a,children:_.isValidElement(c)?_.cloneElement(c,void 0,d):null})}return m.jsx(t,{...i,ref:a,children:s})});return n.displayName=`${e}.Slot`,n}function c1(e){const t=_.forwardRef((n,r)=>{const{children:a,...s}=n;if(_.isValidElement(a)){const i=m1(a),o=h1(s,a.props);return a.type!==_.Fragment&&(o.ref=r?na(r,i):i),_.cloneElement(a,o)}return _.Children.count(a)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var d1=Symbol("radix.slottable");function f1(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===d1}function h1(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...o)=>{const l=s(...o);return a(...o),l}:a&&(n[r]=a):r==="style"?n[r]={...a,...s}:r==="className"&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}function m1(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ha="Popover",[yc]=ra(ha,[dc]),mr=dc(),[p1,Gt]=yc(ha),ni=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:s,modal:i=!1}=e,o=mr(t),l=_.useRef(null),[c,d]=_.useState(!1),[f,p]=Rs({prop:r,defaultProp:a??!1,onChange:s,caller:ha});return m.jsx(i1,{...o,children:m.jsx(p1,{scope:t,contentId:Lr(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:_.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:c,onCustomAnchorAdd:_.useCallback(()=>d(!0),[]),onCustomAnchorRemove:_.useCallback(()=>d(!1),[]),modal:i,children:n})})};ni.displayName=ha;var _c="PopoverAnchor",g1=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Gt(_c,n),s=mr(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:o}=a;return _.useEffect(()=>(i(),()=>o()),[i,o]),m.jsx(xc,{...s,...r,ref:t})});g1.displayName=_c;var Cc="PopoverTrigger",ri=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Gt(Cc,n),s=mr(n),i=Xe(t,a.triggerRef),o=m.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ic(a.open),...r,ref:i,onClick:Le(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?o:m.jsx(xc,{asChild:!0,...s,children:o})});ri.displayName=Cc;var b1="PopoverPortal",[yA,E1]=yc(b1,{forceMount:void 0}),bn="PopoverContent",ai=_.forwardRef((e,t)=>{const n=E1(bn,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,s=Gt(bn,e.__scopePopover);return m.jsx(_n,{present:r||s.open,children:s.modal?m.jsx(x1,{...a,ref:t}):m.jsx(y1,{...a,ref:t})})});ai.displayName=bn;var T1=l1("PopoverContent.RemoveScroll"),x1=_.forwardRef((e,t)=>{const n=Gt(bn,e.__scopePopover),r=_.useRef(null),a=Xe(t,r),s=_.useRef(!1);return _.useEffect(()=>{const i=r.current;if(i)return al(i)},[]),m.jsx(Ds,{as:T1,allowPinchZoom:!0,children:m.jsx(Ac,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Le(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Le(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0,c=o.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Le(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),y1=_.forwardRef((e,t)=>{const n=Gt(bn,e.__scopePopover),r=_.useRef(!1),a=_.useRef(!1);return m.jsx(Ac,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&a.current&&s.preventDefault()}})}),Ac=_.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...f}=e,p=Gt(bn,n),h=mr(n);return Xu(),m.jsx(Ps,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:s,children:m.jsx(Ls,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:m.jsx(o1,{"data-state":Ic(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)"}})})})}),Sc="PopoverClose",_1=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Gt(Sc,n);return m.jsx(Ne.button,{type:"button",...r,ref:t,onClick:Le(e.onClick,()=>a.onOpenChange(!1))})});_1.displayName=Sc;var C1="PopoverArrow",A1=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=mr(n);return m.jsx(u1,{...a,...r,ref:t})});A1.displayName=C1;function Ic(e){return e?"open":"closed"}var Nc=ni,wc=ri,vc=ai;function bo(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const i=n.slice(a,r).trim();(i||!s)&&t.push(i),a=r+1,r=n.indexOf(",",a)}return t}function kc(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const S1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,I1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N1={};function Eo(e,t){return(N1.jsx?I1:S1).test(e)}const w1=/[ \t\n\f\r]/g;function v1(e){return typeof e=="object"?e.type==="text"?To(e.value):!1:To(e)}function To(e){return e.replace(w1,"")===""}let pr=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};pr.prototype.normal={};pr.prototype.property={};pr.prototype.space=void 0;function Oc(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new pr(n,r,t)}function ar(e){return e.toLowerCase()}let Ue=class{constructor(t,n){this.attribute=n,this.property=t}};Ue.prototype.attribute="";Ue.prototype.booleanish=!1;Ue.prototype.boolean=!1;Ue.prototype.commaOrSpaceSeparated=!1;Ue.prototype.commaSeparated=!1;Ue.prototype.defined=!1;Ue.prototype.mustUseProperty=!1;Ue.prototype.number=!1;Ue.prototype.overloadedBoolean=!1;Ue.prototype.property="";Ue.prototype.spaceSeparated=!1;Ue.prototype.space=void 0;let k1=0;const re=Xt(),_e=Xt(),hs=Xt(),W=Xt(),pe=Xt(),fn=Xt(),We=Xt();function Xt(){return 2**++k1}const ms=Object.freeze(Object.defineProperty({__proto__:null,boolean:re,booleanish:_e,commaOrSpaceSeparated:We,commaSeparated:fn,number:W,overloadedBoolean:hs,spaceSeparated:pe},Symbol.toStringTag,{value:"Module"})),Ba=Object.keys(ms);let si=class extends Ue{constructor(t,n,r,a){let s=-1;if(super(t,n),xo(this,"space",a),typeof r=="number")for(;++s<Ba.length;){const i=Ba[s];xo(this,Ba[s],(r&ms[i])===ms[i])}}};si.prototype.defined=!0;function xo(e,t,n){n&&(e[t]=n)}function Nn(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const s=new si(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[ar(r)]=r,n[ar(s.attribute)]=r}return new pr(t,n,e.space)}const Rc=Nn({properties:{ariaActiveDescendant:null,ariaAtomic:_e,ariaAutoComplete:null,ariaBusy:_e,ariaChecked:_e,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:pe,ariaCurrent:null,ariaDescribedBy:pe,ariaDetails:null,ariaDisabled:_e,ariaDropEffect:pe,ariaErrorMessage:null,ariaExpanded:_e,ariaFlowTo:pe,ariaGrabbed:_e,ariaHasPopup:null,ariaHidden:_e,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pe,ariaLevel:W,ariaLive:null,ariaModal:_e,ariaMultiLine:_e,ariaMultiSelectable:_e,ariaOrientation:null,ariaOwns:pe,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:_e,ariaReadOnly:_e,ariaRelevant:null,ariaRequired:_e,ariaRoleDescription:pe,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:_e,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Lc(e,t){return t in e?e[t]:t}function Pc(e,t){return Lc(e,t.toLowerCase())}const O1=Nn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fn,acceptCharset:pe,accessKey:pe,action:null,allow:null,allowFullScreen:re,allowPaymentRequest:re,allowUserMedia:re,alt:null,as:null,async:re,autoCapitalize:null,autoComplete:pe,autoFocus:re,autoPlay:re,blocking:pe,capture:null,charSet:null,checked:re,cite:null,className:pe,cols:W,colSpan:null,content:null,contentEditable:_e,controls:re,controlsList:pe,coords:W|fn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:re,defer:re,dir:null,dirName:null,disabled:re,download:hs,draggable:_e,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:re,formTarget:null,headers:pe,height:W,hidden:hs,high:W,href:null,hrefLang:null,htmlFor:pe,httpEquiv:pe,id:null,imageSizes:null,imageSrcSet:null,inert:re,inputMode:null,integrity:null,is:null,isMap:re,itemId:null,itemProp:pe,itemRef:pe,itemScope:re,itemType:pe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:re,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:re,muted:re,name:null,nonce:null,noModule:re,noValidate:re,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:re,optimum:W,pattern:null,ping:pe,placeholder:null,playsInline:re,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:re,referrerPolicy:null,rel:pe,required:re,reversed:re,rows:W,rowSpan:W,sandbox:pe,scope:null,scoped:re,seamless:re,selected:re,shadowRootClonable:re,shadowRootDelegatesFocus:re,shadowRootMode:null,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:_e,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:re,useMap:null,value:_e,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pe,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:re,declare:re,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:re,noHref:re,noShade:re,noWrap:re,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:_e,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:re,disableRemotePlayback:re,prefix:null,property:null,results:W,security:null,unselectable:null},space:"html",transform:Pc}),R1=Nn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:We,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:pe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:re,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fn,g2:fn,glyphName:fn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:We,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:W,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:pe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:We,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:We,rev:We,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:We,requiredFeatures:We,requiredFonts:We,requiredFormats:We,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:We,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:We,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:We,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Lc}),Dc=Nn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Mc=Nn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Pc}),Bc=Nn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),L1={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},P1=/[A-Z]/g,yo=/-[a-z]/g,D1=/^data[-\w.:]+$/i;function ii(e,t){const n=ar(t);let r=t,a=Ue;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&D1.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(yo,B1);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!yo.test(s)){let i=s.replace(P1,M1);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}a=si}return new a(r,t)}function M1(e){return"-"+e.toLowerCase()}function B1(e){return e.charAt(1).toUpperCase()}const ma=Oc([Rc,O1,Dc,Mc,Bc],"html"),wn=Oc([Rc,R1,Dc,Mc,Bc],"svg");function _o(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Fc(e){return e.join(" ").trim()}var sn={},Fa,Co;function F1(){if(Co)return Fa;Co=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,o=/^\s+|\s+$/g,l=`
|
|
62
62
|
`,c="/",d="*",f="",p="comment",h="declaration";function x(A,E){if(typeof A!="string")throw new TypeError("First argument must be a string");if(!A)return[];E=E||{};var S=1,N=1;function O(F){var H=F.match(t);H&&(S+=H.length);var q=F.lastIndexOf(l);N=~q?F.length-q:N+F.length}function k(){var F={line:S,column:N};return function(H){return H.position=new w(F),$(),H}}function w(F){this.start=F,this.end={line:S,column:N},this.source=E.source}w.prototype.content=A;function R(F){var H=new Error(E.source+":"+S+":"+N+": "+F);if(H.reason=F,H.filename=E.source,H.line=S,H.column=N,H.source=A,!E.silent)throw H}function P(F){var H=F.exec(A);if(H){var q=H[0];return O(q),A=A.slice(q.length),H}}function $(){P(n)}function X(F){var H;for(F=F||[];H=U();)H!==!1&&F.push(H);return F}function U(){var F=k();if(!(c!=A.charAt(0)||d!=A.charAt(1))){for(var H=2;f!=A.charAt(H)&&(d!=A.charAt(H)||c!=A.charAt(H+1));)++H;if(H+=2,f===A.charAt(H-1))return R("End of comment missing");var q=A.slice(2,H-2);return N+=2,O(q),A=A.slice(H),N+=2,F({type:p,comment:q})}}function Y(){var F=k(),H=P(r);if(H){if(U(),!P(a))return R("property missing ':'");var q=P(s),Q=F({type:h,property:g(H[0].replace(e,f)),value:q?g(q[0].replace(e,f)):f});return P(i),Q}}function K(){var F=[];X(F);for(var H;H=Y();)H!==!1&&(F.push(H),X(F));return F}return $(),K()}function g(A){return A?A.replace(o,f):f}return Fa=x,Fa}var Ao;function H1(){if(Ao)return sn;Ao=1;var e=sn&&sn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(sn,"__esModule",{value:!0}),sn.default=n;const t=e(F1());function n(r,a){let s=null;if(!r||typeof r!="string")return s;const i=(0,t.default)(r),o=typeof a=="function";return i.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:d}=l;o?a(c,d,l):d&&(s=s||{},s[c]=d)}),s}return sn}var Bn={},So;function U1(){if(So)return Bn;So=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},i=function(c,d){return d.toUpperCase()},o=function(c,d){return"".concat(d,"-")},l=function(c,d){return d===void 0&&(d={}),s(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(a,o):c=c.replace(r,o),c.replace(t,i))};return Bn.camelCase=l,Bn}var Fn,Io;function j1(){if(Io)return Fn;Io=1;var e=Fn&&Fn.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(H1()),n=U1();function r(a,s){var i={};return!a||typeof a!="string"||(0,t.default)(a,function(o,l){o&&l&&(i[(0,n.camelCase)(o,s)]=l)}),i}return r.default=r,Fn=r,Fn}var z1=j1();const Y1=Ou(z1),pa=Hc("end"),bt=Hc("start");function Hc(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function W1(e){const t=bt(e),n=pa(e);if(t&&n)return{start:t,end:n}}function qn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?No(e.position):"start"in e||"end"in e?No(e):"line"in e||"column"in e?ps(e):""}function ps(e){return wo(e&&e.line)+":"+wo(e&&e.column)}function No(e){return ps(e&&e.start)+"-"+ps(e&&e.end)}function wo(e){return e&&typeof e=="number"?e:1}class we extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",s={},i=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?a=t:!s.cause&&t&&(i=!0,a=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=o?o.line:void 0,this.name=qn(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=i&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}we.prototype.file="";we.prototype.name="";we.prototype.reason="";we.prototype.message="";we.prototype.stack="";we.prototype.column=void 0;we.prototype.line=void 0;we.prototype.ancestors=void 0;we.prototype.cause=void 0;we.prototype.fatal=void 0;we.prototype.place=void 0;we.prototype.ruleId=void 0;we.prototype.source=void 0;const oi={}.hasOwnProperty,V1=new Map,$1=/[A-Z]/g,q1=new Set(["table","tbody","thead","tfoot","tr"]),G1=new Set(["td","th"]),Uc="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function X1(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=rb(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=nb(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?wn:ma,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=jc(a,e,void 0);return s&&typeof s!="string"?s:a.create(e,a.Fragment,{children:s||void 0},void 0)}function jc(e,t,n){if(t.type==="element")return K1(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Q1(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return J1(e,t,n);if(t.type==="mdxjsEsm")return Z1(e,t);if(t.type==="root")return eb(e,t,n);if(t.type==="text")return tb(e,t)}function K1(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=wn,e.schema=a),e.ancestors.push(t);const s=Yc(e,t.tagName,!1),i=ab(e,t);let o=li(e,t);return q1.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!v1(l):!0})),zc(e,i,s,t),ui(i,o),e.ancestors.pop(),e.schema=r,e.create(t,s,i,n)}function Q1(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}sr(e,t.position)}function Z1(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);sr(e,t.position)}function J1(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=wn,e.schema=a),e.ancestors.push(t);const s=t.name===null?e.Fragment:Yc(e,t.name,!0),i=sb(e,t),o=li(e,t);return zc(e,i,s,t),ui(i,o),e.ancestors.pop(),e.schema=r,e.create(t,s,i,n)}function eb(e,t,n){const r={};return ui(r,li(e,t)),e.create(t,e.Fragment,r,n)}function tb(e,t){return t.value}function zc(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ui(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function nb(e,t,n){return r;function r(a,s,i,o){const c=Array.isArray(i.children)?n:t;return o?c(s,i,o):c(s,i)}}function rb(e,t){return n;function n(r,a,s,i){const o=Array.isArray(s.children),l=bt(r);return t(a,s,i,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function ab(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&oi.call(t.properties,a)){const s=ib(e,a,t.properties[a]);if(s){const[i,o]=s;e.tableCellAlignToStyle&&i==="align"&&typeof o=="string"&&G1.has(t.tagName)?r=o:n[i]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function sb(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const i=s.expression;i.type;const o=i.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else sr(e,t.position);else{const a=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else sr(e,t.position);else s=r.value===null?!0:r.value;n[a]=s}return n}function li(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:V1;for(;++r<t.children.length;){const s=t.children[r];let i;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=a.get(l)||0;i=l+"-"+c,a.set(l,c+1)}}const o=jc(e,s,i);o!==void 0&&n.push(o)}return n}function ib(e,t,n){const r=ii(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?kc(n):Fc(n)),r.property==="style"){let a=typeof n=="object"?n:ob(e,String(n));return e.stylePropertyNameCase==="css"&&(a=ub(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?L1[r.property]||r.property:r.attribute,n]}}function ob(e,t){try{return Y1(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new we("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Uc+"#cannot-parse-style-attribute",a}}function Yc(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let s=-1,i;for(;++s<a.length;){const o=Eo(a[s])?{type:"Identifier",name:a[s]}:{type:"Literal",value:a[s]};i=i?{type:"MemberExpression",object:i,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=i}else r=Eo(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return oi.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);sr(e)}function sr(e,t){const n=new we("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Uc+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ub(e){const t={};let n;for(n in e)oi.call(e,n)&&(t[lb(n)]=e[n]);return t}function lb(e){let t=e.replace($1,cb);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function cb(e){return"-"+e.toLowerCase()}const Ha={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},db={};function fb(e,t){const n=db,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Wc(e,r,a)}function Wc(e,t,n){if(hb(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return vo(e.children,t,n)}return Array.isArray(e)?vo(e,t,n):""}function vo(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=Wc(e[a],t,n);return r.join("")}function hb(e){return!!(e&&typeof e=="object")}const ko=document.createElement("i");function ci(e){const t="&"+e+";";ko.innerHTML=t;const n=ko.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function mt(e,t,n,r){const a=e.length;let s=0,i;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);s<r.length;)i=r.slice(s,s+1e4),i.unshift(t,0),e.splice(...i),s+=1e4,t+=1e4}function Ke(e,t){return e.length>0?(mt(e,e.length,0,t),e):t}const Oo={}.hasOwnProperty;function mb(e){const t={};let n=-1;for(;++n<e.length;)pb(t,e[n]);return t}function pb(e,t){let n;for(n in t){const a=(Oo.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let i;if(s)for(i in s){Oo.call(a,i)||(a[i]=[]);const o=s[i];gb(a[i],Array.isArray(o)?o:o?[o]:[])}}}function gb(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);mt(e,0,0,r)}function Vc(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function hn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lt=Bt(/[A-Za-z]/),qe=Bt(/[\dA-Za-z]/),bb=Bt(/[#-'*+\--9=?A-Z^-~]/);function gs(e){return e!==null&&(e<32||e===127)}const bs=Bt(/\d/),Eb=Bt(/[\dA-Fa-f]/),Tb=Bt(/[!-/:-@[-`{-~]/);function ee(e){return e!==null&&e<-2}function He(e){return e!==null&&(e<0||e===32)}function le(e){return e===-2||e===-1||e===32}const xb=Bt(new RegExp("\\p{P}|\\p{S}","u")),yb=Bt(/\s/);function Bt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function vn(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const s=e.charCodeAt(n);let i="";if(s===37&&qe(e.charCodeAt(n+1))&&qe(e.charCodeAt(n+2)))a=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(i=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(i=String.fromCharCode(s,o),a=1):i="�"}else i=String.fromCharCode(s);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+a+1,i=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function be(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let s=0;return i;function i(l){return le(l)?(e.enter(n),o(l)):t(l)}function o(l){return le(l)&&s++<a?(e.consume(l),o):(e.exit(n),t(l))}}const _b={tokenize:Cb};function Cb(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),be(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),s(o)}function s(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,i(o)}function i(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return ee(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),i)}}const Ab={tokenize:Sb},Ro={tokenize:Ib};function Sb(e){const t=this,n=[];let r=0,a,s,i;return o;function o(N){if(r<n.length){const O=n[r];return t.containerState=O[1],e.attempt(O[0].continuation,l,c)(N)}return c(N)}function l(N){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&S();const O=t.events.length;let k=O,w;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){w=t.events[k][1].end;break}E(r);let R=O;for(;R<t.events.length;)t.events[R][1].end={...w},R++;return mt(t.events,k+1,0,t.events.slice(O)),t.events.length=R,c(N)}return o(N)}function c(N){if(r===n.length){if(!a)return p(N);if(a.currentConstruct&&a.currentConstruct.concrete)return x(N);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ro,d,f)(N)}function d(N){return a&&S(),E(r),p(N)}function f(N){return t.parser.lazy[t.now().line]=r!==n.length,i=t.now().offset,x(N)}function p(N){return t.containerState={},e.attempt(Ro,h,x)(N)}function h(N){return r++,n.push([t.currentConstruct,t.containerState]),p(N)}function x(N){if(N===null){a&&S(),E(0),e.consume(N);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:s}),g(N)}function g(N){if(N===null){A(e.exit("chunkFlow"),!0),E(0),e.consume(N);return}return ee(N)?(e.consume(N),A(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(N),g)}function A(N,O){const k=t.sliceStream(N);if(O&&k.push(null),N.previous=s,s&&(s.next=N),s=N,a.defineSkip(N.start),a.write(k),t.parser.lazy[N.start.line]){let w=a.events.length;for(;w--;)if(a.events[w][1].start.offset<i&&(!a.events[w][1].end||a.events[w][1].end.offset>i))return;const R=t.events.length;let P=R,$,X;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if($){X=t.events[P][1].end;break}$=!0}for(E(r),w=R;w<t.events.length;)t.events[w][1].end={...X},w++;mt(t.events,P+1,0,t.events.slice(R)),t.events.length=w}}function E(N){let O=n.length;for(;O-- >N;){const k=n[O];t.containerState=k[1],k[0].exit.call(t,e)}n.length=N}function S(){a.write([null]),s=void 0,a=void 0,t.containerState._closeFlow=void 0}}function Ib(e,t,n){return be(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Lo(e){if(e===null||He(e)||yb(e))return 1;if(xb(e))return 2}function di(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const s=e[a].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Es={name:"attention",resolveAll:Nb,tokenize:wb};function Nb(e,t){let n=-1,r,a,s,i,o,l,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},p={...e[n][1].start};Po(f,-l),Po(p,l),i={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:l>1?"strong":"emphasis",start:{...i.start},end:{...o.end}},e[r][1].end={...i.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ke(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ke(c,[["enter",a,t],["enter",i,t],["exit",i,t],["enter",s,t]]),c=Ke(c,di(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Ke(c,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=Ke(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,mt(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function wb(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Lo(r);let s;return i;function i(l){return s=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===s)return e.consume(l),o;const c=e.exit("attentionSequence"),d=Lo(l),f=!d||d===2&&a||n.includes(l),p=!a||a===2&&d||n.includes(r);return c._open=!!(s===42?f:f&&(a||!p)),c._close=!!(s===42?p:p&&(d||!f)),t(l)}}function Po(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const vb={name:"autolink",tokenize:kb};function kb(e,t,n){let r=0;return a;function a(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(h){return lt(h)?(e.consume(h),i):h===64?n(h):c(h)}function i(h){return h===43||h===45||h===46||qe(h)?(r=1,o(h)):c(h)}function o(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||qe(h))&&r++<32?(e.consume(h),o):(r=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||gs(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),d):bb(h)?(e.consume(h),c):n(h)}function d(h){return qe(h)?f(h):n(h)}function f(h){return h===46?(e.consume(h),r=0,d):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||qe(h))&&r++<63){const x=h===45?p:f;return e.consume(h),x}return n(h)}}const ga={partial:!0,tokenize:Ob};function Ob(e,t,n){return r;function r(s){return le(s)?be(e,a,"linePrefix")(s):a(s)}function a(s){return s===null||ee(s)?t(s):n(s)}}const $c={continuation:{tokenize:Lb},exit:Pb,name:"blockQuote",tokenize:Rb};function Rb(e,t,n){const r=this;return a;function a(i){if(i===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),s}return n(i)}function s(i){return le(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function Lb(e,t,n){const r=this;return a;function a(i){return le(i)?be(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):s(i)}function s(i){return e.attempt($c,t,n)(i)}}function Pb(e){e.exit("blockQuote")}const qc={name:"characterEscape",tokenize:Db};function Db(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),a}function a(s){return Tb(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Gc={name:"characterReference",tokenize:Mb};function Mb(e,t,n){const r=this;let a=0,s,i;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,i=qe,d(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,i=Eb,d):(e.enter("characterReferenceValue"),s=7,i=bs,d(f))}function d(f){if(f===59&&a){const p=e.exit("characterReferenceValue");return i===qe&&!ci(r.sliceSerialize(p))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(f)&&a++<s?(e.consume(f),d):n(f)}}const Do={partial:!0,tokenize:Fb},Mo={concrete:!0,name:"codeFenced",tokenize:Bb};function Bb(e,t,n){const r=this,a={partial:!0,tokenize:k};let s=0,i=0,o;return l;function l(w){return c(w)}function c(w){const R=r.events[r.events.length-1];return s=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,o=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(w)}function d(w){return w===o?(i++,e.consume(w),d):i<3?n(w):(e.exit("codeFencedFenceSequence"),le(w)?be(e,f,"whitespace")(w):f(w))}function f(w){return w===null||ee(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(Do,g,O)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||ee(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(w)):le(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),be(e,h,"whitespace")(w)):w===96&&w===o?n(w):(e.consume(w),p)}function h(w){return w===null||ee(w)?f(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(w))}function x(w){return w===null||ee(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(w)):w===96&&w===o?n(w):(e.consume(w),x)}function g(w){return e.attempt(a,O,A)(w)}function A(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),E}function E(w){return s>0&&le(w)?be(e,S,"linePrefix",s+1)(w):S(w)}function S(w){return w===null||ee(w)?e.check(Do,g,O)(w):(e.enter("codeFlowValue"),N(w))}function N(w){return w===null||ee(w)?(e.exit("codeFlowValue"),S(w)):(e.consume(w),N)}function O(w){return e.exit("codeFenced"),t(w)}function k(w,R,P){let $=0;return X;function X(H){return w.enter("lineEnding"),w.consume(H),w.exit("lineEnding"),U}function U(H){return w.enter("codeFencedFence"),le(H)?be(w,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):Y(H)}function Y(H){return H===o?(w.enter("codeFencedFenceSequence"),K(H)):P(H)}function K(H){return H===o?($++,w.consume(H),K):$>=i?(w.exit("codeFencedFenceSequence"),le(H)?be(w,F,"whitespace")(H):F(H)):P(H)}function F(H){return H===null||ee(H)?(w.exit("codeFencedFence"),R(H)):P(H)}}}function Fb(e,t,n){const r=this;return a;function a(i){return i===null?n(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s)}function s(i){return r.parser.lazy[r.now().line]?n(i):t(i)}}const Ua={name:"codeIndented",tokenize:Ub},Hb={partial:!0,tokenize:jb};function Ub(e,t,n){const r=this;return a;function a(c){return e.enter("codeIndented"),be(e,s,"linePrefix",5)(c)}function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?i(c):n(c)}function i(c){return c===null?l(c):ee(c)?e.attempt(Hb,i,l)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||ee(c)?(e.exit("codeFlowValue"),i(c)):(e.consume(c),o)}function l(c){return e.exit("codeIndented"),t(c)}}function jb(e,t,n){const r=this;return a;function a(i){return r.parser.lazy[r.now().line]?n(i):ee(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a):be(e,s,"linePrefix",5)(i)}function s(i){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(i):ee(i)?a(i):n(i)}}const zb={name:"codeText",previous:Wb,resolve:Yb,tokenize:Vb};function Yb(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function Wb(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Vb(e,t,n){let r=0,a,s;return i;function i(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),r++,o):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(s=e.enter("codeTextSequence"),a=0,d(f)):ee(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||ee(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function d(f){return f===96?(e.consume(f),a++,d):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",c(f))}}class $b{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Hn(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Hn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Hn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Hn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Hn(this.left,n.reverse())}}}function Hn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Xc(e){const t={};let n=-1,r,a,s,i,o,l,c;const d=new $b(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,qb(d,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,a=void 0;s--;)if(i=d.get(s),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(a&&(d.get(a)[1].type="lineEndingBlank"),i[1].type="lineEnding",a=s);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;a&&(r[1].end={...d.get(a)[1].start},o=d.slice(a,n),o.unshift(r),d.splice(a,n-a+1,o))}}return mt(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function qb(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const s=[];let i=n._tokenizer;i||(i=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));const o=i.events,l=[],c={};let d,f,p=-1,h=n,x=0,g=0;const A=[g];for(;h;){for(;e.get(++a)[1]!==h;);s.push(a),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),f&&i.defineSkip(h.start),h._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(d),h._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<o.length;)o[p][0]==="exit"&&o[p-1][0]==="enter"&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(g=p+1,A.push(g),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(i.events=[],h?(h._tokenizer=void 0,h.previous=void 0):A.pop(),p=A.length;p--;){const E=o.slice(A[p],A[p+1]),S=s.pop();l.push([S,S+E.length-1]),e.splice(S,2,E)}for(l.reverse(),p=-1;++p<l.length;)c[x+l[p][0]]=x+l[p][1],x+=l[p][1]-l[p][0]-1;return c}const Gb={resolve:Kb,tokenize:Qb},Xb={partial:!0,tokenize:Zb};function Kb(e){return Xc(e),e}function Qb(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?s(o):ee(o)?e.check(Xb,i,s)(o):(e.consume(o),a)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function i(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function Zb(e,t,n){const r=this;return a;function a(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),be(e,s,"linePrefix")}function s(i){if(i===null||ee(i))return n(i);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Kc(e,t,n,r,a,s,i,o,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(E){return E===60?(e.enter(r),e.enter(a),e.enter(s),e.consume(E),e.exit(s),p):E===null||E===32||E===41||gs(E)?n(E):(e.enter(r),e.enter(i),e.enter(o),e.enter("chunkString",{contentType:"string"}),g(E))}function p(E){return E===62?(e.enter(s),e.consume(E),e.exit(s),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===62?(e.exit("chunkString"),e.exit(o),p(E)):E===null||E===60||ee(E)?n(E):(e.consume(E),E===92?x:h)}function x(E){return E===60||E===62||E===92?(e.consume(E),h):h(E)}function g(E){return!d&&(E===null||E===41||He(E))?(e.exit("chunkString"),e.exit(o),e.exit(i),e.exit(r),t(E)):d<c&&E===40?(e.consume(E),d++,g):E===41?(e.consume(E),d--,g):E===null||E===32||E===40||gs(E)?n(E):(e.consume(E),E===92?A:g)}function A(E){return E===40||E===41||E===92?(e.consume(E),g):g(E)}}function Qc(e,t,n,r,a,s){const i=this;let o=0,l;return c;function c(h){return e.enter(r),e.enter(a),e.consume(h),e.exit(a),e.enter(s),d}function d(h){return o>999||h===null||h===91||h===93&&!l||h===94&&!o&&"_hiddenFootnoteSupport"in i.parser.constructs?n(h):h===93?(e.exit(s),e.enter(a),e.consume(h),e.exit(a),e.exit(r),t):ee(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||ee(h)||o++>999?(e.exit("chunkString"),d(h)):(e.consume(h),l||(l=!le(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(e.consume(h),o++,f):f(h)}}function Zc(e,t,n,r,a,s){let i;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(a),e.consume(p),e.exit(a),i=p===40?41:p,l):n(p)}function l(p){return p===i?(e.enter(a),e.consume(p),e.exit(a),e.exit(r),t):(e.enter(s),c(p))}function c(p){return p===i?(e.exit(s),l(i)):p===null?n(p):ee(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),be(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===i||p===null||ee(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?f:d)}function f(p){return p===i||p===92?(e.consume(p),d):d(p)}}function Gn(e,t){let n;return r;function r(a){return ee(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):le(a)?be(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const Jb={name:"definition",tokenize:tE},eE={partial:!0,tokenize:nE};function tE(e,t,n){const r=this;let a;return s;function s(h){return e.enter("definition"),i(h)}function i(h){return Qc.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function o(h){return a=hn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return He(h)?Gn(e,c)(h):c(h)}function c(h){return Kc(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(eE,f,f)(h)}function f(h){return le(h)?be(e,p,"whitespace")(h):p(h)}function p(h){return h===null||ee(h)?(e.exit("definition"),r.parser.defined.push(a),t(h)):n(h)}}function nE(e,t,n){return r;function r(o){return He(o)?Gn(e,a)(o):n(o)}function a(o){return Zc(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return le(o)?be(e,i,"whitespace")(o):i(o)}function i(o){return o===null||ee(o)?t(o):n(o)}}const rE={name:"hardBreakEscape",tokenize:aE};function aE(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),a}function a(s){return ee(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const sE={name:"headingAtx",resolve:iE,tokenize:oE};function iE(e,t){let n=e.length-2,r=3,a,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},mt(e,r,n-r+1,[["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t]])),e}function oE(e,t,n){let r=0;return a;function a(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),i(d)}function i(d){return d===35&&r++<6?(e.consume(d),i):d===null||He(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||ee(d)?(e.exit("atxHeading"),t(d)):le(d)?be(e,o,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function c(d){return d===null||d===35||He(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),c)}}const uE=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Bo=["pre","script","style","textarea"],lE={concrete:!0,name:"htmlFlow",resolveTo:fE,tokenize:hE},cE={partial:!0,tokenize:pE},dE={partial:!0,tokenize:mE};function fE(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function hE(e,t,n){const r=this;let a,s,i,o,l;return c;function c(I){return d(I)}function d(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),p):I===47?(e.consume(I),s=!0,g):I===63?(e.consume(I),a=3,r.interrupt?t:y):lt(I)?(e.consume(I),i=String.fromCharCode(I),A):n(I)}function p(I){return I===45?(e.consume(I),a=2,h):I===91?(e.consume(I),a=5,o=0,x):lt(I)?(e.consume(I),a=4,r.interrupt?t:y):n(I)}function h(I){return I===45?(e.consume(I),r.interrupt?t:y):n(I)}function x(I){const de="CDATA[";return I===de.charCodeAt(o++)?(e.consume(I),o===de.length?r.interrupt?t:Y:x):n(I)}function g(I){return lt(I)?(e.consume(I),i=String.fromCharCode(I),A):n(I)}function A(I){if(I===null||I===47||I===62||He(I)){const de=I===47,De=i.toLowerCase();return!de&&!s&&Bo.includes(De)?(a=1,r.interrupt?t(I):Y(I)):uE.includes(i.toLowerCase())?(a=6,de?(e.consume(I),E):r.interrupt?t(I):Y(I)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):s?S(I):N(I))}return I===45||qe(I)?(e.consume(I),i+=String.fromCharCode(I),A):n(I)}function E(I){return I===62?(e.consume(I),r.interrupt?t:Y):n(I)}function S(I){return le(I)?(e.consume(I),S):X(I)}function N(I){return I===47?(e.consume(I),X):I===58||I===95||lt(I)?(e.consume(I),O):le(I)?(e.consume(I),N):X(I)}function O(I){return I===45||I===46||I===58||I===95||qe(I)?(e.consume(I),O):k(I)}function k(I){return I===61?(e.consume(I),w):le(I)?(e.consume(I),k):N(I)}function w(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),l=I,R):le(I)?(e.consume(I),w):P(I)}function R(I){return I===l?(e.consume(I),l=null,$):I===null||ee(I)?n(I):(e.consume(I),R)}function P(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||He(I)?k(I):(e.consume(I),P)}function $(I){return I===47||I===62||le(I)?N(I):n(I)}function X(I){return I===62?(e.consume(I),U):n(I)}function U(I){return I===null||ee(I)?Y(I):le(I)?(e.consume(I),U):n(I)}function Y(I){return I===45&&a===2?(e.consume(I),q):I===60&&a===1?(e.consume(I),Q):I===62&&a===4?(e.consume(I),he):I===63&&a===3?(e.consume(I),y):I===93&&a===5?(e.consume(I),ae):ee(I)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(cE,Te,K)(I)):I===null||ee(I)?(e.exit("htmlFlowData"),K(I)):(e.consume(I),Y)}function K(I){return e.check(dE,F,Te)(I)}function F(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),H}function H(I){return I===null||ee(I)?K(I):(e.enter("htmlFlowData"),Y(I))}function q(I){return I===45?(e.consume(I),y):Y(I)}function Q(I){return I===47?(e.consume(I),i="",B):Y(I)}function B(I){if(I===62){const de=i.toLowerCase();return Bo.includes(de)?(e.consume(I),he):Y(I)}return lt(I)&&i.length<8?(e.consume(I),i+=String.fromCharCode(I),B):Y(I)}function ae(I){return I===93?(e.consume(I),y):Y(I)}function y(I){return I===62?(e.consume(I),he):I===45&&a===2?(e.consume(I),y):Y(I)}function he(I){return I===null||ee(I)?(e.exit("htmlFlowData"),Te(I)):(e.consume(I),he)}function Te(I){return e.exit("htmlFlow"),t(I)}}function mE(e,t,n){const r=this;return a;function a(i){return ee(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s):n(i)}function s(i){return r.parser.lazy[r.now().line]?n(i):t(i)}}function pE(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(ga,t,n)}}const gE={name:"htmlText",tokenize:bE};function bE(e,t,n){const r=this;let a,s,i;return o;function o(y){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(y),l}function l(y){return y===33?(e.consume(y),c):y===47?(e.consume(y),k):y===63?(e.consume(y),N):lt(y)?(e.consume(y),P):n(y)}function c(y){return y===45?(e.consume(y),d):y===91?(e.consume(y),s=0,x):lt(y)?(e.consume(y),S):n(y)}function d(y){return y===45?(e.consume(y),h):n(y)}function f(y){return y===null?n(y):y===45?(e.consume(y),p):ee(y)?(i=f,Q(y)):(e.consume(y),f)}function p(y){return y===45?(e.consume(y),h):f(y)}function h(y){return y===62?q(y):y===45?p(y):f(y)}function x(y){const he="CDATA[";return y===he.charCodeAt(s++)?(e.consume(y),s===he.length?g:x):n(y)}function g(y){return y===null?n(y):y===93?(e.consume(y),A):ee(y)?(i=g,Q(y)):(e.consume(y),g)}function A(y){return y===93?(e.consume(y),E):g(y)}function E(y){return y===62?q(y):y===93?(e.consume(y),E):g(y)}function S(y){return y===null||y===62?q(y):ee(y)?(i=S,Q(y)):(e.consume(y),S)}function N(y){return y===null?n(y):y===63?(e.consume(y),O):ee(y)?(i=N,Q(y)):(e.consume(y),N)}function O(y){return y===62?q(y):N(y)}function k(y){return lt(y)?(e.consume(y),w):n(y)}function w(y){return y===45||qe(y)?(e.consume(y),w):R(y)}function R(y){return ee(y)?(i=R,Q(y)):le(y)?(e.consume(y),R):q(y)}function P(y){return y===45||qe(y)?(e.consume(y),P):y===47||y===62||He(y)?$(y):n(y)}function $(y){return y===47?(e.consume(y),q):y===58||y===95||lt(y)?(e.consume(y),X):ee(y)?(i=$,Q(y)):le(y)?(e.consume(y),$):q(y)}function X(y){return y===45||y===46||y===58||y===95||qe(y)?(e.consume(y),X):U(y)}function U(y){return y===61?(e.consume(y),Y):ee(y)?(i=U,Q(y)):le(y)?(e.consume(y),U):$(y)}function Y(y){return y===null||y===60||y===61||y===62||y===96?n(y):y===34||y===39?(e.consume(y),a=y,K):ee(y)?(i=Y,Q(y)):le(y)?(e.consume(y),Y):(e.consume(y),F)}function K(y){return y===a?(e.consume(y),a=void 0,H):y===null?n(y):ee(y)?(i=K,Q(y)):(e.consume(y),K)}function F(y){return y===null||y===34||y===39||y===60||y===61||y===96?n(y):y===47||y===62||He(y)?$(y):(e.consume(y),F)}function H(y){return y===47||y===62||He(y)?$(y):n(y)}function q(y){return y===62?(e.consume(y),e.exit("htmlTextData"),e.exit("htmlText"),t):n(y)}function Q(y){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),B}function B(y){return le(y)?be(e,ae,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):ae(y)}function ae(y){return e.enter("htmlTextData"),i(y)}}const fi={name:"labelEnd",resolveAll:yE,resolveTo:_E,tokenize:CE},EE={tokenize:AE},TE={tokenize:SE},xE={tokenize:IE};function yE(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&mt(e,0,e.length,n),e}function _E(e,t){let n=e.length,r=0,a,s,i,o;for(;n--;)if(a=e[n][1],s){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(i){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(s=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(i=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[i][1].end}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[i-2][1].start}};return o=[["enter",l,t],["enter",c,t]],o=Ke(o,e.slice(s+1,s+r+3)),o=Ke(o,[["enter",d,t]]),o=Ke(o,di(t.parser.constructs.insideSpan.null,e.slice(s+r+4,i-3),t)),o=Ke(o,[["exit",d,t],e[i-2],e[i-1],["exit",c,t]]),o=Ke(o,e.slice(i+1)),o=Ke(o,[["exit",l,t]]),mt(e,s,e.length,o),e}function CE(e,t,n){const r=this;let a=r.events.length,s,i;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){s=r.events[a][1];break}return o;function o(p){return s?s._inactive?f(p):(i=r.parser.defined.includes(hn(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(EE,d,i?d:f)(p):p===91?e.attempt(TE,d,i?c:f)(p):i?d(p):f(p)}function c(p){return e.attempt(xE,d,f)(p)}function d(p){return t(p)}function f(p){return s._balanced=!0,n(p)}}function AE(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),a}function a(f){return He(f)?Gn(e,s)(f):s(f)}function s(f){return f===41?d(f):Kc(e,i,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function i(f){return He(f)?Gn(e,l)(f):d(f)}function o(f){return n(f)}function l(f){return f===34||f===39||f===40?Zc(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function c(f){return He(f)?Gn(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function SE(e,t,n){const r=this;return a;function a(o){return Qc.call(r,e,s,i,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(hn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function i(o){return n(o)}}function IE(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),a}function a(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const NE={name:"labelStartImage",resolveAll:fi.resolveAll,tokenize:wE};function wE(e,t,n){const r=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),i):n(o)}function i(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const vE={name:"labelStartLink",resolveAll:fi.resolveAll,tokenize:kE};function kE(e,t,n){const r=this;return a;function a(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),s}function s(i){return i===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(i):t(i)}}const ja={name:"lineEnding",tokenize:OE};function OE(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),be(e,t,"linePrefix")}}const Br={name:"thematicBreak",tokenize:RE};function RE(e,t,n){let r=0,a;return s;function s(c){return e.enter("thematicBreak"),i(c)}function i(c){return a=c,o(c)}function o(c){return c===a?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ee(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===a?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),le(c)?be(e,o,"whitespace")(c):o(c))}}const Fe={continuation:{tokenize:ME},exit:FE,name:"list",tokenize:DE},LE={partial:!0,tokenize:HE},PE={partial:!0,tokenize:BE};function DE(e,t,n){const r=this,a=r.events[r.events.length-1];let s=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,i=0;return o;function o(h){const x=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:bs(h)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Br,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return bs(h)&&++i<10?(e.consume(h),l):(!r.interrupt||i<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(ga,r.interrupt?n:d,e.attempt(LE,p,f))}function d(h){return r.containerState.initialBlankLine=!0,s++,p(h)}function f(h){return le(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function ME(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ga,a,s);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,be(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!le(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(PE,t,i)(o))}function i(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,be(e,e.attempt(Fe,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function BE(e,t,n){const r=this;return be(e,a,"listItemIndent",r.containerState.size+1);function a(s){const i=r.events[r.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(s):n(s)}}function FE(e){e.exit(this.containerState.type)}function HE(e,t,n){const r=this;return be(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(s){const i=r.events[r.events.length-1];return!le(s)&&i&&i[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Fo={name:"setextUnderline",resolveTo:UE,tokenize:jE};function UE(e,t){let n=e.length,r,a,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const i={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",s?(e.splice(a,0,["enter",i,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=i,e.push(["exit",i,t]),e}function jE(e,t,n){const r=this;let a;return s;function s(c){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),a=c,i(c)):n(c)}function i(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===a?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),le(c)?be(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ee(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const zE={tokenize:YE};function YE(e){const t=this,n=e.attempt(ga,r,e.attempt(this.parser.constructs.flowInitial,a,be(e,e.attempt(this.parser.constructs.flow,a,e.attempt(Gb,a)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const WE={resolveAll:ed()},VE=Jc("string"),$E=Jc("text");function Jc(e){return{resolveAll:ed(e==="text"?qE:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],s=n.attempt(a,i,o);return i;function i(d){return c(d)?s(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const f=a[d];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function ed(e){return t;function t(n,r){let a=-1,s;for(;++a<=n.length;)s===void 0?n[a]&&n[a][1].type==="data"&&(s=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==s+2&&(n[s][1].end=n[a-1][1].end,n.splice(s+2,a-s-2),a=s+2),s=void 0);return e?e(n,r):n}}function qE(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let s=a.length,i=-1,o=0,l;for(;s--;){const c=a[s];if(typeof c=="string"){for(i=c.length;c.charCodeAt(i-1)===32;)o++,i--;if(i)break;i=-1}else if(c===-2)l=!0,o++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const c={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?i:r.start._bufferIndex+i,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const GE={42:Fe,43:Fe,45:Fe,48:Fe,49:Fe,50:Fe,51:Fe,52:Fe,53:Fe,54:Fe,55:Fe,56:Fe,57:Fe,62:$c},XE={91:Jb},KE={[-2]:Ua,[-1]:Ua,32:Ua},QE={35:sE,42:Br,45:[Fo,Br],60:lE,61:Fo,95:Br,96:Mo,126:Mo},ZE={38:Gc,92:qc},JE={[-5]:ja,[-4]:ja,[-3]:ja,33:NE,38:Gc,42:Es,60:[vb,gE],91:vE,92:[rE,qc],93:fi,95:Es,96:zb},eT={null:[Es,WE]},tT={null:[42,95]},nT={null:[]},rT=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:tT,contentInitial:XE,disable:nT,document:GE,flow:QE,flowInitial:KE,insideSpan:eT,string:ZE,text:JE},Symbol.toStringTag,{value:"Module"}));function aT(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},s=[];let i=[],o=[];const l={attempt:R(k),check:R(w),consume:S,enter:N,exit:O,interrupt:R(w,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:x,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:f};let d=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function f(U){return i=Ke(i,U),A(),i[i.length-1]!==null?[]:(P(t,0),c.events=di(s,c.events,c),c.events)}function p(U,Y){return iT(h(U),Y)}function h(U){return sT(i,U)}function x(){const{_bufferIndex:U,_index:Y,line:K,column:F,offset:H}=r;return{_bufferIndex:U,_index:Y,line:K,column:F,offset:H}}function g(U){a[U.line]=U.column,X()}function A(){let U;for(;r._index<i.length;){const Y=i[r._index];if(typeof Y=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<Y.length;)E(Y.charCodeAt(r._bufferIndex));else E(Y)}}function E(U){d=d(U)}function S(U){ee(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,X()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=U}function N(U,Y){const K=Y||{};return K.type=U,K.start=x(),c.events.push(["enter",K,c]),o.push(K),K}function O(U){const Y=o.pop();return Y.end=x(),c.events.push(["exit",Y,c]),Y}function k(U,Y){P(U,Y.from)}function w(U,Y){Y.restore()}function R(U,Y){return K;function K(F,H,q){let Q,B,ae,y;return Array.isArray(F)?Te(F):"tokenize"in F?Te([F]):he(F);function he(xe){return ce;function ce(Me){const je=Me!==null&&xe[Me],ze=Me!==null&&xe.null,st=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray(ze)?ze:ze?[ze]:[]];return Te(st)(Me)}}function Te(xe){return Q=xe,B=0,xe.length===0?q:I(xe[B])}function I(xe){return ce;function ce(Me){return y=$(),ae=xe,xe.partial||(c.currentConstruct=xe),xe.name&&c.parser.constructs.disable.null.includes(xe.name)?De():xe.tokenize.call(Y?Object.assign(Object.create(c),Y):c,l,de,De)(Me)}}function de(xe){return U(ae,y),H}function De(xe){return y.restore(),++B<Q.length?I(Q[B]):q}}}function P(U,Y){U.resolveAll&&!s.includes(U)&&s.push(U),U.resolve&&mt(c.events,Y,c.events.length-Y,U.resolve(c.events.slice(Y),c)),U.resolveTo&&(c.events=U.resolveTo(c.events,c))}function $(){const U=x(),Y=c.previous,K=c.currentConstruct,F=c.events.length,H=Array.from(o);return{from:F,restore:q};function q(){r=U,c.previous=Y,c.currentConstruct=K,c.events.length=F,o=H,X()}}function X(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function sT(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,s=t.end._bufferIndex;let i;if(n===a)i=[e[n].slice(r,s)];else{if(i=e.slice(n,a),r>-1){const o=i[0];typeof o=="string"?i[0]=o.slice(r):i.shift()}s>0&&i.push(e[a].slice(0,s))}return i}function iT(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const s=e[n];let i;if(typeof s=="string")i=s;else switch(s){case-5:{i="\r";break}case-4:{i=`
|
|
@@ -78,16 +78,16 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
78
78
|
<div class="p-4">
|
|
79
79
|
${String(i).trim()}
|
|
80
80
|
</div>
|
|
81
|
-
</details>`})}function fC({children:e,className:t="",openFirst:n=!1}){const a=dC(typeof e=="string"?e:"",{openFirst:n});return m.jsx("div",{className:["prose",nf.prose,t].filter(Boolean).join(" "),children:m.jsx(Mx,{rehypePlugins:[uC],children:a})})}function hC(e){return m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:"size-5",...e,children:[m.jsx("rect",{x:"0.666667",y:"0.666667",width:"10.6667",height:"10.6667",rx:"5.33333",stroke:"#B1B1B1",strokeWidth:"1.33333"}),m.jsx("circle",{cx:"6.00065",cy:"3.33268",r:"0.666667",fill:"#B1B1B1"}),m.jsx("rect",{x:"5.33398",y:"5.33398",width:"1.33333",height:"4",fill:"#B1B1B1"})]})}const Cu={},rf=({tooltipData:e,openFirst:t=!1,trigger:n})=>{if(!e?.trim())return null;const r=a=>{a.stopPropagation()};return m.jsxs(ni,{children:[m.jsx(ri,{asChild:!0,children:n??m.jsx("button",{className:Cu.iconBtn,"aria-label":"Open tooltip",onClick:r,children:m.jsx(hC,{className:Cu.iconSvg})})}),m.jsx(ai,{className:"bg-[#000] text-white text-[1.1rem] leading-[1.45] w-auto max-w-[300px]",side:"top",children:m.jsx(fC,{openFirst:t,children:e})})]})},af=_.forwardRef(({values:e,value:t,onValueChange:n,placeholder:r="Sort by",title:a,className:s,dropdownWidth:i,align:o="start",showClear:l=!1,getTooltipByMaterialAndSection:c,sectionName:d},f)=>{const[p,h]=_.useState(!1),x=_.useRef(null);_.useEffect(()=>{if(!p)return;const S=O=>{const k=O.target,w=x.current;w&&(w.contains(k)||k===w)||h(!1)},N=O=>O.key==="Escape"&&h(!1);return window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),document.addEventListener("keydown",N),()=>{window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S),document.removeEventListener("keydown",N)}},[p]);const g=t?e.find(S=>S.value===t):void 0,A=S=>{n(S),h(!1)},E=()=>n(null);return m.jsxs(Nc,{open:p,onOpenChange:h,children:[m.jsxs(wc,{ref:f,"aria-haspopup":"listbox","aria-expanded":p,className:ke("inline-flex flex-row items-center justify-between gap-[8px] rounded-full bg-[var(--label-bg, #f5f5f5)] px-[8px] py-[8px] text-xs font-medium h-[36px] text-blackborder border-transparent hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--main-accent-color)]sm:w-[102px]",s),children:[m.jsx("span",{className:ke(!g&&"text-xs text-gray-700 ms:text-sm"),children:g?.label??r}),m.jsx(Il,{className:ke("h-4 w-[16px] transition-transform",p&&"rotate-180")})]}),m.jsxs(vc,{ref:x,align:o,sideOffset:6,className:ke("bg-white border border-gray-200 rounded-xl shadow-lg z-50 max-h-80 overflow-y-auto p-0",i||"w-[var(--radix-popover-trigger-width)]"),style:{WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},onTouchStart:S=>S.stopPropagation(),onTouchMove:S=>S.stopPropagation(),onWheel:S=>S.stopPropagation(),children:[(a??r)&&m.jsx("div",{className:"px-4 pt-3 pb-2 text-[1rem] font-regular",children:a??r}),l&&t!==null&&m.jsx("div",{className:"px-4 py-2 border-b",children:m.jsxs("button",{onClick:E,className:"inline-flex flex-row items-center gap-[4px] text-[0.95rem] text-black hover:text-[var(--main-accent-color)] transition-colors",children:[m.jsx(Us,{className:"h-3.5 w-[12px].5"}),"Clear"]})}),m.jsx("div",{role:"listbox","aria-activedescendant":g?`option-${g.value}`:void 0,className:"py-1",children:e.map(S=>{const N=t===S.value;return m.jsxs("div",{id:`option-${S.value}`,role:"option","aria-selected":N,tabIndex:0,className:ke("flex flex-row items-start justify-between gap-[8px] px-4 py-2 cursor-pointer","hover:bg-gray-50 focus:bg-gray-50 focus:outline-none"),onClick:()=>A(S.value),onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),A(S.value))},children:[m.jsxs("div",{className:"flex flex-row items-center gap-[8px]",children:[m.jsx("span",{className:"text-[1.05rem]",children:S.label}),(()=>{if(!c||!d)return null;const O=c(S.value,d);return O?.Description?m.jsx(rf,{tooltipData:O.Description}):null})()]}),N?m.jsx(Sl,{className:"h-4 w-[16px]"}):null]},S.value)})})]})]})});af.displayName="SingleSelect";const sf=({size:e=80,trackClassName:t="text-white",accentClassName:n="text-amber-700",className:r="",isOverlay:a=!0})=>m.jsx("div",{className:a?"absolute inset-0 flex flex-row items-center justify-center backdrop-blur bg-black/30 z-150":"inline-flex flex-row items-center justify-center",children:m.jsxs("span",{role:"status","aria-label":"Loading",className:r,style:{width:e,height:e},children:[m.jsxs("svg",{viewBox:"0 0 80 80",className:"animate-spin",width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("path",{d:"M40.0003 6.66675V20.0001M54.0003 26.0001L63.667 16.3334M60.0003 40.0001H73.3337M54.0003 54.0001L63.667 63.6667M40.0003 60.0001V73.3334M16.3337 63.6667L26.0003 54.0001M6.66699 40.0001H20.0003M16.3337 16.3334L26.0003 26.0001",stroke:"currentColor",className:t,strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M54 25.9999L63.6667 16.3333",stroke:"currentColor",className:n,strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round"})]}),m.jsx("span",{className:"sr-only",children:"Loading…"})]})}),mC=({open:e,target:t,children:n,offset:r=12,maxWidthPx:a=420,forceOverflowVisible:s=!0})=>{const i=D.useRef(null),[o,l]=D.useState({top:0,left:0,arrowLeft:16});return D.useEffect(()=>{if(!e||!t||!s)return;const c=t.style.position;getComputedStyle(t).position==="static"&&(t.style.position="relative");const f=t.style.overflow;return t.style.overflow="visible",()=>{t.style.position=c,t.style.overflow=f}},[e,t,s]),D.useLayoutEffect(()=>{if(!e||!t)return;const c=10,d=8,f=()=>{const g=i.current;if(!g)return;const A={vis:g.style.visibility,top:g.style.top,left:g.style.left,maxW:g.style.maxWidth,transform:g.style.transform};g.style.visibility="hidden",g.style.top="0px",g.style.left="0px",g.style.transform="none",g.style.maxWidth=`min(${a}px, calc(100vw - ${d*2}px))`;const E=g.getBoundingClientRect(),S=E.width,N=E.height,O=t.getBoundingClientRect(),k=O.left,w=Math.max(d,Math.min(k,window.innerWidth-d-S)),R=Math.max(d,O.top-(N+r+c)),P=k-w+16,$=Math.max(8,Math.min(P,S-8));g.style.visibility=A.vis,g.style.top=A.top,g.style.left=A.left,g.style.maxWidth=A.maxW,g.style.transform=A.transform,l({top:R,left:w,arrowLeft:$})};f();const p=()=>f(),h=()=>f();window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",h);const x=new ResizeObserver(()=>f());return x.observe(t),()=>{window.removeEventListener("scroll",p),window.removeEventListener("resize",h),x.disconnect()}},[e,t,r,a]),!e||!t?null:$t.createPortal(m.jsx("div",{className:"fixed inset-0 z-[
|
|
82
|
-
absolute
|
|
83
|
-
rounded-2xl
|
|
84
|
-
text-white text-sm leading-6 font-medium
|
|
85
|
-
pointer-events-auto
|
|
86
|
-
`,style:{top:o.top,left:o.left,maxWidth:`min(${a}px, calc(100vw - 16px))`,backgroundColor:"rgba(40,40,40,0.8)"},children:[m.jsx("div",{className:"px-4 py-3",children:n}),m.jsx("span",{className
|
|
87
|
-
absolute -bottom-[10px] h-0 w-0
|
|
88
|
-
border-l-[10px] border-l-transparent
|
|
89
|
-
border-r-[10px] border-r-transparent
|
|
90
|
-
border-t-[10px]
|
|
81
|
+
</details>`})}function fC({children:e,className:t="",openFirst:n=!1}){const a=dC(typeof e=="string"?e:"",{openFirst:n});return m.jsx("div",{className:["prose",nf.prose,t].filter(Boolean).join(" "),children:m.jsx(Mx,{rehypePlugins:[uC],children:a})})}function hC(e){return m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:"size-5",...e,children:[m.jsx("rect",{x:"0.666667",y:"0.666667",width:"10.6667",height:"10.6667",rx:"5.33333",stroke:"#B1B1B1",strokeWidth:"1.33333"}),m.jsx("circle",{cx:"6.00065",cy:"3.33268",r:"0.666667",fill:"#B1B1B1"}),m.jsx("rect",{x:"5.33398",y:"5.33398",width:"1.33333",height:"4",fill:"#B1B1B1"})]})}const Cu={},rf=({tooltipData:e,openFirst:t=!1,trigger:n})=>{if(!e?.trim())return null;const r=a=>{a.stopPropagation()};return m.jsxs(ni,{children:[m.jsx(ri,{asChild:!0,children:n??m.jsx("button",{className:Cu.iconBtn,"aria-label":"Open tooltip",onClick:r,children:m.jsx(hC,{className:Cu.iconSvg})})}),m.jsx(ai,{className:"bg-[#000] text-white text-[1.1rem] leading-[1.45] w-auto max-w-[300px]",side:"top",children:m.jsx(fC,{openFirst:t,children:e})})]})},af=_.forwardRef(({values:e,value:t,onValueChange:n,placeholder:r="Sort by",title:a,className:s,dropdownWidth:i,align:o="start",showClear:l=!1,getTooltipByMaterialAndSection:c,sectionName:d},f)=>{const[p,h]=_.useState(!1),x=_.useRef(null);_.useEffect(()=>{if(!p)return;const S=O=>{const k=O.target,w=x.current;w&&(w.contains(k)||k===w)||h(!1)},N=O=>O.key==="Escape"&&h(!1);return window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),document.addEventListener("keydown",N),()=>{window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S),document.removeEventListener("keydown",N)}},[p]);const g=t?e.find(S=>S.value===t):void 0,A=S=>{n(S),h(!1)},E=()=>n(null);return m.jsxs(Nc,{open:p,onOpenChange:h,children:[m.jsxs(wc,{ref:f,"aria-haspopup":"listbox","aria-expanded":p,className:ke("inline-flex flex-row items-center justify-between gap-[8px] rounded-full bg-[var(--label-bg, #f5f5f5)] px-[8px] py-[8px] text-xs font-medium h-[36px] text-blackborder border-transparent hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--main-accent-color)]sm:w-[102px]",s),children:[m.jsx("span",{className:ke(!g&&"text-xs text-gray-700 ms:text-sm"),children:g?.label??r}),m.jsx(Il,{className:ke("h-4 w-[16px] transition-transform",p&&"rotate-180")})]}),m.jsxs(vc,{ref:x,align:o,sideOffset:6,className:ke("bg-white border border-gray-200 rounded-xl shadow-lg z-50 max-h-80 overflow-y-auto p-0",i||"w-[var(--radix-popover-trigger-width)]"),style:{WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},onTouchStart:S=>S.stopPropagation(),onTouchMove:S=>S.stopPropagation(),onWheel:S=>S.stopPropagation(),children:[(a??r)&&m.jsx("div",{className:"px-4 pt-3 pb-2 text-[1rem] font-regular",children:a??r}),l&&t!==null&&m.jsx("div",{className:"px-4 py-2 border-b",children:m.jsxs("button",{onClick:E,className:"inline-flex flex-row items-center gap-[4px] text-[0.95rem] text-black hover:text-[var(--main-accent-color)] transition-colors",children:[m.jsx(Us,{className:"h-3.5 w-[12px].5"}),"Clear"]})}),m.jsx("div",{role:"listbox","aria-activedescendant":g?`option-${g.value}`:void 0,className:"py-1",children:e.map(S=>{const N=t===S.value;return m.jsxs("div",{id:`option-${S.value}`,role:"option","aria-selected":N,tabIndex:0,className:ke("flex flex-row items-start justify-between gap-[8px] px-4 py-2 cursor-pointer","hover:bg-gray-50 focus:bg-gray-50 focus:outline-none"),onClick:()=>A(S.value),onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),A(S.value))},children:[m.jsxs("div",{className:"flex flex-row items-center gap-[8px]",children:[m.jsx("span",{className:"text-[1.05rem]",children:S.label}),(()=>{if(!c||!d)return null;const O=c(S.value,d);return O?.Description?m.jsx(rf,{tooltipData:O.Description}):null})()]}),N?m.jsx(Sl,{className:"h-4 w-[16px]"}):null]},S.value)})})]})]})});af.displayName="SingleSelect";const sf=({size:e=80,trackClassName:t="text-white",accentClassName:n="text-amber-700",className:r="",isOverlay:a=!0})=>m.jsx("div",{className:a?"absolute inset-0 flex flex-row items-center justify-center backdrop-blur bg-black/30 z-150":"inline-flex flex-row items-center justify-center",children:m.jsxs("span",{role:"status","aria-label":"Loading",className:r,style:{width:e,height:e},children:[m.jsxs("svg",{viewBox:"0 0 80 80",className:"animate-spin",width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("path",{d:"M40.0003 6.66675V20.0001M54.0003 26.0001L63.667 16.3334M60.0003 40.0001H73.3337M54.0003 54.0001L63.667 63.6667M40.0003 60.0001V73.3334M16.3337 63.6667L26.0003 54.0001M6.66699 40.0001H20.0003M16.3337 16.3334L26.0003 26.0001",stroke:"currentColor",className:t,strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M54 25.9999L63.6667 16.3333",stroke:"currentColor",className:n,strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round"})]}),m.jsx("span",{className:"sr-only",children:"Loading…"})]})}),mC=({open:e,target:t,children:n,offset:r=12,maxWidthPx:a=420,forceOverflowVisible:s=!0})=>{const i=D.useRef(null),[o,l]=D.useState({top:0,left:0,arrowLeft:16});return D.useEffect(()=>{if(!e||!t||!s)return;const c=t.style.position;getComputedStyle(t).position==="static"&&(t.style.position="relative");const f=t.style.overflow;return t.style.overflow="visible",()=>{t.style.position=c,t.style.overflow=f}},[e,t,s]),D.useLayoutEffect(()=>{if(!e||!t)return;const c=10,d=8,f=()=>{const g=i.current;if(!g)return;const A={vis:g.style.visibility,top:g.style.top,left:g.style.left,maxW:g.style.maxWidth,transform:g.style.transform};g.style.visibility="hidden",g.style.top="0px",g.style.left="0px",g.style.transform="none",g.style.maxWidth=`min(${a}px, calc(100vw - ${d*2}px))`;const E=g.getBoundingClientRect(),S=E.width,N=E.height,O=t.getBoundingClientRect(),k=O.left,w=Math.max(d,Math.min(k,window.innerWidth-d-S)),R=Math.max(d,O.top-(N+r+c)),P=k-w+16,$=Math.max(8,Math.min(P,S-8));g.style.visibility=A.vis,g.style.top=A.top,g.style.left=A.left,g.style.maxWidth=A.maxW,g.style.transform=A.transform,l({top:R,left:w,arrowLeft:$})};f();const p=()=>f(),h=()=>f();window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",h);const x=new ResizeObserver(()=>f());return x.observe(t),()=>{window.removeEventListener("scroll",p),window.removeEventListener("resize",h),x.disconnect()}},[e,t,r,a]),!e||!t?null:$t.createPortal(m.jsx("div",{className:"fixed inset-0 z-[60000] pointer-events-none",children:m.jsxs("div",{ref:i,role:"tooltip",className:`\r
|
|
82
|
+
absolute\r
|
|
83
|
+
rounded-2xl\r
|
|
84
|
+
text-white text-sm leading-6 font-medium\r
|
|
85
|
+
pointer-events-auto\r
|
|
86
|
+
`,style:{top:o.top,left:o.left,maxWidth:`min(${a}px, calc(100vw - 16px))`,backgroundColor:"rgba(40,40,40,0.8)"},children:[m.jsx("div",{className:"px-4 py-3",children:n}),m.jsx("span",{className:`\r
|
|
87
|
+
absolute -bottom-[10px] h-0 w-0\r
|
|
88
|
+
border-l-[10px] border-l-transparent\r
|
|
89
|
+
border-r-[10px] border-r-transparent\r
|
|
90
|
+
border-t-[10px]\r
|
|
91
91
|
`,style:{left:o.arrowLeft,borderTopColor:"rgba(40,40,40,0.8)"}})]})}),document.querySelector("#root-container"))},of=({val:e,onDelete:t})=>{const[n,r]=D.useState(null),[a,s]=D.useState(!1),[i,o]=D.useState({materialName:"",parentName:"",productName:""}),l=e.metadata,c=d=>{d.stopPropagation(),t(e)};return m.jsxs(m.Fragment,{children:[m.jsxs("div",{tabIndex:0,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&d.preventDefault()},className:`\r
|
|
92
92
|
bg-[var(--background-grey)] relative w-[40px] h-[40px] border border-solid border-[var(--border)]\r
|
|
93
93
|
rounded-md aspect-square overflow-hidden transition sm:w-[64px] sm:h-[64px]\r
|
|
@@ -103,14 +103,14 @@ ${String(i).trim()}
|
|
|
103
103
|
sm:w-[32px] sm:h-[32px]\r
|
|
104
104
|
`,children:m.jsx(ur,{className:"w-[8px] h-[8px] stroke-[var(--svg-dark)]"})})]}),m.jsx(mC,{open:a,target:n,offset:8,children:m.jsxs(m.Fragment,{children:[i.materialName," | ",i.parentName]})})]})},pC=()=>m.jsx("div",{className:["relative w-[40px] h-[40px] rounded-md aspect-square overflow-hidden","border border-solid border-[var(--border)] bg-[var(--sidebar-b)] sm:w-[64px] sm:h-[64px]"].join(" "),"aria-hidden":!0}),gC=({selectedMaterials:e,containerStyles:t="p-[var(--padding)] border-t border-solid border-[var(--border)] shrink-0 sm:p-[var(--sm-padding)]"})=>{const n=Pe(),r=ue(cr),a=o=>{if(!r.length)return;const l=o.productInformation?.assetId,c=f=>f.parentName===o.parentName&&f.metadata?.label===o.metadata?.label,d=r.map(f=>{if(f.assetId!==l)return f;const p=f.items.filter(h=>!c(h));return{...f,items:p}}).filter(f=>f.items.length>0);n(ts(d))},s=Math.max(0,Re-e.length),i=lr(e);return m.jsxs("div",{className:t,children:[m.jsxs("div",{className:"flex flex-row justify-between items-center mb-[12px]",children:[m.jsxs("div",{className:"relative",children:[m.jsx("div",{className:"text-xs",children:"Swatches list"}),m.jsx("span",{className:"absolute top-0 right-[-20px] font-medium text-[var(--main-accent-color)] text-[8px] leading-none",children:"Free"})]}),m.jsxs("div",{className:"text-xs",children:[i,"/",Re," Selected"]})]}),m.jsxs("div",{className:"flex flex-row flex-wrap gap-[8px]",children:[e.map((o,l)=>{const c=o.metadata;return m.jsx(of,{val:o,onDelete:a},`${c?.label||l}/${o.parentName}`)}),Array.from({length:s}).map((o,l)=>m.jsx(pC,{},`mock-${l}`))]})]})},uf=()=>{const e=Pe(),t=ue(cr),n=D.useMemo(()=>t.flatMap(a=>a.items.map(s=>({...s,productName:a.name}))),[t]),r=()=>{n.length&&e(Du(!0))};return m.jsxs("div",{className:`flex flex-col border-t border-[var(--border)] shrink-0 shadow-[0_-2px_10px_rgba(40,40,40,0.10)]\r
|
|
105
105
|
sm:flex-row\r
|
|
106
|
-
`,children:[m.jsx(gC,{selectedMaterials:n,containerStyles:"flex flex-col p-[var(--sm-padding)] shrink-0 sm:w-[50%] sm:border-r sm:border-[var(--border)]"}),m.jsx("div",{className:"flex flex-row w-full p-[var(--sm-padding)] border-t border-[var(--border)] sm:border-none lg:w-[50%] sm:justify-center sm:items-center lg:justify-end lg:items-end",children:m.jsx("div",{className:"w-full lg:w-[50%] text-sm",children:m.jsx(Wu,{onClick:r,children:"ADD SWATCHES TO CART"})})})]})},bC=[{label:"Clear All",value:""},{label:"A-Z",value:"asc"},{label:"Z-A",value:"dsc"}],EC=()=>{const e=Pe(),t=D.useRef(null),n=ue(Jm),r=ue(ju),a=ue(Zm),s=ue(cr),[i,o]=D.useState(Kl),[l,c]=D.useState(""),[d,f]=D.useState(""),[p,h]=D.useState(null),[x,g]=D.useState(!1);D.useEffect(()=>{const k=t.current;if(!k)return;const w=()=>{const R=k.scrollTop;!x&&R>0&&g(!0),R===0&&x&&g(!1)};return k.addEventListener("scroll",w),()=>k.removeEventListener("scroll",w)},[x]),D.useEffect(()=>{const k=setTimeout(()=>{f(l.trim().toLowerCase())},300);return()=>clearTimeout(k)},[l]),D.useEffect(()=>{e($n())},[e]);const A=D.useMemo(()=>s.reduce((k,w)=>k+(w.items?.length??0),0),[s]),E=D.useMemo(()=>Up.getUniqueCategories(a),[a]),S=k=>k.toLowerCase(),N=D.useMemo(()=>new Intl.Collator(void 0,{sensitivity:"base",numeric:!1}),[]),O=D.useMemo(()=>{let k=a;if(i?.value){const w=S(i.value);k=k.filter(R=>S(R.collection??"")===w)}return d&&(k=k.filter(w=>S(w.name).includes(d))),p==="asc"?k=[...k].sort((w,R)=>N.compare(w.name,R.name)):p==="dsc"?k=[...k].sort((w,R)=>N.compare(R.name,w.name)):k=[...k],k},[a,i,d,p,N]);return m.jsxs("div",{className:"relative flex flex-col h-full min-h-0 w-full",children:[m.jsxs("div",{className:"flex-shrink-0",children:[m.jsx("div",{className:dt("overflow-hidden transform-gpu transition-[max-height,opacity,transform] duration-500 ease-in-out",x?"max-h-0 opacity-0 -translate-y-4 pointer-events-none":"max-h-40 opacity-100 translate-y-0"),children:m.jsx("div",{className:"h-40",children:m.jsx("img",{src:"https://hastings-questionnaie-storage.fra1.digitaloceanspaces.com/static/pic%20big%201%20(1).jpg",className:"object-cover w-full h-full"})})}),m.jsxs("header",{className:"flex flex-col border-b border-[var(--border)] lg:flex-row lg:justify-between",children:[m.jsx("h1",{className:"m-0! p-[var(--sm-padding)] text-base font-medium",children:"Swatches store"}),m.jsx("div",{className:"flex flex-row justify-center items-center border-t border-[var(--border)] p-[var(--sm-padding)] text-xs font-medium leading-[24px] lg:border-none",children:m.jsxs("span",{children:["Choose 5 free swatches to curate your perfect design. Plus get"," ",m.jsx("span",{className:"text-[var(--main-accent-color)] underline",children:"free design advice"})," ","from our experts"]})})]})]}),m.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[(n||r)&&m.jsx(sf,{}),m.jsxs("div",{className:"flex flex-row w-full items-center justify-between gap-[16px] border-b border-[var(--border)] p-[var(--sm-padding)]",children:[m.jsxs("div",{className:"flex flex-row h-[36px] w-full items-center justify-between gap-[16px] shrink-0 lg:max-w-[382px]",children:[m.jsxs("div",{className:"relative h-[36px] flex-1 min-w-0 lg:max-w-[240px]",children:[m.jsx("input",{type:"text",placeholder:"Search",value:l,onChange:k=>c(k.target.value),className
|
|
107
|
-
h-full w-full rounded-2xl border border-[var(--border)] bg-[var(--background)]
|
|
108
|
-
px-4 pr-8 text-sm text-black placeholder-[var(--text-muted)]
|
|
109
|
-
transition focus:border-[var(--main-accent-color)] focus:outline-none
|
|
110
|
-
`}),m.jsx("div",{className
|
|
111
|
-
pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 sm:right-4
|
|
112
|
-
[&_svg_path]:stroke-[var(--svg-dark)]
|
|
113
|
-
`,children:m.jsx(tp,{width:20,height:20})})]}),m.jsx(af,{title:"Sort by",placeholder:"Sort by",values:bC,value:p,onValueChange:h,className:"shrink-0 w-[90px] xxs:w-[100px] bg-[var(--label-bg)] sm:py-8px sm:px-16px sm:w-[102px]",dropdownWidth:"w-64"})]}),m.jsx(ao,{items:E,activeId:i.productId,onSelect:k=>o(k),className:"hidden lg:flex flex-row shrink-0 overflow-x-auto"})]}),m.jsx(ao,{items:E,activeId:i.productId,onSelect:k=>o(k),className:"h-[64px] p-[var(--sm-padding)] border-b border-[var(--border)] lg:hidden"}),m.jsxs("div",{ref:t,className:"flex-1 min-h-0 overflow-y-auto overscroll-contain p-[var(--sm-padding)]",children:[m.jsx("div",{className:"mb-4",children:"Select Product"}),O.length?m.jsx("ul",{className:"grid grid-cols-2 gap-[16px] sm:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8 2xl:grid-cols-9",children:O.map(k=>m.jsx(Hp,{productListItem:k},k.name))}):m.jsx("div",{className:"flex flex-row h-full items-center justify-center",children:"No products were found"})]}),A?m.jsx(uf,{}):null]})]})};function TC(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ca="Checkbox",[xC]=ra(Ca),[yC,Ii]=xC(Ca);function _C(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:s,form:i,name:o,onCheckedChange:l,required:c,value:d="on",internal_do_not_use_render:f}=e,[p,h]=Rs({prop:n,defaultProp:a??!1,onChange:l,caller:Ca}),[x,g]=_.useState(null),[A,E]=_.useState(null),S=_.useRef(!1),N=x?!!i||!!x.closest("form"):!0,O={checked:p,disabled:s,setChecked:h,control:x,setControl:g,name:o,form:i,value:d,hasConsumerStoppedPropagationRef:S,required:c,defaultChecked:Lt(a)?!1:a,isFormControl:N,bubbleInput:A,setBubbleInput:E};return m.jsx(yC,{scope:t,...O,children:CC(f)?f(O):r})}var lf="CheckboxTrigger",cf=_.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:s,value:i,disabled:o,checked:l,required:c,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:x}=Ii(lf,e),g=Xe(a,d),A=_.useRef(l);return _.useEffect(()=>{const E=s?.form;if(E){const S=()=>f(A.current);return E.addEventListener("reset",S),()=>E.removeEventListener("reset",S)}},[s,f]),m.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":Lt(l)?"mixed":l,"aria-required":c,"data-state":gf(l),"data-disabled":o?"":void 0,disabled:o,value:i,...r,ref:g,onKeyDown:Le(t,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:Le(n,E=>{f(S=>Lt(S)?!0:!S),x&&h&&(p.current=E.isPropagationStopped(),p.current||E.stopPropagation())})})});cf.displayName=lf;var df=_.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:s,required:i,disabled:o,value:l,onCheckedChange:c,form:d,...f}=e;return m.jsx(_C,{__scopeCheckbox:n,checked:a,defaultChecked:s,disabled:o,required:i,onCheckedChange:c,name:r,form:d,value:l,internal_do_not_use_render:({isFormControl:p})=>m.jsxs(m.Fragment,{children:[m.jsx(cf,{...f,ref:t,__scopeCheckbox:n}),p&&m.jsx(pf,{__scopeCheckbox:n})]})})});df.displayName=Ca;var ff="CheckboxIndicator",hf=_.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,s=Ii(ff,n);return m.jsx(_n,{present:r||Lt(s.checked)||s.checked===!0,children:m.jsx(Ne.span,{"data-state":gf(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});hf.displayName=ff;var mf="CheckboxBubbleInput",pf=_.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:s,defaultChecked:i,required:o,disabled:l,name:c,value:d,form:f,bubbleInput:p,setBubbleInput:h}=Ii(mf,e),x=Xe(n,h),g=TC(s),A=lc(r);_.useEffect(()=>{const S=p;if(!S)return;const N=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(N,"checked").set,w=!a.current;if(g!==s&&k){const R=new Event("click",{bubbles:w});S.indeterminate=Lt(s),k.call(S,Lt(s)?!1:s),S.dispatchEvent(R)}},[p,g,s,a]);const E=_.useRef(Lt(s)?!1:s);return m.jsx(Ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??E.current,required:o,disabled:l,name:c,value:d,form:f,...t,tabIndex:-1,ref:x,style:{...t.style,...A,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});pf.displayName=mf;function CC(e){return typeof e=="function"}function Lt(e){return e==="indeterminate"}function gf(e){return Lt(e)?"indeterminate":e?"checked":"unchecked"}function AC({className:e,...t}){return m.jsx(df,{"data-slot":"checkbox",className:ke(`
|
|
106
|
+
`,children:[m.jsx(gC,{selectedMaterials:n,containerStyles:"flex flex-col p-[var(--sm-padding)] shrink-0 sm:w-[50%] sm:border-r sm:border-[var(--border)]"}),m.jsx("div",{className:"flex flex-row w-full p-[var(--sm-padding)] border-t border-[var(--border)] sm:border-none lg:w-[50%] sm:justify-center sm:items-center lg:justify-end lg:items-end",children:m.jsx("div",{className:"w-full lg:w-[50%] text-sm",children:m.jsx(Wu,{onClick:r,children:"ADD SWATCHES TO CART"})})})]})},bC=[{label:"Clear All",value:""},{label:"A-Z",value:"asc"},{label:"Z-A",value:"dsc"}],EC=()=>{const e=Pe(),t=D.useRef(null),n=ue(Jm),r=ue(ju),a=ue(Zm),s=ue(cr),[i,o]=D.useState(Kl),[l,c]=D.useState(""),[d,f]=D.useState(""),[p,h]=D.useState(null),[x,g]=D.useState(!1);D.useEffect(()=>{const k=t.current;if(!k)return;const w=()=>{const R=k.scrollTop;!x&&R>0&&g(!0),R===0&&x&&g(!1)};return k.addEventListener("scroll",w),()=>k.removeEventListener("scroll",w)},[x]),D.useEffect(()=>{const k=setTimeout(()=>{f(l.trim().toLowerCase())},300);return()=>clearTimeout(k)},[l]),D.useEffect(()=>{e($n())},[e]);const A=D.useMemo(()=>s.reduce((k,w)=>k+(w.items?.length??0),0),[s]),E=D.useMemo(()=>Up.getUniqueCategories(a),[a]),S=k=>k.toLowerCase(),N=D.useMemo(()=>new Intl.Collator(void 0,{sensitivity:"base",numeric:!1}),[]),O=D.useMemo(()=>{let k=a;if(i?.value){const w=S(i.value);k=k.filter(R=>S(R.collection??"")===w)}return d&&(k=k.filter(w=>S(w.name).includes(d))),p==="asc"?k=[...k].sort((w,R)=>N.compare(w.name,R.name)):p==="dsc"?k=[...k].sort((w,R)=>N.compare(R.name,w.name)):k=[...k],k},[a,i,d,p,N]);return m.jsxs("div",{className:"relative flex flex-col h-full min-h-0 w-full",children:[m.jsxs("div",{className:"flex-shrink-0",children:[m.jsx("div",{className:dt("overflow-hidden transform-gpu transition-[max-height,opacity,transform] duration-500 ease-in-out",x?"max-h-0 opacity-0 -translate-y-4 pointer-events-none":"max-h-40 opacity-100 translate-y-0"),children:m.jsx("div",{className:"h-40",children:m.jsx("img",{src:"https://hastings-questionnaie-storage.fra1.digitaloceanspaces.com/static/pic%20big%201%20(1).jpg",className:"object-cover w-full h-full"})})}),m.jsxs("header",{className:"flex flex-col border-b border-[var(--border)] lg:flex-row lg:justify-between",children:[m.jsx("h1",{className:"m-0! p-[var(--sm-padding)] text-base font-medium",children:"Swatches store"}),m.jsx("div",{className:"flex flex-row justify-center items-center border-t border-[var(--border)] p-[var(--sm-padding)] text-xs font-medium leading-[24px] lg:border-none",children:m.jsxs("span",{children:["Choose 5 free swatches to curate your perfect design. Plus get"," ",m.jsx("span",{className:"text-[var(--main-accent-color)] underline",children:"free design advice"})," ","from our experts"]})})]})]}),m.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[(n||r)&&m.jsx(sf,{}),m.jsxs("div",{className:"flex flex-row w-full items-center justify-between gap-[16px] border-b border-[var(--border)] p-[var(--sm-padding)]",children:[m.jsxs("div",{className:"flex flex-row h-[36px] w-full items-center justify-between gap-[16px] shrink-0 lg:max-w-[382px]",children:[m.jsxs("div",{className:"relative h-[36px] flex-1 min-w-0 lg:max-w-[240px]",children:[m.jsx("input",{type:"text",placeholder:"Search",value:l,onChange:k=>c(k.target.value),className:`
|
|
107
|
+
h-full w-full rounded-2xl border border-[var(--border)] bg-[var(--background)]
|
|
108
|
+
px-4 pr-8 text-sm text-black placeholder-[var(--text-muted)]
|
|
109
|
+
transition focus:border-[var(--main-accent-color)] focus:outline-none
|
|
110
|
+
`}),m.jsx("div",{className:`
|
|
111
|
+
pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 sm:right-4
|
|
112
|
+
[&_svg_path]:stroke-[var(--svg-dark)]
|
|
113
|
+
`,children:m.jsx(tp,{width:20,height:20})})]}),m.jsx(af,{title:"Sort by",placeholder:"Sort by",values:bC,value:p,onValueChange:h,className:"shrink-0 w-[90px] xxs:w-[100px] bg-[var(--label-bg)] sm:py-8px sm:px-16px sm:w-[102px]",dropdownWidth:"w-64"})]}),m.jsx(ao,{items:E,activeId:i.productId,onSelect:k=>o(k),className:"hidden! lg:flex! lg:visible! flex-row! shrink-0! overflow-x-auto!"})]}),m.jsx(ao,{items:E,activeId:i.productId,onSelect:k=>o(k),className:"h-[64px]! p-[var(--sm-padding)]! border-b! border-[var(--border)]! lg:hidden!"}),m.jsxs("div",{ref:t,className:"flex-1 min-h-0 overflow-y-auto overscroll-contain p-[var(--sm-padding)]",children:[m.jsx("div",{className:"mb-4",children:"Select Product"}),O.length?m.jsx("ul",{className:"grid grid-cols-2 gap-[16px] sm:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8 2xl:grid-cols-9",children:O.map(k=>m.jsx(Hp,{productListItem:k},k.name))}):m.jsx("div",{className:"flex flex-row h-full items-center justify-center",children:"No products were found"})]}),A?m.jsx(uf,{}):null]})]})};function TC(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ca="Checkbox",[xC]=ra(Ca),[yC,Ii]=xC(Ca);function _C(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:s,form:i,name:o,onCheckedChange:l,required:c,value:d="on",internal_do_not_use_render:f}=e,[p,h]=Rs({prop:n,defaultProp:a??!1,onChange:l,caller:Ca}),[x,g]=_.useState(null),[A,E]=_.useState(null),S=_.useRef(!1),N=x?!!i||!!x.closest("form"):!0,O={checked:p,disabled:s,setChecked:h,control:x,setControl:g,name:o,form:i,value:d,hasConsumerStoppedPropagationRef:S,required:c,defaultChecked:Lt(a)?!1:a,isFormControl:N,bubbleInput:A,setBubbleInput:E};return m.jsx(yC,{scope:t,...O,children:CC(f)?f(O):r})}var lf="CheckboxTrigger",cf=_.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:s,value:i,disabled:o,checked:l,required:c,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:x}=Ii(lf,e),g=Xe(a,d),A=_.useRef(l);return _.useEffect(()=>{const E=s?.form;if(E){const S=()=>f(A.current);return E.addEventListener("reset",S),()=>E.removeEventListener("reset",S)}},[s,f]),m.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":Lt(l)?"mixed":l,"aria-required":c,"data-state":gf(l),"data-disabled":o?"":void 0,disabled:o,value:i,...r,ref:g,onKeyDown:Le(t,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:Le(n,E=>{f(S=>Lt(S)?!0:!S),x&&h&&(p.current=E.isPropagationStopped(),p.current||E.stopPropagation())})})});cf.displayName=lf;var df=_.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:s,required:i,disabled:o,value:l,onCheckedChange:c,form:d,...f}=e;return m.jsx(_C,{__scopeCheckbox:n,checked:a,defaultChecked:s,disabled:o,required:i,onCheckedChange:c,name:r,form:d,value:l,internal_do_not_use_render:({isFormControl:p})=>m.jsxs(m.Fragment,{children:[m.jsx(cf,{...f,ref:t,__scopeCheckbox:n}),p&&m.jsx(pf,{__scopeCheckbox:n})]})})});df.displayName=Ca;var ff="CheckboxIndicator",hf=_.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,s=Ii(ff,n);return m.jsx(_n,{present:r||Lt(s.checked)||s.checked===!0,children:m.jsx(Ne.span,{"data-state":gf(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});hf.displayName=ff;var mf="CheckboxBubbleInput",pf=_.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:s,defaultChecked:i,required:o,disabled:l,name:c,value:d,form:f,bubbleInput:p,setBubbleInput:h}=Ii(mf,e),x=Xe(n,h),g=TC(s),A=lc(r);_.useEffect(()=>{const S=p;if(!S)return;const N=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(N,"checked").set,w=!a.current;if(g!==s&&k){const R=new Event("click",{bubbles:w});S.indeterminate=Lt(s),k.call(S,Lt(s)?!1:s),S.dispatchEvent(R)}},[p,g,s,a]);const E=_.useRef(Lt(s)?!1:s);return m.jsx(Ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??E.current,required:o,disabled:l,name:c,value:d,form:f,...t,tabIndex:-1,ref:x,style:{...t.style,...A,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});pf.displayName=mf;function CC(e){return typeof e=="function"}function Lt(e){return e==="indeterminate"}function gf(e){return Lt(e)?"indeterminate":e?"checked":"unchecked"}function AC({className:e,...t}){return m.jsx(df,{"data-slot":"checkbox",className:ke(`
|
|
114
114
|
bg-white peer border-input dark:bg-input/30
|
|
115
115
|
data-[state=checked]:bg-transparent
|
|
116
116
|
data-[state=checked]:text-black
|