backflow-ui-renderer 0.1.38 → 0.1.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -10,7 +10,7 @@
10
10
  top: ${c}px !important;
11
11
  left: ${h}px !important;
12
12
  }
13
- `),()=>{document.head.removeChild(u)}},[t]),Ze.jsx(NI,{isPresent:t,childRef:r,sizeRef:i,children:Jn.cloneElement(e,{ref:r})})}const DI=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s})=>{const l=Sb(BI),c=v.useId(),h=v.useCallback(f=>{l.set(f,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),u=v.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:h,register:f=>(l.set(f,!1),()=>l.delete(f))}),o?[Math.random(),h]:[n,h]);return v.useMemo(()=>{l.forEach((f,m)=>l.set(m,!1))},[n]),Jn.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),s==="popLayout"&&(e=Ze.jsx(jI,{isPresent:n,children:e})),Ze.jsx(vp.Provider,{value:u,children:e})};function BI(){return new Map}function BT(e=!0){const t=v.useContext(vp);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,o=v.useId();v.useEffect(()=>{e&&i(o)},[e]);const s=v.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}const Xh=e=>e.key||"";function jx(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Ab=typeof window<"u",zT=Ab?v.useLayoutEffect:v.useEffect,zI=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:o="sync",propagate:s=!1})=>{const[l,c]=BT(s),h=v.useMemo(()=>jx(e),[e]),u=s&&!l?[]:h.map(Xh),f=v.useRef(!0),m=v.useRef(h),y=Sb(()=>new Map),[x,p]=v.useState(h),[b,P]=v.useState(h);zT(()=>{f.current=!1,m.current=h;for(let E=0;E<b.length;E++){const w=Xh(b[E]);u.includes(w)?y.delete(w):y.get(w)!==!0&&y.set(w,!1)}},[b,u.length,u.join("-")]);const S=[];if(h!==x){let E=[...h];for(let w=0;w<b.length;w++){const T=b[w],O=Xh(T);u.includes(O)||(E.splice(w,0,T),S.push(T))}o==="wait"&&S.length&&(E=S),P(jx(E)),p(h);return}process.env.NODE_ENV!=="production"&&o==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:A}=v.useContext(_b);return Ze.jsx(Ze.Fragment,{children:b.map(E=>{const w=Xh(E),T=s&&!l?!1:h===b||u.includes(w),O=()=>{if(y.has(w))y.set(w,!0);else return;let R=!0;y.forEach(N=>{N||(R=!1)}),R&&(A==null||A(),P(m.current),s&&(c==null||c()),r&&r())};return Ze.jsx(DI,{isPresent:T,initial:!f.current||n?void 0:!1,custom:T?void 0:t,presenceAffectsLayout:i,mode:o,onExitComplete:T?void 0:O,children:E},w)})})},cr=e=>e;let Xl=cr,Qo=cr;process.env.NODE_ENV!=="production"&&(Xl=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Qo=(e,t)=>{if(!e)throw new Error(t)});function Tb(e){let t;return()=>(t===void 0&&(t=e()),t)}const pl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},bi=e=>e*1e3,ao=e=>e/1e3,FI={useManualTiming:!1};function WI(e){let t=new Set,n=new Set,r=!1,i=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function l(h){o.has(h)&&(c.schedule(h),e()),h(s)}const c={schedule:(h,u=!1,f=!1)=>{const y=f&&r?t:n;return u&&o.add(h),y.has(h)||y.add(h),h},cancel:h=>{n.delete(h),o.delete(h)},process:h=>{if(s=h,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(l),t.clear(),r=!1,i&&(i=!1,c.process(h))}};return c}const Jh=["read","resolveKeyframes","update","preRender","render","postRender"],VI=40;function FT(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=Jh.reduce((P,S)=>(P[S]=WI(o),P),{}),{read:l,resolveKeyframes:c,update:h,preRender:u,render:f,postRender:m}=s,y=()=>{const P=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(P-i.timestamp,VI),1),i.timestamp=P,i.isProcessing=!0,l.process(i),c.process(i),h.process(i),u.process(i),f.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(y))},x=()=>{n=!0,r=!0,i.isProcessing||e(y)};return{schedule:Jh.reduce((P,S)=>{const A=s[S];return P[S]=(E,w=!1,T=!1)=>(n||x(),A.schedule(E,w,T)),P},{}),cancel:P=>{for(let S=0;S<Jh.length;S++)s[Jh[S]].cancel(P)},state:i,steps:s}}const{schedule:Ue,cancel:ts,state:Nn,steps:Im}=FT(typeof requestAnimationFrame<"u"?requestAnimationFrame:cr,!0),WT=v.createContext({strict:!1}),Dx={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ml={};for(const e in Dx)ml[e]={isEnabled:t=>Dx[e].some(n=>!!t[n])};function UI(e){for(const t in e)ml[t]={...ml[t],...e[t]}}const HI=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Vf(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||HI.has(e)}let VT=e=>!Vf(e);function qI(e){e&&(VT=t=>t.startsWith("on")?!Vf(t):e(t))}try{qI(require("@emotion/is-prop-valid").default)}catch{}function GI(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(VT(i)||n===!0&&Vf(i)||!t&&!Vf(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const Bx=new Set;function bp(e,t,n){e||Bx.has(t)||(console.warn(t),Bx.add(t))}function ZI(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&bp(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const xp=v.createContext({});function _u(e){return typeof e=="string"||Array.isArray(e)}function wp(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Eb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cb=["initial",...Eb];function _p(e){return wp(e.animate)||Cb.some(t=>_u(e[t]))}function UT(e){return!!(_p(e)||e.variants)}function YI(e,t){if(_p(e)){const{initial:n,animate:r}=e;return{initial:n===!1||_u(n)?n:void 0,animate:_u(r)?r:void 0}}return e.inherit!==!1?t:{}}function KI(e){const{initial:t,animate:n}=YI(e,v.useContext(xp));return v.useMemo(()=>({initial:t,animate:n}),[zx(t),zx(n)])}function zx(e){return Array.isArray(e)?e.join(" "):e}const XI=Symbol.for("motionComponentSymbol");function Ga(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function JI(e,t,n){return v.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ga(n)&&(n.current=r))},[t])}const Ob=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),QI="framerAppearId",HT="data-"+Ob(QI),{schedule:Mb}=FT(queueMicrotask,!1),qT=v.createContext({});function tR(e,t,n,r,i){var o,s;const{visualElement:l}=v.useContext(xp),c=v.useContext(WT),h=v.useContext(vp),u=v.useContext(Pb).reducedMotion,f=v.useRef(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:u}));const m=f.current,y=v.useContext(qT);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&eR(f.current,n,i,y);const x=v.useRef(!1);v.useInsertionEffect(()=>{m&&x.current&&m.update(n,h)});const p=n[HT],b=v.useRef(!!p&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,p))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,p)));return zT(()=>{m&&(x.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),Mb.render(m.render),b.current&&m.animationState&&m.animationState.animateChanges())}),v.useEffect(()=>{m&&(!b.current&&m.animationState&&m.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)===null||P===void 0||P.call(window,p)}),b.current=!1))}),m}function eR(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:l,layoutScroll:c,layoutRoot:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:GT(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||l&&Ga(l),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:h})}function GT(e){if(e)return e.options.allowProjection!==!1?e.projection:GT(e.parent)}function nR({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var o,s;e&&UI(e);function l(h,u){let f;const m={...v.useContext(Pb),...h,layoutId:rR(h)},{isStatic:y}=m,x=KI(h),p=r(h,y);if(!y&&Ab){iR(m,e);const b=oR(m);f=b.MeasureLayout,x.visualElement=tR(i,p,m,t,b.ProjectionNode)}return Ze.jsxs(xp.Provider,{value:x,children:[f&&x.visualElement?Ze.jsx(f,{visualElement:x.visualElement,...m}):null,n(i,h,JI(p,x.visualElement,u),p,y,x.visualElement)]})}l.displayName=`motion.${typeof i=="string"?i:`create(${(s=(o=i.displayName)!==null&&o!==void 0?o:i.name)!==null&&s!==void 0?s:""})`}`;const c=v.forwardRef(l);return c[XI]=i,c}function rR({layoutId:e}){const t=v.useContext(_b).id;return t&&e!==void 0?t+"-"+e:e}function iR(e,t){const n=v.useContext(WT).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Xl(!1,r):Qo(!1,r)}}function oR(e){const{drag:t,layout:n}=ml;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const sR=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function kb(e){return typeof e!="string"||e.includes("-")?!1:!!(sR.indexOf(e)>-1||/[A-Z]/u.test(e))}function Fx(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function $b(e,t,n,r){if(typeof t=="function"){const[i,o]=Fx(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=Fx(r);t=t(n!==void 0?n:e.custom,i,o)}return t}const ny=e=>Array.isArray(e),aR=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),lR=e=>ny(e)?e[e.length-1]||0:e,qn=e=>!!(e&&e.getVelocity);function If(e){const t=qn(e)?e.get():e;return aR(t)?t.toValue():t}function cR({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,o){const s={latestValues:uR(r,i,o,e),renderState:t()};return n&&(s.onMount=l=>n({props:r,current:l,...s}),s.onUpdate=l=>n(l)),s}const ZT=e=>(t,n)=>{const r=v.useContext(xp),i=v.useContext(vp),o=()=>cR(e,t,r,i);return n?o():Sb(o)};function uR(e,t,n,r){const i={},o=r(e,{});for(const m in o)i[m]=If(o[m]);let{initial:s,animate:l}=e;const c=_p(e),h=UT(e);t&&h&&!c&&e.inherit!==!1&&(s===void 0&&(s=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const f=u?l:s;if(f&&typeof f!="boolean"&&!wp(f)){const m=Array.isArray(f)?f:[f];for(let y=0;y<m.length;y++){const x=$b(e,m[y]);if(x){const{transitionEnd:p,transition:b,...P}=x;for(const S in P){let A=P[S];if(Array.isArray(A)){const E=u?A.length-1:0;A=A[E]}A!==null&&(i[S]=A)}for(const S in p)i[S]=p[S]}}}return i}const Jl=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ba=new Set(Jl),YT=e=>t=>typeof t=="string"&&t.startsWith(e),KT=YT("--"),hR=YT("var(--"),Ib=e=>hR(e)?fR.test(e.split("/*")[0].trim()):!1,fR=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,XT=(e,t)=>t&&typeof e=="number"?t.transform(e):e,fo=(e,t,n)=>n>t?t:n<e?e:n,Ql={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Su={...Ql,transform:e=>fo(0,1,e)},Qh={...Ql,default:1},hh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),zo=hh("deg"),xi=hh("%"),Wt=hh("px"),dR=hh("vh"),pR=hh("vw"),Wx={...xi,parse:e=>xi.parse(e)/100,transform:e=>xi.transform(e*100)},mR={borderWidth:Wt,borderTopWidth:Wt,borderRightWidth:Wt,borderBottomWidth:Wt,borderLeftWidth:Wt,borderRadius:Wt,radius:Wt,borderTopLeftRadius:Wt,borderTopRightRadius:Wt,borderBottomRightRadius:Wt,borderBottomLeftRadius:Wt,width:Wt,maxWidth:Wt,height:Wt,maxHeight:Wt,top:Wt,right:Wt,bottom:Wt,left:Wt,padding:Wt,paddingTop:Wt,paddingRight:Wt,paddingBottom:Wt,paddingLeft:Wt,margin:Wt,marginTop:Wt,marginRight:Wt,marginBottom:Wt,marginLeft:Wt,backgroundPositionX:Wt,backgroundPositionY:Wt},gR={rotate:zo,rotateX:zo,rotateY:zo,rotateZ:zo,scale:Qh,scaleX:Qh,scaleY:Qh,scaleZ:Qh,skew:zo,skewX:zo,skewY:zo,distance:Wt,translateX:Wt,translateY:Wt,translateZ:Wt,x:Wt,y:Wt,z:Wt,perspective:Wt,transformPerspective:Wt,opacity:Su,originX:Wx,originY:Wx,originZ:Wt},Vx={...Ql,transform:Math.round},Rb={...mR,...gR,zIndex:Vx,size:Wt,fillOpacity:Su,strokeOpacity:Su,numOctaves:Vx},yR={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vR=Jl.length;function bR(e,t,n){let r="",i=!0;for(let o=0;o<vR;o++){const s=Jl[o],l=e[s];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(s.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const h=XT(l,Rb[s]);if(!c){i=!1;const u=yR[s]||s;r+=`${u}(${h}) `}n&&(t[s]=h)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Lb(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let s=!1,l=!1;for(const c in t){const h=t[c];if(ba.has(c)){s=!0;continue}else if(KT(c)){i[c]=h;continue}else{const u=XT(h,Rb[c]);c.startsWith("origin")?(l=!0,o[c]=u):r[c]=u}}if(t.transform||(s||n?r.transform=bR(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:h="50%",originZ:u=0}=o;r.transformOrigin=`${c} ${h} ${u}`}}const xR={offset:"stroke-dashoffset",array:"stroke-dasharray"},wR={offset:"strokeDashoffset",array:"strokeDasharray"};function _R(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?xR:wR;e[o.offset]=Wt.transform(-r);const s=Wt.transform(t),l=Wt.transform(n);e[o.array]=`${s} ${l}`}function Ux(e,t,n){return typeof e=="string"?e:Wt.transform(t+n*e)}function SR(e,t,n){const r=Ux(t,e.x,e.width),i=Ux(n,e.y,e.height);return`${r} ${i}`}function Nb(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:l=1,pathOffset:c=0,...h},u,f){if(Lb(e,h,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:y,dimensions:x}=e;m.transform&&(x&&(y.transform=m.transform),delete m.transform),x&&(i!==void 0||o!==void 0||y.transform)&&(y.transformOrigin=SR(x,i!==void 0?i:.5,o!==void 0?o:.5)),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),s!==void 0&&_R(m,s,l,c,!1)}const jb=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),JT=()=>({...jb(),attrs:{}}),Db=e=>typeof e=="string"&&e.toLowerCase()==="svg";function QT(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const tE=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function eE(e,t,n,r){QT(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(tE.has(i)?i:Ob(i),t.attrs[i])}const Uf={};function PR(e){Object.assign(Uf,e)}function nE(e,{layout:t,layoutId:n}){return ba.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Uf[e]||e==="opacity")}function Bb(e,t,n){var r;const{style:i}=e,o={};for(const s in i)(qn(i[s])||t.style&&qn(t.style[s])||nE(s,e)||((r=n==null?void 0:n.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(o[s]=i[s]);return o}function rE(e,t,n){const r=Bb(e,t,n);for(const i in e)if(qn(e[i])||qn(t[i])){const o=Jl.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}function AR(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const Hx=["x","y","width","height","cx","cy","r"],TR={useVisualState:ZT({scrapeMotionValuesFromProps:rE,createRenderState:JT,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let o=!!e.drag;if(!o){for(const l in i)if(ba.has(l)){o=!0;break}}if(!o)return;let s=!t;if(t)for(let l=0;l<Hx.length;l++){const c=Hx[l];e[c]!==t[c]&&(s=!0)}s&&Ue.read(()=>{AR(n,r),Ue.render(()=>{Nb(r,i,Db(n.tagName),e.transformTemplate),eE(n,r)})})}})},ER={useVisualState:ZT({scrapeMotionValuesFromProps:Bb,createRenderState:jb})};function iE(e,t,n){for(const r in t)!qn(t[r])&&!nE(r,n)&&(e[r]=t[r])}function CR({transformTemplate:e},t){return v.useMemo(()=>{const n=jb();return Lb(n,t,e),Object.assign({},n.vars,n.style)},[t])}function OR(e,t){const n=e.style||{},r={};return iE(r,n,e),Object.assign(r,CR(e,t)),r}function MR(e,t){const n={},r=OR(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function kR(e,t,n,r){const i=v.useMemo(()=>{const o=JT();return Nb(o,t,Db(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};iE(o,e.style,e),i.style={...o,...i.style}}return i}function $R(e=!1){return(n,r,i,{latestValues:o},s)=>{const c=(kb(n)?kR:MR)(r,o,s,n),h=GI(r,typeof n=="string",e),u=n!==v.Fragment?{...h,...c,ref:i}:{},{children:f}=r,m=v.useMemo(()=>qn(f)?f.get():f,[f]);return v.createElement(n,{...u,children:m})}}function IR(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...kb(r)?TR:ER,preloadedFeatures:e,useRender:$R(i),createVisualElement:t,Component:r};return nR(s)}}function oE(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Sp(e,t,n){const r=e.getProps();return $b(r,t,n!==void 0?n:r.custom,e)}const RR=Tb(()=>window.ScrollTimeline!==void 0);class LR{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(RR()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class NR extends LR{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function zb(e,t){return e?e[t]||e.default||e:void 0}const ry=2e4;function sE(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<ry;)t+=n,r=e.next(t);return t>=ry?1/0:t}function Fb(e){return typeof e=="function"}function qx(e,t){e.timeline=t,e.onfinish=null}const Wb=e=>Array.isArray(e)&&typeof e[0]=="number",jR={linearEasing:void 0};function DR(e,t){const n=Tb(e);return()=>{var r;return(r=jR[t])!==null&&r!==void 0?r:n()}}const Hf=DR(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),aE=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let o=0;o<i;o++)r+=e(pl(0,i-1,o))+", ";return`linear(${r.substring(0,r.length-2)})`};function lE(e){return!!(typeof e=="function"&&Hf()||!e||typeof e=="string"&&(e in iy||Hf())||Wb(e)||Array.isArray(e)&&e.every(lE))}const Yc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,iy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yc([0,.65,.55,1]),circOut:Yc([.55,0,1,.45]),backIn:Yc([.31,.01,.66,-.59]),backOut:Yc([.33,1.53,.69,.99])};function cE(e,t){if(e)return typeof e=="function"&&Hf()?aE(e,t):Wb(e)?Yc(e):Array.isArray(e)?e.map(n=>cE(n,t)||iy.easeOut):iy[e]}const Xr={x:!1,y:!1};function uE(){return Xr.x||Xr.y}function BR(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const o=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function hE(e,t){const n=BR(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Gx(e){return t=>{t.pointerType==="touch"||uE()||e(t)}}function zR(e,t,n={}){const[r,i,o]=hE(e,n),s=Gx(l=>{const{target:c}=l,h=t(l);if(typeof h!="function"||!c)return;const u=Gx(f=>{h(f),c.removeEventListener("pointerleave",u)});c.addEventListener("pointerleave",u,i)});return r.forEach(l=>{l.addEventListener("pointerenter",s,i)}),o}const fE=(e,t)=>t?e===t?!0:fE(e,t.parentElement):!1,Vb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,FR=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function WR(e){return FR.has(e.tagName)||e.tabIndex!==-1}const Kc=new WeakSet;function Zx(e){return t=>{t.key==="Enter"&&e(t)}}function Rm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const VR=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Zx(()=>{if(Kc.has(n))return;Rm(n,"down");const i=Zx(()=>{Rm(n,"up")}),o=()=>Rm(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Yx(e){return Vb(e)&&!uE()}function UR(e,t,n={}){const[r,i,o]=hE(e,n),s=l=>{const c=l.currentTarget;if(!Yx(l)||Kc.has(c))return;Kc.add(c);const h=t(l),u=(y,x)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",m),!(!Yx(y)||!Kc.has(c))&&(Kc.delete(c),typeof h=="function"&&h(y,{success:x}))},f=y=>{u(y,n.useGlobalTarget||fE(c,y.target))},m=y=>{u(y,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",m,i)};return r.forEach(l=>{!WR(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",s,i),l.addEventListener("focus",h=>VR(h,i),i)}),o}function HR(e){return e==="x"||e==="y"?Xr[e]?null:(Xr[e]=!0,()=>{Xr[e]=!1}):Xr.x||Xr.y?null:(Xr.x=Xr.y=!0,()=>{Xr.x=Xr.y=!1})}const dE=new Set(["width","height","top","left","right","bottom",...Jl]);let Rf;function qR(){Rf=void 0}const wi={now:()=>(Rf===void 0&&wi.set(Nn.isProcessing||FI.useManualTiming?Nn.timestamp:performance.now()),Rf),set:e=>{Rf=e,queueMicrotask(qR)}};function Ub(e,t){e.indexOf(t)===-1&&e.push(t)}function Hb(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class qb{constructor(){this.subscriptions=[]}add(t){return Ub(this.subscriptions,t),()=>Hb(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o<i;o++){const s=this.subscriptions[o];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function pE(e,t){return t?e*(1e3/t):0}const Kx=30,GR=e=>!isNaN(parseFloat(e));class ZR{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const o=wi.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=wi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=GR(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&bp(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new qb);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ue.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=wi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Kx)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Kx);return pE(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pu(e,t){return new ZR(e,t)}function YR(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pu(n))}function KR(e,t){const n=Sp(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const l=lR(o[s]);YR(e,s,l)}}function XR(e){return!!(qn(e)&&e.add)}function oy(e,t){const n=e.getValue("willChange");if(XR(n))return n.add(t)}function mE(e){return e.props[HT]}const gE=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,JR=1e-7,QR=12;function tL(e,t,n,r,i){let o,s,l=0;do s=t+(n-t)/2,o=gE(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>JR&&++l<QR);return s}function fh(e,t,n,r){if(e===t&&n===r)return cr;const i=o=>tL(o,0,1,e,n);return o=>o===0||o===1?o:gE(i(o),t,r)}const yE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,vE=e=>t=>1-e(1-t),bE=fh(.33,1.53,.69,.99),Gb=vE(bE),xE=yE(Gb),wE=e=>(e*=2)<1?.5*Gb(e):.5*(2-Math.pow(2,-10*(e-1))),Zb=e=>1-Math.sin(Math.acos(e)),_E=vE(Zb),SE=yE(Zb),PE=e=>/^0[^.\s]+$/u.test(e);function eL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||PE(e):!0}const ru=e=>Math.round(e*1e5)/1e5,Yb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function nL(e){return e==null}const rL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Kb=(e,t)=>n=>!!(typeof n=="string"&&rL.test(n)&&n.startsWith(e)||t&&!nL(n)&&Object.prototype.hasOwnProperty.call(n,t)),AE=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,o,s,l]=r.match(Yb);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:l!==void 0?parseFloat(l):1}},iL=e=>fo(0,255,e),Lm={...Ql,transform:e=>Math.round(iL(e))},Ys={test:Kb("rgb","red"),parse:AE("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Lm.transform(e)+", "+Lm.transform(t)+", "+Lm.transform(n)+", "+ru(Su.transform(r))+")"};function oL(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const sy={test:Kb("#"),parse:oL,transform:Ys.transform},Za={test:Kb("hsl","hue"),parse:AE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+xi.transform(ru(t))+", "+xi.transform(ru(n))+", "+ru(Su.transform(r))+")"},Vn={test:e=>Ys.test(e)||sy.test(e)||Za.test(e),parse:e=>Ys.test(e)?Ys.parse(e):Za.test(e)?Za.parse(e):sy.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ys.transform(e):Za.transform(e)},sL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function aL(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Yb))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(sL))===null||n===void 0?void 0:n.length)||0)>0}const TE="number",EE="color",lL="var",cL="var(",Xx="${}",uL=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Au(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const l=t.replace(uL,c=>(Vn.test(c)?(r.color.push(o),i.push(EE),n.push(Vn.parse(c))):c.startsWith(cL)?(r.var.push(o),i.push(lL),n.push(c)):(r.number.push(o),i.push(TE),n.push(parseFloat(c))),++o,Xx)).split(Xx);return{values:n,split:l,indexes:r,types:i}}function CE(e){return Au(e).values}function OE(e){const{split:t,types:n}=Au(e),r=t.length;return i=>{let o="";for(let s=0;s<r;s++)if(o+=t[s],i[s]!==void 0){const l=n[s];l===TE?o+=ru(i[s]):l===EE?o+=Vn.transform(i[s]):o+=i[s]}return o}}const hL=e=>typeof e=="number"?0:e;function fL(e){const t=CE(e);return OE(e)(t.map(hL))}const es={test:aL,parse:CE,createTransformer:OE,getAnimatableNone:fL},dL=new Set(["brightness","contrast","saturate","opacity"]);function pL(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Yb)||[];if(!r)return e;const i=n.replace(r,"");let o=dL.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const mL=/\b([a-z-]*)\(.*?\)/gu,ay={...es,getAnimatableNone:e=>{const t=e.match(mL);return t?t.map(pL).join(" "):e}},gL={...Rb,color:Vn,backgroundColor:Vn,outlineColor:Vn,fill:Vn,stroke:Vn,borderColor:Vn,borderTopColor:Vn,borderRightColor:Vn,borderBottomColor:Vn,borderLeftColor:Vn,filter:ay,WebkitFilter:ay},Xb=e=>gL[e];function ME(e,t){let n=Xb(e);return n!==ay&&(n=es),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const yL=new Set(["auto","none","0"]);function vL(e,t,n){let r=0,i;for(;r<e.length&&!i;){const o=e[r];typeof o=="string"&&!yL.has(o)&&Au(o).values.length&&(i=e[r]),r++}if(i&&n)for(const o of t)e[o]=ME(n,i)}const Jx=e=>e===Ql||e===Wt,Qx=(e,t)=>parseFloat(e.split(", ")[t]),tw=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Qx(i[1],t);{const o=r.match(/^matrix\((.+)\)$/u);return o?Qx(o[1],e):0}},bL=new Set(["x","y","z"]),xL=Jl.filter(e=>!bL.has(e));function wL(e){const t=[];return xL.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const gl={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:tw(4,13),y:tw(5,14)};gl.translateX=gl.x;gl.translateY=gl.y;const ea=new Set;let ly=!1,cy=!1;function kE(){if(cy){const e=Array.from(ea).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=wL(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([o,s])=>{var l;(l=r.getValue(o))===null||l===void 0||l.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}cy=!1,ly=!1,ea.forEach(e=>e.complete()),ea.clear()}function $E(){ea.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(cy=!0)})}function _L(){$E(),kE()}class Jb{constructor(t,n,r,i,o,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ea.add(this),ly||(ly=!0,Ue.read($E),Ue.resolveKeyframes(kE))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let o=0;o<t.length;o++)if(t[o]===null)if(o===0){const s=i==null?void 0:i.get(),l=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),i&&s===void 0&&i.set(t[0])}else t[o]=t[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ea.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ea.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const IE=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),SL=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function PL(e){const t=SL.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const AL=4;function RE(e,t,n=1){Qo(n<=AL,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,i]=PL(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return IE(s)?parseFloat(s):s}return Ib(i)?RE(i,t,n+1):i}const LE=e=>t=>t.test(e),TL={test:e=>e==="auto",parse:e=>e},NE=[Ql,Wt,xi,zo,pR,dR,TL],ew=e=>NE.find(LE(e));class jE extends Jb{constructor(t,n,r,i,o){super(t,n,r,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let h=t[c];if(typeof h=="string"&&(h=h.trim(),Ib(h))){const u=RE(h,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!dE.has(r)||t.length!==2)return;const[i,o]=t,s=ew(i),l=ew(o);if(s!==l)if(Jx(s)&&Jx(l))for(let c=0;c<t.length;c++){const h=t[c];typeof h=="string"&&(t[c]=parseFloat(h))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)eL(t[i])&&r.push(i);r.length&&vL(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=gl[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const o=n.getValue(r);o&&o.jump(this.measuredOrigin,!1);const s=i.length-1,l=i[s];i[s]=gl[r](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,h])=>{n.getValue(c).set(h)}),this.resolveNoneKeyframes()}}const nw=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(es.test(e)||e==="0")&&!e.startsWith("url("));function EL(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function CL(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],s=nw(i,t),l=nw(o,t);return Xl(s===l,`You are trying to animate ${t} from "${i}" to "${o}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${o} via the \`style\` property.`),!s||!l?!1:EL(e)||(n==="spring"||Fb(n))&&r}const OL=e=>e!==null;function Pp(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(OL),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const ML=40;class DE{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=wi.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:o,repeatType:s,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>ML?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&_L(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=wi.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:o,delay:s,onComplete:l,onUpdate:c,isGenerator:h}=this.options;if(!h&&!CL(t,r,i,o))if(s)this.options.duration=0;else{c&&c(Pp(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Je=(e,t,n)=>e+(t-e)*n;function Nm(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function kL({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,s=0;if(!t)i=o=s=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;i=Nm(c,l,e+1/3),o=Nm(c,l,e),s=Nm(c,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}function qf(e,t){return n=>n>0?t:e}const jm=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},$L=[sy,Ys,Za],IL=e=>$L.find(t=>t.test(e));function rw(e){const t=IL(e);if(Xl(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===Za&&(n=kL(n)),n}const iw=(e,t)=>{const n=rw(e),r=rw(t);if(!n||!r)return qf(e,t);const i={...n};return o=>(i.red=jm(n.red,r.red,o),i.green=jm(n.green,r.green,o),i.blue=jm(n.blue,r.blue,o),i.alpha=Je(n.alpha,r.alpha,o),Ys.transform(i))},RL=(e,t)=>n=>t(e(n)),dh=(...e)=>e.reduce(RL),uy=new Set(["none","hidden"]);function LL(e,t){return uy.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function NL(e,t){return n=>Je(e,t,n)}function Qb(e){return typeof e=="number"?NL:typeof e=="string"?Ib(e)?qf:Vn.test(e)?iw:BL:Array.isArray(e)?BE:typeof e=="object"?Vn.test(e)?iw:jL:qf}function BE(e,t){const n=[...e],r=n.length,i=e.map((o,s)=>Qb(o)(o,t[s]));return o=>{for(let s=0;s<r;s++)n[s]=i[s](o);return n}}function jL(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Qb(e[i])(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}}function DL(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],l=e.indexes[s][i[s]],c=(n=e.values[l])!==null&&n!==void 0?n:0;r[o]=c,i[s]++}return r}const BL=(e,t)=>{const n=es.createTransformer(t),r=Au(e),i=Au(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?uy.has(e)&&!i.values.length||uy.has(t)&&!r.values.length?LL(e,t):dh(BE(DL(r,i),i.values),n):(Xl(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),qf(e,t))};function zE(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Je(e,t,n):Qb(e)(e,t)}const zL=5;function FE(e,t,n){const r=Math.max(t-zL,0);return pE(n-e(r),t-r)}const Xe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Dm=.001;function FL({duration:e=Xe.duration,bounce:t=Xe.bounce,velocity:n=Xe.velocity,mass:r=Xe.mass}){let i,o;Xl(e<=bi(Xe.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=fo(Xe.minDamping,Xe.maxDamping,s),e=fo(Xe.minDuration,Xe.maxDuration,ao(e)),s<1?(i=h=>{const u=h*s,f=u*e,m=u-n,y=hy(h,s),x=Math.exp(-f);return Dm-m/y*x},o=h=>{const f=h*s*e,m=f*n+n,y=Math.pow(s,2)*Math.pow(h,2)*e,x=Math.exp(-f),p=hy(Math.pow(h,2),s);return(-i(h)+Dm>0?-1:1)*((m-y)*x)/p}):(i=h=>{const u=Math.exp(-h*e),f=(h-n)*e+1;return-Dm+u*f},o=h=>{const u=Math.exp(-h*e),f=(n-h)*(e*e);return u*f});const l=5/e,c=VL(i,o,l);if(e=bi(e),isNaN(c))return{stiffness:Xe.stiffness,damping:Xe.damping,duration:e};{const h=Math.pow(c,2)*r;return{stiffness:h,damping:s*2*Math.sqrt(r*h),duration:e}}}const WL=12;function VL(e,t,n){let r=n;for(let i=1;i<WL;i++)r=r-e(r)/t(r);return r}function hy(e,t){return e*Math.sqrt(1-t*t)}const UL=["duration","bounce"],HL=["stiffness","damping","mass"];function ow(e,t){return t.some(n=>e[n]!==void 0)}function qL(e){let t={velocity:Xe.velocity,stiffness:Xe.stiffness,damping:Xe.damping,mass:Xe.mass,isResolvedFromDuration:!1,...e};if(!ow(e,HL)&&ow(e,UL))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,o=2*fo(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Xe.mass,stiffness:i,damping:o}}else{const n=FL(e);t={...t,...n,mass:Xe.mass},t.isResolvedFromDuration=!0}return t}function WE(e=Xe.visualDuration,t=Xe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],l={done:!1,value:o},{stiffness:c,damping:h,mass:u,duration:f,velocity:m,isResolvedFromDuration:y}=qL({...n,velocity:-ao(n.velocity||0)}),x=m||0,p=h/(2*Math.sqrt(c*u)),b=s-o,P=ao(Math.sqrt(c/u)),S=Math.abs(b)<5;r||(r=S?Xe.restSpeed.granular:Xe.restSpeed.default),i||(i=S?Xe.restDelta.granular:Xe.restDelta.default);let A;if(p<1){const w=hy(P,p);A=T=>{const O=Math.exp(-p*P*T);return s-O*((x+p*P*b)/w*Math.sin(w*T)+b*Math.cos(w*T))}}else if(p===1)A=w=>s-Math.exp(-P*w)*(b+(x+P*b)*w);else{const w=P*Math.sqrt(p*p-1);A=T=>{const O=Math.exp(-p*P*T),R=Math.min(w*T,300);return s-O*((x+p*P*b)*Math.sinh(R)+w*b*Math.cosh(R))/w}}const E={calculatedDuration:y&&f||null,next:w=>{const T=A(w);if(y)l.done=w>=f;else{let O=0;p<1&&(O=w===0?bi(x):FE(A,w,T));const R=Math.abs(O)<=r,N=Math.abs(s-T)<=i;l.done=R&&N}return l.value=l.done?s:T,l},toString:()=>{const w=Math.min(sE(E),ry),T=aE(O=>E.next(w*O).value,w,30);return w+"ms "+T}};return E}function sw({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:l,max:c,restDelta:h=.5,restSpeed:u}){const f=e[0],m={done:!1,value:f},y=R=>l!==void 0&&R<l||c!==void 0&&R>c,x=R=>l===void 0?c:c===void 0||Math.abs(l-R)<Math.abs(c-R)?l:c;let p=n*t;const b=f+p,P=s===void 0?b:s(b);P!==b&&(p=P-f);const S=R=>-p*Math.exp(-R/r),A=R=>P+S(R),E=R=>{const N=S(R),V=A(R);m.done=Math.abs(N)<=h,m.value=m.done?P:V};let w,T;const O=R=>{y(m.value)&&(w=R,T=WE({keyframes:[m.value,x(m.value)],velocity:FE(A,R,m.value),damping:i,stiffness:o,restDelta:h,restSpeed:u}))};return O(0),{calculatedDuration:null,next:R=>{let N=!1;return!T&&w===void 0&&(N=!0,E(R),O(R)),w!==void 0&&R>=w?T.next(R-w):(!N&&E(R),m)}}}const GL=fh(.42,0,1,1),ZL=fh(0,0,.58,1),VE=fh(.42,0,.58,1),YL=e=>Array.isArray(e)&&typeof e[0]!="number",aw={linear:cr,easeIn:GL,easeInOut:VE,easeOut:ZL,circIn:Zb,circInOut:SE,circOut:_E,backIn:Gb,backInOut:xE,backOut:bE,anticipate:wE},lw=e=>{if(Wb(e)){Qo(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,i]=e;return fh(t,n,r,i)}else if(typeof e=="string")return Qo(aw[e]!==void 0,`Invalid easing type '${e}'`),aw[e];return e};function KL(e,t,n){const r=[],i=n||zE,o=e.length-1;for(let s=0;s<o;s++){let l=i(e[s],e[s+1]);if(t){const c=Array.isArray(t)?t[s]||cr:t;l=dh(c,l)}r.push(l)}return r}function XL(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(Qo(o===t.length,"Both input and output ranges must be the same length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=KL(t,r,i),c=l.length,h=u=>{if(s&&u<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const m=pl(e[f],e[f+1],u);return l[f](m)};return n?u=>h(fo(e[0],e[o-1],u)):h}function JL(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=pl(0,t,r);e.push(Je(n,1,i))}}function QL(e){const t=[0];return JL(t,e.length-1),t}function tN(e,t){return e.map(n=>n*t)}function eN(e,t){return e.map(()=>t||VE).splice(0,e.length-1)}function Gf({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=YL(r)?r.map(lw):lw(r),o={done:!1,value:t[0]},s=tN(n&&n.length===t.length?n:QL(t),e),l=XL(s,t,{ease:Array.isArray(i)?i:eN(t,i)});return{calculatedDuration:e,next:c=>(o.value=l(c),o.done=c>=e,o)}}const nN=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ue.update(t,!0),stop:()=>ts(t),now:()=>Nn.isProcessing?Nn.timestamp:wi.now()}},rN={decay:sw,inertia:sw,tween:Gf,keyframes:Gf,spring:WE},iN=e=>e/100;class t0 extends DE{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:i,keyframes:o}=this.options,s=(i==null?void 0:i.KeyframeResolver)||Jb,l=(c,h)=>this.onKeyframesResolved(c,h);this.resolver=new s(o,l,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=this.options,l=Fb(n)?n:rN[n]||Gf;let c,h;l!==Gf&&typeof t[0]!="number"&&(process.env.NODE_ENV!=="production"&&Qo(t.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),c=dh(iN,zE(t[0],t[1])),t=[0,100]);const u=l({...this.options,keyframes:t});o==="mirror"&&(h=l({...this.options,keyframes:[...t].reverse(),velocity:-s})),u.calculatedDuration===null&&(u.calculatedDuration=sE(u));const{calculatedDuration:f}=u,m=f+i,y=m*(r+1)-i;return{generator:u,mirroredGenerator:h,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:m,totalDuration:y}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:R}=this.options;return{done:!0,value:R[R.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:s,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:h,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return o.next(0);const{delay:m,repeat:y,repeatType:x,repeatDelay:p,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const P=this.currentTime-m*(this.speed>=0?1:-1),S=this.speed>=0?P<0:P>u;this.currentTime=Math.max(P,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let A=this.currentTime,E=o;if(y){const R=Math.min(this.currentTime,u)/f;let N=Math.floor(R),V=R%1;!V&&R>=1&&(V=1),V===1&&N--,N=Math.min(N,y+1),!!(N%2)&&(x==="reverse"?(V=1-V,p&&(V-=p/f)):x==="mirror"&&(E=s)),A=fo(0,1,V)*f}const w=S?{done:!1,value:c[0]}:E.next(A);l&&(w.value=l(w.value));let{done:T}=w;!S&&h!==null&&(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return O&&i!==void 0&&(w.value=Pp(c,this.options,i)),b&&b(w.value),O&&this.finish(),w}get duration(){const{resolved:t}=this;return t?ao(t.calculatedDuration):0}get time(){return ao(this.currentTime)}set time(t){t=bi(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ao(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=nN,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const oN=new Set(["opacity","clipPath","filter","transform"]);function sN(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:l="easeInOut",times:c}={}){const h={[t]:n};c&&(h.offset=c);const u=cE(l,i);return Array.isArray(u)&&(h.easing=u),e.animate(h,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"})}const aN=Tb(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Zf=10,lN=2e4;function cN(e){return Fb(e.type)||e.type==="spring"||!lE(e.ease)}function uN(e,t){const n=new t0({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let o=0;for(;!r.done&&o<lN;)r=n.sample(o),i.push(r.value),o+=Zf;return{times:void 0,keyframes:i,duration:o-Zf,ease:"linear"}}const UE={anticipate:wE,backInOut:xE,circInOut:SE};function hN(e){return e in UE}class cw extends DE{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:o}=this.options;this.resolver=new jE(o,(s,l)=>this.onKeyframesResolved(s,l),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:o,type:s,motionValue:l,name:c,startTime:h}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof o=="string"&&Hf()&&hN(o)&&(o=UE[o]),cN(this.options)){const{onComplete:f,onUpdate:m,motionValue:y,element:x,...p}=this.options,b=uN(t,p);t=b.keyframes,t.length===1&&(t[1]=t[0]),r=b.duration,i=b.times,o=b.ease,s="keyframes"}const u=sN(l.owner.current,c,t,{...this.options,duration:r,times:i,ease:o});return u.startTime=h??this.calcStartTime(),this.pendingTimeline?(qx(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;l.set(Pp(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:i,type:s,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ao(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ao(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=bi(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return cr;const{animation:r}=n;qx(r,t)}return cr}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:o,ease:s,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:h,onUpdate:u,onComplete:f,element:m,...y}=this.options,x=new t0({...y,keyframes:r,duration:i,type:o,ease:s,times:l,isGenerator:!0}),p=bi(this.time);h.setWithVelocity(x.sample(p-Zf).value,x.sample(p).value,Zf)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:o,damping:s,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:h}=n.owner.getProps();return aN()&&r&&oN.has(r)&&!c&&!h&&!i&&o!=="mirror"&&s!==0&&l!=="inertia"}}const fN={type:"spring",stiffness:500,damping:25,restSpeed:10},dN=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),pN={type:"keyframes",duration:.8},mN={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},gN=(e,{keyframes:t})=>t.length>2?pN:ba.has(e)?e.startsWith("scale")?dN(t[1]):fN:mN;function yN({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:l,from:c,elapsed:h,...u}){return!!Object.keys(u).length}const e0=(e,t,n,r={},i,o)=>s=>{const l=zb(r,e)||{},c=l.delay||r.delay||0;let{elapsed:h=0}=r;h=h-bi(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-h,onUpdate:m=>{t.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{s(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:o?void 0:i};yN(l)||(u={...u,...gN(e,u)}),u.duration&&(u.duration=bi(u.duration)),u.repeatDelay&&(u.repeatDelay=bi(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),f&&!o&&t.get()!==void 0){const m=Pp(u.keyframes,l);if(m!==void 0)return Ue.update(()=>{u.onUpdate(m),u.onComplete()}),new NR([])}return!o&&cw.supports(u)?new cw(u):new t0(u)};function vN({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function HE(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:s=e.getDefaultTransition(),transitionEnd:l,...c}=t;r&&(s=r);const h=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const f in c){const m=e.getValue(f,(o=e.latestValues[f])!==null&&o!==void 0?o:null),y=c[f];if(y===void 0||u&&vN(u,f))continue;const x={delay:n,...zb(s||{},f)};let p=!1;if(window.MotionHandoffAnimation){const P=mE(e);if(P){const S=window.MotionHandoffAnimation(P,f,Ue);S!==null&&(x.startTime=S,p=!0)}}oy(e,f),m.start(e0(f,m,y,e.shouldReduceMotion&&dE.has(f)?{type:!1}:x,e,p));const b=m.animation;b&&h.push(b)}return l&&Promise.all(h).then(()=>{Ue.update(()=>{l&&KR(e,l)})}),h}function fy(e,t,n={}){var r;const i=Sp(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(HE(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:m}=o;return bN(e,t,u+h,f,m,n)}:()=>Promise.resolve(),{when:c}=o;if(c){const[h,u]=c==="beforeChildren"?[s,l]:[l,s];return h().then(()=>u())}else return Promise.all([s(),l(n.delay)])}function bN(e,t,n=0,r=0,i=1,o){const s=[],l=(e.variantChildren.size-1)*r,c=i===1?(h=0)=>h*r:(h=0)=>l-h*r;return Array.from(e.variantChildren).sort(xN).forEach((h,u)=>{h.notify("AnimationStart",t),s.push(fy(h,t,{...o,delay:n+c(u)}).then(()=>h.notify("AnimationComplete",t)))}),Promise.all(s)}function xN(e,t){return e.sortNodePosition(t)}function wN(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>fy(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=fy(e,t,n);else{const i=typeof t=="function"?Sp(e,t,n.custom):t;r=Promise.all(HE(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const _N=Cb.length;function qE(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?qE(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<_N;n++){const r=Cb[n],i=e.props[r];(_u(i)||i===!1)&&(t[r]=i)}return t}const SN=[...Eb].reverse(),PN=Eb.length;function AN(e){return t=>Promise.all(t.map(({animation:n,options:r})=>wN(e,n,r)))}function TN(e){let t=AN(e),n=uw(),r=!0;const i=c=>(h,u)=>{var f;const m=Sp(e,u,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(m){const{transition:y,transitionEnd:x,...p}=m;h={...h,...p,...x}}return h};function o(c){t=c(e)}function s(c){const{props:h}=e,u=qE(e.parent)||{},f=[],m=new Set;let y={},x=1/0;for(let b=0;b<PN;b++){const P=SN[b],S=n[P],A=h[P]!==void 0?h[P]:u[P],E=_u(A),w=P===c?S.isActive:null;w===!1&&(x=b);let T=A===u[P]&&A!==h[P]&&E;if(T&&r&&e.manuallyAnimateOnMount&&(T=!1),S.protectedKeys={...y},!S.isActive&&w===null||!A&&!S.prevProp||wp(A)||typeof A=="boolean")continue;const O=EN(S.prevProp,A);let R=O||P===c&&S.isActive&&!T&&E||b>x&&E,N=!1;const V=Array.isArray(A)?A:[A];let D=V.reduce(i(P),{});w===!1&&(D={});const{prevResolvedValues:j={}}=S,K={...j,...D},H=G=>{R=!0,m.has(G)&&(N=!0,m.delete(G)),S.needsAnimating[G]=!0;const J=e.getValue(G);J&&(J.liveStyle=!1)};for(const G in K){const J=D[G],lt=j[G];if(y.hasOwnProperty(G))continue;let q=!1;ny(J)&&ny(lt)?q=!oE(J,lt):q=J!==lt,q?J!=null?H(G):m.add(G):J!==void 0&&m.has(G)?H(G):S.protectedKeys[G]=!0}S.prevProp=A,S.prevResolvedValues=D,S.isActive&&(y={...y,...D}),r&&e.blockInitialAnimation&&(R=!1),R&&(!(T&&O)||N)&&f.push(...V.map(G=>({animation:G,options:{type:P}})))}if(m.size){const b={};m.forEach(P=>{const S=e.getBaseTarget(P),A=e.getValue(P);A&&(A.liveStyle=!0),b[P]=S??null}),f.push({animation:b})}let p=!!f.length;return r&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function l(c,h){var u;if(n[c].isActive===h)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(m=>{var y;return(y=m.animationState)===null||y===void 0?void 0:y.setActive(c,h)}),n[c].isActive=h;const f=s(c);for(const m in n)n[m].protectedKeys={};return f}return{animateChanges:s,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=uw(),r=!0}}}function EN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!oE(t,e):!1}function Ns(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function uw(){return{animate:Ns(!0),whileInView:Ns(),whileHover:Ns(),whileTap:Ns(),whileDrag:Ns(),whileFocus:Ns(),exit:Ns()}}class os{constructor(t){this.isMounted=!1,this.node=t}update(){}}class CN extends os{constructor(t){super(t),t.animationState||(t.animationState=TN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();wp(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let ON=0;class MN extends os{constructor(){super(...arguments),this.id=ON++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const kN={animation:{Feature:CN},exit:{Feature:MN}};function Tu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ph(e){return{point:{x:e.pageX,y:e.pageY}}}const $N=e=>t=>Vb(t)&&e(t,ph(t));function iu(e,t,n,r){return Tu(e,t,$N(n),r)}const hw=(e,t)=>Math.abs(e-t);function IN(e,t){const n=hw(e.x,t.x),r=hw(e.y,t.y);return Math.sqrt(n**2+r**2)}class GE{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=zm(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,y=IN(f.offset,{x:0,y:0})>=3;if(!m&&!y)return;const{point:x}=f,{timestamp:p}=Nn;this.history.push({...x,timestamp:p});const{onStart:b,onMove:P}=this.handlers;m||(b&&b(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,f)},this.handlePointerMove=(f,m)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Bm(m,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(f,m)=>{this.end();const{onEnd:y,onSessionEnd:x,resumeAnimation:p}=this.handlers;if(this.dragSnapToOrigin&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=zm(f.type==="pointercancel"?this.lastMoveEventInfo:Bm(m,this.transformPagePoint),this.history);this.startEvent&&y&&y(f,b),x&&x(f,b)},!Vb(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const s=ph(t),l=Bm(s,this.transformPagePoint),{point:c}=l,{timestamp:h}=Nn;this.history=[{...c,timestamp:h}];const{onSessionStart:u}=n;u&&u(t,zm(l,this.history)),this.removeListeners=dh(iu(this.contextWindow,"pointermove",this.handlePointerMove),iu(this.contextWindow,"pointerup",this.handlePointerUp),iu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ts(this.updatePoint)}}function Bm(e,t){return t?{point:t(e.point)}:e}function fw(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zm({point:e},t){return{point:e,delta:fw(e,ZE(t)),offset:fw(e,RN(t)),velocity:LN(t,.1)}}function RN(e){return e[0]}function ZE(e){return e[e.length-1]}function LN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=ZE(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>bi(t)));)n--;if(!r)return{x:0,y:0};const o=ao(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}const YE=1e-4,NN=1-YE,jN=1+YE,KE=.01,DN=0-KE,BN=0+KE;function Sr(e){return e.max-e.min}function zN(e,t,n){return Math.abs(e-t)<=n}function dw(e,t,n,r=.5){e.origin=r,e.originPoint=Je(t.min,t.max,e.origin),e.scale=Sr(n)/Sr(t),e.translate=Je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=NN&&e.scale<=jN||isNaN(e.scale))&&(e.scale=1),(e.translate>=DN&&e.translate<=BN||isNaN(e.translate))&&(e.translate=0)}function ou(e,t,n,r){dw(e.x,t.x,n.x,r?r.originX:void 0),dw(e.y,t.y,n.y,r?r.originY:void 0)}function pw(e,t,n){e.min=n.min+t.min,e.max=e.min+Sr(t)}function FN(e,t,n){pw(e.x,t.x,n.x),pw(e.y,t.y,n.y)}function mw(e,t,n){e.min=t.min-n.min,e.max=e.min+Sr(t)}function su(e,t,n){mw(e.x,t.x,n.x),mw(e.y,t.y,n.y)}function WN(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Je(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Je(n,e,r.max):Math.min(e,n)),e}function gw(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function VN(e,{top:t,left:n,bottom:r,right:i}){return{x:gw(e.x,n,i),y:gw(e.y,t,r)}}function yw(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function UN(e,t){return{x:yw(e.x,t.x),y:yw(e.y,t.y)}}function HN(e,t){let n=.5;const r=Sr(e),i=Sr(t);return i>r?n=pl(t.min,t.max-r,e.min):r>i&&(n=pl(e.min,e.max-i,t.min)),fo(0,1,n)}function qN(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const dy=.35;function GN(e=dy){return e===!1?e=0:e===!0&&(e=dy),{x:vw(e,"left","right"),y:vw(e,"top","bottom")}}function vw(e,t,n){return{min:bw(e,t),max:bw(e,n)}}function bw(e,t){return typeof e=="number"?e:e[t]||0}const xw=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ya=()=>({x:xw(),y:xw()}),ww=()=>({min:0,max:0}),an=()=>({x:ww(),y:ww()});function Lr(e){return[e("x"),e("y")]}function XE({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ZN({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function YN(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Fm(e){return e===void 0||e===1}function py({scale:e,scaleX:t,scaleY:n}){return!Fm(e)||!Fm(t)||!Fm(n)}function Ws(e){return py(e)||JE(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function JE(e){return _w(e.x)||_w(e.y)}function _w(e){return e&&e!=="0%"}function Yf(e,t,n){const r=e-n,i=t*r;return n+i}function Sw(e,t,n,r,i){return i!==void 0&&(e=Yf(e,i,r)),Yf(e,n,r)+t}function my(e,t=0,n=1,r,i){e.min=Sw(e.min,t,n,r,i),e.max=Sw(e.max,t,n,r,i)}function QE(e,{x:t,y:n}){my(e.x,t.translate,t.scale,t.originPoint),my(e.y,n.translate,n.scale,n.originPoint)}const Pw=.999999999999,Aw=1.0000000000001;function KN(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let l=0;l<i;l++){o=n[l],s=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Xa(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,QE(e,s)),r&&Ws(o.latestValues)&&Xa(e,o.latestValues))}t.x<Aw&&t.x>Pw&&(t.x=1),t.y<Aw&&t.y>Pw&&(t.y=1)}function Ka(e,t){e.min=e.min+t,e.max=e.max+t}function Tw(e,t,n,r,i=.5){const o=Je(e.min,e.max,i);my(e,t,n,o,r)}function Xa(e,t){Tw(e.x,t.x,t.scaleX,t.scale,t.originX),Tw(e.y,t.y,t.scaleY,t.scale,t.originY)}function tC(e,t){return XE(YN(e.getBoundingClientRect(),t))}function XN(e,t,n){const r=tC(e,n),{scroll:i}=t;return i&&(Ka(r.x,i.offset.x),Ka(r.y,i.offset.y)),r}const eC=({current:e})=>e?e.ownerDocument.defaultView:null,JN=new WeakMap;class QN{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=an(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ph(u).point)},o=(u,f)=>{const{drag:m,dragPropagation:y,onDragStart:x}=this.getProps();if(m&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=HR(m),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Lr(b=>{let P=this.getAxisMotionValue(b).get()||0;if(xi.test(P)){const{projection:S}=this.visualElement;if(S&&S.layout){const A=S.layout.layoutBox[b];A&&(P=Sr(A)*(parseFloat(P)/100))}}this.originPoint[b]=P}),x&&Ue.postRender(()=>x(u,f)),oy(this.visualElement,"transform");const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},s=(u,f)=>{const{dragPropagation:m,dragDirectionLock:y,onDirectionLock:x,onDrag:p}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:b}=f;if(y&&this.currentDirection===null){this.currentDirection=tj(b),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),p&&p(u,f)},l=(u,f)=>this.stop(u,f),c=()=>Lr(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:h}=this.getProps();this.panSession=new GE(t,{onSessionStart:i,onStart:o,onMove:s,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,contextWindow:eC(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&Ue.postRender(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!tf(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=WN(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,o=this.constraints;n&&Ga(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=VN(i.layoutBox,n):this.constraints=!1,this.elastic=GN(r),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Lr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=qN(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ga(t))return!1;const r=t.current;Qo(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=XN(r,i.root,this.visualElement.getTransformPagePoint());let s=UN(i.layout.layoutBox,o);if(n){const l=n(ZN(s));this.hasMutatedConstraints=!!l,l&&(s=XE(l))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},h=Lr(u=>{if(!tf(u,n,this.currentDirection))return;let f=c&&c[u]||{};s&&(f={min:0,max:0});const m=i?200:1e6,y=i?40:1e7,x={type:"inertia",velocity:r?t[u]:0,bounceStiffness:m,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(u,x)});return Promise.all(h).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return oy(this.visualElement,t),r.start(e0(t,r,0,n,this.visualElement,!1))}stopAnimation(){Lr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Lr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Lr(n=>{const{drag:r}=this.getProps();if(!tf(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:l}=i.layout.layoutBox[n];o.set(t[n]-Je(s,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ga(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Lr(s=>{const l=this.getAxisMotionValue(s);if(l&&this.constraints!==!1){const c=l.get();i[s]=HN({min:c,max:c},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Lr(s=>{if(!tf(s,t,null))return;const l=this.getAxisMotionValue(s),{min:c,max:h}=this.constraints[s];l.set(Je(c,h,i[s]))})}addListeners(){if(!this.visualElement.current)return;JN.set(this.visualElement,this);const t=this.visualElement.current,n=iu(t,"pointerdown",c=>{const{drag:h,dragListener:u=!0}=this.getProps();h&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Ga(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ue.read(r);const s=Tu(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h})=>{this.isDragging&&h&&(Lr(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=c[u].translate,f.set(f.get()+c[u].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=dy,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:l}}}function tf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function tj(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class ej extends os{constructor(t){super(t),this.removeGroupControls=cr,this.removeListeners=cr,this.controls=new QN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cr}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ew=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class nj extends os{constructor(){super(...arguments),this.removePointerDownListener=cr}onPointerDown(t){this.session=new GE(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:eC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ew(t),onStart:Ew(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&Ue.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=iu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Lf={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Cw(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Nc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Wt.test(e))e=parseFloat(e);else return e;const n=Cw(e,t.target.x),r=Cw(e,t.target.y);return`${n}% ${r}%`}},rj={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=es.parse(e);if(i.length>5)return r;const o=es.createTransformer(e),s=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;i[0+s]/=l,i[1+s]/=c;const h=Je(l,c,.5);return typeof i[2+s]=="number"&&(i[2+s]/=h),typeof i[3+s]=="number"&&(i[3+s]/=h),o(i)}};class ij extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;PR(oj),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Lf.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,s=r.projection;return s&&(s.isPresent=o,i||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Ue.postRender(()=>{const l=s.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Mb.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function nC(e){const[t,n]=BT(),r=v.useContext(_b);return Ze.jsx(ij,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(qT),isPresent:t,safeToRemove:n})}const oj={borderRadius:{...Nc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Nc,borderTopRightRadius:Nc,borderBottomLeftRadius:Nc,borderBottomRightRadius:Nc,boxShadow:rj};function sj(e,t,n){const r=qn(e)?e:Pu(e);return r.start(e0("",r,t,n)),r.animation}function aj(e){return e instanceof SVGElement&&e.tagName!=="svg"}const lj=(e,t)=>e.depth-t.depth;class cj{constructor(){this.children=[],this.isDirty=!1}add(t){Ub(this.children,t),this.isDirty=!0}remove(t){Hb(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(lj),this.isDirty=!1,this.children.forEach(t)}}function uj(e,t){const n=wi.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(ts(r),e(o-t))};return Ue.read(r,!0),()=>ts(r)}const rC=["TopLeft","TopRight","BottomLeft","BottomRight"],hj=rC.length,Ow=e=>typeof e=="string"?parseFloat(e):e,Mw=e=>typeof e=="number"||Wt.test(e);function fj(e,t,n,r,i,o){i?(e.opacity=Je(0,n.opacity!==void 0?n.opacity:1,dj(r)),e.opacityExit=Je(t.opacity!==void 0?t.opacity:1,0,pj(r))):o&&(e.opacity=Je(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;s<hj;s++){const l=`border${rC[s]}Radius`;let c=kw(t,l),h=kw(n,l);if(c===void 0&&h===void 0)continue;c||(c=0),h||(h=0),c===0||h===0||Mw(c)===Mw(h)?(e[l]=Math.max(Je(Ow(c),Ow(h),r),0),(xi.test(h)||xi.test(c))&&(e[l]+="%")):e[l]=h}(t.rotate||n.rotate)&&(e.rotate=Je(t.rotate||0,n.rotate||0,r))}function kw(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const dj=iC(0,.5,_E),pj=iC(.5,.95,cr);function iC(e,t,n){return r=>r<e?0:r>t?1:n(pl(e,t,r))}function $w(e,t){e.min=t.min,e.max=t.max}function kr(e,t){$w(e.x,t.x),$w(e.y,t.y)}function Iw(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Rw(e,t,n,r,i){return e-=t,e=Yf(e,1/n,r),i!==void 0&&(e=Yf(e,1/i,r)),e}function mj(e,t=0,n=1,r=.5,i,o=e,s=e){if(xi.test(t)&&(t=parseFloat(t),t=Je(s.min,s.max,t/100)-s.min),typeof t!="number")return;let l=Je(o.min,o.max,r);e===o&&(l-=t),e.min=Rw(e.min,t,n,l,i),e.max=Rw(e.max,t,n,l,i)}function Lw(e,t,[n,r,i],o,s){mj(e,t[n],t[r],t[i],t.scale,o,s)}const gj=["x","scaleX","originX"],yj=["y","scaleY","originY"];function Nw(e,t,n,r){Lw(e.x,t,gj,n?n.x:void 0,r?r.x:void 0),Lw(e.y,t,yj,n?n.y:void 0,r?r.y:void 0)}function jw(e){return e.translate===0&&e.scale===1}function oC(e){return jw(e.x)&&jw(e.y)}function Dw(e,t){return e.min===t.min&&e.max===t.max}function vj(e,t){return Dw(e.x,t.x)&&Dw(e.y,t.y)}function Bw(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function sC(e,t){return Bw(e.x,t.x)&&Bw(e.y,t.y)}function zw(e){return Sr(e.x)/Sr(e.y)}function Fw(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class bj{constructor(){this.members=[]}add(t){Ub(this.members,t),t.scheduleRender()}remove(t){if(Hb(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function xj(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:u,rotateX:f,rotateY:m,skewX:y,skewY:x}=n;h&&(r=`perspective(${h}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),m&&(r+=`rotateY(${m}deg) `),y&&(r+=`skewX(${y}deg) `),x&&(r+=`skewY(${x}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Vs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Xc=typeof window<"u"&&window.MotionDebug!==void 0,Wm=["","X","Y","Z"],wj={visibility:"hidden"},Ww=1e3;let _j=0;function Vm(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function aC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=mE(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&aC(r)}function lC({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},l=t==null?void 0:t()){this.id=_j++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Xc&&(Vs.totalNodes=Vs.resolvedTargetDeltas=Vs.recalculatedProjection=0),this.nodes.forEach(Aj),this.nodes.forEach(Mj),this.nodes.forEach(kj),this.nodes.forEach(Tj),Xc&&window.MotionDebug.record(Vs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new cj)}addEventListener(s,l){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new qb),this.eventHandlers.get(s).add(l)}notifyListeners(s,...l){const c=this.eventHandlers.get(s);c&&c.notify(...l)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=aj(s),this.instance=s;const{layoutId:c,layout:h,visualElement:u}=this.options;if(u&&!u.current&&u.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(h||c)&&(this.isLayoutDirty=!0),e){let f;const m=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=uj(m,250),Lf.hasAnimatedSinceResize&&(Lf.hasAnimatedSinceResize=!1,this.nodes.forEach(Uw))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&u&&(c||h)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:m,hasRelativeTargetChanged:y,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||Nj,{onLayoutAnimationStart:b,onLayoutAnimationComplete:P}=u.getProps(),S=!this.targetLayout||!sC(this.targetLayout,x)||y,A=!m&&y;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||m&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,A);const E={...zb(p,"layout"),onPlay:b,onComplete:P};(u.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else m||Uw(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ts(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach($j),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&aC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Vw);return}this.isUpdating||this.nodes.forEach(Cj),this.isUpdating=!1,this.nodes.forEach(Oj),this.nodes.forEach(Sj),this.nodes.forEach(Pj),this.clearAllSnapshots();const l=wi.now();Nn.delta=fo(0,1e3/60,l-Nn.timestamp),Nn.timestamp=l,Nn.isProcessing=!0,Im.update.process(Nn),Im.preRender.process(Nn),Im.render.process(Nn),Nn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Mb.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ej),this.sharedNodes.forEach(Ij)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=an(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(l=!1),l){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!oC(this.projectionDelta),c=this.getTransformTemplate(),h=c?c(this.latestValues,""):void 0,u=h!==this.prevTransformTemplateValue;s&&(l||Ws(this.latestValues)||u)&&(i(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return s&&(c=this.removeTransform(c)),jj(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var s;const{visualElement:l}=this.options;if(!l)return an();const c=l.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(Dj))){const{scroll:u}=this.root;u&&(Ka(c.x,u.offset.x),Ka(c.y,u.offset.y))}return c}removeElementScroll(s){var l;const c=an();if(kr(c,s),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return c;for(let h=0;h<this.path.length;h++){const u=this.path[h],{scroll:f,options:m}=u;u!==this.root&&f&&m.layoutScroll&&(f.wasRoot&&kr(c,s),Ka(c.x,f.offset.x),Ka(c.y,f.offset.y))}return c}applyTransform(s,l=!1){const c=an();kr(c,s);for(let h=0;h<this.path.length;h++){const u=this.path[h];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Xa(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ws(u.latestValues)&&Xa(c,u.latestValues)}return Ws(this.latestValues)&&Xa(c,this.latestValues),c}removeTransform(s){const l=an();kr(l,s);for(let c=0;c<this.path.length;c++){const h=this.path[c];if(!h.instance||!Ws(h.latestValues))continue;py(h.latestValues)&&h.updateSnapshot();const u=an(),f=h.measurePageBox();kr(u,f),Nw(l,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,u)}return Ws(this.latestValues)&&Nw(l,this.latestValues),l}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Nn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var l;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==c;if(!(s||h&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:m}=this.options;if(!(!this.layout||!(f||m))){if(this.resolvedRelativeTargetAt=Nn.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=an(),this.relativeTargetOrigin=an(),su(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),kr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=an(),this.targetWithTransforms=an()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),FN(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):kr(this.target,this.layout.layoutBox),QE(this.target,this.targetDelta)):kr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const y=this.getClosestProjectingParent();y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=an(),this.relativeTargetOrigin=an(),su(this.relativeTargetOrigin,this.target,y.target),kr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Xc&&Vs.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||py(this.parent.latestValues)||JE(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let h=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(h=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Nn.timestamp&&(h=!1),h)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;kr(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,y=this.treeScale.y;KN(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=an());const{target:x}=l;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Iw(this.prevProjectionDelta.x,this.projectionDelta.x),Iw(this.prevProjectionDelta.y,this.projectionDelta.y)),ou(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==y||!Fw(this.projectionDelta.x,this.prevProjectionDelta.x)||!Fw(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),Xc&&Vs.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),s){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ya(),this.projectionDelta=Ya(),this.projectionDeltaWithTransform=Ya()}setAnimationOrigin(s,l=!1){const c=this.snapshot,h=c?c.latestValues:{},u={...this.latestValues},f=Ya();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const m=an(),y=c?c.source:void 0,x=this.layout?this.layout.source:void 0,p=y!==x,b=this.getStack(),P=!b||b.members.length<=1,S=!!(p&&!P&&this.options.crossfade===!0&&!this.path.some(Lj));this.animationProgress=0;let A;this.mixTargetDelta=E=>{const w=E/1e3;Hw(f.x,s.x,w),Hw(f.y,s.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(su(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Rj(this.relativeTarget,this.relativeTargetOrigin,m,w),A&&vj(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=an()),kr(A,this.relativeTarget)),p&&(this.animationValues=u,fj(u,h,this.latestValues,w,S,P)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ts(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{Lf.hasAnimatedSinceResize=!0,this.currentAnimation=sj(0,Ww,{...s,onUpdate:l=>{this.mixTargetDelta(l),s.onUpdate&&s.onUpdate(l)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ww),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:l,target:c,layout:h,latestValues:u}=s;if(!(!l||!c||!h)){if(this!==s&&this.layout&&h&&cC(this.options.animationType,this.layout.layoutBox,h.layoutBox)){c=this.target||an();const f=Sr(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+f;const m=Sr(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+m}kr(l,c),Xa(l,u),ou(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(s,l){this.sharedNodes.has(s)||this.sharedNodes.set(s,new bj),this.sharedNodes.get(s).add(l);const h=l.options.initialPromotionConfig;l.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(l):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:l}=this.options;return l?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:l}=this.options;return l?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:l,preserveFollowOpacity:c}={}){const h=this.getStack();h&&h.promote(this,c),s&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let l=!1;const{latestValues:c}=s;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const h={};c.z&&Vm("z",s,h,this.animationValues);for(let u=0;u<Wm.length;u++)Vm(`rotate${Wm[u]}`,s,h,this.animationValues),Vm(`skew${Wm[u]}`,s,h,this.animationValues);s.render();for(const u in h)s.setStaticValue(u,h[u]),this.animationValues&&(this.animationValues[u]=h[u]);s.scheduleRender()}getProjectionStyles(s){var l,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return wj;const h={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,h.opacity="",h.pointerEvents=If(s==null?void 0:s.pointerEvents)||"",h.transform=u?u(this.latestValues,""):"none",h;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=If(s==null?void 0:s.pointerEvents)||""),this.hasProjected&&!Ws(this.latestValues)&&(p.transform=u?u({},""):"none",this.hasProjected=!1),p}const m=f.animationValues||f.latestValues;this.applyTransformsToTarget(),h.transform=xj(this.projectionDeltaWithTransform,this.treeScale,m),u&&(h.transform=u(m,h.transform));const{x:y,y:x}=this.projectionDelta;h.transformOrigin=`${y.origin*100}% ${x.origin*100}% 0`,f.animationValues?h.opacity=f===this?(c=(l=m.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:h.opacity=f===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const p in Uf){if(m[p]===void 0)continue;const{correct:b,applyTo:P}=Uf[p],S=h.transform==="none"?m[p]:b(m[p],f);if(P){const A=P.length;for(let E=0;E<A;E++)h[P[E]]=S}else h[p]=S}return this.options.layoutId&&(h.pointerEvents=f===this?If(s==null?void 0:s.pointerEvents)||"":"none"),h}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var l;return(l=s.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(Vw),this.root.sharedNodes.clear()}}}function Sj(e){e.updateLayout()}function Pj(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,s=n.source!==e.layout.source;o==="size"?Lr(f=>{const m=s?n.measuredBox[f]:n.layoutBox[f],y=Sr(m);m.min=r[f].min,m.max=m.min+y}):cC(o,n.layoutBox,r)&&Lr(f=>{const m=s?n.measuredBox[f]:n.layoutBox[f],y=Sr(r[f]);m.max=m.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+y)});const l=Ya();ou(l,r,n.layoutBox);const c=Ya();s?ou(c,e.applyTransform(i,!0),n.measuredBox):ou(c,r,n.layoutBox);const h=!oC(l);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:m,layout:y}=f;if(m&&y){const x=an();su(x,n.layoutBox,m.layoutBox);const p=an();su(p,r,y.layoutBox),sC(x,p)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=x,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:h,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Aj(e){Xc&&Vs.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Tj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ej(e){e.clearSnapshot()}function Vw(e){e.clearMeasurements()}function Cj(e){e.isLayoutDirty=!1}function Oj(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Uw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Mj(e){e.resolveTargetDelta()}function kj(e){e.calcProjection()}function $j(e){e.resetSkewAndRotation()}function Ij(e){e.removeLeadSnapshot()}function Hw(e,t,n){e.translate=Je(t.translate,0,n),e.scale=Je(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function qw(e,t,n,r){e.min=Je(t.min,n.min,r),e.max=Je(t.max,n.max,r)}function Rj(e,t,n,r){qw(e.x,t.x,n.x,r),qw(e.y,t.y,n.y,r)}function Lj(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Nj={duration:.45,ease:[.4,0,.1,1]},Gw=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Zw=Gw("applewebkit/")&&!Gw("chrome/")?Math.round:cr;function Yw(e){e.min=Zw(e.min),e.max=Zw(e.max)}function jj(e){Yw(e.x),Yw(e.y)}function cC(e,t,n){return e==="position"||e==="preserve-aspect"&&!zN(zw(t),zw(n),.2)}function Dj(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const Bj=lC({attachResizeListener:(e,t)=>Tu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Um={current:void 0},uC=lC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Um.current){const e=new Bj({});e.mount(window),e.setOptions({layoutScroll:!0}),Um.current=e}return Um.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),zj={pan:{Feature:nj},drag:{Feature:ej,ProjectionNode:uC,MeasureLayout:nC}};function Kw(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&Ue.postRender(()=>o(t,ph(t)))}class Fj extends os{mount(){const{current:t}=this.node;t&&(this.unmount=zR(t,n=>(Kw(this.node,n,"Start"),r=>Kw(this.node,r,"End"))))}unmount(){}}class Wj extends os{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=dh(Tu(this.node.current,"focus",()=>this.onFocus()),Tu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Xw(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=r[i];o&&Ue.postRender(()=>o(t,ph(t)))}class Vj extends os{mount(){const{current:t}=this.node;t&&(this.unmount=UR(t,n=>(Xw(this.node,n,"Start"),(r,{success:i})=>Xw(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const gy=new WeakMap,Hm=new WeakMap,Uj=e=>{const t=gy.get(e.target);t&&t(e)},Hj=e=>{e.forEach(Uj)};function qj({root:e,...t}){const n=e||document;Hm.has(n)||Hm.set(n,{});const r=Hm.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Hj,{root:e,...t})),r[i]}function Gj(e,t,n){const r=qj(t);return gy.set(e,n),r.observe(e),()=>{gy.delete(e),r.unobserve(e)}}const Zj={some:0,all:1};class Yj extends os{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Zj[i]},l=c=>{const{isIntersecting:h}=c;if(this.isInView===h||(this.isInView=h,o&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),m=h?u:f;m&&m(c)};return Gj(this.node.current,s,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Kj(t,n))&&this.startObserver()}unmount(){}}function Kj({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Xj={inView:{Feature:Yj},tap:{Feature:Vj},focus:{Feature:Wj},hover:{Feature:Fj}},Jj={layout:{ProjectionNode:uC,MeasureLayout:nC}},yy={current:null},hC={current:!1};function Qj(){if(hC.current=!0,!!Ab)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>yy.current=e.matches;e.addListener(t),t()}else yy.current=!1}const tD=[...NE,Vn,es],eD=e=>tD.find(LE(e)),Jw=new WeakMap;function nD(e,t,n){for(const r in t){const i=t[r],o=n[r];if(qn(i))e.addValue(r,i),process.env.NODE_ENV==="development"&&bp(i.version==="11.18.2",`Attempting to mix Motion versions ${i.version} with 11.18.2 may not work as expected.`);else if(qn(o))e.addValue(r,Pu(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,Pu(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Qw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class rD{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Jb,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=wi.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,Ue.render(this.render,!1,!0))};const{latestValues:c,renderState:h,onUpdate:u}=s;this.onUpdate=u,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=h,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=_p(n),this.isVariantNode=UT(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in m){const x=m[y];c[y]!==void 0&&qn(x)&&x.set(c[y],!1)}}mount(t){this.current=t,Jw.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),hC.current||Qj(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:yy.current,process.env.NODE_ENV!=="production"&&bp(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Jw.delete(this.current),this.projection&&this.projection.unmount(),ts(this.notifyUpdate),ts(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ba.has(t),i=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ml){const n=ml[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):an()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Qw.length;r++){const i=Qw[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,s=t[o];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=nD(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pu(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(IE(i)||PE(i))?i=parseFloat(i):!eD(i)&&es.test(n)&&(i=ME(t,n)),this.setBaseTarget(t,qn(i)?i.get():i)),qn(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const s=$b(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);s&&(i=s[t])}if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!qn(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new qb),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class fC extends rD{constructor(){super(...arguments),this.KeyframeResolver=jE}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;qn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function iD(e){return window.getComputedStyle(e)}class oD extends fC{constructor(){super(...arguments),this.type="html",this.renderInstance=QT}readValueFromInstance(t,n){if(ba.has(n)){const r=Xb(n);return r&&r.default||0}else{const r=iD(t),i=(KT(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return tC(t,n)}build(t,n,r){Lb(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Bb(t,n,r)}}class sD extends fC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=an}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ba.has(n)){const r=Xb(n);return r&&r.default||0}return n=tE.has(n)?n:Ob(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return rE(t,n,r)}build(t,n,r){Nb(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){eE(t,n,r,i)}mount(t){this.isSVGTag=Db(t.tagName),super.mount(t)}}const aD=(e,t)=>kb(e)?new sD(t):new oD(t,{allowProjection:e!==v.Fragment}),lD=IR({...kN,...Xj,...zj,...Jj},aD),Kf=ZI(lD),cD={div:"div",span:"span",p:"p",hr:"hr",a:"a",strong:"strong",em:"em",del:"del",li:"li",ul:"ul",ol:"ol",form:"form",img:"img",header:"header",footer:"footer",section:"section",nav:"nav",main:"main",article:"article",aside:"aside",figure:"figure",figcaption:"figcaption",th:"th",td:"td",caption:"caption",blockquote:"blockquote",address:"address",time:"time",legend:"legend",label:"label",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",code:"code"},uD=new Set(["motion","initial","animate","exit","transition","variants","whileHover","whileTap","whileFocus","whileInView","animateLayout"]);function U(e,t,...n){const{style:r,className:i,...o}=t||{};if(o.motion){const l={};for(const h of uD)if(h in o){const u=h==="animateLayout"?"layout":h;let f=o[h];u==="transition"&&f&&typeof f=="object"&&(f={...f,repeat:Math.max(0,Number(f.repeat)||0)}),l[u]=f,delete o[h]}const c=Kf[e]||Kf.div;return v.createElement(c,{...o,className:i,style:r||{},...l},...n)}delete o.animateLayout;const s=cD[e];return s?v.createElement(s,{...o,className:i,style:r||{}},...n):v.createElement(e,{...o,className:i,style:r||{}},...n)}const hD={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},dC={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},pC=["base","sm","md","lg","xl","2xl"],bn={0:"0px","0.5":"0.125rem",1:"0.25rem","1.5":"0.375rem",2:"0.5rem","2.5":"0.625rem",3:"0.75rem","3.5":"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},ef={xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"},t_={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",auto:"auto",screen:"100vw",fit:"fit-content",max:"max-content",min:"min-content"},nf={"flex-row":"row","flex-row-reverse":"row-reverse","flex-col":"column","flex-col-reverse":"column-reverse"},rf={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-baseline":"baseline","items-stretch":"stretch"},of={"justify-start":"flex-start","justify-end":"flex-end","justify-center":"center","justify-between":"space-between","justify-around":"space-around","justify-evenly":"space-evenly"},sf={"rounded-none":"0px","rounded-sm":"0.125rem",rounded:"0.25rem","rounded-md":"0.375rem","rounded-lg":"0.5rem","rounded-xl":"0.75rem","rounded-2xl":"1rem","rounded-3xl":"1.5rem","rounded-full":"9999px"},fD=["hidden","block","flex","grid","inline","inline-block","inline-flex"];function n0(e,t,n,r){const i=new Map,o=e.split(/\s+/).filter(Boolean);for(const s of o){const l=new RegExp(n.source).exec(s);if(l){i.set(l[1],r(l));continue}const c=new RegExp(t.source).exec(s);c&&i.set("base",r([null,null,c[1]]))}return i}function mC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(flex-row|flex-row-reverse|flex-col|flex-col-reverse)$/);if(i&&nf[i[2]]){t.set(i[1],nf[i[2]]);continue}nf[r]&&t.set("base",nf[r])}return t}function gC(e){return n0(e,/^gap-(\d+(?:\.\d+)?)$/,/^(sm|md|lg|xl|2xl):gap-(\d+(?:\.\d+)?)$/,t=>bn[t[2]]||`${t[2]}px`)}function yC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):w-(.+)$/);if(i){const s=t_[i[2]]||bn[i[2]]||i[2];s&&t.set(i[1],s);continue}const o=r.match(/^w-(.+)$/);if(o){const s=t_[o[1]]||bn[o[1]]||o[1];s&&t.set("base",s)}}return t}function dD(e){return n0(e,/^min-h-\[([^\]]+)\]$/,/^(sm|md|lg|xl|2xl):min-h-\[([^\]]+)\]$/,t=>t[2])}function vC(e){const t=new Map,n=new Map,r=new Map,i=new Map,o=new Map,s=new Map,l=new Map,c=e.split(/\s+/).filter(Boolean);for(const h of c)for(const[u,f]of[["m-",t],["mt-",n],["mr-",r],["mb-",i],["ml-",o],["mx-",s],["my-",l]]){const m=h.match(new RegExp(`^(sm|md|lg|xl|2xl):${u}(\\d+(?:\\.\\d+)?)$`));if(m&&bn[m[2]]){f.set(m[1],bn[m[2]]);break}const y=h.match(new RegExp(`^${u}(\\d+(?:\\.\\d+)?)$`));if(y&&bn[y[1]]){f.set("base",bn[y[1]]);break}}return{all:t,t:n,r,b:i,l:o,x:s,y:l}}function bC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(items-start|items-end|items-center|items-baseline|items-stretch)$/);if(i&&rf[i[2]]){t.set(i[1],rf[i[2]]);continue}rf[r]&&t.set("base",rf[r])}return t}function xC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(justify-start|justify-end|justify-center|justify-between|justify-around|justify-evenly)$/);if(i&&of[i[2]]){t.set(i[1],of[i[2]]);continue}of[r]&&t.set("base",of[r])}return t}function wC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(rounded-none|rounded-sm|rounded|rounded-md|rounded-lg|rounded-xl|rounded-2xl|rounded-3xl|rounded-full)$/);if(i&&sf[i[2]]){t.set(i[1],sf[i[2]]);continue}sf[r]&&t.set("base",sf[r])}return t}function r0(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(hidden|block|flex|grid|inline|inline-block|inline-flex)$/);if(i){t.set(i[1],i[2]==="hidden"?"none":i[2]);continue}fD.includes(r)&&t.set("base",r==="hidden"?"none":r)}return t}function i0(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):grid-cols-(\d+)$/);if(i){t.set(i[1],parseInt(i[2],10));continue}const o=r.match(/^grid-cols-(\d+)$/);o&&t.set("base",parseInt(o[1],10))}return t}function pD(e){return n0(e,/^grid-cols-\[([^\]]+)\]$/,/^(sm|md|lg|xl|2xl):grid-cols-\[([^\]]+)\]$/,t=>t[2].replace(/_/g," "))}function o0(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/);if(i&&ef[i[2]]){t.set(i[1],ef[i[2]]);continue}const o=r.match(/^text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/);o&&ef[o[1]]&&t.set("base",ef[o[1]])}return t}function s0(e){const t=new Map,n=new Map,r=new Map,i=e.split(/\s+/).filter(Boolean);for(const o of i){const s=o.match(/^(sm|md|lg|xl|2xl):px-(\d+(?:\.\d+)?)$/);if(s&&bn[s[2]]){t.set(s[1],bn[s[2]]);continue}const l=o.match(/^px-(\d+(?:\.\d+)?)$/);if(l&&bn[l[1]]){t.set("base",bn[l[1]]);continue}const c=o.match(/^(sm|md|lg|xl|2xl):py-(\d+(?:\.\d+)?)$/);if(c&&bn[c[2]]){n.set(c[1],bn[c[2]]);continue}const h=o.match(/^py-(\d+(?:\.\d+)?)$/);if(h&&bn[h[1]]){n.set("base",bn[h[1]]);continue}const u=o.match(/^(sm|md|lg|xl|2xl):p-(\d+(?:\.\d+)?)$/);if(u&&bn[u[2]]){r.set(u[1],bn[u[2]]);continue}const f=o.match(/^p-(\d+(?:\.\d+)?)$/);f&&bn[f[1]]&&r.set("base",bn[f[1]])}return{px:t,py:n,p:r}}function vy(e){return e.flexDirection.size>0||e.gap.size>0||e.width.size>0||e.minHeight.size>0||e.alignItems.size>0||e.justifyContent.size>0||e.padding.px.size>0||e.padding.py.size>0||e.padding.p.size>0||e.display.size>0||e.gridCols.size>0||e.gridTemplateColumns.size>0||e.textSize.size>0||e.borderRadius.size>0||e.margin.all.size>0||e.margin.t.size>0||e.margin.r.size>0||e.margin.b.size>0||e.margin.l.size>0||e.margin.x.size>0||e.margin.y.size>0}function by(e){return{flexDirection:mC(e),gap:gC(e),width:yC(e),minHeight:dD(e),margin:vC(e),alignItems:bC(e),justifyContent:xC(e),padding:s0(e),display:r0(e),gridCols:i0(e),gridTemplateColumns:pD(e),textSize:o0(e),borderRadius:wC(e),any:!1}}const Eu=hD;function mD(e){return i0(e)}function gD(e,t){let n=e.get("base")??1;const r=["2xl","xl","lg","md","sm"];if(t<=0){for(const i of r)if(e.has(i))return e.get(i);return n}for(const i of["sm","md","lg","xl","2xl"])t>=(Eu[i]||0)&&e.has(i)&&(n=e.get(i));return n}function a0(e){return o0(e)}function zt(e,t,n){let r=e.get("base")??n;for(const i of["sm","md","lg","xl","2xl"])t>=(Eu[i]||0)&&e.has(i)&&(r=e.get(i));return r}function mh(e){return s0(e)}function tc(e){return r0(e)}function _C(e){const[t,n]=v.useState(()=>{var i;return((i=e.current)==null?void 0:i.offsetWidth)??0}),r=v.useRef(t);return v.useEffect(()=>{const i=e.current;if(!i)return;const o=i.offsetWidth;o>0&&o!==r.current&&(r.current=o,n(o));const s=new ResizeObserver(l=>{for(const c of l){const h=Math.round(c.contentRect.width);h>0&&h!==r.current&&(r.current=h,n(h))}});return s.observe(i),()=>{s.disconnect()}},[e]),t}function yD(e,t,n){var h,u,f;const i=(Array.isArray(t.tabItems)?t.tabItems:Array.isArray(t.tabs)?t.tabs:[]).filter(m=>!m.condition||!e.evaluateCondition||e.evaluateCondition(m.condition));if(i.length===0)return null;const o=`__tab_${n}`,s=e.sceneData[o]??(t.defaultTab||0),l={width:"100%",display:"flex",flexDirection:"column",...t.className?((h=e.parseClassNameResponsive)==null?void 0:h.call(e,t.className,n))??e.parseClassName(t.className):{}},c=e.getCommonProps(n,l,t);return v.createElement("div",{key:n,...c},v.createElement("div",{style:{display:"flex",borderBottom:`1px solid ${e.cfg.colors.borderSubtle}`,gap:"0"}},i.map((m,y)=>v.createElement("button",{key:`${n}-tab-${y}`,onClick:()=>e.setSceneData(x=>({...x,[o]:y})),style:{padding:"8px 16px",fontSize:"13px",fontWeight:s===y?600:400,color:s===y?e.cfg.colors.primary:e.cfg.colors.textMuted,borderBottom:s===y?`2px solid ${e.cfg.colors.primary}`:"2px solid transparent",background:"none",border:"none",borderBottomStyle:"solid",borderBottomWidth:"2px",borderBottomColor:s===y?e.cfg.colors.primary:"transparent",cursor:"pointer",transition:e.cfg.effects.transition}},m.label||m.title))),v.createElement("div",{style:{padding:"12px 0"}},(Array.isArray((u=i[s])==null?void 0:u.content)?i[s].content:Array.isArray((f=i[s])==null?void 0:f.children)?i[s].children:[]).map((m,y)=>e.renderComponent(m,y,`${n}-tabcontent-${s}`))))}function vD(e,t,n){var s;Array.isArray(t.items)&&!Array.isArray(t.accordionItems)&&(t.accordionItems=t.items);const r=Array.isArray(t.accordionItems)?t.accordionItems:[];if(r.length===0)return null;const i={width:"100%",display:"flex",flexDirection:"column",gap:"1px",...t.className?((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className):{}},o=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,...o},r.map((l,c)=>{const h=`__acc_${n}_${c}`,u=e.sceneData[h]??(l.defaultOpen||!1);return v.createElement("div",{key:`${n}-acc-${c}`},v.createElement("button",{onClick:()=>e.setSceneData(f=>({...f,[h]:!u})),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",background:"none",border:"none",borderBottom:`1px solid ${e.cfg.colors.borderSubtle}`,color:e.cfg.colors.textSecondary,fontSize:e.cfg.typography.baseFontSize,fontWeight:500,cursor:"pointer",transition:e.cfg.effects.transition}},U("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.icon?e.renderIcon(l.icon,14,{color:e.cfg.colors.primary}):null,U("span",null,l.title)),U("span",{style:{transform:u?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",fontSize:"24px"}},"▾")),v.createElement(zI,{initial:!1},u&&v.createElement(Kf.div,{key:`${n}-acc-body-${c}`,initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{height:{duration:.3,ease:"easeInOut"},opacity:{duration:.25}},style:{overflow:"hidden"}},v.createElement("div",{style:{padding:"8px 12px",display:"flex",flexDirection:"column",gap:"8px"}},(Array.isArray(l.content)?l.content:typeof l.content=="string"?[{type:"text",text:l.content}]:Array.isArray(l.children)?l.children:[]).map((m,y)=>e.renderComponent(m,y,`${n}-acc-${c}-content`))))))}))}function bD(e,t,n){var y,x,p,b,P;const r=(y=e.paginationState)==null?void 0:y[n],i=t.pagination===!0&&r&&r.total>r.limit,o=t.pagination==="scroll",s=r?Math.ceil(r.total/r.limit):0,l=t.className||"flex flex-col gap-3 w-full",c=((x=e.parseClassNameResponsive)==null?void 0:x.call(e,l,n))??e.parseClassName(l);t.rawStyle&&Object.assign(c,t.rawStyle);const h=(p=e.loading)==null?void 0:p[n],u=(b=e.listData)==null?void 0:b[n],f=Array.isArray(u)?u:[],m=e.renderMode==="css-driven"?{"data-bf-r":`${e.scopeId}-${n}`}:{};return v.createElement("div",{key:n,className:l,style:c,"data-component-key":n,...m},h&&(t.loadingComponent?e.renderComponent(t.loadingComponent,0,n):v.createElement("div",{className:"flex justify-center py-4"},U("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin"}))),!h&&f.length===0&&t.emptyComponent&&e.renderComponent(t.emptyComponent,0,`${n}-empty`),!h&&t.selectable&&e.sceneData._selectMode&&f.length>0&&U("div",{key:`${n}-sel-hdr`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:((P=t.selectionStyle)==null?void 0:P.headerPadding)||"0.5rem 2rem"}},U("button",{type:"button",onClick:()=>{const S=Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[],A=f.map((w,T)=>String(w.id||T)),E=A.length>0&&A.every(w=>S.includes(w));e.setSceneData(w=>({...w,_selIds:E?[]:A}))},style:{background:"none",border:"none",cursor:"pointer",color:e.cfg.colors.textSecondary,fontSize:"12px",fontFamily:"inherit",padding:"4px 0"}},(Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[]).filter(S=>f.some(A=>String(A.id)===S)).length===f.filter(S=>S.id).length&&f.length>0?"Deselect all":"Select all"),(Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[]).length>0?U("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},...(Array.isArray(t.selectActions)?t.selectActions:[]).map((S,A)=>U("button",{key:A,type:"button",onClick:()=>{var w;const E=Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[];E.length!==0&&((w=e.runBulkSelectAction)==null||w.call(e,S,t.dataSource,n,E))},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.textSecondary,transition:"all 0.15s ease",padding:"0"},onMouseEnter:E=>{E.currentTarget.style.backgroundColor=e.cfg.colors.border,E.currentTarget.style.color=e.cfg.colors.text},onMouseLeave:E=>{E.currentTarget.style.backgroundColor="transparent",E.currentTarget.style.color=e.cfg.colors.textSecondary}},e.renderIcon(S.icon,12))),U("span",{style:{fontSize:"12px",color:e.cfg.colors.textMuted}},`${(Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[]).length} selected`)):null),!h&&f.length>0&&(()=>{var G,J,lt,q,nt;const S=(G=t.groupBy)==null?void 0:G.field,A=it=>{const at=it==null?void 0:it[S];if(at&&typeof at=="object"&&at._seconds)return at._seconds*1e3;const ct=Date.parse(at);return isNaN(ct)?0:ct},E=it=>{if(!it)return"Earlier";const at=new Date(it),ct=new Date,mt=Et=>`${Et.getFullYear()}-${Et.getMonth()}-${Et.getDate()}`;if(mt(at)===mt(ct))return"Today";const yt=new Date(ct);return yt.setDate(ct.getDate()-1),mt(at)===mt(yt)?"Yesterday":at.toLocaleDateString()},T=((J=t.sort)==null?void 0:J.field)||S?[...f].sort((it,at)=>{var mt;const ct=A(at)-A(it);return((mt=t.sort)==null?void 0:mt.direction)==="asc"?-ct:ct}):f,O=String(e.sceneData.recordingSearchApplied||"").trim().toLowerCase(),[R,N]=String(e.sceneData.recordingDateFilterApplied||"").split("|"),V=R?Date.parse(`${R}T00:00:00`):0,D=N?Date.parse(`${N}T23:59:59.999`):Number.POSITIVE_INFINITY,j=(lt=t.itemsFilter)!=null&&lt.eq?e.interpolateText(String(t.itemsFilter.eq)):"",H=((q=t.itemsFilter)!=null&&q.field&&j?T.filter(it=>String(it==null?void 0:it[t.itemsFilter.field])===j):T).filter(it=>{const at=!O||[it.url,it.title,it.prompt].some(mt=>String(mt||"").toLowerCase().includes(O)),ct=A(it);return at&&ct>=V&&ct<=D}),z={};if(S)for(const it of H)(z[nt=E(A(it))]||(z[nt]=[])).push(it);const Y=(it,at)=>{var ct,mt,yt,Et,Tt,ht,ft,Ct;if(t.renderItem){const rt=JSON.parse(JSON.stringify(t.renderItem)),Rt={...it};if(t.labelField&&t.labelMap){const Bt=String(t.labelField.split(".").reduce((Qt,te)=>Qt==null?void 0:Qt[te],it)??"");Rt.label=t.labelMap[Bt]??""}const bt={};if(Array.isArray(rt.children)){for(const Bt of rt.children)if(Bt.content){const Qt=Bt.content.match(/^\{\{(\w+)\}\}$/);if(Qt){const te=Qt[1],Ht=it[te];Array.isArray(Ht)&&(bt[te]=Ht)}}}const ne=JSON.stringify(rt).replace(/\{\{([\w.]+)(?:\|(date|time|datetime|timeago))?\}\}/g,(Bt,Qt,te)=>{const Ht=Qt.split(".").reduce((re,Ce)=>re==null?void 0:re[Ce],Rt);if(Array.isArray(Ht))return Bt;if(Ht==null)return"";if(te){const re=Ht&&typeof Ht=="object"&&"_seconds"in Ht?new Date(Ht._seconds*1e3):new Date(Ht);if(!isNaN(re.getTime())){if(te==="timeago"){const Ce=Math.floor((Date.now()-re.getTime())/6e4);if(Ce<1)return"just now";if(Ce<60)return`${Ce}m ago`;const ie=Math.floor(Ce/60);if(ie<24)return`${ie}h ago`;const on=Math.floor(ie/24);return on<7?`${on}d ago`:re.toLocaleDateString()}return te==="date"?re.toLocaleDateString():te==="time"?re.toLocaleTimeString():re.toLocaleString()}}return typeof Ht=="string"?Ht.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):Ht!==void 0?JSON.stringify(Ht):""}),Gt=JSON.parse(ne);Gt.type==="widget"&&Gt.widgetId&&(Gt.props={...Rt,...Gt.props||{}});const Le=Bt=>{if(!(!Bt||typeof Bt!="object")){Bt.condition&&(Bt.__conditionBase=Rt);for(const Qt of Bt.children||[])Le(Qt)}};if(Le(Gt),Gt.children&&(Gt.children=Gt.children.map(Bt=>{var Ht;const Qt=Bt.fieldType||"text",te=(Ht=Bt.content)==null?void 0:Ht.match(/^\{\{(\w+)\}\}$/);if(te){const re=te[1],Ce=bt[re];if(Ce)return Qt==="dropdown"?{...Bt,type:"select",content:void 0,placeholder:Bt.fieldPlaceholder||`Select ${re}...`,options:Ce.map(ie=>({label:typeof ie=="object"?ie.label||ie.name||JSON.stringify(ie):String(ie),value:typeof ie=="object"?ie.value||ie.id||JSON.stringify(ie):String(ie)})),name:`${n}-${at}-${re}`,className:Bt.className||"w-full text-sm bg-slate-700 border border-slate-500 text-white rounded-lg px-3 py-1.5"}:Qt==="multiselect"?{...Bt,type:"container",content:void 0,className:Bt.className||"flex flex-col gap-1 w-full",children:[...Bt.fieldPlaceholder?[{type:"text",content:Bt.fieldPlaceholder,className:"text-xs text-gray-400 mb-1"}]:[{type:"text",content:`Select ${re}`,className:"text-xs text-gray-400 mb-1"}],...Ce.map((ie,on)=>({type:"checkbox",label:typeof ie=="object"?ie.label||ie.name||JSON.stringify(ie):String(ie),name:`${n}-${at}-${re}-${on}`,className:"text-sm text-gray-200"}))]}:Qt==="image-grid"?{...Bt,type:"container",content:void 0,className:"flex flex-row gap-2 w-full overflow-x-auto py-1",children:Ce.slice(0,10).map((ie,on)=>({type:"image",src:typeof ie=="string"?ie:ie.url||ie.src||"",alt:`${re} ${on+1}`,className:"w-12 h-12 rounded-lg object-cover flex-shrink-0"}))}:{...Bt,type:"container",content:void 0,className:"flex flex-col gap-1 w-full",children:[{type:"text",content:`⚠ "${re}" is an array (${Ce.length} items)`,className:"text-xs font-semibold text-amber-400"},{type:"text",content:"Use ⚡ to fetch fields, then set type in sidebar",className:"text-xs text-amber-300 opacity-75"}]}}return Qt==="image"&&Bt.content&&!Bt.content.includes("{{")?{...Bt,type:"image",src:Bt.content,alt:Bt.content,content:void 0,className:Bt.className||"w-full h-32 rounded-lg object-cover"}:Bt})),t.selectable&&e.sceneData._selectMode){const Bt=String(it.id||at),Qt=Array.isArray(e.sceneData._selIds)&&e.sceneData._selIds.map(String).includes(Bt),te=Ht=>Ht?[Ht.text,Ht.content,...Ht.children?Ht.children.flatMap(te):[]].filter(re=>typeof re=="string"&&re.trim()&&!re.includes("{{")):[];return Gt.text||Gt.label||te(Gt).slice(0,2).join(" — ")||String(it.id||at),U("div",{key:`${n}-item-${at}`,className:(ct=t.selectionStyle)==null?void 0:ct.className,style:{position:"relative",width:"100%",textAlign:"left",padding:"1rem 2rem",border:`1px solid ${Qt?((mt=t.selectionStyle)==null?void 0:mt.selectedBorderColor)||e.cfg.colors.accent||"#fff":((yt=t.selectionStyle)==null?void 0:yt.borderColor)||e.cfg.colors.border}`,borderRadius:((Et=t.selectionStyle)==null?void 0:Et.borderRadius)||e.cfg.components.inputRadius||"8px",marginBottom:"0.5rem",backgroundColor:Qt?((Tt=t.selectionStyle)==null?void 0:Tt.selectedBackgroundColor)||e.cfg.colors.surface:"transparent",color:e.cfg.colors.text,cursor:"pointer",fontFamily:"inherit",fontSize:"14px",fontWeight:Qt?600:400,transition:"all 0.15s ease",outline:"none"}},U("div",{style:{position:"absolute",inset:0,zIndex:1,pointerEvents:"none"}},U("button",{type:"button","aria-label":Qt?"Deselect item":"Select item",onClick:()=>{e.setSceneData(Ht=>{const re=Array.isArray(Ht._selIds)?Ht._selIds.map(String):[];return{...Ht,_selIds:re.includes(Bt)?re.filter(Ce=>Ce!==Bt):[...re,Bt]}})},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",position:"absolute",top:"50%",left:"1.25rem",transform:"translateY(-50%)",pointerEvents:"auto",border:`1px solid ${Qt?((ht=t.selectionStyle)==null?void 0:ht.selectedBorderColor)||e.cfg.colors.accent||"#fff":((ft=t.selectionStyle)==null?void 0:ft.borderColor)||e.cfg.colors.border}`,borderRadius:"5px",backgroundColor:Qt?((Ct=t.selectionStyle)==null?void 0:Ct.selectedBorderColor)||e.cfg.colors.accent||"#fff":"transparent",color:Qt?e.cfg.colors.background:"transparent",transition:"all 0.15s ease"}},Qt?e.renderIcon("check",12):null)),e.renderComponent(Gt,at,`${n}-item`))}return U("div",{key:`${n}-row-${at}`,style:{display:"contents"},onClickCapture:()=>{e.rowContextRef&&(e.rowContextRef.current=it)}},e.renderComponent(Gt,at,`${n}-item`))}return null};return S?Object.entries(z).map(([it,at],ct)=>U("div",{key:`${n}-group-${ct}`,style:{display:"flex",flexDirection:"column",gap:"6px"}},U("div",{key:`${n}-group-hdr-${ct}`,style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.05em",textTransform:"uppercase",color:e.cfg.colors.textMuted,padding:"10px 4px 2px"}},it),at.map(Y))):H.map(Y)})(),o&&(r==null?void 0:r.hasMore)&&U("div",{"data-bf-scroll-load":n,style:{height:"48px",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",...h&&((r==null?void 0:r.page)??0)>0?{}:{pointerEvents:"none",opacity:.55}}},h&&((r==null?void 0:r.page)??0)>0?U("div",{style:{width:"18px",height:"18px",border:"2px solid rgba(128,128,128,0.25)",borderTopColor:e.cfg.colors.primary,borderRadius:"50%",animation:"bf-spin 0.7s linear infinite"}}):U("div",{style:{width:"18px",height:"2px",borderRadius:"2px",background:e.cfg.colors.textMuted,opacity:.4}})),i&&v.createElement("div",{className:"flex items-center justify-center gap-3 mt-4 py-2"},v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page-1,r.limit),disabled:r.page===0||h,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"◀"),U("span",{className:"text-xs text-gray-500"},`${r.page+1} / ${s}`),v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page+1,r.limit),disabled:!r.hasMore||h,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"▶")))}function xD({api:e,c:t,componentKey:n}){var V,D,j,K;const r=(V=e.paginationState)==null?void 0:V[n],i=t.pagination!==!1&&r&&r.total>r.limit,o=r?Math.ceil(r.total/r.limit):0,s=t.className||"w-full overflow-x-auto rounded-xl bg-gray-800/50 border border-gray-700/50",l=((D=e.parseClassNameResponsive)==null?void 0:D.call(e,s,n))??e.parseClassName(s);t.rawStyle&&Object.assign(l,t.rawStyle);const c=(j=e.loading)==null?void 0:j[n],h=(K=e.listData)==null?void 0:K[n],u=Array.isArray(h)?h:[],f=e.renderMode==="css-driven"?{"data-bf-r":`${e.scopeId}-${n}`}:{},m=!!t.sortable,y=t.sortMode==="client"?"client":"server",[x,p]=v.useState(null),[b,P]=v.useState({}),S=v.useMemo(()=>{if(!x||y!=="client")return u;const H=x.dir==="asc"?1:-1;return[...u].sort((z,Y)=>{const G=z[x.key],J=Y[x.key];return G===J?0:G==null?1:J==null?-1:String(G).localeCompare(String(J),void 0,{numeric:!0})*H})},[u,x,y]),A=H=>{if(!m&&!H.sortable)return;const z=H.field||H.key;let Y=null;!x||x.key!==z?Y={key:z,dir:"asc"}:x.dir==="asc"&&(Y={key:z,dir:"desc"}),p(Y),y==="server"&&Y&&e.fetchListData(t.dataSource,n,0,(r==null?void 0:r.limit)||t.pageSize||10,Y.key,Y.dir)},E=(H,z)=>H.replace(/\{\{([\w.]+)(?:\s*\|\|\s*([^}]+))?\}\}/g,(Y,G,J)=>{const lt=G.split(".").reduce((q,nt)=>q==null?void 0:q[nt],z);return lt==null||lt===""?J??"":String(lt)}),w=async(H,z)=>{var J;const Y=b[H.id??""]||{},G=z.filter(lt=>lt.editable&&Y[lt.field||lt.key]!==void 0);for(const lt of G){const q=lt.field||lt.key,nt=lt.onCellChange||t.onSave;if(!nt)continue;const it=nt.replace(/\{\{field\}\}/g,JSON.stringify(Y[q]));if(it.startsWith("sdk:"))await e.handleButtonClick(E(it,H),{});else{const at=E(it,H);await fetch(at,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[q]:Y[q]})})}}G.length&&((J=e.showToast)==null||J.call(e,(G.length===1,"Saved"),"success"),P(lt=>{const q={...lt};return delete q[H.id??""],q}),e.fetchListData(t.dataSource,n,(r==null?void 0:r.page)||0,(r==null?void 0:r.limit)||t.pageSize||10))},T=(H,z,Y)=>{const G=z.field||z.key,J=H.id??"";P(lt=>({...lt,[J]:{...lt[J]||{},[G]:Y}}))},O=(H,z)=>{const Y=H.field||H.key,G=z.id??"",J=b[G]||{},lt=J[Y]!==void 0?J[Y]:z[Y],q=H.fieldType||"text",nt={style:{width:"100%",background:"transparent",color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,borderRadius:"4px",padding:"2px 6px",fontSize:"13px",fontFamily:"inherit"}},it=()=>{H.onCellChange&&J[H.key]!==void 0&&w(z,[H])};if(q==="select"||q==="dropdown")return U("select",{...nt,value:String(lt??""),onChange:at=>{T(z,H,at.target.value),H.onCellChange&&w(z,[H])},children:(Array.isArray(H.fieldOptions)?H.fieldOptions:[]).map((at,ct)=>U("option",{key:ct,value:at.value,children:at.label??at.value}))});if(q==="multiselect"){const at=Array.isArray(lt)?lt:[];return U("div",{style:{display:"flex",flexDirection:"column",gap:2}},(Array.isArray(H.fieldOptions)?H.fieldOptions:[]).map((ct,mt)=>{const yt=at.includes(ct.value);return U("label",{key:mt,style:{display:"flex",alignItems:"center",gap:4,fontSize:12}},U("input",{type:"checkbox",checked:yt,onChange:Et=>{const Tt=Et.target.checked?[...at,ct.value]:at.filter(ht=>ht!==ct.value);T(z,H,Tt),H.onCellChange&&w(z,[H])}}),U("span",{children:ct.label??ct.value}))}))}return q==="image"?U("div",{style:{display:"flex",alignItems:"center",gap:6}},lt?U("img",{src:String(lt),alt:H.label,style:{width:32,height:32,borderRadius:4,objectFit:"cover"}}):null,U("input",{...nt,value:String(lt??""),placeholder:H.fieldPlaceholder||"Image URL",onChange:at=>T(z,H,at.target.value),onBlur:it})):U("input",{...nt,type:q==="number"?"number":"text",value:String(lt??""),placeholder:H.fieldPlaceholder||"",onChange:at=>T(z,H,q==="number"?Number(at.target.value):at.target.value),onBlur:it})},R=H=>{const z=b[H.id??""];return!!z&&Object.keys(z).some(Y=>{var G;return(G=t.columns)==null?void 0:G.some(J=>J.editable&&(J.field||J.key)===Y)})},N=!!t.onSave;return v.createElement("div",{key:n,className:s,style:l,"data-component-key":n,...f},c&&(t.loadingComponent?e.renderComponent(t.loadingComponent,0,n):v.createElement("div",{className:"flex justify-center py-4"},U("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin"}))),v.createElement("table",{className:"w-full"},Array.isArray(t.columns)&&v.createElement("thead",{className:"bg-gray-900/50"},v.createElement("tr",{},t.columns.map(H=>v.createElement("th",{key:H.key,className:"px-4 py-3 text-left text-sm font-medium text-gray-400"},(m||H.sortable)&&H.sortable!==!1?(()=>{const z=x&&x.key===H.key?x:null;return U("button",{type:"button",onClick:()=>A(H),style:{background:"none",border:"none",color:"inherit",fontFamily:"inherit",fontSize:"inherit",cursor:"pointer",padding:0},children:`${H.label||H.key}${z?z.dir==="asc"?" ↑":" ↓":" ⇅"}`})})():H.label||H.key)),N&&v.createElement("th",{key:"__save",className:"px-4 py-3 text-left text-sm font-medium text-gray-400"},""))),v.createElement("tbody",{className:"divide-y divide-gray-700/50"},S.map((H,z)=>{var Y;return v.createElement("tr",{key:H.id??z,className:"hover:bg-gray-700/30 transition-colors"},(Y=t.columns)==null?void 0:Y.map(G=>v.createElement("td",{key:G.key,className:"px-4 py-3 text-sm text-white"},G.editable?O(G,H):G.template?E(G.template,H):(()=>{const lt=(G.field||G.key).split(".").reduce((q,nt)=>q==null?void 0:q[nt],H);return lt==null||lt===""?"":String(lt)})())),N&&v.createElement("td",{key:"__save-cell",className:"px-4 py-3 text-sm"},U("button",{type:"button",disabled:!R(H)||c,onClick:()=>w(H,t.columns||[]),className:"px-3 py-1 rounded text-xs font-semibold border transition-all disabled:opacity-40 disabled:cursor-not-allowed",style:{background:R(H)?e.cfg.colors.primary:"transparent",color:R(H)?"#ffffff":e.cfg.colors.textSecondary,borderColor:e.cfg.colors.border},children:"Save"})))}))),i&&v.createElement("div",{className:"flex items-center justify-center gap-3 mt-4 py-2"},v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page-1,r.limit),disabled:r.page===0||c,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"◀"),U("span",{className:"text-xs text-gray-500"},`${r.page+1} / ${o}`),v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page+1,r.limit),disabled:!r.hasMore||c,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"▶")))}function wD(e,t,n){return v.createElement(xD,{api:e,c:t,componentKey:n})}function Ie(e){var t=e.width,n=e.height;if(t<0)throw new Error("Negative width is not allowed for Size");if(n<0)throw new Error("Negative height is not allowed for Size");return{width:t,height:n}}function na(e,t){return e.width===t.width&&e.height===t.height}var _D=function(){function e(t){var n=this;this._resolutionListener=function(){return n._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=t,this._installResolutionListener()}return e.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(e.prototype,"value",{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(t){var n=this,r={next:t};return this._observers.push(r),{unsubscribe:function(){n._observers=n._observers.filter(function(i){return i!==r})}}},e.prototype._installResolutionListener=function(){if(this._resolutionMediaQueryList!==null)throw new Error("Resolution listener is already installed");var t=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia("all and (resolution: ".concat(t,"dppx)")),this._resolutionMediaQueryList.addListener(this._resolutionListener)},e.prototype._uninstallResolutionListener=function(){this._resolutionMediaQueryList!==null&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},e.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},e.prototype._onResolutionChanged=function(){var t=this;this._observers.forEach(function(n){return n.next(t._window.devicePixelRatio)}),this._reinstallResolutionListener()},e}();function SD(e){return new _D(e)}var PD=function(){function e(t,n,r){var i;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=t,this._canvasElementClientSize=Ie({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=n??function(o){return o},this._allowResizeObserver=(i=r==null?void 0:r.allowResizeObserver)!==null&&i!==void 0?i:!0,this._chooseAndInitObserver()}return e.prototype.dispose=function(){var t,n;if(this._canvasElement===null)throw new Error("Object is disposed");(t=this._canvasElementResizeObserver)===null||t===void 0||t.disconnect(),this._canvasElementResizeObserver=null,(n=this._devicePixelRatioObservable)===null||n===void 0||n.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(e.prototype,"canvasElement",{get:function(){if(this._canvasElement===null)throw new Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bitmapSize",{get:function(){return Ie({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),e.prototype.resizeCanvasElement=function(t){this._canvasElementClientSize=Ie(t),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},e.prototype.subscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners.push(t)},e.prototype.unsubscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(n){return n!==t})},Object.defineProperty(e.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),e.prototype.subscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners.push(t)},e.prototype.unsubscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(n){return n!==t})},e.prototype.applySuggestedBitmapSize=function(){if(this._suggestedBitmapSize!==null){var t=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(t),this._emitSuggestedBitmapSizeChanged(t,this._suggestedBitmapSize)}},e.prototype._resizeBitmap=function(t){var n=this.bitmapSize;na(n,t)||(this.canvasElement.width=t.width,this.canvasElement.height=t.height,this._emitBitmapSizeChanged(n,t))},e.prototype._emitBitmapSizeChanged=function(t,n){var r=this;this._bitmapSizeChangedListeners.forEach(function(i){return i.call(r,t,n)})},e.prototype._suggestNewBitmapSize=function(t){var n=this._suggestedBitmapSize,r=Ie(this._transformBitmapSize(t,this._canvasElementClientSize)),i=na(this.bitmapSize,r)?null:r;n===null&&i===null||n!==null&&i!==null&&na(n,i)||(this._suggestedBitmapSize=i,this._emitSuggestedBitmapSizeChanged(n,i))},e.prototype._emitSuggestedBitmapSizeChanged=function(t,n){var r=this;this._suggestedBitmapSizeChangedListeners.forEach(function(i){return i.call(r,t,n)})},e.prototype._chooseAndInitObserver=function(){var t=this;if(!this._allowResizeObserver){this._initDevicePixelRatioObservable();return}TD().then(function(n){return n?t._initResizeObserver():t._initDevicePixelRatioObservable()})},e.prototype._initDevicePixelRatioObservable=function(){var t=this;if(this._canvasElement!==null){var n=e_(this._canvasElement);if(n===null)throw new Error("No window is associated with the canvas");this._devicePixelRatioObservable=SD(n),this._devicePixelRatioObservable.subscribe(function(){return t._invalidateBitmapSize()}),this._invalidateBitmapSize()}},e.prototype._invalidateBitmapSize=function(){var t,n;if(this._canvasElement!==null){var r=e_(this._canvasElement);if(r!==null){var i=(n=(t=this._devicePixelRatioObservable)===null||t===void 0?void 0:t.value)!==null&&n!==void 0?n:r.devicePixelRatio,o=this._canvasElement.getClientRects(),s=o[0]!==void 0?ED(o[0],i):Ie({width:this._canvasElementClientSize.width*i,height:this._canvasElementClientSize.height*i});this._suggestNewBitmapSize(s)}}},e.prototype._initResizeObserver=function(){var t=this;this._canvasElement!==null&&(this._canvasElementResizeObserver=new ResizeObserver(function(n){var r=n.find(function(s){return s.target===t._canvasElement});if(!(!r||!r.devicePixelContentBoxSize||!r.devicePixelContentBoxSize[0])){var i=r.devicePixelContentBoxSize[0],o=Ie({width:i.inlineSize,height:i.blockSize});t._suggestNewBitmapSize(o)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"}))},e}();function AD(e,t){return new PD(e,t.transform,t.options)}function e_(e){return e.ownerDocument.defaultView}function TD(){return new Promise(function(e){var t=new ResizeObserver(function(n){e(n.every(function(r){return"devicePixelContentBoxSize"in r})),t.disconnect()});t.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1})}function ED(e,t){return Ie({width:Math.round(e.left*t+e.width*t)-Math.round(e.left*t),height:Math.round(e.top*t+e.height*t)-Math.round(e.top*t)})}var CD=function(){function e(t,n,r){if(n.width===0||n.height===0)throw new TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=n,r.width===0||r.height===0)throw new TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=r,this._context=t}return e.prototype.useMediaCoordinateSpace=function(t){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),t({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},e.prototype.useBitmapCoordinateSpace=function(t){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),t({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(e.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),e}();function la(e,t){var n=e.canvasElementClientSize;if(n.width===0||n.height===0)return null;var r=e.bitmapSize;if(r.width===0||r.height===0)return null;var i=e.canvasElement.getContext("2d",t);return i===null?null:new CD(i,n,r)}/*!
13
+ `),()=>{document.head.removeChild(u)}},[t]),Ze.jsx(NI,{isPresent:t,childRef:r,sizeRef:i,children:Jn.cloneElement(e,{ref:r})})}const DI=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s})=>{const l=Sb(BI),c=v.useId(),h=v.useCallback(f=>{l.set(f,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),u=v.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:h,register:f=>(l.set(f,!1),()=>l.delete(f))}),o?[Math.random(),h]:[n,h]);return v.useMemo(()=>{l.forEach((f,m)=>l.set(m,!1))},[n]),Jn.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),s==="popLayout"&&(e=Ze.jsx(jI,{isPresent:n,children:e})),Ze.jsx(vp.Provider,{value:u,children:e})};function BI(){return new Map}function BT(e=!0){const t=v.useContext(vp);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,o=v.useId();v.useEffect(()=>{e&&i(o)},[e]);const s=v.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}const Xh=e=>e.key||"";function jx(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Ab=typeof window<"u",zT=Ab?v.useLayoutEffect:v.useEffect,zI=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:o="sync",propagate:s=!1})=>{const[l,c]=BT(s),h=v.useMemo(()=>jx(e),[e]),u=s&&!l?[]:h.map(Xh),f=v.useRef(!0),m=v.useRef(h),y=Sb(()=>new Map),[x,p]=v.useState(h),[b,P]=v.useState(h);zT(()=>{f.current=!1,m.current=h;for(let E=0;E<b.length;E++){const w=Xh(b[E]);u.includes(w)?y.delete(w):y.get(w)!==!0&&y.set(w,!1)}},[b,u.length,u.join("-")]);const S=[];if(h!==x){let E=[...h];for(let w=0;w<b.length;w++){const T=b[w],O=Xh(T);u.includes(O)||(E.splice(w,0,T),S.push(T))}o==="wait"&&S.length&&(E=S),P(jx(E)),p(h);return}process.env.NODE_ENV!=="production"&&o==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:A}=v.useContext(_b);return Ze.jsx(Ze.Fragment,{children:b.map(E=>{const w=Xh(E),T=s&&!l?!1:h===b||u.includes(w),O=()=>{if(y.has(w))y.set(w,!0);else return;let R=!0;y.forEach(N=>{N||(R=!1)}),R&&(A==null||A(),P(m.current),s&&(c==null||c()),r&&r())};return Ze.jsx(DI,{isPresent:T,initial:!f.current||n?void 0:!1,custom:T?void 0:t,presenceAffectsLayout:i,mode:o,onExitComplete:T?void 0:O,children:E},w)})})},cr=e=>e;let Xl=cr,Qo=cr;process.env.NODE_ENV!=="production"&&(Xl=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Qo=(e,t)=>{if(!e)throw new Error(t)});function Tb(e){let t;return()=>(t===void 0&&(t=e()),t)}const pl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},bi=e=>e*1e3,ao=e=>e/1e3,FI={useManualTiming:!1};function WI(e){let t=new Set,n=new Set,r=!1,i=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function l(h){o.has(h)&&(c.schedule(h),e()),h(s)}const c={schedule:(h,u=!1,f=!1)=>{const y=f&&r?t:n;return u&&o.add(h),y.has(h)||y.add(h),h},cancel:h=>{n.delete(h),o.delete(h)},process:h=>{if(s=h,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(l),t.clear(),r=!1,i&&(i=!1,c.process(h))}};return c}const Jh=["read","resolveKeyframes","update","preRender","render","postRender"],VI=40;function FT(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=Jh.reduce((P,S)=>(P[S]=WI(o),P),{}),{read:l,resolveKeyframes:c,update:h,preRender:u,render:f,postRender:m}=s,y=()=>{const P=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(P-i.timestamp,VI),1),i.timestamp=P,i.isProcessing=!0,l.process(i),c.process(i),h.process(i),u.process(i),f.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(y))},x=()=>{n=!0,r=!0,i.isProcessing||e(y)};return{schedule:Jh.reduce((P,S)=>{const A=s[S];return P[S]=(E,w=!1,T=!1)=>(n||x(),A.schedule(E,w,T)),P},{}),cancel:P=>{for(let S=0;S<Jh.length;S++)s[Jh[S]].cancel(P)},state:i,steps:s}}const{schedule:Ue,cancel:ts,state:Nn,steps:Im}=FT(typeof requestAnimationFrame<"u"?requestAnimationFrame:cr,!0),WT=v.createContext({strict:!1}),Dx={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ml={};for(const e in Dx)ml[e]={isEnabled:t=>Dx[e].some(n=>!!t[n])};function UI(e){for(const t in e)ml[t]={...ml[t],...e[t]}}const HI=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Vf(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||HI.has(e)}let VT=e=>!Vf(e);function qI(e){e&&(VT=t=>t.startsWith("on")?!Vf(t):e(t))}try{qI(require("@emotion/is-prop-valid").default)}catch{}function GI(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(VT(i)||n===!0&&Vf(i)||!t&&!Vf(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const Bx=new Set;function bp(e,t,n){e||Bx.has(t)||(console.warn(t),Bx.add(t))}function ZI(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&bp(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const xp=v.createContext({});function _u(e){return typeof e=="string"||Array.isArray(e)}function wp(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Eb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cb=["initial",...Eb];function _p(e){return wp(e.animate)||Cb.some(t=>_u(e[t]))}function UT(e){return!!(_p(e)||e.variants)}function YI(e,t){if(_p(e)){const{initial:n,animate:r}=e;return{initial:n===!1||_u(n)?n:void 0,animate:_u(r)?r:void 0}}return e.inherit!==!1?t:{}}function KI(e){const{initial:t,animate:n}=YI(e,v.useContext(xp));return v.useMemo(()=>({initial:t,animate:n}),[zx(t),zx(n)])}function zx(e){return Array.isArray(e)?e.join(" "):e}const XI=Symbol.for("motionComponentSymbol");function Ga(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function JI(e,t,n){return v.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ga(n)&&(n.current=r))},[t])}const Ob=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),QI="framerAppearId",HT="data-"+Ob(QI),{schedule:Mb}=FT(queueMicrotask,!1),qT=v.createContext({});function tR(e,t,n,r,i){var o,s;const{visualElement:l}=v.useContext(xp),c=v.useContext(WT),h=v.useContext(vp),u=v.useContext(Pb).reducedMotion,f=v.useRef(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:u}));const m=f.current,y=v.useContext(qT);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&eR(f.current,n,i,y);const x=v.useRef(!1);v.useInsertionEffect(()=>{m&&x.current&&m.update(n,h)});const p=n[HT],b=v.useRef(!!p&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,p))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,p)));return zT(()=>{m&&(x.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),Mb.render(m.render),b.current&&m.animationState&&m.animationState.animateChanges())}),v.useEffect(()=>{m&&(!b.current&&m.animationState&&m.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)===null||P===void 0||P.call(window,p)}),b.current=!1))}),m}function eR(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:l,layoutScroll:c,layoutRoot:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:GT(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||l&&Ga(l),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:h})}function GT(e){if(e)return e.options.allowProjection!==!1?e.projection:GT(e.parent)}function nR({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var o,s;e&&UI(e);function l(h,u){let f;const m={...v.useContext(Pb),...h,layoutId:rR(h)},{isStatic:y}=m,x=KI(h),p=r(h,y);if(!y&&Ab){iR(m,e);const b=oR(m);f=b.MeasureLayout,x.visualElement=tR(i,p,m,t,b.ProjectionNode)}return Ze.jsxs(xp.Provider,{value:x,children:[f&&x.visualElement?Ze.jsx(f,{visualElement:x.visualElement,...m}):null,n(i,h,JI(p,x.visualElement,u),p,y,x.visualElement)]})}l.displayName=`motion.${typeof i=="string"?i:`create(${(s=(o=i.displayName)!==null&&o!==void 0?o:i.name)!==null&&s!==void 0?s:""})`}`;const c=v.forwardRef(l);return c[XI]=i,c}function rR({layoutId:e}){const t=v.useContext(_b).id;return t&&e!==void 0?t+"-"+e:e}function iR(e,t){const n=v.useContext(WT).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Xl(!1,r):Qo(!1,r)}}function oR(e){const{drag:t,layout:n}=ml;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const sR=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function kb(e){return typeof e!="string"||e.includes("-")?!1:!!(sR.indexOf(e)>-1||/[A-Z]/u.test(e))}function Fx(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function $b(e,t,n,r){if(typeof t=="function"){const[i,o]=Fx(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=Fx(r);t=t(n!==void 0?n:e.custom,i,o)}return t}const ny=e=>Array.isArray(e),aR=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),lR=e=>ny(e)?e[e.length-1]||0:e,qn=e=>!!(e&&e.getVelocity);function If(e){const t=qn(e)?e.get():e;return aR(t)?t.toValue():t}function cR({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,o){const s={latestValues:uR(r,i,o,e),renderState:t()};return n&&(s.onMount=l=>n({props:r,current:l,...s}),s.onUpdate=l=>n(l)),s}const ZT=e=>(t,n)=>{const r=v.useContext(xp),i=v.useContext(vp),o=()=>cR(e,t,r,i);return n?o():Sb(o)};function uR(e,t,n,r){const i={},o=r(e,{});for(const m in o)i[m]=If(o[m]);let{initial:s,animate:l}=e;const c=_p(e),h=UT(e);t&&h&&!c&&e.inherit!==!1&&(s===void 0&&(s=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const f=u?l:s;if(f&&typeof f!="boolean"&&!wp(f)){const m=Array.isArray(f)?f:[f];for(let y=0;y<m.length;y++){const x=$b(e,m[y]);if(x){const{transitionEnd:p,transition:b,...P}=x;for(const S in P){let A=P[S];if(Array.isArray(A)){const E=u?A.length-1:0;A=A[E]}A!==null&&(i[S]=A)}for(const S in p)i[S]=p[S]}}}return i}const Jl=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ba=new Set(Jl),YT=e=>t=>typeof t=="string"&&t.startsWith(e),KT=YT("--"),hR=YT("var(--"),Ib=e=>hR(e)?fR.test(e.split("/*")[0].trim()):!1,fR=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,XT=(e,t)=>t&&typeof e=="number"?t.transform(e):e,fo=(e,t,n)=>n>t?t:n<e?e:n,Ql={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Su={...Ql,transform:e=>fo(0,1,e)},Qh={...Ql,default:1},hh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),zo=hh("deg"),xi=hh("%"),Wt=hh("px"),dR=hh("vh"),pR=hh("vw"),Wx={...xi,parse:e=>xi.parse(e)/100,transform:e=>xi.transform(e*100)},mR={borderWidth:Wt,borderTopWidth:Wt,borderRightWidth:Wt,borderBottomWidth:Wt,borderLeftWidth:Wt,borderRadius:Wt,radius:Wt,borderTopLeftRadius:Wt,borderTopRightRadius:Wt,borderBottomRightRadius:Wt,borderBottomLeftRadius:Wt,width:Wt,maxWidth:Wt,height:Wt,maxHeight:Wt,top:Wt,right:Wt,bottom:Wt,left:Wt,padding:Wt,paddingTop:Wt,paddingRight:Wt,paddingBottom:Wt,paddingLeft:Wt,margin:Wt,marginTop:Wt,marginRight:Wt,marginBottom:Wt,marginLeft:Wt,backgroundPositionX:Wt,backgroundPositionY:Wt},gR={rotate:zo,rotateX:zo,rotateY:zo,rotateZ:zo,scale:Qh,scaleX:Qh,scaleY:Qh,scaleZ:Qh,skew:zo,skewX:zo,skewY:zo,distance:Wt,translateX:Wt,translateY:Wt,translateZ:Wt,x:Wt,y:Wt,z:Wt,perspective:Wt,transformPerspective:Wt,opacity:Su,originX:Wx,originY:Wx,originZ:Wt},Vx={...Ql,transform:Math.round},Rb={...mR,...gR,zIndex:Vx,size:Wt,fillOpacity:Su,strokeOpacity:Su,numOctaves:Vx},yR={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vR=Jl.length;function bR(e,t,n){let r="",i=!0;for(let o=0;o<vR;o++){const s=Jl[o],l=e[s];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(s.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const h=XT(l,Rb[s]);if(!c){i=!1;const u=yR[s]||s;r+=`${u}(${h}) `}n&&(t[s]=h)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Lb(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let s=!1,l=!1;for(const c in t){const h=t[c];if(ba.has(c)){s=!0;continue}else if(KT(c)){i[c]=h;continue}else{const u=XT(h,Rb[c]);c.startsWith("origin")?(l=!0,o[c]=u):r[c]=u}}if(t.transform||(s||n?r.transform=bR(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:h="50%",originZ:u=0}=o;r.transformOrigin=`${c} ${h} ${u}`}}const xR={offset:"stroke-dashoffset",array:"stroke-dasharray"},wR={offset:"strokeDashoffset",array:"strokeDasharray"};function _R(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?xR:wR;e[o.offset]=Wt.transform(-r);const s=Wt.transform(t),l=Wt.transform(n);e[o.array]=`${s} ${l}`}function Ux(e,t,n){return typeof e=="string"?e:Wt.transform(t+n*e)}function SR(e,t,n){const r=Ux(t,e.x,e.width),i=Ux(n,e.y,e.height);return`${r} ${i}`}function Nb(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:l=1,pathOffset:c=0,...h},u,f){if(Lb(e,h,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:y,dimensions:x}=e;m.transform&&(x&&(y.transform=m.transform),delete m.transform),x&&(i!==void 0||o!==void 0||y.transform)&&(y.transformOrigin=SR(x,i!==void 0?i:.5,o!==void 0?o:.5)),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),s!==void 0&&_R(m,s,l,c,!1)}const jb=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),JT=()=>({...jb(),attrs:{}}),Db=e=>typeof e=="string"&&e.toLowerCase()==="svg";function QT(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const tE=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function eE(e,t,n,r){QT(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(tE.has(i)?i:Ob(i),t.attrs[i])}const Uf={};function PR(e){Object.assign(Uf,e)}function nE(e,{layout:t,layoutId:n}){return ba.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Uf[e]||e==="opacity")}function Bb(e,t,n){var r;const{style:i}=e,o={};for(const s in i)(qn(i[s])||t.style&&qn(t.style[s])||nE(s,e)||((r=n==null?void 0:n.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(o[s]=i[s]);return o}function rE(e,t,n){const r=Bb(e,t,n);for(const i in e)if(qn(e[i])||qn(t[i])){const o=Jl.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}function AR(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const Hx=["x","y","width","height","cx","cy","r"],TR={useVisualState:ZT({scrapeMotionValuesFromProps:rE,createRenderState:JT,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let o=!!e.drag;if(!o){for(const l in i)if(ba.has(l)){o=!0;break}}if(!o)return;let s=!t;if(t)for(let l=0;l<Hx.length;l++){const c=Hx[l];e[c]!==t[c]&&(s=!0)}s&&Ue.read(()=>{AR(n,r),Ue.render(()=>{Nb(r,i,Db(n.tagName),e.transformTemplate),eE(n,r)})})}})},ER={useVisualState:ZT({scrapeMotionValuesFromProps:Bb,createRenderState:jb})};function iE(e,t,n){for(const r in t)!qn(t[r])&&!nE(r,n)&&(e[r]=t[r])}function CR({transformTemplate:e},t){return v.useMemo(()=>{const n=jb();return Lb(n,t,e),Object.assign({},n.vars,n.style)},[t])}function OR(e,t){const n=e.style||{},r={};return iE(r,n,e),Object.assign(r,CR(e,t)),r}function MR(e,t){const n={},r=OR(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function kR(e,t,n,r){const i=v.useMemo(()=>{const o=JT();return Nb(o,t,Db(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};iE(o,e.style,e),i.style={...o,...i.style}}return i}function $R(e=!1){return(n,r,i,{latestValues:o},s)=>{const c=(kb(n)?kR:MR)(r,o,s,n),h=GI(r,typeof n=="string",e),u=n!==v.Fragment?{...h,...c,ref:i}:{},{children:f}=r,m=v.useMemo(()=>qn(f)?f.get():f,[f]);return v.createElement(n,{...u,children:m})}}function IR(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...kb(r)?TR:ER,preloadedFeatures:e,useRender:$R(i),createVisualElement:t,Component:r};return nR(s)}}function oE(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Sp(e,t,n){const r=e.getProps();return $b(r,t,n!==void 0?n:r.custom,e)}const RR=Tb(()=>window.ScrollTimeline!==void 0);class LR{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(RR()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class NR extends LR{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function zb(e,t){return e?e[t]||e.default||e:void 0}const ry=2e4;function sE(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<ry;)t+=n,r=e.next(t);return t>=ry?1/0:t}function Fb(e){return typeof e=="function"}function qx(e,t){e.timeline=t,e.onfinish=null}const Wb=e=>Array.isArray(e)&&typeof e[0]=="number",jR={linearEasing:void 0};function DR(e,t){const n=Tb(e);return()=>{var r;return(r=jR[t])!==null&&r!==void 0?r:n()}}const Hf=DR(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),aE=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let o=0;o<i;o++)r+=e(pl(0,i-1,o))+", ";return`linear(${r.substring(0,r.length-2)})`};function lE(e){return!!(typeof e=="function"&&Hf()||!e||typeof e=="string"&&(e in iy||Hf())||Wb(e)||Array.isArray(e)&&e.every(lE))}const Yc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,iy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yc([0,.65,.55,1]),circOut:Yc([.55,0,1,.45]),backIn:Yc([.31,.01,.66,-.59]),backOut:Yc([.33,1.53,.69,.99])};function cE(e,t){if(e)return typeof e=="function"&&Hf()?aE(e,t):Wb(e)?Yc(e):Array.isArray(e)?e.map(n=>cE(n,t)||iy.easeOut):iy[e]}const Xr={x:!1,y:!1};function uE(){return Xr.x||Xr.y}function BR(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const o=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function hE(e,t){const n=BR(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Gx(e){return t=>{t.pointerType==="touch"||uE()||e(t)}}function zR(e,t,n={}){const[r,i,o]=hE(e,n),s=Gx(l=>{const{target:c}=l,h=t(l);if(typeof h!="function"||!c)return;const u=Gx(f=>{h(f),c.removeEventListener("pointerleave",u)});c.addEventListener("pointerleave",u,i)});return r.forEach(l=>{l.addEventListener("pointerenter",s,i)}),o}const fE=(e,t)=>t?e===t?!0:fE(e,t.parentElement):!1,Vb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,FR=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function WR(e){return FR.has(e.tagName)||e.tabIndex!==-1}const Kc=new WeakSet;function Zx(e){return t=>{t.key==="Enter"&&e(t)}}function Rm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const VR=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Zx(()=>{if(Kc.has(n))return;Rm(n,"down");const i=Zx(()=>{Rm(n,"up")}),o=()=>Rm(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Yx(e){return Vb(e)&&!uE()}function UR(e,t,n={}){const[r,i,o]=hE(e,n),s=l=>{const c=l.currentTarget;if(!Yx(l)||Kc.has(c))return;Kc.add(c);const h=t(l),u=(y,x)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",m),!(!Yx(y)||!Kc.has(c))&&(Kc.delete(c),typeof h=="function"&&h(y,{success:x}))},f=y=>{u(y,n.useGlobalTarget||fE(c,y.target))},m=y=>{u(y,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",m,i)};return r.forEach(l=>{!WR(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",s,i),l.addEventListener("focus",h=>VR(h,i),i)}),o}function HR(e){return e==="x"||e==="y"?Xr[e]?null:(Xr[e]=!0,()=>{Xr[e]=!1}):Xr.x||Xr.y?null:(Xr.x=Xr.y=!0,()=>{Xr.x=Xr.y=!1})}const dE=new Set(["width","height","top","left","right","bottom",...Jl]);let Rf;function qR(){Rf=void 0}const wi={now:()=>(Rf===void 0&&wi.set(Nn.isProcessing||FI.useManualTiming?Nn.timestamp:performance.now()),Rf),set:e=>{Rf=e,queueMicrotask(qR)}};function Ub(e,t){e.indexOf(t)===-1&&e.push(t)}function Hb(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class qb{constructor(){this.subscriptions=[]}add(t){return Ub(this.subscriptions,t),()=>Hb(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o<i;o++){const s=this.subscriptions[o];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function pE(e,t){return t?e*(1e3/t):0}const Kx=30,GR=e=>!isNaN(parseFloat(e));class ZR{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const o=wi.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=wi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=GR(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&bp(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new qb);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ue.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=wi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Kx)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Kx);return pE(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pu(e,t){return new ZR(e,t)}function YR(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pu(n))}function KR(e,t){const n=Sp(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const l=lR(o[s]);YR(e,s,l)}}function XR(e){return!!(qn(e)&&e.add)}function oy(e,t){const n=e.getValue("willChange");if(XR(n))return n.add(t)}function mE(e){return e.props[HT]}const gE=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,JR=1e-7,QR=12;function tL(e,t,n,r,i){let o,s,l=0;do s=t+(n-t)/2,o=gE(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>JR&&++l<QR);return s}function fh(e,t,n,r){if(e===t&&n===r)return cr;const i=o=>tL(o,0,1,e,n);return o=>o===0||o===1?o:gE(i(o),t,r)}const yE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,vE=e=>t=>1-e(1-t),bE=fh(.33,1.53,.69,.99),Gb=vE(bE),xE=yE(Gb),wE=e=>(e*=2)<1?.5*Gb(e):.5*(2-Math.pow(2,-10*(e-1))),Zb=e=>1-Math.sin(Math.acos(e)),_E=vE(Zb),SE=yE(Zb),PE=e=>/^0[^.\s]+$/u.test(e);function eL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||PE(e):!0}const ru=e=>Math.round(e*1e5)/1e5,Yb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function nL(e){return e==null}const rL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Kb=(e,t)=>n=>!!(typeof n=="string"&&rL.test(n)&&n.startsWith(e)||t&&!nL(n)&&Object.prototype.hasOwnProperty.call(n,t)),AE=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,o,s,l]=r.match(Yb);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:l!==void 0?parseFloat(l):1}},iL=e=>fo(0,255,e),Lm={...Ql,transform:e=>Math.round(iL(e))},Ys={test:Kb("rgb","red"),parse:AE("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Lm.transform(e)+", "+Lm.transform(t)+", "+Lm.transform(n)+", "+ru(Su.transform(r))+")"};function oL(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const sy={test:Kb("#"),parse:oL,transform:Ys.transform},Za={test:Kb("hsl","hue"),parse:AE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+xi.transform(ru(t))+", "+xi.transform(ru(n))+", "+ru(Su.transform(r))+")"},Vn={test:e=>Ys.test(e)||sy.test(e)||Za.test(e),parse:e=>Ys.test(e)?Ys.parse(e):Za.test(e)?Za.parse(e):sy.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ys.transform(e):Za.transform(e)},sL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function aL(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Yb))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(sL))===null||n===void 0?void 0:n.length)||0)>0}const TE="number",EE="color",lL="var",cL="var(",Xx="${}",uL=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Au(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const l=t.replace(uL,c=>(Vn.test(c)?(r.color.push(o),i.push(EE),n.push(Vn.parse(c))):c.startsWith(cL)?(r.var.push(o),i.push(lL),n.push(c)):(r.number.push(o),i.push(TE),n.push(parseFloat(c))),++o,Xx)).split(Xx);return{values:n,split:l,indexes:r,types:i}}function CE(e){return Au(e).values}function OE(e){const{split:t,types:n}=Au(e),r=t.length;return i=>{let o="";for(let s=0;s<r;s++)if(o+=t[s],i[s]!==void 0){const l=n[s];l===TE?o+=ru(i[s]):l===EE?o+=Vn.transform(i[s]):o+=i[s]}return o}}const hL=e=>typeof e=="number"?0:e;function fL(e){const t=CE(e);return OE(e)(t.map(hL))}const es={test:aL,parse:CE,createTransformer:OE,getAnimatableNone:fL},dL=new Set(["brightness","contrast","saturate","opacity"]);function pL(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Yb)||[];if(!r)return e;const i=n.replace(r,"");let o=dL.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const mL=/\b([a-z-]*)\(.*?\)/gu,ay={...es,getAnimatableNone:e=>{const t=e.match(mL);return t?t.map(pL).join(" "):e}},gL={...Rb,color:Vn,backgroundColor:Vn,outlineColor:Vn,fill:Vn,stroke:Vn,borderColor:Vn,borderTopColor:Vn,borderRightColor:Vn,borderBottomColor:Vn,borderLeftColor:Vn,filter:ay,WebkitFilter:ay},Xb=e=>gL[e];function ME(e,t){let n=Xb(e);return n!==ay&&(n=es),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const yL=new Set(["auto","none","0"]);function vL(e,t,n){let r=0,i;for(;r<e.length&&!i;){const o=e[r];typeof o=="string"&&!yL.has(o)&&Au(o).values.length&&(i=e[r]),r++}if(i&&n)for(const o of t)e[o]=ME(n,i)}const Jx=e=>e===Ql||e===Wt,Qx=(e,t)=>parseFloat(e.split(", ")[t]),tw=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Qx(i[1],t);{const o=r.match(/^matrix\((.+)\)$/u);return o?Qx(o[1],e):0}},bL=new Set(["x","y","z"]),xL=Jl.filter(e=>!bL.has(e));function wL(e){const t=[];return xL.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const gl={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:tw(4,13),y:tw(5,14)};gl.translateX=gl.x;gl.translateY=gl.y;const ea=new Set;let ly=!1,cy=!1;function kE(){if(cy){const e=Array.from(ea).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=wL(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([o,s])=>{var l;(l=r.getValue(o))===null||l===void 0||l.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}cy=!1,ly=!1,ea.forEach(e=>e.complete()),ea.clear()}function $E(){ea.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(cy=!0)})}function _L(){$E(),kE()}class Jb{constructor(t,n,r,i,o,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ea.add(this),ly||(ly=!0,Ue.read($E),Ue.resolveKeyframes(kE))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let o=0;o<t.length;o++)if(t[o]===null)if(o===0){const s=i==null?void 0:i.get(),l=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),i&&s===void 0&&i.set(t[0])}else t[o]=t[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ea.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ea.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const IE=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),SL=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function PL(e){const t=SL.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const AL=4;function RE(e,t,n=1){Qo(n<=AL,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,i]=PL(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return IE(s)?parseFloat(s):s}return Ib(i)?RE(i,t,n+1):i}const LE=e=>t=>t.test(e),TL={test:e=>e==="auto",parse:e=>e},NE=[Ql,Wt,xi,zo,pR,dR,TL],ew=e=>NE.find(LE(e));class jE extends Jb{constructor(t,n,r,i,o){super(t,n,r,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let h=t[c];if(typeof h=="string"&&(h=h.trim(),Ib(h))){const u=RE(h,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!dE.has(r)||t.length!==2)return;const[i,o]=t,s=ew(i),l=ew(o);if(s!==l)if(Jx(s)&&Jx(l))for(let c=0;c<t.length;c++){const h=t[c];typeof h=="string"&&(t[c]=parseFloat(h))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)eL(t[i])&&r.push(i);r.length&&vL(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=gl[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const o=n.getValue(r);o&&o.jump(this.measuredOrigin,!1);const s=i.length-1,l=i[s];i[s]=gl[r](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,h])=>{n.getValue(c).set(h)}),this.resolveNoneKeyframes()}}const nw=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(es.test(e)||e==="0")&&!e.startsWith("url("));function EL(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function CL(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],s=nw(i,t),l=nw(o,t);return Xl(s===l,`You are trying to animate ${t} from "${i}" to "${o}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${o} via the \`style\` property.`),!s||!l?!1:EL(e)||(n==="spring"||Fb(n))&&r}const OL=e=>e!==null;function Pp(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(OL),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const ML=40;class DE{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=wi.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:o,repeatType:s,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>ML?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&_L(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=wi.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:o,delay:s,onComplete:l,onUpdate:c,isGenerator:h}=this.options;if(!h&&!CL(t,r,i,o))if(s)this.options.duration=0;else{c&&c(Pp(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Je=(e,t,n)=>e+(t-e)*n;function Nm(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function kL({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,s=0;if(!t)i=o=s=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;i=Nm(c,l,e+1/3),o=Nm(c,l,e),s=Nm(c,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}function qf(e,t){return n=>n>0?t:e}const jm=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},$L=[sy,Ys,Za],IL=e=>$L.find(t=>t.test(e));function rw(e){const t=IL(e);if(Xl(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===Za&&(n=kL(n)),n}const iw=(e,t)=>{const n=rw(e),r=rw(t);if(!n||!r)return qf(e,t);const i={...n};return o=>(i.red=jm(n.red,r.red,o),i.green=jm(n.green,r.green,o),i.blue=jm(n.blue,r.blue,o),i.alpha=Je(n.alpha,r.alpha,o),Ys.transform(i))},RL=(e,t)=>n=>t(e(n)),dh=(...e)=>e.reduce(RL),uy=new Set(["none","hidden"]);function LL(e,t){return uy.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function NL(e,t){return n=>Je(e,t,n)}function Qb(e){return typeof e=="number"?NL:typeof e=="string"?Ib(e)?qf:Vn.test(e)?iw:BL:Array.isArray(e)?BE:typeof e=="object"?Vn.test(e)?iw:jL:qf}function BE(e,t){const n=[...e],r=n.length,i=e.map((o,s)=>Qb(o)(o,t[s]));return o=>{for(let s=0;s<r;s++)n[s]=i[s](o);return n}}function jL(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Qb(e[i])(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}}function DL(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],l=e.indexes[s][i[s]],c=(n=e.values[l])!==null&&n!==void 0?n:0;r[o]=c,i[s]++}return r}const BL=(e,t)=>{const n=es.createTransformer(t),r=Au(e),i=Au(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?uy.has(e)&&!i.values.length||uy.has(t)&&!r.values.length?LL(e,t):dh(BE(DL(r,i),i.values),n):(Xl(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),qf(e,t))};function zE(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Je(e,t,n):Qb(e)(e,t)}const zL=5;function FE(e,t,n){const r=Math.max(t-zL,0);return pE(n-e(r),t-r)}const Xe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Dm=.001;function FL({duration:e=Xe.duration,bounce:t=Xe.bounce,velocity:n=Xe.velocity,mass:r=Xe.mass}){let i,o;Xl(e<=bi(Xe.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=fo(Xe.minDamping,Xe.maxDamping,s),e=fo(Xe.minDuration,Xe.maxDuration,ao(e)),s<1?(i=h=>{const u=h*s,f=u*e,m=u-n,y=hy(h,s),x=Math.exp(-f);return Dm-m/y*x},o=h=>{const f=h*s*e,m=f*n+n,y=Math.pow(s,2)*Math.pow(h,2)*e,x=Math.exp(-f),p=hy(Math.pow(h,2),s);return(-i(h)+Dm>0?-1:1)*((m-y)*x)/p}):(i=h=>{const u=Math.exp(-h*e),f=(h-n)*e+1;return-Dm+u*f},o=h=>{const u=Math.exp(-h*e),f=(n-h)*(e*e);return u*f});const l=5/e,c=VL(i,o,l);if(e=bi(e),isNaN(c))return{stiffness:Xe.stiffness,damping:Xe.damping,duration:e};{const h=Math.pow(c,2)*r;return{stiffness:h,damping:s*2*Math.sqrt(r*h),duration:e}}}const WL=12;function VL(e,t,n){let r=n;for(let i=1;i<WL;i++)r=r-e(r)/t(r);return r}function hy(e,t){return e*Math.sqrt(1-t*t)}const UL=["duration","bounce"],HL=["stiffness","damping","mass"];function ow(e,t){return t.some(n=>e[n]!==void 0)}function qL(e){let t={velocity:Xe.velocity,stiffness:Xe.stiffness,damping:Xe.damping,mass:Xe.mass,isResolvedFromDuration:!1,...e};if(!ow(e,HL)&&ow(e,UL))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,o=2*fo(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Xe.mass,stiffness:i,damping:o}}else{const n=FL(e);t={...t,...n,mass:Xe.mass},t.isResolvedFromDuration=!0}return t}function WE(e=Xe.visualDuration,t=Xe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],l={done:!1,value:o},{stiffness:c,damping:h,mass:u,duration:f,velocity:m,isResolvedFromDuration:y}=qL({...n,velocity:-ao(n.velocity||0)}),x=m||0,p=h/(2*Math.sqrt(c*u)),b=s-o,P=ao(Math.sqrt(c/u)),S=Math.abs(b)<5;r||(r=S?Xe.restSpeed.granular:Xe.restSpeed.default),i||(i=S?Xe.restDelta.granular:Xe.restDelta.default);let A;if(p<1){const w=hy(P,p);A=T=>{const O=Math.exp(-p*P*T);return s-O*((x+p*P*b)/w*Math.sin(w*T)+b*Math.cos(w*T))}}else if(p===1)A=w=>s-Math.exp(-P*w)*(b+(x+P*b)*w);else{const w=P*Math.sqrt(p*p-1);A=T=>{const O=Math.exp(-p*P*T),R=Math.min(w*T,300);return s-O*((x+p*P*b)*Math.sinh(R)+w*b*Math.cosh(R))/w}}const E={calculatedDuration:y&&f||null,next:w=>{const T=A(w);if(y)l.done=w>=f;else{let O=0;p<1&&(O=w===0?bi(x):FE(A,w,T));const R=Math.abs(O)<=r,N=Math.abs(s-T)<=i;l.done=R&&N}return l.value=l.done?s:T,l},toString:()=>{const w=Math.min(sE(E),ry),T=aE(O=>E.next(w*O).value,w,30);return w+"ms "+T}};return E}function sw({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:l,max:c,restDelta:h=.5,restSpeed:u}){const f=e[0],m={done:!1,value:f},y=R=>l!==void 0&&R<l||c!==void 0&&R>c,x=R=>l===void 0?c:c===void 0||Math.abs(l-R)<Math.abs(c-R)?l:c;let p=n*t;const b=f+p,P=s===void 0?b:s(b);P!==b&&(p=P-f);const S=R=>-p*Math.exp(-R/r),A=R=>P+S(R),E=R=>{const N=S(R),V=A(R);m.done=Math.abs(N)<=h,m.value=m.done?P:V};let w,T;const O=R=>{y(m.value)&&(w=R,T=WE({keyframes:[m.value,x(m.value)],velocity:FE(A,R,m.value),damping:i,stiffness:o,restDelta:h,restSpeed:u}))};return O(0),{calculatedDuration:null,next:R=>{let N=!1;return!T&&w===void 0&&(N=!0,E(R),O(R)),w!==void 0&&R>=w?T.next(R-w):(!N&&E(R),m)}}}const GL=fh(.42,0,1,1),ZL=fh(0,0,.58,1),VE=fh(.42,0,.58,1),YL=e=>Array.isArray(e)&&typeof e[0]!="number",aw={linear:cr,easeIn:GL,easeInOut:VE,easeOut:ZL,circIn:Zb,circInOut:SE,circOut:_E,backIn:Gb,backInOut:xE,backOut:bE,anticipate:wE},lw=e=>{if(Wb(e)){Qo(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,i]=e;return fh(t,n,r,i)}else if(typeof e=="string")return Qo(aw[e]!==void 0,`Invalid easing type '${e}'`),aw[e];return e};function KL(e,t,n){const r=[],i=n||zE,o=e.length-1;for(let s=0;s<o;s++){let l=i(e[s],e[s+1]);if(t){const c=Array.isArray(t)?t[s]||cr:t;l=dh(c,l)}r.push(l)}return r}function XL(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(Qo(o===t.length,"Both input and output ranges must be the same length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=KL(t,r,i),c=l.length,h=u=>{if(s&&u<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const m=pl(e[f],e[f+1],u);return l[f](m)};return n?u=>h(fo(e[0],e[o-1],u)):h}function JL(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=pl(0,t,r);e.push(Je(n,1,i))}}function QL(e){const t=[0];return JL(t,e.length-1),t}function tN(e,t){return e.map(n=>n*t)}function eN(e,t){return e.map(()=>t||VE).splice(0,e.length-1)}function Gf({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=YL(r)?r.map(lw):lw(r),o={done:!1,value:t[0]},s=tN(n&&n.length===t.length?n:QL(t),e),l=XL(s,t,{ease:Array.isArray(i)?i:eN(t,i)});return{calculatedDuration:e,next:c=>(o.value=l(c),o.done=c>=e,o)}}const nN=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ue.update(t,!0),stop:()=>ts(t),now:()=>Nn.isProcessing?Nn.timestamp:wi.now()}},rN={decay:sw,inertia:sw,tween:Gf,keyframes:Gf,spring:WE},iN=e=>e/100;class t0 extends DE{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:i,keyframes:o}=this.options,s=(i==null?void 0:i.KeyframeResolver)||Jb,l=(c,h)=>this.onKeyframesResolved(c,h);this.resolver=new s(o,l,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=this.options,l=Fb(n)?n:rN[n]||Gf;let c,h;l!==Gf&&typeof t[0]!="number"&&(process.env.NODE_ENV!=="production"&&Qo(t.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),c=dh(iN,zE(t[0],t[1])),t=[0,100]);const u=l({...this.options,keyframes:t});o==="mirror"&&(h=l({...this.options,keyframes:[...t].reverse(),velocity:-s})),u.calculatedDuration===null&&(u.calculatedDuration=sE(u));const{calculatedDuration:f}=u,m=f+i,y=m*(r+1)-i;return{generator:u,mirroredGenerator:h,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:m,totalDuration:y}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:R}=this.options;return{done:!0,value:R[R.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:s,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:h,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return o.next(0);const{delay:m,repeat:y,repeatType:x,repeatDelay:p,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const P=this.currentTime-m*(this.speed>=0?1:-1),S=this.speed>=0?P<0:P>u;this.currentTime=Math.max(P,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let A=this.currentTime,E=o;if(y){const R=Math.min(this.currentTime,u)/f;let N=Math.floor(R),V=R%1;!V&&R>=1&&(V=1),V===1&&N--,N=Math.min(N,y+1),!!(N%2)&&(x==="reverse"?(V=1-V,p&&(V-=p/f)):x==="mirror"&&(E=s)),A=fo(0,1,V)*f}const w=S?{done:!1,value:c[0]}:E.next(A);l&&(w.value=l(w.value));let{done:T}=w;!S&&h!==null&&(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return O&&i!==void 0&&(w.value=Pp(c,this.options,i)),b&&b(w.value),O&&this.finish(),w}get duration(){const{resolved:t}=this;return t?ao(t.calculatedDuration):0}get time(){return ao(this.currentTime)}set time(t){t=bi(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ao(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=nN,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const oN=new Set(["opacity","clipPath","filter","transform"]);function sN(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:l="easeInOut",times:c}={}){const h={[t]:n};c&&(h.offset=c);const u=cE(l,i);return Array.isArray(u)&&(h.easing=u),e.animate(h,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"})}const aN=Tb(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Zf=10,lN=2e4;function cN(e){return Fb(e.type)||e.type==="spring"||!lE(e.ease)}function uN(e,t){const n=new t0({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let o=0;for(;!r.done&&o<lN;)r=n.sample(o),i.push(r.value),o+=Zf;return{times:void 0,keyframes:i,duration:o-Zf,ease:"linear"}}const UE={anticipate:wE,backInOut:xE,circInOut:SE};function hN(e){return e in UE}class cw extends DE{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:o}=this.options;this.resolver=new jE(o,(s,l)=>this.onKeyframesResolved(s,l),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:o,type:s,motionValue:l,name:c,startTime:h}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof o=="string"&&Hf()&&hN(o)&&(o=UE[o]),cN(this.options)){const{onComplete:f,onUpdate:m,motionValue:y,element:x,...p}=this.options,b=uN(t,p);t=b.keyframes,t.length===1&&(t[1]=t[0]),r=b.duration,i=b.times,o=b.ease,s="keyframes"}const u=sN(l.owner.current,c,t,{...this.options,duration:r,times:i,ease:o});return u.startTime=h??this.calcStartTime(),this.pendingTimeline?(qx(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;l.set(Pp(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:i,type:s,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ao(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ao(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=bi(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return cr;const{animation:r}=n;qx(r,t)}return cr}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:o,ease:s,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:h,onUpdate:u,onComplete:f,element:m,...y}=this.options,x=new t0({...y,keyframes:r,duration:i,type:o,ease:s,times:l,isGenerator:!0}),p=bi(this.time);h.setWithVelocity(x.sample(p-Zf).value,x.sample(p).value,Zf)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:o,damping:s,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:h}=n.owner.getProps();return aN()&&r&&oN.has(r)&&!c&&!h&&!i&&o!=="mirror"&&s!==0&&l!=="inertia"}}const fN={type:"spring",stiffness:500,damping:25,restSpeed:10},dN=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),pN={type:"keyframes",duration:.8},mN={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},gN=(e,{keyframes:t})=>t.length>2?pN:ba.has(e)?e.startsWith("scale")?dN(t[1]):fN:mN;function yN({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:l,from:c,elapsed:h,...u}){return!!Object.keys(u).length}const e0=(e,t,n,r={},i,o)=>s=>{const l=zb(r,e)||{},c=l.delay||r.delay||0;let{elapsed:h=0}=r;h=h-bi(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-h,onUpdate:m=>{t.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{s(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:o?void 0:i};yN(l)||(u={...u,...gN(e,u)}),u.duration&&(u.duration=bi(u.duration)),u.repeatDelay&&(u.repeatDelay=bi(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),f&&!o&&t.get()!==void 0){const m=Pp(u.keyframes,l);if(m!==void 0)return Ue.update(()=>{u.onUpdate(m),u.onComplete()}),new NR([])}return!o&&cw.supports(u)?new cw(u):new t0(u)};function vN({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function HE(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:s=e.getDefaultTransition(),transitionEnd:l,...c}=t;r&&(s=r);const h=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const f in c){const m=e.getValue(f,(o=e.latestValues[f])!==null&&o!==void 0?o:null),y=c[f];if(y===void 0||u&&vN(u,f))continue;const x={delay:n,...zb(s||{},f)};let p=!1;if(window.MotionHandoffAnimation){const P=mE(e);if(P){const S=window.MotionHandoffAnimation(P,f,Ue);S!==null&&(x.startTime=S,p=!0)}}oy(e,f),m.start(e0(f,m,y,e.shouldReduceMotion&&dE.has(f)?{type:!1}:x,e,p));const b=m.animation;b&&h.push(b)}return l&&Promise.all(h).then(()=>{Ue.update(()=>{l&&KR(e,l)})}),h}function fy(e,t,n={}){var r;const i=Sp(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(HE(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:m}=o;return bN(e,t,u+h,f,m,n)}:()=>Promise.resolve(),{when:c}=o;if(c){const[h,u]=c==="beforeChildren"?[s,l]:[l,s];return h().then(()=>u())}else return Promise.all([s(),l(n.delay)])}function bN(e,t,n=0,r=0,i=1,o){const s=[],l=(e.variantChildren.size-1)*r,c=i===1?(h=0)=>h*r:(h=0)=>l-h*r;return Array.from(e.variantChildren).sort(xN).forEach((h,u)=>{h.notify("AnimationStart",t),s.push(fy(h,t,{...o,delay:n+c(u)}).then(()=>h.notify("AnimationComplete",t)))}),Promise.all(s)}function xN(e,t){return e.sortNodePosition(t)}function wN(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>fy(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=fy(e,t,n);else{const i=typeof t=="function"?Sp(e,t,n.custom):t;r=Promise.all(HE(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const _N=Cb.length;function qE(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?qE(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<_N;n++){const r=Cb[n],i=e.props[r];(_u(i)||i===!1)&&(t[r]=i)}return t}const SN=[...Eb].reverse(),PN=Eb.length;function AN(e){return t=>Promise.all(t.map(({animation:n,options:r})=>wN(e,n,r)))}function TN(e){let t=AN(e),n=uw(),r=!0;const i=c=>(h,u)=>{var f;const m=Sp(e,u,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(m){const{transition:y,transitionEnd:x,...p}=m;h={...h,...p,...x}}return h};function o(c){t=c(e)}function s(c){const{props:h}=e,u=qE(e.parent)||{},f=[],m=new Set;let y={},x=1/0;for(let b=0;b<PN;b++){const P=SN[b],S=n[P],A=h[P]!==void 0?h[P]:u[P],E=_u(A),w=P===c?S.isActive:null;w===!1&&(x=b);let T=A===u[P]&&A!==h[P]&&E;if(T&&r&&e.manuallyAnimateOnMount&&(T=!1),S.protectedKeys={...y},!S.isActive&&w===null||!A&&!S.prevProp||wp(A)||typeof A=="boolean")continue;const O=EN(S.prevProp,A);let R=O||P===c&&S.isActive&&!T&&E||b>x&&E,N=!1;const V=Array.isArray(A)?A:[A];let D=V.reduce(i(P),{});w===!1&&(D={});const{prevResolvedValues:j={}}=S,K={...j,...D},H=G=>{R=!0,m.has(G)&&(N=!0,m.delete(G)),S.needsAnimating[G]=!0;const J=e.getValue(G);J&&(J.liveStyle=!1)};for(const G in K){const J=D[G],lt=j[G];if(y.hasOwnProperty(G))continue;let q=!1;ny(J)&&ny(lt)?q=!oE(J,lt):q=J!==lt,q?J!=null?H(G):m.add(G):J!==void 0&&m.has(G)?H(G):S.protectedKeys[G]=!0}S.prevProp=A,S.prevResolvedValues=D,S.isActive&&(y={...y,...D}),r&&e.blockInitialAnimation&&(R=!1),R&&(!(T&&O)||N)&&f.push(...V.map(G=>({animation:G,options:{type:P}})))}if(m.size){const b={};m.forEach(P=>{const S=e.getBaseTarget(P),A=e.getValue(P);A&&(A.liveStyle=!0),b[P]=S??null}),f.push({animation:b})}let p=!!f.length;return r&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function l(c,h){var u;if(n[c].isActive===h)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(m=>{var y;return(y=m.animationState)===null||y===void 0?void 0:y.setActive(c,h)}),n[c].isActive=h;const f=s(c);for(const m in n)n[m].protectedKeys={};return f}return{animateChanges:s,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=uw(),r=!0}}}function EN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!oE(t,e):!1}function Ns(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function uw(){return{animate:Ns(!0),whileInView:Ns(),whileHover:Ns(),whileTap:Ns(),whileDrag:Ns(),whileFocus:Ns(),exit:Ns()}}class os{constructor(t){this.isMounted=!1,this.node=t}update(){}}class CN extends os{constructor(t){super(t),t.animationState||(t.animationState=TN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();wp(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let ON=0;class MN extends os{constructor(){super(...arguments),this.id=ON++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const kN={animation:{Feature:CN},exit:{Feature:MN}};function Tu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ph(e){return{point:{x:e.pageX,y:e.pageY}}}const $N=e=>t=>Vb(t)&&e(t,ph(t));function iu(e,t,n,r){return Tu(e,t,$N(n),r)}const hw=(e,t)=>Math.abs(e-t);function IN(e,t){const n=hw(e.x,t.x),r=hw(e.y,t.y);return Math.sqrt(n**2+r**2)}class GE{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=zm(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,y=IN(f.offset,{x:0,y:0})>=3;if(!m&&!y)return;const{point:x}=f,{timestamp:p}=Nn;this.history.push({...x,timestamp:p});const{onStart:b,onMove:P}=this.handlers;m||(b&&b(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,f)},this.handlePointerMove=(f,m)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Bm(m,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(f,m)=>{this.end();const{onEnd:y,onSessionEnd:x,resumeAnimation:p}=this.handlers;if(this.dragSnapToOrigin&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=zm(f.type==="pointercancel"?this.lastMoveEventInfo:Bm(m,this.transformPagePoint),this.history);this.startEvent&&y&&y(f,b),x&&x(f,b)},!Vb(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const s=ph(t),l=Bm(s,this.transformPagePoint),{point:c}=l,{timestamp:h}=Nn;this.history=[{...c,timestamp:h}];const{onSessionStart:u}=n;u&&u(t,zm(l,this.history)),this.removeListeners=dh(iu(this.contextWindow,"pointermove",this.handlePointerMove),iu(this.contextWindow,"pointerup",this.handlePointerUp),iu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ts(this.updatePoint)}}function Bm(e,t){return t?{point:t(e.point)}:e}function fw(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zm({point:e},t){return{point:e,delta:fw(e,ZE(t)),offset:fw(e,RN(t)),velocity:LN(t,.1)}}function RN(e){return e[0]}function ZE(e){return e[e.length-1]}function LN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=ZE(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>bi(t)));)n--;if(!r)return{x:0,y:0};const o=ao(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}const YE=1e-4,NN=1-YE,jN=1+YE,KE=.01,DN=0-KE,BN=0+KE;function Sr(e){return e.max-e.min}function zN(e,t,n){return Math.abs(e-t)<=n}function dw(e,t,n,r=.5){e.origin=r,e.originPoint=Je(t.min,t.max,e.origin),e.scale=Sr(n)/Sr(t),e.translate=Je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=NN&&e.scale<=jN||isNaN(e.scale))&&(e.scale=1),(e.translate>=DN&&e.translate<=BN||isNaN(e.translate))&&(e.translate=0)}function ou(e,t,n,r){dw(e.x,t.x,n.x,r?r.originX:void 0),dw(e.y,t.y,n.y,r?r.originY:void 0)}function pw(e,t,n){e.min=n.min+t.min,e.max=e.min+Sr(t)}function FN(e,t,n){pw(e.x,t.x,n.x),pw(e.y,t.y,n.y)}function mw(e,t,n){e.min=t.min-n.min,e.max=e.min+Sr(t)}function su(e,t,n){mw(e.x,t.x,n.x),mw(e.y,t.y,n.y)}function WN(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Je(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Je(n,e,r.max):Math.min(e,n)),e}function gw(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function VN(e,{top:t,left:n,bottom:r,right:i}){return{x:gw(e.x,n,i),y:gw(e.y,t,r)}}function yw(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function UN(e,t){return{x:yw(e.x,t.x),y:yw(e.y,t.y)}}function HN(e,t){let n=.5;const r=Sr(e),i=Sr(t);return i>r?n=pl(t.min,t.max-r,e.min):r>i&&(n=pl(e.min,e.max-i,t.min)),fo(0,1,n)}function qN(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const dy=.35;function GN(e=dy){return e===!1?e=0:e===!0&&(e=dy),{x:vw(e,"left","right"),y:vw(e,"top","bottom")}}function vw(e,t,n){return{min:bw(e,t),max:bw(e,n)}}function bw(e,t){return typeof e=="number"?e:e[t]||0}const xw=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ya=()=>({x:xw(),y:xw()}),ww=()=>({min:0,max:0}),an=()=>({x:ww(),y:ww()});function Lr(e){return[e("x"),e("y")]}function XE({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ZN({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function YN(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Fm(e){return e===void 0||e===1}function py({scale:e,scaleX:t,scaleY:n}){return!Fm(e)||!Fm(t)||!Fm(n)}function Ws(e){return py(e)||JE(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function JE(e){return _w(e.x)||_w(e.y)}function _w(e){return e&&e!=="0%"}function Yf(e,t,n){const r=e-n,i=t*r;return n+i}function Sw(e,t,n,r,i){return i!==void 0&&(e=Yf(e,i,r)),Yf(e,n,r)+t}function my(e,t=0,n=1,r,i){e.min=Sw(e.min,t,n,r,i),e.max=Sw(e.max,t,n,r,i)}function QE(e,{x:t,y:n}){my(e.x,t.translate,t.scale,t.originPoint),my(e.y,n.translate,n.scale,n.originPoint)}const Pw=.999999999999,Aw=1.0000000000001;function KN(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let l=0;l<i;l++){o=n[l],s=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Xa(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,QE(e,s)),r&&Ws(o.latestValues)&&Xa(e,o.latestValues))}t.x<Aw&&t.x>Pw&&(t.x=1),t.y<Aw&&t.y>Pw&&(t.y=1)}function Ka(e,t){e.min=e.min+t,e.max=e.max+t}function Tw(e,t,n,r,i=.5){const o=Je(e.min,e.max,i);my(e,t,n,o,r)}function Xa(e,t){Tw(e.x,t.x,t.scaleX,t.scale,t.originX),Tw(e.y,t.y,t.scaleY,t.scale,t.originY)}function tC(e,t){return XE(YN(e.getBoundingClientRect(),t))}function XN(e,t,n){const r=tC(e,n),{scroll:i}=t;return i&&(Ka(r.x,i.offset.x),Ka(r.y,i.offset.y)),r}const eC=({current:e})=>e?e.ownerDocument.defaultView:null,JN=new WeakMap;class QN{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=an(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ph(u).point)},o=(u,f)=>{const{drag:m,dragPropagation:y,onDragStart:x}=this.getProps();if(m&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=HR(m),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Lr(b=>{let P=this.getAxisMotionValue(b).get()||0;if(xi.test(P)){const{projection:S}=this.visualElement;if(S&&S.layout){const A=S.layout.layoutBox[b];A&&(P=Sr(A)*(parseFloat(P)/100))}}this.originPoint[b]=P}),x&&Ue.postRender(()=>x(u,f)),oy(this.visualElement,"transform");const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},s=(u,f)=>{const{dragPropagation:m,dragDirectionLock:y,onDirectionLock:x,onDrag:p}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:b}=f;if(y&&this.currentDirection===null){this.currentDirection=tj(b),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),p&&p(u,f)},l=(u,f)=>this.stop(u,f),c=()=>Lr(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:h}=this.getProps();this.panSession=new GE(t,{onSessionStart:i,onStart:o,onMove:s,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,contextWindow:eC(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&Ue.postRender(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!tf(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=WN(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,o=this.constraints;n&&Ga(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=VN(i.layoutBox,n):this.constraints=!1,this.elastic=GN(r),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Lr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=qN(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ga(t))return!1;const r=t.current;Qo(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=XN(r,i.root,this.visualElement.getTransformPagePoint());let s=UN(i.layout.layoutBox,o);if(n){const l=n(ZN(s));this.hasMutatedConstraints=!!l,l&&(s=XE(l))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},h=Lr(u=>{if(!tf(u,n,this.currentDirection))return;let f=c&&c[u]||{};s&&(f={min:0,max:0});const m=i?200:1e6,y=i?40:1e7,x={type:"inertia",velocity:r?t[u]:0,bounceStiffness:m,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(u,x)});return Promise.all(h).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return oy(this.visualElement,t),r.start(e0(t,r,0,n,this.visualElement,!1))}stopAnimation(){Lr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Lr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Lr(n=>{const{drag:r}=this.getProps();if(!tf(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:l}=i.layout.layoutBox[n];o.set(t[n]-Je(s,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ga(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Lr(s=>{const l=this.getAxisMotionValue(s);if(l&&this.constraints!==!1){const c=l.get();i[s]=HN({min:c,max:c},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Lr(s=>{if(!tf(s,t,null))return;const l=this.getAxisMotionValue(s),{min:c,max:h}=this.constraints[s];l.set(Je(c,h,i[s]))})}addListeners(){if(!this.visualElement.current)return;JN.set(this.visualElement,this);const t=this.visualElement.current,n=iu(t,"pointerdown",c=>{const{drag:h,dragListener:u=!0}=this.getProps();h&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Ga(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ue.read(r);const s=Tu(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h})=>{this.isDragging&&h&&(Lr(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=c[u].translate,f.set(f.get()+c[u].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=dy,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:l}}}function tf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function tj(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class ej extends os{constructor(t){super(t),this.removeGroupControls=cr,this.removeListeners=cr,this.controls=new QN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cr}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ew=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class nj extends os{constructor(){super(...arguments),this.removePointerDownListener=cr}onPointerDown(t){this.session=new GE(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:eC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ew(t),onStart:Ew(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&Ue.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=iu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Lf={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Cw(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Nc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Wt.test(e))e=parseFloat(e);else return e;const n=Cw(e,t.target.x),r=Cw(e,t.target.y);return`${n}% ${r}%`}},rj={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=es.parse(e);if(i.length>5)return r;const o=es.createTransformer(e),s=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;i[0+s]/=l,i[1+s]/=c;const h=Je(l,c,.5);return typeof i[2+s]=="number"&&(i[2+s]/=h),typeof i[3+s]=="number"&&(i[3+s]/=h),o(i)}};class ij extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;PR(oj),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Lf.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,s=r.projection;return s&&(s.isPresent=o,i||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Ue.postRender(()=>{const l=s.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Mb.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function nC(e){const[t,n]=BT(),r=v.useContext(_b);return Ze.jsx(ij,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(qT),isPresent:t,safeToRemove:n})}const oj={borderRadius:{...Nc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Nc,borderTopRightRadius:Nc,borderBottomLeftRadius:Nc,borderBottomRightRadius:Nc,boxShadow:rj};function sj(e,t,n){const r=qn(e)?e:Pu(e);return r.start(e0("",r,t,n)),r.animation}function aj(e){return e instanceof SVGElement&&e.tagName!=="svg"}const lj=(e,t)=>e.depth-t.depth;class cj{constructor(){this.children=[],this.isDirty=!1}add(t){Ub(this.children,t),this.isDirty=!0}remove(t){Hb(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(lj),this.isDirty=!1,this.children.forEach(t)}}function uj(e,t){const n=wi.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(ts(r),e(o-t))};return Ue.read(r,!0),()=>ts(r)}const rC=["TopLeft","TopRight","BottomLeft","BottomRight"],hj=rC.length,Ow=e=>typeof e=="string"?parseFloat(e):e,Mw=e=>typeof e=="number"||Wt.test(e);function fj(e,t,n,r,i,o){i?(e.opacity=Je(0,n.opacity!==void 0?n.opacity:1,dj(r)),e.opacityExit=Je(t.opacity!==void 0?t.opacity:1,0,pj(r))):o&&(e.opacity=Je(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;s<hj;s++){const l=`border${rC[s]}Radius`;let c=kw(t,l),h=kw(n,l);if(c===void 0&&h===void 0)continue;c||(c=0),h||(h=0),c===0||h===0||Mw(c)===Mw(h)?(e[l]=Math.max(Je(Ow(c),Ow(h),r),0),(xi.test(h)||xi.test(c))&&(e[l]+="%")):e[l]=h}(t.rotate||n.rotate)&&(e.rotate=Je(t.rotate||0,n.rotate||0,r))}function kw(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const dj=iC(0,.5,_E),pj=iC(.5,.95,cr);function iC(e,t,n){return r=>r<e?0:r>t?1:n(pl(e,t,r))}function $w(e,t){e.min=t.min,e.max=t.max}function kr(e,t){$w(e.x,t.x),$w(e.y,t.y)}function Iw(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Rw(e,t,n,r,i){return e-=t,e=Yf(e,1/n,r),i!==void 0&&(e=Yf(e,1/i,r)),e}function mj(e,t=0,n=1,r=.5,i,o=e,s=e){if(xi.test(t)&&(t=parseFloat(t),t=Je(s.min,s.max,t/100)-s.min),typeof t!="number")return;let l=Je(o.min,o.max,r);e===o&&(l-=t),e.min=Rw(e.min,t,n,l,i),e.max=Rw(e.max,t,n,l,i)}function Lw(e,t,[n,r,i],o,s){mj(e,t[n],t[r],t[i],t.scale,o,s)}const gj=["x","scaleX","originX"],yj=["y","scaleY","originY"];function Nw(e,t,n,r){Lw(e.x,t,gj,n?n.x:void 0,r?r.x:void 0),Lw(e.y,t,yj,n?n.y:void 0,r?r.y:void 0)}function jw(e){return e.translate===0&&e.scale===1}function oC(e){return jw(e.x)&&jw(e.y)}function Dw(e,t){return e.min===t.min&&e.max===t.max}function vj(e,t){return Dw(e.x,t.x)&&Dw(e.y,t.y)}function Bw(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function sC(e,t){return Bw(e.x,t.x)&&Bw(e.y,t.y)}function zw(e){return Sr(e.x)/Sr(e.y)}function Fw(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class bj{constructor(){this.members=[]}add(t){Ub(this.members,t),t.scheduleRender()}remove(t){if(Hb(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function xj(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:u,rotateX:f,rotateY:m,skewX:y,skewY:x}=n;h&&(r=`perspective(${h}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),m&&(r+=`rotateY(${m}deg) `),y&&(r+=`skewX(${y}deg) `),x&&(r+=`skewY(${x}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Vs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Xc=typeof window<"u"&&window.MotionDebug!==void 0,Wm=["","X","Y","Z"],wj={visibility:"hidden"},Ww=1e3;let _j=0;function Vm(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function aC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=mE(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&aC(r)}function lC({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},l=t==null?void 0:t()){this.id=_j++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Xc&&(Vs.totalNodes=Vs.resolvedTargetDeltas=Vs.recalculatedProjection=0),this.nodes.forEach(Aj),this.nodes.forEach(Mj),this.nodes.forEach(kj),this.nodes.forEach(Tj),Xc&&window.MotionDebug.record(Vs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new cj)}addEventListener(s,l){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new qb),this.eventHandlers.get(s).add(l)}notifyListeners(s,...l){const c=this.eventHandlers.get(s);c&&c.notify(...l)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=aj(s),this.instance=s;const{layoutId:c,layout:h,visualElement:u}=this.options;if(u&&!u.current&&u.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(h||c)&&(this.isLayoutDirty=!0),e){let f;const m=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=uj(m,250),Lf.hasAnimatedSinceResize&&(Lf.hasAnimatedSinceResize=!1,this.nodes.forEach(Uw))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&u&&(c||h)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:m,hasRelativeTargetChanged:y,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||Nj,{onLayoutAnimationStart:b,onLayoutAnimationComplete:P}=u.getProps(),S=!this.targetLayout||!sC(this.targetLayout,x)||y,A=!m&&y;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||m&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,A);const E={...zb(p,"layout"),onPlay:b,onComplete:P};(u.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else m||Uw(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ts(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach($j),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&aC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Vw);return}this.isUpdating||this.nodes.forEach(Cj),this.isUpdating=!1,this.nodes.forEach(Oj),this.nodes.forEach(Sj),this.nodes.forEach(Pj),this.clearAllSnapshots();const l=wi.now();Nn.delta=fo(0,1e3/60,l-Nn.timestamp),Nn.timestamp=l,Nn.isProcessing=!0,Im.update.process(Nn),Im.preRender.process(Nn),Im.render.process(Nn),Nn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Mb.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ej),this.sharedNodes.forEach(Ij)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=an(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(l=!1),l){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!oC(this.projectionDelta),c=this.getTransformTemplate(),h=c?c(this.latestValues,""):void 0,u=h!==this.prevTransformTemplateValue;s&&(l||Ws(this.latestValues)||u)&&(i(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return s&&(c=this.removeTransform(c)),jj(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var s;const{visualElement:l}=this.options;if(!l)return an();const c=l.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(Dj))){const{scroll:u}=this.root;u&&(Ka(c.x,u.offset.x),Ka(c.y,u.offset.y))}return c}removeElementScroll(s){var l;const c=an();if(kr(c,s),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return c;for(let h=0;h<this.path.length;h++){const u=this.path[h],{scroll:f,options:m}=u;u!==this.root&&f&&m.layoutScroll&&(f.wasRoot&&kr(c,s),Ka(c.x,f.offset.x),Ka(c.y,f.offset.y))}return c}applyTransform(s,l=!1){const c=an();kr(c,s);for(let h=0;h<this.path.length;h++){const u=this.path[h];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Xa(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ws(u.latestValues)&&Xa(c,u.latestValues)}return Ws(this.latestValues)&&Xa(c,this.latestValues),c}removeTransform(s){const l=an();kr(l,s);for(let c=0;c<this.path.length;c++){const h=this.path[c];if(!h.instance||!Ws(h.latestValues))continue;py(h.latestValues)&&h.updateSnapshot();const u=an(),f=h.measurePageBox();kr(u,f),Nw(l,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,u)}return Ws(this.latestValues)&&Nw(l,this.latestValues),l}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Nn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var l;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==c;if(!(s||h&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:m}=this.options;if(!(!this.layout||!(f||m))){if(this.resolvedRelativeTargetAt=Nn.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=an(),this.relativeTargetOrigin=an(),su(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),kr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=an(),this.targetWithTransforms=an()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),FN(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):kr(this.target,this.layout.layoutBox),QE(this.target,this.targetDelta)):kr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const y=this.getClosestProjectingParent();y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=an(),this.relativeTargetOrigin=an(),su(this.relativeTargetOrigin,this.target,y.target),kr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Xc&&Vs.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||py(this.parent.latestValues)||JE(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let h=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(h=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Nn.timestamp&&(h=!1),h)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;kr(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,y=this.treeScale.y;KN(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=an());const{target:x}=l;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Iw(this.prevProjectionDelta.x,this.projectionDelta.x),Iw(this.prevProjectionDelta.y,this.projectionDelta.y)),ou(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==y||!Fw(this.projectionDelta.x,this.prevProjectionDelta.x)||!Fw(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),Xc&&Vs.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),s){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ya(),this.projectionDelta=Ya(),this.projectionDeltaWithTransform=Ya()}setAnimationOrigin(s,l=!1){const c=this.snapshot,h=c?c.latestValues:{},u={...this.latestValues},f=Ya();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const m=an(),y=c?c.source:void 0,x=this.layout?this.layout.source:void 0,p=y!==x,b=this.getStack(),P=!b||b.members.length<=1,S=!!(p&&!P&&this.options.crossfade===!0&&!this.path.some(Lj));this.animationProgress=0;let A;this.mixTargetDelta=E=>{const w=E/1e3;Hw(f.x,s.x,w),Hw(f.y,s.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(su(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Rj(this.relativeTarget,this.relativeTargetOrigin,m,w),A&&vj(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=an()),kr(A,this.relativeTarget)),p&&(this.animationValues=u,fj(u,h,this.latestValues,w,S,P)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ts(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{Lf.hasAnimatedSinceResize=!0,this.currentAnimation=sj(0,Ww,{...s,onUpdate:l=>{this.mixTargetDelta(l),s.onUpdate&&s.onUpdate(l)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ww),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:l,target:c,layout:h,latestValues:u}=s;if(!(!l||!c||!h)){if(this!==s&&this.layout&&h&&cC(this.options.animationType,this.layout.layoutBox,h.layoutBox)){c=this.target||an();const f=Sr(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+f;const m=Sr(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+m}kr(l,c),Xa(l,u),ou(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(s,l){this.sharedNodes.has(s)||this.sharedNodes.set(s,new bj),this.sharedNodes.get(s).add(l);const h=l.options.initialPromotionConfig;l.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(l):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:l}=this.options;return l?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:l}=this.options;return l?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:l,preserveFollowOpacity:c}={}){const h=this.getStack();h&&h.promote(this,c),s&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let l=!1;const{latestValues:c}=s;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const h={};c.z&&Vm("z",s,h,this.animationValues);for(let u=0;u<Wm.length;u++)Vm(`rotate${Wm[u]}`,s,h,this.animationValues),Vm(`skew${Wm[u]}`,s,h,this.animationValues);s.render();for(const u in h)s.setStaticValue(u,h[u]),this.animationValues&&(this.animationValues[u]=h[u]);s.scheduleRender()}getProjectionStyles(s){var l,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return wj;const h={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,h.opacity="",h.pointerEvents=If(s==null?void 0:s.pointerEvents)||"",h.transform=u?u(this.latestValues,""):"none",h;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=If(s==null?void 0:s.pointerEvents)||""),this.hasProjected&&!Ws(this.latestValues)&&(p.transform=u?u({},""):"none",this.hasProjected=!1),p}const m=f.animationValues||f.latestValues;this.applyTransformsToTarget(),h.transform=xj(this.projectionDeltaWithTransform,this.treeScale,m),u&&(h.transform=u(m,h.transform));const{x:y,y:x}=this.projectionDelta;h.transformOrigin=`${y.origin*100}% ${x.origin*100}% 0`,f.animationValues?h.opacity=f===this?(c=(l=m.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:h.opacity=f===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const p in Uf){if(m[p]===void 0)continue;const{correct:b,applyTo:P}=Uf[p],S=h.transform==="none"?m[p]:b(m[p],f);if(P){const A=P.length;for(let E=0;E<A;E++)h[P[E]]=S}else h[p]=S}return this.options.layoutId&&(h.pointerEvents=f===this?If(s==null?void 0:s.pointerEvents)||"":"none"),h}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var l;return(l=s.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(Vw),this.root.sharedNodes.clear()}}}function Sj(e){e.updateLayout()}function Pj(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,s=n.source!==e.layout.source;o==="size"?Lr(f=>{const m=s?n.measuredBox[f]:n.layoutBox[f],y=Sr(m);m.min=r[f].min,m.max=m.min+y}):cC(o,n.layoutBox,r)&&Lr(f=>{const m=s?n.measuredBox[f]:n.layoutBox[f],y=Sr(r[f]);m.max=m.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+y)});const l=Ya();ou(l,r,n.layoutBox);const c=Ya();s?ou(c,e.applyTransform(i,!0),n.measuredBox):ou(c,r,n.layoutBox);const h=!oC(l);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:m,layout:y}=f;if(m&&y){const x=an();su(x,n.layoutBox,m.layoutBox);const p=an();su(p,r,y.layoutBox),sC(x,p)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=x,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:h,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Aj(e){Xc&&Vs.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Tj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ej(e){e.clearSnapshot()}function Vw(e){e.clearMeasurements()}function Cj(e){e.isLayoutDirty=!1}function Oj(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Uw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Mj(e){e.resolveTargetDelta()}function kj(e){e.calcProjection()}function $j(e){e.resetSkewAndRotation()}function Ij(e){e.removeLeadSnapshot()}function Hw(e,t,n){e.translate=Je(t.translate,0,n),e.scale=Je(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function qw(e,t,n,r){e.min=Je(t.min,n.min,r),e.max=Je(t.max,n.max,r)}function Rj(e,t,n,r){qw(e.x,t.x,n.x,r),qw(e.y,t.y,n.y,r)}function Lj(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Nj={duration:.45,ease:[.4,0,.1,1]},Gw=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Zw=Gw("applewebkit/")&&!Gw("chrome/")?Math.round:cr;function Yw(e){e.min=Zw(e.min),e.max=Zw(e.max)}function jj(e){Yw(e.x),Yw(e.y)}function cC(e,t,n){return e==="position"||e==="preserve-aspect"&&!zN(zw(t),zw(n),.2)}function Dj(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const Bj=lC({attachResizeListener:(e,t)=>Tu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Um={current:void 0},uC=lC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Um.current){const e=new Bj({});e.mount(window),e.setOptions({layoutScroll:!0}),Um.current=e}return Um.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),zj={pan:{Feature:nj},drag:{Feature:ej,ProjectionNode:uC,MeasureLayout:nC}};function Kw(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&Ue.postRender(()=>o(t,ph(t)))}class Fj extends os{mount(){const{current:t}=this.node;t&&(this.unmount=zR(t,n=>(Kw(this.node,n,"Start"),r=>Kw(this.node,r,"End"))))}unmount(){}}class Wj extends os{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=dh(Tu(this.node.current,"focus",()=>this.onFocus()),Tu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Xw(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=r[i];o&&Ue.postRender(()=>o(t,ph(t)))}class Vj extends os{mount(){const{current:t}=this.node;t&&(this.unmount=UR(t,n=>(Xw(this.node,n,"Start"),(r,{success:i})=>Xw(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const gy=new WeakMap,Hm=new WeakMap,Uj=e=>{const t=gy.get(e.target);t&&t(e)},Hj=e=>{e.forEach(Uj)};function qj({root:e,...t}){const n=e||document;Hm.has(n)||Hm.set(n,{});const r=Hm.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Hj,{root:e,...t})),r[i]}function Gj(e,t,n){const r=qj(t);return gy.set(e,n),r.observe(e),()=>{gy.delete(e),r.unobserve(e)}}const Zj={some:0,all:1};class Yj extends os{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Zj[i]},l=c=>{const{isIntersecting:h}=c;if(this.isInView===h||(this.isInView=h,o&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),m=h?u:f;m&&m(c)};return Gj(this.node.current,s,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Kj(t,n))&&this.startObserver()}unmount(){}}function Kj({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Xj={inView:{Feature:Yj},tap:{Feature:Vj},focus:{Feature:Wj},hover:{Feature:Fj}},Jj={layout:{ProjectionNode:uC,MeasureLayout:nC}},yy={current:null},hC={current:!1};function Qj(){if(hC.current=!0,!!Ab)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>yy.current=e.matches;e.addListener(t),t()}else yy.current=!1}const tD=[...NE,Vn,es],eD=e=>tD.find(LE(e)),Jw=new WeakMap;function nD(e,t,n){for(const r in t){const i=t[r],o=n[r];if(qn(i))e.addValue(r,i),process.env.NODE_ENV==="development"&&bp(i.version==="11.18.2",`Attempting to mix Motion versions ${i.version} with 11.18.2 may not work as expected.`);else if(qn(o))e.addValue(r,Pu(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,Pu(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Qw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class rD{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Jb,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=wi.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,Ue.render(this.render,!1,!0))};const{latestValues:c,renderState:h,onUpdate:u}=s;this.onUpdate=u,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=h,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=_p(n),this.isVariantNode=UT(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in m){const x=m[y];c[y]!==void 0&&qn(x)&&x.set(c[y],!1)}}mount(t){this.current=t,Jw.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),hC.current||Qj(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:yy.current,process.env.NODE_ENV!=="production"&&bp(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Jw.delete(this.current),this.projection&&this.projection.unmount(),ts(this.notifyUpdate),ts(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ba.has(t),i=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ml){const n=ml[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):an()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Qw.length;r++){const i=Qw[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,s=t[o];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=nD(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pu(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(IE(i)||PE(i))?i=parseFloat(i):!eD(i)&&es.test(n)&&(i=ME(t,n)),this.setBaseTarget(t,qn(i)?i.get():i)),qn(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const s=$b(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);s&&(i=s[t])}if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!qn(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new qb),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class fC extends rD{constructor(){super(...arguments),this.KeyframeResolver=jE}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;qn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function iD(e){return window.getComputedStyle(e)}class oD extends fC{constructor(){super(...arguments),this.type="html",this.renderInstance=QT}readValueFromInstance(t,n){if(ba.has(n)){const r=Xb(n);return r&&r.default||0}else{const r=iD(t),i=(KT(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return tC(t,n)}build(t,n,r){Lb(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Bb(t,n,r)}}class sD extends fC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=an}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ba.has(n)){const r=Xb(n);return r&&r.default||0}return n=tE.has(n)?n:Ob(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return rE(t,n,r)}build(t,n,r){Nb(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){eE(t,n,r,i)}mount(t){this.isSVGTag=Db(t.tagName),super.mount(t)}}const aD=(e,t)=>kb(e)?new sD(t):new oD(t,{allowProjection:e!==v.Fragment}),lD=IR({...kN,...Xj,...zj,...Jj},aD),Kf=ZI(lD),cD={div:"div",span:"span",p:"p",hr:"hr",a:"a",strong:"strong",em:"em",del:"del",li:"li",ul:"ul",ol:"ol",form:"form",img:"img",header:"header",footer:"footer",section:"section",nav:"nav",main:"main",article:"article",aside:"aside",figure:"figure",figcaption:"figcaption",th:"th",td:"td",caption:"caption",blockquote:"blockquote",address:"address",time:"time",legend:"legend",label:"label",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",code:"code"},uD=new Set(["motion","initial","animate","exit","transition","variants","whileHover","whileTap","whileFocus","whileInView","animateLayout"]);function U(e,t,...n){const{style:r,className:i,...o}=t||{};if(o.motion){const l={};for(const h of uD)if(h in o){const u=h==="animateLayout"?"layout":h;let f=o[h];u==="transition"&&f&&typeof f=="object"&&(f={...f,repeat:Math.max(0,Number(f.repeat)||0)}),l[u]=f,delete o[h]}const c=Kf[e]||Kf.div;return v.createElement(c,{...o,className:i,style:r||{},...l},...n)}delete o.animateLayout;const s=cD[e];return s?v.createElement(s,{...o,className:i,style:r||{}},...n):v.createElement(e,{...o,className:i,style:r||{}},...n)}const hD={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},dC={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},pC=["base","sm","md","lg","xl","2xl"],bn={0:"0px","0.5":"0.125rem",1:"0.25rem","1.5":"0.375rem",2:"0.5rem","2.5":"0.625rem",3:"0.75rem","3.5":"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},ef={xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"},t_={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",auto:"auto",screen:"100vw",fit:"fit-content",max:"max-content",min:"min-content"},nf={"flex-row":"row","flex-row-reverse":"row-reverse","flex-col":"column","flex-col-reverse":"column-reverse"},rf={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-baseline":"baseline","items-stretch":"stretch"},of={"justify-start":"flex-start","justify-end":"flex-end","justify-center":"center","justify-between":"space-between","justify-around":"space-around","justify-evenly":"space-evenly"},sf={"rounded-none":"0px","rounded-sm":"0.125rem",rounded:"0.25rem","rounded-md":"0.375rem","rounded-lg":"0.5rem","rounded-xl":"0.75rem","rounded-2xl":"1rem","rounded-3xl":"1.5rem","rounded-full":"9999px"},fD=["hidden","block","flex","grid","inline","inline-block","inline-flex"];function n0(e,t,n,r){const i=new Map,o=e.split(/\s+/).filter(Boolean);for(const s of o){const l=new RegExp(n.source).exec(s);if(l){i.set(l[1],r(l));continue}const c=new RegExp(t.source).exec(s);c&&i.set("base",r([null,null,c[1]]))}return i}function mC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(flex-row|flex-row-reverse|flex-col|flex-col-reverse)$/);if(i&&nf[i[2]]){t.set(i[1],nf[i[2]]);continue}nf[r]&&t.set("base",nf[r])}return t}function gC(e){return n0(e,/^gap-(\d+(?:\.\d+)?)$/,/^(sm|md|lg|xl|2xl):gap-(\d+(?:\.\d+)?)$/,t=>bn[t[2]]||`${t[2]}px`)}function yC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):w-(.+)$/);if(i){const s=t_[i[2]]||bn[i[2]]||i[2];s&&t.set(i[1],s);continue}const o=r.match(/^w-(.+)$/);if(o){const s=t_[o[1]]||bn[o[1]]||o[1];s&&t.set("base",s)}}return t}function dD(e){return n0(e,/^min-h-\[([^\]]+)\]$/,/^(sm|md|lg|xl|2xl):min-h-\[([^\]]+)\]$/,t=>t[2])}function vC(e){const t=new Map,n=new Map,r=new Map,i=new Map,o=new Map,s=new Map,l=new Map,c=e.split(/\s+/).filter(Boolean);for(const h of c)for(const[u,f]of[["m-",t],["mt-",n],["mr-",r],["mb-",i],["ml-",o],["mx-",s],["my-",l]]){const m=h.match(new RegExp(`^(sm|md|lg|xl|2xl):${u}(\\d+(?:\\.\\d+)?)$`));if(m&&bn[m[2]]){f.set(m[1],bn[m[2]]);break}const y=h.match(new RegExp(`^${u}(\\d+(?:\\.\\d+)?)$`));if(y&&bn[y[1]]){f.set("base",bn[y[1]]);break}}return{all:t,t:n,r,b:i,l:o,x:s,y:l}}function bC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(items-start|items-end|items-center|items-baseline|items-stretch)$/);if(i&&rf[i[2]]){t.set(i[1],rf[i[2]]);continue}rf[r]&&t.set("base",rf[r])}return t}function xC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(justify-start|justify-end|justify-center|justify-between|justify-around|justify-evenly)$/);if(i&&of[i[2]]){t.set(i[1],of[i[2]]);continue}of[r]&&t.set("base",of[r])}return t}function wC(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(rounded-none|rounded-sm|rounded|rounded-md|rounded-lg|rounded-xl|rounded-2xl|rounded-3xl|rounded-full)$/);if(i&&sf[i[2]]){t.set(i[1],sf[i[2]]);continue}sf[r]&&t.set("base",sf[r])}return t}function r0(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):(hidden|block|flex|grid|inline|inline-block|inline-flex)$/);if(i){t.set(i[1],i[2]==="hidden"?"none":i[2]);continue}fD.includes(r)&&t.set("base",r==="hidden"?"none":r)}return t}function i0(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):grid-cols-(\d+)$/);if(i){t.set(i[1],parseInt(i[2],10));continue}const o=r.match(/^grid-cols-(\d+)$/);o&&t.set("base",parseInt(o[1],10))}return t}function pD(e){return n0(e,/^grid-cols-\[([^\]]+)\]$/,/^(sm|md|lg|xl|2xl):grid-cols-\[([^\]]+)\]$/,t=>t[2].replace(/_/g," "))}function o0(e){const t=new Map,n=e.split(/\s+/).filter(Boolean);for(const r of n){const i=r.match(/^(sm|md|lg|xl|2xl):text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/);if(i&&ef[i[2]]){t.set(i[1],ef[i[2]]);continue}const o=r.match(/^text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/);o&&ef[o[1]]&&t.set("base",ef[o[1]])}return t}function s0(e){const t=new Map,n=new Map,r=new Map,i=e.split(/\s+/).filter(Boolean);for(const o of i){const s=o.match(/^(sm|md|lg|xl|2xl):px-(\d+(?:\.\d+)?)$/);if(s&&bn[s[2]]){t.set(s[1],bn[s[2]]);continue}const l=o.match(/^px-(\d+(?:\.\d+)?)$/);if(l&&bn[l[1]]){t.set("base",bn[l[1]]);continue}const c=o.match(/^(sm|md|lg|xl|2xl):py-(\d+(?:\.\d+)?)$/);if(c&&bn[c[2]]){n.set(c[1],bn[c[2]]);continue}const h=o.match(/^py-(\d+(?:\.\d+)?)$/);if(h&&bn[h[1]]){n.set("base",bn[h[1]]);continue}const u=o.match(/^(sm|md|lg|xl|2xl):p-(\d+(?:\.\d+)?)$/);if(u&&bn[u[2]]){r.set(u[1],bn[u[2]]);continue}const f=o.match(/^p-(\d+(?:\.\d+)?)$/);f&&bn[f[1]]&&r.set("base",bn[f[1]])}return{px:t,py:n,p:r}}function vy(e){return e.flexDirection.size>0||e.gap.size>0||e.width.size>0||e.minHeight.size>0||e.alignItems.size>0||e.justifyContent.size>0||e.padding.px.size>0||e.padding.py.size>0||e.padding.p.size>0||e.display.size>0||e.gridCols.size>0||e.gridTemplateColumns.size>0||e.textSize.size>0||e.borderRadius.size>0||e.margin.all.size>0||e.margin.t.size>0||e.margin.r.size>0||e.margin.b.size>0||e.margin.l.size>0||e.margin.x.size>0||e.margin.y.size>0}function by(e){return{flexDirection:mC(e),gap:gC(e),width:yC(e),minHeight:dD(e),margin:vC(e),alignItems:bC(e),justifyContent:xC(e),padding:s0(e),display:r0(e),gridCols:i0(e),gridTemplateColumns:pD(e),textSize:o0(e),borderRadius:wC(e),any:!1}}const Eu=hD;function mD(e){return i0(e)}function gD(e,t){let n=e.get("base")??1;const r=["2xl","xl","lg","md","sm"];if(t<=0){for(const i of r)if(e.has(i))return e.get(i);return n}for(const i of["sm","md","lg","xl","2xl"])t>=(Eu[i]||0)&&e.has(i)&&(n=e.get(i));return n}function a0(e){return o0(e)}function zt(e,t,n){let r=e.get("base")??n;for(const i of["sm","md","lg","xl","2xl"])t>=(Eu[i]||0)&&e.has(i)&&(r=e.get(i));return r}function mh(e){return s0(e)}function tc(e){return r0(e)}function _C(e){const[t,n]=v.useState(()=>{var i;return((i=e.current)==null?void 0:i.offsetWidth)??0}),r=v.useRef(t);return v.useEffect(()=>{const i=e.current;if(!i)return;const o=i.offsetWidth;o>0&&o!==r.current&&(r.current=o,n(o));const s=new ResizeObserver(l=>{for(const c of l){const h=Math.round(c.contentRect.width);h>0&&h!==r.current&&(r.current=h,n(h))}});return s.observe(i),()=>{s.disconnect()}},[e]),t}function yD(e,t,n){var h,u,f;const i=(Array.isArray(t.tabItems)?t.tabItems:Array.isArray(t.tabs)?t.tabs:[]).filter(m=>!m.condition||!e.evaluateCondition||e.evaluateCondition(m.condition));if(i.length===0)return null;const o=`__tab_${n}`,s=e.sceneData[o]??(t.defaultTab||0),l={width:"100%",display:"flex",flexDirection:"column",...t.className?((h=e.parseClassNameResponsive)==null?void 0:h.call(e,t.className,n))??e.parseClassName(t.className):{}},c=e.getCommonProps(n,l,t);return v.createElement("div",{key:n,...c},v.createElement("div",{style:{display:"flex",borderBottom:`1px solid ${e.cfg.colors.borderSubtle}`,gap:"0"}},i.map((m,y)=>v.createElement("button",{key:`${n}-tab-${y}`,onClick:()=>e.setSceneData(x=>({...x,[o]:y})),style:{padding:"8px 16px",fontSize:"13px",fontWeight:s===y?600:400,color:s===y?e.cfg.colors.primary:e.cfg.colors.textMuted,borderBottom:s===y?`2px solid ${e.cfg.colors.primary}`:"2px solid transparent",background:"none",border:"none",borderBottomStyle:"solid",borderBottomWidth:"2px",borderBottomColor:s===y?e.cfg.colors.primary:"transparent",cursor:"pointer",transition:e.cfg.effects.transition}},m.label||m.title))),v.createElement("div",{style:{padding:"12px 0"}},(Array.isArray((u=i[s])==null?void 0:u.content)?i[s].content:Array.isArray((f=i[s])==null?void 0:f.children)?i[s].children:[]).map((m,y)=>e.renderComponent(m,y,`${n}-tabcontent-${s}`))))}function vD(e,t,n){var s;Array.isArray(t.items)&&!Array.isArray(t.accordionItems)&&(t.accordionItems=t.items);const r=Array.isArray(t.accordionItems)?t.accordionItems:[];if(r.length===0)return null;const i={width:"100%",display:"flex",flexDirection:"column",gap:"1px",...t.className?((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className):{}},o=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,...o},r.map((l,c)=>{const h=`__acc_${n}_${c}`,u=e.sceneData[h]??(l.defaultOpen||!1);return v.createElement("div",{key:`${n}-acc-${c}`},v.createElement("button",{onClick:()=>e.setSceneData(f=>({...f,[h]:!u})),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",background:"none",border:"none",borderBottom:`1px solid ${e.cfg.colors.borderSubtle}`,color:e.cfg.colors.textSecondary,fontSize:e.cfg.typography.baseFontSize,fontWeight:500,cursor:"pointer",transition:e.cfg.effects.transition}},U("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.icon?e.renderIcon(l.icon,14,{color:e.cfg.colors.primary}):null,U("span",null,l.title)),U("span",{style:{transform:u?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",fontSize:"24px"}},"▾")),v.createElement(zI,{initial:!1},u&&v.createElement(Kf.div,{key:`${n}-acc-body-${c}`,initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{height:{duration:.3,ease:"easeInOut"},opacity:{duration:.25}},style:{overflow:"hidden"}},v.createElement("div",{style:{padding:"8px 12px",display:"flex",flexDirection:"column",gap:"8px"}},(Array.isArray(l.content)?l.content:typeof l.content=="string"?[{type:"text",text:l.content}]:Array.isArray(l.children)?l.children:[]).map((m,y)=>e.renderComponent(m,y,`${n}-acc-${c}-content`))))))}))}function bD(e,t,n){var y,x,p,b,P;const r=(y=e.paginationState)==null?void 0:y[n],i=t.pagination===!0&&r&&r.total>r.limit,o=t.pagination==="scroll",s=r?Math.ceil(r.total/r.limit):0,l=t.className||"flex flex-col gap-3 w-full",c=((x=e.parseClassNameResponsive)==null?void 0:x.call(e,l,n))??e.parseClassName(l);t.rawStyle&&Object.assign(c,t.rawStyle);const h=(p=e.loading)==null?void 0:p[n],u=(b=e.listData)==null?void 0:b[n],f=Array.isArray(u)?u:[],m=e.renderMode==="css-driven"?{"data-bf-r":`${e.scopeId}-${n}`}:{};return v.createElement("div",{key:n,className:l,style:c,"data-component-key":n,...m},h&&(t.loadingComponent?e.renderComponent(t.loadingComponent,0,n):v.createElement("div",{className:"flex justify-center py-4"},U("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin"}))),!h&&f.length===0&&t.emptyComponent&&e.renderComponent(t.emptyComponent,0,`${n}-empty`),!h&&t.selectable&&e.sceneData._selectMode&&f.length>0&&U("div",{key:`${n}-sel-hdr`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:((P=t.selectionStyle)==null?void 0:P.headerPadding)||"0.5rem 2rem"}},U("button",{type:"button",onClick:()=>{const S=Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[],A=f.map((w,T)=>String(w.id||T)),E=A.length>0&&A.every(w=>S.includes(w));e.setSceneData(w=>({...w,_selIds:E?[]:A}))},style:{background:"none",border:"none",cursor:"pointer",color:e.cfg.colors.textSecondary,fontSize:"12px",fontFamily:"inherit",padding:"4px 0"}},(Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[]).filter(S=>f.some(A=>String(A.id)===S)).length===f.filter(S=>S.id).length&&f.length>0?"Deselect all":"Select all"),(Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[]).length>0?U("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},...(Array.isArray(t.selectActions)?t.selectActions:[]).map((S,A)=>U("button",{key:A,type:"button",onClick:()=>{var w;const E=Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[];E.length!==0&&((w=e.runBulkSelectAction)==null||w.call(e,S,t.dataSource,n,E))},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",borderRadius:"4px",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.textSecondary,transition:"all 0.15s ease",padding:"0"},onMouseEnter:E=>{E.currentTarget.style.backgroundColor=e.cfg.colors.border,E.currentTarget.style.color=e.cfg.colors.text},onMouseLeave:E=>{E.currentTarget.style.backgroundColor="transparent",E.currentTarget.style.color=e.cfg.colors.textSecondary}},e.renderIcon(S.icon,12))),U("span",{style:{fontSize:"12px",color:e.cfg.colors.textMuted}},`${(Array.isArray(e.sceneData._selIds)?e.sceneData._selIds:[]).length} selected`)):null),!h&&f.length>0&&(()=>{var G,J,lt,q,nt;const S=(G=t.groupBy)==null?void 0:G.field,A=it=>{const at=it==null?void 0:it[S];if(at&&typeof at=="object"&&at._seconds)return at._seconds*1e3;const ct=Date.parse(at);return isNaN(ct)?0:ct},E=it=>{if(!it)return"Earlier";const at=new Date(it),ct=new Date,gt=Et=>`${Et.getFullYear()}-${Et.getMonth()}-${Et.getDate()}`;if(gt(at)===gt(ct))return"Today";const yt=new Date(ct);return yt.setDate(ct.getDate()-1),gt(at)===gt(yt)?"Yesterday":at.toLocaleDateString()},T=((J=t.sort)==null?void 0:J.field)||S?[...f].sort((it,at)=>{var gt;const ct=A(at)-A(it);return((gt=t.sort)==null?void 0:gt.direction)==="asc"?-ct:ct}):f,O=String(e.sceneData.recordingSearchApplied||"").trim().toLowerCase(),[R,N]=String(e.sceneData.recordingDateFilterApplied||"").split("|"),V=R?Date.parse(`${R}T00:00:00`):0,D=N?Date.parse(`${N}T23:59:59.999`):Number.POSITIVE_INFINITY,j=(lt=t.itemsFilter)!=null&&lt.eq?e.interpolateText(String(t.itemsFilter.eq)):"",H=((q=t.itemsFilter)!=null&&q.field&&j?T.filter(it=>String(it==null?void 0:it[t.itemsFilter.field])===j):T).filter(it=>{const at=!O||[it.url,it.title,it.prompt].some(gt=>String(gt||"").toLowerCase().includes(O)),ct=A(it);return at&&ct>=V&&ct<=D}),z={};if(S)for(const it of H)(z[nt=E(A(it))]||(z[nt]=[])).push(it);const Y=(it,at)=>{var ct,gt,yt,Et,Tt,ht,ft,Ct;if(t.renderItem){const rt=JSON.parse(JSON.stringify(t.renderItem)),Rt={...it};if(t.labelField&&t.labelMap){const Bt=String(t.labelField.split(".").reduce((Qt,te)=>Qt==null?void 0:Qt[te],it)??"");Rt.label=t.labelMap[Bt]??""}const bt={};if(Array.isArray(rt.children)){for(const Bt of rt.children)if(Bt.content){const Qt=Bt.content.match(/^\{\{(\w+)\}\}$/);if(Qt){const te=Qt[1],Ht=it[te];Array.isArray(Ht)&&(bt[te]=Ht)}}}const ne=JSON.stringify(rt).replace(/\{\{([\w.]+)(?:\|(date|time|datetime|timeago))?\}\}/g,(Bt,Qt,te)=>{const Ht=Qt.split(".").reduce((re,Ce)=>re==null?void 0:re[Ce],Rt);if(Array.isArray(Ht))return Bt;if(Ht==null)return"";if(te){const re=Ht&&typeof Ht=="object"&&"_seconds"in Ht?new Date(Ht._seconds*1e3):new Date(Ht);if(!isNaN(re.getTime())){if(te==="timeago"){const Ce=Math.floor((Date.now()-re.getTime())/6e4);if(Ce<1)return"just now";if(Ce<60)return`${Ce}m ago`;const ie=Math.floor(Ce/60);if(ie<24)return`${ie}h ago`;const on=Math.floor(ie/24);return on<7?`${on}d ago`:re.toLocaleDateString()}return te==="date"?re.toLocaleDateString():te==="time"?re.toLocaleTimeString():re.toLocaleString()}}return typeof Ht=="string"?Ht.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):Ht!==void 0?JSON.stringify(Ht):""}),Gt=JSON.parse(ne);Gt.type==="widget"&&Gt.widgetId&&(Gt.props={...Rt,...Gt.props||{}});const Le=Bt=>{if(!(!Bt||typeof Bt!="object")){Bt.condition&&(Bt.__conditionBase=Rt);for(const Qt of Bt.children||[])Le(Qt)}};if(Le(Gt),Gt.children&&(Gt.children=Gt.children.map(Bt=>{var Ht;const Qt=Bt.fieldType||"text",te=(Ht=Bt.content)==null?void 0:Ht.match(/^\{\{(\w+)\}\}$/);if(te){const re=te[1],Ce=bt[re];if(Ce)return Qt==="dropdown"?{...Bt,type:"select",content:void 0,placeholder:Bt.fieldPlaceholder||`Select ${re}...`,options:Ce.map(ie=>({label:typeof ie=="object"?ie.label||ie.name||JSON.stringify(ie):String(ie),value:typeof ie=="object"?ie.value||ie.id||JSON.stringify(ie):String(ie)})),name:`${n}-${at}-${re}`,className:Bt.className||"w-full text-sm bg-slate-700 border border-slate-500 text-white rounded-lg px-3 py-1.5"}:Qt==="multiselect"?{...Bt,type:"container",content:void 0,className:Bt.className||"flex flex-col gap-1 w-full",children:[...Bt.fieldPlaceholder?[{type:"text",content:Bt.fieldPlaceholder,className:"text-xs text-gray-400 mb-1"}]:[{type:"text",content:`Select ${re}`,className:"text-xs text-gray-400 mb-1"}],...Ce.map((ie,on)=>({type:"checkbox",label:typeof ie=="object"?ie.label||ie.name||JSON.stringify(ie):String(ie),name:`${n}-${at}-${re}-${on}`,className:"text-sm text-gray-200"}))]}:Qt==="image-grid"?{...Bt,type:"container",content:void 0,className:"flex flex-row gap-2 w-full overflow-x-auto py-1",children:Ce.slice(0,10).map((ie,on)=>({type:"image",src:typeof ie=="string"?ie:ie.url||ie.src||"",alt:`${re} ${on+1}`,className:"w-12 h-12 rounded-lg object-cover flex-shrink-0"}))}:{...Bt,type:"container",content:void 0,className:"flex flex-col gap-1 w-full",children:[{type:"text",content:`⚠ "${re}" is an array (${Ce.length} items)`,className:"text-xs font-semibold text-amber-400"},{type:"text",content:"Use ⚡ to fetch fields, then set type in sidebar",className:"text-xs text-amber-300 opacity-75"}]}}return Qt==="image"&&Bt.content&&!Bt.content.includes("{{")?{...Bt,type:"image",src:Bt.content,alt:Bt.content,content:void 0,className:Bt.className||"w-full h-32 rounded-lg object-cover"}:Bt})),t.selectable&&e.sceneData._selectMode){const Bt=String(it.id||at),Qt=Array.isArray(e.sceneData._selIds)&&e.sceneData._selIds.map(String).includes(Bt),te=Ht=>Ht?[Ht.text,Ht.content,...Ht.children?Ht.children.flatMap(te):[]].filter(re=>typeof re=="string"&&re.trim()&&!re.includes("{{")):[];return Gt.text||Gt.label||te(Gt).slice(0,2).join(" — ")||String(it.id||at),U("div",{key:`${n}-item-${at}`,className:(ct=t.selectionStyle)==null?void 0:ct.className,style:{position:"relative",width:"100%",textAlign:"left",padding:"1rem 2rem",border:`1px solid ${Qt?((gt=t.selectionStyle)==null?void 0:gt.selectedBorderColor)||e.cfg.colors.accent||"#fff":((yt=t.selectionStyle)==null?void 0:yt.borderColor)||e.cfg.colors.border}`,borderRadius:((Et=t.selectionStyle)==null?void 0:Et.borderRadius)||e.cfg.components.inputRadius||"8px",marginBottom:"0.5rem",backgroundColor:Qt?((Tt=t.selectionStyle)==null?void 0:Tt.selectedBackgroundColor)||e.cfg.colors.surface:"transparent",color:e.cfg.colors.text,cursor:"pointer",fontFamily:"inherit",fontSize:"14px",fontWeight:Qt?600:400,transition:"all 0.15s ease",outline:"none"}},U("div",{style:{position:"absolute",inset:0,zIndex:1,pointerEvents:"none"}},U("button",{type:"button","aria-label":Qt?"Deselect item":"Select item",onClick:()=>{e.setSceneData(Ht=>{const re=Array.isArray(Ht._selIds)?Ht._selIds.map(String):[];return{...Ht,_selIds:re.includes(Bt)?re.filter(Ce=>Ce!==Bt):[...re,Bt]}})},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",position:"absolute",top:"50%",left:"1.25rem",transform:"translateY(-50%)",pointerEvents:"auto",border:`1px solid ${Qt?((ht=t.selectionStyle)==null?void 0:ht.selectedBorderColor)||e.cfg.colors.accent||"#fff":((ft=t.selectionStyle)==null?void 0:ft.borderColor)||e.cfg.colors.border}`,borderRadius:"5px",backgroundColor:Qt?((Ct=t.selectionStyle)==null?void 0:Ct.selectedBorderColor)||e.cfg.colors.accent||"#fff":"transparent",color:Qt?e.cfg.colors.background:"transparent",transition:"all 0.15s ease"}},Qt?e.renderIcon("check",12):null)),e.renderComponent(Gt,at,`${n}-item`))}return U("div",{key:`${n}-row-${at}`,style:{display:"contents"},onClickCapture:()=>{e.rowContextRef&&(e.rowContextRef.current=it)}},e.renderComponent(Gt,at,`${n}-item`))}return null};return S?Object.entries(z).map(([it,at],ct)=>U("div",{key:`${n}-group-${ct}`,style:{display:"flex",flexDirection:"column",gap:"6px"}},U("div",{key:`${n}-group-hdr-${ct}`,style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.05em",textTransform:"uppercase",color:e.cfg.colors.textMuted,padding:"10px 4px 2px"}},it),at.map(Y))):H.map(Y)})(),o&&(r==null?void 0:r.hasMore)&&U("div",{"data-bf-scroll-load":n,style:{height:"48px",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",...h&&((r==null?void 0:r.page)??0)>0?{}:{pointerEvents:"none",opacity:.55}}},h&&((r==null?void 0:r.page)??0)>0?U("div",{style:{width:"18px",height:"18px",border:"2px solid rgba(128,128,128,0.25)",borderTopColor:e.cfg.colors.primary,borderRadius:"50%",animation:"bf-spin 0.7s linear infinite"}}):U("div",{style:{width:"18px",height:"2px",borderRadius:"2px",background:e.cfg.colors.textMuted,opacity:.4}})),i&&v.createElement("div",{className:"flex items-center justify-center gap-3 mt-4 py-2"},v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page-1,r.limit),disabled:r.page===0||h,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"◀"),U("span",{className:"text-xs text-gray-500"},`${r.page+1} / ${s}`),v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page+1,r.limit),disabled:!r.hasMore||h,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"▶")))}function xD({api:e,c:t,componentKey:n}){var V,D,j,K;const r=(V=e.paginationState)==null?void 0:V[n],i=t.pagination!==!1&&r&&r.total>r.limit,o=r?Math.ceil(r.total/r.limit):0,s=t.className||"w-full overflow-x-auto rounded-xl bg-gray-800/50 border border-gray-700/50",l=((D=e.parseClassNameResponsive)==null?void 0:D.call(e,s,n))??e.parseClassName(s);t.rawStyle&&Object.assign(l,t.rawStyle);const c=(j=e.loading)==null?void 0:j[n],h=(K=e.listData)==null?void 0:K[n],u=Array.isArray(h)?h:[],f=e.renderMode==="css-driven"?{"data-bf-r":`${e.scopeId}-${n}`}:{},m=!!t.sortable,y=t.sortMode==="client"?"client":"server",[x,p]=v.useState(null),[b,P]=v.useState({}),S=v.useMemo(()=>{if(!x||y!=="client")return u;const H=x.dir==="asc"?1:-1;return[...u].sort((z,Y)=>{const G=z[x.key],J=Y[x.key];return G===J?0:G==null?1:J==null?-1:String(G).localeCompare(String(J),void 0,{numeric:!0})*H})},[u,x,y]),A=H=>{if(!m&&!H.sortable)return;const z=H.field||H.key;let Y=null;!x||x.key!==z?Y={key:z,dir:"asc"}:x.dir==="asc"&&(Y={key:z,dir:"desc"}),p(Y),y==="server"&&Y&&e.fetchListData(t.dataSource,n,0,(r==null?void 0:r.limit)||t.pageSize||10,Y.key,Y.dir)},E=(H,z)=>H.replace(/\{\{([\w.]+)(?:\s*\|\|\s*([^}]+))?\}\}/g,(Y,G,J)=>{const lt=G.split(".").reduce((q,nt)=>q==null?void 0:q[nt],z);return lt==null||lt===""?J??"":String(lt)}),w=async(H,z)=>{var J;const Y=b[H.id??""]||{},G=z.filter(lt=>lt.editable&&Y[lt.field||lt.key]!==void 0);for(const lt of G){const q=lt.field||lt.key,nt=lt.onCellChange||t.onSave;if(!nt)continue;const it=nt.replace(/\{\{field\}\}/g,JSON.stringify(Y[q]));if(it.startsWith("sdk:"))await e.handleButtonClick(E(it,H),{});else{const at=E(it,H);await fetch(at,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[q]:Y[q]})})}}G.length&&((J=e.showToast)==null||J.call(e,(G.length===1,"Saved"),"success"),P(lt=>{const q={...lt};return delete q[H.id??""],q}),e.fetchListData(t.dataSource,n,(r==null?void 0:r.page)||0,(r==null?void 0:r.limit)||t.pageSize||10))},T=(H,z,Y)=>{const G=z.field||z.key,J=H.id??"";P(lt=>({...lt,[J]:{...lt[J]||{},[G]:Y}}))},O=(H,z)=>{const Y=H.field||H.key,G=z.id??"",J=b[G]||{},lt=J[Y]!==void 0?J[Y]:z[Y],q=H.fieldType||"text",nt={style:{width:"100%",background:"transparent",color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,borderRadius:"4px",padding:"2px 6px",fontSize:"13px",fontFamily:"inherit"}},it=()=>{H.onCellChange&&J[H.key]!==void 0&&w(z,[H])};if(q==="select"||q==="dropdown")return U("select",{...nt,value:String(lt??""),onChange:at=>{T(z,H,at.target.value),H.onCellChange&&w(z,[H])},children:(Array.isArray(H.fieldOptions)?H.fieldOptions:[]).map((at,ct)=>U("option",{key:ct,value:at.value,children:at.label??at.value}))});if(q==="multiselect"){const at=Array.isArray(lt)?lt:[];return U("div",{style:{display:"flex",flexDirection:"column",gap:2}},(Array.isArray(H.fieldOptions)?H.fieldOptions:[]).map((ct,gt)=>{const yt=at.includes(ct.value);return U("label",{key:gt,style:{display:"flex",alignItems:"center",gap:4,fontSize:12}},U("input",{type:"checkbox",checked:yt,onChange:Et=>{const Tt=Et.target.checked?[...at,ct.value]:at.filter(ht=>ht!==ct.value);T(z,H,Tt),H.onCellChange&&w(z,[H])}}),U("span",{children:ct.label??ct.value}))}))}return q==="image"?U("div",{style:{display:"flex",alignItems:"center",gap:6}},lt?U("img",{src:String(lt),alt:H.label,style:{width:32,height:32,borderRadius:4,objectFit:"cover"}}):null,U("input",{...nt,value:String(lt??""),placeholder:H.fieldPlaceholder||"Image URL",onChange:at=>T(z,H,at.target.value),onBlur:it})):U("input",{...nt,type:q==="number"?"number":"text",value:String(lt??""),placeholder:H.fieldPlaceholder||"",onChange:at=>T(z,H,q==="number"?Number(at.target.value):at.target.value),onBlur:it})},R=H=>{const z=b[H.id??""];return!!z&&Object.keys(z).some(Y=>{var G;return(G=t.columns)==null?void 0:G.some(J=>J.editable&&(J.field||J.key)===Y)})},N=!!t.onSave;return v.createElement("div",{key:n,className:s,style:l,"data-component-key":n,...f},c&&(t.loadingComponent?e.renderComponent(t.loadingComponent,0,n):v.createElement("div",{className:"flex justify-center py-4"},U("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin"}))),v.createElement("table",{className:"w-full"},Array.isArray(t.columns)&&v.createElement("thead",{className:"bg-gray-900/50"},v.createElement("tr",{},t.columns.map(H=>v.createElement("th",{key:H.key,className:"px-4 py-3 text-left text-sm font-medium text-gray-400"},(m||H.sortable)&&H.sortable!==!1?(()=>{const z=x&&x.key===H.key?x:null;return U("button",{type:"button",onClick:()=>A(H),style:{background:"none",border:"none",color:"inherit",fontFamily:"inherit",fontSize:"inherit",cursor:"pointer",padding:0},children:`${H.label||H.key}${z?z.dir==="asc"?" ↑":" ↓":" ⇅"}`})})():H.label||H.key)),N&&v.createElement("th",{key:"__save",className:"px-4 py-3 text-left text-sm font-medium text-gray-400"},""))),v.createElement("tbody",{className:"divide-y divide-gray-700/50"},S.map((H,z)=>{var Y;return v.createElement("tr",{key:H.id??z,className:"hover:bg-gray-700/30 transition-colors"},(Y=t.columns)==null?void 0:Y.map(G=>v.createElement("td",{key:G.key,className:"px-4 py-3 text-sm text-white"},G.editable?O(G,H):G.template?E(G.template,H):(()=>{const lt=(G.field||G.key).split(".").reduce((q,nt)=>q==null?void 0:q[nt],H);return lt==null||lt===""?"":String(lt)})())),N&&v.createElement("td",{key:"__save-cell",className:"px-4 py-3 text-sm"},U("button",{type:"button",disabled:!R(H)||c,onClick:()=>w(H,t.columns||[]),className:"px-3 py-1 rounded text-xs font-semibold border transition-all disabled:opacity-40 disabled:cursor-not-allowed",style:{background:R(H)?e.cfg.colors.primary:"transparent",color:R(H)?"#ffffff":e.cfg.colors.textSecondary,borderColor:e.cfg.colors.border},children:"Save"})))}))),i&&v.createElement("div",{className:"flex items-center justify-center gap-3 mt-4 py-2"},v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page-1,r.limit),disabled:r.page===0||c,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"◀"),U("span",{className:"text-xs text-gray-500"},`${r.page+1} / ${o}`),v.createElement("button",{onClick:()=>e.fetchListData(t.dataSource,n,r.page+1,r.limit),disabled:!r.hasMore||c,className:"flex items-center justify-center w-7 h-7 text-xs text-gray-400 hover:text-white hover:bg-[#222222] rounded border border-[#333333] disabled:opacity-30 disabled:cursor-not-allowed transition-all bg-transparent"},"▶")))}function wD(e,t,n){return v.createElement(xD,{api:e,c:t,componentKey:n})}function Ie(e){var t=e.width,n=e.height;if(t<0)throw new Error("Negative width is not allowed for Size");if(n<0)throw new Error("Negative height is not allowed for Size");return{width:t,height:n}}function na(e,t){return e.width===t.width&&e.height===t.height}var _D=function(){function e(t){var n=this;this._resolutionListener=function(){return n._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=t,this._installResolutionListener()}return e.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(e.prototype,"value",{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(t){var n=this,r={next:t};return this._observers.push(r),{unsubscribe:function(){n._observers=n._observers.filter(function(i){return i!==r})}}},e.prototype._installResolutionListener=function(){if(this._resolutionMediaQueryList!==null)throw new Error("Resolution listener is already installed");var t=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia("all and (resolution: ".concat(t,"dppx)")),this._resolutionMediaQueryList.addListener(this._resolutionListener)},e.prototype._uninstallResolutionListener=function(){this._resolutionMediaQueryList!==null&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},e.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},e.prototype._onResolutionChanged=function(){var t=this;this._observers.forEach(function(n){return n.next(t._window.devicePixelRatio)}),this._reinstallResolutionListener()},e}();function SD(e){return new _D(e)}var PD=function(){function e(t,n,r){var i;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=t,this._canvasElementClientSize=Ie({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=n??function(o){return o},this._allowResizeObserver=(i=r==null?void 0:r.allowResizeObserver)!==null&&i!==void 0?i:!0,this._chooseAndInitObserver()}return e.prototype.dispose=function(){var t,n;if(this._canvasElement===null)throw new Error("Object is disposed");(t=this._canvasElementResizeObserver)===null||t===void 0||t.disconnect(),this._canvasElementResizeObserver=null,(n=this._devicePixelRatioObservable)===null||n===void 0||n.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(e.prototype,"canvasElement",{get:function(){if(this._canvasElement===null)throw new Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bitmapSize",{get:function(){return Ie({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),e.prototype.resizeCanvasElement=function(t){this._canvasElementClientSize=Ie(t),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},e.prototype.subscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners.push(t)},e.prototype.unsubscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(n){return n!==t})},Object.defineProperty(e.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),e.prototype.subscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners.push(t)},e.prototype.unsubscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(n){return n!==t})},e.prototype.applySuggestedBitmapSize=function(){if(this._suggestedBitmapSize!==null){var t=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(t),this._emitSuggestedBitmapSizeChanged(t,this._suggestedBitmapSize)}},e.prototype._resizeBitmap=function(t){var n=this.bitmapSize;na(n,t)||(this.canvasElement.width=t.width,this.canvasElement.height=t.height,this._emitBitmapSizeChanged(n,t))},e.prototype._emitBitmapSizeChanged=function(t,n){var r=this;this._bitmapSizeChangedListeners.forEach(function(i){return i.call(r,t,n)})},e.prototype._suggestNewBitmapSize=function(t){var n=this._suggestedBitmapSize,r=Ie(this._transformBitmapSize(t,this._canvasElementClientSize)),i=na(this.bitmapSize,r)?null:r;n===null&&i===null||n!==null&&i!==null&&na(n,i)||(this._suggestedBitmapSize=i,this._emitSuggestedBitmapSizeChanged(n,i))},e.prototype._emitSuggestedBitmapSizeChanged=function(t,n){var r=this;this._suggestedBitmapSizeChangedListeners.forEach(function(i){return i.call(r,t,n)})},e.prototype._chooseAndInitObserver=function(){var t=this;if(!this._allowResizeObserver){this._initDevicePixelRatioObservable();return}TD().then(function(n){return n?t._initResizeObserver():t._initDevicePixelRatioObservable()})},e.prototype._initDevicePixelRatioObservable=function(){var t=this;if(this._canvasElement!==null){var n=e_(this._canvasElement);if(n===null)throw new Error("No window is associated with the canvas");this._devicePixelRatioObservable=SD(n),this._devicePixelRatioObservable.subscribe(function(){return t._invalidateBitmapSize()}),this._invalidateBitmapSize()}},e.prototype._invalidateBitmapSize=function(){var t,n;if(this._canvasElement!==null){var r=e_(this._canvasElement);if(r!==null){var i=(n=(t=this._devicePixelRatioObservable)===null||t===void 0?void 0:t.value)!==null&&n!==void 0?n:r.devicePixelRatio,o=this._canvasElement.getClientRects(),s=o[0]!==void 0?ED(o[0],i):Ie({width:this._canvasElementClientSize.width*i,height:this._canvasElementClientSize.height*i});this._suggestNewBitmapSize(s)}}},e.prototype._initResizeObserver=function(){var t=this;this._canvasElement!==null&&(this._canvasElementResizeObserver=new ResizeObserver(function(n){var r=n.find(function(s){return s.target===t._canvasElement});if(!(!r||!r.devicePixelContentBoxSize||!r.devicePixelContentBoxSize[0])){var i=r.devicePixelContentBoxSize[0],o=Ie({width:i.inlineSize,height:i.blockSize});t._suggestNewBitmapSize(o)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"}))},e}();function AD(e,t){return new PD(e,t.transform,t.options)}function e_(e){return e.ownerDocument.defaultView}function TD(){return new Promise(function(e){var t=new ResizeObserver(function(n){e(n.every(function(r){return"devicePixelContentBoxSize"in r})),t.disconnect()});t.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1})}function ED(e,t){return Ie({width:Math.round(e.left*t+e.width*t)-Math.round(e.left*t),height:Math.round(e.top*t+e.height*t)-Math.round(e.top*t)})}var CD=function(){function e(t,n,r){if(n.width===0||n.height===0)throw new TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=n,r.width===0||r.height===0)throw new TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=r,this._context=t}return e.prototype.useMediaCoordinateSpace=function(t){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),t({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},e.prototype.useBitmapCoordinateSpace=function(t){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),t({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(e.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),e}();function la(e,t){var n=e.canvasElementClientSize;if(n.width===0||n.height===0)return null;var r=e.bitmapSize;if(r.width===0||r.height===0)return null;var i=e.canvasElement.getContext("2d",t);return i===null?null:new CD(i,n,r)}/*!
14
14
  * @license
15
15
  * TradingView Lightweight Charts™ v5.2.1
16
16
  * Copyright (c) 2026 TradingView, Inc.
@@ -31,7 +31,7 @@
31
31
  *
32
32
  * This source code is licensed under the MIT license found in the
33
33
  * LICENSE file in the root directory of this source tree.
34
- */var a1;function _W(){return a1||(a1=1,process.env.NODE_ENV!=="production"&&function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),x=!1,p=!1,b=!1,P=!1,S=!1,A;A=Symbol.for("react.module.reference");function E(bt){return!!(typeof bt=="string"||typeof bt=="function"||bt===n||bt===i||S||bt===r||bt===h||bt===u||P||bt===y||x||p||b||typeof bt=="object"&&bt!==null&&(bt.$$typeof===m||bt.$$typeof===f||bt.$$typeof===o||bt.$$typeof===s||bt.$$typeof===c||bt.$$typeof===A||bt.getModuleId!==void 0))}function w(bt){if(typeof bt=="object"&&bt!==null){var de=bt.$$typeof;switch(de){case e:var ne=bt.type;switch(ne){case n:case i:case r:case h:case u:return ne;default:var Gt=ne&&ne.$$typeof;switch(Gt){case l:case s:case c:case m:case f:case o:return Gt;default:return de}}case t:return de}}}var T=s,O=o,R=e,N=c,V=n,D=m,j=f,K=t,H=i,z=r,Y=h,G=u,J=!1,lt=!1;function q(bt){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function nt(bt){return lt||(lt=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function it(bt){return w(bt)===s}function at(bt){return w(bt)===o}function ct(bt){return typeof bt=="object"&&bt!==null&&bt.$$typeof===e}function mt(bt){return w(bt)===c}function yt(bt){return w(bt)===n}function Et(bt){return w(bt)===m}function Tt(bt){return w(bt)===f}function ht(bt){return w(bt)===t}function ft(bt){return w(bt)===i}function Ct(bt){return w(bt)===r}function rt(bt){return w(bt)===h}function Rt(bt){return w(bt)===u}we.ContextConsumer=T,we.ContextProvider=O,we.Element=R,we.ForwardRef=N,we.Fragment=V,we.Lazy=D,we.Memo=j,we.Portal=K,we.Profiler=H,we.StrictMode=z,we.Suspense=Y,we.SuspenseList=G,we.isAsyncMode=q,we.isConcurrentMode=nt,we.isContextConsumer=it,we.isContextProvider=at,we.isElement=ct,we.isForwardRef=mt,we.isFragment=yt,we.isLazy=Et,we.isMemo=Tt,we.isPortal=ht,we.isProfiler=ft,we.isStrictMode=Ct,we.isSuspense=rt,we.isSuspenseList=Rt,we.isValidElementType=E,we.typeOf=w}()),we}process.env.NODE_ENV==="production"?Ey.exports=wW():Ey.exports=_W();var SW=Ey.exports,PW=vo,AW=bo,TW="[object Number]";function EW(e){return typeof e=="number"||AW(e)&&PW(e)==TW}var iO=EW;const CW=Me(iO);var OW=iO;function MW(e){return OW(e)&&e!=+e}var kW=MW;const sc=Me(kW);var Yn=function(t){return t===0?0:t>0?1:-1},Ks=function(t){return fa(t)&&t.indexOf("%")===t.length-1},xt=function(t){return CW(t)&&!sc(t)},$W=function(t){return Ut(t)},xn=function(t){return xt(t)||fa(t)},IW=0,wa=function(t){var n=++IW;return"".concat(t||"").concat(n)},Kn=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!xt(t)&&!fa(t))return r;var o;if(Ks(t)){var s=t.indexOf("%");o=n*parseFloat(t.slice(0,s))/100}else o=+t;return sc(o)&&(o=r),i&&o>n&&(o=n),o},Uo=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},RW=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},Pn=function(t,n){return xt(t)&&xt(n)?function(r){return t+r*(n-t)}:function(){return n}};function nd(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):_r(r,t))===n})}var LW=function(t){if(!t||!t.length)return null;for(var n=t.length,r=0,i=0,o=0,s=0,l=1/0,c=-1/0,h=0,u=0,f=0;f<n;f++)h=t[f].cx||0,u=t[f].cy||0,r+=h,i+=u,o+=h*u,s+=h*h,l=Math.min(l,h),c=Math.max(c,h);var m=n*s!==r*r?(n*o-r*i)/(n*s-r*r):0;return{xmin:l,xmax:c,a:m,b:(i-m*r)/n}},NW=function(t,n){return xt(t)&&xt(n)?t-n:fa(t)&&fa(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function ll(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function Cy(e){"@babel/helpers - typeof";return Cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cy(e)}var jW=["viewBox","children"],DW=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],l1=["points","pathLength"],ug={svg:jW,polygon:l1,polyline:l1},P0=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],rd=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(v.isValidElement(t)&&(r=t.props),!nc(r))return null;var i={};return Object.keys(r).forEach(function(o){P0.includes(o)&&(i[o]=n||function(s){return r[o](r,s)})}),i},BW=function(t,n,r){return function(i){return t(n,r,i),null}},rs=function(t,n,r){if(!nc(t)||Cy(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(o){var s=t[o];P0.includes(o)&&typeof s=="function"&&(i||(i={}),i[o]=BW(s,n,r))}),i},zW=["children"],FW=["children"];function c1(e,t){if(e==null)return{};var n=WW(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Oy(e){"@babel/helpers - typeof";return Oy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oy(e)}var u1={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},lo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},h1=null,hg=null,A0=function e(t){if(t===h1&&Array.isArray(hg))return hg;var n=[];return v.Children.forEach(t,function(r){Ut(r)||(SW.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),hg=n,h1=t,n};function ur(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return lo(i)}):r=[lo(t)],A0(e).forEach(function(i){var o=_r(i,"type.displayName")||_r(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function vr(e,t){var n=ur(e,t);return n&&n[0]}var f1=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!xt(r)||r<=0||!xt(i)||i<=0)},VW=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],UW=function(t){return t&&t.type&&fa(t.type)&&VW.indexOf(t.type)>=0},HW=function(t){return t&&Oy(t)==="object"&&"clipDot"in t},qW=function(t,n,r,i){var o,s=(o=ug==null?void 0:ug[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!Vt(t)&&(i&&s.includes(n)||DW.includes(n))||r&&P0.includes(n)},Lt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(v.isValidElement(t)&&(i=t.props),!nc(i))return null;var o={};return Object.keys(i).forEach(function(s){var l;qW((l=i)===null||l===void 0?void 0:l[s],s,n,r)&&(o[s]=i[s])}),o},My=function e(t,n){if(t===n)return!0;var r=v.Children.count(t);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return d1(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var o=t[i],s=n[i];if(Array.isArray(o)||Array.isArray(s)){if(!e(o,s))return!1}else if(!d1(o,s))return!1}return!0},d1=function(t,n){if(Ut(t)&&Ut(n))return!0;if(!Ut(t)&&!Ut(n)){var r=t.props||{},i=r.children,o=c1(r,zW),s=n.props||{},l=s.children,c=c1(s,FW);return i&&l?ll(o,c)&&My(i,l):!i&&!l?ll(o,c):!1}return!1},p1=function(t,n){var r=[],i={};return A0(t).forEach(function(o,s){if(UW(o))r.push(o);else if(o){var l=lo(o.type),c=n[l]||{},h=c.handler,u=c.once;if(h&&(!u||!i[l])){var f=h(o,l,s);r.push(f),i[l]=!0}}}),r},GW=function(t){var n=t&&t.type;return n&&u1[n]?u1[n]:null},ZW=function(t,n){return A0(n).indexOf(t)},YW=["children","width","height","viewBox","className","style","title","desc"];function ky(){return ky=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ky.apply(this,arguments)}function KW(e,t){if(e==null)return{};var n=XW(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function XW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function $y(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,o=e.className,s=e.style,l=e.title,c=e.desc,h=KW(e,YW),u=i||{width:n,height:r,x:0,y:0},f=Jt("recharts-surface",o);return v.createElement("svg",ky({},Lt(h,!0,"svg"),{className:f,width:n,height:r,style:s,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),v.createElement("title",null,l),v.createElement("desc",null,c),t)}var JW=["children","className"];function Iy(){return Iy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Iy.apply(this,arguments)}function QW(e,t){if(e==null)return{};var n=t4(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function t4(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ue=v.forwardRef(function(e,t){var n=e.children,r=e.className,i=QW(e,JW),o=Jt("recharts-layer",r);return v.createElement("g",Iy({className:o},Lt(i,!0),{ref:t}),n)}),e4=process.env.NODE_ENV!=="production",ei=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];if(e4&&typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;console.warn(n.replace(/%s/g,function(){return i[s++]}))}};function n4(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}var r4=n4,i4=r4;function o4(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:i4(e,t,n)}var s4=o4,a4="\\ud800-\\udfff",l4="\\u0300-\\u036f",c4="\\ufe20-\\ufe2f",u4="\\u20d0-\\u20ff",h4=l4+c4+u4,f4="\\ufe0e\\ufe0f",d4="\\u200d",p4=RegExp("["+d4+a4+h4+f4+"]");function m4(e){return p4.test(e)}var oO=m4;function g4(e){return e.split("")}var y4=g4,sO="\\ud800-\\udfff",v4="\\u0300-\\u036f",b4="\\ufe20-\\ufe2f",x4="\\u20d0-\\u20ff",w4=v4+b4+x4,_4="\\ufe0e\\ufe0f",S4="["+sO+"]",Ry="["+w4+"]",Ly="\\ud83c[\\udffb-\\udfff]",P4="(?:"+Ry+"|"+Ly+")",aO="[^"+sO+"]",lO="(?:\\ud83c[\\udde6-\\uddff]){2}",cO="[\\ud800-\\udbff][\\udc00-\\udfff]",A4="\\u200d",uO=P4+"?",hO="["+_4+"]?",T4="(?:"+A4+"(?:"+[aO,lO,cO].join("|")+")"+hO+uO+")*",E4=hO+uO+T4,C4="(?:"+[aO+Ry+"?",Ry,lO,cO,S4].join("|")+")",O4=RegExp(Ly+"(?="+Ly+")|"+C4+E4,"g");function M4(e){return e.match(O4)||[]}var k4=M4,$4=y4,I4=oO,R4=k4;function L4(e){return I4(e)?R4(e):$4(e)}var N4=L4,j4=s4,D4=oO,B4=N4,z4=eO;function F4(e){return function(t){t=z4(t);var n=D4(t)?B4(t):void 0,r=n?n[0]:t.charAt(0),i=n?j4(n,1).join(""):t.slice(1);return r[e]()+i}}var W4=F4,V4=W4,U4=V4("toUpperCase"),H4=U4;const Np=Me(H4);function De(e){return function(){return e}}const fO=Math.cos,id=Math.sin,ri=Math.sqrt,od=Math.PI,jp=2*od,Ny=Math.PI,jy=2*Ny,Us=1e-6,q4=jy-Us;function dO(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function G4(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return dO;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Z4{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?dO:G4(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,l=this._y1,c=r-t,h=i-n,u=s-t,f=l-n,m=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(m>Us)if(!(Math.abs(f*c-h*u)>Us)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let y=r-s,x=i-l,p=c*c+h*h,b=y*y+x*x,P=Math.sqrt(p),S=Math.sqrt(m),A=o*Math.tan((Ny-Math.acos((p+m-b)/(2*P*S)))/2),E=A/S,w=A/P;Math.abs(E-1)>Us&&this._append`L${t+E*u},${n+E*f}`,this._append`A${o},${o},0,0,${+(f*y>u*x)},${this._x1=t+w*c},${this._y1=n+w*h}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),h=t+l,u=n+c,f=1^s,m=s?i-o:o-i;this._x1===null?this._append`M${h},${u}`:(Math.abs(this._x1-h)>Us||Math.abs(this._y1-u)>Us)&&this._append`L${h},${u}`,r&&(m<0&&(m=m%jy+jy),m>q4?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=h},${this._y1=u}`:m>Us&&this._append`A${r},${r},0,${+(m>=Ny)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function T0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Z4(t)}function E0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function pO(e){this._context=e}pO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Dp(e){return new pO(e)}function mO(e){return e[0]}function gO(e){return e[1]}function yO(e,t){var n=De(!0),r=null,i=Dp,o=null,s=T0(l);e=typeof e=="function"?e:e===void 0?mO:De(e),t=typeof t=="function"?t:t===void 0?gO:De(t);function l(c){var h,u=(c=E0(c)).length,f,m=!1,y;for(r==null&&(o=i(y=s())),h=0;h<=u;++h)!(h<u&&n(f=c[h],h,c))===m&&((m=!m)?o.lineStart():o.lineEnd()),m&&o.point(+e(f,h,c),+t(f,h,c));if(y)return o=null,y+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:De(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:De(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:De(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(o=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=o=null:o=i(r=c),l):r},l}function yf(e,t,n){var r=null,i=De(!0),o=null,s=Dp,l=null,c=T0(h);e=typeof e=="function"?e:e===void 0?mO:De(+e),t=typeof t=="function"?t:De(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?gO:De(+n);function h(f){var m,y,x,p=(f=E0(f)).length,b,P=!1,S,A=new Array(p),E=new Array(p);for(o==null&&(l=s(S=c())),m=0;m<=p;++m){if(!(m<p&&i(b=f[m],m,f))===P)if(P=!P)y=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),x=m-1;x>=y;--x)l.point(A[x],E[x]);l.lineEnd(),l.areaEnd()}P&&(A[m]=+e(b,m,f),E[m]=+t(b,m,f),l.point(r?+r(b,m,f):A[m],n?+n(b,m,f):E[m]))}if(S)return l=null,S+""||null}function u(){return yO().defined(i).curve(s).context(o)}return h.x=function(f){return arguments.length?(e=typeof f=="function"?f:De(+f),r=null,h):e},h.x0=function(f){return arguments.length?(e=typeof f=="function"?f:De(+f),h):e},h.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:De(+f),h):r},h.y=function(f){return arguments.length?(t=typeof f=="function"?f:De(+f),n=null,h):t},h.y0=function(f){return arguments.length?(t=typeof f=="function"?f:De(+f),h):t},h.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:De(+f),h):n},h.lineX0=h.lineY0=function(){return u().x(e).y(t)},h.lineY1=function(){return u().x(e).y(n)},h.lineX1=function(){return u().x(r).y(t)},h.defined=function(f){return arguments.length?(i=typeof f=="function"?f:De(!!f),h):i},h.curve=function(f){return arguments.length?(s=f,o!=null&&(l=s(o)),h):s},h.context=function(f){return arguments.length?(f==null?o=l=null:l=s(o=f),h):o},h}class vO{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Y4(e){return new vO(e,!0)}function K4(e){return new vO(e,!1)}const C0={draw(e,t){const n=ri(t/od);e.moveTo(n,0),e.arc(0,0,n,0,jp)}},X4={draw(e,t){const n=ri(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},bO=ri(1/3),J4=bO*2,Q4={draw(e,t){const n=ri(t/J4),r=n*bO;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},tV={draw(e,t){const n=ri(t),r=-n/2;e.rect(r,r,n,n)}},eV=.8908130915292852,xO=id(od/10)/id(7*od/10),nV=id(jp/10)*xO,rV=-fO(jp/10)*xO,iV={draw(e,t){const n=ri(t*eV),r=nV*n,i=rV*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const s=jp*o/5,l=fO(s),c=id(s);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},fg=ri(3),oV={draw(e,t){const n=-ri(t/(fg*3));e.moveTo(0,n*2),e.lineTo(-fg*n,-n),e.lineTo(fg*n,-n),e.closePath()}},$r=-.5,Ir=ri(3)/2,Dy=1/ri(12),sV=(Dy/2+1)*3,aV={draw(e,t){const n=ri(t/sV),r=n/2,i=n*Dy,o=r,s=n*Dy+n,l=-o,c=s;e.moveTo(r,i),e.lineTo(o,s),e.lineTo(l,c),e.lineTo($r*r-Ir*i,Ir*r+$r*i),e.lineTo($r*o-Ir*s,Ir*o+$r*s),e.lineTo($r*l-Ir*c,Ir*l+$r*c),e.lineTo($r*r+Ir*i,$r*i-Ir*r),e.lineTo($r*o+Ir*s,$r*s-Ir*o),e.lineTo($r*l+Ir*c,$r*c-Ir*l),e.closePath()}};function lV(e,t){let n=null,r=T0(i);e=typeof e=="function"?e:De(e||C0),t=typeof t=="function"?t:De(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:De(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:De(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function sd(){}function ad(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function wO(e){this._context=e}wO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ad(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ad(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cV(e){return new wO(e)}function _O(e){this._context=e}_O.prototype={areaStart:sd,areaEnd:sd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ad(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uV(e){return new _O(e)}function SO(e){this._context=e}SO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ad(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hV(e){return new SO(e)}function PO(e){this._context=e}PO.prototype={areaStart:sd,areaEnd:sd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function fV(e){return new PO(e)}function m1(e){return e<0?-1:1}function g1(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),l=(o*i+s*r)/(r+i);return(m1(o)+m1(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(l))||0}function y1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function dg(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,l=(o-r)/3;e._context.bezierCurveTo(r+l,i+l*t,o-l,s-l*n,o,s)}function ld(e){this._context=e}ld.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:dg(this,this._t0,y1(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,dg(this,y1(this,n=g1(this,e,t)),n);break;default:dg(this,this._t0,n=g1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function AO(e){this._context=new TO(e)}(AO.prototype=Object.create(ld.prototype)).point=function(e,t){ld.prototype.point.call(this,t,e)};function TO(e){this._context=e}TO.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function dV(e){return new ld(e)}function pV(e){return new AO(e)}function EO(e){this._context=e}EO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=v1(e),i=v1(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function v1(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),s=new Array(n);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function mV(e){return new EO(e)}function Bp(e,t){this._context=e,this._t=t}Bp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function gV(e){return new Bp(e,.5)}function yV(e){return new Bp(e,0)}function vV(e){return new Bp(e,1)}function bl(e,t){if((s=e.length)>1)for(var n=1,r,i,o=e[t[0]],s,l=o.length;n<s;++n)for(i=o,o=e[t[n]],r=0;r<l;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function By(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function bV(e,t){return e[t]}function xV(e){const t=[];return t.key=e,t}function wV(){var e=De([]),t=By,n=bl,r=bV;function i(o){var s=Array.from(e.apply(this,arguments),xV),l,c=s.length,h=-1,u;for(const f of o)for(l=0,++h;l<c;++l)(s[l][h]=[0,+r(f,s[l].key,h,o)]).data=f;for(l=0,u=E0(t(s));l<c;++l)s[u[l]].index=l;return n(s,u),s}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:De(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:De(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?By:typeof o=="function"?o:De(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??bl,i):n},i}function _V(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,s;i<o;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}bl(e,t)}}function SV(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var s=0,l=0;s<i;++s)l+=e[s][n][1]||0;r[n][1]+=r[n][0]=-l/2}bl(e,t)}}function PV(e,t){if(!(!((s=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,s;r<o;++r){for(var l=0,c=0,h=0;l<s;++l){for(var u=e[t[l]],f=u[r][1]||0,m=u[r-1][1]||0,y=(f-m)/2,x=0;x<l;++x){var p=e[t[x]],b=p[r][1]||0,P=p[r-1][1]||0;y+=b-P}c+=f,h+=y*f}i[r-1][1]+=i[r-1][0]=n,c&&(n-=h/c)}i[r-1][1]+=i[r-1][0]=n,bl(e,t)}}function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}var AV=["type","size","sizeType"];function zy(){return zy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zy.apply(this,arguments)}function b1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function x1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b1(Object(n),!0).forEach(function(r){TV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TV(e,t,n){return t=EV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EV(e){var t=CV(e,"string");return Mu(t)=="symbol"?t:t+""}function CV(e,t){if(Mu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Mu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OV(e,t){if(e==null)return{};var n=MV(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function MV(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var CO={symbolCircle:C0,symbolCross:X4,symbolDiamond:Q4,symbolSquare:tV,symbolStar:iV,symbolTriangle:oV,symbolWye:aV},kV=Math.PI/180,$V=function(t){var n="symbol".concat(Np(t));return CO[n]||C0},IV=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*kV;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},RV=function(t,n){CO["symbol".concat(Np(t))]=n},zp=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,o=i===void 0?64:i,s=t.sizeType,l=s===void 0?"area":s,c=OV(t,AV),h=x1(x1({},c),{},{type:r,size:o,sizeType:l}),u=function(){var b=$V(r),P=lV().type(b).size(IV(o,l,r));return P()},f=h.className,m=h.cx,y=h.cy,x=Lt(h,!0);return m===+m&&y===+y&&o===+o?v.createElement("path",zy({},x,{className:Jt("recharts-symbols",f),transform:"translate(".concat(m,", ").concat(y,")"),d:u()})):null};zp.registerSymbol=RV;function xl(e){"@babel/helpers - typeof";return xl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xl(e)}function Fy(){return Fy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fy.apply(this,arguments)}function w1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function LV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w1(Object(n),!0).forEach(function(r){ku(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jV(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,MO(r.key),r)}}function DV(e,t,n){return t&&jV(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function BV(e,t,n){return t=cd(t),zV(e,OO()?Reflect.construct(t,n||[],cd(e).constructor):t.apply(e,n))}function zV(e,t){if(t&&(xl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FV(e)}function FV(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OO=function(){return!!e})()}function cd(e){return cd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cd(e)}function WV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wy(e,t)}function Wy(e,t){return Wy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Wy(e,t)}function ku(e,t,n){return t=MO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MO(e){var t=VV(e,"string");return xl(t)=="symbol"?t:t+""}function VV(e,t){if(xl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Rr=32,O0=function(e){function t(){return NV(this,t),BV(this,t,arguments)}return WV(t,e),DV(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,o=Rr/2,s=Rr/6,l=Rr/3,c=r.inactive?i:r.color;if(r.type==="plainline")return v.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:o,x2:Rr,y2:o,className:"recharts-legend-icon"});if(r.type==="line")return v.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(o,"h").concat(l,`
34
+ */var a1;function _W(){return a1||(a1=1,process.env.NODE_ENV!=="production"&&function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),x=!1,p=!1,b=!1,P=!1,S=!1,A;A=Symbol.for("react.module.reference");function E(bt){return!!(typeof bt=="string"||typeof bt=="function"||bt===n||bt===i||S||bt===r||bt===h||bt===u||P||bt===y||x||p||b||typeof bt=="object"&&bt!==null&&(bt.$$typeof===m||bt.$$typeof===f||bt.$$typeof===o||bt.$$typeof===s||bt.$$typeof===c||bt.$$typeof===A||bt.getModuleId!==void 0))}function w(bt){if(typeof bt=="object"&&bt!==null){var de=bt.$$typeof;switch(de){case e:var ne=bt.type;switch(ne){case n:case i:case r:case h:case u:return ne;default:var Gt=ne&&ne.$$typeof;switch(Gt){case l:case s:case c:case m:case f:case o:return Gt;default:return de}}case t:return de}}}var T=s,O=o,R=e,N=c,V=n,D=m,j=f,K=t,H=i,z=r,Y=h,G=u,J=!1,lt=!1;function q(bt){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function nt(bt){return lt||(lt=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function it(bt){return w(bt)===s}function at(bt){return w(bt)===o}function ct(bt){return typeof bt=="object"&&bt!==null&&bt.$$typeof===e}function gt(bt){return w(bt)===c}function yt(bt){return w(bt)===n}function Et(bt){return w(bt)===m}function Tt(bt){return w(bt)===f}function ht(bt){return w(bt)===t}function ft(bt){return w(bt)===i}function Ct(bt){return w(bt)===r}function rt(bt){return w(bt)===h}function Rt(bt){return w(bt)===u}we.ContextConsumer=T,we.ContextProvider=O,we.Element=R,we.ForwardRef=N,we.Fragment=V,we.Lazy=D,we.Memo=j,we.Portal=K,we.Profiler=H,we.StrictMode=z,we.Suspense=Y,we.SuspenseList=G,we.isAsyncMode=q,we.isConcurrentMode=nt,we.isContextConsumer=it,we.isContextProvider=at,we.isElement=ct,we.isForwardRef=gt,we.isFragment=yt,we.isLazy=Et,we.isMemo=Tt,we.isPortal=ht,we.isProfiler=ft,we.isStrictMode=Ct,we.isSuspense=rt,we.isSuspenseList=Rt,we.isValidElementType=E,we.typeOf=w}()),we}process.env.NODE_ENV==="production"?Ey.exports=wW():Ey.exports=_W();var SW=Ey.exports,PW=vo,AW=bo,TW="[object Number]";function EW(e){return typeof e=="number"||AW(e)&&PW(e)==TW}var iO=EW;const CW=Me(iO);var OW=iO;function MW(e){return OW(e)&&e!=+e}var kW=MW;const sc=Me(kW);var Yn=function(t){return t===0?0:t>0?1:-1},Ks=function(t){return fa(t)&&t.indexOf("%")===t.length-1},xt=function(t){return CW(t)&&!sc(t)},$W=function(t){return Ut(t)},xn=function(t){return xt(t)||fa(t)},IW=0,wa=function(t){var n=++IW;return"".concat(t||"").concat(n)},Kn=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!xt(t)&&!fa(t))return r;var o;if(Ks(t)){var s=t.indexOf("%");o=n*parseFloat(t.slice(0,s))/100}else o=+t;return sc(o)&&(o=r),i&&o>n&&(o=n),o},Uo=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},RW=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},Pn=function(t,n){return xt(t)&&xt(n)?function(r){return t+r*(n-t)}:function(){return n}};function nd(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):_r(r,t))===n})}var LW=function(t){if(!t||!t.length)return null;for(var n=t.length,r=0,i=0,o=0,s=0,l=1/0,c=-1/0,h=0,u=0,f=0;f<n;f++)h=t[f].cx||0,u=t[f].cy||0,r+=h,i+=u,o+=h*u,s+=h*h,l=Math.min(l,h),c=Math.max(c,h);var m=n*s!==r*r?(n*o-r*i)/(n*s-r*r):0;return{xmin:l,xmax:c,a:m,b:(i-m*r)/n}},NW=function(t,n){return xt(t)&&xt(n)?t-n:fa(t)&&fa(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function ll(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function Cy(e){"@babel/helpers - typeof";return Cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cy(e)}var jW=["viewBox","children"],DW=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],l1=["points","pathLength"],ug={svg:jW,polygon:l1,polyline:l1},P0=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],rd=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(v.isValidElement(t)&&(r=t.props),!nc(r))return null;var i={};return Object.keys(r).forEach(function(o){P0.includes(o)&&(i[o]=n||function(s){return r[o](r,s)})}),i},BW=function(t,n,r){return function(i){return t(n,r,i),null}},rs=function(t,n,r){if(!nc(t)||Cy(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(o){var s=t[o];P0.includes(o)&&typeof s=="function"&&(i||(i={}),i[o]=BW(s,n,r))}),i},zW=["children"],FW=["children"];function c1(e,t){if(e==null)return{};var n=WW(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Oy(e){"@babel/helpers - typeof";return Oy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oy(e)}var u1={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},lo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},h1=null,hg=null,A0=function e(t){if(t===h1&&Array.isArray(hg))return hg;var n=[];return v.Children.forEach(t,function(r){Ut(r)||(SW.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),hg=n,h1=t,n};function ur(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return lo(i)}):r=[lo(t)],A0(e).forEach(function(i){var o=_r(i,"type.displayName")||_r(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function vr(e,t){var n=ur(e,t);return n&&n[0]}var f1=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!xt(r)||r<=0||!xt(i)||i<=0)},VW=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],UW=function(t){return t&&t.type&&fa(t.type)&&VW.indexOf(t.type)>=0},HW=function(t){return t&&Oy(t)==="object"&&"clipDot"in t},qW=function(t,n,r,i){var o,s=(o=ug==null?void 0:ug[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!Vt(t)&&(i&&s.includes(n)||DW.includes(n))||r&&P0.includes(n)},Lt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(v.isValidElement(t)&&(i=t.props),!nc(i))return null;var o={};return Object.keys(i).forEach(function(s){var l;qW((l=i)===null||l===void 0?void 0:l[s],s,n,r)&&(o[s]=i[s])}),o},My=function e(t,n){if(t===n)return!0;var r=v.Children.count(t);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return d1(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var o=t[i],s=n[i];if(Array.isArray(o)||Array.isArray(s)){if(!e(o,s))return!1}else if(!d1(o,s))return!1}return!0},d1=function(t,n){if(Ut(t)&&Ut(n))return!0;if(!Ut(t)&&!Ut(n)){var r=t.props||{},i=r.children,o=c1(r,zW),s=n.props||{},l=s.children,c=c1(s,FW);return i&&l?ll(o,c)&&My(i,l):!i&&!l?ll(o,c):!1}return!1},p1=function(t,n){var r=[],i={};return A0(t).forEach(function(o,s){if(UW(o))r.push(o);else if(o){var l=lo(o.type),c=n[l]||{},h=c.handler,u=c.once;if(h&&(!u||!i[l])){var f=h(o,l,s);r.push(f),i[l]=!0}}}),r},GW=function(t){var n=t&&t.type;return n&&u1[n]?u1[n]:null},ZW=function(t,n){return A0(n).indexOf(t)},YW=["children","width","height","viewBox","className","style","title","desc"];function ky(){return ky=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ky.apply(this,arguments)}function KW(e,t){if(e==null)return{};var n=XW(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function XW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function $y(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,o=e.className,s=e.style,l=e.title,c=e.desc,h=KW(e,YW),u=i||{width:n,height:r,x:0,y:0},f=Jt("recharts-surface",o);return v.createElement("svg",ky({},Lt(h,!0,"svg"),{className:f,width:n,height:r,style:s,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),v.createElement("title",null,l),v.createElement("desc",null,c),t)}var JW=["children","className"];function Iy(){return Iy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Iy.apply(this,arguments)}function QW(e,t){if(e==null)return{};var n=t4(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function t4(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ue=v.forwardRef(function(e,t){var n=e.children,r=e.className,i=QW(e,JW),o=Jt("recharts-layer",r);return v.createElement("g",Iy({className:o},Lt(i,!0),{ref:t}),n)}),e4=process.env.NODE_ENV!=="production",ei=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];if(e4&&typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;console.warn(n.replace(/%s/g,function(){return i[s++]}))}};function n4(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}var r4=n4,i4=r4;function o4(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:i4(e,t,n)}var s4=o4,a4="\\ud800-\\udfff",l4="\\u0300-\\u036f",c4="\\ufe20-\\ufe2f",u4="\\u20d0-\\u20ff",h4=l4+c4+u4,f4="\\ufe0e\\ufe0f",d4="\\u200d",p4=RegExp("["+d4+a4+h4+f4+"]");function m4(e){return p4.test(e)}var oO=m4;function g4(e){return e.split("")}var y4=g4,sO="\\ud800-\\udfff",v4="\\u0300-\\u036f",b4="\\ufe20-\\ufe2f",x4="\\u20d0-\\u20ff",w4=v4+b4+x4,_4="\\ufe0e\\ufe0f",S4="["+sO+"]",Ry="["+w4+"]",Ly="\\ud83c[\\udffb-\\udfff]",P4="(?:"+Ry+"|"+Ly+")",aO="[^"+sO+"]",lO="(?:\\ud83c[\\udde6-\\uddff]){2}",cO="[\\ud800-\\udbff][\\udc00-\\udfff]",A4="\\u200d",uO=P4+"?",hO="["+_4+"]?",T4="(?:"+A4+"(?:"+[aO,lO,cO].join("|")+")"+hO+uO+")*",E4=hO+uO+T4,C4="(?:"+[aO+Ry+"?",Ry,lO,cO,S4].join("|")+")",O4=RegExp(Ly+"(?="+Ly+")|"+C4+E4,"g");function M4(e){return e.match(O4)||[]}var k4=M4,$4=y4,I4=oO,R4=k4;function L4(e){return I4(e)?R4(e):$4(e)}var N4=L4,j4=s4,D4=oO,B4=N4,z4=eO;function F4(e){return function(t){t=z4(t);var n=D4(t)?B4(t):void 0,r=n?n[0]:t.charAt(0),i=n?j4(n,1).join(""):t.slice(1);return r[e]()+i}}var W4=F4,V4=W4,U4=V4("toUpperCase"),H4=U4;const Np=Me(H4);function De(e){return function(){return e}}const fO=Math.cos,id=Math.sin,ri=Math.sqrt,od=Math.PI,jp=2*od,Ny=Math.PI,jy=2*Ny,Us=1e-6,q4=jy-Us;function dO(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function G4(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return dO;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Z4{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?dO:G4(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,l=this._y1,c=r-t,h=i-n,u=s-t,f=l-n,m=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(m>Us)if(!(Math.abs(f*c-h*u)>Us)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let y=r-s,x=i-l,p=c*c+h*h,b=y*y+x*x,P=Math.sqrt(p),S=Math.sqrt(m),A=o*Math.tan((Ny-Math.acos((p+m-b)/(2*P*S)))/2),E=A/S,w=A/P;Math.abs(E-1)>Us&&this._append`L${t+E*u},${n+E*f}`,this._append`A${o},${o},0,0,${+(f*y>u*x)},${this._x1=t+w*c},${this._y1=n+w*h}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),h=t+l,u=n+c,f=1^s,m=s?i-o:o-i;this._x1===null?this._append`M${h},${u}`:(Math.abs(this._x1-h)>Us||Math.abs(this._y1-u)>Us)&&this._append`L${h},${u}`,r&&(m<0&&(m=m%jy+jy),m>q4?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=h},${this._y1=u}`:m>Us&&this._append`A${r},${r},0,${+(m>=Ny)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function T0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Z4(t)}function E0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function pO(e){this._context=e}pO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Dp(e){return new pO(e)}function mO(e){return e[0]}function gO(e){return e[1]}function yO(e,t){var n=De(!0),r=null,i=Dp,o=null,s=T0(l);e=typeof e=="function"?e:e===void 0?mO:De(e),t=typeof t=="function"?t:t===void 0?gO:De(t);function l(c){var h,u=(c=E0(c)).length,f,m=!1,y;for(r==null&&(o=i(y=s())),h=0;h<=u;++h)!(h<u&&n(f=c[h],h,c))===m&&((m=!m)?o.lineStart():o.lineEnd()),m&&o.point(+e(f,h,c),+t(f,h,c));if(y)return o=null,y+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:De(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:De(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:De(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(o=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=o=null:o=i(r=c),l):r},l}function yf(e,t,n){var r=null,i=De(!0),o=null,s=Dp,l=null,c=T0(h);e=typeof e=="function"?e:e===void 0?mO:De(+e),t=typeof t=="function"?t:De(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?gO:De(+n);function h(f){var m,y,x,p=(f=E0(f)).length,b,P=!1,S,A=new Array(p),E=new Array(p);for(o==null&&(l=s(S=c())),m=0;m<=p;++m){if(!(m<p&&i(b=f[m],m,f))===P)if(P=!P)y=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),x=m-1;x>=y;--x)l.point(A[x],E[x]);l.lineEnd(),l.areaEnd()}P&&(A[m]=+e(b,m,f),E[m]=+t(b,m,f),l.point(r?+r(b,m,f):A[m],n?+n(b,m,f):E[m]))}if(S)return l=null,S+""||null}function u(){return yO().defined(i).curve(s).context(o)}return h.x=function(f){return arguments.length?(e=typeof f=="function"?f:De(+f),r=null,h):e},h.x0=function(f){return arguments.length?(e=typeof f=="function"?f:De(+f),h):e},h.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:De(+f),h):r},h.y=function(f){return arguments.length?(t=typeof f=="function"?f:De(+f),n=null,h):t},h.y0=function(f){return arguments.length?(t=typeof f=="function"?f:De(+f),h):t},h.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:De(+f),h):n},h.lineX0=h.lineY0=function(){return u().x(e).y(t)},h.lineY1=function(){return u().x(e).y(n)},h.lineX1=function(){return u().x(r).y(t)},h.defined=function(f){return arguments.length?(i=typeof f=="function"?f:De(!!f),h):i},h.curve=function(f){return arguments.length?(s=f,o!=null&&(l=s(o)),h):s},h.context=function(f){return arguments.length?(f==null?o=l=null:l=s(o=f),h):o},h}class vO{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Y4(e){return new vO(e,!0)}function K4(e){return new vO(e,!1)}const C0={draw(e,t){const n=ri(t/od);e.moveTo(n,0),e.arc(0,0,n,0,jp)}},X4={draw(e,t){const n=ri(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},bO=ri(1/3),J4=bO*2,Q4={draw(e,t){const n=ri(t/J4),r=n*bO;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},tV={draw(e,t){const n=ri(t),r=-n/2;e.rect(r,r,n,n)}},eV=.8908130915292852,xO=id(od/10)/id(7*od/10),nV=id(jp/10)*xO,rV=-fO(jp/10)*xO,iV={draw(e,t){const n=ri(t*eV),r=nV*n,i=rV*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const s=jp*o/5,l=fO(s),c=id(s);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},fg=ri(3),oV={draw(e,t){const n=-ri(t/(fg*3));e.moveTo(0,n*2),e.lineTo(-fg*n,-n),e.lineTo(fg*n,-n),e.closePath()}},$r=-.5,Ir=ri(3)/2,Dy=1/ri(12),sV=(Dy/2+1)*3,aV={draw(e,t){const n=ri(t/sV),r=n/2,i=n*Dy,o=r,s=n*Dy+n,l=-o,c=s;e.moveTo(r,i),e.lineTo(o,s),e.lineTo(l,c),e.lineTo($r*r-Ir*i,Ir*r+$r*i),e.lineTo($r*o-Ir*s,Ir*o+$r*s),e.lineTo($r*l-Ir*c,Ir*l+$r*c),e.lineTo($r*r+Ir*i,$r*i-Ir*r),e.lineTo($r*o+Ir*s,$r*s-Ir*o),e.lineTo($r*l+Ir*c,$r*c-Ir*l),e.closePath()}};function lV(e,t){let n=null,r=T0(i);e=typeof e=="function"?e:De(e||C0),t=typeof t=="function"?t:De(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:De(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:De(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function sd(){}function ad(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function wO(e){this._context=e}wO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ad(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ad(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cV(e){return new wO(e)}function _O(e){this._context=e}_O.prototype={areaStart:sd,areaEnd:sd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ad(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uV(e){return new _O(e)}function SO(e){this._context=e}SO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ad(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hV(e){return new SO(e)}function PO(e){this._context=e}PO.prototype={areaStart:sd,areaEnd:sd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function fV(e){return new PO(e)}function m1(e){return e<0?-1:1}function g1(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),l=(o*i+s*r)/(r+i);return(m1(o)+m1(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(l))||0}function y1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function dg(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,l=(o-r)/3;e._context.bezierCurveTo(r+l,i+l*t,o-l,s-l*n,o,s)}function ld(e){this._context=e}ld.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:dg(this,this._t0,y1(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,dg(this,y1(this,n=g1(this,e,t)),n);break;default:dg(this,this._t0,n=g1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function AO(e){this._context=new TO(e)}(AO.prototype=Object.create(ld.prototype)).point=function(e,t){ld.prototype.point.call(this,t,e)};function TO(e){this._context=e}TO.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function dV(e){return new ld(e)}function pV(e){return new AO(e)}function EO(e){this._context=e}EO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=v1(e),i=v1(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function v1(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),s=new Array(n);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function mV(e){return new EO(e)}function Bp(e,t){this._context=e,this._t=t}Bp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function gV(e){return new Bp(e,.5)}function yV(e){return new Bp(e,0)}function vV(e){return new Bp(e,1)}function bl(e,t){if((s=e.length)>1)for(var n=1,r,i,o=e[t[0]],s,l=o.length;n<s;++n)for(i=o,o=e[t[n]],r=0;r<l;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function By(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function bV(e,t){return e[t]}function xV(e){const t=[];return t.key=e,t}function wV(){var e=De([]),t=By,n=bl,r=bV;function i(o){var s=Array.from(e.apply(this,arguments),xV),l,c=s.length,h=-1,u;for(const f of o)for(l=0,++h;l<c;++l)(s[l][h]=[0,+r(f,s[l].key,h,o)]).data=f;for(l=0,u=E0(t(s));l<c;++l)s[u[l]].index=l;return n(s,u),s}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:De(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:De(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?By:typeof o=="function"?o:De(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??bl,i):n},i}function _V(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,s;i<o;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}bl(e,t)}}function SV(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var s=0,l=0;s<i;++s)l+=e[s][n][1]||0;r[n][1]+=r[n][0]=-l/2}bl(e,t)}}function PV(e,t){if(!(!((s=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,s;r<o;++r){for(var l=0,c=0,h=0;l<s;++l){for(var u=e[t[l]],f=u[r][1]||0,m=u[r-1][1]||0,y=(f-m)/2,x=0;x<l;++x){var p=e[t[x]],b=p[r][1]||0,P=p[r-1][1]||0;y+=b-P}c+=f,h+=y*f}i[r-1][1]+=i[r-1][0]=n,c&&(n-=h/c)}i[r-1][1]+=i[r-1][0]=n,bl(e,t)}}function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}var AV=["type","size","sizeType"];function zy(){return zy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zy.apply(this,arguments)}function b1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function x1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b1(Object(n),!0).forEach(function(r){TV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TV(e,t,n){return t=EV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EV(e){var t=CV(e,"string");return Mu(t)=="symbol"?t:t+""}function CV(e,t){if(Mu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Mu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OV(e,t){if(e==null)return{};var n=MV(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function MV(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var CO={symbolCircle:C0,symbolCross:X4,symbolDiamond:Q4,symbolSquare:tV,symbolStar:iV,symbolTriangle:oV,symbolWye:aV},kV=Math.PI/180,$V=function(t){var n="symbol".concat(Np(t));return CO[n]||C0},IV=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*kV;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},RV=function(t,n){CO["symbol".concat(Np(t))]=n},zp=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,o=i===void 0?64:i,s=t.sizeType,l=s===void 0?"area":s,c=OV(t,AV),h=x1(x1({},c),{},{type:r,size:o,sizeType:l}),u=function(){var b=$V(r),P=lV().type(b).size(IV(o,l,r));return P()},f=h.className,m=h.cx,y=h.cy,x=Lt(h,!0);return m===+m&&y===+y&&o===+o?v.createElement("path",zy({},x,{className:Jt("recharts-symbols",f),transform:"translate(".concat(m,", ").concat(y,")"),d:u()})):null};zp.registerSymbol=RV;function xl(e){"@babel/helpers - typeof";return xl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xl(e)}function Fy(){return Fy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fy.apply(this,arguments)}function w1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function LV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w1(Object(n),!0).forEach(function(r){ku(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jV(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,MO(r.key),r)}}function DV(e,t,n){return t&&jV(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function BV(e,t,n){return t=cd(t),zV(e,OO()?Reflect.construct(t,n||[],cd(e).constructor):t.apply(e,n))}function zV(e,t){if(t&&(xl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FV(e)}function FV(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OO=function(){return!!e})()}function cd(e){return cd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cd(e)}function WV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wy(e,t)}function Wy(e,t){return Wy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Wy(e,t)}function ku(e,t,n){return t=MO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MO(e){var t=VV(e,"string");return xl(t)=="symbol"?t:t+""}function VV(e,t){if(xl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Rr=32,O0=function(e){function t(){return NV(this,t),BV(this,t,arguments)}return WV(t,e),DV(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,o=Rr/2,s=Rr/6,l=Rr/3,c=r.inactive?i:r.color;if(r.type==="plainline")return v.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:o,x2:Rr,y2:o,className:"recharts-legend-icon"});if(r.type==="line")return v.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(o,"h").concat(l,`
35
35
  A`).concat(s,",").concat(s,",0,1,1,").concat(2*l,",").concat(o,`
36
36
  H`).concat(Rr,"M").concat(2*l,",").concat(o,`
37
37
  A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(o),className:"recharts-legend-icon"});if(r.type==="rect")return v.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Rr/8,"h").concat(Rr,"v").concat(Rr*3/4,"h").concat(-Rr,"z"),className:"recharts-legend-icon"});if(v.isValidElement(r.legendIcon)){var h=LV({},r);return delete h.legendIcon,v.cloneElement(r.legendIcon,h)}return v.createElement(zp,{fill:c,cx:o,cy:o,size:Rr,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,o=i.payload,s=i.iconSize,l=i.layout,c=i.formatter,h=i.inactiveColor,u={x:0,y:0,width:Rr,height:Rr},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(y,x){var p=y.formatter||c,b=Jt(ku(ku({"recharts-legend-item":!0},"legend-item-".concat(x),!0),"inactive",y.inactive));if(y.type==="none")return null;var P=Vt(y.value)?null:y.value;ei(!Vt(y.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var S=y.inactive?h:y.color;return v.createElement("li",Fy({className:b,style:f,key:"legend-item-".concat(x)},rs(r.props,y,x)),v.createElement($y,{width:s,height:s,viewBox:u,style:m},r.renderIcon(y)),v.createElement("span",{className:"recharts-legend-item-text",style:{color:S}},p?p(P,y,x):P))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,s=r.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:o==="horizontal"?s:"left"};return v.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(v.PureComponent);ku(O0,"displayName","Legend");ku(O0,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var UV=Ip;function HV(){this.__data__=new UV,this.size=0}var qV=HV;function GV(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var ZV=GV;function YV(e){return this.__data__.get(e)}var KV=YV;function XV(e){return this.__data__.has(e)}var JV=XV,QV=Ip,t6=b0,e6=x0,n6=200;function r6(e,t){var n=this.__data__;if(n instanceof QV){var r=n.__data__;if(!t6||r.length<n6-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new e6(r)}return n.set(e,t),this.size=n.size,this}var i6=r6,o6=Ip,s6=qV,a6=ZV,l6=KV,c6=JV,u6=i6;function ac(e){var t=this.__data__=new o6(e);this.size=t.size}ac.prototype.clear=s6;ac.prototype.delete=a6;ac.prototype.get=l6;ac.prototype.has=c6;ac.prototype.set=u6;var kO=ac,h6="__lodash_hash_undefined__";function f6(e){return this.__data__.set(e,h6),this}var d6=f6;function p6(e){return this.__data__.has(e)}var m6=p6,g6=x0,y6=d6,v6=m6;function ud(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new g6;++t<n;)this.add(e[t])}ud.prototype.add=ud.prototype.push=y6;ud.prototype.has=v6;var $O=ud;function b6(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var IO=b6;function x6(e,t){return e.has(t)}var RO=x6,w6=$O,_6=IO,S6=RO,P6=1,A6=2;function T6(e,t,n,r,i,o){var s=n&P6,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var h=o.get(e),u=o.get(t);if(h&&u)return h==t&&u==e;var f=-1,m=!0,y=n&A6?new w6:void 0;for(o.set(e,t),o.set(t,e);++f<l;){var x=e[f],p=t[f];if(r)var b=s?r(p,x,f,t,e,o):r(x,p,f,e,t,o);if(b!==void 0){if(b)continue;m=!1;break}if(y){if(!_6(t,function(P,S){if(!S6(y,S)&&(x===P||i(x,P,n,r,o)))return y.push(S)})){m=!1;break}}else if(!(x===p||i(x,p,n,r,o))){m=!1;break}}return o.delete(e),o.delete(t),m}var LO=T6,E6=Ti,C6=E6.Uint8Array,O6=C6;function M6(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var k6=M6;function $6(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var M0=$6,_1=yh,S1=O6,I6=v0,R6=LO,L6=k6,N6=M0,j6=1,D6=2,B6="[object Boolean]",z6="[object Date]",F6="[object Error]",W6="[object Map]",V6="[object Number]",U6="[object RegExp]",H6="[object Set]",q6="[object String]",G6="[object Symbol]",Z6="[object ArrayBuffer]",Y6="[object DataView]",P1=_1?_1.prototype:void 0,pg=P1?P1.valueOf:void 0;function K6(e,t,n,r,i,o,s){switch(n){case Y6:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Z6:return!(e.byteLength!=t.byteLength||!o(new S1(e),new S1(t)));case B6:case z6:case V6:return I6(+e,+t);case F6:return e.name==t.name&&e.message==t.message;case U6:case q6:return e==t+"";case W6:var l=L6;case H6:var c=r&j6;if(l||(l=N6),e.size!=t.size&&!c)return!1;var h=s.get(e);if(h)return h==t;r|=D6,s.set(e,t);var u=R6(l(e),l(t),r,i,o,s);return s.delete(e),u;case G6:if(pg)return pg.call(e)==pg.call(t)}return!1}var X6=K6;function J6(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var NO=J6,Q6=NO,t8=dr;function e8(e,t,n){var r=t(e);return t8(e)?r:Q6(r,n(e))}var n8=e8;function r8(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}var i8=r8;function o8(){return[]}var s8=o8,a8=i8,l8=s8,c8=Object.prototype,u8=c8.propertyIsEnumerable,A1=Object.getOwnPropertySymbols,h8=A1?function(e){return e==null?[]:(e=Object(e),a8(A1(e),function(t){return u8.call(e,t)}))}:l8,f8=h8;function d8(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var p8=d8,m8=vo,g8=bo,y8="[object Arguments]";function v8(e){return g8(e)&&m8(e)==y8}var b8=v8,T1=b8,x8=bo,jO=Object.prototype,w8=jO.hasOwnProperty,_8=jO.propertyIsEnumerable,S8=T1(function(){return arguments}())?T1:function(e){return x8(e)&&w8.call(e,"callee")&&!_8.call(e,"callee")},k0=S8,hd={exports:{}};function P8(){return!1}var A8=P8;hd.exports;(function(e,t){var n=Ti,r=A8,i=t&&!t.nodeType&&t,o=i&&!0&&e&&!e.nodeType&&e,s=o&&o.exports===i,l=s?n.Buffer:void 0,c=l?l.isBuffer:void 0,h=c||r;e.exports=h})(hd,hd.exports);var DO=hd.exports,T8=9007199254740991,E8=/^(?:0|[1-9]\d*)$/;function C8(e,t){var n=typeof e;return t=t??T8,!!t&&(n=="number"||n!="symbol"&&E8.test(e))&&e>-1&&e%1==0&&e<t}var $0=C8,O8=9007199254740991;function M8(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=O8}var I0=M8,k8=vo,$8=I0,I8=bo,R8="[object Arguments]",L8="[object Array]",N8="[object Boolean]",j8="[object Date]",D8="[object Error]",B8="[object Function]",z8="[object Map]",F8="[object Number]",W8="[object Object]",V8="[object RegExp]",U8="[object Set]",H8="[object String]",q8="[object WeakMap]",G8="[object ArrayBuffer]",Z8="[object DataView]",Y8="[object Float32Array]",K8="[object Float64Array]",X8="[object Int8Array]",J8="[object Int16Array]",Q8="[object Int32Array]",tU="[object Uint8Array]",eU="[object Uint8ClampedArray]",nU="[object Uint16Array]",rU="[object Uint32Array]",We={};We[Y8]=We[K8]=We[X8]=We[J8]=We[Q8]=We[tU]=We[eU]=We[nU]=We[rU]=!0;We[R8]=We[L8]=We[G8]=We[N8]=We[Z8]=We[j8]=We[D8]=We[B8]=We[z8]=We[F8]=We[W8]=We[V8]=We[U8]=We[H8]=We[q8]=!1;function iU(e){return I8(e)&&$8(e.length)&&!!We[k8(e)]}var oU=iU;function sU(e){return function(t){return e(t)}}var BO=sU,fd={exports:{}};fd.exports;(function(e,t){var n=YC,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,s=o&&n.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();e.exports=l})(fd,fd.exports);var aU=fd.exports,lU=oU,cU=BO,E1=aU,C1=E1&&E1.isTypedArray,uU=C1?cU(C1):lU,zO=uU,hU=p8,fU=k0,dU=dr,pU=DO,mU=$0,gU=zO,yU=Object.prototype,vU=yU.hasOwnProperty;function bU(e,t){var n=dU(e),r=!n&&fU(e),i=!n&&!r&&pU(e),o=!n&&!r&&!i&&gU(e),s=n||r||i||o,l=s?hU(e.length,String):[],c=l.length;for(var h in e)(t||vU.call(e,h))&&!(s&&(h=="length"||i&&(h=="offset"||h=="parent")||o&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||mU(h,c)))&&l.push(h);return l}var xU=bU,wU=Object.prototype;function _U(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||wU;return e===n}var SU=_U;function PU(e,t){return function(n){return e(t(n))}}var FO=PU,AU=FO,TU=AU(Object.keys,Object),EU=TU,CU=SU,OU=EU,MU=Object.prototype,kU=MU.hasOwnProperty;function $U(e){if(!CU(e))return OU(e);var t=[];for(var n in Object(e))kU.call(e,n)&&n!="constructor"&&t.push(n);return t}var IU=$U,RU=y0,LU=I0;function NU(e){return e!=null&&LU(e.length)&&!RU(e)}var vh=NU,jU=xU,DU=IU,BU=vh;function zU(e){return BU(e)?jU(e):DU(e)}var Fp=zU,FU=n8,WU=f8,VU=Fp;function UU(e){return FU(e,VU,WU)}var HU=UU,O1=HU,qU=1,GU=Object.prototype,ZU=GU.hasOwnProperty;function YU(e,t,n,r,i,o){var s=n&qU,l=O1(e),c=l.length,h=O1(t),u=h.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var m=l[f];if(!(s?m in t:ZU.call(t,m)))return!1}var y=o.get(e),x=o.get(t);if(y&&x)return y==t&&x==e;var p=!0;o.set(e,t),o.set(t,e);for(var b=s;++f<c;){m=l[f];var P=e[m],S=t[m];if(r)var A=s?r(S,P,m,t,e,o):r(P,S,m,e,t,o);if(!(A===void 0?P===S||i(P,S,n,r,o):A)){p=!1;break}b||(b=m=="constructor")}if(p&&!b){var E=e.constructor,w=t.constructor;E!=w&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof w=="function"&&w instanceof w)&&(p=!1)}return o.delete(e),o.delete(t),p}var KU=YU,XU=xa,JU=Ti,QU=XU(JU,"DataView"),tH=QU,eH=xa,nH=Ti,rH=eH(nH,"Promise"),iH=rH,oH=xa,sH=Ti,aH=oH(sH,"Set"),WO=aH,lH=xa,cH=Ti,uH=lH(cH,"WeakMap"),hH=uH,Vy=tH,Uy=b0,Hy=iH,qy=WO,Gy=hH,VO=vo,lc=XC,M1="[object Map]",fH="[object Object]",k1="[object Promise]",$1="[object Set]",I1="[object WeakMap]",R1="[object DataView]",dH=lc(Vy),pH=lc(Uy),mH=lc(Hy),gH=lc(qy),yH=lc(Gy),Hs=VO;(Vy&&Hs(new Vy(new ArrayBuffer(1)))!=R1||Uy&&Hs(new Uy)!=M1||Hy&&Hs(Hy.resolve())!=k1||qy&&Hs(new qy)!=$1||Gy&&Hs(new Gy)!=I1)&&(Hs=function(e){var t=VO(e),n=t==fH?e.constructor:void 0,r=n?lc(n):"";if(r)switch(r){case dH:return R1;case pH:return M1;case mH:return k1;case gH:return $1;case yH:return I1}return t});var vH=Hs,mg=kO,bH=LO,xH=X6,wH=KU,L1=vH,N1=dr,j1=DO,_H=zO,SH=1,D1="[object Arguments]",B1="[object Array]",vf="[object Object]",PH=Object.prototype,z1=PH.hasOwnProperty;function AH(e,t,n,r,i,o){var s=N1(e),l=N1(t),c=s?B1:L1(e),h=l?B1:L1(t);c=c==D1?vf:c,h=h==D1?vf:h;var u=c==vf,f=h==vf,m=c==h;if(m&&j1(e)){if(!j1(t))return!1;s=!0,u=!1}if(m&&!u)return o||(o=new mg),s||_H(e)?bH(e,t,n,r,i,o):xH(e,t,c,n,r,i,o);if(!(n&SH)){var y=u&&z1.call(e,"__wrapped__"),x=f&&z1.call(t,"__wrapped__");if(y||x){var p=y?e.value():e,b=x?t.value():t;return o||(o=new mg),i(p,b,n,r,o)}}return m?(o||(o=new mg),wH(e,t,n,r,i,o)):!1}var TH=AH,EH=TH,F1=bo;function UO(e,t,n,r,i){return e===t?!0:e==null||t==null||!F1(e)&&!F1(t)?e!==e&&t!==t:EH(e,t,n,r,UO,i)}var R0=UO,CH=kO,OH=R0,MH=1,kH=2;function $H(e,t,n,r){var i=n.length,o=i,s=!r;if(e==null)return!o;for(e=Object(e);i--;){var l=n[i];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<o;){l=n[i];var c=l[0],h=e[c],u=l[1];if(s&&l[2]){if(h===void 0&&!(c in e))return!1}else{var f=new CH;if(r)var m=r(h,u,c,e,t,f);if(!(m===void 0?OH(u,h,MH|kH,r,f):m))return!1}}return!0}var IH=$H,RH=as;function LH(e){return e===e&&!RH(e)}var HO=LH,NH=HO,jH=Fp;function DH(e){for(var t=jH(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,NH(i)]}return t}var BH=DH;function zH(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var qO=zH,FH=IH,WH=BH,VH=qO;function UH(e){var t=WH(e);return t.length==1&&t[0][2]?VH(t[0][0],t[0][1]):function(n){return n===e||FH(n,e,t)}}var HH=UH;function qH(e,t){return e!=null&&t in Object(e)}var GH=qH,ZH=nO,YH=k0,KH=dr,XH=$0,JH=I0,QH=Lp;function tq(e,t,n){t=ZH(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=QH(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&JH(i)&&XH(s,i)&&(KH(e)||YH(e)))}var eq=tq,nq=GH,rq=eq;function iq(e,t){return e!=null&&rq(e,t,nq)}var oq=iq,sq=R0,aq=rO,lq=oq,cq=g0,uq=HO,hq=qO,fq=Lp,dq=1,pq=2;function mq(e,t){return cq(e)&&uq(t)?hq(fq(e),t):function(n){var r=aq(n,e);return r===void 0&&r===t?lq(n,e):sq(t,r,dq|pq)}}var gq=mq;function yq(e){return e}var cc=yq;function vq(e){return function(t){return t==null?void 0:t[e]}}var bq=vq,xq=S0;function wq(e){return function(t){return xq(t,e)}}var _q=wq,Sq=bq,Pq=_q,Aq=g0,Tq=Lp;function Eq(e){return Aq(e)?Sq(Tq(e)):Pq(e)}var Cq=Eq,Oq=HH,Mq=gq,kq=cc,$q=dr,Iq=Cq;function Rq(e){return typeof e=="function"?e:e==null?kq:typeof e=="object"?$q(e)?Mq(e[0],e[1]):Oq(e):Iq(e)}var Ei=Rq;function Lq(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var GO=Lq;function Nq(e){return e!==e}var jq=Nq;function Dq(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var Bq=Dq,zq=GO,Fq=jq,Wq=Bq;function Vq(e,t,n){return t===t?Wq(e,t,n):zq(e,Fq,n)}var Uq=Vq,Hq=Uq;function qq(e,t){var n=e==null?0:e.length;return!!n&&Hq(e,t,0)>-1}var Gq=qq;function Zq(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var Yq=Zq;function Kq(){}var Xq=Kq,gg=WO,Jq=Xq,Qq=M0,tG=1/0,eG=gg&&1/Qq(new gg([,-0]))[1]==tG?function(e){return new gg(e)}:Jq,nG=eG,rG=$O,iG=Gq,oG=Yq,sG=RO,aG=nG,lG=M0,cG=200;function uG(e,t,n){var r=-1,i=iG,o=e.length,s=!0,l=[],c=l;if(n)s=!1,i=oG;else if(o>=cG){var h=t?null:aG(e);if(h)return lG(h);s=!1,i=sG,c=new rG}else c=t?[]:l;t:for(;++r<o;){var u=e[r],f=t?t(u):u;if(u=n||u!==0?u:0,s&&f===f){for(var m=c.length;m--;)if(c[m]===f)continue t;t&&c.push(f),l.push(u)}else i(c,f,n)||(c!==l&&c.push(f),l.push(u))}return l}var hG=uG,fG=Ei,dG=hG;function pG(e,t){return e&&e.length?dG(e,fG(t)):[]}var mG=pG;const W1=Me(mG);function ZO(e,t,n){return t===!0?W1(e,n):Vt(t)?W1(e,t):e}function wl(e){"@babel/helpers - typeof";return wl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wl(e)}var gG=["ref"];function V1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function to(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V1(Object(n),!0).forEach(function(r){Wp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function U1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,KO(r.key),r)}}function vG(e,t,n){return t&&U1(e.prototype,t),n&&U1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bG(e,t,n){return t=dd(t),xG(e,YO()?Reflect.construct(t,n||[],dd(e).constructor):t.apply(e,n))}function xG(e,t){if(t&&(wl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wG(e)}function wG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YO=function(){return!!e})()}function dd(e){return dd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},dd(e)}function _G(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zy(e,t)}function Zy(e,t){return Zy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Zy(e,t)}function Wp(e,t,n){return t=KO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KO(e){var t=SG(e,"string");return wl(t)=="symbol"?t:t+""}function SG(e,t){if(wl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function PG(e,t){if(e==null)return{};var n=AG(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function AG(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function TG(e){return e.value}function EG(e,t){if(v.isValidElement(e))return v.cloneElement(e,t);if(typeof e=="function")return v.createElement(e,t);t.ref;var n=PG(t,gG);return v.createElement(O0,n)}var H1=1,ra=function(e){function t(){var n;yG(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=bG(this,t,[].concat(i)),Wp(n,"lastBoundingBox",{width:-1,height:-1}),n}return _G(t,e),vG(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>H1||Math.abs(i.height-this.lastBoundingBox.height)>H1)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?to({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,s=i.align,l=i.verticalAlign,c=i.margin,h=i.chartWidth,u=i.chartHeight,f,m;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(s==="center"&&o==="vertical"){var y=this.getBBoxSnapshot();f={left:((h||0)-y.width)/2}}else f=s==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var x=this.getBBoxSnapshot();m={top:((u||0)-x.height)/2}}else m=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return to(to({},f),m)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,s=i.width,l=i.height,c=i.wrapperStyle,h=i.payloadUniqBy,u=i.payload,f=to(to({position:"absolute",width:s||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return v.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(y){r.wrapperNode=y}},EG(o,to(to({},this.props),{},{payload:ZO(u,h,TG)})))}}],[{key:"getWithHeight",value:function(r,i){var o=to(to({},this.defaultProps),r.props),s=o.layout;return s==="vertical"&&xt(r.props.height)?{height:r.props.height}:s==="horizontal"?{width:r.props.width||i}:null}}])}(v.PureComponent);Wp(ra,"displayName","Legend");Wp(ra,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var q1=yh,CG=k0,OG=dr,G1=q1?q1.isConcatSpreadable:void 0;function MG(e){return OG(e)||CG(e)||!!(G1&&e&&e[G1])}var kG=MG,$G=NO,IG=kG;function XO(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=IG),i||(i=[]);++o<s;){var l=e[o];t>0&&n(l)?t>1?XO(l,t-1,n,r,i):$G(i,l):r||(i[i.length]=l)}return i}var JO=XO;function RG(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),l=s.length;l--;){var c=s[e?l:++i];if(n(o[c],c,o)===!1)break}return t}}var LG=RG,NG=LG,jG=NG(),DG=jG,BG=DG,zG=Fp;function FG(e,t){return e&&BG(e,t,zG)}var QO=FG,WG=vh;function VG(e,t){return function(n,r){if(n==null)return n;if(!WG(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Object(n);(t?o--:++o<i)&&r(s[o],o,s)!==!1;);return n}}var UG=VG,HG=QO,qG=UG,GG=qG(HG),L0=GG,ZG=L0,YG=vh;function KG(e,t){var n=-1,r=YG(e)?Array(e.length):[];return ZG(e,function(i,o,s){r[++n]=t(i,o,s)}),r}var tM=KG;function XG(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var JG=XG,Z1=ec;function QG(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,o=Z1(e),s=t!==void 0,l=t===null,c=t===t,h=Z1(t);if(!l&&!h&&!o&&e>t||o&&s&&c&&!l&&!h||r&&s&&c||!n&&c||!i)return 1;if(!r&&!o&&!h&&e<t||h&&n&&i&&!r&&!o||l&&n&&i||!s&&i||!c)return-1}return 0}var t9=QG,e9=t9;function n9(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,l=n.length;++r<s;){var c=e9(i[r],o[r]);if(c){if(r>=l)return c;var h=n[r];return c*(h=="desc"?-1:1)}}return e.index-t.index}var r9=n9,yg=_0,i9=S0,o9=Ei,s9=tM,a9=JG,l9=BO,c9=r9,u9=cc,h9=dr;function f9(e,t,n){t.length?t=yg(t,function(o){return h9(o)?function(s){return i9(s,o.length===1?o[0]:o)}:o}):t=[u9];var r=-1;t=yg(t,l9(o9));var i=s9(e,function(o,s,l){var c=yg(t,function(h){return h(o)});return{criteria:c,index:++r,value:o}});return a9(i,function(o,s){return c9(o,s,n)})}var d9=f9;function p9(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var m9=p9,g9=m9,Y1=Math.max;function y9(e,t,n){return t=Y1(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=Y1(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=r[i];return l[t]=n(s),g9(e,this,l)}}var v9=y9;function b9(e){return function(){return e}}var x9=b9,w9=xa,_9=function(){try{var e=w9(Object,"defineProperty");return e({},"",{}),e}catch{}}(),eM=_9,S9=x9,K1=eM,P9=cc,A9=K1?function(e,t){return K1(e,"toString",{configurable:!0,enumerable:!1,value:S9(t),writable:!0})}:P9,T9=A9,E9=800,C9=16,O9=Date.now;function M9(e){var t=0,n=0;return function(){var r=O9(),i=C9-(r-n);if(n=r,i>0){if(++t>=E9)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var k9=M9,$9=T9,I9=k9,R9=I9($9),L9=R9,N9=cc,j9=v9,D9=L9;function B9(e,t){return D9(j9(e,t,N9),e+"")}var z9=B9,F9=v0,W9=vh,V9=$0,U9=as;function H9(e,t,n){if(!U9(n))return!1;var r=typeof t;return(r=="number"?W9(n)&&V9(t,n.length):r=="string"&&t in n)?F9(n[t],e):!1}var Vp=H9,q9=JO,G9=d9,Z9=z9,X1=Vp,Y9=Z9(function(e,t){if(e==null)return[];var n=t.length;return n>1&&X1(e,t[0],t[1])?t=[]:n>2&&X1(t[0],t[1],t[2])&&(t=[t[0]]),G9(e,q9(t,1),[])}),K9=Y9;const N0=Me(K9);function $u(e){"@babel/helpers - typeof";return $u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$u(e)}function Yy(){return Yy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yy.apply(this,arguments)}function X9(e,t){return e7(e)||t7(e,t)||Q9(e,t)||J9()}function J9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -42,7 +42,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
42
42
  or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
43
43
  height and width.`,z,Y,s,c,u,f,n);var G=!Array.isArray(y)&&lo(y.type).endsWith("Chart");return v.Children.map(y,function(J){return v.isValidElement(J)?v.cloneElement(J,xf({width:z,height:Y},G?{style:xf({height:"100%",width:"100%",maxHeight:Y,maxWidth:z},J.props.style)}:{})):J})},[n,y,c,m,f,u,N,s]);return v.createElement("div",{id:b?"".concat(b):void 0,className:Jt("recharts-responsive-container",P),style:xf(xf({},E),{},{width:s,height:c,minWidth:u,minHeight:f,maxHeight:m}),ref:w},j)}),bh=function(t){return null};bh.displayName="Cell";function Lu(e){"@babel/helpers - typeof";return Lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lu(e)}function hS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hS(Object(n),!0).forEach(function(r){mZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mZ(e,t,n){return t=gZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gZ(e){var t=yZ(e,"string");return Lu(t)=="symbol"?t:t+""}function yZ(e,t){if(Lu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wa={widthCache:{},cacheCount:0},vZ=2e3,bZ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},fS="recharts_measurement_span";function xZ(e){var t=Qy({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var uu=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ls.isSsr)return{width:0,height:0};var r=xZ(n),i=JSON.stringify({text:t,copyStyle:r});if(Wa.widthCache[i])return Wa.widthCache[i];try{var o=document.getElementById(fS);o||(o=document.createElement("span"),o.setAttribute("id",fS),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var s=Qy(Qy({},bZ),r);Object.assign(o.style,s),o.textContent="".concat(t);var l=o.getBoundingClientRect(),c={width:l.width,height:l.height};return Wa.widthCache[i]=c,++Wa.cacheCount>vZ&&(Wa.cacheCount=0,Wa.widthCache={}),c}catch{return{width:0,height:0}}},wZ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}function gd(e,t){return AZ(e)||PZ(e,t)||SZ(e,t)||_Z()}function _Z(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
44
44
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SZ(e,t){if(e){if(typeof e=="string")return dS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dS(e,t)}}function dS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function PZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function AZ(e){if(Array.isArray(e))return e}function TZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,CZ(r.key),r)}}function EZ(e,t,n){return t&&pS(e.prototype,t),n&&pS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function CZ(e){var t=OZ(e,"string");return Nu(t)=="symbol"?t:t+""}function OZ(e,t){if(Nu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var mS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,gS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,MZ=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,kZ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,lM={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},$Z=Object.keys(lM),tl="NaN";function IZ(e,t){return e*lM[t]}var wf=function(){function e(t,n){TZ(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!MZ.test(n)&&(this.num=NaN,this.unit=""),$Z.includes(n)&&(this.num=IZ(t,n),this.unit="px")}return EZ(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,i=(r=kZ.exec(n))!==null&&r!==void 0?r:[],o=gd(i,3),s=o[1],l=o[2];return new e(parseFloat(s),l??"")}}])}();function cM(e){if(e.includes(tl))return tl;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=mS.exec(t))!==null&&n!==void 0?n:[],i=gd(r,4),o=i[1],s=i[2],l=i[3],c=wf.parse(o??""),h=wf.parse(l??""),u=s==="*"?c.multiply(h):c.divide(h);if(u.isNaN())return tl;t=t.replace(mS,u.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,m=(f=gS.exec(t))!==null&&f!==void 0?f:[],y=gd(m,4),x=y[1],p=y[2],b=y[3],P=wf.parse(x??""),S=wf.parse(b??""),A=p==="+"?P.add(S):P.subtract(S);if(A.isNaN())return tl;t=t.replace(gS,A.toString())}return t}var yS=/\(([^()]*)\)/;function RZ(e){for(var t=e;t.includes("(");){var n=yS.exec(t),r=gd(n,2),i=r[1];t=t.replace(yS,cM(i))}return t}function LZ(e){var t=e.replace(/\s+/g,"");return t=RZ(t),t=cM(t),t}function NZ(e){try{return LZ(e)}catch{return tl}}function xg(e){var t=NZ(e.slice(5,-1));return t===tl?"":t}var jZ=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],DZ=["dx","dy","angle","className","breakAll"];function tv(){return tv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tv.apply(this,arguments)}function vS(e,t){if(e==null)return{};var n=BZ(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function BZ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function bS(e,t){return VZ(e)||WZ(e,t)||FZ(e,t)||zZ()}function zZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
45
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FZ(e,t){if(e){if(typeof e=="string")return xS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xS(e,t)}}function xS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function WZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function VZ(e){if(Array.isArray(e))return e}var uM=/[ \f\n\r\t\v\u2028\u2029]+/,hM=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var o=[];Ut(n)||(r?o=n.toString().split(""):o=n.toString().split(uM));var s=o.map(function(c){return{word:c,width:uu(c,i).width}}),l=r?0:uu(" ",i).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}},UZ=function(t,n,r,i,o){var s=t.maxLines,l=t.children,c=t.style,h=t.breakAll,u=xt(s),f=l,m=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return z.reduce(function(Y,G){var J=G.word,lt=G.width,q=Y[Y.length-1];if(q&&(i==null||o||q.width+lt+r<Number(i)))q.words.push(J),q.width+=lt+r;else{var nt={words:[J],width:lt};Y.push(nt)}return Y},[])},y=m(n),x=function(z){return z.reduce(function(Y,G){return Y.width>G.width?Y:G})};if(!u)return y;for(var p="…",b=function(z){var Y=f.slice(0,z),G=hM({breakAll:h,style:c,children:Y+p}).wordsWithComputedWidth,J=m(G),lt=J.length>s||x(J).width>Number(i);return[lt,J]},P=0,S=f.length-1,A=0,E;P<=S&&A<=f.length-1;){var w=Math.floor((P+S)/2),T=w-1,O=b(T),R=bS(O,2),N=R[0],V=R[1],D=b(w),j=bS(D,1),K=j[0];if(!N&&!K&&(P=w+1),N&&K&&(S=w-1),!N&&K){E=V;break}A++}return E||y},wS=function(t){var n=Ut(t)?[]:t.toString().split(uM);return[{words:n}]},HZ=function(t){var n=t.width,r=t.scaleToFit,i=t.children,o=t.style,s=t.breakAll,l=t.maxLines;if((n||r)&&!ls.isSsr){var c,h,u=hM({breakAll:s,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,m=u.spaceWidth;c=f,h=m}else return wS(i);return UZ({breakAll:s,children:i,maxLines:l,style:o},c,h,n,r)}return wS(i)},_S="#808080",da=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,s=t.lineHeight,l=s===void 0?"1em":s,c=t.capHeight,h=c===void 0?"0.71em":c,u=t.scaleToFit,f=u===void 0?!1:u,m=t.textAnchor,y=m===void 0?"start":m,x=t.verticalAnchor,p=x===void 0?"end":x,b=t.fill,P=b===void 0?_S:b,S=vS(t,jZ),A=v.useMemo(function(){return HZ({breakAll:S.breakAll,children:S.children,maxLines:S.maxLines,scaleToFit:f,style:S.style,width:S.width})},[S.breakAll,S.children,S.maxLines,f,S.style,S.width]),E=S.dx,w=S.dy,T=S.angle,O=S.className,R=S.breakAll,N=vS(S,DZ);if(!xn(r)||!xn(o))return null;var V=r+(xt(E)?E:0),D=o+(xt(w)?w:0),j;switch(p){case"start":j=xg("calc(".concat(h,")"));break;case"middle":j=xg("calc(".concat((A.length-1)/2," * -").concat(l," + (").concat(h," / 2))"));break;default:j=xg("calc(".concat(A.length-1," * -").concat(l,")"));break}var K=[];if(f){var H=A[0].width,z=S.width;K.push("scale(".concat((xt(z)?z/H:1)/H,")"))}return T&&K.push("rotate(".concat(T,", ").concat(V,", ").concat(D,")")),K.length&&(N.transform=K.join(" ")),v.createElement("text",tv({},Lt(N,!0),{x:V,y:D,className:Jt("recharts-text",O),textAnchor:y,fill:P.includes("url")?_S:P}),A.map(function(Y,G){var J=Y.words.join(R?"":" ");return v.createElement("tspan",{x:V,dy:G===0?j:l,key:"".concat(J,"-").concat(G)},J)}))};function Xo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function qZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function D0(e){let t,n,r;e.length!==2?(t=Xo,n=(l,c)=>Xo(e(l),c),r=(l,c)=>e(l)-c):(t=e===Xo||e===qZ?e:GZ,n=e,r=e);function i(l,c,h=0,u=l.length){if(h<u){if(t(c,c)!==0)return u;do{const f=h+u>>>1;n(l[f],c)<0?h=f+1:u=f}while(h<u)}return h}function o(l,c,h=0,u=l.length){if(h<u){if(t(c,c)!==0)return u;do{const f=h+u>>>1;n(l[f],c)<=0?h=f+1:u=f}while(h<u)}return h}function s(l,c,h=0,u=l.length){const f=i(l,c,h,u-1);return f>h&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:i,center:s,right:o}}function GZ(){return 0}function fM(e){return e===null?NaN:+e}function*ZZ(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const YZ=D0(Xo),xh=YZ.right;D0(fM).center;class SS extends Map{constructor(t,n=JZ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(PS(this,t))}has(t){return super.has(PS(this,t))}set(t,n){return super.set(KZ(this,t),n)}delete(t){return super.delete(XZ(this,t))}}function PS({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function KZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function XZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function JZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function QZ(e=Xo){if(e===Xo)return dM;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function dM(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const tY=Math.sqrt(50),eY=Math.sqrt(10),nY=Math.sqrt(2);function yd(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=tY?10:o>=eY?5:o>=nY?2:1;let l,c,h;return i<0?(h=Math.pow(10,-i)/s,l=Math.round(e*h),c=Math.round(t*h),l/h<e&&++l,c/h>t&&--c,h=-h):(h=Math.pow(10,i)*s,l=Math.round(e/h),c=Math.round(t/h),l*h<e&&++l,c*h>t&&--c),c<l&&.5<=n&&n<2?yd(e,t,n*2):[l,c,h]}function ev(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,s]=r?yd(t,e,n):yd(e,t,n);if(!(o>=i))return[];const l=o-i+1,c=new Array(l);if(r)if(s<0)for(let h=0;h<l;++h)c[h]=(o-h)/-s;else for(let h=0;h<l;++h)c[h]=(o-h)*s;else if(s<0)for(let h=0;h<l;++h)c[h]=(i+h)/-s;else for(let h=0;h<l;++h)c[h]=(i+h)*s;return c}function nv(e,t,n){return t=+t,e=+e,n=+n,yd(e,t,n)[2]}function rv(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?nv(t,e,n):nv(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function AS(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function TS(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function pM(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?dM:QZ(i);r>n;){if(r-n>600){const c=r-n+1,h=t-n+1,u=Math.log(c),f=.5*Math.exp(2*u/3),m=.5*Math.sqrt(u*f*(c-f)/c)*(h-c/2<0?-1:1),y=Math.max(n,Math.floor(t-h*f/c+m)),x=Math.min(r,Math.floor(t+(c-h)*f/c+m));pM(e,t,y,x,i)}const o=e[t];let s=n,l=r;for(Fc(e,n,t),i(e[r],o)>0&&Fc(e,n,r);s<l;){for(Fc(e,s,l),++s,--l;i(e[s],o)<0;)++s;for(;i(e[l],o)>0;)--l}i(e[n],o)===0?Fc(e,n,l):(++l,Fc(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Fc(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function rY(e,t,n){if(e=Float64Array.from(ZZ(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return TS(e);if(t>=1)return AS(e);var r,i=(r-1)*t,o=Math.floor(i),s=AS(pM(e,o).subarray(0,o+1)),l=TS(e.subarray(o+1));return s+(l-s)*(i-o)}}function iY(e,t,n=fM){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),s=+n(e[o],o,e),l=+n(e[o+1],o+1,e);return s+(l-s)*(i-o)}}function oY(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function Fr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function xo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const iv=Symbol("implicit");function B0(){var e=new SS,t=[],n=[],r=iv;function i(o){let s=e.get(o);if(s===void 0){if(r!==iv)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new SS;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return B0(t,n).unknown(r)},Fr.apply(i,arguments),i}function ju(){var e=B0().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,l=!1,c=0,h=0,u=.5;delete e.unknown;function f(){var m=t().length,y=i<r,x=y?i:r,p=y?r:i;o=(p-x)/Math.max(1,m-c+h*2),l&&(o=Math.floor(o)),x+=(p-x-o*(m-c))*u,s=o*(1-c),l&&(x=Math.round(x),s=Math.round(s));var b=oY(m).map(function(P){return x+o*P});return n(y?b.reverse():b)}return e.domain=function(m){return arguments.length?(t(m),f()):t()},e.range=function(m){return arguments.length?([r,i]=m,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(m){return[r,i]=m,r=+r,i=+i,l=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(m){return arguments.length?(l=!!m,f()):l},e.padding=function(m){return arguments.length?(c=Math.min(1,h=+m),f()):c},e.paddingInner=function(m){return arguments.length?(c=Math.min(1,m),f()):c},e.paddingOuter=function(m){return arguments.length?(h=+m,f()):h},e.align=function(m){return arguments.length?(u=Math.max(0,Math.min(1,m)),f()):u},e.copy=function(){return ju(t(),[r,i]).round(l).paddingInner(c).paddingOuter(h).align(u)},Fr.apply(f(),arguments)}function mM(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return mM(t())},e}function hu(){return mM(ju.apply(null,arguments).paddingInner(1))}function z0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function gM(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function wh(){}var Du=.7,vd=1/Du,cl="\\s*([+-]?\\d+)\\s*",Bu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_i="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sY=/^#([0-9a-f]{3,8})$/,aY=new RegExp(`^rgb\\(${cl},${cl},${cl}\\)$`),lY=new RegExp(`^rgb\\(${_i},${_i},${_i}\\)$`),cY=new RegExp(`^rgba\\(${cl},${cl},${cl},${Bu}\\)$`),uY=new RegExp(`^rgba\\(${_i},${_i},${_i},${Bu}\\)$`),hY=new RegExp(`^hsl\\(${Bu},${_i},${_i}\\)$`),fY=new RegExp(`^hsla\\(${Bu},${_i},${_i},${Bu}\\)$`),ES={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};z0(wh,zu,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:CS,formatHex:CS,formatHex8:dY,formatHsl:pY,formatRgb:OS,toString:OS});function CS(){return this.rgb().formatHex()}function dY(){return this.rgb().formatHex8()}function pY(){return yM(this).formatHsl()}function OS(){return this.rgb().formatRgb()}function zu(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sY.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?MS(t):n===3?new ar(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_f(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_f(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=aY.exec(e))?new ar(t[1],t[2],t[3],1):(t=lY.exec(e))?new ar(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cY.exec(e))?_f(t[1],t[2],t[3],t[4]):(t=uY.exec(e))?_f(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=hY.exec(e))?IS(t[1],t[2]/100,t[3]/100,1):(t=fY.exec(e))?IS(t[1],t[2]/100,t[3]/100,t[4]):ES.hasOwnProperty(e)?MS(ES[e]):e==="transparent"?new ar(NaN,NaN,NaN,0):null}function MS(e){return new ar(e>>16&255,e>>8&255,e&255,1)}function _f(e,t,n,r){return r<=0&&(e=t=n=NaN),new ar(e,t,n,r)}function mY(e){return e instanceof wh||(e=zu(e)),e?(e=e.rgb(),new ar(e.r,e.g,e.b,e.opacity)):new ar}function ov(e,t,n,r){return arguments.length===1?mY(e):new ar(e,t,n,r??1)}function ar(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}z0(ar,ov,gM(wh,{brighter(e){return e=e==null?vd:Math.pow(vd,e),new ar(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Du:Math.pow(Du,e),new ar(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ar(ia(this.r),ia(this.g),ia(this.b),bd(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:kS,formatHex:kS,formatHex8:gY,formatRgb:$S,toString:$S}));function kS(){return`#${Xs(this.r)}${Xs(this.g)}${Xs(this.b)}`}function gY(){return`#${Xs(this.r)}${Xs(this.g)}${Xs(this.b)}${Xs((isNaN(this.opacity)?1:this.opacity)*255)}`}function $S(){const e=bd(this.opacity);return`${e===1?"rgb(":"rgba("}${ia(this.r)}, ${ia(this.g)}, ${ia(this.b)}${e===1?")":`, ${e})`}`}function bd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ia(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xs(e){return e=ia(e),(e<16?"0":"")+e.toString(16)}function IS(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qr(e,t,n,r)}function yM(e){if(e instanceof Qr)return new Qr(e.h,e.s,e.l,e.opacity);if(e instanceof wh||(e=zu(e)),!e)return new Qr;if(e instanceof Qr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,l=o-i,c=(o+i)/2;return l?(t===o?s=(n-r)/l+(n<r)*6:n===o?s=(r-t)/l+2:s=(t-n)/l+4,l/=c<.5?o+i:2-o-i,s*=60):l=c>0&&c<1?0:s,new Qr(s,l,c,e.opacity)}function yY(e,t,n,r){return arguments.length===1?yM(e):new Qr(e,t,n,r??1)}function Qr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}z0(Qr,yY,gM(wh,{brighter(e){return e=e==null?vd:Math.pow(vd,e),new Qr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Du:Math.pow(Du,e),new Qr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ar(wg(e>=240?e-240:e+120,i,r),wg(e,i,r),wg(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Qr(RS(this.h),Sf(this.s),Sf(this.l),bd(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=bd(this.opacity);return`${e===1?"hsl(":"hsla("}${RS(this.h)}, ${Sf(this.s)*100}%, ${Sf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function RS(e){return e=(e||0)%360,e<0?e+360:e}function Sf(e){return Math.max(0,Math.min(1,e||0))}function wg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const F0=e=>()=>e;function vY(e,t){return function(n){return e+n*t}}function bY(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function xY(e){return(e=+e)==1?vM:function(t,n){return n-t?bY(t,n,e):F0(isNaN(t)?n:t)}}function vM(e,t){var n=t-e;return n?vY(e,n):F0(isNaN(e)?t:e)}const LS=function e(t){var n=xY(t);function r(i,o){var s=n((i=ov(i)).r,(o=ov(o)).r),l=n(i.g,o.g),c=n(i.b,o.b),h=vM(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=l(u),i.b=c(u),i.opacity=h(u),i+""}}return r.gamma=e,r}(1);function wY(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function _Y(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function SY(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=uc(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(l){for(s=0;s<r;++s)o[s]=i[s](l);return o}}function PY(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function xd(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function AY(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=uc(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var sv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_g=new RegExp(sv.source,"g");function TY(e){return function(){return e}}function EY(e){return function(t){return e(t)+""}}function CY(e,t){var n=sv.lastIndex=_g.lastIndex=0,r,i,o,s=-1,l=[],c=[];for(e=e+"",t=t+"";(r=sv.exec(e))&&(i=_g.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),l[s]?l[s]+=o:l[++s]=o),(r=r[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,c.push({i:s,x:xd(r,i)})),n=_g.lastIndex;return n<t.length&&(o=t.slice(n),l[s]?l[s]+=o:l[++s]=o),l.length<2?c[0]?EY(c[0].x):TY(t):(t=c.length,function(h){for(var u=0,f;u<t;++u)l[(f=c[u]).i]=f.x(h);return l.join("")})}function uc(e,t){var n=typeof t,r;return t==null||n==="boolean"?F0(t):(n==="number"?xd:n==="string"?(r=zu(t))?(t=r,LS):CY:t instanceof zu?LS:t instanceof Date?PY:_Y(t)?wY:Array.isArray(t)?SY:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?AY:xd)(e,t)}function W0(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function OY(e,t){t===void 0&&(t=e,e=uc);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(s){var l=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return o[l](s-l)}}function MY(e){return function(){return e}}function wd(e){return+e}var NS=[0,1];function Xn(e){return e}function av(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:MY(isNaN(t)?NaN:.5)}function kY(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function $Y(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=av(i,r),o=n(s,o)):(r=av(r,i),o=n(o,s)),function(l){return o(r(l))}}function IY(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=av(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(l){var c=xh(e,l,1,r)-1;return o[c](i[c](l))}}function _h(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Hp(){var e=NS,t=NS,n=uc,r,i,o,s=Xn,l,c,h;function u(){var m=Math.min(e.length,t.length);return s!==Xn&&(s=kY(e[0],e[m-1])),l=m>2?IY:$Y,c=h=null,f}function f(m){return m==null||isNaN(m=+m)?o:(c||(c=l(e.map(r),t,n)))(r(s(m)))}return f.invert=function(m){return s(i((h||(h=l(t,e.map(r),xd)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,wd),u()):e.slice()},f.range=function(m){return arguments.length?(t=Array.from(m),u()):t.slice()},f.rangeRound=function(m){return t=Array.from(m),n=W0,u()},f.clamp=function(m){return arguments.length?(s=m?!0:Xn,u()):s!==Xn},f.interpolate=function(m){return arguments.length?(n=m,u()):n},f.unknown=function(m){return arguments.length?(o=m,f):o},function(m,y){return r=m,i=y,u()}}function V0(){return Hp()(Xn,Xn)}function RY(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function _d(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Pl(e){return e=_d(Math.abs(e)),e?e[1]:NaN}function LY(e,t){return function(n,r){for(var i=n.length,o=[],s=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),o.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[s=(s+1)%e.length];return o.reverse().join(t)}}function NY(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var jY=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Fu(e){if(!(t=jY.exec(e)))throw new Error("invalid format: "+e);var t;return new U0({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Fu.prototype=U0.prototype;function U0(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}U0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function DY(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Sd;function BY(e,t){var n=_d(e,t);if(!n)return Sd=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(Sd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+_d(e,Math.max(0,t+o-1))[0]}function jS(e,t){var n=_d(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const DS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:RY,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>jS(e*100,t),r:jS,s:BY,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function BS(e){return e}var zS=Array.prototype.map,FS=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function zY(e){var t=e.grouping===void 0||e.thousands===void 0?BS:LY(zS.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?BS:NY(zS.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function h(f,m){f=Fu(f);var y=f.fill,x=f.align,p=f.sign,b=f.symbol,P=f.zero,S=f.width,A=f.comma,E=f.precision,w=f.trim,T=f.type;T==="n"?(A=!0,T="g"):DS[T]||(E===void 0&&(E=12),w=!0,T="g"),(P||y==="0"&&x==="=")&&(P=!0,y="0",x="=");var O=(m&&m.prefix!==void 0?m.prefix:"")+(b==="$"?n:b==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),R=(b==="$"?r:/[%p]/.test(T)?s:"")+(m&&m.suffix!==void 0?m.suffix:""),N=DS[T],V=/[defgprs%]/.test(T);E=E===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function D(j){var K=O,H=R,z,Y,G;if(T==="c")H=N(j)+H,j="";else{j=+j;var J=j<0||1/j<0;if(j=isNaN(j)?c:N(Math.abs(j),E),w&&(j=DY(j)),J&&+j==0&&p!=="+"&&(J=!1),K=(J?p==="("?p:l:p==="-"||p==="("?"":p)+K,H=(T==="s"&&!isNaN(j)&&Sd!==void 0?FS[8+Sd/3]:"")+H+(J&&p==="("?")":""),V){for(z=-1,Y=j.length;++z<Y;)if(G=j.charCodeAt(z),48>G||G>57){H=(G===46?i+j.slice(z+1):j.slice(z))+H,j=j.slice(0,z);break}}}A&&!P&&(j=t(j,1/0));var lt=K.length+j.length+H.length,q=lt<S?new Array(S-lt+1).join(y):"";switch(A&&P&&(j=t(q+j,q.length?S-H.length:1/0),q=""),x){case"<":j=K+j+H+q;break;case"=":j=K+q+j+H;break;case"^":j=q.slice(0,lt=q.length>>1)+K+j+H+q.slice(lt);break;default:j=q+K+j+H;break}return o(j)}return D.toString=function(){return f+""},D}function u(f,m){var y=Math.max(-8,Math.min(8,Math.floor(Pl(m)/3)))*3,x=Math.pow(10,-y),p=h((f=Fu(f),f.type="f",f),{suffix:FS[8+y/3]});return function(b){return p(x*b)}}return{format:h,formatPrefix:u}}var Pf,H0,bM;FY({thousands:",",grouping:[3],currency:["$",""]});function FY(e){return Pf=zY(e),H0=Pf.format,bM=Pf.formatPrefix,Pf}function WY(e){return Math.max(0,-Pl(Math.abs(e)))}function VY(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Pl(t)/3)))*3-Pl(Math.abs(e)))}function UY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Pl(t)-Pl(e))+1}function xM(e,t,n,r){var i=rv(e,t,n),o;switch(r=Fu(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=VY(i,s))&&(r.precision=o),bM(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=UY(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=WY(i))&&(r.precision=o-(r.type==="%")*2);break}}return H0(r)}function cs(e){var t=e.domain;return e.ticks=function(n){var r=t();return ev(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return xM(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],l=r[o],c,h,u=10;for(l<s&&(h=s,s=l,l=h,h=i,i=o,o=h);u-- >0;){if(h=nv(s,l,n),h===c)return r[i]=s,r[o]=l,t(r);if(h>0)s=Math.floor(s/h)*h,l=Math.ceil(l/h)*h;else if(h<0)s=Math.ceil(s*h)/h,l=Math.floor(l*h)/h;else break;c=h}return e},e}function Pd(){var e=V0();return e.copy=function(){return _h(e,Pd())},Fr.apply(e,arguments),cs(e)}function wM(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,wd),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return wM(e).unknown(t)},e=arguments.length?Array.from(e,wd):[0,1],cs(n)}function _M(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return o<i&&(s=n,n=r,r=s,s=i,i=o,o=s),e[n]=t.floor(i),e[r]=t.ceil(o),e}function WS(e){return Math.log(e)}function VS(e){return Math.exp(e)}function HY(e){return-Math.log(-e)}function qY(e){return-Math.exp(-e)}function GY(e){return isFinite(e)?+("1e"+e):e<0?0:e}function ZY(e){return e===10?GY:e===Math.E?Math.exp:t=>Math.pow(e,t)}function YY(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function US(e){return(t,n)=>-e(-t,n)}function q0(e){const t=e(WS,VS),n=t.domain;let r=10,i,o;function s(){return i=YY(r),o=ZY(r),n()[0]<0?(i=US(i),o=US(o),e(HY,qY)):e(WS,VS),t}return t.base=function(l){return arguments.length?(r=+l,s()):r},t.domain=function(l){return arguments.length?(n(l),s()):n()},t.ticks=l=>{const c=n();let h=c[0],u=c[c.length-1];const f=u<h;f&&([h,u]=[u,h]);let m=i(h),y=i(u),x,p;const b=l==null?10:+l;let P=[];if(!(r%1)&&y-m<b){if(m=Math.floor(m),y=Math.ceil(y),h>0){for(;m<=y;++m)for(x=1;x<r;++x)if(p=m<0?x/o(-m):x*o(m),!(p<h)){if(p>u)break;P.push(p)}}else for(;m<=y;++m)for(x=r-1;x>=1;--x)if(p=m>0?x/o(-m):x*o(m),!(p<h)){if(p>u)break;P.push(p)}P.length*2<b&&(P=ev(h,u,b))}else P=ev(m,y,Math.min(y-m,b)).map(o);return f?P.reverse():P},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Fu(c)).precision==null&&(c.trim=!0),c=H0(c)),l===1/0)return c;const h=Math.max(1,r*l/t.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*r<r-.5&&(f*=r),f<=h?c(u):""}},t.nice=()=>n(_M(n(),{floor:l=>o(Math.floor(i(l))),ceil:l=>o(Math.ceil(i(l)))})),t}function SM(){const e=q0(Hp()).domain([1,10]);return e.copy=()=>_h(e,SM()).base(e.base()),Fr.apply(e,arguments),e}function HS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function qS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function G0(e){var t=1,n=e(HS(t),qS(t));return n.constant=function(r){return arguments.length?e(HS(t=+r),qS(t)):t},cs(n)}function PM(){var e=G0(Hp());return e.copy=function(){return _h(e,PM()).constant(e.constant())},Fr.apply(e,arguments)}function GS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function KY(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function XY(e){return e<0?-e*e:e*e}function Z0(e){var t=e(Xn,Xn),n=1;function r(){return n===1?e(Xn,Xn):n===.5?e(KY,XY):e(GS(n),GS(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},cs(t)}function Y0(){var e=Z0(Hp());return e.copy=function(){return _h(e,Y0()).exponent(e.exponent())},Fr.apply(e,arguments),e}function JY(){return Y0.apply(null,arguments).exponent(.5)}function ZS(e){return Math.sign(e)*e*e}function QY(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function AM(){var e=V0(),t=[0,1],n=!1,r;function i(o){var s=QY(e(o));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(o){return e.invert(ZS(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,wd)).map(ZS)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return AM(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Fr.apply(i,arguments),cs(i)}function TM(){var e=[],t=[],n=[],r;function i(){var s=0,l=Math.max(1,t.length);for(n=new Array(l-1);++s<l;)n[s-1]=iY(e,s/l);return o}function o(s){return s==null||isNaN(s=+s)?r:t[xh(n,s)]}return o.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Xo),i()},o.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},o.unknown=function(s){return arguments.length?(r=s,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return TM().domain(e).range(t).unknown(r)},Fr.apply(o,arguments)}function EM(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function s(c){return c!=null&&c<=c?i[xh(r,c,0,n)]:o}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,l()):i.slice()},s.invertExtent=function(c){var h=i.indexOf(c);return h<0?[NaN,NaN]:h<1?[e,r[0]]:h>=n?[r[n-1],t]:[r[h-1],r[h]]},s.unknown=function(c){return arguments.length&&(o=c),s},s.thresholds=function(){return r.slice()},s.copy=function(){return EM().domain([e,t]).range(i).unknown(o)},Fr.apply(cs(s),arguments)}function CM(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[xh(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return CM().domain(e).range(t).unknown(n)},Fr.apply(i,arguments)}const Sg=new Date,Pg=new Date;function wn(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),l=i.ceil(o);return o-s<l-o?s:l},i.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,l)=>{const c=[];if(o=i.ceil(o),l=l==null?1:Math.floor(l),!(o<s)||!(l>0))return c;let h;do c.push(h=new Date(+o)),t(o,l),e(o);while(h<o&&o<s);return c},i.filter=o=>wn(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!o(s););else for(;--l>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(Sg.setTime(+o),Pg.setTime(+s),e(Sg),e(Pg),Math.floor(n(Sg,Pg))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const Ad=wn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ad.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?wn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ad);Ad.range;const io=1e3,Br=io*60,oo=Br*60,po=oo*24,K0=po*7,YS=po*30,Ag=po*365,Js=wn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*io)},(e,t)=>(t-e)/io,e=>e.getUTCSeconds());Js.range;const X0=wn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*io)},(e,t)=>{e.setTime(+e+t*Br)},(e,t)=>(t-e)/Br,e=>e.getMinutes());X0.range;const J0=wn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Br)},(e,t)=>(t-e)/Br,e=>e.getUTCMinutes());J0.range;const Q0=wn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*io-e.getMinutes()*Br)},(e,t)=>{e.setTime(+e+t*oo)},(e,t)=>(t-e)/oo,e=>e.getHours());Q0.range;const tx=wn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*oo)},(e,t)=>(t-e)/oo,e=>e.getUTCHours());tx.range;const Sh=wn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Br)/po,e=>e.getDate()-1);Sh.range;const qp=wn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/po,e=>e.getUTCDate()-1);qp.range;const OM=wn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/po,e=>Math.floor(e/po));OM.range;function _a(e){return wn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Br)/K0)}const Gp=_a(0),Td=_a(1),tK=_a(2),eK=_a(3),Al=_a(4),nK=_a(5),rK=_a(6);Gp.range;Td.range;tK.range;eK.range;Al.range;nK.range;rK.range;function Sa(e){return wn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/K0)}const Zp=Sa(0),Ed=Sa(1),iK=Sa(2),oK=Sa(3),Tl=Sa(4),sK=Sa(5),aK=Sa(6);Zp.range;Ed.range;iK.range;oK.range;Tl.range;sK.range;aK.range;const ex=wn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ex.range;const nx=wn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());nx.range;const mo=wn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());mo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:wn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});mo.range;const go=wn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());go.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:wn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});go.range;function MM(e,t,n,r,i,o){const s=[[Js,1,io],[Js,5,5*io],[Js,15,15*io],[Js,30,30*io],[o,1,Br],[o,5,5*Br],[o,15,15*Br],[o,30,30*Br],[i,1,oo],[i,3,3*oo],[i,6,6*oo],[i,12,12*oo],[r,1,po],[r,2,2*po],[n,1,K0],[t,1,YS],[t,3,3*YS],[e,1,Ag]];function l(h,u,f){const m=u<h;m&&([h,u]=[u,h]);const y=f&&typeof f.range=="function"?f:c(h,u,f),x=y?y.range(h,+u+1):[];return m?x.reverse():x}function c(h,u,f){const m=Math.abs(u-h)/f,y=D0(([,,b])=>b).right(s,m);if(y===s.length)return e.every(rv(h/Ag,u/Ag,f));if(y===0)return Ad.every(Math.max(rv(h,u,f),1));const[x,p]=s[m/s[y-1][2]<s[y][2]/m?y-1:y];return x.every(p)}return[l,c]}const[lK,cK]=MM(go,nx,Zp,OM,tx,J0),[uK,hK]=MM(mo,ex,Gp,Sh,Q0,X0);function Tg(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Eg(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Wc(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function fK(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,h=Vc(i),u=Uc(i),f=Vc(o),m=Uc(o),y=Vc(s),x=Uc(s),p=Vc(l),b=Uc(l),P=Vc(c),S=Uc(c),A={a:G,A:J,b:lt,B:q,c:null,d:eP,e:eP,f:LK,g:HK,G:GK,H:$K,I:IK,j:RK,L:kM,m:NK,M:jK,p:nt,q:it,Q:iP,s:oP,S:DK,u:BK,U:zK,V:FK,w:WK,W:VK,x:null,X:null,y:UK,Y:qK,Z:ZK,"%":rP},E={a:at,A:ct,b:mt,B:yt,c:null,d:nP,e:nP,f:JK,g:lX,G:uX,H:YK,I:KK,j:XK,L:IM,m:QK,M:tX,p:Et,q:Tt,Q:iP,s:oP,S:eX,u:nX,U:rX,V:iX,w:oX,W:sX,x:null,X:null,y:aX,Y:cX,Z:hX,"%":rP},w={a:V,A:D,b:j,B:K,c:H,d:QS,e:QS,f:CK,g:JS,G:XS,H:tP,I:tP,j:PK,L:EK,m:SK,M:AK,p:N,q:_K,Q:MK,s:kK,S:TK,u:yK,U:vK,V:bK,w:gK,W:xK,x:z,X:Y,y:JS,Y:XS,Z:wK,"%":OK};A.x=T(n,A),A.X=T(r,A),A.c=T(t,A),E.x=T(n,E),E.X=T(r,E),E.c=T(t,E);function T(ht,ft){return function(Ct){var rt=[],Rt=-1,bt=0,de=ht.length,ne,Gt,Le;for(Ct instanceof Date||(Ct=new Date(+Ct));++Rt<de;)ht.charCodeAt(Rt)===37&&(rt.push(ht.slice(bt,Rt)),(Gt=KS[ne=ht.charAt(++Rt)])!=null?ne=ht.charAt(++Rt):Gt=ne==="e"?" ":"0",(Le=ft[ne])&&(ne=Le(Ct,Gt)),rt.push(ne),bt=Rt+1);return rt.push(ht.slice(bt,Rt)),rt.join("")}}function O(ht,ft){return function(Ct){var rt=Wc(1900,void 0,1),Rt=R(rt,ht,Ct+="",0),bt,de;if(Rt!=Ct.length)return null;if("Q"in rt)return new Date(rt.Q);if("s"in rt)return new Date(rt.s*1e3+("L"in rt?rt.L:0));if(ft&&!("Z"in rt)&&(rt.Z=0),"p"in rt&&(rt.H=rt.H%12+rt.p*12),rt.m===void 0&&(rt.m="q"in rt?rt.q:0),"V"in rt){if(rt.V<1||rt.V>53)return null;"w"in rt||(rt.w=1),"Z"in rt?(bt=Eg(Wc(rt.y,0,1)),de=bt.getUTCDay(),bt=de>4||de===0?Ed.ceil(bt):Ed(bt),bt=qp.offset(bt,(rt.V-1)*7),rt.y=bt.getUTCFullYear(),rt.m=bt.getUTCMonth(),rt.d=bt.getUTCDate()+(rt.w+6)%7):(bt=Tg(Wc(rt.y,0,1)),de=bt.getDay(),bt=de>4||de===0?Td.ceil(bt):Td(bt),bt=Sh.offset(bt,(rt.V-1)*7),rt.y=bt.getFullYear(),rt.m=bt.getMonth(),rt.d=bt.getDate()+(rt.w+6)%7)}else("W"in rt||"U"in rt)&&("w"in rt||(rt.w="u"in rt?rt.u%7:"W"in rt?1:0),de="Z"in rt?Eg(Wc(rt.y,0,1)).getUTCDay():Tg(Wc(rt.y,0,1)).getDay(),rt.m=0,rt.d="W"in rt?(rt.w+6)%7+rt.W*7-(de+5)%7:rt.w+rt.U*7-(de+6)%7);return"Z"in rt?(rt.H+=rt.Z/100|0,rt.M+=rt.Z%100,Eg(rt)):Tg(rt)}}function R(ht,ft,Ct,rt){for(var Rt=0,bt=ft.length,de=Ct.length,ne,Gt;Rt<bt;){if(rt>=de)return-1;if(ne=ft.charCodeAt(Rt++),ne===37){if(ne=ft.charAt(Rt++),Gt=w[ne in KS?ft.charAt(Rt++):ne],!Gt||(rt=Gt(ht,Ct,rt))<0)return-1}else if(ne!=Ct.charCodeAt(rt++))return-1}return rt}function N(ht,ft,Ct){var rt=h.exec(ft.slice(Ct));return rt?(ht.p=u.get(rt[0].toLowerCase()),Ct+rt[0].length):-1}function V(ht,ft,Ct){var rt=y.exec(ft.slice(Ct));return rt?(ht.w=x.get(rt[0].toLowerCase()),Ct+rt[0].length):-1}function D(ht,ft,Ct){var rt=f.exec(ft.slice(Ct));return rt?(ht.w=m.get(rt[0].toLowerCase()),Ct+rt[0].length):-1}function j(ht,ft,Ct){var rt=P.exec(ft.slice(Ct));return rt?(ht.m=S.get(rt[0].toLowerCase()),Ct+rt[0].length):-1}function K(ht,ft,Ct){var rt=p.exec(ft.slice(Ct));return rt?(ht.m=b.get(rt[0].toLowerCase()),Ct+rt[0].length):-1}function H(ht,ft,Ct){return R(ht,t,ft,Ct)}function z(ht,ft,Ct){return R(ht,n,ft,Ct)}function Y(ht,ft,Ct){return R(ht,r,ft,Ct)}function G(ht){return s[ht.getDay()]}function J(ht){return o[ht.getDay()]}function lt(ht){return c[ht.getMonth()]}function q(ht){return l[ht.getMonth()]}function nt(ht){return i[+(ht.getHours()>=12)]}function it(ht){return 1+~~(ht.getMonth()/3)}function at(ht){return s[ht.getUTCDay()]}function ct(ht){return o[ht.getUTCDay()]}function mt(ht){return c[ht.getUTCMonth()]}function yt(ht){return l[ht.getUTCMonth()]}function Et(ht){return i[+(ht.getUTCHours()>=12)]}function Tt(ht){return 1+~~(ht.getUTCMonth()/3)}return{format:function(ht){var ft=T(ht+="",A);return ft.toString=function(){return ht},ft},parse:function(ht){var ft=O(ht+="",!1);return ft.toString=function(){return ht},ft},utcFormat:function(ht){var ft=T(ht+="",E);return ft.toString=function(){return ht},ft},utcParse:function(ht){var ft=O(ht+="",!0);return ft.toString=function(){return ht},ft}}}var KS={"-":"",_:" ",0:"0"},Tn=/^\s*\d+/,dK=/^%/,pK=/[\\^$*+?|[\]().{}]/g;function ge(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function mK(e){return e.replace(pK,"\\$&")}function Vc(e){return new RegExp("^(?:"+e.map(mK).join("|")+")","i")}function Uc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function gK(e,t,n){var r=Tn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function yK(e,t,n){var r=Tn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function vK(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function bK(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function xK(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function XS(e,t,n){var r=Tn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function JS(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function wK(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function _K(e,t,n){var r=Tn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function SK(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function QS(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function PK(e,t,n){var r=Tn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function tP(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function AK(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function TK(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function EK(e,t,n){var r=Tn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function CK(e,t,n){var r=Tn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function OK(e,t,n){var r=dK.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function MK(e,t,n){var r=Tn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function kK(e,t,n){var r=Tn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function eP(e,t){return ge(e.getDate(),t,2)}function $K(e,t){return ge(e.getHours(),t,2)}function IK(e,t){return ge(e.getHours()%12||12,t,2)}function RK(e,t){return ge(1+Sh.count(mo(e),e),t,3)}function kM(e,t){return ge(e.getMilliseconds(),t,3)}function LK(e,t){return kM(e,t)+"000"}function NK(e,t){return ge(e.getMonth()+1,t,2)}function jK(e,t){return ge(e.getMinutes(),t,2)}function DK(e,t){return ge(e.getSeconds(),t,2)}function BK(e){var t=e.getDay();return t===0?7:t}function zK(e,t){return ge(Gp.count(mo(e)-1,e),t,2)}function $M(e){var t=e.getDay();return t>=4||t===0?Al(e):Al.ceil(e)}function FK(e,t){return e=$M(e),ge(Al.count(mo(e),e)+(mo(e).getDay()===4),t,2)}function WK(e){return e.getDay()}function VK(e,t){return ge(Td.count(mo(e)-1,e),t,2)}function UK(e,t){return ge(e.getFullYear()%100,t,2)}function HK(e,t){return e=$M(e),ge(e.getFullYear()%100,t,2)}function qK(e,t){return ge(e.getFullYear()%1e4,t,4)}function GK(e,t){var n=e.getDay();return e=n>=4||n===0?Al(e):Al.ceil(e),ge(e.getFullYear()%1e4,t,4)}function ZK(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ge(t/60|0,"0",2)+ge(t%60,"0",2)}function nP(e,t){return ge(e.getUTCDate(),t,2)}function YK(e,t){return ge(e.getUTCHours(),t,2)}function KK(e,t){return ge(e.getUTCHours()%12||12,t,2)}function XK(e,t){return ge(1+qp.count(go(e),e),t,3)}function IM(e,t){return ge(e.getUTCMilliseconds(),t,3)}function JK(e,t){return IM(e,t)+"000"}function QK(e,t){return ge(e.getUTCMonth()+1,t,2)}function tX(e,t){return ge(e.getUTCMinutes(),t,2)}function eX(e,t){return ge(e.getUTCSeconds(),t,2)}function nX(e){var t=e.getUTCDay();return t===0?7:t}function rX(e,t){return ge(Zp.count(go(e)-1,e),t,2)}function RM(e){var t=e.getUTCDay();return t>=4||t===0?Tl(e):Tl.ceil(e)}function iX(e,t){return e=RM(e),ge(Tl.count(go(e),e)+(go(e).getUTCDay()===4),t,2)}function oX(e){return e.getUTCDay()}function sX(e,t){return ge(Ed.count(go(e)-1,e),t,2)}function aX(e,t){return ge(e.getUTCFullYear()%100,t,2)}function lX(e,t){return e=RM(e),ge(e.getUTCFullYear()%100,t,2)}function cX(e,t){return ge(e.getUTCFullYear()%1e4,t,4)}function uX(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Tl(e):Tl.ceil(e),ge(e.getUTCFullYear()%1e4,t,4)}function hX(){return"+0000"}function rP(){return"%"}function iP(e){return+e}function oP(e){return Math.floor(+e/1e3)}var Va,LM,NM;fX({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function fX(e){return Va=fK(e),LM=Va.format,Va.parse,NM=Va.utcFormat,Va.utcParse,Va}function dX(e){return new Date(e)}function pX(e){return e instanceof Date?+e:+new Date(+e)}function rx(e,t,n,r,i,o,s,l,c,h){var u=V0(),f=u.invert,m=u.domain,y=h(".%L"),x=h(":%S"),p=h("%I:%M"),b=h("%I %p"),P=h("%a %d"),S=h("%b %d"),A=h("%B"),E=h("%Y");function w(T){return(c(T)<T?y:l(T)<T?x:s(T)<T?p:o(T)<T?b:r(T)<T?i(T)<T?P:S:n(T)<T?A:E)(T)}return u.invert=function(T){return new Date(f(T))},u.domain=function(T){return arguments.length?m(Array.from(T,pX)):m().map(dX)},u.ticks=function(T){var O=m();return e(O[0],O[O.length-1],T??10)},u.tickFormat=function(T,O){return O==null?w:h(O)},u.nice=function(T){var O=m();return(!T||typeof T.range!="function")&&(T=t(O[0],O[O.length-1],T??10)),T?m(_M(O,T)):u},u.copy=function(){return _h(u,rx(e,t,n,r,i,o,s,l,c,h))},u}function mX(){return Fr.apply(rx(uK,hK,mo,ex,Gp,Sh,Q0,X0,Js,LM).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function gX(){return Fr.apply(rx(lK,cK,go,nx,Zp,qp,tx,J0,Js,NM).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Yp(){var e=0,t=1,n,r,i,o,s=Xn,l=!1,c;function h(f){return f==null||isNaN(f=+f)?c:s(i===0?.5:(f=(o(f)-n)*i,l?Math.max(0,Math.min(1,f)):f))}h.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),h):[e,t]},h.clamp=function(f){return arguments.length?(l=!!f,h):l},h.interpolator=function(f){return arguments.length?(s=f,h):s};function u(f){return function(m){var y,x;return arguments.length?([y,x]=m,s=f(y,x),h):[s(0),s(1)]}}return h.range=u(uc),h.rangeRound=u(W0),h.unknown=function(f){return arguments.length?(c=f,h):c},function(f){return o=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),h}}function us(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function jM(){var e=cs(Yp()(Xn));return e.copy=function(){return us(e,jM())},xo.apply(e,arguments)}function DM(){var e=q0(Yp()).domain([1,10]);return e.copy=function(){return us(e,DM()).base(e.base())},xo.apply(e,arguments)}function BM(){var e=G0(Yp());return e.copy=function(){return us(e,BM()).constant(e.constant())},xo.apply(e,arguments)}function ix(){var e=Z0(Yp());return e.copy=function(){return us(e,ix()).exponent(e.exponent())},xo.apply(e,arguments)}function yX(){return ix.apply(null,arguments).exponent(.5)}function zM(){var e=[],t=Xn;function n(r){if(r!=null&&!isNaN(r=+r))return t((xh(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Xo),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>rY(e,o/r))},n.copy=function(){return zM(t).domain(e)},xo.apply(n,arguments)}function Kp(){var e=0,t=.5,n=1,r=1,i,o,s,l,c,h=Xn,u,f=!1,m;function y(p){return isNaN(p=+p)?m:(p=.5+((p=+u(p))-o)*(r*p<r*o?l:c),h(f?Math.max(0,Math.min(1,p)):p))}y.domain=function(p){return arguments.length?([e,t,n]=p,i=u(e=+e),o=u(t=+t),s=u(n=+n),l=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,y):[e,t,n]},y.clamp=function(p){return arguments.length?(f=!!p,y):f},y.interpolator=function(p){return arguments.length?(h=p,y):h};function x(p){return function(b){var P,S,A;return arguments.length?([P,S,A]=b,h=OY(p,[P,S,A]),y):[h(0),h(.5),h(1)]}}return y.range=x(uc),y.rangeRound=x(W0),y.unknown=function(p){return arguments.length?(m=p,y):m},function(p){return u=p,i=p(e),o=p(t),s=p(n),l=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,y}}function FM(){var e=cs(Kp()(Xn));return e.copy=function(){return us(e,FM())},xo.apply(e,arguments)}function WM(){var e=q0(Kp()).domain([.1,1,10]);return e.copy=function(){return us(e,WM()).base(e.base())},xo.apply(e,arguments)}function VM(){var e=G0(Kp());return e.copy=function(){return us(e,VM()).constant(e.constant())},xo.apply(e,arguments)}function ox(){var e=Z0(Kp());return e.copy=function(){return us(e,ox()).exponent(e.exponent())},xo.apply(e,arguments)}function vX(){return ox.apply(null,arguments).exponent(.5)}const sP=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:ju,scaleDiverging:FM,scaleDivergingLog:WM,scaleDivergingPow:ox,scaleDivergingSqrt:vX,scaleDivergingSymlog:VM,scaleIdentity:wM,scaleImplicit:iv,scaleLinear:Pd,scaleLog:SM,scaleOrdinal:B0,scalePoint:hu,scalePow:Y0,scaleQuantile:TM,scaleQuantize:EM,scaleRadial:AM,scaleSequential:jM,scaleSequentialLog:DM,scaleSequentialPow:ix,scaleSequentialQuantile:zM,scaleSequentialSqrt:yX,scaleSequentialSymlog:BM,scaleSqrt:JY,scaleSymlog:PM,scaleThreshold:CM,scaleTime:mX,scaleUtc:gX,tickFormat:xM},Symbol.toStringTag,{value:"Module"}));var bX=ec;function xX(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],s=t(o);if(s!=null&&(l===void 0?s===s&&!bX(s):n(s,l)))var l=s,c=o}return c}var Xp=xX;function wX(e,t){return e>t}var UM=wX,_X=Xp,SX=UM,PX=cc;function AX(e){return e&&e.length?_X(e,PX,SX):void 0}var TX=AX;const Go=Me(TX);function EX(e,t){return e<t}var HM=EX,CX=Xp,OX=HM,MX=cc;function kX(e){return e&&e.length?CX(e,MX,OX):void 0}var $X=kX;const Jp=Me($X);var IX=_0,RX=Ei,LX=tM,NX=dr;function jX(e,t){var n=NX(e)?IX:LX;return n(e,RX(t))}var DX=jX,BX=JO,zX=DX;function FX(e,t){return BX(zX(e,t),1)}var WX=FX;const VX=Me(WX);var UX=R0;function HX(e,t){return UX(e,t)}var qX=HX;const pa=Me(qX);var hc=1e9,GX={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},ax,Ye=!0,zr="[DecimalError] ",oa=zr+"Invalid argument: ",sx=zr+"Exponent out of range: ",fc=Math.floor,qs=Math.pow,ZX=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,xr,Sn=1e7,Ve=7,qM=9007199254740991,Cd=fc(qM/Ve),Mt={};Mt.absoluteValue=Mt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Mt.comparedTo=Mt.cmp=function(e){var t,n,r,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(r=o.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};Mt.decimalPlaces=Mt.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Ve;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Mt.dividedBy=Mt.div=function(e){return co(this,new this.constructor(e))};Mt.dividedToIntegerBy=Mt.idiv=function(e){var t=this,n=t.constructor;return Re(co(t,new n(e),0,1),n.precision)};Mt.equals=Mt.eq=function(e){return!this.cmp(e)};Mt.exponent=function(){return mn(this)};Mt.greaterThan=Mt.gt=function(e){return this.cmp(e)>0};Mt.greaterThanOrEqualTo=Mt.gte=function(e){return this.cmp(e)>=0};Mt.isInteger=Mt.isint=function(){return this.e>this.d.length-2};Mt.isNegative=Mt.isneg=function(){return this.s<0};Mt.isPositive=Mt.ispos=function(){return this.s>0};Mt.isZero=function(){return this.s===0};Mt.lessThan=Mt.lt=function(e){return this.cmp(e)<0};Mt.lessThanOrEqualTo=Mt.lte=function(e){return this.cmp(e)<1};Mt.logarithm=Mt.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(xr))throw Error(zr+"NaN");if(n.s<1)throw Error(zr+(n.s?"NaN":"-Infinity"));return n.eq(xr)?new r(0):(Ye=!1,t=co(Wu(n,o),Wu(e,o),o),Ye=!0,Re(t,i))};Mt.minus=Mt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?YM(t,e):GM(t,(e.s=-e.s,e))};Mt.modulo=Mt.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(zr+"NaN");return n.s?(Ye=!1,t=co(n,e,0,1).times(e),Ye=!0,n.minus(t)):Re(new r(n),i)};Mt.naturalExponential=Mt.exp=function(){return ZM(this)};Mt.naturalLogarithm=Mt.ln=function(){return Wu(this)};Mt.negated=Mt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Mt.plus=Mt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?GM(t,e):YM(t,(e.s=-e.s,e))};Mt.precision=Mt.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(oa+e);if(t=mn(i)+1,r=i.d.length-1,n=r*Ve+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Mt.squareRoot=Mt.sqrt=function(){var e,t,n,r,i,o,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(zr+"NaN")}for(e=mn(l),Ye=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=yi(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=fc((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=s=n+3;;)if(o=r,r=o.plus(co(l,o,s+2)).times(.5),yi(o.d).slice(0,s)===(t=yi(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(Re(o,n+1,0),o.times(o).eq(l)){r=o;break}}else if(t!="9999")break;s+=4}return Ye=!0,Re(r,n)};Mt.times=Mt.mul=function(e){var t,n,r,i,o,s,l,c,h,u=this,f=u.constructor,m=u.d,y=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,n=u.e+e.e,c=m.length,h=y.length,c<h&&(o=m,m=y,y=o,s=c,c=h,h=s),o=[],s=c+h,r=s;r--;)o.push(0);for(r=h;--r>=0;){for(t=0,i=c+r;i>r;)l=o[i]+y[r]*m[i-r-1]+t,o[i--]=l%Sn|0,t=l/Sn|0;o[i]=(o[i]+t)%Sn|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,Ye?Re(e,f.precision):e};Mt.toDecimalPlaces=Mt.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ai(e,0,hc),t===void 0?t=r.rounding:Ai(t,0,8),Re(n,e+mn(n)+1,t))};Mt.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=ma(r,!0):(Ai(e,0,hc),t===void 0?t=i.rounding:Ai(t,0,8),r=Re(new i(r),e+1,t),n=ma(r,!0,e+1)),n};Mt.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?ma(i):(Ai(e,0,hc),t===void 0?t=o.rounding:Ai(t,0,8),r=Re(new o(i),e+mn(i)+1,t),n=ma(r.abs(),!1,e+mn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Mt.toInteger=Mt.toint=function(){var e=this,t=e.constructor;return Re(new t(e),mn(e)+1,t.rounding)};Mt.toNumber=function(){return+this};Mt.toPower=Mt.pow=function(e){var t,n,r,i,o,s,l=this,c=l.constructor,h=12,u=+(e=new c(e));if(!e.s)return new c(xr);if(l=new c(l),!l.s){if(e.s<1)throw Error(zr+"Infinity");return l}if(l.eq(xr))return l;if(r=c.precision,e.eq(xr))return Re(l,r);if(t=e.e,n=e.d.length-1,s=t>=n,o=l.s,s){if((n=u<0?-u:u)<=qM){for(i=new c(xr),t=Math.ceil(r/Ve+4),Ye=!1;n%2&&(i=i.times(l),lP(i.d,t)),n=fc(n/2),n!==0;)l=l.times(l),lP(l.d,t);return Ye=!0,e.s<0?new c(xr).div(i):Re(i,r)}}else if(o<0)throw Error(zr+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Ye=!1,i=e.times(Wu(l,r+h)),Ye=!0,i=ZM(i),i.s=o,i};Mt.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?(n=mn(i),r=ma(i,n<=o.toExpNeg||n>=o.toExpPos)):(Ai(e,1,hc),t===void 0?t=o.rounding:Ai(t,0,8),i=Re(new o(i),e,t),n=mn(i),r=ma(i,e<=n||n<=o.toExpNeg,e)),r};Mt.toSignificantDigits=Mt.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ai(e,1,hc),t===void 0?t=r.rounding:Ai(t,0,8)),Re(new r(n),e,t)};Mt.toString=Mt.valueOf=Mt.val=Mt.toJSON=Mt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=mn(e),n=e.constructor;return ma(e,t<=n.toExpNeg||t>=n.toExpPos)};function GM(e,t){var n,r,i,o,s,l,c,h,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),Ye?Re(t,f):t;if(c=e.d,h=t.d,s=e.e,i=t.e,c=c.slice(),o=s-i,o){for(o<0?(r=c,o=-o,l=h.length):(r=h,i=s,l=c.length),s=Math.ceil(f/Ve),l=s>l?s+1:l+1,o>l&&(o=l,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(l=c.length,o=h.length,l-o<0&&(o=l,r=h,h=c,c=r),n=0;o;)n=(c[--o]=c[o]+h[o]+n)/Sn|0,c[o]%=Sn;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,Ye?Re(t,f):t}function Ai(e,t,n){if(e!==~~e||e<t||e>n)throw Error(oa+e)}function yi(e){var t,n,r,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)r=e[t]+"",n=Ve-r.length,n&&(o+=Wo(n)),o+=r;s=e[t],r=s+"",n=Ve-r.length,n&&(o+=Wo(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}var co=function(){function e(r,i){var o,s=0,l=r.length;for(r=r.slice();l--;)o=r[l]*i+s,r[l]=o%Sn|0,s=o/Sn|0;return s&&r.unshift(s),r}function t(r,i,o,s){var l,c;if(o!=s)c=o>s?1:-1;else for(l=c=0;l<o;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,o){for(var s=0;o--;)r[o]-=s,s=r[o]<i[o]?1:0,r[o]=s*Sn+r[o]-i[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,o,s){var l,c,h,u,f,m,y,x,p,b,P,S,A,E,w,T,O,R,N=r.constructor,V=r.s==i.s?1:-1,D=r.d,j=i.d;if(!r.s)return new N(r);if(!i.s)throw Error(zr+"Division by zero");for(c=r.e-i.e,O=j.length,w=D.length,y=new N(V),x=y.d=[],h=0;j[h]==(D[h]||0);)++h;if(j[h]>(D[h]||0)&&--c,o==null?S=o=N.precision:s?S=o+(mn(r)-mn(i))+1:S=o,S<0)return new N(0);if(S=S/Ve+2|0,h=0,O==1)for(u=0,j=j[0],S++;(h<w||u)&&S--;h++)A=u*Sn+(D[h]||0),x[h]=A/j|0,u=A%j|0;else{for(u=Sn/(j[0]+1)|0,u>1&&(j=e(j,u),D=e(D,u),O=j.length,w=D.length),E=O,p=D.slice(0,O),b=p.length;b<O;)p[b++]=0;R=j.slice(),R.unshift(0),T=j[0],j[1]>=Sn/2&&++T;do u=0,l=t(j,p,O,b),l<0?(P=p[0],O!=b&&(P=P*Sn+(p[1]||0)),u=P/T|0,u>1?(u>=Sn&&(u=Sn-1),f=e(j,u),m=f.length,b=p.length,l=t(f,p,m,b),l==1&&(u--,n(f,O<m?R:j,m))):(u==0&&(l=u=1),f=j.slice()),m=f.length,m<b&&f.unshift(0),n(p,f,b),l==-1&&(b=p.length,l=t(j,p,O,b),l<1&&(u++,n(p,O<b?R:j,b))),b=p.length):l===0&&(u++,p=[0]),x[h++]=u,l&&p[0]?p[b++]=D[E]||0:(p=[D[E]],b=1);while((E++<w||p[0]!==void 0)&&S--)}return x[0]||x.shift(),y.e=c,Re(y,s?o+mn(y)+1:o)}}();function ZM(e,t){var n,r,i,o,s,l,c=0,h=0,u=e.constructor,f=u.precision;if(mn(e)>16)throw Error(sx+mn(e));if(!e.s)return new u(xr);for(Ye=!1,l=f,s=new u(.03125);e.abs().gte(.1);)e=e.times(s),h+=5;for(r=Math.log(qs(2,h))/Math.LN10*2+5|0,l+=r,n=i=o=new u(xr),u.precision=l;;){if(i=Re(i.times(e),l),n=n.times(++c),s=o.plus(co(i,n,l)),yi(s.d).slice(0,l)===yi(o.d).slice(0,l)){for(;h--;)o=Re(o.times(o),l);return u.precision=f,t==null?(Ye=!0,Re(o,f)):o}o=s}}function mn(e){for(var t=e.e*Ve,n=e.d[0];n>=10;n/=10)t++;return t}function Cg(e,t,n){if(t>e.LN10.sd())throw Ye=!0,n&&(e.precision=n),Error(zr+"LN10 precision limit exceeded");return Re(new e(e.LN10),t)}function Wo(e){for(var t="";e--;)t+="0";return t}function Wu(e,t){var n,r,i,o,s,l,c,h,u,f=1,m=10,y=e,x=y.d,p=y.constructor,b=p.precision;if(y.s<1)throw Error(zr+(y.s?"NaN":"-Infinity"));if(y.eq(xr))return new p(0);if(t==null?(Ye=!1,h=b):h=t,y.eq(10))return t==null&&(Ye=!0),Cg(p,h);if(h+=m,p.precision=h,n=yi(x),r=n.charAt(0),o=mn(y),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)y=y.times(e),n=yi(y.d),r=n.charAt(0),f++;o=mn(y),r>1?(y=new p("0."+n),o++):y=new p(r+"."+n.slice(1))}else return c=Cg(p,h+2,b).times(o+""),y=Wu(new p(r+"."+n.slice(1)),h-m).plus(c),p.precision=b,t==null?(Ye=!0,Re(y,b)):y;for(l=s=y=co(y.minus(xr),y.plus(xr),h),u=Re(y.times(y),h),i=3;;){if(s=Re(s.times(u),h),c=l.plus(co(s,new p(i),h)),yi(c.d).slice(0,h)===yi(l.d).slice(0,h))return l=l.times(2),o!==0&&(l=l.plus(Cg(p,h+2,b).times(o+""))),l=co(l,new p(f),h),p.precision=b,t==null?(Ye=!0,Re(l,b)):l;l=c,i+=2}}function aP(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=fc(n/Ve),e.d=[],r=(n+1)%Ve,n<0&&(r+=Ve),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Ve;r<i;)e.d.push(+t.slice(r,r+=Ve));t=t.slice(r),r=Ve-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Ye&&(e.e>Cd||e.e<-Cd))throw Error(sx+n)}else e.s=0,e.e=0,e.d=[0];return e}function Re(e,t,n){var r,i,o,s,l,c,h,u,f=e.d;for(s=1,o=f[0];o>=10;o/=10)s++;if(r=t-s,r<0)r+=Ve,i=t,h=f[u=0];else{if(u=Math.ceil((r+1)/Ve),o=f.length,u>=o)return e;for(h=o=f[u],s=1;o>=10;o/=10)s++;r%=Ve,i=r-Ve+s}if(n!==void 0&&(o=qs(10,s-i-1),l=h/o%10|0,c=t<0||f[u+1]!==void 0||h%o,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?h/qs(10,s-i):0:f[u-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(o=mn(e),f.length=1,t=t-o-1,f[0]=qs(10,(Ve-t%Ve)%Ve),e.e=fc(-t/Ve)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=u,o=1,u--):(f.length=u+1,o=qs(10,Ve-r),f[u]=i>0?(h/qs(10,s-i)%qs(10,i)|0)*o:0),c)for(;;)if(u==0){(f[0]+=o)==Sn&&(f[0]=1,++e.e);break}else{if(f[u]+=o,f[u]!=Sn)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(Ye&&(e.e>Cd||e.e<-Cd))throw Error(sx+mn(e));return e}function YM(e,t){var n,r,i,o,s,l,c,h,u,f,m=e.constructor,y=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),Ye?Re(t,y):t;if(c=e.d,f=t.d,r=t.e,h=e.e,c=c.slice(),s=h-r,s){for(u=s<0,u?(n=c,s=-s,l=f.length):(n=f,r=h,l=c.length),i=Math.max(Math.ceil(y/Ve),l)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=f.length,u=i<l,u&&(l=i),i=0;i<l;i++)if(c[i]!=f[i]){u=c[i]<f[i];break}s=0}for(u&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,i=f.length-l;i>0;--i)c[l++]=0;for(i=f.length;i>s;){if(c[--i]<f[i]){for(o=i;o&&c[--o]===0;)c[o]=Sn-1;--c[o],c[i]+=Sn}c[i]-=f[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Ye?Re(t,y):t):new m(0)}function ma(e,t,n){var r,i=mn(e),o=yi(e.d),s=o.length;return t?(n&&(r=n-s)>0?o=o.charAt(0)+"."+o.slice(1)+Wo(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Wo(-i-1)+o,n&&(r=n-s)>0&&(o+=Wo(r))):i>=s?(o+=Wo(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+Wo(r))):((r=i+1)<s&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(o+="."),o+=Wo(r))),e.s<0?"-"+o:o}function lP(e,t){if(e.length>t)return e.length=t,!0}function KM(e){var t,n,r;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(oa+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return aP(s,o.toString())}else if(typeof o!="string")throw Error(oa+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,ZX.test(o))aP(s,o);else throw Error(oa+o)}if(i.prototype=Mt,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=KM,i.config=i.set=YX,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function YX(e){if(!e||typeof e!="object")throw Error(zr+"Object expected");var t,n,r,i=["precision",1,hc,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(fc(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(oa+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(oa+n+": "+r);return this}var ax=KM(GX);xr=new ax(1);const Oe=ax;function KX(e){return tJ(e)||QX(e)||JX(e)||XX()}function XX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
45
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FZ(e,t){if(e){if(typeof e=="string")return xS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xS(e,t)}}function xS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function WZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function VZ(e){if(Array.isArray(e))return e}var uM=/[ \f\n\r\t\v\u2028\u2029]+/,hM=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var o=[];Ut(n)||(r?o=n.toString().split(""):o=n.toString().split(uM));var s=o.map(function(c){return{word:c,width:uu(c,i).width}}),l=r?0:uu(" ",i).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}},UZ=function(t,n,r,i,o){var s=t.maxLines,l=t.children,c=t.style,h=t.breakAll,u=xt(s),f=l,m=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return z.reduce(function(Y,G){var J=G.word,lt=G.width,q=Y[Y.length-1];if(q&&(i==null||o||q.width+lt+r<Number(i)))q.words.push(J),q.width+=lt+r;else{var nt={words:[J],width:lt};Y.push(nt)}return Y},[])},y=m(n),x=function(z){return z.reduce(function(Y,G){return Y.width>G.width?Y:G})};if(!u)return y;for(var p="…",b=function(z){var Y=f.slice(0,z),G=hM({breakAll:h,style:c,children:Y+p}).wordsWithComputedWidth,J=m(G),lt=J.length>s||x(J).width>Number(i);return[lt,J]},P=0,S=f.length-1,A=0,E;P<=S&&A<=f.length-1;){var w=Math.floor((P+S)/2),T=w-1,O=b(T),R=bS(O,2),N=R[0],V=R[1],D=b(w),j=bS(D,1),K=j[0];if(!N&&!K&&(P=w+1),N&&K&&(S=w-1),!N&&K){E=V;break}A++}return E||y},wS=function(t){var n=Ut(t)?[]:t.toString().split(uM);return[{words:n}]},HZ=function(t){var n=t.width,r=t.scaleToFit,i=t.children,o=t.style,s=t.breakAll,l=t.maxLines;if((n||r)&&!ls.isSsr){var c,h,u=hM({breakAll:s,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,m=u.spaceWidth;c=f,h=m}else return wS(i);return UZ({breakAll:s,children:i,maxLines:l,style:o},c,h,n,r)}return wS(i)},_S="#808080",da=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,s=t.lineHeight,l=s===void 0?"1em":s,c=t.capHeight,h=c===void 0?"0.71em":c,u=t.scaleToFit,f=u===void 0?!1:u,m=t.textAnchor,y=m===void 0?"start":m,x=t.verticalAnchor,p=x===void 0?"end":x,b=t.fill,P=b===void 0?_S:b,S=vS(t,jZ),A=v.useMemo(function(){return HZ({breakAll:S.breakAll,children:S.children,maxLines:S.maxLines,scaleToFit:f,style:S.style,width:S.width})},[S.breakAll,S.children,S.maxLines,f,S.style,S.width]),E=S.dx,w=S.dy,T=S.angle,O=S.className,R=S.breakAll,N=vS(S,DZ);if(!xn(r)||!xn(o))return null;var V=r+(xt(E)?E:0),D=o+(xt(w)?w:0),j;switch(p){case"start":j=xg("calc(".concat(h,")"));break;case"middle":j=xg("calc(".concat((A.length-1)/2," * -").concat(l," + (").concat(h," / 2))"));break;default:j=xg("calc(".concat(A.length-1," * -").concat(l,")"));break}var K=[];if(f){var H=A[0].width,z=S.width;K.push("scale(".concat((xt(z)?z/H:1)/H,")"))}return T&&K.push("rotate(".concat(T,", ").concat(V,", ").concat(D,")")),K.length&&(N.transform=K.join(" ")),v.createElement("text",tv({},Lt(N,!0),{x:V,y:D,className:Jt("recharts-text",O),textAnchor:y,fill:P.includes("url")?_S:P}),A.map(function(Y,G){var J=Y.words.join(R?"":" ");return v.createElement("tspan",{x:V,dy:G===0?j:l,key:"".concat(J,"-").concat(G)},J)}))};function Xo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function qZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function D0(e){let t,n,r;e.length!==2?(t=Xo,n=(l,c)=>Xo(e(l),c),r=(l,c)=>e(l)-c):(t=e===Xo||e===qZ?e:GZ,n=e,r=e);function i(l,c,h=0,u=l.length){if(h<u){if(t(c,c)!==0)return u;do{const f=h+u>>>1;n(l[f],c)<0?h=f+1:u=f}while(h<u)}return h}function o(l,c,h=0,u=l.length){if(h<u){if(t(c,c)!==0)return u;do{const f=h+u>>>1;n(l[f],c)<=0?h=f+1:u=f}while(h<u)}return h}function s(l,c,h=0,u=l.length){const f=i(l,c,h,u-1);return f>h&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:i,center:s,right:o}}function GZ(){return 0}function fM(e){return e===null?NaN:+e}function*ZZ(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const YZ=D0(Xo),xh=YZ.right;D0(fM).center;class SS extends Map{constructor(t,n=JZ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(PS(this,t))}has(t){return super.has(PS(this,t))}set(t,n){return super.set(KZ(this,t),n)}delete(t){return super.delete(XZ(this,t))}}function PS({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function KZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function XZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function JZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function QZ(e=Xo){if(e===Xo)return dM;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function dM(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const tY=Math.sqrt(50),eY=Math.sqrt(10),nY=Math.sqrt(2);function yd(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=tY?10:o>=eY?5:o>=nY?2:1;let l,c,h;return i<0?(h=Math.pow(10,-i)/s,l=Math.round(e*h),c=Math.round(t*h),l/h<e&&++l,c/h>t&&--c,h=-h):(h=Math.pow(10,i)*s,l=Math.round(e/h),c=Math.round(t/h),l*h<e&&++l,c*h>t&&--c),c<l&&.5<=n&&n<2?yd(e,t,n*2):[l,c,h]}function ev(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,s]=r?yd(t,e,n):yd(e,t,n);if(!(o>=i))return[];const l=o-i+1,c=new Array(l);if(r)if(s<0)for(let h=0;h<l;++h)c[h]=(o-h)/-s;else for(let h=0;h<l;++h)c[h]=(o-h)*s;else if(s<0)for(let h=0;h<l;++h)c[h]=(i+h)/-s;else for(let h=0;h<l;++h)c[h]=(i+h)*s;return c}function nv(e,t,n){return t=+t,e=+e,n=+n,yd(e,t,n)[2]}function rv(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?nv(t,e,n):nv(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function AS(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function TS(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function pM(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?dM:QZ(i);r>n;){if(r-n>600){const c=r-n+1,h=t-n+1,u=Math.log(c),f=.5*Math.exp(2*u/3),m=.5*Math.sqrt(u*f*(c-f)/c)*(h-c/2<0?-1:1),y=Math.max(n,Math.floor(t-h*f/c+m)),x=Math.min(r,Math.floor(t+(c-h)*f/c+m));pM(e,t,y,x,i)}const o=e[t];let s=n,l=r;for(Fc(e,n,t),i(e[r],o)>0&&Fc(e,n,r);s<l;){for(Fc(e,s,l),++s,--l;i(e[s],o)<0;)++s;for(;i(e[l],o)>0;)--l}i(e[n],o)===0?Fc(e,n,l):(++l,Fc(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Fc(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function rY(e,t,n){if(e=Float64Array.from(ZZ(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return TS(e);if(t>=1)return AS(e);var r,i=(r-1)*t,o=Math.floor(i),s=AS(pM(e,o).subarray(0,o+1)),l=TS(e.subarray(o+1));return s+(l-s)*(i-o)}}function iY(e,t,n=fM){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),s=+n(e[o],o,e),l=+n(e[o+1],o+1,e);return s+(l-s)*(i-o)}}function oY(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function Fr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function xo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const iv=Symbol("implicit");function B0(){var e=new SS,t=[],n=[],r=iv;function i(o){let s=e.get(o);if(s===void 0){if(r!==iv)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new SS;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return B0(t,n).unknown(r)},Fr.apply(i,arguments),i}function ju(){var e=B0().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,l=!1,c=0,h=0,u=.5;delete e.unknown;function f(){var m=t().length,y=i<r,x=y?i:r,p=y?r:i;o=(p-x)/Math.max(1,m-c+h*2),l&&(o=Math.floor(o)),x+=(p-x-o*(m-c))*u,s=o*(1-c),l&&(x=Math.round(x),s=Math.round(s));var b=oY(m).map(function(P){return x+o*P});return n(y?b.reverse():b)}return e.domain=function(m){return arguments.length?(t(m),f()):t()},e.range=function(m){return arguments.length?([r,i]=m,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(m){return[r,i]=m,r=+r,i=+i,l=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(m){return arguments.length?(l=!!m,f()):l},e.padding=function(m){return arguments.length?(c=Math.min(1,h=+m),f()):c},e.paddingInner=function(m){return arguments.length?(c=Math.min(1,m),f()):c},e.paddingOuter=function(m){return arguments.length?(h=+m,f()):h},e.align=function(m){return arguments.length?(u=Math.max(0,Math.min(1,m)),f()):u},e.copy=function(){return ju(t(),[r,i]).round(l).paddingInner(c).paddingOuter(h).align(u)},Fr.apply(f(),arguments)}function mM(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return mM(t())},e}function hu(){return mM(ju.apply(null,arguments).paddingInner(1))}function z0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function gM(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function wh(){}var Du=.7,vd=1/Du,cl="\\s*([+-]?\\d+)\\s*",Bu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_i="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sY=/^#([0-9a-f]{3,8})$/,aY=new RegExp(`^rgb\\(${cl},${cl},${cl}\\)$`),lY=new RegExp(`^rgb\\(${_i},${_i},${_i}\\)$`),cY=new RegExp(`^rgba\\(${cl},${cl},${cl},${Bu}\\)$`),uY=new RegExp(`^rgba\\(${_i},${_i},${_i},${Bu}\\)$`),hY=new RegExp(`^hsl\\(${Bu},${_i},${_i}\\)$`),fY=new RegExp(`^hsla\\(${Bu},${_i},${_i},${Bu}\\)$`),ES={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};z0(wh,zu,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:CS,formatHex:CS,formatHex8:dY,formatHsl:pY,formatRgb:OS,toString:OS});function CS(){return this.rgb().formatHex()}function dY(){return this.rgb().formatHex8()}function pY(){return yM(this).formatHsl()}function OS(){return this.rgb().formatRgb()}function zu(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sY.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?MS(t):n===3?new ar(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_f(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_f(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=aY.exec(e))?new ar(t[1],t[2],t[3],1):(t=lY.exec(e))?new ar(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cY.exec(e))?_f(t[1],t[2],t[3],t[4]):(t=uY.exec(e))?_f(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=hY.exec(e))?IS(t[1],t[2]/100,t[3]/100,1):(t=fY.exec(e))?IS(t[1],t[2]/100,t[3]/100,t[4]):ES.hasOwnProperty(e)?MS(ES[e]):e==="transparent"?new ar(NaN,NaN,NaN,0):null}function MS(e){return new ar(e>>16&255,e>>8&255,e&255,1)}function _f(e,t,n,r){return r<=0&&(e=t=n=NaN),new ar(e,t,n,r)}function mY(e){return e instanceof wh||(e=zu(e)),e?(e=e.rgb(),new ar(e.r,e.g,e.b,e.opacity)):new ar}function ov(e,t,n,r){return arguments.length===1?mY(e):new ar(e,t,n,r??1)}function ar(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}z0(ar,ov,gM(wh,{brighter(e){return e=e==null?vd:Math.pow(vd,e),new ar(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Du:Math.pow(Du,e),new ar(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ar(ia(this.r),ia(this.g),ia(this.b),bd(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:kS,formatHex:kS,formatHex8:gY,formatRgb:$S,toString:$S}));function kS(){return`#${Xs(this.r)}${Xs(this.g)}${Xs(this.b)}`}function gY(){return`#${Xs(this.r)}${Xs(this.g)}${Xs(this.b)}${Xs((isNaN(this.opacity)?1:this.opacity)*255)}`}function $S(){const e=bd(this.opacity);return`${e===1?"rgb(":"rgba("}${ia(this.r)}, ${ia(this.g)}, ${ia(this.b)}${e===1?")":`, ${e})`}`}function bd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ia(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xs(e){return e=ia(e),(e<16?"0":"")+e.toString(16)}function IS(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qr(e,t,n,r)}function yM(e){if(e instanceof Qr)return new Qr(e.h,e.s,e.l,e.opacity);if(e instanceof wh||(e=zu(e)),!e)return new Qr;if(e instanceof Qr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,l=o-i,c=(o+i)/2;return l?(t===o?s=(n-r)/l+(n<r)*6:n===o?s=(r-t)/l+2:s=(t-n)/l+4,l/=c<.5?o+i:2-o-i,s*=60):l=c>0&&c<1?0:s,new Qr(s,l,c,e.opacity)}function yY(e,t,n,r){return arguments.length===1?yM(e):new Qr(e,t,n,r??1)}function Qr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}z0(Qr,yY,gM(wh,{brighter(e){return e=e==null?vd:Math.pow(vd,e),new Qr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Du:Math.pow(Du,e),new Qr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ar(wg(e>=240?e-240:e+120,i,r),wg(e,i,r),wg(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Qr(RS(this.h),Sf(this.s),Sf(this.l),bd(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=bd(this.opacity);return`${e===1?"hsl(":"hsla("}${RS(this.h)}, ${Sf(this.s)*100}%, ${Sf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function RS(e){return e=(e||0)%360,e<0?e+360:e}function Sf(e){return Math.max(0,Math.min(1,e||0))}function wg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const F0=e=>()=>e;function vY(e,t){return function(n){return e+n*t}}function bY(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function xY(e){return(e=+e)==1?vM:function(t,n){return n-t?bY(t,n,e):F0(isNaN(t)?n:t)}}function vM(e,t){var n=t-e;return n?vY(e,n):F0(isNaN(e)?t:e)}const LS=function e(t){var n=xY(t);function r(i,o){var s=n((i=ov(i)).r,(o=ov(o)).r),l=n(i.g,o.g),c=n(i.b,o.b),h=vM(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=l(u),i.b=c(u),i.opacity=h(u),i+""}}return r.gamma=e,r}(1);function wY(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function _Y(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function SY(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=uc(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(l){for(s=0;s<r;++s)o[s]=i[s](l);return o}}function PY(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function xd(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function AY(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=uc(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var sv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_g=new RegExp(sv.source,"g");function TY(e){return function(){return e}}function EY(e){return function(t){return e(t)+""}}function CY(e,t){var n=sv.lastIndex=_g.lastIndex=0,r,i,o,s=-1,l=[],c=[];for(e=e+"",t=t+"";(r=sv.exec(e))&&(i=_g.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),l[s]?l[s]+=o:l[++s]=o),(r=r[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,c.push({i:s,x:xd(r,i)})),n=_g.lastIndex;return n<t.length&&(o=t.slice(n),l[s]?l[s]+=o:l[++s]=o),l.length<2?c[0]?EY(c[0].x):TY(t):(t=c.length,function(h){for(var u=0,f;u<t;++u)l[(f=c[u]).i]=f.x(h);return l.join("")})}function uc(e,t){var n=typeof t,r;return t==null||n==="boolean"?F0(t):(n==="number"?xd:n==="string"?(r=zu(t))?(t=r,LS):CY:t instanceof zu?LS:t instanceof Date?PY:_Y(t)?wY:Array.isArray(t)?SY:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?AY:xd)(e,t)}function W0(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function OY(e,t){t===void 0&&(t=e,e=uc);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(s){var l=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return o[l](s-l)}}function MY(e){return function(){return e}}function wd(e){return+e}var NS=[0,1];function Xn(e){return e}function av(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:MY(isNaN(t)?NaN:.5)}function kY(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function $Y(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=av(i,r),o=n(s,o)):(r=av(r,i),o=n(o,s)),function(l){return o(r(l))}}function IY(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=av(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(l){var c=xh(e,l,1,r)-1;return o[c](i[c](l))}}function _h(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Hp(){var e=NS,t=NS,n=uc,r,i,o,s=Xn,l,c,h;function u(){var m=Math.min(e.length,t.length);return s!==Xn&&(s=kY(e[0],e[m-1])),l=m>2?IY:$Y,c=h=null,f}function f(m){return m==null||isNaN(m=+m)?o:(c||(c=l(e.map(r),t,n)))(r(s(m)))}return f.invert=function(m){return s(i((h||(h=l(t,e.map(r),xd)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,wd),u()):e.slice()},f.range=function(m){return arguments.length?(t=Array.from(m),u()):t.slice()},f.rangeRound=function(m){return t=Array.from(m),n=W0,u()},f.clamp=function(m){return arguments.length?(s=m?!0:Xn,u()):s!==Xn},f.interpolate=function(m){return arguments.length?(n=m,u()):n},f.unknown=function(m){return arguments.length?(o=m,f):o},function(m,y){return r=m,i=y,u()}}function V0(){return Hp()(Xn,Xn)}function RY(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function _d(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Pl(e){return e=_d(Math.abs(e)),e?e[1]:NaN}function LY(e,t){return function(n,r){for(var i=n.length,o=[],s=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),o.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[s=(s+1)%e.length];return o.reverse().join(t)}}function NY(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var jY=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Fu(e){if(!(t=jY.exec(e)))throw new Error("invalid format: "+e);var t;return new U0({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Fu.prototype=U0.prototype;function U0(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}U0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function DY(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Sd;function BY(e,t){var n=_d(e,t);if(!n)return Sd=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(Sd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+_d(e,Math.max(0,t+o-1))[0]}function jS(e,t){var n=_d(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const DS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:RY,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>jS(e*100,t),r:jS,s:BY,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function BS(e){return e}var zS=Array.prototype.map,FS=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function zY(e){var t=e.grouping===void 0||e.thousands===void 0?BS:LY(zS.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?BS:NY(zS.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function h(f,m){f=Fu(f);var y=f.fill,x=f.align,p=f.sign,b=f.symbol,P=f.zero,S=f.width,A=f.comma,E=f.precision,w=f.trim,T=f.type;T==="n"?(A=!0,T="g"):DS[T]||(E===void 0&&(E=12),w=!0,T="g"),(P||y==="0"&&x==="=")&&(P=!0,y="0",x="=");var O=(m&&m.prefix!==void 0?m.prefix:"")+(b==="$"?n:b==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),R=(b==="$"?r:/[%p]/.test(T)?s:"")+(m&&m.suffix!==void 0?m.suffix:""),N=DS[T],V=/[defgprs%]/.test(T);E=E===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function D(j){var K=O,H=R,z,Y,G;if(T==="c")H=N(j)+H,j="";else{j=+j;var J=j<0||1/j<0;if(j=isNaN(j)?c:N(Math.abs(j),E),w&&(j=DY(j)),J&&+j==0&&p!=="+"&&(J=!1),K=(J?p==="("?p:l:p==="-"||p==="("?"":p)+K,H=(T==="s"&&!isNaN(j)&&Sd!==void 0?FS[8+Sd/3]:"")+H+(J&&p==="("?")":""),V){for(z=-1,Y=j.length;++z<Y;)if(G=j.charCodeAt(z),48>G||G>57){H=(G===46?i+j.slice(z+1):j.slice(z))+H,j=j.slice(0,z);break}}}A&&!P&&(j=t(j,1/0));var lt=K.length+j.length+H.length,q=lt<S?new Array(S-lt+1).join(y):"";switch(A&&P&&(j=t(q+j,q.length?S-H.length:1/0),q=""),x){case"<":j=K+j+H+q;break;case"=":j=K+q+j+H;break;case"^":j=q.slice(0,lt=q.length>>1)+K+j+H+q.slice(lt);break;default:j=q+K+j+H;break}return o(j)}return D.toString=function(){return f+""},D}function u(f,m){var y=Math.max(-8,Math.min(8,Math.floor(Pl(m)/3)))*3,x=Math.pow(10,-y),p=h((f=Fu(f),f.type="f",f),{suffix:FS[8+y/3]});return function(b){return p(x*b)}}return{format:h,formatPrefix:u}}var Pf,H0,bM;FY({thousands:",",grouping:[3],currency:["$",""]});function FY(e){return Pf=zY(e),H0=Pf.format,bM=Pf.formatPrefix,Pf}function WY(e){return Math.max(0,-Pl(Math.abs(e)))}function VY(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Pl(t)/3)))*3-Pl(Math.abs(e)))}function UY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Pl(t)-Pl(e))+1}function xM(e,t,n,r){var i=rv(e,t,n),o;switch(r=Fu(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=VY(i,s))&&(r.precision=o),bM(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=UY(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=WY(i))&&(r.precision=o-(r.type==="%")*2);break}}return H0(r)}function cs(e){var t=e.domain;return e.ticks=function(n){var r=t();return ev(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return xM(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],l=r[o],c,h,u=10;for(l<s&&(h=s,s=l,l=h,h=i,i=o,o=h);u-- >0;){if(h=nv(s,l,n),h===c)return r[i]=s,r[o]=l,t(r);if(h>0)s=Math.floor(s/h)*h,l=Math.ceil(l/h)*h;else if(h<0)s=Math.ceil(s*h)/h,l=Math.floor(l*h)/h;else break;c=h}return e},e}function Pd(){var e=V0();return e.copy=function(){return _h(e,Pd())},Fr.apply(e,arguments),cs(e)}function wM(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,wd),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return wM(e).unknown(t)},e=arguments.length?Array.from(e,wd):[0,1],cs(n)}function _M(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return o<i&&(s=n,n=r,r=s,s=i,i=o,o=s),e[n]=t.floor(i),e[r]=t.ceil(o),e}function WS(e){return Math.log(e)}function VS(e){return Math.exp(e)}function HY(e){return-Math.log(-e)}function qY(e){return-Math.exp(-e)}function GY(e){return isFinite(e)?+("1e"+e):e<0?0:e}function ZY(e){return e===10?GY:e===Math.E?Math.exp:t=>Math.pow(e,t)}function YY(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function US(e){return(t,n)=>-e(-t,n)}function q0(e){const t=e(WS,VS),n=t.domain;let r=10,i,o;function s(){return i=YY(r),o=ZY(r),n()[0]<0?(i=US(i),o=US(o),e(HY,qY)):e(WS,VS),t}return t.base=function(l){return arguments.length?(r=+l,s()):r},t.domain=function(l){return arguments.length?(n(l),s()):n()},t.ticks=l=>{const c=n();let h=c[0],u=c[c.length-1];const f=u<h;f&&([h,u]=[u,h]);let m=i(h),y=i(u),x,p;const b=l==null?10:+l;let P=[];if(!(r%1)&&y-m<b){if(m=Math.floor(m),y=Math.ceil(y),h>0){for(;m<=y;++m)for(x=1;x<r;++x)if(p=m<0?x/o(-m):x*o(m),!(p<h)){if(p>u)break;P.push(p)}}else for(;m<=y;++m)for(x=r-1;x>=1;--x)if(p=m>0?x/o(-m):x*o(m),!(p<h)){if(p>u)break;P.push(p)}P.length*2<b&&(P=ev(h,u,b))}else P=ev(m,y,Math.min(y-m,b)).map(o);return f?P.reverse():P},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Fu(c)).precision==null&&(c.trim=!0),c=H0(c)),l===1/0)return c;const h=Math.max(1,r*l/t.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*r<r-.5&&(f*=r),f<=h?c(u):""}},t.nice=()=>n(_M(n(),{floor:l=>o(Math.floor(i(l))),ceil:l=>o(Math.ceil(i(l)))})),t}function SM(){const e=q0(Hp()).domain([1,10]);return e.copy=()=>_h(e,SM()).base(e.base()),Fr.apply(e,arguments),e}function HS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function qS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function G0(e){var t=1,n=e(HS(t),qS(t));return n.constant=function(r){return arguments.length?e(HS(t=+r),qS(t)):t},cs(n)}function PM(){var e=G0(Hp());return e.copy=function(){return _h(e,PM()).constant(e.constant())},Fr.apply(e,arguments)}function GS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function KY(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function XY(e){return e<0?-e*e:e*e}function Z0(e){var t=e(Xn,Xn),n=1;function r(){return n===1?e(Xn,Xn):n===.5?e(KY,XY):e(GS(n),GS(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},cs(t)}function Y0(){var e=Z0(Hp());return e.copy=function(){return _h(e,Y0()).exponent(e.exponent())},Fr.apply(e,arguments),e}function JY(){return Y0.apply(null,arguments).exponent(.5)}function ZS(e){return Math.sign(e)*e*e}function QY(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function AM(){var e=V0(),t=[0,1],n=!1,r;function i(o){var s=QY(e(o));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(o){return e.invert(ZS(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,wd)).map(ZS)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return AM(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Fr.apply(i,arguments),cs(i)}function TM(){var e=[],t=[],n=[],r;function i(){var s=0,l=Math.max(1,t.length);for(n=new Array(l-1);++s<l;)n[s-1]=iY(e,s/l);return o}function o(s){return s==null||isNaN(s=+s)?r:t[xh(n,s)]}return o.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Xo),i()},o.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},o.unknown=function(s){return arguments.length?(r=s,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return TM().domain(e).range(t).unknown(r)},Fr.apply(o,arguments)}function EM(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function s(c){return c!=null&&c<=c?i[xh(r,c,0,n)]:o}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,l()):i.slice()},s.invertExtent=function(c){var h=i.indexOf(c);return h<0?[NaN,NaN]:h<1?[e,r[0]]:h>=n?[r[n-1],t]:[r[h-1],r[h]]},s.unknown=function(c){return arguments.length&&(o=c),s},s.thresholds=function(){return r.slice()},s.copy=function(){return EM().domain([e,t]).range(i).unknown(o)},Fr.apply(cs(s),arguments)}function CM(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[xh(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return CM().domain(e).range(t).unknown(n)},Fr.apply(i,arguments)}const Sg=new Date,Pg=new Date;function wn(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),l=i.ceil(o);return o-s<l-o?s:l},i.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,l)=>{const c=[];if(o=i.ceil(o),l=l==null?1:Math.floor(l),!(o<s)||!(l>0))return c;let h;do c.push(h=new Date(+o)),t(o,l),e(o);while(h<o&&o<s);return c},i.filter=o=>wn(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!o(s););else for(;--l>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(Sg.setTime(+o),Pg.setTime(+s),e(Sg),e(Pg),Math.floor(n(Sg,Pg))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const Ad=wn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ad.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?wn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ad);Ad.range;const io=1e3,Br=io*60,oo=Br*60,po=oo*24,K0=po*7,YS=po*30,Ag=po*365,Js=wn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*io)},(e,t)=>(t-e)/io,e=>e.getUTCSeconds());Js.range;const X0=wn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*io)},(e,t)=>{e.setTime(+e+t*Br)},(e,t)=>(t-e)/Br,e=>e.getMinutes());X0.range;const J0=wn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Br)},(e,t)=>(t-e)/Br,e=>e.getUTCMinutes());J0.range;const Q0=wn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*io-e.getMinutes()*Br)},(e,t)=>{e.setTime(+e+t*oo)},(e,t)=>(t-e)/oo,e=>e.getHours());Q0.range;const tx=wn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*oo)},(e,t)=>(t-e)/oo,e=>e.getUTCHours());tx.range;const Sh=wn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Br)/po,e=>e.getDate()-1);Sh.range;const qp=wn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/po,e=>e.getUTCDate()-1);qp.range;const OM=wn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/po,e=>Math.floor(e/po));OM.range;function _a(e){return wn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Br)/K0)}const Gp=_a(0),Td=_a(1),tK=_a(2),eK=_a(3),Al=_a(4),nK=_a(5),rK=_a(6);Gp.range;Td.range;tK.range;eK.range;Al.range;nK.range;rK.range;function Sa(e){return wn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/K0)}const Zp=Sa(0),Ed=Sa(1),iK=Sa(2),oK=Sa(3),Tl=Sa(4),sK=Sa(5),aK=Sa(6);Zp.range;Ed.range;iK.range;oK.range;Tl.range;sK.range;aK.range;const ex=wn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ex.range;const nx=wn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());nx.range;const mo=wn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());mo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:wn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});mo.range;const go=wn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());go.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:wn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});go.range;function MM(e,t,n,r,i,o){const s=[[Js,1,io],[Js,5,5*io],[Js,15,15*io],[Js,30,30*io],[o,1,Br],[o,5,5*Br],[o,15,15*Br],[o,30,30*Br],[i,1,oo],[i,3,3*oo],[i,6,6*oo],[i,12,12*oo],[r,1,po],[r,2,2*po],[n,1,K0],[t,1,YS],[t,3,3*YS],[e,1,Ag]];function l(h,u,f){const m=u<h;m&&([h,u]=[u,h]);const y=f&&typeof f.range=="function"?f:c(h,u,f),x=y?y.range(h,+u+1):[];return m?x.reverse():x}function c(h,u,f){const m=Math.abs(u-h)/f,y=D0(([,,b])=>b).right(s,m);if(y===s.length)return e.every(rv(h/Ag,u/Ag,f));if(y===0)return Ad.every(Math.max(rv(h,u,f),1));const[x,p]=s[m/s[y-1][2]<s[y][2]/m?y-1:y];return x.every(p)}return[l,c]}const[lK,cK]=MM(go,nx,Zp,OM,tx,J0),[uK,hK]=MM(mo,ex,Gp,Sh,Q0,X0);function Tg(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Eg(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Wc(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function fK(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,h=Vc(i),u=Uc(i),f=Vc(o),m=Uc(o),y=Vc(s),x=Uc(s),p=Vc(l),b=Uc(l),P=Vc(c),S=Uc(c),A={a:G,A:J,b:lt,B:q,c:null,d:eP,e:eP,f:LK,g:HK,G:GK,H:$K,I:IK,j:RK,L:kM,m:NK,M:jK,p:nt,q:it,Q:iP,s:oP,S:DK,u:BK,U:zK,V:FK,w:WK,W:VK,x:null,X:null,y:UK,Y:qK,Z:ZK,"%":rP},E={a:at,A:ct,b:gt,B:yt,c:null,d:nP,e:nP,f:JK,g:lX,G:uX,H:YK,I:KK,j:XK,L:IM,m:QK,M:tX,p:Et,q:Tt,Q:iP,s:oP,S:eX,u:nX,U:rX,V:iX,w:oX,W:sX,x:null,X:null,y:aX,Y:cX,Z:hX,"%":rP},w={a:V,A:D,b:j,B:K,c:H,d:QS,e:QS,f:CK,g:JS,G:XS,H:tP,I:tP,j:PK,L:EK,m:SK,M:AK,p:N,q:_K,Q:MK,s:kK,S:TK,u:yK,U:vK,V:bK,w:gK,W:xK,x:z,X:Y,y:JS,Y:XS,Z:wK,"%":OK};A.x=T(n,A),A.X=T(r,A),A.c=T(t,A),E.x=T(n,E),E.X=T(r,E),E.c=T(t,E);function T(ht,ft){return function(Ct){var rt=[],Rt=-1,bt=0,de=ht.length,ne,Gt,Le;for(Ct instanceof Date||(Ct=new Date(+Ct));++Rt<de;)ht.charCodeAt(Rt)===37&&(rt.push(ht.slice(bt,Rt)),(Gt=KS[ne=ht.charAt(++Rt)])!=null?ne=ht.charAt(++Rt):Gt=ne==="e"?" ":"0",(Le=ft[ne])&&(ne=Le(Ct,Gt)),rt.push(ne),bt=Rt+1);return rt.push(ht.slice(bt,Rt)),rt.join("")}}function O(ht,ft){return function(Ct){var rt=Wc(1900,void 0,1),Rt=R(rt,ht,Ct+="",0),bt,de;if(Rt!=Ct.length)return null;if("Q"in rt)return new Date(rt.Q);if("s"in rt)return new Date(rt.s*1e3+("L"in rt?rt.L:0));if(ft&&!("Z"in rt)&&(rt.Z=0),"p"in rt&&(rt.H=rt.H%12+rt.p*12),rt.m===void 0&&(rt.m="q"in rt?rt.q:0),"V"in rt){if(rt.V<1||rt.V>53)return null;"w"in rt||(rt.w=1),"Z"in rt?(bt=Eg(Wc(rt.y,0,1)),de=bt.getUTCDay(),bt=de>4||de===0?Ed.ceil(bt):Ed(bt),bt=qp.offset(bt,(rt.V-1)*7),rt.y=bt.getUTCFullYear(),rt.m=bt.getUTCMonth(),rt.d=bt.getUTCDate()+(rt.w+6)%7):(bt=Tg(Wc(rt.y,0,1)),de=bt.getDay(),bt=de>4||de===0?Td.ceil(bt):Td(bt),bt=Sh.offset(bt,(rt.V-1)*7),rt.y=bt.getFullYear(),rt.m=bt.getMonth(),rt.d=bt.getDate()+(rt.w+6)%7)}else("W"in rt||"U"in rt)&&("w"in rt||(rt.w="u"in rt?rt.u%7:"W"in rt?1:0),de="Z"in rt?Eg(Wc(rt.y,0,1)).getUTCDay():Tg(Wc(rt.y,0,1)).getDay(),rt.m=0,rt.d="W"in rt?(rt.w+6)%7+rt.W*7-(de+5)%7:rt.w+rt.U*7-(de+6)%7);return"Z"in rt?(rt.H+=rt.Z/100|0,rt.M+=rt.Z%100,Eg(rt)):Tg(rt)}}function R(ht,ft,Ct,rt){for(var Rt=0,bt=ft.length,de=Ct.length,ne,Gt;Rt<bt;){if(rt>=de)return-1;if(ne=ft.charCodeAt(Rt++),ne===37){if(ne=ft.charAt(Rt++),Gt=w[ne in KS?ft.charAt(Rt++):ne],!Gt||(rt=Gt(ht,Ct,rt))<0)return-1}else if(ne!=Ct.charCodeAt(rt++))return-1}return rt}function N(ht,ft,Ct){var rt=h.exec(ft.slice(Ct));return rt?(ht.p=u.get(rt[0].toLowerCase()),Ct+rt[0].length):-1}function V(ht,ft,Ct){var rt=y.exec(ft.slice(Ct));return rt?(ht.w=x.get(rt[0].toLowerCase()),Ct+rt[0].length):-1}function D(ht,ft,Ct){var rt=f.exec(ft.slice(Ct));return rt?(ht.w=m.get(rt[0].toLowerCase()),Ct+rt[0].length):-1}function j(ht,ft,Ct){var rt=P.exec(ft.slice(Ct));return rt?(ht.m=S.get(rt[0].toLowerCase()),Ct+rt[0].length):-1}function K(ht,ft,Ct){var rt=p.exec(ft.slice(Ct));return rt?(ht.m=b.get(rt[0].toLowerCase()),Ct+rt[0].length):-1}function H(ht,ft,Ct){return R(ht,t,ft,Ct)}function z(ht,ft,Ct){return R(ht,n,ft,Ct)}function Y(ht,ft,Ct){return R(ht,r,ft,Ct)}function G(ht){return s[ht.getDay()]}function J(ht){return o[ht.getDay()]}function lt(ht){return c[ht.getMonth()]}function q(ht){return l[ht.getMonth()]}function nt(ht){return i[+(ht.getHours()>=12)]}function it(ht){return 1+~~(ht.getMonth()/3)}function at(ht){return s[ht.getUTCDay()]}function ct(ht){return o[ht.getUTCDay()]}function gt(ht){return c[ht.getUTCMonth()]}function yt(ht){return l[ht.getUTCMonth()]}function Et(ht){return i[+(ht.getUTCHours()>=12)]}function Tt(ht){return 1+~~(ht.getUTCMonth()/3)}return{format:function(ht){var ft=T(ht+="",A);return ft.toString=function(){return ht},ft},parse:function(ht){var ft=O(ht+="",!1);return ft.toString=function(){return ht},ft},utcFormat:function(ht){var ft=T(ht+="",E);return ft.toString=function(){return ht},ft},utcParse:function(ht){var ft=O(ht+="",!0);return ft.toString=function(){return ht},ft}}}var KS={"-":"",_:" ",0:"0"},Tn=/^\s*\d+/,dK=/^%/,pK=/[\\^$*+?|[\]().{}]/g;function ge(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function mK(e){return e.replace(pK,"\\$&")}function Vc(e){return new RegExp("^(?:"+e.map(mK).join("|")+")","i")}function Uc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function gK(e,t,n){var r=Tn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function yK(e,t,n){var r=Tn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function vK(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function bK(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function xK(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function XS(e,t,n){var r=Tn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function JS(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function wK(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function _K(e,t,n){var r=Tn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function SK(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function QS(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function PK(e,t,n){var r=Tn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function tP(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function AK(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function TK(e,t,n){var r=Tn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function EK(e,t,n){var r=Tn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function CK(e,t,n){var r=Tn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function OK(e,t,n){var r=dK.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function MK(e,t,n){var r=Tn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function kK(e,t,n){var r=Tn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function eP(e,t){return ge(e.getDate(),t,2)}function $K(e,t){return ge(e.getHours(),t,2)}function IK(e,t){return ge(e.getHours()%12||12,t,2)}function RK(e,t){return ge(1+Sh.count(mo(e),e),t,3)}function kM(e,t){return ge(e.getMilliseconds(),t,3)}function LK(e,t){return kM(e,t)+"000"}function NK(e,t){return ge(e.getMonth()+1,t,2)}function jK(e,t){return ge(e.getMinutes(),t,2)}function DK(e,t){return ge(e.getSeconds(),t,2)}function BK(e){var t=e.getDay();return t===0?7:t}function zK(e,t){return ge(Gp.count(mo(e)-1,e),t,2)}function $M(e){var t=e.getDay();return t>=4||t===0?Al(e):Al.ceil(e)}function FK(e,t){return e=$M(e),ge(Al.count(mo(e),e)+(mo(e).getDay()===4),t,2)}function WK(e){return e.getDay()}function VK(e,t){return ge(Td.count(mo(e)-1,e),t,2)}function UK(e,t){return ge(e.getFullYear()%100,t,2)}function HK(e,t){return e=$M(e),ge(e.getFullYear()%100,t,2)}function qK(e,t){return ge(e.getFullYear()%1e4,t,4)}function GK(e,t){var n=e.getDay();return e=n>=4||n===0?Al(e):Al.ceil(e),ge(e.getFullYear()%1e4,t,4)}function ZK(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ge(t/60|0,"0",2)+ge(t%60,"0",2)}function nP(e,t){return ge(e.getUTCDate(),t,2)}function YK(e,t){return ge(e.getUTCHours(),t,2)}function KK(e,t){return ge(e.getUTCHours()%12||12,t,2)}function XK(e,t){return ge(1+qp.count(go(e),e),t,3)}function IM(e,t){return ge(e.getUTCMilliseconds(),t,3)}function JK(e,t){return IM(e,t)+"000"}function QK(e,t){return ge(e.getUTCMonth()+1,t,2)}function tX(e,t){return ge(e.getUTCMinutes(),t,2)}function eX(e,t){return ge(e.getUTCSeconds(),t,2)}function nX(e){var t=e.getUTCDay();return t===0?7:t}function rX(e,t){return ge(Zp.count(go(e)-1,e),t,2)}function RM(e){var t=e.getUTCDay();return t>=4||t===0?Tl(e):Tl.ceil(e)}function iX(e,t){return e=RM(e),ge(Tl.count(go(e),e)+(go(e).getUTCDay()===4),t,2)}function oX(e){return e.getUTCDay()}function sX(e,t){return ge(Ed.count(go(e)-1,e),t,2)}function aX(e,t){return ge(e.getUTCFullYear()%100,t,2)}function lX(e,t){return e=RM(e),ge(e.getUTCFullYear()%100,t,2)}function cX(e,t){return ge(e.getUTCFullYear()%1e4,t,4)}function uX(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Tl(e):Tl.ceil(e),ge(e.getUTCFullYear()%1e4,t,4)}function hX(){return"+0000"}function rP(){return"%"}function iP(e){return+e}function oP(e){return Math.floor(+e/1e3)}var Va,LM,NM;fX({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function fX(e){return Va=fK(e),LM=Va.format,Va.parse,NM=Va.utcFormat,Va.utcParse,Va}function dX(e){return new Date(e)}function pX(e){return e instanceof Date?+e:+new Date(+e)}function rx(e,t,n,r,i,o,s,l,c,h){var u=V0(),f=u.invert,m=u.domain,y=h(".%L"),x=h(":%S"),p=h("%I:%M"),b=h("%I %p"),P=h("%a %d"),S=h("%b %d"),A=h("%B"),E=h("%Y");function w(T){return(c(T)<T?y:l(T)<T?x:s(T)<T?p:o(T)<T?b:r(T)<T?i(T)<T?P:S:n(T)<T?A:E)(T)}return u.invert=function(T){return new Date(f(T))},u.domain=function(T){return arguments.length?m(Array.from(T,pX)):m().map(dX)},u.ticks=function(T){var O=m();return e(O[0],O[O.length-1],T??10)},u.tickFormat=function(T,O){return O==null?w:h(O)},u.nice=function(T){var O=m();return(!T||typeof T.range!="function")&&(T=t(O[0],O[O.length-1],T??10)),T?m(_M(O,T)):u},u.copy=function(){return _h(u,rx(e,t,n,r,i,o,s,l,c,h))},u}function mX(){return Fr.apply(rx(uK,hK,mo,ex,Gp,Sh,Q0,X0,Js,LM).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function gX(){return Fr.apply(rx(lK,cK,go,nx,Zp,qp,tx,J0,Js,NM).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Yp(){var e=0,t=1,n,r,i,o,s=Xn,l=!1,c;function h(f){return f==null||isNaN(f=+f)?c:s(i===0?.5:(f=(o(f)-n)*i,l?Math.max(0,Math.min(1,f)):f))}h.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),h):[e,t]},h.clamp=function(f){return arguments.length?(l=!!f,h):l},h.interpolator=function(f){return arguments.length?(s=f,h):s};function u(f){return function(m){var y,x;return arguments.length?([y,x]=m,s=f(y,x),h):[s(0),s(1)]}}return h.range=u(uc),h.rangeRound=u(W0),h.unknown=function(f){return arguments.length?(c=f,h):c},function(f){return o=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),h}}function us(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function jM(){var e=cs(Yp()(Xn));return e.copy=function(){return us(e,jM())},xo.apply(e,arguments)}function DM(){var e=q0(Yp()).domain([1,10]);return e.copy=function(){return us(e,DM()).base(e.base())},xo.apply(e,arguments)}function BM(){var e=G0(Yp());return e.copy=function(){return us(e,BM()).constant(e.constant())},xo.apply(e,arguments)}function ix(){var e=Z0(Yp());return e.copy=function(){return us(e,ix()).exponent(e.exponent())},xo.apply(e,arguments)}function yX(){return ix.apply(null,arguments).exponent(.5)}function zM(){var e=[],t=Xn;function n(r){if(r!=null&&!isNaN(r=+r))return t((xh(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Xo),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>rY(e,o/r))},n.copy=function(){return zM(t).domain(e)},xo.apply(n,arguments)}function Kp(){var e=0,t=.5,n=1,r=1,i,o,s,l,c,h=Xn,u,f=!1,m;function y(p){return isNaN(p=+p)?m:(p=.5+((p=+u(p))-o)*(r*p<r*o?l:c),h(f?Math.max(0,Math.min(1,p)):p))}y.domain=function(p){return arguments.length?([e,t,n]=p,i=u(e=+e),o=u(t=+t),s=u(n=+n),l=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,y):[e,t,n]},y.clamp=function(p){return arguments.length?(f=!!p,y):f},y.interpolator=function(p){return arguments.length?(h=p,y):h};function x(p){return function(b){var P,S,A;return arguments.length?([P,S,A]=b,h=OY(p,[P,S,A]),y):[h(0),h(.5),h(1)]}}return y.range=x(uc),y.rangeRound=x(W0),y.unknown=function(p){return arguments.length?(m=p,y):m},function(p){return u=p,i=p(e),o=p(t),s=p(n),l=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,y}}function FM(){var e=cs(Kp()(Xn));return e.copy=function(){return us(e,FM())},xo.apply(e,arguments)}function WM(){var e=q0(Kp()).domain([.1,1,10]);return e.copy=function(){return us(e,WM()).base(e.base())},xo.apply(e,arguments)}function VM(){var e=G0(Kp());return e.copy=function(){return us(e,VM()).constant(e.constant())},xo.apply(e,arguments)}function ox(){var e=Z0(Kp());return e.copy=function(){return us(e,ox()).exponent(e.exponent())},xo.apply(e,arguments)}function vX(){return ox.apply(null,arguments).exponent(.5)}const sP=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:ju,scaleDiverging:FM,scaleDivergingLog:WM,scaleDivergingPow:ox,scaleDivergingSqrt:vX,scaleDivergingSymlog:VM,scaleIdentity:wM,scaleImplicit:iv,scaleLinear:Pd,scaleLog:SM,scaleOrdinal:B0,scalePoint:hu,scalePow:Y0,scaleQuantile:TM,scaleQuantize:EM,scaleRadial:AM,scaleSequential:jM,scaleSequentialLog:DM,scaleSequentialPow:ix,scaleSequentialQuantile:zM,scaleSequentialSqrt:yX,scaleSequentialSymlog:BM,scaleSqrt:JY,scaleSymlog:PM,scaleThreshold:CM,scaleTime:mX,scaleUtc:gX,tickFormat:xM},Symbol.toStringTag,{value:"Module"}));var bX=ec;function xX(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],s=t(o);if(s!=null&&(l===void 0?s===s&&!bX(s):n(s,l)))var l=s,c=o}return c}var Xp=xX;function wX(e,t){return e>t}var UM=wX,_X=Xp,SX=UM,PX=cc;function AX(e){return e&&e.length?_X(e,PX,SX):void 0}var TX=AX;const Go=Me(TX);function EX(e,t){return e<t}var HM=EX,CX=Xp,OX=HM,MX=cc;function kX(e){return e&&e.length?CX(e,MX,OX):void 0}var $X=kX;const Jp=Me($X);var IX=_0,RX=Ei,LX=tM,NX=dr;function jX(e,t){var n=NX(e)?IX:LX;return n(e,RX(t))}var DX=jX,BX=JO,zX=DX;function FX(e,t){return BX(zX(e,t),1)}var WX=FX;const VX=Me(WX);var UX=R0;function HX(e,t){return UX(e,t)}var qX=HX;const pa=Me(qX);var hc=1e9,GX={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},ax,Ye=!0,zr="[DecimalError] ",oa=zr+"Invalid argument: ",sx=zr+"Exponent out of range: ",fc=Math.floor,qs=Math.pow,ZX=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,xr,Sn=1e7,Ve=7,qM=9007199254740991,Cd=fc(qM/Ve),Mt={};Mt.absoluteValue=Mt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Mt.comparedTo=Mt.cmp=function(e){var t,n,r,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(r=o.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};Mt.decimalPlaces=Mt.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Ve;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Mt.dividedBy=Mt.div=function(e){return co(this,new this.constructor(e))};Mt.dividedToIntegerBy=Mt.idiv=function(e){var t=this,n=t.constructor;return Re(co(t,new n(e),0,1),n.precision)};Mt.equals=Mt.eq=function(e){return!this.cmp(e)};Mt.exponent=function(){return mn(this)};Mt.greaterThan=Mt.gt=function(e){return this.cmp(e)>0};Mt.greaterThanOrEqualTo=Mt.gte=function(e){return this.cmp(e)>=0};Mt.isInteger=Mt.isint=function(){return this.e>this.d.length-2};Mt.isNegative=Mt.isneg=function(){return this.s<0};Mt.isPositive=Mt.ispos=function(){return this.s>0};Mt.isZero=function(){return this.s===0};Mt.lessThan=Mt.lt=function(e){return this.cmp(e)<0};Mt.lessThanOrEqualTo=Mt.lte=function(e){return this.cmp(e)<1};Mt.logarithm=Mt.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(xr))throw Error(zr+"NaN");if(n.s<1)throw Error(zr+(n.s?"NaN":"-Infinity"));return n.eq(xr)?new r(0):(Ye=!1,t=co(Wu(n,o),Wu(e,o),o),Ye=!0,Re(t,i))};Mt.minus=Mt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?YM(t,e):GM(t,(e.s=-e.s,e))};Mt.modulo=Mt.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(zr+"NaN");return n.s?(Ye=!1,t=co(n,e,0,1).times(e),Ye=!0,n.minus(t)):Re(new r(n),i)};Mt.naturalExponential=Mt.exp=function(){return ZM(this)};Mt.naturalLogarithm=Mt.ln=function(){return Wu(this)};Mt.negated=Mt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Mt.plus=Mt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?GM(t,e):YM(t,(e.s=-e.s,e))};Mt.precision=Mt.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(oa+e);if(t=mn(i)+1,r=i.d.length-1,n=r*Ve+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Mt.squareRoot=Mt.sqrt=function(){var e,t,n,r,i,o,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(zr+"NaN")}for(e=mn(l),Ye=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=yi(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=fc((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=s=n+3;;)if(o=r,r=o.plus(co(l,o,s+2)).times(.5),yi(o.d).slice(0,s)===(t=yi(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(Re(o,n+1,0),o.times(o).eq(l)){r=o;break}}else if(t!="9999")break;s+=4}return Ye=!0,Re(r,n)};Mt.times=Mt.mul=function(e){var t,n,r,i,o,s,l,c,h,u=this,f=u.constructor,m=u.d,y=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,n=u.e+e.e,c=m.length,h=y.length,c<h&&(o=m,m=y,y=o,s=c,c=h,h=s),o=[],s=c+h,r=s;r--;)o.push(0);for(r=h;--r>=0;){for(t=0,i=c+r;i>r;)l=o[i]+y[r]*m[i-r-1]+t,o[i--]=l%Sn|0,t=l/Sn|0;o[i]=(o[i]+t)%Sn|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,Ye?Re(e,f.precision):e};Mt.toDecimalPlaces=Mt.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ai(e,0,hc),t===void 0?t=r.rounding:Ai(t,0,8),Re(n,e+mn(n)+1,t))};Mt.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=ma(r,!0):(Ai(e,0,hc),t===void 0?t=i.rounding:Ai(t,0,8),r=Re(new i(r),e+1,t),n=ma(r,!0,e+1)),n};Mt.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?ma(i):(Ai(e,0,hc),t===void 0?t=o.rounding:Ai(t,0,8),r=Re(new o(i),e+mn(i)+1,t),n=ma(r.abs(),!1,e+mn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Mt.toInteger=Mt.toint=function(){var e=this,t=e.constructor;return Re(new t(e),mn(e)+1,t.rounding)};Mt.toNumber=function(){return+this};Mt.toPower=Mt.pow=function(e){var t,n,r,i,o,s,l=this,c=l.constructor,h=12,u=+(e=new c(e));if(!e.s)return new c(xr);if(l=new c(l),!l.s){if(e.s<1)throw Error(zr+"Infinity");return l}if(l.eq(xr))return l;if(r=c.precision,e.eq(xr))return Re(l,r);if(t=e.e,n=e.d.length-1,s=t>=n,o=l.s,s){if((n=u<0?-u:u)<=qM){for(i=new c(xr),t=Math.ceil(r/Ve+4),Ye=!1;n%2&&(i=i.times(l),lP(i.d,t)),n=fc(n/2),n!==0;)l=l.times(l),lP(l.d,t);return Ye=!0,e.s<0?new c(xr).div(i):Re(i,r)}}else if(o<0)throw Error(zr+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Ye=!1,i=e.times(Wu(l,r+h)),Ye=!0,i=ZM(i),i.s=o,i};Mt.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?(n=mn(i),r=ma(i,n<=o.toExpNeg||n>=o.toExpPos)):(Ai(e,1,hc),t===void 0?t=o.rounding:Ai(t,0,8),i=Re(new o(i),e,t),n=mn(i),r=ma(i,e<=n||n<=o.toExpNeg,e)),r};Mt.toSignificantDigits=Mt.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ai(e,1,hc),t===void 0?t=r.rounding:Ai(t,0,8)),Re(new r(n),e,t)};Mt.toString=Mt.valueOf=Mt.val=Mt.toJSON=Mt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=mn(e),n=e.constructor;return ma(e,t<=n.toExpNeg||t>=n.toExpPos)};function GM(e,t){var n,r,i,o,s,l,c,h,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),Ye?Re(t,f):t;if(c=e.d,h=t.d,s=e.e,i=t.e,c=c.slice(),o=s-i,o){for(o<0?(r=c,o=-o,l=h.length):(r=h,i=s,l=c.length),s=Math.ceil(f/Ve),l=s>l?s+1:l+1,o>l&&(o=l,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(l=c.length,o=h.length,l-o<0&&(o=l,r=h,h=c,c=r),n=0;o;)n=(c[--o]=c[o]+h[o]+n)/Sn|0,c[o]%=Sn;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,Ye?Re(t,f):t}function Ai(e,t,n){if(e!==~~e||e<t||e>n)throw Error(oa+e)}function yi(e){var t,n,r,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)r=e[t]+"",n=Ve-r.length,n&&(o+=Wo(n)),o+=r;s=e[t],r=s+"",n=Ve-r.length,n&&(o+=Wo(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}var co=function(){function e(r,i){var o,s=0,l=r.length;for(r=r.slice();l--;)o=r[l]*i+s,r[l]=o%Sn|0,s=o/Sn|0;return s&&r.unshift(s),r}function t(r,i,o,s){var l,c;if(o!=s)c=o>s?1:-1;else for(l=c=0;l<o;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,o){for(var s=0;o--;)r[o]-=s,s=r[o]<i[o]?1:0,r[o]=s*Sn+r[o]-i[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,o,s){var l,c,h,u,f,m,y,x,p,b,P,S,A,E,w,T,O,R,N=r.constructor,V=r.s==i.s?1:-1,D=r.d,j=i.d;if(!r.s)return new N(r);if(!i.s)throw Error(zr+"Division by zero");for(c=r.e-i.e,O=j.length,w=D.length,y=new N(V),x=y.d=[],h=0;j[h]==(D[h]||0);)++h;if(j[h]>(D[h]||0)&&--c,o==null?S=o=N.precision:s?S=o+(mn(r)-mn(i))+1:S=o,S<0)return new N(0);if(S=S/Ve+2|0,h=0,O==1)for(u=0,j=j[0],S++;(h<w||u)&&S--;h++)A=u*Sn+(D[h]||0),x[h]=A/j|0,u=A%j|0;else{for(u=Sn/(j[0]+1)|0,u>1&&(j=e(j,u),D=e(D,u),O=j.length,w=D.length),E=O,p=D.slice(0,O),b=p.length;b<O;)p[b++]=0;R=j.slice(),R.unshift(0),T=j[0],j[1]>=Sn/2&&++T;do u=0,l=t(j,p,O,b),l<0?(P=p[0],O!=b&&(P=P*Sn+(p[1]||0)),u=P/T|0,u>1?(u>=Sn&&(u=Sn-1),f=e(j,u),m=f.length,b=p.length,l=t(f,p,m,b),l==1&&(u--,n(f,O<m?R:j,m))):(u==0&&(l=u=1),f=j.slice()),m=f.length,m<b&&f.unshift(0),n(p,f,b),l==-1&&(b=p.length,l=t(j,p,O,b),l<1&&(u++,n(p,O<b?R:j,b))),b=p.length):l===0&&(u++,p=[0]),x[h++]=u,l&&p[0]?p[b++]=D[E]||0:(p=[D[E]],b=1);while((E++<w||p[0]!==void 0)&&S--)}return x[0]||x.shift(),y.e=c,Re(y,s?o+mn(y)+1:o)}}();function ZM(e,t){var n,r,i,o,s,l,c=0,h=0,u=e.constructor,f=u.precision;if(mn(e)>16)throw Error(sx+mn(e));if(!e.s)return new u(xr);for(Ye=!1,l=f,s=new u(.03125);e.abs().gte(.1);)e=e.times(s),h+=5;for(r=Math.log(qs(2,h))/Math.LN10*2+5|0,l+=r,n=i=o=new u(xr),u.precision=l;;){if(i=Re(i.times(e),l),n=n.times(++c),s=o.plus(co(i,n,l)),yi(s.d).slice(0,l)===yi(o.d).slice(0,l)){for(;h--;)o=Re(o.times(o),l);return u.precision=f,t==null?(Ye=!0,Re(o,f)):o}o=s}}function mn(e){for(var t=e.e*Ve,n=e.d[0];n>=10;n/=10)t++;return t}function Cg(e,t,n){if(t>e.LN10.sd())throw Ye=!0,n&&(e.precision=n),Error(zr+"LN10 precision limit exceeded");return Re(new e(e.LN10),t)}function Wo(e){for(var t="";e--;)t+="0";return t}function Wu(e,t){var n,r,i,o,s,l,c,h,u,f=1,m=10,y=e,x=y.d,p=y.constructor,b=p.precision;if(y.s<1)throw Error(zr+(y.s?"NaN":"-Infinity"));if(y.eq(xr))return new p(0);if(t==null?(Ye=!1,h=b):h=t,y.eq(10))return t==null&&(Ye=!0),Cg(p,h);if(h+=m,p.precision=h,n=yi(x),r=n.charAt(0),o=mn(y),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)y=y.times(e),n=yi(y.d),r=n.charAt(0),f++;o=mn(y),r>1?(y=new p("0."+n),o++):y=new p(r+"."+n.slice(1))}else return c=Cg(p,h+2,b).times(o+""),y=Wu(new p(r+"."+n.slice(1)),h-m).plus(c),p.precision=b,t==null?(Ye=!0,Re(y,b)):y;for(l=s=y=co(y.minus(xr),y.plus(xr),h),u=Re(y.times(y),h),i=3;;){if(s=Re(s.times(u),h),c=l.plus(co(s,new p(i),h)),yi(c.d).slice(0,h)===yi(l.d).slice(0,h))return l=l.times(2),o!==0&&(l=l.plus(Cg(p,h+2,b).times(o+""))),l=co(l,new p(f),h),p.precision=b,t==null?(Ye=!0,Re(l,b)):l;l=c,i+=2}}function aP(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=fc(n/Ve),e.d=[],r=(n+1)%Ve,n<0&&(r+=Ve),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Ve;r<i;)e.d.push(+t.slice(r,r+=Ve));t=t.slice(r),r=Ve-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Ye&&(e.e>Cd||e.e<-Cd))throw Error(sx+n)}else e.s=0,e.e=0,e.d=[0];return e}function Re(e,t,n){var r,i,o,s,l,c,h,u,f=e.d;for(s=1,o=f[0];o>=10;o/=10)s++;if(r=t-s,r<0)r+=Ve,i=t,h=f[u=0];else{if(u=Math.ceil((r+1)/Ve),o=f.length,u>=o)return e;for(h=o=f[u],s=1;o>=10;o/=10)s++;r%=Ve,i=r-Ve+s}if(n!==void 0&&(o=qs(10,s-i-1),l=h/o%10|0,c=t<0||f[u+1]!==void 0||h%o,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?h/qs(10,s-i):0:f[u-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(o=mn(e),f.length=1,t=t-o-1,f[0]=qs(10,(Ve-t%Ve)%Ve),e.e=fc(-t/Ve)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=u,o=1,u--):(f.length=u+1,o=qs(10,Ve-r),f[u]=i>0?(h/qs(10,s-i)%qs(10,i)|0)*o:0),c)for(;;)if(u==0){(f[0]+=o)==Sn&&(f[0]=1,++e.e);break}else{if(f[u]+=o,f[u]!=Sn)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(Ye&&(e.e>Cd||e.e<-Cd))throw Error(sx+mn(e));return e}function YM(e,t){var n,r,i,o,s,l,c,h,u,f,m=e.constructor,y=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),Ye?Re(t,y):t;if(c=e.d,f=t.d,r=t.e,h=e.e,c=c.slice(),s=h-r,s){for(u=s<0,u?(n=c,s=-s,l=f.length):(n=f,r=h,l=c.length),i=Math.max(Math.ceil(y/Ve),l)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=f.length,u=i<l,u&&(l=i),i=0;i<l;i++)if(c[i]!=f[i]){u=c[i]<f[i];break}s=0}for(u&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,i=f.length-l;i>0;--i)c[l++]=0;for(i=f.length;i>s;){if(c[--i]<f[i]){for(o=i;o&&c[--o]===0;)c[o]=Sn-1;--c[o],c[i]+=Sn}c[i]-=f[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Ye?Re(t,y):t):new m(0)}function ma(e,t,n){var r,i=mn(e),o=yi(e.d),s=o.length;return t?(n&&(r=n-s)>0?o=o.charAt(0)+"."+o.slice(1)+Wo(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Wo(-i-1)+o,n&&(r=n-s)>0&&(o+=Wo(r))):i>=s?(o+=Wo(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+Wo(r))):((r=i+1)<s&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(o+="."),o+=Wo(r))),e.s<0?"-"+o:o}function lP(e,t){if(e.length>t)return e.length=t,!0}function KM(e){var t,n,r;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(oa+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return aP(s,o.toString())}else if(typeof o!="string")throw Error(oa+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,ZX.test(o))aP(s,o);else throw Error(oa+o)}if(i.prototype=Mt,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=KM,i.config=i.set=YX,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function YX(e){if(!e||typeof e!="object")throw Error(zr+"Object expected");var t,n,r,i=["precision",1,hc,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(fc(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(oa+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(oa+n+": "+r);return this}var ax=KM(GX);xr=new ax(1);const Oe=ax;function KX(e){return tJ(e)||QX(e)||JX(e)||XX()}function XX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
46
46
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JX(e,t){if(e){if(typeof e=="string")return lv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lv(e,t)}}function QX(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function tJ(e){if(Array.isArray(e))return lv(e)}function lv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var eJ=function(t){return t},XM={},JM=function(t){return t===XM},cP=function(t){return function n(){return arguments.length===0||arguments.length===1&&JM(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},nJ=function e(t,n){return t===1?n:cP(function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var s=i.filter(function(l){return l!==XM}).length;return s>=t?n.apply(void 0,i):e(t-s,cP(function(){for(var l=arguments.length,c=new Array(l),h=0;h<l;h++)c[h]=arguments[h];var u=i.map(function(f){return JM(f)?c.shift():f});return n.apply(void 0,KX(u).concat(c))}))})},Qp=function(t){return nJ(t.length,t)},cv=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},rJ=Qp(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),iJ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return eJ;var i=n.reverse(),o=i[0],s=i.slice(1);return function(){return s.reduce(function(l,c){return c(l)},o.apply(void 0,arguments))}},uv=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},QM=function(t){var n=null,r=null;return function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n&&o.every(function(l,c){return l===n[c]})||(n=o,r=t.apply(void 0,o)),r}};function oJ(e){var t;return e===0?t=1:t=Math.floor(new Oe(e).abs().log(10).toNumber())+1,t}function sJ(e,t,n){for(var r=new Oe(e),i=0,o=[];r.lt(t)&&i<1e5;)o.push(r.toNumber()),r=r.add(n),i++;return o}var aJ=Qp(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),lJ=Qp(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),cJ=Qp(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const tm={rangeStep:sJ,getDigitCount:oJ,interpolateNumber:aJ,uninterpolateNumber:lJ,uninterpolateTruncation:cJ};function hv(e){return fJ(e)||hJ(e)||tk(e)||uJ()}function uJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
47
47
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hJ(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function fJ(e){if(Array.isArray(e))return fv(e)}function Vu(e,t){return mJ(e)||pJ(e,t)||tk(e,t)||dJ()}function dJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
48
48
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tk(e,t){if(e){if(typeof e=="string")return fv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fv(e,t)}}function fv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pJ(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),l;!(r=(l=s.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){i=!0,o=c}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function mJ(e){if(Array.isArray(e))return e}function ek(e){var t=Vu(e,2),n=t[0],r=t[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function nk(e,t,n){if(e.lte(0))return new Oe(0);var r=tm.getDigitCount(e.toNumber()),i=new Oe(10).pow(r),o=e.div(i),s=r!==1?.05:.1,l=new Oe(Math.ceil(o.div(s).toNumber())).add(n).mul(s),c=l.mul(i);return t?c:new Oe(Math.ceil(c))}function gJ(e,t,n){var r=1,i=new Oe(e);if(!i.isint()&&n){var o=Math.abs(e);o<1?(r=new Oe(10).pow(tm.getDigitCount(e)-1),i=new Oe(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new Oe(Math.floor(e)))}else e===0?i=new Oe(Math.floor((t-1)/2)):n||(i=new Oe(Math.floor(e)));var s=Math.floor((t-1)/2),l=iJ(rJ(function(c){return i.add(new Oe(c-s).mul(r)).toNumber()}),cv);return l(0,t)}function rk(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Oe(0),tickMin:new Oe(0),tickMax:new Oe(0)};var o=nk(new Oe(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new Oe(0):(s=new Oe(e).add(t).div(2),s=s.sub(new Oe(s).mod(o)));var l=Math.ceil(s.sub(e).div(o).toNumber()),c=Math.ceil(new Oe(t).sub(s).div(o).toNumber()),h=l+c+1;return h>n?rk(e,t,n,r,i+1):(h<n&&(c=t>0?c+(n-h):c,l=t>0?l:l+(n-h)),{step:o,tickMin:s.sub(new Oe(l).mul(o)),tickMax:s.add(new Oe(c).mul(o))})}function yJ(e){var t=Vu(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),l=ek([n,r]),c=Vu(l,2),h=c[0],u=c[1];if(h===-1/0||u===1/0){var f=u===1/0?[h].concat(hv(cv(0,i-1).map(function(){return 1/0}))):[].concat(hv(cv(0,i-1).map(function(){return-1/0})),[u]);return n>r?uv(f):f}if(h===u)return gJ(h,i,o);var m=rk(h,u,s,o),y=m.step,x=m.tickMin,p=m.tickMax,b=tm.rangeStep(x,p.add(new Oe(.1).mul(y)),y);return n>r?uv(b):b}function vJ(e,t){var n=Vu(e,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=ek([r,i]),l=Vu(s,2),c=l[0],h=l[1];if(c===-1/0||h===1/0)return[r,i];if(c===h)return[c];var u=Math.max(t,2),f=nk(new Oe(h).sub(c).div(u-1),o,0),m=[].concat(hv(tm.rangeStep(new Oe(c),new Oe(h).sub(new Oe(.99).mul(f)),f)),[h]);return r>i?uv(m):m}var bJ=QM(yJ),xJ=QM(vJ),wJ=process.env.NODE_ENV==="production",Og="Invariant failed";function lr(e,t){if(wJ)throw new Error(Og);var n=typeof t=="function"?t():t,r=n?"".concat(Og,": ").concat(n):Og;throw new Error(r)}var _J=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function El(e){"@babel/helpers - typeof";return El=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},El(e)}function Od(){return Od=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Od.apply(this,arguments)}function SJ(e,t){return EJ(e)||TJ(e,t)||AJ(e,t)||PJ()}function PJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -83,12 +83,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
83
83
  *
84
84
  * This source code is licensed under the MIT license found in the
85
85
  * LICENSE file in the root directory of this source tree.
86
- */var $P;function gtt(){return $P||($P=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,h=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,x=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,P=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function A(rt){return typeof rt=="string"||typeof rt=="function"||rt===r||rt===h||rt===o||rt===i||rt===f||rt===m||typeof rt=="object"&&rt!==null&&(rt.$$typeof===x||rt.$$typeof===y||rt.$$typeof===s||rt.$$typeof===l||rt.$$typeof===u||rt.$$typeof===b||rt.$$typeof===P||rt.$$typeof===S||rt.$$typeof===p)}function E(rt){if(typeof rt=="object"&&rt!==null){var Rt=rt.$$typeof;switch(Rt){case t:var bt=rt.type;switch(bt){case c:case h:case r:case o:case i:case f:return bt;default:var de=bt&&bt.$$typeof;switch(de){case l:case u:case x:case y:case s:return de;default:return Rt}}case n:return Rt}}}var w=c,T=h,O=l,R=s,N=t,V=u,D=r,j=x,K=y,H=n,z=o,Y=i,G=f,J=!1;function lt(rt){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),q(rt)||E(rt)===c}function q(rt){return E(rt)===h}function nt(rt){return E(rt)===l}function it(rt){return E(rt)===s}function at(rt){return typeof rt=="object"&&rt!==null&&rt.$$typeof===t}function ct(rt){return E(rt)===u}function mt(rt){return E(rt)===r}function yt(rt){return E(rt)===x}function Et(rt){return E(rt)===y}function Tt(rt){return E(rt)===n}function ht(rt){return E(rt)===o}function ft(rt){return E(rt)===i}function Ct(rt){return E(rt)===f}Se.AsyncMode=w,Se.ConcurrentMode=T,Se.ContextConsumer=O,Se.ContextProvider=R,Se.Element=N,Se.ForwardRef=V,Se.Fragment=D,Se.Lazy=j,Se.Memo=K,Se.Portal=H,Se.Profiler=z,Se.StrictMode=Y,Se.Suspense=G,Se.isAsyncMode=lt,Se.isConcurrentMode=q,Se.isContextConsumer=nt,Se.isContextProvider=it,Se.isElement=at,Se.isForwardRef=ct,Se.isFragment=mt,Se.isLazy=yt,Se.isMemo=Et,Se.isPortal=Tt,Se.isProfiler=ht,Se.isStrictMode=ft,Se.isSuspense=Ct,Se.isValidElementType=A,Se.typeOf=E}()),Se}var IP;function Sk(){return IP||(IP=1,process.env.NODE_ENV==="production"?Cf.exports=mtt():Cf.exports=gtt()),Cf.exports}/*
86
+ */var $P;function gtt(){return $P||($P=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,h=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,x=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,P=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function A(rt){return typeof rt=="string"||typeof rt=="function"||rt===r||rt===h||rt===o||rt===i||rt===f||rt===m||typeof rt=="object"&&rt!==null&&(rt.$$typeof===x||rt.$$typeof===y||rt.$$typeof===s||rt.$$typeof===l||rt.$$typeof===u||rt.$$typeof===b||rt.$$typeof===P||rt.$$typeof===S||rt.$$typeof===p)}function E(rt){if(typeof rt=="object"&&rt!==null){var Rt=rt.$$typeof;switch(Rt){case t:var bt=rt.type;switch(bt){case c:case h:case r:case o:case i:case f:return bt;default:var de=bt&&bt.$$typeof;switch(de){case l:case u:case x:case y:case s:return de;default:return Rt}}case n:return Rt}}}var w=c,T=h,O=l,R=s,N=t,V=u,D=r,j=x,K=y,H=n,z=o,Y=i,G=f,J=!1;function lt(rt){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),q(rt)||E(rt)===c}function q(rt){return E(rt)===h}function nt(rt){return E(rt)===l}function it(rt){return E(rt)===s}function at(rt){return typeof rt=="object"&&rt!==null&&rt.$$typeof===t}function ct(rt){return E(rt)===u}function gt(rt){return E(rt)===r}function yt(rt){return E(rt)===x}function Et(rt){return E(rt)===y}function Tt(rt){return E(rt)===n}function ht(rt){return E(rt)===o}function ft(rt){return E(rt)===i}function Ct(rt){return E(rt)===f}Se.AsyncMode=w,Se.ConcurrentMode=T,Se.ContextConsumer=O,Se.ContextProvider=R,Se.Element=N,Se.ForwardRef=V,Se.Fragment=D,Se.Lazy=j,Se.Memo=K,Se.Portal=H,Se.Profiler=z,Se.StrictMode=Y,Se.Suspense=G,Se.isAsyncMode=lt,Se.isConcurrentMode=q,Se.isContextConsumer=nt,Se.isContextProvider=it,Se.isElement=at,Se.isForwardRef=ct,Se.isFragment=gt,Se.isLazy=yt,Se.isMemo=Et,Se.isPortal=Tt,Se.isProfiler=ht,Se.isStrictMode=ft,Se.isSuspense=Ct,Se.isValidElementType=A,Se.typeOf=E}()),Se}var IP;function Sk(){return IP||(IP=1,process.env.NODE_ENV==="production"?Cf.exports=mtt():Cf.exports=gtt()),Cf.exports}/*
87
87
  object-assign
88
88
  (c) Sindre Sorhus
89
89
  @license MIT
90
- */var kg,RP;function ytt(){if(RP)return kg;RP=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;var c=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(c.join("")!=="0123456789")return!1;var h={};return"abcdefghijklmnopqrst".split("").forEach(function(u){h[u]=u}),Object.keys(Object.assign({},h)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return kg=i()?Object.assign:function(o,s){for(var l,c=r(o),h,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)t.call(l,f)&&(c[f]=l[f]);if(e){h=e(l);for(var m=0;m<h.length;m++)n.call(l,h[m])&&(c[h[m]]=l[h[m]])}}return c},kg}var $g,LP;function cx(){if(LP)return $g;LP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return $g=e,$g}var Ig,NP;function Pk(){return NP||(NP=1,Ig=Function.call.bind(Object.prototype.hasOwnProperty)),Ig}var Rg,jP;function vtt(){if(jP)return Rg;jP=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=cx(),n={},r=Pk();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,l,c,h){if(process.env.NODE_ENV!=="production"){for(var u in o)if(r(o,u)){var f;try{if(typeof o[u]!="function"){var m=Error((c||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}f=o[u](s,u,c,l,null,t)}catch(x){f=x}if(f&&!(f instanceof Error)&&e((c||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var y=h?h():"";e("Failed "+l+" type: "+f.message+(y??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Rg=i,Rg}var Lg,DP;function btt(){if(DP)return Lg;DP=1;var e=Sk(),t=ytt(),n=cx(),r=Pk(),i=vtt(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(l){var c="Warning: "+l;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function s(){return null}return Lg=function(l,c){var h=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(q){var nt=q&&(h&&q[h]||q[u]);if(typeof nt=="function")return nt}var m="<<anonymous>>",y={array:P("array"),bigint:P("bigint"),bool:P("boolean"),func:P("function"),number:P("number"),object:P("object"),string:P("string"),symbol:P("symbol"),any:S(),arrayOf:A,element:E(),elementType:w(),instanceOf:T,node:V(),objectOf:R,oneOf:O,oneOfType:N,shape:j,exact:K};function x(q,nt){return q===nt?q!==0||1/q===1/nt:q!==q&&nt!==nt}function p(q,nt){this.message=q,this.data=nt&&typeof nt=="object"?nt:{},this.stack=""}p.prototype=Error.prototype;function b(q){if(process.env.NODE_ENV!=="production")var nt={},it=0;function at(mt,yt,Et,Tt,ht,ft,Ct){if(Tt=Tt||m,ft=ft||Et,Ct!==n){if(c){var rt=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw rt.name="Invariant Violation",rt}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Rt=Tt+":"+Et;!nt[Rt]&&it<3&&(o("You are manually calling a React.PropTypes validation function for the `"+ft+"` prop on `"+Tt+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),nt[Rt]=!0,it++)}}return yt[Et]==null?mt?yt[Et]===null?new p("The "+ht+" `"+ft+"` is marked as required "+("in `"+Tt+"`, but its value is `null`.")):new p("The "+ht+" `"+ft+"` is marked as required in "+("`"+Tt+"`, but its value is `undefined`.")):null:q(yt,Et,Tt,ht,ft)}var ct=at.bind(null,!1);return ct.isRequired=at.bind(null,!0),ct}function P(q){function nt(it,at,ct,mt,yt,Et){var Tt=it[at],ht=Y(Tt);if(ht!==q){var ft=G(Tt);return new p("Invalid "+mt+" `"+yt+"` of type "+("`"+ft+"` supplied to `"+ct+"`, expected ")+("`"+q+"`."),{expectedType:q})}return null}return b(nt)}function S(){return b(s)}function A(q){function nt(it,at,ct,mt,yt){if(typeof q!="function")return new p("Property `"+yt+"` of component `"+ct+"` has invalid PropType notation inside arrayOf.");var Et=it[at];if(!Array.isArray(Et)){var Tt=Y(Et);return new p("Invalid "+mt+" `"+yt+"` of type "+("`"+Tt+"` supplied to `"+ct+"`, expected an array."))}for(var ht=0;ht<Et.length;ht++){var ft=q(Et,ht,ct,mt,yt+"["+ht+"]",n);if(ft instanceof Error)return ft}return null}return b(nt)}function E(){function q(nt,it,at,ct,mt){var yt=nt[it];if(!l(yt)){var Et=Y(yt);return new p("Invalid "+ct+" `"+mt+"` of type "+("`"+Et+"` supplied to `"+at+"`, expected a single ReactElement."))}return null}return b(q)}function w(){function q(nt,it,at,ct,mt){var yt=nt[it];if(!e.isValidElementType(yt)){var Et=Y(yt);return new p("Invalid "+ct+" `"+mt+"` of type "+("`"+Et+"` supplied to `"+at+"`, expected a single ReactElement type."))}return null}return b(q)}function T(q){function nt(it,at,ct,mt,yt){if(!(it[at]instanceof q)){var Et=q.name||m,Tt=lt(it[at]);return new p("Invalid "+mt+" `"+yt+"` of type "+("`"+Tt+"` supplied to `"+ct+"`, expected ")+("instance of `"+Et+"`."))}return null}return b(nt)}function O(q){if(!Array.isArray(q))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function nt(it,at,ct,mt,yt){for(var Et=it[at],Tt=0;Tt<q.length;Tt++)if(x(Et,q[Tt]))return null;var ht=JSON.stringify(q,function(Ct,rt){var Rt=G(rt);return Rt==="symbol"?String(rt):rt});return new p("Invalid "+mt+" `"+yt+"` of value `"+String(Et)+"` "+("supplied to `"+ct+"`, expected one of "+ht+"."))}return b(nt)}function R(q){function nt(it,at,ct,mt,yt){if(typeof q!="function")return new p("Property `"+yt+"` of component `"+ct+"` has invalid PropType notation inside objectOf.");var Et=it[at],Tt=Y(Et);if(Tt!=="object")return new p("Invalid "+mt+" `"+yt+"` of type "+("`"+Tt+"` supplied to `"+ct+"`, expected an object."));for(var ht in Et)if(r(Et,ht)){var ft=q(Et,ht,ct,mt,yt+"."+ht,n);if(ft instanceof Error)return ft}return null}return b(nt)}function N(q){if(!Array.isArray(q))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var nt=0;nt<q.length;nt++){var it=q[nt];if(typeof it!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(it)+" at index "+nt+"."),s}function at(ct,mt,yt,Et,Tt){for(var ht=[],ft=0;ft<q.length;ft++){var Ct=q[ft],rt=Ct(ct,mt,yt,Et,Tt,n);if(rt==null)return null;rt.data&&r(rt.data,"expectedType")&&ht.push(rt.data.expectedType)}var Rt=ht.length>0?", expected one of type ["+ht.join(", ")+"]":"";return new p("Invalid "+Et+" `"+Tt+"` supplied to "+("`"+yt+"`"+Rt+"."))}return b(at)}function V(){function q(nt,it,at,ct,mt){return H(nt[it])?null:new p("Invalid "+ct+" `"+mt+"` supplied to "+("`"+at+"`, expected a ReactNode."))}return b(q)}function D(q,nt,it,at,ct){return new p((q||"React class")+": "+nt+" type `"+it+"."+at+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ct+"`.")}function j(q){function nt(it,at,ct,mt,yt){var Et=it[at],Tt=Y(Et);if(Tt!=="object")return new p("Invalid "+mt+" `"+yt+"` of type `"+Tt+"` "+("supplied to `"+ct+"`, expected `object`."));for(var ht in q){var ft=q[ht];if(typeof ft!="function")return D(ct,mt,yt,ht,G(ft));var Ct=ft(Et,ht,ct,mt,yt+"."+ht,n);if(Ct)return Ct}return null}return b(nt)}function K(q){function nt(it,at,ct,mt,yt){var Et=it[at],Tt=Y(Et);if(Tt!=="object")return new p("Invalid "+mt+" `"+yt+"` of type `"+Tt+"` "+("supplied to `"+ct+"`, expected `object`."));var ht=t({},it[at],q);for(var ft in ht){var Ct=q[ft];if(r(q,ft)&&typeof Ct!="function")return D(ct,mt,yt,ft,G(Ct));if(!Ct)return new p("Invalid "+mt+" `"+yt+"` key `"+ft+"` supplied to `"+ct+"`.\nBad object: "+JSON.stringify(it[at],null," ")+`
91
- Valid keys: `+JSON.stringify(Object.keys(q),null," "));var rt=Ct(Et,ft,ct,mt,yt+"."+ft,n);if(rt)return rt}return null}return b(nt)}function H(q){switch(typeof q){case"number":case"string":case"undefined":return!0;case"boolean":return!q;case"object":if(Array.isArray(q))return q.every(H);if(q===null||l(q))return!0;var nt=f(q);if(nt){var it=nt.call(q),at;if(nt!==q.entries){for(;!(at=it.next()).done;)if(!H(at.value))return!1}else for(;!(at=it.next()).done;){var ct=at.value;if(ct&&!H(ct[1]))return!1}}else return!1;return!0;default:return!1}}function z(q,nt){return q==="symbol"?!0:nt?nt["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&nt instanceof Symbol:!1}function Y(q){var nt=typeof q;return Array.isArray(q)?"array":q instanceof RegExp?"object":z(nt,q)?"symbol":nt}function G(q){if(typeof q>"u"||q===null)return""+q;var nt=Y(q);if(nt==="object"){if(q instanceof Date)return"date";if(q instanceof RegExp)return"regexp"}return nt}function J(q){var nt=G(q);switch(nt){case"array":case"object":return"an "+nt;case"boolean":case"date":case"regexp":return"a "+nt;default:return nt}}function lt(q){return!q.constructor||!q.constructor.name?m:q.constructor.name}return y.checkPropTypes=i,y.resetWarningCache=i.resetWarningCache,y.PropTypes=y,y},Lg}var Ng,BP;function xtt(){if(BP)return Ng;BP=1;var e=cx();function t(){}function n(){}return n.resetWarningCache=t,Ng=function(){function r(s,l,c,h,u,f){if(f!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Ng}if(process.env.NODE_ENV!=="production"){var wtt=Sk(),_tt=!0;xv.exports=btt()(wtt.isElement,_tt)}else xv.exports=xtt()();var Stt=xv.exports;const Pe=Me(Stt),{getOwnPropertyNames:Ptt,getOwnPropertySymbols:Att}=Object,{hasOwnProperty:Ttt}=Object.prototype;function jg(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Of(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:o}=i,s=o.get(n),l=o.get(r);if(s&&l)return s===r&&l===n;o.set(n,r),o.set(r,n);const c=e(n,r,i);return o.delete(n),o.delete(r),c}}function Ett(e){return e!=null?e[Symbol.toStringTag]:void 0}function zP(e){return Ptt(e).concat(Att(e))}const Ctt=Object.hasOwn||((e,t)=>Ttt.call(e,t));function Pa(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Ott="__v",Mtt="__o",ktt="_owner",{getOwnPropertyDescriptor:FP,keys:WP}=Object;function $tt(e,t){return e.byteLength===t.byteLength&&Ld(new Uint8Array(e),new Uint8Array(t))}function Itt(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Rtt(e,t){return e.byteLength===t.byteLength&&Ld(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Ltt(e,t){return Pa(e.getTime(),t.getTime())}function Ntt(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function jtt(e,t){return e===t}function VP(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.entries();let s,l,c=0;for(;(s=o.next())&&!s.done;){const h=t.entries();let u=!1,f=0;for(;(l=h.next())&&!l.done;){if(i[f]){f++;continue}const m=s.value,y=l.value;if(n.equals(m[0],y[0],c,f,e,t,n)&&n.equals(m[1],y[1],m[0],y[0],e,t,n)){u=i[f]=!0;break}f++}if(!u)return!1;c++}return!0}const Dtt=Pa;function Btt(e,t,n){const r=WP(e);let i=r.length;if(WP(t).length!==i)return!1;for(;i-- >0;)if(!Ak(e,t,n,r[i]))return!1;return!0}function Gc(e,t,n){const r=zP(e);let i=r.length;if(zP(t).length!==i)return!1;let o,s,l;for(;i-- >0;)if(o=r[i],!Ak(e,t,n,o)||(s=FP(e,o),l=FP(t,o),(s||l)&&(!s||!l||s.configurable!==l.configurable||s.enumerable!==l.enumerable||s.writable!==l.writable)))return!1;return!0}function ztt(e,t){return Pa(e.valueOf(),t.valueOf())}function Ftt(e,t){return e.source===t.source&&e.flags===t.flags}function UP(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.values();let s,l;for(;(s=o.next())&&!s.done;){const c=t.values();let h=!1,u=0;for(;(l=c.next())&&!l.done;){if(!i[u]&&n.equals(s.value,l.value,s.value,l.value,e,t,n)){h=i[u]=!0;break}u++}if(!h)return!1}return!0}function Ld(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Wtt(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Ak(e,t,n,r){return(r===ktt||r===Mtt||r===Ott)&&(e.$$typeof||t.$$typeof)?!0:Ctt(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const Vtt="[object ArrayBuffer]",Utt="[object Arguments]",Htt="[object Boolean]",qtt="[object DataView]",Gtt="[object Date]",Ztt="[object Error]",Ytt="[object Map]",Ktt="[object Number]",Xtt="[object Object]",Jtt="[object RegExp]",Qtt="[object Set]",tet="[object String]",eet={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},net="[object URL]",ret=Object.prototype.toString;function iet({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:h,areRegExpsEqual:u,areSetsEqual:f,areTypedArraysEqual:m,areUrlsEqual:y,unknownTagComparators:x}){return function(b,P,S){if(b===P)return!0;if(b==null||P==null)return!1;const A=typeof b;if(A!==typeof P)return!1;if(A!=="object")return A==="number"?l(b,P,S):A==="function"?o(b,P,S):!1;const E=b.constructor;if(E!==P.constructor)return!1;if(E===Object)return c(b,P,S);if(Array.isArray(b))return t(b,P,S);if(E===Date)return r(b,P,S);if(E===RegExp)return u(b,P,S);if(E===Map)return s(b,P,S);if(E===Set)return f(b,P,S);const w=ret.call(b);if(w===Gtt)return r(b,P,S);if(w===Jtt)return u(b,P,S);if(w===Ytt)return s(b,P,S);if(w===Qtt)return f(b,P,S);if(w===Xtt)return typeof b.then!="function"&&typeof P.then!="function"&&c(b,P,S);if(w===net)return y(b,P,S);if(w===Ztt)return i(b,P,S);if(w===Utt)return c(b,P,S);if(eet[w])return m(b,P,S);if(w===Vtt)return e(b,P,S);if(w===qtt)return n(b,P,S);if(w===Htt||w===Ktt||w===tet)return h(b,P,S);if(x){let T=x[w];if(!T){const O=Ett(b);O&&(T=x[O])}if(T)return T(b,P,S)}return!1}}function oet({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:$tt,areArraysEqual:n?Gc:Itt,areDataViewsEqual:Rtt,areDatesEqual:Ltt,areErrorsEqual:Ntt,areFunctionsEqual:jtt,areMapsEqual:n?jg(VP,Gc):VP,areNumbersEqual:Dtt,areObjectsEqual:n?Gc:Btt,arePrimitiveWrappersEqual:ztt,areRegExpsEqual:Ftt,areSetsEqual:n?jg(UP,Gc):UP,areTypedArraysEqual:n?jg(Ld,Gc):Ld,areUrlsEqual:Wtt,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=Of(r.areArraysEqual),o=Of(r.areMapsEqual),s=Of(r.areObjectsEqual),l=Of(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return r}function set(e){return function(t,n,r,i,o,s,l){return e(t,n,l)}}function aet({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(l,c){const{cache:h=e?new WeakMap:void 0,meta:u}=n();return t(l,c,{cache:h,equals:r,meta:u,strict:i})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const o={cache:void 0,equals:r,meta:void 0,strict:i};return function(l,c){return t(l,c,o)}}const cet=hs();hs({strict:!0});hs({circular:!0});hs({circular:!0,strict:!0});hs({createInternalComparator:()=>Pa});hs({strict:!0,createInternalComparator:()=>Pa});hs({circular:!0,createInternalComparator:()=>Pa});hs({circular:!0,createInternalComparator:()=>Pa,strict:!0});function hs(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=oet(e),s=iet(o),l=n?n(s):set(s);return aet({circular:t,comparator:s,createState:r,equals:l,strict:i})}function uet(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function HP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>t?(e(o),n=-1):uet(i)};requestAnimationFrame(r)}function wv(e){"@babel/helpers - typeof";return wv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wv(e)}function het(e){return met(e)||pet(e)||det(e)||fet()}function fet(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
90
+ */var kg,RP;function ytt(){if(RP)return kg;RP=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;var c=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(c.join("")!=="0123456789")return!1;var h={};return"abcdefghijklmnopqrst".split("").forEach(function(u){h[u]=u}),Object.keys(Object.assign({},h)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return kg=i()?Object.assign:function(o,s){for(var l,c=r(o),h,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)t.call(l,f)&&(c[f]=l[f]);if(e){h=e(l);for(var m=0;m<h.length;m++)n.call(l,h[m])&&(c[h[m]]=l[h[m]])}}return c},kg}var $g,LP;function cx(){if(LP)return $g;LP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return $g=e,$g}var Ig,NP;function Pk(){return NP||(NP=1,Ig=Function.call.bind(Object.prototype.hasOwnProperty)),Ig}var Rg,jP;function vtt(){if(jP)return Rg;jP=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=cx(),n={},r=Pk();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,l,c,h){if(process.env.NODE_ENV!=="production"){for(var u in o)if(r(o,u)){var f;try{if(typeof o[u]!="function"){var m=Error((c||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}f=o[u](s,u,c,l,null,t)}catch(x){f=x}if(f&&!(f instanceof Error)&&e((c||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var y=h?h():"";e("Failed "+l+" type: "+f.message+(y??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Rg=i,Rg}var Lg,DP;function btt(){if(DP)return Lg;DP=1;var e=Sk(),t=ytt(),n=cx(),r=Pk(),i=vtt(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(l){var c="Warning: "+l;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function s(){return null}return Lg=function(l,c){var h=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(q){var nt=q&&(h&&q[h]||q[u]);if(typeof nt=="function")return nt}var m="<<anonymous>>",y={array:P("array"),bigint:P("bigint"),bool:P("boolean"),func:P("function"),number:P("number"),object:P("object"),string:P("string"),symbol:P("symbol"),any:S(),arrayOf:A,element:E(),elementType:w(),instanceOf:T,node:V(),objectOf:R,oneOf:O,oneOfType:N,shape:j,exact:K};function x(q,nt){return q===nt?q!==0||1/q===1/nt:q!==q&&nt!==nt}function p(q,nt){this.message=q,this.data=nt&&typeof nt=="object"?nt:{},this.stack=""}p.prototype=Error.prototype;function b(q){if(process.env.NODE_ENV!=="production")var nt={},it=0;function at(gt,yt,Et,Tt,ht,ft,Ct){if(Tt=Tt||m,ft=ft||Et,Ct!==n){if(c){var rt=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw rt.name="Invariant Violation",rt}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Rt=Tt+":"+Et;!nt[Rt]&&it<3&&(o("You are manually calling a React.PropTypes validation function for the `"+ft+"` prop on `"+Tt+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),nt[Rt]=!0,it++)}}return yt[Et]==null?gt?yt[Et]===null?new p("The "+ht+" `"+ft+"` is marked as required "+("in `"+Tt+"`, but its value is `null`.")):new p("The "+ht+" `"+ft+"` is marked as required in "+("`"+Tt+"`, but its value is `undefined`.")):null:q(yt,Et,Tt,ht,ft)}var ct=at.bind(null,!1);return ct.isRequired=at.bind(null,!0),ct}function P(q){function nt(it,at,ct,gt,yt,Et){var Tt=it[at],ht=Y(Tt);if(ht!==q){var ft=G(Tt);return new p("Invalid "+gt+" `"+yt+"` of type "+("`"+ft+"` supplied to `"+ct+"`, expected ")+("`"+q+"`."),{expectedType:q})}return null}return b(nt)}function S(){return b(s)}function A(q){function nt(it,at,ct,gt,yt){if(typeof q!="function")return new p("Property `"+yt+"` of component `"+ct+"` has invalid PropType notation inside arrayOf.");var Et=it[at];if(!Array.isArray(Et)){var Tt=Y(Et);return new p("Invalid "+gt+" `"+yt+"` of type "+("`"+Tt+"` supplied to `"+ct+"`, expected an array."))}for(var ht=0;ht<Et.length;ht++){var ft=q(Et,ht,ct,gt,yt+"["+ht+"]",n);if(ft instanceof Error)return ft}return null}return b(nt)}function E(){function q(nt,it,at,ct,gt){var yt=nt[it];if(!l(yt)){var Et=Y(yt);return new p("Invalid "+ct+" `"+gt+"` of type "+("`"+Et+"` supplied to `"+at+"`, expected a single ReactElement."))}return null}return b(q)}function w(){function q(nt,it,at,ct,gt){var yt=nt[it];if(!e.isValidElementType(yt)){var Et=Y(yt);return new p("Invalid "+ct+" `"+gt+"` of type "+("`"+Et+"` supplied to `"+at+"`, expected a single ReactElement type."))}return null}return b(q)}function T(q){function nt(it,at,ct,gt,yt){if(!(it[at]instanceof q)){var Et=q.name||m,Tt=lt(it[at]);return new p("Invalid "+gt+" `"+yt+"` of type "+("`"+Tt+"` supplied to `"+ct+"`, expected ")+("instance of `"+Et+"`."))}return null}return b(nt)}function O(q){if(!Array.isArray(q))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function nt(it,at,ct,gt,yt){for(var Et=it[at],Tt=0;Tt<q.length;Tt++)if(x(Et,q[Tt]))return null;var ht=JSON.stringify(q,function(Ct,rt){var Rt=G(rt);return Rt==="symbol"?String(rt):rt});return new p("Invalid "+gt+" `"+yt+"` of value `"+String(Et)+"` "+("supplied to `"+ct+"`, expected one of "+ht+"."))}return b(nt)}function R(q){function nt(it,at,ct,gt,yt){if(typeof q!="function")return new p("Property `"+yt+"` of component `"+ct+"` has invalid PropType notation inside objectOf.");var Et=it[at],Tt=Y(Et);if(Tt!=="object")return new p("Invalid "+gt+" `"+yt+"` of type "+("`"+Tt+"` supplied to `"+ct+"`, expected an object."));for(var ht in Et)if(r(Et,ht)){var ft=q(Et,ht,ct,gt,yt+"."+ht,n);if(ft instanceof Error)return ft}return null}return b(nt)}function N(q){if(!Array.isArray(q))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var nt=0;nt<q.length;nt++){var it=q[nt];if(typeof it!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(it)+" at index "+nt+"."),s}function at(ct,gt,yt,Et,Tt){for(var ht=[],ft=0;ft<q.length;ft++){var Ct=q[ft],rt=Ct(ct,gt,yt,Et,Tt,n);if(rt==null)return null;rt.data&&r(rt.data,"expectedType")&&ht.push(rt.data.expectedType)}var Rt=ht.length>0?", expected one of type ["+ht.join(", ")+"]":"";return new p("Invalid "+Et+" `"+Tt+"` supplied to "+("`"+yt+"`"+Rt+"."))}return b(at)}function V(){function q(nt,it,at,ct,gt){return H(nt[it])?null:new p("Invalid "+ct+" `"+gt+"` supplied to "+("`"+at+"`, expected a ReactNode."))}return b(q)}function D(q,nt,it,at,ct){return new p((q||"React class")+": "+nt+" type `"+it+"."+at+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ct+"`.")}function j(q){function nt(it,at,ct,gt,yt){var Et=it[at],Tt=Y(Et);if(Tt!=="object")return new p("Invalid "+gt+" `"+yt+"` of type `"+Tt+"` "+("supplied to `"+ct+"`, expected `object`."));for(var ht in q){var ft=q[ht];if(typeof ft!="function")return D(ct,gt,yt,ht,G(ft));var Ct=ft(Et,ht,ct,gt,yt+"."+ht,n);if(Ct)return Ct}return null}return b(nt)}function K(q){function nt(it,at,ct,gt,yt){var Et=it[at],Tt=Y(Et);if(Tt!=="object")return new p("Invalid "+gt+" `"+yt+"` of type `"+Tt+"` "+("supplied to `"+ct+"`, expected `object`."));var ht=t({},it[at],q);for(var ft in ht){var Ct=q[ft];if(r(q,ft)&&typeof Ct!="function")return D(ct,gt,yt,ft,G(Ct));if(!Ct)return new p("Invalid "+gt+" `"+yt+"` key `"+ft+"` supplied to `"+ct+"`.\nBad object: "+JSON.stringify(it[at],null," ")+`
91
+ Valid keys: `+JSON.stringify(Object.keys(q),null," "));var rt=Ct(Et,ft,ct,gt,yt+"."+ft,n);if(rt)return rt}return null}return b(nt)}function H(q){switch(typeof q){case"number":case"string":case"undefined":return!0;case"boolean":return!q;case"object":if(Array.isArray(q))return q.every(H);if(q===null||l(q))return!0;var nt=f(q);if(nt){var it=nt.call(q),at;if(nt!==q.entries){for(;!(at=it.next()).done;)if(!H(at.value))return!1}else for(;!(at=it.next()).done;){var ct=at.value;if(ct&&!H(ct[1]))return!1}}else return!1;return!0;default:return!1}}function z(q,nt){return q==="symbol"?!0:nt?nt["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&nt instanceof Symbol:!1}function Y(q){var nt=typeof q;return Array.isArray(q)?"array":q instanceof RegExp?"object":z(nt,q)?"symbol":nt}function G(q){if(typeof q>"u"||q===null)return""+q;var nt=Y(q);if(nt==="object"){if(q instanceof Date)return"date";if(q instanceof RegExp)return"regexp"}return nt}function J(q){var nt=G(q);switch(nt){case"array":case"object":return"an "+nt;case"boolean":case"date":case"regexp":return"a "+nt;default:return nt}}function lt(q){return!q.constructor||!q.constructor.name?m:q.constructor.name}return y.checkPropTypes=i,y.resetWarningCache=i.resetWarningCache,y.PropTypes=y,y},Lg}var Ng,BP;function xtt(){if(BP)return Ng;BP=1;var e=cx();function t(){}function n(){}return n.resetWarningCache=t,Ng=function(){function r(s,l,c,h,u,f){if(f!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Ng}if(process.env.NODE_ENV!=="production"){var wtt=Sk(),_tt=!0;xv.exports=btt()(wtt.isElement,_tt)}else xv.exports=xtt()();var Stt=xv.exports;const Pe=Me(Stt),{getOwnPropertyNames:Ptt,getOwnPropertySymbols:Att}=Object,{hasOwnProperty:Ttt}=Object.prototype;function jg(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Of(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:o}=i,s=o.get(n),l=o.get(r);if(s&&l)return s===r&&l===n;o.set(n,r),o.set(r,n);const c=e(n,r,i);return o.delete(n),o.delete(r),c}}function Ett(e){return e!=null?e[Symbol.toStringTag]:void 0}function zP(e){return Ptt(e).concat(Att(e))}const Ctt=Object.hasOwn||((e,t)=>Ttt.call(e,t));function Pa(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Ott="__v",Mtt="__o",ktt="_owner",{getOwnPropertyDescriptor:FP,keys:WP}=Object;function $tt(e,t){return e.byteLength===t.byteLength&&Ld(new Uint8Array(e),new Uint8Array(t))}function Itt(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Rtt(e,t){return e.byteLength===t.byteLength&&Ld(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Ltt(e,t){return Pa(e.getTime(),t.getTime())}function Ntt(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function jtt(e,t){return e===t}function VP(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.entries();let s,l,c=0;for(;(s=o.next())&&!s.done;){const h=t.entries();let u=!1,f=0;for(;(l=h.next())&&!l.done;){if(i[f]){f++;continue}const m=s.value,y=l.value;if(n.equals(m[0],y[0],c,f,e,t,n)&&n.equals(m[1],y[1],m[0],y[0],e,t,n)){u=i[f]=!0;break}f++}if(!u)return!1;c++}return!0}const Dtt=Pa;function Btt(e,t,n){const r=WP(e);let i=r.length;if(WP(t).length!==i)return!1;for(;i-- >0;)if(!Ak(e,t,n,r[i]))return!1;return!0}function Gc(e,t,n){const r=zP(e);let i=r.length;if(zP(t).length!==i)return!1;let o,s,l;for(;i-- >0;)if(o=r[i],!Ak(e,t,n,o)||(s=FP(e,o),l=FP(t,o),(s||l)&&(!s||!l||s.configurable!==l.configurable||s.enumerable!==l.enumerable||s.writable!==l.writable)))return!1;return!0}function ztt(e,t){return Pa(e.valueOf(),t.valueOf())}function Ftt(e,t){return e.source===t.source&&e.flags===t.flags}function UP(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.values();let s,l;for(;(s=o.next())&&!s.done;){const c=t.values();let h=!1,u=0;for(;(l=c.next())&&!l.done;){if(!i[u]&&n.equals(s.value,l.value,s.value,l.value,e,t,n)){h=i[u]=!0;break}u++}if(!h)return!1}return!0}function Ld(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Wtt(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Ak(e,t,n,r){return(r===ktt||r===Mtt||r===Ott)&&(e.$$typeof||t.$$typeof)?!0:Ctt(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const Vtt="[object ArrayBuffer]",Utt="[object Arguments]",Htt="[object Boolean]",qtt="[object DataView]",Gtt="[object Date]",Ztt="[object Error]",Ytt="[object Map]",Ktt="[object Number]",Xtt="[object Object]",Jtt="[object RegExp]",Qtt="[object Set]",tet="[object String]",eet={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},net="[object URL]",ret=Object.prototype.toString;function iet({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:h,areRegExpsEqual:u,areSetsEqual:f,areTypedArraysEqual:m,areUrlsEqual:y,unknownTagComparators:x}){return function(b,P,S){if(b===P)return!0;if(b==null||P==null)return!1;const A=typeof b;if(A!==typeof P)return!1;if(A!=="object")return A==="number"?l(b,P,S):A==="function"?o(b,P,S):!1;const E=b.constructor;if(E!==P.constructor)return!1;if(E===Object)return c(b,P,S);if(Array.isArray(b))return t(b,P,S);if(E===Date)return r(b,P,S);if(E===RegExp)return u(b,P,S);if(E===Map)return s(b,P,S);if(E===Set)return f(b,P,S);const w=ret.call(b);if(w===Gtt)return r(b,P,S);if(w===Jtt)return u(b,P,S);if(w===Ytt)return s(b,P,S);if(w===Qtt)return f(b,P,S);if(w===Xtt)return typeof b.then!="function"&&typeof P.then!="function"&&c(b,P,S);if(w===net)return y(b,P,S);if(w===Ztt)return i(b,P,S);if(w===Utt)return c(b,P,S);if(eet[w])return m(b,P,S);if(w===Vtt)return e(b,P,S);if(w===qtt)return n(b,P,S);if(w===Htt||w===Ktt||w===tet)return h(b,P,S);if(x){let T=x[w];if(!T){const O=Ett(b);O&&(T=x[O])}if(T)return T(b,P,S)}return!1}}function oet({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:$tt,areArraysEqual:n?Gc:Itt,areDataViewsEqual:Rtt,areDatesEqual:Ltt,areErrorsEqual:Ntt,areFunctionsEqual:jtt,areMapsEqual:n?jg(VP,Gc):VP,areNumbersEqual:Dtt,areObjectsEqual:n?Gc:Btt,arePrimitiveWrappersEqual:ztt,areRegExpsEqual:Ftt,areSetsEqual:n?jg(UP,Gc):UP,areTypedArraysEqual:n?jg(Ld,Gc):Ld,areUrlsEqual:Wtt,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=Of(r.areArraysEqual),o=Of(r.areMapsEqual),s=Of(r.areObjectsEqual),l=Of(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return r}function set(e){return function(t,n,r,i,o,s,l){return e(t,n,l)}}function aet({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(l,c){const{cache:h=e?new WeakMap:void 0,meta:u}=n();return t(l,c,{cache:h,equals:r,meta:u,strict:i})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const o={cache:void 0,equals:r,meta:void 0,strict:i};return function(l,c){return t(l,c,o)}}const cet=hs();hs({strict:!0});hs({circular:!0});hs({circular:!0,strict:!0});hs({createInternalComparator:()=>Pa});hs({strict:!0,createInternalComparator:()=>Pa});hs({circular:!0,createInternalComparator:()=>Pa});hs({circular:!0,createInternalComparator:()=>Pa,strict:!0});function hs(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=oet(e),s=iet(o),l=n?n(s):set(s);return aet({circular:t,comparator:s,createState:r,equals:l,strict:i})}function uet(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function HP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>t?(e(o),n=-1):uet(i)};requestAnimationFrame(r)}function wv(e){"@babel/helpers - typeof";return wv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wv(e)}function het(e){return met(e)||pet(e)||det(e)||fet()}function fet(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
92
92
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function det(e,t){if(e){if(typeof e=="string")return qP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qP(e,t)}}function qP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pet(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function met(e){if(Array.isArray(e))return e}function get(){var e={},t=function(){return null},n=!1,r=function i(o){if(!n){if(Array.isArray(o)){if(!o.length)return;var s=o,l=het(s),c=l[0],h=l.slice(1);if(typeof c=="number"){HP(i.bind(null,h),c);return}i(c),HP(i.bind(null,h));return}wv(o)==="object"&&(e=o,t(e)),typeof o=="function"&&o()}};return{stop:function(){n=!0},start:function(o){n=!1,r(o)},subscribe:function(o){return t=o,function(){t=function(){return null}}}}}function Ju(e){"@babel/helpers - typeof";return Ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ju(e)}function GP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ZP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GP(Object(n),!0).forEach(function(r){Tk(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tk(e,t,n){return t=yet(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yet(e){var t=vet(e,"string");return Ju(t)==="symbol"?t:String(t)}function vet(e,t){if(Ju(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ju(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bet=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(o){return i.includes(o)})})},xet=function(t){return t},wet=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},du=function(t,n){return Object.keys(n).reduce(function(r,i){return ZP(ZP({},r),{},Tk({},i,t(i,n[i])))},{})},YP=function(t,n,r){return t.map(function(i){return"".concat(wet(i)," ").concat(n,"ms ").concat(r)}).join(",")},_et=process.env.NODE_ENV!=="production",Nd=function(t,n,r,i,o,s,l,c){if(_et&&typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var h=[r,i,o,s,l,c],u=0;console.warn(n.replace(/%s/g,function(){return h[u++]}))}};function Pet(e,t){return Eet(e)||Tet(e,t)||Ek(e,t)||Aet()}function Aet(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
93
93
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tet(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function Eet(e){if(Array.isArray(e))return e}function Cet(e){return ket(e)||Met(e)||Ek(e)||Oet()}function Oet(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
94
94
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ek(e,t){if(e){if(typeof e=="string")return _v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _v(e,t)}}function Met(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ket(e){if(Array.isArray(e))return _v(e)}function _v(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var jd=1e-4,Ck=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},Ok=function(t,n){return t.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},KP=function(t,n){return function(r){var i=Ck(t,n);return Ok(i,r)}},$et=function(t,n){return function(r){var i=Ck(t,n),o=[].concat(Cet(i.map(function(s,l){return s*l}).slice(1)),[0]);return Ok(o,r)}},XP=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0],o=n[1],s=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":i=0,o=0,s=1,l=1;break;case"ease":i=.25,o=.1,s=.25,l=1;break;case"ease-in":i=.42,o=0,s=1,l=1;break;case"ease-out":i=.42,o=0,s=.58,l=1;break;case"ease-in-out":i=0,o=0,s=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var h=c[1].split(")")[0].split(",").map(function(b){return parseFloat(b)}),u=Pet(h,4);i=u[0],o=u[1],s=u[2],l=u[3]}else Nd(!1,"[configBezier]: arguments should be one of oneOf 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', instead received %s",n)}}Nd([i,s,o,l].every(function(b){return typeof b=="number"&&b>=0&&b<=1}),"[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s",n);var f=KP(i,s),m=KP(o,l),y=$et(i,s),x=function(P){return P>1?1:P<0?0:P},p=function(P){for(var S=P>1?1:P,A=S,E=0;E<8;++E){var w=f(A)-S,T=y(A);if(Math.abs(w-S)<jd||T<jd)return m(A);A=x(A-w/T)}return m(A)};return p.isStepper=!1,p},Iet=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,o=i===void 0?8:i,s=t.dt,l=s===void 0?17:s,c=function(u,f,m){var y=-(u-f)*r,x=m*o,p=m+(y-x)*l/1e3,b=m*l/1e3+u;return Math.abs(b-f)<jd&&Math.abs(p)<jd?[f,0]:[b,p]};return c.isStepper=!0,c.dt=l,c},Ret=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return XP(i);case"spring":return Iet();default:if(i.split("(")[0]==="cubic-bezier")return XP(i);Nd(!1,"[configEasing]: first argument should be one of 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', 'linear' and 'spring', instead received %s",n)}return typeof i=="function"?i:(Nd(!1,"[configEasing]: first argument type should be function or string, instead received %s",n),null)};function Qu(e){"@babel/helpers - typeof";return Qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qu(e)}function JP(e){return jet(e)||Net(e)||Mk(e)||Let()}function Let(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
@@ -109,24 +109,24 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
109
109
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xnt(e,t){if(e){if(typeof e=="string")return Mv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mv(e,t)}}function wnt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _nt(e){if(Array.isArray(e))return Mv(e)}function Mv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var sA=function(t){return t&&t.x===+t.x&&t.y===+t.y},Snt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){sA(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),sA(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},pu=function(t,n){var r=Snt(t);n&&(r=[r.reduce(function(o,s){return[].concat(oA(o),oA(s))},[])]);var i=r.map(function(o){return o.reduce(function(s,l,c){return"".concat(s).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},Pnt=function(t,n,r){var i=pu(t,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(pu(n.reverse(),r).slice(1))},Ant=function(t){var n=t.points,r=t.className,i=t.baseLinePoints,o=t.connectNulls,s=ynt(t,gnt);if(!n||!n.length)return null;var l=Jt("recharts-polygon",r);if(i&&i.length){var c=s.stroke&&s.stroke!=="none",h=Pnt(n,i,o);return v.createElement("g",{className:l},v.createElement("path",el({},Lt(s,!0),{fill:h.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:h})),c?v.createElement("path",el({},Lt(s,!0),{fill:"none",d:pu(n,o)})):null,c?v.createElement("path",el({},Lt(s,!0),{fill:"none",d:pu(i,o)})):null)}var u=pu(n,o);return v.createElement("path",el({},Lt(s,!0),{fill:u.slice(-1)==="Z"?s.fill:"none",className:l,d:u}))};function kv(){return kv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kv.apply(this,arguments)}var em=function(t){var n=t.cx,r=t.cy,i=t.r,o=t.className,s=Jt("recharts-dot",o);return n===+n&&r===+r&&i===+i?Jn.createElement("circle",kv({},Lt(t,!1),rd(t),{className:s,cx:n,cy:r,r:i})):null};function eh(e){"@babel/helpers - typeof";return eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eh(e)}var Tnt=["x","y","top","left","width","height","className"];function $v(){return $v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$v.apply(this,arguments)}function aA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ent(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aA(Object(n),!0).forEach(function(r){Cnt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cnt(e,t,n){return t=Ont(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ont(e){var t=Mnt(e,"string");return eh(t)=="symbol"?t:t+""}function Mnt(e,t){if(eh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(eh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function knt(e,t){if(e==null)return{};var n=$nt(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $nt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Int=function(t,n,r,i,o,s){return"M".concat(t,",").concat(o,"v").concat(i,"M").concat(s,",").concat(n,"h").concat(r)},Rnt=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,s=t.top,l=s===void 0?0:s,c=t.left,h=c===void 0?0:c,u=t.width,f=u===void 0?0:u,m=t.height,y=m===void 0?0:m,x=t.className,p=knt(t,Tnt),b=Ent({x:r,y:o,top:l,left:h,width:f,height:y},p);return!xt(r)||!xt(o)||!xt(f)||!xt(y)||!xt(l)||!xt(h)?null:v.createElement("path",$v({},Lt(b,!0),{className:Jt("recharts-cross",x),d:Int(r,o,f,y,l,h)}))},Lnt=Xp,Nnt=UM,jnt=Ei;function Dnt(e,t){return e&&e.length?Lnt(e,jnt(t),Nnt):void 0}var Bnt=Dnt;const znt=Me(Bnt);var Fnt=Xp,Wnt=Ei,Vnt=HM;function Unt(e,t){return e&&e.length?Fnt(e,Wnt(t),Vnt):void 0}var Hnt=Unt;const qnt=Me(Hnt);var Gnt=["cx","cy","angle","ticks","axisLine"],Znt=["ticks","tick","angle","tickFormatter","stroke"];function Ol(e){"@babel/helpers - typeof";return Ol=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ol(e)}function mu(){return mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mu.apply(this,arguments)}function lA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lA(Object(n),!0).forEach(function(r){nm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cA(e,t){if(e==null)return{};var n=Ynt(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ynt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Knt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ik(r.key),r)}}function Xnt(e,t,n){return t&&uA(e.prototype,t),n&&uA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jnt(e,t,n){return t=Fd(t),Qnt(e,$k()?Reflect.construct(t,n||[],Fd(e).constructor):t.apply(e,n))}function Qnt(e,t){if(t&&(Ol(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return trt(e)}function trt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($k=function(){return!!e})()}function Fd(e){return Fd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Fd(e)}function ert(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Iv(e,t)}function Iv(e,t){return Iv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Iv(e,t)}function nm(e,t,n){return t=Ik(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ik(e){var t=nrt(e,"string");return Ol(t)=="symbol"?t:t+""}function nrt(e,t){if(Ol(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ol(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rm=function(e){function t(){return Knt(this,t),Jnt(this,t,arguments)}return ert(t,e),Xnt(t,[{key:"getTickValueCoord",value:function(r){var i=r.coordinate,o=this.props,s=o.angle,l=o.cx,c=o.cy;return ze(l,c,i,s)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,i;switch(r){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var r=this.props,i=r.cx,o=r.cy,s=r.angle,l=r.ticks,c=znt(l,function(u){return u.coordinate||0}),h=qnt(l,function(u){return u.coordinate||0});return{cx:i,cy:o,startAngle:s,endAngle:s,innerRadius:h.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,o=r.cy,s=r.angle,l=r.ticks,c=r.axisLine,h=cA(r,Gnt),u=l.reduce(function(x,p){return[Math.min(x[0],p.coordinate),Math.max(x[1],p.coordinate)]},[1/0,-1/0]),f=ze(i,o,u[0],s),m=ze(i,o,u[1],s),y=Bs(Bs(Bs({},Lt(h,!1)),{},{fill:"none"},Lt(c,!1)),{},{x1:f.x,y1:f.y,x2:m.x,y2:m.y});return v.createElement("line",mu({className:"recharts-polar-radius-axis-line"},y))}},{key:"renderTicks",value:function(){var r=this,i=this.props,o=i.ticks,s=i.tick,l=i.angle,c=i.tickFormatter,h=i.stroke,u=cA(i,Znt),f=this.getTickTextAnchor(),m=Lt(u,!1),y=Lt(s,!1),x=o.map(function(p,b){var P=r.getTickValueCoord(p),S=Bs(Bs(Bs(Bs({textAnchor:f,transform:"rotate(".concat(90-l,", ").concat(P.x,", ").concat(P.y,")")},m),{},{stroke:"none",fill:h},y),{},{index:b},P),{},{payload:p});return v.createElement(ue,mu({className:Jt("recharts-polar-radius-axis-tick",bk(s)),key:"tick-".concat(p.coordinate)},rs(r.props,p,b)),t.renderTickItem(s,S,c?c(p.value,b):p.value))});return v.createElement(ue,{className:"recharts-polar-radius-axis-ticks"},x)}},{key:"render",value:function(){var r=this.props,i=r.ticks,o=r.axisLine,s=r.tick;return!i||!i.length?null:v.createElement(ue,{className:Jt("recharts-polar-radius-axis",this.props.className)},o&&this.renderAxisLine(),s&&this.renderTicks(),An.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,i,o){var s;return v.isValidElement(r)?s=v.cloneElement(r,i):Vt(r)?s=r(i):s=v.createElement(da,mu({},i,{className:"recharts-polar-radius-axis-tick-value"}),o),s}}])}(v.PureComponent);nm(rm,"displayName","PolarRadiusAxis");nm(rm,"axisType","radiusAxis");nm(rm,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Ml(e){"@babel/helpers - typeof";return Ml=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ml(e)}function Zs(){return Zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zs.apply(this,arguments)}function hA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hA(Object(n),!0).forEach(function(r){im(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rrt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Lk(r.key),r)}}function irt(e,t,n){return t&&fA(e.prototype,t),n&&fA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ort(e,t,n){return t=Wd(t),srt(e,Rk()?Reflect.construct(t,n||[],Wd(e).constructor):t.apply(e,n))}function srt(e,t){if(t&&(Ml(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return art(e)}function art(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Rk=function(){return!!e})()}function Wd(e){return Wd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wd(e)}function lrt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rv(e,t)}function Rv(e,t){return Rv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Rv(e,t)}function im(e,t,n){return t=Lk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lk(e){var t=crt(e,"string");return Ml(t)=="symbol"?t:t+""}function crt(e,t){if(Ml(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ml(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var urt=Math.PI/180,dA=1e-5,om=function(e){function t(){return rrt(this,t),ort(this,t,arguments)}return lrt(t,e),irt(t,[{key:"getTickLineCoord",value:function(r){var i=this.props,o=i.cx,s=i.cy,l=i.radius,c=i.orientation,h=i.tickSize,u=h||8,f=ze(o,s,l,r.coordinate),m=ze(o,s,l+(c==="inner"?-1:1)*u,r.coordinate);return{x1:f.x,y1:f.y,x2:m.x,y2:m.y}}},{key:"getTickTextAnchor",value:function(r){var i=this.props.orientation,o=Math.cos(-r.coordinate*urt),s;return o>dA?s=i==="outer"?"start":"end":o<-dA?s=i==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,o=r.cy,s=r.radius,l=r.axisLine,c=r.axisLineType,h=zs(zs({},Lt(this.props,!1)),{},{fill:"none"},Lt(l,!1));if(c==="circle")return v.createElement(em,Zs({className:"recharts-polar-angle-axis-line"},h,{cx:i,cy:o,r:s}));var u=this.props.ticks,f=u.map(function(m){return ze(i,o,s,m.coordinate)});return v.createElement(Ant,Zs({className:"recharts-polar-angle-axis-line"},h,{points:f}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,o=i.ticks,s=i.tick,l=i.tickLine,c=i.tickFormatter,h=i.stroke,u=Lt(this.props,!1),f=Lt(s,!1),m=zs(zs({},u),{},{fill:"none"},Lt(l,!1)),y=o.map(function(x,p){var b=r.getTickLineCoord(x),P=r.getTickTextAnchor(x),S=zs(zs(zs({textAnchor:P},u),{},{stroke:"none",fill:h},f),{},{index:p,payload:x,x:b.x2,y:b.y2});return v.createElement(ue,Zs({className:Jt("recharts-polar-angle-axis-tick",bk(s)),key:"tick-".concat(x.coordinate)},rs(r.props,x,p)),l&&v.createElement("line",Zs({className:"recharts-polar-angle-axis-tick-line"},m,b)),s&&t.renderTickItem(s,S,c?c(x.value,p):x.value))});return v.createElement(ue,{className:"recharts-polar-angle-axis-ticks"},y)}},{key:"render",value:function(){var r=this.props,i=r.ticks,o=r.radius,s=r.axisLine;return o<=0||!i||!i.length?null:v.createElement(ue,{className:Jt("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,o){var s;return v.isValidElement(r)?s=v.cloneElement(r,i):Vt(r)?s=r(i):s=v.createElement(da,Zs({},i,{className:"recharts-polar-angle-axis-tick-value"}),o),s}}])}(v.PureComponent);im(om,"displayName","PolarAngleAxis");im(om,"axisType","angleAxis");im(om,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var hrt=FO,frt=hrt(Object.getPrototypeOf,Object),drt=frt,prt=vo,mrt=drt,grt=bo,yrt="[object Object]",vrt=Function.prototype,brt=Object.prototype,Nk=vrt.toString,xrt=brt.hasOwnProperty,wrt=Nk.call(Object);function _rt(e){if(!grt(e)||prt(e)!=yrt)return!1;var t=mrt(e);if(t===null)return!0;var n=xrt.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Nk.call(n)==wrt}var Srt=_rt;const Prt=Me(Srt);var Art=vo,Trt=bo,Ert="[object Boolean]";function Crt(e){return e===!0||e===!1||Trt(e)&&Art(e)==Ert}var Ort=Crt;const Mrt=Me(Ort);function nh(e){"@babel/helpers - typeof";return nh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nh(e)}function Vd(){return Vd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vd.apply(this,arguments)}function krt(e,t){return Lrt(e)||Rrt(e,t)||Irt(e,t)||$rt()}function $rt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
110
110
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Irt(e,t){if(e){if(typeof e=="string")return pA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pA(e,t)}}function pA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Rrt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function Lrt(e){if(Array.isArray(e))return e}function mA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mA(Object(n),!0).forEach(function(r){Nrt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nrt(e,t,n){return t=jrt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jrt(e){var t=Drt(e,"string");return nh(t)=="symbol"?t:t+""}function Drt(e,t){if(nh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yA=function(t,n,r,i,o){var s=r-i,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-s/2,",").concat(n+o),l+="L ".concat(t+r-s/2-i,",").concat(n+o),l+="L ".concat(t,",").concat(n," Z"),l},Brt={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},zrt=function(t){var n=gA(gA({},Brt),t),r=v.useRef(),i=v.useState(-1),o=krt(i,2),s=o[0],l=o[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var A=r.current.getTotalLength();A&&l(A)}catch{}},[]);var c=n.x,h=n.y,u=n.upperWidth,f=n.lowerWidth,m=n.height,y=n.className,x=n.animationEasing,p=n.animationDuration,b=n.animationBegin,P=n.isUpdateAnimationActive;if(c!==+c||h!==+h||u!==+u||f!==+f||m!==+m||u===0&&f===0||m===0)return null;var S=Jt("recharts-trapezoid",y);return P?v.createElement(ni,{canBegin:s>0,from:{upperWidth:0,lowerWidth:0,height:m,x:c,y:h},to:{upperWidth:u,lowerWidth:f,height:m,x:c,y:h},duration:p,animationEasing:x,isActive:P},function(A){var E=A.upperWidth,w=A.lowerWidth,T=A.height,O=A.x,R=A.y;return v.createElement(ni,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:p,easing:x},v.createElement("path",Vd({},Lt(n,!0),{className:S,d:yA(O,R,E,w,T),ref:r})))}):v.createElement("g",null,v.createElement("path",Vd({},Lt(n,!0),{className:S,d:yA(c,h,u,f,m)})))},Frt=["option","shapeType","propTransformer","activeClassName","isActive"];function rh(e){"@babel/helpers - typeof";return rh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rh(e)}function Wrt(e,t){if(e==null)return{};var n=Vrt(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Vrt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function vA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ud(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vA(Object(n),!0).forEach(function(r){Urt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Urt(e,t,n){return t=Hrt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hrt(e){var t=qrt(e,"string");return rh(t)=="symbol"?t:t+""}function qrt(e,t){if(rh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(rh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Grt(e,t){return Ud(Ud({},t),e)}function Zrt(e,t){return e==="symbols"}function bA(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return v.createElement(ux,n);case"trapezoid":return v.createElement(zrt,n);case"sector":return v.createElement(_k,n);case"symbols":if(Zrt(t))return v.createElement(zp,n);break;default:return null}}function Yrt(e){return v.isValidElement(e)?e.props:e}function Hd(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?Grt:r,o=e.activeClassName,s=o===void 0?"recharts-active-shape":o,l=e.isActive,c=Wrt(e,Frt),h;if(v.isValidElement(t))h=v.cloneElement(t,Ud(Ud({},c),Yrt(t)));else if(Vt(t))h=t(c);else if(Prt(t)&&!Mrt(t)){var u=i(t,c);h=v.createElement(bA,{shapeType:n,elementProps:u})}else{var f=c;h=v.createElement(bA,{shapeType:n,elementProps:f})}return l?v.createElement(ue,{className:s},h):h}function sm(e,t){return t!=null&&"trapezoids"in e.props}function am(e,t){return t!=null&&"sectors"in e.props}function ih(e,t){return t!=null&&"points"in e.props}function Krt(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,o=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return i&&o}function Xrt(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function Jrt(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function Qrt(e,t){var n;return sm(e,t)?n=Krt:am(e,t)?n=Xrt:ih(e,t)&&(n=Jrt),n}function tit(e,t){var n;return sm(e,t)?n="trapezoids":am(e,t)?n="sectors":ih(e,t)&&(n="points"),n}function eit(e,t){if(sm(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(am(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return ih(e,t)?t.payload:{}}function nit(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=tit(n,t),o=eit(n,t),s=r.filter(function(c,h){var u=pa(o,c),f=n.props[i].filter(function(x){var p=Qrt(n,t);return p(x,t)}),m=n.props[i].indexOf(f[f.length-1]),y=h===m;return u&&y}),l=r.indexOf(s[s.length-1]);return l}var Bf;function kl(e){"@babel/helpers - typeof";return kl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kl(e)}function nl(){return nl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nl.apply(this,arguments)}function xA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xA(Object(n),!0).forEach(function(r){Dr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rit(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Dk(r.key),r)}}function iit(e,t,n){return t&&wA(e.prototype,t),n&&wA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function oit(e,t,n){return t=qd(t),sit(e,jk()?Reflect.construct(t,n||[],qd(e).constructor):t.apply(e,n))}function sit(e,t){if(t&&(kl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ait(e)}function ait(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jk=function(){return!!e})()}function qd(e){return qd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qd(e)}function lit(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lv(e,t)}function Lv(e,t){return Lv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Lv(e,t)}function Dr(e,t,n){return t=Dk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dk(e){var t=cit(e,"string");return kl(t)=="symbol"?t:t+""}function cit(e,t){if(kl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(kl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var wo=function(e){function t(n){var r;return rit(this,t),r=oit(this,t,[n]),Dr(r,"pieRef",null),Dr(r,"sectorRefs",[]),Dr(r,"id",wa("recharts-pie-")),Dr(r,"handleAnimationEnd",function(){var i=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Vt(i)&&i()}),Dr(r,"handleAnimationStart",function(){var i=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Vt(i)&&i()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return lit(t,e),iit(t,[{key:"isActiveIndex",value:function(r){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(r)!==-1:r===i}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.label,l=o.labelLine,c=o.dataKey,h=o.valueKey,u=Lt(this.props,!1),f=Lt(s,!1),m=Lt(l,!1),y=s&&s.offsetRadius||20,x=r.map(function(p,b){var P=(p.startAngle+p.endAngle)/2,S=ze(p.cx,p.cy,p.outerRadius+y,P),A=je(je(je(je({},u),p),{},{stroke:"none"},f),{},{index:b,textAnchor:t.getTextAnchor(S.x,p.cx)},S),E=je(je(je(je({},u),p),{},{fill:"none",stroke:p.fill},m),{},{index:b,points:[ze(p.cx,p.cy,p.outerRadius,P),S]}),w=c;return Ut(c)&&Ut(h)?w="value":Ut(c)&&(w=h),v.createElement(ue,{key:"label-".concat(p.startAngle,"-").concat(p.endAngle,"-").concat(p.midAngle,"-").concat(b)},l&&t.renderLabelLineItem(l,E,"line"),t.renderLabelItem(s,A,Qe(p,w)))});return v.createElement(ue,{className:"recharts-pie-labels"},x)}},{key:"renderSectorsStatically",value:function(r){var i=this,o=this.props,s=o.activeShape,l=o.blendStroke,c=o.inactiveShape;return r.map(function(h,u){if((h==null?void 0:h.startAngle)===0&&(h==null?void 0:h.endAngle)===0&&r.length!==1)return null;var f=i.isActiveIndex(u),m=c&&i.hasActiveIndex()?c:null,y=f?s:m,x=je(je({},h),{},{stroke:l?h.fill:h.stroke,tabIndex:-1});return v.createElement(ue,nl({ref:function(b){b&&!i.sectorRefs.includes(b)&&i.sectorRefs.push(b)},tabIndex:-1,className:"recharts-pie-sector"},rs(i.props,h,u),{key:"sector-".concat(h==null?void 0:h.startAngle,"-").concat(h==null?void 0:h.endAngle,"-").concat(h.midAngle,"-").concat(u)}),v.createElement(Hd,nl({option:y,isActive:f,shapeType:"sector"},x)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,i=this.props,o=i.sectors,s=i.isAnimationActive,l=i.animationBegin,c=i.animationDuration,h=i.animationEasing,u=i.animationId,f=this.state,m=f.prevSectors,y=f.prevIsAnimationActive;return v.createElement(ni,{begin:l,duration:c,isActive:s,easing:h,from:{t:0},to:{t:1},key:"pie-".concat(u,"-").concat(y),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(x){var p=x.t,b=[],P=o&&o[0],S=P.startAngle;return o.forEach(function(A,E){var w=m&&m[E],T=E>0?_r(A,"paddingAngle",0):0;if(w){var O=Pn(w.endAngle-w.startAngle,A.endAngle-A.startAngle),R=je(je({},A),{},{startAngle:S+T,endAngle:S+O(p)+T});b.push(R),S=R.endAngle}else{var N=A.endAngle,V=A.startAngle,D=Pn(0,N-V),j=D(p),K=je(je({},A),{},{startAngle:S+T,endAngle:S+j+T});b.push(K),S=K.endAngle}}),v.createElement(ue,null,r.renderSectorsStatically(b))})}},{key:"attachKeyboardHandlers",value:function(r){var i=this;r.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var s=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"ArrowRight":{var l=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[l].focus(),i.setState({sectorToFocus:l});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,i=r.sectors,o=r.isAnimationActive,s=this.state.prevSectors;return o&&i&&i.length&&(!s||!pa(s,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,i=this.props,o=i.hide,s=i.sectors,l=i.className,c=i.label,h=i.cx,u=i.cy,f=i.innerRadius,m=i.outerRadius,y=i.isAnimationActive,x=this.state.isAnimationFinished;if(o||!s||!s.length||!xt(h)||!xt(u)||!xt(f)||!xt(m))return null;var p=Jt("recharts-pie",l);return v.createElement(ue,{tabIndex:this.props.rootTabIndex,className:p,ref:function(P){r.pieRef=P}},this.renderSectors(),c&&this.renderLabels(s),An.renderCallByParent(this.props,null,!1),(!y||x)&&Si.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return i.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:r.sectors!==i.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,i){return r>i?"start":r<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,i,o){if(v.isValidElement(r))return v.cloneElement(r,i);if(Vt(r))return r(i);var s=Jt("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return v.createElement(sa,nl({},i,{key:o,type:"linear",className:s}))}},{key:"renderLabelItem",value:function(r,i,o){if(v.isValidElement(r))return v.cloneElement(r,i);var s=o;if(Vt(r)&&(s=r(i),v.isValidElement(s)))return s;var l=Jt("recharts-pie-label-text",typeof r!="boolean"&&!Vt(r)?r.className:"");return v.createElement(da,nl({},i,{alignmentBaseline:"middle",className:l}),s)}}])}(v.PureComponent);Bf=wo;Dr(wo,"displayName","Pie");Dr(wo,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!ls.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Dr(wo,"parseDeltaAngle",function(e,t){var n=Yn(t-e),r=Math.min(Math.abs(t-e),360);return n*r});Dr(wo,"getRealPieData",function(e){var t=e.data,n=e.children,r=Lt(e,!1),i=ur(n,bh);return t&&t.length?t.map(function(o,s){return je(je(je({payload:o},r),o),i&&i[s]&&i[s].props)}):i&&i.length?i.map(function(o){return je(je({},r),o.props)}):[]});Dr(wo,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,i=t.width,o=t.height,s=vk(i,o),l=r+Kn(e.cx,i,i/2),c=n+Kn(e.cy,o,o/2),h=Kn(e.innerRadius,s,0),u=Kn(e.outerRadius,s,s*.8),f=e.maxRadius||Math.sqrt(i*i+o*o)/2;return{cx:l,cy:c,innerRadius:h,outerRadius:u,maxRadius:f}});Dr(wo,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?je(je({},t.type.defaultProps),t.props):t.props,i=Bf.getRealPieData(r);if(!i||!i.length)return null;var o=r.cornerRadius,s=r.startAngle,l=r.endAngle,c=r.paddingAngle,h=r.dataKey,u=r.nameKey,f=r.valueKey,m=r.tooltipType,y=Math.abs(r.minAngle),x=Bf.parseCoordinateOfPie(r,n),p=Bf.parseDeltaAngle(s,l),b=Math.abs(p),P=h;Ut(h)&&Ut(f)?(ei(!1,`Use "dataKey" to specify the value of pie,
111
111
  the props "valueKey" will be deprecated in 1.1.0`),P="value"):Ut(h)&&(ei(!1,`Use "dataKey" to specify the value of pie,
112
- the props "valueKey" will be deprecated in 1.1.0`),P=f);var S=i.filter(function(R){return Qe(R,P,0)!==0}).length,A=(b>=360?S:S-1)*c,E=b-S*y-A,w=i.reduce(function(R,N){var V=Qe(N,P,0);return R+(xt(V)?V:0)},0),T;if(w>0){var O;T=i.map(function(R,N){var V=Qe(R,P,0),D=Qe(R,u,N),j=(xt(V)?V:0)/w,K;N?K=O.endAngle+Yn(p)*c*(V!==0?1:0):K=s;var H=K+Yn(p)*((V!==0?y:0)+j*E),z=(K+H)/2,Y=(x.innerRadius+x.outerRadius)/2,G=[{name:D,value:V,payload:R,dataKey:P,type:m}],J=ze(x.cx,x.cy,Y,z);return O=je(je(je({percent:j,cornerRadius:o,name:D,tooltipPayload:G,midAngle:z,middleRadius:Y,tooltipPosition:J},R),x),{},{value:Qe(R,P),startAngle:K,endAngle:H,payload:R,paddingAngle:Yn(p)*c}),O})}return je(je({},x),{},{sectors:T,data:i})});var uit=Math.ceil,hit=Math.max;function fit(e,t,n,r){for(var i=-1,o=hit(uit((t-e)/(n||1)),0),s=Array(o);o--;)s[r?o:++i]=e,e+=n;return s}var dit=fit,pit=sM,_A=1/0,mit=17976931348623157e292;function git(e){if(!e)return e===0?e:0;if(e=pit(e),e===_A||e===-_A){var t=e<0?-1:1;return t*mit}return e===e?e:0}var Bk=git,yit=dit,vit=Vp,Bg=Bk;function bit(e){return function(t,n,r){return r&&typeof r!="number"&&vit(t,n,r)&&(n=r=void 0),t=Bg(t),n===void 0?(n=t,t=0):n=Bg(n),r=r===void 0?t<n?1:-1:Bg(r),yit(t,n,r,e)}}var xit=bit,wit=xit,_it=wit(),Sit=_it;const Gd=Me(Sit);function oh(e){"@babel/helpers - typeof";return oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(e)}function SA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function PA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SA(Object(n),!0).forEach(function(r){zk(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zk(e,t,n){return t=Pit(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pit(e){var t=Ait(e,"string");return oh(t)=="symbol"?t:t+""}function Ait(e,t){if(oh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(oh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Tit=["Webkit","Moz","O","ms"],Eit=function(t,n){var r=t.replace(/(\w)/,function(o){return o.toUpperCase()}),i=Tit.reduce(function(o,s){return PA(PA({},o),{},zk({},s+r,n))},{});return i[t]=n,i};function $l(e){"@babel/helpers - typeof";return $l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$l(e)}function Zd(){return Zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zd.apply(this,arguments)}function AA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AA(Object(n),!0).forEach(function(r){yr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cit(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Wk(r.key),r)}}function Oit(e,t,n){return t&&TA(e.prototype,t),n&&TA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mit(e,t,n){return t=Yd(t),kit(e,Fk()?Reflect.construct(t,n||[],Yd(e).constructor):t.apply(e,n))}function kit(e,t){if(t&&($l(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $it(e)}function $it(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Fk=function(){return!!e})()}function Yd(e){return Yd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Yd(e)}function Iit(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nv(e,t)}function Nv(e,t){return Nv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Nv(e,t)}function yr(e,t,n){return t=Wk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wk(e){var t=Rit(e,"string");return $l(t)=="symbol"?t:t+""}function Rit(e,t){if($l(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($l(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Lit=function(t){var n=t.data,r=t.startIndex,i=t.endIndex,o=t.x,s=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,h=hu().domain(Gd(0,c)).range([o,o+s-l]),u=h.domain().map(function(f){return h(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:h(r),endX:h(i),scale:h,scaleValues:u}},EA=function(t){return t.changedTouches&&!!t.changedTouches.length},Il=function(e){function t(n){var r;return Cit(this,t),r=Mit(this,t,[n]),yr(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),yr(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),yr(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,s=i.onDragEnd,l=i.startIndex;s==null||s({endIndex:o,startIndex:l})}),r.detachDragEndListener()}),yr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),yr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),yr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),yr(r,"handleSlideDragStart",function(i){var o=EA(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Iit(t,e),Oit(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,s=this.state.scaleValues,l=this.props,c=l.gap,h=l.data,u=h.length-1,f=Math.min(i,o),m=Math.max(i,o),y=t.getIndexInRange(s,f),x=t.getIndexInRange(s,m);return{startIndex:y-y%c,endIndex:x===u?u:x-x%c}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,s=i.tickFormatter,l=i.dataKey,c=Qe(o[r],l,r);return Vt(s)?s(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,s=i.startX,l=i.endX,c=this.props,h=c.x,u=c.width,f=c.travellerWidth,m=c.startIndex,y=c.endIndex,x=c.onChange,p=r.pageX-o;p>0?p=Math.min(p,h+u-f-l,h+u-f-s):p<0&&(p=Math.max(p,h-s,h-l));var b=this.getIndex({startX:s+p,endX:l+p});(b.startIndex!==m||b.endIndex!==y)&&x&&x(b),this.setState({startX:s+p,endX:l+p,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=EA(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,s=i.movingTravellerId,l=i.endX,c=i.startX,h=this.state[s],u=this.props,f=u.x,m=u.width,y=u.travellerWidth,x=u.onChange,p=u.gap,b=u.data,P={startX:this.state.startX,endX:this.state.endX},S=r.pageX-o;S>0?S=Math.min(S,f+m-y-h):S<0&&(S=Math.max(S,f-h)),P[s]=h+S;var A=this.getIndex(P),E=A.startIndex,w=A.endIndex,T=function(){var R=b.length-1;return s==="startX"&&(l>c?E%p===0:w%p===0)||l<c&&w===R||s==="endX"&&(l>c?w%p===0:E%p===0)||l>c&&w===R};this.setState(yr(yr({},s,h+S),"brushMoveStartX",r.pageX),function(){x&&T()&&x(A)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,s=this.state,l=s.scaleValues,c=s.startX,h=s.endX,u=this.state[i],f=l.indexOf(u);if(f!==-1){var m=f+r;if(!(m===-1||m>=l.length)){var y=l[m];i==="startX"&&y>=h||i==="endX"&&y<=c||this.setState(yr({},i,y),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,l=r.height,c=r.fill,h=r.stroke;return v.createElement("rect",{stroke:h,fill:c,x:i,y:o,width:s,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,l=r.height,c=r.data,h=r.children,u=r.padding,f=v.Children.only(h);return f?v.cloneElement(f,{x:i,y:o,width:s,height:l,margin:u,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,s,l=this,c=this.props,h=c.y,u=c.travellerWidth,f=c.height,m=c.traveller,y=c.ariaLabel,x=c.data,p=c.startIndex,b=c.endIndex,P=Math.max(r,this.props.x),S=zg(zg({},Lt(this.props,!1)),{},{x:P,y:h,width:u,height:f}),A=y||"Min value: ".concat((o=x[p])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=x[b])===null||s===void 0?void 0:s.name);return v.createElement(ue,{tabIndex:0,role:"slider","aria-label":A,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),l.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,S))}},{key:"renderSlide",value:function(r,i){var o=this.props,s=o.y,l=o.height,c=o.stroke,h=o.travellerWidth,u=Math.min(r,i)+h,f=Math.max(Math.abs(i-r)-h,0);return v.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:u,y:s,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,s=r.y,l=r.height,c=r.travellerWidth,h=r.stroke,u=this.state,f=u.startX,m=u.endX,y=5,x={pointerEvents:"none",fill:h};return v.createElement(ue,{className:"recharts-brush-texts"},v.createElement(da,Zd({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,m)-y,y:s+l/2},x),this.getTextOfTick(i)),v.createElement(da,Zd({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,m)+c+y,y:s+l/2},x),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,s=r.children,l=r.x,c=r.y,h=r.width,u=r.height,f=r.alwaysShowText,m=this.state,y=m.startX,x=m.endX,p=m.isTextActive,b=m.isSlideMoving,P=m.isTravellerMoving,S=m.isTravellerFocused;if(!i||!i.length||!xt(l)||!xt(c)||!xt(h)||!xt(u)||h<=0||u<=0)return null;var A=Jt("recharts-brush",o),E=v.Children.count(s)===1,w=Eit("userSelect","none");return v.createElement(ue,{className:A,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(y,x),this.renderTravellerLayer(y,"startX"),this.renderTravellerLayer(x,"endX"),(p||b||P||S||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,s=r.width,l=r.height,c=r.stroke,h=Math.floor(o+l/2)-1;return v.createElement(v.Fragment,null,v.createElement("rect",{x:i,y:o,width:s,height:l,fill:c,stroke:"none"}),v.createElement("line",{x1:i+1,y1:h,x2:i+s-1,y2:h,fill:"none",stroke:"#fff"}),v.createElement("line",{x1:i+1,y1:h+2,x2:i+s-1,y2:h+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return v.isValidElement(r)?o=v.cloneElement(r,i):Vt(r)?o=r(i):o=t.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,s=r.width,l=r.x,c=r.travellerWidth,h=r.updateId,u=r.startIndex,f=r.endIndex;if(o!==i.prevData||h!==i.prevUpdateId)return zg({prevData:o,prevTravellerWidth:c,prevUpdateId:h,prevX:l,prevWidth:s},o&&o.length?Lit({data:o,width:s,x:l,travellerWidth:c,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+s-c]);var m=i.scale.domain().map(function(y){return i.scale(y)});return{prevData:o,prevTravellerWidth:c,prevUpdateId:h,prevX:l,prevWidth:s,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,s=0,l=o-1;l-s>1;){var c=Math.floor((s+l)/2);r[c]>i?l=c:s=c}return i>=r[l]?l:s}}])}(v.PureComponent);yr(Il,"displayName","Brush");yr(Il,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Nit=L0;function jit(e,t){var n;return Nit(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}var Dit=jit,Bit=IO,zit=Ei,Fit=Dit,Wit=dr,Vit=Vp;function Uit(e,t,n){var r=Wit(e)?Bit:Fit;return n&&Vit(e,t,n)&&(t=void 0),r(e,zit(t))}var Hit=Uit;const qit=Me(Hit);var Pi=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},CA=eM;function Git(e,t,n){t=="__proto__"&&CA?CA(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Zit=Git,Yit=Zit,Kit=QO,Xit=Ei;function Jit(e,t){var n={};return t=Xit(t),Kit(e,function(r,i,o){Yit(n,i,t(r,i,o))}),n}var Qit=Jit;const tot=Me(Qit);function eot(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var not=eot,rot=L0;function iot(e,t){var n=!0;return rot(e,function(r,i,o){return n=!!t(r,i,o),n}),n}var oot=iot,sot=not,aot=oot,lot=Ei,cot=dr,uot=Vp;function hot(e,t,n){var r=cot(e)?sot:aot;return n&&uot(e,t,n)&&(t=void 0),r(e,lot(t))}var fot=hot;const Vk=Me(fot);var dot=["x","y"];function Rl(e){"@babel/helpers - typeof";return Rl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rl(e)}function jv(){return jv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jv.apply(this,arguments)}function OA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OA(Object(n),!0).forEach(function(r){pot(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pot(e,t,n){return t=mot(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mot(e){var t=got(e,"string");return Rl(t)=="symbol"?t:t+""}function got(e,t){if(Rl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yot(e,t){if(e==null)return{};var n=vot(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vot(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function bot(e,t){var n=e.x,r=e.y,i=yot(e,dot),o="".concat(n),s=parseInt(o,10),l="".concat(r),c=parseInt(l,10),h="".concat(t.height||i.height),u=parseInt(h,10),f="".concat(t.width||i.width),m=parseInt(f,10);return Zc(Zc(Zc(Zc(Zc({},t),i),s?{x:s}:{}),c?{y:c}:{}),{},{height:u,width:m,name:t.name,radius:t.radius})}function MA(e){return v.createElement(Hd,jv({shapeType:"rectangle",propTransformer:bot,activeClassName:"recharts-active-bar"},e))}var xot=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var o=xt(r)||$W(r);return o?t(r,i):(o||(process.env.NODE_ENV!=="production"?lr(!1,"minPointSize callback function received a value with type of ".concat(Rl(r),". Currently only numbers or null/undefined are supported.")):lr()),n)}},wot=["value","background"],Uk;function Ll(e){"@babel/helpers - typeof";return Ll=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ll(e)}function _ot(e,t){if(e==null)return{};var n=Sot(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sot(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Kd(){return Kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kd.apply(this,arguments)}function kA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kA(Object(n),!0).forEach(function(r){Zo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qk(r.key),r)}}function Aot(e,t,n){return t&&$A(e.prototype,t),n&&$A(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tot(e,t,n){return t=Xd(t),Eot(e,Hk()?Reflect.construct(t,n||[],Xd(e).constructor):t.apply(e,n))}function Eot(e,t){if(t&&(Ll(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cot(e)}function Cot(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hk=function(){return!!e})()}function Xd(e){return Xd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xd(e)}function Oot(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dv(e,t)}function Dv(e,t){return Dv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Dv(e,t)}function Zo(e,t,n){return t=qk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qk(e){var t=Mot(e,"string");return Ll(t)=="symbol"?t:t+""}function Mot(e,t){if(Ll(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ll(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Aa=function(e){function t(){var n;Pot(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=Tot(this,t,[].concat(i)),Zo(n,"state",{isAnimationFinished:!1}),Zo(n,"id",wa("recharts-bar-")),Zo(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),s&&s()}),Zo(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),s&&s()}),n}return Oot(t,e),Aot(t,[{key:"renderRectanglesStatically",value:function(r){var i=this,o=this.props,s=o.shape,l=o.dataKey,c=o.activeIndex,h=o.activeBar,u=Lt(this.props,!1);return r&&r.map(function(f,m){var y=m===c,x=y?h:s,p=pn(pn(pn({},u),f),{},{isActive:y,option:x,index:m,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return v.createElement(ue,Kd({className:"recharts-bar-rectangle"},rs(i.props,f,m),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(m)}),v.createElement(MA,p))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,o=i.data,s=i.layout,l=i.isAnimationActive,c=i.animationBegin,h=i.animationDuration,u=i.animationEasing,f=i.animationId,m=this.state.prevData;return v.createElement(ni,{begin:c,duration:h,isActive:l,easing:u,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(y){var x=y.t,p=o.map(function(b,P){var S=m&&m[P];if(S){var A=Pn(S.x,b.x),E=Pn(S.y,b.y),w=Pn(S.width,b.width),T=Pn(S.height,b.height);return pn(pn({},b),{},{x:A(x),y:E(x),width:w(x),height:T(x)})}if(s==="horizontal"){var O=Pn(0,b.height),R=O(x);return pn(pn({},b),{},{y:b.y+b.height-R,height:R})}var N=Pn(0,b.width),V=N(x);return pn(pn({},b),{},{width:V})});return v.createElement(ue,null,r.renderRectanglesStatically(p))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,o=r.isAnimationActive,s=this.state.prevData;return o&&i&&i.length&&(!s||!pa(s,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,o=i.data,s=i.dataKey,l=i.activeIndex,c=Lt(this.props.background,!1);return o.map(function(h,u){h.value;var f=h.background,m=_ot(h,wot);if(!f)return null;var y=pn(pn(pn(pn(pn({},m),{},{fill:"#eee"},f),c),rs(r.props,h,u)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:s,index:u,className:"recharts-bar-background-rectangle"});return v.createElement(MA,Kd({key:"background-bar-".concat(u),option:r.props.background,isActive:u===l},y))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.data,l=o.xAxis,c=o.yAxis,h=o.layout,u=o.children,f=ur(u,Ph);if(!f)return null;var m=h==="vertical"?s[0].height/2:s[0].width/2,y=function(b,P){var S=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:S,errorVal:Qe(b,P)}},x={clipPath:r?"url(#clipPath-".concat(i,")"):null};return v.createElement(ue,x,f.map(function(p){return v.cloneElement(p,{key:"error-bar-".concat(i,"-").concat(p.props.dataKey),data:s,xAxis:l,yAxis:c,layout:h,offset:m,dataPointFormatter:y})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,o=r.data,s=r.className,l=r.xAxis,c=r.yAxis,h=r.left,u=r.top,f=r.width,m=r.height,y=r.isAnimationActive,x=r.background,p=r.id;if(i||!o||!o.length)return null;var b=this.state.isAnimationFinished,P=Jt("recharts-bar",s),S=l&&l.allowDataOverflow,A=c&&c.allowDataOverflow,E=S||A,w=Ut(p)?this.id:p;return v.createElement(ue,{className:P},S||A?v.createElement("defs",null,v.createElement("clipPath",{id:"clipPath-".concat(w)},v.createElement("rect",{x:S?h:h-f/2,y:A?u:u-m/2,width:S?f:f*2,height:A?m:m*2}))):null,v.createElement(ue,{className:"recharts-bar-rectangles",clipPath:E?"url(#clipPath-".concat(w,")"):null},x?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(E,w),(!y||b)&&Si.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])}(v.PureComponent);Uk=Aa;Zo(Aa,"displayName","Bar");Zo(Aa,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!ls.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Zo(Aa,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,o=e.xAxis,s=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,h=e.stackedData,u=e.dataStartIndex,f=e.displayedData,m=e.offset,y=QJ(r,n);if(!y)return null;var x=t.layout,p=n.type.defaultProps,b=p!==void 0?pn(pn({},p),n.props):n.props,P=b.dataKey,S=b.children,A=b.minPointSize,E=x==="horizontal"?s:o,w=h?E.scale.domain():null,T=sQ({numericAxis:E}),O=ur(S,bh),R=f.map(function(N,V){var D,j,K,H,z,Y;h?D=tQ(h[u+V],w):(D=Qe(N,P),Array.isArray(D)||(D=[T,D]));var G=xot(A,Uk.defaultProps.minPointSize)(D[1],V);if(x==="horizontal"){var J,lt=[s.scale(D[0]),s.scale(D[1])],q=lt[0],nt=lt[1];j=mP({axis:o,ticks:l,bandSize:i,offset:y.offset,entry:N,index:V}),K=(J=nt??q)!==null&&J!==void 0?J:void 0,H=y.size;var it=q-nt;if(z=Number.isNaN(it)?0:it,Y={x:j,y:s.y,width:H,height:s.height},Math.abs(G)>0&&Math.abs(z)<Math.abs(G)){var at=Yn(z||G)*(Math.abs(G)-Math.abs(z));K-=at,z+=at}}else{var ct=[o.scale(D[0]),o.scale(D[1])],mt=ct[0],yt=ct[1];if(j=mt,K=mP({axis:s,ticks:c,bandSize:i,offset:y.offset,entry:N,index:V}),H=yt-mt,z=y.size,Y={x:o.x,y:K,width:o.width,height:z},Math.abs(G)>0&&Math.abs(H)<Math.abs(G)){var Et=Yn(H||G)*(Math.abs(G)-Math.abs(H));H+=Et}}return pn(pn(pn({},N),{},{x:j,y:K,width:H,height:z,value:h?D:D[1],payload:N,background:Y},O&&O[V]&&O[V].props),{},{tooltipPayload:[gk(n,N)],tooltipPosition:{x:j+H/2,y:K+z/2}})});return pn({data:R,layout:x},m)});function sh(e){"@babel/helpers - typeof";return sh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sh(e)}function kot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gk(r.key),r)}}function $ot(e,t,n){return t&&IA(e.prototype,t),n&&IA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function RA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RA(Object(n),!0).forEach(function(r){lm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lm(e,t,n){return t=Gk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gk(e){var t=Iot(e,"string");return sh(t)=="symbol"?t:t+""}function Iot(e,t){if(sh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hx=function(t,n,r,i,o){var s=t.width,l=t.height,c=t.layout,h=t.children,u=Object.keys(n),f={left:r.left,leftMirror:r.left,right:s-r.right,rightMirror:s-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},m=!!vr(h,Aa);return u.reduce(function(y,x){var p=n[x],b=p.orientation,P=p.domain,S=p.padding,A=S===void 0?{}:S,E=p.mirror,w=p.reversed,T="".concat(b).concat(E?"Mirror":""),O,R,N,V,D;if(p.type==="number"&&(p.padding==="gap"||p.padding==="no-gap")){var j=P[1]-P[0],K=1/0,H=p.categoricalDomain.sort(NW);if(H.forEach(function(ct,mt){mt>0&&(K=Math.min((ct||0)-(H[mt-1]||0),K))}),Number.isFinite(K)){var z=K/j,Y=p.layout==="vertical"?r.height:r.width;if(p.padding==="gap"&&(O=z*Y/2),p.padding==="no-gap"){var G=Kn(t.barCategoryGap,z*Y),J=z*Y/2;O=J-G-(J-G)/Y*G}}}i==="xAxis"?R=[r.left+(A.left||0)+(O||0),r.left+r.width-(A.right||0)-(O||0)]:i==="yAxis"?R=c==="horizontal"?[r.top+r.height-(A.bottom||0),r.top+(A.top||0)]:[r.top+(A.top||0)+(O||0),r.top+r.height-(A.bottom||0)-(O||0)]:R=p.range,w&&(R=[R[1],R[0]]);var lt=fk(p,o,m),q=lt.scale,nt=lt.realScaleType;q.domain(P).range(R),dk(q);var it=pk(q,Jr(Jr({},p),{},{realScaleType:nt}));i==="xAxis"?(D=b==="top"&&!E||b==="bottom"&&E,N=r.left,V=f[T]-D*p.height):i==="yAxis"&&(D=b==="left"&&!E||b==="right"&&E,N=f[T]-D*p.width,V=r.top);var at=Jr(Jr(Jr({},p),it),{},{realScaleType:nt,x:N,y:V,scale:q,width:i==="xAxis"?r.width:p.width,height:i==="yAxis"?r.height:p.height});return at.bandSize=$d(at,it),!p.hide&&i==="xAxis"?f[T]+=(D?-1:1)*at.height:p.hide||(f[T]+=(D?-1:1)*at.width),Jr(Jr({},y),{},lm({},x,at))},{})},Zk=function(t,n){var r=t.x,i=t.y,o=n.x,s=n.y;return{x:Math.min(r,o),y:Math.min(i,s),width:Math.abs(o-r),height:Math.abs(s-i)}},Rot=function(t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2;return Zk({x:n,y:r},{x:i,y:o})},Yk=function(){function e(t){kot(this,e),this.scale=t}return $ot(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])}();lm(Yk,"EPS",1e-4);var fx=function(t){var n=Object.keys(t).reduce(function(r,i){return Jr(Jr({},r),{},lm({},i,Yk.create(t[i])))},{});return Jr(Jr({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,l=o.position;return tot(i,function(c,h){return n[h].apply(c,{bandAware:s,position:l})})},isInRange:function(i){return Vk(i,function(o,s){return n[s].isInRange(o)})}})};function Lot(e){return(e%180+180)%180}var Not=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=Lot(i),s=o*Math.PI/180,l=Math.atan(r/n),c=s>l&&s<Math.PI-l?r/Math.sin(s):n/Math.cos(s);return Math.abs(c)},jot=Ei,Dot=vh,Bot=Fp;function zot(e){return function(t,n,r){var i=Object(t);if(!Dot(t)){var o=jot(n);t=Bot(t),n=function(l){return o(i[l],l,i)}}var s=e(t,n,r);return s>-1?i[o?t[s]:s]:void 0}}var Fot=zot,Wot=Bk;function Vot(e){var t=Wot(e),n=t%1;return t===t?n?t-n:t:0}var Uot=Vot,Hot=GO,qot=Ei,Got=Uot,Zot=Math.max;function Yot(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Got(n);return i<0&&(i=Zot(r+i,0)),Hot(e,qot(t),i)}var Kot=Yot,Xot=Fot,Jot=Kot,Qot=Xot(Jot),tst=Qot;const est=Me(tst);var nst=D3(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")});function Jd(e){"@babel/helpers - typeof";return Jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jd(e)}var dx=v.createContext(void 0),px=v.createContext(void 0),Kk=v.createContext(void 0),Xk=v.createContext({}),Jk=v.createContext(void 0),Qk=v.createContext(0),t$=v.createContext(0),LA=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,s=t.clipPathId,l=t.children,c=t.width,h=t.height,u=nst(o);return v.createElement(dx.Provider,{value:r},v.createElement(px.Provider,{value:i},v.createElement(Xk.Provider,{value:o},v.createElement(Kk.Provider,{value:u},v.createElement(Jk.Provider,{value:s},v.createElement(Qk.Provider,{value:h},v.createElement(t$.Provider,{value:c},l)))))))},rst=function(){return v.useContext(Jk)};function e$(e){var t=Object.keys(e);return t.length===0?"There are no available ids.":"Available ids are: ".concat(t,".")}var n$=function(t){var n=v.useContext(dx);n==null&&(process.env.NODE_ENV!=="production"?lr(!1,"Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"):lr());var r=n[t];return r==null&&(process.env.NODE_ENV!=="production"?lr(!1,'Could not find xAxis by id "'.concat(t,'" [').concat(Jd(t),"]. ").concat(e$(n))):lr()),r},ist=function(){var t=v.useContext(dx);return Uo(t)},ost=function(){var t=v.useContext(px),n=est(t,function(r){return Vk(r.domain,Number.isFinite)});return n||Uo(t)},r$=function(t){var n=v.useContext(px);n==null&&(process.env.NODE_ENV!=="production"?lr(!1,"Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"):lr());var r=n[t];return r==null&&(process.env.NODE_ENV!=="production"?lr(!1,'Could not find yAxis by id "'.concat(t,'" [').concat(Jd(t),"]. ").concat(e$(n))):lr()),r},sst=function(){var t=v.useContext(Kk);return t},ast=function(){return v.useContext(Xk)},mx=function(){return v.useContext(t$)},gx=function(){return v.useContext(Qk)};function Nl(e){"@babel/helpers - typeof";return Nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nl(e)}function lst(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cst(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o$(r.key),r)}}function ust(e,t,n){return t&&cst(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function hst(e,t,n){return t=Qd(t),fst(e,i$()?Reflect.construct(t,n||[],Qd(e).constructor):t.apply(e,n))}function fst(e,t){if(t&&(Nl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dst(e)}function dst(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(i$=function(){return!!e})()}function Qd(e){return Qd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qd(e)}function pst(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bv(e,t)}function Bv(e,t){return Bv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Bv(e,t)}function NA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NA(Object(n),!0).forEach(function(r){yx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yx(e,t,n){return t=o$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o$(e){var t=mst(e,"string");return Nl(t)=="symbol"?t:t+""}function mst(e,t){if(Nl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function gst(e,t){return xst(e)||bst(e,t)||vst(e,t)||yst()}function yst(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
112
+ the props "valueKey" will be deprecated in 1.1.0`),P=f);var S=i.filter(function(R){return Qe(R,P,0)!==0}).length,A=(b>=360?S:S-1)*c,E=b-S*y-A,w=i.reduce(function(R,N){var V=Qe(N,P,0);return R+(xt(V)?V:0)},0),T;if(w>0){var O;T=i.map(function(R,N){var V=Qe(R,P,0),D=Qe(R,u,N),j=(xt(V)?V:0)/w,K;N?K=O.endAngle+Yn(p)*c*(V!==0?1:0):K=s;var H=K+Yn(p)*((V!==0?y:0)+j*E),z=(K+H)/2,Y=(x.innerRadius+x.outerRadius)/2,G=[{name:D,value:V,payload:R,dataKey:P,type:m}],J=ze(x.cx,x.cy,Y,z);return O=je(je(je({percent:j,cornerRadius:o,name:D,tooltipPayload:G,midAngle:z,middleRadius:Y,tooltipPosition:J},R),x),{},{value:Qe(R,P),startAngle:K,endAngle:H,payload:R,paddingAngle:Yn(p)*c}),O})}return je(je({},x),{},{sectors:T,data:i})});var uit=Math.ceil,hit=Math.max;function fit(e,t,n,r){for(var i=-1,o=hit(uit((t-e)/(n||1)),0),s=Array(o);o--;)s[r?o:++i]=e,e+=n;return s}var dit=fit,pit=sM,_A=1/0,mit=17976931348623157e292;function git(e){if(!e)return e===0?e:0;if(e=pit(e),e===_A||e===-_A){var t=e<0?-1:1;return t*mit}return e===e?e:0}var Bk=git,yit=dit,vit=Vp,Bg=Bk;function bit(e){return function(t,n,r){return r&&typeof r!="number"&&vit(t,n,r)&&(n=r=void 0),t=Bg(t),n===void 0?(n=t,t=0):n=Bg(n),r=r===void 0?t<n?1:-1:Bg(r),yit(t,n,r,e)}}var xit=bit,wit=xit,_it=wit(),Sit=_it;const Gd=Me(Sit);function oh(e){"@babel/helpers - typeof";return oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(e)}function SA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function PA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SA(Object(n),!0).forEach(function(r){zk(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zk(e,t,n){return t=Pit(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pit(e){var t=Ait(e,"string");return oh(t)=="symbol"?t:t+""}function Ait(e,t){if(oh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(oh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Tit=["Webkit","Moz","O","ms"],Eit=function(t,n){var r=t.replace(/(\w)/,function(o){return o.toUpperCase()}),i=Tit.reduce(function(o,s){return PA(PA({},o),{},zk({},s+r,n))},{});return i[t]=n,i};function $l(e){"@babel/helpers - typeof";return $l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$l(e)}function Zd(){return Zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zd.apply(this,arguments)}function AA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AA(Object(n),!0).forEach(function(r){yr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cit(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Wk(r.key),r)}}function Oit(e,t,n){return t&&TA(e.prototype,t),n&&TA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mit(e,t,n){return t=Yd(t),kit(e,Fk()?Reflect.construct(t,n||[],Yd(e).constructor):t.apply(e,n))}function kit(e,t){if(t&&($l(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $it(e)}function $it(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Fk=function(){return!!e})()}function Yd(e){return Yd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Yd(e)}function Iit(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nv(e,t)}function Nv(e,t){return Nv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Nv(e,t)}function yr(e,t,n){return t=Wk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wk(e){var t=Rit(e,"string");return $l(t)=="symbol"?t:t+""}function Rit(e,t){if($l(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($l(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Lit=function(t){var n=t.data,r=t.startIndex,i=t.endIndex,o=t.x,s=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,h=hu().domain(Gd(0,c)).range([o,o+s-l]),u=h.domain().map(function(f){return h(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:h(r),endX:h(i),scale:h,scaleValues:u}},EA=function(t){return t.changedTouches&&!!t.changedTouches.length},Il=function(e){function t(n){var r;return Cit(this,t),r=Mit(this,t,[n]),yr(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),yr(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),yr(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,s=i.onDragEnd,l=i.startIndex;s==null||s({endIndex:o,startIndex:l})}),r.detachDragEndListener()}),yr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),yr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),yr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),yr(r,"handleSlideDragStart",function(i){var o=EA(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Iit(t,e),Oit(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,s=this.state.scaleValues,l=this.props,c=l.gap,h=l.data,u=h.length-1,f=Math.min(i,o),m=Math.max(i,o),y=t.getIndexInRange(s,f),x=t.getIndexInRange(s,m);return{startIndex:y-y%c,endIndex:x===u?u:x-x%c}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,s=i.tickFormatter,l=i.dataKey,c=Qe(o[r],l,r);return Vt(s)?s(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,s=i.startX,l=i.endX,c=this.props,h=c.x,u=c.width,f=c.travellerWidth,m=c.startIndex,y=c.endIndex,x=c.onChange,p=r.pageX-o;p>0?p=Math.min(p,h+u-f-l,h+u-f-s):p<0&&(p=Math.max(p,h-s,h-l));var b=this.getIndex({startX:s+p,endX:l+p});(b.startIndex!==m||b.endIndex!==y)&&x&&x(b),this.setState({startX:s+p,endX:l+p,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=EA(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,s=i.movingTravellerId,l=i.endX,c=i.startX,h=this.state[s],u=this.props,f=u.x,m=u.width,y=u.travellerWidth,x=u.onChange,p=u.gap,b=u.data,P={startX:this.state.startX,endX:this.state.endX},S=r.pageX-o;S>0?S=Math.min(S,f+m-y-h):S<0&&(S=Math.max(S,f-h)),P[s]=h+S;var A=this.getIndex(P),E=A.startIndex,w=A.endIndex,T=function(){var R=b.length-1;return s==="startX"&&(l>c?E%p===0:w%p===0)||l<c&&w===R||s==="endX"&&(l>c?w%p===0:E%p===0)||l>c&&w===R};this.setState(yr(yr({},s,h+S),"brushMoveStartX",r.pageX),function(){x&&T()&&x(A)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,s=this.state,l=s.scaleValues,c=s.startX,h=s.endX,u=this.state[i],f=l.indexOf(u);if(f!==-1){var m=f+r;if(!(m===-1||m>=l.length)){var y=l[m];i==="startX"&&y>=h||i==="endX"&&y<=c||this.setState(yr({},i,y),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,l=r.height,c=r.fill,h=r.stroke;return v.createElement("rect",{stroke:h,fill:c,x:i,y:o,width:s,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,l=r.height,c=r.data,h=r.children,u=r.padding,f=v.Children.only(h);return f?v.cloneElement(f,{x:i,y:o,width:s,height:l,margin:u,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,s,l=this,c=this.props,h=c.y,u=c.travellerWidth,f=c.height,m=c.traveller,y=c.ariaLabel,x=c.data,p=c.startIndex,b=c.endIndex,P=Math.max(r,this.props.x),S=zg(zg({},Lt(this.props,!1)),{},{x:P,y:h,width:u,height:f}),A=y||"Min value: ".concat((o=x[p])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=x[b])===null||s===void 0?void 0:s.name);return v.createElement(ue,{tabIndex:0,role:"slider","aria-label":A,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),l.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,S))}},{key:"renderSlide",value:function(r,i){var o=this.props,s=o.y,l=o.height,c=o.stroke,h=o.travellerWidth,u=Math.min(r,i)+h,f=Math.max(Math.abs(i-r)-h,0);return v.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:u,y:s,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,s=r.y,l=r.height,c=r.travellerWidth,h=r.stroke,u=this.state,f=u.startX,m=u.endX,y=5,x={pointerEvents:"none",fill:h};return v.createElement(ue,{className:"recharts-brush-texts"},v.createElement(da,Zd({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,m)-y,y:s+l/2},x),this.getTextOfTick(i)),v.createElement(da,Zd({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,m)+c+y,y:s+l/2},x),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,s=r.children,l=r.x,c=r.y,h=r.width,u=r.height,f=r.alwaysShowText,m=this.state,y=m.startX,x=m.endX,p=m.isTextActive,b=m.isSlideMoving,P=m.isTravellerMoving,S=m.isTravellerFocused;if(!i||!i.length||!xt(l)||!xt(c)||!xt(h)||!xt(u)||h<=0||u<=0)return null;var A=Jt("recharts-brush",o),E=v.Children.count(s)===1,w=Eit("userSelect","none");return v.createElement(ue,{className:A,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(y,x),this.renderTravellerLayer(y,"startX"),this.renderTravellerLayer(x,"endX"),(p||b||P||S||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,s=r.width,l=r.height,c=r.stroke,h=Math.floor(o+l/2)-1;return v.createElement(v.Fragment,null,v.createElement("rect",{x:i,y:o,width:s,height:l,fill:c,stroke:"none"}),v.createElement("line",{x1:i+1,y1:h,x2:i+s-1,y2:h,fill:"none",stroke:"#fff"}),v.createElement("line",{x1:i+1,y1:h+2,x2:i+s-1,y2:h+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return v.isValidElement(r)?o=v.cloneElement(r,i):Vt(r)?o=r(i):o=t.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,s=r.width,l=r.x,c=r.travellerWidth,h=r.updateId,u=r.startIndex,f=r.endIndex;if(o!==i.prevData||h!==i.prevUpdateId)return zg({prevData:o,prevTravellerWidth:c,prevUpdateId:h,prevX:l,prevWidth:s},o&&o.length?Lit({data:o,width:s,x:l,travellerWidth:c,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+s-c]);var m=i.scale.domain().map(function(y){return i.scale(y)});return{prevData:o,prevTravellerWidth:c,prevUpdateId:h,prevX:l,prevWidth:s,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,s=0,l=o-1;l-s>1;){var c=Math.floor((s+l)/2);r[c]>i?l=c:s=c}return i>=r[l]?l:s}}])}(v.PureComponent);yr(Il,"displayName","Brush");yr(Il,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Nit=L0;function jit(e,t){var n;return Nit(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}var Dit=jit,Bit=IO,zit=Ei,Fit=Dit,Wit=dr,Vit=Vp;function Uit(e,t,n){var r=Wit(e)?Bit:Fit;return n&&Vit(e,t,n)&&(t=void 0),r(e,zit(t))}var Hit=Uit;const qit=Me(Hit);var Pi=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},CA=eM;function Git(e,t,n){t=="__proto__"&&CA?CA(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Zit=Git,Yit=Zit,Kit=QO,Xit=Ei;function Jit(e,t){var n={};return t=Xit(t),Kit(e,function(r,i,o){Yit(n,i,t(r,i,o))}),n}var Qit=Jit;const tot=Me(Qit);function eot(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var not=eot,rot=L0;function iot(e,t){var n=!0;return rot(e,function(r,i,o){return n=!!t(r,i,o),n}),n}var oot=iot,sot=not,aot=oot,lot=Ei,cot=dr,uot=Vp;function hot(e,t,n){var r=cot(e)?sot:aot;return n&&uot(e,t,n)&&(t=void 0),r(e,lot(t))}var fot=hot;const Vk=Me(fot);var dot=["x","y"];function Rl(e){"@babel/helpers - typeof";return Rl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rl(e)}function jv(){return jv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jv.apply(this,arguments)}function OA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OA(Object(n),!0).forEach(function(r){pot(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pot(e,t,n){return t=mot(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mot(e){var t=got(e,"string");return Rl(t)=="symbol"?t:t+""}function got(e,t){if(Rl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yot(e,t){if(e==null)return{};var n=vot(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vot(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function bot(e,t){var n=e.x,r=e.y,i=yot(e,dot),o="".concat(n),s=parseInt(o,10),l="".concat(r),c=parseInt(l,10),h="".concat(t.height||i.height),u=parseInt(h,10),f="".concat(t.width||i.width),m=parseInt(f,10);return Zc(Zc(Zc(Zc(Zc({},t),i),s?{x:s}:{}),c?{y:c}:{}),{},{height:u,width:m,name:t.name,radius:t.radius})}function MA(e){return v.createElement(Hd,jv({shapeType:"rectangle",propTransformer:bot,activeClassName:"recharts-active-bar"},e))}var xot=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var o=xt(r)||$W(r);return o?t(r,i):(o||(process.env.NODE_ENV!=="production"?lr(!1,"minPointSize callback function received a value with type of ".concat(Rl(r),". Currently only numbers or null/undefined are supported.")):lr()),n)}},wot=["value","background"],Uk;function Ll(e){"@babel/helpers - typeof";return Ll=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ll(e)}function _ot(e,t){if(e==null)return{};var n=Sot(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sot(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Kd(){return Kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kd.apply(this,arguments)}function kA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kA(Object(n),!0).forEach(function(r){Zo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qk(r.key),r)}}function Aot(e,t,n){return t&&$A(e.prototype,t),n&&$A(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tot(e,t,n){return t=Xd(t),Eot(e,Hk()?Reflect.construct(t,n||[],Xd(e).constructor):t.apply(e,n))}function Eot(e,t){if(t&&(Ll(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cot(e)}function Cot(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hk=function(){return!!e})()}function Xd(e){return Xd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xd(e)}function Oot(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dv(e,t)}function Dv(e,t){return Dv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Dv(e,t)}function Zo(e,t,n){return t=qk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qk(e){var t=Mot(e,"string");return Ll(t)=="symbol"?t:t+""}function Mot(e,t){if(Ll(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ll(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Aa=function(e){function t(){var n;Pot(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=Tot(this,t,[].concat(i)),Zo(n,"state",{isAnimationFinished:!1}),Zo(n,"id",wa("recharts-bar-")),Zo(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),s&&s()}),Zo(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),s&&s()}),n}return Oot(t,e),Aot(t,[{key:"renderRectanglesStatically",value:function(r){var i=this,o=this.props,s=o.shape,l=o.dataKey,c=o.activeIndex,h=o.activeBar,u=Lt(this.props,!1);return r&&r.map(function(f,m){var y=m===c,x=y?h:s,p=pn(pn(pn({},u),f),{},{isActive:y,option:x,index:m,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return v.createElement(ue,Kd({className:"recharts-bar-rectangle"},rs(i.props,f,m),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(m)}),v.createElement(MA,p))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,o=i.data,s=i.layout,l=i.isAnimationActive,c=i.animationBegin,h=i.animationDuration,u=i.animationEasing,f=i.animationId,m=this.state.prevData;return v.createElement(ni,{begin:c,duration:h,isActive:l,easing:u,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(y){var x=y.t,p=o.map(function(b,P){var S=m&&m[P];if(S){var A=Pn(S.x,b.x),E=Pn(S.y,b.y),w=Pn(S.width,b.width),T=Pn(S.height,b.height);return pn(pn({},b),{},{x:A(x),y:E(x),width:w(x),height:T(x)})}if(s==="horizontal"){var O=Pn(0,b.height),R=O(x);return pn(pn({},b),{},{y:b.y+b.height-R,height:R})}var N=Pn(0,b.width),V=N(x);return pn(pn({},b),{},{width:V})});return v.createElement(ue,null,r.renderRectanglesStatically(p))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,o=r.isAnimationActive,s=this.state.prevData;return o&&i&&i.length&&(!s||!pa(s,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,o=i.data,s=i.dataKey,l=i.activeIndex,c=Lt(this.props.background,!1);return o.map(function(h,u){h.value;var f=h.background,m=_ot(h,wot);if(!f)return null;var y=pn(pn(pn(pn(pn({},m),{},{fill:"#eee"},f),c),rs(r.props,h,u)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:s,index:u,className:"recharts-bar-background-rectangle"});return v.createElement(MA,Kd({key:"background-bar-".concat(u),option:r.props.background,isActive:u===l},y))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.data,l=o.xAxis,c=o.yAxis,h=o.layout,u=o.children,f=ur(u,Ph);if(!f)return null;var m=h==="vertical"?s[0].height/2:s[0].width/2,y=function(b,P){var S=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:S,errorVal:Qe(b,P)}},x={clipPath:r?"url(#clipPath-".concat(i,")"):null};return v.createElement(ue,x,f.map(function(p){return v.cloneElement(p,{key:"error-bar-".concat(i,"-").concat(p.props.dataKey),data:s,xAxis:l,yAxis:c,layout:h,offset:m,dataPointFormatter:y})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,o=r.data,s=r.className,l=r.xAxis,c=r.yAxis,h=r.left,u=r.top,f=r.width,m=r.height,y=r.isAnimationActive,x=r.background,p=r.id;if(i||!o||!o.length)return null;var b=this.state.isAnimationFinished,P=Jt("recharts-bar",s),S=l&&l.allowDataOverflow,A=c&&c.allowDataOverflow,E=S||A,w=Ut(p)?this.id:p;return v.createElement(ue,{className:P},S||A?v.createElement("defs",null,v.createElement("clipPath",{id:"clipPath-".concat(w)},v.createElement("rect",{x:S?h:h-f/2,y:A?u:u-m/2,width:S?f:f*2,height:A?m:m*2}))):null,v.createElement(ue,{className:"recharts-bar-rectangles",clipPath:E?"url(#clipPath-".concat(w,")"):null},x?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(E,w),(!y||b)&&Si.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])}(v.PureComponent);Uk=Aa;Zo(Aa,"displayName","Bar");Zo(Aa,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!ls.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Zo(Aa,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,o=e.xAxis,s=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,h=e.stackedData,u=e.dataStartIndex,f=e.displayedData,m=e.offset,y=QJ(r,n);if(!y)return null;var x=t.layout,p=n.type.defaultProps,b=p!==void 0?pn(pn({},p),n.props):n.props,P=b.dataKey,S=b.children,A=b.minPointSize,E=x==="horizontal"?s:o,w=h?E.scale.domain():null,T=sQ({numericAxis:E}),O=ur(S,bh),R=f.map(function(N,V){var D,j,K,H,z,Y;h?D=tQ(h[u+V],w):(D=Qe(N,P),Array.isArray(D)||(D=[T,D]));var G=xot(A,Uk.defaultProps.minPointSize)(D[1],V);if(x==="horizontal"){var J,lt=[s.scale(D[0]),s.scale(D[1])],q=lt[0],nt=lt[1];j=mP({axis:o,ticks:l,bandSize:i,offset:y.offset,entry:N,index:V}),K=(J=nt??q)!==null&&J!==void 0?J:void 0,H=y.size;var it=q-nt;if(z=Number.isNaN(it)?0:it,Y={x:j,y:s.y,width:H,height:s.height},Math.abs(G)>0&&Math.abs(z)<Math.abs(G)){var at=Yn(z||G)*(Math.abs(G)-Math.abs(z));K-=at,z+=at}}else{var ct=[o.scale(D[0]),o.scale(D[1])],gt=ct[0],yt=ct[1];if(j=gt,K=mP({axis:s,ticks:c,bandSize:i,offset:y.offset,entry:N,index:V}),H=yt-gt,z=y.size,Y={x:o.x,y:K,width:o.width,height:z},Math.abs(G)>0&&Math.abs(H)<Math.abs(G)){var Et=Yn(H||G)*(Math.abs(G)-Math.abs(H));H+=Et}}return pn(pn(pn({},N),{},{x:j,y:K,width:H,height:z,value:h?D:D[1],payload:N,background:Y},O&&O[V]&&O[V].props),{},{tooltipPayload:[gk(n,N)],tooltipPosition:{x:j+H/2,y:K+z/2}})});return pn({data:R,layout:x},m)});function sh(e){"@babel/helpers - typeof";return sh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sh(e)}function kot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gk(r.key),r)}}function $ot(e,t,n){return t&&IA(e.prototype,t),n&&IA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function RA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RA(Object(n),!0).forEach(function(r){lm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lm(e,t,n){return t=Gk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gk(e){var t=Iot(e,"string");return sh(t)=="symbol"?t:t+""}function Iot(e,t){if(sh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hx=function(t,n,r,i,o){var s=t.width,l=t.height,c=t.layout,h=t.children,u=Object.keys(n),f={left:r.left,leftMirror:r.left,right:s-r.right,rightMirror:s-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},m=!!vr(h,Aa);return u.reduce(function(y,x){var p=n[x],b=p.orientation,P=p.domain,S=p.padding,A=S===void 0?{}:S,E=p.mirror,w=p.reversed,T="".concat(b).concat(E?"Mirror":""),O,R,N,V,D;if(p.type==="number"&&(p.padding==="gap"||p.padding==="no-gap")){var j=P[1]-P[0],K=1/0,H=p.categoricalDomain.sort(NW);if(H.forEach(function(ct,gt){gt>0&&(K=Math.min((ct||0)-(H[gt-1]||0),K))}),Number.isFinite(K)){var z=K/j,Y=p.layout==="vertical"?r.height:r.width;if(p.padding==="gap"&&(O=z*Y/2),p.padding==="no-gap"){var G=Kn(t.barCategoryGap,z*Y),J=z*Y/2;O=J-G-(J-G)/Y*G}}}i==="xAxis"?R=[r.left+(A.left||0)+(O||0),r.left+r.width-(A.right||0)-(O||0)]:i==="yAxis"?R=c==="horizontal"?[r.top+r.height-(A.bottom||0),r.top+(A.top||0)]:[r.top+(A.top||0)+(O||0),r.top+r.height-(A.bottom||0)-(O||0)]:R=p.range,w&&(R=[R[1],R[0]]);var lt=fk(p,o,m),q=lt.scale,nt=lt.realScaleType;q.domain(P).range(R),dk(q);var it=pk(q,Jr(Jr({},p),{},{realScaleType:nt}));i==="xAxis"?(D=b==="top"&&!E||b==="bottom"&&E,N=r.left,V=f[T]-D*p.height):i==="yAxis"&&(D=b==="left"&&!E||b==="right"&&E,N=f[T]-D*p.width,V=r.top);var at=Jr(Jr(Jr({},p),it),{},{realScaleType:nt,x:N,y:V,scale:q,width:i==="xAxis"?r.width:p.width,height:i==="yAxis"?r.height:p.height});return at.bandSize=$d(at,it),!p.hide&&i==="xAxis"?f[T]+=(D?-1:1)*at.height:p.hide||(f[T]+=(D?-1:1)*at.width),Jr(Jr({},y),{},lm({},x,at))},{})},Zk=function(t,n){var r=t.x,i=t.y,o=n.x,s=n.y;return{x:Math.min(r,o),y:Math.min(i,s),width:Math.abs(o-r),height:Math.abs(s-i)}},Rot=function(t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2;return Zk({x:n,y:r},{x:i,y:o})},Yk=function(){function e(t){kot(this,e),this.scale=t}return $ot(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])}();lm(Yk,"EPS",1e-4);var fx=function(t){var n=Object.keys(t).reduce(function(r,i){return Jr(Jr({},r),{},lm({},i,Yk.create(t[i])))},{});return Jr(Jr({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,l=o.position;return tot(i,function(c,h){return n[h].apply(c,{bandAware:s,position:l})})},isInRange:function(i){return Vk(i,function(o,s){return n[s].isInRange(o)})}})};function Lot(e){return(e%180+180)%180}var Not=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=Lot(i),s=o*Math.PI/180,l=Math.atan(r/n),c=s>l&&s<Math.PI-l?r/Math.sin(s):n/Math.cos(s);return Math.abs(c)},jot=Ei,Dot=vh,Bot=Fp;function zot(e){return function(t,n,r){var i=Object(t);if(!Dot(t)){var o=jot(n);t=Bot(t),n=function(l){return o(i[l],l,i)}}var s=e(t,n,r);return s>-1?i[o?t[s]:s]:void 0}}var Fot=zot,Wot=Bk;function Vot(e){var t=Wot(e),n=t%1;return t===t?n?t-n:t:0}var Uot=Vot,Hot=GO,qot=Ei,Got=Uot,Zot=Math.max;function Yot(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Got(n);return i<0&&(i=Zot(r+i,0)),Hot(e,qot(t),i)}var Kot=Yot,Xot=Fot,Jot=Kot,Qot=Xot(Jot),tst=Qot;const est=Me(tst);var nst=D3(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")});function Jd(e){"@babel/helpers - typeof";return Jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jd(e)}var dx=v.createContext(void 0),px=v.createContext(void 0),Kk=v.createContext(void 0),Xk=v.createContext({}),Jk=v.createContext(void 0),Qk=v.createContext(0),t$=v.createContext(0),LA=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,s=t.clipPathId,l=t.children,c=t.width,h=t.height,u=nst(o);return v.createElement(dx.Provider,{value:r},v.createElement(px.Provider,{value:i},v.createElement(Xk.Provider,{value:o},v.createElement(Kk.Provider,{value:u},v.createElement(Jk.Provider,{value:s},v.createElement(Qk.Provider,{value:h},v.createElement(t$.Provider,{value:c},l)))))))},rst=function(){return v.useContext(Jk)};function e$(e){var t=Object.keys(e);return t.length===0?"There are no available ids.":"Available ids are: ".concat(t,".")}var n$=function(t){var n=v.useContext(dx);n==null&&(process.env.NODE_ENV!=="production"?lr(!1,"Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"):lr());var r=n[t];return r==null&&(process.env.NODE_ENV!=="production"?lr(!1,'Could not find xAxis by id "'.concat(t,'" [').concat(Jd(t),"]. ").concat(e$(n))):lr()),r},ist=function(){var t=v.useContext(dx);return Uo(t)},ost=function(){var t=v.useContext(px),n=est(t,function(r){return Vk(r.domain,Number.isFinite)});return n||Uo(t)},r$=function(t){var n=v.useContext(px);n==null&&(process.env.NODE_ENV!=="production"?lr(!1,"Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"):lr());var r=n[t];return r==null&&(process.env.NODE_ENV!=="production"?lr(!1,'Could not find yAxis by id "'.concat(t,'" [').concat(Jd(t),"]. ").concat(e$(n))):lr()),r},sst=function(){var t=v.useContext(Kk);return t},ast=function(){return v.useContext(Xk)},mx=function(){return v.useContext(t$)},gx=function(){return v.useContext(Qk)};function Nl(e){"@babel/helpers - typeof";return Nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nl(e)}function lst(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cst(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o$(r.key),r)}}function ust(e,t,n){return t&&cst(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function hst(e,t,n){return t=Qd(t),fst(e,i$()?Reflect.construct(t,n||[],Qd(e).constructor):t.apply(e,n))}function fst(e,t){if(t&&(Nl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dst(e)}function dst(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(i$=function(){return!!e})()}function Qd(e){return Qd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qd(e)}function pst(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bv(e,t)}function Bv(e,t){return Bv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Bv(e,t)}function NA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NA(Object(n),!0).forEach(function(r){yx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yx(e,t,n){return t=o$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o$(e){var t=mst(e,"string");return Nl(t)=="symbol"?t:t+""}function mst(e,t){if(Nl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function gst(e,t){return xst(e)||bst(e,t)||vst(e,t)||yst()}function yst(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
113
113
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vst(e,t){if(e){if(typeof e=="string")return DA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DA(e,t)}}function DA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bst(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function xst(e){if(Array.isArray(e))return e}function zv(){return zv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zv.apply(this,arguments)}var wst=function(t,n){var r;return v.isValidElement(t)?r=v.cloneElement(t,n):Vt(t)?r=t(n):r=v.createElement("line",zv({},n,{className:"recharts-reference-line-line"})),r},_st=function(t,n,r,i,o,s,l,c,h){var u=o.x,f=o.y,m=o.width,y=o.height;if(r){var x=h.y,p=t.y.apply(x,{position:s});if(Pi(h,"discard")&&!t.y.isInRange(p))return null;var b=[{x:u+m,y:p},{x:u,y:p}];return c==="left"?b.reverse():b}if(n){var P=h.x,S=t.x.apply(P,{position:s});if(Pi(h,"discard")&&!t.x.isInRange(S))return null;var A=[{x:S,y:f+y},{x:S,y:f}];return l==="top"?A.reverse():A}if(i){var E=h.segment,w=E.map(function(T){return t.apply(T,{position:s})});return Pi(h,"discard")&&qit(w,function(T){return!t.isInRange(T)})?null:w}return null};function Sst(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,o=e.yAxisId,s=e.shape,l=e.className,c=e.alwaysShow,h=rst(),u=n$(i),f=r$(o),m=sst();if(!h||!m)return null;ei(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var y=fx({x:u.scale,y:f.scale}),x=xn(t),p=xn(n),b=r&&r.length===2,P=_st(y,x,p,b,m,e.position,u.orientation,f.orientation,e);if(!P)return null;var S=gst(P,2),A=S[0],E=A.x,w=A.y,T=S[1],O=T.x,R=T.y,N=Pi(e,"hidden")?"url(#".concat(h,")"):void 0,V=jA(jA({clipPath:N},Lt(e,!0)),{},{x1:E,y1:w,x2:O,y2:R});return v.createElement(ue,{className:Jt("recharts-reference-line",l)},wst(s,V),An.renderCallByParent(e,Rot({x1:E,y1:w,x2:O,y2:R})))}var vx=function(e){function t(){return lst(this,t),hst(this,t,arguments)}return pst(t,e),ust(t,[{key:"render",value:function(){return v.createElement(Sst,this.props)}}])}(v.Component);yx(vx,"displayName","ReferenceLine");yx(vx,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Fv(){return Fv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fv.apply(this,arguments)}function jl(e){"@babel/helpers - typeof";return jl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jl(e)}function BA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BA(Object(n),!0).forEach(function(r){cm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pst(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ast(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a$(r.key),r)}}function Tst(e,t,n){return t&&Ast(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Est(e,t,n){return t=tp(t),Cst(e,s$()?Reflect.construct(t,n||[],tp(e).constructor):t.apply(e,n))}function Cst(e,t){if(t&&(jl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ost(e)}function Ost(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(s$=function(){return!!e})()}function tp(e){return tp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},tp(e)}function Mst(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wv(e,t)}function Wv(e,t){return Wv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Wv(e,t)}function cm(e,t,n){return t=a$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a$(e){var t=kst(e,"string");return jl(t)=="symbol"?t:t+""}function kst(e,t){if(jl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var $st=function(t){var n=t.x,r=t.y,i=t.xAxis,o=t.yAxis,s=fx({x:i.scale,y:o.scale}),l=s.apply({x:n,y:r},{bandAware:!0});return Pi(t,"discard")&&!s.isInRange(l)?null:l},um=function(e){function t(){return Pst(this,t),Est(this,t,arguments)}return Mst(t,e),Tst(t,[{key:"render",value:function(){var r=this.props,i=r.x,o=r.y,s=r.r,l=r.alwaysShow,c=r.clipPathId,h=xn(i),u=xn(o);if(ei(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!h||!u)return null;var f=$st(this.props);if(!f)return null;var m=f.x,y=f.y,x=this.props,p=x.shape,b=x.className,P=Pi(this.props,"hidden")?"url(#".concat(c,")"):void 0,S=zA(zA({clipPath:P},Lt(this.props,!0)),{},{cx:m,cy:y});return v.createElement(ue,{className:Jt("recharts-reference-dot",b)},t.renderDot(p,S),An.renderCallByParent(this.props,{x:m-s,y:y-s,width:2*s,height:2*s}))}}])}(v.Component);cm(um,"displayName","ReferenceDot");cm(um,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});cm(um,"renderDot",function(e,t){var n;return v.isValidElement(e)?n=v.cloneElement(e,t):Vt(e)?n=e(t):n=v.createElement(em,Fv({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function Vv(){return Vv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vv.apply(this,arguments)}function Dl(e){"@babel/helpers - typeof";return Dl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dl(e)}function FA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function WA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FA(Object(n),!0).forEach(function(r){hm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ist(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rst(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c$(r.key),r)}}function Lst(e,t,n){return t&&Rst(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Nst(e,t,n){return t=ep(t),jst(e,l$()?Reflect.construct(t,n||[],ep(e).constructor):t.apply(e,n))}function jst(e,t){if(t&&(Dl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dst(e)}function Dst(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(l$=function(){return!!e})()}function ep(e){return ep=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ep(e)}function Bst(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Uv(e,t)}function Uv(e,t){return Uv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Uv(e,t)}function hm(e,t,n){return t=c$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c$(e){var t=zst(e,"string");return Dl(t)=="symbol"?t:t+""}function zst(e,t){if(Dl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Fst=function(t,n,r,i,o){var s=o.x1,l=o.x2,c=o.y1,h=o.y2,u=o.xAxis,f=o.yAxis;if(!u||!f)return null;var m=fx({x:u.scale,y:f.scale}),y={x:t?m.x.apply(s,{position:"start"}):m.x.rangeMin,y:r?m.y.apply(c,{position:"start"}):m.y.rangeMin},x={x:n?m.x.apply(l,{position:"end"}):m.x.rangeMax,y:i?m.y.apply(h,{position:"end"}):m.y.rangeMax};return Pi(o,"discard")&&(!m.isInRange(y)||!m.isInRange(x))?null:Zk(y,x)},fm=function(e){function t(){return Ist(this,t),Nst(this,t,arguments)}return Bst(t,e),Lst(t,[{key:"render",value:function(){var r=this.props,i=r.x1,o=r.x2,s=r.y1,l=r.y2,c=r.className,h=r.alwaysShow,u=r.clipPathId;ei(h===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=xn(i),m=xn(o),y=xn(s),x=xn(l),p=this.props.shape;if(!f&&!m&&!y&&!x&&!p)return null;var b=Fst(f,m,y,x,this.props);if(!b&&!p)return null;var P=Pi(this.props,"hidden")?"url(#".concat(u,")"):void 0;return v.createElement(ue,{className:Jt("recharts-reference-area",c)},t.renderRect(p,WA(WA({clipPath:P},Lt(this.props,!0)),b)),An.renderCallByParent(this.props,b))}}])}(v.Component);hm(fm,"displayName","ReferenceArea");hm(fm,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});hm(fm,"renderRect",function(e,t){var n;return v.isValidElement(e)?n=v.cloneElement(e,t):Vt(e)?n=e(t):n=v.createElement(ux,Vv({},t,{className:"recharts-reference-area-rect"})),n});function u$(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)r.push(e[i]);return r}function Wst(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Not(r,n)}function Vst(e,t,n){var r=n==="width",i=e.x,o=e.y,s=e.width,l=e.height;return t===1?{start:r?i:o,end:r?i+s:o+l}:{start:r?i+s:o+l,end:r?i:o}}function np(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-i)<=0}function Ust(e,t){return u$(e,t+1)}function Hst(e,t,n,r,i){for(var o=(r||[]).slice(),s=t.start,l=t.end,c=0,h=1,u=s,f=function(){var x=r==null?void 0:r[c];if(x===void 0)return{v:u$(r,h)};var p=c,b,P=function(){return b===void 0&&(b=n(x,p)),b},S=x.coordinate,A=c===0||np(e,S,P,u,l);A||(c=0,u=s,h+=1),A&&(u=S+e*(P()/2+i),c+=h)},m;h<=o.length;)if(m=f(),m)return m.v;return[]}function ah(e){"@babel/helpers - typeof";return ah=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ah(e)}function VA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Un(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VA(Object(n),!0).forEach(function(r){qst(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qst(e,t,n){return t=Gst(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gst(e){var t=Zst(e,"string");return ah(t)=="symbol"?t:t+""}function Zst(e,t){if(ah(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ah(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yst(e,t,n,r,i){for(var o=(r||[]).slice(),s=o.length,l=t.start,c=t.end,h=function(m){var y=o[m],x,p=function(){return x===void 0&&(x=n(y,m)),x};if(m===s-1){var b=e*(y.coordinate+e*p()/2-c);o[m]=y=Un(Un({},y),{},{tickCoord:b>0?y.coordinate-b*e:y.coordinate})}else o[m]=y=Un(Un({},y),{},{tickCoord:y.coordinate});var P=np(e,y.tickCoord,p,l,c);P&&(c=y.tickCoord-e*(p()/2+i),o[m]=Un(Un({},y),{},{isShow:!0}))},u=s-1;u>=0;u--)h(u);return o}function Kst(e,t,n,r,i,o){var s=(r||[]).slice(),l=s.length,c=t.start,h=t.end;if(o){var u=r[l-1],f=n(u,l-1),m=e*(u.coordinate+e*f/2-h);s[l-1]=u=Un(Un({},u),{},{tickCoord:m>0?u.coordinate-m*e:u.coordinate});var y=np(e,u.tickCoord,function(){return f},c,h);y&&(h=u.tickCoord-e*(f/2+i),s[l-1]=Un(Un({},u),{},{isShow:!0}))}for(var x=o?l-1:l,p=function(S){var A=s[S],E,w=function(){return E===void 0&&(E=n(A,S)),E};if(S===0){var T=e*(A.coordinate-e*w()/2-c);s[S]=A=Un(Un({},A),{},{tickCoord:T<0?A.coordinate-T*e:A.coordinate})}else s[S]=A=Un(Un({},A),{},{tickCoord:A.coordinate});var O=np(e,A.tickCoord,w,c,h);O&&(c=A.tickCoord+e*(w()/2+i),s[S]=Un(Un({},A),{},{isShow:!0}))},b=0;b<x;b++)p(b);return s}function bx(e,t,n){var r=e.tick,i=e.ticks,o=e.viewBox,s=e.minTickGap,l=e.orientation,c=e.interval,h=e.tickFormatter,u=e.unit,f=e.angle;if(!i||!i.length||!r)return[];if(xt(c)||ls.isSsr)return Ust(i,typeof c=="number"&&xt(c)?c:0);var m=[],y=l==="top"||l==="bottom"?"width":"height",x=u&&y==="width"?uu(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},p=function(A,E){var w=Vt(h)?h(A.value,E):A.value;return y==="width"?Wst(uu(w,{fontSize:t,letterSpacing:n}),x,f):uu(w,{fontSize:t,letterSpacing:n})[y]},b=i.length>=2?Yn(i[1].coordinate-i[0].coordinate):1,P=Vst(o,b,y);return c==="equidistantPreserveStart"?Hst(b,P,p,i,s):(c==="preserveStart"||c==="preserveStartEnd"?m=Kst(b,P,p,i,s,c==="preserveStartEnd"):m=Yst(b,P,p,i,s),m.filter(function(S){return S.isShow}))}var Xst=["viewBox"],Jst=["viewBox"],Qst=["ticks"];function Bl(e){"@babel/helpers - typeof";return Bl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bl(e)}function rl(){return rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rl.apply(this,arguments)}function UA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UA(Object(n),!0).forEach(function(r){xx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fg(e,t){if(e==null)return{};var n=tat(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tat(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function eat(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f$(r.key),r)}}function nat(e,t,n){return t&&HA(e.prototype,t),n&&HA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function rat(e,t,n){return t=rp(t),iat(e,h$()?Reflect.construct(t,n||[],rp(e).constructor):t.apply(e,n))}function iat(e,t){if(t&&(Bl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oat(e)}function oat(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(h$=function(){return!!e})()}function rp(e){return rp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rp(e)}function sat(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hv(e,t)}function Hv(e,t){return Hv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Hv(e,t)}function xx(e,t,n){return t=f$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f$(e){var t=aat(e,"string");return Bl(t)=="symbol"?t:t+""}function aat(e,t){if(Bl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var dc=function(e){function t(n){var r;return eat(this,t),r=rat(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return sat(t,e),nat(t,[{key:"shouldComponentUpdate",value:function(r,i){var o=r.viewBox,s=Fg(r,Xst),l=this.props,c=l.viewBox,h=Fg(l,Jst);return!ll(o,c)||!ll(s,h)||!ll(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,o=i.x,s=i.y,l=i.width,c=i.height,h=i.orientation,u=i.tickSize,f=i.mirror,m=i.tickMargin,y,x,p,b,P,S,A=f?-1:1,E=r.tickSize||u,w=xt(r.tickCoord)?r.tickCoord:r.coordinate;switch(h){case"top":y=x=r.coordinate,b=s+ +!f*c,p=b-A*E,S=p-A*m,P=w;break;case"left":p=b=r.coordinate,x=o+ +!f*l,y=x-A*E,P=y-A*m,S=w;break;case"right":p=b=r.coordinate,x=o+ +f*l,y=x+A*E,P=y+A*m,S=w;break;default:y=x=r.coordinate,b=s+ +f*c,p=b+A*E,S=p+A*m,P=w;break}return{line:{x1:y,y1:p,x2:x,y2:b},tick:{x:P,y:S}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,o=r.mirror,s;switch(i){case"left":s=o?"start":"end";break;case"right":s=o?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,o=r.mirror,s="end";switch(i){case"left":case"right":s="middle";break;case"top":s=o?"start":"end";break;default:s=o?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,l=r.height,c=r.orientation,h=r.mirror,u=r.axisLine,f=yn(yn(yn({},Lt(this.props,!1)),Lt(u,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var m=+(c==="top"&&!h||c==="bottom"&&h);f=yn(yn({},f),{},{x1:i,y1:o+m*l,x2:i+s,y2:o+m*l})}else{var y=+(c==="left"&&!h||c==="right"&&h);f=yn(yn({},f),{},{x1:i+y*s,y1:o,x2:i+y*s,y2:o+l})}return v.createElement("line",rl({},f,{className:Jt("recharts-cartesian-axis-line",_r(u,"className"))}))}},{key:"renderTicks",value:function(r,i,o){var s=this,l=this.props,c=l.tickLine,h=l.stroke,u=l.tick,f=l.tickFormatter,m=l.unit,y=bx(yn(yn({},this.props),{},{ticks:r}),i,o),x=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),b=Lt(this.props,!1),P=Lt(u,!1),S=yn(yn({},b),{},{fill:"none"},Lt(c,!1)),A=y.map(function(E,w){var T=s.getTickLineCoord(E),O=T.line,R=T.tick,N=yn(yn(yn(yn({textAnchor:x,verticalAnchor:p},b),{},{stroke:"none",fill:h},P),R),{},{index:w,payload:E,visibleTicksCount:y.length,tickFormatter:f});return v.createElement(ue,rl({className:"recharts-cartesian-axis-tick",key:"tick-".concat(E.value,"-").concat(E.coordinate,"-").concat(E.tickCoord)},rs(s.props,E,w)),c&&v.createElement("line",rl({},S,O,{className:Jt("recharts-cartesian-axis-tick-line",_r(c,"className"))})),u&&t.renderTickItem(u,N,"".concat(Vt(f)?f(E.value,w):E.value).concat(m||"")))});return v.createElement("g",{className:"recharts-cartesian-axis-ticks"},A)}},{key:"render",value:function(){var r=this,i=this.props,o=i.axisLine,s=i.width,l=i.height,c=i.ticksGenerator,h=i.className,u=i.hide;if(u)return null;var f=this.props,m=f.ticks,y=Fg(f,Qst),x=m;return Vt(c)&&(x=m&&m.length>0?c(this.props):c(y)),s<=0||l<=0||!x||!x.length?null:v.createElement(ue,{className:Jt("recharts-cartesian-axis",h),ref:function(b){r.layerReference=b}},o&&this.renderAxisLine(),this.renderTicks(x,this.state.fontSize,this.state.letterSpacing),An.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var s,l=Jt(i.className,"recharts-cartesian-axis-tick-value");return v.isValidElement(r)?s=v.cloneElement(r,yn(yn({},i),{},{className:l})):Vt(r)?s=r(yn(yn({},i),{},{className:l})):s=v.createElement(da,rl({},i,{className:"recharts-cartesian-axis-tick-value"}),o),s}}])}(v.Component);xx(dc,"displayName","CartesianAxis");xx(dc,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var lat=["x1","y1","x2","y2","key"],cat=["offset"];function ga(e){"@babel/helpers - typeof";return ga=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ga(e)}function qA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Hn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qA(Object(n),!0).forEach(function(r){uat(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uat(e,t,n){return t=hat(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hat(e){var t=fat(e,"string");return ga(t)=="symbol"?t:t+""}function fat(e,t){if(ga(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ga(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qs(){return Qs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qs.apply(this,arguments)}function GA(e,t){if(e==null)return{};var n=dat(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dat(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var pat=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,o=t.y,s=t.width,l=t.height,c=t.ry;return v.createElement("rect",{x:i,y:o,ry:c,width:s,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function d$(e,t){var n;if(v.isValidElement(e))n=v.cloneElement(e,t);else if(Vt(e))n=e(t);else{var r=t.x1,i=t.y1,o=t.x2,s=t.y2,l=t.key,c=GA(t,lat),h=Lt(c,!1);h.offset;var u=GA(h,cat);n=v.createElement("line",Qs({},u,{x1:r,y1:i,x2:o,y2:s,fill:"none",key:l}))}return n}function mat(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,o=e.horizontalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(l,c){var h=Hn(Hn({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return d$(i,h)});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function gat(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,o=e.verticalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(l,c){var h=Hn(Hn({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return d$(i,h)});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function yat(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,o=e.width,s=e.height,l=e.horizontalPoints,c=e.horizontal,h=c===void 0?!0:c;if(!h||!t||!t.length)return null;var u=l.map(function(m){return Math.round(m+i-i)}).sort(function(m,y){return m-y});i!==u[0]&&u.unshift(0);var f=u.map(function(m,y){var x=!u[y+1],p=x?i+s-m:u[y+1]-m;if(p<=0)return null;var b=y%t.length;return v.createElement("rect",{key:"react-".concat(y),y:m,x:r,height:p,width:o,stroke:"none",fill:t[b],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function vat(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,o=e.x,s=e.y,l=e.width,c=e.height,h=e.verticalPoints;if(!n||!r||!r.length)return null;var u=h.map(function(m){return Math.round(m+o-o)}).sort(function(m,y){return m-y});o!==u[0]&&u.unshift(0);var f=u.map(function(m,y){var x=!u[y+1],p=x?o+l-m:u[y+1]-m;if(p<=0)return null;var b=y%r.length;return v.createElement("rect",{key:"react-".concat(y),x:m,y:s,width:p,height:c,stroke:"none",fill:r[b],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var bat=function(t,n){var r=t.xAxis,i=t.width,o=t.height,s=t.offset;return hk(bx(Hn(Hn(Hn({},dc.defaultProps),r),{},{ticks:so(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.left,s.left+s.width,n)},xat=function(t,n){var r=t.yAxis,i=t.width,o=t.height,s=t.offset;return hk(bx(Hn(Hn(Hn({},dc.defaultProps),r),{},{ticks:so(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.top,s.top+s.height,n)},Ua={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function dm(e){var t,n,r,i,o,s,l=mx(),c=gx(),h=ast(),u=Hn(Hn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Ua.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:Ua.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:Ua.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Ua.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:Ua.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:Ua.verticalFill,x:xt(e.x)?e.x:h.left,y:xt(e.y)?e.y:h.top,width:xt(e.width)?e.width:h.width,height:xt(e.height)?e.height:h.height}),f=u.x,m=u.y,y=u.width,x=u.height,p=u.syncWithTicks,b=u.horizontalValues,P=u.verticalValues,S=ist(),A=ost();if(!xt(y)||y<=0||!xt(x)||x<=0||!xt(f)||f!==+f||!xt(m)||m!==+m)return null;var E=u.verticalCoordinatesGenerator||bat,w=u.horizontalCoordinatesGenerator||xat,T=u.horizontalPoints,O=u.verticalPoints;if((!T||!T.length)&&Vt(w)){var R=b&&b.length,N=w({yAxis:A?Hn(Hn({},A),{},{ticks:R?b:A.ticks}):void 0,width:l,height:c,offset:h},R?!0:p);ei(Array.isArray(N),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(ga(N),"]")),Array.isArray(N)&&(T=N)}if((!O||!O.length)&&Vt(E)){var V=P&&P.length,D=E({xAxis:S?Hn(Hn({},S),{},{ticks:V?P:S.ticks}):void 0,width:l,height:c,offset:h},V?!0:p);ei(Array.isArray(D),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(ga(D),"]")),Array.isArray(D)&&(O=D)}return v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(pat,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height,ry:u.ry}),v.createElement(mat,Qs({},u,{offset:h,horizontalPoints:T,xAxis:S,yAxis:A})),v.createElement(gat,Qs({},u,{offset:h,verticalPoints:O,xAxis:S,yAxis:A})),v.createElement(yat,Qs({},u,{horizontalPoints:T})),v.createElement(vat,Qs({},u,{verticalPoints:O})))}dm.displayName="CartesianGrid";var wat=["layout","type","stroke","connectNulls","isRange","ref"],_at=["key"],p$;function zl(e){"@babel/helpers - typeof";return zl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zl(e)}function m$(e,t){if(e==null)return{};var n=Sat(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sat(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ta(){return ta=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ta.apply(this,arguments)}function ZA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZA(Object(n),!0).forEach(function(r){vi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pat(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y$(r.key),r)}}function Aat(e,t,n){return t&&YA(e.prototype,t),n&&YA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tat(e,t,n){return t=ip(t),Eat(e,g$()?Reflect.construct(t,n||[],ip(e).constructor):t.apply(e,n))}function Eat(e,t){if(t&&(zl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cat(e)}function Cat(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g$=function(){return!!e})()}function ip(e){return ip=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ip(e)}function Oat(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qv(e,t)}function qv(e,t){return qv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},qv(e,t)}function vi(e,t,n){return t=y$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y$(e){var t=Mat(e,"string");return zl(t)=="symbol"?t:t+""}function Mat(e,t){if(zl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var fs=function(e){function t(){var n;Pat(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=Tat(this,t,[].concat(i)),vi(n,"state",{isAnimationFinished:!0}),vi(n,"id",wa("recharts-area-")),vi(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Vt(s)&&s()}),vi(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Vt(s)&&s()}),n}return Oat(t,e),Aat(t,[{key:"renderDots",value:function(r,i,o){var s=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(s&&!l)return null;var c=this.props,h=c.dot,u=c.points,f=c.dataKey,m=Lt(this.props,!1),y=Lt(h,!0),x=u.map(function(b,P){var S=Fo(Fo(Fo({key:"dot-".concat(P),r:3},m),y),{},{index:P,cx:b.x,cy:b.y,dataKey:f,value:b.value,payload:b.payload,points:u});return t.renderDotItem(h,S)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return v.createElement(ue,ta({className:"recharts-area-dots"},p),x)}},{key:"renderHorizontalRect",value:function(r){var i=this.props,o=i.baseLine,s=i.points,l=i.strokeWidth,c=s[0].x,h=s[s.length-1].x,u=r*Math.abs(c-h),f=Go(s.map(function(m){return m.y||0}));return xt(o)&&typeof o=="number"?f=Math.max(o,f):o&&Array.isArray(o)&&o.length&&(f=Math.max(Go(o.map(function(m){return m.y||0})),f)),xt(f)?v.createElement("rect",{x:c<h?c:c-u,y:0,width:u,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var i=this.props,o=i.baseLine,s=i.points,l=i.strokeWidth,c=s[0].y,h=s[s.length-1].y,u=r*Math.abs(c-h),f=Go(s.map(function(m){return m.x||0}));return xt(o)&&typeof o=="number"?f=Math.max(o,f):o&&Array.isArray(o)&&o.length&&(f=Math.max(Go(o.map(function(m){return m.x||0})),f)),xt(f)?v.createElement("rect",{x:0,y:c<h?c:c-u,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(u)}):null}},{key:"renderClipRect",value:function(r){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,i,o,s){var l=this.props,c=l.layout,h=l.type,u=l.stroke,f=l.connectNulls,m=l.isRange;l.ref;var y=m$(l,wat);return v.createElement(ue,{clipPath:o?"url(#clipPath-".concat(s,")"):null},v.createElement(sa,ta({},Lt(y,!0),{points:r,connectNulls:f,type:h,baseLine:i,layout:c,stroke:"none",className:"recharts-area-area"})),u!=="none"&&v.createElement(sa,ta({},Lt(this.props,!1),{className:"recharts-area-curve",layout:c,type:h,connectNulls:f,fill:"none",points:r})),u!=="none"&&m&&v.createElement(sa,ta({},Lt(this.props,!1),{className:"recharts-area-curve",layout:c,type:h,connectNulls:f,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(r,i){var o=this,s=this.props,l=s.points,c=s.baseLine,h=s.isAnimationActive,u=s.animationBegin,f=s.animationDuration,m=s.animationEasing,y=s.animationId,x=this.state,p=x.prevPoints,b=x.prevBaseLine;return v.createElement(ni,{begin:u,duration:f,isActive:h,easing:m,from:{t:0},to:{t:1},key:"area-".concat(y),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(P){var S=P.t;if(p){var A=p.length/l.length,E=l.map(function(R,N){var V=Math.floor(N*A);if(p[V]){var D=p[V],j=Pn(D.x,R.x),K=Pn(D.y,R.y);return Fo(Fo({},R),{},{x:j(S),y:K(S)})}return R}),w;if(xt(c)&&typeof c=="number"){var T=Pn(b,c);w=T(S)}else if(Ut(c)||sc(c)){var O=Pn(b,0);w=O(S)}else w=c.map(function(R,N){var V=Math.floor(N*A);if(b[V]){var D=b[V],j=Pn(D.x,R.x),K=Pn(D.y,R.y);return Fo(Fo({},R),{},{x:j(S),y:K(S)})}return R});return o.renderAreaStatically(E,w,r,i)}return v.createElement(ue,null,v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(i)},o.renderClipRect(S))),v.createElement(ue,{clipPath:"url(#animationClipPath-".concat(i,")")},o.renderAreaStatically(l,c,r,i)))})}},{key:"renderArea",value:function(r,i){var o=this.props,s=o.points,l=o.baseLine,c=o.isAnimationActive,h=this.state,u=h.prevPoints,f=h.prevBaseLine,m=h.totalLength;return c&&s&&s.length&&(!u&&m>0||!pa(u,s)||!pa(f,l))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(s,l,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,l=i.points,c=i.className,h=i.top,u=i.left,f=i.xAxis,m=i.yAxis,y=i.width,x=i.height,p=i.isAnimationActive,b=i.id;if(o||!l||!l.length)return null;var P=this.state.isAnimationFinished,S=l.length===1,A=Jt("recharts-area",c),E=f&&f.allowDataOverflow,w=m&&m.allowDataOverflow,T=E||w,O=Ut(b)?this.id:b,R=(r=Lt(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},N=R.r,V=N===void 0?3:N,D=R.strokeWidth,j=D===void 0?2:D,K=HW(s)?s:{},H=K.clipDot,z=H===void 0?!0:H,Y=V*2+j;return v.createElement(ue,{className:A},E||w?v.createElement("defs",null,v.createElement("clipPath",{id:"clipPath-".concat(O)},v.createElement("rect",{x:E?u:u-y/2,y:w?h:h-x/2,width:E?y:y*2,height:w?x:x*2})),!z&&v.createElement("clipPath",{id:"clipPath-dots-".concat(O)},v.createElement("rect",{x:u-Y/2,y:h-Y/2,width:y+Y,height:x+Y}))):null,S?null:this.renderArea(T,O),(s||S)&&this.renderDots(T,z,O),(!p||P)&&Si.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(v.PureComponent);p$=fs;vi(fs,"displayName","Area");vi(fs,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ls.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});vi(fs,"getBaseValue",function(e,t,n,r){var i=e.layout,o=e.baseValue,s=t.props.baseValue,l=s??o;if(xt(l)&&typeof l=="number")return l;var c=i==="horizontal"?r:n,h=c.scale.domain();if(c.type==="number"){var u=Math.max(h[0],h[1]),f=Math.min(h[0],h[1]);return l==="dataMin"?f:l==="dataMax"||u<0?u:Math.max(Math.min(h[0],h[1]),0)}return l==="dataMin"?h[0]:l==="dataMax"?h[1]:h[0]});vi(fs,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,i=e.yAxis,o=e.xAxisTicks,s=e.yAxisTicks,l=e.bandSize,c=e.dataKey,h=e.stackedData,u=e.dataStartIndex,f=e.displayedData,m=e.offset,y=t.layout,x=h&&h.length,p=p$.getBaseValue(t,n,r,i),b=y==="horizontal",P=!1,S=f.map(function(E,w){var T;x?T=h[u+w]:(T=Qe(E,c),Array.isArray(T)?P=!0:T=[p,T]);var O=T[1]==null||x&&Qe(E,c)==null;return b?{x:kd({axis:r,ticks:o,bandSize:l,entry:E,index:w}),y:O?null:i.scale(T[1]),value:T,payload:E}:{x:O?null:r.scale(T[1]),y:kd({axis:i,ticks:s,bandSize:l,entry:E,index:w}),value:T,payload:E}}),A;return x||P?A=S.map(function(E){var w=Array.isArray(E.value)?E.value[0]:null;return b?{x:E.x,y:w!=null&&E.y!=null?i.scale(w):null}:{x:w!=null?r.scale(w):null,y:E.y}}):A=b?i.scale(p):r.scale(p),Fo({points:S,baseLine:A,layout:y,isRange:P},m)});vi(fs,"renderDotItem",function(e,t){var n;if(v.isValidElement(e))n=v.cloneElement(e,t);else if(Vt(e))n=e(t);else{var r=Jt("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,o=m$(t,_at);n=v.createElement(em,ta({},o,{key:i,className:r}))}return n});function Fl(e){"@babel/helpers - typeof";return Fl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fl(e)}function kat(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $at(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,x$(r.key),r)}}function Iat(e,t,n){return t&&$at(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rat(e,t,n){return t=op(t),Lat(e,v$()?Reflect.construct(t,n||[],op(e).constructor):t.apply(e,n))}function Lat(e,t){if(t&&(Fl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nat(e)}function Nat(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(v$=function(){return!!e})()}function op(e){return op=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},op(e)}function jat(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gv(e,t)}function Gv(e,t){return Gv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Gv(e,t)}function b$(e,t,n){return t=x$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x$(e){var t=Dat(e,"string");return Fl(t)=="symbol"?t:t+""}function Dat(e,t){if(Fl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ah=function(e){function t(){return kat(this,t),Rat(this,t,arguments)}return jat(t,e),Iat(t,[{key:"render",value:function(){return null}}])}(Jn.Component);b$(Ah,"displayName","ZAxis");b$(Ah,"defaultProps",{zAxisId:0,range:[64,64],scale:"auto",type:"number"});var Bat=["option","isActive"];function gu(){return gu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gu.apply(this,arguments)}function zat(e,t){if(e==null)return{};var n=Fat(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fat(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Wat(e){var t=e.option,n=e.isActive,r=zat(e,Bat);return typeof t=="string"?Jn.createElement(Hd,gu({option:Jn.createElement(zp,gu({type:t},r)),isActive:n,shapeType:"symbols"},r)):Jn.createElement(Hd,gu({option:t,isActive:n,shapeType:"symbols"},r))}function Wl(e){"@babel/helpers - typeof";return Wl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wl(e)}function yu(){return yu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yu.apply(this,arguments)}function KA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KA(Object(n),!0).forEach(function(r){Yo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vat(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_$(r.key),r)}}function Uat(e,t,n){return t&&XA(e.prototype,t),n&&XA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hat(e,t,n){return t=sp(t),qat(e,w$()?Reflect.construct(t,n||[],sp(e).constructor):t.apply(e,n))}function qat(e,t){if(t&&(Wl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gat(e)}function Gat(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(w$=function(){return!!e})()}function sp(e){return sp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sp(e)}function Zat(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zv(e,t)}function Zv(e,t){return Zv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Zv(e,t)}function Yo(e,t,n){return t=_$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _$(e){var t=Yat(e,"string");return Wl(t)=="symbol"?t:t+""}function Yat(e,t){if(Wl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Th=function(e){function t(){var n;Vat(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=Hat(this,t,[].concat(i)),Yo(n,"state",{isAnimationFinished:!1}),Yo(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0})}),Yo(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1})}),Yo(n,"id",wa("recharts-scatter-")),n}return Zat(t,e),Uat(t,[{key:"renderSymbolsStatically",value:function(r){var i=this,o=this.props,s=o.shape,l=o.activeShape,c=o.activeIndex,h=Lt(this.props,!1);return r.map(function(u,f){var m=c===f,y=m?l:s,x=Nr(Nr({},h),u);return v.createElement(ue,yu({className:"recharts-scatter-symbol",key:"symbol-".concat(u==null?void 0:u.cx,"-").concat(u==null?void 0:u.cy,"-").concat(u==null?void 0:u.size,"-").concat(f)},rs(i.props,u,f),{role:"img"}),v.createElement(Wat,yu({option:y,isActive:m,key:"symbol-".concat(f)},x)))})}},{key:"renderSymbolsWithAnimation",value:function(){var r=this,i=this.props,o=i.points,s=i.isAnimationActive,l=i.animationBegin,c=i.animationDuration,h=i.animationEasing,u=i.animationId,f=this.state.prevPoints;return v.createElement(ni,{begin:l,duration:c,isActive:s,easing:h,from:{t:0},to:{t:1},key:"pie-".concat(u),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var y=m.t,x=o.map(function(p,b){var P=f&&f[b];if(P){var S=Pn(P.cx,p.cx),A=Pn(P.cy,p.cy),E=Pn(P.size,p.size);return Nr(Nr({},p),{},{cx:S(y),cy:A(y),size:E(y)})}var w=Pn(0,p.size);return Nr(Nr({},p),{},{size:w(y)})});return v.createElement(ue,null,r.renderSymbolsStatically(x))})}},{key:"renderSymbols",value:function(){var r=this.props,i=r.points,o=r.isAnimationActive,s=this.state.prevPoints;return o&&i&&i.length&&(!s||!pa(s,i))?this.renderSymbolsWithAnimation():this.renderSymbolsStatically(i)}},{key:"renderErrorBar",value:function(){var r=this.props.isAnimationActive;if(r&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,s=i.xAxis,l=i.yAxis,c=i.children,h=ur(c,Ph);return h?h.map(function(u,f){var m=u.props,y=m.direction,x=m.dataKey;return v.cloneElement(u,{key:"".concat(y,"-").concat(x,"-").concat(o[f]),data:o,xAxis:s,yAxis:l,layout:y==="x"?"vertical":"horizontal",dataPointFormatter:function(b,P){return{x:b.cx,y:b.cy,value:y==="x"?+b.node.x:+b.node.y,errorVal:Qe(b,P)}}})}):null}},{key:"renderLine",value:function(){var r=this.props,i=r.points,o=r.line,s=r.lineType,l=r.lineJointType,c=Lt(this.props,!1),h=Lt(o,!1),u,f;if(s==="joint")u=i.map(function(A){return{x:A.cx,y:A.cy}});else if(s==="fitting"){var m=LW(i),y=m.xmin,x=m.xmax,p=m.a,b=m.b,P=function(E){return p*E+b};u=[{x:y,y:P(y)},{x,y:P(x)}]}var S=Nr(Nr(Nr({},c),{},{fill:"none",stroke:c&&c.fill},h),{},{points:u});return v.isValidElement(o)?f=v.cloneElement(o,S):Vt(o)?f=o(S):f=v.createElement(sa,yu({},S,{type:l})),v.createElement(ue,{className:"recharts-scatter-line",key:"recharts-scatter-line"},f)}},{key:"render",value:function(){var r=this.props,i=r.hide,o=r.points,s=r.line,l=r.className,c=r.xAxis,h=r.yAxis,u=r.left,f=r.top,m=r.width,y=r.height,x=r.id,p=r.isAnimationActive;if(i||!o||!o.length)return null;var b=this.state.isAnimationFinished,P=Jt("recharts-scatter",l),S=c&&c.allowDataOverflow,A=h&&h.allowDataOverflow,E=S||A,w=Ut(x)?this.id:x;return v.createElement(ue,{className:P,clipPath:E?"url(#clipPath-".concat(w,")"):null},S||A?v.createElement("defs",null,v.createElement("clipPath",{id:"clipPath-".concat(w)},v.createElement("rect",{x:S?u:u-m/2,y:A?f:f-y/2,width:S?m:m*2,height:A?y:y*2}))):null,s&&this.renderLine(),this.renderErrorBar(),v.createElement(ue,{key:"recharts-scatter-symbols"},this.renderSymbols()),(!p||b)&&Si.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}}])}(v.PureComponent);Yo(Th,"displayName","Scatter");Yo(Th,"defaultProps",{xAxisId:0,yAxisId:0,zAxisId:0,legendType:"circle",lineType:"joint",lineJointType:"linear",data:[],shape:"circle",hide:!1,isAnimationActive:!ls.isSsr,animationBegin:0,animationDuration:400,animationEasing:"linear"});Yo(Th,"getComposedData",function(e){var t=e.xAxis,n=e.yAxis,r=e.zAxis,i=e.item,o=e.displayedData,s=e.xAxisTicks,l=e.yAxisTicks,c=e.offset,h=i.props.tooltipType,u=ur(i.props.children,bh),f=Ut(t.dataKey)?i.props.dataKey:t.dataKey,m=Ut(n.dataKey)?i.props.dataKey:n.dataKey,y=r&&r.dataKey,x=r?r.range:Ah.defaultProps.range,p=x&&x[0],b=t.scale.bandwidth?t.scale.bandwidth():0,P=n.scale.bandwidth?n.scale.bandwidth():0,S=o.map(function(A,E){var w=Qe(A,f),T=Qe(A,m),O=!Ut(y)&&Qe(A,y)||"-",R=[{name:Ut(t.dataKey)?i.props.name:t.name||t.dataKey,unit:t.unit||"",value:w,payload:A,dataKey:f,type:h},{name:Ut(n.dataKey)?i.props.name:n.name||n.dataKey,unit:n.unit||"",value:T,payload:A,dataKey:m,type:h}];O!=="-"&&R.push({name:r.name||r.dataKey,unit:r.unit||"",value:O,payload:A,dataKey:y,type:h});var N=kd({axis:t,ticks:s,bandSize:b,entry:A,index:E,dataKey:f}),V=kd({axis:n,ticks:l,bandSize:P,entry:A,index:E,dataKey:m}),D=O!=="-"?r.scale(O):p,j=Math.sqrt(Math.max(D,0)/Math.PI);return Nr(Nr({},A),{},{cx:N,cy:V,x:N-j,y:V-j,xAxis:t,yAxis:n,zAxis:r,width:2*j,height:2*j,size:D,node:{x:w,y:T,z:O},tooltipPayload:R,tooltipPosition:{x:N,y:V},payload:A},u&&u[E]&&u[E].props)});return Nr({points:S},c)});function Vl(e){"@babel/helpers - typeof";return Vl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vl(e)}function Kat(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xat(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,A$(r.key),r)}}function Jat(e,t,n){return t&&Xat(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qat(e,t,n){return t=ap(t),tlt(e,S$()?Reflect.construct(t,n||[],ap(e).constructor):t.apply(e,n))}function tlt(e,t){if(t&&(Vl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return elt(e)}function elt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(S$=function(){return!!e})()}function ap(e){return ap=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ap(e)}function nlt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yv(e,t)}function Yv(e,t){return Yv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Yv(e,t)}function P$(e,t,n){return t=A$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A$(e){var t=rlt(e,"string");return Vl(t)=="symbol"?t:t+""}function rlt(e,t){if(Vl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Kv(){return Kv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kv.apply(this,arguments)}function ilt(e){var t=e.xAxisId,n=mx(),r=gx(),i=n$(t);return i==null?null:Jn.createElement(dc,Kv({},i,{className:Jt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(s){return so(s,!0)}}))}var ds=function(e){function t(){return Kat(this,t),Qat(this,t,arguments)}return nlt(t,e),Jat(t,[{key:"render",value:function(){return Jn.createElement(ilt,this.props)}}])}(Jn.Component);P$(ds,"displayName","XAxis");P$(ds,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Ul(e){"@babel/helpers - typeof";return Ul=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ul(e)}function olt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function slt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,C$(r.key),r)}}function alt(e,t,n){return t&&slt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function llt(e,t,n){return t=lp(t),clt(e,T$()?Reflect.construct(t,n||[],lp(e).constructor):t.apply(e,n))}function clt(e,t){if(t&&(Ul(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ult(e)}function ult(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function T$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(T$=function(){return!!e})()}function lp(e){return lp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lp(e)}function hlt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xv(e,t)}function Xv(e,t){return Xv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Xv(e,t)}function E$(e,t,n){return t=C$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C$(e){var t=flt(e,"string");return Ul(t)=="symbol"?t:t+""}function flt(e,t){if(Ul(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ul(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Jv(){return Jv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jv.apply(this,arguments)}var dlt=function(t){var n=t.yAxisId,r=mx(),i=gx(),o=r$(n);return o==null?null:Jn.createElement(dc,Jv({},o,{className:Jt("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(l){return so(l,!0)}}))},ps=function(e){function t(){return olt(this,t),llt(this,t,arguments)}return hlt(t,e),alt(t,[{key:"render",value:function(){return Jn.createElement(dlt,this.props)}}])}(Jn.Component);E$(ps,"displayName","YAxis");E$(ps,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function JA(e){return ylt(e)||glt(e)||mlt(e)||plt()}function plt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
114
114
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mlt(e,t){if(e){if(typeof e=="string")return Qv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qv(e,t)}}function glt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ylt(e){if(Array.isArray(e))return Qv(e)}function Qv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var tb=function(t,n,r,i,o){var s=ur(t,vx),l=ur(t,um),c=[].concat(JA(s),JA(l)),h=ur(t,fm),u="".concat(i,"Id"),f=i[0],m=n;if(c.length&&(m=c.reduce(function(p,b){if(b.props[u]===r&&Pi(b.props,"extendDomain")&&xt(b.props[f])){var P=b.props[f];return[Math.min(p[0],P),Math.max(p[1],P)]}return p},m)),h.length){var y="".concat(f,"1"),x="".concat(f,"2");m=h.reduce(function(p,b){if(b.props[u]===r&&Pi(b.props,"extendDomain")&&xt(b.props[y])&&xt(b.props[x])){var P=b.props[y],S=b.props[x];return[Math.min(p[0],P,S),Math.max(p[1],P,S)]}return p},m)}return o&&o.length&&(m=o.reduce(function(p,b){return xt(b)?[Math.min(p[0],b),Math.max(p[1],b)]:p},m)),m},O$={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,h,u){this.fn=c,this.context=h,this.once=u||!1}function o(c,h,u,f,m){if(typeof u!="function")throw new TypeError("The listener must be a function");var y=new i(u,f||c,m),x=n?n+h:h;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],y]:c._events[x].push(y):(c._events[x]=y,c._eventsCount++),c}function s(c,h){--c._eventsCount===0?c._events=new r:delete c._events[h]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var h=[],u,f;if(this._eventsCount===0)return h;for(f in u=this._events)t.call(u,f)&&h.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(u)):h},l.prototype.listeners=function(h){var u=n?n+h:h,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var m=0,y=f.length,x=new Array(y);m<y;m++)x[m]=f[m].fn;return x},l.prototype.listenerCount=function(h){var u=n?n+h:h,f=this._events[u];return f?f.fn?1:f.length:0},l.prototype.emit=function(h,u,f,m,y,x){var p=n?n+h:h;if(!this._events[p])return!1;var b=this._events[p],P=arguments.length,S,A;if(b.fn){switch(b.once&&this.removeListener(h,b.fn,void 0,!0),P){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,u),!0;case 3:return b.fn.call(b.context,u,f),!0;case 4:return b.fn.call(b.context,u,f,m),!0;case 5:return b.fn.call(b.context,u,f,m,y),!0;case 6:return b.fn.call(b.context,u,f,m,y,x),!0}for(A=1,S=new Array(P-1);A<P;A++)S[A-1]=arguments[A];b.fn.apply(b.context,S)}else{var E=b.length,w;for(A=0;A<E;A++)switch(b[A].once&&this.removeListener(h,b[A].fn,void 0,!0),P){case 1:b[A].fn.call(b[A].context);break;case 2:b[A].fn.call(b[A].context,u);break;case 3:b[A].fn.call(b[A].context,u,f);break;case 4:b[A].fn.call(b[A].context,u,f,m);break;default:if(!S)for(w=1,S=new Array(P-1);w<P;w++)S[w-1]=arguments[w];b[A].fn.apply(b[A].context,S)}}return!0},l.prototype.on=function(h,u,f){return o(this,h,u,f,!1)},l.prototype.once=function(h,u,f){return o(this,h,u,f,!0)},l.prototype.removeListener=function(h,u,f,m){var y=n?n+h:h;if(!this._events[y])return this;if(!u)return s(this,y),this;var x=this._events[y];if(x.fn)x.fn===u&&(!m||x.once)&&(!f||x.context===f)&&s(this,y);else{for(var p=0,b=[],P=x.length;p<P;p++)(x[p].fn!==u||m&&!x[p].once||f&&x[p].context!==f)&&b.push(x[p]);b.length?this._events[y]=b.length===1?b[0]:b:s(this,y)}return this},l.prototype.removeAllListeners=function(h){var u;return h?(u=n?n+h:h,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(O$);var vlt=O$.exports;const blt=Me(vlt);var Wg=new blt,Vg="recharts.syncMouseEvents";function lh(e){"@babel/helpers - typeof";return lh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lh(e)}function xlt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wlt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,M$(r.key),r)}}function _lt(e,t,n){return t&&wlt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ug(e,t,n){return t=M$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M$(e){var t=Slt(e,"string");return lh(t)=="symbol"?t:t+""}function Slt(e,t){if(lh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(lh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Plt=function(){function e(){xlt(this,e),Ug(this,"activeIndex",0),Ug(this,"coordinateList",[]),Ug(this,"layout","horizontal")}return _lt(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,o=i===void 0?null:i,s=n.container,l=s===void 0?null:s,c=n.layout,h=c===void 0?null:c,u=n.offset,f=u===void 0?null:u,m=n.mouseHandlerCallback,y=m===void 0?null:m;this.coordinateList=(r=o??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=h??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=y??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),o=i.x,s=i.y,l=i.height,c=this.coordinateList[this.activeIndex].coordinate,h=((n=window)===null||n===void 0?void 0:n.scrollX)||0,u=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=o+c+h,m=s+this.offset.top+l/2+u;this.mouseHandlerCallback({pageX:f,pageY:m})}}}])}();function Alt(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],i=e==null?void 0:e[1];if(r&&i&&xt(r)&&xt(i))return!0}return!1}function Tlt(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function k$(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,o=e.endAngle,s=ze(t,n,r,i),l=ze(t,n,r,o);return{points:[s,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:o}}function Elt(e,t,n){var r,i,o,s;if(e==="horizontal")r=t.x,o=r,i=n.top,s=n.top+n.height;else if(e==="vertical")i=t.y,s=i,r=n.left,o=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,h=t.innerRadius,u=t.outerRadius,f=t.angle,m=ze(l,c,h,f),y=ze(l,c,u,f);r=m.x,i=m.y,o=y.x,s=y.y}else return k$(t);return[{x:r,y:i},{x:o,y:s}]}function ch(e){"@babel/helpers - typeof";return ch=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ch(e)}function QA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QA(Object(n),!0).forEach(function(r){Clt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Clt(e,t,n){return t=Olt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Olt(e){var t=Mlt(e,"string");return ch(t)=="symbol"?t:t+""}function Mlt(e,t){if(ch(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ch(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function klt(e){var t,n,r=e.element,i=e.tooltipEventType,o=e.isActive,s=e.activeCoordinate,l=e.activePayload,c=e.offset,h=e.activeTooltipIndex,u=e.tooltipAxisBandSize,f=e.layout,m=e.chartName,y=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!y||!o||!s||m!=="ScatterChart"&&i!=="axis")return null;var x,p=sa;if(m==="ScatterChart")x=s,p=Rnt;else if(m==="BarChart")x=Tlt(f,s,c,u),p=ux;else if(f==="radial"){var b=k$(s),P=b.cx,S=b.cy,A=b.radius,E=b.startAngle,w=b.endAngle;x={cx:P,cy:S,startAngle:E,endAngle:w,innerRadius:A,outerRadius:A},p=_k}else x={points:Elt(f,s,c)},p=sa;var T=Mf(Mf(Mf(Mf({stroke:"#ccc",pointerEvents:"none"},c),x),Lt(y,!1)),{},{payload:l,payloadIndex:h,className:Jt("recharts-tooltip-cursor",y.className)});return v.isValidElement(y)?v.cloneElement(y,T):v.createElement(p,T)}var $lt=["item"],Ilt=["children","className","width","height","style","compact","title","desc"];function Hl(e){"@babel/helpers - typeof";return Hl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hl(e)}function il(){return il=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},il.apply(this,arguments)}function tT(e,t){return Nlt(e)||Llt(e,t)||I$(e,t)||Rlt()}function Rlt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
115
115
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Llt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,l=[],c=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(u){h=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return l}}function Nlt(e){if(Array.isArray(e))return e}function eT(e,t){if(e==null)return{};var n=jlt(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jlt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Dlt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Blt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,R$(r.key),r)}}function zlt(e,t,n){return t&&Blt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Flt(e,t,n){return t=cp(t),Wlt(e,$$()?Reflect.construct(t,n||[],cp(e).constructor):t.apply(e,n))}function Wlt(e,t){if(t&&(Hl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vlt(e)}function Vlt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($$=function(){return!!e})()}function cp(e){return cp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cp(e)}function Ult(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eb(e,t)}function eb(e,t){return eb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},eb(e,t)}function ql(e){return Glt(e)||qlt(e)||I$(e)||Hlt()}function Hlt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
116
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I$(e,t){if(e){if(typeof e=="string")return nb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nb(e,t)}}function qlt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Glt(e){if(Array.isArray(e))return nb(e)}function nb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ut(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nT(Object(n),!0).forEach(function(r){Ft(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ft(e,t,n){return t=R$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R$(e){var t=Zlt(e,"string");return Hl(t)=="symbol"?t:t+""}function Zlt(e,t){if(Hl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ylt={xAxis:["bottom","top"],yAxis:["left","right"]},Klt={width:"100%",height:"100%"},L$={x:0,y:0};function kf(e){return e}var Xlt=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Jlt=function(t,n,r,i){var o=n.find(function(u){return u&&u.index===r});if(o){if(t==="horizontal")return{x:o.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:o.coordinate};if(t==="centric"){var s=o.coordinate,l=i.radius;return ut(ut(ut({},i),ze(i.cx,i.cy,l,s)),{},{angle:s,radius:l})}var c=o.coordinate,h=i.angle;return ut(ut(ut({},i),ze(i.cx,i.cy,c,h)),{},{angle:h,radius:c})}return L$},pm=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,o=n.dataEndIndex,s=(r??[]).reduce(function(l,c){var h=c.props.data;return h&&h.length?[].concat(ql(l),ql(h)):l},[]);return s.length>0?s:t&&t.length&&xt(i)&&xt(o)?t.slice(i,o+1):[]};function N$(e){return e==="number"?[0,"auto"]:void 0}var rb=function(t,n,r,i){var o=t.graphicalItems,s=t.tooltipAxis,l=pm(n,t);return r<0||!o||!o.length||r>=l.length?null:o.reduce(function(c,h){var u,f=(u=h.props.data)!==null&&u!==void 0?u:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(s.dataKey&&!s.allowDuplicatedCategory){var y=f===void 0?l:f;m=nd(y,s.dataKey,i)}else m=f&&f[r]||l[r];return m?[].concat(ql(c),[gk(h,m)]):c},[])},rT=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},s=Xlt(o,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,h=t.tooltipTicks,u=GJ(s,l,h,c);if(u>=0&&h){var f=h[u]&&h[u].value,m=rb(t,n,u,f),y=Jlt(r,l,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:m,activeCoordinate:y}}return null},Qlt=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,s=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,h=n.dataEndIndex,u=t.layout,f=t.children,m=t.stackOffset,y=uk(u,o);return r.reduce(function(x,p){var b,P=p.type.defaultProps!==void 0?ut(ut({},p.type.defaultProps),p.props):p.props,S=P.type,A=P.dataKey,E=P.allowDataOverflow,w=P.allowDuplicatedCategory,T=P.scale,O=P.ticks,R=P.includeHidden,N=P[s];if(x[N])return x;var V=pm(t.data,{graphicalItems:i.filter(function(it){var at,ct=s in it.props?it.props[s]:(at=it.type.defaultProps)===null||at===void 0?void 0:at[s];return ct===N}),dataStartIndex:c,dataEndIndex:h}),D=V.length,j,K,H;Alt(P.domain,E,S)&&(j=mv(P.domain,null,E),y&&(S==="number"||T!=="auto")&&(H=fu(V,A,"category")));var z=N$(S);if(!j||j.length===0){var Y,G=(Y=P.domain)!==null&&Y!==void 0?Y:z;if(A){if(j=fu(V,A,S),S==="category"&&y){var J=RW(j);w&&J?(K=j,j=Gd(0,D)):w||(j=vP(G,j,p).reduce(function(it,at){return it.indexOf(at)>=0?it:[].concat(ql(it),[at])},[]))}else if(S==="category")w?j=j.filter(function(it){return it!==""&&!Ut(it)}):j=vP(G,j,p).reduce(function(it,at){return it.indexOf(at)>=0||at===""||Ut(at)?it:[].concat(ql(it),[at])},[]);else if(S==="number"){var lt=JJ(V,i.filter(function(it){var at,ct,mt=s in it.props?it.props[s]:(at=it.type.defaultProps)===null||at===void 0?void 0:at[s],yt="hide"in it.props?it.props.hide:(ct=it.type.defaultProps)===null||ct===void 0?void 0:ct.hide;return mt===N&&(R||!yt)}),A,o,u);lt&&(j=lt)}y&&(S==="number"||T!=="auto")&&(H=fu(V,A,"category"))}else y?j=Gd(0,D):l&&l[N]&&l[N].hasStack&&S==="number"?j=m==="expand"?[0,1]:mk(l[N].stackGroups,c,h):j=ck(V,i.filter(function(it){var at=s in it.props?it.props[s]:it.type.defaultProps[s],ct="hide"in it.props?it.props.hide:it.type.defaultProps.hide;return at===N&&(R||!ct)}),S,u,!0);if(S==="number")j=tb(f,j,N,o,O),G&&(j=mv(G,j,E));else if(S==="category"&&G){var q=G,nt=j.every(function(it){return q.indexOf(it)>=0});nt&&(j=q)}}return ut(ut({},x),{},Ft({},N,ut(ut({},P),{},{axisType:o,domain:j,categoricalDomain:H,duplicateDomain:K,originalDomain:(b=P.domain)!==null&&b!==void 0?b:z,isCategorical:y,layout:u})))},{})},tct=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,s=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,h=n.dataEndIndex,u=t.layout,f=t.children,m=pm(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:h}),y=m.length,x=uk(u,o),p=-1;return r.reduce(function(b,P){var S=P.type.defaultProps!==void 0?ut(ut({},P.type.defaultProps),P.props):P.props,A=S[s],E=N$("number");if(!b[A]){p++;var w;return x?w=Gd(0,y):l&&l[A]&&l[A].hasStack?(w=mk(l[A].stackGroups,c,h),w=tb(f,w,A,o)):(w=mv(E,ck(m,r.filter(function(T){var O,R,N=s in T.props?T.props[s]:(O=T.type.defaultProps)===null||O===void 0?void 0:O[s],V="hide"in T.props?T.props.hide:(R=T.type.defaultProps)===null||R===void 0?void 0:R.hide;return N===A&&!V}),"number",u),i.defaultProps.allowDataOverflow),w=tb(f,w,A,o)),ut(ut({},b),{},Ft({},A,ut(ut({axisType:o},i.defaultProps),{},{hide:!0,orientation:_r(Ylt,"".concat(o,".").concat(p%2),null),domain:w,originalDomain:E,isCategorical:x,layout:u})))}return b},{})},ect=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,h=n.dataEndIndex,u=t.children,f="".concat(i,"Id"),m=ur(u,o),y={};return m&&m.length?y=Qlt(t,{axes:m,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:h}):s&&s.length&&(y=tct(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:h})),y},nct=function(t){var n=Uo(t),r=so(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:N0(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:$d(n,r)}},iT=function(t){var n=t.children,r=t.defaultShowTooltip,i=vr(n,Il),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},rct=function(t){return!t||!t.length?!1:t.some(function(n){var r=lo(n&&n.type);return r&&r.indexOf("Bar")>=0})},oT=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},ict=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,l=t.yAxisMap,c=l===void 0?{}:l,h=r.width,u=r.height,f=r.children,m=r.margin||{},y=vr(f,Il),x=vr(f,ra),p=Object.keys(c).reduce(function(w,T){var O=c[T],R=O.orientation;return!O.mirror&&!O.hide?ut(ut({},w),{},Ft({},R,w[R]+O.width)):w},{left:m.left||0,right:m.right||0}),b=Object.keys(s).reduce(function(w,T){var O=s[T],R=O.orientation;return!O.mirror&&!O.hide?ut(ut({},w),{},Ft({},R,_r(w,"".concat(R))+O.height)):w},{top:m.top||0,bottom:m.bottom||0}),P=ut(ut({},b),p),S=P.bottom;y&&(P.bottom+=y.props.height||Il.defaultProps.height),x&&n&&(P=KJ(P,i,r,n));var A=h-P.left-P.right,E=u-P.top-P.bottom;return ut(ut({brushBottom:S},P),{},{width:Math.max(A,0),height:Math.max(E,0)})},oct=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},mm=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=t.axisComponents,h=t.legendContent,u=t.formatAxisMap,f=t.defaultProps,m=function(P,S){var A=S.graphicalItems,E=S.stackGroups,w=S.offset,T=S.updateId,O=S.dataStartIndex,R=S.dataEndIndex,N=P.barSize,V=P.layout,D=P.barGap,j=P.barCategoryGap,K=P.maxBarSize,H=oT(V),z=H.numericAxisName,Y=H.cateAxisName,G=rct(A),J=[];return A.forEach(function(lt,q){var nt=pm(P.data,{graphicalItems:[lt],dataStartIndex:O,dataEndIndex:R}),it=lt.type.defaultProps!==void 0?ut(ut({},lt.type.defaultProps),lt.props):lt.props,at=it.dataKey,ct=it.maxBarSize,mt=it["".concat(z,"Id")],yt=it["".concat(Y,"Id")],Et={},Tt=c.reduce(function(te,Ht){var re,Ce,ie=S["".concat(Ht.axisType,"Map")],on=it["".concat(Ht.axisType,"Id")];ie&&ie[on]||Ht.axisType==="zAxis"||(process.env.NODE_ENV!=="production"?lr(!1,"Specifying a(n) ".concat(Ht.axisType,"Id requires a corresponding ").concat(Ht.axisType,"Id on the targeted graphical component ").concat((re=lt==null||(Ce=lt.type)===null||Ce===void 0?void 0:Ce.displayName)!==null&&re!==void 0?re:"")):lr());var tn=ie[on];return ut(ut({},te),{},Ft(Ft({},Ht.axisType,tn),"".concat(Ht.axisType,"Ticks"),so(tn)))},Et),ht=Tt[Y],ft=Tt["".concat(Y,"Ticks")],Ct=E&&E[mt]&&E[mt].hasStack&&aQ(lt,E[mt].stackGroups),rt=lo(lt.type).indexOf("Bar")>=0,Rt=$d(ht,ft),bt=[],de=G&&ZJ({barSize:N,stackGroups:E,totalSize:oct(Tt,Y)});if(rt){var ne,Gt,Le=Ut(ct)?K:ct,Bt=(ne=(Gt=$d(ht,ft,!0))!==null&&Gt!==void 0?Gt:Le)!==null&&ne!==void 0?ne:0;bt=YJ({barGap:D,barCategoryGap:j,bandSize:Bt!==Rt?Bt:Rt,sizeList:de[yt],maxBarSize:Le}),Bt!==Rt&&(bt=bt.map(function(te){return ut(ut({},te),{},{position:ut(ut({},te.position),{},{offset:te.position.offset-Bt/2})})}))}var Qt=lt&&lt.type&&lt.type.getComposedData;Qt&&J.push({props:ut(ut({},Qt(ut(ut({},Tt),{},{displayedData:nt,props:P,dataKey:at,item:lt,bandSize:Rt,barPosition:bt,offset:w,stackedData:Ct,layout:V,dataStartIndex:O,dataEndIndex:R}))),{},Ft(Ft(Ft({key:lt.key||"item-".concat(q)},z,Tt[z]),Y,Tt[Y]),"animationId",T)),childIndex:ZW(lt,P.children),item:lt})}),J},y=function(P,S){var A=P.props,E=P.dataStartIndex,w=P.dataEndIndex,T=P.updateId;if(!f1({props:A}))return null;var O=A.children,R=A.layout,N=A.stackOffset,V=A.data,D=A.reverseStackOrder,j=oT(R),K=j.numericAxisName,H=j.cateAxisName,z=ur(O,r),Y=oQ(V,z,"".concat(K,"Id"),"".concat(H,"Id"),N,D),G=c.reduce(function(it,at){var ct="".concat(at.axisType,"Map");return ut(ut({},it),{},Ft({},ct,ect(A,ut(ut({},at),{},{graphicalItems:z,stackGroups:at.axisType===K&&Y,dataStartIndex:E,dataEndIndex:w}))))},{}),J=ict(ut(ut({},G),{},{props:A,graphicalItems:z}),S==null?void 0:S.legendBBox);Object.keys(G).forEach(function(it){G[it]=u(A,G[it],J,it.replace("Map",""),n)});var lt=G["".concat(H,"Map")],q=nct(lt),nt=m(A,ut(ut({},G),{},{dataStartIndex:E,dataEndIndex:w,updateId:T,graphicalItems:z,stackGroups:Y,offset:J}));return ut(ut({formattedGraphicalItems:nt,graphicalItems:z,offset:J,stackGroups:Y},q),G)},x=function(b){function P(S){var A,E,w;return Dlt(this,P),w=Flt(this,P,[S]),Ft(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ft(w,"accessibilityManager",new Plt),Ft(w,"handleLegendBBoxUpdate",function(T){if(T){var O=w.state,R=O.dataStartIndex,N=O.dataEndIndex,V=O.updateId;w.setState(ut({legendBBox:T},y({props:w.props,dataStartIndex:R,dataEndIndex:N,updateId:V},ut(ut({},w.state),{},{legendBBox:T}))))}}),Ft(w,"handleReceiveSyncEvent",function(T,O,R){if(w.props.syncId===T){if(R===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(O)}}),Ft(w,"handleBrushChange",function(T){var O=T.startIndex,R=T.endIndex;if(O!==w.state.dataStartIndex||R!==w.state.dataEndIndex){var N=w.state.updateId;w.setState(function(){return ut({dataStartIndex:O,dataEndIndex:R},y({props:w.props,dataStartIndex:O,dataEndIndex:R,updateId:N},w.state))}),w.triggerSyncEvent({dataStartIndex:O,dataEndIndex:R})}}),Ft(w,"handleMouseEnter",function(T){var O=w.getMouseInfo(T);if(O){var R=ut(ut({},O),{},{isTooltipActive:!0});w.setState(R),w.triggerSyncEvent(R);var N=w.props.onMouseEnter;Vt(N)&&N(R,T)}}),Ft(w,"triggeredAfterMouseMove",function(T){var O=w.getMouseInfo(T),R=O?ut(ut({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(R),w.triggerSyncEvent(R);var N=w.props.onMouseMove;Vt(N)&&N(R,T)}),Ft(w,"handleItemMouseEnter",function(T){w.setState(function(){return{isTooltipActive:!0,activeItem:T,activePayload:T.tooltipPayload,activeCoordinate:T.tooltipPosition||{x:T.cx,y:T.cy}}})}),Ft(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),Ft(w,"handleMouseMove",function(T){T.persist(),w.throttleTriggeredAfterMouseMove(T)}),Ft(w,"handleMouseLeave",function(T){w.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};w.setState(O),w.triggerSyncEvent(O);var R=w.props.onMouseLeave;Vt(R)&&R(O,T)}),Ft(w,"handleOuterEvent",function(T){var O=GW(T),R=_r(w.props,"".concat(O));if(O&&Vt(R)){var N,V;/.*touch.*/i.test(O)?V=w.getMouseInfo(T.changedTouches[0]):V=w.getMouseInfo(T),R((N=V)!==null&&N!==void 0?N:{},T)}}),Ft(w,"handleClick",function(T){var O=w.getMouseInfo(T);if(O){var R=ut(ut({},O),{},{isTooltipActive:!0});w.setState(R),w.triggerSyncEvent(R);var N=w.props.onClick;Vt(N)&&N(R,T)}}),Ft(w,"handleMouseDown",function(T){var O=w.props.onMouseDown;if(Vt(O)){var R=w.getMouseInfo(T);O(R,T)}}),Ft(w,"handleMouseUp",function(T){var O=w.props.onMouseUp;if(Vt(O)){var R=w.getMouseInfo(T);O(R,T)}}),Ft(w,"handleTouchMove",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(T.changedTouches[0])}),Ft(w,"handleTouchStart",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&w.handleMouseDown(T.changedTouches[0])}),Ft(w,"handleTouchEnd",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&w.handleMouseUp(T.changedTouches[0])}),Ft(w,"handleDoubleClick",function(T){var O=w.props.onDoubleClick;if(Vt(O)){var R=w.getMouseInfo(T);O(R,T)}}),Ft(w,"handleContextMenu",function(T){var O=w.props.onContextMenu;if(Vt(O)){var R=w.getMouseInfo(T);O(R,T)}}),Ft(w,"triggerSyncEvent",function(T){w.props.syncId!==void 0&&Wg.emit(Vg,w.props.syncId,T,w.eventEmitterSymbol)}),Ft(w,"applySyncEvent",function(T){var O=w.props,R=O.layout,N=O.syncMethod,V=w.state.updateId,D=T.dataStartIndex,j=T.dataEndIndex;if(T.dataStartIndex!==void 0||T.dataEndIndex!==void 0)w.setState(ut({dataStartIndex:D,dataEndIndex:j},y({props:w.props,dataStartIndex:D,dataEndIndex:j,updateId:V},w.state)));else if(T.activeTooltipIndex!==void 0){var K=T.chartX,H=T.chartY,z=T.activeTooltipIndex,Y=w.state,G=Y.offset,J=Y.tooltipTicks;if(!G)return;if(typeof N=="function")z=N(J,T);else if(N==="value"){z=-1;for(var lt=0;lt<J.length;lt++)if(J[lt].value===T.activeLabel){z=lt;break}}var q=ut(ut({},G),{},{x:G.left,y:G.top}),nt=Math.min(K,q.x+q.width),it=Math.min(H,q.y+q.height),at=J[z]&&J[z].value,ct=rb(w.state,w.props.data,z),mt=J[z]?{x:R==="horizontal"?J[z].coordinate:nt,y:R==="horizontal"?it:J[z].coordinate}:L$;w.setState(ut(ut({},T),{},{activeLabel:at,activeCoordinate:mt,activePayload:ct,activeTooltipIndex:z}))}else w.setState(T)}),Ft(w,"renderCursor",function(T){var O,R=w.state,N=R.isTooltipActive,V=R.activeCoordinate,D=R.activePayload,j=R.offset,K=R.activeTooltipIndex,H=R.tooltipAxisBandSize,z=w.getTooltipEventType(),Y=(O=T.props.active)!==null&&O!==void 0?O:N,G=w.props.layout,J=T.key||"_recharts-cursor";return v.createElement(klt,{key:J,activeCoordinate:V,activePayload:D,activeTooltipIndex:K,chartName:n,element:T,isActive:Y,layout:G,offset:j,tooltipAxisBandSize:H,tooltipEventType:z})}),Ft(w,"renderPolarAxis",function(T,O,R){var N=_r(T,"type.axisType"),V=_r(w.state,"".concat(N,"Map")),D=T.type.defaultProps,j=D!==void 0?ut(ut({},D),T.props):T.props,K=V&&V[j["".concat(N,"Id")]];return v.cloneElement(T,ut(ut({},K),{},{className:Jt(N,K.className),key:T.key||"".concat(O,"-").concat(R),ticks:so(K,!0)}))}),Ft(w,"renderPolarGrid",function(T){var O=T.props,R=O.radialLines,N=O.polarAngles,V=O.polarRadius,D=w.state,j=D.radiusAxisMap,K=D.angleAxisMap,H=Uo(j),z=Uo(K),Y=z.cx,G=z.cy,J=z.innerRadius,lt=z.outerRadius;return v.cloneElement(T,{polarAngles:Array.isArray(N)?N:so(z,!0).map(function(q){return q.coordinate}),polarRadius:Array.isArray(V)?V:so(H,!0).map(function(q){return q.coordinate}),cx:Y,cy:G,innerRadius:J,outerRadius:lt,key:T.key||"polar-grid",radialLines:R})}),Ft(w,"renderLegend",function(){var T=w.state.formattedGraphicalItems,O=w.props,R=O.children,N=O.width,V=O.height,D=w.props.margin||{},j=N-(D.left||0)-(D.right||0),K=ak({children:R,formattedGraphicalItems:T,legendWidth:j,legendContent:h});if(!K)return null;var H=K.item,z=eT(K,$lt);return v.cloneElement(H,ut(ut({},z),{},{chartWidth:N,chartHeight:V,margin:D,onBBoxUpdate:w.handleLegendBBoxUpdate}))}),Ft(w,"renderTooltip",function(){var T,O=w.props,R=O.children,N=O.accessibilityLayer,V=vr(R,br);if(!V)return null;var D=w.state,j=D.isTooltipActive,K=D.activeCoordinate,H=D.activePayload,z=D.activeLabel,Y=D.offset,G=(T=V.props.active)!==null&&T!==void 0?T:j;return v.cloneElement(V,{viewBox:ut(ut({},Y),{},{x:Y.left,y:Y.top}),active:G,label:z,payload:G?H:[],coordinate:K,accessibilityLayer:N})}),Ft(w,"renderBrush",function(T){var O=w.props,R=O.margin,N=O.data,V=w.state,D=V.offset,j=V.dataStartIndex,K=V.dataEndIndex,H=V.updateId;return v.cloneElement(T,{key:T.key||"_recharts-brush",onChange:Af(w.handleBrushChange,T.props.onChange),data:N,x:xt(T.props.x)?T.props.x:D.left,y:xt(T.props.y)?T.props.y:D.top+D.height+D.brushBottom-(R.bottom||0),width:xt(T.props.width)?T.props.width:D.width,startIndex:j,endIndex:K,updateId:"brush-".concat(H)})}),Ft(w,"renderReferenceElement",function(T,O,R){if(!T)return null;var N=w,V=N.clipPathId,D=w.state,j=D.xAxisMap,K=D.yAxisMap,H=D.offset,z=T.type.defaultProps||{},Y=T.props,G=Y.xAxisId,J=G===void 0?z.xAxisId:G,lt=Y.yAxisId,q=lt===void 0?z.yAxisId:lt;return v.cloneElement(T,{key:T.key||"".concat(O,"-").concat(R),xAxis:j[J],yAxis:K[q],viewBox:{x:H.left,y:H.top,width:H.width,height:H.height},clipPathId:V})}),Ft(w,"renderActivePoints",function(T){var O=T.item,R=T.activePoint,N=T.basePoint,V=T.childIndex,D=T.isRange,j=[],K=O.props.key,H=O.item.type.defaultProps!==void 0?ut(ut({},O.item.type.defaultProps),O.item.props):O.item.props,z=H.activeDot,Y=H.dataKey,G=ut(ut({index:V,dataKey:Y,cx:R.x,cy:R.y,r:4,fill:lx(O.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},Lt(z,!1)),rd(z));return j.push(P.renderActiveDot(z,G,"".concat(K,"-activePoint-").concat(V))),N?j.push(P.renderActiveDot(z,ut(ut({},G),{},{cx:N.x,cy:N.y}),"".concat(K,"-basePoint-").concat(V))):D&&j.push(null),j}),Ft(w,"renderGraphicChild",function(T,O,R){var N=w.filterFormatItem(T,O,R);if(!N)return null;var V=w.getTooltipEventType(),D=w.state,j=D.isTooltipActive,K=D.tooltipAxis,H=D.activeTooltipIndex,z=D.activeLabel,Y=w.props.children,G=vr(Y,br),J=N.props,lt=J.points,q=J.isRange,nt=J.baseLine,it=N.item.type.defaultProps!==void 0?ut(ut({},N.item.type.defaultProps),N.item.props):N.item.props,at=it.activeDot,ct=it.hide,mt=it.activeBar,yt=it.activeShape,Et=!!(!ct&&j&&G&&(at||mt||yt)),Tt={};V!=="axis"&&G&&G.props.trigger==="click"?Tt={onClick:Af(w.handleItemMouseEnter,T.props.onClick)}:V!=="axis"&&(Tt={onMouseLeave:Af(w.handleItemMouseLeave,T.props.onMouseLeave),onMouseEnter:Af(w.handleItemMouseEnter,T.props.onMouseEnter)});var ht=v.cloneElement(T,ut(ut({},N.props),Tt));function ft(Ht){return typeof K.dataKey=="function"?K.dataKey(Ht.payload):null}if(Et)if(H>=0){var Ct,rt;if(K.dataKey&&!K.allowDuplicatedCategory){var Rt=typeof K.dataKey=="function"?ft:"payload.".concat(K.dataKey.toString());Ct=nd(lt,Rt,z),rt=q&&nt&&nd(nt,Rt,z)}else Ct=lt==null?void 0:lt[H],rt=q&&nt&&nt[H];if(yt||mt){var bt=T.props.activeIndex!==void 0?T.props.activeIndex:H;return[v.cloneElement(T,ut(ut(ut({},N.props),Tt),{},{activeIndex:bt})),null,null]}if(!Ut(Ct))return[ht].concat(ql(w.renderActivePoints({item:N,activePoint:Ct,basePoint:rt,childIndex:H,isRange:q})))}else{var de,ne=(de=w.getItemByXY(w.state.activeCoordinate))!==null&&de!==void 0?de:{graphicalItem:ht},Gt=ne.graphicalItem,Le=Gt.item,Bt=Le===void 0?T:Le,Qt=Gt.childIndex,te=ut(ut(ut({},N.props),Tt),{},{activeIndex:Qt});return[v.cloneElement(Bt,te),null,null]}return q?[ht,null,null]:[ht,null]}),Ft(w,"renderCustomized",function(T,O,R){return v.cloneElement(T,ut(ut({key:"recharts-customized-".concat(R)},w.props),w.state))}),Ft(w,"renderMap",{CartesianGrid:{handler:kf,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:kf},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:kf},YAxis:{handler:kf},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((A=S.id)!==null&&A!==void 0?A:wa("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=aM(w.triggeredAfterMouseMove,(E=S.throttleDelay)!==null&&E!==void 0?E:1e3/60),w.state={},w}return Ult(P,b),zlt(P,[{key:"componentDidMount",value:function(){var A,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var A=this.props,E=A.children,w=A.data,T=A.height,O=A.layout,R=vr(E,br);if(R){var N=R.props.defaultIndex;if(!(typeof N!="number"||N<0||N>this.state.tooltipTicks.length-1)){var V=this.state.tooltipTicks[N]&&this.state.tooltipTicks[N].value,D=rb(this.state,w,N,V),j=this.state.tooltipTicks[N].coordinate,K=(this.state.offset.top+T)/2,H=O==="horizontal",z=H?{x:j,y:K}:{y:j,x:K},Y=this.state.formattedGraphicalItems.find(function(J){var lt=J.item;return lt.type.name==="Scatter"});Y&&(z=ut(ut({},z),Y.props.points[N].tooltipPosition),D=Y.props.points[N].tooltipPayload);var G={activeTooltipIndex:N,isTooltipActive:!0,activeLabel:V,activePayload:D,activeCoordinate:z};this.setState(G),this.renderCursor(R),this.accessibilityManager.setIndex(N)}}}},{key:"getSnapshotBeforeUpdate",value:function(A,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==A.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==A.margin){var w,T;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0}})}return null}},{key:"componentDidUpdate",value:function(A){My([vr(A.children,br)],[vr(this.props.children,br)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var A=vr(this.props.children,br);if(A&&typeof A.props.shared=="boolean"){var E=A.props.shared?"axis":"item";return l.indexOf(E)>=0?E:o}return o}},{key:"getMouseInfo",value:function(A){if(!this.container)return null;var E=this.container,w=E.getBoundingClientRect(),T=wZ(w),O={chartX:Math.round(A.pageX-T.left),chartY:Math.round(A.pageY-T.top)},R=w.width/E.offsetWidth||1,N=this.inRange(O.chartX,O.chartY,R);if(!N)return null;var V=this.state,D=V.xAxisMap,j=V.yAxisMap,K=this.getTooltipEventType(),H=rT(this.state,this.props.data,this.props.layout,N);if(K!=="axis"&&D&&j){var z=Uo(D).scale,Y=Uo(j).scale,G=z&&z.invert?z.invert(O.chartX):null,J=Y&&Y.invert?Y.invert(O.chartY):null;return ut(ut({},O),{},{xValue:G,yValue:J},H)}return H?ut(ut({},O),H):null}},{key:"inRange",value:function(A,E){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=this.props.layout,O=A/w,R=E/w;if(T==="horizontal"||T==="vertical"){var N=this.state.offset,V=O>=N.left&&O<=N.left+N.width&&R>=N.top&&R<=N.top+N.height;return V?{x:O,y:R}:null}var D=this.state,j=D.angleAxisMap,K=D.radiusAxisMap;if(j&&K){var H=Uo(j);return wP({x:O,y:R},H)}return null}},{key:"parseEventsOfWrapper",value:function(){var A=this.props.children,E=this.getTooltipEventType(),w=vr(A,br),T={};w&&E==="axis"&&(w.props.trigger==="click"?T={onClick:this.handleClick}:T={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=rd(this.props,this.handleOuterEvent);return ut(ut({},O),T)}},{key:"addListener",value:function(){Wg.on(Vg,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Wg.removeListener(Vg,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(A,E,w){for(var T=this.state.formattedGraphicalItems,O=0,R=T.length;O<R;O++){var N=T[O];if(N.item===A||N.props.key===A.key||E===lo(N.item.type)&&w===N.childIndex)return N}return null}},{key:"renderClipPath",value:function(){var A=this.clipPathId,E=this.state.offset,w=E.left,T=E.top,O=E.height,R=E.width;return v.createElement("defs",null,v.createElement("clipPath",{id:A},v.createElement("rect",{x:w,y:T,height:O,width:R})))}},{key:"getXScales",value:function(){var A=this.state.xAxisMap;return A?Object.entries(A).reduce(function(E,w){var T=tT(w,2),O=T[0],R=T[1];return ut(ut({},E),{},Ft({},O,R.scale))},{}):null}},{key:"getYScales",value:function(){var A=this.state.yAxisMap;return A?Object.entries(A).reduce(function(E,w){var T=tT(w,2),O=T[0],R=T[1];return ut(ut({},E),{},Ft({},O,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(A){var E;return(E=this.state.xAxisMap)===null||E===void 0||(E=E[A])===null||E===void 0?void 0:E.scale}},{key:"getYScaleByAxisId",value:function(A){var E;return(E=this.state.yAxisMap)===null||E===void 0||(E=E[A])===null||E===void 0?void 0:E.scale}},{key:"getItemByXY",value:function(A){var E=this.state,w=E.formattedGraphicalItems,T=E.activeItem;if(w&&w.length)for(var O=0,R=w.length;O<R;O++){var N=w[O],V=N.props,D=N.item,j=D.type.defaultProps!==void 0?ut(ut({},D.type.defaultProps),D.props):D.props,K=lo(D.type);if(K==="Bar"){var H=(V.data||[]).find(function(J){return pnt(A,J)});if(H)return{graphicalItem:N,payload:H}}else if(K==="RadialBar"){var z=(V.data||[]).find(function(J){return wP(A,J)});if(z)return{graphicalItem:N,payload:z}}else if(sm(N,T)||am(N,T)||ih(N,T)){var Y=nit({graphicalItem:N,activeTooltipItem:T,itemData:j.data}),G=j.activeIndex===void 0?Y:j.activeIndex;return{graphicalItem:ut(ut({},N),{},{childIndex:G}),payload:ih(N,T)?j.data[Y]:N.props.data[Y]}}}return null}},{key:"render",value:function(){var A=this;if(!f1(this))return null;var E=this.props,w=E.children,T=E.className,O=E.width,R=E.height,N=E.style,V=E.compact,D=E.title,j=E.desc,K=eT(E,Ilt),H=Lt(K,!1);if(V)return v.createElement(LA,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},v.createElement($y,il({},H,{width:O,height:R,title:D,desc:j}),this.renderClipPath(),p1(w,this.renderMap)));if(this.props.accessibilityLayer){var z,Y;H.tabIndex=(z=this.props.tabIndex)!==null&&z!==void 0?z:0,H.role=(Y=this.props.role)!==null&&Y!==void 0?Y:"application",H.onKeyDown=function(J){A.accessibilityManager.keyboardEvent(J)},H.onFocus=function(){A.accessibilityManager.focus()}}var G=this.parseEventsOfWrapper();return v.createElement(LA,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},v.createElement("div",il({className:Jt("recharts-wrapper",T),style:ut({position:"relative",cursor:"default",width:O,height:R},N)},G,{ref:function(lt){A.container=lt}}),v.createElement($y,il({},H,{width:O,height:R,title:D,desc:j,style:Klt}),this.renderClipPath(),p1(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(v.Component);Ft(x,"displayName",n),Ft(x,"defaultProps",ut({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Ft(x,"getDerivedStateFromProps",function(b,P){var S=b.dataKey,A=b.data,E=b.children,w=b.width,T=b.height,O=b.layout,R=b.stackOffset,N=b.margin,V=P.dataStartIndex,D=P.dataEndIndex;if(P.updateId===void 0){var j=iT(b);return ut(ut(ut({},j),{},{updateId:0},y(ut(ut({props:b},j),{},{updateId:0}),P)),{},{prevDataKey:S,prevData:A,prevWidth:w,prevHeight:T,prevLayout:O,prevStackOffset:R,prevMargin:N,prevChildren:E})}if(S!==P.prevDataKey||A!==P.prevData||w!==P.prevWidth||T!==P.prevHeight||O!==P.prevLayout||R!==P.prevStackOffset||!ll(N,P.prevMargin)){var K=iT(b),H={chartX:P.chartX,chartY:P.chartY,isTooltipActive:P.isTooltipActive},z=ut(ut({},rT(P,A,O)),{},{updateId:P.updateId+1}),Y=ut(ut(ut({},K),H),z);return ut(ut(ut({},Y),y(ut({props:b},Y),P)),{},{prevDataKey:S,prevData:A,prevWidth:w,prevHeight:T,prevLayout:O,prevStackOffset:R,prevMargin:N,prevChildren:E})}if(!My(E,P.prevChildren)){var G,J,lt,q,nt=vr(E,Il),it=nt&&(G=(J=nt.props)===null||J===void 0?void 0:J.startIndex)!==null&&G!==void 0?G:V,at=nt&&(lt=(q=nt.props)===null||q===void 0?void 0:q.endIndex)!==null&&lt!==void 0?lt:D,ct=it!==V||at!==D,mt=!Ut(A),yt=mt&&!ct?P.updateId:P.updateId+1;return ut(ut({updateId:yt},y(ut(ut({props:b},P),{},{updateId:yt,dataStartIndex:it,dataEndIndex:at}),P)),{},{prevChildren:E,dataStartIndex:it,dataEndIndex:at})}return null}),Ft(x,"renderActiveDot",function(b,P,S){var A;return v.isValidElement(b)?A=v.cloneElement(b,P):Vt(b)?A=b(P):A=v.createElement(em,P),v.createElement(ue,{className:"recharts-active-dot",key:S},A)});var p=v.forwardRef(function(P,S){return v.createElement(x,il({},P,{ref:S}))});return p.displayName=x.displayName,p},sct=mm({chartName:"BarChart",GraphicalChild:Aa,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ds},{axisType:"yAxis",AxisComp:ps}],formatAxisMap:hx}),act=mm({chartName:"PieChart",GraphicalChild:wo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:om},{axisType:"radiusAxis",AxisComp:rm}],formatAxisMap:yQ,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),lct=mm({chartName:"ScatterChart",GraphicalChild:Th,defaultTooltipEventType:"item",validateTooltipEventTypes:["item"],axisComponents:[{axisType:"xAxis",AxisComp:ds},{axisType:"yAxis",AxisComp:ps},{axisType:"zAxis",AxisComp:Ah}],formatAxisMap:hx}),cct=mm({chartName:"AreaChart",GraphicalChild:fs,axisComponents:[{axisType:"xAxis",AxisComp:ds},{axisType:"yAxis",AxisComp:ps}],formatAxisMap:hx});const uct=()=>{try{if(typeof window<"u")return window.localStorage.getItem("backflow_dev_diagnostics")==="1"}catch{}return!1},up=(...e)=>{uct()&&console.warn(...e)};function hct(e,t,n){var s,l;const r=t.expression?((s=e.evaluateExpression)==null?void 0:s.call(e,t.expression,t.expressionUrl,n,t.expressionKey))??e.interpolateText(t.expression):e.interpolateText(t.text||"");if(t.className){const c=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const u=a0(t.className);if(u.size>0){const m=zt(u,e.containerWidth,"1rem");c.fontSize=m}const f=tc(t.className);f.size>0&&(c.display=zt(f,e.containerWidth,"block"))}const h=e.getCommonProps(n,c,t);return U("p",{key:n,className:t.className,...h},r)}const i={};t.fontSize!==void 0&&(i.fontSize=`${t.fontSize}px`),t.fontWeight!==void 0&&(i.fontWeight=t.fontWeight),t.color!==void 0&&(i.color=t.color),t.textAlign!==void 0&&(i.textAlign=t.textAlign);const o=e.getCommonProps(n,i,t);return U("p",{key:n,...o},r)}function fct(e){return e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<iframe[\s\S]*?<\/iframe>/gi,"").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"")}function dct(e,t,n){const r=String(e.apiUrl||"").replace(/\/$/,""),i=e.interpolateText(t.text||t.html||"").replace(/(src|href)=("|')\/(?!\/)/g,r?`$1=$2${r}/`:"$1=$2/"),o=e.getCommonProps(n,{color:e.cfg.colors.text},t);return U("div",{key:n,className:t.className,...o,dangerouslySetInnerHTML:{__html:fct(i)}})}function pct(e,t,n){var l,c,h,u,f;const r=()=>{t.onClick?e.handleButtonClick(t.onClick,{onSuccess:t.onSuccess,onError:t.onError},{optimistic:t.optimistic,feedback:t.feedback}):t.href&&(t.href.startsWith("http")||e.previewMode?window.open(t.href,"_blank","noopener,noreferrer"):window.location.href=t.href)},i=()=>{var m;if(!e.interactionDisabled){if((m=t.confirmation)!=null&&m.enabled){(e.setOverlayModal||e.setActiveModal)({id:"__confirm",definition:{title:t.confirmation.title||"Confirm Action",size:"sm",components:[{type:"text",text:t.confirmation.message||"Are you sure you want to proceed?",color:e.cfg.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.6)",fontSize:14}],actions:[{label:"Cancel",variant:"ghost",dismiss:!0},{label:"Confirm",variant:"primary",dismiss:!0}]},legacyOnConfirm:()=>{r()}});return}r()}};if(t.className){const m=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const x=tc(t.className);x.size>0&&(m.display=zt(x,e.containerWidth,"inline"));const p=a0(t.className);if(p.size>0){const b=zt(p,e.containerWidth,"1rem");m.fontSize=b}}t.icon&&(m.display="inline-flex",m.alignItems="center",m.gap=6);const y=e.getCommonProps(n,m,t);return U("a",{key:n,className:t.className,...y,onClick:e.interactionDisabled?void 0:i,href:e.interactionDisabled?void 0:t.href&&!t.onClick?t.href:void 0,target:(c=t.href)!=null&&c.startsWith("http")?"_blank":void 0,rel:(h=t.href)!=null&&h.startsWith("http")?"noopener noreferrer":void 0},t.icon?e.renderIcon(t.icon,16):null,e.interpolateText(t.text||t.label||""))}const o={cursor:"pointer",textDecoration:"none",transition:"all 0.2s",display:"inline-flex",alignItems:"center",gap:6},s=e.getCommonProps(n,o,t);return U("a",{key:n,...s,onClick:e.interactionDisabled?void 0:i,href:e.interactionDisabled?void 0:t.href&&!t.onClick?t.href:void 0,target:(u=t.href)!=null&&u.startsWith("http")?"_blank":void 0,rel:(f=t.href)!=null&&f.startsWith("http")?"noopener noreferrer":void 0},t.icon?e.renderIcon(t.icon,16):null,e.interpolateText(t.text||t.label||""))}function mct(e,t,n){var x,p,b,P,S;let r=!1;if(t.activeWhen){if(t.activeWhen===e.currentSceneId)r=!0;else if(typeof t.activeWhen=="string"){const A=t.activeWhen.split("=",2);A.length===2&&(r=String(((x=e.sceneData)==null?void 0:x[A[0]])??"")===A[1])}}const i=r?{onClick:t.activeOnClick||t.onClick,onSuccess:t.activeOnSuccess||t.onSuccess,onError:t.activeOnError||t.onError,icon:t.activeIcon||t.icon,text:t.activeText||t.text,label:t.activeText||t.label}:{onClick:t.onClick,onSuccess:t.onSuccess,onError:t.onError,icon:t.icon,text:t.text,label:t.label},o=t.disabled?((p=e.evaluateCondition)==null?void 0:p.call(e,t.disabled))??!1:!1,s=A=>{const E=()=>e.handleButtonClick(i.onClick||"",{onSuccess:i.onSuccess,onError:i.onError},{optimistic:t.optimistic,feedback:t.feedback,payload:t.payload,refetchScope:t.refetchScope,mergeResponse:t.mergeResponse,anchorElement:A==null?void 0:A.currentTarget,openUrl:t.openUrl});(e.withLoading?e.withLoading(n,E):E()).catch(T=>{var R,N;const O=((R=t.onError)==null?void 0:R.message)||(T==null?void 0:T.message)||"An error occurred";(N=e.showToast)==null||N.call(e,O,"error")})},l=A=>{var E;if((E=t.confirmation)!=null&&E.enabled){(e.setOverlayModal||e.setActiveModal)({id:"__confirm",definition:{title:t.confirmation.title||"Confirm Action",size:"sm",components:[{type:"text",text:t.confirmation.message||"Are you sure you want to proceed?",color:e.cfg.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.6)",fontSize:16}],actions:[{label:"Cancel",variant:"ghost",dismiss:!0},{label:"Confirm",variant:"primary",dismiss:!0}]},legacyOnConfirm:()=>{s(A)}});return}s(A)},c=(b=e.buttonLoading)==null?void 0:b[n];if(t.className){let A=((P=e.parseClassNameResponsive)==null?void 0:P.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const D=tc(t.className);D.size>0&&(A.display=zt(D,e.containerWidth,"inline-flex"));const j=a0(t.className);j.size>0&&(A.fontSize=zt(j,e.containerWidth,"1rem"))}let E=t.className;if(r&&t.activeClass){const D=((S=e.parseClassNameResponsive)==null?void 0:S.call(e,t.activeClass,n))??e.parseClassName(t.activeClass);A={...A,...D},E=`${t.className} ${t.activeClass}`}const w={display:"inline-flex",alignItems:"center",justifyContent:A.textAlign==="left"?"flex-start":A.textAlign==="right"?"flex-end":"center",gap:"6px",...A,...t.color&&{color:t.color},...t.background&&{background:t.background},...t.borderRadius!==void 0&&{borderRadius:typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius},...t.borderColor&&{borderColor:t.borderColor},...c&&{opacity:.6,pointerEvents:"none"}},T={},O=(t.className||"").split(/\s+/).filter(Boolean);for(const D of O)if(D.startsWith("hover:")){const j=D.replace("hover:","");if(j.startsWith("bg-")||j.startsWith("text-")||j.startsWith("border-")){const K=e.parseClassName(j);Object.assign(T,K)}}const R=e.getCommonProps(n,w,t),N=[];i.icon&&!c&&N.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i.text?{marginRight:"6px"}:{}}},e.renderIcon(i.icon,t.iconSize||16))),c&&N.unshift(U("div",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})),Array.isArray(t.children)&&t.children.length>0?t.children.forEach((D,j)=>{N.push(e.renderComponent(D,j,n))}):N.push(i.label||i.text||(i.icon?"":"Button"));const V={};return Object.keys(T).length>0&&(V.onMouseEnter=D=>{T.backgroundColor&&(D.currentTarget.style.backgroundColor=T.backgroundColor),T.color&&(D.currentTarget.style.color=T.color),T.borderColor&&(D.currentTarget.style.borderColor=T.borderColor)},V.onMouseLeave=D=>{T.backgroundColor&&(D.currentTarget.style.backgroundColor=w.backgroundColor||""),T.color&&(D.currentTarget.style.color=w.color||""),T.borderColor&&(D.currentTarget.style.borderColor=w.borderColor||"")}),U("button",{key:n,className:E,title:e.interpolateText(t.tooltip||t.ariaLabel||i.label||i.text||"Button"),...R,...V,onClick:e.interactionDisabled?void 0:l,disabled:c||o||void 0},...N)}const h=e.cfg.colors.primary,u=e.cfg.colors.accent,f={display:"inline-flex",alignItems:"center",gap:"6px",padding:"0.75rem 1.5rem",borderRadius:"0.75rem",fontWeight:600,transition:e.cfg.effects.transition,color:e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.text,background:r?e.cfg.colors.primary:`linear-gradient(to right, ${h}, ${u})`,boxShadow:r?"none":`0 10px 15px -3px ${h}40`,...c&&{opacity:.6,pointerEvents:"none"}},m=e.getCommonProps(n,f,t),y=[];return c&&y.push(U("div",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})),i.icon&&!c&&y.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(i.icon,t.iconSize||16))),y.push(i.label||i.text||(i.icon?"":"Button")),U("button",{key:n,title:e.interpolateText(t.tooltip||t.ariaLabel||i.label||i.text||"Button"),...m,onClick:e.interactionDisabled?void 0:l,disabled:c||o||void 0},...y)}function gct(e,t,n){var h;const r=e.interpolateText(t.src||""),i=!r||r==="placeholder",o=e.imageErrors[n];if(t.skipEmpty&&i)return null;const s={border:`1px dashed ${e.cfg.colors.borderSubtle}`,display:"flex",alignItems:"center",justifyContent:"center",padding:10,height:"200px",borderRadius:"0.75rem"};if(i){const u=e.getCommonProps(n,s,t);return U("div",{key:n,...u},U("span",{style:{color:e.cfg.colors.textPlaceholder,fontSize:"0.875rem"}},"Image"))}if(o)return null;if(t.className){const u=((h=e.parseClassNameResponsive)==null?void 0:h.call(e,t.className,n))??e.parseClassName(t.className),f=e.getCommonProps(n,u,t),m={key:`${n}-${r}`,src:r,alt:t.alt||"",className:t.className,...f,onError:()=>e.setImageErrors(y=>({...y,[n]:!0}))};return t.onClick&&!e.interactionDisabled&&(m.onClick=()=>e.handleButtonClick(t.onClick)),U("img",m)}const l={width:t.w||t.width||"100%",height:t.h||t.height||"auto",objectFit:"cover",borderRadius:"0.75rem"};t.onClick&&(l.cursor="pointer");const c={key:`${n}-${r}`,src:r,alt:t.alt||"",...e.getCommonProps(n,l,t),onError:()=>e.setImageErrors(u=>({...u,[n]:!0}))};return t.onClick&&!e.interactionDisabled&&(c.onClick=()=>e.handleButtonClick(t.onClick)),U("img",c)}function yct(e,t,n){var o;if(t.className){const s=((o=e.parseClassNameResponsive)==null?void 0:o.call(e,t.className,n))??e.parseClassName(t.className),l=e.getCommonProps(n,s,t);return U("input",{key:n,className:t.className,...l,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",value:e.sceneData[t.name||""]??"",style:{colorScheme:e.cfg.colorMode==="light"?"light":"dark"},onClick:t.openPickerOnClick?c=>{var h,u;return(u=(h=c.currentTarget).showPicker)==null?void 0:u.call(h)}:void 0,onChange:c=>e.setSceneData(h=>({...h,[t.name||""]:c.target.value})),onKeyDown:t.onKeyDown?c=>{c.key==="Enter"&&e.handleButtonClick(t.onKeyDown)}:void 0})}const r={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition},i=e.getCommonProps(n,r,t);if(t.label){const s=e.getCommonProps(n,{width:"100%"},t);return U("div",{key:n,...s},U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("input",{...i,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",value:e.sceneData[t.name||""]??"",onChange:l=>e.setSceneData(c=>({...c,[t.name||""]:l.target.value}))}))}return U("input",{key:n,...i,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",value:e.sceneData[t.name||""]??"",onChange:s=>e.setSceneData(l=>({...l,[t.name||""]:s.target.value}))})}function vct(e,t,n){const r=t.value?e.interpolateText(String(t.value)):e.sceneData[t.name||""]??"";return U("input",{key:n,type:"hidden",name:t.name,value:r})}function bct(e,t,n){var s;const r=()=>{var l;return[t.placeholder&&U("option",{key:"__placeholder",value:""},t.placeholder),...((l=t.options)==null?void 0:l.map(c=>U("option",{key:c.value,value:c.value},c.label)))||[]]};if(t.className){const l=((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className),c=e.getCommonProps(n,l,t);return U("select",{key:n,className:t.className,...c,name:t.name,value:e.sceneData[t.name||""]??"",onChange:h=>e.setSceneData(u=>({...u,[t.name||""]:h.target.value}))},...r())}const i={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition,cursor:"pointer",appearance:"none"},o=e.getCommonProps(n,i,t);if(t.label){const l=e.getCommonProps(n,{width:"100%"},t);return U("div",{key:n,...l},U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("select",{...o,name:t.name,value:e.sceneData[t.name||""]??"",onChange:c=>e.setSceneData(h=>({...h,[t.name||""]:c.target.value}))},...r()))}return U("select",{key:n,...o,name:t.name,value:e.sceneData[t.name||""]??"",onChange:l=>e.setSceneData(c=>({...c,[t.name||""]:l.target.value}))},...r())}function xct(e,t,n){const r=t.className||"flex items-center gap-3 cursor-pointer text-white",i=e.parseClassName(r),o="w-5 h-5 rounded border-gray-600 bg-gray-800 accent-primary",s=e.parseClassName(o),l=e.getCommonProps(n,i,t);return U("label",{key:n,className:r,...l},U("input",{type:"checkbox",className:o,style:s,checked:e.sceneData[t.name||""]||!1,onChange:c=>e.setSceneData(h=>({...h,[t.name||""]:c.target.checked}))}),U("span",{},t.label||""))}function wct(e,t,n){const r={green:{bg:"#065f4620",color:"#22c55e",border:"#22c55e40"},blue:{bg:"#1e40af20",color:"#3b82f6",border:"#3b82f640"},red:{bg:"#7f1d1d20",color:"#ef4444",border:"#ef444440"},yellow:{bg:"#71370220",color:"#eab308",border:"#eab30840"},purple:{bg:"#581c8720",color:"#a855f7",border:"#a855f740"},orange:{bg:"#7c2d1220",color:"#f97316",border:"#f9731640"},gray:{bg:"#37415120",color:"#9ca3af",border:"#9ca3af40"},cyan:{bg:"#0e727020",color:"#06b6d4",border:"#06b6d440"},pink:{bg:"#83184420",color:"#ec4899",border:"#ec489940"}};let o=t.colorScheme||"gray";if(t.colorBy&&typeof t.colorBy=="object"){const u=(e.interpolateText(t.text||t.label||"")||"").trim().toLowerCase();t.colorBy[u]&&(o=t.colorBy[u])}const s=r[o]||r.gray,l=t.variant||"subtle";let c={display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:600,letterSpacing:"0.025em",textTransform:"uppercase",whiteSpace:"nowrap"};l==="solid"?(c.backgroundColor=s.color,c.color="#fff"):l==="outline"?(c.backgroundColor="transparent",c.color=s.color,c.border=`1px solid ${s.border||s.color}`):(c.backgroundColor=s.bg,c.color=s.color,t.bordered&&(c.border=`1px solid ${s.border||s.color}`)),t.pill&&(c.borderRadius="9999px"),t.className&&(c={...c,...e.parseClassName(t.className)});const h=e.getCommonProps(n,c,t);return U("span",{key:n,...h},e.interpolateText(t.text||t.label||""))}function _ct(e,t,n){const r={display:"inline-flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"9999px",fontSize:"12px",fontWeight:500,backgroundColor:t.bg||e.cfg.colors.surfaceHover,color:t.color||e.cfg.colors.textSecondary,...t.className?e.parseClassName(t.className):{}},i=e.getCommonProps(n,r,t);return U("span",{key:n,...i},e.interpolateText(t.text||t.label||""))}function Sct(e,t,n){const i={sm:32,md:40,lg:48,xl:64}[t.size||"md"]||40,o=i*.4;if(t.src){const h={width:`${i}px`,height:`${i}px`,borderRadius:"50%",objectFit:"cover",...t.className?e.parseClassName(t.className):{}},u=e.getCommonProps(n,h,t);return U("img",{key:n,src:t.src,alt:t.alt||t.label||"",...u})}const s=t.initials||(t.label||t.text||"").split(" ").map(h=>h[0]).join("").slice(0,2).toUpperCase()||"?",l={width:`${i}px`,height:`${i}px`,borderRadius:"50%",backgroundColor:t.bg||e.cfg.colors.primary,color:t.color||e.cfg.colors.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${o}px`,fontWeight:600,flexShrink:0,...t.className?e.parseClassName(t.className):{}},c=e.getCommonProps(n,l,t);return U("div",{key:n,...c},s)}function Pct(e,t,n){const r=t.progressValue??t.value??0,i=t.progressMax??100,o=(y,x)=>{if(typeof y=="string")return Number(e.interpolateText(y))||x;const p=Number(y);return Number.isFinite(p)?p:x},s=o(r,0),l=o(i,100),c=Math.min(100,Math.max(0,s/l*100)),u=s>l?e.cfg.colors.danger:t.color||e.cfg.colors.primary,f={width:"100%",display:"flex",flexDirection:"column",gap:"4px",...t.className?e.parseClassName(t.className):{}},m=e.getCommonProps(n,f,t);return U("div",{key:n,...m},(t.progressLabel||t.label)&&v.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:e.cfg.colors.textMuted}},U("span",null,e.interpolateText(t.progressLabel||t.label||"")),U("span",null,`${s}/${l}`)),v.createElement("div",{style:{width:"100%",height:"8px",backgroundColor:e.cfg.colors.surfaceHover,borderRadius:"4px",overflow:"hidden"}},U("div",{style:{width:`${Math.min(c,100)}%`,height:"100%",backgroundColor:u,borderRadius:"4px",transition:"width 0.3s ease"}})))}function Act(e,t,n){const r={position:"relative",width:"100%",...t.className?e.parseClassName(t.className):{}},i=e.getCommonProps(n,r,t);return U("div",{key:n,...i},U("span",{style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:e.cfg.colors.textPlaceholder,fontSize:"14px",pointerEvents:"none"}},e.renderIcon("search",14)),U("input",{type:"text",name:t.name||"search",placeholder:t.placeholder||"Search...",value:e.sceneData[t.name||"search"]??"",onChange:o=>{e.setSceneData(s=>({...s,[t.name||"search"]:o.target.value}))},style:{width:"100%",padding:"8px 12px 8px 36px",borderRadius:e.cfg.layout.borderRadius,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",fontSize:e.cfg.typography.baseFontSize,transition:e.cfg.effects.transition}}))}function Tct(e,t,n){const r=Array.isArray(t.breadcrumbItems)?t.breadcrumbItems:[],i={display:"flex",alignItems:"center",gap:"4px",fontSize:"14px",...t.className?e.parseClassName(t.className):{}},o=e.getCommonProps(n,i,t);return U("nav",{key:n,...o,"aria-label":"Breadcrumb"},r.map((s,l)=>{const c=l===r.length-1,h=e.interpolateText(s.label);return v.createElement(v.Fragment,{key:`${n}-bc-${l}`},v.createElement(c?"span":"a",{style:{color:c?e.cfg.colors.textSecondary:e.cfg.colors.textMuted,fontWeight:c?600:400,cursor:c?"default":"pointer",textDecoration:"none",transition:e.cfg.effects.transition},...!c&&s.href?{href:s.href}:{},...!c&&s.onClick?{onClick:()=>e.handleButtonClick(s.onClick,{})}:{}},h),!c&&U("span",{style:{color:e.cfg.colors.border,margin:"0 2px"}},"/"))}))}function Ect(e,t,n){const r=Array.isArray(t.items)?t.items:[],[i,o]=v.useState(0),s=t.autoplay!==!1&&r.length>1,l=t.interval||4e3,c=t.effect==="fade"?"fade":"slide";v.useEffect(()=>{if(!s||r.length<2)return;const S=setInterval(()=>o(A=>(A+1)%r.length),l);return()=>clearInterval(S)},[s,l,r.length]);const h=S=>o((S%r.length+r.length)%r.length),u=t.showArrows!==!1&&r.length>1,f=t.showDots!==!1&&r.length>1,m={position:"relative",overflow:"hidden",...t.className?e.parseClassName(t.className):{}};t.aspectRatio&&(m.aspectRatio=t.aspectRatio),!t.aspectRatio&&!t.height&&(m.height="320px");const y=e.getCommonProps(n,m,t),x=S=>typeof S=="string"?{type:"text",text:S}:S&&S.image?{type:"image",src:S.image,alt:S.alt||"",title:S.title}:S,p=r.map((S,A)=>{const E=e.renderComponent({...x(S),key:void 0},A,`${n}-slide`),w={width:"100%",height:"100%",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"};return c==="fade"?(w.position="absolute",w.inset="0",w.opacity=A===i?1:0,w.transition="opacity .5s ease",w.pointerEvents=A===i?"auto":"none"):w.flexShrink=0,U("div",{key:`${n}-item-${A}`,style:w},E)}),b=c==="fade"?{position:"relative",width:"100%",height:"100%"}:{display:"flex",height:"100%",transition:"transform .5s ease",transform:`translateX(-${i*100}%)`},P={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,width:"36px",height:"36px",borderRadius:"50%",border:"none",background:"rgba(0,0,0,0.45)",color:"#fff",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"};return U("div",{key:n,...y},U("div",{style:b},p),u&&U("div",{style:{...P,left:"8px"}},U("button",{style:{background:"transparent",border:"none",color:"inherit",fontSize:"18px",cursor:"pointer"},onClick:()=>h(i-1),"aria-label":"Previous slide"},"<")),u&&U("div",{style:{...P,right:"8px"}},U("button",{style:{background:"transparent",border:"none",color:"inherit",fontSize:"18px",cursor:"pointer"},onClick:()=>h(i+1),"aria-label":"Next slide"},">")),f&&U("div",{style:{position:"absolute",bottom:"10px",left:"50%",transform:"translateX(-50%)",display:"flex",gap:"6px",zIndex:2}},r.map((S,A)=>U("button",{key:`${n}-dot-${A}`,"aria-label":`Slide ${A+1}`,onClick:()=>h(A),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",padding:0,background:A===i?"rgba(255,255,255,0.95)":"rgba(255,255,255,0.4)",transition:"background .3s ease"}}))))}function Cct(e,t,n){const r=Array.isArray(t.items)?t.items:[],i=t.speed||20,o={overflow:"hidden",width:"100%",...t.className?e.parseClassName(t.className):{}},s=e.getCommonProps(n,o,t),l=c=>U("div",{key:c,style:{display:"inline-flex",alignItems:"center",gap:t.gap||"24px",paddingRight:t.gap||"24px",animation:`bf-marquee ${i}s linear infinite`,willChange:"transform",flexShrink:0}},r.map((h,u)=>{const f=typeof h=="string"?{type:"text",text:h}:h&&h.image?{type:"image",src:h.image,alt:h.alt||"",height:t.itemHeight||"48px"}:h;return e.renderComponent(f,u,`${c}-${n}-marq`)}));return U("div",{key:n,...s},U("div",{style:{display:"flex",width:"max-content"}},l("a"),l("b")))}function Oct(e,t,n){const r=v.useRef(null),i=v.useRef(null),o=v.useRef(null),[s,l]=v.useState("idle"),[c,h]=v.useState(""),[u,f]=v.useState(!1),m=t.fieldName||"capture",y=t.captureMode==="qr",x=e.apiUrl||window.location.origin,p=t.uploadPath||"/api/files/upload",b=()=>{var V;(V=i.current)==null||V.getTracks().forEach(D=>D.stop()),i.current=null},P=async V=>{var H,z,Y;const D=new FormData;D.append("file",V,`${m}-${Date.now()}.jpg`);const j=await fetch(new URL(p,x).toString(),{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:D});if(!j.ok)throw new Error("Upload failed");const K=await j.json();return((H=K==null?void 0:K.file)==null?void 0:H.url)||((z=K==null?void 0:K.file)==null?void 0:z.publicUrl)||((Y=K==null?void 0:K.file)==null?void 0:Y.path)||(K==null?void 0:K.url)||(K==null?void 0:K.path)||""},S=async(V,D)=>{var j,K;if(s!=="done"){b();try{f(!0);const H=D||await P(V);e.setSceneData(z=>({...z,[m]:H})),h(H),l("done"),(j=e.showToast)==null||j.call(e,t.successMessage||(D?"Scanned!":"Captured & uploaded"),"success")}catch{l("error"),(K=e.showToast)==null||K.call(e,"Capture failed","error")}finally{f(!1)}}},A=()=>{var j;const V=r.current;if(!V||!V.videoWidth)return;const D=document.createElement("canvas");D.width=V.videoWidth,D.height=V.videoHeight,(j=D.getContext("2d"))==null||j.drawImage(V,0,0),D.toBlob(K=>K&&S(K),"image/jpeg",t.quality||.85)},E=async()=>{var V,D;try{const j=await navigator.mediaDevices.getUserMedia({video:{facingMode:t.facingMode||"user",...t.aspectRatio?{aspectRatio:Number(t.aspectRatio)}:{}},audio:!1});if(i.current=j,r.current&&(r.current.srcObject=j,await r.current.play().catch(()=>{})),l("running"),y){const H=window.BarcodeDetector;if(!H){l("error"),(V=e.showToast)==null||V.call(e,"QR scanning not supported in this browser","error");return}const z=new H;o.current=window.setInterval(async()=>{const Y=r.current;if(!(!Y||!Y.videoWidth||s==="done"))try{const G=await z.detect(Y);G!=null&&G.length&&S(new Blob,G[0].rawValue)}catch{}},400)}}catch{l("error"),(D=e.showToast)==null||D.call(e,"Camera access denied","error")}};v.useEffect(()=>(E(),()=>{o.current&&window.clearInterval(o.current),b()}),[]);const w={display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",width:"100%",...t.className?e.parseClassName(t.className):{}},T=e.getCommonProps(n,w,t),O=U("video",{key:"cam-video",ref:r,autoPlay:!0,playsInline:!0,muted:!0,style:{width:"100%",maxWidth:t.maxWidth||"480px",borderRadius:"12px",aspectRatio:t.aspectRatio||"4 / 3",objectFit:"cover",background:"#0f172a",display:y||s!=="done"?void 0:"none"}}),R=c?U("img",{key:"cam-result",src:c,alt:"captured",style:{width:"100%",maxWidth:t.maxWidth||"480px",borderRadius:"12px",aspectRatio:t.aspectRatio||"4 / 3",objectFit:"cover",background:"#0f172a"}}):null,N=U("div",{key:"cam-actions",style:{display:"flex",gap:"10px",flexWrap:"wrap",justifyContent:"center"}},s!=="done"?U("button",{key:"cam-capture",onClick:A,disabled:u||s!=="running",style:{padding:"10px 22px",borderRadius:"9999px",border:"none",cursor:u?"wait":"pointer",background:"#3B82F6",color:"#fff",fontWeight:600}},u?"Uploading...":y?t.captureLabel||"Scan QR":t.captureLabel||"Capture"):U("button",{key:"cam-retake",onClick:()=>{h(""),l("idle"),E()},style:{padding:"10px 22px",borderRadius:"9999px",border:"1px solid #94a3b8",cursor:"pointer",background:"transparent"}},"Retake"));return U("div",{key:n,...T},O,R,t.captureLabel===!1?null:N,s==="error"?U("p",{key:"cam-err",style:{color:"#EF4444",fontSize:"13px"}},"Camera unavailable — check permissions"):null)}function Mct(e,t,n){var i;if(t.className){const o=((i=e.parseClassNameResponsive)==null?void 0:i.call(e,t.className,n))??e.parseClassName(t.className),s=e.getCommonProps(n,o,t);return U("div",{key:n,className:t.className,...s})}const r=e.getCommonProps(n,{height:t.h||t.height||"24px"},t);return U("div",{key:n,...r})}function kct(e,t,n){const r=t.className||"border-gray-700 my-4",i=e.parseClassName(r),o=e.getCommonProps(n,i,t);return U("hr",{key:n,className:r,...o})}function $ct(e,t,n){var u;const r=t.loaderVariant||"spinner",i=t.rows||3,o=t.className?((u=e.parseClassNameResponsive)==null?void 0:u.call(e,t.className,n))??e.parseClassName(t.className):{};t.rawStyle&&Object.assign(o,t.rawStyle);const s=e.getCommonProps(n,o,t),l=`${e.scopeId}-${n}`,c=e.renderMode==="css-driven"?{"data-bf-r":l}:{};if(r==="skeleton"){const f=[];for(let m=0;m<i;m++){const y=t.width||(m===i-1?"60%":"100%");f.push(U("div",{key:m,className:"bf-loader-skeleton",style:{height:t.height||"16px",width:y,borderRadius:"6px",marginBottom:m<i-1?"12px":"0"}}))}return U("div",{key:n,className:t.className,style:o,...s,...c},...f)}if(r==="shimmer"){const f=[];for(let m=0;m<i;m++){const y=t.width||(m===i-1?"60%":"100%");f.push(U("div",{key:m,className:"bf-loader-shimmer",style:{height:t.height||"16px",width:y,borderRadius:"6px",marginBottom:m<i-1?"12px":"0"}}))}return U("div",{key:n,className:t.className,style:o,...s,...c},...f)}if(r==="dots"){const f=t.color||"currentColor";return U("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",gap:"6px",...o},...s,...c},[0,1,2].map(m=>U("div",{key:m,className:"bf-loader-dot",style:{width:t.size||"8px",height:t.size||"8px",borderRadius:"50%",backgroundColor:f,animationDelay:`${m*.16}s`}})))}if(r==="pulse")return U("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",justifyContent:"center",...o},...s,...c},U("div",{className:"bf-loader-pulse",style:{width:t.size||"32px",height:t.size||"32px",borderRadius:"50%",border:`3px solid ${t.color||"currentColor"}`}}));if(r==="progress")return U("div",{key:n,className:t.className,style:{width:"100%",...o},...s,...c},U("div",{style:{height:t.height||"4px",width:"100%",backgroundColor:"rgba(128,128,128,0.2)",borderRadius:"4px",overflow:"hidden"}},U("div",{className:"bf-loader-progress-bar",style:{height:"100%",width:"30%",backgroundColor:t.color||"currentColor",borderRadius:"4px"}})));const h=t.size||"24px";return U("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",justifyContent:"center",...o},...s,...c},U("div",{className:"bf-loader-spinner",style:{width:h,height:h,border:`3px solid ${t.color?t.color+"33":"rgba(128,128,128,0.2)"}`,borderTopColor:t.color||"currentColor",borderRadius:"50%"}}))}function Ict(e,t,n){const r=t.rows||4;if(t.className){const s=e.parseClassName(t.className),l=e.getCommonProps(n,s,t);return U("textarea",{key:n,className:t.className,...l,name:t.name,placeholder:t.placeholder,rows:r})}const i={width:"100%",padding:"0.75rem 1rem",borderRadius:e.cfg.components.inputRadius,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition,resize:"vertical",fontFamily:"inherit"},o=e.getCommonProps(n,i,t);if(t.label){const s=e.getCommonProps(n,{width:"100%"},t);return U("div",{key:n,...s},U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("textarea",{...o,name:t.name,placeholder:t.placeholder,rows:r}))}return U("textarea",{key:n,...o,name:t.name,placeholder:t.placeholder,rows:r})}function Rct(e,t,n){const r=t.icon||t.name||"",i=t.size||24,o=e.renderIcon(r,i),s=t.tooltip?e.interpolateText(t.tooltip):void 0;if(t.className){const l=e.parseClassName(t.className),c=e.getCommonProps(n,l,t);return U("span",{key:n,className:t.className,title:s,...c},o)}return s?U("span",{key:n,title:s},o):v.cloneElement(o,{key:n})}function Lct(e,t,n){const r=t.metricSize||"md",i=r==="sm"?"1.25rem":r==="lg"?"2.5rem":"1.75rem",o=r==="sm"?"0.75rem":r==="lg"?"1rem":"0.875rem",s=t.color||e.cfg.colors.primary,l=t.trend==="up"?"↑":t.trend==="down"?"↓":"",c=t.trendColor||(t.trend==="up"?e.cfg.colors.success:t.trend==="down"?e.cfg.colors.danger:e.cfg.colors.textMuted),h={display:"flex",flexDirection:"column",gap:"2px",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},u=e.getCommonProps(n,h,t);return U("div",{key:n,...u},t.label&&U("span",{style:{fontSize:o,color:e.cfg.colors.textSecondary,fontWeight:500}},e.interpolateText(t.label)),v.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"6px",marginTop:"4px"}},t.prefix&&U("span",{style:{fontSize:i,fontWeight:700,color:s}},t.prefix),U("span",{style:{fontSize:i,fontWeight:700,color:e.cfg.colors.text}},typeof t.value=="number"?t.value.toLocaleString():e.interpolateText(String(t.value??""))),t.suffix&&U("span",{style:{fontSize:i,fontWeight:700,color:s}},t.suffix),t.delta&&U("span",{style:{fontSize:"0.75rem",fontWeight:600,color:c,marginLeft:"4px"}},`${l} ${t.delta}`)))}function Nct(e,t,n){const r=t.chartData||t.data||[];if(!Array.isArray(r)||r.length===0)return null;const i=Number(t.height)||200,o=t.barColor||e.cfg.colors.primary,s=t.horizontal===!0,l={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},c=s?{type:"number",axisLine:!1,tickLine:!1}:{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fill:e.cfg.colors.textMuted,fontSize:12}},h=s?{dataKey:"label",type:"category",axisLine:!1,tickLine:!1,width:88,tick:{fill:e.cfg.colors.textMuted,fontSize:12}}:{axisLine:!1,tickLine:!1,width:36},u=v.createElement(Up,{width:"100%",height:i},v.createElement(sct,{data:r,layout:s?"vertical":"horizontal"},v.createElement(dm,{vertical:!s,stroke:e.cfg.colors.borderSubtle,strokeDasharray:"3 3"}),v.createElement(ds,c),v.createElement(ps,h),v.createElement(br,{cursor:{fill:t.cursorColor||e.cfg.colors.surfaceHover,fillOpacity:t.cursorOpacity??.5},content:v.createElement(j$,{prefix:t.tooltipPrefix,labelText:t.tooltipLabel,lineColor:o,backgroundColor:e.cfg.colors.surface,textColor:e.cfg.colors.text,borderColor:e.cfg.colors.borderSubtle})}),v.createElement(Aa,{dataKey:"value",fill:o,radius:s?[0,4,4,0]:[4,4,0,0],isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750})));return U("div",{key:n,style:e.getCommonProps(n,l,t)},t.title&&U("div",{style:{marginBottom:"0.75rem"}},t.title),u)}function sT(e,t,n,r=!1){const i=t.chartData||t.data||[];if(!Array.isArray(i)||i.length===0)return null;const o=Number(t.height)||240,s=Array.isArray(t.colors)&&t.colors.length?t.colors:[e.cfg.colors.primary,e.cfg.colors.accent,"#317150","#d95020","#638173"],l={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}};return U("div",{key:n,style:e.getCommonProps(n,l,t)},t.title&&U("div",{style:{marginBottom:"0.75rem"}},t.title),v.createElement(Up,{width:"100%",height:o},v.createElement(act,null,v.createElement(br,{contentStyle:{borderRadius:6,border:`1px solid ${e.cfg.colors.borderSubtle}`}}),t.showLegend!==!1&&v.createElement(ra,{iconType:"circle",wrapperStyle:{fontSize:12}}),v.createElement(wo,{data:i,dataKey:"value",nameKey:"label",cx:"50%",cy:"50%",innerRadius:r?"55%":0,outerRadius:"80%",paddingAngle:2,isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750},...i.map((c,h)=>v.createElement(bh,{key:`${c.label||h}-${h}`,fill:c.color||s[h%s.length]}))))))}function jct(e,t,n){const r=t.chartData||t.data||[];if(!Array.isArray(r)||r.length===0)return null;const i=Number(t.height)||260,o=t.xKey||"x",s=t.yKey||"y",l=t.zKey||"size",c={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}};return U("div",{key:n,style:e.getCommonProps(n,c,t)},t.title&&U("div",{style:{marginBottom:"0.75rem"}},t.title),v.createElement(Up,{width:"100%",height:i},v.createElement(lct,{margin:{top:16,right:12,bottom:8,left:0}},v.createElement(dm,{stroke:e.cfg.colors.borderSubtle,strokeDasharray:"3 3"}),v.createElement(ds,{dataKey:o,type:"number",axisLine:!1,tickLine:!1}),v.createElement(ps,{dataKey:s,type:"number",axisLine:!1,tickLine:!1}),v.createElement(Ah,{dataKey:l,range:t.zRange||[50,360]}),v.createElement(br,{contentStyle:{borderRadius:6,border:`1px solid ${e.cfg.colors.borderSubtle}`}}),v.createElement(Th,{data:r,fill:t.color||e.cfg.colors.primary,isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750}))))}function j$({active:e,payload:t,label:n,prefix:r,labelText:i,lineColor:o,backgroundColor:s,textColor:l,borderColor:c}){var u;const h=Number((u=t==null?void 0:t[0])==null?void 0:u.value);return!e||!Number.isFinite(h)?null:v.createElement("div",{style:{padding:10,border:`1px solid ${c}`,borderRadius:6,backgroundColor:s,boxShadow:"0 8px 24px rgba(0, 0, 0, 0.16)",color:l}},v.createElement("p",{style:{margin:0,fontSize:14}},n),v.createElement("p",{style:{margin:"8px 0 0",color:o,fontSize:14}},`${i||"Indicative price / kg"}: ${r||""}${h.toLocaleString()}`))}function Dct({api:e,c:t,data:n,height:r,lineColor:i,fillColor:o,filled:s}){return v.createElement(Up,{width:"100%",height:r},v.createElement(cct,{data:n,margin:{top:16,right:8,left:0,bottom:0}},t.showGrid!==!1&&v.createElement(dm,{vertical:!1,stroke:"#dce4dc",strokeDasharray:"3 3"}),v.createElement(ds,{dataKey:"label",axisLine:!1,tickLine:!1,height:30,tick:{fill:"#638173",fontSize:12}}),v.createElement(ps,{axisLine:!1,tickLine:!1,width:40,tickCount:5,domain:[0,"auto"],tick:{fill:"#638173",fontSize:12},tickFormatter:l=>`${t.tooltipPrefix||""}${Number(l/1e3).toFixed(1).replace(".0","")}k`}),v.createElement(br,{cursor:{stroke:"#638173",strokeDasharray:"3 3"},content:v.createElement(j$,{prefix:t.tooltipPrefix,labelText:t.tooltipLabel,lineColor:i,backgroundColor:e.cfg.colors.surface,textColor:e.cfg.colors.text,borderColor:e.cfg.colors.borderSubtle})}),v.createElement(fs,{type:"monotone",dataKey:"value",stroke:i,fill:s?o:"transparent",strokeWidth:3,dot:!1,activeDot:{r:6,fill:i,stroke:e.cfg.colors.surface,strokeWidth:3},isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750})))}function Hg(e,t,n,r=!1,i=!1){const o=Array.isArray(t.chartData)?t.chartData:[];if(o.length===0)return null;const s=o.flatMap(b=>i?[b.low,b.high]:[b.value]).map(Number).filter(Number.isFinite);if(s.length===0)return null;const l=Math.min(...s),h=Math.max(...s)-l||1,u=Number(t.height)||220,f=b=>u-(b-l)/h*u,m=t.lineColor||e.cfg.colors.accent,y=t.fillColor||`${m}33`,x={width:"100%",padding:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},p=i?o.map((b,P)=>{const S=Number(b.open),A=Number(b.close),E=Number(b.high),w=Number(b.low),T=A>=S;return U("div",{key:P,style:{flex:1,height:"100%",position:"relative"}},U("div",{style:{position:"absolute",left:"50%",top:`${f(E)}px`,height:`${Math.max(1,f(w)-f(E))}px`,borderLeft:`1px solid ${T?"#22c55e":"#ef4444"}`}}),U("div",{style:{position:"absolute",left:"25%",right:"25%",top:`${f(Math.max(S,A))}px`,height:`${Math.max(3,Math.abs(f(A)-f(S)))}px`,background:T?"#22c55e":"#ef4444",borderRadius:"2px"}}))}):v.createElement(Dct,{api:e,c:t,data:o,height:u,lineColor:m,fillColor:y,filled:r});return U("div",{key:n,style:e.getCommonProps(n,x,t)},t.title&&U("div",{style:{color:e.cfg.colors.textSecondary,fontWeight:600,marginBottom:"0.75rem"}},t.title),U("div",{style:{display:"flex",alignItems:"stretch",gap:i?"4px":void 0,height:u}},p),i&&U("div",{style:{display:"flex",justifyContent:"space-between",color:e.cfg.colors.textMuted,fontSize:"0.7rem",marginTop:"4px"}},...o.map((b,P)=>U("span",{key:P},b.label||""))))}function Bct(e,t,n){const r=Array.isArray(t.chartData)?t.chartData[0]||{}:{},i=t.ticker||r.ticker||r.symbol||"EUR/USD",o=t.bid??r.bid??r.price,s=t.ask??r.ask,l=t.change??r.change,c=Number(l),h=Number.isFinite(c)&&c>=0,u=e.getCommonProps(n,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1rem",width:"100%",padding:"0.9rem 1rem",backgroundColor:e.cfg.colors.surface,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:e.cfg.layout.borderRadiusLg,...t.className?e.parseClassName(t.className):{}},t);return U("div",{key:n,...u},U("div",{},U("div",{style:{color:e.cfg.colors.text,fontWeight:700}},i),t.label&&U("div",{style:{color:e.cfg.colors.textMuted,fontSize:"0.75rem"}},t.label)),U("div",{style:{display:"flex",gap:"1rem",alignItems:"baseline",fontVariantNumeric:"tabular-nums"}},o!=null&&U("span",{style:{color:e.cfg.colors.text,fontWeight:700}},String(o)),s!=null&&U("span",{style:{color:e.cfg.colors.textSecondary}},String(s)),l!=null&&U("span",{style:{color:h?"#22c55e":"#ef4444",fontSize:"0.8rem",fontWeight:600}},`${h?"+":""}${l}`)))}function zct({api:e,c:t,componentKey:n}){var b,P,S,A;const r=v.useRef(null),i=v.useRef(null),o=v.useRef(null),[s,l]=v.useState(null),c=v.useRef(null),[h,u]=v.useState(()=>Array.isArray(t.chartData)?t.chartData:[]);v.useEffect(()=>{Array.isArray(t.chartData)&&u(t.chartData)},[t.chartData]);const f=e.interpolateText(((b=t.realtime)==null?void 0:b.channel)||""),m=e.interpolateText(((P=t.timeRange)==null?void 0:P.from)||""),y=e.interpolateText(((S=t.timeRange)==null?void 0:S.to)||""),x=Array.isArray(t.timeframes)?t.timeframes:[];v.useEffect(()=>{var O,R;const E=e.sdk;if(!(((O=t.realtime)==null?void 0:O.mode)==="ws"&&e.isAuthenticated&&f&&((R=E==null?void 0:E.client)==null?void 0:R.createWebSocket)))return;const T=E.client.createWebSocket(f);return T.onmessage=N=>{var V;try{const D=typeof N.data=="string"?JSON.parse(N.data):N.data,j=(D==null?void 0:D.tick)||((V=D==null?void 0:D.data)==null?void 0:V.tick)||(D==null?void 0:D.data)||D,K=Number((j==null?void 0:j.quote)??(j==null?void 0:j.price)??(j==null?void 0:j.close));if(!Number.isFinite(K))return;const H=Number((j==null?void 0:j.epoch)??(j==null?void 0:j.timestamp)??Date.now()/1e3),z=Math.floor(H/60)*60;u(Y=>{const G=Y[Y.length-1];if((G==null?void 0:G.time)===z)return[...Y.slice(0,-1),{...G,high:Math.max(Number(G.high),K),low:Math.min(Number(G.low),K),close:K}];const J=Number((G==null?void 0:G.close)??K);return[...Y.slice(-99),{time:z,open:J,high:K,low:K,close:K}]})}catch{}},()=>{var N;return(N=T.close)==null?void 0:N.call(T)}},[e.isAuthenticated,(A=t.realtime)==null?void 0:A.mode,f]);const p=v.useMemo(()=>h.map((E,w)=>{const T=E.time||E.timestamp;return{time:typeof T=="string"&&T.includes("T")?Math.floor(new Date(T).getTime()/1e3):T||`2024-01-${String(w+1).padStart(2,"0")}`,...t.chartType==="candlestick"?{open:Number(E.open),high:Number(E.high),low:Number(E.low),close:Number(E.close)}:{value:Number(E.value??E.close)}}}),[t.chartType,h]);return c.current=p[p.length-1],v.useEffect(()=>{const E=r.current;if(!E)return;const w=Nz(E,{autoSize:!0,height:Number(t.height)||280,layout:{background:{color:"transparent"},textColor:e.cfg.colors.textSecondary},grid:{vertLines:{color:e.cfg.colors.borderSubtle},horzLines:{color:e.cfg.colors.borderSubtle}},rightPriceScale:{borderColor:e.cfg.colors.borderSubtle},timeScale:{borderColor:e.cfg.colors.borderSubtle,timeVisible:!0}}),T=t.chartType||"candlestick",O=T==="line"?w.addSeries(Vz,{color:t.lineColor||e.cfg.colors.accent}):T==="area"?w.addSeries(Xz,{lineColor:t.lineColor||e.cfg.colors.accent,topColor:t.fillColor||`${e.cfg.colors.accent}66`,bottomColor:"transparent"}):w.addSeries(e5,{upColor:"#22c55e",downColor:"#ef4444",borderVisible:!1,wickUpColor:"#22c55e",wickDownColor:"#ef4444"});return o.current=w,i.current=O,()=>{i.current=null,o.current=null,w.remove()}},[e.cfg.colors.accent,e.cfg.colors.borderSubtle,e.cfg.colors.textSecondary,t.chartType,t.height,t.lineColor,t.fillColor]),v.useEffect(()=>{var E,w;!i.current||p.length===0||(i.current.setData(p),m&&y?(E=o.current)==null||E.timeScale().setVisibleRange({from:m,to:y}):(w=o.current)!=null&&w.timeScale().getVisibleLogicalRange()||o.current.timeScale().fitContent())},[p,m,y]),v.useEffect(()=>{if(!s||!o.current||!c.current)return;const E={"1H":3600,"4H":14400,"1D":86400,"1W":604800}[s],w=Number(c.current.time);E&&Number.isFinite(w)&&o.current.timeScale().setVisibleRange({from:w-E,to:w})},[s]),U("div",{key:n,style:{width:"100%",padding:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}}},x.length>0&&U("div",{style:{display:"flex",gap:"0.35rem",marginBottom:"0.5rem"}},...x.map(E=>U("button",{key:E,type:"button",onClick:()=>l(E),style:{padding:"0.3rem 0.6rem",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:4,color:e.cfg.colors.text,background:s===E?e.cfg.colors.surfaceHover:"transparent",cursor:"pointer"}},E))),U("div",{ref:r,style:{width:"100%",height:Number(t.height)||280}}))}function Fct(e,t,n){return v.createElement(zct,{api:e,c:t,componentKey:n})}function Wct(e,t,n){const r=t.json||t.data||t.diagram||{},i=e.getCommonProps(n,{display:"flex",flexDirection:"column",minHeight:"300px"},t);return U("div",{key:n,className:t.className,...i},v.createElement("pre",{style:{fontSize:"12px",whiteSpace:"pre-wrap",margin:0}},typeof r=="string"?r:JSON.stringify(r,null,2)))}function Vct({api:e,c:t,componentKey:n}){const r=t.data||t.json||t.diagram||{},{_config:i,...o}=r||{},s=Object.keys(o).length?o:r,{nodes:l,edges:c}=v.useMemo(()=>Tx.createFlowDiagram(s),[s]),[h,u]=v.useState("LR"),f=e.cfg.fullscreen===!0,m=t.height||(f?"100%":320),y=e.getCommonProps(n,{width:"100%",height:m,...f?{minHeight:0}:{}},t);return U("div",{key:n,className:t.className,...y},v.createElement(Tx.FlowDiagram,{nodes:l,edges:c,config:{direction:h,layout:(i==null?void 0:i.layout)||"dagre",colorMode:(i==null?void 0:i.colorMode)||(e.cfg.colorMode==="dark"?"dark":"light"),backgroundPattern:(i==null?void 0:i.backgroundPattern)||"dot"},callbacks:{onDirectionChange:x=>u(x)},showBottomBar:(i==null?void 0:i.showBottomBar)||!1,style:{width:"100%",height:"100%"}}))}function Uct(e,t,n){return v.createElement(Vct,{api:e,c:t,componentKey:n})}function Hct(e,t,n){var r;if(t.className){const i=((r=e.parseClassNameResponsive)==null?void 0:r.call(e,t.className,n))??e.parseClassName(t.className);i.display==null&&(i.display="flex"),i.flexDirection==null&&(i.flexDirection=/(^|\s)flex(\s|$)/.test(t.className||"")||t.layout==="row"?"row":"column");const o=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,className:t.className,...o},(Array.isArray(t.children)?t.children:[]).map((s,l)=>e.renderComponent(s,l,n)))}return null}const qct=v.memo(({api:e,field:t,fieldName:n,value:r,onChange:i})=>{v.useEffect(()=>{r!==void 0&&r!==""&&i&&i(r)},[]);const o=v.useRef(null),[s,l]=v.useState(!1),c=v.useRef(null),h=v.useRef(null),[u,f]=v.useState(!1),[m,y]=v.useState(""),[x,p]=v.useState(!1),b=t.html!==!1,P=S=>b?S:S.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/\n/g,"<br>");return v.useEffect(()=>{o.current&&!o.current.innerHTML&&(o.current.innerHTML=P(r))},[]),v.useEffect(()=>{o.current&&document.activeElement!==o.current&&o.current.innerHTML!==r&&(o.current.innerHTML=P(r))},[r]),v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},t.label?U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,v.createElement("div",{style:{border:`1px solid ${s?e.cfg.colors.primary:e.cfg.colors.border}`,borderRadius:e.cfg.components.inputRadius,overflow:"hidden",transition:"border-color 0.2s",position:"relative"}},v.createElement("div",{style:{display:"flex",gap:"4px",padding:"6px 8px",borderBottom:`1px solid ${e.cfg.colors.border}`,backgroundColor:e.cfg.colors.surface}},...[{cmd:"bold",label:"B"},{cmd:"italic",label:"I"},{cmd:"underline",label:"U"}].map(S=>U("button",{key:S.cmd,type:"button",onMouseDown:A=>{var E;A.preventDefault(),document.execCommand(S.cmd,!1),(E=o.current)==null||E.focus()},style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontWeight:600,fontSize:"13px"},onMouseEnter:A=>A.target.style.borderColor=e.cfg.colors.border,onMouseLeave:A=>A.target.style.borderColor="transparent"},S.label)),U("span",{key:"spacer",style:{flex:1}}),U("button",{key:"list-btn",type:"button",onMouseDown:S=>{var A;S.preventDefault(),document.execCommand("insertUnorderedList",!1),(A=o.current)==null||A.focus()},style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},"☰"),U("span",{key:"divider",style:{width:"1px",height:"16px",backgroundColor:e.cfg.colors.border,margin:"0 4px",alignSelf:"center"}}),U("button",{key:"img-btn",type:"button",onMouseDown:S=>{var A;S.preventDefault(),(A=c.current)==null||A.click()},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("image",14)),U("button",{key:"att-btn",type:"button",onMouseDown:S=>{var A;S.preventDefault(),(A=h.current)==null||A.click()},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("paperclip",14)),U("button",{key:"ai-btn",type:"button",onMouseDown:S=>{S.preventDefault(),f(!u)},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:u?e.cfg.colors.border:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("sparkles",14))),U("div",{ref:o,contentEditable:!0,suppressContentEditableWarning:!0,onInput:S=>i(S.currentTarget.innerHTML),onFocus:()=>l(!0),onBlur:()=>l(!1),style:{minHeight:(t.rows||10)*20+"px",padding:"0.75rem 1rem",backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,outline:"none",fontSize:"0.875rem",lineHeight:"1.6"}}),t.expandAction?v.createElement("button",{type:"button",key:"expand",style:{position:"absolute",bottom:"6px",left:"6px",background:"rgba(0,0,0,0.55)",border:`1px solid ${e.cfg.colors.border}`,borderRadius:"4px",cursor:"pointer",color:e.cfg.colors.textMuted,padding:"3px 5px",display:"flex",alignItems:"center",justifyContent:"center",opacity:.5,transition:"opacity 0.2s",zIndex:1},onMouseEnter:S=>{S.currentTarget.style.opacity="0.85"},onMouseLeave:S=>{S.currentTarget.style.opacity="0.5"},onClick:S=>{S.preventDefault(),S.stopPropagation(),e.handleButtonClick(t.expandAction,{})}},e.renderIcon("maximize-2",13)):null,U("input",{key:"img-input",ref:c,type:"file",accept:"image/*",style:{display:"none"},onChange:async S=>{var E,w,T,O,R,N;const A=(E=S.target.files)==null?void 0:E[0];if(A){try{const V=(w=e.showToast)==null?void 0:w.call(e,"Uploading image (0%)…","success",0),D=e.uploadFile?await e.uploadFile(A,t.upload,j=>{var K;return(K=V==null?void 0:V.update)==null?void 0:K.call(V,`Uploading image (${j}%)`)}):"";if((T=V==null?void 0:V.dismiss)==null||T.call(V),!D)throw Error();(O=o.current)==null||O.focus(),document.execCommand("insertImage",!1,D),i(((R=o.current)==null?void 0:R.innerHTML)||"")}catch{(N=e.showToast)==null||N.call(e,"Failed to upload image","error")}S.target.value=""}}}),U("input",{key:"att-input",ref:h,type:"file",multiple:!0,style:{display:"none"},onChange:async S=>{var O,R,N,V,D;const A=Array.from(S.target.files||[]);S.target.value="";const E=[];let w=0;const T=(O=e.showToast)==null?void 0:O.call(e,`Uploading 0/${A.length}…`,"success",0);for(const j of A){try{const K=e.uploadFile?await e.uploadFile(j,t.upload,H=>{var z;return(z=T==null?void 0:T.update)==null?void 0:z.call(T,`Uploading ${j.name} (${H}%)`)}):"";if(!K)throw Error();E.push(`<a href="${K}">${j.name}</a>`)}catch{(R=e.showToast)==null||R.call(e,`Failed to upload ${j.name}`,"error")}w++,(N=T==null?void 0:T.update)==null||N.call(T,`Uploading ${w}/${A.length}…`)}if((V=T==null?void 0:T.dismiss)==null||V.call(T),E.length>0&&o.current){o.current.focus();const j=window.getSelection();if(j){j.removeAllRanges();const K=document.createRange();K.selectNodeContents(o.current),K.collapse(!1),j.addRange(K)}document.execCommand("insertHTML",!1,`<br><br>${E.join(", ")}`),i(((D=o.current)==null?void 0:D.innerHTML)||"")}}}),u?U("div",{key:"ai-popup",style:{position:"absolute",bottom:"100%",left:"8px",right:"8px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",padding:"12px",zIndex:10,boxShadow:"0 -4px 24px rgba(0,0,0,0.4)"}},U("textarea",{value:m,onChange:S=>y(S.target.value),placeholder:"Ask AI to draft a reply...",rows:3,style:{width:"100%",padding:"8px 12px",borderRadius:"4px",border:`1px solid ${e.cfg.colors.borderSubtle}`,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,fontSize:"13px",outline:"none",fontFamily:"inherit",resize:"none",boxSizing:"border-box"}}),U("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end",marginTop:"8px"}},U("button",{type:"button",onClick:()=>{f(!1),y("")},style:{padding:"6px 14px",borderRadius:"6px",border:`1px solid ${e.cfg.colors.borderSubtle}`,cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.textMuted,fontSize:"12px",fontFamily:"inherit"}},"Cancel"),U("button",{type:"button",disabled:x||!m.trim(),onClick:async()=>{var S,A,E,w;if(!(!m.trim()||x)){p(!0);try{const T=((S=o.current)==null?void 0:S.innerHTML)||"",O=await fetch("/api/tenant/email/ai/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:m,context:T})});if(!O.ok)throw Error();const R=await O.json(),N=R.response||R.text||R.content||"";(A=o.current)==null||A.focus(),document.execCommand("insertText",!1,N),i(((E=o.current)==null?void 0:E.innerHTML)||""),f(!1),y("")}catch{(w=e.showToast)==null||w.call(e,"AI request failed","error")}p(!1)}},style:{padding:"6px 14px",borderRadius:"6px",border:"none",cursor:x||!m.trim()?"not-allowed":"pointer",backgroundColor:x||!m.trim()?e.cfg.colors.surfaceHover:e.cfg.colors.background,color:x||!m.trim()?e.cfg.colors.textSecondary:e.cfg.colors.text,fontSize:"12px",fontWeight:600,fontFamily:"inherit"}},x?"Thinking...":"Generate"))):null))}),Gct=v.memo(({api:e,c:t,componentKey:n})=>{const[r,i]=v.useState(!1),o=v.useRef(null),[s,l]=v.useState([]),c=t.name?`bf_persist_${t.name}`:null;v.useEffect(()=>{t.dataSource&&(async()=>{var f;try{const m=e.interpolateText(t.dataSource),y=(f=e.selectDynamicOptions)==null?void 0:f[m];if(y&&y.length>0){l(y);return}Ko[m]||(Ko[m]=(async()=>{var p;try{const b=await fetch(m,{headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!b.ok)return[];const P=await b.json(),S=t.dataField||"configs",A=t.optionLabel||"label",E=t.optionValue||"value",w=P[S]||P.data||P,T=Array.isArray(w)?w.map(O=>({label:O[A]||O.name||O.label,value:O[E]||O.id||O.name||O.label})):[];return(p=e.setSelectDynamicOptions)==null||p.call(e,O=>({...O,[m]:T})),T}catch{return delete Ko[m],[]}})());const x=await Ko[m];x.length>0&&l(x)}catch{}})()},[t.dataSource]),v.useEffect(()=>{if(c&&t.name&&!e.sceneData[t.name]){const m=localStorage.getItem(c);m&&e.setSceneData(y=>({...y,[t.name]:m}))}},[c,t.name,e.sceneData[t.name]]),v.useEffect(()=>{if(!r)return;const f=y=>{o.current&&!o.current.contains(y.target)&&i(!1)},m=setTimeout(()=>{document.addEventListener("mousedown",f)},0);return()=>{clearTimeout(m),document.removeEventListener("mousedown",f)}},[r]);const h=t.variant==="selector",u=Array.isArray(t.items)?t.items:s;if(h){const f=t.name&&(e.sceneData[t.name||""]||c&&localStorage.getItem(c))||"",m=f||t.placeholder||"Select...";return U("div",{ref:o,style:{position:"relative",display:"inline-flex"}},v.createElement("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:"6px",background:"none",border:"none",cursor:"pointer",fontFamily:"inherit",fontSize:t.fontSize||"1rem",fontWeight:t.fontWeight||600,color:t.color||e.cfg.colors.text,padding:"2px 0",outline:"none",lineHeight:"1.5"},onClick:y=>{y.preventDefault(),i(!r)}},U("span",{key:"text"},m),U("span",{key:"caret",style:{display:"flex",alignItems:"center",opacity:.6,marginLeft:"2px"}},e.renderIcon("chevron-down",14))),r?v.createElement("div",{style:{position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.4)",zIndex:9999,overflow:"hidden",minWidth:"200px"}},...u.map((y,x)=>v.createElement("button",{key:x,type:"button",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"10px 16px",backgroundColor:"transparent",color:e.cfg.colors.text,border:"none",cursor:"pointer",fontSize:"14px",textAlign:"left",fontFamily:"inherit",transition:"background-color 0.15s ease",outline:"none",whiteSpace:"nowrap"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor=e.cfg.colors.borderSubtle},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent"},onClick:p=>{p.preventDefault(),p.stopPropagation(),i(!1),t.name&&y.value!==f&&e.setSceneData(b=>({...b,[t.name]:y.value}))}},y.label||""))):null)}return v.createElement("div",{ref:o,style:{position:"relative",display:"flex",width:"100%"}},(()=>{var y;const f=!!((y=e.buttonLoading)!=null&&y[n]),m=[];return f?m.push(U("span",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):t.icon&&m.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(t.icon,t.iconSize||16))),m.push(U("span",{key:"text",style:{lineHeight:"1"}},t.text||"Button")),v.createElement("button",{type:"button",style:{flex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"0.75rem 1.5rem",backgroundColor:e.cfg.colorMode==="light"?e.cfg.colors.primary:"transparent",color:e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.textSecondary,border:`1px solid ${e.cfg.colors.border}`,cursor:"pointer",fontSize:"0.875rem",fontWeight:600,fontFamily:"inherit",lineHeight:"1.25rem",transition:"all 0.15s ease",outline:"none"},onMouseEnter:x=>{x.currentTarget.style.backgroundColor=e.cfg.colors.border,x.currentTarget.style.color=e.cfg.colorMode==="light"?"#111827":e.cfg.colors.text},onMouseLeave:x=>{x.currentTarget.style.backgroundColor=e.cfg.colorMode==="light"?e.cfg.colors.primary:"transparent",x.currentTarget.style.color=e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.textSecondary},onClick:x=>{if(x.preventDefault(),u.length>0&&u[0].onClick){const p=()=>e.handleButtonClick(u[0].onClick,{onSuccess:u[0].onSuccess,onError:u[0].onError},{feedback:u[0].feedback,optimistic:u[0].optimistic,payload:u[0].payload});(e.withLoading?e.withLoading(n,p):p()).catch(()=>{})}}},...m)})(),u.length>0?v.createElement("button",{type:"button",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"0.75rem 0.5rem",backgroundColor:"transparent",color:e.cfg.colors.textSecondary,border:`1px solid ${e.cfg.colors.border}`,borderLeft:`1px solid ${e.cfg.colors.border}`,cursor:"pointer",fontFamily:"inherit",transition:"all 0.15s ease",outline:"none"},onMouseEnter:f=>{f.currentTarget.style.backgroundColor=e.cfg.colors.border,f.currentTarget.style.color=e.cfg.colors.text},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent",f.currentTarget.style.color=e.cfg.colors.textSecondary},onClick:f=>{f.preventDefault(),f.stopPropagation(),i(!r)}},e.renderIcon("chevron-down",16)):null,r?v.createElement("div",{style:{position:"absolute",bottom:"100%",left:"0",right:"0",marginBottom:"4px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",boxShadow:"0 -8px 24px rgba(0,0,0,0.4)",zIndex:9999,overflow:"hidden"}},...u.map((f,m)=>{var b;const y=`${n}-item-${m}`,x=!!((b=e.buttonLoading)!=null&&b[y]),p=[];return x?p.push(U("span",{key:"spinner",className:"bf-btn-spinner",style:{width:"12px",height:"12px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):f.icon&&p.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"8px"}},e.renderIcon(f.icon,14))),p.push(f.label||""),v.createElement("button",{key:m,type:"button",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"10px 16px",backgroundColor:"transparent",color:e.cfg.colors.text,border:"none",cursor:"pointer",fontSize:"14px",textAlign:"left",fontFamily:"inherit",transition:"background-color 0.15s ease",outline:"none"},onMouseEnter:P=>{P.currentTarget.style.backgroundColor=e.cfg.colors.borderSubtle},onMouseLeave:P=>{P.currentTarget.style.backgroundColor="transparent"},onClick:P=>{if(P.preventDefault(),P.stopPropagation(),!f.onClick)return;const S=f.loading==="self"?y:n;f.loading==="self"?i(!0):i(!1);const A=()=>e.handleButtonClick(f.onClick,{onSuccess:f.onSuccess,onError:f.onError},{feedback:f.feedback,optimistic:f.optimistic,payload:f.payload});(e.withLoading?e.withLoading(S,A):A()).finally(()=>{f.loading==="self"&&i(!1)}).catch(()=>{})}},...p)})):null)});function Zct(e,t,n){return v.createElement(Gct,{key:n,api:e,c:t,componentKey:n})}function Yct(e,t,n){var c,h;const r=t.widgetId;if(!r)return null;const o=(e.widgets||[]).find(u=>u.id===r);if(!o||!Array.isArray(o.components))return up(`[renderer] widget "${r}" not found`),null;if(e.widgetStack&&e.widgetStack.includes(r))return up(`[renderer] circular widget reference "${r}"`),null;(c=e.widgetStack)==null||c.push(r);const s=t.props||{},l=ib(o.components,s).map((u,f)=>e.renderComponent(u,f,`${n}-${r}`));return(h=e.widgetStack)==null||h.pop(),v.createElement(v.Fragment,null,...l)}function ib(e,t){if(!t||Object.keys(t).length===0)return e;if(Array.isArray(e))return e.map(n=>ib(n,t));if(e&&typeof e=="object"){const n={};for(const[r,i]of Object.entries(e))typeof i=="string"&&i.includes("{{")?n[r]=i.replace(/\{\{\s*(?:props\.)?([\w.]+)(?:\|(\w+))?\s*\}\}/g,(o,s,l)=>{let c=t;for(const f of s.split("."))c=c==null?void 0:c[f];if(c==null)return o;const h=c&&typeof c=="object"&&"_seconds"in c?c._seconds*1e3:c&&typeof c=="object"&&"seconds"in c?c.seconds*1e3:c,u=l?new Date(h):null;if(l&&Number.isNaN(u==null?void 0:u.getTime()))return"";if(l==="datetime")return u.toLocaleString();if(l==="timeago"){const f=Math.floor((Date.now()-u.getTime())/6e4);if(f<1)return"just now";if(f<60)return`${f}m ago`;const m=Math.floor(f/60);return m<24?`${m}h ago`:`${Math.floor(m/24)}d ago`}return typeof c=="object"?JSON.stringify(c):String(c)}):n[r]=ib(i,t);return e.condition&&(n.__conditionBase=t),n}return e}const D$=v.memo(({api:e,c:t,componentKey:n})=>{const[r,i]=v.useState(!1),[o,s]=v.useState(""),l=v.useRef(null),c=v.useMemo(()=>(Array.isArray(t.options)?t.options:[]).map(b=>typeof b=="string"?{label:b,value:b}:{label:b.label??b.value,value:b.value??b.label}),[t.options]),h=e.sceneData[t.name||""]??"",u=c.find(p=>p.value===h),f=t.className?e.parseClassName(t.className):{},m=v.useMemo(()=>{if(!o)return c;const p=o.toLowerCase();return c.filter(b=>b.label.toLowerCase().includes(p))},[c,o]),y=t.custom&&o&&!c.find(p=>p.value===o||p.label===o);v.useEffect(()=>{if(!r){s("");return}const p=b=>{l.current&&!l.current.contains(b.target)&&i(!1)};return setTimeout(()=>document.addEventListener("mousedown",p),0),()=>document.removeEventListener("mousedown",p)},[r]);const x=p=>{e.setSceneData(b=>({...b,[t.name||""]:p})),i(!1)};return U("div",{key:n,ref:l,style:{position:"relative",width:"100%",...f}},t.label&&U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("button",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 8px",borderRadius:"6px",border:"1px solid",borderColor:e.cfg.colors.border,background:"transparent",color:e.cfg.colors.text,cursor:"pointer",fontSize:"14px",textAlign:"left",gap:"8px"},onClick:()=>i(!r)},U("span",null,u?u.label:t.placeholder||"Select..."),U("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},U("path",{d:"m6 9 6 6 6-6"}))),r&&U("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:50,marginTop:"4px",borderRadius:"6px",border:"1px solid",borderColor:e.cfg.colors.border,background:e.cfg.colors.surface,overflow:"hidden",maxHeight:"260px",display:"flex",flexDirection:"column"}},t.searchable!==!1&&U("input",{style:{width:"100%",padding:"8px",border:"none",borderBottom:"1px solid",borderColor:e.cfg.colors.borderSubtle,background:"transparent",color:e.cfg.colors.text,outline:"none",fontSize:"13px"},placeholder:"Search...",value:o,onChange:p=>{s(p.target.value),p.stopPropagation()},onClick:p=>p.stopPropagation()}),U("div",{style:{overflow:"auto",flex:1}},m.map(p=>U("button",{key:p.value,style:{width:"100%",display:"block",textAlign:"left",padding:"8px",border:"none",background:p.value===h?"rgba(59,130,246,0.2)":"transparent",color:p.value===h?e.cfg.colors.primary:e.cfg.colors.text,cursor:"pointer",fontSize:"13px"},onMouseEnter:b=>{b.currentTarget.style.background=e.cfg.colors.surfaceHover},onMouseLeave:b=>{b.currentTarget.style.background=p.value===h?"rgba(59,130,246,0.2)":"transparent"},onClick:()=>x(p.value)},p.label)),y&&U("button",{style:{width:"100%",display:"block",textAlign:"left",padding:"8px",border:"none",borderTop:"1px solid",borderColor:e.cfg.colors.borderSubtle,background:"transparent",color:e.cfg.colors.primary,cursor:"pointer",fontSize:"13px",fontStyle:"italic"},onClick:()=>x(o)},`+ Add "${o}"`))))});function Kct(e,t,n){return v.createElement(D$,{api:e,c:t,componentKey:n})}const Ko={},Xct=v.memo(({api:e,field:t,fieldName:n,fieldKey:r,fieldStyle:i,fieldWrapperStyle:o})=>{const[s,l]=v.useState([]);v.useEffect(()=>{t.dataSource&&(async()=>{var u;try{const f=e.interpolateText(t.dataSource),m=(u=e.selectDynamicOptions)==null?void 0:u[f];if(m&&m.length>0){l(m);return}Ko[f]||(Ko[f]=(async()=>{var x;try{const p=await fetch(f,{headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!p.ok)return[];const b=await p.json(),P=t.dataField||"configs",S=t.optionLabel||"label",A=t.optionValue||"value",E=b[P]||b.data||b,w=Array.isArray(E)?E.map(T=>({label:T[S]||T.name||T.label,value:T[A]||T.id||T.name||T.label})):[];return(x=e.setSelectDynamicOptions)==null||x.call(e,T=>({...T,[f]:w})),w}catch{return delete Ko[f],[]}})());const y=await Ko[f];y.length>0&&l(y)}catch{}})()},[t.dataSource]);const c=s.length>0?s:Array.isArray(t.options)?t.options:[],h=t.placeholder||t.label||"Select...";return v.createElement("div",{key:r,style:o||{width:"100%"}},t.label?U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,U("select",{name:n,value:e.sceneData[n]??"",required:t.required,className:t.className,style:{...i,fontSize:"0.875rem"},size:"md",onChange:u=>e.setSceneData(f=>({...f,[n]:u.target.value}))},U("option",{key:"__placeholder",value:"",disabled:!0,hidden:!0},h),c.map((u,f)=>U("option",{key:f,value:typeof u=="string"?u:u.value},typeof u=="string"?u:u.label))))});function Jct(e,t,n){var c;const r=t.className||"",i=((c=e.parseClassNameResponsive)==null?void 0:c.call(e,r,n))??e.parseClassName(r),o=e.getCommonProps(n,i,t),s=Array.isArray(t.fields)?t.fields:[],l=t.submitButton;return t.collection&&e.fetchEntitySchema?v.createElement(Qct,{api:e,c:t,componentKey:n,formClassName:r,parsedStyle:i,formProps:o,fields:s,submitBtn:l}):B$(e,t,n,r,i,o,s,l)}function Qct({api:e,c:t,componentKey:n,formClassName:r,parsedStyle:i,formProps:o,fields:s,submitBtn:l}){const[c,h]=v.useState(s),[u,f]=v.useState(!0);return v.useEffect(()=>{if(!e.fetchEntitySchema){f(!1);return}e.fetchEntitySchema(t.collection).then(m=>{if(!Array.isArray(m==null?void 0:m.fields)){f(!1);return}const y=new Map(m.fields.map(p=>[p.name,p])),x=s.map(p=>{var P;const b=y.get(p.name||((P=p.label)==null?void 0:P.toLowerCase()));return b?{...p,required:p.required??b.required,validation:p.validation??(b.validation?{...b.validation}:void 0),placeholder:p.placeholder??b.placeholder}:p});h(x),f(!1)}).catch(()=>f(!1))},[t.collection]),u?U("div",{key:n,style:{padding:"1rem",textAlign:"center",color:e.cfg.colors.textMuted,fontSize:"0.8rem"}},"Loading fields..."):B$(e,t,n,r,i,o,c,l)}const tut=v.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,inputType:s,label:l,fieldStyle:c,onKeyDown:h,openPickerOnClick:u}){v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const f=v.useRef(r);f.current=r;const m=v.useRef(c);m.current=c;const y=v.useCallback(p=>{f.current(p.target.value)},[]),x=v.createElement("input",{name:t,placeholder:i,required:o,type:s||"text",value:n??"",onChange:y,onClick:u?p=>{var b,P;return(P=(b=p.currentTarget).showPicker)==null?void 0:P.call(b)}:void 0,onKeyDown:h?p=>{p.key==="Enter"&&h()}:void 0,style:m.current});return l?v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},v.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:c.color,marginBottom:"0.75rem"}},l),x):x}),eut=v.memo(function({api:t,field:n,fieldName:r,label:i,fieldStyle:o}){const s=v.useRef(null),[l,c]=v.useState(!1),h=t.sceneData[r]||"",u=t.sceneData[r+"_name"]||"",f=async m=>{var x,p,b,P;const y=(x=m.target.files)==null?void 0:x[0];if(m.target.value="",!!y){c(!0);try{const S=(p=t.showToast)==null?void 0:p.call(t,"Uploading test case (0%)…","success",0),A=t.uploadFile?await t.uploadFile(y,n.upload,E=>{var w;return(w=S==null?void 0:S.update)==null?void 0:w.call(S,`Uploading test case (${E}%)`)}):"";if((b=S==null?void 0:S.dismiss)==null||b.call(S),!A)throw new Error;t.setSceneData(E=>({...E,[r]:A,[r+"_name"]:y.name}))}catch{(P=t.showToast)==null||P.call(t,"Upload failed","error")}finally{c(!1)}}};return v.createElement("div",{style:{width:"100%"}},i&&U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:t.cfg.colors.textSecondary,marginBottom:"0.75rem"}},i),h?v.createElement("div",{style:{...o,display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"}},U("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},"📎 "+(u||"Test case uploaded")),U("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",color:t.cfg.colors.danger,fontSize:"13px"},onClick:()=>t.setSceneData(m=>{const y={...m};return delete y[r],delete y[r+"_name"],y})},"Remove")):v.createElement("button",{type:"button",onClick:()=>{var m;return(m=s.current)==null?void 0:m.click()},style:{...o,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",cursor:"pointer",color:t.cfg.colors.textMuted,fontSize:"14px"}},l?"Uploading…":"⬆ Upload a test case"),U("input",{key:"file-input",ref:s,type:"file",accept:n.accept||".pdf,.docx,.txt,.md,.csv,.json",style:{display:"none"},onChange:f}))}),nut=v.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,options:s,label:l,fieldStyle:c}){v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const h=v.useRef(r);h.current=r;const u=v.useRef(c);u.current=c;const f=v.useCallback(y=>{h.current(y.target.value)},[]),m=v.createElement("select",{name:t,required:o,value:n??"",onChange:f,style:{...u.current,cursor:"pointer",appearance:"none"}},i?v.createElement("option",{key:"__placeholder",value:""},i):null,...s.map((y,x)=>v.createElement("option",{key:x,value:typeof y=="string"?y:y.value},typeof y=="string"?y:y.label)));return l?v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},v.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,marginBottom:"0.75rem"}},l),m):m}),rut=v.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,rows:s,label:l,fieldStyle:c}){v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const h=v.useRef(r);h.current=r;const u=v.useRef(c);u.current=c;const f=v.useCallback(y=>{h.current(y.target.value)},[]),m=v.createElement("textarea",{name:t,placeholder:i,required:o,rows:s||4,value:n??"",onChange:f,style:{...u.current,resize:"vertical",fontFamily:"inherit"}});return l?v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},v.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,marginBottom:"0.75rem"}},l),m):m});function B$(e,t,n,r,i,o,s,l){var y,x;const c=[],h=Math.max(1,Math.floor(Number(t.columns)||1)),u=typeof window>"u"?1/0:window.innerWidth,m=Math.min(e.containerWidth||1/0,u)<640?1:h;if(s.forEach((p,b)=>{var O,R;const P=`${n}-field-${b}`,S=p.name||((O=p.label)==null?void 0:O.toLowerCase())||"",A=p.className?((R=e.parseClassNameResponsive)==null?void 0:R.call(e,p.className,P))??e.parseClassName(p.className):{},E={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:p.borderless?p.backgroundColor||"transparent":e.cfg.colors.surface,color:p.textColor||e.cfg.colors.text,colorScheme:e.cfg.colorMode==="light"?"light":"dark",border:p.borderless?"none":`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition,...A},w={width:"100%",marginBottom:"1rem"},T=N=>N.value?e.interpolateText(String(N.value)):"";if(p.type==="richtext")c.push(v.createElement(qct,{key:P,api:e,field:p,fieldName:S,value:e.sceneData[S]??T(p),onChange:N=>e.setSceneData(V=>({...V,[S]:N}))}));else if(p.type==="textarea"){const N=p.rows||4;c.push(v.createElement(rut,{key:P,name:S,value:e.sceneData[S]??T(p),onChange:V=>e.setSceneData(D=>({...D,[S]:V})),placeholder:p.placeholder||p.label,required:p.required,rows:N,label:p.label,fieldStyle:E}))}else if(p.type==="select")if(p.dataSource)c.push(v.createElement(Xct,{key:P,api:e,field:p,fieldName:S,fieldKey:P,fieldStyle:E,fieldWrapperStyle:w}));else{const N=Array.isArray(p.options)?p.options:[];c.push(v.createElement(nut,{key:P,name:S,value:e.sceneData[S]??T(p),onChange:V=>e.setSceneData(D=>({...D,[S]:V})),placeholder:p.placeholder||p.label||"Select...",required:p.required,options:N,label:p.label,fieldStyle:E}))}else if(p.type==="advanced-select")c.push(v.createElement("div",{key:`${P}-wrap`,style:w},v.createElement(D$,{key:P,api:e,c:{...p,name:S,options:p.options},componentKey:P})));else if(p.type==="file")c.push(v.createElement("div",{key:`${P}-wrap`,style:w},v.createElement(eut,{key:P,api:e,field:p,fieldName:S,label:p.label,fieldStyle:E})));else if(p.tags)c.push(v.createElement(iut,{key:P,api:e,field:p,value:e.sceneData[S]??T(p),onChange:N=>e.setSceneData(V=>({...V,[S]:N}))}));else{const N=p.type==="email"?"email":p.type==="password"?"password":p.type==="number"?"number":p.type==="date"?"date":p.type==="datetime-local"?"datetime-local":"text";c.push(v.createElement(tut,{key:P,name:S,value:e.sceneData[S]??T(p),onChange:V=>e.setSceneData(D=>({...D,[S]:V})),placeholder:p.placeholder||p.label,required:p.required,inputType:N,label:p.label,fieldStyle:E,openPickerOnClick:p.openPickerOnClick,onKeyDown:p.onKeyDown?()=>e.handleButtonClick(p.onKeyDown):void 0}))}}),h>1){const p=c.splice(0);c.push(...p.map((b,P)=>{var A;const S=Math.min(m,Math.max(1,Number((A=s[P])==null?void 0:A.fieldSpan)||1));return U("div",{key:`${n}-field-grid-${P}`,style:{gridColumn:`span ${S} / span ${S}`,minWidth:0}},b)}))}if(l){const p={padding:"0.75rem 1.5rem",borderRadius:e.cfg.components.inputRadius,cursor:"pointer",fontWeight:600,width:"100%",marginTop:"1rem",...h>1?{gridColumn:"1 / -1",marginTop:0}:{}},b=l.className?((y=e.parseClassNameResponsive)==null?void 0:y.call(e,l.className,`${n}-submit`))??e.parseClassName(l.className):{},P=!!l.className&&/(^|\s)bg-[^\s]+/.test(l.className),S=!!l.className&&/(^|\s)text-[^\s]+/.test(l.className),A={...p,...b,...!P&&{backgroundColor:e.cfg.colors.primary},...!S&&{color:"#fff",border:"none"}},E=`${n}-submit`,w=!!((x=e.buttonLoading)!=null&&x[E]),T=()=>{var j,K,H,z,Y;const V=[],D=e.sceneData||{};for(const G of s){const J=G.name||((j=G.label)==null?void 0:j.toLowerCase()),lt=D[J],q=G.label||J;if(G.required&&(lt==null||String(lt).trim()==="")){V.push(`${q} is required`);continue}lt==null||String(lt).trim()===""||((K=G.validation)!=null&&K.pattern&&!new RegExp(G.validation.pattern).test(String(lt))&&V.push(`${q} is invalid`),((H=G.validation)==null?void 0:H.min)!==void 0&&Number(lt)<Number(G.validation.min)&&V.push(`${q} must be at least ${G.validation.min}`),((z=G.validation)==null?void 0:z.max)!==void 0&&Number(lt)>Number(G.validation.max)&&V.push(`${q} must be at most ${G.validation.max}`),((Y=G.validation)==null?void 0:Y.minLength)!==void 0&&String(lt).length<Number(G.validation.minLength)&&V.push(`${q} must be at least ${G.validation.minLength} characters`))}return V},O=()=>{var K,H;const V=T();if(V.length){(K=e.showToast)==null||K.call(e,V,"error");return}const D=()=>l.onClick?e.handleButtonClick(l.onClick,{onSuccess:l.onSuccess,onError:l.onError},{optimistic:l.optimistic,feedback:l.feedback,payload:l.payload}):Promise.resolve(),j=e.withLoading?e.withLoading(E,D):D();(H=j==null?void 0:j.catch)==null||H.call(j,()=>{})},R=l.onClick?()=>O():void 0,N=[];w?N.push(U("span",{key:"spinner",className:"bf-btn-spinner",style:{display:"inline-flex",width:"14px",height:"14px",marginRight:"6px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):l.icon&&N.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(l.icon,l.iconSize||16))),N.push(U("span",{key:"text"},l.text||"Submit")),c.push(U("button",{key:E,type:l.type||"submit",className:l.className,...e.getCommonProps(E,A,l),disabled:w||void 0,onClick:R},...N))}return U("form",{key:n,className:r,...o,style:{...o.style||{},...h>1?{display:"grid",gridTemplateColumns:`repeat(${m}, minmax(0, 1fr))`,columnGap:"1rem",rowGap:"1.25rem"}:{}},onSubmit:p=>p.preventDefault()},...c)}const iut=v.memo(({api:e,field:t,value:n,onChange:r})=>{v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const i=v.useRef(null),o=(n||"").split(",").filter(Boolean).map(y=>y.trim()),[s,l]=v.useState(""),[c,h]=v.useState(!1),u=y=>{const x=y.target.value;if(x.includes(",")||x.includes(";")){const p=x.split(/[,;]+/).map(b=>b.trim()).filter(Boolean);if(p.length>0){const b=[...new Set([...o,...p])].join(", ");r(b)}l("")}else l(x)},f=y=>{if(y.key==="Enter"||y.key===","||y.key===";"){y.preventDefault();const x=s.trim();x&&(r([...new Set([...o,x])].join(", ")),l(""))}else y.key==="Backspace"&&!s&&o.length>0&&r(o.slice(0,-1).join(", "))},m=()=>{const y=s.trim();y&&(r([...new Set([...o,y])].join(", ")),l(""))};return U("div",{key:"tags",style:{width:"100%",marginBottom:"1rem"}},t.label?U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,U("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",padding:"0.5rem 0.75rem",borderRadius:e.cfg.components.inputRadius||"8px",backgroundColor:e.cfg.colors.surface,border:`1px solid ${c?e.cfg.colors.primary:e.cfg.colors.border}`,cursor:"text",outline:"none",transition:"border-color 0.2s"},onClick:()=>{var y;return(y=i.current)==null?void 0:y.focus()}},...o.map((y,x)=>U("span",{key:x,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"4px",backgroundColor:e.cfg.colors.background,border:`1px solid ${e.cfg.colors.borderSubtle}`,color:e.cfg.colors.text,fontSize:"13px",lineHeight:"1.4"}},U("span",null,y),U("button",{type:"button",onMouseDown:p=>{p.preventDefault(),p.stopPropagation(),r(o.filter((b,P)=>P!==x).join(", "))},style:{background:"none",border:"none",cursor:"pointer",color:e.cfg.colors.textMuted,padding:"0",fontSize:"14px",lineHeight:"1",display:"flex",alignItems:"center",fontFamily:"inherit"}},"×"))),U("input",{ref:i,type:"text",value:s,onChange:u,onKeyDown:f,onFocus:()=>h(!0),onBlur:()=>{h(!1),m()},placeholder:t.placeholder||(o.length>0?"":"Add email..."),style:{flex:1,minWidth:"100px",border:"none",outline:"none",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"14px",fontFamily:"inherit",padding:"2px 0"}})))});function out(e,t,n){let r=e.interpolateText(t.text||t.content||"");if(!r)return null;!r.includes(`
116
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I$(e,t){if(e){if(typeof e=="string")return nb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nb(e,t)}}function qlt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Glt(e){if(Array.isArray(e))return nb(e)}function nb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ut(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nT(Object(n),!0).forEach(function(r){Ft(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ft(e,t,n){return t=R$(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R$(e){var t=Zlt(e,"string");return Hl(t)=="symbol"?t:t+""}function Zlt(e,t){if(Hl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ylt={xAxis:["bottom","top"],yAxis:["left","right"]},Klt={width:"100%",height:"100%"},L$={x:0,y:0};function kf(e){return e}var Xlt=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Jlt=function(t,n,r,i){var o=n.find(function(u){return u&&u.index===r});if(o){if(t==="horizontal")return{x:o.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:o.coordinate};if(t==="centric"){var s=o.coordinate,l=i.radius;return ut(ut(ut({},i),ze(i.cx,i.cy,l,s)),{},{angle:s,radius:l})}var c=o.coordinate,h=i.angle;return ut(ut(ut({},i),ze(i.cx,i.cy,c,h)),{},{angle:h,radius:c})}return L$},pm=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,o=n.dataEndIndex,s=(r??[]).reduce(function(l,c){var h=c.props.data;return h&&h.length?[].concat(ql(l),ql(h)):l},[]);return s.length>0?s:t&&t.length&&xt(i)&&xt(o)?t.slice(i,o+1):[]};function N$(e){return e==="number"?[0,"auto"]:void 0}var rb=function(t,n,r,i){var o=t.graphicalItems,s=t.tooltipAxis,l=pm(n,t);return r<0||!o||!o.length||r>=l.length?null:o.reduce(function(c,h){var u,f=(u=h.props.data)!==null&&u!==void 0?u:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(s.dataKey&&!s.allowDuplicatedCategory){var y=f===void 0?l:f;m=nd(y,s.dataKey,i)}else m=f&&f[r]||l[r];return m?[].concat(ql(c),[gk(h,m)]):c},[])},rT=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},s=Xlt(o,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,h=t.tooltipTicks,u=GJ(s,l,h,c);if(u>=0&&h){var f=h[u]&&h[u].value,m=rb(t,n,u,f),y=Jlt(r,l,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:m,activeCoordinate:y}}return null},Qlt=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,s=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,h=n.dataEndIndex,u=t.layout,f=t.children,m=t.stackOffset,y=uk(u,o);return r.reduce(function(x,p){var b,P=p.type.defaultProps!==void 0?ut(ut({},p.type.defaultProps),p.props):p.props,S=P.type,A=P.dataKey,E=P.allowDataOverflow,w=P.allowDuplicatedCategory,T=P.scale,O=P.ticks,R=P.includeHidden,N=P[s];if(x[N])return x;var V=pm(t.data,{graphicalItems:i.filter(function(it){var at,ct=s in it.props?it.props[s]:(at=it.type.defaultProps)===null||at===void 0?void 0:at[s];return ct===N}),dataStartIndex:c,dataEndIndex:h}),D=V.length,j,K,H;Alt(P.domain,E,S)&&(j=mv(P.domain,null,E),y&&(S==="number"||T!=="auto")&&(H=fu(V,A,"category")));var z=N$(S);if(!j||j.length===0){var Y,G=(Y=P.domain)!==null&&Y!==void 0?Y:z;if(A){if(j=fu(V,A,S),S==="category"&&y){var J=RW(j);w&&J?(K=j,j=Gd(0,D)):w||(j=vP(G,j,p).reduce(function(it,at){return it.indexOf(at)>=0?it:[].concat(ql(it),[at])},[]))}else if(S==="category")w?j=j.filter(function(it){return it!==""&&!Ut(it)}):j=vP(G,j,p).reduce(function(it,at){return it.indexOf(at)>=0||at===""||Ut(at)?it:[].concat(ql(it),[at])},[]);else if(S==="number"){var lt=JJ(V,i.filter(function(it){var at,ct,gt=s in it.props?it.props[s]:(at=it.type.defaultProps)===null||at===void 0?void 0:at[s],yt="hide"in it.props?it.props.hide:(ct=it.type.defaultProps)===null||ct===void 0?void 0:ct.hide;return gt===N&&(R||!yt)}),A,o,u);lt&&(j=lt)}y&&(S==="number"||T!=="auto")&&(H=fu(V,A,"category"))}else y?j=Gd(0,D):l&&l[N]&&l[N].hasStack&&S==="number"?j=m==="expand"?[0,1]:mk(l[N].stackGroups,c,h):j=ck(V,i.filter(function(it){var at=s in it.props?it.props[s]:it.type.defaultProps[s],ct="hide"in it.props?it.props.hide:it.type.defaultProps.hide;return at===N&&(R||!ct)}),S,u,!0);if(S==="number")j=tb(f,j,N,o,O),G&&(j=mv(G,j,E));else if(S==="category"&&G){var q=G,nt=j.every(function(it){return q.indexOf(it)>=0});nt&&(j=q)}}return ut(ut({},x),{},Ft({},N,ut(ut({},P),{},{axisType:o,domain:j,categoricalDomain:H,duplicateDomain:K,originalDomain:(b=P.domain)!==null&&b!==void 0?b:z,isCategorical:y,layout:u})))},{})},tct=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,s=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,h=n.dataEndIndex,u=t.layout,f=t.children,m=pm(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:h}),y=m.length,x=uk(u,o),p=-1;return r.reduce(function(b,P){var S=P.type.defaultProps!==void 0?ut(ut({},P.type.defaultProps),P.props):P.props,A=S[s],E=N$("number");if(!b[A]){p++;var w;return x?w=Gd(0,y):l&&l[A]&&l[A].hasStack?(w=mk(l[A].stackGroups,c,h),w=tb(f,w,A,o)):(w=mv(E,ck(m,r.filter(function(T){var O,R,N=s in T.props?T.props[s]:(O=T.type.defaultProps)===null||O===void 0?void 0:O[s],V="hide"in T.props?T.props.hide:(R=T.type.defaultProps)===null||R===void 0?void 0:R.hide;return N===A&&!V}),"number",u),i.defaultProps.allowDataOverflow),w=tb(f,w,A,o)),ut(ut({},b),{},Ft({},A,ut(ut({axisType:o},i.defaultProps),{},{hide:!0,orientation:_r(Ylt,"".concat(o,".").concat(p%2),null),domain:w,originalDomain:E,isCategorical:x,layout:u})))}return b},{})},ect=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,h=n.dataEndIndex,u=t.children,f="".concat(i,"Id"),m=ur(u,o),y={};return m&&m.length?y=Qlt(t,{axes:m,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:h}):s&&s.length&&(y=tct(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:h})),y},nct=function(t){var n=Uo(t),r=so(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:N0(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:$d(n,r)}},iT=function(t){var n=t.children,r=t.defaultShowTooltip,i=vr(n,Il),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},rct=function(t){return!t||!t.length?!1:t.some(function(n){var r=lo(n&&n.type);return r&&r.indexOf("Bar")>=0})},oT=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},ict=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,l=t.yAxisMap,c=l===void 0?{}:l,h=r.width,u=r.height,f=r.children,m=r.margin||{},y=vr(f,Il),x=vr(f,ra),p=Object.keys(c).reduce(function(w,T){var O=c[T],R=O.orientation;return!O.mirror&&!O.hide?ut(ut({},w),{},Ft({},R,w[R]+O.width)):w},{left:m.left||0,right:m.right||0}),b=Object.keys(s).reduce(function(w,T){var O=s[T],R=O.orientation;return!O.mirror&&!O.hide?ut(ut({},w),{},Ft({},R,_r(w,"".concat(R))+O.height)):w},{top:m.top||0,bottom:m.bottom||0}),P=ut(ut({},b),p),S=P.bottom;y&&(P.bottom+=y.props.height||Il.defaultProps.height),x&&n&&(P=KJ(P,i,r,n));var A=h-P.left-P.right,E=u-P.top-P.bottom;return ut(ut({brushBottom:S},P),{},{width:Math.max(A,0),height:Math.max(E,0)})},oct=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},mm=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=t.axisComponents,h=t.legendContent,u=t.formatAxisMap,f=t.defaultProps,m=function(P,S){var A=S.graphicalItems,E=S.stackGroups,w=S.offset,T=S.updateId,O=S.dataStartIndex,R=S.dataEndIndex,N=P.barSize,V=P.layout,D=P.barGap,j=P.barCategoryGap,K=P.maxBarSize,H=oT(V),z=H.numericAxisName,Y=H.cateAxisName,G=rct(A),J=[];return A.forEach(function(lt,q){var nt=pm(P.data,{graphicalItems:[lt],dataStartIndex:O,dataEndIndex:R}),it=lt.type.defaultProps!==void 0?ut(ut({},lt.type.defaultProps),lt.props):lt.props,at=it.dataKey,ct=it.maxBarSize,gt=it["".concat(z,"Id")],yt=it["".concat(Y,"Id")],Et={},Tt=c.reduce(function(te,Ht){var re,Ce,ie=S["".concat(Ht.axisType,"Map")],on=it["".concat(Ht.axisType,"Id")];ie&&ie[on]||Ht.axisType==="zAxis"||(process.env.NODE_ENV!=="production"?lr(!1,"Specifying a(n) ".concat(Ht.axisType,"Id requires a corresponding ").concat(Ht.axisType,"Id on the targeted graphical component ").concat((re=lt==null||(Ce=lt.type)===null||Ce===void 0?void 0:Ce.displayName)!==null&&re!==void 0?re:"")):lr());var tn=ie[on];return ut(ut({},te),{},Ft(Ft({},Ht.axisType,tn),"".concat(Ht.axisType,"Ticks"),so(tn)))},Et),ht=Tt[Y],ft=Tt["".concat(Y,"Ticks")],Ct=E&&E[gt]&&E[gt].hasStack&&aQ(lt,E[gt].stackGroups),rt=lo(lt.type).indexOf("Bar")>=0,Rt=$d(ht,ft),bt=[],de=G&&ZJ({barSize:N,stackGroups:E,totalSize:oct(Tt,Y)});if(rt){var ne,Gt,Le=Ut(ct)?K:ct,Bt=(ne=(Gt=$d(ht,ft,!0))!==null&&Gt!==void 0?Gt:Le)!==null&&ne!==void 0?ne:0;bt=YJ({barGap:D,barCategoryGap:j,bandSize:Bt!==Rt?Bt:Rt,sizeList:de[yt],maxBarSize:Le}),Bt!==Rt&&(bt=bt.map(function(te){return ut(ut({},te),{},{position:ut(ut({},te.position),{},{offset:te.position.offset-Bt/2})})}))}var Qt=lt&&lt.type&&lt.type.getComposedData;Qt&&J.push({props:ut(ut({},Qt(ut(ut({},Tt),{},{displayedData:nt,props:P,dataKey:at,item:lt,bandSize:Rt,barPosition:bt,offset:w,stackedData:Ct,layout:V,dataStartIndex:O,dataEndIndex:R}))),{},Ft(Ft(Ft({key:lt.key||"item-".concat(q)},z,Tt[z]),Y,Tt[Y]),"animationId",T)),childIndex:ZW(lt,P.children),item:lt})}),J},y=function(P,S){var A=P.props,E=P.dataStartIndex,w=P.dataEndIndex,T=P.updateId;if(!f1({props:A}))return null;var O=A.children,R=A.layout,N=A.stackOffset,V=A.data,D=A.reverseStackOrder,j=oT(R),K=j.numericAxisName,H=j.cateAxisName,z=ur(O,r),Y=oQ(V,z,"".concat(K,"Id"),"".concat(H,"Id"),N,D),G=c.reduce(function(it,at){var ct="".concat(at.axisType,"Map");return ut(ut({},it),{},Ft({},ct,ect(A,ut(ut({},at),{},{graphicalItems:z,stackGroups:at.axisType===K&&Y,dataStartIndex:E,dataEndIndex:w}))))},{}),J=ict(ut(ut({},G),{},{props:A,graphicalItems:z}),S==null?void 0:S.legendBBox);Object.keys(G).forEach(function(it){G[it]=u(A,G[it],J,it.replace("Map",""),n)});var lt=G["".concat(H,"Map")],q=nct(lt),nt=m(A,ut(ut({},G),{},{dataStartIndex:E,dataEndIndex:w,updateId:T,graphicalItems:z,stackGroups:Y,offset:J}));return ut(ut({formattedGraphicalItems:nt,graphicalItems:z,offset:J,stackGroups:Y},q),G)},x=function(b){function P(S){var A,E,w;return Dlt(this,P),w=Flt(this,P,[S]),Ft(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ft(w,"accessibilityManager",new Plt),Ft(w,"handleLegendBBoxUpdate",function(T){if(T){var O=w.state,R=O.dataStartIndex,N=O.dataEndIndex,V=O.updateId;w.setState(ut({legendBBox:T},y({props:w.props,dataStartIndex:R,dataEndIndex:N,updateId:V},ut(ut({},w.state),{},{legendBBox:T}))))}}),Ft(w,"handleReceiveSyncEvent",function(T,O,R){if(w.props.syncId===T){if(R===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(O)}}),Ft(w,"handleBrushChange",function(T){var O=T.startIndex,R=T.endIndex;if(O!==w.state.dataStartIndex||R!==w.state.dataEndIndex){var N=w.state.updateId;w.setState(function(){return ut({dataStartIndex:O,dataEndIndex:R},y({props:w.props,dataStartIndex:O,dataEndIndex:R,updateId:N},w.state))}),w.triggerSyncEvent({dataStartIndex:O,dataEndIndex:R})}}),Ft(w,"handleMouseEnter",function(T){var O=w.getMouseInfo(T);if(O){var R=ut(ut({},O),{},{isTooltipActive:!0});w.setState(R),w.triggerSyncEvent(R);var N=w.props.onMouseEnter;Vt(N)&&N(R,T)}}),Ft(w,"triggeredAfterMouseMove",function(T){var O=w.getMouseInfo(T),R=O?ut(ut({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(R),w.triggerSyncEvent(R);var N=w.props.onMouseMove;Vt(N)&&N(R,T)}),Ft(w,"handleItemMouseEnter",function(T){w.setState(function(){return{isTooltipActive:!0,activeItem:T,activePayload:T.tooltipPayload,activeCoordinate:T.tooltipPosition||{x:T.cx,y:T.cy}}})}),Ft(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),Ft(w,"handleMouseMove",function(T){T.persist(),w.throttleTriggeredAfterMouseMove(T)}),Ft(w,"handleMouseLeave",function(T){w.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};w.setState(O),w.triggerSyncEvent(O);var R=w.props.onMouseLeave;Vt(R)&&R(O,T)}),Ft(w,"handleOuterEvent",function(T){var O=GW(T),R=_r(w.props,"".concat(O));if(O&&Vt(R)){var N,V;/.*touch.*/i.test(O)?V=w.getMouseInfo(T.changedTouches[0]):V=w.getMouseInfo(T),R((N=V)!==null&&N!==void 0?N:{},T)}}),Ft(w,"handleClick",function(T){var O=w.getMouseInfo(T);if(O){var R=ut(ut({},O),{},{isTooltipActive:!0});w.setState(R),w.triggerSyncEvent(R);var N=w.props.onClick;Vt(N)&&N(R,T)}}),Ft(w,"handleMouseDown",function(T){var O=w.props.onMouseDown;if(Vt(O)){var R=w.getMouseInfo(T);O(R,T)}}),Ft(w,"handleMouseUp",function(T){var O=w.props.onMouseUp;if(Vt(O)){var R=w.getMouseInfo(T);O(R,T)}}),Ft(w,"handleTouchMove",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(T.changedTouches[0])}),Ft(w,"handleTouchStart",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&w.handleMouseDown(T.changedTouches[0])}),Ft(w,"handleTouchEnd",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&w.handleMouseUp(T.changedTouches[0])}),Ft(w,"handleDoubleClick",function(T){var O=w.props.onDoubleClick;if(Vt(O)){var R=w.getMouseInfo(T);O(R,T)}}),Ft(w,"handleContextMenu",function(T){var O=w.props.onContextMenu;if(Vt(O)){var R=w.getMouseInfo(T);O(R,T)}}),Ft(w,"triggerSyncEvent",function(T){w.props.syncId!==void 0&&Wg.emit(Vg,w.props.syncId,T,w.eventEmitterSymbol)}),Ft(w,"applySyncEvent",function(T){var O=w.props,R=O.layout,N=O.syncMethod,V=w.state.updateId,D=T.dataStartIndex,j=T.dataEndIndex;if(T.dataStartIndex!==void 0||T.dataEndIndex!==void 0)w.setState(ut({dataStartIndex:D,dataEndIndex:j},y({props:w.props,dataStartIndex:D,dataEndIndex:j,updateId:V},w.state)));else if(T.activeTooltipIndex!==void 0){var K=T.chartX,H=T.chartY,z=T.activeTooltipIndex,Y=w.state,G=Y.offset,J=Y.tooltipTicks;if(!G)return;if(typeof N=="function")z=N(J,T);else if(N==="value"){z=-1;for(var lt=0;lt<J.length;lt++)if(J[lt].value===T.activeLabel){z=lt;break}}var q=ut(ut({},G),{},{x:G.left,y:G.top}),nt=Math.min(K,q.x+q.width),it=Math.min(H,q.y+q.height),at=J[z]&&J[z].value,ct=rb(w.state,w.props.data,z),gt=J[z]?{x:R==="horizontal"?J[z].coordinate:nt,y:R==="horizontal"?it:J[z].coordinate}:L$;w.setState(ut(ut({},T),{},{activeLabel:at,activeCoordinate:gt,activePayload:ct,activeTooltipIndex:z}))}else w.setState(T)}),Ft(w,"renderCursor",function(T){var O,R=w.state,N=R.isTooltipActive,V=R.activeCoordinate,D=R.activePayload,j=R.offset,K=R.activeTooltipIndex,H=R.tooltipAxisBandSize,z=w.getTooltipEventType(),Y=(O=T.props.active)!==null&&O!==void 0?O:N,G=w.props.layout,J=T.key||"_recharts-cursor";return v.createElement(klt,{key:J,activeCoordinate:V,activePayload:D,activeTooltipIndex:K,chartName:n,element:T,isActive:Y,layout:G,offset:j,tooltipAxisBandSize:H,tooltipEventType:z})}),Ft(w,"renderPolarAxis",function(T,O,R){var N=_r(T,"type.axisType"),V=_r(w.state,"".concat(N,"Map")),D=T.type.defaultProps,j=D!==void 0?ut(ut({},D),T.props):T.props,K=V&&V[j["".concat(N,"Id")]];return v.cloneElement(T,ut(ut({},K),{},{className:Jt(N,K.className),key:T.key||"".concat(O,"-").concat(R),ticks:so(K,!0)}))}),Ft(w,"renderPolarGrid",function(T){var O=T.props,R=O.radialLines,N=O.polarAngles,V=O.polarRadius,D=w.state,j=D.radiusAxisMap,K=D.angleAxisMap,H=Uo(j),z=Uo(K),Y=z.cx,G=z.cy,J=z.innerRadius,lt=z.outerRadius;return v.cloneElement(T,{polarAngles:Array.isArray(N)?N:so(z,!0).map(function(q){return q.coordinate}),polarRadius:Array.isArray(V)?V:so(H,!0).map(function(q){return q.coordinate}),cx:Y,cy:G,innerRadius:J,outerRadius:lt,key:T.key||"polar-grid",radialLines:R})}),Ft(w,"renderLegend",function(){var T=w.state.formattedGraphicalItems,O=w.props,R=O.children,N=O.width,V=O.height,D=w.props.margin||{},j=N-(D.left||0)-(D.right||0),K=ak({children:R,formattedGraphicalItems:T,legendWidth:j,legendContent:h});if(!K)return null;var H=K.item,z=eT(K,$lt);return v.cloneElement(H,ut(ut({},z),{},{chartWidth:N,chartHeight:V,margin:D,onBBoxUpdate:w.handleLegendBBoxUpdate}))}),Ft(w,"renderTooltip",function(){var T,O=w.props,R=O.children,N=O.accessibilityLayer,V=vr(R,br);if(!V)return null;var D=w.state,j=D.isTooltipActive,K=D.activeCoordinate,H=D.activePayload,z=D.activeLabel,Y=D.offset,G=(T=V.props.active)!==null&&T!==void 0?T:j;return v.cloneElement(V,{viewBox:ut(ut({},Y),{},{x:Y.left,y:Y.top}),active:G,label:z,payload:G?H:[],coordinate:K,accessibilityLayer:N})}),Ft(w,"renderBrush",function(T){var O=w.props,R=O.margin,N=O.data,V=w.state,D=V.offset,j=V.dataStartIndex,K=V.dataEndIndex,H=V.updateId;return v.cloneElement(T,{key:T.key||"_recharts-brush",onChange:Af(w.handleBrushChange,T.props.onChange),data:N,x:xt(T.props.x)?T.props.x:D.left,y:xt(T.props.y)?T.props.y:D.top+D.height+D.brushBottom-(R.bottom||0),width:xt(T.props.width)?T.props.width:D.width,startIndex:j,endIndex:K,updateId:"brush-".concat(H)})}),Ft(w,"renderReferenceElement",function(T,O,R){if(!T)return null;var N=w,V=N.clipPathId,D=w.state,j=D.xAxisMap,K=D.yAxisMap,H=D.offset,z=T.type.defaultProps||{},Y=T.props,G=Y.xAxisId,J=G===void 0?z.xAxisId:G,lt=Y.yAxisId,q=lt===void 0?z.yAxisId:lt;return v.cloneElement(T,{key:T.key||"".concat(O,"-").concat(R),xAxis:j[J],yAxis:K[q],viewBox:{x:H.left,y:H.top,width:H.width,height:H.height},clipPathId:V})}),Ft(w,"renderActivePoints",function(T){var O=T.item,R=T.activePoint,N=T.basePoint,V=T.childIndex,D=T.isRange,j=[],K=O.props.key,H=O.item.type.defaultProps!==void 0?ut(ut({},O.item.type.defaultProps),O.item.props):O.item.props,z=H.activeDot,Y=H.dataKey,G=ut(ut({index:V,dataKey:Y,cx:R.x,cy:R.y,r:4,fill:lx(O.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},Lt(z,!1)),rd(z));return j.push(P.renderActiveDot(z,G,"".concat(K,"-activePoint-").concat(V))),N?j.push(P.renderActiveDot(z,ut(ut({},G),{},{cx:N.x,cy:N.y}),"".concat(K,"-basePoint-").concat(V))):D&&j.push(null),j}),Ft(w,"renderGraphicChild",function(T,O,R){var N=w.filterFormatItem(T,O,R);if(!N)return null;var V=w.getTooltipEventType(),D=w.state,j=D.isTooltipActive,K=D.tooltipAxis,H=D.activeTooltipIndex,z=D.activeLabel,Y=w.props.children,G=vr(Y,br),J=N.props,lt=J.points,q=J.isRange,nt=J.baseLine,it=N.item.type.defaultProps!==void 0?ut(ut({},N.item.type.defaultProps),N.item.props):N.item.props,at=it.activeDot,ct=it.hide,gt=it.activeBar,yt=it.activeShape,Et=!!(!ct&&j&&G&&(at||gt||yt)),Tt={};V!=="axis"&&G&&G.props.trigger==="click"?Tt={onClick:Af(w.handleItemMouseEnter,T.props.onClick)}:V!=="axis"&&(Tt={onMouseLeave:Af(w.handleItemMouseLeave,T.props.onMouseLeave),onMouseEnter:Af(w.handleItemMouseEnter,T.props.onMouseEnter)});var ht=v.cloneElement(T,ut(ut({},N.props),Tt));function ft(Ht){return typeof K.dataKey=="function"?K.dataKey(Ht.payload):null}if(Et)if(H>=0){var Ct,rt;if(K.dataKey&&!K.allowDuplicatedCategory){var Rt=typeof K.dataKey=="function"?ft:"payload.".concat(K.dataKey.toString());Ct=nd(lt,Rt,z),rt=q&&nt&&nd(nt,Rt,z)}else Ct=lt==null?void 0:lt[H],rt=q&&nt&&nt[H];if(yt||gt){var bt=T.props.activeIndex!==void 0?T.props.activeIndex:H;return[v.cloneElement(T,ut(ut(ut({},N.props),Tt),{},{activeIndex:bt})),null,null]}if(!Ut(Ct))return[ht].concat(ql(w.renderActivePoints({item:N,activePoint:Ct,basePoint:rt,childIndex:H,isRange:q})))}else{var de,ne=(de=w.getItemByXY(w.state.activeCoordinate))!==null&&de!==void 0?de:{graphicalItem:ht},Gt=ne.graphicalItem,Le=Gt.item,Bt=Le===void 0?T:Le,Qt=Gt.childIndex,te=ut(ut(ut({},N.props),Tt),{},{activeIndex:Qt});return[v.cloneElement(Bt,te),null,null]}return q?[ht,null,null]:[ht,null]}),Ft(w,"renderCustomized",function(T,O,R){return v.cloneElement(T,ut(ut({key:"recharts-customized-".concat(R)},w.props),w.state))}),Ft(w,"renderMap",{CartesianGrid:{handler:kf,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:kf},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:kf},YAxis:{handler:kf},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((A=S.id)!==null&&A!==void 0?A:wa("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=aM(w.triggeredAfterMouseMove,(E=S.throttleDelay)!==null&&E!==void 0?E:1e3/60),w.state={},w}return Ult(P,b),zlt(P,[{key:"componentDidMount",value:function(){var A,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var A=this.props,E=A.children,w=A.data,T=A.height,O=A.layout,R=vr(E,br);if(R){var N=R.props.defaultIndex;if(!(typeof N!="number"||N<0||N>this.state.tooltipTicks.length-1)){var V=this.state.tooltipTicks[N]&&this.state.tooltipTicks[N].value,D=rb(this.state,w,N,V),j=this.state.tooltipTicks[N].coordinate,K=(this.state.offset.top+T)/2,H=O==="horizontal",z=H?{x:j,y:K}:{y:j,x:K},Y=this.state.formattedGraphicalItems.find(function(J){var lt=J.item;return lt.type.name==="Scatter"});Y&&(z=ut(ut({},z),Y.props.points[N].tooltipPosition),D=Y.props.points[N].tooltipPayload);var G={activeTooltipIndex:N,isTooltipActive:!0,activeLabel:V,activePayload:D,activeCoordinate:z};this.setState(G),this.renderCursor(R),this.accessibilityManager.setIndex(N)}}}},{key:"getSnapshotBeforeUpdate",value:function(A,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==A.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==A.margin){var w,T;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0}})}return null}},{key:"componentDidUpdate",value:function(A){My([vr(A.children,br)],[vr(this.props.children,br)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var A=vr(this.props.children,br);if(A&&typeof A.props.shared=="boolean"){var E=A.props.shared?"axis":"item";return l.indexOf(E)>=0?E:o}return o}},{key:"getMouseInfo",value:function(A){if(!this.container)return null;var E=this.container,w=E.getBoundingClientRect(),T=wZ(w),O={chartX:Math.round(A.pageX-T.left),chartY:Math.round(A.pageY-T.top)},R=w.width/E.offsetWidth||1,N=this.inRange(O.chartX,O.chartY,R);if(!N)return null;var V=this.state,D=V.xAxisMap,j=V.yAxisMap,K=this.getTooltipEventType(),H=rT(this.state,this.props.data,this.props.layout,N);if(K!=="axis"&&D&&j){var z=Uo(D).scale,Y=Uo(j).scale,G=z&&z.invert?z.invert(O.chartX):null,J=Y&&Y.invert?Y.invert(O.chartY):null;return ut(ut({},O),{},{xValue:G,yValue:J},H)}return H?ut(ut({},O),H):null}},{key:"inRange",value:function(A,E){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=this.props.layout,O=A/w,R=E/w;if(T==="horizontal"||T==="vertical"){var N=this.state.offset,V=O>=N.left&&O<=N.left+N.width&&R>=N.top&&R<=N.top+N.height;return V?{x:O,y:R}:null}var D=this.state,j=D.angleAxisMap,K=D.radiusAxisMap;if(j&&K){var H=Uo(j);return wP({x:O,y:R},H)}return null}},{key:"parseEventsOfWrapper",value:function(){var A=this.props.children,E=this.getTooltipEventType(),w=vr(A,br),T={};w&&E==="axis"&&(w.props.trigger==="click"?T={onClick:this.handleClick}:T={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=rd(this.props,this.handleOuterEvent);return ut(ut({},O),T)}},{key:"addListener",value:function(){Wg.on(Vg,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Wg.removeListener(Vg,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(A,E,w){for(var T=this.state.formattedGraphicalItems,O=0,R=T.length;O<R;O++){var N=T[O];if(N.item===A||N.props.key===A.key||E===lo(N.item.type)&&w===N.childIndex)return N}return null}},{key:"renderClipPath",value:function(){var A=this.clipPathId,E=this.state.offset,w=E.left,T=E.top,O=E.height,R=E.width;return v.createElement("defs",null,v.createElement("clipPath",{id:A},v.createElement("rect",{x:w,y:T,height:O,width:R})))}},{key:"getXScales",value:function(){var A=this.state.xAxisMap;return A?Object.entries(A).reduce(function(E,w){var T=tT(w,2),O=T[0],R=T[1];return ut(ut({},E),{},Ft({},O,R.scale))},{}):null}},{key:"getYScales",value:function(){var A=this.state.yAxisMap;return A?Object.entries(A).reduce(function(E,w){var T=tT(w,2),O=T[0],R=T[1];return ut(ut({},E),{},Ft({},O,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(A){var E;return(E=this.state.xAxisMap)===null||E===void 0||(E=E[A])===null||E===void 0?void 0:E.scale}},{key:"getYScaleByAxisId",value:function(A){var E;return(E=this.state.yAxisMap)===null||E===void 0||(E=E[A])===null||E===void 0?void 0:E.scale}},{key:"getItemByXY",value:function(A){var E=this.state,w=E.formattedGraphicalItems,T=E.activeItem;if(w&&w.length)for(var O=0,R=w.length;O<R;O++){var N=w[O],V=N.props,D=N.item,j=D.type.defaultProps!==void 0?ut(ut({},D.type.defaultProps),D.props):D.props,K=lo(D.type);if(K==="Bar"){var H=(V.data||[]).find(function(J){return pnt(A,J)});if(H)return{graphicalItem:N,payload:H}}else if(K==="RadialBar"){var z=(V.data||[]).find(function(J){return wP(A,J)});if(z)return{graphicalItem:N,payload:z}}else if(sm(N,T)||am(N,T)||ih(N,T)){var Y=nit({graphicalItem:N,activeTooltipItem:T,itemData:j.data}),G=j.activeIndex===void 0?Y:j.activeIndex;return{graphicalItem:ut(ut({},N),{},{childIndex:G}),payload:ih(N,T)?j.data[Y]:N.props.data[Y]}}}return null}},{key:"render",value:function(){var A=this;if(!f1(this))return null;var E=this.props,w=E.children,T=E.className,O=E.width,R=E.height,N=E.style,V=E.compact,D=E.title,j=E.desc,K=eT(E,Ilt),H=Lt(K,!1);if(V)return v.createElement(LA,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},v.createElement($y,il({},H,{width:O,height:R,title:D,desc:j}),this.renderClipPath(),p1(w,this.renderMap)));if(this.props.accessibilityLayer){var z,Y;H.tabIndex=(z=this.props.tabIndex)!==null&&z!==void 0?z:0,H.role=(Y=this.props.role)!==null&&Y!==void 0?Y:"application",H.onKeyDown=function(J){A.accessibilityManager.keyboardEvent(J)},H.onFocus=function(){A.accessibilityManager.focus()}}var G=this.parseEventsOfWrapper();return v.createElement(LA,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},v.createElement("div",il({className:Jt("recharts-wrapper",T),style:ut({position:"relative",cursor:"default",width:O,height:R},N)},G,{ref:function(lt){A.container=lt}}),v.createElement($y,il({},H,{width:O,height:R,title:D,desc:j,style:Klt}),this.renderClipPath(),p1(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(v.Component);Ft(x,"displayName",n),Ft(x,"defaultProps",ut({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Ft(x,"getDerivedStateFromProps",function(b,P){var S=b.dataKey,A=b.data,E=b.children,w=b.width,T=b.height,O=b.layout,R=b.stackOffset,N=b.margin,V=P.dataStartIndex,D=P.dataEndIndex;if(P.updateId===void 0){var j=iT(b);return ut(ut(ut({},j),{},{updateId:0},y(ut(ut({props:b},j),{},{updateId:0}),P)),{},{prevDataKey:S,prevData:A,prevWidth:w,prevHeight:T,prevLayout:O,prevStackOffset:R,prevMargin:N,prevChildren:E})}if(S!==P.prevDataKey||A!==P.prevData||w!==P.prevWidth||T!==P.prevHeight||O!==P.prevLayout||R!==P.prevStackOffset||!ll(N,P.prevMargin)){var K=iT(b),H={chartX:P.chartX,chartY:P.chartY,isTooltipActive:P.isTooltipActive},z=ut(ut({},rT(P,A,O)),{},{updateId:P.updateId+1}),Y=ut(ut(ut({},K),H),z);return ut(ut(ut({},Y),y(ut({props:b},Y),P)),{},{prevDataKey:S,prevData:A,prevWidth:w,prevHeight:T,prevLayout:O,prevStackOffset:R,prevMargin:N,prevChildren:E})}if(!My(E,P.prevChildren)){var G,J,lt,q,nt=vr(E,Il),it=nt&&(G=(J=nt.props)===null||J===void 0?void 0:J.startIndex)!==null&&G!==void 0?G:V,at=nt&&(lt=(q=nt.props)===null||q===void 0?void 0:q.endIndex)!==null&&lt!==void 0?lt:D,ct=it!==V||at!==D,gt=!Ut(A),yt=gt&&!ct?P.updateId:P.updateId+1;return ut(ut({updateId:yt},y(ut(ut({props:b},P),{},{updateId:yt,dataStartIndex:it,dataEndIndex:at}),P)),{},{prevChildren:E,dataStartIndex:it,dataEndIndex:at})}return null}),Ft(x,"renderActiveDot",function(b,P,S){var A;return v.isValidElement(b)?A=v.cloneElement(b,P):Vt(b)?A=b(P):A=v.createElement(em,P),v.createElement(ue,{className:"recharts-active-dot",key:S},A)});var p=v.forwardRef(function(P,S){return v.createElement(x,il({},P,{ref:S}))});return p.displayName=x.displayName,p},sct=mm({chartName:"BarChart",GraphicalChild:Aa,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ds},{axisType:"yAxis",AxisComp:ps}],formatAxisMap:hx}),act=mm({chartName:"PieChart",GraphicalChild:wo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:om},{axisType:"radiusAxis",AxisComp:rm}],formatAxisMap:yQ,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),lct=mm({chartName:"ScatterChart",GraphicalChild:Th,defaultTooltipEventType:"item",validateTooltipEventTypes:["item"],axisComponents:[{axisType:"xAxis",AxisComp:ds},{axisType:"yAxis",AxisComp:ps},{axisType:"zAxis",AxisComp:Ah}],formatAxisMap:hx}),cct=mm({chartName:"AreaChart",GraphicalChild:fs,axisComponents:[{axisType:"xAxis",AxisComp:ds},{axisType:"yAxis",AxisComp:ps}],formatAxisMap:hx});const uct=()=>{try{if(typeof window<"u")return window.localStorage.getItem("backflow_dev_diagnostics")==="1"}catch{}return!1},up=(...e)=>{uct()&&console.warn(...e)};function hct(e,t,n){var s,l;const r=t.expression?((s=e.evaluateExpression)==null?void 0:s.call(e,t.expression,t.expressionUrl,n,t.expressionKey))??e.interpolateText(t.expression):e.interpolateText(t.text||"");if(t.className){const c=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const u=a0(t.className);if(u.size>0){const m=zt(u,e.containerWidth,"1rem");c.fontSize=m}const f=tc(t.className);f.size>0&&(c.display=zt(f,e.containerWidth,"block"))}const h=e.getCommonProps(n,c,t);return U("p",{key:n,className:t.className,...h},r)}const i={};t.fontSize!==void 0&&(i.fontSize=`${t.fontSize}px`),t.fontWeight!==void 0&&(i.fontWeight=t.fontWeight),t.color!==void 0&&(i.color=t.color),t.textAlign!==void 0&&(i.textAlign=t.textAlign);const o=e.getCommonProps(n,i,t);return U("p",{key:n,...o},r)}function fct(e){return e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<iframe[\s\S]*?<\/iframe>/gi,"").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"")}function dct(e,t,n){const r=String(e.apiUrl||"").replace(/\/$/,""),i=e.interpolateText(t.text||t.html||"").replace(/(src|href)=("|')\/(?!\/)/g,r?`$1=$2${r}/`:"$1=$2/"),o=e.getCommonProps(n,{color:e.cfg.colors.text},t);return U("div",{key:n,className:t.className,...o,dangerouslySetInnerHTML:{__html:fct(i)}})}function pct(e,t,n){var l,c,h,u,f;const r=()=>{t.onClick?e.handleButtonClick(t.onClick,{onSuccess:t.onSuccess,onError:t.onError},{optimistic:t.optimistic,feedback:t.feedback}):t.href&&(t.href.startsWith("http")||e.previewMode?window.open(t.href,"_blank","noopener,noreferrer"):window.location.href=t.href)},i=()=>{var m;if(!e.interactionDisabled){if((m=t.confirmation)!=null&&m.enabled){(e.setOverlayModal||e.setActiveModal)({id:"__confirm",definition:{title:t.confirmation.title||"Confirm Action",size:"sm",components:[{type:"text",text:t.confirmation.message||"Are you sure you want to proceed?",color:e.cfg.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.6)",fontSize:14}],actions:[{label:"Cancel",variant:"ghost",dismiss:!0},{label:"Confirm",variant:"primary",dismiss:!0}]},legacyOnConfirm:()=>{r()}});return}r()}};if(t.className){const m=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const x=tc(t.className);x.size>0&&(m.display=zt(x,e.containerWidth,"inline"));const p=a0(t.className);if(p.size>0){const b=zt(p,e.containerWidth,"1rem");m.fontSize=b}}t.icon&&(m.display="inline-flex",m.alignItems="center",m.gap=6);const y=e.getCommonProps(n,m,t);return U("a",{key:n,className:t.className,...y,onClick:e.interactionDisabled?void 0:i,href:e.interactionDisabled?void 0:t.href&&!t.onClick?t.href:void 0,target:(c=t.href)!=null&&c.startsWith("http")?"_blank":void 0,rel:(h=t.href)!=null&&h.startsWith("http")?"noopener noreferrer":void 0},t.icon?e.renderIcon(t.icon,16):null,e.interpolateText(t.text||t.label||""))}const o={cursor:"pointer",textDecoration:"none",transition:"all 0.2s",display:"inline-flex",alignItems:"center",gap:6},s=e.getCommonProps(n,o,t);return U("a",{key:n,...s,onClick:e.interactionDisabled?void 0:i,href:e.interactionDisabled?void 0:t.href&&!t.onClick?t.href:void 0,target:(u=t.href)!=null&&u.startsWith("http")?"_blank":void 0,rel:(f=t.href)!=null&&f.startsWith("http")?"noopener noreferrer":void 0},t.icon?e.renderIcon(t.icon,16):null,e.interpolateText(t.text||t.label||""))}function mct(e,t,n){var x,p,b,P,S;let r=!1;if(t.activeWhen){if(t.activeWhen===e.currentSceneId)r=!0;else if(typeof t.activeWhen=="string"){const A=t.activeWhen.split("=",2);A.length===2&&(r=String(((x=e.sceneData)==null?void 0:x[A[0]])??"")===A[1])}}const i=r?{onClick:t.activeOnClick||t.onClick,onSuccess:t.activeOnSuccess||t.onSuccess,onError:t.activeOnError||t.onError,icon:t.activeIcon||t.icon,text:t.activeText||t.text,label:t.activeText||t.label}:{onClick:t.onClick,onSuccess:t.onSuccess,onError:t.onError,icon:t.icon,text:t.text,label:t.label},o=t.disabled?((p=e.evaluateCondition)==null?void 0:p.call(e,t.disabled))??!1:!1,s=A=>{const E=()=>e.handleButtonClick(i.onClick||"",{onSuccess:i.onSuccess,onError:i.onError},{optimistic:t.optimistic,feedback:t.feedback,payload:t.payload,refetchScope:t.refetchScope,mergeResponse:t.mergeResponse,anchorElement:A==null?void 0:A.currentTarget,openUrl:t.openUrl});(e.withLoading?e.withLoading(n,E):E()).catch(T=>{var R,N;const O=((R=t.onError)==null?void 0:R.message)||(T==null?void 0:T.message)||"An error occurred";(N=e.showToast)==null||N.call(e,O,"error")})},l=A=>{var E;if((E=t.confirmation)!=null&&E.enabled){(e.setOverlayModal||e.setActiveModal)({id:"__confirm",definition:{title:t.confirmation.title||"Confirm Action",size:"sm",components:[{type:"text",text:t.confirmation.message||"Are you sure you want to proceed?",color:e.cfg.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.6)",fontSize:16}],actions:[{label:"Cancel",variant:"ghost",dismiss:!0},{label:"Confirm",variant:"primary",dismiss:!0}]},legacyOnConfirm:()=>{s(A)}});return}s(A)},c=(b=e.buttonLoading)==null?void 0:b[n];if(t.className){let A=((P=e.parseClassNameResponsive)==null?void 0:P.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const D=tc(t.className);D.size>0&&(A.display=zt(D,e.containerWidth,"inline-flex"));const j=a0(t.className);j.size>0&&(A.fontSize=zt(j,e.containerWidth,"1rem"))}let E=t.className;if(r&&t.activeClass){const D=((S=e.parseClassNameResponsive)==null?void 0:S.call(e,t.activeClass,n))??e.parseClassName(t.activeClass);A={...A,...D},E=`${t.className} ${t.activeClass}`}const w={display:"inline-flex",alignItems:"center",justifyContent:A.textAlign==="left"?"flex-start":A.textAlign==="right"?"flex-end":"center",gap:"6px",...A,...t.color&&{color:t.color},...t.background&&{background:t.background},...t.borderRadius!==void 0&&{borderRadius:typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius},...t.borderColor&&{borderColor:t.borderColor},...c&&{opacity:.6,pointerEvents:"none"}},T={},O=(t.className||"").split(/\s+/).filter(Boolean);for(const D of O)if(D.startsWith("hover:")){const j=D.replace("hover:","");if(j.startsWith("bg-")||j.startsWith("text-")||j.startsWith("border-")){const K=e.parseClassName(j);Object.assign(T,K)}}const R=e.getCommonProps(n,w,t),N=[];i.icon&&!c&&N.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i.text?{marginRight:"6px"}:{}}},e.renderIcon(i.icon,t.iconSize||16))),c&&N.unshift(U("div",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})),Array.isArray(t.children)&&t.children.length>0?t.children.forEach((D,j)=>{N.push(e.renderComponent(D,j,n))}):N.push(i.label||i.text||(i.icon?"":"Button"));const V={};return Object.keys(T).length>0&&(V.onMouseEnter=D=>{T.backgroundColor&&(D.currentTarget.style.backgroundColor=T.backgroundColor),T.color&&(D.currentTarget.style.color=T.color),T.borderColor&&(D.currentTarget.style.borderColor=T.borderColor)},V.onMouseLeave=D=>{T.backgroundColor&&(D.currentTarget.style.backgroundColor=w.backgroundColor||""),T.color&&(D.currentTarget.style.color=w.color||""),T.borderColor&&(D.currentTarget.style.borderColor=w.borderColor||"")}),U("button",{key:n,className:E,title:e.interpolateText(t.tooltip||t.ariaLabel||i.label||i.text||"Button"),...R,...V,onClick:e.interactionDisabled?void 0:l,disabled:c||o||void 0},...N)}const h=e.cfg.colors.primary,u=e.cfg.colors.accent,f={display:"inline-flex",alignItems:"center",gap:"6px",padding:"0.75rem 1.5rem",borderRadius:"0.75rem",fontWeight:600,transition:e.cfg.effects.transition,color:e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.text,background:r?e.cfg.colors.primary:`linear-gradient(to right, ${h}, ${u})`,boxShadow:r?"none":`0 10px 15px -3px ${h}40`,...c&&{opacity:.6,pointerEvents:"none"}},m=e.getCommonProps(n,f,t),y=[];return c&&y.push(U("div",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})),i.icon&&!c&&y.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(i.icon,t.iconSize||16))),y.push(i.label||i.text||(i.icon?"":"Button")),U("button",{key:n,title:e.interpolateText(t.tooltip||t.ariaLabel||i.label||i.text||"Button"),...m,onClick:e.interactionDisabled?void 0:l,disabled:c||o||void 0},...y)}function gct(e,t,n){var h;const r=e.interpolateText(t.src||""),i=!r||r==="placeholder",o=e.imageErrors[n];if(t.skipEmpty&&i)return null;const s={border:`1px dashed ${e.cfg.colors.borderSubtle}`,display:"flex",alignItems:"center",justifyContent:"center",padding:10,height:"200px",borderRadius:"0.75rem"};if(i){const u=e.getCommonProps(n,s,t);return U("div",{key:n,...u},U("span",{style:{color:e.cfg.colors.textPlaceholder,fontSize:"0.875rem"}},"Image"))}if(o)return null;if(t.className){const u=((h=e.parseClassNameResponsive)==null?void 0:h.call(e,t.className,n))??e.parseClassName(t.className),f=e.getCommonProps(n,u,t),m={key:`${n}-${r}`,src:r,alt:t.alt||"",className:t.className,...f,onError:()=>e.setImageErrors(y=>({...y,[n]:!0}))};return t.onClick&&!e.interactionDisabled&&(m.onClick=()=>e.handleButtonClick(t.onClick)),U("img",m)}const l={width:t.w||t.width||"100%",height:t.h||t.height||"auto",objectFit:"cover",borderRadius:"0.75rem"};t.onClick&&(l.cursor="pointer");const c={key:`${n}-${r}`,src:r,alt:t.alt||"",...e.getCommonProps(n,l,t),onError:()=>e.setImageErrors(u=>({...u,[n]:!0}))};return t.onClick&&!e.interactionDisabled&&(c.onClick=()=>e.handleButtonClick(t.onClick)),U("img",c)}function yct(e,t,n){var o;if(t.className){const s=((o=e.parseClassNameResponsive)==null?void 0:o.call(e,t.className,n))??e.parseClassName(t.className),l=e.getCommonProps(n,s,t);return U("input",{key:n,className:t.className,...l,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",value:e.sceneData[t.name||""]??"",style:{colorScheme:e.cfg.colorMode==="light"?"light":"dark"},onClick:t.openPickerOnClick?c=>{var h,u;return(u=(h=c.currentTarget).showPicker)==null?void 0:u.call(h)}:void 0,onChange:c=>e.setSceneData(h=>({...h,[t.name||""]:c.target.value})),onKeyDown:t.onKeyDown?c=>{c.key==="Enter"&&e.handleButtonClick(t.onKeyDown)}:void 0})}const r={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition},i=e.getCommonProps(n,r,t);if(t.label){const s=e.getCommonProps(n,{width:"100%"},t);return U("div",{key:n,...s},U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("input",{...i,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",value:e.sceneData[t.name||""]??"",onChange:l=>e.setSceneData(c=>({...c,[t.name||""]:l.target.value}))}))}return U("input",{key:n,...i,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",value:e.sceneData[t.name||""]??"",onChange:s=>e.setSceneData(l=>({...l,[t.name||""]:s.target.value}))})}function vct(e,t,n){const r=t.value?e.interpolateText(String(t.value)):e.sceneData[t.name||""]??"";return U("input",{key:n,type:"hidden",name:t.name,value:r})}function bct(e,t,n){var s;const r=()=>{var l;return[t.placeholder&&U("option",{key:"__placeholder",value:""},t.placeholder),...((l=t.options)==null?void 0:l.map(c=>U("option",{key:c.value,value:c.value},c.label)))||[]]};if(t.className){const l=((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className),c=e.getCommonProps(n,l,t);return U("select",{key:n,className:t.className,...c,name:t.name,value:e.sceneData[t.name||""]??"",onChange:h=>e.setSceneData(u=>({...u,[t.name||""]:h.target.value}))},...r())}const i={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition,cursor:"pointer",appearance:"none"},o=e.getCommonProps(n,i,t);if(t.label){const l=e.getCommonProps(n,{width:"100%"},t);return U("div",{key:n,...l},U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("select",{...o,name:t.name,value:e.sceneData[t.name||""]??"",onChange:c=>e.setSceneData(h=>({...h,[t.name||""]:c.target.value}))},...r()))}return U("select",{key:n,...o,name:t.name,value:e.sceneData[t.name||""]??"",onChange:l=>e.setSceneData(c=>({...c,[t.name||""]:l.target.value}))},...r())}function xct(e,t,n){const r=t.className||"flex items-center gap-3 cursor-pointer text-white",i=e.parseClassName(r),o="w-5 h-5 rounded border-gray-600 bg-gray-800 accent-primary",s=e.parseClassName(o),l=e.getCommonProps(n,i,t);return U("label",{key:n,className:r,...l},U("input",{type:"checkbox",className:o,style:s,checked:e.sceneData[t.name||""]||!1,onChange:c=>e.setSceneData(h=>({...h,[t.name||""]:c.target.checked}))}),U("span",{},t.label||""))}function wct(e,t,n){const r={green:{bg:"#065f4620",color:"#22c55e",border:"#22c55e40"},blue:{bg:"#1e40af20",color:"#3b82f6",border:"#3b82f640"},red:{bg:"#7f1d1d20",color:"#ef4444",border:"#ef444440"},yellow:{bg:"#71370220",color:"#eab308",border:"#eab30840"},purple:{bg:"#581c8720",color:"#a855f7",border:"#a855f740"},orange:{bg:"#7c2d1220",color:"#f97316",border:"#f9731640"},gray:{bg:"#37415120",color:"#9ca3af",border:"#9ca3af40"},cyan:{bg:"#0e727020",color:"#06b6d4",border:"#06b6d440"},pink:{bg:"#83184420",color:"#ec4899",border:"#ec489940"}};let o=t.colorScheme||"gray";if(t.colorBy&&typeof t.colorBy=="object"){const u=(e.interpolateText(t.text||t.label||"")||"").trim().toLowerCase();t.colorBy[u]&&(o=t.colorBy[u])}const s=r[o]||r.gray,l=t.variant||"subtle";let c={display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:600,letterSpacing:"0.025em",textTransform:"uppercase",whiteSpace:"nowrap"};l==="solid"?(c.backgroundColor=s.color,c.color="#fff"):l==="outline"?(c.backgroundColor="transparent",c.color=s.color,c.border=`1px solid ${s.border||s.color}`):(c.backgroundColor=s.bg,c.color=s.color,t.bordered&&(c.border=`1px solid ${s.border||s.color}`)),t.pill&&(c.borderRadius="9999px"),t.className&&(c={...c,...e.parseClassName(t.className)});const h=e.getCommonProps(n,c,t);return U("span",{key:n,...h},e.interpolateText(t.text||t.label||""))}function _ct(e,t,n){const r={display:"inline-flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"9999px",fontSize:"12px",fontWeight:500,backgroundColor:t.bg||e.cfg.colors.surfaceHover,color:t.color||e.cfg.colors.textSecondary,...t.className?e.parseClassName(t.className):{}},i=e.getCommonProps(n,r,t);return U("span",{key:n,...i},e.interpolateText(t.text||t.label||""))}function Sct(e,t,n){const i={sm:32,md:40,lg:48,xl:64}[t.size||"md"]||40,o=i*.4;if(t.src){const h={width:`${i}px`,height:`${i}px`,borderRadius:"50%",objectFit:"cover",...t.className?e.parseClassName(t.className):{}},u=e.getCommonProps(n,h,t);return U("img",{key:n,src:t.src,alt:t.alt||t.label||"",...u})}const s=t.initials||(t.label||t.text||"").split(" ").map(h=>h[0]).join("").slice(0,2).toUpperCase()||"?",l={width:`${i}px`,height:`${i}px`,borderRadius:"50%",backgroundColor:t.bg||e.cfg.colors.primary,color:t.color||e.cfg.colors.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${o}px`,fontWeight:600,flexShrink:0,...t.className?e.parseClassName(t.className):{}},c=e.getCommonProps(n,l,t);return U("div",{key:n,...c},s)}function Pct(e,t,n){const r=t.progressValue??t.value??0,i=t.progressMax??100,o=(y,x)=>{if(typeof y=="string")return Number(e.interpolateText(y))||x;const p=Number(y);return Number.isFinite(p)?p:x},s=o(r,0),l=o(i,100),c=Math.min(100,Math.max(0,s/l*100)),u=s>l?e.cfg.colors.danger:t.color||e.cfg.colors.primary,f={width:"100%",display:"flex",flexDirection:"column",gap:"4px",...t.className?e.parseClassName(t.className):{}},m=e.getCommonProps(n,f,t);return U("div",{key:n,...m},(t.progressLabel||t.label)&&v.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:e.cfg.colors.textMuted}},U("span",null,e.interpolateText(t.progressLabel||t.label||"")),U("span",null,`${s}/${l}`)),v.createElement("div",{style:{width:"100%",height:"8px",backgroundColor:e.cfg.colors.surfaceHover,borderRadius:"4px",overflow:"hidden"}},U("div",{style:{width:`${Math.min(c,100)}%`,height:"100%",backgroundColor:u,borderRadius:"4px",transition:"width 0.3s ease"}})))}function Act(e,t,n){const r={position:"relative",width:"100%",...t.className?e.parseClassName(t.className):{}},i=e.getCommonProps(n,r,t);return U("div",{key:n,...i},U("span",{style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:e.cfg.colors.textPlaceholder,fontSize:"14px",pointerEvents:"none"}},e.renderIcon("search",14)),U("input",{type:"text",name:t.name||"search",placeholder:t.placeholder||"Search...",value:e.sceneData[t.name||"search"]??"",onChange:o=>{e.setSceneData(s=>({...s,[t.name||"search"]:o.target.value}))},style:{width:"100%",padding:"8px 12px 8px 36px",borderRadius:e.cfg.layout.borderRadius,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",fontSize:e.cfg.typography.baseFontSize,transition:e.cfg.effects.transition}}))}function Tct(e,t,n){const r=Array.isArray(t.breadcrumbItems)?t.breadcrumbItems:[],i={display:"flex",alignItems:"center",gap:"4px",fontSize:"14px",...t.className?e.parseClassName(t.className):{}},o=e.getCommonProps(n,i,t);return U("nav",{key:n,...o,"aria-label":"Breadcrumb"},r.map((s,l)=>{const c=l===r.length-1,h=e.interpolateText(s.label);return v.createElement(v.Fragment,{key:`${n}-bc-${l}`},v.createElement(c?"span":"a",{style:{color:c?e.cfg.colors.textSecondary:e.cfg.colors.textMuted,fontWeight:c?600:400,cursor:c?"default":"pointer",textDecoration:"none",transition:e.cfg.effects.transition},...!c&&s.href?{href:s.href}:{},...!c&&s.onClick?{onClick:()=>e.handleButtonClick(s.onClick,{})}:{}},h),!c&&U("span",{style:{color:e.cfg.colors.border,margin:"0 2px"}},"/"))}))}function Ect(e,t,n){const r=Array.isArray(t.items)?t.items:[],[i,o]=v.useState(0),s=t.autoplay!==!1&&r.length>1,l=t.interval||4e3,c=t.effect==="fade"?"fade":"slide";v.useEffect(()=>{if(!s||r.length<2)return;const S=setInterval(()=>o(A=>(A+1)%r.length),l);return()=>clearInterval(S)},[s,l,r.length]);const h=S=>o((S%r.length+r.length)%r.length),u=t.showArrows!==!1&&r.length>1,f=t.showDots!==!1&&r.length>1,m={position:"relative",overflow:"hidden",...t.className?e.parseClassName(t.className):{}};t.aspectRatio&&(m.aspectRatio=t.aspectRatio),!t.aspectRatio&&!t.height&&(m.height="320px");const y=e.getCommonProps(n,m,t),x=S=>typeof S=="string"?{type:"text",text:S}:S&&S.image?{type:"image",src:S.image,alt:S.alt||"",title:S.title}:S,p=r.map((S,A)=>{const E=e.renderComponent({...x(S),key:void 0},A,`${n}-slide`),w={width:"100%",height:"100%",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"};return c==="fade"?(w.position="absolute",w.inset="0",w.opacity=A===i?1:0,w.transition="opacity .5s ease",w.pointerEvents=A===i?"auto":"none"):w.flexShrink=0,U("div",{key:`${n}-item-${A}`,style:w},E)}),b=c==="fade"?{position:"relative",width:"100%",height:"100%"}:{display:"flex",height:"100%",transition:"transform .5s ease",transform:`translateX(-${i*100}%)`},P={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,width:"36px",height:"36px",borderRadius:"50%",border:"none",background:"rgba(0,0,0,0.45)",color:"#fff",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"};return U("div",{key:n,...y},U("div",{style:b},p),u&&U("div",{style:{...P,left:"8px"}},U("button",{style:{background:"transparent",border:"none",color:"inherit",fontSize:"18px",cursor:"pointer"},onClick:()=>h(i-1),"aria-label":"Previous slide"},"<")),u&&U("div",{style:{...P,right:"8px"}},U("button",{style:{background:"transparent",border:"none",color:"inherit",fontSize:"18px",cursor:"pointer"},onClick:()=>h(i+1),"aria-label":"Next slide"},">")),f&&U("div",{style:{position:"absolute",bottom:"10px",left:"50%",transform:"translateX(-50%)",display:"flex",gap:"6px",zIndex:2}},r.map((S,A)=>U("button",{key:`${n}-dot-${A}`,"aria-label":`Slide ${A+1}`,onClick:()=>h(A),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",padding:0,background:A===i?"rgba(255,255,255,0.95)":"rgba(255,255,255,0.4)",transition:"background .3s ease"}}))))}function Cct(e,t,n){const r=Array.isArray(t.items)?t.items:[],i=t.speed||20,o={overflow:"hidden",width:"100%",...t.className?e.parseClassName(t.className):{}},s=e.getCommonProps(n,o,t),l=c=>U("div",{key:c,style:{display:"inline-flex",alignItems:"center",gap:t.gap||"24px",paddingRight:t.gap||"24px",animation:`bf-marquee ${i}s linear infinite`,willChange:"transform",flexShrink:0}},r.map((h,u)=>{const f=typeof h=="string"?{type:"text",text:h}:h&&h.image?{type:"image",src:h.image,alt:h.alt||"",height:t.itemHeight||"48px"}:h;return e.renderComponent(f,u,`${c}-${n}-marq`)}));return U("div",{key:n,...s},U("div",{style:{display:"flex",width:"max-content"}},l("a"),l("b")))}function Oct(e,t,n){const r=v.useRef(null),i=v.useRef(null),o=v.useRef(null),[s,l]=v.useState("idle"),[c,h]=v.useState(""),[u,f]=v.useState(!1),m=t.fieldName||"capture",y=t.captureMode==="qr",x=e.apiUrl||window.location.origin,p=t.uploadPath||"/api/files/upload",b=()=>{var V;(V=i.current)==null||V.getTracks().forEach(D=>D.stop()),i.current=null},P=async V=>{var H,z,Y;const D=new FormData;D.append("file",V,`${m}-${Date.now()}.jpg`);const j=await fetch(new URL(p,x).toString(),{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:D});if(!j.ok)throw new Error("Upload failed");const K=await j.json();return((H=K==null?void 0:K.file)==null?void 0:H.url)||((z=K==null?void 0:K.file)==null?void 0:z.publicUrl)||((Y=K==null?void 0:K.file)==null?void 0:Y.path)||(K==null?void 0:K.url)||(K==null?void 0:K.path)||""},S=async(V,D)=>{var j,K;if(s!=="done"){b();try{f(!0);const H=D||await P(V);e.setSceneData(z=>({...z,[m]:H})),h(H),l("done"),(j=e.showToast)==null||j.call(e,t.successMessage||(D?"Scanned!":"Captured & uploaded"),"success")}catch{l("error"),(K=e.showToast)==null||K.call(e,"Capture failed","error")}finally{f(!1)}}},A=()=>{var j;const V=r.current;if(!V||!V.videoWidth)return;const D=document.createElement("canvas");D.width=V.videoWidth,D.height=V.videoHeight,(j=D.getContext("2d"))==null||j.drawImage(V,0,0),D.toBlob(K=>K&&S(K),"image/jpeg",t.quality||.85)},E=async()=>{var V,D;try{const j=await navigator.mediaDevices.getUserMedia({video:{facingMode:t.facingMode||"user",...t.aspectRatio?{aspectRatio:Number(t.aspectRatio)}:{}},audio:!1});if(i.current=j,r.current&&(r.current.srcObject=j,await r.current.play().catch(()=>{})),l("running"),y){const H=window.BarcodeDetector;if(!H){l("error"),(V=e.showToast)==null||V.call(e,"QR scanning not supported in this browser","error");return}const z=new H;o.current=window.setInterval(async()=>{const Y=r.current;if(!(!Y||!Y.videoWidth||s==="done"))try{const G=await z.detect(Y);G!=null&&G.length&&S(new Blob,G[0].rawValue)}catch{}},400)}}catch{l("error"),(D=e.showToast)==null||D.call(e,"Camera access denied","error")}};v.useEffect(()=>(E(),()=>{o.current&&window.clearInterval(o.current),b()}),[]);const w={display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",width:"100%",...t.className?e.parseClassName(t.className):{}},T=e.getCommonProps(n,w,t),O=U("video",{key:"cam-video",ref:r,autoPlay:!0,playsInline:!0,muted:!0,style:{width:"100%",maxWidth:t.maxWidth||"480px",borderRadius:"12px",aspectRatio:t.aspectRatio||"4 / 3",objectFit:"cover",background:"#0f172a",display:y||s!=="done"?void 0:"none"}}),R=c?U("img",{key:"cam-result",src:c,alt:"captured",style:{width:"100%",maxWidth:t.maxWidth||"480px",borderRadius:"12px",aspectRatio:t.aspectRatio||"4 / 3",objectFit:"cover",background:"#0f172a"}}):null,N=U("div",{key:"cam-actions",style:{display:"flex",gap:"10px",flexWrap:"wrap",justifyContent:"center"}},s!=="done"?U("button",{key:"cam-capture",onClick:A,disabled:u||s!=="running",style:{padding:"10px 22px",borderRadius:"9999px",border:"none",cursor:u?"wait":"pointer",background:"#3B82F6",color:"#fff",fontWeight:600}},u?"Uploading...":y?t.captureLabel||"Scan QR":t.captureLabel||"Capture"):U("button",{key:"cam-retake",onClick:()=>{h(""),l("idle"),E()},style:{padding:"10px 22px",borderRadius:"9999px",border:"1px solid #94a3b8",cursor:"pointer",background:"transparent"}},"Retake"));return U("div",{key:n,...T},O,R,t.captureLabel===!1?null:N,s==="error"?U("p",{key:"cam-err",style:{color:"#EF4444",fontSize:"13px"}},"Camera unavailable — check permissions"):null)}function Mct(e,t,n){var i;if(t.className){const o=((i=e.parseClassNameResponsive)==null?void 0:i.call(e,t.className,n))??e.parseClassName(t.className),s=e.getCommonProps(n,o,t);return U("div",{key:n,className:t.className,...s})}const r=e.getCommonProps(n,{height:t.h||t.height||"24px"},t);return U("div",{key:n,...r})}function kct(e,t,n){const r=t.className||"border-gray-700 my-4",i=e.parseClassName(r),o=e.getCommonProps(n,i,t);return U("hr",{key:n,className:r,...o})}function $ct(e,t,n){var u;const r=t.loaderVariant||"spinner",i=t.rows||3,o=t.className?((u=e.parseClassNameResponsive)==null?void 0:u.call(e,t.className,n))??e.parseClassName(t.className):{};t.rawStyle&&Object.assign(o,t.rawStyle);const s=e.getCommonProps(n,o,t),l=`${e.scopeId}-${n}`,c=e.renderMode==="css-driven"?{"data-bf-r":l}:{};if(r==="skeleton"){const f=[];for(let m=0;m<i;m++){const y=t.width||(m===i-1?"60%":"100%");f.push(U("div",{key:m,className:"bf-loader-skeleton",style:{height:t.height||"16px",width:y,borderRadius:"6px",marginBottom:m<i-1?"12px":"0"}}))}return U("div",{key:n,className:t.className,style:o,...s,...c},...f)}if(r==="shimmer"){const f=[];for(let m=0;m<i;m++){const y=t.width||(m===i-1?"60%":"100%");f.push(U("div",{key:m,className:"bf-loader-shimmer",style:{height:t.height||"16px",width:y,borderRadius:"6px",marginBottom:m<i-1?"12px":"0"}}))}return U("div",{key:n,className:t.className,style:o,...s,...c},...f)}if(r==="dots"){const f=t.color||"currentColor";return U("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",gap:"6px",...o},...s,...c},[0,1,2].map(m=>U("div",{key:m,className:"bf-loader-dot",style:{width:t.size||"8px",height:t.size||"8px",borderRadius:"50%",backgroundColor:f,animationDelay:`${m*.16}s`}})))}if(r==="pulse")return U("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",justifyContent:"center",...o},...s,...c},U("div",{className:"bf-loader-pulse",style:{width:t.size||"32px",height:t.size||"32px",borderRadius:"50%",border:`3px solid ${t.color||"currentColor"}`}}));if(r==="progress")return U("div",{key:n,className:t.className,style:{width:"100%",...o},...s,...c},U("div",{style:{height:t.height||"4px",width:"100%",backgroundColor:"rgba(128,128,128,0.2)",borderRadius:"4px",overflow:"hidden"}},U("div",{className:"bf-loader-progress-bar",style:{height:"100%",width:"30%",backgroundColor:t.color||"currentColor",borderRadius:"4px"}})));const h=t.size||"24px";return U("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",justifyContent:"center",...o},...s,...c},U("div",{className:"bf-loader-spinner",style:{width:h,height:h,border:`3px solid ${t.color?t.color+"33":"rgba(128,128,128,0.2)"}`,borderTopColor:t.color||"currentColor",borderRadius:"50%"}}))}function Ict(e,t,n){const r=t.rows||4;if(t.className){const s=e.parseClassName(t.className),l=e.getCommonProps(n,s,t);return U("textarea",{key:n,className:t.className,...l,name:t.name,placeholder:t.placeholder,rows:r})}const i={width:"100%",padding:"0.75rem 1rem",borderRadius:e.cfg.components.inputRadius,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition,resize:"vertical",fontFamily:"inherit"},o=e.getCommonProps(n,i,t);if(t.label){const s=e.getCommonProps(n,{width:"100%"},t);return U("div",{key:n,...s},U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("textarea",{...o,name:t.name,placeholder:t.placeholder,rows:r}))}return U("textarea",{key:n,...o,name:t.name,placeholder:t.placeholder,rows:r})}function Rct(e,t,n){const r=t.icon||t.name||"",i=t.size||24,o=e.renderIcon(r,i),s=t.tooltip?e.interpolateText(t.tooltip):void 0;if(t.className){const l=e.parseClassName(t.className),c=e.getCommonProps(n,l,t);return U("span",{key:n,className:t.className,title:s,...c},o)}return s?U("span",{key:n,title:s},o):v.cloneElement(o,{key:n})}function Lct(e,t,n){const r=t.metricSize||"md",i=r==="sm"?"1.25rem":r==="lg"?"2.5rem":"1.75rem",o=r==="sm"?"0.75rem":r==="lg"?"1rem":"0.875rem",s=t.color||e.cfg.colors.primary,l=t.trend==="up"?"↑":t.trend==="down"?"↓":"",c=t.trendColor||(t.trend==="up"?e.cfg.colors.success:t.trend==="down"?e.cfg.colors.danger:e.cfg.colors.textMuted),h={display:"flex",flexDirection:"column",gap:"2px",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},u=e.getCommonProps(n,h,t);return U("div",{key:n,...u},t.label&&U("span",{style:{fontSize:o,color:e.cfg.colors.textSecondary,fontWeight:500}},e.interpolateText(t.label)),v.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"6px",marginTop:"4px"}},t.prefix&&U("span",{style:{fontSize:i,fontWeight:700,color:s}},t.prefix),U("span",{style:{fontSize:i,fontWeight:700,color:e.cfg.colors.text}},typeof t.value=="number"?t.value.toLocaleString():e.interpolateText(String(t.value??""))),t.suffix&&U("span",{style:{fontSize:i,fontWeight:700,color:s}},t.suffix),t.delta&&U("span",{style:{fontSize:"0.75rem",fontWeight:600,color:c,marginLeft:"4px"}},`${l} ${t.delta}`)))}function Nct(e,t,n){const r=t.chartData||t.data||[];if(!Array.isArray(r)||r.length===0)return null;const i=Number(t.height)||200,o=t.barColor||e.cfg.colors.primary,s=t.horizontal===!0,l={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},c=s?{type:"number",axisLine:!1,tickLine:!1}:{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fill:e.cfg.colors.textMuted,fontSize:12}},h=s?{dataKey:"label",type:"category",axisLine:!1,tickLine:!1,width:88,tick:{fill:e.cfg.colors.textMuted,fontSize:12}}:{axisLine:!1,tickLine:!1,width:36},u=v.createElement(Up,{width:"100%",height:i},v.createElement(sct,{data:r,layout:s?"vertical":"horizontal"},v.createElement(dm,{vertical:!s,stroke:e.cfg.colors.borderSubtle,strokeDasharray:"3 3"}),v.createElement(ds,c),v.createElement(ps,h),v.createElement(br,{cursor:{fill:t.cursorColor||e.cfg.colors.surfaceHover,fillOpacity:t.cursorOpacity??.5},content:v.createElement(j$,{prefix:t.tooltipPrefix,labelText:t.tooltipLabel,lineColor:o,backgroundColor:e.cfg.colors.surface,textColor:e.cfg.colors.text,borderColor:e.cfg.colors.borderSubtle})}),v.createElement(Aa,{dataKey:"value",fill:o,radius:s?[0,4,4,0]:[4,4,0,0],isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750})));return U("div",{key:n,style:e.getCommonProps(n,l,t)},t.title&&U("div",{style:{marginBottom:"0.75rem"}},t.title),u)}function sT(e,t,n,r=!1){const i=t.chartData||t.data||[];if(!Array.isArray(i)||i.length===0)return null;const o=Number(t.height)||240,s=Array.isArray(t.colors)&&t.colors.length?t.colors:[e.cfg.colors.primary,e.cfg.colors.accent,"#317150","#d95020","#638173"],l={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}};return U("div",{key:n,style:e.getCommonProps(n,l,t)},t.title&&U("div",{style:{marginBottom:"0.75rem"}},t.title),v.createElement(Up,{width:"100%",height:o},v.createElement(act,null,v.createElement(br,{contentStyle:{borderRadius:6,border:`1px solid ${e.cfg.colors.borderSubtle}`}}),t.showLegend!==!1&&v.createElement(ra,{iconType:"circle",wrapperStyle:{fontSize:12}}),v.createElement(wo,{data:i,dataKey:"value",nameKey:"label",cx:"50%",cy:"50%",innerRadius:r?"55%":0,outerRadius:"80%",paddingAngle:2,isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750},...i.map((c,h)=>v.createElement(bh,{key:`${c.label||h}-${h}`,fill:c.color||s[h%s.length]}))))))}function jct(e,t,n){const r=t.chartData||t.data||[];if(!Array.isArray(r)||r.length===0)return null;const i=Number(t.height)||260,o=t.xKey||"x",s=t.yKey||"y",l=t.zKey||"size",c={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}};return U("div",{key:n,style:e.getCommonProps(n,c,t)},t.title&&U("div",{style:{marginBottom:"0.75rem"}},t.title),v.createElement(Up,{width:"100%",height:i},v.createElement(lct,{margin:{top:16,right:12,bottom:8,left:0}},v.createElement(dm,{stroke:e.cfg.colors.borderSubtle,strokeDasharray:"3 3"}),v.createElement(ds,{dataKey:o,type:"number",axisLine:!1,tickLine:!1}),v.createElement(ps,{dataKey:s,type:"number",axisLine:!1,tickLine:!1}),v.createElement(Ah,{dataKey:l,range:t.zRange||[50,360]}),v.createElement(br,{contentStyle:{borderRadius:6,border:`1px solid ${e.cfg.colors.borderSubtle}`}}),v.createElement(Th,{data:r,fill:t.color||e.cfg.colors.primary,isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750}))))}function j$({active:e,payload:t,label:n,prefix:r,labelText:i,lineColor:o,backgroundColor:s,textColor:l,borderColor:c}){var u;const h=Number((u=t==null?void 0:t[0])==null?void 0:u.value);return!e||!Number.isFinite(h)?null:v.createElement("div",{style:{padding:10,border:`1px solid ${c}`,borderRadius:6,backgroundColor:s,boxShadow:"0 8px 24px rgba(0, 0, 0, 0.16)",color:l}},v.createElement("p",{style:{margin:0,fontSize:14}},n),v.createElement("p",{style:{margin:"8px 0 0",color:o,fontSize:14}},`${i||"Indicative price / kg"}: ${r||""}${h.toLocaleString()}`))}function Dct({api:e,c:t,data:n,height:r,lineColor:i,fillColor:o,filled:s}){return v.createElement(Up,{width:"100%",height:r},v.createElement(cct,{data:n,margin:{top:16,right:8,left:0,bottom:0}},t.showGrid!==!1&&v.createElement(dm,{vertical:!1,stroke:"#dce4dc",strokeDasharray:"3 3"}),v.createElement(ds,{dataKey:"label",axisLine:!1,tickLine:!1,height:30,tick:{fill:"#638173",fontSize:12}}),v.createElement(ps,{axisLine:!1,tickLine:!1,width:40,tickCount:5,domain:[0,"auto"],tick:{fill:"#638173",fontSize:12},tickFormatter:l=>`${t.tooltipPrefix||""}${Number(l/1e3).toFixed(1).replace(".0","")}k`}),v.createElement(br,{cursor:{stroke:"#638173",strokeDasharray:"3 3"},content:v.createElement(j$,{prefix:t.tooltipPrefix,labelText:t.tooltipLabel,lineColor:i,backgroundColor:e.cfg.colors.surface,textColor:e.cfg.colors.text,borderColor:e.cfg.colors.borderSubtle})}),v.createElement(fs,{type:"monotone",dataKey:"value",stroke:i,fill:s?o:"transparent",strokeWidth:3,dot:!1,activeDot:{r:6,fill:i,stroke:e.cfg.colors.surface,strokeWidth:3},isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750})))}function Hg(e,t,n,r=!1,i=!1){const o=Array.isArray(t.chartData)?t.chartData:[];if(o.length===0)return null;const s=o.flatMap(b=>i?[b.low,b.high]:[b.value]).map(Number).filter(Number.isFinite);if(s.length===0)return null;const l=Math.min(...s),h=Math.max(...s)-l||1,u=Number(t.height)||220,f=b=>u-(b-l)/h*u,m=t.lineColor||e.cfg.colors.accent,y=t.fillColor||`${m}33`,x={width:"100%",padding:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},p=i?o.map((b,P)=>{const S=Number(b.open),A=Number(b.close),E=Number(b.high),w=Number(b.low),T=A>=S;return U("div",{key:P,style:{flex:1,height:"100%",position:"relative"}},U("div",{style:{position:"absolute",left:"50%",top:`${f(E)}px`,height:`${Math.max(1,f(w)-f(E))}px`,borderLeft:`1px solid ${T?"#22c55e":"#ef4444"}`}}),U("div",{style:{position:"absolute",left:"25%",right:"25%",top:`${f(Math.max(S,A))}px`,height:`${Math.max(3,Math.abs(f(A)-f(S)))}px`,background:T?"#22c55e":"#ef4444",borderRadius:"2px"}}))}):v.createElement(Dct,{api:e,c:t,data:o,height:u,lineColor:m,fillColor:y,filled:r});return U("div",{key:n,style:e.getCommonProps(n,x,t)},t.title&&U("div",{style:{color:e.cfg.colors.textSecondary,fontWeight:600,marginBottom:"0.75rem"}},t.title),U("div",{style:{display:"flex",alignItems:"stretch",gap:i?"4px":void 0,height:u}},p),i&&U("div",{style:{display:"flex",justifyContent:"space-between",color:e.cfg.colors.textMuted,fontSize:"0.7rem",marginTop:"4px"}},...o.map((b,P)=>U("span",{key:P},b.label||""))))}function Bct(e,t,n){const r=Array.isArray(t.chartData)?t.chartData[0]||{}:{},i=t.ticker||r.ticker||r.symbol||"EUR/USD",o=t.bid??r.bid??r.price,s=t.ask??r.ask,l=t.change??r.change,c=Number(l),h=Number.isFinite(c)&&c>=0,u=e.getCommonProps(n,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1rem",width:"100%",padding:"0.9rem 1rem",backgroundColor:e.cfg.colors.surface,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:e.cfg.layout.borderRadiusLg,...t.className?e.parseClassName(t.className):{}},t);return U("div",{key:n,...u},U("div",{},U("div",{style:{color:e.cfg.colors.text,fontWeight:700}},i),t.label&&U("div",{style:{color:e.cfg.colors.textMuted,fontSize:"0.75rem"}},t.label)),U("div",{style:{display:"flex",gap:"1rem",alignItems:"baseline",fontVariantNumeric:"tabular-nums"}},o!=null&&U("span",{style:{color:e.cfg.colors.text,fontWeight:700}},String(o)),s!=null&&U("span",{style:{color:e.cfg.colors.textSecondary}},String(s)),l!=null&&U("span",{style:{color:h?"#22c55e":"#ef4444",fontSize:"0.8rem",fontWeight:600}},`${h?"+":""}${l}`)))}function zct({api:e,c:t,componentKey:n}){var b,P,S,A;const r=v.useRef(null),i=v.useRef(null),o=v.useRef(null),[s,l]=v.useState(null),c=v.useRef(null),[h,u]=v.useState(()=>Array.isArray(t.chartData)?t.chartData:[]);v.useEffect(()=>{Array.isArray(t.chartData)&&u(t.chartData)},[t.chartData]);const f=e.interpolateText(((b=t.realtime)==null?void 0:b.channel)||""),m=e.interpolateText(((P=t.timeRange)==null?void 0:P.from)||""),y=e.interpolateText(((S=t.timeRange)==null?void 0:S.to)||""),x=Array.isArray(t.timeframes)?t.timeframes:[];v.useEffect(()=>{var O,R;const E=e.sdk;if(!(((O=t.realtime)==null?void 0:O.mode)==="ws"&&e.isAuthenticated&&f&&((R=E==null?void 0:E.client)==null?void 0:R.createWebSocket)))return;const T=E.client.createWebSocket(f);return T.onmessage=N=>{var V;try{const D=typeof N.data=="string"?JSON.parse(N.data):N.data,j=(D==null?void 0:D.tick)||((V=D==null?void 0:D.data)==null?void 0:V.tick)||(D==null?void 0:D.data)||D,K=Number((j==null?void 0:j.quote)??(j==null?void 0:j.price)??(j==null?void 0:j.close));if(!Number.isFinite(K))return;const H=Number((j==null?void 0:j.epoch)??(j==null?void 0:j.timestamp)??Date.now()/1e3),z=Math.floor(H/60)*60;u(Y=>{const G=Y[Y.length-1];if((G==null?void 0:G.time)===z)return[...Y.slice(0,-1),{...G,high:Math.max(Number(G.high),K),low:Math.min(Number(G.low),K),close:K}];const J=Number((G==null?void 0:G.close)??K);return[...Y.slice(-99),{time:z,open:J,high:K,low:K,close:K}]})}catch{}},()=>{var N;return(N=T.close)==null?void 0:N.call(T)}},[e.isAuthenticated,(A=t.realtime)==null?void 0:A.mode,f]);const p=v.useMemo(()=>h.map((E,w)=>{const T=E.time||E.timestamp;return{time:typeof T=="string"&&T.includes("T")?Math.floor(new Date(T).getTime()/1e3):T||`2024-01-${String(w+1).padStart(2,"0")}`,...t.chartType==="candlestick"?{open:Number(E.open),high:Number(E.high),low:Number(E.low),close:Number(E.close)}:{value:Number(E.value??E.close)}}}),[t.chartType,h]);return c.current=p[p.length-1],v.useEffect(()=>{const E=r.current;if(!E)return;const w=Nz(E,{autoSize:!0,height:Number(t.height)||280,layout:{background:{color:"transparent"},textColor:e.cfg.colors.textSecondary},grid:{vertLines:{color:e.cfg.colors.borderSubtle},horzLines:{color:e.cfg.colors.borderSubtle}},rightPriceScale:{borderColor:e.cfg.colors.borderSubtle},timeScale:{borderColor:e.cfg.colors.borderSubtle,timeVisible:!0}}),T=t.chartType||"candlestick",O=T==="line"?w.addSeries(Vz,{color:t.lineColor||e.cfg.colors.accent}):T==="area"?w.addSeries(Xz,{lineColor:t.lineColor||e.cfg.colors.accent,topColor:t.fillColor||`${e.cfg.colors.accent}66`,bottomColor:"transparent"}):w.addSeries(e5,{upColor:"#22c55e",downColor:"#ef4444",borderVisible:!1,wickUpColor:"#22c55e",wickDownColor:"#ef4444"});return o.current=w,i.current=O,()=>{i.current=null,o.current=null,w.remove()}},[e.cfg.colors.accent,e.cfg.colors.borderSubtle,e.cfg.colors.textSecondary,t.chartType,t.height,t.lineColor,t.fillColor]),v.useEffect(()=>{var E,w;!i.current||p.length===0||(i.current.setData(p),m&&y?(E=o.current)==null||E.timeScale().setVisibleRange({from:m,to:y}):(w=o.current)!=null&&w.timeScale().getVisibleLogicalRange()||o.current.timeScale().fitContent())},[p,m,y]),v.useEffect(()=>{if(!s||!o.current||!c.current)return;const E={"1H":3600,"4H":14400,"1D":86400,"1W":604800}[s],w=Number(c.current.time);E&&Number.isFinite(w)&&o.current.timeScale().setVisibleRange({from:w-E,to:w})},[s]),U("div",{key:n,style:{width:"100%",padding:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}}},x.length>0&&U("div",{style:{display:"flex",gap:"0.35rem",marginBottom:"0.5rem"}},...x.map(E=>U("button",{key:E,type:"button",onClick:()=>l(E),style:{padding:"0.3rem 0.6rem",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:4,color:e.cfg.colors.text,background:s===E?e.cfg.colors.surfaceHover:"transparent",cursor:"pointer"}},E))),U("div",{ref:r,style:{width:"100%",height:Number(t.height)||280}}))}function Fct(e,t,n){return v.createElement(zct,{api:e,c:t,componentKey:n})}function Wct(e,t,n){const r=t.json||t.data||t.diagram||{},i=e.getCommonProps(n,{display:"flex",flexDirection:"column",minHeight:"300px"},t);return U("div",{key:n,className:t.className,...i},v.createElement("pre",{style:{fontSize:"12px",whiteSpace:"pre-wrap",margin:0}},typeof r=="string"?r:JSON.stringify(r,null,2)))}function Vct({api:e,c:t,componentKey:n}){const r=t.data||t.json||t.diagram||{},{_config:i,...o}=r||{},s=Object.keys(o).length?o:r,{nodes:l,edges:c}=v.useMemo(()=>Tx.createFlowDiagram(s),[s]),[h,u]=v.useState("LR"),f=e.cfg.fullscreen===!0,m=t.height||(f?"100%":320),y=e.getCommonProps(n,{width:"100%",height:m,...f?{minHeight:0}:{}},t);return U("div",{key:n,className:t.className,...y},v.createElement(Tx.FlowDiagram,{nodes:l,edges:c,config:{direction:h,layout:(i==null?void 0:i.layout)||"dagre",colorMode:(i==null?void 0:i.colorMode)||(e.cfg.colorMode==="dark"?"dark":"light"),backgroundPattern:(i==null?void 0:i.backgroundPattern)||"dot"},callbacks:{onDirectionChange:x=>u(x)},showBottomBar:(i==null?void 0:i.showBottomBar)||!1,style:{width:"100%",height:"100%"}}))}function Uct(e,t,n){return v.createElement(Vct,{api:e,c:t,componentKey:n})}function Hct(e,t,n){var r;if(t.className){const i=((r=e.parseClassNameResponsive)==null?void 0:r.call(e,t.className,n))??e.parseClassName(t.className);i.display==null&&(i.display="flex"),i.flexDirection==null&&(i.flexDirection=/(^|\s)flex(\s|$)/.test(t.className||"")||t.layout==="row"?"row":"column");const o=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,className:t.className,...o},(Array.isArray(t.children)?t.children:[]).map((s,l)=>e.renderComponent(s,l,n)))}return null}const qct=v.memo(({api:e,field:t,fieldName:n,value:r,onChange:i})=>{v.useEffect(()=>{r!==void 0&&r!==""&&i&&i(r)},[]);const o=v.useRef(null),[s,l]=v.useState(!1),c=v.useRef(null),h=v.useRef(null),[u,f]=v.useState(!1),[m,y]=v.useState(""),[x,p]=v.useState(!1),b=t.html!==!1,P=S=>b?S:S.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/\n/g,"<br>");return v.useEffect(()=>{o.current&&!o.current.innerHTML&&(o.current.innerHTML=P(r))},[]),v.useEffect(()=>{o.current&&document.activeElement!==o.current&&o.current.innerHTML!==r&&(o.current.innerHTML=P(r))},[r]),v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},t.label?U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,v.createElement("div",{style:{border:`1px solid ${s?e.cfg.colors.primary:e.cfg.colors.border}`,borderRadius:e.cfg.components.inputRadius,overflow:"hidden",transition:"border-color 0.2s",position:"relative"}},v.createElement("div",{style:{display:"flex",gap:"4px",padding:"6px 8px",borderBottom:`1px solid ${e.cfg.colors.border}`,backgroundColor:e.cfg.colors.surface}},...[{cmd:"bold",label:"B"},{cmd:"italic",label:"I"},{cmd:"underline",label:"U"}].map(S=>U("button",{key:S.cmd,type:"button",onMouseDown:A=>{var E;A.preventDefault(),document.execCommand(S.cmd,!1),(E=o.current)==null||E.focus()},style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontWeight:600,fontSize:"13px"},onMouseEnter:A=>A.target.style.borderColor=e.cfg.colors.border,onMouseLeave:A=>A.target.style.borderColor="transparent"},S.label)),U("span",{key:"spacer",style:{flex:1}}),U("button",{key:"list-btn",type:"button",onMouseDown:S=>{var A;S.preventDefault(),document.execCommand("insertUnorderedList",!1),(A=o.current)==null||A.focus()},style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},"☰"),U("span",{key:"divider",style:{width:"1px",height:"16px",backgroundColor:e.cfg.colors.border,margin:"0 4px",alignSelf:"center"}}),U("button",{key:"img-btn",type:"button",onMouseDown:S=>{var A;S.preventDefault(),(A=c.current)==null||A.click()},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("image",14)),U("button",{key:"att-btn",type:"button",onMouseDown:S=>{var A;S.preventDefault(),(A=h.current)==null||A.click()},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("paperclip",14)),U("button",{key:"ai-btn",type:"button",onMouseDown:S=>{S.preventDefault(),f(!u)},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:u?e.cfg.colors.border:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("sparkles",14))),U("div",{ref:o,contentEditable:!0,suppressContentEditableWarning:!0,onInput:S=>i(S.currentTarget.innerHTML),onFocus:()=>l(!0),onBlur:()=>l(!1),style:{minHeight:(t.rows||10)*20+"px",padding:"0.75rem 1rem",backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,outline:"none",fontSize:"0.875rem",lineHeight:"1.6"}}),t.expandAction?v.createElement("button",{type:"button",key:"expand",style:{position:"absolute",bottom:"6px",left:"6px",background:"rgba(0,0,0,0.55)",border:`1px solid ${e.cfg.colors.border}`,borderRadius:"4px",cursor:"pointer",color:e.cfg.colors.textMuted,padding:"3px 5px",display:"flex",alignItems:"center",justifyContent:"center",opacity:.5,transition:"opacity 0.2s",zIndex:1},onMouseEnter:S=>{S.currentTarget.style.opacity="0.85"},onMouseLeave:S=>{S.currentTarget.style.opacity="0.5"},onClick:S=>{S.preventDefault(),S.stopPropagation(),e.handleButtonClick(t.expandAction,{})}},e.renderIcon("maximize-2",13)):null,U("input",{key:"img-input",ref:c,type:"file",accept:"image/*",style:{display:"none"},onChange:async S=>{var E,w,T,O,R,N;const A=(E=S.target.files)==null?void 0:E[0];if(A){try{const V=(w=e.showToast)==null?void 0:w.call(e,"Uploading image (0%)…","success",0),D=e.uploadFile?await e.uploadFile(A,t.upload,j=>{var K;return(K=V==null?void 0:V.update)==null?void 0:K.call(V,`Uploading image (${j}%)`)}):"";if((T=V==null?void 0:V.dismiss)==null||T.call(V),!D)throw Error();(O=o.current)==null||O.focus(),document.execCommand("insertImage",!1,D),i(((R=o.current)==null?void 0:R.innerHTML)||"")}catch{(N=e.showToast)==null||N.call(e,"Failed to upload image","error")}S.target.value=""}}}),U("input",{key:"att-input",ref:h,type:"file",multiple:!0,style:{display:"none"},onChange:async S=>{var O,R,N,V,D;const A=Array.from(S.target.files||[]);S.target.value="";const E=[];let w=0;const T=(O=e.showToast)==null?void 0:O.call(e,`Uploading 0/${A.length}…`,"success",0);for(const j of A){try{const K=e.uploadFile?await e.uploadFile(j,t.upload,H=>{var z;return(z=T==null?void 0:T.update)==null?void 0:z.call(T,`Uploading ${j.name} (${H}%)`)}):"";if(!K)throw Error();E.push(`<a href="${K}">${j.name}</a>`)}catch{(R=e.showToast)==null||R.call(e,`Failed to upload ${j.name}`,"error")}w++,(N=T==null?void 0:T.update)==null||N.call(T,`Uploading ${w}/${A.length}…`)}if((V=T==null?void 0:T.dismiss)==null||V.call(T),E.length>0&&o.current){o.current.focus();const j=window.getSelection();if(j){j.removeAllRanges();const K=document.createRange();K.selectNodeContents(o.current),K.collapse(!1),j.addRange(K)}document.execCommand("insertHTML",!1,`<br><br>${E.join(", ")}`),i(((D=o.current)==null?void 0:D.innerHTML)||"")}}}),u?U("div",{key:"ai-popup",style:{position:"absolute",bottom:"100%",left:"8px",right:"8px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",padding:"12px",zIndex:10,boxShadow:"0 -4px 24px rgba(0,0,0,0.4)"}},U("textarea",{value:m,onChange:S=>y(S.target.value),placeholder:"Ask AI to draft a reply...",rows:3,style:{width:"100%",padding:"8px 12px",borderRadius:"4px",border:`1px solid ${e.cfg.colors.borderSubtle}`,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,fontSize:"13px",outline:"none",fontFamily:"inherit",resize:"none",boxSizing:"border-box"}}),U("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end",marginTop:"8px"}},U("button",{type:"button",onClick:()=>{f(!1),y("")},style:{padding:"6px 14px",borderRadius:"6px",border:`1px solid ${e.cfg.colors.borderSubtle}`,cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.textMuted,fontSize:"12px",fontFamily:"inherit"}},"Cancel"),U("button",{type:"button",disabled:x||!m.trim(),onClick:async()=>{var S,A,E,w;if(!(!m.trim()||x)){p(!0);try{const T=((S=o.current)==null?void 0:S.innerHTML)||"",O=await fetch("/api/tenant/email/ai/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:m,context:T})});if(!O.ok)throw Error();const R=await O.json(),N=R.response||R.text||R.content||"";(A=o.current)==null||A.focus(),document.execCommand("insertText",!1,N),i(((E=o.current)==null?void 0:E.innerHTML)||""),f(!1),y("")}catch{(w=e.showToast)==null||w.call(e,"AI request failed","error")}p(!1)}},style:{padding:"6px 14px",borderRadius:"6px",border:"none",cursor:x||!m.trim()?"not-allowed":"pointer",backgroundColor:x||!m.trim()?e.cfg.colors.surfaceHover:e.cfg.colors.background,color:x||!m.trim()?e.cfg.colors.textSecondary:e.cfg.colors.text,fontSize:"12px",fontWeight:600,fontFamily:"inherit"}},x?"Thinking...":"Generate"))):null))}),Gct=v.memo(({api:e,c:t,componentKey:n})=>{const[r,i]=v.useState(!1),o=v.useRef(null),[s,l]=v.useState([]),c=t.name?`bf_persist_${t.name}`:null;v.useEffect(()=>{t.dataSource&&(async()=>{var f;try{const m=e.interpolateText(t.dataSource),y=(f=e.selectDynamicOptions)==null?void 0:f[m];if(y&&y.length>0){l(y);return}Ko[m]||(Ko[m]=(async()=>{var p;try{const b=await fetch(m,{headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!b.ok)return[];const P=await b.json(),S=t.dataField||"configs",A=t.optionLabel||"label",E=t.optionValue||"value",w=P[S]||P.data||P,T=Array.isArray(w)?w.map(O=>({label:O[A]||O.name||O.label,value:O[E]||O.id||O.name||O.label})):[];return(p=e.setSelectDynamicOptions)==null||p.call(e,O=>({...O,[m]:T})),T}catch{return delete Ko[m],[]}})());const x=await Ko[m];x.length>0&&l(x)}catch{}})()},[t.dataSource]),v.useEffect(()=>{if(c&&t.name&&!e.sceneData[t.name]){const m=localStorage.getItem(c);m&&e.setSceneData(y=>({...y,[t.name]:m}))}},[c,t.name,e.sceneData[t.name]]),v.useEffect(()=>{if(!r)return;const f=y=>{o.current&&!o.current.contains(y.target)&&i(!1)},m=setTimeout(()=>{document.addEventListener("mousedown",f)},0);return()=>{clearTimeout(m),document.removeEventListener("mousedown",f)}},[r]);const h=t.variant==="selector",u=Array.isArray(t.items)?t.items:s;if(h){const f=t.name&&(e.sceneData[t.name||""]||c&&localStorage.getItem(c))||"",m=f||t.placeholder||"Select...";return U("div",{ref:o,style:{position:"relative",display:"inline-flex"}},v.createElement("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:"6px",background:"none",border:"none",cursor:"pointer",fontFamily:"inherit",fontSize:t.fontSize||"1rem",fontWeight:t.fontWeight||600,color:t.color||e.cfg.colors.text,padding:"2px 0",outline:"none",lineHeight:"1.5"},onClick:y=>{y.preventDefault(),i(!r)}},U("span",{key:"text"},m),U("span",{key:"caret",style:{display:"flex",alignItems:"center",opacity:.6,marginLeft:"2px"}},e.renderIcon("chevron-down",14))),r?v.createElement("div",{style:{position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.4)",zIndex:9999,overflow:"hidden",minWidth:"200px"}},...u.map((y,x)=>v.createElement("button",{key:x,type:"button",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"10px 16px",backgroundColor:"transparent",color:e.cfg.colors.text,border:"none",cursor:"pointer",fontSize:"14px",textAlign:"left",fontFamily:"inherit",transition:"background-color 0.15s ease",outline:"none",whiteSpace:"nowrap"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor=e.cfg.colors.borderSubtle},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent"},onClick:p=>{p.preventDefault(),p.stopPropagation(),i(!1),t.name&&y.value!==f&&e.setSceneData(b=>({...b,[t.name]:y.value}))}},y.label||""))):null)}return v.createElement("div",{ref:o,style:{position:"relative",display:"flex",width:"100%"}},(()=>{var y;const f=!!((y=e.buttonLoading)!=null&&y[n]),m=[];return f?m.push(U("span",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):t.icon&&m.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(t.icon,t.iconSize||16))),m.push(U("span",{key:"text",style:{lineHeight:"1"}},t.text||"Button")),v.createElement("button",{type:"button",style:{flex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"0.75rem 1.5rem",backgroundColor:e.cfg.colorMode==="light"?e.cfg.colors.primary:"transparent",color:e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.textSecondary,border:`1px solid ${e.cfg.colors.border}`,cursor:"pointer",fontSize:"0.875rem",fontWeight:600,fontFamily:"inherit",lineHeight:"1.25rem",transition:"all 0.15s ease",outline:"none"},onMouseEnter:x=>{x.currentTarget.style.backgroundColor=e.cfg.colors.border,x.currentTarget.style.color=e.cfg.colorMode==="light"?"#111827":e.cfg.colors.text},onMouseLeave:x=>{x.currentTarget.style.backgroundColor=e.cfg.colorMode==="light"?e.cfg.colors.primary:"transparent",x.currentTarget.style.color=e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.textSecondary},onClick:x=>{if(x.preventDefault(),u.length>0&&u[0].onClick){const p=()=>e.handleButtonClick(u[0].onClick,{onSuccess:u[0].onSuccess,onError:u[0].onError},{feedback:u[0].feedback,optimistic:u[0].optimistic,payload:u[0].payload});(e.withLoading?e.withLoading(n,p):p()).catch(()=>{})}}},...m)})(),u.length>0?v.createElement("button",{type:"button",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"0.75rem 0.5rem",backgroundColor:"transparent",color:e.cfg.colors.textSecondary,border:`1px solid ${e.cfg.colors.border}`,borderLeft:`1px solid ${e.cfg.colors.border}`,cursor:"pointer",fontFamily:"inherit",transition:"all 0.15s ease",outline:"none"},onMouseEnter:f=>{f.currentTarget.style.backgroundColor=e.cfg.colors.border,f.currentTarget.style.color=e.cfg.colors.text},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent",f.currentTarget.style.color=e.cfg.colors.textSecondary},onClick:f=>{f.preventDefault(),f.stopPropagation(),i(!r)}},e.renderIcon("chevron-down",16)):null,r?v.createElement("div",{style:{position:"absolute",bottom:"100%",left:"0",right:"0",marginBottom:"4px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",boxShadow:"0 -8px 24px rgba(0,0,0,0.4)",zIndex:9999,overflow:"hidden"}},...u.map((f,m)=>{var b;const y=`${n}-item-${m}`,x=!!((b=e.buttonLoading)!=null&&b[y]),p=[];return x?p.push(U("span",{key:"spinner",className:"bf-btn-spinner",style:{width:"12px",height:"12px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):f.icon&&p.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"8px"}},e.renderIcon(f.icon,14))),p.push(f.label||""),v.createElement("button",{key:m,type:"button",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"10px 16px",backgroundColor:"transparent",color:e.cfg.colors.text,border:"none",cursor:"pointer",fontSize:"14px",textAlign:"left",fontFamily:"inherit",transition:"background-color 0.15s ease",outline:"none"},onMouseEnter:P=>{P.currentTarget.style.backgroundColor=e.cfg.colors.borderSubtle},onMouseLeave:P=>{P.currentTarget.style.backgroundColor="transparent"},onClick:P=>{if(P.preventDefault(),P.stopPropagation(),!f.onClick)return;const S=f.loading==="self"?y:n;f.loading==="self"?i(!0):i(!1);const A=()=>e.handleButtonClick(f.onClick,{onSuccess:f.onSuccess,onError:f.onError},{feedback:f.feedback,optimistic:f.optimistic,payload:f.payload});(e.withLoading?e.withLoading(S,A):A()).finally(()=>{f.loading==="self"&&i(!1)}).catch(()=>{})}},...p)})):null)});function Zct(e,t,n){return v.createElement(Gct,{key:n,api:e,c:t,componentKey:n})}function Yct(e,t,n){var c,h;const r=t.widgetId;if(!r)return null;const o=(e.widgets||[]).find(u=>u.id===r);if(!o||!Array.isArray(o.components))return up(`[renderer] widget "${r}" not found`),null;if(e.widgetStack&&e.widgetStack.includes(r))return up(`[renderer] circular widget reference "${r}"`),null;(c=e.widgetStack)==null||c.push(r);const s=t.props||{},l=ib(o.components,s).map((u,f)=>e.renderComponent(u,f,`${n}-${r}`));return(h=e.widgetStack)==null||h.pop(),v.createElement(v.Fragment,null,...l)}function ib(e,t){if(!t||Object.keys(t).length===0)return e;if(Array.isArray(e))return e.map(n=>ib(n,t));if(e&&typeof e=="object"){const n={};for(const[r,i]of Object.entries(e))typeof i=="string"&&i.includes("{{")?n[r]=i.replace(/\{\{\s*(?:props\.)?([\w.]+)(?:\|(\w+))?\s*\}\}/g,(o,s,l)=>{let c=t;for(const f of s.split("."))c=c==null?void 0:c[f];if(c==null)return o;const h=c&&typeof c=="object"&&"_seconds"in c?c._seconds*1e3:c&&typeof c=="object"&&"seconds"in c?c.seconds*1e3:c,u=l?new Date(h):null;if(l&&Number.isNaN(u==null?void 0:u.getTime()))return"";if(l==="datetime")return u.toLocaleString();if(l==="timeago"){const f=Math.floor((Date.now()-u.getTime())/6e4);if(f<1)return"just now";if(f<60)return`${f}m ago`;const m=Math.floor(f/60);return m<24?`${m}h ago`:`${Math.floor(m/24)}d ago`}return typeof c=="object"?JSON.stringify(c):String(c)}):n[r]=ib(i,t);return e.condition&&(n.__conditionBase=t),n}return e}const D$=v.memo(({api:e,c:t,componentKey:n})=>{const[r,i]=v.useState(!1),[o,s]=v.useState(""),l=v.useRef(null),c=v.useMemo(()=>(Array.isArray(t.options)?t.options:[]).map(b=>typeof b=="string"?{label:b,value:b}:{label:b.label??b.value,value:b.value??b.label}),[t.options]),h=e.sceneData[t.name||""]??"",u=c.find(p=>p.value===h),f=t.className?e.parseClassName(t.className):{},m=v.useMemo(()=>{if(!o)return c;const p=o.toLowerCase();return c.filter(b=>b.label.toLowerCase().includes(p))},[c,o]),y=t.custom&&o&&!c.find(p=>p.value===o||p.label===o);v.useEffect(()=>{if(!r){s("");return}const p=b=>{l.current&&!l.current.contains(b.target)&&i(!1)};return setTimeout(()=>document.addEventListener("mousedown",p),0),()=>document.removeEventListener("mousedown",p)},[r]);const x=p=>{e.setSceneData(b=>({...b,[t.name||""]:p})),i(!1)};return U("div",{key:n,ref:l,style:{position:"relative",width:"100%",...f}},t.label&&U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("button",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 8px",borderRadius:"6px",border:"1px solid",borderColor:e.cfg.colors.border,background:"transparent",color:e.cfg.colors.text,cursor:"pointer",fontSize:"14px",textAlign:"left",gap:"8px"},onClick:()=>i(!r)},U("span",null,u?u.label:t.placeholder||"Select..."),U("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},U("path",{d:"m6 9 6 6 6-6"}))),r&&U("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:50,marginTop:"4px",borderRadius:"6px",border:"1px solid",borderColor:e.cfg.colors.border,background:e.cfg.colors.surface,overflow:"hidden",maxHeight:"260px",display:"flex",flexDirection:"column"}},t.searchable!==!1&&U("input",{style:{width:"100%",padding:"8px",border:"none",borderBottom:"1px solid",borderColor:e.cfg.colors.borderSubtle,background:"transparent",color:e.cfg.colors.text,outline:"none",fontSize:"13px"},placeholder:"Search...",value:o,onChange:p=>{s(p.target.value),p.stopPropagation()},onClick:p=>p.stopPropagation()}),U("div",{style:{overflow:"auto",flex:1}},m.map(p=>U("button",{key:p.value,style:{width:"100%",display:"block",textAlign:"left",padding:"8px",border:"none",background:p.value===h?"rgba(59,130,246,0.2)":"transparent",color:p.value===h?e.cfg.colors.primary:e.cfg.colors.text,cursor:"pointer",fontSize:"13px"},onMouseEnter:b=>{b.currentTarget.style.background=e.cfg.colors.surfaceHover},onMouseLeave:b=>{b.currentTarget.style.background=p.value===h?"rgba(59,130,246,0.2)":"transparent"},onClick:()=>x(p.value)},p.label)),y&&U("button",{style:{width:"100%",display:"block",textAlign:"left",padding:"8px",border:"none",borderTop:"1px solid",borderColor:e.cfg.colors.borderSubtle,background:"transparent",color:e.cfg.colors.primary,cursor:"pointer",fontSize:"13px",fontStyle:"italic"},onClick:()=>x(o)},`+ Add "${o}"`))))});function Kct(e,t,n){return v.createElement(D$,{api:e,c:t,componentKey:n})}const Ko={},Xct=v.memo(({api:e,field:t,fieldName:n,fieldKey:r,fieldStyle:i,fieldWrapperStyle:o})=>{const[s,l]=v.useState([]);v.useEffect(()=>{t.dataSource&&(async()=>{var u;try{const f=e.interpolateText(t.dataSource),m=(u=e.selectDynamicOptions)==null?void 0:u[f];if(m&&m.length>0){l(m);return}Ko[f]||(Ko[f]=(async()=>{var x;try{const p=await fetch(f,{headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!p.ok)return[];const b=await p.json(),P=t.dataField||"configs",S=t.optionLabel||"label",A=t.optionValue||"value",E=b[P]||b.data||b,w=Array.isArray(E)?E.map(T=>({label:T[S]||T.name||T.label,value:T[A]||T.id||T.name||T.label})):[];return(x=e.setSelectDynamicOptions)==null||x.call(e,T=>({...T,[f]:w})),w}catch{return delete Ko[f],[]}})());const y=await Ko[f];y.length>0&&l(y)}catch{}})()},[t.dataSource]);const c=s.length>0?s:Array.isArray(t.options)?t.options:[],h=t.placeholder||t.label||"Select...";return v.createElement("div",{key:r,style:o||{width:"100%"}},t.label?U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,U("select",{name:n,value:e.sceneData[n]??"",required:t.required,className:t.className,style:{...i,fontSize:"0.875rem"},size:"md",onChange:u=>e.setSceneData(f=>({...f,[n]:u.target.value}))},U("option",{key:"__placeholder",value:"",disabled:!0,hidden:!0},h),c.map((u,f)=>U("option",{key:f,value:typeof u=="string"?u:u.value},typeof u=="string"?u:u.label))))});function Jct(e,t,n){var c;const r=t.className||"",i=((c=e.parseClassNameResponsive)==null?void 0:c.call(e,r,n))??e.parseClassName(r),o=e.getCommonProps(n,i,t),s=Array.isArray(t.fields)?t.fields:[],l=t.submitButton;return t.collection&&e.fetchEntitySchema?v.createElement(Qct,{api:e,c:t,componentKey:n,formClassName:r,parsedStyle:i,formProps:o,fields:s,submitBtn:l}):B$(e,t,n,r,i,o,s,l)}function Qct({api:e,c:t,componentKey:n,formClassName:r,parsedStyle:i,formProps:o,fields:s,submitBtn:l}){const[c,h]=v.useState(s),[u,f]=v.useState(!0);return v.useEffect(()=>{if(!e.fetchEntitySchema){f(!1);return}e.fetchEntitySchema(t.collection).then(m=>{if(!Array.isArray(m==null?void 0:m.fields)){f(!1);return}const y=new Map(m.fields.map(p=>[p.name,p])),x=s.map(p=>{var P;const b=y.get(p.name||((P=p.label)==null?void 0:P.toLowerCase()));return b?{...p,required:p.required??b.required,validation:p.validation??(b.validation?{...b.validation}:void 0),placeholder:p.placeholder??b.placeholder}:p});h(x),f(!1)}).catch(()=>f(!1))},[t.collection]),u?U("div",{key:n,style:{padding:"1rem",textAlign:"center",color:e.cfg.colors.textMuted,fontSize:"0.8rem"}},"Loading fields..."):B$(e,t,n,r,i,o,c,l)}const tut=v.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,inputType:s,label:l,fieldStyle:c,onKeyDown:h,openPickerOnClick:u}){v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const f=v.useRef(r);f.current=r;const m=v.useRef(c);m.current=c;const y=v.useCallback(p=>{f.current(p.target.value)},[]),x=v.createElement("input",{name:t,placeholder:i,required:o,type:s||"text",value:n??"",onChange:y,onClick:u?p=>{var b,P;return(P=(b=p.currentTarget).showPicker)==null?void 0:P.call(b)}:void 0,onKeyDown:h?p=>{p.key==="Enter"&&h()}:void 0,style:m.current});return l?v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},v.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:c.color,marginBottom:"0.75rem"}},l),x):x}),eut=v.memo(function({api:t,field:n,fieldName:r,label:i,fieldStyle:o}){const s=v.useRef(null),[l,c]=v.useState(!1),h=t.sceneData[r]||"",u=t.sceneData[r+"_name"]||"",f=async m=>{var x,p,b,P;const y=(x=m.target.files)==null?void 0:x[0];if(m.target.value="",!!y){c(!0);try{const S=(p=t.showToast)==null?void 0:p.call(t,"Uploading test case (0%)…","success",0),A=t.uploadFile?await t.uploadFile(y,n.upload,E=>{var w;return(w=S==null?void 0:S.update)==null?void 0:w.call(S,`Uploading test case (${E}%)`)}):"";if((b=S==null?void 0:S.dismiss)==null||b.call(S),!A)throw new Error;t.setSceneData(E=>({...E,[r]:A,[r+"_name"]:y.name}))}catch{(P=t.showToast)==null||P.call(t,"Upload failed","error")}finally{c(!1)}}};return v.createElement("div",{style:{width:"100%"}},i&&U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:t.cfg.colors.textSecondary,marginBottom:"0.75rem"}},i),h?v.createElement("div",{style:{...o,display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"}},U("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},"📎 "+(u||"Test case uploaded")),U("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",color:t.cfg.colors.danger,fontSize:"13px"},onClick:()=>t.setSceneData(m=>{const y={...m};return delete y[r],delete y[r+"_name"],y})},"Remove")):v.createElement("button",{type:"button",onClick:()=>{var m;return(m=s.current)==null?void 0:m.click()},style:{...o,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",cursor:"pointer",color:t.cfg.colors.textMuted,fontSize:"14px"}},l?"Uploading…":"⬆ Upload a test case"),U("input",{key:"file-input",ref:s,type:"file",accept:n.accept||".pdf,.docx,.txt,.md,.csv,.json",style:{display:"none"},onChange:f}))}),nut=v.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,options:s,label:l,fieldStyle:c}){v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const h=v.useRef(r);h.current=r;const u=v.useRef(c);u.current=c;const f=v.useCallback(y=>{h.current(y.target.value)},[]),m=v.createElement("select",{name:t,required:o,value:n??"",onChange:f,style:{...u.current,cursor:"pointer",appearance:"none"}},i?v.createElement("option",{key:"__placeholder",value:""},i):null,...s.map((y,x)=>v.createElement("option",{key:x,value:typeof y=="string"?y:y.value},typeof y=="string"?y:y.label)));return l?v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},v.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,marginBottom:"0.75rem"}},l),m):m}),rut=v.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,rows:s,label:l,fieldStyle:c}){v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const h=v.useRef(r);h.current=r;const u=v.useRef(c);u.current=c;const f=v.useCallback(y=>{h.current(y.target.value)},[]),m=v.createElement("textarea",{name:t,placeholder:i,required:o,rows:s||4,value:n??"",onChange:f,style:{...u.current,resize:"vertical",fontFamily:"inherit"}});return l?v.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},v.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,marginBottom:"0.75rem"}},l),m):m});function B$(e,t,n,r,i,o,s,l){var y,x;const c=[],h=Math.max(1,Math.floor(Number(t.columns)||1)),u=typeof window>"u"?1/0:window.innerWidth,m=Math.min(e.containerWidth||1/0,u)<640?1:h;if(s.forEach((p,b)=>{var O,R;const P=`${n}-field-${b}`,S=p.name||((O=p.label)==null?void 0:O.toLowerCase())||"",A=p.className?((R=e.parseClassNameResponsive)==null?void 0:R.call(e,p.className,P))??e.parseClassName(p.className):{},E={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:p.borderless?p.backgroundColor||"transparent":e.cfg.colors.surface,color:p.textColor||e.cfg.colors.text,colorScheme:e.cfg.colorMode==="light"?"light":"dark",border:p.borderless?"none":`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition,...A},w={width:"100%",marginBottom:"1rem"},T=N=>N.value?e.interpolateText(String(N.value)):"";if(p.type==="richtext")c.push(v.createElement(qct,{key:P,api:e,field:p,fieldName:S,value:e.sceneData[S]??T(p),onChange:N=>e.setSceneData(V=>({...V,[S]:N}))}));else if(p.type==="textarea"){const N=p.rows||4;c.push(v.createElement(rut,{key:P,name:S,value:e.sceneData[S]??T(p),onChange:V=>e.setSceneData(D=>({...D,[S]:V})),placeholder:p.placeholder||p.label,required:p.required,rows:N,label:p.label,fieldStyle:E}))}else if(p.type==="select")if(p.dataSource)c.push(v.createElement(Xct,{key:P,api:e,field:p,fieldName:S,fieldKey:P,fieldStyle:E,fieldWrapperStyle:w}));else{const N=Array.isArray(p.options)?p.options:[];c.push(v.createElement(nut,{key:P,name:S,value:e.sceneData[S]??T(p),onChange:V=>e.setSceneData(D=>({...D,[S]:V})),placeholder:p.placeholder||p.label||"Select...",required:p.required,options:N,label:p.label,fieldStyle:E}))}else if(p.type==="advanced-select")c.push(v.createElement("div",{key:`${P}-wrap`,style:w},v.createElement(D$,{key:P,api:e,c:{...p,name:S,options:p.options},componentKey:P})));else if(p.type==="file")c.push(v.createElement("div",{key:`${P}-wrap`,style:w},v.createElement(eut,{key:P,api:e,field:p,fieldName:S,label:p.label,fieldStyle:E})));else if(p.tags)c.push(v.createElement(iut,{key:P,api:e,field:p,value:e.sceneData[S]??T(p),onChange:N=>e.setSceneData(V=>({...V,[S]:N}))}));else{const N=p.type==="email"?"email":p.type==="password"?"password":p.type==="number"?"number":p.type==="date"?"date":p.type==="datetime-local"?"datetime-local":"text";c.push(v.createElement(tut,{key:P,name:S,value:e.sceneData[S]??T(p),onChange:V=>e.setSceneData(D=>({...D,[S]:V})),placeholder:p.placeholder||p.label,required:p.required,inputType:N,label:p.label,fieldStyle:E,openPickerOnClick:p.openPickerOnClick,onKeyDown:p.onKeyDown?()=>e.handleButtonClick(p.onKeyDown):void 0}))}}),h>1){const p=c.splice(0);c.push(...p.map((b,P)=>{var A;const S=Math.min(m,Math.max(1,Number((A=s[P])==null?void 0:A.fieldSpan)||1));return U("div",{key:`${n}-field-grid-${P}`,style:{gridColumn:`span ${S} / span ${S}`,minWidth:0}},b)}))}if(l){const p={padding:"0.75rem 1.5rem",borderRadius:e.cfg.components.inputRadius,cursor:"pointer",fontWeight:600,width:"100%",marginTop:"1rem",...h>1?{gridColumn:"1 / -1",marginTop:0}:{}},b=l.className?((y=e.parseClassNameResponsive)==null?void 0:y.call(e,l.className,`${n}-submit`))??e.parseClassName(l.className):{},P=!!l.className&&/(^|\s)bg-[^\s]+/.test(l.className),S=!!l.className&&/(^|\s)text-[^\s]+/.test(l.className),A={...p,...b,...!P&&{backgroundColor:e.cfg.colors.primary},...!S&&{color:"#fff",border:"none"}},E=`${n}-submit`,w=!!((x=e.buttonLoading)!=null&&x[E]),T=()=>{var j,K,H,z,Y;const V=[],D=e.sceneData||{};for(const G of s){const J=G.name||((j=G.label)==null?void 0:j.toLowerCase()),lt=D[J],q=G.label||J;if(G.required&&(lt==null||String(lt).trim()==="")){V.push(`${q} is required`);continue}lt==null||String(lt).trim()===""||((K=G.validation)!=null&&K.pattern&&!new RegExp(G.validation.pattern).test(String(lt))&&V.push(`${q} is invalid`),((H=G.validation)==null?void 0:H.min)!==void 0&&Number(lt)<Number(G.validation.min)&&V.push(`${q} must be at least ${G.validation.min}`),((z=G.validation)==null?void 0:z.max)!==void 0&&Number(lt)>Number(G.validation.max)&&V.push(`${q} must be at most ${G.validation.max}`),((Y=G.validation)==null?void 0:Y.minLength)!==void 0&&String(lt).length<Number(G.validation.minLength)&&V.push(`${q} must be at least ${G.validation.minLength} characters`))}return V},O=()=>{var K,H;const V=T();if(V.length){(K=e.showToast)==null||K.call(e,V,"error");return}const D=()=>l.onClick?e.handleButtonClick(l.onClick,{onSuccess:l.onSuccess,onError:l.onError},{optimistic:l.optimistic,feedback:l.feedback,payload:l.payload}):Promise.resolve(),j=e.withLoading?e.withLoading(E,D):D();(H=j==null?void 0:j.catch)==null||H.call(j,()=>{})},R=l.onClick?()=>O():void 0,N=[];w?N.push(U("span",{key:"spinner",className:"bf-btn-spinner",style:{display:"inline-flex",width:"14px",height:"14px",marginRight:"6px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):l.icon&&N.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(l.icon,l.iconSize||16))),N.push(U("span",{key:"text"},l.text||"Submit")),c.push(U("button",{key:E,type:l.type||"submit",className:l.className,...e.getCommonProps(E,A,l),disabled:w||void 0,onClick:R},...N))}return U("form",{key:n,className:r,...o,style:{...o.style||{},...h>1?{display:"grid",gridTemplateColumns:`repeat(${m}, minmax(0, 1fr))`,columnGap:"1rem",rowGap:"1.25rem"}:{}},onSubmit:p=>p.preventDefault()},...c)}const iut=v.memo(({api:e,field:t,value:n,onChange:r})=>{v.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const i=v.useRef(null),o=(n||"").split(",").filter(Boolean).map(y=>y.trim()),[s,l]=v.useState(""),[c,h]=v.useState(!1),u=y=>{const x=y.target.value;if(x.includes(",")||x.includes(";")){const p=x.split(/[,;]+/).map(b=>b.trim()).filter(Boolean);if(p.length>0){const b=[...new Set([...o,...p])].join(", ");r(b)}l("")}else l(x)},f=y=>{if(y.key==="Enter"||y.key===","||y.key===";"){y.preventDefault();const x=s.trim();x&&(r([...new Set([...o,x])].join(", ")),l(""))}else y.key==="Backspace"&&!s&&o.length>0&&r(o.slice(0,-1).join(", "))},m=()=>{const y=s.trim();y&&(r([...new Set([...o,y])].join(", ")),l(""))};return U("div",{key:"tags",style:{width:"100%",marginBottom:"1rem"}},t.label?U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,U("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",padding:"0.5rem 0.75rem",borderRadius:e.cfg.components.inputRadius||"8px",backgroundColor:e.cfg.colors.surface,border:`1px solid ${c?e.cfg.colors.primary:e.cfg.colors.border}`,cursor:"text",outline:"none",transition:"border-color 0.2s"},onClick:()=>{var y;return(y=i.current)==null?void 0:y.focus()}},...o.map((y,x)=>U("span",{key:x,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"4px",backgroundColor:e.cfg.colors.background,border:`1px solid ${e.cfg.colors.borderSubtle}`,color:e.cfg.colors.text,fontSize:"13px",lineHeight:"1.4"}},U("span",null,y),U("button",{type:"button",onMouseDown:p=>{p.preventDefault(),p.stopPropagation(),r(o.filter((b,P)=>P!==x).join(", "))},style:{background:"none",border:"none",cursor:"pointer",color:e.cfg.colors.textMuted,padding:"0",fontSize:"14px",lineHeight:"1",display:"flex",alignItems:"center",fontFamily:"inherit"}},"×"))),U("input",{ref:i,type:"text",value:s,onChange:u,onKeyDown:f,onFocus:()=>h(!0),onBlur:()=>{h(!1),m()},placeholder:t.placeholder||(o.length>0?"":"Add email..."),style:{flex:1,minWidth:"100px",border:"none",outline:"none",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"14px",fontFamily:"inherit",padding:"2px 0"}})))});function out(e,t,n){let r=e.interpolateText(t.text||t.content||"");if(!r)return null;!r.includes(`
117
117
  `)&&r.includes("\\n")&&(r=r.replace(/\\n/g,`
118
118
  `));const i=p=>{const b=[],P=/(\*\*(.+?)\*\*)|(\*(.+?)\*)|(`(.+?)`)|(\[(.+?)\]\((.+?)\))|(~~(.+?)~~)/g;let S=0,A;for(;(A=P.exec(p))!==null;)A.index>S&&b.push(p.slice(S,A.index)),A[2]?b.push(U("strong",{key:b.length},A[2])):A[4]?b.push(U("em",{key:b.length},A[4])):A[6]?b.push(U("code",{key:b.length},A[6])):A[8]?b.push(U("a",{key:b.length,href:A[9],target:"_blank",rel:"noopener noreferrer"},A[8])):A[11]&&b.push(U("del",{key:b.length},A[11])),S=A.index+A[0].length;return S<p.length&&b.push(p.slice(S)),b},o=r.split(`
119
119
  `),s=[];let l=null,c=!1,h=[];const u=p=>{l&&(s.push(v.createElement(l.type,{key:p,style:{paddingLeft:"1.5rem",margin:"0.5rem 0",listStyleType:l.type==="ul"?"disc":"decimal"}},l.items.map((b,P)=>U("li",{key:`${p}-${P}`},b)))),l=null)},f=p=>{if(h.length===0)return;const b=h.join(`
120
120
  `);s.push(U("div",{key:p,style:{position:"relative",background:"#1e1e2e",borderRadius:"8px",margin:"0.5rem 0"}},U("button",{style:{position:"absolute",top:"8px",right:"8px",background:"transparent",border:"none",color:"#666",cursor:"pointer",padding:"4px",borderRadius:"4px",lineHeight:"1",zIndex:1,display:"inline-flex",alignItems:"center",fontSize:"14px"},onClick:P=>{P.preventDefault(),P.stopPropagation(),(A=>{navigator.clipboard.writeText(A).catch(()=>{const E=document.createElement("textarea");E.value=A,E.style.position="fixed",E.style.opacity="0",document.body.appendChild(E),E.select(),document.execCommand("copy"),document.body.removeChild(E)})})(b)}},U("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},U("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),U("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))),U("pre",{style:{padding:"16px 12px",margin:0,overflow:"auto",fontSize:"13px",lineHeight:"1.5",color:"#e2e8f0"}},U("code",null,b)))),h=[]};for(let p=0;p<o.length;p++){const b=o[p],P=b.trim();if(P.startsWith("```")){c?(f(`code-${p}`),c=!1):(u(`list-${p}`),c=!0,h=[]);continue}if(c){h.push(b);continue}if(!P){u(`list-${p}`);continue}const S=P.match(/^(#{1,3})\s+(.+)/);if(S){u(`list-${p}`);const E=S[1].length,w=`h${E}`,T={1:"1.5em",2:"1.25em",3:"1.1em"}[E];s.push(v.createElement(w,{key:p,style:{margin:"0.75rem 0 0.25rem",fontSize:T,fontWeight:700}},...i(S[2])));continue}if(P.startsWith("- ")||P.startsWith("* ")){const E=P.slice(2);l?l.type!=="ul"&&(u(`list-${p}`),l={type:"ul",items:[]}):l={type:"ul",items:[]},l.items.push(v.createElement(v.Fragment,{},...i(E)));continue}const A=P.match(/^\d+\.\s+(.+)/);if(A){l?l.type!=="ol"&&(u(`list-${p}`),l={type:"ol",items:[]}):l={type:"ol",items:[]},l.items.push(v.createElement(v.Fragment,{},...i(A[1])));continue}u(`list-${p}`),s.push(U("p",{key:p,style:{margin:"0.25rem 0"}},...i(P)))}c&&f("code-end"),u("list-end");const m={};t.fontSize!==void 0&&(m.fontSize=`${t.fontSize}px`),t.fontWeight!==void 0&&(m.fontWeight=t.fontWeight),t.color!==void 0&&(m.color=t.color),t.textAlign!==void 0&&(m.textAlign=t.textAlign);const y=t.className?{...m,...e.parseClassName(t.className)}:m,x=e.getCommonProps(n,y,t);return U("div",{key:n,...x},...s)}function sut(e,t,n){const r=e.cfg.colors,i={position:"relative",marginTop:"auto",bottom:0,left:0,right:0,zIndex:40,display:"flex",justifyContent:"space-around",alignItems:"stretch",backgroundColor:r.surfaceHover,borderTop:`1px solid ${r.border}`,padding:"6px 0",boxShadow:"0 -2px 8px rgba(0,0,0,0.08)"},s=(Array.isArray(t.items)?t.items:[]).map((c,h)=>{const u=c.active||!1,f=()=>{const m=()=>e.handleButtonClick(c.onClick||"");(e.withLoading?e.withLoading(`${n}-bn-${h}`,m):m()).catch(()=>{})};return U("button",{key:`${n}-bn-${h}`,onClick:f,style:{background:"none",border:"none",cursor:"pointer",flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:2,padding:"6px 0",color:u?r.primary:r.textMuted,fontSize:11,fontFamily:"inherit"},"aria-label":c.label||c.icon||"nav item"},c.icon?e.renderIcon(c.icon,20):null,c.label?U("span",{},c.label):null)}),l=e.getCommonProps(n,i,t);return U("div",{key:n,...l},...s)}function aut(e,t,n){const r=Array.isArray(t.panes)?t.panes:[],i=t.className?{display:"flex",flexDirection:"row",alignItems:"stretch",...e.parseClassName(t.className)}:{display:"flex",flexDirection:"row",alignItems:"stretch",width:"100%",flex:1,minHeight:0},o=r.map((l,c)=>{const u={width:l.width!==void 0?l.width:c===r.length-1?"1fr":"50%",minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"},f=`${n}-split-${c}`;return U("div",{key:f,style:u},l.component?e.renderComponent(l.component,c,`${n}-split`):null)}),s=e.getCommonProps(n,i,t);return U("div",{key:n,...s},...o)}function lut(e,t,n){const r=e.cfg.colorMode!=="light",i=()=>{var l;return(l=e.setColorMode)==null?void 0:l.call(e,r?"light":"dark")},o=t.className?e.parseClassName(t.className):{background:"none",border:`1px solid ${e.cfg.colors.border}`,borderRadius:8,cursor:"pointer",display:"flex",alignItems:"center",gap:6,padding:"6px 10px",color:e.cfg.colors.text,fontSize:14,fontFamily:"inherit"},s=e.getCommonProps(n,o,t);return U("button",{key:n,...s,onClick:i,"aria-label":r?"Switch to light mode":"Switch to dark mode"},U("span",{},r?"☀️":"🌙"),t.text?U("span",{},t.text):null)}function cut(e){var o;const{api:t,config:n}=e,r=t.interpolateText(n.channel||""),i=t.interpolateText(n.entityId||"");return v.useEffect(()=>{var b;const s=t.sdk;if(!t.isAuthenticated||!((b=s==null?void 0:s.client)!=null&&b.createWebSocket)||!r)return;let l=null,c=null,h=[],u=!1,f=null;const m=()=>{const P=t.interpolateText(n.resolution||"")||"",S=String(P).match(/(\d+)\s*x\s*(\d+)/);return S?{width:Number(S[1]),height:Number(S[2])}:{width:Number(t.interpolateText(n.width))||1280,height:Number(t.interpolateText(n.height))||720}},y=Number(t.interpolateText(n.fps))||10,x=async()=>{var S;if(u)return;u=!0,c&&c.state!=="inactive"&&await new Promise(A=>{c.onstop=()=>A(),c.stop()}),(S=l==null?void 0:l.close)==null||S.call(l);const P=new Blob(h,{type:"video/webm"});if(h=[],P.size!==0)try{const A=t.interpolateText(n.entityId||"")||"cast",E=t.interpolateText(n.fileName||"")||`${n.entityType||"video"}-${A}.webm`,w=new File([P],E,{type:"video/webm"}),T=await s.files.upload(w,{bucket:n.bucket||"backflow-storage",entityType:n.entityType||"video",entityId:A});t.setSceneData(O=>({...O,sessionId:A,[n.assetField||"asset_id"]:T==null?void 0:T.id,_recorded:T})),n.onRecorded&&t.handleButtonClick(String(n.onRecorded),{})}catch(A){up("[recorder] upload failed:",A)}},p=()=>{if(c)return;const{width:P,height:S}=m(),A=document.createElement("canvas");A.width=P,A.height=S;const E=A.getContext("2d");if(E){f=w=>{const T=new Image;T.onload=()=>E.drawImage(T,0,0,P,S),T.src=w};try{const w=A.captureStream(y);c=new MediaRecorder(w,{mimeType:"video/webm",videoBitsPerSecond:5e6}),c.ondataavailable=T=>{T.data.size&&h.push(T.data)},c.start(500)}catch(w){up("[recorder] start failed:",w),c=null}}};return l=s.client.createWebSocket(r),l.onmessage=P=>{let S=P==null?void 0:P.data;if(typeof S=="string")try{S=JSON.parse(S)}catch{return}(S==null?void 0:S.type)==="screencast_frame"&&S.frame?(p(),f==null||f(S.frame)):((S==null?void 0:S.status)==="completed"||(S==null?void 0:S.status)==="failed"||(S==null?void 0:S.type)==="workflow_completed"||(S==null?void 0:S.type)==="workflow_failed")&&x()},l.onclose=()=>x(),l.onerror=()=>x(),()=>{var P,S;u=!0,(P=c==null?void 0:c.stop)==null||P.call(c),(S=l==null?void 0:l.close)==null||S.call(l)}},[t.isAuthenticated,r,i,(o=e.config)==null?void 0:o.channel]),null}function uut(e){const{api:t,config:n,componentKey:r}=e,i=t.interpolateText(n.channel||""),o=v.useRef(null),s=v.useRef(null),[l,c]=v.useState(!1);v.useEffect(()=>{const u=()=>c(document.fullscreenElement===o.current);return document.addEventListener("fullscreenchange",u),()=>document.removeEventListener("fullscreenchange",u)},[]);const h=async u=>{var m,y;u.preventDefault(),u.stopPropagation();const f=o.current;if(f){if(document.fullscreenElement){await((m=document.exitFullscreen)==null?void 0:m.call(document));return}await((y=f.requestFullscreen)==null?void 0:y.call(f))}};return v.useEffect(()=>{var p;const u=t.sdk;if(!t.isAuthenticated||!((p=u==null?void 0:u.client)!=null&&p.createWebSocket)||!i)return;let f=null,m=!1;const y=b=>{const P=s.current;if(!P)return;const S=new Image;S.onload=()=>{if(m)return;const A=P.getContext("2d");A&&(P.width=S.width,P.height=S.height,A.drawImage(S,0,0,P.width,P.height))},S.src=b},x=()=>{m||(f=u.client.createWebSocket(i),f.onmessage=b=>{let P=b==null?void 0:b.data;if(typeof P=="string")try{P=JSON.parse(P)}catch{return}(P==null?void 0:P.type)==="screencast_frame"&&P.frame&&y(P.frame)},f.onclose=()=>{m||setTimeout(x,3e3)},f.onerror=()=>{var b;(b=f==null?void 0:f.close)==null||b.call(f)})};return x(),()=>{var b;m=!0,(b=f==null?void 0:f.close)==null||b.call(f)}},[t.isAuthenticated,i,r]),v.createElement("div",{key:r,ref:o,className:"relative w-full h-full bg-black group",style:{width:"100%",height:"100%"}},v.createElement("canvas",{ref:s,className:t.parseClassName(n.className||"w-full h-full object-contain bg-black [aspect-ratio:16/9]"),style:{width:"100%",height:"100%",objectFit:"contain"}}),n.fullscreen===!1?null:v.createElement("button",{type:"button",onClick:h,title:l?"Exit fullscreen":"Open fullscreen","aria-label":l?"Exit fullscreen":"Open fullscreen",className:"absolute top-2 right-2 z-20 inline-flex h-8 w-8 items-center justify-center rounded-full bg-black/55 text-white transition-opacity hover:bg-black/75"},t.renderIcon(l?"minimize-2":"maximize-2",16)))}function hut(e){var n;const t=e.apiUrl||((n=e.sdk)==null?void 0:n.endpoint)||window.location.origin;return`${String(t).replace(/\/+$/,"")}/diagnostics-chat`}function fut({api:e,config:t,componentKey:n}){var S;const[r,i]=v.useState([]),[o,s]=v.useState(""),[l,c]=v.useState(""),[h,u]=v.useState(!1),f=String(e.sceneData.remoteSessionId||"").trim(),m=async A=>{A.preventDefault();const E=o.trim();if(!(!E||h||!f)){i(w=>[...w,{role:"user",content:E},{role:"assistant",content:""}]),s(""),u(!0),c("Inspecting the active UI");try{const w=await fetch(hut(e),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:JSON.stringify({message:E,remoteSessionId:f})});if(!w.ok){const O=await w.json().catch(()=>null);throw new Error((O==null?void 0:O.error)||"Could not reach the diagnostic agent")}const T=await w.json();if(typeof(T==null?void 0:T.message)!="string")throw new Error("The diagnostic agent returned an invalid response");i(O=>{const R=[...O];return R[R.length-1]={role:"assistant",content:T.message},R})}catch(w){i(T=>{const O=[...T],R=O.length-1;return O[R]={role:"assistant",content:w.message},O})}finally{u(!1),c("")}}},y=t.className?((S=e.parseClassNameResponsive)==null?void 0:S.call(e,t.className,n))||e.parseClassName(t.className):{},x=e.getCommonProps(n,y,t),p=e.cfg.colors.surface,b=e.cfg.colors.text,P=e.cfg.colors.textMuted;return v.createElement("section",{...x,style:{...x.style,...y,display:"flex",flexDirection:"column",gap:"12px"}},v.createElement("div",{style:{minHeight:"180px",maxHeight:"380px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"10px"}},r.length===0?v.createElement("span",{style:{color:P,fontSize:"13px"}},"Ask about a UI error, render issue, or unexpected request."):r.map((A,E)=>v.createElement("div",{key:`${A.role}-${E}`,style:{alignSelf:A.role==="user"?"flex-end":"stretch",maxWidth:A.role==="user"?"84%":"100%",padding:"10px 12px",borderRadius:"8px",background:A.role==="user"?e.cfg.colors.primary:p,color:b,whiteSpace:"pre-wrap",fontSize:"13px",lineHeight:1.5}},A.content||l||"Working..."))),f?null:v.createElement("span",{style:{color:e.cfg.colors.warning,fontSize:"12px"}},"A live remote UI session is required."),v.createElement("form",{onSubmit:m,style:{display:"flex",gap:"8px",alignItems:"flex-end"}},v.createElement("textarea",{value:o,disabled:h||!f,onChange:A=>s(A.target.value),placeholder:t.placeholder||"Ask the diagnostic agent",rows:3,style:{flex:1,resize:"vertical",minHeight:"72px",padding:"10px 12px",borderRadius:"8px",border:`1px solid ${e.cfg.colors.borderSubtle}`,background:p,color:b}}),v.createElement("button",{type:"submit",disabled:h||!o.trim()||!f,"aria-label":"Send diagnostic question",style:{width:"40px",height:"40px",border:"none",borderRadius:"8px",background:e.cfg.colors.primary,color:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.renderIcon("send",16))))}function z$(e,t){const n=v.useRef(t);v.useEffect(function(){t!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),t!=null&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}function F$(e,t,n){t.center!==n.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==n.radius&&e.setRadius(t.radius)}const dut=1;function put(e){return Object.freeze({__version:dut,map:e})}function gm(e,t){return Object.freeze({...e,...t})}const W$=v.createContext(null),V$=W$.Provider;function ym(){const e=v.useContext(W$);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}function mut(e){function t(n,r){const{instance:i,context:o}=e(n).current;return v.useImperativeHandle(r,()=>i),n.children==null?null:v.createElement(V$,{value:o},n.children)}return v.forwardRef(t)}function gut(e){function t(n,r){const[i,o]=v.useState(!1),{instance:s}=e(n,o).current;v.useImperativeHandle(r,()=>s),v.useEffect(function(){i&&s.update()},[s,i,n.children]);const l=s._contentNode;return l?ub.createPortal(n.children,l):null}return v.forwardRef(t)}function yut(e){function t(n,r){const{instance:i}=e(n).current;return v.useImperativeHandle(r,()=>i),null}return v.forwardRef(t)}function wx(e,t){const n=v.useRef();v.useEffect(function(){return t!=null&&e.instance.on(t),n.current=t,function(){n.current!=null&&e.instance.off(n.current),n.current=null}},[e,t])}function vm(e,t){const n=e.pane??t.pane;return n?{...e,pane:n}:e}function vut(e,t){return function(r,i){const o=ym(),s=e(vm(r,o),o);return z$(o.map,r.attribution),wx(s.current,r.eventHandlers),t(s.current,o,r,i),s}}var ob={exports:{}};/* @preserve
121
121
  * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
122
122
  * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
123
- */(function(e,t){(function(n,r){r(t)})(tu,function(n){var r="1.9.4";function i(a){var d,g,_,C;for(g=1,_=arguments.length;g<_;g++){C=arguments[g];for(d in C)a[d]=C[d]}return a}var o=Object.create||function(){function a(){}return function(d){return a.prototype=d,new a}}();function s(a,d){var g=Array.prototype.slice;if(a.bind)return a.bind.apply(a,g.call(arguments,1));var _=g.call(arguments,2);return function(){return a.apply(d,_.length?_.concat(g.call(arguments)):arguments)}}var l=0;function c(a){return"_leaflet_id"in a||(a._leaflet_id=++l),a._leaflet_id}function h(a,d,g){var _,C,k,W;return W=function(){_=!1,C&&(k.apply(g,C),C=!1)},k=function(){_?C=arguments:(a.apply(g,arguments),setTimeout(W,d),_=!0)},k}function u(a,d,g){var _=d[1],C=d[0],k=_-C;return a===_&&g?a:((a-C)%k+k)%k+C}function f(){return!1}function m(a,d){if(d===!1)return a;var g=Math.pow(10,d===void 0?6:d);return Math.round(a*g)/g}function y(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function x(a){return y(a).split(/\s+/)}function p(a,d){Object.prototype.hasOwnProperty.call(a,"options")||(a.options=a.options?o(a.options):{});for(var g in d)a.options[g]=d[g];return a.options}function b(a,d,g){var _=[];for(var C in a)_.push(encodeURIComponent(g?C.toUpperCase():C)+"="+encodeURIComponent(a[C]));return(!d||d.indexOf("?")===-1?"?":"&")+_.join("&")}var P=/\{ *([\w_ -]+) *\}/g;function S(a,d){return a.replace(P,function(g,_){var C=d[_];if(C===void 0)throw new Error("No value provided for variable "+g);return typeof C=="function"&&(C=C(d)),C})}var A=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"};function E(a,d){for(var g=0;g<a.length;g++)if(a[g]===d)return g;return-1}var w="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function T(a){return window["webkit"+a]||window["moz"+a]||window["ms"+a]}var O=0;function R(a){var d=+new Date,g=Math.max(0,16-(d-O));return O=d+g,window.setTimeout(a,g)}var N=window.requestAnimationFrame||T("RequestAnimationFrame")||R,V=window.cancelAnimationFrame||T("CancelAnimationFrame")||T("CancelRequestAnimationFrame")||function(a){window.clearTimeout(a)};function D(a,d,g){if(g&&N===R)a.call(d);else return N.call(window,s(a,d))}function j(a){a&&V.call(window,a)}var K={__proto__:null,extend:i,create:o,bind:s,get lastId(){return l},stamp:c,throttle:h,wrapNum:u,falseFn:f,formatNum:m,trim:y,splitWords:x,setOptions:p,getParamString:b,template:S,isArray:A,indexOf:E,emptyImageUrl:w,requestFn:N,cancelFn:V,requestAnimFrame:D,cancelAnimFrame:j};function H(){}H.extend=function(a){var d=function(){p(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},g=d.__super__=this.prototype,_=o(g);_.constructor=d,d.prototype=_;for(var C in this)Object.prototype.hasOwnProperty.call(this,C)&&C!=="prototype"&&C!=="__super__"&&(d[C]=this[C]);return a.statics&&i(d,a.statics),a.includes&&(z(a.includes),i.apply(null,[_].concat(a.includes))),i(_,a),delete _.statics,delete _.includes,_.options&&(_.options=g.options?o(g.options):{},i(_.options,a.options)),_._initHooks=[],_.callInitHooks=function(){if(!this._initHooksCalled){g.callInitHooks&&g.callInitHooks.call(this),this._initHooksCalled=!0;for(var k=0,W=_._initHooks.length;k<W;k++)_._initHooks[k].call(this)}},d},H.include=function(a){var d=this.prototype.options;return i(this.prototype,a),a.options&&(this.prototype.options=d,this.mergeOptions(a.options)),this},H.mergeOptions=function(a){return i(this.prototype.options,a),this},H.addInitHook=function(a){var d=Array.prototype.slice.call(arguments,1),g=typeof a=="function"?a:function(){this[a].apply(this,d)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(g),this};function z(a){if(!(typeof L>"u"||!L||!L.Mixin)){a=A(a)?a:[a];for(var d=0;d<a.length;d++)a[d]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Y={on:function(a,d,g){if(typeof a=="object")for(var _ in a)this._on(_,a[_],d);else{a=x(a);for(var C=0,k=a.length;C<k;C++)this._on(a[C],d,g)}return this},off:function(a,d,g){if(!arguments.length)delete this._events;else if(typeof a=="object")for(var _ in a)this._off(_,a[_],d);else{a=x(a);for(var C=arguments.length===1,k=0,W=a.length;k<W;k++)C?this._off(a[k]):this._off(a[k],d,g)}return this},_on:function(a,d,g,_){if(typeof d!="function"){console.warn("wrong listener type: "+typeof d);return}if(this._listens(a,d,g)===!1){g===this&&(g=void 0);var C={fn:d,ctx:g};_&&(C.once=!0),this._events=this._events||{},this._events[a]=this._events[a]||[],this._events[a].push(C)}},_off:function(a,d,g){var _,C,k;if(this._events&&(_=this._events[a],!!_)){if(arguments.length===1){if(this._firingCount)for(C=0,k=_.length;C<k;C++)_[C].fn=f;delete this._events[a];return}if(typeof d!="function"){console.warn("wrong listener type: "+typeof d);return}var W=this._listens(a,d,g);if(W!==!1){var et=_[W];this._firingCount&&(et.fn=f,this._events[a]=_=_.slice()),_.splice(W,1)}}},fire:function(a,d,g){if(!this.listens(a,g))return this;var _=i({},d,{type:a,target:this,sourceTarget:d&&d.sourceTarget||this});if(this._events){var C=this._events[a];if(C){this._firingCount=this._firingCount+1||1;for(var k=0,W=C.length;k<W;k++){var et=C[k],ot=et.fn;et.once&&this.off(a,ot,et.ctx),ot.call(et.ctx||this,_)}this._firingCount--}}return g&&this._propagateEvent(_),this},listens:function(a,d,g,_){typeof a!="string"&&console.warn('"string" type argument expected');var C=d;typeof d!="function"&&(_=!!d,C=void 0,g=void 0);var k=this._events&&this._events[a];if(k&&k.length&&this._listens(a,C,g)!==!1)return!0;if(_){for(var W in this._eventParents)if(this._eventParents[W].listens(a,d,g,_))return!0}return!1},_listens:function(a,d,g){if(!this._events)return!1;var _=this._events[a]||[];if(!d)return!!_.length;g===this&&(g=void 0);for(var C=0,k=_.length;C<k;C++)if(_[C].fn===d&&_[C].ctx===g)return C;return!1},once:function(a,d,g){if(typeof a=="object")for(var _ in a)this._on(_,a[_],d,!0);else{a=x(a);for(var C=0,k=a.length;C<k;C++)this._on(a[C],d,g,!0)}return this},addEventParent:function(a){return this._eventParents=this._eventParents||{},this._eventParents[c(a)]=a,this},removeEventParent:function(a){return this._eventParents&&delete this._eventParents[c(a)],this},_propagateEvent:function(a){for(var d in this._eventParents)this._eventParents[d].fire(a.type,i({layer:a.target,propagatedFrom:a.target},a),!0)}};Y.addEventListener=Y.on,Y.removeEventListener=Y.clearAllEventListeners=Y.off,Y.addOneTimeEventListener=Y.once,Y.fireEvent=Y.fire,Y.hasEventListeners=Y.listens;var G=H.extend(Y);function J(a,d,g){this.x=g?Math.round(a):a,this.y=g?Math.round(d):d}var lt=Math.trunc||function(a){return a>0?Math.floor(a):Math.ceil(a)};J.prototype={clone:function(){return new J(this.x,this.y)},add:function(a){return this.clone()._add(q(a))},_add:function(a){return this.x+=a.x,this.y+=a.y,this},subtract:function(a){return this.clone()._subtract(q(a))},_subtract:function(a){return this.x-=a.x,this.y-=a.y,this},divideBy:function(a){return this.clone()._divideBy(a)},_divideBy:function(a){return this.x/=a,this.y/=a,this},multiplyBy:function(a){return this.clone()._multiplyBy(a)},_multiplyBy:function(a){return this.x*=a,this.y*=a,this},scaleBy:function(a){return new J(this.x*a.x,this.y*a.y)},unscaleBy:function(a){return new J(this.x/a.x,this.y/a.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=lt(this.x),this.y=lt(this.y),this},distanceTo:function(a){a=q(a);var d=a.x-this.x,g=a.y-this.y;return Math.sqrt(d*d+g*g)},equals:function(a){return a=q(a),a.x===this.x&&a.y===this.y},contains:function(a){return a=q(a),Math.abs(a.x)<=Math.abs(this.x)&&Math.abs(a.y)<=Math.abs(this.y)},toString:function(){return"Point("+m(this.x)+", "+m(this.y)+")"}};function q(a,d,g){return a instanceof J?a:A(a)?new J(a[0],a[1]):a==null?a:typeof a=="object"&&"x"in a&&"y"in a?new J(a.x,a.y):new J(a,d,g)}function nt(a,d){if(a)for(var g=d?[a,d]:a,_=0,C=g.length;_<C;_++)this.extend(g[_])}nt.prototype={extend:function(a){var d,g;if(!a)return this;if(a instanceof J||typeof a[0]=="number"||"x"in a)d=g=q(a);else if(a=it(a),d=a.min,g=a.max,!d||!g)return this;return!this.min&&!this.max?(this.min=d.clone(),this.max=g.clone()):(this.min.x=Math.min(d.x,this.min.x),this.max.x=Math.max(g.x,this.max.x),this.min.y=Math.min(d.y,this.min.y),this.max.y=Math.max(g.y,this.max.y)),this},getCenter:function(a){return q((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,a)},getBottomLeft:function(){return q(this.min.x,this.max.y)},getTopRight:function(){return q(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(a){var d,g;return typeof a[0]=="number"||a instanceof J?a=q(a):a=it(a),a instanceof nt?(d=a.min,g=a.max):d=g=a,d.x>=this.min.x&&g.x<=this.max.x&&d.y>=this.min.y&&g.y<=this.max.y},intersects:function(a){a=it(a);var d=this.min,g=this.max,_=a.min,C=a.max,k=C.x>=d.x&&_.x<=g.x,W=C.y>=d.y&&_.y<=g.y;return k&&W},overlaps:function(a){a=it(a);var d=this.min,g=this.max,_=a.min,C=a.max,k=C.x>d.x&&_.x<g.x,W=C.y>d.y&&_.y<g.y;return k&&W},isValid:function(){return!!(this.min&&this.max)},pad:function(a){var d=this.min,g=this.max,_=Math.abs(d.x-g.x)*a,C=Math.abs(d.y-g.y)*a;return it(q(d.x-_,d.y-C),q(g.x+_,g.y+C))},equals:function(a){return a?(a=it(a),this.min.equals(a.getTopLeft())&&this.max.equals(a.getBottomRight())):!1}};function it(a,d){return!a||a instanceof nt?a:new nt(a,d)}function at(a,d){if(a)for(var g=d?[a,d]:a,_=0,C=g.length;_<C;_++)this.extend(g[_])}at.prototype={extend:function(a){var d=this._southWest,g=this._northEast,_,C;if(a instanceof mt)_=a,C=a;else if(a instanceof at){if(_=a._southWest,C=a._northEast,!_||!C)return this}else return a?this.extend(yt(a)||ct(a)):this;return!d&&!g?(this._southWest=new mt(_.lat,_.lng),this._northEast=new mt(C.lat,C.lng)):(d.lat=Math.min(_.lat,d.lat),d.lng=Math.min(_.lng,d.lng),g.lat=Math.max(C.lat,g.lat),g.lng=Math.max(C.lng,g.lng)),this},pad:function(a){var d=this._southWest,g=this._northEast,_=Math.abs(d.lat-g.lat)*a,C=Math.abs(d.lng-g.lng)*a;return new at(new mt(d.lat-_,d.lng-C),new mt(g.lat+_,g.lng+C))},getCenter:function(){return new mt((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new mt(this.getNorth(),this.getWest())},getSouthEast:function(){return new mt(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(a){typeof a[0]=="number"||a instanceof mt||"lat"in a?a=yt(a):a=ct(a);var d=this._southWest,g=this._northEast,_,C;return a instanceof at?(_=a.getSouthWest(),C=a.getNorthEast()):_=C=a,_.lat>=d.lat&&C.lat<=g.lat&&_.lng>=d.lng&&C.lng<=g.lng},intersects:function(a){a=ct(a);var d=this._southWest,g=this._northEast,_=a.getSouthWest(),C=a.getNorthEast(),k=C.lat>=d.lat&&_.lat<=g.lat,W=C.lng>=d.lng&&_.lng<=g.lng;return k&&W},overlaps:function(a){a=ct(a);var d=this._southWest,g=this._northEast,_=a.getSouthWest(),C=a.getNorthEast(),k=C.lat>d.lat&&_.lat<g.lat,W=C.lng>d.lng&&_.lng<g.lng;return k&&W},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(a,d){return a?(a=ct(a),this._southWest.equals(a.getSouthWest(),d)&&this._northEast.equals(a.getNorthEast(),d)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function ct(a,d){return a instanceof at?a:new at(a,d)}function mt(a,d,g){if(isNaN(a)||isNaN(d))throw new Error("Invalid LatLng object: ("+a+", "+d+")");this.lat=+a,this.lng=+d,g!==void 0&&(this.alt=+g)}mt.prototype={equals:function(a,d){if(!a)return!1;a=yt(a);var g=Math.max(Math.abs(this.lat-a.lat),Math.abs(this.lng-a.lng));return g<=(d===void 0?1e-9:d)},toString:function(a){return"LatLng("+m(this.lat,a)+", "+m(this.lng,a)+")"},distanceTo:function(a){return Tt.distance(this,yt(a))},wrap:function(){return Tt.wrapLatLng(this)},toBounds:function(a){var d=180*a/40075017,g=d/Math.cos(Math.PI/180*this.lat);return ct([this.lat-d,this.lng-g],[this.lat+d,this.lng+g])},clone:function(){return new mt(this.lat,this.lng,this.alt)}};function yt(a,d,g){return a instanceof mt?a:A(a)&&typeof a[0]!="object"?a.length===3?new mt(a[0],a[1],a[2]):a.length===2?new mt(a[0],a[1]):null:a==null?a:typeof a=="object"&&"lat"in a?new mt(a.lat,"lng"in a?a.lng:a.lon,a.alt):d===void 0?null:new mt(a,d,g)}var Et={latLngToPoint:function(a,d){var g=this.projection.project(a),_=this.scale(d);return this.transformation._transform(g,_)},pointToLatLng:function(a,d){var g=this.scale(d),_=this.transformation.untransform(a,g);return this.projection.unproject(_)},project:function(a){return this.projection.project(a)},unproject:function(a){return this.projection.unproject(a)},scale:function(a){return 256*Math.pow(2,a)},zoom:function(a){return Math.log(a/256)/Math.LN2},getProjectedBounds:function(a){if(this.infinite)return null;var d=this.projection.bounds,g=this.scale(a),_=this.transformation.transform(d.min,g),C=this.transformation.transform(d.max,g);return new nt(_,C)},infinite:!1,wrapLatLng:function(a){var d=this.wrapLng?u(a.lng,this.wrapLng,!0):a.lng,g=this.wrapLat?u(a.lat,this.wrapLat,!0):a.lat,_=a.alt;return new mt(g,d,_)},wrapLatLngBounds:function(a){var d=a.getCenter(),g=this.wrapLatLng(d),_=d.lat-g.lat,C=d.lng-g.lng;if(_===0&&C===0)return a;var k=a.getSouthWest(),W=a.getNorthEast(),et=new mt(k.lat-_,k.lng-C),ot=new mt(W.lat-_,W.lng-C);return new at(et,ot)}},Tt=i({},Et,{wrapLng:[-180,180],R:6371e3,distance:function(a,d){var g=Math.PI/180,_=a.lat*g,C=d.lat*g,k=Math.sin((d.lat-a.lat)*g/2),W=Math.sin((d.lng-a.lng)*g/2),et=k*k+Math.cos(_)*Math.cos(C)*W*W,ot=2*Math.atan2(Math.sqrt(et),Math.sqrt(1-et));return this.R*ot}}),ht=6378137,ft={R:ht,MAX_LATITUDE:85.0511287798,project:function(a){var d=Math.PI/180,g=this.MAX_LATITUDE,_=Math.max(Math.min(g,a.lat),-g),C=Math.sin(_*d);return new J(this.R*a.lng*d,this.R*Math.log((1+C)/(1-C))/2)},unproject:function(a){var d=180/Math.PI;return new mt((2*Math.atan(Math.exp(a.y/this.R))-Math.PI/2)*d,a.x*d/this.R)},bounds:function(){var a=ht*Math.PI;return new nt([-a,-a],[a,a])}()};function Ct(a,d,g,_){if(A(a)){this._a=a[0],this._b=a[1],this._c=a[2],this._d=a[3];return}this._a=a,this._b=d,this._c=g,this._d=_}Ct.prototype={transform:function(a,d){return this._transform(a.clone(),d)},_transform:function(a,d){return d=d||1,a.x=d*(this._a*a.x+this._b),a.y=d*(this._c*a.y+this._d),a},untransform:function(a,d){return d=d||1,new J((a.x/d-this._b)/this._a,(a.y/d-this._d)/this._c)}};function rt(a,d,g,_){return new Ct(a,d,g,_)}var Rt=i({},Tt,{code:"EPSG:3857",projection:ft,transformation:function(){var a=.5/(Math.PI*ft.R);return rt(a,.5,-a,.5)}()}),bt=i({},Rt,{code:"EPSG:900913"});function de(a){return document.createElementNS("http://www.w3.org/2000/svg",a)}function ne(a,d){var g="",_,C,k,W,et,ot;for(_=0,k=a.length;_<k;_++){for(et=a[_],C=0,W=et.length;C<W;C++)ot=et[C],g+=(C?"L":"M")+ot.x+" "+ot.y;g+=d?$t.svg?"z":"x":""}return g||"M0 0"}var Gt=document.documentElement.style,Le="ActiveXObject"in window,Bt=Le&&!document.addEventListener,Qt="msLaunchUri"in navigator&&!("documentMode"in document),te=En("webkit"),Ht=En("android"),re=En("android 2")||En("android 3"),Ce=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ie=Ht&&En("Google")&&Ce<537&&!("AudioNode"in window),on=!!window.opera,tn=!Qt&&En("chrome"),Ke=En("gecko")&&!te&&!on&&!Le,_o=!tn&&En("safari"),cn=En("phantom"),Ot="OTransition"in Gt,Dn=navigator.platform.indexOf("Win")===0,Fe=Le&&"transition"in Gt,Ci="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!re,So="MozPerspective"in Gt,Po=!window.L_DISABLE_3D&&(Fe||Ci||So)&&!Ot&&!cn,he=typeof orientation<"u"||En("mobile"),se=he&&te,ii=he&&Ci,Oi=!window.PointerEvent&&window.MSPointerEvent,Pr=!!(window.PointerEvent||Oi),Mi="ontouchstart"in window||!!window.TouchEvent,ms=!window.L_NO_TOUCH&&(Mi||Pr),ki=he&&on,oi=he&&Ke,$i=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Wr=function(){var a=!1;try{var d=Object.defineProperty({},"passive",{get:function(){a=!0}});window.addEventListener("testPassiveEventSupport",f,d),window.removeEventListener("testPassiveEventSupport",f,d)}catch{}return a}(),Ao=function(){return!!document.createElement("canvas").getContext}(),Ii=!!(document.createElementNS&&de("svg").createSVGRect),Ri=!!Ii&&function(){var a=document.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Ar=!Ii&&function(){try{var a=document.createElement("div");a.innerHTML='<v:shape adj="1"/>';var d=a.firstChild;return d.style.behavior="url(#default#VML)",d&&typeof d.adj=="object"}catch{return!1}}(),Li=navigator.platform.indexOf("Mac")===0,Ni=navigator.platform.indexOf("Linux")===0;function En(a){return navigator.userAgent.toLowerCase().indexOf(a)>=0}var $t={ie:Le,ielt9:Bt,edge:Qt,webkit:te,android:Ht,android23:re,androidStock:ie,opera:on,chrome:tn,gecko:Ke,safari:_o,phantom:cn,opera12:Ot,win:Dn,ie3d:Fe,webkit3d:Ci,gecko3d:So,any3d:Po,mobile:he,mobileWebkit:se,mobileWebkit3d:ii,msPointer:Oi,pointer:Pr,touch:ms,touchNative:Mi,mobileOpera:ki,mobileGecko:oi,retina:$i,passiveEvents:Wr,canvas:Ao,svg:Ii,vml:Ar,inlineSvg:Ri,mac:Li,linux:Ni},To=$t.msPointer?"MSPointerDown":"pointerdown",Cn=$t.msPointer?"MSPointerMove":"pointermove",ji=$t.msPointer?"MSPointerUp":"pointerup",Eo=$t.msPointer?"MSPointerCancel":"pointercancel",si={touchstart:To,touchmove:Cn,touchend:ji,touchcancel:Eo},Di={touchstart:un,touchmove:Ae,touchend:Ae,touchcancel:Ae},pr={},Bi=!1;function gs(a,d,g){return d==="touchstart"&&bs(),Di[d]?(g=Di[d].bind(this,g),a.addEventListener(si[d],g,!1),g):(console.warn("wrong event specified:",d),f)}function Gn(a,d,g){if(!si[d]){console.warn("wrong event specified:",d);return}a.removeEventListener(si[d],g,!1)}function zi(a){pr[a.pointerId]=a}function ys(a){pr[a.pointerId]&&(pr[a.pointerId]=a)}function vs(a){delete pr[a.pointerId]}function bs(){Bi||(document.addEventListener(To,zi,!0),document.addEventListener(Cn,ys,!0),document.addEventListener(ji,vs,!0),document.addEventListener(Eo,vs,!0),Bi=!0)}function Ae(a,d){if(d.pointerType!==(d.MSPOINTER_TYPE_MOUSE||"mouse")){d.touches=[];for(var g in pr)d.touches.push(pr[g]);d.changedTouches=[d],a(d)}}function un(a,d){d.MSPOINTER_TYPE_TOUCH&&d.pointerType===d.MSPOINTER_TYPE_TOUCH&&en(d),Ae(a,d)}function Ea(a){var d={},g,_;for(_ in a)g=a[_],d[_]=g&&g.bind?g.bind(a):g;return a=d,d.type="dblclick",d.detail=2,d.isTrusted=!1,d._simulated=!0,d}var xs=200;function ws(a,d){a.addEventListener("dblclick",d);var g=0,_;function C(k){if(k.detail!==1){_=k.detail;return}if(!(k.pointerType==="mouse"||k.sourceCapabilities&&!k.sourceCapabilities.firesTouchEvents)){var W=Hr(k);if(!(W.some(function(ot){return ot instanceof HTMLLabelElement&&ot.attributes.for})&&!W.some(function(ot){return ot instanceof HTMLInputElement||ot instanceof HTMLSelectElement}))){var et=Date.now();et-g<=xs?(_++,_===2&&d(Ea(k))):_=1,g=et}}}return a.addEventListener("click",C),{dblclick:d,simDblclick:C}}function Fi(a,d){a.removeEventListener("dblclick",d.dblclick),a.removeEventListener("click",d.simDblclick)}var _n=hn(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),tr=hn(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Co=tr==="webkitTransition"||tr==="OTransition"?tr+"End":"transitionend";function ai(a){return typeof a=="string"?document.getElementById(a):a}function On(a,d){var g=a.style[d]||a.currentStyle&&a.currentStyle[d];if((!g||g==="auto")&&document.defaultView){var _=document.defaultView.getComputedStyle(a,null);g=_?_[d]:null}return g==="auto"?null:g}function ee(a,d,g){var _=document.createElement(a);return _.className=d||"",g&&g.appendChild(_),_}function qt(a){var d=a.parentNode;d&&d.removeChild(a)}function mr(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function ye(a){var d=a.parentNode;d&&d.lastChild!==a&&d.appendChild(a)}function wt(a){var d=a.parentNode;d&&d.firstChild!==a&&d.insertBefore(a,d.firstChild)}function ve(a,d){if(a.classList!==void 0)return a.classList.contains(d);var g=Wi(a);return g.length>0&&new RegExp("(^|\\s)"+d+"(\\s|$)").test(g)}function It(a,d){if(a.classList!==void 0)for(var g=x(d),_=0,C=g.length;_<C;_++)a.classList.add(g[_]);else if(!ve(a,d)){var k=Wi(a);_s(a,(k?k+" ":"")+d)}}function ae(a,d){a.classList!==void 0?a.classList.remove(d):_s(a,y((" "+Wi(a)+" ").replace(" "+d+" "," ")))}function _s(a,d){a.className.baseVal===void 0?a.className=d:a.className.baseVal=d}function Wi(a){return a.correspondingElement&&(a=a.correspondingElement),a.className.baseVal===void 0?a.className:a.className.baseVal}function Mn(a,d){"opacity"in a.style?a.style.opacity=d:"filter"in a.style&&li(a,d)}function li(a,d){var g=!1,_="DXImageTransform.Microsoft.Alpha";try{g=a.filters.item(_)}catch{if(d===1)return}d=Math.round(d*100),g?(g.Enabled=d!==100,g.Opacity=d):a.style.filter+=" progid:"+_+"(opacity="+d+")"}function hn(a){for(var d=document.documentElement.style,g=0;g<a.length;g++)if(a[g]in d)return a[g];return!1}function qe(a,d,g){var _=d||new J(0,0);a.style[_n]=($t.ie3d?"translate("+_.x+"px,"+_.y+"px)":"translate3d("+_.x+"px,"+_.y+"px,0)")+(g?" scale("+g+")":"")}function ke(a,d){a._leaflet_pos=d,$t.any3d?qe(a,d):(a.style.left=d.x+"px",a.style.top=d.y+"px")}function Te(a){return a._leaflet_pos||new J(0,0)}var Ss,Vr,Vi;if("onselectstart"in document)Ss=function(){Dt(window,"selectstart",en)},Vr=function(){Ee(window,"selectstart",en)};else{var Ps=hn(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Ss=function(){if(Ps){var a=document.documentElement.style;Vi=a[Ps],a[Ps]="none"}},Vr=function(){Ps&&(document.documentElement.style[Ps]=Vi,Vi=void 0)}}function Tr(){Dt(window,"dragstart",en)}function Oo(){Ee(window,"dragstart",en)}var Ui,mc;function le(a){for(;a.tabIndex===-1;)a=a.parentNode;a.style&&(As(),Ui=a,mc=a.style.outlineStyle,a.style.outlineStyle="none",Dt(window,"keydown",As))}function As(){Ui&&(Ui.style.outlineStyle=mc,Ui=void 0,mc=void 0,Ee(window,"keydown",As))}function Eh(a){do a=a.parentNode;while((!a.offsetWidth||!a.offsetHeight)&&a!==document.body);return a}function Mo(a){var d=a.getBoundingClientRect();return{x:d.width/a.offsetWidth||1,y:d.height/a.offsetHeight||1,boundingClientRect:d}}var xm={__proto__:null,TRANSFORM:_n,TRANSITION:tr,TRANSITION_END:Co,get:ai,getStyle:On,create:ee,remove:qt,empty:mr,toFront:ye,toBack:wt,hasClass:ve,addClass:It,removeClass:ae,setClass:_s,getClass:Wi,setOpacity:Mn,testProp:hn,setTransform:qe,setPosition:ke,getPosition:Te,get disableTextSelection(){return Ss},get enableTextSelection(){return Vr},disableImageDrag:Tr,enableImageDrag:Oo,preventOutline:le,restoreOutline:As,getSizedParentNode:Eh,getScale:Mo};function Dt(a,d,g,_){if(d&&typeof d=="object")for(var C in d)Ca(a,C,d[C],g);else{d=x(d);for(var k=0,W=d.length;k<W;k++)Ca(a,d[k],g,_)}return this}var pe="_leaflet_events";function Ee(a,d,g,_){if(arguments.length===1)gc(a),delete a[pe];else if(d&&typeof d=="object")for(var C in d)Oa(a,C,d[C],g);else if(d=x(d),arguments.length===2)gc(a,function(et){return E(d,et)!==-1});else for(var k=0,W=d.length;k<W;k++)Oa(a,d[k],g,_);return this}function gc(a,d){for(var g in a[pe]){var _=g.split(/\d/)[0];(!d||d(_))&&Oa(a,_,null,null,g)}}var Ur={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ca(a,d,g,_){var C=d+c(g)+(_?"_"+c(_):"");if(a[pe]&&a[pe][C])return this;var k=function(et){return g.call(_||a,et||window.event)},W=k;!$t.touchNative&&$t.pointer&&d.indexOf("touch")===0?k=gs(a,d,k):$t.touch&&d==="dblclick"?k=ws(a,k):"addEventListener"in a?d==="touchstart"||d==="touchmove"||d==="wheel"||d==="mousewheel"?a.addEventListener(Ur[d]||d,k,$t.passiveEvents?{passive:!1}:!1):d==="mouseenter"||d==="mouseleave"?(k=function(et){et=et||window.event,er(a,et)&&W(et)},a.addEventListener(Ur[d],k,!1)):a.addEventListener(d,W,!1):a.attachEvent("on"+d,k),a[pe]=a[pe]||{},a[pe][C]=k}function Oa(a,d,g,_,C){C=C||d+c(g)+(_?"_"+c(_):"");var k=a[pe]&&a[pe][C];if(!k)return this;!$t.touchNative&&$t.pointer&&d.indexOf("touch")===0?Gn(a,d,k):$t.touch&&d==="dblclick"?Fi(a,k):"removeEventListener"in a?a.removeEventListener(Ur[d]||d,k,!1):a.detachEvent("on"+d,k),a[pe][C]=null}function Hi(a){return a.stopPropagation?a.stopPropagation():a.originalEvent?a.originalEvent._stopped=!0:a.cancelBubble=!0,this}function ci(a){return Ca(a,"wheel",Hi),this}function ko(a){return Dt(a,"mousedown touchstart dblclick contextmenu",Hi),a._leaflet_disable_click=!0,this}function en(a){return a.preventDefault?a.preventDefault():a.returnValue=!1,this}function ui(a){return en(a),Hi(a),this}function Hr(a){if(a.composedPath)return a.composedPath();for(var d=[],g=a.target;g;)d.push(g),g=g.parentNode;return d}function Ma(a,d){if(!d)return new J(a.clientX,a.clientY);var g=Mo(d),_=g.boundingClientRect;return new J((a.clientX-_.left)/g.x-d.clientLeft,(a.clientY-_.top)/g.y-d.clientTop)}var Ts=$t.linux&&$t.chrome?window.devicePixelRatio:$t.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function kn(a){return $t.edge?a.wheelDeltaY/2:a.deltaY&&a.deltaMode===0?-a.deltaY/Ts:a.deltaY&&a.deltaMode===1?-a.deltaY*20:a.deltaY&&a.deltaMode===2?-a.deltaY*60:a.deltaX||a.deltaZ?0:a.wheelDelta?(a.wheelDeltaY||a.wheelDelta)/2:a.detail&&Math.abs(a.detail)<32765?-a.detail*20:a.detail?a.detail/-32765*60:0}function er(a,d){var g=d.relatedTarget;if(!g)return!0;try{for(;g&&g!==a;)g=g.parentNode}catch{return!1}return g!==a}var yc={__proto__:null,on:Dt,off:Ee,stopPropagation:Hi,disableScrollPropagation:ci,disableClickPropagation:ko,preventDefault:en,stop:ui,getPropagationPath:Hr,getMousePosition:Ma,getWheelDelta:kn,isExternalTarget:er,addListener:Dt,removeListener:Ee},vc=G.extend({run:function(a,d,g,_){this.stop(),this._el=a,this._inProgress=!0,this._duration=g||.25,this._easeOutPower=1/Math.max(_||.5,.2),this._startPos=Te(a),this._offset=d.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=D(this._animate,this),this._step()},_step:function(a){var d=+new Date-this._startTime,g=this._duration*1e3;d<g?this._runFrame(this._easeOut(d/g),a):(this._runFrame(1),this._complete())},_runFrame:function(a,d){var g=this._startPos.add(this._offset.multiplyBy(a));d&&g._round(),ke(this._el,g),this.fire("step")},_complete:function(){j(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(a){return 1-Math.pow(1-a,this._easeOutPower)}}),Zt=G.extend({options:{crs:Rt,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(a,d){d=p(this,d),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(a),this._initLayout(),this._onResize=s(this._onResize,this),this._initEvents(),d.maxBounds&&this.setMaxBounds(d.maxBounds),d.zoom!==void 0&&(this._zoom=this._limitZoom(d.zoom)),d.center&&d.zoom!==void 0&&this.setView(yt(d.center),d.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=tr&&$t.any3d&&!$t.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Dt(this._proxy,Co,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(a,d,g){if(d=d===void 0?this._zoom:this._limitZoom(d),a=this._limitCenter(yt(a),d,this.options.maxBounds),g=g||{},this._stop(),this._loaded&&!g.reset&&g!==!0){g.animate!==void 0&&(g.zoom=i({animate:g.animate},g.zoom),g.pan=i({animate:g.animate,duration:g.duration},g.pan));var _=this._zoom!==d?this._tryAnimatedZoom&&this._tryAnimatedZoom(a,d,g.zoom):this._tryAnimatedPan(a,g.pan);if(_)return clearTimeout(this._sizeTimer),this}return this._resetView(a,d,g.pan&&g.pan.noMoveStart),this},setZoom:function(a,d){return this._loaded?this.setView(this.getCenter(),a,{zoom:d}):(this._zoom=a,this)},zoomIn:function(a,d){return a=a||($t.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+a,d)},zoomOut:function(a,d){return a=a||($t.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-a,d)},setZoomAround:function(a,d,g){var _=this.getZoomScale(d),C=this.getSize().divideBy(2),k=a instanceof J?a:this.latLngToContainerPoint(a),W=k.subtract(C).multiplyBy(1-1/_),et=this.containerPointToLatLng(C.add(W));return this.setView(et,d,{zoom:g})},_getBoundsCenterZoom:function(a,d){d=d||{},a=a.getBounds?a.getBounds():ct(a);var g=q(d.paddingTopLeft||d.padding||[0,0]),_=q(d.paddingBottomRight||d.padding||[0,0]),C=this.getBoundsZoom(a,!1,g.add(_));if(C=typeof d.maxZoom=="number"?Math.min(d.maxZoom,C):C,C===1/0)return{center:a.getCenter(),zoom:C};var k=_.subtract(g).divideBy(2),W=this.project(a.getSouthWest(),C),et=this.project(a.getNorthEast(),C),ot=this.unproject(W.add(et).divideBy(2).add(k),C);return{center:ot,zoom:C}},fitBounds:function(a,d){if(a=ct(a),!a.isValid())throw new Error("Bounds are not valid.");var g=this._getBoundsCenterZoom(a,d);return this.setView(g.center,g.zoom,d)},fitWorld:function(a){return this.fitBounds([[-90,-180],[90,180]],a)},panTo:function(a,d){return this.setView(a,this._zoom,{pan:d})},panBy:function(a,d){if(a=q(a).round(),d=d||{},!a.x&&!a.y)return this.fire("moveend");if(d.animate!==!0&&!this.getSize().contains(a))return this._resetView(this.unproject(this.project(this.getCenter()).add(a)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new vc,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),d.noMoveStart||this.fire("movestart"),d.animate!==!1){It(this._mapPane,"leaflet-pan-anim");var g=this._getMapPanePos().subtract(a).round();this._panAnim.run(this._mapPane,g,d.duration||.25,d.easeLinearity)}else this._rawPanBy(a),this.fire("move").fire("moveend");return this},flyTo:function(a,d,g){if(g=g||{},g.animate===!1||!$t.any3d)return this.setView(a,d,g);this._stop();var _=this.project(this.getCenter()),C=this.project(a),k=this.getSize(),W=this._zoom;a=yt(a),d=d===void 0?W:d;var et=Math.max(k.x,k.y),ot=et*this.getZoomScale(W,d),dt=C.distanceTo(_)||1,Pt=1.42,kt=Pt*Pt;function Yt(be){var Ba=be?-1:1,Yh=be?ot:et,Mm=ot*ot-et*et+Ba*kt*kt*dt*dt,Ic=2*Yh*kt*dt,Fn=Mm/Ic,Rc=Math.sqrt(Fn*Fn+1)-Fn,Kh=Rc<1e-9?-18:Math.log(Rc);return Kh}function fn(be){return(Math.exp(be)-Math.exp(-be))/2}function oe(be){return(Math.exp(be)+Math.exp(-be))/2}function St(be){return fn(be)/oe(be)}var jt=Yt(0);function Kt(be){return et*(oe(jt)/oe(jt+Pt*be))}function Ne(be){return et*(oe(jt)*St(jt+Pt*be)-fn(jt))/kt}function Ge(be){return 1-Math.pow(1-be,1.5)}var Ji=Date.now(),zn=(Yt(1)-jt)/Pt,Ls=g.duration?1e3*g.duration:1e3*zn*.8;function sr(){var be=(Date.now()-Ji)/Ls,Ba=Ge(be)*zn;be<=1?(this._flyToFrame=D(sr,this),this._move(this.unproject(_.add(C.subtract(_).multiplyBy(Ne(Ba)/dt)),W),this.getScaleZoom(et/Kt(Ba),W),{flyTo:!0})):this._move(a,d)._moveEnd(!0)}return this._moveStart(!0,g.noMoveStart),sr.call(this),this},flyToBounds:function(a,d){var g=this._getBoundsCenterZoom(a,d);return this.flyTo(g.center,g.zoom,d)},setMaxBounds:function(a){return a=ct(a),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),a.isValid()?(this.options.maxBounds=a,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(a){var d=this.options.minZoom;return this.options.minZoom=a,this._loaded&&d!==a&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(a):this},setMaxZoom:function(a){var d=this.options.maxZoom;return this.options.maxZoom=a,this._loaded&&d!==a&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(a):this},panInsideBounds:function(a,d){this._enforcingBounds=!0;var g=this.getCenter(),_=this._limitCenter(g,this._zoom,ct(a));return g.equals(_)||this.panTo(_,d),this._enforcingBounds=!1,this},panInside:function(a,d){d=d||{};var g=q(d.paddingTopLeft||d.padding||[0,0]),_=q(d.paddingBottomRight||d.padding||[0,0]),C=this.project(this.getCenter()),k=this.project(a),W=this.getPixelBounds(),et=it([W.min.add(g),W.max.subtract(_)]),ot=et.getSize();if(!et.contains(k)){this._enforcingBounds=!0;var dt=k.subtract(et.getCenter()),Pt=et.extend(k).getSize().subtract(ot);C.x+=dt.x<0?-Pt.x:Pt.x,C.y+=dt.y<0?-Pt.y:Pt.y,this.panTo(this.unproject(C),d),this._enforcingBounds=!1}return this},invalidateSize:function(a){if(!this._loaded)return this;a=i({animate:!1,pan:!0},a===!0?{animate:!0}:a);var d=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var g=this.getSize(),_=d.divideBy(2).round(),C=g.divideBy(2).round(),k=_.subtract(C);return!k.x&&!k.y?this:(a.animate&&a.pan?this.panBy(k):(a.pan&&this._rawPanBy(k),this.fire("move"),a.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:d,newSize:g}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(a){if(a=this._locateOptions=i({timeout:1e4,watch:!1},a),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var d=s(this._handleGeolocationResponse,this),g=s(this._handleGeolocationError,this);return a.watch?this._locationWatchId=navigator.geolocation.watchPosition(d,g,a):navigator.geolocation.getCurrentPosition(d,g,a),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(a){if(this._container._leaflet_id){var d=a.code,g=a.message||(d===1?"permission denied":d===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:d,message:"Geolocation error: "+g+"."})}},_handleGeolocationResponse:function(a){if(this._container._leaflet_id){var d=a.coords.latitude,g=a.coords.longitude,_=new mt(d,g),C=_.toBounds(a.coords.accuracy*2),k=this._locateOptions;if(k.setView){var W=this.getBoundsZoom(C);this.setView(_,k.maxZoom?Math.min(W,k.maxZoom):W)}var et={latlng:_,bounds:C,timestamp:a.timestamp};for(var ot in a.coords)typeof a.coords[ot]=="number"&&(et[ot]=a.coords[ot]);this.fire("locationfound",et)}},addHandler:function(a,d){if(!d)return this;var g=this[a]=new d(this);return this._handlers.push(g),this.options[a]&&g.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),qt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(j(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var a;for(a in this._layers)this._layers[a].remove();for(a in this._panes)qt(this._panes[a]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(a,d){var g="leaflet-pane"+(a?" leaflet-"+a.replace("Pane","")+"-pane":""),_=ee("div",g,d||this._mapPane);return a&&(this._panes[a]=_),_},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var a=this.getPixelBounds(),d=this.unproject(a.getBottomLeft()),g=this.unproject(a.getTopRight());return new at(d,g)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(a,d,g){a=ct(a),g=q(g||[0,0]);var _=this.getZoom()||0,C=this.getMinZoom(),k=this.getMaxZoom(),W=a.getNorthWest(),et=a.getSouthEast(),ot=this.getSize().subtract(g),dt=it(this.project(et,_),this.project(W,_)).getSize(),Pt=$t.any3d?this.options.zoomSnap:1,kt=ot.x/dt.x,Yt=ot.y/dt.y,fn=d?Math.max(kt,Yt):Math.min(kt,Yt);return _=this.getScaleZoom(fn,_),Pt&&(_=Math.round(_/(Pt/100))*(Pt/100),_=d?Math.ceil(_/Pt)*Pt:Math.floor(_/Pt)*Pt),Math.max(C,Math.min(k,_))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new J(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(a,d){var g=this._getTopLeftPoint(a,d);return new nt(g,g.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(a){return this.options.crs.getProjectedBounds(a===void 0?this.getZoom():a)},getPane:function(a){return typeof a=="string"?this._panes[a]:a},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(a,d){var g=this.options.crs;return d=d===void 0?this._zoom:d,g.scale(a)/g.scale(d)},getScaleZoom:function(a,d){var g=this.options.crs;d=d===void 0?this._zoom:d;var _=g.zoom(a*g.scale(d));return isNaN(_)?1/0:_},project:function(a,d){return d=d===void 0?this._zoom:d,this.options.crs.latLngToPoint(yt(a),d)},unproject:function(a,d){return d=d===void 0?this._zoom:d,this.options.crs.pointToLatLng(q(a),d)},layerPointToLatLng:function(a){var d=q(a).add(this.getPixelOrigin());return this.unproject(d)},latLngToLayerPoint:function(a){var d=this.project(yt(a))._round();return d._subtract(this.getPixelOrigin())},wrapLatLng:function(a){return this.options.crs.wrapLatLng(yt(a))},wrapLatLngBounds:function(a){return this.options.crs.wrapLatLngBounds(ct(a))},distance:function(a,d){return this.options.crs.distance(yt(a),yt(d))},containerPointToLayerPoint:function(a){return q(a).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(a){return q(a).add(this._getMapPanePos())},containerPointToLatLng:function(a){var d=this.containerPointToLayerPoint(q(a));return this.layerPointToLatLng(d)},latLngToContainerPoint:function(a){return this.layerPointToContainerPoint(this.latLngToLayerPoint(yt(a)))},mouseEventToContainerPoint:function(a){return Ma(a,this._container)},mouseEventToLayerPoint:function(a){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(a))},mouseEventToLatLng:function(a){return this.layerPointToLatLng(this.mouseEventToLayerPoint(a))},_initContainer:function(a){var d=this._container=ai(a);if(d){if(d._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Dt(d,"scroll",this._onScroll,this),this._containerId=c(d)},_initLayout:function(){var a=this._container;this._fadeAnimated=this.options.fadeAnimation&&$t.any3d,It(a,"leaflet-container"+($t.touch?" leaflet-touch":"")+($t.retina?" leaflet-retina":"")+($t.ielt9?" leaflet-oldie":"")+($t.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var d=On(a,"position");d!=="absolute"&&d!=="relative"&&d!=="fixed"&&d!=="sticky"&&(a.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var a=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ke(this._mapPane,new J(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(It(a.markerPane,"leaflet-zoom-hide"),It(a.shadowPane,"leaflet-zoom-hide"))},_resetView:function(a,d,g){ke(this._mapPane,new J(0,0));var _=!this._loaded;this._loaded=!0,d=this._limitZoom(d),this.fire("viewprereset");var C=this._zoom!==d;this._moveStart(C,g)._move(a,d)._moveEnd(C),this.fire("viewreset"),_&&this.fire("load")},_moveStart:function(a,d){return a&&this.fire("zoomstart"),d||this.fire("movestart"),this},_move:function(a,d,g,_){d===void 0&&(d=this._zoom);var C=this._zoom!==d;return this._zoom=d,this._lastCenter=a,this._pixelOrigin=this._getNewPixelOrigin(a),_?g&&g.pinch&&this.fire("zoom",g):((C||g&&g.pinch)&&this.fire("zoom",g),this.fire("move",g)),this},_moveEnd:function(a){return a&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return j(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(a){ke(this._mapPane,this._getMapPanePos().subtract(a))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(a){this._targets={},this._targets[c(this._container)]=this;var d=a?Ee:Dt;d(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&d(window,"resize",this._onResize,this),$t.any3d&&this.options.transform3DLimit&&(a?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){j(this._resizeRequest),this._resizeRequest=D(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var a=this._getMapPanePos();Math.max(Math.abs(a.x),Math.abs(a.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(a,d){for(var g=[],_,C=d==="mouseout"||d==="mouseover",k=a.target||a.srcElement,W=!1;k;){if(_=this._targets[c(k)],_&&(d==="click"||d==="preclick")&&this._draggableMoved(_)){W=!0;break}if(_&&_.listens(d,!0)&&(C&&!er(k,a)||(g.push(_),C))||k===this._container)break;k=k.parentNode}return!g.length&&!W&&!C&&this.listens(d,!0)&&(g=[this]),g},_isClickDisabled:function(a){for(;a&&a!==this._container;){if(a._leaflet_disable_click)return!0;a=a.parentNode}},_handleDOMEvent:function(a){var d=a.target||a.srcElement;if(!(!this._loaded||d._leaflet_disable_events||a.type==="click"&&this._isClickDisabled(d))){var g=a.type;g==="mousedown"&&le(d),this._fireDOMEvent(a,g)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(a,d,g){if(a.type==="click"){var _=i({},a);_.type="preclick",this._fireDOMEvent(_,_.type,g)}var C=this._findEventTargets(a,d);if(g){for(var k=[],W=0;W<g.length;W++)g[W].listens(d,!0)&&k.push(g[W]);C=k.concat(C)}if(C.length){d==="contextmenu"&&en(a);var et=C[0],ot={originalEvent:a};if(a.type!=="keypress"&&a.type!=="keydown"&&a.type!=="keyup"){var dt=et.getLatLng&&(!et._radius||et._radius<=10);ot.containerPoint=dt?this.latLngToContainerPoint(et.getLatLng()):this.mouseEventToContainerPoint(a),ot.layerPoint=this.containerPointToLayerPoint(ot.containerPoint),ot.latlng=dt?et.getLatLng():this.layerPointToLatLng(ot.layerPoint)}for(W=0;W<C.length;W++)if(C[W].fire(d,ot,!0),ot.originalEvent._stopped||C[W].options.bubblingMouseEvents===!1&&E(this._mouseEvents,d)!==-1)return}},_draggableMoved:function(a){return a=a.dragging&&a.dragging.enabled()?a:this,a.dragging&&a.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var a=0,d=this._handlers.length;a<d;a++)this._handlers[a].disable()},whenReady:function(a,d){return this._loaded?a.call(d||this,{target:this}):this.on("load",a,d),this},_getMapPanePos:function(){return Te(this._mapPane)||new J(0,0)},_moved:function(){var a=this._getMapPanePos();return a&&!a.equals([0,0])},_getTopLeftPoint:function(a,d){var g=a&&d!==void 0?this._getNewPixelOrigin(a,d):this.getPixelOrigin();return g.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(a,d){var g=this.getSize()._divideBy(2);return this.project(a,d)._subtract(g)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(a,d,g){var _=this._getNewPixelOrigin(g,d);return this.project(a,d)._subtract(_)},_latLngBoundsToNewLayerBounds:function(a,d,g){var _=this._getNewPixelOrigin(g,d);return it([this.project(a.getSouthWest(),d)._subtract(_),this.project(a.getNorthWest(),d)._subtract(_),this.project(a.getSouthEast(),d)._subtract(_),this.project(a.getNorthEast(),d)._subtract(_)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(a){return this.latLngToLayerPoint(a).subtract(this._getCenterLayerPoint())},_limitCenter:function(a,d,g){if(!g)return a;var _=this.project(a,d),C=this.getSize().divideBy(2),k=new nt(_.subtract(C),_.add(C)),W=this._getBoundsOffset(k,g,d);return Math.abs(W.x)<=1&&Math.abs(W.y)<=1?a:this.unproject(_.add(W),d)},_limitOffset:function(a,d){if(!d)return a;var g=this.getPixelBounds(),_=new nt(g.min.add(a),g.max.add(a));return a.add(this._getBoundsOffset(_,d))},_getBoundsOffset:function(a,d,g){var _=it(this.project(d.getNorthEast(),g),this.project(d.getSouthWest(),g)),C=_.min.subtract(a.min),k=_.max.subtract(a.max),W=this._rebound(C.x,-k.x),et=this._rebound(C.y,-k.y);return new J(W,et)},_rebound:function(a,d){return a+d>0?Math.round(a-d)/2:Math.max(0,Math.ceil(a))-Math.max(0,Math.floor(d))},_limitZoom:function(a){var d=this.getMinZoom(),g=this.getMaxZoom(),_=$t.any3d?this.options.zoomSnap:1;return _&&(a=Math.round(a/_)*_),Math.max(d,Math.min(g,a))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ae(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(a,d){var g=this._getCenterOffset(a)._trunc();return(d&&d.animate)!==!0&&!this.getSize().contains(g)?!1:(this.panBy(g,d),!0)},_createAnimProxy:function(){var a=this._proxy=ee("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(a),this.on("zoomanim",function(d){var g=_n,_=this._proxy.style[g];qe(this._proxy,this.project(d.center,d.zoom),this.getZoomScale(d.zoom,1)),_===this._proxy.style[g]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){qt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var a=this.getCenter(),d=this.getZoom();qe(this._proxy,this.project(a,d),this.getZoomScale(d,1))},_catchTransitionEnd:function(a){this._animatingZoom&&a.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(a,d,g){if(this._animatingZoom)return!0;if(g=g||{},!this._zoomAnimated||g.animate===!1||this._nothingToAnimate()||Math.abs(d-this._zoom)>this.options.zoomAnimationThreshold)return!1;var _=this.getZoomScale(d),C=this._getCenterOffset(a)._divideBy(1-1/_);return g.animate!==!0&&!this.getSize().contains(C)?!1:(D(function(){this._moveStart(!0,g.noMoveStart||!1)._animateZoom(a,d,!0)},this),!0)},_animateZoom:function(a,d,g,_){this._mapPane&&(g&&(this._animatingZoom=!0,this._animateToCenter=a,this._animateToZoom=d,It(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:a,zoom:d,noUpdate:_}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ae(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ch(a,d){return new Zt(a,d)}var Bn=H.extend({options:{position:"topright"},initialize:function(a){p(this,a)},getPosition:function(){return this.options.position},setPosition:function(a){var d=this._map;return d&&d.removeControl(this),this.options.position=a,d&&d.addControl(this),this},getContainer:function(){return this._container},addTo:function(a){this.remove(),this._map=a;var d=this._container=this.onAdd(a),g=this.getPosition(),_=a._controlCorners[g];return It(d,"leaflet-control"),g.indexOf("bottom")!==-1?_.insertBefore(d,_.firstChild):_.appendChild(d),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(qt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(a){this._map&&a&&a.screenX>0&&a.screenY>0&&this._map.getContainer().focus()}}),Es=function(a){return new Bn(a)};Zt.include({addControl:function(a){return a.addTo(this),this},removeControl:function(a){return a.remove(),this},_initControlPos:function(){var a=this._controlCorners={},d="leaflet-",g=this._controlContainer=ee("div",d+"control-container",this._container);function _(C,k){var W=d+C+" "+d+k;a[C+k]=ee("div",W,g)}_("top","left"),_("top","right"),_("bottom","left"),_("bottom","right")},_clearControlPos:function(){for(var a in this._controlCorners)qt(this._controlCorners[a]);qt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Oh=Bn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(a,d,g,_){return g<_?-1:_<g?1:0}},initialize:function(a,d,g){p(this,g),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var _ in a)this._addLayer(a[_],_);for(_ in d)this._addLayer(d[_],_,!0)},onAdd:function(a){this._initLayout(),this._update(),this._map=a,a.on("zoomend",this._checkDisabledLayers,this);for(var d=0;d<this._layers.length;d++)this._layers[d].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(a){return Bn.prototype.addTo.call(this,a),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var a=0;a<this._layers.length;a++)this._layers[a].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(a,d){return this._addLayer(a,d),this._map?this._update():this},addOverlay:function(a,d){return this._addLayer(a,d,!0),this._map?this._update():this},removeLayer:function(a){a.off("add remove",this._onLayerChange,this);var d=this._getLayer(c(a));return d&&this._layers.splice(this._layers.indexOf(d),1),this._map?this._update():this},expand:function(){It(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var a=this._map.getSize().y-(this._container.offsetTop+50);return a<this._section.clientHeight?(It(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=a+"px"):ae(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ae(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var a="leaflet-control-layers",d=this._container=ee("div",a),g=this.options.collapsed;d.setAttribute("aria-haspopup",!0),ko(d),ci(d);var _=this._section=ee("section",a+"-list");g&&(this._map.on("click",this.collapse,this),Dt(d,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var C=this._layersLink=ee("a",a+"-toggle",d);C.href="#",C.title="Layers",C.setAttribute("role","button"),Dt(C,{keydown:function(k){k.keyCode===13&&this._expandSafely()},click:function(k){en(k),this._expandSafely()}},this),g||this.expand(),this._baseLayersList=ee("div",a+"-base",_),this._separator=ee("div",a+"-separator",_),this._overlaysList=ee("div",a+"-overlays",_),d.appendChild(_)},_getLayer:function(a){for(var d=0;d<this._layers.length;d++)if(this._layers[d]&&c(this._layers[d].layer)===a)return this._layers[d]},_addLayer:function(a,d,g){this._map&&a.on("add remove",this._onLayerChange,this),this._layers.push({layer:a,name:d,overlay:g}),this.options.sortLayers&&this._layers.sort(s(function(_,C){return this.options.sortFunction(_.layer,C.layer,_.name,C.name)},this)),this.options.autoZIndex&&a.setZIndex&&(this._lastZIndex++,a.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;mr(this._baseLayersList),mr(this._overlaysList),this._layerControlInputs=[];var a,d,g,_,C=0;for(g=0;g<this._layers.length;g++)_=this._layers[g],this._addItem(_),d=d||_.overlay,a=a||!_.overlay,C+=_.overlay?0:1;return this.options.hideSingleBase&&(a=a&&C>1,this._baseLayersList.style.display=a?"":"none"),this._separator.style.display=d&&a?"":"none",this},_onLayerChange:function(a){this._handlingClick||this._update();var d=this._getLayer(c(a.target)),g=d.overlay?a.type==="add"?"overlayadd":"overlayremove":a.type==="add"?"baselayerchange":null;g&&this._map.fire(g,d)},_createRadioElement:function(a,d){var g='<input type="radio" class="leaflet-control-layers-selector" name="'+a+'"'+(d?' checked="checked"':"")+"/>",_=document.createElement("div");return _.innerHTML=g,_.firstChild},_addItem:function(a){var d=document.createElement("label"),g=this._map.hasLayer(a.layer),_;a.overlay?(_=document.createElement("input"),_.type="checkbox",_.className="leaflet-control-layers-selector",_.defaultChecked=g):_=this._createRadioElement("leaflet-base-layers_"+c(this),g),this._layerControlInputs.push(_),_.layerId=c(a.layer),Dt(_,"click",this._onInputClick,this);var C=document.createElement("span");C.innerHTML=" "+a.name;var k=document.createElement("span");d.appendChild(k),k.appendChild(_),k.appendChild(C);var W=a.overlay?this._overlaysList:this._baseLayersList;return W.appendChild(d),this._checkDisabledLayers(),d},_onInputClick:function(){if(!this._preventClick){var a=this._layerControlInputs,d,g,_=[],C=[];this._handlingClick=!0;for(var k=a.length-1;k>=0;k--)d=a[k],g=this._getLayer(d.layerId).layer,d.checked?_.push(g):d.checked||C.push(g);for(k=0;k<C.length;k++)this._map.hasLayer(C[k])&&this._map.removeLayer(C[k]);for(k=0;k<_.length;k++)this._map.hasLayer(_[k])||this._map.addLayer(_[k]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var a=this._layerControlInputs,d,g,_=this._map.getZoom(),C=a.length-1;C>=0;C--)d=a[C],g=this._getLayer(d.layerId).layer,d.disabled=g.options.minZoom!==void 0&&_<g.options.minZoom||g.options.maxZoom!==void 0&&_>g.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var a=this._section;this._preventClick=!0,Dt(a,"click",en),this.expand();var d=this;setTimeout(function(){Ee(a,"click",en),d._preventClick=!1})}}),wm=function(a,d,g){return new Oh(a,d,g)},bc=Bn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(a){var d="leaflet-control-zoom",g=ee("div",d+" leaflet-bar"),_=this.options;return this._zoomInButton=this._createButton(_.zoomInText,_.zoomInTitle,d+"-in",g,this._zoomIn),this._zoomOutButton=this._createButton(_.zoomOutText,_.zoomOutTitle,d+"-out",g,this._zoomOut),this._updateDisabled(),a.on("zoomend zoomlevelschange",this._updateDisabled,this),g},onRemove:function(a){a.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(a){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(a.shiftKey?3:1))},_zoomOut:function(a){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(a.shiftKey?3:1))},_createButton:function(a,d,g,_,C){var k=ee("a",g,_);return k.innerHTML=a,k.href="#",k.title=d,k.setAttribute("role","button"),k.setAttribute("aria-label",d),ko(k),Dt(k,"click",ui),Dt(k,"click",C,this),Dt(k,"click",this._refocusOnMap,this),k},_updateDisabled:function(){var a=this._map,d="leaflet-disabled";ae(this._zoomInButton,d),ae(this._zoomOutButton,d),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||a._zoom===a.getMinZoom())&&(It(this._zoomOutButton,d),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||a._zoom===a.getMaxZoom())&&(It(this._zoomInButton,d),this._zoomInButton.setAttribute("aria-disabled","true"))}});Zt.mergeOptions({zoomControl:!0}),Zt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new bc,this.addControl(this.zoomControl))});var $n=function(a){return new bc(a)},Mh=Bn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(a){var d="leaflet-control-scale",g=ee("div",d),_=this.options;return this._addScales(_,d+"-line",g),a.on(_.updateWhenIdle?"moveend":"move",this._update,this),a.whenReady(this._update,this),g},onRemove:function(a){a.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(a,d,g){a.metric&&(this._mScale=ee("div",d,g)),a.imperial&&(this._iScale=ee("div",d,g))},_update:function(){var a=this._map,d=a.getSize().y/2,g=a.distance(a.containerPointToLatLng([0,d]),a.containerPointToLatLng([this.options.maxWidth,d]));this._updateScales(g)},_updateScales:function(a){this.options.metric&&a&&this._updateMetric(a),this.options.imperial&&a&&this._updateImperial(a)},_updateMetric:function(a){var d=this._getRoundNum(a),g=d<1e3?d+" m":d/1e3+" km";this._updateScale(this._mScale,g,d/a)},_updateImperial:function(a){var d=a*3.2808399,g,_,C;d>5280?(g=d/5280,_=this._getRoundNum(g),this._updateScale(this._iScale,_+" mi",_/g)):(C=this._getRoundNum(d),this._updateScale(this._iScale,C+" ft",C/d))},_updateScale:function(a,d,g){a.style.width=Math.round(this.options.maxWidth*g)+"px",a.innerHTML=d},_getRoundNum:function(a){var d=Math.pow(10,(Math.floor(a)+"").length-1),g=a/d;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:1,d*g}}),_m=function(a){return new Mh(a)},$o='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',qi=Bn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+($t.inlineSvg?$o+" ":"")+"Leaflet</a>"},initialize:function(a){p(this,a),this._attributions={}},onAdd:function(a){a.attributionControl=this,this._container=ee("div","leaflet-control-attribution"),ko(this._container);for(var d in a._layers)a._layers[d].getAttribution&&this.addAttribution(a._layers[d].getAttribution());return this._update(),a.on("layeradd",this._addAttribution,this),this._container},onRemove:function(a){a.off("layeradd",this._addAttribution,this)},_addAttribution:function(a){a.layer.getAttribution&&(this.addAttribution(a.layer.getAttribution()),a.layer.once("remove",function(){this.removeAttribution(a.layer.getAttribution())},this))},setPrefix:function(a){return this.options.prefix=a,this._update(),this},addAttribution:function(a){return a?(this._attributions[a]||(this._attributions[a]=0),this._attributions[a]++,this._update(),this):this},removeAttribution:function(a){return a?(this._attributions[a]&&(this._attributions[a]--,this._update()),this):this},_update:function(){if(this._map){var a=[];for(var d in this._attributions)this._attributions[d]&&a.push(d);var g=[];this.options.prefix&&g.push(this.options.prefix),a.length&&g.push(a.join(", ")),this._container.innerHTML=g.join(' <span aria-hidden="true">|</span> ')}}});Zt.mergeOptions({attributionControl:!0}),Zt.addInitHook(function(){this.options.attributionControl&&new qi().addTo(this)});var qr=function(a){return new qi(a)};Bn.Layers=Oh,Bn.Zoom=bc,Bn.Scale=Mh,Bn.Attribution=qi,Es.layers=wm,Es.zoom=$n,Es.scale=_m,Es.attribution=qr;var nr=H.extend({initialize:function(a){this._map=a},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});nr.addTo=function(a,d){return a.addHandler(d,this),this};var xc={Events:Y},$e=$t.touch?"touchstart mousedown":"mousedown",Zn=G.extend({options:{clickTolerance:3},initialize:function(a,d,g,_){p(this,_),this._element=a,this._dragStartTarget=d||a,this._preventOutline=g},enable:function(){this._enabled||(Dt(this._dragStartTarget,$e,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Zn._dragging===this&&this.finishDrag(!0),Ee(this._dragStartTarget,$e,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(a){if(this._enabled&&(this._moved=!1,!ve(this._element,"leaflet-zoom-anim"))){if(a.touches&&a.touches.length!==1){Zn._dragging===this&&this.finishDrag();return}if(!(Zn._dragging||a.shiftKey||a.which!==1&&a.button!==1&&!a.touches)&&(Zn._dragging=this,this._preventOutline&&le(this._element),Tr(),Ss(),!this._moving)){this.fire("down");var d=a.touches?a.touches[0]:a,g=Eh(this._element);this._startPoint=new J(d.clientX,d.clientY),this._startPos=Te(this._element),this._parentScale=Mo(g);var _=a.type==="mousedown";Dt(document,_?"mousemove":"touchmove",this._onMove,this),Dt(document,_?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(a){if(this._enabled){if(a.touches&&a.touches.length>1){this._moved=!0;return}var d=a.touches&&a.touches.length===1?a.touches[0]:a,g=new J(d.clientX,d.clientY)._subtract(this._startPoint);!g.x&&!g.y||Math.abs(g.x)+Math.abs(g.y)<this.options.clickTolerance||(g.x/=this._parentScale.x,g.y/=this._parentScale.y,en(a),this._moved||(this.fire("dragstart"),this._moved=!0,It(document.body,"leaflet-dragging"),this._lastTarget=a.target||a.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),It(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(g),this._moving=!0,this._lastEvent=a,this._updatePosition())}},_updatePosition:function(){var a={originalEvent:this._lastEvent};this.fire("predrag",a),ke(this._element,this._newPos),this.fire("drag",a)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(a){ae(document.body,"leaflet-dragging"),this._lastTarget&&(ae(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Ee(document,"mousemove touchmove",this._onMove,this),Ee(document,"mouseup touchend touchcancel",this._onUp,this),Oo(),Vr();var d=this._moved&&this._moving;this._moving=!1,Zn._dragging=!1,d&&this.fire("dragend",{noInertia:a,distance:this._newPos.distanceTo(this._startPos)})}});function kh(a,d,g){var _,C=[1,4,2,8],k,W,et,ot,dt,Pt,kt,Yt;for(k=0,Pt=a.length;k<Pt;k++)a[k]._code=fi(a[k],d);for(et=0;et<4;et++){for(kt=C[et],_=[],k=0,Pt=a.length,W=Pt-1;k<Pt;W=k++)ot=a[k],dt=a[W],ot._code&kt?dt._code&kt||(Yt=hi(dt,ot,kt,d,g),Yt._code=fi(Yt,d),_.push(Yt)):(dt._code&kt&&(Yt=hi(dt,ot,kt,d,g),Yt._code=fi(Yt,d),_.push(Yt)),_.push(ot));a=_}return a}function ka(a,d){var g,_,C,k,W,et,ot,dt,Pt;if(!a||a.length===0)throw new Error("latlngs not passed");rr(a)||(console.warn("latlngs are not flat! Only the first ring will be used"),a=a[0]);var kt=yt([0,0]),Yt=ct(a),fn=Yt.getNorthWest().distanceTo(Yt.getSouthWest())*Yt.getNorthEast().distanceTo(Yt.getNorthWest());fn<1700&&(kt=$a(a));var oe=a.length,St=[];for(g=0;g<oe;g++){var jt=yt(a[g]);St.push(d.project(yt([jt.lat-kt.lat,jt.lng-kt.lng])))}for(et=ot=dt=0,g=0,_=oe-1;g<oe;_=g++)C=St[g],k=St[_],W=C.y*k.x-k.y*C.x,ot+=(C.x+k.x)*W,dt+=(C.y+k.y)*W,et+=W*3;et===0?Pt=St[0]:Pt=[ot/et,dt/et];var Kt=d.unproject(q(Pt));return yt([Kt.lat+kt.lat,Kt.lng+kt.lng])}function $a(a){for(var d=0,g=0,_=0,C=0;C<a.length;C++){var k=yt(a[C]);d+=k.lat,g+=k.lng,_++}return yt([d/_,g/_])}var Gi={__proto__:null,clipPolygon:kh,polygonCenter:ka,centroid:$a};function sn(a,d){if(!d||!a.length)return a.slice();var g=d*d;return a=Sm(a,g),a=$h(a,g),a}function Gr(a,d,g){return Math.sqrt(Os(a,d,g,!0))}function wc(a,d,g){return Os(a,d,g)}function $h(a,d){var g=a.length,_=typeof Uint8Array<"u"?Uint8Array:Array,C=new _(g);C[0]=C[g-1]=1,Ia(a,C,d,0,g-1);var k,W=[];for(k=0;k<g;k++)C[k]&&W.push(a[k]);return W}function Ia(a,d,g,_,C){var k=0,W,et,ot;for(et=_+1;et<=C-1;et++)ot=Os(a[et],a[_],a[C],!0),ot>k&&(W=et,k=ot);k>g&&(d[W]=1,Ia(a,d,g,_,W),Ia(a,d,g,W,C))}function Sm(a,d){for(var g=[a[0]],_=1,C=0,k=a.length;_<k;_++)Pm(a[_],a[C])>d&&(g.push(a[_]),C=_);return C<k-1&&g.push(a[k-1]),g}var _c;function Cs(a,d,g,_,C){var k=_?_c:fi(a,g),W=fi(d,g),et,ot,dt;for(_c=W;;){if(!(k|W))return[a,d];if(k&W)return!1;et=k||W,ot=hi(a,d,et,g,C),dt=fi(ot,g),et===k?(a=ot,k=dt):(d=ot,W=dt)}}function hi(a,d,g,_,C){var k=d.x-a.x,W=d.y-a.y,et=_.min,ot=_.max,dt,Pt;return g&8?(dt=a.x+k*(ot.y-a.y)/W,Pt=ot.y):g&4?(dt=a.x+k*(et.y-a.y)/W,Pt=et.y):g&2?(dt=ot.x,Pt=a.y+W*(ot.x-a.x)/k):g&1&&(dt=et.x,Pt=a.y+W*(et.x-a.x)/k),new J(dt,Pt,C)}function fi(a,d){var g=0;return a.x<d.min.x?g|=1:a.x>d.max.x&&(g|=2),a.y<d.min.y?g|=4:a.y>d.max.y&&(g|=8),g}function Pm(a,d){var g=d.x-a.x,_=d.y-a.y;return g*g+_*_}function Os(a,d,g,_){var C=d.x,k=d.y,W=g.x-C,et=g.y-k,ot=W*W+et*et,dt;return ot>0&&(dt=((a.x-C)*W+(a.y-k)*et)/ot,dt>1?(C=g.x,k=g.y):dt>0&&(C+=W*dt,k+=et*dt)),W=a.x-C,et=a.y-k,_?W*W+et*et:new J(C,k)}function rr(a){return!A(a[0])||typeof a[0][0]!="object"&&typeof a[0][0]<"u"}function Ih(a){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),rr(a)}function Sc(a,d){var g,_,C,k,W,et,ot,dt;if(!a||a.length===0)throw new Error("latlngs not passed");rr(a)||(console.warn("latlngs are not flat! Only the first ring will be used"),a=a[0]);var Pt=yt([0,0]),kt=ct(a),Yt=kt.getNorthWest().distanceTo(kt.getSouthWest())*kt.getNorthEast().distanceTo(kt.getNorthWest());Yt<1700&&(Pt=$a(a));var fn=a.length,oe=[];for(g=0;g<fn;g++){var St=yt(a[g]);oe.push(d.project(yt([St.lat-Pt.lat,St.lng-Pt.lng])))}for(g=0,_=0;g<fn-1;g++)_+=oe[g].distanceTo(oe[g+1])/2;if(_===0)dt=oe[0];else for(g=0,k=0;g<fn-1;g++)if(W=oe[g],et=oe[g+1],C=W.distanceTo(et),k+=C,k>_){ot=(k-_)/C,dt=[et.x-ot*(et.x-W.x),et.y-ot*(et.y-W.y)];break}var jt=d.unproject(q(dt));return yt([jt.lat+Pt.lat,jt.lng+Pt.lng])}var Am={__proto__:null,simplify:sn,pointToSegmentDistance:Gr,closestPointOnSegment:wc,clipSegment:Cs,_getEdgeIntersection:hi,_getBitCode:fi,_sqClosestPointOnSegment:Os,isFlat:rr,_flat:Ih,polylineCenter:Sc},In={project:function(a){return new J(a.lng,a.lat)},unproject:function(a){return new mt(a.y,a.x)},bounds:new nt([-180,-90],[180,90])},gn={R:6378137,R_MINOR:6356752314245179e-9,bounds:new nt([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(a){var d=Math.PI/180,g=this.R,_=a.lat*d,C=this.R_MINOR/g,k=Math.sqrt(1-C*C),W=k*Math.sin(_),et=Math.tan(Math.PI/4-_/2)/Math.pow((1-W)/(1+W),k/2);return _=-g*Math.log(Math.max(et,1e-10)),new J(a.lng*d*g,_)},unproject:function(a){for(var d=180/Math.PI,g=this.R,_=this.R_MINOR/g,C=Math.sqrt(1-_*_),k=Math.exp(-a.y/g),W=Math.PI/2-2*Math.atan(k),et=0,ot=.1,dt;et<15&&Math.abs(ot)>1e-7;et++)dt=C*Math.sin(W),dt=Math.pow((1-dt)/(1+dt),C/2),ot=Math.PI/2-2*Math.atan(k*dt)-W,W+=ot;return new mt(W*d,a.x*d/g)}},Rh={__proto__:null,LonLat:In,Mercator:gn,SphericalMercator:ft},Io=i({},Tt,{code:"EPSG:3395",projection:gn,transformation:function(){var a=.5/(Math.PI*gn.R);return rt(a,.5,-a,.5)}()}),Ra=i({},Tt,{code:"EPSG:4326",projection:In,transformation:rt(1/180,1,-1/180,.5)}),Lh=i({},Et,{projection:In,transformation:rt(1,0,-1,0),scale:function(a){return Math.pow(2,a)},zoom:function(a){return Math.log(a)/Math.LN2},distance:function(a,d){var g=d.lng-a.lng,_=d.lat-a.lat;return Math.sqrt(g*g+_*_)},infinite:!0});Et.Earth=Tt,Et.EPSG3395=Io,Et.EPSG3857=Rt,Et.EPSG900913=bt,Et.EPSG4326=Ra,Et.Simple=Lh;var ir=G.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(a){return a.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(a){return a&&a.removeLayer(this),this},getPane:function(a){return this._map.getPane(a?this.options[a]||a:this.options.pane)},addInteractiveTarget:function(a){return this._map._targets[c(a)]=this,this},removeInteractiveTarget:function(a){return delete this._map._targets[c(a)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(a){var d=a.target;if(d.hasLayer(this)){if(this._map=d,this._zoomAnimated=d._zoomAnimated,this.getEvents){var g=this.getEvents();d.on(g,this),this.once("remove",function(){d.off(g,this)},this)}this.onAdd(d),this.fire("add"),d.fire("layeradd",{layer:this})}}});Zt.include({addLayer:function(a){if(!a._layerAdd)throw new Error("The provided object is not a Layer.");var d=c(a);return this._layers[d]?this:(this._layers[d]=a,a._mapToAdd=this,a.beforeAdd&&a.beforeAdd(this),this.whenReady(a._layerAdd,a),this)},removeLayer:function(a){var d=c(a);return this._layers[d]?(this._loaded&&a.onRemove(this),delete this._layers[d],this._loaded&&(this.fire("layerremove",{layer:a}),a.fire("remove")),a._map=a._mapToAdd=null,this):this},hasLayer:function(a){return c(a)in this._layers},eachLayer:function(a,d){for(var g in this._layers)a.call(d,this._layers[g]);return this},_addLayers:function(a){a=a?A(a)?a:[a]:[];for(var d=0,g=a.length;d<g;d++)this.addLayer(a[d])},_addZoomLimit:function(a){(!isNaN(a.options.maxZoom)||!isNaN(a.options.minZoom))&&(this._zoomBoundLayers[c(a)]=a,this._updateZoomLevels())},_removeZoomLimit:function(a){var d=c(a);this._zoomBoundLayers[d]&&(delete this._zoomBoundLayers[d],this._updateZoomLevels())},_updateZoomLevels:function(){var a=1/0,d=-1/0,g=this._getZoomSpan();for(var _ in this._zoomBoundLayers){var C=this._zoomBoundLayers[_].options;a=C.minZoom===void 0?a:Math.min(a,C.minZoom),d=C.maxZoom===void 0?d:Math.max(d,C.maxZoom)}this._layersMaxZoom=d===-1/0?void 0:d,this._layersMinZoom=a===1/0?void 0:a,g!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var di=ir.extend({initialize:function(a,d){p(this,d),this._layers={};var g,_;if(a)for(g=0,_=a.length;g<_;g++)this.addLayer(a[g])},addLayer:function(a){var d=this.getLayerId(a);return this._layers[d]=a,this._map&&this._map.addLayer(a),this},removeLayer:function(a){var d=a in this._layers?a:this.getLayerId(a);return this._map&&this._layers[d]&&this._map.removeLayer(this._layers[d]),delete this._layers[d],this},hasLayer:function(a){var d=typeof a=="number"?a:this.getLayerId(a);return d in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(a){var d=Array.prototype.slice.call(arguments,1),g,_;for(g in this._layers)_=this._layers[g],_[a]&&_[a].apply(_,d);return this},onAdd:function(a){this.eachLayer(a.addLayer,a)},onRemove:function(a){this.eachLayer(a.removeLayer,a)},eachLayer:function(a,d){for(var g in this._layers)a.call(d,this._layers[g]);return this},getLayer:function(a){return this._layers[a]},getLayers:function(){var a=[];return this.eachLayer(a.push,a),a},setZIndex:function(a){return this.invoke("setZIndex",a)},getLayerId:function(a){return c(a)}}),Nh=function(a,d){return new di(a,d)},Er=di.extend({addLayer:function(a){return this.hasLayer(a)?this:(a.addEventParent(this),di.prototype.addLayer.call(this,a),this.fire("layeradd",{layer:a}))},removeLayer:function(a){return this.hasLayer(a)?(a in this._layers&&(a=this._layers[a]),a.removeEventParent(this),di.prototype.removeLayer.call(this,a),this.fire("layerremove",{layer:a})):this},setStyle:function(a){return this.invoke("setStyle",a)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var a=new at;for(var d in this._layers){var g=this._layers[d];a.extend(g.getBounds?g.getBounds():g.getLatLng())}return a}}),jh=function(a,d){return new Er(a,d)},pi=H.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(a){p(this,a)},createIcon:function(a){return this._createIcon("icon",a)},createShadow:function(a){return this._createIcon("shadow",a)},_createIcon:function(a,d){var g=this._getIconUrl(a);if(!g){if(a==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var _=this._createImg(g,d&&d.tagName==="IMG"?d:null);return this._setIconStyles(_,a),(this.options.crossOrigin||this.options.crossOrigin==="")&&(_.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),_},_setIconStyles:function(a,d){var g=this.options,_=g[d+"Size"];typeof _=="number"&&(_=[_,_]);var C=q(_),k=q(d==="shadow"&&g.shadowAnchor||g.iconAnchor||C&&C.divideBy(2,!0));a.className="leaflet-marker-"+d+" "+(g.className||""),k&&(a.style.marginLeft=-k.x+"px",a.style.marginTop=-k.y+"px"),C&&(a.style.width=C.x+"px",a.style.height=C.y+"px")},_createImg:function(a,d){return d=d||document.createElement("img"),d.src=a,d},_getIconUrl:function(a){return $t.retina&&this.options[a+"RetinaUrl"]||this.options[a+"Url"]}});function Pc(a){return new pi(a)}var Cr=pi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(a){return typeof Cr.imagePath!="string"&&(Cr.imagePath=this._detectIconPath()),(this.options.imagePath||Cr.imagePath)+pi.prototype._getIconUrl.call(this,a)},_stripUrl:function(a){var d=function(g,_,C){var k=_.exec(g);return k&&k[C]};return a=d(a,/^url\((['"])?(.+)\1\)$/,2),a&&d(a,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var a=ee("div","leaflet-default-icon-path",document.body),d=On(a,"background-image")||On(a,"backgroundImage");if(document.body.removeChild(a),d=this._stripUrl(d),d)return d;var g=document.querySelector('link[href$="leaflet.css"]');return g?g.href.substring(0,g.href.length-11-1):""}}),La=nr.extend({initialize:function(a){this._marker=a},addHooks:function(){var a=this._marker._icon;this._draggable||(this._draggable=new Zn(a,a,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),It(a,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ae(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(a){var d=this._marker,g=d._map,_=this._marker.options.autoPanSpeed,C=this._marker.options.autoPanPadding,k=Te(d._icon),W=g.getPixelBounds(),et=g.getPixelOrigin(),ot=it(W.min._subtract(et).add(C),W.max._subtract(et).subtract(C));if(!ot.contains(k)){var dt=q((Math.max(ot.max.x,k.x)-ot.max.x)/(W.max.x-ot.max.x)-(Math.min(ot.min.x,k.x)-ot.min.x)/(W.min.x-ot.min.x),(Math.max(ot.max.y,k.y)-ot.max.y)/(W.max.y-ot.max.y)-(Math.min(ot.min.y,k.y)-ot.min.y)/(W.min.y-ot.min.y)).multiplyBy(_);g.panBy(dt,{animate:!1}),this._draggable._newPos._add(dt),this._draggable._startPos._add(dt),ke(d._icon,this._draggable._newPos),this._onDrag(a),this._panRequest=D(this._adjustPan.bind(this,a))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(a){this._marker.options.autoPan&&(j(this._panRequest),this._panRequest=D(this._adjustPan.bind(this,a)))},_onDrag:function(a){var d=this._marker,g=d._shadow,_=Te(d._icon),C=d._map.layerPointToLatLng(_);g&&ke(g,_),d._latlng=C,a.latlng=C,a.oldLatLng=this._oldLatLng,d.fire("move",a).fire("drag",a)},_onDragEnd:function(a){j(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",a)}}),Ms=ir.extend({options:{icon:new Cr,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(a,d){p(this,d),this._latlng=yt(a)},onAdd:function(a){this._zoomAnimated=this._zoomAnimated&&a.options.markerZoomAnimation,this._zoomAnimated&&a.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(a){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&a.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(a){var d=this._latlng;return this._latlng=yt(a),this.update(),this.fire("move",{oldLatLng:d,latlng:this._latlng})},setZIndexOffset:function(a){return this.options.zIndexOffset=a,this.update()},getIcon:function(){return this.options.icon},setIcon:function(a){return this.options.icon=a,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var a=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(a)}return this},_initIcon:function(){var a=this.options,d="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),g=a.icon.createIcon(this._icon),_=!1;g!==this._icon&&(this._icon&&this._removeIcon(),_=!0,a.title&&(g.title=a.title),g.tagName==="IMG"&&(g.alt=a.alt||"")),It(g,d),a.keyboard&&(g.tabIndex="0",g.setAttribute("role","button")),this._icon=g,a.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Dt(g,"focus",this._panOnFocus,this);var C=a.icon.createShadow(this._shadow),k=!1;C!==this._shadow&&(this._removeShadow(),k=!0),C&&(It(C,d),C.alt=""),this._shadow=C,a.opacity<1&&this._updateOpacity(),_&&this.getPane().appendChild(this._icon),this._initInteraction(),C&&k&&this.getPane(a.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ee(this._icon,"focus",this._panOnFocus,this),qt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&qt(this._shadow),this._shadow=null},_setPos:function(a){this._icon&&ke(this._icon,a),this._shadow&&ke(this._shadow,a),this._zIndex=a.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(a){this._icon&&(this._icon.style.zIndex=this._zIndex+a)},_animateZoom:function(a){var d=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center).round();this._setPos(d)},_initInteraction:function(){if(this.options.interactive&&(It(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),La)){var a=this.options.draggable;this.dragging&&(a=this.dragging.enabled(),this.dragging.disable()),this.dragging=new La(this),a&&this.dragging.enable()}},setOpacity:function(a){return this.options.opacity=a,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var a=this.options.opacity;this._icon&&Mn(this._icon,a),this._shadow&&Mn(this._shadow,a)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var a=this._map;if(a){var d=this.options.icon.options,g=d.iconSize?q(d.iconSize):q(0,0),_=d.iconAnchor?q(d.iconAnchor):q(0,0);a.panInside(this._latlng,{paddingTopLeft:_,paddingBottomRight:g.subtract(_)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Ro(a,d){return new Ms(a,d)}var Zr=ir.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(a){this._renderer=a.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(a){return p(this,a),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&a&&Object.prototype.hasOwnProperty.call(a,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Zi=Zr.extend({options:{fill:!0,radius:10},initialize:function(a,d){p(this,d),this._latlng=yt(a),this._radius=this.options.radius},setLatLng:function(a){var d=this._latlng;return this._latlng=yt(a),this.redraw(),this.fire("move",{oldLatLng:d,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(a){return this.options.radius=this._radius=a,this.redraw()},getRadius:function(){return this._radius},setStyle:function(a){var d=a&&a.radius||this._radius;return Zr.prototype.setStyle.call(this,a),this.setRadius(d),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var a=this._radius,d=this._radiusY||a,g=this._clickTolerance(),_=[a+g,d+g];this._pxBounds=new nt(this._point.subtract(_),this._point.add(_))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(a){return a.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function fe(a,d){return new Zi(a,d)}var Yi=Zi.extend({initialize:function(a,d,g){if(typeof d=="number"&&(d=i({},g,{radius:d})),p(this,d),this._latlng=yt(a),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(a){return this._mRadius=a,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var a=[this._radius,this._radiusY||this._radius];return new at(this._map.layerPointToLatLng(this._point.subtract(a)),this._map.layerPointToLatLng(this._point.add(a)))},setStyle:Zr.prototype.setStyle,_project:function(){var a=this._latlng.lng,d=this._latlng.lat,g=this._map,_=g.options.crs;if(_.distance===Tt.distance){var C=Math.PI/180,k=this._mRadius/Tt.R/C,W=g.project([d+k,a]),et=g.project([d-k,a]),ot=W.add(et).divideBy(2),dt=g.unproject(ot).lat,Pt=Math.acos((Math.cos(k*C)-Math.sin(d*C)*Math.sin(dt*C))/(Math.cos(d*C)*Math.cos(dt*C)))/C;(isNaN(Pt)||Pt===0)&&(Pt=k/Math.cos(Math.PI/180*d)),this._point=ot.subtract(g.getPixelOrigin()),this._radius=isNaN(Pt)?0:ot.x-g.project([dt,a-Pt]).x,this._radiusY=ot.y-W.y}else{var kt=_.unproject(_.project(this._latlng).subtract([this._mRadius,0]));this._point=g.latLngToLayerPoint(this._latlng),this._radius=this._point.x-g.latLngToLayerPoint(kt).x}this._updateBounds()}});function Dh(a,d,g){return new Yi(a,d,g)}var or=Zr.extend({options:{smoothFactor:1,noClip:!1},initialize:function(a,d){p(this,d),this._setLatLngs(a)},getLatLngs:function(){return this._latlngs},setLatLngs:function(a){return this._setLatLngs(a),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(a){for(var d=1/0,g=null,_=Os,C,k,W=0,et=this._parts.length;W<et;W++)for(var ot=this._parts[W],dt=1,Pt=ot.length;dt<Pt;dt++){C=ot[dt-1],k=ot[dt];var kt=_(a,C,k,!0);kt<d&&(d=kt,g=_(a,C,k))}return g&&(g.distance=Math.sqrt(d)),g},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Sc(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(a,d){return d=d||this._defaultShape(),a=yt(a),d.push(a),this._bounds.extend(a),this.redraw()},_setLatLngs:function(a){this._bounds=new at,this._latlngs=this._convertLatLngs(a)},_defaultShape:function(){return rr(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(a){for(var d=[],g=rr(a),_=0,C=a.length;_<C;_++)g?(d[_]=yt(a[_]),this._bounds.extend(d[_])):d[_]=this._convertLatLngs(a[_]);return d},_project:function(){var a=new nt;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,a),this._bounds.isValid()&&a.isValid()&&(this._rawPxBounds=a,this._updateBounds())},_updateBounds:function(){var a=this._clickTolerance(),d=new J(a,a);this._rawPxBounds&&(this._pxBounds=new nt([this._rawPxBounds.min.subtract(d),this._rawPxBounds.max.add(d)]))},_projectLatlngs:function(a,d,g){var _=a[0]instanceof mt,C=a.length,k,W;if(_){for(W=[],k=0;k<C;k++)W[k]=this._map.latLngToLayerPoint(a[k]),g.extend(W[k]);d.push(W)}else for(k=0;k<C;k++)this._projectLatlngs(a[k],d,g)},_clipPoints:function(){var a=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(a))){if(this.options.noClip){this._parts=this._rings;return}var d=this._parts,g,_,C,k,W,et,ot;for(g=0,C=0,k=this._rings.length;g<k;g++)for(ot=this._rings[g],_=0,W=ot.length;_<W-1;_++)et=Cs(ot[_],ot[_+1],a,_,!0),et&&(d[C]=d[C]||[],d[C].push(et[0]),(et[1]!==ot[_+1]||_===W-2)&&(d[C].push(et[1]),C++))}},_simplifyPoints:function(){for(var a=this._parts,d=this.options.smoothFactor,g=0,_=a.length;g<_;g++)a[g]=sn(a[g],d)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(a,d){var g,_,C,k,W,et,ot=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(a))return!1;for(g=0,k=this._parts.length;g<k;g++)for(et=this._parts[g],_=0,W=et.length,C=W-1;_<W;C=_++)if(!(!d&&_===0)&&Gr(a,et[C],et[_])<=ot)return!0;return!1}});function Na(a,d){return new or(a,d)}or._flat=Ih;var Lo=or.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return ka(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(a){var d=or.prototype._convertLatLngs.call(this,a),g=d.length;return g>=2&&d[0]instanceof mt&&d[0].equals(d[g-1])&&d.pop(),d},_setLatLngs:function(a){or.prototype._setLatLngs.call(this,a),rr(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return rr(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var a=this._renderer._bounds,d=this.options.weight,g=new J(d,d);if(a=new nt(a.min.subtract(g),a.max.add(g)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(a))){if(this.options.noClip){this._parts=this._rings;return}for(var _=0,C=this._rings.length,k;_<C;_++)k=kh(this._rings[_],a,!0),k.length&&this._parts.push(k)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(a){var d=!1,g,_,C,k,W,et,ot,dt;if(!this._pxBounds||!this._pxBounds.contains(a))return!1;for(k=0,ot=this._parts.length;k<ot;k++)for(g=this._parts[k],W=0,dt=g.length,et=dt-1;W<dt;et=W++)_=g[W],C=g[et],_.y>a.y!=C.y>a.y&&a.x<(C.x-_.x)*(a.y-_.y)/(C.y-_.y)+_.x&&(d=!d);return d||or.prototype._containsPoint.call(this,a,!0)}});function Bh(a,d){return new Lo(a,d)}var Yr=Er.extend({initialize:function(a,d){p(this,d),this._layers={},a&&this.addData(a)},addData:function(a){var d=A(a)?a:a.features,g,_,C;if(d){for(g=0,_=d.length;g<_;g++)C=d[g],(C.geometries||C.geometry||C.features||C.coordinates)&&this.addData(C);return this}var k=this.options;if(k.filter&&!k.filter(a))return this;var W=ks(a,k);return W?(W.feature=$s(a),W.defaultOptions=W.options,this.resetStyle(W),k.onEachFeature&&k.onEachFeature(a,W),this.addLayer(W)):this},resetStyle:function(a){return a===void 0?this.eachLayer(this.resetStyle,this):(a.options=i({},a.defaultOptions),this._setLayerStyle(a,this.options.style),this)},setStyle:function(a){return this.eachLayer(function(d){this._setLayerStyle(d,a)},this)},_setLayerStyle:function(a,d){a.setStyle&&(typeof d=="function"&&(d=d(a.feature)),a.setStyle(d))}});function ks(a,d){var g=a.type==="Feature"?a.geometry:a,_=g?g.coordinates:null,C=[],k=d&&d.pointToLayer,W=d&&d.coordsToLatLng||Ac,et,ot,dt,Pt;if(!_&&!g)return null;switch(g.type){case"Point":return et=W(_),Tm(k,a,et,d);case"MultiPoint":for(dt=0,Pt=_.length;dt<Pt;dt++)et=W(_[dt]),C.push(Tm(k,a,et,d));return new Er(C);case"LineString":case"MultiLineString":return ot=Tc(_,g.type==="LineString"?0:1,W),new or(ot,d);case"Polygon":case"MultiPolygon":return ot=Tc(_,g.type==="Polygon"?1:2,W),new Lo(ot,d);case"GeometryCollection":for(dt=0,Pt=g.geometries.length;dt<Pt;dt++){var kt=ks({geometry:g.geometries[dt],type:"Feature",properties:a.properties},d);kt&&C.push(kt)}return new Er(C);case"FeatureCollection":for(dt=0,Pt=g.features.length;dt<Pt;dt++){var Yt=ks(g.features[dt],d);Yt&&C.push(Yt)}return new Er(C);default:throw new Error("Invalid GeoJSON object.")}}function Tm(a,d,g,_){return a?a(d,g):new Ms(g,_&&_.markersInheritOptions&&_)}function Ac(a){return new mt(a[1],a[0],a[2])}function Tc(a,d,g){for(var _=[],C=0,k=a.length,W;C<k;C++)W=d?Tc(a[C],d-1,g):(g||Ac)(a[C]),_.push(W);return _}function Ec(a,d){return a=yt(a),a.alt!==void 0?[m(a.lng,d),m(a.lat,d),m(a.alt,d)]:[m(a.lng,d),m(a.lat,d)]}function gr(a,d,g,_){for(var C=[],k=0,W=a.length;k<W;k++)C.push(d?gr(a[k],rr(a[k])?0:d-1,g,_):Ec(a[k],_));return!d&&g&&C.length>0&&C.push(C[0].slice()),C}function Ki(a,d){return a.feature?i({},a.feature,{geometry:d}):$s(d)}function $s(a){return a.type==="Feature"||a.type==="FeatureCollection"?a:{type:"Feature",properties:{},geometry:a}}var Is={toGeoJSON:function(a){return Ki(this,{type:"Point",coordinates:Ec(this.getLatLng(),a)})}};Ms.include(Is),Yi.include(Is),Zi.include(Is),or.include({toGeoJSON:function(a){var d=!rr(this._latlngs),g=gr(this._latlngs,d?1:0,!1,a);return Ki(this,{type:(d?"Multi":"")+"LineString",coordinates:g})}}),Lo.include({toGeoJSON:function(a){var d=!rr(this._latlngs),g=d&&!rr(this._latlngs[0]),_=gr(this._latlngs,g?2:d?1:0,!0,a);return d||(_=[_]),Ki(this,{type:(g?"Multi":"")+"Polygon",coordinates:_})}}),di.include({toMultiPoint:function(a){var d=[];return this.eachLayer(function(g){d.push(g.toGeoJSON(a).geometry.coordinates)}),Ki(this,{type:"MultiPoint",coordinates:d})},toGeoJSON:function(a){var d=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(d==="MultiPoint")return this.toMultiPoint(a);var g=d==="GeometryCollection",_=[];return this.eachLayer(function(C){if(C.toGeoJSON){var k=C.toGeoJSON(a);if(g)_.push(k.geometry);else{var W=$s(k);W.type==="FeatureCollection"?_.push.apply(_,W.features):_.push(W)}}}),g?Ki(this,{geometries:_,type:"GeometryCollection"}):{type:"FeatureCollection",features:_}}});function zh(a,d){return new Yr(a,d)}var Em=zh,ja=ir.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(a,d,g){this._url=a,this._bounds=ct(d),p(this,g)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(It(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){qt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(a){return this.options.opacity=a,this._image&&this._updateOpacity(),this},setStyle:function(a){return a.opacity&&this.setOpacity(a.opacity),this},bringToFront:function(){return this._map&&ye(this._image),this},bringToBack:function(){return this._map&&wt(this._image),this},setUrl:function(a){return this._url=a,this._image&&(this._image.src=a),this},setBounds:function(a){return this._bounds=ct(a),this._map&&this._reset(),this},getEvents:function(){var a={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(a.zoomanim=this._animateZoom),a},setZIndex:function(a){return this.options.zIndex=a,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var a=this._url.tagName==="IMG",d=this._image=a?this._url:ee("img");if(It(d,"leaflet-image-layer"),this._zoomAnimated&&It(d,"leaflet-zoom-animated"),this.options.className&&It(d,this.options.className),d.onselectstart=f,d.onmousemove=f,d.onload=s(this.fire,this,"load"),d.onerror=s(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(d.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),a){this._url=d.src;return}d.src=this._url,d.alt=this.options.alt},_animateZoom:function(a){var d=this._map.getZoomScale(a.zoom),g=this._map._latLngBoundsToNewLayerBounds(this._bounds,a.zoom,a.center).min;qe(this._image,g,d)},_reset:function(){var a=this._image,d=new nt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),g=d.getSize();ke(a,d.min),a.style.width=g.x+"px",a.style.height=g.y+"px"},_updateOpacity:function(){Mn(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var a=this.options.errorOverlayUrl;a&&this._url!==a&&(this._url=a,this._image.src=a)},getCenter:function(){return this._bounds.getCenter()}}),Cm=function(a,d,g){return new ja(a,d,g)},Fh=ja.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var a=this._url.tagName==="VIDEO",d=this._image=a?this._url:ee("video");if(It(d,"leaflet-image-layer"),this._zoomAnimated&&It(d,"leaflet-zoom-animated"),this.options.className&&It(d,this.options.className),d.onselectstart=f,d.onmousemove=f,d.onloadeddata=s(this.fire,this,"load"),a){for(var g=d.getElementsByTagName("source"),_=[],C=0;C<g.length;C++)_.push(g[C].src);this._url=g.length>0?_:[d.src];return}A(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(d.style,"objectFit")&&(d.style.objectFit="fill"),d.autoplay=!!this.options.autoplay,d.loop=!!this.options.loop,d.muted=!!this.options.muted,d.playsInline=!!this.options.playsInline;for(var k=0;k<this._url.length;k++){var W=ee("source");W.src=this._url[k],d.appendChild(W)}}});function Px(a,d,g){return new Fh(a,d,g)}var Wh=ja.extend({_initImage:function(){var a=this._image=this._url;It(a,"leaflet-image-layer"),this._zoomAnimated&&It(a,"leaflet-zoom-animated"),this.options.className&&It(a,this.options.className),a.onselectstart=f,a.onmousemove=f}});function Om(a,d,g){return new Wh(a,d,g)}var Or=ir.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(a,d){a&&(a instanceof mt||A(a))?(this._latlng=yt(a),p(this,d)):(p(this,a),this._source=d),this.options.content&&(this._content=this.options.content)},openOn:function(a){return a=arguments.length?a:this._source._map,a.hasLayer(this)||a.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(a){return this._map?this.close():(arguments.length?this._source=a:a=this._source,this._prepareOpen(),this.openOn(a._map)),this},onAdd:function(a){this._zoomAnimated=a._zoomAnimated,this._container||this._initLayout(),a._fadeAnimated&&Mn(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),a._fadeAnimated&&Mn(this._container,1),this.bringToFront(),this.options.interactive&&(It(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(a){a._fadeAnimated?(Mn(this._container,0),this._removeTimeout=setTimeout(s(qt,void 0,this._container),200)):qt(this._container),this.options.interactive&&(ae(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(a){return this._latlng=yt(a),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(a){return this._content=a,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var a={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(a.zoomanim=this._animateZoom),a},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ye(this._container),this},bringToBack:function(){return this._map&&wt(this._container),this},_prepareOpen:function(a){var d=this._source;if(!d._map)return!1;if(d instanceof Er){d=null;var g=this._source._layers;for(var _ in g)if(g[_]._map){d=g[_];break}if(!d)return!1;this._source=d}if(!a)if(d.getCenter)a=d.getCenter();else if(d.getLatLng)a=d.getLatLng();else if(d.getBounds)a=d.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(a),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var a=this._contentNode,d=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof d=="string")a.innerHTML=d;else{for(;a.hasChildNodes();)a.removeChild(a.firstChild);a.appendChild(d)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var a=this._map.latLngToLayerPoint(this._latlng),d=q(this.options.offset),g=this._getAnchor();this._zoomAnimated?ke(this._container,a.add(g)):d=d.add(a).add(g);var _=this._containerBottom=-d.y,C=this._containerLeft=-Math.round(this._containerWidth/2)+d.x;this._container.style.bottom=_+"px",this._container.style.left=C+"px"}},_getAnchor:function(){return[0,0]}});Zt.include({_initOverlay:function(a,d,g,_){var C=d;return C instanceof a||(C=new a(_).setContent(d)),g&&C.setLatLng(g),C}}),ir.include({_initOverlay:function(a,d,g,_){var C=g;return C instanceof a?(p(C,_),C._source=this):(C=d&&!_?d:new a(_,this),C.setContent(g)),C}});var Da=Or.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(a){return a=arguments.length?a:this._source._map,!a.hasLayer(this)&&a._popup&&a._popup.options.autoClose&&a.removeLayer(a._popup),a._popup=this,Or.prototype.openOn.call(this,a)},onAdd:function(a){Or.prototype.onAdd.call(this,a),a.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Zr||this._source.on("preclick",Hi))},onRemove:function(a){Or.prototype.onRemove.call(this,a),a.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Zr||this._source.off("preclick",Hi))},getEvents:function(){var a=Or.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(a.preclick=this.close),this.options.keepInView&&(a.moveend=this._adjustPan),a},_initLayout:function(){var a="leaflet-popup",d=this._container=ee("div",a+" "+(this.options.className||"")+" leaflet-zoom-animated"),g=this._wrapper=ee("div",a+"-content-wrapper",d);if(this._contentNode=ee("div",a+"-content",g),ko(d),ci(this._contentNode),Dt(d,"contextmenu",Hi),this._tipContainer=ee("div",a+"-tip-container",d),this._tip=ee("div",a+"-tip",this._tipContainer),this.options.closeButton){var _=this._closeButton=ee("a",a+"-close-button",d);_.setAttribute("role","button"),_.setAttribute("aria-label","Close popup"),_.href="#close",_.innerHTML='<span aria-hidden="true">&#215;</span>',Dt(_,"click",function(C){en(C),this.close()},this)}},_updateLayout:function(){var a=this._contentNode,d=a.style;d.width="",d.whiteSpace="nowrap";var g=a.offsetWidth;g=Math.min(g,this.options.maxWidth),g=Math.max(g,this.options.minWidth),d.width=g+1+"px",d.whiteSpace="",d.height="";var _=a.offsetHeight,C=this.options.maxHeight,k="leaflet-popup-scrolled";C&&_>C?(d.height=C+"px",It(a,k)):ae(a,k),this._containerWidth=this._container.offsetWidth},_animateZoom:function(a){var d=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center),g=this._getAnchor();ke(this._container,d.add(g))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var a=this._map,d=parseInt(On(this._container,"marginBottom"),10)||0,g=this._container.offsetHeight+d,_=this._containerWidth,C=new J(this._containerLeft,-g-this._containerBottom);C._add(Te(this._container));var k=a.layerPointToContainerPoint(C),W=q(this.options.autoPanPadding),et=q(this.options.autoPanPaddingTopLeft||W),ot=q(this.options.autoPanPaddingBottomRight||W),dt=a.getSize(),Pt=0,kt=0;k.x+_+ot.x>dt.x&&(Pt=k.x+_-dt.x+ot.x),k.x-Pt-et.x<0&&(Pt=k.x-et.x),k.y+g+ot.y>dt.y&&(kt=k.y+g-dt.y+ot.y),k.y-kt-et.y<0&&(kt=k.y-et.y),(Pt||kt)&&(this.options.keepInView&&(this._autopanning=!0),a.fire("autopanstart").panBy([Pt,kt]))}},_getAnchor:function(){return q(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Vh=function(a,d){return new Da(a,d)};Zt.mergeOptions({closePopupOnClick:!0}),Zt.include({openPopup:function(a,d,g){return this._initOverlay(Da,a,d,g).openOn(this),this},closePopup:function(a){return a=arguments.length?a:this._popup,a&&a.close(),this}}),ir.include({bindPopup:function(a,d){return this._popup=this._initOverlay(Da,this._popup,a,d),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(a){return this._popup&&(this instanceof Er||(this._popup._source=this),this._popup._prepareOpen(a||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(a){return this._popup&&this._popup.setContent(a),this},getPopup:function(){return this._popup},_openPopup:function(a){if(!(!this._popup||!this._map)){ui(a);var d=a.layer||a.target;if(this._popup._source===d&&!(d instanceof Zr)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(a.latlng);return}this._popup._source=d,this.openPopup(a.latlng)}},_movePopup:function(a){this._popup.setLatLng(a.latlng)},_onKeyPress:function(a){a.originalEvent.keyCode===13&&this._openPopup(a)}});var Rs=Or.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(a){Or.prototype.onAdd.call(this,a),this.setOpacity(this.options.opacity),a.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(a){Or.prototype.onRemove.call(this,a),a.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var a=Or.prototype.getEvents.call(this);return this.options.permanent||(a.preclick=this.close),a},_initLayout:function(){var a="leaflet-tooltip",d=a+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=ee("div",d),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(a){var d,g,_=this._map,C=this._container,k=_.latLngToContainerPoint(_.getCenter()),W=_.layerPointToContainerPoint(a),et=this.options.direction,ot=C.offsetWidth,dt=C.offsetHeight,Pt=q(this.options.offset),kt=this._getAnchor();et==="top"?(d=ot/2,g=dt):et==="bottom"?(d=ot/2,g=0):et==="center"?(d=ot/2,g=dt/2):et==="right"?(d=0,g=dt/2):et==="left"?(d=ot,g=dt/2):W.x<k.x?(et="right",d=0,g=dt/2):(et="left",d=ot+(Pt.x+kt.x)*2,g=dt/2),a=a.subtract(q(d,g,!0)).add(Pt).add(kt),ae(C,"leaflet-tooltip-right"),ae(C,"leaflet-tooltip-left"),ae(C,"leaflet-tooltip-top"),ae(C,"leaflet-tooltip-bottom"),It(C,"leaflet-tooltip-"+et),ke(C,a)},_updatePosition:function(){var a=this._map.latLngToLayerPoint(this._latlng);this._setPosition(a)},setOpacity:function(a){this.options.opacity=a,this._container&&Mn(this._container,a)},_animateZoom:function(a){var d=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center);this._setPosition(d)},_getAnchor:function(){return q(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Uh=function(a,d){return new Rs(a,d)};Zt.include({openTooltip:function(a,d,g){return this._initOverlay(Rs,a,d,g).openOn(this),this},closeTooltip:function(a){return a.close(),this}}),ir.include({bindTooltip:function(a,d){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Rs,this._tooltip,a,d),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(a){if(!(!a&&this._tooltipHandlersAdded)){var d=a?"off":"on",g={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?g.add=this._openTooltip:(g.mouseover=this._openTooltip,g.mouseout=this.closeTooltip,g.click=this._openTooltip,this._map?this._addFocusListeners():g.add=this._addFocusListeners),this._tooltip.options.sticky&&(g.mousemove=this._moveTooltip),this[d](g),this._tooltipHandlersAdded=!a}},openTooltip:function(a){return this._tooltip&&(this instanceof Er||(this._tooltip._source=this),this._tooltip._prepareOpen(a)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(a){return this._tooltip&&this._tooltip.setContent(a),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(a){var d=typeof a.getElement=="function"&&a.getElement();d&&(Dt(d,"focus",function(){this._tooltip._source=a,this.openTooltip()},this),Dt(d,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(a){var d=typeof a.getElement=="function"&&a.getElement();d&&d.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(a){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var d=this;this._map.once("moveend",function(){d._openOnceFlag=!1,d._openTooltip(a)});return}this._tooltip._source=a.layer||a.target,this.openTooltip(this._tooltip.options.sticky?a.latlng:void 0)}},_moveTooltip:function(a){var d=a.latlng,g,_;this._tooltip.options.sticky&&a.originalEvent&&(g=this._map.mouseEventToContainerPoint(a.originalEvent),_=this._map.containerPointToLayerPoint(g),d=this._map.layerPointToLatLng(_)),this._tooltip.setLatLng(d)}});var Cc=pi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(a){var d=a&&a.tagName==="DIV"?a:document.createElement("div"),g=this.options;if(g.html instanceof Element?(mr(d),d.appendChild(g.html)):d.innerHTML=g.html!==!1?g.html:"",g.bgPos){var _=q(g.bgPos);d.style.backgroundPosition=-_.x+"px "+-_.y+"px"}return this._setIconStyles(d,"icon"),d},createShadow:function(){return null}});function Hh(a){return new Cc(a)}pi.Default=Cr;var No=ir.extend({options:{tileSize:256,opacity:1,updateWhenIdle:$t.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(a){p(this,a)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(a){a._addZoomLimit(this)},onRemove:function(a){this._removeAllTiles(),qt(this._container),a._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(ye(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(wt(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(a){return this.options.opacity=a,this._updateOpacity(),this},setZIndex:function(a){return this.options.zIndex=a,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var a=this._clampZoom(this._map.getZoom());a!==this._tileZoom&&(this._tileZoom=a,this._updateLevels()),this._update()}return this},getEvents:function(){var a={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=h(this._onMoveEnd,this.options.updateInterval,this)),a.move=this._onMove),this._zoomAnimated&&(a.zoomanim=this._animateZoom),a},createTile:function(){return document.createElement("div")},getTileSize:function(){var a=this.options.tileSize;return a instanceof J?a:new J(a,a)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(a){for(var d=this.getPane().children,g=-a(-1/0,1/0),_=0,C=d.length,k;_<C;_++)k=d[_].style.zIndex,d[_]!==this._container&&k&&(g=a(g,+k));isFinite(g)&&(this.options.zIndex=g+a(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!$t.ielt9){Mn(this._container,this.options.opacity);var a=+new Date,d=!1,g=!1;for(var _ in this._tiles){var C=this._tiles[_];if(!(!C.current||!C.loaded)){var k=Math.min(1,(a-C.loaded)/200);Mn(C.el,k),k<1?d=!0:(C.active?g=!0:this._onOpaqueTile(C),C.active=!0)}}g&&!this._noPrune&&this._pruneTiles(),d&&(j(this._fadeFrame),this._fadeFrame=D(this._updateOpacity,this))}},_onOpaqueTile:f,_initContainer:function(){this._container||(this._container=ee("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var a=this._tileZoom,d=this.options.maxZoom;if(a!==void 0){for(var g in this._levels)g=Number(g),this._levels[g].el.children.length||g===a?(this._levels[g].el.style.zIndex=d-Math.abs(a-g),this._onUpdateLevel(g)):(qt(this._levels[g].el),this._removeTilesAtZoom(g),this._onRemoveLevel(g),delete this._levels[g]);var _=this._levels[a],C=this._map;return _||(_=this._levels[a]={},_.el=ee("div","leaflet-tile-container leaflet-zoom-animated",this._container),_.el.style.zIndex=d,_.origin=C.project(C.unproject(C.getPixelOrigin()),a).round(),_.zoom=a,this._setZoomTransform(_,C.getCenter(),C.getZoom()),f(_.el.offsetWidth),this._onCreateLevel(_)),this._level=_,_}},_onUpdateLevel:f,_onRemoveLevel:f,_onCreateLevel:f,_pruneTiles:function(){if(this._map){var a,d,g=this._map.getZoom();if(g>this.options.maxZoom||g<this.options.minZoom){this._removeAllTiles();return}for(a in this._tiles)d=this._tiles[a],d.retain=d.current;for(a in this._tiles)if(d=this._tiles[a],d.current&&!d.active){var _=d.coords;this._retainParent(_.x,_.y,_.z,_.z-5)||this._retainChildren(_.x,_.y,_.z,_.z+2)}for(a in this._tiles)this._tiles[a].retain||this._removeTile(a)}},_removeTilesAtZoom:function(a){for(var d in this._tiles)this._tiles[d].coords.z===a&&this._removeTile(d)},_removeAllTiles:function(){for(var a in this._tiles)this._removeTile(a)},_invalidateAll:function(){for(var a in this._levels)qt(this._levels[a].el),this._onRemoveLevel(Number(a)),delete this._levels[a];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(a,d,g,_){var C=Math.floor(a/2),k=Math.floor(d/2),W=g-1,et=new J(+C,+k);et.z=+W;var ot=this._tileCoordsToKey(et),dt=this._tiles[ot];return dt&&dt.active?(dt.retain=!0,!0):(dt&&dt.loaded&&(dt.retain=!0),W>_?this._retainParent(C,k,W,_):!1)},_retainChildren:function(a,d,g,_){for(var C=2*a;C<2*a+2;C++)for(var k=2*d;k<2*d+2;k++){var W=new J(C,k);W.z=g+1;var et=this._tileCoordsToKey(W),ot=this._tiles[et];if(ot&&ot.active){ot.retain=!0;continue}else ot&&ot.loaded&&(ot.retain=!0);g+1<_&&this._retainChildren(C,k,g+1,_)}},_resetView:function(a){var d=a&&(a.pinch||a.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),d,d)},_animateZoom:function(a){this._setView(a.center,a.zoom,!0,a.noUpdate)},_clampZoom:function(a){var d=this.options;return d.minNativeZoom!==void 0&&a<d.minNativeZoom?d.minNativeZoom:d.maxNativeZoom!==void 0&&d.maxNativeZoom<a?d.maxNativeZoom:a},_setView:function(a,d,g,_){var C=Math.round(d);this.options.maxZoom!==void 0&&C>this.options.maxZoom||this.options.minZoom!==void 0&&C<this.options.minZoom?C=void 0:C=this._clampZoom(C);var k=this.options.updateWhenZooming&&C!==this._tileZoom;(!_||k)&&(this._tileZoom=C,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),C!==void 0&&this._update(a),g||this._pruneTiles(),this._noPrune=!!g),this._setZoomTransforms(a,d)},_setZoomTransforms:function(a,d){for(var g in this._levels)this._setZoomTransform(this._levels[g],a,d)},_setZoomTransform:function(a,d,g){var _=this._map.getZoomScale(g,a.zoom),C=a.origin.multiplyBy(_).subtract(this._map._getNewPixelOrigin(d,g)).round();$t.any3d?qe(a.el,C,_):ke(a.el,C)},_resetGrid:function(){var a=this._map,d=a.options.crs,g=this._tileSize=this.getTileSize(),_=this._tileZoom,C=this._map.getPixelWorldBounds(this._tileZoom);C&&(this._globalTileRange=this._pxBoundsToTileRange(C)),this._wrapX=d.wrapLng&&!this.options.noWrap&&[Math.floor(a.project([0,d.wrapLng[0]],_).x/g.x),Math.ceil(a.project([0,d.wrapLng[1]],_).x/g.y)],this._wrapY=d.wrapLat&&!this.options.noWrap&&[Math.floor(a.project([d.wrapLat[0],0],_).y/g.x),Math.ceil(a.project([d.wrapLat[1],0],_).y/g.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(a){var d=this._map,g=d._animatingZoom?Math.max(d._animateToZoom,d.getZoom()):d.getZoom(),_=d.getZoomScale(g,this._tileZoom),C=d.project(a,this._tileZoom).floor(),k=d.getSize().divideBy(_*2);return new nt(C.subtract(k),C.add(k))},_update:function(a){var d=this._map;if(d){var g=this._clampZoom(d.getZoom());if(a===void 0&&(a=d.getCenter()),this._tileZoom!==void 0){var _=this._getTiledPixelBounds(a),C=this._pxBoundsToTileRange(_),k=C.getCenter(),W=[],et=this.options.keepBuffer,ot=new nt(C.getBottomLeft().subtract([et,-et]),C.getTopRight().add([et,-et]));if(!(isFinite(C.min.x)&&isFinite(C.min.y)&&isFinite(C.max.x)&&isFinite(C.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var dt in this._tiles){var Pt=this._tiles[dt].coords;(Pt.z!==this._tileZoom||!ot.contains(new J(Pt.x,Pt.y)))&&(this._tiles[dt].current=!1)}if(Math.abs(g-this._tileZoom)>1){this._setView(a,g);return}for(var kt=C.min.y;kt<=C.max.y;kt++)for(var Yt=C.min.x;Yt<=C.max.x;Yt++){var fn=new J(Yt,kt);if(fn.z=this._tileZoom,!!this._isValidTile(fn)){var oe=this._tiles[this._tileCoordsToKey(fn)];oe?oe.current=!0:W.push(fn)}}if(W.sort(function(jt,Kt){return jt.distanceTo(k)-Kt.distanceTo(k)}),W.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var St=document.createDocumentFragment();for(Yt=0;Yt<W.length;Yt++)this._addTile(W[Yt],St);this._level.el.appendChild(St)}}}},_isValidTile:function(a){var d=this._map.options.crs;if(!d.infinite){var g=this._globalTileRange;if(!d.wrapLng&&(a.x<g.min.x||a.x>g.max.x)||!d.wrapLat&&(a.y<g.min.y||a.y>g.max.y))return!1}if(!this.options.bounds)return!0;var _=this._tileCoordsToBounds(a);return ct(this.options.bounds).overlaps(_)},_keyToBounds:function(a){return this._tileCoordsToBounds(this._keyToTileCoords(a))},_tileCoordsToNwSe:function(a){var d=this._map,g=this.getTileSize(),_=a.scaleBy(g),C=_.add(g),k=d.unproject(_,a.z),W=d.unproject(C,a.z);return[k,W]},_tileCoordsToBounds:function(a){var d=this._tileCoordsToNwSe(a),g=new at(d[0],d[1]);return this.options.noWrap||(g=this._map.wrapLatLngBounds(g)),g},_tileCoordsToKey:function(a){return a.x+":"+a.y+":"+a.z},_keyToTileCoords:function(a){var d=a.split(":"),g=new J(+d[0],+d[1]);return g.z=+d[2],g},_removeTile:function(a){var d=this._tiles[a];d&&(qt(d.el),delete this._tiles[a],this.fire("tileunload",{tile:d.el,coords:this._keyToTileCoords(a)}))},_initTile:function(a){It(a,"leaflet-tile");var d=this.getTileSize();a.style.width=d.x+"px",a.style.height=d.y+"px",a.onselectstart=f,a.onmousemove=f,$t.ielt9&&this.options.opacity<1&&Mn(a,this.options.opacity)},_addTile:function(a,d){var g=this._getTilePos(a),_=this._tileCoordsToKey(a),C=this.createTile(this._wrapCoords(a),s(this._tileReady,this,a));this._initTile(C),this.createTile.length<2&&D(s(this._tileReady,this,a,null,C)),ke(C,g),this._tiles[_]={el:C,coords:a,current:!0},d.appendChild(C),this.fire("tileloadstart",{tile:C,coords:a})},_tileReady:function(a,d,g){d&&this.fire("tileerror",{error:d,tile:g,coords:a});var _=this._tileCoordsToKey(a);g=this._tiles[_],g&&(g.loaded=+new Date,this._map._fadeAnimated?(Mn(g.el,0),j(this._fadeFrame),this._fadeFrame=D(this._updateOpacity,this)):(g.active=!0,this._pruneTiles()),d||(It(g.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:g.el,coords:a})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),$t.ielt9||!this._map._fadeAnimated?D(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(a){return a.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(a){var d=new J(this._wrapX?u(a.x,this._wrapX):a.x,this._wrapY?u(a.y,this._wrapY):a.y);return d.z=a.z,d},_pxBoundsToTileRange:function(a){var d=this.getTileSize();return new nt(a.min.unscaleBy(d).floor(),a.max.unscaleBy(d).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var a in this._tiles)if(!this._tiles[a].loaded)return!1;return!0}});function qh(a){return new No(a)}var Xi=No.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(a,d){this._url=a,d=p(this,d),d.detectRetina&&$t.retina&&d.maxZoom>0?(d.tileSize=Math.floor(d.tileSize/2),d.zoomReverse?(d.zoomOffset--,d.minZoom=Math.min(d.maxZoom,d.minZoom+1)):(d.zoomOffset++,d.maxZoom=Math.max(d.minZoom,d.maxZoom-1)),d.minZoom=Math.max(0,d.minZoom)):d.zoomReverse?d.minZoom=Math.min(d.maxZoom,d.minZoom):d.maxZoom=Math.max(d.minZoom,d.maxZoom),typeof d.subdomains=="string"&&(d.subdomains=d.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(a,d){return this._url===a&&d===void 0&&(d=!0),this._url=a,d||this.redraw(),this},createTile:function(a,d){var g=document.createElement("img");return Dt(g,"load",s(this._tileOnLoad,this,d,g)),Dt(g,"error",s(this._tileOnError,this,d,g)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(g.referrerPolicy=this.options.referrerPolicy),g.alt="",g.src=this.getTileUrl(a),g},getTileUrl:function(a){var d={r:$t.retina?"@2x":"",s:this._getSubdomain(a),x:a.x,y:a.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var g=this._globalTileRange.max.y-a.y;this.options.tms&&(d.y=g),d["-y"]=g}return S(this._url,i(d,this.options))},_tileOnLoad:function(a,d){$t.ielt9?setTimeout(s(a,this,null,d),0):a(null,d)},_tileOnError:function(a,d,g){var _=this.options.errorTileUrl;_&&d.getAttribute("src")!==_&&(d.src=_),a(g,d)},_onTileRemove:function(a){a.tile.onload=null},_getZoomForUrl:function(){var a=this._tileZoom,d=this.options.maxZoom,g=this.options.zoomReverse,_=this.options.zoomOffset;return g&&(a=d-a),a+_},_getSubdomain:function(a){var d=Math.abs(a.x+a.y)%this.options.subdomains.length;return this.options.subdomains[d]},_abortLoading:function(){var a,d;for(a in this._tiles)if(this._tiles[a].coords.z!==this._tileZoom&&(d=this._tiles[a].el,d.onload=f,d.onerror=f,!d.complete)){d.src=w;var g=this._tiles[a].coords;qt(d),delete this._tiles[a],this.fire("tileabort",{tile:d,coords:g})}},_removeTile:function(a){var d=this._tiles[a];if(d)return d.el.setAttribute("src",w),No.prototype._removeTile.call(this,a)},_tileReady:function(a,d,g){if(!(!this._map||g&&g.getAttribute("src")===w))return No.prototype._tileReady.call(this,a,d,g)}});function Oc(a,d){return new Xi(a,d)}var Mc=Xi.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(a,d){this._url=a;var g=i({},this.defaultWmsParams);for(var _ in d)_ in this.options||(g[_]=d[_]);d=p(this,d);var C=d.detectRetina&&$t.retina?2:1,k=this.getTileSize();g.width=k.x*C,g.height=k.y*C,this.wmsParams=g},onAdd:function(a){this._crs=this.options.crs||a.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var d=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[d]=this._crs.code,Xi.prototype.onAdd.call(this,a)},getTileUrl:function(a){var d=this._tileCoordsToNwSe(a),g=this._crs,_=it(g.project(d[0]),g.project(d[1])),C=_.min,k=_.max,W=(this._wmsVersion>=1.3&&this._crs===Ra?[C.y,C.x,k.y,k.x]:[C.x,C.y,k.x,k.y]).join(","),et=Xi.prototype.getTileUrl.call(this,a);return et+b(this.wmsParams,et,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+W},setParams:function(a,d){return i(this.wmsParams,a),d||this.redraw(),this}});function Gh(a,d){return new Mc(a,d)}Xi.WMS=Mc,Oc.wms=Gh;var Mr=ir.extend({options:{padding:.1},initialize:function(a){p(this,a),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),It(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var a={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(a.zoomanim=this._onAnimZoom),a},_onAnimZoom:function(a){this._updateTransform(a.center,a.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(a,d){var g=this._map.getZoomScale(d,this._zoom),_=this._map.getSize().multiplyBy(.5+this.options.padding),C=this._map.project(this._center,d),k=_.multiplyBy(-g).add(C).subtract(this._map._getNewPixelOrigin(a,d));$t.any3d?qe(this._container,k,g):ke(this._container,k)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var a in this._layers)this._layers[a]._reset()},_onZoomEnd:function(){for(var a in this._layers)this._layers[a]._project()},_updatePaths:function(){for(var a in this._layers)this._layers[a]._update()},_update:function(){var a=this.options.padding,d=this._map.getSize(),g=this._map.containerPointToLayerPoint(d.multiplyBy(-a)).round();this._bounds=new nt(g,g.add(d.multiplyBy(1+a*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),kc=Mr.extend({options:{tolerance:0},getEvents:function(){var a=Mr.prototype.getEvents.call(this);return a.viewprereset=this._onViewPreReset,a},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Mr.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var a=this._container=document.createElement("canvas");Dt(a,"mousemove",this._onMouseMove,this),Dt(a,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Dt(a,"mouseout",this._handleMouseOut,this),a._leaflet_disable_events=!0,this._ctx=a.getContext("2d")},_destroyContainer:function(){j(this._redrawRequest),delete this._ctx,qt(this._container),Ee(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var a;this._redrawBounds=null;for(var d in this._layers)a=this._layers[d],a._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Mr.prototype._update.call(this);var a=this._bounds,d=this._container,g=a.getSize(),_=$t.retina?2:1;ke(d,a.min),d.width=_*g.x,d.height=_*g.y,d.style.width=g.x+"px",d.style.height=g.y+"px",$t.retina&&this._ctx.scale(2,2),this._ctx.translate(-a.min.x,-a.min.y),this.fire("update")}},_reset:function(){Mr.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(a){this._updateDashArray(a),this._layers[c(a)]=a;var d=a._order={layer:a,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=d),this._drawLast=d,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(a){this._requestRedraw(a)},_removePath:function(a){var d=a._order,g=d.next,_=d.prev;g?g.prev=_:this._drawLast=_,_?_.next=g:this._drawFirst=g,delete a._order,delete this._layers[c(a)],this._requestRedraw(a)},_updatePath:function(a){this._extendRedrawBounds(a),a._project(),a._update(),this._requestRedraw(a)},_updateStyle:function(a){this._updateDashArray(a),this._requestRedraw(a)},_updateDashArray:function(a){if(typeof a.options.dashArray=="string"){var d=a.options.dashArray.split(/[, ]+/),g=[],_,C;for(C=0;C<d.length;C++){if(_=Number(d[C]),isNaN(_))return;g.push(_)}a.options._dashArray=g}else a.options._dashArray=a.options.dashArray},_requestRedraw:function(a){this._map&&(this._extendRedrawBounds(a),this._redrawRequest=this._redrawRequest||D(this._redraw,this))},_extendRedrawBounds:function(a){if(a._pxBounds){var d=(a.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new nt,this._redrawBounds.extend(a._pxBounds.min.subtract([d,d])),this._redrawBounds.extend(a._pxBounds.max.add([d,d]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var a=this._redrawBounds;if(a){var d=a.getSize();this._ctx.clearRect(a.min.x,a.min.y,d.x,d.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var a,d=this._redrawBounds;if(this._ctx.save(),d){var g=d.getSize();this._ctx.beginPath(),this._ctx.rect(d.min.x,d.min.y,g.x,g.y),this._ctx.clip()}this._drawing=!0;for(var _=this._drawFirst;_;_=_.next)a=_.layer,(!d||a._pxBounds&&a._pxBounds.intersects(d))&&a._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(a,d){if(this._drawing){var g,_,C,k,W=a._parts,et=W.length,ot=this._ctx;if(et){for(ot.beginPath(),g=0;g<et;g++){for(_=0,C=W[g].length;_<C;_++)k=W[g][_],ot[_?"lineTo":"moveTo"](k.x,k.y);d&&ot.closePath()}this._fillStroke(ot,a)}}},_updateCircle:function(a){if(!(!this._drawing||a._empty())){var d=a._point,g=this._ctx,_=Math.max(Math.round(a._radius),1),C=(Math.max(Math.round(a._radiusY),1)||_)/_;C!==1&&(g.save(),g.scale(1,C)),g.beginPath(),g.arc(d.x,d.y/C,_,0,Math.PI*2,!1),C!==1&&g.restore(),this._fillStroke(g,a)}},_fillStroke:function(a,d){var g=d.options;g.fill&&(a.globalAlpha=g.fillOpacity,a.fillStyle=g.fillColor||g.color,a.fill(g.fillRule||"evenodd")),g.stroke&&g.weight!==0&&(a.setLineDash&&a.setLineDash(d.options&&d.options._dashArray||[]),a.globalAlpha=g.opacity,a.lineWidth=g.weight,a.strokeStyle=g.color,a.lineCap=g.lineCap,a.lineJoin=g.lineJoin,a.stroke())},_onClick:function(a){for(var d=this._map.mouseEventToLayerPoint(a),g,_,C=this._drawFirst;C;C=C.next)g=C.layer,g.options.interactive&&g._containsPoint(d)&&(!(a.type==="click"||a.type==="preclick")||!this._map._draggableMoved(g))&&(_=g);this._fireEvent(_?[_]:!1,a)},_onMouseMove:function(a){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var d=this._map.mouseEventToLayerPoint(a);this._handleMouseHover(a,d)}},_handleMouseOut:function(a){var d=this._hoveredLayer;d&&(ae(this._container,"leaflet-interactive"),this._fireEvent([d],a,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(a,d){if(!this._mouseHoverThrottled){for(var g,_,C=this._drawFirst;C;C=C.next)g=C.layer,g.options.interactive&&g._containsPoint(d)&&(_=g);_!==this._hoveredLayer&&(this._handleMouseOut(a),_&&(It(this._container,"leaflet-interactive"),this._fireEvent([_],a,"mouseover"),this._hoveredLayer=_)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,a),this._mouseHoverThrottled=!0,setTimeout(s(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(a,d,g){this._map._fireDOMEvent(d,g||d.type,a)},_bringToFront:function(a){var d=a._order;if(d){var g=d.next,_=d.prev;if(g)g.prev=_;else return;_?_.next=g:g&&(this._drawFirst=g),d.prev=this._drawLast,this._drawLast.next=d,d.next=null,this._drawLast=d,this._requestRedraw(a)}},_bringToBack:function(a){var d=a._order;if(d){var g=d.next,_=d.prev;if(_)_.next=g;else return;g?g.prev=_:_&&(this._drawLast=_),d.prev=null,d.next=this._drawFirst,this._drawFirst.prev=d,this._drawFirst=d,this._requestRedraw(a)}}});function $c(a){return $t.canvas?new kc(a):null}var jo=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(a){return document.createElement("<lvml:"+a+' class="lvml">')}}catch{}return function(a){return document.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Zh={_initContainer:function(){this._container=ee("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Mr.prototype._update.call(this),this.fire("update"))},_initPath:function(a){var d=a._container=jo("shape");It(d,"leaflet-vml-shape "+(this.options.className||"")),d.coordsize="1 1",a._path=jo("path"),d.appendChild(a._path),this._updateStyle(a),this._layers[c(a)]=a},_addPath:function(a){var d=a._container;this._container.appendChild(d),a.options.interactive&&a.addInteractiveTarget(d)},_removePath:function(a){var d=a._container;qt(d),a.removeInteractiveTarget(d),delete this._layers[c(a)]},_updateStyle:function(a){var d=a._stroke,g=a._fill,_=a.options,C=a._container;C.stroked=!!_.stroke,C.filled=!!_.fill,_.stroke?(d||(d=a._stroke=jo("stroke")),C.appendChild(d),d.weight=_.weight+"px",d.color=_.color,d.opacity=_.opacity,_.dashArray?d.dashStyle=A(_.dashArray)?_.dashArray.join(" "):_.dashArray.replace(/( *, *)/g," "):d.dashStyle="",d.endcap=_.lineCap.replace("butt","flat"),d.joinstyle=_.lineJoin):d&&(C.removeChild(d),a._stroke=null),_.fill?(g||(g=a._fill=jo("fill")),C.appendChild(g),g.color=_.fillColor||_.color,g.opacity=_.fillOpacity):g&&(C.removeChild(g),a._fill=null)},_updateCircle:function(a){var d=a._point.round(),g=Math.round(a._radius),_=Math.round(a._radiusY||g);this._setPath(a,a._empty()?"M0 0":"AL "+d.x+","+d.y+" "+g+","+_+" 0,"+65535*360)},_setPath:function(a,d){a._path.v=d},_bringToFront:function(a){ye(a._container)},_bringToBack:function(a){wt(a._container)}},M=$t.vml?jo:de,$=Mr.extend({_initContainer:function(){this._container=M("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=M("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){qt(this._container),Ee(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Mr.prototype._update.call(this);var a=this._bounds,d=a.getSize(),g=this._container;(!this._svgSize||!this._svgSize.equals(d))&&(this._svgSize=d,g.setAttribute("width",d.x),g.setAttribute("height",d.y)),ke(g,a.min),g.setAttribute("viewBox",[a.min.x,a.min.y,d.x,d.y].join(" ")),this.fire("update")}},_initPath:function(a){var d=a._path=M("path");a.options.className&&It(d,a.options.className),a.options.interactive&&It(d,"leaflet-interactive"),this._updateStyle(a),this._layers[c(a)]=a},_addPath:function(a){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(a._path),a.addInteractiveTarget(a._path)},_removePath:function(a){qt(a._path),a.removeInteractiveTarget(a._path),delete this._layers[c(a)]},_updatePath:function(a){a._project(),a._update()},_updateStyle:function(a){var d=a._path,g=a.options;d&&(g.stroke?(d.setAttribute("stroke",g.color),d.setAttribute("stroke-opacity",g.opacity),d.setAttribute("stroke-width",g.weight),d.setAttribute("stroke-linecap",g.lineCap),d.setAttribute("stroke-linejoin",g.lineJoin),g.dashArray?d.setAttribute("stroke-dasharray",g.dashArray):d.removeAttribute("stroke-dasharray"),g.dashOffset?d.setAttribute("stroke-dashoffset",g.dashOffset):d.removeAttribute("stroke-dashoffset")):d.setAttribute("stroke","none"),g.fill?(d.setAttribute("fill",g.fillColor||g.color),d.setAttribute("fill-opacity",g.fillOpacity),d.setAttribute("fill-rule",g.fillRule||"evenodd")):d.setAttribute("fill","none"))},_updatePoly:function(a,d){this._setPath(a,ne(a._parts,d))},_updateCircle:function(a){var d=a._point,g=Math.max(Math.round(a._radius),1),_=Math.max(Math.round(a._radiusY),1)||g,C="a"+g+","+_+" 0 1,0 ",k=a._empty()?"M0 0":"M"+(d.x-g)+","+d.y+C+g*2+",0 "+C+-g*2+",0 ";this._setPath(a,k)},_setPath:function(a,d){a._path.setAttribute("d",d)},_bringToFront:function(a){ye(a._path)},_bringToBack:function(a){wt(a._path)}});$t.vml&&$.include(Zh);function I(a){return $t.svg||$t.vml?new $(a):null}Zt.include({getRenderer:function(a){var d=a.options.renderer||this._getPaneRenderer(a.options.pane)||this.options.renderer||this._renderer;return d||(d=this._renderer=this._createRenderer()),this.hasLayer(d)||this.addLayer(d),d},_getPaneRenderer:function(a){if(a==="overlayPane"||a===void 0)return!1;var d=this._paneRenderers[a];return d===void 0&&(d=this._createRenderer({pane:a}),this._paneRenderers[a]=d),d},_createRenderer:function(a){return this.options.preferCanvas&&$c(a)||I(a)}});var Z=Lo.extend({initialize:function(a,d){Lo.prototype.initialize.call(this,this._boundsToLatLngs(a),d)},setBounds:function(a){return this.setLatLngs(this._boundsToLatLngs(a))},_boundsToLatLngs:function(a){return a=ct(a),[a.getSouthWest(),a.getNorthWest(),a.getNorthEast(),a.getSouthEast()]}});function B(a,d){return new Z(a,d)}$.create=M,$.pointsToPath=ne,Yr.geometryToLayer=ks,Yr.coordsToLatLng=Ac,Yr.coordsToLatLngs=Tc,Yr.latLngToCoords=Ec,Yr.latLngsToCoords=gr,Yr.getFeature=Ki,Yr.asFeature=$s,Zt.mergeOptions({boxZoom:!0});var F=nr.extend({initialize:function(a){this._map=a,this._container=a._container,this._pane=a._panes.overlayPane,this._resetStateTimeout=0,a.on("unload",this._destroy,this)},addHooks:function(){Dt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ee(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){qt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(a){if(!a.shiftKey||a.which!==1&&a.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Ss(),Tr(),this._startPoint=this._map.mouseEventToContainerPoint(a),Dt(document,{contextmenu:ui,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(a){this._moved||(this._moved=!0,this._box=ee("div","leaflet-zoom-box",this._container),It(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(a);var d=new nt(this._point,this._startPoint),g=d.getSize();ke(this._box,d.min),this._box.style.width=g.x+"px",this._box.style.height=g.y+"px"},_finish:function(){this._moved&&(qt(this._box),ae(this._container,"leaflet-crosshair")),Vr(),Oo(),Ee(document,{contextmenu:ui,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(a){if(!(a.which!==1&&a.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(s(this._resetState,this),0);var d=new at(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(d).fire("boxzoomend",{boxZoomBounds:d})}},_onKeyDown:function(a){a.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Zt.addInitHook("addHandler","boxZoom",F),Zt.mergeOptions({doubleClickZoom:!0});var Q=nr.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(a){var d=this._map,g=d.getZoom(),_=d.options.zoomDelta,C=a.originalEvent.shiftKey?g-_:g+_;d.options.doubleClickZoom==="center"?d.setZoom(C):d.setZoomAround(a.containerPoint,C)}});Zt.addInitHook("addHandler","doubleClickZoom",Q),Zt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var tt=nr.extend({addHooks:function(){if(!this._draggable){var a=this._map;this._draggable=new Zn(a._mapPane,a._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),a.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),a.on("zoomend",this._onZoomEnd,this),a.whenReady(this._onZoomEnd,this))}It(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ae(this._map._container,"leaflet-grab"),ae(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var a=this._map;if(a._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var d=ct(this._map.options.maxBounds);this._offsetLimit=it(this._map.latLngToContainerPoint(d.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(d.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;a.fire("movestart").fire("dragstart"),a.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(a){if(this._map.options.inertia){var d=this._lastTime=+new Date,g=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(g),this._times.push(d),this._prunePositions(d)}this._map.fire("move",a).fire("drag",a)},_prunePositions:function(a){for(;this._positions.length>1&&a-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var a=this._map.getSize().divideBy(2),d=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=d.subtract(a).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(a,d){return a-(a-d)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var a=this._draggable._newPos.subtract(this._draggable._startPos),d=this._offsetLimit;a.x<d.min.x&&(a.x=this._viscousLimit(a.x,d.min.x)),a.y<d.min.y&&(a.y=this._viscousLimit(a.y,d.min.y)),a.x>d.max.x&&(a.x=this._viscousLimit(a.x,d.max.x)),a.y>d.max.y&&(a.y=this._viscousLimit(a.y,d.max.y)),this._draggable._newPos=this._draggable._startPos.add(a)}},_onPreDragWrap:function(){var a=this._worldWidth,d=Math.round(a/2),g=this._initialWorldOffset,_=this._draggable._newPos.x,C=(_-d+g)%a+d-g,k=(_+d+g)%a-d-g,W=Math.abs(C+g)<Math.abs(k+g)?C:k;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=W},_onDragEnd:function(a){var d=this._map,g=d.options,_=!g.inertia||a.noInertia||this._times.length<2;if(d.fire("dragend",a),_)d.fire("moveend");else{this._prunePositions(+new Date);var C=this._lastPos.subtract(this._positions[0]),k=(this._lastTime-this._times[0])/1e3,W=g.easeLinearity,et=C.multiplyBy(W/k),ot=et.distanceTo([0,0]),dt=Math.min(g.inertiaMaxSpeed,ot),Pt=et.multiplyBy(dt/ot),kt=dt/(g.inertiaDeceleration*W),Yt=Pt.multiplyBy(-kt/2).round();!Yt.x&&!Yt.y?d.fire("moveend"):(Yt=d._limitOffset(Yt,d.options.maxBounds),D(function(){d.panBy(Yt,{duration:kt,easeLinearity:W,noMoveStart:!0,animate:!0})}))}}});Zt.addInitHook("addHandler","dragging",tt),Zt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var X=nr.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(a){this._map=a,this._setPanDelta(a.options.keyboardPanDelta),this._setZoomDelta(a.options.zoomDelta)},addHooks:function(){var a=this._map._container;a.tabIndex<=0&&(a.tabIndex="0"),Dt(a,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ee(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var a=document.body,d=document.documentElement,g=a.scrollTop||d.scrollTop,_=a.scrollLeft||d.scrollLeft;this._map._container.focus(),window.scrollTo(_,g)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(a){var d=this._panKeys={},g=this.keyCodes,_,C;for(_=0,C=g.left.length;_<C;_++)d[g.left[_]]=[-1*a,0];for(_=0,C=g.right.length;_<C;_++)d[g.right[_]]=[a,0];for(_=0,C=g.down.length;_<C;_++)d[g.down[_]]=[0,a];for(_=0,C=g.up.length;_<C;_++)d[g.up[_]]=[0,-1*a]},_setZoomDelta:function(a){var d=this._zoomKeys={},g=this.keyCodes,_,C;for(_=0,C=g.zoomIn.length;_<C;_++)d[g.zoomIn[_]]=a;for(_=0,C=g.zoomOut.length;_<C;_++)d[g.zoomOut[_]]=-a},_addHooks:function(){Dt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ee(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(a){if(!(a.altKey||a.ctrlKey||a.metaKey)){var d=a.keyCode,g=this._map,_;if(d in this._panKeys){if(!g._panAnim||!g._panAnim._inProgress)if(_=this._panKeys[d],a.shiftKey&&(_=q(_).multiplyBy(3)),g.options.maxBounds&&(_=g._limitOffset(q(_),g.options.maxBounds)),g.options.worldCopyJump){var C=g.wrapLatLng(g.unproject(g.project(g.getCenter()).add(_)));g.panTo(C)}else g.panBy(_)}else if(d in this._zoomKeys)g.setZoom(g.getZoom()+(a.shiftKey?3:1)*this._zoomKeys[d]);else if(d===27&&g._popup&&g._popup.options.closeOnEscapeKey)g.closePopup();else return;ui(a)}}});Zt.addInitHook("addHandler","keyboard",X),Zt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var st=nr.extend({addHooks:function(){Dt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ee(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(a){var d=kn(a),g=this._map.options.wheelDebounceTime;this._delta+=d,this._lastMousePos=this._map.mouseEventToContainerPoint(a),this._startTime||(this._startTime=+new Date);var _=Math.max(g-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),_),ui(a)},_performZoom:function(){var a=this._map,d=a.getZoom(),g=this._map.options.zoomSnap||0;a._stop();var _=this._delta/(this._map.options.wheelPxPerZoomLevel*4),C=4*Math.log(2/(1+Math.exp(-Math.abs(_))))/Math.LN2,k=g?Math.ceil(C/g)*g:C,W=a._limitZoom(d+(this._delta>0?k:-k))-d;this._delta=0,this._startTime=null,W&&(a.options.scrollWheelZoom==="center"?a.setZoom(d+W):a.setZoomAround(this._lastMousePos,d+W))}});Zt.addInitHook("addHandler","scrollWheelZoom",st);var gt=600;Zt.mergeOptions({tapHold:$t.touchNative&&$t.safari&&$t.mobile,tapTolerance:15});var vt=nr.extend({addHooks:function(){Dt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ee(this._map._container,"touchstart",this._onDown,this)},_onDown:function(a){if(clearTimeout(this._holdTimeout),a.touches.length===1){var d=a.touches[0];this._startPos=this._newPos=new J(d.clientX,d.clientY),this._holdTimeout=setTimeout(s(function(){this._cancel(),this._isTapValid()&&(Dt(document,"touchend",en),Dt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",d))},this),gt),Dt(document,"touchend touchcancel contextmenu",this._cancel,this),Dt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function a(){Ee(document,"touchend",en),Ee(document,"touchend touchcancel",a)},_cancel:function(){clearTimeout(this._holdTimeout),Ee(document,"touchend touchcancel contextmenu",this._cancel,this),Ee(document,"touchmove",this._onMove,this)},_onMove:function(a){var d=a.touches[0];this._newPos=new J(d.clientX,d.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(a,d){var g=new MouseEvent(a,{bubbles:!0,cancelable:!0,view:window,screenX:d.screenX,screenY:d.screenY,clientX:d.clientX,clientY:d.clientY});g._simulated=!0,d.target.dispatchEvent(g)}});Zt.addInitHook("addHandler","tapHold",vt),Zt.mergeOptions({touchZoom:$t.touch,bounceAtZoomLimits:!0});var pt=nr.extend({addHooks:function(){It(this._map._container,"leaflet-touch-zoom"),Dt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ae(this._map._container,"leaflet-touch-zoom"),Ee(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(a){var d=this._map;if(!(!a.touches||a.touches.length!==2||d._animatingZoom||this._zooming)){var g=d.mouseEventToContainerPoint(a.touches[0]),_=d.mouseEventToContainerPoint(a.touches[1]);this._centerPoint=d.getSize()._divideBy(2),this._startLatLng=d.containerPointToLatLng(this._centerPoint),d.options.touchZoom!=="center"&&(this._pinchStartLatLng=d.containerPointToLatLng(g.add(_)._divideBy(2))),this._startDist=g.distanceTo(_),this._startZoom=d.getZoom(),this._moved=!1,this._zooming=!0,d._stop(),Dt(document,"touchmove",this._onTouchMove,this),Dt(document,"touchend touchcancel",this._onTouchEnd,this),en(a)}},_onTouchMove:function(a){if(!(!a.touches||a.touches.length!==2||!this._zooming)){var d=this._map,g=d.mouseEventToContainerPoint(a.touches[0]),_=d.mouseEventToContainerPoint(a.touches[1]),C=g.distanceTo(_)/this._startDist;if(this._zoom=d.getScaleZoom(C,this._startZoom),!d.options.bounceAtZoomLimits&&(this._zoom<d.getMinZoom()&&C<1||this._zoom>d.getMaxZoom()&&C>1)&&(this._zoom=d._limitZoom(this._zoom)),d.options.touchZoom==="center"){if(this._center=this._startLatLng,C===1)return}else{var k=g._add(_)._divideBy(2)._subtract(this._centerPoint);if(C===1&&k.x===0&&k.y===0)return;this._center=d.unproject(d.project(this._pinchStartLatLng,this._zoom).subtract(k),this._zoom)}this._moved||(d._moveStart(!0,!1),this._moved=!0),j(this._animRequest);var W=s(d._move,d,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=D(W,this,!0),en(a)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,j(this._animRequest),Ee(document,"touchmove",this._onTouchMove,this),Ee(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Zt.addInitHook("addHandler","touchZoom",pt),Zt.BoxZoom=F,Zt.DoubleClickZoom=Q,Zt.Drag=tt,Zt.Keyboard=X,Zt.ScrollWheelZoom=st,Zt.TapHold=vt,Zt.TouchZoom=pt,n.Bounds=nt,n.Browser=$t,n.CRS=Et,n.Canvas=kc,n.Circle=Yi,n.CircleMarker=Zi,n.Class=H,n.Control=Bn,n.DivIcon=Cc,n.DivOverlay=Or,n.DomEvent=yc,n.DomUtil=xm,n.Draggable=Zn,n.Evented=G,n.FeatureGroup=Er,n.GeoJSON=Yr,n.GridLayer=No,n.Handler=nr,n.Icon=pi,n.ImageOverlay=ja,n.LatLng=mt,n.LatLngBounds=at,n.Layer=ir,n.LayerGroup=di,n.LineUtil=Am,n.Map=Zt,n.Marker=Ms,n.Mixin=xc,n.Path=Zr,n.Point=J,n.PolyUtil=Gi,n.Polygon=Lo,n.Polyline=or,n.Popup=Da,n.PosAnimation=vc,n.Projection=Rh,n.Rectangle=Z,n.Renderer=Mr,n.SVG=$,n.SVGOverlay=Wh,n.TileLayer=Xi,n.Tooltip=Rs,n.Transformation=Ct,n.Util=K,n.VideoOverlay=Fh,n.bind=s,n.bounds=it,n.canvas=$c,n.circle=Dh,n.circleMarker=fe,n.control=Es,n.divIcon=Hh,n.extend=i,n.featureGroup=jh,n.geoJSON=zh,n.geoJson=Em,n.gridLayer=qh,n.icon=Pc,n.imageOverlay=Cm,n.latLng=yt,n.latLngBounds=ct,n.layerGroup=Nh,n.map=Ch,n.marker=Ro,n.point=q,n.polygon=Bh,n.polyline=Na,n.popup=Vh,n.rectangle=B,n.setOptions=p,n.stamp=c,n.svg=I,n.svgOverlay=Om,n.tileLayer=Oc,n.tooltip=Uh,n.transformation=rt,n.version=r,n.videoOverlay=Px;var At=window.L;n.noConflict=function(){return window.L=At,this},window.L=n})})(ob,ob.exports);var Ta=ob.exports;function pc(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function _x(e,t){return t==null?function(r,i){const o=v.useRef();return o.current||(o.current=e(r,i)),o}:function(r,i){const o=v.useRef();o.current||(o.current=e(r,i));const s=v.useRef(r),{instance:l}=o.current;return v.useEffect(function(){s.current!==r&&(t(l,r,s.current),s.current=r)},[l,r,i]),o}}function U$(e,t){v.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var o;(o=t.layerContainer)==null||o.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function but(e){return function(n){const r=ym(),i=e(vm(n,r),r);return z$(r.map,n.attribution),wx(i.current,n.eventHandlers),U$(i.current,r),i}}function xut(e,t){const n=v.useRef();v.useEffect(function(){if(t.pathOptions!==n.current){const i=t.pathOptions??{};e.instance.setStyle(i),n.current=i}},[e,t])}function wut(e){return function(n){const r=ym(),i=e(vm(n,r),r);return wx(i.current,n.eventHandlers),U$(i.current,r),xut(i.current,n),i}}function _ut(e,t){const n=_x(e),r=vut(n,t);return gut(r)}function bm(e,t){const n=_x(e,t),r=wut(n);return mut(r)}function Sut(e,t){const n=_x(e,t),r=but(n);return yut(r)}function Put(e,t,n){const{opacity:r,zIndex:i}=t;r!=null&&r!==n.opacity&&e.setOpacity(r),i!=null&&i!==n.zIndex&&e.setZIndex(i)}function H$(){return ym().map}function Aut(e){const t=H$();return v.useEffect(function(){return t.on(e),function(){t.off(e)}},[t,e]),t}const Tut=bm(function({center:t,children:n,...r},i){const o=new Ta.Circle(t,r);return pc(o,gm(i,{overlayContainer:o}))},F$),aT=bm(function({center:t,children:n,...r},i){const o=new Ta.CircleMarker(t,r);return pc(o,gm(i,{overlayContainer:o}))},F$);function sb(){return sb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sb.apply(this,arguments)}function Eut({bounds:e,boundsOptions:t,center:n,children:r,className:i,id:o,placeholder:s,style:l,whenReady:c,zoom:h,...u},f){const[m]=v.useState({className:i,id:o,style:l}),[y,x]=v.useState(null);v.useImperativeHandle(f,()=>(y==null?void 0:y.map)??null,[y]);const p=v.useCallback(P=>{if(P!==null&&y===null){const S=new Ta.Map(P,u);n!=null&&h!=null?S.setView(n,h):e!=null&&S.fitBounds(e,t),c!=null&&S.whenReady(c),x(put(S))}},[]);v.useEffect(()=>()=>{y==null||y.map.remove()},[y]);const b=y?v.createElement(V$,{value:y},r):s??null;return v.createElement("div",sb({},m,{ref:p}),b)}const Cut=v.forwardRef(Eut),lT=bm(function({positions:t,...n},r){const i=new Ta.Polygon(t,n);return pc(i,gm(r,{overlayContainer:i}))},function(t,n,r){n.positions!==r.positions&&t.setLatLngs(n.positions)}),cT=bm(function({positions:t,...n},r){const i=new Ta.Polyline(t,n);return pc(i,gm(r,{overlayContainer:i}))},function(t,n,r){n.positions!==r.positions&&t.setLatLngs(n.positions)}),Out=Sut(function({url:t,...n},r){const i=new Ta.TileLayer(t,vm(n,r));return pc(i,r)},function(t,n,r){Put(t,n,r);const{url:i}=n;i!=null&&i!==r.url&&t.setUrl(i)}),Mut=_ut(function(t,n){const r=new Ta.Tooltip(t,n.overlayContainer);return pc(r,n)},function(t,n,{position:r},i){v.useEffect(function(){const s=n.overlayContainer;if(s==null)return;const{instance:l}=t,c=u=>{u.tooltip===l&&(r!=null&&l.setLatLng(r),l.update(),i(!0))},h=u=>{u.tooltip===l&&i(!1)};return s.on({tooltipopen:c,tooltipclose:h}),s.bindTooltip(l),function(){s.off({tooltipopen:c,tooltipclose:h}),s._map!=null&&s.unbindTooltip()}},[t,n,i,r])});function Ho(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function gi(e,t){let n=t;if(typeof n=="string"){const l=e.interpolateText(n);try{n=JSON.parse(l)}catch{n=l.split(",")}}const r=Array.isArray(n)?n[0]:(n==null?void 0:n.latitude)??(n==null?void 0:n.lat),i=Array.isArray(n)?n[1]:(n==null?void 0:n.longitude)??(n==null?void 0:n.lng),o=Number(e.interpolateText(String(r??""))),s=Number(e.interpolateText(String(i??"")));return Number.isFinite(o)&&Number.isFinite(s)?[o,s]:null}function qg(e,t,n){return e[t||""]??n.map(r=>e[r]).find(Boolean)??""}function ab(e,t,n,r,i){if(e.interactionDisabled)return;const o={...r,latitude:n[0],longitude:n[1],[t.latitudeKey||"latitude"]:n[0],[t.longitudeKey||"longitude"]:n[1]};e.rowContextRef&&(e.rowContextRef.current=o),e.setSceneData(s=>({...s,...o})),i&&e.handleButtonClick(e.interpolateText(i)).catch(()=>{})}function kut({api:e,drawing:t,active:n,points:r}){if(!t||t.controls===!1)return null;const i=t.activeKey||"isDrawing",o=t.activeValue??!0,s=t.inactiveValue??!1,l=t.pointsKey||"draftGeofencePoints",c=u=>e.setSceneData(f=>({...f,...u})),h={alignItems:"center",background:"#ffffff",border:"1px solid #cbd5e1",borderRadius:"6px",color:"#0f172a",cursor:"pointer",display:"flex",fontSize:"12px",fontWeight:700,gap:"6px",minHeight:"34px",padding:"7px 10px"};return U("div",{"aria-live":"polite",style:{display:"flex",flexDirection:"column",gap:"6px",position:"absolute",right:"12px",top:"12px",zIndex:1001}},n?U("div",{style:{background:"#0f172a",borderRadius:"6px",color:"#ffffff",fontSize:"12px",fontWeight:700,padding:"8px 10px"}},`Drawing polygon: ${r.length} points`):U("button",{"aria-label":"Draw geofence",onClick:()=>c({[i]:o,[l]:[]}),style:h,title:"Draw geofence",type:"button"},e.renderIcon("pencil-ruler",15),"Draw fence"),n?U("button",{"aria-label":"Finish geofence",disabled:r.length<3,onClick:()=>c({[i]:s}),style:{...h,opacity:r.length<3?.5:1},title:"Finish geofence",type:"button"},e.renderIcon("check",15),"Finish"):null,U("button",{"aria-label":"Clear geofence draft",onClick:()=>c({[i]:s,[l]:[]}),style:h,title:"Clear geofence draft",type:"button"},e.renderIcon("trash-2",15),"Clear"))}function $ut({center:e,points:t,fitBounds:n,location:r,followLocation:i,followDuration:o}){const s=H$(),l=v.useRef(!1),c=t.map(u=>u.join(",")).join("|"),h=(r==null?void 0:r.join(","))||"";return v.useEffect(()=>{const u=n&&t.length>1,f=u&&!l.current;if(i?f:u){l.current=!0,s.fitBounds(t,{padding:[24,24],maxZoom:16});return}if(i&&r){l.current=!0,s.panTo(r,{animate:!0,duration:Number(o)||.45});return}l.current=!0,s.setView(e,s.getZoom())},[e[0],e[1],n,o,i,h,s,c]),null}function Iut({enabled:e,drawingEnabled:t,onSelect:n,onDrawPoint:r}){return Aut({click:i=>{if(!e)return;const o=[i.latlng.lat,i.latlng.lng];t?r(o):n(o)}}),null}function Rut(e,t){if(!t)return!1;const n=t.activeKey?e.sceneData[t.activeKey]:t.enabled;return t.activeValue===void 0?n===!0||n==="true":String(n)===String(t.activeValue)}function Lut(e,t){return t?Ho(e.sceneData[t.pointsKey||"draftGeofencePoints"]).map(n=>gi(e,n)).filter(n=>n!==null):[]}function Nut(e,t,n){const r=gi(n,t.center);if(r&&t.radius){const o=(e[0]-r[0])*111320,s=(e[1]-r[1])*111320*Math.cos(r[0]*Math.PI/180);return Math.hypot(o,s)<=Number(t.radius)}const i=Ho(typeof t.points=="string"?n.interpolateText(t.points):t.points).map(o=>gi(n,o)).filter(o=>o!==null);return i.length<3?!1:i.reduce((o,s,l)=>{const c=i[(l+i.length-1)%i.length];return s[0]>e[0]!=c[0]>e[0]&&e[1]<(c[1]-s[1])*(e[0]-s[0])/(c[0]-s[0])+s[1]?!o:o},!1)}function jut({api:e,config:t,location:n,fences:r}){const i=JSON.stringify(r),o=(n==null?void 0:n.join(","))||"";return v.useEffect(()=>{if(!n)return;const s=new Set(r.filter(u=>Nut(n,u,e)).map((u,f)=>u.id||String(f))),l=t.geofenceKey||"activeGeofences",c=new Set(Array.isArray(e.sceneData[l])?e.sceneData[l].map(String):[]);(s.size!==c.size||[...s].some(u=>!c.has(u)))&&(e.setSceneData(u=>({...u,[l]:[...s]})),r.forEach((u,f)=>{const m=u.id||String(f),y=s.has(m)&&!c.has(m),x=!s.has(m)&&c.has(m),p=y?u.onEnter||t.onGeofenceEnter:x?u.onExit||t.onGeofenceExit:void 0;p&&ab(e,t,n,{...u,geofenceId:m},p)}))},[e,t,i,r,n,o]),null}function Dut({api:e,config:t,componentKey:n}){var w,T;const r=e.interpolateText(t.dataSource||""),{fetchListData:i}=e;v.useEffect(()=>{r&&i(r,n,0,t.pageSize||50).catch(()=>{})},[n,t.pageSize,r,i]);const s=(r?((w=e.listData)==null?void 0:w[n])||[]:Ho(typeof t.markers=="string"?e.interpolateText(t.markers):t.markers)).map(O=>({source:O,location:gi(e,O)})).filter(O=>O.location!==null),l=Ho(typeof t.route=="string"?e.interpolateText(t.route):t.route).map(O=>gi(e,O)).filter(O=>O!==null),c=gi(e,t.location),h=gi(e,t.center||t)||c||((T=s[0])==null?void 0:T.location)||l[0];t.marker&&h&&s.length===0&&s.push({source:{},location:h});const u=Ho(typeof t.geofences=="string"?e.interpolateText(t.geofences):t.geofences),f=t.drawing,m=Rut(e,f),y=Lut(e,f),x=y.length>2?{id:f.id||f.pointsKey||"drawn-geofence",label:f.label||"Drawn geofence",color:f.color||e.cfg.colors.accent,points:y}:null,p=x?[...u,x]:u,b=(f==null?void 0:f.color)||e.cfg.colors.accent,P={width:"100%",height:t.height||t.h||"360px",minHeight:"180px",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",overflow:"hidden",position:"relative",...t.className?e.parseClassName(t.className):{}},S=e.getCommonProps(n,P,t);if(!h)return U("div",{key:n,...S},t.emptyText||"Map location unavailable");const A=t.interactive!==!1&&!e.interactionDisabled,E=[...s.map(O=>O.location),...l,...c?[c]:[]];return Ze.jsxs("div",{className:t.className,...S,children:[Ze.jsxs(Cut,{center:h,zoom:Math.min(19,Math.max(1,Number(t.zoom)||14)),dragging:A,scrollWheelZoom:A,zoomControl:A,attributionControl:!1,style:{width:"100%",height:"100%"},children:[Ze.jsx(Out,{url:t.tileUrl||"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:t.tileAttribution||"&copy; OpenStreetMap contributors"}),Ze.jsx($ut,{center:h,points:E,fitBounds:t.fitBounds??E.length>1,location:c,followLocation:t.followLocation===!0,followDuration:t.followDuration}),Ze.jsx(Iut,{enabled:A,drawingEnabled:m,onSelect:O=>ab(e,t,O,{},t.onMapClick||t.onClick),onDrawPoint:O=>{const R=(f==null?void 0:f.pointsKey)||"draftGeofencePoints";e.setSceneData(N=>({...N,[R]:[...Ho(N[R]),O]}))}}),Ze.jsx(jut,{api:e,config:t,location:c,fences:p}),l.length>1&&Ze.jsx(cT,{positions:l,pathOptions:{color:t.routeColor||e.cfg.colors.primary,weight:5}}),f&&y.length===1&&Ze.jsx(aT,{center:y[0],radius:6,pathOptions:{color:b,fillColor:b}}),f&&y.length>1&&Ze.jsx(cT,{positions:y,pathOptions:{color:b,dashArray:"8 8",weight:3}}),f&&y.length>2&&Ze.jsx(lT,{positions:y,pathOptions:{color:b,fillColor:b,fillOpacity:.18,weight:2}}),u.map((O,R)=>{const N=O.color||e.cfg.colors.primary,V=gi(e,O.center),D=Ho(typeof O.points=="string"?e.interpolateText(O.points):O.points).map(K=>gi(e,K)).filter(K=>K!==null),j={color:N,fillColor:N,fillOpacity:.14,weight:2};return V&&O.radius?Ze.jsx(Tut,{center:V,radius:Number(O.radius),pathOptions:j},O.id||R):D.length>2?Ze.jsx(lT,{positions:D,pathOptions:j},O.id||R):null}),s.map(({source:O,location:R})=>Ze.jsx(aT,{center:R,radius:Number(O.radius||t.markerRadius)||9,pathOptions:{color:O.color||t.markerColor||e.cfg.colors.primary,fillColor:O.color||t.markerColor||e.cfg.colors.primary,fillOpacity:.9,weight:2},eventHandlers:{click:()=>ab(e,t,R,O,O.onClick||t.onMarkerClick)},children:O.label||O.name?Ze.jsx(Mut,{children:e.interpolateText(O.label||O.name)}):null},O.id||R.join("-")))]}),Ze.jsx(kut,{api:e,drawing:f,active:m,points:y})]},n)}function Gl(e,t,n,r,i,o=!1){if(!Array.isArray(t)||t.length===0)return null;if(r==="row"||o)return t.map((u,f)=>e.renderComponent(u,f,n));const s=[];let l=[];const c=u=>u&&(u.type==="button"||i&&(u.type==="link"||u.type==="a")),h=u=>{l.length!==0&&(l.length===1?s.push(e.renderComponent(l[0],u,n)):s.push(U("div",{key:`${n}-btns-${u}`,style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",gap:"0.75rem"}},...l.map((f,m)=>e.renderComponent(f,u+m,n)))),l=[])};return t.forEach((u,f)=>{c(u)?l.push(u):(h(f),s.push(e.renderComponent(u,f,n)))}),h(t.length),s}function q$(e){return e.className?/\bhidden\b/.test(e.className)&&/\b(sm|md|lg|xl):(?:block|flex|inline|inline-block|inline-flex)\b/.test(e.className):!1}function G$(e){return e.children?e.children.filter(t=>q$(t)):[]}function But(e){return e.children?e.children.filter(t=>!q$(t)):[]}function Z$(e){var t;return Array.isArray((t=e==null?void 0:e.mobileMenu)==null?void 0:t.items)?e.mobileMenu.items:[]}function zut(e){if(!(e.layout==="row"||e.className&&/\bflex-row\b/.test(e.className)))return!1;const n=G$(e),r=Z$(e);if(n.length===0&&r.length===0)return!1;const i=["text","link","button","accordion"];if(!(n.length===0||n.every(c=>i.includes(c.type))))return!1;const s=e.className||"";return/\b(sticky|fixed)\b/.test(s)||/\btop-0\b/.test(s)||/\bz-(10|20|30|40|50)\b/.test(s)||/\bjustify-between\b/.test(s)||e.justify==="space-between"}function uT(e){const t=Z$(e);return t.length>0?t:G$(e)}function hT(e){return But(e)}function fT(e,t,n){return v.createElement("button",{key:"hamburger-icon",onClick:()=>t(!e),style:{background:"none",border:"none",cursor:"pointer",width:"40px",height:"40px",padding:"10px",display:"flex",alignItems:"center",justifyContent:"center",color:n||"inherit",fontSize:"24px",lineHeight:1},"aria-label":e?"Close navigation menu":"Open navigation menu"},v.createElement(e?Xt.FiX:Xt.FiMenu,{size:20}))}function Y$(e){return e=String(e??""),e.replace(/\bhidden\b/g,"").replace(/\b(sm|md|lg|xl|2xl):(block|flex|inline|inline-block|inline-flex)\b/g,"").replace(/\s+/g," ").trim()}function dT(e){const t=(e==null?void 0:e.className)||"";return/\bdrawer\b/.test(t)&&!/\bdrawer-(item|item-[a-z]+)\b/.test(t)}function Ha(e){return/\bburger-first\b/.test((e==null?void 0:e.className)||"")}function pT({navLinks:e,parentKey:t,renderComponentFn:n,open:r,onClose:i,colorMode:o,portalTarget:s,mobileMenu:l,parseMenuClassName:c}){const[h,u]=v.useState(r);if(v.useEffect(()=>{r&&u(!0)},[r]),!r&&!h)return null;const f=e.map(P=>({...P,className:P.className?Y$(P.className):void 0})),m=o!=="light"?"rgba(17, 24, 39, 0.98)":"rgba(255, 255, 255, 0.98)",y=l!=null&&l.className&&c?c(l.className,`${t}-side-drawer-class`):{},x=l!=null&&l.headerClassName&&c?c(l.headerClassName,`${t}-side-header-class`):{},p=()=>{u(!1),i()},b=v.createElement(v.Fragment,null,v.createElement("div",{key:`${t}-side-backdrop`,onClick:p,style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.45)",zIndex:90,opacity:r?1:0,transition:"opacity 0.25s ease",pointerEvents:r?"auto":"none"}}),v.createElement("div",{key:`${t}-side-drawer`,className:l==null?void 0:l.className,style:{position:"absolute",top:0,bottom:0,left:0,width:"min(300px, 85%)",backgroundColor:m,zIndex:100,overflowY:"auto",transform:r?"translateX(0)":"translateX(-100%)",transition:"transform 0.25s ease",boxShadow:"2px 0 12px rgba(0, 0, 0, 0.25)",display:"flex",flexDirection:"column",gap:"4px",padding:"16px 12px",...y}},v.createElement("div",{key:`${t}-side-header`,className:l==null?void 0:l.headerClassName,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4px 8px 12px",borderBottom:"1px solid rgba(128, 128, 128, 0.2)",marginBottom:"8px",fontSize:18,fontWeight:700,...x}},(l==null?void 0:l.title)||"Menu",v.createElement("button",{onClick:p,"aria-label":"Close menu",style:{background:"none",border:"none",cursor:"pointer",fontSize:22,color:"inherit",lineHeight:1}},"✕")),f.map((P,S)=>v.createElement(K$,{key:`${t}-drawer-item-${S}`,link:P,idx:S,parentKey:t,renderComponentFn:n,onClose:p,itemClassName:P.drawerClassName||(l==null?void 0:l.itemClassName),itemStyle:(P.drawerClassName||l!=null&&l.itemClassName)&&c?c(P.drawerClassName||l.itemClassName,`${t}-drawer-item-class-${S}`):void 0}))));return s?ub.createPortal(b,s):b}function K$({link:e,idx:t,parentKey:n,renderComponentFn:r,onClose:i,itemClassName:o,itemStyle:s}){const[l,c]=v.useState(!1),h=e.type==="link"||e.type==="button";return v.createElement("div",{key:`${n}-drawer-item-${t}`,className:o,style:{display:"flex",flexDirection:"row",alignItems:"center",gap:10,width:"100%",padding:"10px 12px",borderRadius:8,cursor:h?"pointer":"default",backgroundColor:l?"rgba(128, 128, 128, 0.12)":"transparent",transition:"background-color 0.15s ease",...s},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onClick:u=>{var m;!u.target.closest("a, button, [role='button']")&&h&&((m=u.currentTarget.querySelector("a, button, [role='button']"))==null||m.click()),h&&i()}},r(e,t+1,`${n}-drawer`))}function mT(e,t,n,r,i,o,s,l){if(!r)return null;const c=e.map(x=>({...x,className:x.className?Y$(x.className):void 0})),h=i!=="light"?"rgba(17, 24, 39, 0.98)":"rgba(255, 255, 255, 0.98)",u=i!=="light"?"rgba(75, 85, 99, 0.5)":"rgba(209, 213, 219, 0.5)",f=s!=null&&s.className&&l?l(s.className,`${t}-mobile-drawer-class`):{},m=(s==null?void 0:s.rawStyle)??{},y=!!(s!=null&&s.inFlow);return v.createElement("div",{key:`${t}-mobile-drawer`,className:s==null?void 0:s.className,style:{position:y?"relative":"absolute",top:y?0:"100%",left:0,right:0,flexBasis:y?"100%":void 0,backgroundColor:h,borderTop:`1px solid ${u}`,padding:"12px",display:"flex",flexDirection:"column",gap:"4px",zIndex:50,boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",...f,...m}},c.map((x,p)=>v.createElement(K$,{key:`${t}-drawer-item-${p}`,link:x,idx:p,parentKey:t,renderComponentFn:n,onClose:()=>o==null?void 0:o(!1),itemClassName:x.drawerClassName||(s==null?void 0:s.itemClassName),itemStyle:(x.drawerClassName||s!=null&&s.itemClassName)&&l?l(x.drawerClassName||s.itemClassName,`${t}-drawer-item-class-${p}`):void 0})))}function Fut(e,t,n){var s;if(t.className){const l=((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className),c=/\bspace-x-/.test(t.className),h=/\bspace-y-/.test(t.className);if(l.display==null&&(l.display=t.layout==="row"||c||h?"flex":"block"),l.flexDirection==null){const f=t.className||"",m=f.match(/\b((sm|md|lg|xl|2xl):)?flex-(row|row-reverse|col|col-reverse)\b/);if(m)l.flexDirection=m[3].startsWith("row")?"row":"column";else if(/(^|\s)((sm|md|lg|xl|2xl):)?flex(\s|$)/.test(f)){const y=/\bmin-h-(screen|\[[^\]]+\])/.test(f)&&/\bitems-center\b/.test(f),x=Array.isArray(t.children)&&t.children.length>0&&t.children.every(p=>p&&["h1","h2","h3","h4","p","text"].includes(p.type));l.flexDirection=y||x?"column":"row"}else c||h?l.flexDirection=c?"row":"column":l.flexDirection=t.layout==="row"?"row":"column"}if(e.renderMode!=="css-driven"){const f=mh(t.className);if(f.px.size>0){const y=zt(f.px,e.containerWidth,"0px");l.paddingLeft=y,l.paddingRight=y}if(f.py.size>0){const y=zt(f.py,e.containerWidth,"0px");l.paddingTop=y,l.paddingBottom=y}if(f.p.size>0){const y=zt(f.p,e.containerWidth,"0px");l.padding=y}const m=tc(t.className);m.size>0&&(l.display=zt(m,e.containerWidth,"flex"))}const u=e.getCommonProps(n,l,t);return v.createElement("div",{key:n,className:t.className,...u},Gl(e,Array.isArray(t.children)?t.children:[],n,l.flexDirection))}const r=e.cfg.colorMode==="light",i={display:"flex",flexDirection:t.layout==="row"?"row":"column",gap:t.gap!==void 0?`${t.gap}px`:"1rem",padding:"1.5rem",borderRadius:"1rem",backdropFilter:"blur(8px)",border:r?"1px solid rgba(0, 0, 0, 0.1)":"1px solid rgba(55, 65, 81, 0.5)"},o=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,...o},Gl(e,t.children,n,i.flexDirection))}function Wut(e,t,n){var l,c,h,u,f;const r=e.isMobileView&&zut(t);if(t.className){const m=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className),y=/\bspace-x-/.test(t.className),x=/\bspace-y-/.test(t.className);if(m.display==null&&(m.display=t.layout==="row"||y||x?"flex":"block"),m.flexDirection==null){const P=t.className||"",S=P.match(/\b((sm|md|lg|xl|2xl):)?flex-(row|row-reverse|col|col-reverse)\b/);if(S)m.flexDirection=S[3].startsWith("row")?"row":"column";else if(/(^|\s)((sm|md|lg|xl|2xl):)?flex(\s|$)/.test(P)){const A=/\bmin-h-(screen|\[[^\]]+\])/.test(P)&&/\bitems-center\b/.test(P),E=Array.isArray(t.children)&&t.children.length>0&&t.children.every(w=>w&&["h1","h2","h3","h4","p","text"].includes(w.type));m.flexDirection=A||E?"column":"row"}else y||x?m.flexDirection=y?"row":"column":m.flexDirection=t.layout==="row"?"row":"column"}if(e.renderMode!=="css-driven"){const P=mh(t.className);if(P.px.size>0){const A=zt(P.px,e.containerWidth,"0px");m.paddingLeft=A,m.paddingRight=A}if(P.py.size>0){const A=zt(P.py,e.containerWidth,"0px");m.paddingTop=A,m.paddingBottom=A}if(P.p.size>0){const A=zt(P.p,e.containerWidth,"0px");m.padding=A}const S=tc(t.className);S.size>0&&(m.display=zt(S,e.containerWidth,"flex"))}if(r&&t.children&&t.children.length>0){const P=hT(t),S=uT(t),A=!!((c=t.mobileMenu)!=null&&c.inFlow);m.position="relative",m.display="flex",m.alignItems="center",m.justifyContent=Ha(t)?"flex-start":"space-between",Ha(t)&&(m.gap=10),A&&(m.flexWrap="wrap",m.height="auto",m.minHeight="64px",m.paddingTop="12px");const E=e.getCommonProps(n,m,t),w=fT(e.mobileMenuOpen,e.setMobileMenuOpen,(h=t.mobileMenu)==null?void 0:h.iconColor),T=(R,N)=>{var V;return((V=e.parseClassNameResponsive)==null?void 0:V.call(e,R,N))??e.parseClassName(R)},O=P.map((R,N)=>e.renderComponent(R,N,n));return v.createElement("div",{key:n,className:t.className,...t.scrollTarget||t.id?{id:t.scrollTarget||t.id}:{},...E},...Ha(t)?[w,...O]:[...O,w],dT(t)?v.createElement(pT,{navLinks:S,parentKey:n,renderComponentFn:e.renderComponent,open:e.mobileMenuOpen,onClose:()=>e.setMobileMenuOpen(!1),colorMode:e.cfg.colorMode,portalTarget:e.portalTarget,mobileMenu:t.mobileMenu,parseMenuClassName:T}):mT(S,n,e.renderComponent,e.mobileMenuOpen,e.cfg.colorMode,e.setMobileMenuOpen,t.mobileMenu,T))}const p=e.getCommonProps(n,m,t),b=t.onClick?{onClick:P=>{P.stopPropagation(),e.handleButtonClick(t.onClick,{})},style:{cursor:"pointer"}}:{};return v.createElement("div",{key:n,className:t.className,...t.scrollTarget||t.id?{id:t.scrollTarget||t.id}:{},...p,...b},Gl(e,Array.isArray(t.children)?t.children:[],n,m.flexDirection,!1,/\bflex-col\b|\bspace-y-/.test(t.className)))}const i={display:"flex",flexDirection:t.layout==="row"?"row":"column",gap:t.gap!==void 0?`${t.gap}px`:"16px"};if(t.align){const m={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};i.alignItems=m[t.align]}if(t.justify){const m={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between"};i.justifyContent=m[t.justify]}if(t.padding!==void 0&&(i.padding=`${t.padding}px`),r&&t.children&&t.children.length>0){const m=hT(t),y=uT(t),x=!!((u=t.mobileMenu)!=null&&u.inFlow);i.position="relative",i.display="flex",i.alignItems="center",i.justifyContent=Ha(t)?"flex-start":"space-between",Ha(t)&&(i.gap=10),x&&(i.flexWrap="wrap",i.height="auto",i.minHeight="64px",i.paddingTop="12px");const p=e.getCommonProps(n,i,t),b=fT(e.mobileMenuOpen,e.setMobileMenuOpen,(f=t.mobileMenu)==null?void 0:f.iconColor),P=(A,E)=>{var w;return((w=e.parseClassNameResponsive)==null?void 0:w.call(e,A,E))??e.parseClassName(A)},S=m.map((A,E)=>e.renderComponent(A,E,n));return v.createElement("div",{key:n,...p},...Ha(t)?[b,...S]:[...S,b],dT(t)?v.createElement(pT,{navLinks:y,parentKey:n,renderComponentFn:e.renderComponent,open:e.mobileMenuOpen,onClose:()=>e.setMobileMenuOpen(!1),colorMode:e.cfg.colorMode,portalTarget:e.portalTarget,mobileMenu:t.mobileMenu,parseMenuClassName:P}):mT(y,n,e.renderComponent,e.mobileMenuOpen,e.cfg.colorMode,e.setMobileMenuOpen,t.mobileMenu,P))}const o=e.getCommonProps(n,i,t),s=t.onClick?{onClick:m=>{m.stopPropagation(),e.handleButtonClick(t.onClick,{})},style:{cursor:"pointer"}}:{};return v.createElement("div",{key:n,...o,...s},Gl(e,t.children,n,i.flexDirection))}function Vut(e,t,n){var o,s;if(t.className){const l=((o=e.parseClassNameResponsive)==null?void 0:o.call(e,t.className,n))??e.parseClassName(t.className);let c;if(e.renderMode!=="css-driven"){const u=mD(t.className),f=u.size>0?gD(u,e.containerWidth):void 0;c={display:"grid",...l,...f!==void 0&&{gridTemplateColumns:`repeat(${f}, minmax(0, 1fr))`}}}else c={display:"grid",...l};const h=e.getCommonProps(n,c,t);return v.createElement("div",{key:n,className:t.className,...h},(Array.isArray(t.children)?t.children:[]).map((u,f)=>e.renderComponent(u,f,n)))}const r={display:"grid",width:"100%",gridTemplateColumns:`repeat(${t.cols||2}, minmax(0, 1fr))`,gap:t.gap!==void 0?`${t.gap}px`:"16px"},i=e.getCommonProps(n,r,t);return v.createElement("div",{key:n,...i},(s=t.children)==null?void 0:s.map((l,c)=>e.renderComponent(l,c,n)))}function Uut(e,t,n){var l,c;if(t.className){const u={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",minHeight:e.containerWidth>0&&e.containerWidth<Eu.md?"300px":"500px",gap:"24px"};(t.bg||t.backgroundColor)&&(u.background=t.bg||t.backgroundColor),t.bgImage&&(u.backgroundImage=`url(${t.bgImage})`,u.backgroundSize="cover",u.backgroundPosition="center");const f={...u,...((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className)};if(Array.isArray(t.children)&&t.children.some(x=>x.type==="grid")||(f.textAlign="center"),e.renderMode!=="css-driven"){const x=mh(t.className);if(x.px.size>0){const p=zt(x.px,e.containerWidth,"0px");f.paddingLeft=p,f.paddingRight=p}if(x.py.size>0){const p=zt(x.py,e.containerWidth,"0px");f.paddingTop=p,f.paddingBottom=p}if(x.p.size>0){const p=zt(x.p,e.containerWidth,"0px");f.padding=p}}const y=e.getCommonProps(n,f,t);return v.createElement("div",{key:n,className:t.className,...y},Gl(e,Array.isArray(t.children)?t.children:[],n,f.flexDirection))}const r=e.containerWidth<Eu.md,i={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",minHeight:r?"300px":"500px",padding:r?"1.5rem":"3rem",background:t.bg||t.backgroundColor,gap:"24px"};t.bgImage&&(i.backgroundImage=`url(${t.bgImage})`,i.backgroundSize="cover",i.backgroundPosition="center"),Array.isArray(t.children)&&t.children.some(h=>h.type==="grid")||(i.textAlign="center");const s=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,...s},(c=t.children)==null?void 0:c.map((h,u)=>e.renderComponent(h,u,n)))}function Hut(e,t,n){var s;const r={display:"flex",flexDirection:"row",alignItems:"center",width:"100%",flexShrink:0,position:"sticky",top:0,zIndex:50,gap:"1.25rem",padding:"0.75rem 1.5rem",backgroundColor:e.cfg.colors.surface,borderBottom:`1px solid ${e.cfg.colors.border}`};if(t.className&&(Object.assign(r,((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className)),e.renderMode!=="css-driven")){const l=mh(t.className);l.px.size>0&&(r.paddingLeft=zt(l.px,e.containerWidth,"0px"),r.paddingRight=zt(l.px,e.containerWidth,"0px")),l.py.size>0&&(r.paddingTop=zt(l.py,e.containerWidth,"0px"),r.paddingBottom=zt(l.py,e.containerWidth,"0px"));const c=tc(t.className);c.size>0&&(r.display=zt(c,e.containerWidth,"flex"))}const i=e.getCommonProps(n,r,t),o=t.className?{key:n,className:t.className,...i}:{key:n,...i};return v.createElement("header",o,(Array.isArray(t.children)?t.children:[]).filter(l=>Array.isArray(l.visibleOn)?l.visibleOn.includes(e.currentSceneId):Array.isArray(l.hiddenOn)?!l.hiddenOn.includes(e.currentSceneId):!0).map((l,c)=>e.renderComponent(l,c,n)))}function qut(e,t,n){var c;const r={display:"flex",flexDirection:t.layout==="row"?"row":"column",width:"100%",flexShrink:0,marginTop:"auto",gap:"1rem",padding:"2.5rem 1.5rem",backgroundColor:e.cfg.colors.surfaceHover,borderTop:`1px solid ${e.cfg.colors.border}`};if(t.className&&(Object.assign(r,((c=e.parseClassNameResponsive)==null?void 0:c.call(e,t.className,n))??e.parseClassName(t.className)),e.renderMode!=="css-driven")){const h=mh(t.className);h.px.size>0&&(r.paddingLeft=zt(h.px,e.containerWidth,"0px"),r.paddingRight=zt(h.px,e.containerWidth,"0px")),h.py.size>0&&(r.paddingTop=zt(h.py,e.containerWidth,"0px"),r.paddingBottom=zt(h.py,e.containerWidth,"0px"))}const i=e.getCommonProps(n,r,t),o=t.className?{key:n,className:t.className,...i}:{key:n,...i};let s=Array.isArray(t.children)?t.children:[];const l=s[0];return l&&l.type==="text"&&/^(\u00a9|\(c\)|copyright)/i.test(String(l.text).trim())&&(s=[...s.slice(1),l]),v.createElement("footer",o,Gl(e,s,n,r.flexDirection,!0))}function Gut({api:e,config:t,componentKey:n}){var b,P;const r=t.queryKey||"placeQuery",i=String(e.sceneData[r]||""),[o,s]=v.useState(i),l=e.interpolateText(t.dataSource||""),c=Number(t.minChars)||3,h=Number(t.debounceMs)||300,{fetchListData:u}=e;v.useEffect(()=>{i!==o&&s(i)},[o,i]),v.useEffect(()=>{if(!l||o.trim().length<c)return;const S=window.setTimeout(()=>{u(l,n,0,t.pageSize||8).catch(()=>{})},h);return()=>window.clearTimeout(S)},[n,t.pageSize,l,h,u,c,o]);const f=l?((b=e.listData)==null?void 0:b[n])||[]:Ho(typeof t.places=="string"?e.interpolateText(t.places):t.places),m={display:"flex",flexDirection:"column",gap:"8px",width:"100%",...t.className?e.parseClassName(t.className):{}},y=e.getCommonProps(n,m,t),x=S=>{const A=qg(S,t.addressField,["address","formattedAddress","formatted_address","vicinity"]),E=gi(e,S),w={...S,[t.valueKey||"address"]:A,...E?{latitude:E[0],longitude:E[1]}:{},...E&&t.latitudeKey?{[t.latitudeKey]:E[0]}:{},...E&&t.longitudeKey?{[t.longitudeKey]:E[1]}:{}};e.rowContextRef&&(e.rowContextRef.current=w),e.setSceneData(O=>({...O,...w}));const T=S.onClick||t.onPlaceClick||t.onClick;T&&e.handleButtonClick(e.interpolateText(T)).catch(()=>{})},p=!((P=e.loading)!=null&&P[n])&&f.length===0&&(!l||o.trim().length>=c);return U("div",{key:n,className:t.className,...y},l&&t.searchable!==!1?U("input",{type:"search",value:o,placeholder:e.interpolateText(t.placeholder||"Search address"),autoComplete:"off",onChange:S=>{const A=S.target.value;s(A),e.setSceneData(E=>({...E,[r]:A}))},style:{width:"100%",padding:"10px 12px",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text}}):null,...f.map((S,A)=>{const E=e.interpolateText(qg(S,t.labelField,["name","title","label"])),w=e.interpolateText(qg(S,t.addressField,["address","formattedAddress","formatted_address","vicinity"]));return U("button",{key:S.id||`${n}-${A}`,type:"button",onClick:()=>!e.interactionDisabled&&x(S),disabled:e.interactionDisabled||void 0,"aria-label":`Select ${E||w||"place"}`,style:{display:"flex",alignItems:"center",gap:"10px",padding:"12px",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,cursor:e.interactionDisabled?"default":"pointer",textAlign:"left",...t.itemClassName?e.parseClassName(t.itemClassName):{}}},e.renderIcon("map-pin",18),U("span",{style:{display:"flex",flex:1,flexDirection:"column",gap:"3px",minWidth:0}},U("strong",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},E||w),E&&w?U("span",{style:{color:e.cfg.colors.textSecondary,fontSize:"13px"}},w):null))}),p?U("span",{style:{color:e.cfg.colors.textMuted,fontSize:"13px"}},t.emptyText||"No addresses found"):null)}const gT=new Map;function Zut(e){let t=gT.get(e);return t||(t=Kf.create(e),gT.set(e,t)),t}function Nt(e,t){if(!(e!=null&&e.motion)||!v.isValidElement(t))return t;const n=t,r=n.props,i=Zut(n.type);return v.createElement(i,{key:n.key,...r,initial:e.initial,animate:e.animate,exit:e.exit,transition:e.transition,variants:e.variants,whileHover:e.whileHover,whileTap:e.whileTap,whileFocus:e.whileFocus,whileInView:e.whileInView,layout:e.animateLayout},r==null?void 0:r.children)}function zf(e,t,n,r=""){var s,l;const i=t,o=`${r}-${n}`;if(Array.isArray(i.hiddenOn)&&i.hiddenOn.includes(e.currentSceneId)||Array.isArray(i.visibleOn)&&!i.visibleOn.includes(e.currentSceneId)||i.condition&&e.evaluateCondition&&!e.evaluateCondition(i.condition,i.__conditionBase))return null;if(!Array.isArray(i.children)&&Array.isArray(i.components)&&(i.children=i.components),i.type==="custom"){const c=i.tagName||"div",h=((s=e.parseClassNameResponsive)==null?void 0:s.call(e,i.className||"",o))??(i.className?e.parseClassName(i.className):{});i.rawStyle&&Object.assign(h,i.rawStyle);const u=e.getCommonProps(o,h,i),f=Array.isArray(i.children)?i.children.map((y,x)=>e.renderComponent(y,x,o)):[],m=i.motion?{motion:i.motion,initial:i.initial,animate:i.animate,exit:i.exit,transition:i.transition,variants:i.variants,whileHover:i.whileHover,whileTap:i.whileTap,whileFocus:i.whileFocus,whileInView:i.whileInView,animateLayout:i.animateLayout}:{};return U(c,{key:o,className:i.className,...u,...m},...f)}if(/^h[1-6]$/.test(i.type)||i.type==="p"||i.type==="span"||i.type==="label"||i.type==="blockquote"||i.type==="strong"||i.type==="em"||i.type==="li"||i.type==="figcaption"||i.type==="th"||i.type==="td"||i.type==="heading"||i.type==="paragraph"||i.type==="address"||i.type==="time"||i.type==="legend"||i.type==="caption"?i.type="text":i.type==="div"||i.type==="article"||i.type==="aside"||i.type==="main"||i.type==="figure"?i.type=i.children?"section":"text":i.type==="a"?i.type="link":i.type==="img"?i.type="image":i.type==="ul"||i.type==="ol"?i.type="list":i.type==="table"||i.type==="thead"||i.type==="tbody"||i.type==="tfoot"||i.type==="tr"?i.type="table":i.type==="br"?i.type="spacer":i.type==="hr"?i.type="divider":i.type==="details"||i.type==="summary"?i.type=i.children?"section":"text":i.type==="nav"?i.type="section":(i.type==="form"&&!i.fields||i.type==="listItem")&&(i.type=i.children?"section":"text"),i.type==="select"&&Array.isArray(i.options)&&typeof i.options[0]=="string"&&(i.options=i.options.map(c=>({label:c,value:c}))),i.type==="dropdown-button"&&!i.items&&i.options&&(i.items=Array.isArray(i.options)&&typeof i.options[0]=="string"?i.options.map(c=>({label:c,value:c})):i.options),(i.type==="input"||i.type==="textarea")&&!i.placeholder&&i.label&&(i.placeholder=i.label),e.imageReplacements&&e.imageReplacements.size>0){const c=e.imageReplacements.get(o);if(c&&c.url){const h={width:"100%",height:"auto",maxHeight:"300px",objectFit:"cover",borderRadius:"0.75rem"},u=e.getCommonProps(o,h,i),f=i.motion?{motion:i.motion,initial:i.initial,animate:i.animate,whileHover:i.whileHover,whileTap:i.whileTap,transition:i.transition,animateLayout:i.animateLayout}:{};return U("img",{key:`${o}-${c.url}`,src:c.url,alt:c.name||"Replacement image",...u,...f})}}switch(i.type){case"text":return Nt(i,hct(e,i,o));case"html":return Nt(i,dct(e,i,o));case"link":return Nt(i,pct(e,i,o));case"button":return Nt(i,mct(e,i,o));case"image":return Nt(i,gct(e,i,o));case"input":return Nt(i,yct(e,i,o));case"hidden":return Nt(i,vct(e,i,o));case"select":return Nt(i,bct(e,i,o));case"checkbox":return Nt(i,xct(e,i,o));case"card":return Nt(i,Fut(e,i,o));case"section":case"container":case"cta_section":return Nt(i,Wut(e,i,o));case"header":return Nt(i,Hut(e,i,o));case"grid":case"features_grid":return Nt(i,Vut(e,i,o));case"hero":return Nt(i,Uut(e,i,o));case"footer":return Nt(i,qut(e,i,o));case"spacer":return Nt(i,Mct(e,i,o));case"divider":return Nt(i,kct(e,i,o));case"list":return Nt(i,bD(e,i,o));case"table":return Nt(i,wD(e,i,o));case"badge":return Nt(i,wct(e,i,o));case"tag":return Nt(i,_ct(e,i,o));case"avatar":return Nt(i,Sct(e,i,o));case"progress":return Nt(i,Pct(e,i,o));case"recorder":return v.createElement(cut,{api:e,config:i,key:o});case"live-cast":return v.createElement(uut,{api:e,config:i,componentKey:o,key:o});case"tabs":return Nt(i,yD(e,i,o));case"accordion":return Nt(i,vD(e,i,o));case"bottom_nav":return Nt(i,sut(e,i,o));case"split":return Nt(i,aut(e,i,o));case"theme_toggle":return Nt(i,lut(e,i,o));case"slider":case"carousel":return Nt(i,Ect(e,i,o));case"marquee":return Nt(i,Cct(e,i,o));case"camera":case"capture":return Nt(i,Oct(e,i,o));case"phaser_game":return Nt(i,((l=e.renderPhaserGame)==null?void 0:l.call(e,i,o))??null);case"search":return Nt(i,Act(e,i,o));case"breadcrumb":return Nt(i,Tct(e,i,o));case"form":return Nt(i,Jct(e,i,o));case"textarea":return Nt(i,Ict(e,i,o));case"diagnostics_chat":return Nt(i,v.createElement(fut,{api:e,config:i,componentKey:o}));case"icon":return Nt(i,Rct(e,i,o));case"markdown":return Nt(i,out(e,i,o));case"dropdown-button":return Nt(i,Zct(e,i,o));case"widget":return Nt(i,Yct(e,i,o));case"advanced-select":return Nt(i,Kct(e,i,o));case"metric_display":return Nt(i,Lct(e,i,o));case"bar_chart":return Nt(i,Nct(e,i,o));case"line_chart":return Nt(i,Hg(e,i,o,!1));case"area_chart":return Nt(i,Hg(e,i,o,!0));case"pie_chart":return Nt(i,sT(e,i,o));case"donut_chart":return Nt(i,sT(e,i,o,!0));case"scatter_chart":return Nt(i,jct(e,i,o));case"candlestick":return Nt(i,Hg(e,i,o,!1,!0));case"fx_ticker":return Nt(i,Bct(e,i,o));case"trading_view":return Nt(i,Fct(e,i,o));case"loader":return Nt(i,$ct(e,i,o));case"map":return v.createElement(Dut,{api:e,config:i,componentKey:o,key:o});case"places":return v.createElement(Gut,{api:e,config:i,componentKey:o,key:o});case"flow_diagram":return Nt(i,Wct(e,i,o));case"flow":return Nt(i,Uct(e,i,o));default:return Nt(i,Hct(e,i,o))}}function X$(e){const t=new Map,n=new Map;for(const r of e)if(r.type==="render_scene"&&r.route){const i=r.route.startsWith("/")?r.route:`/${r.route}`;t.set(r.id,i),n.set(i,r.id)}for(const r of e)if(r.type==="render_scene"&&!t.has(r.id)){const i=`/${r.id}`;t.set(r.id,i),n.set(i,r.id)}return{sceneToRoute:t,routeToScene:n}}function lb(e){if(typeof window>"u")return null;const t=window.location.hash;if(!t||t==="#")return null;const n=t.slice(1);return e.get(n)||null}function yT(e){return typeof window>"u"?null:e.get(window.location.pathname)||null}function Ff(e,t,n=!1){if(typeof window>"u")return;const r=t.get(e);if(!r)return;const i=`#${r}`;window.location.hash!==i&&(n?window.history.replaceState({sceneId:e},"",i):window.history.pushState({sceneId:e},"",i))}function Gg(e,t,n=!1){if(typeof window>"u")return;const r=t.get(e);if(!r||window.location.pathname===r)return;const i=`${r}${window.location.search}`;n?window.history.replaceState({sceneId:e},"",i):window.history.pushState({sceneId:e},"",i)}const Yut=()=>{try{if(typeof window<"u")return window.localStorage.getItem("backflow_dev_diagnostics")==="1"}catch{}return!1};async function Wf(e,t,n={},r){var i;try{const o=t.indexOf(".");if(o===-1)throw new Error(`Invalid SDK call syntax: ${t}`);const s=t.slice(0,o),l=t.slice(o+1),c=l.indexOf("(");if(c===-1)throw new Error(`Invalid SDK call syntax (missing parentheses): ${t}`);const h=l.slice(0,c),u=l.slice(c+1,-1),f=Kut(u,n);let m=e[s];if(!m)throw new Error(`Unknown SDK resource: ${String(s)}`);const y=h.split(".");for(let b=0;b<y.length-1;b++){const P=y[b];if(P&&(m=m[P],!m))throw new Error(`Unknown path ${y.slice(0,b+1).join(".")} on resource ${String(s)}`)}const x=y[y.length-1],p=m[x];if(typeof p!="function")throw new Error(`Unknown method ${x} on ${String(s)}.${y.slice(0,-1).join(".")}`);return await p.apply(m,f)}catch(o){throw Yut()&&console.error("[SDK Executor] Error:",o),(i=r==null?void 0:r.onError)==null||i.call(r,o),o}}function Kut(e,t){if(!e.trim())return[];const r=e.replace(/\{\{([\w.]+)\}\}/g,(i,o)=>{if(o==="now")return JSON.stringify(new Date().toISOString());const s=Jut(t,o);return s===void 0?"null":typeof s=="string"?`"${s}"`:JSON.stringify(s)}).replace(/([{,]\s*)([A-Za-z_$][\w$]*)\s*:/g,'$1"$2":').replace(/'((?:[^'\\]|\\.)*)'/g,(i,o)=>`"${o.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`);try{return JSON.parse(`[${r}]`)}catch{return Xut(r).map(i=>{const o=i.trim();if(o.startsWith("'")&&o.endsWith("'")||o.startsWith('"')&&o.endsWith('"'))return o.slice(1,-1);if(!isNaN(Number(o)))return Number(o);if(o==="true")return!0;if(o==="false")return!1;if(o==="null")return null;try{return JSON.parse(o)}catch{return o}})}}function Xut(e){const t=[];let n="",r=0,i=null;for(let o=0;o<e.length;o++){const s=e[o],l=e[o-1];if((s==='"'||s==="'")&&l!=="\\"&&(i===s?i=null:i||(i=s)),!i&&((s==="{"||s==="["||s==="(")&&r++,(s==="}"||s==="]"||s===")")&&r--,s===","&&r===0)){t.push(n),n="";continue}n+=s}return n.trim()&&t.push(n),t}function Jut(e,t){const n=t.split(".");let r=e;for(const i of n){if(r==null)return;r=r[i]}return r}function vu(e){return e.startsWith("sdk:")}function nu(e){return vu(e)?e.slice(4):e}function Qut(e,t,...n){const r=n.map(i=>typeof i=="string"?`'${i}'`:JSON.stringify(i)).join(", ");return`sdk:${e}.${t}(${r})`}function tht(e,t){const n=new Map,r=(i,o)=>{o.size>0&&n.set(i,o)};return r("--bf-fd",e.flexDirection),r("--bf-gap",e.gap),r("--bf-w",e.width),r("--bf-min-h",e.minHeight),r("--bf-items",e.alignItems),r("--bf-justify",e.justifyContent),r("--bf-display",e.display),r("--bf-cols",e.gridCols),r("--bf-grid-template",e.gridTemplateColumns),r("--bf-text",e.textSize),r("--bf-radius",e.borderRadius),e.padding.p.size>0&&r("--bf-p",e.padding.p),e.padding.px.size>0&&r("--bf-px",e.padding.px),e.padding.py.size>0&&r("--bf-py",e.padding.py),e.margin.all.size>0&&r("--bf-m",e.margin.all),e.margin.t.size>0&&r("--bf-mt",e.margin.t),e.margin.r.size>0&&r("--bf-mr",e.margin.r),e.margin.b.size>0&&r("--bf-mb",e.margin.b),e.margin.l.size>0&&r("--bf-ml",e.margin.l),e.margin.x.size>0&&r("--bf-mx",e.margin.x),e.margin.y.size>0&&r("--bf-my",e.margin.y),n}function eht(e,t){const n=String(t).replace(/[^a-zA-Z0-9_-]/g,"_");return`${e}-${n}`}function J$(e,t,n){const r=tht(n);if(r.size===0)return"";const i=`[data-bf-r="${e}-${t}"]`,o=[];for(const s of pC){if(s==="base")continue;const l=dC[s],c=[];for(const[h,u]of r)if(u.has(s)){const f=eht(h,t);c.push(` ${f}: ${u.get(s)};`)}c.length>0&&o.push(`@media (min-width: ${l}px) {
123
+ */(function(e,t){(function(n,r){r(t)})(tu,function(n){var r="1.9.4";function i(a){var d,g,_,C;for(g=1,_=arguments.length;g<_;g++){C=arguments[g];for(d in C)a[d]=C[d]}return a}var o=Object.create||function(){function a(){}return function(d){return a.prototype=d,new a}}();function s(a,d){var g=Array.prototype.slice;if(a.bind)return a.bind.apply(a,g.call(arguments,1));var _=g.call(arguments,2);return function(){return a.apply(d,_.length?_.concat(g.call(arguments)):arguments)}}var l=0;function c(a){return"_leaflet_id"in a||(a._leaflet_id=++l),a._leaflet_id}function h(a,d,g){var _,C,k,F;return F=function(){_=!1,C&&(k.apply(g,C),C=!1)},k=function(){_?C=arguments:(a.apply(g,arguments),setTimeout(F,d),_=!0)},k}function u(a,d,g){var _=d[1],C=d[0],k=_-C;return a===_&&g?a:((a-C)%k+k)%k+C}function f(){return!1}function m(a,d){if(d===!1)return a;var g=Math.pow(10,d===void 0?6:d);return Math.round(a*g)/g}function y(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function x(a){return y(a).split(/\s+/)}function p(a,d){Object.prototype.hasOwnProperty.call(a,"options")||(a.options=a.options?o(a.options):{});for(var g in d)a.options[g]=d[g];return a.options}function b(a,d,g){var _=[];for(var C in a)_.push(encodeURIComponent(g?C.toUpperCase():C)+"="+encodeURIComponent(a[C]));return(!d||d.indexOf("?")===-1?"?":"&")+_.join("&")}var P=/\{ *([\w_ -]+) *\}/g;function S(a,d){return a.replace(P,function(g,_){var C=d[_];if(C===void 0)throw new Error("No value provided for variable "+g);return typeof C=="function"&&(C=C(d)),C})}var A=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"};function E(a,d){for(var g=0;g<a.length;g++)if(a[g]===d)return g;return-1}var w="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function T(a){return window["webkit"+a]||window["moz"+a]||window["ms"+a]}var O=0;function R(a){var d=+new Date,g=Math.max(0,16-(d-O));return O=d+g,window.setTimeout(a,g)}var N=window.requestAnimationFrame||T("RequestAnimationFrame")||R,V=window.cancelAnimationFrame||T("CancelAnimationFrame")||T("CancelRequestAnimationFrame")||function(a){window.clearTimeout(a)};function D(a,d,g){if(g&&N===R)a.call(d);else return N.call(window,s(a,d))}function j(a){a&&V.call(window,a)}var K={__proto__:null,extend:i,create:o,bind:s,get lastId(){return l},stamp:c,throttle:h,wrapNum:u,falseFn:f,formatNum:m,trim:y,splitWords:x,setOptions:p,getParamString:b,template:S,isArray:A,indexOf:E,emptyImageUrl:w,requestFn:N,cancelFn:V,requestAnimFrame:D,cancelAnimFrame:j};function H(){}H.extend=function(a){var d=function(){p(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},g=d.__super__=this.prototype,_=o(g);_.constructor=d,d.prototype=_;for(var C in this)Object.prototype.hasOwnProperty.call(this,C)&&C!=="prototype"&&C!=="__super__"&&(d[C]=this[C]);return a.statics&&i(d,a.statics),a.includes&&(z(a.includes),i.apply(null,[_].concat(a.includes))),i(_,a),delete _.statics,delete _.includes,_.options&&(_.options=g.options?o(g.options):{},i(_.options,a.options)),_._initHooks=[],_.callInitHooks=function(){if(!this._initHooksCalled){g.callInitHooks&&g.callInitHooks.call(this),this._initHooksCalled=!0;for(var k=0,F=_._initHooks.length;k<F;k++)_._initHooks[k].call(this)}},d},H.include=function(a){var d=this.prototype.options;return i(this.prototype,a),a.options&&(this.prototype.options=d,this.mergeOptions(a.options)),this},H.mergeOptions=function(a){return i(this.prototype.options,a),this},H.addInitHook=function(a){var d=Array.prototype.slice.call(arguments,1),g=typeof a=="function"?a:function(){this[a].apply(this,d)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(g),this};function z(a){if(!(typeof L>"u"||!L||!L.Mixin)){a=A(a)?a:[a];for(var d=0;d<a.length;d++)a[d]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Y={on:function(a,d,g){if(typeof a=="object")for(var _ in a)this._on(_,a[_],d);else{a=x(a);for(var C=0,k=a.length;C<k;C++)this._on(a[C],d,g)}return this},off:function(a,d,g){if(!arguments.length)delete this._events;else if(typeof a=="object")for(var _ in a)this._off(_,a[_],d);else{a=x(a);for(var C=arguments.length===1,k=0,F=a.length;k<F;k++)C?this._off(a[k]):this._off(a[k],d,g)}return this},_on:function(a,d,g,_){if(typeof d!="function"){console.warn("wrong listener type: "+typeof d);return}if(this._listens(a,d,g)===!1){g===this&&(g=void 0);var C={fn:d,ctx:g};_&&(C.once=!0),this._events=this._events||{},this._events[a]=this._events[a]||[],this._events[a].push(C)}},_off:function(a,d,g){var _,C,k;if(this._events&&(_=this._events[a],!!_)){if(arguments.length===1){if(this._firingCount)for(C=0,k=_.length;C<k;C++)_[C].fn=f;delete this._events[a];return}if(typeof d!="function"){console.warn("wrong listener type: "+typeof d);return}var F=this._listens(a,d,g);if(F!==!1){var et=_[F];this._firingCount&&(et.fn=f,this._events[a]=_=_.slice()),_.splice(F,1)}}},fire:function(a,d,g){if(!this.listens(a,g))return this;var _=i({},d,{type:a,target:this,sourceTarget:d&&d.sourceTarget||this});if(this._events){var C=this._events[a];if(C){this._firingCount=this._firingCount+1||1;for(var k=0,F=C.length;k<F;k++){var et=C[k],ot=et.fn;et.once&&this.off(a,ot,et.ctx),ot.call(et.ctx||this,_)}this._firingCount--}}return g&&this._propagateEvent(_),this},listens:function(a,d,g,_){typeof a!="string"&&console.warn('"string" type argument expected');var C=d;typeof d!="function"&&(_=!!d,C=void 0,g=void 0);var k=this._events&&this._events[a];if(k&&k.length&&this._listens(a,C,g)!==!1)return!0;if(_){for(var F in this._eventParents)if(this._eventParents[F].listens(a,d,g,_))return!0}return!1},_listens:function(a,d,g){if(!this._events)return!1;var _=this._events[a]||[];if(!d)return!!_.length;g===this&&(g=void 0);for(var C=0,k=_.length;C<k;C++)if(_[C].fn===d&&_[C].ctx===g)return C;return!1},once:function(a,d,g){if(typeof a=="object")for(var _ in a)this._on(_,a[_],d,!0);else{a=x(a);for(var C=0,k=a.length;C<k;C++)this._on(a[C],d,g,!0)}return this},addEventParent:function(a){return this._eventParents=this._eventParents||{},this._eventParents[c(a)]=a,this},removeEventParent:function(a){return this._eventParents&&delete this._eventParents[c(a)],this},_propagateEvent:function(a){for(var d in this._eventParents)this._eventParents[d].fire(a.type,i({layer:a.target,propagatedFrom:a.target},a),!0)}};Y.addEventListener=Y.on,Y.removeEventListener=Y.clearAllEventListeners=Y.off,Y.addOneTimeEventListener=Y.once,Y.fireEvent=Y.fire,Y.hasEventListeners=Y.listens;var G=H.extend(Y);function J(a,d,g){this.x=g?Math.round(a):a,this.y=g?Math.round(d):d}var lt=Math.trunc||function(a){return a>0?Math.floor(a):Math.ceil(a)};J.prototype={clone:function(){return new J(this.x,this.y)},add:function(a){return this.clone()._add(q(a))},_add:function(a){return this.x+=a.x,this.y+=a.y,this},subtract:function(a){return this.clone()._subtract(q(a))},_subtract:function(a){return this.x-=a.x,this.y-=a.y,this},divideBy:function(a){return this.clone()._divideBy(a)},_divideBy:function(a){return this.x/=a,this.y/=a,this},multiplyBy:function(a){return this.clone()._multiplyBy(a)},_multiplyBy:function(a){return this.x*=a,this.y*=a,this},scaleBy:function(a){return new J(this.x*a.x,this.y*a.y)},unscaleBy:function(a){return new J(this.x/a.x,this.y/a.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=lt(this.x),this.y=lt(this.y),this},distanceTo:function(a){a=q(a);var d=a.x-this.x,g=a.y-this.y;return Math.sqrt(d*d+g*g)},equals:function(a){return a=q(a),a.x===this.x&&a.y===this.y},contains:function(a){return a=q(a),Math.abs(a.x)<=Math.abs(this.x)&&Math.abs(a.y)<=Math.abs(this.y)},toString:function(){return"Point("+m(this.x)+", "+m(this.y)+")"}};function q(a,d,g){return a instanceof J?a:A(a)?new J(a[0],a[1]):a==null?a:typeof a=="object"&&"x"in a&&"y"in a?new J(a.x,a.y):new J(a,d,g)}function nt(a,d){if(a)for(var g=d?[a,d]:a,_=0,C=g.length;_<C;_++)this.extend(g[_])}nt.prototype={extend:function(a){var d,g;if(!a)return this;if(a instanceof J||typeof a[0]=="number"||"x"in a)d=g=q(a);else if(a=it(a),d=a.min,g=a.max,!d||!g)return this;return!this.min&&!this.max?(this.min=d.clone(),this.max=g.clone()):(this.min.x=Math.min(d.x,this.min.x),this.max.x=Math.max(g.x,this.max.x),this.min.y=Math.min(d.y,this.min.y),this.max.y=Math.max(g.y,this.max.y)),this},getCenter:function(a){return q((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,a)},getBottomLeft:function(){return q(this.min.x,this.max.y)},getTopRight:function(){return q(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(a){var d,g;return typeof a[0]=="number"||a instanceof J?a=q(a):a=it(a),a instanceof nt?(d=a.min,g=a.max):d=g=a,d.x>=this.min.x&&g.x<=this.max.x&&d.y>=this.min.y&&g.y<=this.max.y},intersects:function(a){a=it(a);var d=this.min,g=this.max,_=a.min,C=a.max,k=C.x>=d.x&&_.x<=g.x,F=C.y>=d.y&&_.y<=g.y;return k&&F},overlaps:function(a){a=it(a);var d=this.min,g=this.max,_=a.min,C=a.max,k=C.x>d.x&&_.x<g.x,F=C.y>d.y&&_.y<g.y;return k&&F},isValid:function(){return!!(this.min&&this.max)},pad:function(a){var d=this.min,g=this.max,_=Math.abs(d.x-g.x)*a,C=Math.abs(d.y-g.y)*a;return it(q(d.x-_,d.y-C),q(g.x+_,g.y+C))},equals:function(a){return a?(a=it(a),this.min.equals(a.getTopLeft())&&this.max.equals(a.getBottomRight())):!1}};function it(a,d){return!a||a instanceof nt?a:new nt(a,d)}function at(a,d){if(a)for(var g=d?[a,d]:a,_=0,C=g.length;_<C;_++)this.extend(g[_])}at.prototype={extend:function(a){var d=this._southWest,g=this._northEast,_,C;if(a instanceof gt)_=a,C=a;else if(a instanceof at){if(_=a._southWest,C=a._northEast,!_||!C)return this}else return a?this.extend(yt(a)||ct(a)):this;return!d&&!g?(this._southWest=new gt(_.lat,_.lng),this._northEast=new gt(C.lat,C.lng)):(d.lat=Math.min(_.lat,d.lat),d.lng=Math.min(_.lng,d.lng),g.lat=Math.max(C.lat,g.lat),g.lng=Math.max(C.lng,g.lng)),this},pad:function(a){var d=this._southWest,g=this._northEast,_=Math.abs(d.lat-g.lat)*a,C=Math.abs(d.lng-g.lng)*a;return new at(new gt(d.lat-_,d.lng-C),new gt(g.lat+_,g.lng+C))},getCenter:function(){return new gt((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new gt(this.getNorth(),this.getWest())},getSouthEast:function(){return new gt(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(a){typeof a[0]=="number"||a instanceof gt||"lat"in a?a=yt(a):a=ct(a);var d=this._southWest,g=this._northEast,_,C;return a instanceof at?(_=a.getSouthWest(),C=a.getNorthEast()):_=C=a,_.lat>=d.lat&&C.lat<=g.lat&&_.lng>=d.lng&&C.lng<=g.lng},intersects:function(a){a=ct(a);var d=this._southWest,g=this._northEast,_=a.getSouthWest(),C=a.getNorthEast(),k=C.lat>=d.lat&&_.lat<=g.lat,F=C.lng>=d.lng&&_.lng<=g.lng;return k&&F},overlaps:function(a){a=ct(a);var d=this._southWest,g=this._northEast,_=a.getSouthWest(),C=a.getNorthEast(),k=C.lat>d.lat&&_.lat<g.lat,F=C.lng>d.lng&&_.lng<g.lng;return k&&F},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(a,d){return a?(a=ct(a),this._southWest.equals(a.getSouthWest(),d)&&this._northEast.equals(a.getNorthEast(),d)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function ct(a,d){return a instanceof at?a:new at(a,d)}function gt(a,d,g){if(isNaN(a)||isNaN(d))throw new Error("Invalid LatLng object: ("+a+", "+d+")");this.lat=+a,this.lng=+d,g!==void 0&&(this.alt=+g)}gt.prototype={equals:function(a,d){if(!a)return!1;a=yt(a);var g=Math.max(Math.abs(this.lat-a.lat),Math.abs(this.lng-a.lng));return g<=(d===void 0?1e-9:d)},toString:function(a){return"LatLng("+m(this.lat,a)+", "+m(this.lng,a)+")"},distanceTo:function(a){return Tt.distance(this,yt(a))},wrap:function(){return Tt.wrapLatLng(this)},toBounds:function(a){var d=180*a/40075017,g=d/Math.cos(Math.PI/180*this.lat);return ct([this.lat-d,this.lng-g],[this.lat+d,this.lng+g])},clone:function(){return new gt(this.lat,this.lng,this.alt)}};function yt(a,d,g){return a instanceof gt?a:A(a)&&typeof a[0]!="object"?a.length===3?new gt(a[0],a[1],a[2]):a.length===2?new gt(a[0],a[1]):null:a==null?a:typeof a=="object"&&"lat"in a?new gt(a.lat,"lng"in a?a.lng:a.lon,a.alt):d===void 0?null:new gt(a,d,g)}var Et={latLngToPoint:function(a,d){var g=this.projection.project(a),_=this.scale(d);return this.transformation._transform(g,_)},pointToLatLng:function(a,d){var g=this.scale(d),_=this.transformation.untransform(a,g);return this.projection.unproject(_)},project:function(a){return this.projection.project(a)},unproject:function(a){return this.projection.unproject(a)},scale:function(a){return 256*Math.pow(2,a)},zoom:function(a){return Math.log(a/256)/Math.LN2},getProjectedBounds:function(a){if(this.infinite)return null;var d=this.projection.bounds,g=this.scale(a),_=this.transformation.transform(d.min,g),C=this.transformation.transform(d.max,g);return new nt(_,C)},infinite:!1,wrapLatLng:function(a){var d=this.wrapLng?u(a.lng,this.wrapLng,!0):a.lng,g=this.wrapLat?u(a.lat,this.wrapLat,!0):a.lat,_=a.alt;return new gt(g,d,_)},wrapLatLngBounds:function(a){var d=a.getCenter(),g=this.wrapLatLng(d),_=d.lat-g.lat,C=d.lng-g.lng;if(_===0&&C===0)return a;var k=a.getSouthWest(),F=a.getNorthEast(),et=new gt(k.lat-_,k.lng-C),ot=new gt(F.lat-_,F.lng-C);return new at(et,ot)}},Tt=i({},Et,{wrapLng:[-180,180],R:6371e3,distance:function(a,d){var g=Math.PI/180,_=a.lat*g,C=d.lat*g,k=Math.sin((d.lat-a.lat)*g/2),F=Math.sin((d.lng-a.lng)*g/2),et=k*k+Math.cos(_)*Math.cos(C)*F*F,ot=2*Math.atan2(Math.sqrt(et),Math.sqrt(1-et));return this.R*ot}}),ht=6378137,ft={R:ht,MAX_LATITUDE:85.0511287798,project:function(a){var d=Math.PI/180,g=this.MAX_LATITUDE,_=Math.max(Math.min(g,a.lat),-g),C=Math.sin(_*d);return new J(this.R*a.lng*d,this.R*Math.log((1+C)/(1-C))/2)},unproject:function(a){var d=180/Math.PI;return new gt((2*Math.atan(Math.exp(a.y/this.R))-Math.PI/2)*d,a.x*d/this.R)},bounds:function(){var a=ht*Math.PI;return new nt([-a,-a],[a,a])}()};function Ct(a,d,g,_){if(A(a)){this._a=a[0],this._b=a[1],this._c=a[2],this._d=a[3];return}this._a=a,this._b=d,this._c=g,this._d=_}Ct.prototype={transform:function(a,d){return this._transform(a.clone(),d)},_transform:function(a,d){return d=d||1,a.x=d*(this._a*a.x+this._b),a.y=d*(this._c*a.y+this._d),a},untransform:function(a,d){return d=d||1,new J((a.x/d-this._b)/this._a,(a.y/d-this._d)/this._c)}};function rt(a,d,g,_){return new Ct(a,d,g,_)}var Rt=i({},Tt,{code:"EPSG:3857",projection:ft,transformation:function(){var a=.5/(Math.PI*ft.R);return rt(a,.5,-a,.5)}()}),bt=i({},Rt,{code:"EPSG:900913"});function de(a){return document.createElementNS("http://www.w3.org/2000/svg",a)}function ne(a,d){var g="",_,C,k,F,et,ot;for(_=0,k=a.length;_<k;_++){for(et=a[_],C=0,F=et.length;C<F;C++)ot=et[C],g+=(C?"L":"M")+ot.x+" "+ot.y;g+=d?$t.svg?"z":"x":""}return g||"M0 0"}var Gt=document.documentElement.style,Le="ActiveXObject"in window,Bt=Le&&!document.addEventListener,Qt="msLaunchUri"in navigator&&!("documentMode"in document),te=En("webkit"),Ht=En("android"),re=En("android 2")||En("android 3"),Ce=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ie=Ht&&En("Google")&&Ce<537&&!("AudioNode"in window),on=!!window.opera,tn=!Qt&&En("chrome"),Ke=En("gecko")&&!te&&!on&&!Le,_o=!tn&&En("safari"),cn=En("phantom"),Ot="OTransition"in Gt,Dn=navigator.platform.indexOf("Win")===0,Fe=Le&&"transition"in Gt,Ci="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!re,So="MozPerspective"in Gt,Po=!window.L_DISABLE_3D&&(Fe||Ci||So)&&!Ot&&!cn,he=typeof orientation<"u"||En("mobile"),se=he&&te,ii=he&&Ci,Oi=!window.PointerEvent&&window.MSPointerEvent,Pr=!!(window.PointerEvent||Oi),Mi="ontouchstart"in window||!!window.TouchEvent,ms=!window.L_NO_TOUCH&&(Mi||Pr),ki=he&&on,oi=he&&Ke,$i=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Wr=function(){var a=!1;try{var d=Object.defineProperty({},"passive",{get:function(){a=!0}});window.addEventListener("testPassiveEventSupport",f,d),window.removeEventListener("testPassiveEventSupport",f,d)}catch{}return a}(),Ao=function(){return!!document.createElement("canvas").getContext}(),Ii=!!(document.createElementNS&&de("svg").createSVGRect),Ri=!!Ii&&function(){var a=document.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Ar=!Ii&&function(){try{var a=document.createElement("div");a.innerHTML='<v:shape adj="1"/>';var d=a.firstChild;return d.style.behavior="url(#default#VML)",d&&typeof d.adj=="object"}catch{return!1}}(),Li=navigator.platform.indexOf("Mac")===0,Ni=navigator.platform.indexOf("Linux")===0;function En(a){return navigator.userAgent.toLowerCase().indexOf(a)>=0}var $t={ie:Le,ielt9:Bt,edge:Qt,webkit:te,android:Ht,android23:re,androidStock:ie,opera:on,chrome:tn,gecko:Ke,safari:_o,phantom:cn,opera12:Ot,win:Dn,ie3d:Fe,webkit3d:Ci,gecko3d:So,any3d:Po,mobile:he,mobileWebkit:se,mobileWebkit3d:ii,msPointer:Oi,pointer:Pr,touch:ms,touchNative:Mi,mobileOpera:ki,mobileGecko:oi,retina:$i,passiveEvents:Wr,canvas:Ao,svg:Ii,vml:Ar,inlineSvg:Ri,mac:Li,linux:Ni},To=$t.msPointer?"MSPointerDown":"pointerdown",Cn=$t.msPointer?"MSPointerMove":"pointermove",ji=$t.msPointer?"MSPointerUp":"pointerup",Eo=$t.msPointer?"MSPointerCancel":"pointercancel",si={touchstart:To,touchmove:Cn,touchend:ji,touchcancel:Eo},Di={touchstart:un,touchmove:Ae,touchend:Ae,touchcancel:Ae},pr={},Bi=!1;function gs(a,d,g){return d==="touchstart"&&bs(),Di[d]?(g=Di[d].bind(this,g),a.addEventListener(si[d],g,!1),g):(console.warn("wrong event specified:",d),f)}function Gn(a,d,g){if(!si[d]){console.warn("wrong event specified:",d);return}a.removeEventListener(si[d],g,!1)}function zi(a){pr[a.pointerId]=a}function ys(a){pr[a.pointerId]&&(pr[a.pointerId]=a)}function vs(a){delete pr[a.pointerId]}function bs(){Bi||(document.addEventListener(To,zi,!0),document.addEventListener(Cn,ys,!0),document.addEventListener(ji,vs,!0),document.addEventListener(Eo,vs,!0),Bi=!0)}function Ae(a,d){if(d.pointerType!==(d.MSPOINTER_TYPE_MOUSE||"mouse")){d.touches=[];for(var g in pr)d.touches.push(pr[g]);d.changedTouches=[d],a(d)}}function un(a,d){d.MSPOINTER_TYPE_TOUCH&&d.pointerType===d.MSPOINTER_TYPE_TOUCH&&en(d),Ae(a,d)}function Ea(a){var d={},g,_;for(_ in a)g=a[_],d[_]=g&&g.bind?g.bind(a):g;return a=d,d.type="dblclick",d.detail=2,d.isTrusted=!1,d._simulated=!0,d}var xs=200;function ws(a,d){a.addEventListener("dblclick",d);var g=0,_;function C(k){if(k.detail!==1){_=k.detail;return}if(!(k.pointerType==="mouse"||k.sourceCapabilities&&!k.sourceCapabilities.firesTouchEvents)){var F=Hr(k);if(!(F.some(function(ot){return ot instanceof HTMLLabelElement&&ot.attributes.for})&&!F.some(function(ot){return ot instanceof HTMLInputElement||ot instanceof HTMLSelectElement}))){var et=Date.now();et-g<=xs?(_++,_===2&&d(Ea(k))):_=1,g=et}}}return a.addEventListener("click",C),{dblclick:d,simDblclick:C}}function Fi(a,d){a.removeEventListener("dblclick",d.dblclick),a.removeEventListener("click",d.simDblclick)}var _n=hn(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),tr=hn(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Co=tr==="webkitTransition"||tr==="OTransition"?tr+"End":"transitionend";function ai(a){return typeof a=="string"?document.getElementById(a):a}function On(a,d){var g=a.style[d]||a.currentStyle&&a.currentStyle[d];if((!g||g==="auto")&&document.defaultView){var _=document.defaultView.getComputedStyle(a,null);g=_?_[d]:null}return g==="auto"?null:g}function ee(a,d,g){var _=document.createElement(a);return _.className=d||"",g&&g.appendChild(_),_}function qt(a){var d=a.parentNode;d&&d.removeChild(a)}function mr(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function ye(a){var d=a.parentNode;d&&d.lastChild!==a&&d.appendChild(a)}function wt(a){var d=a.parentNode;d&&d.firstChild!==a&&d.insertBefore(a,d.firstChild)}function ve(a,d){if(a.classList!==void 0)return a.classList.contains(d);var g=Wi(a);return g.length>0&&new RegExp("(^|\\s)"+d+"(\\s|$)").test(g)}function It(a,d){if(a.classList!==void 0)for(var g=x(d),_=0,C=g.length;_<C;_++)a.classList.add(g[_]);else if(!ve(a,d)){var k=Wi(a);_s(a,(k?k+" ":"")+d)}}function ae(a,d){a.classList!==void 0?a.classList.remove(d):_s(a,y((" "+Wi(a)+" ").replace(" "+d+" "," ")))}function _s(a,d){a.className.baseVal===void 0?a.className=d:a.className.baseVal=d}function Wi(a){return a.correspondingElement&&(a=a.correspondingElement),a.className.baseVal===void 0?a.className:a.className.baseVal}function Mn(a,d){"opacity"in a.style?a.style.opacity=d:"filter"in a.style&&li(a,d)}function li(a,d){var g=!1,_="DXImageTransform.Microsoft.Alpha";try{g=a.filters.item(_)}catch{if(d===1)return}d=Math.round(d*100),g?(g.Enabled=d!==100,g.Opacity=d):a.style.filter+=" progid:"+_+"(opacity="+d+")"}function hn(a){for(var d=document.documentElement.style,g=0;g<a.length;g++)if(a[g]in d)return a[g];return!1}function qe(a,d,g){var _=d||new J(0,0);a.style[_n]=($t.ie3d?"translate("+_.x+"px,"+_.y+"px)":"translate3d("+_.x+"px,"+_.y+"px,0)")+(g?" scale("+g+")":"")}function ke(a,d){a._leaflet_pos=d,$t.any3d?qe(a,d):(a.style.left=d.x+"px",a.style.top=d.y+"px")}function Te(a){return a._leaflet_pos||new J(0,0)}var Ss,Vr,Vi;if("onselectstart"in document)Ss=function(){Dt(window,"selectstart",en)},Vr=function(){Ee(window,"selectstart",en)};else{var Ps=hn(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Ss=function(){if(Ps){var a=document.documentElement.style;Vi=a[Ps],a[Ps]="none"}},Vr=function(){Ps&&(document.documentElement.style[Ps]=Vi,Vi=void 0)}}function Tr(){Dt(window,"dragstart",en)}function Oo(){Ee(window,"dragstart",en)}var Ui,mc;function le(a){for(;a.tabIndex===-1;)a=a.parentNode;a.style&&(As(),Ui=a,mc=a.style.outlineStyle,a.style.outlineStyle="none",Dt(window,"keydown",As))}function As(){Ui&&(Ui.style.outlineStyle=mc,Ui=void 0,mc=void 0,Ee(window,"keydown",As))}function Eh(a){do a=a.parentNode;while((!a.offsetWidth||!a.offsetHeight)&&a!==document.body);return a}function Mo(a){var d=a.getBoundingClientRect();return{x:d.width/a.offsetWidth||1,y:d.height/a.offsetHeight||1,boundingClientRect:d}}var xm={__proto__:null,TRANSFORM:_n,TRANSITION:tr,TRANSITION_END:Co,get:ai,getStyle:On,create:ee,remove:qt,empty:mr,toFront:ye,toBack:wt,hasClass:ve,addClass:It,removeClass:ae,setClass:_s,getClass:Wi,setOpacity:Mn,testProp:hn,setTransform:qe,setPosition:ke,getPosition:Te,get disableTextSelection(){return Ss},get enableTextSelection(){return Vr},disableImageDrag:Tr,enableImageDrag:Oo,preventOutline:le,restoreOutline:As,getSizedParentNode:Eh,getScale:Mo};function Dt(a,d,g,_){if(d&&typeof d=="object")for(var C in d)Ca(a,C,d[C],g);else{d=x(d);for(var k=0,F=d.length;k<F;k++)Ca(a,d[k],g,_)}return this}var pe="_leaflet_events";function Ee(a,d,g,_){if(arguments.length===1)gc(a),delete a[pe];else if(d&&typeof d=="object")for(var C in d)Oa(a,C,d[C],g);else if(d=x(d),arguments.length===2)gc(a,function(et){return E(d,et)!==-1});else for(var k=0,F=d.length;k<F;k++)Oa(a,d[k],g,_);return this}function gc(a,d){for(var g in a[pe]){var _=g.split(/\d/)[0];(!d||d(_))&&Oa(a,_,null,null,g)}}var Ur={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ca(a,d,g,_){var C=d+c(g)+(_?"_"+c(_):"");if(a[pe]&&a[pe][C])return this;var k=function(et){return g.call(_||a,et||window.event)},F=k;!$t.touchNative&&$t.pointer&&d.indexOf("touch")===0?k=gs(a,d,k):$t.touch&&d==="dblclick"?k=ws(a,k):"addEventListener"in a?d==="touchstart"||d==="touchmove"||d==="wheel"||d==="mousewheel"?a.addEventListener(Ur[d]||d,k,$t.passiveEvents?{passive:!1}:!1):d==="mouseenter"||d==="mouseleave"?(k=function(et){et=et||window.event,er(a,et)&&F(et)},a.addEventListener(Ur[d],k,!1)):a.addEventListener(d,F,!1):a.attachEvent("on"+d,k),a[pe]=a[pe]||{},a[pe][C]=k}function Oa(a,d,g,_,C){C=C||d+c(g)+(_?"_"+c(_):"");var k=a[pe]&&a[pe][C];if(!k)return this;!$t.touchNative&&$t.pointer&&d.indexOf("touch")===0?Gn(a,d,k):$t.touch&&d==="dblclick"?Fi(a,k):"removeEventListener"in a?a.removeEventListener(Ur[d]||d,k,!1):a.detachEvent("on"+d,k),a[pe][C]=null}function Hi(a){return a.stopPropagation?a.stopPropagation():a.originalEvent?a.originalEvent._stopped=!0:a.cancelBubble=!0,this}function ci(a){return Ca(a,"wheel",Hi),this}function ko(a){return Dt(a,"mousedown touchstart dblclick contextmenu",Hi),a._leaflet_disable_click=!0,this}function en(a){return a.preventDefault?a.preventDefault():a.returnValue=!1,this}function ui(a){return en(a),Hi(a),this}function Hr(a){if(a.composedPath)return a.composedPath();for(var d=[],g=a.target;g;)d.push(g),g=g.parentNode;return d}function Ma(a,d){if(!d)return new J(a.clientX,a.clientY);var g=Mo(d),_=g.boundingClientRect;return new J((a.clientX-_.left)/g.x-d.clientLeft,(a.clientY-_.top)/g.y-d.clientTop)}var Ts=$t.linux&&$t.chrome?window.devicePixelRatio:$t.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function kn(a){return $t.edge?a.wheelDeltaY/2:a.deltaY&&a.deltaMode===0?-a.deltaY/Ts:a.deltaY&&a.deltaMode===1?-a.deltaY*20:a.deltaY&&a.deltaMode===2?-a.deltaY*60:a.deltaX||a.deltaZ?0:a.wheelDelta?(a.wheelDeltaY||a.wheelDelta)/2:a.detail&&Math.abs(a.detail)<32765?-a.detail*20:a.detail?a.detail/-32765*60:0}function er(a,d){var g=d.relatedTarget;if(!g)return!0;try{for(;g&&g!==a;)g=g.parentNode}catch{return!1}return g!==a}var yc={__proto__:null,on:Dt,off:Ee,stopPropagation:Hi,disableScrollPropagation:ci,disableClickPropagation:ko,preventDefault:en,stop:ui,getPropagationPath:Hr,getMousePosition:Ma,getWheelDelta:kn,isExternalTarget:er,addListener:Dt,removeListener:Ee},vc=G.extend({run:function(a,d,g,_){this.stop(),this._el=a,this._inProgress=!0,this._duration=g||.25,this._easeOutPower=1/Math.max(_||.5,.2),this._startPos=Te(a),this._offset=d.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=D(this._animate,this),this._step()},_step:function(a){var d=+new Date-this._startTime,g=this._duration*1e3;d<g?this._runFrame(this._easeOut(d/g),a):(this._runFrame(1),this._complete())},_runFrame:function(a,d){var g=this._startPos.add(this._offset.multiplyBy(a));d&&g._round(),ke(this._el,g),this.fire("step")},_complete:function(){j(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(a){return 1-Math.pow(1-a,this._easeOutPower)}}),Zt=G.extend({options:{crs:Rt,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(a,d){d=p(this,d),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(a),this._initLayout(),this._onResize=s(this._onResize,this),this._initEvents(),d.maxBounds&&this.setMaxBounds(d.maxBounds),d.zoom!==void 0&&(this._zoom=this._limitZoom(d.zoom)),d.center&&d.zoom!==void 0&&this.setView(yt(d.center),d.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=tr&&$t.any3d&&!$t.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Dt(this._proxy,Co,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(a,d,g){if(d=d===void 0?this._zoom:this._limitZoom(d),a=this._limitCenter(yt(a),d,this.options.maxBounds),g=g||{},this._stop(),this._loaded&&!g.reset&&g!==!0){g.animate!==void 0&&(g.zoom=i({animate:g.animate},g.zoom),g.pan=i({animate:g.animate,duration:g.duration},g.pan));var _=this._zoom!==d?this._tryAnimatedZoom&&this._tryAnimatedZoom(a,d,g.zoom):this._tryAnimatedPan(a,g.pan);if(_)return clearTimeout(this._sizeTimer),this}return this._resetView(a,d,g.pan&&g.pan.noMoveStart),this},setZoom:function(a,d){return this._loaded?this.setView(this.getCenter(),a,{zoom:d}):(this._zoom=a,this)},zoomIn:function(a,d){return a=a||($t.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+a,d)},zoomOut:function(a,d){return a=a||($t.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-a,d)},setZoomAround:function(a,d,g){var _=this.getZoomScale(d),C=this.getSize().divideBy(2),k=a instanceof J?a:this.latLngToContainerPoint(a),F=k.subtract(C).multiplyBy(1-1/_),et=this.containerPointToLatLng(C.add(F));return this.setView(et,d,{zoom:g})},_getBoundsCenterZoom:function(a,d){d=d||{},a=a.getBounds?a.getBounds():ct(a);var g=q(d.paddingTopLeft||d.padding||[0,0]),_=q(d.paddingBottomRight||d.padding||[0,0]),C=this.getBoundsZoom(a,!1,g.add(_));if(C=typeof d.maxZoom=="number"?Math.min(d.maxZoom,C):C,C===1/0)return{center:a.getCenter(),zoom:C};var k=_.subtract(g).divideBy(2),F=this.project(a.getSouthWest(),C),et=this.project(a.getNorthEast(),C),ot=this.unproject(F.add(et).divideBy(2).add(k),C);return{center:ot,zoom:C}},fitBounds:function(a,d){if(a=ct(a),!a.isValid())throw new Error("Bounds are not valid.");var g=this._getBoundsCenterZoom(a,d);return this.setView(g.center,g.zoom,d)},fitWorld:function(a){return this.fitBounds([[-90,-180],[90,180]],a)},panTo:function(a,d){return this.setView(a,this._zoom,{pan:d})},panBy:function(a,d){if(a=q(a).round(),d=d||{},!a.x&&!a.y)return this.fire("moveend");if(d.animate!==!0&&!this.getSize().contains(a))return this._resetView(this.unproject(this.project(this.getCenter()).add(a)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new vc,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),d.noMoveStart||this.fire("movestart"),d.animate!==!1){It(this._mapPane,"leaflet-pan-anim");var g=this._getMapPanePos().subtract(a).round();this._panAnim.run(this._mapPane,g,d.duration||.25,d.easeLinearity)}else this._rawPanBy(a),this.fire("move").fire("moveend");return this},flyTo:function(a,d,g){if(g=g||{},g.animate===!1||!$t.any3d)return this.setView(a,d,g);this._stop();var _=this.project(this.getCenter()),C=this.project(a),k=this.getSize(),F=this._zoom;a=yt(a),d=d===void 0?F:d;var et=Math.max(k.x,k.y),ot=et*this.getZoomScale(F,d),dt=C.distanceTo(_)||1,Pt=1.42,kt=Pt*Pt;function Yt(be){var Ba=be?-1:1,Yh=be?ot:et,Mm=ot*ot-et*et+Ba*kt*kt*dt*dt,Ic=2*Yh*kt*dt,Fn=Mm/Ic,Rc=Math.sqrt(Fn*Fn+1)-Fn,Kh=Rc<1e-9?-18:Math.log(Rc);return Kh}function fn(be){return(Math.exp(be)-Math.exp(-be))/2}function oe(be){return(Math.exp(be)+Math.exp(-be))/2}function St(be){return fn(be)/oe(be)}var jt=Yt(0);function Kt(be){return et*(oe(jt)/oe(jt+Pt*be))}function Ne(be){return et*(oe(jt)*St(jt+Pt*be)-fn(jt))/kt}function Ge(be){return 1-Math.pow(1-be,1.5)}var Ji=Date.now(),zn=(Yt(1)-jt)/Pt,Ls=g.duration?1e3*g.duration:1e3*zn*.8;function sr(){var be=(Date.now()-Ji)/Ls,Ba=Ge(be)*zn;be<=1?(this._flyToFrame=D(sr,this),this._move(this.unproject(_.add(C.subtract(_).multiplyBy(Ne(Ba)/dt)),F),this.getScaleZoom(et/Kt(Ba),F),{flyTo:!0})):this._move(a,d)._moveEnd(!0)}return this._moveStart(!0,g.noMoveStart),sr.call(this),this},flyToBounds:function(a,d){var g=this._getBoundsCenterZoom(a,d);return this.flyTo(g.center,g.zoom,d)},setMaxBounds:function(a){return a=ct(a),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),a.isValid()?(this.options.maxBounds=a,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(a){var d=this.options.minZoom;return this.options.minZoom=a,this._loaded&&d!==a&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(a):this},setMaxZoom:function(a){var d=this.options.maxZoom;return this.options.maxZoom=a,this._loaded&&d!==a&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(a):this},panInsideBounds:function(a,d){this._enforcingBounds=!0;var g=this.getCenter(),_=this._limitCenter(g,this._zoom,ct(a));return g.equals(_)||this.panTo(_,d),this._enforcingBounds=!1,this},panInside:function(a,d){d=d||{};var g=q(d.paddingTopLeft||d.padding||[0,0]),_=q(d.paddingBottomRight||d.padding||[0,0]),C=this.project(this.getCenter()),k=this.project(a),F=this.getPixelBounds(),et=it([F.min.add(g),F.max.subtract(_)]),ot=et.getSize();if(!et.contains(k)){this._enforcingBounds=!0;var dt=k.subtract(et.getCenter()),Pt=et.extend(k).getSize().subtract(ot);C.x+=dt.x<0?-Pt.x:Pt.x,C.y+=dt.y<0?-Pt.y:Pt.y,this.panTo(this.unproject(C),d),this._enforcingBounds=!1}return this},invalidateSize:function(a){if(!this._loaded)return this;a=i({animate:!1,pan:!0},a===!0?{animate:!0}:a);var d=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var g=this.getSize(),_=d.divideBy(2).round(),C=g.divideBy(2).round(),k=_.subtract(C);return!k.x&&!k.y?this:(a.animate&&a.pan?this.panBy(k):(a.pan&&this._rawPanBy(k),this.fire("move"),a.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:d,newSize:g}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(a){if(a=this._locateOptions=i({timeout:1e4,watch:!1},a),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var d=s(this._handleGeolocationResponse,this),g=s(this._handleGeolocationError,this);return a.watch?this._locationWatchId=navigator.geolocation.watchPosition(d,g,a):navigator.geolocation.getCurrentPosition(d,g,a),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(a){if(this._container._leaflet_id){var d=a.code,g=a.message||(d===1?"permission denied":d===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:d,message:"Geolocation error: "+g+"."})}},_handleGeolocationResponse:function(a){if(this._container._leaflet_id){var d=a.coords.latitude,g=a.coords.longitude,_=new gt(d,g),C=_.toBounds(a.coords.accuracy*2),k=this._locateOptions;if(k.setView){var F=this.getBoundsZoom(C);this.setView(_,k.maxZoom?Math.min(F,k.maxZoom):F)}var et={latlng:_,bounds:C,timestamp:a.timestamp};for(var ot in a.coords)typeof a.coords[ot]=="number"&&(et[ot]=a.coords[ot]);this.fire("locationfound",et)}},addHandler:function(a,d){if(!d)return this;var g=this[a]=new d(this);return this._handlers.push(g),this.options[a]&&g.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),qt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(j(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var a;for(a in this._layers)this._layers[a].remove();for(a in this._panes)qt(this._panes[a]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(a,d){var g="leaflet-pane"+(a?" leaflet-"+a.replace("Pane","")+"-pane":""),_=ee("div",g,d||this._mapPane);return a&&(this._panes[a]=_),_},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var a=this.getPixelBounds(),d=this.unproject(a.getBottomLeft()),g=this.unproject(a.getTopRight());return new at(d,g)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(a,d,g){a=ct(a),g=q(g||[0,0]);var _=this.getZoom()||0,C=this.getMinZoom(),k=this.getMaxZoom(),F=a.getNorthWest(),et=a.getSouthEast(),ot=this.getSize().subtract(g),dt=it(this.project(et,_),this.project(F,_)).getSize(),Pt=$t.any3d?this.options.zoomSnap:1,kt=ot.x/dt.x,Yt=ot.y/dt.y,fn=d?Math.max(kt,Yt):Math.min(kt,Yt);return _=this.getScaleZoom(fn,_),Pt&&(_=Math.round(_/(Pt/100))*(Pt/100),_=d?Math.ceil(_/Pt)*Pt:Math.floor(_/Pt)*Pt),Math.max(C,Math.min(k,_))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new J(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(a,d){var g=this._getTopLeftPoint(a,d);return new nt(g,g.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(a){return this.options.crs.getProjectedBounds(a===void 0?this.getZoom():a)},getPane:function(a){return typeof a=="string"?this._panes[a]:a},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(a,d){var g=this.options.crs;return d=d===void 0?this._zoom:d,g.scale(a)/g.scale(d)},getScaleZoom:function(a,d){var g=this.options.crs;d=d===void 0?this._zoom:d;var _=g.zoom(a*g.scale(d));return isNaN(_)?1/0:_},project:function(a,d){return d=d===void 0?this._zoom:d,this.options.crs.latLngToPoint(yt(a),d)},unproject:function(a,d){return d=d===void 0?this._zoom:d,this.options.crs.pointToLatLng(q(a),d)},layerPointToLatLng:function(a){var d=q(a).add(this.getPixelOrigin());return this.unproject(d)},latLngToLayerPoint:function(a){var d=this.project(yt(a))._round();return d._subtract(this.getPixelOrigin())},wrapLatLng:function(a){return this.options.crs.wrapLatLng(yt(a))},wrapLatLngBounds:function(a){return this.options.crs.wrapLatLngBounds(ct(a))},distance:function(a,d){return this.options.crs.distance(yt(a),yt(d))},containerPointToLayerPoint:function(a){return q(a).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(a){return q(a).add(this._getMapPanePos())},containerPointToLatLng:function(a){var d=this.containerPointToLayerPoint(q(a));return this.layerPointToLatLng(d)},latLngToContainerPoint:function(a){return this.layerPointToContainerPoint(this.latLngToLayerPoint(yt(a)))},mouseEventToContainerPoint:function(a){return Ma(a,this._container)},mouseEventToLayerPoint:function(a){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(a))},mouseEventToLatLng:function(a){return this.layerPointToLatLng(this.mouseEventToLayerPoint(a))},_initContainer:function(a){var d=this._container=ai(a);if(d){if(d._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Dt(d,"scroll",this._onScroll,this),this._containerId=c(d)},_initLayout:function(){var a=this._container;this._fadeAnimated=this.options.fadeAnimation&&$t.any3d,It(a,"leaflet-container"+($t.touch?" leaflet-touch":"")+($t.retina?" leaflet-retina":"")+($t.ielt9?" leaflet-oldie":"")+($t.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var d=On(a,"position");d!=="absolute"&&d!=="relative"&&d!=="fixed"&&d!=="sticky"&&(a.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var a=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ke(this._mapPane,new J(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(It(a.markerPane,"leaflet-zoom-hide"),It(a.shadowPane,"leaflet-zoom-hide"))},_resetView:function(a,d,g){ke(this._mapPane,new J(0,0));var _=!this._loaded;this._loaded=!0,d=this._limitZoom(d),this.fire("viewprereset");var C=this._zoom!==d;this._moveStart(C,g)._move(a,d)._moveEnd(C),this.fire("viewreset"),_&&this.fire("load")},_moveStart:function(a,d){return a&&this.fire("zoomstart"),d||this.fire("movestart"),this},_move:function(a,d,g,_){d===void 0&&(d=this._zoom);var C=this._zoom!==d;return this._zoom=d,this._lastCenter=a,this._pixelOrigin=this._getNewPixelOrigin(a),_?g&&g.pinch&&this.fire("zoom",g):((C||g&&g.pinch)&&this.fire("zoom",g),this.fire("move",g)),this},_moveEnd:function(a){return a&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return j(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(a){ke(this._mapPane,this._getMapPanePos().subtract(a))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(a){this._targets={},this._targets[c(this._container)]=this;var d=a?Ee:Dt;d(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&d(window,"resize",this._onResize,this),$t.any3d&&this.options.transform3DLimit&&(a?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){j(this._resizeRequest),this._resizeRequest=D(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var a=this._getMapPanePos();Math.max(Math.abs(a.x),Math.abs(a.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(a,d){for(var g=[],_,C=d==="mouseout"||d==="mouseover",k=a.target||a.srcElement,F=!1;k;){if(_=this._targets[c(k)],_&&(d==="click"||d==="preclick")&&this._draggableMoved(_)){F=!0;break}if(_&&_.listens(d,!0)&&(C&&!er(k,a)||(g.push(_),C))||k===this._container)break;k=k.parentNode}return!g.length&&!F&&!C&&this.listens(d,!0)&&(g=[this]),g},_isClickDisabled:function(a){for(;a&&a!==this._container;){if(a._leaflet_disable_click)return!0;a=a.parentNode}},_handleDOMEvent:function(a){var d=a.target||a.srcElement;if(!(!this._loaded||d._leaflet_disable_events||a.type==="click"&&this._isClickDisabled(d))){var g=a.type;g==="mousedown"&&le(d),this._fireDOMEvent(a,g)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(a,d,g){if(a.type==="click"){var _=i({},a);_.type="preclick",this._fireDOMEvent(_,_.type,g)}var C=this._findEventTargets(a,d);if(g){for(var k=[],F=0;F<g.length;F++)g[F].listens(d,!0)&&k.push(g[F]);C=k.concat(C)}if(C.length){d==="contextmenu"&&en(a);var et=C[0],ot={originalEvent:a};if(a.type!=="keypress"&&a.type!=="keydown"&&a.type!=="keyup"){var dt=et.getLatLng&&(!et._radius||et._radius<=10);ot.containerPoint=dt?this.latLngToContainerPoint(et.getLatLng()):this.mouseEventToContainerPoint(a),ot.layerPoint=this.containerPointToLayerPoint(ot.containerPoint),ot.latlng=dt?et.getLatLng():this.layerPointToLatLng(ot.layerPoint)}for(F=0;F<C.length;F++)if(C[F].fire(d,ot,!0),ot.originalEvent._stopped||C[F].options.bubblingMouseEvents===!1&&E(this._mouseEvents,d)!==-1)return}},_draggableMoved:function(a){return a=a.dragging&&a.dragging.enabled()?a:this,a.dragging&&a.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var a=0,d=this._handlers.length;a<d;a++)this._handlers[a].disable()},whenReady:function(a,d){return this._loaded?a.call(d||this,{target:this}):this.on("load",a,d),this},_getMapPanePos:function(){return Te(this._mapPane)||new J(0,0)},_moved:function(){var a=this._getMapPanePos();return a&&!a.equals([0,0])},_getTopLeftPoint:function(a,d){var g=a&&d!==void 0?this._getNewPixelOrigin(a,d):this.getPixelOrigin();return g.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(a,d){var g=this.getSize()._divideBy(2);return this.project(a,d)._subtract(g)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(a,d,g){var _=this._getNewPixelOrigin(g,d);return this.project(a,d)._subtract(_)},_latLngBoundsToNewLayerBounds:function(a,d,g){var _=this._getNewPixelOrigin(g,d);return it([this.project(a.getSouthWest(),d)._subtract(_),this.project(a.getNorthWest(),d)._subtract(_),this.project(a.getSouthEast(),d)._subtract(_),this.project(a.getNorthEast(),d)._subtract(_)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(a){return this.latLngToLayerPoint(a).subtract(this._getCenterLayerPoint())},_limitCenter:function(a,d,g){if(!g)return a;var _=this.project(a,d),C=this.getSize().divideBy(2),k=new nt(_.subtract(C),_.add(C)),F=this._getBoundsOffset(k,g,d);return Math.abs(F.x)<=1&&Math.abs(F.y)<=1?a:this.unproject(_.add(F),d)},_limitOffset:function(a,d){if(!d)return a;var g=this.getPixelBounds(),_=new nt(g.min.add(a),g.max.add(a));return a.add(this._getBoundsOffset(_,d))},_getBoundsOffset:function(a,d,g){var _=it(this.project(d.getNorthEast(),g),this.project(d.getSouthWest(),g)),C=_.min.subtract(a.min),k=_.max.subtract(a.max),F=this._rebound(C.x,-k.x),et=this._rebound(C.y,-k.y);return new J(F,et)},_rebound:function(a,d){return a+d>0?Math.round(a-d)/2:Math.max(0,Math.ceil(a))-Math.max(0,Math.floor(d))},_limitZoom:function(a){var d=this.getMinZoom(),g=this.getMaxZoom(),_=$t.any3d?this.options.zoomSnap:1;return _&&(a=Math.round(a/_)*_),Math.max(d,Math.min(g,a))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ae(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(a,d){var g=this._getCenterOffset(a)._trunc();return(d&&d.animate)!==!0&&!this.getSize().contains(g)?!1:(this.panBy(g,d),!0)},_createAnimProxy:function(){var a=this._proxy=ee("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(a),this.on("zoomanim",function(d){var g=_n,_=this._proxy.style[g];qe(this._proxy,this.project(d.center,d.zoom),this.getZoomScale(d.zoom,1)),_===this._proxy.style[g]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){qt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var a=this.getCenter(),d=this.getZoom();qe(this._proxy,this.project(a,d),this.getZoomScale(d,1))},_catchTransitionEnd:function(a){this._animatingZoom&&a.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(a,d,g){if(this._animatingZoom)return!0;if(g=g||{},!this._zoomAnimated||g.animate===!1||this._nothingToAnimate()||Math.abs(d-this._zoom)>this.options.zoomAnimationThreshold)return!1;var _=this.getZoomScale(d),C=this._getCenterOffset(a)._divideBy(1-1/_);return g.animate!==!0&&!this.getSize().contains(C)?!1:(D(function(){this._moveStart(!0,g.noMoveStart||!1)._animateZoom(a,d,!0)},this),!0)},_animateZoom:function(a,d,g,_){this._mapPane&&(g&&(this._animatingZoom=!0,this._animateToCenter=a,this._animateToZoom=d,It(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:a,zoom:d,noUpdate:_}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ae(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ch(a,d){return new Zt(a,d)}var Bn=H.extend({options:{position:"topright"},initialize:function(a){p(this,a)},getPosition:function(){return this.options.position},setPosition:function(a){var d=this._map;return d&&d.removeControl(this),this.options.position=a,d&&d.addControl(this),this},getContainer:function(){return this._container},addTo:function(a){this.remove(),this._map=a;var d=this._container=this.onAdd(a),g=this.getPosition(),_=a._controlCorners[g];return It(d,"leaflet-control"),g.indexOf("bottom")!==-1?_.insertBefore(d,_.firstChild):_.appendChild(d),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(qt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(a){this._map&&a&&a.screenX>0&&a.screenY>0&&this._map.getContainer().focus()}}),Es=function(a){return new Bn(a)};Zt.include({addControl:function(a){return a.addTo(this),this},removeControl:function(a){return a.remove(),this},_initControlPos:function(){var a=this._controlCorners={},d="leaflet-",g=this._controlContainer=ee("div",d+"control-container",this._container);function _(C,k){var F=d+C+" "+d+k;a[C+k]=ee("div",F,g)}_("top","left"),_("top","right"),_("bottom","left"),_("bottom","right")},_clearControlPos:function(){for(var a in this._controlCorners)qt(this._controlCorners[a]);qt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Oh=Bn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(a,d,g,_){return g<_?-1:_<g?1:0}},initialize:function(a,d,g){p(this,g),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var _ in a)this._addLayer(a[_],_);for(_ in d)this._addLayer(d[_],_,!0)},onAdd:function(a){this._initLayout(),this._update(),this._map=a,a.on("zoomend",this._checkDisabledLayers,this);for(var d=0;d<this._layers.length;d++)this._layers[d].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(a){return Bn.prototype.addTo.call(this,a),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var a=0;a<this._layers.length;a++)this._layers[a].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(a,d){return this._addLayer(a,d),this._map?this._update():this},addOverlay:function(a,d){return this._addLayer(a,d,!0),this._map?this._update():this},removeLayer:function(a){a.off("add remove",this._onLayerChange,this);var d=this._getLayer(c(a));return d&&this._layers.splice(this._layers.indexOf(d),1),this._map?this._update():this},expand:function(){It(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var a=this._map.getSize().y-(this._container.offsetTop+50);return a<this._section.clientHeight?(It(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=a+"px"):ae(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ae(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var a="leaflet-control-layers",d=this._container=ee("div",a),g=this.options.collapsed;d.setAttribute("aria-haspopup",!0),ko(d),ci(d);var _=this._section=ee("section",a+"-list");g&&(this._map.on("click",this.collapse,this),Dt(d,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var C=this._layersLink=ee("a",a+"-toggle",d);C.href="#",C.title="Layers",C.setAttribute("role","button"),Dt(C,{keydown:function(k){k.keyCode===13&&this._expandSafely()},click:function(k){en(k),this._expandSafely()}},this),g||this.expand(),this._baseLayersList=ee("div",a+"-base",_),this._separator=ee("div",a+"-separator",_),this._overlaysList=ee("div",a+"-overlays",_),d.appendChild(_)},_getLayer:function(a){for(var d=0;d<this._layers.length;d++)if(this._layers[d]&&c(this._layers[d].layer)===a)return this._layers[d]},_addLayer:function(a,d,g){this._map&&a.on("add remove",this._onLayerChange,this),this._layers.push({layer:a,name:d,overlay:g}),this.options.sortLayers&&this._layers.sort(s(function(_,C){return this.options.sortFunction(_.layer,C.layer,_.name,C.name)},this)),this.options.autoZIndex&&a.setZIndex&&(this._lastZIndex++,a.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;mr(this._baseLayersList),mr(this._overlaysList),this._layerControlInputs=[];var a,d,g,_,C=0;for(g=0;g<this._layers.length;g++)_=this._layers[g],this._addItem(_),d=d||_.overlay,a=a||!_.overlay,C+=_.overlay?0:1;return this.options.hideSingleBase&&(a=a&&C>1,this._baseLayersList.style.display=a?"":"none"),this._separator.style.display=d&&a?"":"none",this},_onLayerChange:function(a){this._handlingClick||this._update();var d=this._getLayer(c(a.target)),g=d.overlay?a.type==="add"?"overlayadd":"overlayremove":a.type==="add"?"baselayerchange":null;g&&this._map.fire(g,d)},_createRadioElement:function(a,d){var g='<input type="radio" class="leaflet-control-layers-selector" name="'+a+'"'+(d?' checked="checked"':"")+"/>",_=document.createElement("div");return _.innerHTML=g,_.firstChild},_addItem:function(a){var d=document.createElement("label"),g=this._map.hasLayer(a.layer),_;a.overlay?(_=document.createElement("input"),_.type="checkbox",_.className="leaflet-control-layers-selector",_.defaultChecked=g):_=this._createRadioElement("leaflet-base-layers_"+c(this),g),this._layerControlInputs.push(_),_.layerId=c(a.layer),Dt(_,"click",this._onInputClick,this);var C=document.createElement("span");C.innerHTML=" "+a.name;var k=document.createElement("span");d.appendChild(k),k.appendChild(_),k.appendChild(C);var F=a.overlay?this._overlaysList:this._baseLayersList;return F.appendChild(d),this._checkDisabledLayers(),d},_onInputClick:function(){if(!this._preventClick){var a=this._layerControlInputs,d,g,_=[],C=[];this._handlingClick=!0;for(var k=a.length-1;k>=0;k--)d=a[k],g=this._getLayer(d.layerId).layer,d.checked?_.push(g):d.checked||C.push(g);for(k=0;k<C.length;k++)this._map.hasLayer(C[k])&&this._map.removeLayer(C[k]);for(k=0;k<_.length;k++)this._map.hasLayer(_[k])||this._map.addLayer(_[k]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var a=this._layerControlInputs,d,g,_=this._map.getZoom(),C=a.length-1;C>=0;C--)d=a[C],g=this._getLayer(d.layerId).layer,d.disabled=g.options.minZoom!==void 0&&_<g.options.minZoom||g.options.maxZoom!==void 0&&_>g.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var a=this._section;this._preventClick=!0,Dt(a,"click",en),this.expand();var d=this;setTimeout(function(){Ee(a,"click",en),d._preventClick=!1})}}),wm=function(a,d,g){return new Oh(a,d,g)},bc=Bn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(a){var d="leaflet-control-zoom",g=ee("div",d+" leaflet-bar"),_=this.options;return this._zoomInButton=this._createButton(_.zoomInText,_.zoomInTitle,d+"-in",g,this._zoomIn),this._zoomOutButton=this._createButton(_.zoomOutText,_.zoomOutTitle,d+"-out",g,this._zoomOut),this._updateDisabled(),a.on("zoomend zoomlevelschange",this._updateDisabled,this),g},onRemove:function(a){a.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(a){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(a.shiftKey?3:1))},_zoomOut:function(a){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(a.shiftKey?3:1))},_createButton:function(a,d,g,_,C){var k=ee("a",g,_);return k.innerHTML=a,k.href="#",k.title=d,k.setAttribute("role","button"),k.setAttribute("aria-label",d),ko(k),Dt(k,"click",ui),Dt(k,"click",C,this),Dt(k,"click",this._refocusOnMap,this),k},_updateDisabled:function(){var a=this._map,d="leaflet-disabled";ae(this._zoomInButton,d),ae(this._zoomOutButton,d),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||a._zoom===a.getMinZoom())&&(It(this._zoomOutButton,d),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||a._zoom===a.getMaxZoom())&&(It(this._zoomInButton,d),this._zoomInButton.setAttribute("aria-disabled","true"))}});Zt.mergeOptions({zoomControl:!0}),Zt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new bc,this.addControl(this.zoomControl))});var $n=function(a){return new bc(a)},Mh=Bn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(a){var d="leaflet-control-scale",g=ee("div",d),_=this.options;return this._addScales(_,d+"-line",g),a.on(_.updateWhenIdle?"moveend":"move",this._update,this),a.whenReady(this._update,this),g},onRemove:function(a){a.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(a,d,g){a.metric&&(this._mScale=ee("div",d,g)),a.imperial&&(this._iScale=ee("div",d,g))},_update:function(){var a=this._map,d=a.getSize().y/2,g=a.distance(a.containerPointToLatLng([0,d]),a.containerPointToLatLng([this.options.maxWidth,d]));this._updateScales(g)},_updateScales:function(a){this.options.metric&&a&&this._updateMetric(a),this.options.imperial&&a&&this._updateImperial(a)},_updateMetric:function(a){var d=this._getRoundNum(a),g=d<1e3?d+" m":d/1e3+" km";this._updateScale(this._mScale,g,d/a)},_updateImperial:function(a){var d=a*3.2808399,g,_,C;d>5280?(g=d/5280,_=this._getRoundNum(g),this._updateScale(this._iScale,_+" mi",_/g)):(C=this._getRoundNum(d),this._updateScale(this._iScale,C+" ft",C/d))},_updateScale:function(a,d,g){a.style.width=Math.round(this.options.maxWidth*g)+"px",a.innerHTML=d},_getRoundNum:function(a){var d=Math.pow(10,(Math.floor(a)+"").length-1),g=a/d;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:1,d*g}}),_m=function(a){return new Mh(a)},$o='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',qi=Bn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+($t.inlineSvg?$o+" ":"")+"Leaflet</a>"},initialize:function(a){p(this,a),this._attributions={}},onAdd:function(a){a.attributionControl=this,this._container=ee("div","leaflet-control-attribution"),ko(this._container);for(var d in a._layers)a._layers[d].getAttribution&&this.addAttribution(a._layers[d].getAttribution());return this._update(),a.on("layeradd",this._addAttribution,this),this._container},onRemove:function(a){a.off("layeradd",this._addAttribution,this)},_addAttribution:function(a){a.layer.getAttribution&&(this.addAttribution(a.layer.getAttribution()),a.layer.once("remove",function(){this.removeAttribution(a.layer.getAttribution())},this))},setPrefix:function(a){return this.options.prefix=a,this._update(),this},addAttribution:function(a){return a?(this._attributions[a]||(this._attributions[a]=0),this._attributions[a]++,this._update(),this):this},removeAttribution:function(a){return a?(this._attributions[a]&&(this._attributions[a]--,this._update()),this):this},_update:function(){if(this._map){var a=[];for(var d in this._attributions)this._attributions[d]&&a.push(d);var g=[];this.options.prefix&&g.push(this.options.prefix),a.length&&g.push(a.join(", ")),this._container.innerHTML=g.join(' <span aria-hidden="true">|</span> ')}}});Zt.mergeOptions({attributionControl:!0}),Zt.addInitHook(function(){this.options.attributionControl&&new qi().addTo(this)});var qr=function(a){return new qi(a)};Bn.Layers=Oh,Bn.Zoom=bc,Bn.Scale=Mh,Bn.Attribution=qi,Es.layers=wm,Es.zoom=$n,Es.scale=_m,Es.attribution=qr;var nr=H.extend({initialize:function(a){this._map=a},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});nr.addTo=function(a,d){return a.addHandler(d,this),this};var xc={Events:Y},$e=$t.touch?"touchstart mousedown":"mousedown",Zn=G.extend({options:{clickTolerance:3},initialize:function(a,d,g,_){p(this,_),this._element=a,this._dragStartTarget=d||a,this._preventOutline=g},enable:function(){this._enabled||(Dt(this._dragStartTarget,$e,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Zn._dragging===this&&this.finishDrag(!0),Ee(this._dragStartTarget,$e,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(a){if(this._enabled&&(this._moved=!1,!ve(this._element,"leaflet-zoom-anim"))){if(a.touches&&a.touches.length!==1){Zn._dragging===this&&this.finishDrag();return}if(!(Zn._dragging||a.shiftKey||a.which!==1&&a.button!==1&&!a.touches)&&(Zn._dragging=this,this._preventOutline&&le(this._element),Tr(),Ss(),!this._moving)){this.fire("down");var d=a.touches?a.touches[0]:a,g=Eh(this._element);this._startPoint=new J(d.clientX,d.clientY),this._startPos=Te(this._element),this._parentScale=Mo(g);var _=a.type==="mousedown";Dt(document,_?"mousemove":"touchmove",this._onMove,this),Dt(document,_?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(a){if(this._enabled){if(a.touches&&a.touches.length>1){this._moved=!0;return}var d=a.touches&&a.touches.length===1?a.touches[0]:a,g=new J(d.clientX,d.clientY)._subtract(this._startPoint);!g.x&&!g.y||Math.abs(g.x)+Math.abs(g.y)<this.options.clickTolerance||(g.x/=this._parentScale.x,g.y/=this._parentScale.y,en(a),this._moved||(this.fire("dragstart"),this._moved=!0,It(document.body,"leaflet-dragging"),this._lastTarget=a.target||a.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),It(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(g),this._moving=!0,this._lastEvent=a,this._updatePosition())}},_updatePosition:function(){var a={originalEvent:this._lastEvent};this.fire("predrag",a),ke(this._element,this._newPos),this.fire("drag",a)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(a){ae(document.body,"leaflet-dragging"),this._lastTarget&&(ae(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Ee(document,"mousemove touchmove",this._onMove,this),Ee(document,"mouseup touchend touchcancel",this._onUp,this),Oo(),Vr();var d=this._moved&&this._moving;this._moving=!1,Zn._dragging=!1,d&&this.fire("dragend",{noInertia:a,distance:this._newPos.distanceTo(this._startPos)})}});function kh(a,d,g){var _,C=[1,4,2,8],k,F,et,ot,dt,Pt,kt,Yt;for(k=0,Pt=a.length;k<Pt;k++)a[k]._code=fi(a[k],d);for(et=0;et<4;et++){for(kt=C[et],_=[],k=0,Pt=a.length,F=Pt-1;k<Pt;F=k++)ot=a[k],dt=a[F],ot._code&kt?dt._code&kt||(Yt=hi(dt,ot,kt,d,g),Yt._code=fi(Yt,d),_.push(Yt)):(dt._code&kt&&(Yt=hi(dt,ot,kt,d,g),Yt._code=fi(Yt,d),_.push(Yt)),_.push(ot));a=_}return a}function ka(a,d){var g,_,C,k,F,et,ot,dt,Pt;if(!a||a.length===0)throw new Error("latlngs not passed");rr(a)||(console.warn("latlngs are not flat! Only the first ring will be used"),a=a[0]);var kt=yt([0,0]),Yt=ct(a),fn=Yt.getNorthWest().distanceTo(Yt.getSouthWest())*Yt.getNorthEast().distanceTo(Yt.getNorthWest());fn<1700&&(kt=$a(a));var oe=a.length,St=[];for(g=0;g<oe;g++){var jt=yt(a[g]);St.push(d.project(yt([jt.lat-kt.lat,jt.lng-kt.lng])))}for(et=ot=dt=0,g=0,_=oe-1;g<oe;_=g++)C=St[g],k=St[_],F=C.y*k.x-k.y*C.x,ot+=(C.x+k.x)*F,dt+=(C.y+k.y)*F,et+=F*3;et===0?Pt=St[0]:Pt=[ot/et,dt/et];var Kt=d.unproject(q(Pt));return yt([Kt.lat+kt.lat,Kt.lng+kt.lng])}function $a(a){for(var d=0,g=0,_=0,C=0;C<a.length;C++){var k=yt(a[C]);d+=k.lat,g+=k.lng,_++}return yt([d/_,g/_])}var Gi={__proto__:null,clipPolygon:kh,polygonCenter:ka,centroid:$a};function sn(a,d){if(!d||!a.length)return a.slice();var g=d*d;return a=Sm(a,g),a=$h(a,g),a}function Gr(a,d,g){return Math.sqrt(Os(a,d,g,!0))}function wc(a,d,g){return Os(a,d,g)}function $h(a,d){var g=a.length,_=typeof Uint8Array<"u"?Uint8Array:Array,C=new _(g);C[0]=C[g-1]=1,Ia(a,C,d,0,g-1);var k,F=[];for(k=0;k<g;k++)C[k]&&F.push(a[k]);return F}function Ia(a,d,g,_,C){var k=0,F,et,ot;for(et=_+1;et<=C-1;et++)ot=Os(a[et],a[_],a[C],!0),ot>k&&(F=et,k=ot);k>g&&(d[F]=1,Ia(a,d,g,_,F),Ia(a,d,g,F,C))}function Sm(a,d){for(var g=[a[0]],_=1,C=0,k=a.length;_<k;_++)Pm(a[_],a[C])>d&&(g.push(a[_]),C=_);return C<k-1&&g.push(a[k-1]),g}var _c;function Cs(a,d,g,_,C){var k=_?_c:fi(a,g),F=fi(d,g),et,ot,dt;for(_c=F;;){if(!(k|F))return[a,d];if(k&F)return!1;et=k||F,ot=hi(a,d,et,g,C),dt=fi(ot,g),et===k?(a=ot,k=dt):(d=ot,F=dt)}}function hi(a,d,g,_,C){var k=d.x-a.x,F=d.y-a.y,et=_.min,ot=_.max,dt,Pt;return g&8?(dt=a.x+k*(ot.y-a.y)/F,Pt=ot.y):g&4?(dt=a.x+k*(et.y-a.y)/F,Pt=et.y):g&2?(dt=ot.x,Pt=a.y+F*(ot.x-a.x)/k):g&1&&(dt=et.x,Pt=a.y+F*(et.x-a.x)/k),new J(dt,Pt,C)}function fi(a,d){var g=0;return a.x<d.min.x?g|=1:a.x>d.max.x&&(g|=2),a.y<d.min.y?g|=4:a.y>d.max.y&&(g|=8),g}function Pm(a,d){var g=d.x-a.x,_=d.y-a.y;return g*g+_*_}function Os(a,d,g,_){var C=d.x,k=d.y,F=g.x-C,et=g.y-k,ot=F*F+et*et,dt;return ot>0&&(dt=((a.x-C)*F+(a.y-k)*et)/ot,dt>1?(C=g.x,k=g.y):dt>0&&(C+=F*dt,k+=et*dt)),F=a.x-C,et=a.y-k,_?F*F+et*et:new J(C,k)}function rr(a){return!A(a[0])||typeof a[0][0]!="object"&&typeof a[0][0]<"u"}function Ih(a){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),rr(a)}function Sc(a,d){var g,_,C,k,F,et,ot,dt;if(!a||a.length===0)throw new Error("latlngs not passed");rr(a)||(console.warn("latlngs are not flat! Only the first ring will be used"),a=a[0]);var Pt=yt([0,0]),kt=ct(a),Yt=kt.getNorthWest().distanceTo(kt.getSouthWest())*kt.getNorthEast().distanceTo(kt.getNorthWest());Yt<1700&&(Pt=$a(a));var fn=a.length,oe=[];for(g=0;g<fn;g++){var St=yt(a[g]);oe.push(d.project(yt([St.lat-Pt.lat,St.lng-Pt.lng])))}for(g=0,_=0;g<fn-1;g++)_+=oe[g].distanceTo(oe[g+1])/2;if(_===0)dt=oe[0];else for(g=0,k=0;g<fn-1;g++)if(F=oe[g],et=oe[g+1],C=F.distanceTo(et),k+=C,k>_){ot=(k-_)/C,dt=[et.x-ot*(et.x-F.x),et.y-ot*(et.y-F.y)];break}var jt=d.unproject(q(dt));return yt([jt.lat+Pt.lat,jt.lng+Pt.lng])}var Am={__proto__:null,simplify:sn,pointToSegmentDistance:Gr,closestPointOnSegment:wc,clipSegment:Cs,_getEdgeIntersection:hi,_getBitCode:fi,_sqClosestPointOnSegment:Os,isFlat:rr,_flat:Ih,polylineCenter:Sc},In={project:function(a){return new J(a.lng,a.lat)},unproject:function(a){return new gt(a.y,a.x)},bounds:new nt([-180,-90],[180,90])},gn={R:6378137,R_MINOR:6356752314245179e-9,bounds:new nt([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(a){var d=Math.PI/180,g=this.R,_=a.lat*d,C=this.R_MINOR/g,k=Math.sqrt(1-C*C),F=k*Math.sin(_),et=Math.tan(Math.PI/4-_/2)/Math.pow((1-F)/(1+F),k/2);return _=-g*Math.log(Math.max(et,1e-10)),new J(a.lng*d*g,_)},unproject:function(a){for(var d=180/Math.PI,g=this.R,_=this.R_MINOR/g,C=Math.sqrt(1-_*_),k=Math.exp(-a.y/g),F=Math.PI/2-2*Math.atan(k),et=0,ot=.1,dt;et<15&&Math.abs(ot)>1e-7;et++)dt=C*Math.sin(F),dt=Math.pow((1-dt)/(1+dt),C/2),ot=Math.PI/2-2*Math.atan(k*dt)-F,F+=ot;return new gt(F*d,a.x*d/g)}},Rh={__proto__:null,LonLat:In,Mercator:gn,SphericalMercator:ft},Io=i({},Tt,{code:"EPSG:3395",projection:gn,transformation:function(){var a=.5/(Math.PI*gn.R);return rt(a,.5,-a,.5)}()}),Ra=i({},Tt,{code:"EPSG:4326",projection:In,transformation:rt(1/180,1,-1/180,.5)}),Lh=i({},Et,{projection:In,transformation:rt(1,0,-1,0),scale:function(a){return Math.pow(2,a)},zoom:function(a){return Math.log(a)/Math.LN2},distance:function(a,d){var g=d.lng-a.lng,_=d.lat-a.lat;return Math.sqrt(g*g+_*_)},infinite:!0});Et.Earth=Tt,Et.EPSG3395=Io,Et.EPSG3857=Rt,Et.EPSG900913=bt,Et.EPSG4326=Ra,Et.Simple=Lh;var ir=G.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(a){return a.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(a){return a&&a.removeLayer(this),this},getPane:function(a){return this._map.getPane(a?this.options[a]||a:this.options.pane)},addInteractiveTarget:function(a){return this._map._targets[c(a)]=this,this},removeInteractiveTarget:function(a){return delete this._map._targets[c(a)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(a){var d=a.target;if(d.hasLayer(this)){if(this._map=d,this._zoomAnimated=d._zoomAnimated,this.getEvents){var g=this.getEvents();d.on(g,this),this.once("remove",function(){d.off(g,this)},this)}this.onAdd(d),this.fire("add"),d.fire("layeradd",{layer:this})}}});Zt.include({addLayer:function(a){if(!a._layerAdd)throw new Error("The provided object is not a Layer.");var d=c(a);return this._layers[d]?this:(this._layers[d]=a,a._mapToAdd=this,a.beforeAdd&&a.beforeAdd(this),this.whenReady(a._layerAdd,a),this)},removeLayer:function(a){var d=c(a);return this._layers[d]?(this._loaded&&a.onRemove(this),delete this._layers[d],this._loaded&&(this.fire("layerremove",{layer:a}),a.fire("remove")),a._map=a._mapToAdd=null,this):this},hasLayer:function(a){return c(a)in this._layers},eachLayer:function(a,d){for(var g in this._layers)a.call(d,this._layers[g]);return this},_addLayers:function(a){a=a?A(a)?a:[a]:[];for(var d=0,g=a.length;d<g;d++)this.addLayer(a[d])},_addZoomLimit:function(a){(!isNaN(a.options.maxZoom)||!isNaN(a.options.minZoom))&&(this._zoomBoundLayers[c(a)]=a,this._updateZoomLevels())},_removeZoomLimit:function(a){var d=c(a);this._zoomBoundLayers[d]&&(delete this._zoomBoundLayers[d],this._updateZoomLevels())},_updateZoomLevels:function(){var a=1/0,d=-1/0,g=this._getZoomSpan();for(var _ in this._zoomBoundLayers){var C=this._zoomBoundLayers[_].options;a=C.minZoom===void 0?a:Math.min(a,C.minZoom),d=C.maxZoom===void 0?d:Math.max(d,C.maxZoom)}this._layersMaxZoom=d===-1/0?void 0:d,this._layersMinZoom=a===1/0?void 0:a,g!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var di=ir.extend({initialize:function(a,d){p(this,d),this._layers={};var g,_;if(a)for(g=0,_=a.length;g<_;g++)this.addLayer(a[g])},addLayer:function(a){var d=this.getLayerId(a);return this._layers[d]=a,this._map&&this._map.addLayer(a),this},removeLayer:function(a){var d=a in this._layers?a:this.getLayerId(a);return this._map&&this._layers[d]&&this._map.removeLayer(this._layers[d]),delete this._layers[d],this},hasLayer:function(a){var d=typeof a=="number"?a:this.getLayerId(a);return d in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(a){var d=Array.prototype.slice.call(arguments,1),g,_;for(g in this._layers)_=this._layers[g],_[a]&&_[a].apply(_,d);return this},onAdd:function(a){this.eachLayer(a.addLayer,a)},onRemove:function(a){this.eachLayer(a.removeLayer,a)},eachLayer:function(a,d){for(var g in this._layers)a.call(d,this._layers[g]);return this},getLayer:function(a){return this._layers[a]},getLayers:function(){var a=[];return this.eachLayer(a.push,a),a},setZIndex:function(a){return this.invoke("setZIndex",a)},getLayerId:function(a){return c(a)}}),Nh=function(a,d){return new di(a,d)},Er=di.extend({addLayer:function(a){return this.hasLayer(a)?this:(a.addEventParent(this),di.prototype.addLayer.call(this,a),this.fire("layeradd",{layer:a}))},removeLayer:function(a){return this.hasLayer(a)?(a in this._layers&&(a=this._layers[a]),a.removeEventParent(this),di.prototype.removeLayer.call(this,a),this.fire("layerremove",{layer:a})):this},setStyle:function(a){return this.invoke("setStyle",a)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var a=new at;for(var d in this._layers){var g=this._layers[d];a.extend(g.getBounds?g.getBounds():g.getLatLng())}return a}}),jh=function(a,d){return new Er(a,d)},pi=H.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(a){p(this,a)},createIcon:function(a){return this._createIcon("icon",a)},createShadow:function(a){return this._createIcon("shadow",a)},_createIcon:function(a,d){var g=this._getIconUrl(a);if(!g){if(a==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var _=this._createImg(g,d&&d.tagName==="IMG"?d:null);return this._setIconStyles(_,a),(this.options.crossOrigin||this.options.crossOrigin==="")&&(_.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),_},_setIconStyles:function(a,d){var g=this.options,_=g[d+"Size"];typeof _=="number"&&(_=[_,_]);var C=q(_),k=q(d==="shadow"&&g.shadowAnchor||g.iconAnchor||C&&C.divideBy(2,!0));a.className="leaflet-marker-"+d+" "+(g.className||""),k&&(a.style.marginLeft=-k.x+"px",a.style.marginTop=-k.y+"px"),C&&(a.style.width=C.x+"px",a.style.height=C.y+"px")},_createImg:function(a,d){return d=d||document.createElement("img"),d.src=a,d},_getIconUrl:function(a){return $t.retina&&this.options[a+"RetinaUrl"]||this.options[a+"Url"]}});function Pc(a){return new pi(a)}var Cr=pi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(a){return typeof Cr.imagePath!="string"&&(Cr.imagePath=this._detectIconPath()),(this.options.imagePath||Cr.imagePath)+pi.prototype._getIconUrl.call(this,a)},_stripUrl:function(a){var d=function(g,_,C){var k=_.exec(g);return k&&k[C]};return a=d(a,/^url\((['"])?(.+)\1\)$/,2),a&&d(a,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var a=ee("div","leaflet-default-icon-path",document.body),d=On(a,"background-image")||On(a,"backgroundImage");if(document.body.removeChild(a),d=this._stripUrl(d),d)return d;var g=document.querySelector('link[href$="leaflet.css"]');return g?g.href.substring(0,g.href.length-11-1):""}}),La=nr.extend({initialize:function(a){this._marker=a},addHooks:function(){var a=this._marker._icon;this._draggable||(this._draggable=new Zn(a,a,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),It(a,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ae(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(a){var d=this._marker,g=d._map,_=this._marker.options.autoPanSpeed,C=this._marker.options.autoPanPadding,k=Te(d._icon),F=g.getPixelBounds(),et=g.getPixelOrigin(),ot=it(F.min._subtract(et).add(C),F.max._subtract(et).subtract(C));if(!ot.contains(k)){var dt=q((Math.max(ot.max.x,k.x)-ot.max.x)/(F.max.x-ot.max.x)-(Math.min(ot.min.x,k.x)-ot.min.x)/(F.min.x-ot.min.x),(Math.max(ot.max.y,k.y)-ot.max.y)/(F.max.y-ot.max.y)-(Math.min(ot.min.y,k.y)-ot.min.y)/(F.min.y-ot.min.y)).multiplyBy(_);g.panBy(dt,{animate:!1}),this._draggable._newPos._add(dt),this._draggable._startPos._add(dt),ke(d._icon,this._draggable._newPos),this._onDrag(a),this._panRequest=D(this._adjustPan.bind(this,a))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(a){this._marker.options.autoPan&&(j(this._panRequest),this._panRequest=D(this._adjustPan.bind(this,a)))},_onDrag:function(a){var d=this._marker,g=d._shadow,_=Te(d._icon),C=d._map.layerPointToLatLng(_);g&&ke(g,_),d._latlng=C,a.latlng=C,a.oldLatLng=this._oldLatLng,d.fire("move",a).fire("drag",a)},_onDragEnd:function(a){j(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",a)}}),Ms=ir.extend({options:{icon:new Cr,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(a,d){p(this,d),this._latlng=yt(a)},onAdd:function(a){this._zoomAnimated=this._zoomAnimated&&a.options.markerZoomAnimation,this._zoomAnimated&&a.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(a){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&a.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(a){var d=this._latlng;return this._latlng=yt(a),this.update(),this.fire("move",{oldLatLng:d,latlng:this._latlng})},setZIndexOffset:function(a){return this.options.zIndexOffset=a,this.update()},getIcon:function(){return this.options.icon},setIcon:function(a){return this.options.icon=a,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var a=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(a)}return this},_initIcon:function(){var a=this.options,d="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),g=a.icon.createIcon(this._icon),_=!1;g!==this._icon&&(this._icon&&this._removeIcon(),_=!0,a.title&&(g.title=a.title),g.tagName==="IMG"&&(g.alt=a.alt||"")),It(g,d),a.keyboard&&(g.tabIndex="0",g.setAttribute("role","button")),this._icon=g,a.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Dt(g,"focus",this._panOnFocus,this);var C=a.icon.createShadow(this._shadow),k=!1;C!==this._shadow&&(this._removeShadow(),k=!0),C&&(It(C,d),C.alt=""),this._shadow=C,a.opacity<1&&this._updateOpacity(),_&&this.getPane().appendChild(this._icon),this._initInteraction(),C&&k&&this.getPane(a.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ee(this._icon,"focus",this._panOnFocus,this),qt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&qt(this._shadow),this._shadow=null},_setPos:function(a){this._icon&&ke(this._icon,a),this._shadow&&ke(this._shadow,a),this._zIndex=a.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(a){this._icon&&(this._icon.style.zIndex=this._zIndex+a)},_animateZoom:function(a){var d=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center).round();this._setPos(d)},_initInteraction:function(){if(this.options.interactive&&(It(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),La)){var a=this.options.draggable;this.dragging&&(a=this.dragging.enabled(),this.dragging.disable()),this.dragging=new La(this),a&&this.dragging.enable()}},setOpacity:function(a){return this.options.opacity=a,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var a=this.options.opacity;this._icon&&Mn(this._icon,a),this._shadow&&Mn(this._shadow,a)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var a=this._map;if(a){var d=this.options.icon.options,g=d.iconSize?q(d.iconSize):q(0,0),_=d.iconAnchor?q(d.iconAnchor):q(0,0);a.panInside(this._latlng,{paddingTopLeft:_,paddingBottomRight:g.subtract(_)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Ro(a,d){return new Ms(a,d)}var Zr=ir.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(a){this._renderer=a.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(a){return p(this,a),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&a&&Object.prototype.hasOwnProperty.call(a,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Zi=Zr.extend({options:{fill:!0,radius:10},initialize:function(a,d){p(this,d),this._latlng=yt(a),this._radius=this.options.radius},setLatLng:function(a){var d=this._latlng;return this._latlng=yt(a),this.redraw(),this.fire("move",{oldLatLng:d,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(a){return this.options.radius=this._radius=a,this.redraw()},getRadius:function(){return this._radius},setStyle:function(a){var d=a&&a.radius||this._radius;return Zr.prototype.setStyle.call(this,a),this.setRadius(d),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var a=this._radius,d=this._radiusY||a,g=this._clickTolerance(),_=[a+g,d+g];this._pxBounds=new nt(this._point.subtract(_),this._point.add(_))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(a){return a.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function fe(a,d){return new Zi(a,d)}var Yi=Zi.extend({initialize:function(a,d,g){if(typeof d=="number"&&(d=i({},g,{radius:d})),p(this,d),this._latlng=yt(a),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(a){return this._mRadius=a,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var a=[this._radius,this._radiusY||this._radius];return new at(this._map.layerPointToLatLng(this._point.subtract(a)),this._map.layerPointToLatLng(this._point.add(a)))},setStyle:Zr.prototype.setStyle,_project:function(){var a=this._latlng.lng,d=this._latlng.lat,g=this._map,_=g.options.crs;if(_.distance===Tt.distance){var C=Math.PI/180,k=this._mRadius/Tt.R/C,F=g.project([d+k,a]),et=g.project([d-k,a]),ot=F.add(et).divideBy(2),dt=g.unproject(ot).lat,Pt=Math.acos((Math.cos(k*C)-Math.sin(d*C)*Math.sin(dt*C))/(Math.cos(d*C)*Math.cos(dt*C)))/C;(isNaN(Pt)||Pt===0)&&(Pt=k/Math.cos(Math.PI/180*d)),this._point=ot.subtract(g.getPixelOrigin()),this._radius=isNaN(Pt)?0:ot.x-g.project([dt,a-Pt]).x,this._radiusY=ot.y-F.y}else{var kt=_.unproject(_.project(this._latlng).subtract([this._mRadius,0]));this._point=g.latLngToLayerPoint(this._latlng),this._radius=this._point.x-g.latLngToLayerPoint(kt).x}this._updateBounds()}});function Dh(a,d,g){return new Yi(a,d,g)}var or=Zr.extend({options:{smoothFactor:1,noClip:!1},initialize:function(a,d){p(this,d),this._setLatLngs(a)},getLatLngs:function(){return this._latlngs},setLatLngs:function(a){return this._setLatLngs(a),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(a){for(var d=1/0,g=null,_=Os,C,k,F=0,et=this._parts.length;F<et;F++)for(var ot=this._parts[F],dt=1,Pt=ot.length;dt<Pt;dt++){C=ot[dt-1],k=ot[dt];var kt=_(a,C,k,!0);kt<d&&(d=kt,g=_(a,C,k))}return g&&(g.distance=Math.sqrt(d)),g},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Sc(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(a,d){return d=d||this._defaultShape(),a=yt(a),d.push(a),this._bounds.extend(a),this.redraw()},_setLatLngs:function(a){this._bounds=new at,this._latlngs=this._convertLatLngs(a)},_defaultShape:function(){return rr(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(a){for(var d=[],g=rr(a),_=0,C=a.length;_<C;_++)g?(d[_]=yt(a[_]),this._bounds.extend(d[_])):d[_]=this._convertLatLngs(a[_]);return d},_project:function(){var a=new nt;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,a),this._bounds.isValid()&&a.isValid()&&(this._rawPxBounds=a,this._updateBounds())},_updateBounds:function(){var a=this._clickTolerance(),d=new J(a,a);this._rawPxBounds&&(this._pxBounds=new nt([this._rawPxBounds.min.subtract(d),this._rawPxBounds.max.add(d)]))},_projectLatlngs:function(a,d,g){var _=a[0]instanceof gt,C=a.length,k,F;if(_){for(F=[],k=0;k<C;k++)F[k]=this._map.latLngToLayerPoint(a[k]),g.extend(F[k]);d.push(F)}else for(k=0;k<C;k++)this._projectLatlngs(a[k],d,g)},_clipPoints:function(){var a=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(a))){if(this.options.noClip){this._parts=this._rings;return}var d=this._parts,g,_,C,k,F,et,ot;for(g=0,C=0,k=this._rings.length;g<k;g++)for(ot=this._rings[g],_=0,F=ot.length;_<F-1;_++)et=Cs(ot[_],ot[_+1],a,_,!0),et&&(d[C]=d[C]||[],d[C].push(et[0]),(et[1]!==ot[_+1]||_===F-2)&&(d[C].push(et[1]),C++))}},_simplifyPoints:function(){for(var a=this._parts,d=this.options.smoothFactor,g=0,_=a.length;g<_;g++)a[g]=sn(a[g],d)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(a,d){var g,_,C,k,F,et,ot=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(a))return!1;for(g=0,k=this._parts.length;g<k;g++)for(et=this._parts[g],_=0,F=et.length,C=F-1;_<F;C=_++)if(!(!d&&_===0)&&Gr(a,et[C],et[_])<=ot)return!0;return!1}});function Na(a,d){return new or(a,d)}or._flat=Ih;var Lo=or.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return ka(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(a){var d=or.prototype._convertLatLngs.call(this,a),g=d.length;return g>=2&&d[0]instanceof gt&&d[0].equals(d[g-1])&&d.pop(),d},_setLatLngs:function(a){or.prototype._setLatLngs.call(this,a),rr(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return rr(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var a=this._renderer._bounds,d=this.options.weight,g=new J(d,d);if(a=new nt(a.min.subtract(g),a.max.add(g)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(a))){if(this.options.noClip){this._parts=this._rings;return}for(var _=0,C=this._rings.length,k;_<C;_++)k=kh(this._rings[_],a,!0),k.length&&this._parts.push(k)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(a){var d=!1,g,_,C,k,F,et,ot,dt;if(!this._pxBounds||!this._pxBounds.contains(a))return!1;for(k=0,ot=this._parts.length;k<ot;k++)for(g=this._parts[k],F=0,dt=g.length,et=dt-1;F<dt;et=F++)_=g[F],C=g[et],_.y>a.y!=C.y>a.y&&a.x<(C.x-_.x)*(a.y-_.y)/(C.y-_.y)+_.x&&(d=!d);return d||or.prototype._containsPoint.call(this,a,!0)}});function Bh(a,d){return new Lo(a,d)}var Yr=Er.extend({initialize:function(a,d){p(this,d),this._layers={},a&&this.addData(a)},addData:function(a){var d=A(a)?a:a.features,g,_,C;if(d){for(g=0,_=d.length;g<_;g++)C=d[g],(C.geometries||C.geometry||C.features||C.coordinates)&&this.addData(C);return this}var k=this.options;if(k.filter&&!k.filter(a))return this;var F=ks(a,k);return F?(F.feature=$s(a),F.defaultOptions=F.options,this.resetStyle(F),k.onEachFeature&&k.onEachFeature(a,F),this.addLayer(F)):this},resetStyle:function(a){return a===void 0?this.eachLayer(this.resetStyle,this):(a.options=i({},a.defaultOptions),this._setLayerStyle(a,this.options.style),this)},setStyle:function(a){return this.eachLayer(function(d){this._setLayerStyle(d,a)},this)},_setLayerStyle:function(a,d){a.setStyle&&(typeof d=="function"&&(d=d(a.feature)),a.setStyle(d))}});function ks(a,d){var g=a.type==="Feature"?a.geometry:a,_=g?g.coordinates:null,C=[],k=d&&d.pointToLayer,F=d&&d.coordsToLatLng||Ac,et,ot,dt,Pt;if(!_&&!g)return null;switch(g.type){case"Point":return et=F(_),Tm(k,a,et,d);case"MultiPoint":for(dt=0,Pt=_.length;dt<Pt;dt++)et=F(_[dt]),C.push(Tm(k,a,et,d));return new Er(C);case"LineString":case"MultiLineString":return ot=Tc(_,g.type==="LineString"?0:1,F),new or(ot,d);case"Polygon":case"MultiPolygon":return ot=Tc(_,g.type==="Polygon"?1:2,F),new Lo(ot,d);case"GeometryCollection":for(dt=0,Pt=g.geometries.length;dt<Pt;dt++){var kt=ks({geometry:g.geometries[dt],type:"Feature",properties:a.properties},d);kt&&C.push(kt)}return new Er(C);case"FeatureCollection":for(dt=0,Pt=g.features.length;dt<Pt;dt++){var Yt=ks(g.features[dt],d);Yt&&C.push(Yt)}return new Er(C);default:throw new Error("Invalid GeoJSON object.")}}function Tm(a,d,g,_){return a?a(d,g):new Ms(g,_&&_.markersInheritOptions&&_)}function Ac(a){return new gt(a[1],a[0],a[2])}function Tc(a,d,g){for(var _=[],C=0,k=a.length,F;C<k;C++)F=d?Tc(a[C],d-1,g):(g||Ac)(a[C]),_.push(F);return _}function Ec(a,d){return a=yt(a),a.alt!==void 0?[m(a.lng,d),m(a.lat,d),m(a.alt,d)]:[m(a.lng,d),m(a.lat,d)]}function gr(a,d,g,_){for(var C=[],k=0,F=a.length;k<F;k++)C.push(d?gr(a[k],rr(a[k])?0:d-1,g,_):Ec(a[k],_));return!d&&g&&C.length>0&&C.push(C[0].slice()),C}function Ki(a,d){return a.feature?i({},a.feature,{geometry:d}):$s(d)}function $s(a){return a.type==="Feature"||a.type==="FeatureCollection"?a:{type:"Feature",properties:{},geometry:a}}var Is={toGeoJSON:function(a){return Ki(this,{type:"Point",coordinates:Ec(this.getLatLng(),a)})}};Ms.include(Is),Yi.include(Is),Zi.include(Is),or.include({toGeoJSON:function(a){var d=!rr(this._latlngs),g=gr(this._latlngs,d?1:0,!1,a);return Ki(this,{type:(d?"Multi":"")+"LineString",coordinates:g})}}),Lo.include({toGeoJSON:function(a){var d=!rr(this._latlngs),g=d&&!rr(this._latlngs[0]),_=gr(this._latlngs,g?2:d?1:0,!0,a);return d||(_=[_]),Ki(this,{type:(g?"Multi":"")+"Polygon",coordinates:_})}}),di.include({toMultiPoint:function(a){var d=[];return this.eachLayer(function(g){d.push(g.toGeoJSON(a).geometry.coordinates)}),Ki(this,{type:"MultiPoint",coordinates:d})},toGeoJSON:function(a){var d=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(d==="MultiPoint")return this.toMultiPoint(a);var g=d==="GeometryCollection",_=[];return this.eachLayer(function(C){if(C.toGeoJSON){var k=C.toGeoJSON(a);if(g)_.push(k.geometry);else{var F=$s(k);F.type==="FeatureCollection"?_.push.apply(_,F.features):_.push(F)}}}),g?Ki(this,{geometries:_,type:"GeometryCollection"}):{type:"FeatureCollection",features:_}}});function zh(a,d){return new Yr(a,d)}var Em=zh,ja=ir.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(a,d,g){this._url=a,this._bounds=ct(d),p(this,g)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(It(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){qt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(a){return this.options.opacity=a,this._image&&this._updateOpacity(),this},setStyle:function(a){return a.opacity&&this.setOpacity(a.opacity),this},bringToFront:function(){return this._map&&ye(this._image),this},bringToBack:function(){return this._map&&wt(this._image),this},setUrl:function(a){return this._url=a,this._image&&(this._image.src=a),this},setBounds:function(a){return this._bounds=ct(a),this._map&&this._reset(),this},getEvents:function(){var a={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(a.zoomanim=this._animateZoom),a},setZIndex:function(a){return this.options.zIndex=a,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var a=this._url.tagName==="IMG",d=this._image=a?this._url:ee("img");if(It(d,"leaflet-image-layer"),this._zoomAnimated&&It(d,"leaflet-zoom-animated"),this.options.className&&It(d,this.options.className),d.onselectstart=f,d.onmousemove=f,d.onload=s(this.fire,this,"load"),d.onerror=s(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(d.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),a){this._url=d.src;return}d.src=this._url,d.alt=this.options.alt},_animateZoom:function(a){var d=this._map.getZoomScale(a.zoom),g=this._map._latLngBoundsToNewLayerBounds(this._bounds,a.zoom,a.center).min;qe(this._image,g,d)},_reset:function(){var a=this._image,d=new nt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),g=d.getSize();ke(a,d.min),a.style.width=g.x+"px",a.style.height=g.y+"px"},_updateOpacity:function(){Mn(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var a=this.options.errorOverlayUrl;a&&this._url!==a&&(this._url=a,this._image.src=a)},getCenter:function(){return this._bounds.getCenter()}}),Cm=function(a,d,g){return new ja(a,d,g)},Fh=ja.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var a=this._url.tagName==="VIDEO",d=this._image=a?this._url:ee("video");if(It(d,"leaflet-image-layer"),this._zoomAnimated&&It(d,"leaflet-zoom-animated"),this.options.className&&It(d,this.options.className),d.onselectstart=f,d.onmousemove=f,d.onloadeddata=s(this.fire,this,"load"),a){for(var g=d.getElementsByTagName("source"),_=[],C=0;C<g.length;C++)_.push(g[C].src);this._url=g.length>0?_:[d.src];return}A(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(d.style,"objectFit")&&(d.style.objectFit="fill"),d.autoplay=!!this.options.autoplay,d.loop=!!this.options.loop,d.muted=!!this.options.muted,d.playsInline=!!this.options.playsInline;for(var k=0;k<this._url.length;k++){var F=ee("source");F.src=this._url[k],d.appendChild(F)}}});function Px(a,d,g){return new Fh(a,d,g)}var Wh=ja.extend({_initImage:function(){var a=this._image=this._url;It(a,"leaflet-image-layer"),this._zoomAnimated&&It(a,"leaflet-zoom-animated"),this.options.className&&It(a,this.options.className),a.onselectstart=f,a.onmousemove=f}});function Om(a,d,g){return new Wh(a,d,g)}var Or=ir.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(a,d){a&&(a instanceof gt||A(a))?(this._latlng=yt(a),p(this,d)):(p(this,a),this._source=d),this.options.content&&(this._content=this.options.content)},openOn:function(a){return a=arguments.length?a:this._source._map,a.hasLayer(this)||a.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(a){return this._map?this.close():(arguments.length?this._source=a:a=this._source,this._prepareOpen(),this.openOn(a._map)),this},onAdd:function(a){this._zoomAnimated=a._zoomAnimated,this._container||this._initLayout(),a._fadeAnimated&&Mn(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),a._fadeAnimated&&Mn(this._container,1),this.bringToFront(),this.options.interactive&&(It(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(a){a._fadeAnimated?(Mn(this._container,0),this._removeTimeout=setTimeout(s(qt,void 0,this._container),200)):qt(this._container),this.options.interactive&&(ae(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(a){return this._latlng=yt(a),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(a){return this._content=a,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var a={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(a.zoomanim=this._animateZoom),a},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ye(this._container),this},bringToBack:function(){return this._map&&wt(this._container),this},_prepareOpen:function(a){var d=this._source;if(!d._map)return!1;if(d instanceof Er){d=null;var g=this._source._layers;for(var _ in g)if(g[_]._map){d=g[_];break}if(!d)return!1;this._source=d}if(!a)if(d.getCenter)a=d.getCenter();else if(d.getLatLng)a=d.getLatLng();else if(d.getBounds)a=d.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(a),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var a=this._contentNode,d=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof d=="string")a.innerHTML=d;else{for(;a.hasChildNodes();)a.removeChild(a.firstChild);a.appendChild(d)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var a=this._map.latLngToLayerPoint(this._latlng),d=q(this.options.offset),g=this._getAnchor();this._zoomAnimated?ke(this._container,a.add(g)):d=d.add(a).add(g);var _=this._containerBottom=-d.y,C=this._containerLeft=-Math.round(this._containerWidth/2)+d.x;this._container.style.bottom=_+"px",this._container.style.left=C+"px"}},_getAnchor:function(){return[0,0]}});Zt.include({_initOverlay:function(a,d,g,_){var C=d;return C instanceof a||(C=new a(_).setContent(d)),g&&C.setLatLng(g),C}}),ir.include({_initOverlay:function(a,d,g,_){var C=g;return C instanceof a?(p(C,_),C._source=this):(C=d&&!_?d:new a(_,this),C.setContent(g)),C}});var Da=Or.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(a){return a=arguments.length?a:this._source._map,!a.hasLayer(this)&&a._popup&&a._popup.options.autoClose&&a.removeLayer(a._popup),a._popup=this,Or.prototype.openOn.call(this,a)},onAdd:function(a){Or.prototype.onAdd.call(this,a),a.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Zr||this._source.on("preclick",Hi))},onRemove:function(a){Or.prototype.onRemove.call(this,a),a.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Zr||this._source.off("preclick",Hi))},getEvents:function(){var a=Or.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(a.preclick=this.close),this.options.keepInView&&(a.moveend=this._adjustPan),a},_initLayout:function(){var a="leaflet-popup",d=this._container=ee("div",a+" "+(this.options.className||"")+" leaflet-zoom-animated"),g=this._wrapper=ee("div",a+"-content-wrapper",d);if(this._contentNode=ee("div",a+"-content",g),ko(d),ci(this._contentNode),Dt(d,"contextmenu",Hi),this._tipContainer=ee("div",a+"-tip-container",d),this._tip=ee("div",a+"-tip",this._tipContainer),this.options.closeButton){var _=this._closeButton=ee("a",a+"-close-button",d);_.setAttribute("role","button"),_.setAttribute("aria-label","Close popup"),_.href="#close",_.innerHTML='<span aria-hidden="true">&#215;</span>',Dt(_,"click",function(C){en(C),this.close()},this)}},_updateLayout:function(){var a=this._contentNode,d=a.style;d.width="",d.whiteSpace="nowrap";var g=a.offsetWidth;g=Math.min(g,this.options.maxWidth),g=Math.max(g,this.options.minWidth),d.width=g+1+"px",d.whiteSpace="",d.height="";var _=a.offsetHeight,C=this.options.maxHeight,k="leaflet-popup-scrolled";C&&_>C?(d.height=C+"px",It(a,k)):ae(a,k),this._containerWidth=this._container.offsetWidth},_animateZoom:function(a){var d=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center),g=this._getAnchor();ke(this._container,d.add(g))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var a=this._map,d=parseInt(On(this._container,"marginBottom"),10)||0,g=this._container.offsetHeight+d,_=this._containerWidth,C=new J(this._containerLeft,-g-this._containerBottom);C._add(Te(this._container));var k=a.layerPointToContainerPoint(C),F=q(this.options.autoPanPadding),et=q(this.options.autoPanPaddingTopLeft||F),ot=q(this.options.autoPanPaddingBottomRight||F),dt=a.getSize(),Pt=0,kt=0;k.x+_+ot.x>dt.x&&(Pt=k.x+_-dt.x+ot.x),k.x-Pt-et.x<0&&(Pt=k.x-et.x),k.y+g+ot.y>dt.y&&(kt=k.y+g-dt.y+ot.y),k.y-kt-et.y<0&&(kt=k.y-et.y),(Pt||kt)&&(this.options.keepInView&&(this._autopanning=!0),a.fire("autopanstart").panBy([Pt,kt]))}},_getAnchor:function(){return q(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Vh=function(a,d){return new Da(a,d)};Zt.mergeOptions({closePopupOnClick:!0}),Zt.include({openPopup:function(a,d,g){return this._initOverlay(Da,a,d,g).openOn(this),this},closePopup:function(a){return a=arguments.length?a:this._popup,a&&a.close(),this}}),ir.include({bindPopup:function(a,d){return this._popup=this._initOverlay(Da,this._popup,a,d),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(a){return this._popup&&(this instanceof Er||(this._popup._source=this),this._popup._prepareOpen(a||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(a){return this._popup&&this._popup.setContent(a),this},getPopup:function(){return this._popup},_openPopup:function(a){if(!(!this._popup||!this._map)){ui(a);var d=a.layer||a.target;if(this._popup._source===d&&!(d instanceof Zr)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(a.latlng);return}this._popup._source=d,this.openPopup(a.latlng)}},_movePopup:function(a){this._popup.setLatLng(a.latlng)},_onKeyPress:function(a){a.originalEvent.keyCode===13&&this._openPopup(a)}});var Rs=Or.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(a){Or.prototype.onAdd.call(this,a),this.setOpacity(this.options.opacity),a.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(a){Or.prototype.onRemove.call(this,a),a.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var a=Or.prototype.getEvents.call(this);return this.options.permanent||(a.preclick=this.close),a},_initLayout:function(){var a="leaflet-tooltip",d=a+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=ee("div",d),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(a){var d,g,_=this._map,C=this._container,k=_.latLngToContainerPoint(_.getCenter()),F=_.layerPointToContainerPoint(a),et=this.options.direction,ot=C.offsetWidth,dt=C.offsetHeight,Pt=q(this.options.offset),kt=this._getAnchor();et==="top"?(d=ot/2,g=dt):et==="bottom"?(d=ot/2,g=0):et==="center"?(d=ot/2,g=dt/2):et==="right"?(d=0,g=dt/2):et==="left"?(d=ot,g=dt/2):F.x<k.x?(et="right",d=0,g=dt/2):(et="left",d=ot+(Pt.x+kt.x)*2,g=dt/2),a=a.subtract(q(d,g,!0)).add(Pt).add(kt),ae(C,"leaflet-tooltip-right"),ae(C,"leaflet-tooltip-left"),ae(C,"leaflet-tooltip-top"),ae(C,"leaflet-tooltip-bottom"),It(C,"leaflet-tooltip-"+et),ke(C,a)},_updatePosition:function(){var a=this._map.latLngToLayerPoint(this._latlng);this._setPosition(a)},setOpacity:function(a){this.options.opacity=a,this._container&&Mn(this._container,a)},_animateZoom:function(a){var d=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center);this._setPosition(d)},_getAnchor:function(){return q(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Uh=function(a,d){return new Rs(a,d)};Zt.include({openTooltip:function(a,d,g){return this._initOverlay(Rs,a,d,g).openOn(this),this},closeTooltip:function(a){return a.close(),this}}),ir.include({bindTooltip:function(a,d){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Rs,this._tooltip,a,d),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(a){if(!(!a&&this._tooltipHandlersAdded)){var d=a?"off":"on",g={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?g.add=this._openTooltip:(g.mouseover=this._openTooltip,g.mouseout=this.closeTooltip,g.click=this._openTooltip,this._map?this._addFocusListeners():g.add=this._addFocusListeners),this._tooltip.options.sticky&&(g.mousemove=this._moveTooltip),this[d](g),this._tooltipHandlersAdded=!a}},openTooltip:function(a){return this._tooltip&&(this instanceof Er||(this._tooltip._source=this),this._tooltip._prepareOpen(a)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(a){return this._tooltip&&this._tooltip.setContent(a),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(a){var d=typeof a.getElement=="function"&&a.getElement();d&&(Dt(d,"focus",function(){this._tooltip._source=a,this.openTooltip()},this),Dt(d,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(a){var d=typeof a.getElement=="function"&&a.getElement();d&&d.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(a){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var d=this;this._map.once("moveend",function(){d._openOnceFlag=!1,d._openTooltip(a)});return}this._tooltip._source=a.layer||a.target,this.openTooltip(this._tooltip.options.sticky?a.latlng:void 0)}},_moveTooltip:function(a){var d=a.latlng,g,_;this._tooltip.options.sticky&&a.originalEvent&&(g=this._map.mouseEventToContainerPoint(a.originalEvent),_=this._map.containerPointToLayerPoint(g),d=this._map.layerPointToLatLng(_)),this._tooltip.setLatLng(d)}});var Cc=pi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(a){var d=a&&a.tagName==="DIV"?a:document.createElement("div"),g=this.options;if(g.html instanceof Element?(mr(d),d.appendChild(g.html)):d.innerHTML=g.html!==!1?g.html:"",g.bgPos){var _=q(g.bgPos);d.style.backgroundPosition=-_.x+"px "+-_.y+"px"}return this._setIconStyles(d,"icon"),d},createShadow:function(){return null}});function Hh(a){return new Cc(a)}pi.Default=Cr;var No=ir.extend({options:{tileSize:256,opacity:1,updateWhenIdle:$t.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(a){p(this,a)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(a){a._addZoomLimit(this)},onRemove:function(a){this._removeAllTiles(),qt(this._container),a._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(ye(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(wt(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(a){return this.options.opacity=a,this._updateOpacity(),this},setZIndex:function(a){return this.options.zIndex=a,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var a=this._clampZoom(this._map.getZoom());a!==this._tileZoom&&(this._tileZoom=a,this._updateLevels()),this._update()}return this},getEvents:function(){var a={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=h(this._onMoveEnd,this.options.updateInterval,this)),a.move=this._onMove),this._zoomAnimated&&(a.zoomanim=this._animateZoom),a},createTile:function(){return document.createElement("div")},getTileSize:function(){var a=this.options.tileSize;return a instanceof J?a:new J(a,a)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(a){for(var d=this.getPane().children,g=-a(-1/0,1/0),_=0,C=d.length,k;_<C;_++)k=d[_].style.zIndex,d[_]!==this._container&&k&&(g=a(g,+k));isFinite(g)&&(this.options.zIndex=g+a(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!$t.ielt9){Mn(this._container,this.options.opacity);var a=+new Date,d=!1,g=!1;for(var _ in this._tiles){var C=this._tiles[_];if(!(!C.current||!C.loaded)){var k=Math.min(1,(a-C.loaded)/200);Mn(C.el,k),k<1?d=!0:(C.active?g=!0:this._onOpaqueTile(C),C.active=!0)}}g&&!this._noPrune&&this._pruneTiles(),d&&(j(this._fadeFrame),this._fadeFrame=D(this._updateOpacity,this))}},_onOpaqueTile:f,_initContainer:function(){this._container||(this._container=ee("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var a=this._tileZoom,d=this.options.maxZoom;if(a!==void 0){for(var g in this._levels)g=Number(g),this._levels[g].el.children.length||g===a?(this._levels[g].el.style.zIndex=d-Math.abs(a-g),this._onUpdateLevel(g)):(qt(this._levels[g].el),this._removeTilesAtZoom(g),this._onRemoveLevel(g),delete this._levels[g]);var _=this._levels[a],C=this._map;return _||(_=this._levels[a]={},_.el=ee("div","leaflet-tile-container leaflet-zoom-animated",this._container),_.el.style.zIndex=d,_.origin=C.project(C.unproject(C.getPixelOrigin()),a).round(),_.zoom=a,this._setZoomTransform(_,C.getCenter(),C.getZoom()),f(_.el.offsetWidth),this._onCreateLevel(_)),this._level=_,_}},_onUpdateLevel:f,_onRemoveLevel:f,_onCreateLevel:f,_pruneTiles:function(){if(this._map){var a,d,g=this._map.getZoom();if(g>this.options.maxZoom||g<this.options.minZoom){this._removeAllTiles();return}for(a in this._tiles)d=this._tiles[a],d.retain=d.current;for(a in this._tiles)if(d=this._tiles[a],d.current&&!d.active){var _=d.coords;this._retainParent(_.x,_.y,_.z,_.z-5)||this._retainChildren(_.x,_.y,_.z,_.z+2)}for(a in this._tiles)this._tiles[a].retain||this._removeTile(a)}},_removeTilesAtZoom:function(a){for(var d in this._tiles)this._tiles[d].coords.z===a&&this._removeTile(d)},_removeAllTiles:function(){for(var a in this._tiles)this._removeTile(a)},_invalidateAll:function(){for(var a in this._levels)qt(this._levels[a].el),this._onRemoveLevel(Number(a)),delete this._levels[a];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(a,d,g,_){var C=Math.floor(a/2),k=Math.floor(d/2),F=g-1,et=new J(+C,+k);et.z=+F;var ot=this._tileCoordsToKey(et),dt=this._tiles[ot];return dt&&dt.active?(dt.retain=!0,!0):(dt&&dt.loaded&&(dt.retain=!0),F>_?this._retainParent(C,k,F,_):!1)},_retainChildren:function(a,d,g,_){for(var C=2*a;C<2*a+2;C++)for(var k=2*d;k<2*d+2;k++){var F=new J(C,k);F.z=g+1;var et=this._tileCoordsToKey(F),ot=this._tiles[et];if(ot&&ot.active){ot.retain=!0;continue}else ot&&ot.loaded&&(ot.retain=!0);g+1<_&&this._retainChildren(C,k,g+1,_)}},_resetView:function(a){var d=a&&(a.pinch||a.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),d,d)},_animateZoom:function(a){this._setView(a.center,a.zoom,!0,a.noUpdate)},_clampZoom:function(a){var d=this.options;return d.minNativeZoom!==void 0&&a<d.minNativeZoom?d.minNativeZoom:d.maxNativeZoom!==void 0&&d.maxNativeZoom<a?d.maxNativeZoom:a},_setView:function(a,d,g,_){var C=Math.round(d);this.options.maxZoom!==void 0&&C>this.options.maxZoom||this.options.minZoom!==void 0&&C<this.options.minZoom?C=void 0:C=this._clampZoom(C);var k=this.options.updateWhenZooming&&C!==this._tileZoom;(!_||k)&&(this._tileZoom=C,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),C!==void 0&&this._update(a),g||this._pruneTiles(),this._noPrune=!!g),this._setZoomTransforms(a,d)},_setZoomTransforms:function(a,d){for(var g in this._levels)this._setZoomTransform(this._levels[g],a,d)},_setZoomTransform:function(a,d,g){var _=this._map.getZoomScale(g,a.zoom),C=a.origin.multiplyBy(_).subtract(this._map._getNewPixelOrigin(d,g)).round();$t.any3d?qe(a.el,C,_):ke(a.el,C)},_resetGrid:function(){var a=this._map,d=a.options.crs,g=this._tileSize=this.getTileSize(),_=this._tileZoom,C=this._map.getPixelWorldBounds(this._tileZoom);C&&(this._globalTileRange=this._pxBoundsToTileRange(C)),this._wrapX=d.wrapLng&&!this.options.noWrap&&[Math.floor(a.project([0,d.wrapLng[0]],_).x/g.x),Math.ceil(a.project([0,d.wrapLng[1]],_).x/g.y)],this._wrapY=d.wrapLat&&!this.options.noWrap&&[Math.floor(a.project([d.wrapLat[0],0],_).y/g.x),Math.ceil(a.project([d.wrapLat[1],0],_).y/g.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(a){var d=this._map,g=d._animatingZoom?Math.max(d._animateToZoom,d.getZoom()):d.getZoom(),_=d.getZoomScale(g,this._tileZoom),C=d.project(a,this._tileZoom).floor(),k=d.getSize().divideBy(_*2);return new nt(C.subtract(k),C.add(k))},_update:function(a){var d=this._map;if(d){var g=this._clampZoom(d.getZoom());if(a===void 0&&(a=d.getCenter()),this._tileZoom!==void 0){var _=this._getTiledPixelBounds(a),C=this._pxBoundsToTileRange(_),k=C.getCenter(),F=[],et=this.options.keepBuffer,ot=new nt(C.getBottomLeft().subtract([et,-et]),C.getTopRight().add([et,-et]));if(!(isFinite(C.min.x)&&isFinite(C.min.y)&&isFinite(C.max.x)&&isFinite(C.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var dt in this._tiles){var Pt=this._tiles[dt].coords;(Pt.z!==this._tileZoom||!ot.contains(new J(Pt.x,Pt.y)))&&(this._tiles[dt].current=!1)}if(Math.abs(g-this._tileZoom)>1){this._setView(a,g);return}for(var kt=C.min.y;kt<=C.max.y;kt++)for(var Yt=C.min.x;Yt<=C.max.x;Yt++){var fn=new J(Yt,kt);if(fn.z=this._tileZoom,!!this._isValidTile(fn)){var oe=this._tiles[this._tileCoordsToKey(fn)];oe?oe.current=!0:F.push(fn)}}if(F.sort(function(jt,Kt){return jt.distanceTo(k)-Kt.distanceTo(k)}),F.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var St=document.createDocumentFragment();for(Yt=0;Yt<F.length;Yt++)this._addTile(F[Yt],St);this._level.el.appendChild(St)}}}},_isValidTile:function(a){var d=this._map.options.crs;if(!d.infinite){var g=this._globalTileRange;if(!d.wrapLng&&(a.x<g.min.x||a.x>g.max.x)||!d.wrapLat&&(a.y<g.min.y||a.y>g.max.y))return!1}if(!this.options.bounds)return!0;var _=this._tileCoordsToBounds(a);return ct(this.options.bounds).overlaps(_)},_keyToBounds:function(a){return this._tileCoordsToBounds(this._keyToTileCoords(a))},_tileCoordsToNwSe:function(a){var d=this._map,g=this.getTileSize(),_=a.scaleBy(g),C=_.add(g),k=d.unproject(_,a.z),F=d.unproject(C,a.z);return[k,F]},_tileCoordsToBounds:function(a){var d=this._tileCoordsToNwSe(a),g=new at(d[0],d[1]);return this.options.noWrap||(g=this._map.wrapLatLngBounds(g)),g},_tileCoordsToKey:function(a){return a.x+":"+a.y+":"+a.z},_keyToTileCoords:function(a){var d=a.split(":"),g=new J(+d[0],+d[1]);return g.z=+d[2],g},_removeTile:function(a){var d=this._tiles[a];d&&(qt(d.el),delete this._tiles[a],this.fire("tileunload",{tile:d.el,coords:this._keyToTileCoords(a)}))},_initTile:function(a){It(a,"leaflet-tile");var d=this.getTileSize();a.style.width=d.x+"px",a.style.height=d.y+"px",a.onselectstart=f,a.onmousemove=f,$t.ielt9&&this.options.opacity<1&&Mn(a,this.options.opacity)},_addTile:function(a,d){var g=this._getTilePos(a),_=this._tileCoordsToKey(a),C=this.createTile(this._wrapCoords(a),s(this._tileReady,this,a));this._initTile(C),this.createTile.length<2&&D(s(this._tileReady,this,a,null,C)),ke(C,g),this._tiles[_]={el:C,coords:a,current:!0},d.appendChild(C),this.fire("tileloadstart",{tile:C,coords:a})},_tileReady:function(a,d,g){d&&this.fire("tileerror",{error:d,tile:g,coords:a});var _=this._tileCoordsToKey(a);g=this._tiles[_],g&&(g.loaded=+new Date,this._map._fadeAnimated?(Mn(g.el,0),j(this._fadeFrame),this._fadeFrame=D(this._updateOpacity,this)):(g.active=!0,this._pruneTiles()),d||(It(g.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:g.el,coords:a})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),$t.ielt9||!this._map._fadeAnimated?D(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(a){return a.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(a){var d=new J(this._wrapX?u(a.x,this._wrapX):a.x,this._wrapY?u(a.y,this._wrapY):a.y);return d.z=a.z,d},_pxBoundsToTileRange:function(a){var d=this.getTileSize();return new nt(a.min.unscaleBy(d).floor(),a.max.unscaleBy(d).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var a in this._tiles)if(!this._tiles[a].loaded)return!1;return!0}});function qh(a){return new No(a)}var Xi=No.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(a,d){this._url=a,d=p(this,d),d.detectRetina&&$t.retina&&d.maxZoom>0?(d.tileSize=Math.floor(d.tileSize/2),d.zoomReverse?(d.zoomOffset--,d.minZoom=Math.min(d.maxZoom,d.minZoom+1)):(d.zoomOffset++,d.maxZoom=Math.max(d.minZoom,d.maxZoom-1)),d.minZoom=Math.max(0,d.minZoom)):d.zoomReverse?d.minZoom=Math.min(d.maxZoom,d.minZoom):d.maxZoom=Math.max(d.minZoom,d.maxZoom),typeof d.subdomains=="string"&&(d.subdomains=d.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(a,d){return this._url===a&&d===void 0&&(d=!0),this._url=a,d||this.redraw(),this},createTile:function(a,d){var g=document.createElement("img");return Dt(g,"load",s(this._tileOnLoad,this,d,g)),Dt(g,"error",s(this._tileOnError,this,d,g)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(g.referrerPolicy=this.options.referrerPolicy),g.alt="",g.src=this.getTileUrl(a),g},getTileUrl:function(a){var d={r:$t.retina?"@2x":"",s:this._getSubdomain(a),x:a.x,y:a.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var g=this._globalTileRange.max.y-a.y;this.options.tms&&(d.y=g),d["-y"]=g}return S(this._url,i(d,this.options))},_tileOnLoad:function(a,d){$t.ielt9?setTimeout(s(a,this,null,d),0):a(null,d)},_tileOnError:function(a,d,g){var _=this.options.errorTileUrl;_&&d.getAttribute("src")!==_&&(d.src=_),a(g,d)},_onTileRemove:function(a){a.tile.onload=null},_getZoomForUrl:function(){var a=this._tileZoom,d=this.options.maxZoom,g=this.options.zoomReverse,_=this.options.zoomOffset;return g&&(a=d-a),a+_},_getSubdomain:function(a){var d=Math.abs(a.x+a.y)%this.options.subdomains.length;return this.options.subdomains[d]},_abortLoading:function(){var a,d;for(a in this._tiles)if(this._tiles[a].coords.z!==this._tileZoom&&(d=this._tiles[a].el,d.onload=f,d.onerror=f,!d.complete)){d.src=w;var g=this._tiles[a].coords;qt(d),delete this._tiles[a],this.fire("tileabort",{tile:d,coords:g})}},_removeTile:function(a){var d=this._tiles[a];if(d)return d.el.setAttribute("src",w),No.prototype._removeTile.call(this,a)},_tileReady:function(a,d,g){if(!(!this._map||g&&g.getAttribute("src")===w))return No.prototype._tileReady.call(this,a,d,g)}});function Oc(a,d){return new Xi(a,d)}var Mc=Xi.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(a,d){this._url=a;var g=i({},this.defaultWmsParams);for(var _ in d)_ in this.options||(g[_]=d[_]);d=p(this,d);var C=d.detectRetina&&$t.retina?2:1,k=this.getTileSize();g.width=k.x*C,g.height=k.y*C,this.wmsParams=g},onAdd:function(a){this._crs=this.options.crs||a.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var d=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[d]=this._crs.code,Xi.prototype.onAdd.call(this,a)},getTileUrl:function(a){var d=this._tileCoordsToNwSe(a),g=this._crs,_=it(g.project(d[0]),g.project(d[1])),C=_.min,k=_.max,F=(this._wmsVersion>=1.3&&this._crs===Ra?[C.y,C.x,k.y,k.x]:[C.x,C.y,k.x,k.y]).join(","),et=Xi.prototype.getTileUrl.call(this,a);return et+b(this.wmsParams,et,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+F},setParams:function(a,d){return i(this.wmsParams,a),d||this.redraw(),this}});function Gh(a,d){return new Mc(a,d)}Xi.WMS=Mc,Oc.wms=Gh;var Mr=ir.extend({options:{padding:.1},initialize:function(a){p(this,a),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),It(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var a={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(a.zoomanim=this._onAnimZoom),a},_onAnimZoom:function(a){this._updateTransform(a.center,a.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(a,d){var g=this._map.getZoomScale(d,this._zoom),_=this._map.getSize().multiplyBy(.5+this.options.padding),C=this._map.project(this._center,d),k=_.multiplyBy(-g).add(C).subtract(this._map._getNewPixelOrigin(a,d));$t.any3d?qe(this._container,k,g):ke(this._container,k)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var a in this._layers)this._layers[a]._reset()},_onZoomEnd:function(){for(var a in this._layers)this._layers[a]._project()},_updatePaths:function(){for(var a in this._layers)this._layers[a]._update()},_update:function(){var a=this.options.padding,d=this._map.getSize(),g=this._map.containerPointToLayerPoint(d.multiplyBy(-a)).round();this._bounds=new nt(g,g.add(d.multiplyBy(1+a*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),kc=Mr.extend({options:{tolerance:0},getEvents:function(){var a=Mr.prototype.getEvents.call(this);return a.viewprereset=this._onViewPreReset,a},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Mr.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var a=this._container=document.createElement("canvas");Dt(a,"mousemove",this._onMouseMove,this),Dt(a,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Dt(a,"mouseout",this._handleMouseOut,this),a._leaflet_disable_events=!0,this._ctx=a.getContext("2d")},_destroyContainer:function(){j(this._redrawRequest),delete this._ctx,qt(this._container),Ee(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var a;this._redrawBounds=null;for(var d in this._layers)a=this._layers[d],a._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Mr.prototype._update.call(this);var a=this._bounds,d=this._container,g=a.getSize(),_=$t.retina?2:1;ke(d,a.min),d.width=_*g.x,d.height=_*g.y,d.style.width=g.x+"px",d.style.height=g.y+"px",$t.retina&&this._ctx.scale(2,2),this._ctx.translate(-a.min.x,-a.min.y),this.fire("update")}},_reset:function(){Mr.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(a){this._updateDashArray(a),this._layers[c(a)]=a;var d=a._order={layer:a,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=d),this._drawLast=d,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(a){this._requestRedraw(a)},_removePath:function(a){var d=a._order,g=d.next,_=d.prev;g?g.prev=_:this._drawLast=_,_?_.next=g:this._drawFirst=g,delete a._order,delete this._layers[c(a)],this._requestRedraw(a)},_updatePath:function(a){this._extendRedrawBounds(a),a._project(),a._update(),this._requestRedraw(a)},_updateStyle:function(a){this._updateDashArray(a),this._requestRedraw(a)},_updateDashArray:function(a){if(typeof a.options.dashArray=="string"){var d=a.options.dashArray.split(/[, ]+/),g=[],_,C;for(C=0;C<d.length;C++){if(_=Number(d[C]),isNaN(_))return;g.push(_)}a.options._dashArray=g}else a.options._dashArray=a.options.dashArray},_requestRedraw:function(a){this._map&&(this._extendRedrawBounds(a),this._redrawRequest=this._redrawRequest||D(this._redraw,this))},_extendRedrawBounds:function(a){if(a._pxBounds){var d=(a.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new nt,this._redrawBounds.extend(a._pxBounds.min.subtract([d,d])),this._redrawBounds.extend(a._pxBounds.max.add([d,d]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var a=this._redrawBounds;if(a){var d=a.getSize();this._ctx.clearRect(a.min.x,a.min.y,d.x,d.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var a,d=this._redrawBounds;if(this._ctx.save(),d){var g=d.getSize();this._ctx.beginPath(),this._ctx.rect(d.min.x,d.min.y,g.x,g.y),this._ctx.clip()}this._drawing=!0;for(var _=this._drawFirst;_;_=_.next)a=_.layer,(!d||a._pxBounds&&a._pxBounds.intersects(d))&&a._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(a,d){if(this._drawing){var g,_,C,k,F=a._parts,et=F.length,ot=this._ctx;if(et){for(ot.beginPath(),g=0;g<et;g++){for(_=0,C=F[g].length;_<C;_++)k=F[g][_],ot[_?"lineTo":"moveTo"](k.x,k.y);d&&ot.closePath()}this._fillStroke(ot,a)}}},_updateCircle:function(a){if(!(!this._drawing||a._empty())){var d=a._point,g=this._ctx,_=Math.max(Math.round(a._radius),1),C=(Math.max(Math.round(a._radiusY),1)||_)/_;C!==1&&(g.save(),g.scale(1,C)),g.beginPath(),g.arc(d.x,d.y/C,_,0,Math.PI*2,!1),C!==1&&g.restore(),this._fillStroke(g,a)}},_fillStroke:function(a,d){var g=d.options;g.fill&&(a.globalAlpha=g.fillOpacity,a.fillStyle=g.fillColor||g.color,a.fill(g.fillRule||"evenodd")),g.stroke&&g.weight!==0&&(a.setLineDash&&a.setLineDash(d.options&&d.options._dashArray||[]),a.globalAlpha=g.opacity,a.lineWidth=g.weight,a.strokeStyle=g.color,a.lineCap=g.lineCap,a.lineJoin=g.lineJoin,a.stroke())},_onClick:function(a){for(var d=this._map.mouseEventToLayerPoint(a),g,_,C=this._drawFirst;C;C=C.next)g=C.layer,g.options.interactive&&g._containsPoint(d)&&(!(a.type==="click"||a.type==="preclick")||!this._map._draggableMoved(g))&&(_=g);this._fireEvent(_?[_]:!1,a)},_onMouseMove:function(a){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var d=this._map.mouseEventToLayerPoint(a);this._handleMouseHover(a,d)}},_handleMouseOut:function(a){var d=this._hoveredLayer;d&&(ae(this._container,"leaflet-interactive"),this._fireEvent([d],a,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(a,d){if(!this._mouseHoverThrottled){for(var g,_,C=this._drawFirst;C;C=C.next)g=C.layer,g.options.interactive&&g._containsPoint(d)&&(_=g);_!==this._hoveredLayer&&(this._handleMouseOut(a),_&&(It(this._container,"leaflet-interactive"),this._fireEvent([_],a,"mouseover"),this._hoveredLayer=_)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,a),this._mouseHoverThrottled=!0,setTimeout(s(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(a,d,g){this._map._fireDOMEvent(d,g||d.type,a)},_bringToFront:function(a){var d=a._order;if(d){var g=d.next,_=d.prev;if(g)g.prev=_;else return;_?_.next=g:g&&(this._drawFirst=g),d.prev=this._drawLast,this._drawLast.next=d,d.next=null,this._drawLast=d,this._requestRedraw(a)}},_bringToBack:function(a){var d=a._order;if(d){var g=d.next,_=d.prev;if(_)_.next=g;else return;g?g.prev=_:_&&(this._drawLast=_),d.prev=null,d.next=this._drawFirst,this._drawFirst.prev=d,this._drawFirst=d,this._requestRedraw(a)}}});function $c(a){return $t.canvas?new kc(a):null}var jo=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(a){return document.createElement("<lvml:"+a+' class="lvml">')}}catch{}return function(a){return document.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Zh={_initContainer:function(){this._container=ee("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Mr.prototype._update.call(this),this.fire("update"))},_initPath:function(a){var d=a._container=jo("shape");It(d,"leaflet-vml-shape "+(this.options.className||"")),d.coordsize="1 1",a._path=jo("path"),d.appendChild(a._path),this._updateStyle(a),this._layers[c(a)]=a},_addPath:function(a){var d=a._container;this._container.appendChild(d),a.options.interactive&&a.addInteractiveTarget(d)},_removePath:function(a){var d=a._container;qt(d),a.removeInteractiveTarget(d),delete this._layers[c(a)]},_updateStyle:function(a){var d=a._stroke,g=a._fill,_=a.options,C=a._container;C.stroked=!!_.stroke,C.filled=!!_.fill,_.stroke?(d||(d=a._stroke=jo("stroke")),C.appendChild(d),d.weight=_.weight+"px",d.color=_.color,d.opacity=_.opacity,_.dashArray?d.dashStyle=A(_.dashArray)?_.dashArray.join(" "):_.dashArray.replace(/( *, *)/g," "):d.dashStyle="",d.endcap=_.lineCap.replace("butt","flat"),d.joinstyle=_.lineJoin):d&&(C.removeChild(d),a._stroke=null),_.fill?(g||(g=a._fill=jo("fill")),C.appendChild(g),g.color=_.fillColor||_.color,g.opacity=_.fillOpacity):g&&(C.removeChild(g),a._fill=null)},_updateCircle:function(a){var d=a._point.round(),g=Math.round(a._radius),_=Math.round(a._radiusY||g);this._setPath(a,a._empty()?"M0 0":"AL "+d.x+","+d.y+" "+g+","+_+" 0,"+65535*360)},_setPath:function(a,d){a._path.v=d},_bringToFront:function(a){ye(a._container)},_bringToBack:function(a){wt(a._container)}},M=$t.vml?jo:de,$=Mr.extend({_initContainer:function(){this._container=M("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=M("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){qt(this._container),Ee(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Mr.prototype._update.call(this);var a=this._bounds,d=a.getSize(),g=this._container;(!this._svgSize||!this._svgSize.equals(d))&&(this._svgSize=d,g.setAttribute("width",d.x),g.setAttribute("height",d.y)),ke(g,a.min),g.setAttribute("viewBox",[a.min.x,a.min.y,d.x,d.y].join(" ")),this.fire("update")}},_initPath:function(a){var d=a._path=M("path");a.options.className&&It(d,a.options.className),a.options.interactive&&It(d,"leaflet-interactive"),this._updateStyle(a),this._layers[c(a)]=a},_addPath:function(a){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(a._path),a.addInteractiveTarget(a._path)},_removePath:function(a){qt(a._path),a.removeInteractiveTarget(a._path),delete this._layers[c(a)]},_updatePath:function(a){a._project(),a._update()},_updateStyle:function(a){var d=a._path,g=a.options;d&&(g.stroke?(d.setAttribute("stroke",g.color),d.setAttribute("stroke-opacity",g.opacity),d.setAttribute("stroke-width",g.weight),d.setAttribute("stroke-linecap",g.lineCap),d.setAttribute("stroke-linejoin",g.lineJoin),g.dashArray?d.setAttribute("stroke-dasharray",g.dashArray):d.removeAttribute("stroke-dasharray"),g.dashOffset?d.setAttribute("stroke-dashoffset",g.dashOffset):d.removeAttribute("stroke-dashoffset")):d.setAttribute("stroke","none"),g.fill?(d.setAttribute("fill",g.fillColor||g.color),d.setAttribute("fill-opacity",g.fillOpacity),d.setAttribute("fill-rule",g.fillRule||"evenodd")):d.setAttribute("fill","none"))},_updatePoly:function(a,d){this._setPath(a,ne(a._parts,d))},_updateCircle:function(a){var d=a._point,g=Math.max(Math.round(a._radius),1),_=Math.max(Math.round(a._radiusY),1)||g,C="a"+g+","+_+" 0 1,0 ",k=a._empty()?"M0 0":"M"+(d.x-g)+","+d.y+C+g*2+",0 "+C+-g*2+",0 ";this._setPath(a,k)},_setPath:function(a,d){a._path.setAttribute("d",d)},_bringToFront:function(a){ye(a._path)},_bringToBack:function(a){wt(a._path)}});$t.vml&&$.include(Zh);function I(a){return $t.svg||$t.vml?new $(a):null}Zt.include({getRenderer:function(a){var d=a.options.renderer||this._getPaneRenderer(a.options.pane)||this.options.renderer||this._renderer;return d||(d=this._renderer=this._createRenderer()),this.hasLayer(d)||this.addLayer(d),d},_getPaneRenderer:function(a){if(a==="overlayPane"||a===void 0)return!1;var d=this._paneRenderers[a];return d===void 0&&(d=this._createRenderer({pane:a}),this._paneRenderers[a]=d),d},_createRenderer:function(a){return this.options.preferCanvas&&$c(a)||I(a)}});var Z=Lo.extend({initialize:function(a,d){Lo.prototype.initialize.call(this,this._boundsToLatLngs(a),d)},setBounds:function(a){return this.setLatLngs(this._boundsToLatLngs(a))},_boundsToLatLngs:function(a){return a=ct(a),[a.getSouthWest(),a.getNorthWest(),a.getNorthEast(),a.getSouthEast()]}});function B(a,d){return new Z(a,d)}$.create=M,$.pointsToPath=ne,Yr.geometryToLayer=ks,Yr.coordsToLatLng=Ac,Yr.coordsToLatLngs=Tc,Yr.latLngToCoords=Ec,Yr.latLngsToCoords=gr,Yr.getFeature=Ki,Yr.asFeature=$s,Zt.mergeOptions({boxZoom:!0});var W=nr.extend({initialize:function(a){this._map=a,this._container=a._container,this._pane=a._panes.overlayPane,this._resetStateTimeout=0,a.on("unload",this._destroy,this)},addHooks:function(){Dt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ee(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){qt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(a){if(!a.shiftKey||a.which!==1&&a.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Ss(),Tr(),this._startPoint=this._map.mouseEventToContainerPoint(a),Dt(document,{contextmenu:ui,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(a){this._moved||(this._moved=!0,this._box=ee("div","leaflet-zoom-box",this._container),It(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(a);var d=new nt(this._point,this._startPoint),g=d.getSize();ke(this._box,d.min),this._box.style.width=g.x+"px",this._box.style.height=g.y+"px"},_finish:function(){this._moved&&(qt(this._box),ae(this._container,"leaflet-crosshair")),Vr(),Oo(),Ee(document,{contextmenu:ui,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(a){if(!(a.which!==1&&a.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(s(this._resetState,this),0);var d=new at(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(d).fire("boxzoomend",{boxZoomBounds:d})}},_onKeyDown:function(a){a.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Zt.addInitHook("addHandler","boxZoom",W),Zt.mergeOptions({doubleClickZoom:!0});var Q=nr.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(a){var d=this._map,g=d.getZoom(),_=d.options.zoomDelta,C=a.originalEvent.shiftKey?g-_:g+_;d.options.doubleClickZoom==="center"?d.setZoom(C):d.setZoomAround(a.containerPoint,C)}});Zt.addInitHook("addHandler","doubleClickZoom",Q),Zt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var tt=nr.extend({addHooks:function(){if(!this._draggable){var a=this._map;this._draggable=new Zn(a._mapPane,a._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),a.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),a.on("zoomend",this._onZoomEnd,this),a.whenReady(this._onZoomEnd,this))}It(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ae(this._map._container,"leaflet-grab"),ae(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var a=this._map;if(a._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var d=ct(this._map.options.maxBounds);this._offsetLimit=it(this._map.latLngToContainerPoint(d.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(d.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;a.fire("movestart").fire("dragstart"),a.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(a){if(this._map.options.inertia){var d=this._lastTime=+new Date,g=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(g),this._times.push(d),this._prunePositions(d)}this._map.fire("move",a).fire("drag",a)},_prunePositions:function(a){for(;this._positions.length>1&&a-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var a=this._map.getSize().divideBy(2),d=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=d.subtract(a).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(a,d){return a-(a-d)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var a=this._draggable._newPos.subtract(this._draggable._startPos),d=this._offsetLimit;a.x<d.min.x&&(a.x=this._viscousLimit(a.x,d.min.x)),a.y<d.min.y&&(a.y=this._viscousLimit(a.y,d.min.y)),a.x>d.max.x&&(a.x=this._viscousLimit(a.x,d.max.x)),a.y>d.max.y&&(a.y=this._viscousLimit(a.y,d.max.y)),this._draggable._newPos=this._draggable._startPos.add(a)}},_onPreDragWrap:function(){var a=this._worldWidth,d=Math.round(a/2),g=this._initialWorldOffset,_=this._draggable._newPos.x,C=(_-d+g)%a+d-g,k=(_+d+g)%a-d-g,F=Math.abs(C+g)<Math.abs(k+g)?C:k;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=F},_onDragEnd:function(a){var d=this._map,g=d.options,_=!g.inertia||a.noInertia||this._times.length<2;if(d.fire("dragend",a),_)d.fire("moveend");else{this._prunePositions(+new Date);var C=this._lastPos.subtract(this._positions[0]),k=(this._lastTime-this._times[0])/1e3,F=g.easeLinearity,et=C.multiplyBy(F/k),ot=et.distanceTo([0,0]),dt=Math.min(g.inertiaMaxSpeed,ot),Pt=et.multiplyBy(dt/ot),kt=dt/(g.inertiaDeceleration*F),Yt=Pt.multiplyBy(-kt/2).round();!Yt.x&&!Yt.y?d.fire("moveend"):(Yt=d._limitOffset(Yt,d.options.maxBounds),D(function(){d.panBy(Yt,{duration:kt,easeLinearity:F,noMoveStart:!0,animate:!0})}))}}});Zt.addInitHook("addHandler","dragging",tt),Zt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var X=nr.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(a){this._map=a,this._setPanDelta(a.options.keyboardPanDelta),this._setZoomDelta(a.options.zoomDelta)},addHooks:function(){var a=this._map._container;a.tabIndex<=0&&(a.tabIndex="0"),Dt(a,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ee(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var a=document.body,d=document.documentElement,g=a.scrollTop||d.scrollTop,_=a.scrollLeft||d.scrollLeft;this._map._container.focus(),window.scrollTo(_,g)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(a){var d=this._panKeys={},g=this.keyCodes,_,C;for(_=0,C=g.left.length;_<C;_++)d[g.left[_]]=[-1*a,0];for(_=0,C=g.right.length;_<C;_++)d[g.right[_]]=[a,0];for(_=0,C=g.down.length;_<C;_++)d[g.down[_]]=[0,a];for(_=0,C=g.up.length;_<C;_++)d[g.up[_]]=[0,-1*a]},_setZoomDelta:function(a){var d=this._zoomKeys={},g=this.keyCodes,_,C;for(_=0,C=g.zoomIn.length;_<C;_++)d[g.zoomIn[_]]=a;for(_=0,C=g.zoomOut.length;_<C;_++)d[g.zoomOut[_]]=-a},_addHooks:function(){Dt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ee(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(a){if(!(a.altKey||a.ctrlKey||a.metaKey)){var d=a.keyCode,g=this._map,_;if(d in this._panKeys){if(!g._panAnim||!g._panAnim._inProgress)if(_=this._panKeys[d],a.shiftKey&&(_=q(_).multiplyBy(3)),g.options.maxBounds&&(_=g._limitOffset(q(_),g.options.maxBounds)),g.options.worldCopyJump){var C=g.wrapLatLng(g.unproject(g.project(g.getCenter()).add(_)));g.panTo(C)}else g.panBy(_)}else if(d in this._zoomKeys)g.setZoom(g.getZoom()+(a.shiftKey?3:1)*this._zoomKeys[d]);else if(d===27&&g._popup&&g._popup.options.closeOnEscapeKey)g.closePopup();else return;ui(a)}}});Zt.addInitHook("addHandler","keyboard",X),Zt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var st=nr.extend({addHooks:function(){Dt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ee(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(a){var d=kn(a),g=this._map.options.wheelDebounceTime;this._delta+=d,this._lastMousePos=this._map.mouseEventToContainerPoint(a),this._startTime||(this._startTime=+new Date);var _=Math.max(g-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),_),ui(a)},_performZoom:function(){var a=this._map,d=a.getZoom(),g=this._map.options.zoomSnap||0;a._stop();var _=this._delta/(this._map.options.wheelPxPerZoomLevel*4),C=4*Math.log(2/(1+Math.exp(-Math.abs(_))))/Math.LN2,k=g?Math.ceil(C/g)*g:C,F=a._limitZoom(d+(this._delta>0?k:-k))-d;this._delta=0,this._startTime=null,F&&(a.options.scrollWheelZoom==="center"?a.setZoom(d+F):a.setZoomAround(this._lastMousePos,d+F))}});Zt.addInitHook("addHandler","scrollWheelZoom",st);var mt=600;Zt.mergeOptions({tapHold:$t.touchNative&&$t.safari&&$t.mobile,tapTolerance:15});var vt=nr.extend({addHooks:function(){Dt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ee(this._map._container,"touchstart",this._onDown,this)},_onDown:function(a){if(clearTimeout(this._holdTimeout),a.touches.length===1){var d=a.touches[0];this._startPos=this._newPos=new J(d.clientX,d.clientY),this._holdTimeout=setTimeout(s(function(){this._cancel(),this._isTapValid()&&(Dt(document,"touchend",en),Dt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",d))},this),mt),Dt(document,"touchend touchcancel contextmenu",this._cancel,this),Dt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function a(){Ee(document,"touchend",en),Ee(document,"touchend touchcancel",a)},_cancel:function(){clearTimeout(this._holdTimeout),Ee(document,"touchend touchcancel contextmenu",this._cancel,this),Ee(document,"touchmove",this._onMove,this)},_onMove:function(a){var d=a.touches[0];this._newPos=new J(d.clientX,d.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(a,d){var g=new MouseEvent(a,{bubbles:!0,cancelable:!0,view:window,screenX:d.screenX,screenY:d.screenY,clientX:d.clientX,clientY:d.clientY});g._simulated=!0,d.target.dispatchEvent(g)}});Zt.addInitHook("addHandler","tapHold",vt),Zt.mergeOptions({touchZoom:$t.touch,bounceAtZoomLimits:!0});var pt=nr.extend({addHooks:function(){It(this._map._container,"leaflet-touch-zoom"),Dt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ae(this._map._container,"leaflet-touch-zoom"),Ee(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(a){var d=this._map;if(!(!a.touches||a.touches.length!==2||d._animatingZoom||this._zooming)){var g=d.mouseEventToContainerPoint(a.touches[0]),_=d.mouseEventToContainerPoint(a.touches[1]);this._centerPoint=d.getSize()._divideBy(2),this._startLatLng=d.containerPointToLatLng(this._centerPoint),d.options.touchZoom!=="center"&&(this._pinchStartLatLng=d.containerPointToLatLng(g.add(_)._divideBy(2))),this._startDist=g.distanceTo(_),this._startZoom=d.getZoom(),this._moved=!1,this._zooming=!0,d._stop(),Dt(document,"touchmove",this._onTouchMove,this),Dt(document,"touchend touchcancel",this._onTouchEnd,this),en(a)}},_onTouchMove:function(a){if(!(!a.touches||a.touches.length!==2||!this._zooming)){var d=this._map,g=d.mouseEventToContainerPoint(a.touches[0]),_=d.mouseEventToContainerPoint(a.touches[1]),C=g.distanceTo(_)/this._startDist;if(this._zoom=d.getScaleZoom(C,this._startZoom),!d.options.bounceAtZoomLimits&&(this._zoom<d.getMinZoom()&&C<1||this._zoom>d.getMaxZoom()&&C>1)&&(this._zoom=d._limitZoom(this._zoom)),d.options.touchZoom==="center"){if(this._center=this._startLatLng,C===1)return}else{var k=g._add(_)._divideBy(2)._subtract(this._centerPoint);if(C===1&&k.x===0&&k.y===0)return;this._center=d.unproject(d.project(this._pinchStartLatLng,this._zoom).subtract(k),this._zoom)}this._moved||(d._moveStart(!0,!1),this._moved=!0),j(this._animRequest);var F=s(d._move,d,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=D(F,this,!0),en(a)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,j(this._animRequest),Ee(document,"touchmove",this._onTouchMove,this),Ee(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Zt.addInitHook("addHandler","touchZoom",pt),Zt.BoxZoom=W,Zt.DoubleClickZoom=Q,Zt.Drag=tt,Zt.Keyboard=X,Zt.ScrollWheelZoom=st,Zt.TapHold=vt,Zt.TouchZoom=pt,n.Bounds=nt,n.Browser=$t,n.CRS=Et,n.Canvas=kc,n.Circle=Yi,n.CircleMarker=Zi,n.Class=H,n.Control=Bn,n.DivIcon=Cc,n.DivOverlay=Or,n.DomEvent=yc,n.DomUtil=xm,n.Draggable=Zn,n.Evented=G,n.FeatureGroup=Er,n.GeoJSON=Yr,n.GridLayer=No,n.Handler=nr,n.Icon=pi,n.ImageOverlay=ja,n.LatLng=gt,n.LatLngBounds=at,n.Layer=ir,n.LayerGroup=di,n.LineUtil=Am,n.Map=Zt,n.Marker=Ms,n.Mixin=xc,n.Path=Zr,n.Point=J,n.PolyUtil=Gi,n.Polygon=Lo,n.Polyline=or,n.Popup=Da,n.PosAnimation=vc,n.Projection=Rh,n.Rectangle=Z,n.Renderer=Mr,n.SVG=$,n.SVGOverlay=Wh,n.TileLayer=Xi,n.Tooltip=Rs,n.Transformation=Ct,n.Util=K,n.VideoOverlay=Fh,n.bind=s,n.bounds=it,n.canvas=$c,n.circle=Dh,n.circleMarker=fe,n.control=Es,n.divIcon=Hh,n.extend=i,n.featureGroup=jh,n.geoJSON=zh,n.geoJson=Em,n.gridLayer=qh,n.icon=Pc,n.imageOverlay=Cm,n.latLng=yt,n.latLngBounds=ct,n.layerGroup=Nh,n.map=Ch,n.marker=Ro,n.point=q,n.polygon=Bh,n.polyline=Na,n.popup=Vh,n.rectangle=B,n.setOptions=p,n.stamp=c,n.svg=I,n.svgOverlay=Om,n.tileLayer=Oc,n.tooltip=Uh,n.transformation=rt,n.version=r,n.videoOverlay=Px;var At=window.L;n.noConflict=function(){return window.L=At,this},window.L=n})})(ob,ob.exports);var Ta=ob.exports;function pc(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function _x(e,t){return t==null?function(r,i){const o=v.useRef();return o.current||(o.current=e(r,i)),o}:function(r,i){const o=v.useRef();o.current||(o.current=e(r,i));const s=v.useRef(r),{instance:l}=o.current;return v.useEffect(function(){s.current!==r&&(t(l,r,s.current),s.current=r)},[l,r,i]),o}}function U$(e,t){v.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var o;(o=t.layerContainer)==null||o.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function but(e){return function(n){const r=ym(),i=e(vm(n,r),r);return z$(r.map,n.attribution),wx(i.current,n.eventHandlers),U$(i.current,r),i}}function xut(e,t){const n=v.useRef();v.useEffect(function(){if(t.pathOptions!==n.current){const i=t.pathOptions??{};e.instance.setStyle(i),n.current=i}},[e,t])}function wut(e){return function(n){const r=ym(),i=e(vm(n,r),r);return wx(i.current,n.eventHandlers),U$(i.current,r),xut(i.current,n),i}}function _ut(e,t){const n=_x(e),r=vut(n,t);return gut(r)}function bm(e,t){const n=_x(e,t),r=wut(n);return mut(r)}function Sut(e,t){const n=_x(e,t),r=but(n);return yut(r)}function Put(e,t,n){const{opacity:r,zIndex:i}=t;r!=null&&r!==n.opacity&&e.setOpacity(r),i!=null&&i!==n.zIndex&&e.setZIndex(i)}function H$(){return ym().map}function Aut(e){const t=H$();return v.useEffect(function(){return t.on(e),function(){t.off(e)}},[t,e]),t}const Tut=bm(function({center:t,children:n,...r},i){const o=new Ta.Circle(t,r);return pc(o,gm(i,{overlayContainer:o}))},F$),aT=bm(function({center:t,children:n,...r},i){const o=new Ta.CircleMarker(t,r);return pc(o,gm(i,{overlayContainer:o}))},F$);function sb(){return sb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sb.apply(this,arguments)}function Eut({bounds:e,boundsOptions:t,center:n,children:r,className:i,id:o,placeholder:s,style:l,whenReady:c,zoom:h,...u},f){const[m]=v.useState({className:i,id:o,style:l}),[y,x]=v.useState(null);v.useImperativeHandle(f,()=>(y==null?void 0:y.map)??null,[y]);const p=v.useCallback(P=>{if(P!==null&&y===null){const S=new Ta.Map(P,u);n!=null&&h!=null?S.setView(n,h):e!=null&&S.fitBounds(e,t),c!=null&&S.whenReady(c),x(put(S))}},[]);v.useEffect(()=>()=>{y==null||y.map.remove()},[y]);const b=y?v.createElement(V$,{value:y},r):s??null;return v.createElement("div",sb({},m,{ref:p}),b)}const Cut=v.forwardRef(Eut),lT=bm(function({positions:t,...n},r){const i=new Ta.Polygon(t,n);return pc(i,gm(r,{overlayContainer:i}))},function(t,n,r){n.positions!==r.positions&&t.setLatLngs(n.positions)}),cT=bm(function({positions:t,...n},r){const i=new Ta.Polyline(t,n);return pc(i,gm(r,{overlayContainer:i}))},function(t,n,r){n.positions!==r.positions&&t.setLatLngs(n.positions)}),Out=Sut(function({url:t,...n},r){const i=new Ta.TileLayer(t,vm(n,r));return pc(i,r)},function(t,n,r){Put(t,n,r);const{url:i}=n;i!=null&&i!==r.url&&t.setUrl(i)}),Mut=_ut(function(t,n){const r=new Ta.Tooltip(t,n.overlayContainer);return pc(r,n)},function(t,n,{position:r},i){v.useEffect(function(){const s=n.overlayContainer;if(s==null)return;const{instance:l}=t,c=u=>{u.tooltip===l&&(r!=null&&l.setLatLng(r),l.update(),i(!0))},h=u=>{u.tooltip===l&&i(!1)};return s.on({tooltipopen:c,tooltipclose:h}),s.bindTooltip(l),function(){s.off({tooltipopen:c,tooltipclose:h}),s._map!=null&&s.unbindTooltip()}},[t,n,i,r])});function Ho(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function gi(e,t){let n=t;if(typeof n=="string"){const l=e.interpolateText(n);try{n=JSON.parse(l)}catch{n=l.split(",")}}const r=Array.isArray(n)?n[0]:(n==null?void 0:n.latitude)??(n==null?void 0:n.lat),i=Array.isArray(n)?n[1]:(n==null?void 0:n.longitude)??(n==null?void 0:n.lng),o=Number(e.interpolateText(String(r??""))),s=Number(e.interpolateText(String(i??"")));return Number.isFinite(o)&&Number.isFinite(s)?[o,s]:null}function qg(e,t,n){return e[t||""]??n.map(r=>e[r]).find(Boolean)??""}function ab(e,t,n,r,i){if(e.interactionDisabled)return;const o={...r,latitude:n[0],longitude:n[1],[t.latitudeKey||"latitude"]:n[0],[t.longitudeKey||"longitude"]:n[1]};e.rowContextRef&&(e.rowContextRef.current=o),e.setSceneData(s=>({...s,...o})),i&&e.handleButtonClick(e.interpolateText(i)).catch(()=>{})}function kut({api:e,drawing:t,active:n,points:r}){if(!t||t.controls===!1)return null;const i=t.activeKey||"isDrawing",o=t.activeValue??!0,s=t.inactiveValue??!1,l=t.pointsKey||"draftGeofencePoints",c=u=>e.setSceneData(f=>({...f,...u})),h={alignItems:"center",background:"#ffffff",border:"1px solid #cbd5e1",borderRadius:"6px",color:"#0f172a",cursor:"pointer",display:"flex",fontSize:"12px",fontWeight:700,gap:"6px",minHeight:"34px",padding:"7px 10px"};return U("div",{"aria-live":"polite",style:{display:"flex",flexDirection:"column",gap:"6px",position:"absolute",right:"12px",top:"12px",zIndex:1001}},n?U("div",{style:{background:"#0f172a",borderRadius:"6px",color:"#ffffff",fontSize:"12px",fontWeight:700,padding:"8px 10px"}},`Drawing polygon: ${r.length} points`):U("button",{"aria-label":"Draw geofence",onClick:()=>c({[i]:o,[l]:[]}),style:h,title:"Draw geofence",type:"button"},e.renderIcon("pencil-ruler",15),"Draw fence"),n?U("button",{"aria-label":"Finish geofence",disabled:r.length<3,onClick:()=>c({[i]:s}),style:{...h,opacity:r.length<3?.5:1},title:"Finish geofence",type:"button"},e.renderIcon("check",15),"Finish"):null,U("button",{"aria-label":"Clear geofence draft",onClick:()=>c({[i]:s,[l]:[]}),style:h,title:"Clear geofence draft",type:"button"},e.renderIcon("trash-2",15),"Clear"))}function $ut({center:e,points:t,fitBounds:n,location:r,followLocation:i,followDuration:o}){const s=H$(),l=v.useRef(!1),c=t.map(u=>u.join(",")).join("|"),h=(r==null?void 0:r.join(","))||"";return v.useEffect(()=>{const u=n&&t.length>1,f=u&&!l.current;if(i?f:u){l.current=!0,s.fitBounds(t,{padding:[24,24],maxZoom:16});return}if(i&&r){l.current=!0,s.panTo(r,{animate:!0,duration:Number(o)||.45});return}l.current=!0,s.setView(e,s.getZoom())},[e[0],e[1],n,o,i,h,s,c]),null}function Iut({enabled:e,drawingEnabled:t,onSelect:n,onDrawPoint:r}){return Aut({click:i=>{if(!e)return;const o=[i.latlng.lat,i.latlng.lng];t?r(o):n(o)}}),null}function Rut(e,t){if(!t)return!1;const n=t.activeKey?e.sceneData[t.activeKey]:t.enabled;return t.activeValue===void 0?n===!0||n==="true":String(n)===String(t.activeValue)}function Lut(e,t){return t?Ho(e.sceneData[t.pointsKey||"draftGeofencePoints"]).map(n=>gi(e,n)).filter(n=>n!==null):[]}function Nut(e,t,n){const r=gi(n,t.center);if(r&&t.radius){const o=(e[0]-r[0])*111320,s=(e[1]-r[1])*111320*Math.cos(r[0]*Math.PI/180);return Math.hypot(o,s)<=Number(t.radius)}const i=Ho(typeof t.points=="string"?n.interpolateText(t.points):t.points).map(o=>gi(n,o)).filter(o=>o!==null);return i.length<3?!1:i.reduce((o,s,l)=>{const c=i[(l+i.length-1)%i.length];return s[0]>e[0]!=c[0]>e[0]&&e[1]<(c[1]-s[1])*(e[0]-s[0])/(c[0]-s[0])+s[1]?!o:o},!1)}function jut({api:e,config:t,location:n,fences:r}){const i=JSON.stringify(r),o=(n==null?void 0:n.join(","))||"";return v.useEffect(()=>{if(!n)return;const s=new Set(r.filter(u=>Nut(n,u,e)).map((u,f)=>u.id||String(f))),l=t.geofenceKey||"activeGeofences",c=new Set(Array.isArray(e.sceneData[l])?e.sceneData[l].map(String):[]);(s.size!==c.size||[...s].some(u=>!c.has(u)))&&(e.setSceneData(u=>({...u,[l]:[...s]})),r.forEach((u,f)=>{const m=u.id||String(f),y=s.has(m)&&!c.has(m),x=!s.has(m)&&c.has(m),p=y?u.onEnter||t.onGeofenceEnter:x?u.onExit||t.onGeofenceExit:void 0;p&&ab(e,t,n,{...u,geofenceId:m},p)}))},[e,t,i,r,n,o]),null}function Dut({api:e,config:t,componentKey:n}){var w,T;const r=e.interpolateText(t.dataSource||""),{fetchListData:i}=e;v.useEffect(()=>{r&&i(r,n,0,t.pageSize||50).catch(()=>{})},[n,t.pageSize,r,i]);const s=(r?((w=e.listData)==null?void 0:w[n])||[]:Ho(typeof t.markers=="string"?e.interpolateText(t.markers):t.markers)).map(O=>({source:O,location:gi(e,O)})).filter(O=>O.location!==null),l=Ho(typeof t.route=="string"?e.interpolateText(t.route):t.route).map(O=>gi(e,O)).filter(O=>O!==null),c=gi(e,t.location),h=gi(e,t.center||t)||c||((T=s[0])==null?void 0:T.location)||l[0];t.marker&&h&&s.length===0&&s.push({source:{},location:h});const u=Ho(typeof t.geofences=="string"?e.interpolateText(t.geofences):t.geofences),f=t.drawing,m=Rut(e,f),y=Lut(e,f),x=y.length>2?{id:f.id||f.pointsKey||"drawn-geofence",label:f.label||"Drawn geofence",color:f.color||e.cfg.colors.accent,points:y}:null,p=x?[...u,x]:u,b=(f==null?void 0:f.color)||e.cfg.colors.accent,P={width:"100%",height:t.height||t.h||"360px",minHeight:"180px",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",overflow:"hidden",position:"relative",...t.className?e.parseClassName(t.className):{}},S=e.getCommonProps(n,P,t);if(!h)return U("div",{key:n,...S},t.emptyText||"Map location unavailable");const A=t.interactive!==!1&&!e.interactionDisabled,E=[...s.map(O=>O.location),...l,...c?[c]:[]];return Ze.jsxs("div",{className:t.className,...S,children:[Ze.jsxs(Cut,{center:h,zoom:Math.min(19,Math.max(1,Number(t.zoom)||14)),dragging:A,scrollWheelZoom:A,zoomControl:A,attributionControl:!1,style:{width:"100%",height:"100%"},children:[Ze.jsx(Out,{url:t.tileUrl||"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:t.tileAttribution||"&copy; OpenStreetMap contributors"}),Ze.jsx($ut,{center:h,points:E,fitBounds:t.fitBounds??E.length>1,location:c,followLocation:t.followLocation===!0,followDuration:t.followDuration}),Ze.jsx(Iut,{enabled:A,drawingEnabled:m,onSelect:O=>ab(e,t,O,{},t.onMapClick||t.onClick),onDrawPoint:O=>{const R=(f==null?void 0:f.pointsKey)||"draftGeofencePoints";e.setSceneData(N=>({...N,[R]:[...Ho(N[R]),O]}))}}),Ze.jsx(jut,{api:e,config:t,location:c,fences:p}),l.length>1&&Ze.jsx(cT,{positions:l,pathOptions:{color:t.routeColor||e.cfg.colors.primary,weight:5}}),f&&y.length===1&&Ze.jsx(aT,{center:y[0],radius:6,pathOptions:{color:b,fillColor:b}}),f&&y.length>1&&Ze.jsx(cT,{positions:y,pathOptions:{color:b,dashArray:"8 8",weight:3}}),f&&y.length>2&&Ze.jsx(lT,{positions:y,pathOptions:{color:b,fillColor:b,fillOpacity:.18,weight:2}}),u.map((O,R)=>{const N=O.color||e.cfg.colors.primary,V=gi(e,O.center),D=Ho(typeof O.points=="string"?e.interpolateText(O.points):O.points).map(K=>gi(e,K)).filter(K=>K!==null),j={color:N,fillColor:N,fillOpacity:.14,weight:2};return V&&O.radius?Ze.jsx(Tut,{center:V,radius:Number(O.radius),pathOptions:j},O.id||R):D.length>2?Ze.jsx(lT,{positions:D,pathOptions:j},O.id||R):null}),s.map(({source:O,location:R})=>Ze.jsx(aT,{center:R,radius:Number(O.radius||t.markerRadius)||9,pathOptions:{color:O.color||t.markerColor||e.cfg.colors.primary,fillColor:O.color||t.markerColor||e.cfg.colors.primary,fillOpacity:.9,weight:2},eventHandlers:{click:()=>ab(e,t,R,O,O.onClick||t.onMarkerClick)},children:O.label||O.name?Ze.jsx(Mut,{children:e.interpolateText(O.label||O.name)}):null},O.id||R.join("-")))]}),Ze.jsx(kut,{api:e,drawing:f,active:m,points:y})]},n)}function Gl(e,t,n,r,i,o=!1){if(!Array.isArray(t)||t.length===0)return null;if(r==="row"||o)return t.map((u,f)=>e.renderComponent(u,f,n));const s=[];let l=[];const c=u=>u&&(u.type==="button"||i&&(u.type==="link"||u.type==="a")),h=u=>{l.length!==0&&(l.length===1?s.push(e.renderComponent(l[0],u,n)):s.push(U("div",{key:`${n}-btns-${u}`,style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",gap:"0.75rem"}},...l.map((f,m)=>e.renderComponent(f,u+m,n)))),l=[])};return t.forEach((u,f)=>{c(u)?l.push(u):(h(f),s.push(e.renderComponent(u,f,n)))}),h(t.length),s}function q$(e){return e.className?/\bhidden\b/.test(e.className)&&/\b(sm|md|lg|xl):(?:block|flex|inline|inline-block|inline-flex)\b/.test(e.className):!1}function G$(e){return e.children?e.children.filter(t=>q$(t)):[]}function But(e){return e.children?e.children.filter(t=>!q$(t)):[]}function Z$(e){var t;return Array.isArray((t=e==null?void 0:e.mobileMenu)==null?void 0:t.items)?e.mobileMenu.items:[]}function zut(e){if(!(e.layout==="row"||e.className&&/\bflex-row\b/.test(e.className)))return!1;const n=G$(e),r=Z$(e);if(n.length===0&&r.length===0)return!1;const i=["text","link","button","accordion"];if(!(n.length===0||n.every(c=>i.includes(c.type))))return!1;const s=e.className||"";return/\b(sticky|fixed)\b/.test(s)||/\btop-0\b/.test(s)||/\bz-(10|20|30|40|50)\b/.test(s)||/\bjustify-between\b/.test(s)||e.justify==="space-between"}function uT(e){const t=Z$(e);return t.length>0?t:G$(e)}function hT(e){return But(e)}function fT(e,t,n){return v.createElement("button",{key:"hamburger-icon",onClick:()=>t(!e),style:{background:"none",border:"none",cursor:"pointer",width:"40px",height:"40px",padding:"10px",display:"flex",alignItems:"center",justifyContent:"center",color:n||"inherit",fontSize:"24px",lineHeight:1},"aria-label":e?"Close navigation menu":"Open navigation menu"},v.createElement(e?Xt.FiX:Xt.FiMenu,{size:20}))}function Y$(e){return e=String(e??""),e.replace(/\bhidden\b/g,"").replace(/\b(sm|md|lg|xl|2xl):(block|flex|inline|inline-block|inline-flex)\b/g,"").replace(/\s+/g," ").trim()}function dT(e){const t=(e==null?void 0:e.className)||"";return/\bdrawer\b/.test(t)&&!/\bdrawer-(item|item-[a-z]+)\b/.test(t)}function Ha(e){return/\bburger-first\b/.test((e==null?void 0:e.className)||"")}function pT({navLinks:e,parentKey:t,renderComponentFn:n,open:r,onClose:i,colorMode:o,portalTarget:s,mobileMenu:l,parseMenuClassName:c}){const[h,u]=v.useState(r);if(v.useEffect(()=>{r&&u(!0)},[r]),!r&&!h)return null;const f=e.map(P=>({...P,className:P.className?Y$(P.className):void 0})),m=o!=="light"?"rgba(17, 24, 39, 0.98)":"rgba(255, 255, 255, 0.98)",y=l!=null&&l.className&&c?c(l.className,`${t}-side-drawer-class`):{},x=l!=null&&l.headerClassName&&c?c(l.headerClassName,`${t}-side-header-class`):{},p=()=>{u(!1),i()},b=v.createElement(v.Fragment,null,v.createElement("div",{key:`${t}-side-backdrop`,onClick:p,style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.45)",zIndex:90,opacity:r?1:0,transition:"opacity 0.25s ease",pointerEvents:r?"auto":"none"}}),v.createElement("div",{key:`${t}-side-drawer`,className:l==null?void 0:l.className,style:{position:"absolute",top:0,bottom:0,left:0,width:"min(300px, 85%)",backgroundColor:m,zIndex:100,overflowY:"auto",transform:r?"translateX(0)":"translateX(-100%)",transition:"transform 0.25s ease",boxShadow:"2px 0 12px rgba(0, 0, 0, 0.25)",display:"flex",flexDirection:"column",gap:"4px",padding:"16px 12px",...y}},v.createElement("div",{key:`${t}-side-header`,className:l==null?void 0:l.headerClassName,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4px 8px 12px",borderBottom:"1px solid rgba(128, 128, 128, 0.2)",marginBottom:"8px",fontSize:18,fontWeight:700,...x}},(l==null?void 0:l.title)||"Menu",v.createElement("button",{onClick:p,"aria-label":"Close menu",style:{background:"none",border:"none",cursor:"pointer",fontSize:22,color:"inherit",lineHeight:1}},"✕")),f.map((P,S)=>v.createElement(K$,{key:`${t}-drawer-item-${S}`,link:P,idx:S,parentKey:t,renderComponentFn:n,onClose:p,itemClassName:P.drawerClassName||(l==null?void 0:l.itemClassName),itemStyle:(P.drawerClassName||l!=null&&l.itemClassName)&&c?c(P.drawerClassName||l.itemClassName,`${t}-drawer-item-class-${S}`):void 0}))));return s?ub.createPortal(b,s):b}function K$({link:e,idx:t,parentKey:n,renderComponentFn:r,onClose:i,itemClassName:o,itemStyle:s}){const[l,c]=v.useState(!1),h=e.type==="link"||e.type==="button";return v.createElement("div",{key:`${n}-drawer-item-${t}`,className:o,style:{display:"flex",flexDirection:"row",alignItems:"center",gap:10,width:"100%",padding:"10px 12px",borderRadius:8,cursor:h?"pointer":"default",backgroundColor:l?"rgba(128, 128, 128, 0.12)":"transparent",transition:"background-color 0.15s ease",...s},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onClick:u=>{var m;!u.target.closest("a, button, [role='button']")&&h&&((m=u.currentTarget.querySelector("a, button, [role='button']"))==null||m.click()),h&&i()}},r(e,t+1,`${n}-drawer`))}function mT(e,t,n,r,i,o,s,l){if(!r)return null;const c=e.map(x=>({...x,className:x.className?Y$(x.className):void 0})),h=i!=="light"?"rgba(17, 24, 39, 0.98)":"rgba(255, 255, 255, 0.98)",u=i!=="light"?"rgba(75, 85, 99, 0.5)":"rgba(209, 213, 219, 0.5)",f=s!=null&&s.className&&l?l(s.className,`${t}-mobile-drawer-class`):{},m=(s==null?void 0:s.rawStyle)??{},y=!!(s!=null&&s.inFlow);return v.createElement("div",{key:`${t}-mobile-drawer`,className:s==null?void 0:s.className,style:{position:y?"relative":"absolute",top:y?0:"100%",left:0,right:0,flexBasis:y?"100%":void 0,backgroundColor:h,borderTop:`1px solid ${u}`,padding:"12px",display:"flex",flexDirection:"column",gap:"4px",zIndex:50,boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",...f,...m}},c.map((x,p)=>v.createElement(K$,{key:`${t}-drawer-item-${p}`,link:x,idx:p,parentKey:t,renderComponentFn:n,onClose:()=>o==null?void 0:o(!1),itemClassName:x.drawerClassName||(s==null?void 0:s.itemClassName),itemStyle:(x.drawerClassName||s!=null&&s.itemClassName)&&l?l(x.drawerClassName||s.itemClassName,`${t}-drawer-item-class-${p}`):void 0})))}function Fut(e,t,n){var s;if(t.className){const l=((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className),c=/\bspace-x-/.test(t.className),h=/\bspace-y-/.test(t.className);if(l.display==null&&(l.display=t.layout==="row"||c||h?"flex":"block"),l.flexDirection==null){const f=t.className||"",m=f.match(/\b((sm|md|lg|xl|2xl):)?flex-(row|row-reverse|col|col-reverse)\b/);if(m)l.flexDirection=m[3].startsWith("row")?"row":"column";else if(/(^|\s)((sm|md|lg|xl|2xl):)?flex(\s|$)/.test(f)){const y=/\bmin-h-(screen|\[[^\]]+\])/.test(f)&&/\bitems-center\b/.test(f),x=Array.isArray(t.children)&&t.children.length>0&&t.children.every(p=>p&&["h1","h2","h3","h4","p","text"].includes(p.type));l.flexDirection=y||x?"column":"row"}else c||h?l.flexDirection=c?"row":"column":l.flexDirection=t.layout==="row"?"row":"column"}if(e.renderMode!=="css-driven"){const f=mh(t.className);if(f.px.size>0){const y=zt(f.px,e.containerWidth,"0px");l.paddingLeft=y,l.paddingRight=y}if(f.py.size>0){const y=zt(f.py,e.containerWidth,"0px");l.paddingTop=y,l.paddingBottom=y}if(f.p.size>0){const y=zt(f.p,e.containerWidth,"0px");l.padding=y}const m=tc(t.className);m.size>0&&(l.display=zt(m,e.containerWidth,"flex"))}const u=e.getCommonProps(n,l,t);return v.createElement("div",{key:n,className:t.className,...u},Gl(e,Array.isArray(t.children)?t.children:[],n,l.flexDirection))}const r=e.cfg.colorMode==="light",i={display:"flex",flexDirection:t.layout==="row"?"row":"column",gap:t.gap!==void 0?`${t.gap}px`:"1rem",padding:"1.5rem",borderRadius:"1rem",backdropFilter:"blur(8px)",border:r?"1px solid rgba(0, 0, 0, 0.1)":"1px solid rgba(55, 65, 81, 0.5)"},o=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,...o},Gl(e,t.children,n,i.flexDirection))}function Wut(e,t,n){var l,c,h,u,f;const r=e.isMobileView&&zut(t);if(t.className){const m=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className),y=/\bspace-x-/.test(t.className),x=/\bspace-y-/.test(t.className);if(m.display==null&&(m.display=t.layout==="row"||y||x?"flex":"block"),m.flexDirection==null){const P=t.className||"",S=P.match(/\b((sm|md|lg|xl|2xl):)?flex-(row|row-reverse|col|col-reverse)\b/);if(S)m.flexDirection=S[3].startsWith("row")?"row":"column";else if(/(^|\s)((sm|md|lg|xl|2xl):)?flex(\s|$)/.test(P)){const A=/\bmin-h-(screen|\[[^\]]+\])/.test(P)&&/\bitems-center\b/.test(P),E=Array.isArray(t.children)&&t.children.length>0&&t.children.every(w=>w&&["h1","h2","h3","h4","p","text"].includes(w.type));m.flexDirection=A||E?"column":"row"}else y||x?m.flexDirection=y?"row":"column":m.flexDirection=t.layout==="row"?"row":"column"}if(e.renderMode!=="css-driven"){const P=mh(t.className);if(P.px.size>0){const A=zt(P.px,e.containerWidth,"0px");m.paddingLeft=A,m.paddingRight=A}if(P.py.size>0){const A=zt(P.py,e.containerWidth,"0px");m.paddingTop=A,m.paddingBottom=A}if(P.p.size>0){const A=zt(P.p,e.containerWidth,"0px");m.padding=A}const S=tc(t.className);S.size>0&&(m.display=zt(S,e.containerWidth,"flex"))}if(r&&t.children&&t.children.length>0){const P=hT(t),S=uT(t),A=!!((c=t.mobileMenu)!=null&&c.inFlow);m.position="relative",m.display="flex",m.alignItems="center",m.justifyContent=Ha(t)?"flex-start":"space-between",Ha(t)&&(m.gap=10),A&&(m.flexWrap="wrap",m.height="auto",m.minHeight="64px",m.paddingTop="12px");const E=e.getCommonProps(n,m,t),w=fT(e.mobileMenuOpen,e.setMobileMenuOpen,(h=t.mobileMenu)==null?void 0:h.iconColor),T=(R,N)=>{var V;return((V=e.parseClassNameResponsive)==null?void 0:V.call(e,R,N))??e.parseClassName(R)},O=P.map((R,N)=>e.renderComponent(R,N,n));return v.createElement("div",{key:n,className:t.className,...t.scrollTarget||t.id?{id:t.scrollTarget||t.id}:{},...E},...Ha(t)?[w,...O]:[...O,w],dT(t)?v.createElement(pT,{navLinks:S,parentKey:n,renderComponentFn:e.renderComponent,open:e.mobileMenuOpen,onClose:()=>e.setMobileMenuOpen(!1),colorMode:e.cfg.colorMode,portalTarget:e.portalTarget,mobileMenu:t.mobileMenu,parseMenuClassName:T}):mT(S,n,e.renderComponent,e.mobileMenuOpen,e.cfg.colorMode,e.setMobileMenuOpen,t.mobileMenu,T))}const p=e.getCommonProps(n,m,t),b=t.onClick?{onClick:P=>{P.stopPropagation(),e.handleButtonClick(t.onClick,{})},style:{cursor:"pointer"}}:{};return v.createElement("div",{key:n,className:t.className,...t.scrollTarget||t.id?{id:t.scrollTarget||t.id}:{},...p,...b},Gl(e,Array.isArray(t.children)?t.children:[],n,m.flexDirection,!1,/\bflex-col\b|\bspace-y-/.test(t.className)))}const i={display:"flex",flexDirection:t.layout==="row"?"row":"column",gap:t.gap!==void 0?`${t.gap}px`:"16px"};if(t.align){const m={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};i.alignItems=m[t.align]}if(t.justify){const m={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between"};i.justifyContent=m[t.justify]}if(t.padding!==void 0&&(i.padding=`${t.padding}px`),r&&t.children&&t.children.length>0){const m=hT(t),y=uT(t),x=!!((u=t.mobileMenu)!=null&&u.inFlow);i.position="relative",i.display="flex",i.alignItems="center",i.justifyContent=Ha(t)?"flex-start":"space-between",Ha(t)&&(i.gap=10),x&&(i.flexWrap="wrap",i.height="auto",i.minHeight="64px",i.paddingTop="12px");const p=e.getCommonProps(n,i,t),b=fT(e.mobileMenuOpen,e.setMobileMenuOpen,(f=t.mobileMenu)==null?void 0:f.iconColor),P=(A,E)=>{var w;return((w=e.parseClassNameResponsive)==null?void 0:w.call(e,A,E))??e.parseClassName(A)},S=m.map((A,E)=>e.renderComponent(A,E,n));return v.createElement("div",{key:n,...p},...Ha(t)?[b,...S]:[...S,b],dT(t)?v.createElement(pT,{navLinks:y,parentKey:n,renderComponentFn:e.renderComponent,open:e.mobileMenuOpen,onClose:()=>e.setMobileMenuOpen(!1),colorMode:e.cfg.colorMode,portalTarget:e.portalTarget,mobileMenu:t.mobileMenu,parseMenuClassName:P}):mT(y,n,e.renderComponent,e.mobileMenuOpen,e.cfg.colorMode,e.setMobileMenuOpen,t.mobileMenu,P))}const o=e.getCommonProps(n,i,t),s=t.onClick?{onClick:m=>{m.stopPropagation(),e.handleButtonClick(t.onClick,{})},style:{cursor:"pointer"}}:{};return v.createElement("div",{key:n,...o,...s},Gl(e,t.children,n,i.flexDirection))}function Vut(e,t,n){var o,s;if(t.className){const l=((o=e.parseClassNameResponsive)==null?void 0:o.call(e,t.className,n))??e.parseClassName(t.className);let c;if(e.renderMode!=="css-driven"){const u=mD(t.className),f=u.size>0?gD(u,e.containerWidth):void 0;c={display:"grid",...l,...f!==void 0&&{gridTemplateColumns:`repeat(${f}, minmax(0, 1fr))`}}}else c={display:"grid",...l};const h=e.getCommonProps(n,c,t);return v.createElement("div",{key:n,className:t.className,...h},(Array.isArray(t.children)?t.children:[]).map((u,f)=>e.renderComponent(u,f,n)))}const r={display:"grid",width:"100%",gridTemplateColumns:`repeat(${t.cols||2}, minmax(0, 1fr))`,gap:t.gap!==void 0?`${t.gap}px`:"16px"},i=e.getCommonProps(n,r,t);return v.createElement("div",{key:n,...i},(s=t.children)==null?void 0:s.map((l,c)=>e.renderComponent(l,c,n)))}function Uut(e,t,n){var l,c;if(t.className){const u={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",minHeight:e.containerWidth>0&&e.containerWidth<Eu.md?"300px":"500px",gap:"24px"};(t.bg||t.backgroundColor)&&(u.background=t.bg||t.backgroundColor),t.bgImage&&(u.backgroundImage=`url(${t.bgImage})`,u.backgroundSize="cover",u.backgroundPosition="center");const f={...u,...((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className)};if(Array.isArray(t.children)&&t.children.some(x=>x.type==="grid")||(f.textAlign="center"),e.renderMode!=="css-driven"){const x=mh(t.className);if(x.px.size>0){const p=zt(x.px,e.containerWidth,"0px");f.paddingLeft=p,f.paddingRight=p}if(x.py.size>0){const p=zt(x.py,e.containerWidth,"0px");f.paddingTop=p,f.paddingBottom=p}if(x.p.size>0){const p=zt(x.p,e.containerWidth,"0px");f.padding=p}}const y=e.getCommonProps(n,f,t);return v.createElement("div",{key:n,className:t.className,...y},Gl(e,Array.isArray(t.children)?t.children:[],n,f.flexDirection))}const r=e.containerWidth<Eu.md,i={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",minHeight:r?"300px":"500px",padding:r?"1.5rem":"3rem",background:t.bg||t.backgroundColor,gap:"24px"};t.bgImage&&(i.backgroundImage=`url(${t.bgImage})`,i.backgroundSize="cover",i.backgroundPosition="center"),Array.isArray(t.children)&&t.children.some(h=>h.type==="grid")||(i.textAlign="center");const s=e.getCommonProps(n,i,t);return v.createElement("div",{key:n,...s},(c=t.children)==null?void 0:c.map((h,u)=>e.renderComponent(h,u,n)))}function Hut(e,t,n){var s;const r={display:"flex",flexDirection:"row",alignItems:"center",width:"100%",flexShrink:0,position:"sticky",top:0,zIndex:50,gap:"1.25rem",padding:"0.75rem 1.5rem",backgroundColor:e.cfg.colors.surface,borderBottom:`1px solid ${e.cfg.colors.border}`};if(t.className&&(Object.assign(r,((s=e.parseClassNameResponsive)==null?void 0:s.call(e,t.className,n))??e.parseClassName(t.className)),e.renderMode!=="css-driven")){const l=mh(t.className);l.px.size>0&&(r.paddingLeft=zt(l.px,e.containerWidth,"0px"),r.paddingRight=zt(l.px,e.containerWidth,"0px")),l.py.size>0&&(r.paddingTop=zt(l.py,e.containerWidth,"0px"),r.paddingBottom=zt(l.py,e.containerWidth,"0px"));const c=tc(t.className);c.size>0&&(r.display=zt(c,e.containerWidth,"flex"))}const i=e.getCommonProps(n,r,t),o=t.className?{key:n,className:t.className,...i}:{key:n,...i};return v.createElement("header",o,(Array.isArray(t.children)?t.children:[]).filter(l=>Array.isArray(l.visibleOn)?l.visibleOn.includes(e.currentSceneId):Array.isArray(l.hiddenOn)?!l.hiddenOn.includes(e.currentSceneId):!0).map((l,c)=>e.renderComponent(l,c,n)))}function qut(e,t,n){var c;const r={display:"flex",flexDirection:t.layout==="row"?"row":"column",width:"100%",flexShrink:0,marginTop:"auto",gap:"1rem",padding:"2.5rem 1.5rem",backgroundColor:e.cfg.colors.surfaceHover,borderTop:`1px solid ${e.cfg.colors.border}`};if(t.className&&(Object.assign(r,((c=e.parseClassNameResponsive)==null?void 0:c.call(e,t.className,n))??e.parseClassName(t.className)),e.renderMode!=="css-driven")){const h=mh(t.className);h.px.size>0&&(r.paddingLeft=zt(h.px,e.containerWidth,"0px"),r.paddingRight=zt(h.px,e.containerWidth,"0px")),h.py.size>0&&(r.paddingTop=zt(h.py,e.containerWidth,"0px"),r.paddingBottom=zt(h.py,e.containerWidth,"0px"))}const i=e.getCommonProps(n,r,t),o=t.className?{key:n,className:t.className,...i}:{key:n,...i};let s=Array.isArray(t.children)?t.children:[];const l=s[0];return l&&l.type==="text"&&/^(\u00a9|\(c\)|copyright)/i.test(String(l.text).trim())&&(s=[...s.slice(1),l]),v.createElement("footer",o,Gl(e,s,n,r.flexDirection,!0))}function Gut({api:e,config:t,componentKey:n}){var b,P;const r=t.queryKey||"placeQuery",i=String(e.sceneData[r]||""),[o,s]=v.useState(i),l=e.interpolateText(t.dataSource||""),c=Number(t.minChars)||3,h=Number(t.debounceMs)||300,{fetchListData:u}=e;v.useEffect(()=>{i!==o&&s(i)},[o,i]),v.useEffect(()=>{if(!l||o.trim().length<c)return;const S=window.setTimeout(()=>{u(l,n,0,t.pageSize||8).catch(()=>{})},h);return()=>window.clearTimeout(S)},[n,t.pageSize,l,h,u,c,o]);const f=l?((b=e.listData)==null?void 0:b[n])||[]:Ho(typeof t.places=="string"?e.interpolateText(t.places):t.places),m={display:"flex",flexDirection:"column",gap:"8px",width:"100%",...t.className?e.parseClassName(t.className):{}},y=e.getCommonProps(n,m,t),x=S=>{const A=qg(S,t.addressField,["address","formattedAddress","formatted_address","vicinity"]),E=gi(e,S),w={...S,[t.valueKey||"address"]:A,...E?{latitude:E[0],longitude:E[1]}:{},...E&&t.latitudeKey?{[t.latitudeKey]:E[0]}:{},...E&&t.longitudeKey?{[t.longitudeKey]:E[1]}:{}};e.rowContextRef&&(e.rowContextRef.current=w),e.setSceneData(O=>({...O,...w}));const T=S.onClick||t.onPlaceClick||t.onClick;T&&e.handleButtonClick(e.interpolateText(T)).catch(()=>{})},p=!((P=e.loading)!=null&&P[n])&&f.length===0&&(!l||o.trim().length>=c);return U("div",{key:n,className:t.className,...y},l&&t.searchable!==!1?U("input",{type:"search",value:o,placeholder:e.interpolateText(t.placeholder||"Search address"),autoComplete:"off",onChange:S=>{const A=S.target.value;s(A),e.setSceneData(E=>({...E,[r]:A}))},style:{width:"100%",padding:"10px 12px",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text}}):null,...f.map((S,A)=>{const E=e.interpolateText(qg(S,t.labelField,["name","title","label"])),w=e.interpolateText(qg(S,t.addressField,["address","formattedAddress","formatted_address","vicinity"]));return U("button",{key:S.id||`${n}-${A}`,type:"button",onClick:()=>!e.interactionDisabled&&x(S),disabled:e.interactionDisabled||void 0,"aria-label":`Select ${E||w||"place"}`,style:{display:"flex",alignItems:"center",gap:"10px",padding:"12px",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,cursor:e.interactionDisabled?"default":"pointer",textAlign:"left",...t.itemClassName?e.parseClassName(t.itemClassName):{}}},e.renderIcon("map-pin",18),U("span",{style:{display:"flex",flex:1,flexDirection:"column",gap:"3px",minWidth:0}},U("strong",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},E||w),E&&w?U("span",{style:{color:e.cfg.colors.textSecondary,fontSize:"13px"}},w):null))}),p?U("span",{style:{color:e.cfg.colors.textMuted,fontSize:"13px"}},t.emptyText||"No addresses found"):null)}const gT=new Map;function Zut(e){let t=gT.get(e);return t||(t=Kf.create(e),gT.set(e,t)),t}function Nt(e,t){if(!(e!=null&&e.motion)||!v.isValidElement(t))return t;const n=t,r=n.props,i=Zut(n.type);return v.createElement(i,{key:n.key,...r,initial:e.initial,animate:e.animate,exit:e.exit,transition:e.transition,variants:e.variants,whileHover:e.whileHover,whileTap:e.whileTap,whileFocus:e.whileFocus,whileInView:e.whileInView,layout:e.animateLayout},r==null?void 0:r.children)}function zf(e,t,n,r=""){var s,l;const i=t,o=`${r}-${n}`;if(Array.isArray(i.hiddenOn)&&i.hiddenOn.includes(e.currentSceneId)||Array.isArray(i.visibleOn)&&!i.visibleOn.includes(e.currentSceneId)||i.condition&&e.evaluateCondition&&!e.evaluateCondition(i.condition,i.__conditionBase))return null;if(!Array.isArray(i.children)&&Array.isArray(i.components)&&(i.children=i.components),i.type==="custom"){const c=i.tagName||"div",h=((s=e.parseClassNameResponsive)==null?void 0:s.call(e,i.className||"",o))??(i.className?e.parseClassName(i.className):{});i.rawStyle&&Object.assign(h,i.rawStyle);const u=e.getCommonProps(o,h,i),f=Array.isArray(i.children)?i.children.map((y,x)=>e.renderComponent(y,x,o)):[],m=i.motion?{motion:i.motion,initial:i.initial,animate:i.animate,exit:i.exit,transition:i.transition,variants:i.variants,whileHover:i.whileHover,whileTap:i.whileTap,whileFocus:i.whileFocus,whileInView:i.whileInView,animateLayout:i.animateLayout}:{};return U(c,{key:o,className:i.className,...u,...m},...f)}if(/^h[1-6]$/.test(i.type)||i.type==="p"||i.type==="span"||i.type==="label"||i.type==="blockquote"||i.type==="strong"||i.type==="em"||i.type==="li"||i.type==="figcaption"||i.type==="th"||i.type==="td"||i.type==="heading"||i.type==="paragraph"||i.type==="address"||i.type==="time"||i.type==="legend"||i.type==="caption"?i.type="text":i.type==="div"||i.type==="article"||i.type==="aside"||i.type==="main"||i.type==="figure"?i.type=i.children?"section":"text":i.type==="a"?i.type="link":i.type==="img"?i.type="image":i.type==="ul"||i.type==="ol"?i.type="list":i.type==="table"||i.type==="thead"||i.type==="tbody"||i.type==="tfoot"||i.type==="tr"?i.type="table":i.type==="br"?i.type="spacer":i.type==="hr"?i.type="divider":i.type==="details"||i.type==="summary"?i.type=i.children?"section":"text":i.type==="nav"?i.type="section":(i.type==="form"&&!i.fields||i.type==="listItem")&&(i.type=i.children?"section":"text"),i.type==="select"&&Array.isArray(i.options)&&typeof i.options[0]=="string"&&(i.options=i.options.map(c=>({label:c,value:c}))),i.type==="dropdown-button"&&!i.items&&i.options&&(i.items=Array.isArray(i.options)&&typeof i.options[0]=="string"?i.options.map(c=>({label:c,value:c})):i.options),(i.type==="input"||i.type==="textarea")&&!i.placeholder&&i.label&&(i.placeholder=i.label),e.imageReplacements&&e.imageReplacements.size>0){const c=e.imageReplacements.get(o);if(c&&c.url){const h={width:"100%",height:"auto",maxHeight:"300px",objectFit:"cover",borderRadius:"0.75rem"},u=e.getCommonProps(o,h,i),f=i.motion?{motion:i.motion,initial:i.initial,animate:i.animate,whileHover:i.whileHover,whileTap:i.whileTap,transition:i.transition,animateLayout:i.animateLayout}:{};return U("img",{key:`${o}-${c.url}`,src:c.url,alt:c.name||"Replacement image",...u,...f})}}switch(i.type){case"text":return Nt(i,hct(e,i,o));case"html":return Nt(i,dct(e,i,o));case"link":return Nt(i,pct(e,i,o));case"button":return Nt(i,mct(e,i,o));case"image":return Nt(i,gct(e,i,o));case"input":return Nt(i,yct(e,i,o));case"hidden":return Nt(i,vct(e,i,o));case"select":return Nt(i,bct(e,i,o));case"checkbox":return Nt(i,xct(e,i,o));case"card":return Nt(i,Fut(e,i,o));case"section":case"container":case"cta_section":return Nt(i,Wut(e,i,o));case"header":return Nt(i,Hut(e,i,o));case"grid":case"features_grid":return Nt(i,Vut(e,i,o));case"hero":return Nt(i,Uut(e,i,o));case"footer":return Nt(i,qut(e,i,o));case"spacer":return Nt(i,Mct(e,i,o));case"divider":return Nt(i,kct(e,i,o));case"list":return Nt(i,bD(e,i,o));case"table":return Nt(i,wD(e,i,o));case"badge":return Nt(i,wct(e,i,o));case"tag":return Nt(i,_ct(e,i,o));case"avatar":return Nt(i,Sct(e,i,o));case"progress":return Nt(i,Pct(e,i,o));case"recorder":return v.createElement(cut,{api:e,config:i,key:o});case"live-cast":return v.createElement(uut,{api:e,config:i,componentKey:o,key:o});case"tabs":return Nt(i,yD(e,i,o));case"accordion":return Nt(i,vD(e,i,o));case"bottom_nav":return Nt(i,sut(e,i,o));case"split":return Nt(i,aut(e,i,o));case"theme_toggle":return Nt(i,lut(e,i,o));case"slider":case"carousel":return Nt(i,Ect(e,i,o));case"marquee":return Nt(i,Cct(e,i,o));case"camera":case"capture":return Nt(i,Oct(e,i,o));case"phaser_game":return Nt(i,((l=e.renderPhaserGame)==null?void 0:l.call(e,i,o))??null);case"search":return Nt(i,Act(e,i,o));case"breadcrumb":return Nt(i,Tct(e,i,o));case"form":return Nt(i,Jct(e,i,o));case"textarea":return Nt(i,Ict(e,i,o));case"diagnostics_chat":return Nt(i,v.createElement(fut,{api:e,config:i,componentKey:o}));case"icon":return Nt(i,Rct(e,i,o));case"markdown":return Nt(i,out(e,i,o));case"dropdown-button":return Nt(i,Zct(e,i,o));case"widget":return Nt(i,Yct(e,i,o));case"advanced-select":return Nt(i,Kct(e,i,o));case"metric_display":return Nt(i,Lct(e,i,o));case"bar_chart":return Nt(i,Nct(e,i,o));case"line_chart":return Nt(i,Hg(e,i,o,!1));case"area_chart":return Nt(i,Hg(e,i,o,!0));case"pie_chart":return Nt(i,sT(e,i,o));case"donut_chart":return Nt(i,sT(e,i,o,!0));case"scatter_chart":return Nt(i,jct(e,i,o));case"candlestick":return Nt(i,Hg(e,i,o,!1,!0));case"fx_ticker":return Nt(i,Bct(e,i,o));case"trading_view":return Nt(i,Fct(e,i,o));case"loader":return Nt(i,$ct(e,i,o));case"map":return v.createElement(Dut,{api:e,config:i,componentKey:o,key:o});case"places":return v.createElement(Gut,{api:e,config:i,componentKey:o,key:o});case"flow_diagram":return Nt(i,Wct(e,i,o));case"flow":return Nt(i,Uct(e,i,o));default:return Nt(i,Hct(e,i,o))}}function X$(e){const t=new Map,n=new Map;for(const r of e)if(r.type==="render_scene"&&r.route){const i=r.route.startsWith("/")?r.route:`/${r.route}`;t.set(r.id,i),n.set(i,r.id)}for(const r of e)if(r.type==="render_scene"&&!t.has(r.id)){const i=`/${r.id}`;t.set(r.id,i),n.set(i,r.id)}return{sceneToRoute:t,routeToScene:n}}function lb(e){if(typeof window>"u")return null;const t=window.location.hash;if(!t||t==="#")return null;const n=t.slice(1);return e.get(n)||null}function yT(e){return typeof window>"u"?null:e.get(window.location.pathname)||null}function Ff(e,t,n=!1){if(typeof window>"u")return;const r=t.get(e);if(!r)return;const i=`#${r}`;window.location.hash!==i&&(n?window.history.replaceState({sceneId:e},"",i):window.history.pushState({sceneId:e},"",i))}function Gg(e,t,n=!1){if(typeof window>"u")return;const r=t.get(e);if(!r||window.location.pathname===r)return;const i=`${r}${window.location.search}`;n?window.history.replaceState({sceneId:e},"",i):window.history.pushState({sceneId:e},"",i)}const Yut=()=>{try{if(typeof window<"u")return window.localStorage.getItem("backflow_dev_diagnostics")==="1"}catch{}return!1};async function Wf(e,t,n={},r){var i;try{const o=t.indexOf(".");if(o===-1)throw new Error(`Invalid SDK call syntax: ${t}`);const s=t.slice(0,o),l=t.slice(o+1),c=l.indexOf("(");if(c===-1)throw new Error(`Invalid SDK call syntax (missing parentheses): ${t}`);const h=l.slice(0,c),u=l.slice(c+1,-1),f=Kut(u,n);let m=e[s];if(!m)throw new Error(`Unknown SDK resource: ${String(s)}`);const y=h.split(".");for(let b=0;b<y.length-1;b++){const P=y[b];if(P&&(m=m[P],!m))throw new Error(`Unknown path ${y.slice(0,b+1).join(".")} on resource ${String(s)}`)}const x=y[y.length-1],p=m[x];if(typeof p!="function")throw new Error(`Unknown method ${x} on ${String(s)}.${y.slice(0,-1).join(".")}`);return await p.apply(m,f)}catch(o){throw Yut()&&console.error("[SDK Executor] Error:",o),(i=r==null?void 0:r.onError)==null||i.call(r,o),o}}function Kut(e,t){if(!e.trim())return[];const r=e.replace(/\{\{([\w.]+)\}\}/g,(i,o)=>{if(o==="now")return JSON.stringify(new Date().toISOString());const s=Jut(t,o);return s===void 0?"null":typeof s=="string"?`"${s}"`:JSON.stringify(s)}).replace(/([{,]\s*)([A-Za-z_$][\w$]*)\s*:/g,'$1"$2":').replace(/'((?:[^'\\]|\\.)*)'/g,(i,o)=>`"${o.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`);try{return JSON.parse(`[${r}]`)}catch{return Xut(r).map(i=>{const o=i.trim();if(o.startsWith("'")&&o.endsWith("'")||o.startsWith('"')&&o.endsWith('"'))return o.slice(1,-1);if(!isNaN(Number(o)))return Number(o);if(o==="true")return!0;if(o==="false")return!1;if(o==="null")return null;try{return JSON.parse(o)}catch{return o}})}}function Xut(e){const t=[];let n="",r=0,i=null;for(let o=0;o<e.length;o++){const s=e[o],l=e[o-1];if((s==='"'||s==="'")&&l!=="\\"&&(i===s?i=null:i||(i=s)),!i&&((s==="{"||s==="["||s==="(")&&r++,(s==="}"||s==="]"||s===")")&&r--,s===","&&r===0)){t.push(n),n="";continue}n+=s}return n.trim()&&t.push(n),t}function Jut(e,t){const n=t.split(".");let r=e;for(const i of n){if(r==null)return;r=r[i]}return r}function vu(e){return e.startsWith("sdk:")}function nu(e){return vu(e)?e.slice(4):e}function Qut(e,t,...n){const r=n.map(i=>typeof i=="string"?`'${i}'`:JSON.stringify(i)).join(", ");return`sdk:${e}.${t}(${r})`}function tht(e,t){const n=new Map,r=(i,o)=>{o.size>0&&n.set(i,o)};return r("--bf-fd",e.flexDirection),r("--bf-gap",e.gap),r("--bf-w",e.width),r("--bf-min-h",e.minHeight),r("--bf-items",e.alignItems),r("--bf-justify",e.justifyContent),r("--bf-display",e.display),r("--bf-cols",e.gridCols),r("--bf-grid-template",e.gridTemplateColumns),r("--bf-text",e.textSize),r("--bf-radius",e.borderRadius),e.padding.p.size>0&&r("--bf-p",e.padding.p),e.padding.px.size>0&&r("--bf-px",e.padding.px),e.padding.py.size>0&&r("--bf-py",e.padding.py),e.margin.all.size>0&&r("--bf-m",e.margin.all),e.margin.t.size>0&&r("--bf-mt",e.margin.t),e.margin.r.size>0&&r("--bf-mr",e.margin.r),e.margin.b.size>0&&r("--bf-mb",e.margin.b),e.margin.l.size>0&&r("--bf-ml",e.margin.l),e.margin.x.size>0&&r("--bf-mx",e.margin.x),e.margin.y.size>0&&r("--bf-my",e.margin.y),n}function eht(e,t){const n=String(t).replace(/[^a-zA-Z0-9_-]/g,"_");return`${e}-${n}`}function J$(e,t,n){const r=tht(n);if(r.size===0)return"";const i=`[data-bf-r="${e}-${t}"]`,o=[];for(const s of pC){if(s==="base")continue;const l=dC[s],c=[];for(const[h,u]of r)if(u.has(s)){const f=eht(h,t);c.push(` ${f}: ${u.get(s)};`)}c.length>0&&o.push(`@media (min-width: ${l}px) {
124
124
  ${i} {
125
125
  ${c.join(`
126
126
  `)}
127
127
  }
128
128
  }`)}return o.join(`
129
- `)}const nht={slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}},cb={transparent:"transparent",current:"currentColor",inherit:"inherit",black:"#000000",white:"#ffffff",primary:"#3b82f6",secondary:"#64748b",accent:"#ec4899",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#3b82f6"};for(const[e,t]of Object.entries(nht))for(const[n,r]of Object.entries(t))cb[`${e}-${n}`]=r;const ce={0:"0px","0.5":"0.125rem",1:"0.25rem","1.5":"0.375rem",2:"0.5rem","2.5":"0.625rem",3:"0.75rem","3.5":"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},rht={xs:{fontSize:"0.75rem",lineHeight:"1rem"},sm:{fontSize:"0.875rem",lineHeight:"1.25rem"},base:{fontSize:"1rem",lineHeight:"1.5rem"},lg:{fontSize:"1.125rem",lineHeight:"1.75rem"},xl:{fontSize:"1.25rem",lineHeight:"1.75rem"},"2xl":{fontSize:"1.5rem",lineHeight:"2rem"},"3xl":{fontSize:"1.875rem",lineHeight:"2.25rem"},"4xl":{fontSize:"2.25rem",lineHeight:"2.5rem"},"5xl":{fontSize:"3rem",lineHeight:"1"},"6xl":{fontSize:"3.75rem",lineHeight:"1"},"7xl":{fontSize:"4.5rem",lineHeight:"1"},"8xl":{fontSize:"6rem",lineHeight:"1"},"9xl":{fontSize:"8rem",lineHeight:"1"}};function Sx(e,t,n=!0){if(!e)return{};e=String(e);const{colorMode:r,...i}=t||{},o=r==="light",s=e.match(/(?:^|\s)dark:([^\s]+)/g)||[],l=e.replace(/(?:^|\s)dark:[^\s]+/g," ").replace(/\s+/g," ").trim();!o&&s.length?e=l?`${l} ${s.map(p=>p.trim().replace(/^dark:/,"")).join(" ")}`:s.map(p=>p.trim().replace(/^dark:/,"")).join(" "):e=l;const c=i?{...cb,...Object.fromEntries(Object.entries(i).filter(([,p])=>p))}:cb;o&&n&&(c.white="#000000",c.black="#ffffff",c["gray-300"]="#4b5563",c["gray-400"]="#374151",c["gray-500"]="#374151",c["gray-600"]="#1f2937",c["gray-700"]="#111827",c["gray-800"]="#0f172a",c["slate-300"]="#475569",c["slate-400"]="#334155",c["slate-500"]="#334155",c["slate-600"]="#1e293b");const h=e.split(/\s+/).filter(Boolean),u={};let f="",m="",y="",x="";for(let p of h){if(p.startsWith("hover:")||p.startsWith("focus:")||p.startsWith("active:")||p.startsWith("group-hover:")||p==="transition"||p==="transition-all"||p==="transition-colors"||p==="transition-opacity"||p==="transition-transform"||p.startsWith("duration-")||p.startsWith("ease-")||p==="cursor-pointer"||p==="grayscale"||((p.startsWith("sm:")||p.startsWith("md:")||p.startsWith("lg:")||p.startsWith("xl:")||p.startsWith("2xl:"))&&(p=p.replace(/^(sm:|md:|lg:|xl:|2xl:)/,"")),p.startsWith("placeholder-"))||p.startsWith("disabled:"))continue;const b=p.match(/^bg-\[([^\]]+)\]$/);if(b){const wt=b[1];wt.startsWith("url(")?u.backgroundImage=wt:u.backgroundColor=wt;continue}const P=p.match(/^text-\[(#[0-9a-fA-F]{3,8}|rgb[a]?\([^)]+\)|hsl[a]?\([^)]+\))\]$/);if(P){u.color=P[1];continue}const S=p.match(/^text-\[(\d+(?:\.\d+)?(?:px|rem|em|%))\]$/);if(S){u.fontSize=S[1];continue}const A=p.match(/^w-\[([^\]]+)\]$/);if(A){u.width=A[1];continue}const E=p.match(/^h-\[([^\]]+)\]$/);if(E){u.height=E[1];continue}const w=p.match(/^min-w-\[([^\]]+)\]$/);if(w){u.minWidth=w[1];continue}const T=p.match(/^max-w-\[([^\]]+)\]$/);if(T){u.maxWidth=T[1];continue}const O=p.match(/^min-h-\[([^\]]+)\]$/);if(O){u.minHeight=O[1];continue}const R=p.match(/^max-h-\[([^\]]+)\]$/);if(R){u.maxHeight=R[1];continue}const N=p.match(/^p-\[([^\]]+)\]$/);if(N){u.padding=N[1];continue}const V=p.match(/^px-\[([^\]]+)\]$/);if(V){u.paddingLeft=V[1],u.paddingRight=V[1];continue}const D=p.match(/^py-\[([^\]]+)\]$/);if(D){u.paddingTop=D[1],u.paddingBottom=D[1];continue}const j=p.match(/^pt-\[([^\]]+)\]$/);if(j){u.paddingTop=j[1];continue}const K=p.match(/^pr-\[([^\]]+)\]$/);if(K){u.paddingRight=K[1];continue}const H=p.match(/^pb-\[([^\]]+)\]$/);if(H){u.paddingBottom=H[1];continue}const z=p.match(/^pl-\[([^\]]+)\]$/);if(z){u.paddingLeft=z[1];continue}const Y=p.match(/^m-\[([^\]]+)\]$/);if(Y){u.margin=Y[1];continue}const G=p.match(/^mx-\[([^\]]+)\]$/);if(G){u.marginLeft=G[1],u.marginRight=G[1];continue}const J=p.match(/^my-\[([^\]]+)\]$/);if(J){u.marginTop=J[1],u.marginBottom=J[1];continue}const lt=p.match(/^mt-\[([^\]]+)\]$/);if(lt){u.marginTop=lt[1];continue}const q=p.match(/^mr-\[([^\]]+)\]$/);if(q){u.marginRight=q[1];continue}const nt=p.match(/^mb-\[([^\]]+)\]$/);if(nt){u.marginBottom=nt[1];continue}const it=p.match(/^ml-\[([^\]]+)\]$/);if(it){u.marginLeft=it[1];continue}const at=p.match(/^gap-\[([^\]]+)\]$/);if(at){u.gap=at[1];continue}const ct=p.match(/^gap-x-\[([^\]]+)\]$/);if(ct){u.columnGap=ct[1];continue}const mt=p.match(/^gap-y-\[([^\]]+)\]$/);if(mt){u.rowGap=mt[1];continue}const yt=p.match(/^rounded-\[([^\]]+)\]$/);if(yt){u.borderRadius=yt[1];continue}const Et=p.match(/^border-\[(#[0-9a-fA-F]{3,8}|rgb[a]?\([^)]+\))\]$/);if(Et){u.borderColor=Et[1];continue}const Tt=p.match(/^border-\[(\d+(?:\.\d+)?(?:px)?)\]$/);if(Tt){u.borderWidth=Tt[1];continue}const ht=p.match(/^top-\[([^\]]+)\]$/);if(ht){u.top=ht[1];continue}const ft=p.match(/^right-\[([^\]]+)\]$/);if(ft){u.right=ft[1];continue}const Ct=p.match(/^bottom-\[([^\]]+)\]$/);if(Ct){u.bottom=Ct[1];continue}const rt=p.match(/^left-\[([^\]]+)\]$/);if(rt){u.left=rt[1];continue}const Rt=p.match(/^inset-\[([^\]]+)\]$/);if(Rt){u.inset=Rt[1];continue}const bt=p.match(/^z-\[([^\]]+)\]$/);if(bt){u.zIndex=parseInt(bt[1])||bt[1];continue}const de=p.match(/^opacity-\[([^\]]+)\]$/);if(de){u.opacity=parseFloat(de[1]);continue}const ne=p.match(/^leading-\[([^\]]+)\]$/);if(ne){u.lineHeight=ne[1];continue}if(p==="flex"){u.display="flex";continue}if(p==="grid"){u.display="grid";continue}if(p==="block"){u.display="block";continue}if(p==="inline"){u.display="inline";continue}if(p==="inline-flex"){u.display="inline-flex";continue}if(p==="inline-block"){u.display="inline-block";continue}if(p==="hidden"){u.display="none";continue}if(p==="flex-col"){u.flexDirection="column";continue}if(p==="flex-row"){u.flexDirection="row";continue}if(p==="flex-wrap"){u.flexWrap="wrap";continue}if(p==="flex-nowrap"){u.flexWrap="nowrap";continue}if(p==="flex-col-reverse"){u.flexDirection="column-reverse";continue}if(p==="flex-row-reverse"){u.flexDirection="row-reverse";continue}if(p==="flex-1"){u.flex="1 1 0%";continue}if(p==="flex-auto"){u.flex="1 1 auto";continue}if(p==="flex-initial"){u.flex="0 1 auto";continue}if(p==="flex-none"){u.flex="none";continue}if(p==="grow"){u.flexGrow=1;continue}if(p==="grow-0"){u.flexGrow=0;continue}if(p==="shrink"){u.flexShrink=1;continue}if(p==="shrink-0"){u.flexShrink=0;continue}if(p==="items-start"){u.alignItems="flex-start";continue}if(p==="items-center"){u.alignItems="center";continue}if(p==="items-end"){u.alignItems="flex-end";continue}if(p==="items-stretch"){u.alignItems="stretch";continue}if(p==="items-baseline"){u.alignItems="baseline";continue}if(p==="justify-start"){u.justifyContent="flex-start";continue}if(p==="justify-center"){u.justifyContent="center";continue}if(p==="justify-end"){u.justifyContent="flex-end";continue}if(p==="justify-between"){u.justifyContent="space-between";continue}if(p==="justify-around"){u.justifyContent="space-around";continue}if(p==="justify-evenly"){u.justifyContent="space-evenly";continue}if(p==="justify-items-start"){u.justifyItems="start";continue}if(p==="justify-items-center"){u.justifyItems="center";continue}if(p==="justify-items-end"){u.justifyItems="end";continue}if(p==="justify-items-stretch"){u.justifyItems="stretch";continue}if(p==="self-auto"){u.alignSelf="auto";continue}if(p==="self-start"){u.alignSelf="flex-start";continue}if(p==="self-center"){u.alignSelf="center";continue}if(p==="self-end"){u.alignSelf="flex-end";continue}if(p==="self-stretch"){u.alignSelf="stretch";continue}if(p==="self-baseline"){u.alignSelf="baseline";continue}if(p==="justify-self-auto"){u.justifySelf="auto";continue}if(p==="justify-self-start"){u.justifySelf="start";continue}if(p==="justify-self-center"){u.justifySelf="center";continue}if(p==="justify-self-end"){u.justifySelf="end";continue}if(p==="justify-self-stretch"){u.justifySelf="stretch";continue}if(p==="place-content-center"){u.placeContent="center";continue}if(p==="place-content-start"){u.placeContent="start";continue}if(p==="place-content-end"){u.placeContent="end";continue}if(p==="place-content-between"){u.placeContent="space-between";continue}if(p==="place-content-around"){u.placeContent="space-around";continue}if(p==="place-content-evenly"){u.placeContent="space-evenly";continue}if(p==="place-content-stretch"){u.placeContent="stretch";continue}if(p==="place-items-start"){u.placeItems="start";continue}if(p==="place-items-center"){u.placeItems="center";continue}if(p==="place-items-end"){u.placeItems="end";continue}if(p==="place-items-stretch"){u.placeItems="stretch";continue}if(p==="text-left"){u.textAlign="left";continue}if(p==="text-center"){u.textAlign="center";continue}if(p==="text-right"){u.textAlign="right";continue}if(p==="text-justify"){u.textAlign="justify";continue}if(p==="text-start"){u.textAlign="start";continue}if(p==="text-end"){u.textAlign="end";continue}if(p==="whitespace-normal"){u.whiteSpace="normal";continue}if(p==="whitespace-nowrap"){u.whiteSpace="nowrap";continue}if(p==="whitespace-pre"){u.whiteSpace="pre";continue}if(p==="whitespace-pre-line"){u.whiteSpace="pre-line";continue}if(p==="whitespace-pre-wrap"){u.whiteSpace="pre-wrap";continue}if(p==="whitespace-break-spaces"){u.whiteSpace="break-spaces";continue}if(p==="break-normal"){u.wordBreak="normal",u.overflowWrap="normal";continue}if(p==="break-words"){u.overflowWrap="break-word";continue}if(p==="break-all"){u.wordBreak="break-all";continue}if(p==="break-keep"){u.wordBreak="keep-all";continue}if(p==="truncate"){u.overflow="hidden",u.textOverflow="ellipsis",u.whiteSpace="nowrap";continue}if(p==="text-ellipsis"){u.textOverflow="ellipsis";continue}if(p==="text-clip"){u.textOverflow="clip";continue}if(p==="underline"){u.textDecoration="underline";continue}if(p==="overline"){u.textDecoration="overline";continue}if(p==="line-through"){u.textDecoration="line-through";continue}if(p==="no-underline"){u.textDecoration="none";continue}if(p==="uppercase"){u.textTransform="uppercase";continue}if(p==="lowercase"){u.textTransform="lowercase";continue}if(p==="capitalize"){u.textTransform="capitalize";continue}if(p==="normal-case"){u.textTransform="none";continue}if(p==="italic"){u.fontStyle="italic";continue}if(p==="not-italic"){u.fontStyle="normal";continue}if(p==="font-thin"){u.fontWeight=100;continue}if(p==="font-extralight"){u.fontWeight=200;continue}if(p==="font-light"){u.fontWeight=300;continue}if(p==="font-normal"){u.fontWeight=400;continue}if(p==="font-medium"){u.fontWeight=500;continue}if(p==="font-semibold"){u.fontWeight=600;continue}if(p==="font-bold"){u.fontWeight=700;continue}if(p==="font-extrabold"){u.fontWeight=800;continue}if(p==="font-black"){u.fontWeight=900;continue}if(p==="w-full"){u.width="100%";continue}if(p==="w-screen"){u.width="100vw";continue}if(p==="w-auto"){u.width="auto";continue}if(p==="w-fit"){u.width="fit-content";continue}if(p==="w-min"){u.width="min-content";continue}if(p==="w-max"){u.width="max-content";continue}const Gt=p.match(/^w-(\d+(?:\.\d+)?)$/);if(Gt){u.width=ce[Gt[1]]||`${parseFloat(Gt[1])*.25}rem`;continue}const Le=p.match(/^w-(\d+)\/(\d+)$/);if(Le){const wt=parseInt(Le[1])/parseInt(Le[2])*100;u.width=`${wt}%`;continue}if(p==="h-full"){u.height="100%";continue}if(p==="h-screen"){u.height="100vh";continue}if(p==="h-auto"){u.height="auto";continue}if(p==="h-fit"){u.height="fit-content";continue}if(p==="h-min"){u.height="min-content";continue}if(p==="h-max"){u.height="max-content";continue}const Bt=p.match(/^h-(\d+(?:\.\d+)?)$/);if(Bt){u.height=ce[Bt[1]]||`${parseFloat(Bt[1])*.25}rem`;continue}const Qt=p.match(/^h-(\d+)\/(\d+)$/);if(Qt){const wt=parseInt(Qt[1])/parseInt(Qt[2])*100;u.height=`${wt}%`;continue}if(p==="min-h-screen"){u.minHeight="100vh";continue}if(p==="min-h-full"){u.minHeight="100%";continue}if(p==="min-h-0"){u.minHeight="0";continue}if(p==="min-h-fit"){u.minHeight="fit-content";continue}const te=p.match(/^min-h-(\d+(?:\.\d+)?)$/);if(te){u.minHeight=ce[te[1]]||`${parseFloat(te[1])*.25}rem`;continue}if(p==="min-w-0"){u.minWidth="0";continue}if(p==="min-w-full"){u.minWidth="100%";continue}if(p==="min-w-fit"){u.minWidth="fit-content";continue}const Ht=p.match(/^min-w-(\d+(?:\.\d+)?)$/);if(Ht){u.minWidth=ce[Ht[1]]||`${parseFloat(Ht[1])*.25}rem`;continue}if(p==="max-w-none"){u.maxWidth="none";continue}if(p==="max-w-xs"){u.maxWidth="20rem";continue}if(p==="max-w-sm"){u.maxWidth="24rem";continue}if(p==="max-w-md"){u.maxWidth="28rem";continue}if(p==="max-w-lg"){u.maxWidth="32rem";continue}if(p==="max-w-xl"){u.maxWidth="36rem";continue}if(p==="max-w-2xl"){u.maxWidth="42rem";continue}if(p==="max-w-3xl"){u.maxWidth="48rem";continue}if(p==="max-w-4xl"){u.maxWidth="56rem";continue}if(p==="max-w-5xl"){u.maxWidth="64rem";continue}if(p==="max-w-6xl"){u.maxWidth="72rem";continue}if(p==="max-w-7xl"){u.maxWidth="80rem";continue}if(p==="max-w-full"){u.maxWidth="100%";continue}if(p==="max-w-prose"){u.maxWidth="65ch";continue}if(p==="max-w-screen-sm"){u.maxWidth="640px";continue}if(p==="max-w-screen-md"){u.maxWidth="768px";continue}if(p==="max-w-screen-lg"){u.maxWidth="1024px";continue}if(p==="max-w-screen-xl"){u.maxWidth="1280px";continue}if(p==="max-w-screen-2xl"){u.maxWidth="1536px";continue}if(p==="max-h-none"){u.maxHeight="none";continue}if(p==="max-h-full"){u.maxHeight="100%";continue}if(p==="max-h-screen"){u.maxHeight="100vh";continue}if(p==="max-h-fit"){u.maxHeight="fit-content";continue}const re=p.match(/^max-h-(\d+(?:\.\d+)?)$/);if(re){u.maxHeight=ce[re[1]]||`${parseFloat(re[1])*.25}rem`;continue}if(p==="relative"){u.position="relative";continue}if(p==="absolute"){u.position="absolute";continue}if(p==="fixed"){u.position="fixed";continue}if(p==="sticky"){u.position="sticky";continue}if(p==="inset-0"){u.top="0",u.right="0",u.bottom="0",u.left="0";continue}if(p==="inset-auto"){u.top="auto",u.right="auto",u.bottom="auto",u.left="auto";continue}if(p==="inset-x-0"){u.left="0",u.right="0";continue}if(p==="inset-y-0"){u.top="0",u.bottom="0";continue}const Ce=p.match(/^inset-(\d+(?:\.\d+)?)$/);if(Ce){const wt=ce[Ce[1]]||`${parseFloat(Ce[1])*.25}rem`;u.top=wt,u.right=wt,u.bottom=wt,u.left=wt;continue}const ie=p.match(/^inset-x-(\d+(?:\.\d+)?)$/);if(ie){const wt=ce[ie[1]]||`${parseFloat(ie[1])*.25}rem`;u.left=wt,u.right=wt;continue}const on=p.match(/^inset-y-(\d+(?:\.\d+)?)$/);if(on){const wt=ce[on[1]]||`${parseFloat(on[1])*.25}rem`;u.top=wt,u.bottom=wt;continue}if(p==="top-0"){u.top="0";continue}if(p==="top-auto"){u.top="auto";continue}if(p==="top-full"){u.top="100%";continue}const tn=p.match(/^top-(\d+(?:\.\d+)?)$/);if(tn){u.top=ce[tn[1]]||`${parseFloat(tn[1])*.25}rem`;continue}const Ke=p.match(/^-top-(\d+(?:\.\d+)?)$/);if(Ke){const wt=ce[Ke[1]]||`${parseFloat(Ke[1])*.25}rem`;u.top=`-${wt}`;continue}if(p==="right-0"){u.right="0";continue}if(p==="right-auto"){u.right="auto";continue}if(p==="right-full"){u.right="100%";continue}const _o=p.match(/^right-(\d+(?:\.\d+)?)$/);if(_o){u.right=ce[_o[1]]||`${parseFloat(_o[1])*.25}rem`;continue}const cn=p.match(/^-right-(\d+(?:\.\d+)?)$/);if(cn){const wt=ce[cn[1]]||`${parseFloat(cn[1])*.25}rem`;u.right=`-${wt}`;continue}if(p==="bottom-0"){u.bottom="0";continue}if(p==="bottom-auto"){u.bottom="auto";continue}if(p==="bottom-full"){u.bottom="100%";continue}const Ot=p.match(/^bottom-(\d+(?:\.\d+)?)$/);if(Ot){u.bottom=ce[Ot[1]]||`${parseFloat(Ot[1])*.25}rem`;continue}const Dn=p.match(/^-bottom-(\d+(?:\.\d+)?)$/);if(Dn){const wt=ce[Dn[1]]||`${parseFloat(Dn[1])*.25}rem`;u.bottom=`-${wt}`;continue}if(p==="left-0"){u.left="0";continue}if(p==="left-auto"){u.left="auto";continue}if(p==="left-full"){u.left="100%";continue}const Fe=p.match(/^left-(\d+(?:\.\d+)?)$/);if(Fe){u.left=ce[Fe[1]]||`${parseFloat(Fe[1])*.25}rem`;continue}const Ci=p.match(/^-left-(\d+(?:\.\d+)?)$/);if(Ci){const wt=ce[Ci[1]]||`${parseFloat(Ci[1])*.25}rem`;u.left=`-${wt}`;continue}if(p==="overflow-hidden"){u.overflow="hidden";continue}if(p==="overflow-auto"){u.overflow="auto";continue}if(p==="overflow-scroll"){u.overflow="scroll";continue}if(p==="overflow-visible"){u.overflow="visible";continue}if(p==="overflow-x-auto"){u.overflowX="auto";continue}if(p==="overflow-y-auto"){u.overflowY="auto";continue}if(p==="overflow-x-hidden"){u.overflowX="hidden";continue}if(p==="overflow-y-hidden"){u.overflowY="hidden";continue}if(p==="overflow-x-scroll"){u.overflowX="scroll";continue}if(p==="overflow-y-scroll"){u.overflowY="scroll";continue}if(p==="object-cover"){u.objectFit="cover";continue}if(p==="object-contain"){u.objectFit="contain";continue}if(p==="object-fill"){u.objectFit="fill";continue}if(p==="object-center"){u.objectPosition="center";continue}if(p==="z-0"){u.zIndex=0;continue}if(p==="z-10"){u.zIndex=10;continue}if(p==="z-20"){u.zIndex=20;continue}if(p==="z-30"){u.zIndex=30;continue}if(p==="z-40"){u.zIndex=40;continue}if(p==="z-50"){u.zIndex=50;continue}const So=p.match(/^opacity-(\d+)$/);if(So){u.opacity=parseInt(So[1])/100;continue}const Po=p.match(/^text-(xs|sm|base|lg|xl|[2-9]xl)$/);if(Po){const wt=rht[Po[1]];wt&&(u.fontSize=wt.fontSize,u.lineHeight=wt.lineHeight);continue}const he=p.match(/^text-([\w-]+)(?:\/([\d]+))?$/);if(he&&!p.startsWith("text-center")&&!p.startsWith("text-left")&&!p.startsWith("text-right")){const wt=he[1],ve=he[2],ae=o?c[wt]:{black:"#e5e7eb","gray-600":"#9ca3af","gray-700":"#d1d5db","gray-800":"#e5e7eb","gray-900":"#f3f4f6","slate-700":"#cbd5e1","slate-800":"#e2e8f0","slate-900":"#f1f5f9"}[wt]||c[wt];ae&&(ve?u.color=Fs(ae,parseInt(ve)/100):u.color=ae);continue}if(p==="bg-clip-text"){u.WebkitBackgroundClip="text",u.backgroundClip="text",u.WebkitTextFillColor="transparent";continue}if(p==="bg-fixed"){u.backgroundAttachment="fixed";continue}if(p==="bg-scroll"){u.backgroundAttachment="scroll";continue}const se=p.match(/^bg-([\w-]+)(?:\/([\d]+))?$/);if(se&&!p.startsWith("bg-gradient")){const wt=se[1],ve=se[2],ae=o?c[wt]:{white:"#1f2937","gray-50":"#1f2937","gray-100":"#1f2937","gray-200":"#374151","gray-300":"#4b5563","slate-50":"#1f2937","slate-100":"#1f2937","slate-200":"#334155"}[wt]||c[wt];ae&&(ve?u.backgroundColor=Fs(ae,parseInt(ve)/100):u.backgroundColor=ae);continue}if(p==="bg-gradient-to-t"){f="to top";continue}if(p==="bg-gradient-to-tr"){f="to top right";continue}if(p==="bg-gradient-to-r"){f="to right";continue}if(p==="bg-gradient-to-br"){f="to bottom right";continue}if(p==="bg-gradient-to-b"){f="to bottom";continue}if(p==="bg-gradient-to-bl"){f="to bottom left";continue}if(p==="bg-gradient-to-l"){f="to left";continue}if(p==="bg-gradient-to-tl"){f="to top left";continue}const ii=p.match(/^from-([\w-]+)(?:\/([\d]+))?$/);if(ii){const wt=ii[1],ve=ii[2],It=c[wt];It&&(m=ve?Fs(It,parseInt(ve)/100):It);continue}const Oi=p.match(/^via-([\w-]+)(?:\/([\d]+))?$/);if(Oi){const wt=Oi[1],ve=Oi[2],It=c[wt];It&&(y=ve?Fs(It,parseInt(ve)/100):It);continue}const Pr=p.match(/^to-([\w-]+)(?:\/([\d]+))?$/);if(Pr){const wt=Pr[1],ve=Pr[2],It=c[wt];It&&(x=ve?Fs(It,parseInt(ve)/100):It);continue}const Mi=p.match(/^p-(\d+(?:\.\d+)?)$/);if(Mi){u.padding=ce[Mi[1]]||`${parseFloat(Mi[1])*.25}rem`;continue}const ms=p.match(/^px-(\d+(?:\.\d+)?)$/);if(ms){const wt=ce[ms[1]]||`${parseFloat(ms[1])*.25}rem`;u.paddingLeft=wt,u.paddingRight=wt;continue}const ki=p.match(/^py-(\d+(?:\.\d+)?)$/);if(ki){const wt=ce[ki[1]]||`${parseFloat(ki[1])*.25}rem`;u.paddingTop=wt,u.paddingBottom=wt;continue}const oi=p.match(/^pt-(\d+(?:\.\d+)?)$/);if(oi){u.paddingTop=ce[oi[1]]||`${parseFloat(oi[1])*.25}rem`;continue}const $i=p.match(/^pr-(\d+(?:\.\d+)?)$/);if($i){u.paddingRight=ce[$i[1]]||`${parseFloat($i[1])*.25}rem`;continue}const Wr=p.match(/^pb-(\d+(?:\.\d+)?)$/);if(Wr){u.paddingBottom=ce[Wr[1]]||`${parseFloat(Wr[1])*.25}rem`;continue}const Ao=p.match(/^pl-(\d+(?:\.\d+)?)$/);if(Ao){u.paddingLeft=ce[Ao[1]]||`${parseFloat(Ao[1])*.25}rem`;continue}const Ii=p.match(/^m-(\d+(?:\.\d+)?)$/);if(Ii){u.margin=ce[Ii[1]]||`${parseFloat(Ii[1])*.25}rem`;continue}const Ri=p.match(/^mx-(\d+(?:\.\d+)?|auto)$/);if(Ri){const wt=Ri[1]==="auto"?"auto":ce[Ri[1]]||`${parseFloat(Ri[1])*.25}rem`;u.marginLeft=wt,u.marginRight=wt;continue}const Ar=p.match(/^my-(\d+(?:\.\d+)?|auto)$/);if(Ar){const wt=Ar[1]==="auto"?"auto":ce[Ar[1]]||`${parseFloat(Ar[1])*.25}rem`;u.marginTop=wt,u.marginBottom=wt;continue}const Li=p.match(/^mt-(\d+(?:\.\d+)?|auto)$/);if(Li){u.marginTop=Li[1]==="auto"?"auto":ce[Li[1]]||`${parseFloat(Li[1])*.25}rem`;continue}const Ni=p.match(/^mr-(\d+(?:\.\d+)?|auto)$/);if(Ni){u.marginRight=Ni[1]==="auto"?"auto":ce[Ni[1]]||`${parseFloat(Ni[1])*.25}rem`;continue}const En=p.match(/^mb-(\d+(?:\.\d+)?)$/);if(En){u.marginBottom=ce[En[1]]||`${parseFloat(En[1])*.25}rem`;continue}const $t=p.match(/^ml-(\d+(?:\.\d+)?|auto)$/);if($t){u.marginLeft=$t[1]==="auto"?"auto":ce[$t[1]]||`${parseFloat($t[1])*.25}rem`;continue}if(p==="mt-auto"){u.marginTop="auto";continue}const To=p.match(/^gap-(\d+(?:\.\d+)?)$/);if(To){u.gap=ce[To[1]]||`${parseFloat(To[1])*.25}rem`;continue}const Cn=p.match(/^gap-x-(\d+(?:\.\d+)?)$/);if(Cn){u.columnGap=ce[Cn[1]]||`${parseFloat(Cn[1])*.25}rem`;continue}const ji=p.match(/^gap-y-(\d+(?:\.\d+)?)$/);if(ji){u.rowGap=ce[ji[1]]||`${parseFloat(ji[1])*.25}rem`;continue}const Eo=p.match(/^space-x-(\d+(?:\.\d+)?)$/);if(Eo){u.columnGap=ce[Eo[1]]||`${parseFloat(Eo[1])*.25}rem`;continue}const si=p.match(/^space-y-(\d+(?:\.\d+)?)$/);if(si){u.rowGap=ce[si[1]]||`${parseFloat(si[1])*.25}rem`;continue}const Di=p.match(/^space-x-\[([^\]]+)\]$/);if(Di){u.columnGap=Di[1];continue}const pr=p.match(/^space-y-\[([^\]]+)\]$/);if(pr){u.rowGap=pr[1];continue}const Bi=p.match(/^grid-cols-(\d+)$/);if(Bi){u.gridTemplateColumns=`repeat(${Bi[1]}, minmax(0, 1fr))`;continue}if(p==="rounded"){u.borderRadius="0.25rem";continue}if(p==="rounded-none"){u.borderRadius="0";continue}if(p==="rounded-sm"){u.borderRadius="0.125rem";continue}if(p==="rounded-md"){u.borderRadius="0.375rem";continue}if(p==="rounded-lg"){u.borderRadius="0.5rem";continue}if(p==="rounded-xl"){u.borderRadius="0.75rem";continue}if(p==="rounded-2xl"){u.borderRadius="1rem";continue}if(p==="rounded-3xl"){u.borderRadius="1.5rem";continue}if(p==="rounded-full"){u.borderRadius="9999px";continue}if(p==="border"){u.borderWidth="1px",u.borderStyle="solid";continue}if(p==="border-0"){u.borderWidth="0";continue}if(p==="border-2"){u.borderWidth="2px",u.borderStyle="solid";continue}if(p==="border-t"){u.borderTopWidth="1px",u.borderStyle="solid";continue}if(p==="border-b"){u.borderBottomWidth="1px",u.borderStyle="solid";continue}if(p==="border-l"){u.borderLeftWidth="1px",u.borderStyle="solid";continue}if(p==="border-r"){u.borderRightWidth="1px",u.borderStyle="solid";continue}const gs=p.match(/^border-t-(\d+)$/);if(gs){u.borderTopWidth=`${gs[1]}px`,u.borderStyle="solid";continue}const Gn=p.match(/^border-b-(\d+)$/);if(Gn){u.borderBottomWidth=`${Gn[1]}px`,u.borderStyle="solid";continue}const zi=p.match(/^border-l-(\d+)$/);if(zi){u.borderLeftWidth=`${zi[1]}px`,u.borderStyle="solid";continue}const ys=p.match(/^border-r-(\d+)$/);if(ys){u.borderRightWidth=`${ys[1]}px`,u.borderStyle="solid";continue}const vs=p.match(/^border-(\d+)$/);if(vs){u.borderWidth=`${vs[1]}px`,u.borderStyle="solid";continue}const bs=p.match(/^border-([\w-]+)(?:\/([\d]+))?$/);if(bs&&!p.match(/^border-[trbl]$/)){const wt=bs[1],ve=bs[2],ae=o?c[wt]:{white:"#374151","gray-100":"#374151","gray-200":"#374151","gray-300":"#4b5563","slate-100":"#334155","slate-200":"#334155","slate-300":"#475569"}[wt]||c[wt];ae&&(u.borderColor=ve?Fs(ae,parseInt(ve)/100):ae);continue}if(p==="shadow"){u.boxShadow="0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-sm"){u.boxShadow="0 1px 2px 0 rgb(0 0 0 / 0.05)";continue}if(p==="shadow-md"){u.boxShadow="0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-lg"){u.boxShadow="0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-xl"){u.boxShadow="0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-2xl"){u.boxShadow="0 25px 50px -12px rgb(0 0 0 / 0.25)";continue}if(p==="shadow-none"){u.boxShadow="none";continue}if(p==="ring"){u.boxShadow="0 0 0 3px rgba(59, 130, 246, 0.5)";continue}if(p==="ring-0"){u.boxShadow="0 0 0 0px transparent";continue}if(p==="ring-1"){u.boxShadow="0 0 0 1px rgba(59, 130, 246, 0.5)";continue}if(p==="ring-2"){u.boxShadow="0 0 0 2px rgba(59, 130, 246, 0.5)";continue}const Ae=p.match(/^ring-([\w-]+)(?:\/([\d]+))?$/);if(Ae&&!p.match(/^ring-\d$/)){const wt=Ae[1],ve=Ae[2],It=c[wt];if(It){const ae=ve?parseInt(ve)/100:1;u.boxShadow&&u.boxShadow.includes("0 0 0")&&(u.boxShadow=u.boxShadow.replace(/rgba\([^)]+\)/,Fs(It,ae)))}continue}if(p==="backdrop-blur"){u.backdropFilter="blur(8px)";continue}if(p==="backdrop-blur-none"){u.backdropFilter="blur(0)";continue}if(p==="backdrop-blur-sm"){u.backdropFilter="blur(4px)";continue}if(p==="backdrop-blur-md"){u.backdropFilter="blur(12px)";continue}if(p==="backdrop-blur-lg"){u.backdropFilter="blur(16px)";continue}if(p==="backdrop-blur-xl"){u.backdropFilter="blur(24px)";continue}if(p==="backdrop-blur-2xl"){u.backdropFilter="blur(40px)";continue}if(p==="backdrop-blur-3xl"){u.backdropFilter="blur(64px)";continue}if(p==="blur"){u.filter="blur(8px)";continue}if(p==="blur-none"){u.filter="blur(0)";continue}if(p==="blur-sm"){u.filter="blur(4px)";continue}if(p==="blur-md"){u.filter="blur(12px)";continue}if(p==="blur-lg"){u.filter="blur(16px)";continue}if(p==="blur-xl"){u.filter="blur(24px)";continue}if(p==="blur-2xl"){u.filter="blur(40px)";continue}if(p==="blur-3xl"){u.filter="blur(64px)";continue}const un=p.match(/^scale-(\d+)$/);if(un){const wt=parseInt(un[1])/100;u.transform=`scale(${wt})`;continue}const Ea=p.match(/^scale-x-(\d+)$/);if(Ea){const wt=parseInt(Ea[1])/100;u.transform=`scaleX(${wt})`;continue}const xs=p.match(/^scale-y-(\d+)$/);if(xs){const wt=parseInt(xs[1])/100;u.transform=`scaleY(${wt})`;continue}const ws=p.match(/^rotate-(\d+)$/);if(ws){u.transform=`rotate(${ws[1]}deg)`;continue}const Fi=p.match(/^-rotate-(\d+)$/);if(Fi){u.transform=`rotate(-${Fi[1]}deg)`;continue}const _n=p.match(/^translate-x-(\d+(?:\.\d+)?)$/);if(_n){const wt=ce[_n[1]]||`${parseFloat(_n[1])*.25}rem`;u.transform=`translateX(${wt})`;continue}const tr=p.match(/^-translate-x-(\d+(?:\.\d+)?)$/);if(tr){const wt=ce[tr[1]]||`${parseFloat(tr[1])*.25}rem`;u.transform=`translateX(-${wt})`;continue}const Co=p.match(/^translate-y-(\d+(?:\.\d+)?)$/);if(Co){const wt=ce[Co[1]]||`${parseFloat(Co[1])*.25}rem`;u.transform=`translateY(${wt})`;continue}const ai=p.match(/^-translate-y-(\d+(?:\.\d+)?)$/);if(ai){const wt=ce[ai[1]]||`${parseFloat(ai[1])*.25}rem`;u.transform=`translateY(-${wt})`;continue}if(p==="translate-x-full"){u.transform="translateX(100%)";continue}if(p==="-translate-x-full"){u.transform="translateX(-100%)";continue}if(p==="translate-y-full"){u.transform="translateY(100%)";continue}if(p==="-translate-y-full"){u.transform="translateY(-100%)";continue}if(p==="translate-x-1/2"){u.transform="translateX(50%)";continue}if(p==="-translate-x-1/2"){u.transform="translateX(-50%)";continue}if(p==="translate-y-1/2"){u.transform="translateY(50%)";continue}if(p==="-translate-y-1/2"){u.transform="translateY(-50%)";continue}if(p.startsWith("animate-")||p.startsWith("divide-")||p.startsWith("group-"))continue;if(p==="leading-none"){u.lineHeight="1";continue}if(p==="leading-tight"){u.lineHeight="1.25";continue}if(p==="leading-snug"){u.lineHeight="1.375";continue}if(p==="leading-normal"){u.lineHeight="1.5";continue}if(p==="leading-relaxed"){u.lineHeight="1.625";continue}if(p==="leading-loose"){u.lineHeight="2";continue}if(p==="tracking-tighter"){u.letterSpacing="-0.05em";continue}if(p==="tracking-tight"){u.letterSpacing="-0.025em";continue}if(p==="tracking-normal"){u.letterSpacing="0em";continue}if(p==="tracking-wide"){u.letterSpacing="0.025em";continue}if(p==="tracking-wider"){u.letterSpacing="0.05em";continue}if(p==="tracking-widest"){u.letterSpacing="0.1em";continue}const On=p.match(/^tracking-\[(.+)\]$/);if(On){u.letterSpacing=On[1];continue}const ee=p.match(/^w-\[(.+)\]$/);if(ee){u.width=ee[1];continue}const qt=p.match(/^h-\[(.+)\]$/);if(qt){u.height=qt[1];continue}const mr=p.match(/^min-h-\[(.+)\]$/);if(mr){u.minHeight=mr[1];continue}const ye=p.match(/^max-w-\[(.+)\]$/);if(ye){u.maxWidth=ye[1];continue}}return f&&m&&(y?u.backgroundImage=`linear-gradient(${f}, ${m}, ${y}, ${x||m})`:x?u.backgroundImage=`linear-gradient(${f}, ${m}, ${x})`:u.backgroundImage=`linear-gradient(${f}, ${m}, transparent)`),u}function Fs(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`rgba(${n}, ${r}, ${i}, ${t})`}const vT={margin:0,padding:0,boxSizing:"border-box",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"};function iht(e){return`
129
+ `)}const nht={slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}},cb={transparent:"transparent",current:"currentColor",inherit:"inherit",black:"#000000",white:"#ffffff",primary:"#3b82f6",secondary:"#64748b",accent:"#ec4899",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#3b82f6"};for(const[e,t]of Object.entries(nht))for(const[n,r]of Object.entries(t))cb[`${e}-${n}`]=r;const ce={0:"0px","0.5":"0.125rem",1:"0.25rem","1.5":"0.375rem",2:"0.5rem","2.5":"0.625rem",3:"0.75rem","3.5":"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},rht={xs:{fontSize:"0.75rem",lineHeight:"1rem"},sm:{fontSize:"0.875rem",lineHeight:"1.25rem"},base:{fontSize:"1rem",lineHeight:"1.5rem"},lg:{fontSize:"1.125rem",lineHeight:"1.75rem"},xl:{fontSize:"1.25rem",lineHeight:"1.75rem"},"2xl":{fontSize:"1.5rem",lineHeight:"2rem"},"3xl":{fontSize:"1.875rem",lineHeight:"2.25rem"},"4xl":{fontSize:"2.25rem",lineHeight:"2.5rem"},"5xl":{fontSize:"3rem",lineHeight:"1"},"6xl":{fontSize:"3.75rem",lineHeight:"1"},"7xl":{fontSize:"4.5rem",lineHeight:"1"},"8xl":{fontSize:"6rem",lineHeight:"1"},"9xl":{fontSize:"8rem",lineHeight:"1"}};function Sx(e,t,n=!0){if(!e)return{};e=String(e);const{colorMode:r,...i}=t||{},o=r==="light",s=e.match(/(?:^|\s)dark:([^\s]+)/g)||[],l=e.replace(/(?:^|\s)dark:[^\s]+/g," ").replace(/\s+/g," ").trim();!o&&s.length?e=l?`${l} ${s.map(p=>p.trim().replace(/^dark:/,"")).join(" ")}`:s.map(p=>p.trim().replace(/^dark:/,"")).join(" "):e=l;const c=i?{...cb,...Object.fromEntries(Object.entries(i).filter(([,p])=>p))}:cb;o&&n&&(c.white="#000000",c.black="#ffffff",c["gray-300"]="#4b5563",c["gray-400"]="#374151",c["gray-500"]="#374151",c["gray-600"]="#1f2937",c["gray-700"]="#111827",c["gray-800"]="#0f172a",c["slate-300"]="#475569",c["slate-400"]="#334155",c["slate-500"]="#334155",c["slate-600"]="#1e293b");const h=e.split(/\s+/).filter(Boolean),u={};let f="",m="",y="",x="";for(let p of h){if(p.startsWith("hover:")||p.startsWith("focus:")||p.startsWith("active:")||p.startsWith("group-hover:")||p==="transition"||p==="transition-all"||p==="transition-colors"||p==="transition-opacity"||p==="transition-transform"||p.startsWith("duration-")||p.startsWith("ease-")||p==="cursor-pointer"||p==="grayscale"||((p.startsWith("sm:")||p.startsWith("md:")||p.startsWith("lg:")||p.startsWith("xl:")||p.startsWith("2xl:"))&&(p=p.replace(/^(sm:|md:|lg:|xl:|2xl:)/,"")),p.startsWith("placeholder-"))||p.startsWith("disabled:"))continue;const b=p.match(/^bg-\[([^\]]+)\]$/);if(b){const wt=b[1];wt.startsWith("url(")?u.backgroundImage=wt:u.backgroundColor=wt;continue}const P=p.match(/^text-\[(#[0-9a-fA-F]{3,8}|rgb[a]?\([^)]+\)|hsl[a]?\([^)]+\))\]$/);if(P){u.color=P[1];continue}const S=p.match(/^text-\[(\d+(?:\.\d+)?(?:px|rem|em|%))\]$/);if(S){u.fontSize=S[1];continue}const A=p.match(/^w-\[([^\]]+)\]$/);if(A){u.width=A[1];continue}const E=p.match(/^h-\[([^\]]+)\]$/);if(E){u.height=E[1];continue}const w=p.match(/^min-w-\[([^\]]+)\]$/);if(w){u.minWidth=w[1];continue}const T=p.match(/^max-w-\[([^\]]+)\]$/);if(T){u.maxWidth=T[1];continue}const O=p.match(/^min-h-\[([^\]]+)\]$/);if(O){u.minHeight=O[1];continue}const R=p.match(/^max-h-\[([^\]]+)\]$/);if(R){u.maxHeight=R[1];continue}const N=p.match(/^p-\[([^\]]+)\]$/);if(N){u.padding=N[1];continue}const V=p.match(/^px-\[([^\]]+)\]$/);if(V){u.paddingLeft=V[1],u.paddingRight=V[1];continue}const D=p.match(/^py-\[([^\]]+)\]$/);if(D){u.paddingTop=D[1],u.paddingBottom=D[1];continue}const j=p.match(/^pt-\[([^\]]+)\]$/);if(j){u.paddingTop=j[1];continue}const K=p.match(/^pr-\[([^\]]+)\]$/);if(K){u.paddingRight=K[1];continue}const H=p.match(/^pb-\[([^\]]+)\]$/);if(H){u.paddingBottom=H[1];continue}const z=p.match(/^pl-\[([^\]]+)\]$/);if(z){u.paddingLeft=z[1];continue}const Y=p.match(/^m-\[([^\]]+)\]$/);if(Y){u.margin=Y[1];continue}const G=p.match(/^mx-\[([^\]]+)\]$/);if(G){u.marginLeft=G[1],u.marginRight=G[1];continue}const J=p.match(/^my-\[([^\]]+)\]$/);if(J){u.marginTop=J[1],u.marginBottom=J[1];continue}const lt=p.match(/^mt-\[([^\]]+)\]$/);if(lt){u.marginTop=lt[1];continue}const q=p.match(/^mr-\[([^\]]+)\]$/);if(q){u.marginRight=q[1];continue}const nt=p.match(/^mb-\[([^\]]+)\]$/);if(nt){u.marginBottom=nt[1];continue}const it=p.match(/^ml-\[([^\]]+)\]$/);if(it){u.marginLeft=it[1];continue}const at=p.match(/^gap-\[([^\]]+)\]$/);if(at){u.gap=at[1];continue}const ct=p.match(/^gap-x-\[([^\]]+)\]$/);if(ct){u.columnGap=ct[1];continue}const gt=p.match(/^gap-y-\[([^\]]+)\]$/);if(gt){u.rowGap=gt[1];continue}const yt=p.match(/^rounded-\[([^\]]+)\]$/);if(yt){u.borderRadius=yt[1];continue}const Et=p.match(/^border-\[(#[0-9a-fA-F]{3,8}|rgb[a]?\([^)]+\))\]$/);if(Et){u.borderColor=Et[1];continue}const Tt=p.match(/^border-\[(\d+(?:\.\d+)?(?:px)?)\]$/);if(Tt){u.borderWidth=Tt[1];continue}const ht=p.match(/^top-\[([^\]]+)\]$/);if(ht){u.top=ht[1];continue}const ft=p.match(/^right-\[([^\]]+)\]$/);if(ft){u.right=ft[1];continue}const Ct=p.match(/^bottom-\[([^\]]+)\]$/);if(Ct){u.bottom=Ct[1];continue}const rt=p.match(/^left-\[([^\]]+)\]$/);if(rt){u.left=rt[1];continue}const Rt=p.match(/^inset-\[([^\]]+)\]$/);if(Rt){u.inset=Rt[1];continue}const bt=p.match(/^z-\[([^\]]+)\]$/);if(bt){u.zIndex=parseInt(bt[1])||bt[1];continue}const de=p.match(/^opacity-\[([^\]]+)\]$/);if(de){u.opacity=parseFloat(de[1]);continue}const ne=p.match(/^leading-\[([^\]]+)\]$/);if(ne){u.lineHeight=ne[1];continue}if(p==="flex"){u.display="flex";continue}if(p==="grid"){u.display="grid";continue}if(p==="block"){u.display="block";continue}if(p==="inline"){u.display="inline";continue}if(p==="inline-flex"){u.display="inline-flex";continue}if(p==="inline-block"){u.display="inline-block";continue}if(p==="hidden"){u.display="none";continue}if(p==="flex-col"){u.flexDirection="column";continue}if(p==="flex-row"){u.flexDirection="row";continue}if(p==="flex-wrap"){u.flexWrap="wrap";continue}if(p==="flex-nowrap"){u.flexWrap="nowrap";continue}if(p==="flex-col-reverse"){u.flexDirection="column-reverse";continue}if(p==="flex-row-reverse"){u.flexDirection="row-reverse";continue}if(p==="flex-1"){u.flex="1 1 0%";continue}if(p==="flex-auto"){u.flex="1 1 auto";continue}if(p==="flex-initial"){u.flex="0 1 auto";continue}if(p==="flex-none"){u.flex="none";continue}if(p==="grow"){u.flexGrow=1;continue}if(p==="grow-0"){u.flexGrow=0;continue}if(p==="shrink"){u.flexShrink=1;continue}if(p==="shrink-0"){u.flexShrink=0;continue}if(p==="items-start"){u.alignItems="flex-start";continue}if(p==="items-center"){u.alignItems="center";continue}if(p==="items-end"){u.alignItems="flex-end";continue}if(p==="items-stretch"){u.alignItems="stretch";continue}if(p==="items-baseline"){u.alignItems="baseline";continue}if(p==="justify-start"){u.justifyContent="flex-start";continue}if(p==="justify-center"){u.justifyContent="center";continue}if(p==="justify-end"){u.justifyContent="flex-end";continue}if(p==="justify-between"){u.justifyContent="space-between";continue}if(p==="justify-around"){u.justifyContent="space-around";continue}if(p==="justify-evenly"){u.justifyContent="space-evenly";continue}if(p==="justify-items-start"){u.justifyItems="start";continue}if(p==="justify-items-center"){u.justifyItems="center";continue}if(p==="justify-items-end"){u.justifyItems="end";continue}if(p==="justify-items-stretch"){u.justifyItems="stretch";continue}if(p==="self-auto"){u.alignSelf="auto";continue}if(p==="self-start"){u.alignSelf="flex-start";continue}if(p==="self-center"){u.alignSelf="center";continue}if(p==="self-end"){u.alignSelf="flex-end";continue}if(p==="self-stretch"){u.alignSelf="stretch";continue}if(p==="self-baseline"){u.alignSelf="baseline";continue}if(p==="justify-self-auto"){u.justifySelf="auto";continue}if(p==="justify-self-start"){u.justifySelf="start";continue}if(p==="justify-self-center"){u.justifySelf="center";continue}if(p==="justify-self-end"){u.justifySelf="end";continue}if(p==="justify-self-stretch"){u.justifySelf="stretch";continue}if(p==="place-content-center"){u.placeContent="center";continue}if(p==="place-content-start"){u.placeContent="start";continue}if(p==="place-content-end"){u.placeContent="end";continue}if(p==="place-content-between"){u.placeContent="space-between";continue}if(p==="place-content-around"){u.placeContent="space-around";continue}if(p==="place-content-evenly"){u.placeContent="space-evenly";continue}if(p==="place-content-stretch"){u.placeContent="stretch";continue}if(p==="place-items-start"){u.placeItems="start";continue}if(p==="place-items-center"){u.placeItems="center";continue}if(p==="place-items-end"){u.placeItems="end";continue}if(p==="place-items-stretch"){u.placeItems="stretch";continue}if(p==="text-left"){u.textAlign="left";continue}if(p==="text-center"){u.textAlign="center";continue}if(p==="text-right"){u.textAlign="right";continue}if(p==="text-justify"){u.textAlign="justify";continue}if(p==="text-start"){u.textAlign="start";continue}if(p==="text-end"){u.textAlign="end";continue}if(p==="whitespace-normal"){u.whiteSpace="normal";continue}if(p==="whitespace-nowrap"){u.whiteSpace="nowrap";continue}if(p==="whitespace-pre"){u.whiteSpace="pre";continue}if(p==="whitespace-pre-line"){u.whiteSpace="pre-line";continue}if(p==="whitespace-pre-wrap"){u.whiteSpace="pre-wrap";continue}if(p==="whitespace-break-spaces"){u.whiteSpace="break-spaces";continue}if(p==="break-normal"){u.wordBreak="normal",u.overflowWrap="normal";continue}if(p==="break-words"){u.overflowWrap="break-word";continue}if(p==="break-all"){u.wordBreak="break-all";continue}if(p==="break-keep"){u.wordBreak="keep-all";continue}if(p==="truncate"){u.overflow="hidden",u.textOverflow="ellipsis",u.whiteSpace="nowrap";continue}if(p==="text-ellipsis"){u.textOverflow="ellipsis";continue}if(p==="text-clip"){u.textOverflow="clip";continue}if(p==="underline"){u.textDecoration="underline";continue}if(p==="overline"){u.textDecoration="overline";continue}if(p==="line-through"){u.textDecoration="line-through";continue}if(p==="no-underline"){u.textDecoration="none";continue}if(p==="uppercase"){u.textTransform="uppercase";continue}if(p==="lowercase"){u.textTransform="lowercase";continue}if(p==="capitalize"){u.textTransform="capitalize";continue}if(p==="normal-case"){u.textTransform="none";continue}if(p==="italic"){u.fontStyle="italic";continue}if(p==="not-italic"){u.fontStyle="normal";continue}if(p==="font-thin"){u.fontWeight=100;continue}if(p==="font-extralight"){u.fontWeight=200;continue}if(p==="font-light"){u.fontWeight=300;continue}if(p==="font-normal"){u.fontWeight=400;continue}if(p==="font-medium"){u.fontWeight=500;continue}if(p==="font-semibold"){u.fontWeight=600;continue}if(p==="font-bold"){u.fontWeight=700;continue}if(p==="font-extrabold"){u.fontWeight=800;continue}if(p==="font-black"){u.fontWeight=900;continue}if(p==="w-full"){u.width="100%";continue}if(p==="w-screen"){u.width="100vw";continue}if(p==="w-auto"){u.width="auto";continue}if(p==="w-fit"){u.width="fit-content";continue}if(p==="w-min"){u.width="min-content";continue}if(p==="w-max"){u.width="max-content";continue}const Gt=p.match(/^w-(\d+(?:\.\d+)?)$/);if(Gt){u.width=ce[Gt[1]]||`${parseFloat(Gt[1])*.25}rem`;continue}const Le=p.match(/^w-(\d+)\/(\d+)$/);if(Le){const wt=parseInt(Le[1])/parseInt(Le[2])*100;u.width=`${wt}%`;continue}if(p==="h-full"){u.height="100%";continue}if(p==="h-screen"){u.height="100vh";continue}if(p==="h-auto"){u.height="auto";continue}if(p==="h-fit"){u.height="fit-content";continue}if(p==="h-min"){u.height="min-content";continue}if(p==="h-max"){u.height="max-content";continue}const Bt=p.match(/^h-(\d+(?:\.\d+)?)$/);if(Bt){u.height=ce[Bt[1]]||`${parseFloat(Bt[1])*.25}rem`;continue}const Qt=p.match(/^h-(\d+)\/(\d+)$/);if(Qt){const wt=parseInt(Qt[1])/parseInt(Qt[2])*100;u.height=`${wt}%`;continue}if(p==="min-h-screen"){u.minHeight="100vh";continue}if(p==="min-h-full"){u.minHeight="100%";continue}if(p==="min-h-0"){u.minHeight="0";continue}if(p==="min-h-fit"){u.minHeight="fit-content";continue}const te=p.match(/^min-h-(\d+(?:\.\d+)?)$/);if(te){u.minHeight=ce[te[1]]||`${parseFloat(te[1])*.25}rem`;continue}if(p==="min-w-0"){u.minWidth="0";continue}if(p==="min-w-full"){u.minWidth="100%";continue}if(p==="min-w-fit"){u.minWidth="fit-content";continue}const Ht=p.match(/^min-w-(\d+(?:\.\d+)?)$/);if(Ht){u.minWidth=ce[Ht[1]]||`${parseFloat(Ht[1])*.25}rem`;continue}if(p==="max-w-none"){u.maxWidth="none";continue}if(p==="max-w-xs"){u.maxWidth="20rem";continue}if(p==="max-w-sm"){u.maxWidth="24rem";continue}if(p==="max-w-md"){u.maxWidth="28rem";continue}if(p==="max-w-lg"){u.maxWidth="32rem";continue}if(p==="max-w-xl"){u.maxWidth="36rem";continue}if(p==="max-w-2xl"){u.maxWidth="42rem";continue}if(p==="max-w-3xl"){u.maxWidth="48rem";continue}if(p==="max-w-4xl"){u.maxWidth="56rem";continue}if(p==="max-w-5xl"){u.maxWidth="64rem";continue}if(p==="max-w-6xl"){u.maxWidth="72rem";continue}if(p==="max-w-7xl"){u.maxWidth="80rem";continue}if(p==="max-w-full"){u.maxWidth="100%";continue}if(p==="max-w-prose"){u.maxWidth="65ch";continue}if(p==="max-w-screen-sm"){u.maxWidth="640px";continue}if(p==="max-w-screen-md"){u.maxWidth="768px";continue}if(p==="max-w-screen-lg"){u.maxWidth="1024px";continue}if(p==="max-w-screen-xl"){u.maxWidth="1280px";continue}if(p==="max-w-screen-2xl"){u.maxWidth="1536px";continue}if(p==="max-h-none"){u.maxHeight="none";continue}if(p==="max-h-full"){u.maxHeight="100%";continue}if(p==="max-h-screen"){u.maxHeight="100vh";continue}if(p==="max-h-fit"){u.maxHeight="fit-content";continue}const re=p.match(/^max-h-(\d+(?:\.\d+)?)$/);if(re){u.maxHeight=ce[re[1]]||`${parseFloat(re[1])*.25}rem`;continue}if(p==="relative"){u.position="relative";continue}if(p==="absolute"){u.position="absolute";continue}if(p==="fixed"){u.position="fixed";continue}if(p==="sticky"){u.position="sticky";continue}if(p==="inset-0"){u.top="0",u.right="0",u.bottom="0",u.left="0";continue}if(p==="inset-auto"){u.top="auto",u.right="auto",u.bottom="auto",u.left="auto";continue}if(p==="inset-x-0"){u.left="0",u.right="0";continue}if(p==="inset-y-0"){u.top="0",u.bottom="0";continue}const Ce=p.match(/^inset-(\d+(?:\.\d+)?)$/);if(Ce){const wt=ce[Ce[1]]||`${parseFloat(Ce[1])*.25}rem`;u.top=wt,u.right=wt,u.bottom=wt,u.left=wt;continue}const ie=p.match(/^inset-x-(\d+(?:\.\d+)?)$/);if(ie){const wt=ce[ie[1]]||`${parseFloat(ie[1])*.25}rem`;u.left=wt,u.right=wt;continue}const on=p.match(/^inset-y-(\d+(?:\.\d+)?)$/);if(on){const wt=ce[on[1]]||`${parseFloat(on[1])*.25}rem`;u.top=wt,u.bottom=wt;continue}if(p==="top-0"){u.top="0";continue}if(p==="top-auto"){u.top="auto";continue}if(p==="top-full"){u.top="100%";continue}const tn=p.match(/^top-(\d+(?:\.\d+)?)$/);if(tn){u.top=ce[tn[1]]||`${parseFloat(tn[1])*.25}rem`;continue}const Ke=p.match(/^-top-(\d+(?:\.\d+)?)$/);if(Ke){const wt=ce[Ke[1]]||`${parseFloat(Ke[1])*.25}rem`;u.top=`-${wt}`;continue}if(p==="right-0"){u.right="0";continue}if(p==="right-auto"){u.right="auto";continue}if(p==="right-full"){u.right="100%";continue}const _o=p.match(/^right-(\d+(?:\.\d+)?)$/);if(_o){u.right=ce[_o[1]]||`${parseFloat(_o[1])*.25}rem`;continue}const cn=p.match(/^-right-(\d+(?:\.\d+)?)$/);if(cn){const wt=ce[cn[1]]||`${parseFloat(cn[1])*.25}rem`;u.right=`-${wt}`;continue}if(p==="bottom-0"){u.bottom="0";continue}if(p==="bottom-auto"){u.bottom="auto";continue}if(p==="bottom-full"){u.bottom="100%";continue}const Ot=p.match(/^bottom-(\d+(?:\.\d+)?)$/);if(Ot){u.bottom=ce[Ot[1]]||`${parseFloat(Ot[1])*.25}rem`;continue}const Dn=p.match(/^-bottom-(\d+(?:\.\d+)?)$/);if(Dn){const wt=ce[Dn[1]]||`${parseFloat(Dn[1])*.25}rem`;u.bottom=`-${wt}`;continue}if(p==="left-0"){u.left="0";continue}if(p==="left-auto"){u.left="auto";continue}if(p==="left-full"){u.left="100%";continue}const Fe=p.match(/^left-(\d+(?:\.\d+)?)$/);if(Fe){u.left=ce[Fe[1]]||`${parseFloat(Fe[1])*.25}rem`;continue}const Ci=p.match(/^-left-(\d+(?:\.\d+)?)$/);if(Ci){const wt=ce[Ci[1]]||`${parseFloat(Ci[1])*.25}rem`;u.left=`-${wt}`;continue}if(p==="overflow-hidden"){u.overflow="hidden";continue}if(p==="overflow-auto"){u.overflow="auto";continue}if(p==="overflow-scroll"){u.overflow="scroll";continue}if(p==="overflow-visible"){u.overflow="visible";continue}if(p==="overflow-x-auto"){u.overflowX="auto";continue}if(p==="overflow-y-auto"){u.overflowY="auto";continue}if(p==="overflow-x-hidden"){u.overflowX="hidden";continue}if(p==="overflow-y-hidden"){u.overflowY="hidden";continue}if(p==="overflow-x-scroll"){u.overflowX="scroll";continue}if(p==="overflow-y-scroll"){u.overflowY="scroll";continue}if(p==="object-cover"){u.objectFit="cover";continue}if(p==="object-contain"){u.objectFit="contain";continue}if(p==="object-fill"){u.objectFit="fill";continue}if(p==="object-center"){u.objectPosition="center";continue}if(p==="z-0"){u.zIndex=0;continue}if(p==="z-10"){u.zIndex=10;continue}if(p==="z-20"){u.zIndex=20;continue}if(p==="z-30"){u.zIndex=30;continue}if(p==="z-40"){u.zIndex=40;continue}if(p==="z-50"){u.zIndex=50;continue}const So=p.match(/^opacity-(\d+)$/);if(So){u.opacity=parseInt(So[1])/100;continue}const Po=p.match(/^text-(xs|sm|base|lg|xl|[2-9]xl)$/);if(Po){const wt=rht[Po[1]];wt&&(u.fontSize=wt.fontSize,u.lineHeight=wt.lineHeight);continue}const he=p.match(/^text-([\w-]+)(?:\/([\d]+))?$/);if(he&&!p.startsWith("text-center")&&!p.startsWith("text-left")&&!p.startsWith("text-right")){const wt=he[1],ve=he[2],ae=o?c[wt]:{black:"#e5e7eb","gray-600":"#9ca3af","gray-700":"#d1d5db","gray-800":"#e5e7eb","gray-900":"#f3f4f6","slate-700":"#cbd5e1","slate-800":"#e2e8f0","slate-900":"#f1f5f9"}[wt]||c[wt];ae&&(ve?u.color=Fs(ae,parseInt(ve)/100):u.color=ae);continue}if(p==="bg-clip-text"){u.WebkitBackgroundClip="text",u.backgroundClip="text",u.WebkitTextFillColor="transparent";continue}if(p==="bg-fixed"){u.backgroundAttachment="fixed";continue}if(p==="bg-scroll"){u.backgroundAttachment="scroll";continue}const se=p.match(/^bg-([\w-]+)(?:\/([\d]+))?$/);if(se&&!p.startsWith("bg-gradient")){const wt=se[1],ve=se[2],ae=o?c[wt]:{white:"#1f2937","gray-50":"#1f2937","gray-100":"#1f2937","gray-200":"#374151","gray-300":"#4b5563","slate-50":"#1f2937","slate-100":"#1f2937","slate-200":"#334155"}[wt]||c[wt];ae&&(ve?u.backgroundColor=Fs(ae,parseInt(ve)/100):u.backgroundColor=ae);continue}if(p==="bg-gradient-to-t"){f="to top";continue}if(p==="bg-gradient-to-tr"){f="to top right";continue}if(p==="bg-gradient-to-r"){f="to right";continue}if(p==="bg-gradient-to-br"){f="to bottom right";continue}if(p==="bg-gradient-to-b"){f="to bottom";continue}if(p==="bg-gradient-to-bl"){f="to bottom left";continue}if(p==="bg-gradient-to-l"){f="to left";continue}if(p==="bg-gradient-to-tl"){f="to top left";continue}const ii=p.match(/^from-([\w-]+)(?:\/([\d]+))?$/);if(ii){const wt=ii[1],ve=ii[2],It=c[wt];It&&(m=ve?Fs(It,parseInt(ve)/100):It);continue}const Oi=p.match(/^via-([\w-]+)(?:\/([\d]+))?$/);if(Oi){const wt=Oi[1],ve=Oi[2],It=c[wt];It&&(y=ve?Fs(It,parseInt(ve)/100):It);continue}const Pr=p.match(/^to-([\w-]+)(?:\/([\d]+))?$/);if(Pr){const wt=Pr[1],ve=Pr[2],It=c[wt];It&&(x=ve?Fs(It,parseInt(ve)/100):It);continue}const Mi=p.match(/^p-(\d+(?:\.\d+)?)$/);if(Mi){u.padding=ce[Mi[1]]||`${parseFloat(Mi[1])*.25}rem`;continue}const ms=p.match(/^px-(\d+(?:\.\d+)?)$/);if(ms){const wt=ce[ms[1]]||`${parseFloat(ms[1])*.25}rem`;u.paddingLeft=wt,u.paddingRight=wt;continue}const ki=p.match(/^py-(\d+(?:\.\d+)?)$/);if(ki){const wt=ce[ki[1]]||`${parseFloat(ki[1])*.25}rem`;u.paddingTop=wt,u.paddingBottom=wt;continue}const oi=p.match(/^pt-(\d+(?:\.\d+)?)$/);if(oi){u.paddingTop=ce[oi[1]]||`${parseFloat(oi[1])*.25}rem`;continue}const $i=p.match(/^pr-(\d+(?:\.\d+)?)$/);if($i){u.paddingRight=ce[$i[1]]||`${parseFloat($i[1])*.25}rem`;continue}const Wr=p.match(/^pb-(\d+(?:\.\d+)?)$/);if(Wr){u.paddingBottom=ce[Wr[1]]||`${parseFloat(Wr[1])*.25}rem`;continue}const Ao=p.match(/^pl-(\d+(?:\.\d+)?)$/);if(Ao){u.paddingLeft=ce[Ao[1]]||`${parseFloat(Ao[1])*.25}rem`;continue}const Ii=p.match(/^m-(\d+(?:\.\d+)?)$/);if(Ii){u.margin=ce[Ii[1]]||`${parseFloat(Ii[1])*.25}rem`;continue}const Ri=p.match(/^mx-(\d+(?:\.\d+)?|auto)$/);if(Ri){const wt=Ri[1]==="auto"?"auto":ce[Ri[1]]||`${parseFloat(Ri[1])*.25}rem`;u.marginLeft=wt,u.marginRight=wt;continue}const Ar=p.match(/^my-(\d+(?:\.\d+)?|auto)$/);if(Ar){const wt=Ar[1]==="auto"?"auto":ce[Ar[1]]||`${parseFloat(Ar[1])*.25}rem`;u.marginTop=wt,u.marginBottom=wt;continue}const Li=p.match(/^mt-(\d+(?:\.\d+)?|auto)$/);if(Li){u.marginTop=Li[1]==="auto"?"auto":ce[Li[1]]||`${parseFloat(Li[1])*.25}rem`;continue}const Ni=p.match(/^mr-(\d+(?:\.\d+)?|auto)$/);if(Ni){u.marginRight=Ni[1]==="auto"?"auto":ce[Ni[1]]||`${parseFloat(Ni[1])*.25}rem`;continue}const En=p.match(/^mb-(\d+(?:\.\d+)?)$/);if(En){u.marginBottom=ce[En[1]]||`${parseFloat(En[1])*.25}rem`;continue}const $t=p.match(/^ml-(\d+(?:\.\d+)?|auto)$/);if($t){u.marginLeft=$t[1]==="auto"?"auto":ce[$t[1]]||`${parseFloat($t[1])*.25}rem`;continue}if(p==="mt-auto"){u.marginTop="auto";continue}const To=p.match(/^gap-(\d+(?:\.\d+)?)$/);if(To){u.gap=ce[To[1]]||`${parseFloat(To[1])*.25}rem`;continue}const Cn=p.match(/^gap-x-(\d+(?:\.\d+)?)$/);if(Cn){u.columnGap=ce[Cn[1]]||`${parseFloat(Cn[1])*.25}rem`;continue}const ji=p.match(/^gap-y-(\d+(?:\.\d+)?)$/);if(ji){u.rowGap=ce[ji[1]]||`${parseFloat(ji[1])*.25}rem`;continue}const Eo=p.match(/^space-x-(\d+(?:\.\d+)?)$/);if(Eo){u.columnGap=ce[Eo[1]]||`${parseFloat(Eo[1])*.25}rem`;continue}const si=p.match(/^space-y-(\d+(?:\.\d+)?)$/);if(si){u.rowGap=ce[si[1]]||`${parseFloat(si[1])*.25}rem`;continue}const Di=p.match(/^space-x-\[([^\]]+)\]$/);if(Di){u.columnGap=Di[1];continue}const pr=p.match(/^space-y-\[([^\]]+)\]$/);if(pr){u.rowGap=pr[1];continue}const Bi=p.match(/^grid-cols-(\d+)$/);if(Bi){u.gridTemplateColumns=`repeat(${Bi[1]}, minmax(0, 1fr))`;continue}if(p==="rounded"){u.borderRadius="0.25rem";continue}if(p==="rounded-none"){u.borderRadius="0";continue}if(p==="rounded-sm"){u.borderRadius="0.125rem";continue}if(p==="rounded-md"){u.borderRadius="0.375rem";continue}if(p==="rounded-lg"){u.borderRadius="0.5rem";continue}if(p==="rounded-xl"){u.borderRadius="0.75rem";continue}if(p==="rounded-2xl"){u.borderRadius="1rem";continue}if(p==="rounded-3xl"){u.borderRadius="1.5rem";continue}if(p==="rounded-full"){u.borderRadius="9999px";continue}if(p==="border"){u.borderWidth="1px",u.borderStyle="solid";continue}if(p==="border-0"){u.borderWidth="0";continue}if(p==="border-2"){u.borderWidth="2px",u.borderStyle="solid";continue}if(p==="border-t"){u.borderTopWidth="1px",u.borderStyle="solid";continue}if(p==="border-b"){u.borderBottomWidth="1px",u.borderStyle="solid";continue}if(p==="border-l"){u.borderLeftWidth="1px",u.borderStyle="solid";continue}if(p==="border-r"){u.borderRightWidth="1px",u.borderStyle="solid";continue}const gs=p.match(/^border-t-(\d+)$/);if(gs){u.borderTopWidth=`${gs[1]}px`,u.borderStyle="solid";continue}const Gn=p.match(/^border-b-(\d+)$/);if(Gn){u.borderBottomWidth=`${Gn[1]}px`,u.borderStyle="solid";continue}const zi=p.match(/^border-l-(\d+)$/);if(zi){u.borderLeftWidth=`${zi[1]}px`,u.borderStyle="solid";continue}const ys=p.match(/^border-r-(\d+)$/);if(ys){u.borderRightWidth=`${ys[1]}px`,u.borderStyle="solid";continue}const vs=p.match(/^border-(\d+)$/);if(vs){u.borderWidth=`${vs[1]}px`,u.borderStyle="solid";continue}const bs=p.match(/^border-([\w-]+)(?:\/([\d]+))?$/);if(bs&&!p.match(/^border-[trbl]$/)){const wt=bs[1],ve=bs[2],ae=o?c[wt]:{white:"#374151","gray-100":"#374151","gray-200":"#374151","gray-300":"#4b5563","slate-100":"#334155","slate-200":"#334155","slate-300":"#475569"}[wt]||c[wt];ae&&(u.borderColor=ve?Fs(ae,parseInt(ve)/100):ae);continue}if(p==="shadow"){u.boxShadow="0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-sm"){u.boxShadow="0 1px 2px 0 rgb(0 0 0 / 0.05)";continue}if(p==="shadow-md"){u.boxShadow="0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-lg"){u.boxShadow="0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-xl"){u.boxShadow="0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)";continue}if(p==="shadow-2xl"){u.boxShadow="0 25px 50px -12px rgb(0 0 0 / 0.25)";continue}if(p==="shadow-none"){u.boxShadow="none";continue}if(p==="ring"){u.boxShadow="0 0 0 3px rgba(59, 130, 246, 0.5)";continue}if(p==="ring-0"){u.boxShadow="0 0 0 0px transparent";continue}if(p==="ring-1"){u.boxShadow="0 0 0 1px rgba(59, 130, 246, 0.5)";continue}if(p==="ring-2"){u.boxShadow="0 0 0 2px rgba(59, 130, 246, 0.5)";continue}const Ae=p.match(/^ring-([\w-]+)(?:\/([\d]+))?$/);if(Ae&&!p.match(/^ring-\d$/)){const wt=Ae[1],ve=Ae[2],It=c[wt];if(It){const ae=ve?parseInt(ve)/100:1;u.boxShadow&&u.boxShadow.includes("0 0 0")&&(u.boxShadow=u.boxShadow.replace(/rgba\([^)]+\)/,Fs(It,ae)))}continue}if(p==="backdrop-blur"){u.backdropFilter="blur(8px)";continue}if(p==="backdrop-blur-none"){u.backdropFilter="blur(0)";continue}if(p==="backdrop-blur-sm"){u.backdropFilter="blur(4px)";continue}if(p==="backdrop-blur-md"){u.backdropFilter="blur(12px)";continue}if(p==="backdrop-blur-lg"){u.backdropFilter="blur(16px)";continue}if(p==="backdrop-blur-xl"){u.backdropFilter="blur(24px)";continue}if(p==="backdrop-blur-2xl"){u.backdropFilter="blur(40px)";continue}if(p==="backdrop-blur-3xl"){u.backdropFilter="blur(64px)";continue}if(p==="blur"){u.filter="blur(8px)";continue}if(p==="blur-none"){u.filter="blur(0)";continue}if(p==="blur-sm"){u.filter="blur(4px)";continue}if(p==="blur-md"){u.filter="blur(12px)";continue}if(p==="blur-lg"){u.filter="blur(16px)";continue}if(p==="blur-xl"){u.filter="blur(24px)";continue}if(p==="blur-2xl"){u.filter="blur(40px)";continue}if(p==="blur-3xl"){u.filter="blur(64px)";continue}const un=p.match(/^scale-(\d+)$/);if(un){const wt=parseInt(un[1])/100;u.transform=`scale(${wt})`;continue}const Ea=p.match(/^scale-x-(\d+)$/);if(Ea){const wt=parseInt(Ea[1])/100;u.transform=`scaleX(${wt})`;continue}const xs=p.match(/^scale-y-(\d+)$/);if(xs){const wt=parseInt(xs[1])/100;u.transform=`scaleY(${wt})`;continue}const ws=p.match(/^rotate-(\d+)$/);if(ws){u.transform=`rotate(${ws[1]}deg)`;continue}const Fi=p.match(/^-rotate-(\d+)$/);if(Fi){u.transform=`rotate(-${Fi[1]}deg)`;continue}const _n=p.match(/^translate-x-(\d+(?:\.\d+)?)$/);if(_n){const wt=ce[_n[1]]||`${parseFloat(_n[1])*.25}rem`;u.transform=`translateX(${wt})`;continue}const tr=p.match(/^-translate-x-(\d+(?:\.\d+)?)$/);if(tr){const wt=ce[tr[1]]||`${parseFloat(tr[1])*.25}rem`;u.transform=`translateX(-${wt})`;continue}const Co=p.match(/^translate-y-(\d+(?:\.\d+)?)$/);if(Co){const wt=ce[Co[1]]||`${parseFloat(Co[1])*.25}rem`;u.transform=`translateY(${wt})`;continue}const ai=p.match(/^-translate-y-(\d+(?:\.\d+)?)$/);if(ai){const wt=ce[ai[1]]||`${parseFloat(ai[1])*.25}rem`;u.transform=`translateY(-${wt})`;continue}if(p==="translate-x-full"){u.transform="translateX(100%)";continue}if(p==="-translate-x-full"){u.transform="translateX(-100%)";continue}if(p==="translate-y-full"){u.transform="translateY(100%)";continue}if(p==="-translate-y-full"){u.transform="translateY(-100%)";continue}if(p==="translate-x-1/2"){u.transform="translateX(50%)";continue}if(p==="-translate-x-1/2"){u.transform="translateX(-50%)";continue}if(p==="translate-y-1/2"){u.transform="translateY(50%)";continue}if(p==="-translate-y-1/2"){u.transform="translateY(-50%)";continue}if(p.startsWith("animate-")||p.startsWith("divide-")||p.startsWith("group-"))continue;if(p==="leading-none"){u.lineHeight="1";continue}if(p==="leading-tight"){u.lineHeight="1.25";continue}if(p==="leading-snug"){u.lineHeight="1.375";continue}if(p==="leading-normal"){u.lineHeight="1.5";continue}if(p==="leading-relaxed"){u.lineHeight="1.625";continue}if(p==="leading-loose"){u.lineHeight="2";continue}if(p==="tracking-tighter"){u.letterSpacing="-0.05em";continue}if(p==="tracking-tight"){u.letterSpacing="-0.025em";continue}if(p==="tracking-normal"){u.letterSpacing="0em";continue}if(p==="tracking-wide"){u.letterSpacing="0.025em";continue}if(p==="tracking-wider"){u.letterSpacing="0.05em";continue}if(p==="tracking-widest"){u.letterSpacing="0.1em";continue}const On=p.match(/^tracking-\[(.+)\]$/);if(On){u.letterSpacing=On[1];continue}const ee=p.match(/^w-\[(.+)\]$/);if(ee){u.width=ee[1];continue}const qt=p.match(/^h-\[(.+)\]$/);if(qt){u.height=qt[1];continue}const mr=p.match(/^min-h-\[(.+)\]$/);if(mr){u.minHeight=mr[1];continue}const ye=p.match(/^max-w-\[(.+)\]$/);if(ye){u.maxWidth=ye[1];continue}}return f&&m&&(y?u.backgroundImage=`linear-gradient(${f}, ${m}, ${y}, ${x||m})`:x?u.backgroundImage=`linear-gradient(${f}, ${m}, ${x})`:u.backgroundImage=`linear-gradient(${f}, ${m}, transparent)`),u}function Fs(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`rgba(${n}, ${r}, ${i}, ${t})`}const vT={margin:0,padding:0,boxSizing:"border-box",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"};function iht(e){return`
130
130
  #${e} {
131
131
  isolation: isolate;
132
132
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
@@ -191,10 +191,10 @@ ${c.join(`
191
191
  font-weight: inherit;
192
192
  margin: 0;
193
193
  }
194
- `}function oht(e,t,n,r){return v.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",minHeight:"100%",backgroundColor:e.colors.background,gap:"16px"}},U("p",{style:{color:e.colors.text,fontSize:"1.125rem"}},"Scene not found"),v.createElement("div",{style:{display:"flex",gap:"12px",alignItems:"center"}},t>0&&v.createElement("button",{onClick:n,style:{padding:"0.5rem 1.5rem",borderRadius:"0.5rem",backgroundColor:e.colors.surfaceHover,color:e.colors.text,border:"none",cursor:"pointer",fontSize:"0.875rem",fontWeight:500,transition:e.effects.transition},onMouseOver:i=>i.target.style.backgroundColor=e.colors.border,onMouseOut:i=>i.target.style.backgroundColor=e.colors.surfaceHover},"← Go Back"),r&&v.createElement("button",{onClick:r,style:{display:"flex",alignItems:"center",gap:"6px",padding:"0.5rem 1.5rem",borderRadius:"0.5rem",backgroundColor:e.colors.primary,variant:"outline",color:e.colors.text,border:"none",cursor:"pointer",fontSize:"0.875rem",fontWeight:500,transition:"opacity 0.2s"},onMouseOver:i=>i.target.style.opacity="0.85",onMouseOut:i=>i.target.style.opacity="1"},v.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},U("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})),"Generate Scene")))}function sht(e){return v.createElement("div",{key:"preview-modal",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,animation:"bf-fade-in 0.15s ease"}},v.createElement("div",{style:{backgroundColor:e.colors.background,borderRadius:"12px",padding:"24px",maxWidth:"360px",width:"90%",boxShadow:"0 20px 40px rgba(0, 0, 0, 0.4)",border:"1px solid rgba(255, 255, 255, 0.08)"}},U("h3",{style:{color:e.colors.text,fontSize:"16px",fontWeight:600,marginBottom:"12px"}},"Sample Modal"),U("p",{style:{color:e.colors.textSecondary,fontSize:"14px",marginBottom:"20px"}},"This is a preview of the modal component for styling."),v.createElement("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"}},U("button",{style:{padding:"10px 20px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:500,background:"rgba(255,255,255,0.08)",color:e.colors.text,border:`1px solid ${e.colors.borderSubtle}`}},"Cancel"),U("button",{style:{padding:"10px 20px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:500,background:e.colors.primary,color:e.colors.text,border:"none"}},"Confirm"))))}function bT(e,t,n,r,i,o,s){var O,R,N,V,D,j,K,H,z,Y,G;if(!e)return null;const{definition:l,closing:c}=e,h=l.variant?(O=l.variants)==null?void 0:O[l.variant]:void 0,u={...l,...h,style:{...l.style,...h==null?void 0:h.style},components:(h==null?void 0:h.components)||l.components,actions:(h==null?void 0:h.actions)||l.actions},f=u.popover===!0,m=(R=u.style)==null?void 0:R.placement,y=m==="left"||m==="right"||m==="bottom"?m:"center",x=u.drawer===!0||y==="left"||y==="right",p=y==="bottom",b=c===!0,P=u.className||"",S=P?((N=n.parseClassNameResponsive)==null?void 0:N.call(n,P,`modal-${e.id}`))??n.parseClassName(P):{},A=f&&s&&s.top>window.innerHeight/2&&s.bottom+300>window.innerHeight,E=s?Math.min(Math.max(12,s.left),Math.max(12,window.innerWidth-372)):void 0,w=()=>{var J;b||(J=i||n.dismissModal)==null||J()},T=v.createElement("div",{key:`modal-overlay-${e.id||"base"}`,style:{position:"fixed",top:0,left:0,right:0,bottom:0,animation:b?"bf-fade-out 0.2s ease forwards":"bf-fade-in 0.15s ease",backdropFilter:f?void 0:"blur(4px)",WebkitBackdropFilter:f?void 0:"blur(4px)",display:"flex",alignItems:f?"flex-start":p?"flex-end":"center",justifyContent:f?"flex-end":x?y==="left"?"flex-start":"flex-end":"center",paddingTop:void 0,paddingRight:void 0,backgroundColor:f?"transparent":((V=u.style)==null?void 0:V.overlayColor)||"rgba(0,0,0,0.45)",pointerEvents:"auto",zIndex:o||1e4},onClick:J=>{J.target===J.currentTarget&&w()}},v.createElement("div",{className:P||void 0,style:{pointerEvents:f?"auto":void 0,...f?{position:"fixed",top:A||!s?A?void 0:"116px":`${s.bottom+8}px`,bottom:A?`${Math.max(12,window.innerHeight-s.top+8)}px`:void 0,left:E===void 0?void 0:`${E}px`,right:E===void 0?"24px":void 0}:{},backgroundColor:((D=u.style)==null?void 0:D.backgroundColor)||r||t.colors.background,borderRadius:x?"0px":((j=u.style)==null?void 0:j.borderRadius)||(p?"16px 16px 0 0":"12px"),padding:x?"0.5rem":p?"16px":"24px",height:x?"100%":"auto",maxHeight:p?"90vh":x?void 0:"85vh",maxWidth:x?"520px":p?n.isMobileView?"none":"640px":((K=u.style)==null?void 0:K.width)||{sm:"min(360px, 92vw)",md:"min(480px, 92vw)",lg:"min(720px, 92vw)",full:"90vw"}[u.size||"sm"]||"min(400px, 92vw)",width:(H=u.style)!=null&&H.width?"100%":x?"90vw":p?"100%":"90%",boxShadow:x?y==="left"?"4px 0 24px rgba(0, 0, 0, 0.4)":"-4px 0 24px rgba(0, 0, 0, 0.4)":p?"0 -8px 32px rgba(0, 0, 0, 0.45)":"0 20px 40px rgba(0, 0, 0, 0.4)",...f?{minWidth:"min(360px, 92vw)",marginRight:"0px",boxShadow:"0 12px 32px rgba(0, 0, 0, 0.45)"}:{},border:"none",borderLeft:x&&y==="right"?`1px solid ${((z=u.style)==null?void 0:z.borderColor)||"rgba(255, 255, 255, 0.08)"}`:"none",borderRight:x&&y==="left"?`1px solid ${((Y=u.style)==null?void 0:Y.borderColor)||"rgba(255, 255, 255, 0.08)"}`:"none",overflow:"auto",animation:x?b?y==="left"?"bf-slide-out-left 0.2s ease forwards":"bf-slide-out-right 0.2s ease forwards":y==="left"?"bf-slide-in-left 0.2s ease":"bf-slide-in-right 0.2s ease":p?b?"bf-slide-out-down 0.2s ease forwards":"bf-slide-in-up 0.25s ease":b?"bf-fade-out 0.2s ease forwards":void 0,...S}},p?v.createElement("div",{key:"bf-sheet-handle",style:{width:"40px",height:"4px",borderRadius:"2px",backgroundColor:"rgba(255, 255, 255, 0.2)",margin:"0 auto 12px",flexShrink:0}}):null,u.icon?v.createElement("div",{style:{textAlign:"center",marginBottom:"12px",display:"flex",justifyContent:"center"}},n.renderIcon(u.icon,32)):null,u.title?v.createElement("h3",{style:{color:t.colors.text,fontSize:u.icon?"18px":"16px",fontWeight:600,marginBottom:"12px",marginTop:"4px",paddingLeft:x?"1.5rem":"0px",paddingRight:x?"1.5rem":"0px",textAlign:u.icon?"center":"left"}},n.interpolateText(u.title)):null,...(u.components||[]).map((J,lt)=>zf(n,J,lt,"modal")),(((G=u.actions)==null?void 0:G.length)||0)>0?v.createElement("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end",marginTop:"20px"}},...(u.actions||[]).map((J,lt)=>{const nt=(ct=>{const mt=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(ct);if(!mt)return!1;const[yt,Et,Tt]=[parseInt(mt[1],16),parseInt(mt[2],16),parseInt(mt[3],16)];return(yt*299+Et*587+Tt*114)/1e3>150})(t.colors.primary)?"#000000":"#ffffff",it={primary:{background:t.colors.primary,color:nt,border:"none"},secondary:{background:"rgba(255, 255, 255, 0.08)",color:t.colors.text,border:`1px solid ${t.colors.borderSubtle}`},ghost:{background:"transparent",color:t.colors.text,border:`1px solid ${t.colors.borderSubtle}`},danger:{background:t.colors.danger,color:"#ffffff",border:"none"}},at=it[J.variant||"primary"]||it.primary;return v.createElement("button",{key:lt,onClick:()=>{if(e.legacyOnConfirm&&J.label==="Confirm"){w(),setTimeout(()=>{var ct;return(ct=e.legacyOnConfirm)==null?void 0:ct.call(e)},250);return}J.onClick&&n.handleButtonClick(J.onClick,{onSuccess:J.onSuccess,onError:J.onError}),J.dismiss&&w()},style:{padding:"10px 20px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:500,...at}},J.label)})):null));return f&&typeof document<"u"?ub.createPortal(T,document.body):T}const aht=new va,hp=()=>{try{if(typeof window<"u")return window.localStorage.getItem("backflow_dev_diagnostics")==="1"}catch{}return!1},Zg=(...e)=>{hp()&&console.log(...e)},Yg=(...e)=>{hp()&&console.warn(...e)};let Q$=null;window.addEventListener("message",e=>{var t,n,r;(((t=e.data)==null?void 0:t.type)==="auth"||((n=e.data)==null?void 0:n.type)==="auth-token")&&((r=e.data)!=null&&r.token)&&(Q$=e.data.token,localStorage.setItem("token",e.data.token),e.data.refreshToken&&localStorage.setItem("backflow_refresh_token",e.data.refreshToken),e.data.userId&&localStorage.setItem("backflow_refresh_user_id",e.data.userId))});function $f(e){try{const t=JSON.parse(atob(e.split(".")[1]));return typeof t.exp!="number"||t.exp*1e3<=Date.now()}catch{return!0}}function lht({workflow:e,sdk:t,iconResolver:n,authToken:r,nativeAction:i,onRouteExecute:o,onJobProgress:s,appName:l,appIcon:c,selectedComponentKey:h,selectedComponentClass:u,styleOverrides:f,interactionDisabled:m,theme:y,imageReplacements:x,currentSceneId:p,onSceneChange:b,onGenerateScene:P,enableRouting:S,routingMode:A,previewElement:E,tenantId:w,appId:T,renderPhaserGame:O,renderMode:R,apiUrl:N,workflowBaseUrl:V,initialScene:D,previewMode:j,remoteSessionId:K,devDiagnostics:H}){var Vh,Rs,Uh,Cc,Hh,No,qh,Xi,Oc,Mc,Gh,Mr,kc,$c,jo,Zh;const z=(()=>{const M=Q$||localStorage.getItem("token");return!!M&&!$f(M)})(),[Y,G]=v.useState(!z),[J,lt]=v.useState(null),q=v.useMemo(()=>Array.isArray(e==null?void 0:e.steps)?e.steps:[],[e]),nt=v.useMemo(()=>{const M=q;return e&&!Array.isArray(e.steps)&&(Yg("[WorkflowRenderer] NON-ARRAY steps:",typeof e.steps,JSON.stringify(e.steps).slice(0,500)),Yg("[WorkflowRenderer] Workflow keys:",Object.keys(e))),Y!==!0?M:M.filter($=>{var I,Z;return!($.requiresAuth===!0||((I=$.config)==null?void 0:I.requireAuth)===!0||((Z=$.config)==null?void 0:Z.requiresAuth)===!0)})},[e,Y,q]),it=v.useCallback(M=>{var I;const $=q.find(Z=>Z.id===M);return((I=$==null?void 0:$.config)==null?void 0:I.requireAuth)===!0||($==null?void 0:$.requiresAuth)===!0},[q]),at=e&&!((Vh=e.config)!=null&&Vh.colorMode)?dI(e):void 0,ct=jT(at?{...(e==null?void 0:e.config)||{},colorMode:at}:e==null?void 0:e.config,void 0,y),mt=!((Rs=e==null?void 0:e.config)!=null&&Rs.colorMode)&&!at&&!(y!=null&&y.colorMode),yt=M=>Sx(M,{primary:le.colors.primary,accent:le.colors.accent,colorMode:le.colorMode},mt),Et=R||"legacy",Tt=A||(S?"hash":"memory"),ht=Tt!=="memory",[ft,Ct]=v.useState(z),[rt,Rt]=v.useState(!1),[bt,de]=v.useState(!1),{sceneToRoute:ne,routeToScene:Gt}=v.useMemo(()=>X$(nt),[nt]),Le=v.useMemo(()=>{var $,I;if(D&&nt.some(Z=>Z.id===D))return D;const M=nt.filter(Z=>Z.type==="render_scene");return(($=M.find(Z=>Z.route==="/"))==null?void 0:$.id)||((I=M[0])==null?void 0:I.id)||""},[nt,D]),Bt=v.useMemo(()=>{if(ht){const M=Tt==="hash"?lb(Gt):yT(Gt);if(M)return M}return Le},[Le,ht,Tt,Gt]),[Qt,te]=v.useState([]),[Ht,re]=v.useState(Bt),Ce=v.useRef(null),ie=_C(Ce),on=v.useRef(!1);v.useRef(null);const tn=v.useRef(!1),Ke=v.useRef(!1),_o=v.useRef(0),cn=v.useRef(null);v.useEffect(()=>(tn.current=!1,NT(),()=>{tn.current=!0}),[]),v.useEffect(()=>{r&&localStorage.setItem("token",r)},[r]);const Ot=p??Ht;v.useEffect(()=>{var tt,X,st;const M=nt.find(gt=>gt.id===Ot),$=!!((tt=e==null?void 0:e.config)!=null&&tt.remoteControl)&&!!(M!=null&&M.remoteScene);if(TT($),ET($&&!!((st=(X=e==null?void 0:e.config)==null?void 0:X.mouse)!=null&&st.enabled)),!$||!K){Jg();return}const I=N||(t==null?void 0:t.endpoint),Z=I&&/^https?:\/\//.test(I)?I:window.location.origin,B=new URL("/ws",Z);B.protocol=B.protocol==="https:"?"wss:":"ws:";const F=B.toString(),Q=`agent:${w||"default"}:${K}`;return LT(F,Q,r||localStorage.getItem("token")||void 0),()=>Jg()},[(Uh=e==null?void 0:e.config)==null?void 0:Uh.remoteControl,(Hh=(Cc=e==null?void 0:e.config)==null?void 0:Cc.mouse)==null?void 0:Hh.enabled,nt,Ot,K,w,N,t,r]);const Dn=v.useCallback(M=>{re(M),b==null||b(M)},[b]);v.useEffect(()=>{var I;const M=nt.find(Z=>Z.id===Ot),$=((I=M==null?void 0:M.config)==null?void 0:I.requireAuth)===!0||(M==null?void 0:M.requiresAuth)===!0;Ot&&!$&&Rt(!1)},[Ot,nt]);const Fe=(e==null?void 0:e.modals)||{};v.useEffect(()=>{if(!ft)return;const M=le.startupModal;!M||!Fe[M]||localStorage.getItem(`backflow_startup_modal_${M}`)||un({id:M,definition:Fe[M]})},[ft]);const Ci=v.useRef(typeof window>"u"?null:new URLSearchParams(window.location.search).get("customer_session_token"));v.useEffect(()=>{if(!ft||!Ci.current||!Fe["payment-success"])return;window.history.replaceState({},"",window.location.pathname);const $=setTimeout(()=>{Fe["payment-success"]&&un({id:"payment-success",definition:Fe["payment-success"]})},400);return()=>clearTimeout($)},[ft,Fe["payment-success"]]),v.useEffect(()=>{Y===!0&&(!Ot||nt.some(M=>M.id===Ot)||Le&&Dn(Le))},[Y,nt,Ot,Le]),v.useEffect(()=>{if(ht){if(on.current){on.current=!1;return}Tt==="hash"?Ff(Ot,ne,!1):Gg(Ot,ne,!1)}},[Ot,ht,Tt,ne]),v.useEffect(()=>{ht&&(Tt==="hash"?Ff(Ot,ne,!0):Gg(Ot,ne,!0))},[]);const So=v.useRef(!0);v.useEffect(()=>{const M=setTimeout(()=>{So.current=!1},1500);return()=>clearTimeout(M)},[]),v.useEffect(()=>{if(!ht)return;const M=$=>{var Z;if(So.current)return;const I=((Z=$.state)==null?void 0:Z.sceneId)||(Tt==="hash"?lb(Gt):yT(Gt));I&&I!==Ot&&(on.current=!0,Dn(I),te(B=>B.length>0&&B[B.length-1]===I?B.slice(0,-1):B))};return window.addEventListener("popstate",M),()=>window.removeEventListener("popstate",M)},[ht,Tt,Gt,Ot,Dn]),v.useEffect(()=>{var $;const M=(($=nt.find(I=>I.type==="render_scene"))==null?void 0:$.id)||"";if(M&&M!==Ot){if(re(M),te([]),b==null||b(M),!ht)return;Tt==="hash"?Ff(M,ne,!0):Gg(M,ne,!0)}},[e]),v.useEffect(()=>{p&&p!==Ht&&re(p)},[p]);const Po=v.useCallback(()=>{if(ht){window.history.back();return}if(Qt.length>0){const M=Qt[Qt.length-1];te($=>$.slice(0,-1)),Dn(M)}},[Qt,ht]),[he,se]=v.useState({}),ii=v.useRef(he);v.useEffect(()=>{ii.current=he},[he]),v.useEffect(()=>{K&&se(M=>M.remoteSessionId===K?M:{...M,remoteSessionId:K})},[K]);const Oi=v.useMemo(()=>Array.isArray(e==null?void 0:e.workflowRefs)?e.workflowRefs:[],[e]),Pr=v.useMemo(()=>Oi.filter(M=>M.sceneIds==="*"||Array.isArray(M.sceneIds)&&M.sceneIds.includes(Ot)),[Ot,Oi]),[Mi,ms]=v.useState({}),ki=v.useRef({}),oi=v.useCallback(async(M,$=!1)=>{if(!ft||!M.appId)return;const I=N||(t==null?void 0:t.endpoint)||window.location.origin,Z=!N&&typeof I=="string"&&I.startsWith("/")?I.replace(/\/+$/,""):"",B=/^https?:\/\//.test(I)?I:window.location.origin,F=`${Z}/mobile/apps/${encodeURIComponent(M.appId)}/workflow`,Q=await fetch(new URL(F,B).toString(),{cache:$?"no-cache":"default",headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`}});if(!Q.ok)throw new Error(`Workflow reference ${M.id} failed`);const tt=await Q.json(),X=(tt==null?void 0:tt.app)||tt;if(!Array.isArray(X==null?void 0:X.steps))throw new Error(`Workflow reference ${M.id} is invalid`);ms(st=>({...st,[M.id]:X}))},[N,r,ft,t]);v.useEffect(()=>{let M=!1;for(const $ of Pr){const I=`${$.appId}:${$.sourceSceneId||""}`;ki.current[$.id]!==I&&(ki.current[$.id]=I,oi($).catch(()=>{M||delete ki.current[$.id]}))}return()=>{M=!0}},[Pr,oi]),v.useEffect(()=>{var Z;const M=Pr.filter(B=>{var F;return((F=B.realtime)==null?void 0:F.mode)==="ws"});if(M.length===0||!w)return;const $=(Z=t==null?void 0:t.client)==null?void 0:Z.createWebSocket;if(!$)return;const I=$(`tenant:${w}:entities`);return I.onmessage=B=>{let F;try{F=JSON.parse(B.data)}catch{return}if(!(F.type!=="entity_changed"||F.entity!=="mobile_apps"))for(const Q of M)F.id===Q.appId&&oi(Q,!0).catch(()=>{})},()=>I.close()},[Pr,oi,w,t]);const[$i,Wr]=v.useState({}),Ao=v.useRef(new Set),[Ii,Ri]=v.useState({}),[Ar,Li]=v.useState({}),[Ni,En]=v.useState({}),[$t,To]=v.useState({}),[Cn,ji]=v.useState({}),[Eo,si]=v.useState([]),Di=v.useRef(new Set),pr=v.useRef(new Map),Bi=v.useCallback((M,$)=>{if(!(H??hp()))return;const I=`${M}:${$}`;Di.current.has(I)||(Di.current.add(I),si(Z=>[...Z,{level:"warn",code:M,where:`runtime:${Ot}`,msg:$}]))},[Ot,H]),gs=v.useCallback((M,$)=>{if(!(H??hp()))return;const I=Date.now(),Z=(pr.current.get(M)||[]).filter(Q=>I-Q.at<2e3),B=Z.find(Q=>Q.componentKey!==$&&I-Q.at<500);Z.push({componentKey:$,at:I}),pr.current.set(M,Z),B&&Bi("DATASOURCE_DUPLICATE_RUNTIME",`"${M}" fetched by ${B.componentKey} and ${$} within 500ms`);const F=Z.filter(Q=>Q.componentKey===$);F.length>=3&&Bi("RENDER_FETCH_LOOP",`"${M}" fetched ${F.length} times by ${$} within 2s`)},[H,Bi]);v.useEffect(()=>{Di.current.clear(),pr.current.clear(),si([])},[Ot]);const Gn=v.useRef(new Map),zi=v.useRef(new Map),ys=v.useRef(new Set),[vs,bs]=v.useState(!1),[Ae,un]=v.useState(null),[Ea,xs]=v.useState(null),ws=v.useRef(null);v.useEffect(()=>{var $;if(!(($=Ae==null?void 0:Ae.definition)!=null&&$.popover))return;const M=()=>{const I=ws.current;I&&xs(I.getBoundingClientRect())};return window.addEventListener("scroll",M,!0),window.addEventListener("resize",M),M(),()=>{window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[Ae==null?void 0:Ae.id,(No=Ae==null?void 0:Ae.definition)==null?void 0:No.popover]);const Fi=v.useCallback(()=>{un(M=>M?{...M,closing:!0}:null),setTimeout(()=>un(null),250)},[]),[_n,tr]=v.useState(null),Co=v.useCallback(()=>{tr(M=>M?{...M,closing:!0}:null),setTimeout(()=>tr(null),250)},[]),ai=ie>0&&ie<Eu.md;v.useEffect(()=>{e&&typeof e=="object"&&(e.auth={signedIn:ft})},[e,ft]),v.useEffect(()=>{const M=e;if(!(M!=null&&M.config))return;if(c){M.config.logo=c,se(I=>I&&{...I});return}if(!V)return;let $=!1;return(async()=>{for(const I of["svg","png","jpg","jpeg"]){const Z=`${V}logo.${I}`;try{if((await fetch(Z,{method:"HEAD"})).ok&&!$){M.config.logo=Z,se(F=>F&&{...F});return}}catch{}}})(),()=>{$=!0}},[e,V,c]);const[On,ee]=v.useState("login"),[qt,mr]=v.useState(""),[ye,wt]=v.useState(""),[ve,It]=v.useState(""),[ae,_s]=v.useState({}),[Wi,Mn]=v.useState(""),[li,hn]=v.useState(null),[qe,ke]=v.useState(!1),[Te,Ss]=v.useState({}),Vr=M=>M?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(M)?null:"Invalid email address":null,Vi=M=>M?M.length>=6?null:"Password must be at least 6 characters":null,Ps=(M,$)=>$?$===M?null:"Passwords do not match":null,Tr=(M,$)=>Ss(I=>({...I,[M]:$||""})),Oo=M=>{var $,I;return M?typeof M=="string"?M:Array.isArray(M)?(($=M[0])==null?void 0:$.message)||"Validation failed":typeof M.message=="string"?M.message:typeof M.error=="string"?M.error:(I=M.error)!=null&&I.message?M.error.message:"An error occurred":"An error occurred"},Ui=(he==null?void 0:he._colorMode)||ct.colorMode,mc=Ui==="dark"?xu:wu,le=Ui!==ct.colorMode?{...ct,colorMode:Ui,colors:{...mc,...ct.colors&&Ui==="dark"?ct.colors:{}}}:ct;v.useEffect(()=>{typeof document>"u"||document.documentElement.setAttribute("data-theme",le.colorMode==="dark"?"dark":"light")},[le.colorMode]);const As=v.useCallback(M=>{try{localStorage.setItem("bf_theme",M)}catch{}se($=>({...$,_colorMode:M}))},[]);v.useEffect(()=>{if(typeof localStorage>"u")return;const M=localStorage.getItem("bf_theme");(M==="dark"||M==="light")&&se($=>({...$,_colorMode:M}))},[]),v.useEffect(()=>{const M=localStorage.getItem("token"),$=!!M&&!$f(M);$?(Ke.current=!1,G(!1)):G(!0),Ct($);const I=()=>{const F=localStorage.getItem("token"),Q=!!F&&!$f(F);Q?(Ke.current=!1,G(!1)):G(!0),Ct(Q)};window.addEventListener("storage",I);const Z=F=>{var Q,tt,X;if((((Q=F.data)==null?void 0:Q.type)==="auth"||((tt=F.data)==null?void 0:tt.type)==="auth-token")&&((X=F.data)!=null&&X.token)){if(localStorage.setItem("token",F.data.token),F.data.refreshToken&&localStorage.setItem("backflow_refresh_token",F.data.refreshToken),F.data.userId&&localStorage.setItem("backflow_refresh_user_id",F.data.userId),$f(F.data.token)){Ke.current=!0,Ct(!1);return}if(!ft&&(rt||Ke.current||!!cn.current)){window.location.reload();return}Ct(!0),Rt(!1),G(!1),Ke.current=!1}};window.addEventListener("message",Z);const B=()=>{var F;if(!Ke.current){const Q=nt.find(X=>X.id===Ot);if(!(((F=Q==null?void 0:Q.config)==null?void 0:F.requireAuth)===!0||(Q==null?void 0:Q.requiresAuth)===!0))return;Ke.current=!0,Ct(!1),Rt(!0)}};return window.addEventListener("auth:required",B),()=>{window.removeEventListener("storage",I),window.removeEventListener("message",Z),window.removeEventListener("auth:required",B)}},[]);const Eh=async()=>{var I;const M=localStorage.getItem("backflow_refresh_token"),$=localStorage.getItem("backflow_refresh_user_id");if(!M||!$)return!1;try{const B=await(await fetch(`${window.location.origin}/api/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:M,userId:$})})).json();if(B.success&&((I=B.data)!=null&&I.token))return B.data.refreshToken&&localStorage.setItem("backflow_refresh_token",B.data.refreshToken),localStorage.setItem("token",B.data.token),!0}catch{}return localStorage.removeItem("backflow_refresh_token"),localStorage.removeItem("backflow_refresh_user_id"),!1},Mo=async(M,$=!1)=>{var I;if(M.status===401&&!rt){if(await Eh())return!1;if(Zg("[bf] 401 intercepted, showAuth:",rt,"authInterceptedRef:",Ke.current),!Ke.current){Ke.current=!0,localStorage.removeItem("token"),Ct(!1);const B=nt.find(Q=>Q.id===Ot),F=((I=B==null?void 0:B.config)==null?void 0:I.requireAuth)===!0||(B==null?void 0:B.requiresAuth)===!0;($||F)&&(Rt(!0),Ot&&(cn.current=Ot))}return!0}return!1},xm=Ot&&nt.some(M=>M.id===Ot)?Ot:(qh=nt[0])==null?void 0:qh.id,Dt=nt.find(M=>M.id===xm),pe=(Dt==null?void 0:Dt.type)==="render_scene"?Dt.config:null;v.useEffect(()=>{if(!pe)return;const M=w||"default",$={TENANT_ID:M,tenantId:M,role:"user"};se(I=>{const Z={};for(const B of Object.keys(I))B.startsWith("_")&&(Z[B]=I[B]);return{...$,...pe.sceneData||{},...Z}})},[Ot,pe]),v.useEffect(()=>{const M=le.persistedKeys;if(!M||M.length===0)return;const $={};for(const I of M){const Z=localStorage.getItem(`bf_persist_${I}`);Z&&($[I]=Z)}Object.keys($).length>0&&se(I=>({...I,...$}))},[Ot]),v.useEffect(()=>{const M=le.persistedKeys;if(!(!M||M.length===0))for(const $ of M){const I=he[$];I&&localStorage.setItem(`bf_persist_${$}`,String(I))}});const Ee=M=>{const $=M.match(/^(GET|POST|PATCH|DELETE|PUT)\s+(.+)/);return{method:$?$[1]:"POST",path:$?$[2]:M}},gc=M=>{const $={...M};return delete $.TENANT_ID,delete $.tenantId,delete $.role,$},Ur=v.useCallback(async M=>{var Z,B,F;if(!M.action)return;const $=String(M.action),I=ii.current;try{if($.startsWith("execute_workflow:")){if(!ft)return;const{method:Q,path:tt}=Ee($.replace("execute_workflow:","")),X=tt.replace(/:(\w+)/g,(At,a)=>{const d=I[a];return d===void 0?At:String(d)}).replace(/\{\{(\w+)\}\}/g,(At,a)=>{const d=I[a];return d===void 0?At:String(d)}),st=er(),gt=Q!=="GET"&&Q!=="DELETE";Q!=="GET"&&Ch(Q,X,I,!0);const vt=await fetch(new URL(X,st).toString(),{method:Q,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},...gt?{body:JSON.stringify(gc(I))}:{}});if(tn.current||await Mo(vt)||tn.current)return;if(!vt.ok)throw Zt(X),new Error(`Route failed: ${vt.statusText}`);const pt=await vt.json();if(tn.current)return;if(pt&&typeof pt=="object"&&!Array.isArray(pt)&&se(At=>({...At,feedback:pt})),((Z=M.onSuccess)==null?void 0:Z.type)==="toast"&&M.onSuccess.value)$e(M.onSuccess.value,"success");else if(((B=M.onSuccess)==null?void 0:B.type)==="navigate"&&M.onSuccess.value){const At=M.onSuccess.value;if(it(At)&&!ft){cn.current=At,Rt(!0);return}te(d=>[...d,Ot]),Dn(At)}pt!=null&&pt.data&&se(At=>({...At,...pt.data})),pt!=null&&pt.user&&typeof pt.user=="object"&&se(At=>({...At,user:pt.user})),sn.current[X.replace(/^\//,"")]={response:pt},se(At=>({...At}))}else if($.startsWith("navigate:")){const Q=$.replace("navigate:","");if(it(Q)&&!ft){cn.current=Q,Rt(!0);return}te(X=>[...X,Ot]),Dn(Q)}else if($.startsWith("go_to_step:")){const Q=$.replace("go_to_step:","").split("?")[0].trim();if(it(Q)&&!ft){cn.current=Q,Rt(!0);return}te(X=>[...X,Ot]),Dn(Q)}else if($.startsWith("show_toast:")){const Q=$.replace("show_toast:","");Q&&$e(Q,"success")}else if($.startsWith("show_modal:")){const Q=$.replace("show_modal:","");if(Fe[Q]){const tt=Fe[Q],X=tt.clearFormKeys;se(st=>{const gt={...st};let vt=Array.isArray(X)&&X.length>0;if(vt)for(const pt of X)delete gt[pt];for(const pt of Object.keys(gt))pt.startsWith("__acc_")&&(delete gt[pt],vt=!0);return vt?gt:st}),tt.preload&&await qi(String(tt.preload)),un({id:Q,definition:tt})}else{const tt=Q.split("|");un({id:"__legacy",definition:{title:tt[0]||"Notice",components:tt[1]?[{type:"text",text:tt[1],color:le.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.7)",fontSize:14}]:[],actions:[{label:"OK",variant:"primary",dismiss:!0}]}})}}else if($.startsWith("toast:")){const Q=$.replace("toast:","");$e(Q,"success")}}catch(Q){if(Q instanceof $o&&xc(Q,M==null?void 0:M.onError))return;(F=M.onError)!=null&&F.message&&$e(M.onError.message,"error")}},[Ot,nt,ft]),Ca=v.useRef(null),Oa=v.useRef(null);v.useEffect(()=>{const M=Oa.current;Oa.current=Ot;const $=pe==null?void 0:pe.events,I=Array.isArray($==null?void 0:$.onLoad)?$.onLoad:$!=null&&$.onLoad?[$.onLoad]:[];I.length!==0&&M!==Ot&&I.forEach(Z=>Ur(Z))},[Ot,pe==null?void 0:pe.events,Ur]),v.useEffect(()=>{var $,I;const M=Ca.current;if(Ca.current=Ot,M&&M!==Ot){const Z=nt.find(F=>F.id===M),B=(Z==null?void 0:Z.type)==="render_scene"?Z.config:null;(I=($=B==null?void 0:B.events)==null?void 0:$.onLeave)!=null&&I.action&&Ur(B.events.onLeave)}},[Ot,nt,Ur]),v.useEffect(()=>{const M=pe==null?void 0:pe.events;if(!(M!=null&&M.onVisibilityChange))return;const $=()=>{var I,Z,B,F;document.hidden?(Z=(I=M.onVisibilityChange)==null?void 0:I.onHidden)!=null&&Z.action&&Ur(M.onVisibilityChange.onHidden):(F=(B=M.onVisibilityChange)==null?void 0:B.onVisible)!=null&&F.action&&Ur(M.onVisibilityChange.onVisible)};return document.addEventListener("visibilitychange",$),()=>document.removeEventListener("visibilitychange",$)},[Ot,pe==null?void 0:pe.events,Ur]);const Hi=v.useCallback(async(M,$)=>{En(I=>({...I,[M]:!0}));try{await $()}finally{En(I=>({...I,[M]:!1}))}},[]),ci=v.useRef({}),ko=v.useRef(new Map),en=v.useRef(new Set),ui=v.useRef(new Set),Hr=v.useRef(null),Ma=v.useRef([]),Ts=v.useRef({}),kn=v.useCallback(async(M,$,I=0,Z=10,B,F,Q,tt=!1)=>{var vt;if(!M||Ke.current||!ft)return;const X=`${$}|${M}|${I}|${tt}`,st=ko.current.get(X)||0;if(Date.now()-st<1e3)return;ko.current.set(X,Date.now()),ci.current[$]=M;const gt=M.match(/^\{\{\s*\[([\w/.-]+)\](?:\.([\w.]+))?\s*\}\}$/);if(gt){const pt=Gr(`${gt[1]}${gt[2]?"."+gt[2]:""}`);if(Array.isArray(pt))return Wr(At=>({...At,[$]:pt})),sn.current[$]=pt,sn.current[M]=pt,ji(At=>({...At,[$]:{page:I,limit:Z,total:pt.length,hasMore:(I+1)*Z<pt.length}})),pt}Ao.current.has($)||Li(pt=>({...pt,[$]:!0}));try{let pt=[],At=0,a;const d=ii.current;if(gs(M,$),vu(M)&&t){const g=bc(M,{limit:Z,page:I}),_=B?wm(g,B,F):g,C=nu(_),k=await Wf(t,C,d);a=k,pt=(k==null?void 0:k.emails)||(k==null?void 0:k.items)||(k==null?void 0:k.data)||(k==null?void 0:k.history)||(Array.isArray(k)?k:[]),At=((vt=k==null?void 0:k.pagination)==null?void 0:vt.total)??(k==null?void 0:k.count)??pt.length}else if(!vu(M)){const g=t==null?void 0:t.endpoint,_=N||(g&&/^https?:\/\//.test(g)?g:window.location.origin);let C=M;!N&&g&&!/^https?:\/\//.test(g)&&typeof g=="string"&&(C=`${g.replace(/\/+$/,"")}${M.startsWith("/")?M:`/${M}`}`),Zg("[fetchListData] apiUrl=%s baseUrl=%s dataSource=%s origin=%s",N,_,M,window.location.origin);const k=new URL(C,_);k.searchParams.set("limit",String(Z)),k.searchParams.set("offset",String(I*Z)),B&&(k.searchParams.set("sort",B),k.searchParams.set("dir",F||"asc"));const W=await fetch(k.toString(),{headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`}});if(await Mo(W)||tn.current)return;let et=null;try{et=await W.json()}catch{}if(!W.ok){const ot=typeof(et==null?void 0:et.message)=="string"&&et.message||typeof(et==null?void 0:et.error)=="string"&&et.error||`Request failed: ${W.statusText}`;throw new $o([ot],et||void 0)}if(a=et,tn.current)return;pt=Array.isArray(et)?et:Array.isArray(et.data)?et.data:Array.isArray(et.items)?et.items:[],At=et.count??et.total??pt.length}if(Wr(g=>{if(tt&&Array.isArray(g[$])){const _=new Set(g[$].map(k=>k==null?void 0:k.id)),C=[...g[$],...pt.filter(k=>!_.has(k==null?void 0:k.id))];return{...g,[$]:C}}return{...g,[$]:pt}}),Ao.current.add($),sn.current[$]=pt,M&&(sn.current[M]=pt),Q&&(sn.current[Q]={items:pt,response:a},M)){const g=Ts.current[Q];g&&g!==M&&Yg(`[renderer] duplicate list key "${Q}" used for both ${g} and ${M}`),Ts.current[Q]=M}{const g=String(M||"").replace(/^\//,"").split("?")[0];g&&(sn.current[g]={response:a})}return ji(g=>({...g,[$]:{page:I,limit:Z,total:At,hasMore:(I+1)*Z<At}})),pt}catch(pt){if(pt instanceof $o&&xc(pt))return;Wr(At=>{const a=At[$];return Array.isArray(a)&&a.length>0?At:{...At,[$]:[]}})}finally{Li(pt=>({...pt,[$]:!1}))}},[t,ft,gs]),er=()=>{const M=N||(t==null?void 0:t.endpoint);return M&&/^https?:\/\//.test(M)?M:M!=null&&M.startsWith("/")?`${window.location.origin}${M}`:window.location.origin},yc=v.useRef(null);v.useEffect(()=>{var B;if(!ft)return;const M=r||localStorage.getItem("token");if(!M){G(!0);return}const $=((e==null?void 0:e.steps)||[]).find(F=>F.id===Ot);if(!(((B=$==null?void 0:$.config)==null?void 0:B.requireAuth)===!0||($==null?void 0:$.requiresAuth)===!0||rt)||yc.current===M)return;let Z=!1;return(async()=>{var F;try{const Q=await fetch(`${er()}/admin/users/me`,{headers:{Authorization:`Bearer ${M}`}});if(Z)return;if(Q.ok){const tt=await Q.json().catch(()=>null);yc.current=M,G(!1),lt(typeof((F=tt==null?void 0:tt.user)==null?void 0:F.emailVerified)=="boolean"?tt.user.emailVerified:null)}else Ot&&(cn.current=Ot),yc.current=null,G(!0),Ct(!1),lt(null)}catch{Z||(Ot&&(cn.current=Ot),G(!0))}})(),()=>{Z=!0}},[ft,Ot,e==null?void 0:e.steps]);const vc=v.useCallback((M,$,I)=>{!M||$.length===0||Wr(Z=>{const B={...Z};for(const[F,Q]of Object.entries(ci.current)){if(Q!==M||!Z[F])continue;const tt=Z[F];I==="remove"&&(B[F]=tt.filter(X=>!$.includes(X.id)))}return B})},[]),Zt=v.useCallback((M,$)=>{var Q,tt;const I=new Map;for(const[X,st]of Object.entries(Ts.current))I.set(st,X);const Z=new Map;for(const[X,st]of Object.entries(ci.current))Z.set(X,{ds:st,dataKey:I.get(st)});for(const[X,st]of Object.entries(Ts.current))Object.values(ci.current).includes(st)||Z.set(X,{ds:st,dataKey:X});if(Z.size===0)return;const B=Array.isArray($)?new Set($):void 0,F=(X,st)=>en.current.has(X)||(st?en.current.has(st):!1);for(const[X,{ds:st,dataKey:gt}]of Z){if(!F(X,gt))continue;const vt=!!(B!=null&&B.has(X)||gt&&(B!=null&&B.has(gt)));if($==="view"||vt){kn(st,X,0,((Q=Cn[X])==null?void 0:Q.limit)||10,void 0,void 0,gt);continue}const pt=st==null?void 0:st.split("?")[0];pt&&M.startsWith(pt)&&kn(st,X,0,((tt=Cn[X])==null?void 0:tt.limit)||10,void 0,void 0,gt)}},[kn,Cn]),Ch=v.useCallback((M,$,I,Z)=>{const B=String(M||"").toUpperCase();if(B==="GET"||Z===!1)return;const F=Z==="remove"||Z==="merge"||Z==="add"||Z==="refresh"?Z:B==="DELETE"?"remove":B==="PUT"||B==="PATCH"?"merge":B==="POST"?"add":null;if(!F||F==="refresh")return;const Q=()=>{const X=String($).match(/\/([^/]+)\/?$/);return X?decodeURIComponent(X[1]):void 0},tt=[];for(const[X,st]of Object.entries(ci.current))st&&$.startsWith(st)&&tt.push({key:X,ds:st});tt.length!==0&&Wr(X=>{const st={...X};for(const{key:gt,ds:vt}of tt){const pt=X[gt]||[];if(F==="remove"){const At=(I==null?void 0:I.id)||Q();st[gt]=pt.filter(a=>a.id!==At)}else if(F==="merge"){const At=(I==null?void 0:I.id)||Q();st[gt]=pt.map(a=>a.id===At?{...a,...I}:a)}else{const At={...I||{},id:(I==null?void 0:I.id)||`temp_${Date.now()}`};F==="add"&&At.status===void 0&&(At.status="queued"),st[gt]=[At,...pt]}}return st})},[]),Bn=v.useCallback((M,$,I,Z)=>{var X;const B=er();let F=!1;const Q=st=>{F||(F=!0,st())},tt=t==null?void 0:t.queues;if(M==="sse"&&(tt!=null&&tt.subscribe))try{const st=Z.sseUrl||`${B}/queues/bulk-operations/jobs/${$}/subscribe?token=${encodeURIComponent(I)}`,gt=((t==null?void 0:t.endpoint)||B).replace(/\/$/,""),vt=st.startsWith(gt)?st.slice(gt.length):st;tt.subscribe(vt,{onComplete:pt=>Q(()=>Z.onComplete(pt)),onFailed:pt=>Q(()=>Z.onFailed({message:pt||"Subscription failed",kind:"transport"})),onError:()=>Q(()=>Z.onFailed({message:"Stream error",kind:"transport"})),onConnected:()=>{},onProgress:pt=>{var At;return(At=Z.onProgress)==null?void 0:At.call(Z,pt)}}),setTimeout(()=>Q(()=>Z.onFailed({message:"Timed out",kind:"transport"})),3e4);return}catch{}if(M==="ws"&&((X=t==null?void 0:t.client)!=null&&X.createWebSocket))try{const st=t.client.createWebSocket(`job:${$}`);st.onmessage=gt=>{try{const vt=JSON.parse(gt.data);(vt==null?void 0:vt.type)==="completed"?Q(()=>Z.onComplete(vt.result)):(vt==null?void 0:vt.type)==="failed"&&Q(()=>Z.onFailed({message:vt.error||"Job failed",kind:"job"}))}catch{}},st.onerror=()=>Q(()=>Z.onFailed({message:"Connection error",kind:"transport"})),setTimeout(()=>Q(()=>Z.onFailed({message:"Timed out",kind:"transport"})),3e4);return}catch{}if(M==="poll"&&(tt!=null&&tt.getJob)){const st=window.setInterval(async()=>{var gt;try{const vt=await tt.getJob("bulk-operations",$),pt=(vt==null?void 0:vt.status)||((gt=vt==null?void 0:vt.job)==null?void 0:gt.status),At=(vt==null?void 0:vt.result)||(vt==null?void 0:vt.data);pt==="failed"||At!=null&&At.final?(window.clearInterval(st),Q(()=>pt==="failed"?Z.onFailed({message:(At==null?void 0:At.error)||"Job failed",kind:"job"}):Z.onComplete(At))):pt==="completed"&&(window.clearInterval(st),Q(()=>Z.onComplete(At)))}catch{}},600);setTimeout(()=>{window.clearInterval(st),Q(()=>Z.onFailed({message:"Timed out",kind:"transport"}))},3e4);return}Q(()=>Z.onFailed({message:"Feedback transport unavailable",kind:"transport"}))},[]),Es=v.useCallback(async(M,$,I)=>{var gt,vt;const Z=t==null?void 0:t.files,B=encodeURIComponent(r||localStorage.getItem("token")||"");if(Z!=null&&Z.upload){const pt=await Z.upload(M,$||{},I),At=(pt==null?void 0:pt.url)||(pt==null?void 0:pt.path)||"";return At?(pt==null?void 0:pt.visibility)==="public"?At:`${er()}${At}?token=${B}`:""}const F=new FormData;F.append("file",M),$!=null&&$.entityType&&F.append("entityType",$.entityType),$!=null&&$.entityId&&F.append("entityId",$.entityId),$!=null&&$.visibility&&F.append("visibility",$.visibility);const Q=await fetch(`${er()}/files/upload`,{method:"POST",headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},body:F});if(!Q.ok)throw new Error("Upload failed");const tt=await Q.json(),X=((gt=tt==null?void 0:tt.asset)==null?void 0:gt.url)||(tt==null?void 0:tt.url)||(tt==null?void 0:tt.path)||(tt==null?void 0:tt.id)||"";return X?((vt=tt==null?void 0:tt.asset)==null?void 0:vt.visibility)==="public"?X:`${er()}${X}?token=${B}`:""},[]),Oh=v.useCallback(async(M,$,I,Z)=>{var Q;if(!(M!=null&&M.endpoint)||Z.length===0)return;const B=M.endpoint,F=M.optimistic??!0;try{const tt=await fetch(er()+B,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},body:JSON.stringify({ids:Z})});let X={};try{X=await tt.json()}catch{}if(!tt.ok){$e(((Q=X==null?void 0:X.error)==null?void 0:Q.message)||"Request failed","error");return}F!==!1&&(F==="remove"||F==="refresh"?F:X.softUpdate||(M.action==="delete"?"remove":"refresh"))==="remove"&&vc($,Z,"remove"),se(gt=>({...gt,_selIds:[],_selectMode:!1}));const st=(gt,vt,pt)=>{var At;if(gt)$e(pt||"Bulk operation failed","error");else{const a=vt||{},d=a.total??Z.length,g=a.successful??d;$e(g>=d?`${g} ${M.action}d`:`${g} of ${d} ${M.action}d`,"success")}kn($,I,0,((At=Cn[I])==null?void 0:At.limit)||10)};X.jobId&&X.token&&M.feedback?Bn(M.feedback,X.jobId,X.token,{onComplete:gt=>st(!1,gt),onFailed:gt=>{var vt;if(gt.kind==="transport"){kn($,I,0,((vt=Cn[I])==null?void 0:vt.limit)||10);return}st(!0,null,gt.message)}}):st(!1,X)}catch{$e("Request failed","error")}},[vc,Bn,kn,Cn]),wm=(M,$,I)=>{const Z=nu(M),B=Z.indexOf("(");if(B===-1)return M;const F=Z.slice(B+1,-1).trim(),Q=`sort: "${$}", dir: ${I==="desc"?'"desc"':'"asc"'}`;if(!F)return M.replace(/\(\)$/,`({${Q}})`);const tt=F.lastIndexOf(",");if(tt===-1)return M.replace(/\(([^)]*)\)$/,`(${F}, {${Q}})`);const X=F.slice(tt+1).trim();return X.startsWith("{")?M.replace(/\(([^)]*)\)$/,`(${F.slice(0,tt)}, {${X.slice(1,-1)}, ${Q}})`):M.replace(/\(([^)]*)\)$/,`(${F}, {${Q}})`)},bc=(M,$)=>{const I=nu(M),Z=I.indexOf("(");if(Z===-1)return M;const B=I.slice(Z+1,-1).trim(),F=`limit: ${$.limit}, page: ${$.page}`;if(!B)return M.replace(/\(\)$/,`({${F}})`);const Q=B.lastIndexOf(",");if(Q===-1)return M.replace(/\(([^)]*)\)$/,`(${B}, {${F}})`);const tt=B.slice(Q+1).trim();return tt.startsWith("{")?M.replace(/\(([^)]*)\)$/,`(${B.slice(0,Q)}, {${tt.slice(1,-1)}, ${F}})`):M.replace(/\(([^)]*)\)$/,`(${B}, {${F}})`)};v.useEffect(()=>()=>{tn.current=!0},[]),le.colors.background;const $n=v.useMemo(()=>`bf-preview-${Math.random().toString(36).slice(2,9)}`,[]),Mh=M=>M.replace(/:(\w+)/g,($,I)=>{const Z=he[I];return Z===void 0?$:String(Z)}),_m=M=>{try{const $=JSON.parse(M);if(Array.isArray($)&&$.length>0)return $.map(I=>{var Z;return I.message||`${((Z=I.path)==null?void 0:Z.join("."))||"field"} is invalid`})}catch{}return null};class $o extends Error{constructor(I,Z){super(I.join(", "));km(this,"errors");km(this,"body");this.errors=I,this.body=Z}}const qi=async(M,$)=>{var At,a,d,g,_;if(Ke.current||!ft)return;const{method:I,path:Z}=Ee(M),B=Mh(Z),F=I!=="GET"&&I!=="DELETE",Q=er();I!=="GET"&&Ch(I,B,he,($==null?void 0:$.optimistic)??!0);let tt;if($!=null&&$.payload&&typeof $.payload=="object"){tt={};for(const[C,k]of Object.entries($.payload))tt[C]=typeof k=="string"&&k.includes("{{")?Cs(k):k}else tt=he;tt=gc(tt);const X=await fetch(new URL(B,Q).toString(),{method:I,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},...F?{body:JSON.stringify(tt)}:{}});if(await Mo(X)||tn.current)return;let st;try{st=await X.json()}catch{if(tn.current)return;if(!X.ok)throw new $o([`Request failed: ${X.statusText}`]);return}if(!X.ok||st.success===!1){Zt(B,$==null?void 0:$.refetchScope);let C=["Something went wrong"];throw(At=st.error)!=null&&At.message?C=_m(st.error.message)||[st.error.message]:st.message&&(C=[st.message]),new $o(C,st)}st.token&&localStorage.setItem("token",st.token),$!=null&&$.openUrl&&(st!=null&&st.url)&&String(st.url).startsWith("http")&&window.open(String(st.url),"_blank","noopener,noreferrer"),st&&typeof st=="object"&&!Array.isArray(st)&&se(C=>({...C,feedback:st})),st.data&&($==null?void 0:$.mergeResponse)!==!1&&se(C=>({...C,...st.data})),st.user&&typeof st.user=="object"?se(C=>({...C,user:st.user})):se(C=>({...C})),sn.current[B.replace(/^\//,"")]={response:st};for(const[C,k]of Object.entries(Ts.current))if(k===B||k.endsWith(B)){const W=sn.current[C];sn.current[C]={items:Array.isArray(W)?W:Array.isArray(W==null?void 0:W.items)?W.items:[],response:st}}const gt=(d=(a=st.subscribe)==null?void 0:a.websocket)==null?void 0:d.workflowChannel;gt&&($==null?void 0:$.mergeResponse)!==!1&&se(C=>{var k,W,et,ot;return{...C,liveCastChannel:gt,execution_id:st.draftId||C.execution_id,id:st.sessionId||C.id,status:"running",test_session:{...C.test_session||{},id:st.sessionId||((k=C.test_session)==null?void 0:k.id),execution_id:st.draftId||((W=C.test_session)==null?void 0:W.execution_id),status:"running",liveCastChannel:gt,prompt:(tt==null?void 0:tt.prompt)||((et=C.test_session)==null?void 0:et.prompt),url:(tt==null?void 0:tt.url)||((ot=C.test_session)==null?void 0:ot.url)}}}),Zt(B,$==null?void 0:$.refetchScope);const vt=$==null?void 0:$.feedback,pt=typeof vt=="string"?vt:vt==null?void 0:vt.transport;if(pt&&st.jobId&&(st.token||(g=st.subscribe)!=null&&g.sse||typeof vt=="object")){let C=(_=st.subscribe)!=null&&_.sse?/^https?:\/\//.test(st.subscribe.sse)?st.subscribe.sse:Q+st.subscribe.sse:void 0;if(typeof vt=="object"&&vt.subscribeUrl){const k=String(vt.subscribeUrl).trim(),W=k.startsWith("{{")&&k.endsWith("}}")?k.slice(2,-2).trim():k,et=W.match(/^\[(.+?)\](?:\.(.*))?$/),ot=et?Gr(`${et[1]}${et[2]?"."+et[2]:""}`):W.split(".").reduce((dt,Pt)=>dt==null?void 0:dt[Pt],st);ot&&(C=/^https?:\/\//.test(ot)?ot:Q+ot)}if(C){Bn(pt,st.jobId,st.token,{sseUrl:C,onProgress:k=>{s==null||s(k);const W=Date.now();W-_o.current>=2e3&&(_o.current=W,Zt(B,$==null?void 0:$.refetchScope))},onComplete:k=>{const W=(k==null?void 0:k.result)??k;if(W&&typeof W=="object"){const et=B.replace(/^\//,"");sn.current[et]={response:W},se(ot=>({...ot}))}Zt(B,$==null?void 0:$.refetchScope)},onFailed:k=>{Zt(B,$==null?void 0:$.refetchScope),k.kind!=="transport"&&$e(k.message||"Job failed","error")}});return}Bn(pt,st.jobId,st.token,{onComplete:k=>{const W=k||{},et=W.total,ot=W.successful;et!==void 0&&$e(ot>=et?`${ot} completed`:`${ot} of ${et} completed`,"success"),Zt(B,$==null?void 0:$.refetchScope)},onFailed:k=>{if(k.kind==="transport"){Zt(B,$==null?void 0:$.refetchScope);return}$e(k.message||"Job failed","error"),Zt(B,$==null?void 0:$.refetchScope)}})}},qr=M=>{var Z,B;un(null);const $=M==="/"&&(((Z=nt.find(F=>F.route==="/"))==null?void 0:Z.id)||((B=nt.find(F=>F.type==="render_scene"))==null?void 0:B.id))||M;if(it($)&&!ft){cn.current=$,Rt(!0);return}te(F=>[...F,Ot]),Dn($)},nr=(M,$="error")=>{if(se(I=>({...I,gateTitle:M.uiTitle||"Usage Notice",gateMessage:M.message})),M.uiVariant!=="modal"){const I=M.uiTitle?`${M.uiTitle}
194
+ `}function oht(e,t,n,r){return v.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",minHeight:"100%",backgroundColor:e.colors.background,gap:"16px"}},U("p",{style:{color:e.colors.text,fontSize:"1.125rem"}},"Scene not found"),v.createElement("div",{style:{display:"flex",gap:"12px",alignItems:"center"}},t>0&&v.createElement("button",{onClick:n,style:{padding:"0.5rem 1.5rem",borderRadius:"0.5rem",backgroundColor:e.colors.surfaceHover,color:e.colors.text,border:"none",cursor:"pointer",fontSize:"0.875rem",fontWeight:500,transition:e.effects.transition},onMouseOver:i=>i.target.style.backgroundColor=e.colors.border,onMouseOut:i=>i.target.style.backgroundColor=e.colors.surfaceHover},"← Go Back"),r&&v.createElement("button",{onClick:r,style:{display:"flex",alignItems:"center",gap:"6px",padding:"0.5rem 1.5rem",borderRadius:"0.5rem",backgroundColor:e.colors.primary,variant:"outline",color:e.colors.text,border:"none",cursor:"pointer",fontSize:"0.875rem",fontWeight:500,transition:"opacity 0.2s"},onMouseOver:i=>i.target.style.opacity="0.85",onMouseOut:i=>i.target.style.opacity="1"},v.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},U("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})),"Generate Scene")))}function sht(e){return v.createElement("div",{key:"preview-modal",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,animation:"bf-fade-in 0.15s ease"}},v.createElement("div",{style:{backgroundColor:e.colors.background,borderRadius:"12px",padding:"24px",maxWidth:"360px",width:"90%",boxShadow:"0 20px 40px rgba(0, 0, 0, 0.4)",border:"1px solid rgba(255, 255, 255, 0.08)"}},U("h3",{style:{color:e.colors.text,fontSize:"16px",fontWeight:600,marginBottom:"12px"}},"Sample Modal"),U("p",{style:{color:e.colors.textSecondary,fontSize:"14px",marginBottom:"20px"}},"This is a preview of the modal component for styling."),v.createElement("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"}},U("button",{style:{padding:"10px 20px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:500,background:"rgba(255,255,255,0.08)",color:e.colors.text,border:`1px solid ${e.colors.borderSubtle}`}},"Cancel"),U("button",{style:{padding:"10px 20px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:500,background:e.colors.primary,color:e.colors.text,border:"none"}},"Confirm"))))}function bT(e,t,n,r,i,o,s){var O,R,N,V,D,j,K,H,z,Y,G;if(!e)return null;const{definition:l,closing:c}=e,h=l.variant?(O=l.variants)==null?void 0:O[l.variant]:void 0,u={...l,...h,style:{...l.style,...h==null?void 0:h.style},components:(h==null?void 0:h.components)||l.components,actions:(h==null?void 0:h.actions)||l.actions},f=u.popover===!0,m=(R=u.style)==null?void 0:R.placement,y=m==="left"||m==="right"||m==="bottom"?m:"center",x=u.drawer===!0||y==="left"||y==="right",p=y==="bottom",b=c===!0,P=u.className||"",S=P?((N=n.parseClassNameResponsive)==null?void 0:N.call(n,P,`modal-${e.id}`))??n.parseClassName(P):{},A=f&&s&&s.top>window.innerHeight/2&&s.bottom+300>window.innerHeight,E=s?Math.min(Math.max(12,s.left),Math.max(12,window.innerWidth-372)):void 0,w=()=>{var J;b||(J=i||n.dismissModal)==null||J()},T=v.createElement("div",{key:`modal-overlay-${e.id||"base"}`,style:{position:"fixed",top:0,left:0,right:0,bottom:0,animation:b?"bf-fade-out 0.2s ease forwards":"bf-fade-in 0.15s ease",backdropFilter:f?void 0:"blur(4px)",WebkitBackdropFilter:f?void 0:"blur(4px)",display:"flex",alignItems:f?"flex-start":p?"flex-end":"center",justifyContent:f?"flex-end":x?y==="left"?"flex-start":"flex-end":"center",paddingTop:void 0,paddingRight:void 0,backgroundColor:f?"transparent":((V=u.style)==null?void 0:V.overlayColor)||"rgba(0,0,0,0.45)",pointerEvents:"auto",zIndex:o||1e4},onClick:J=>{J.target===J.currentTarget&&w()}},v.createElement("div",{className:P||void 0,style:{pointerEvents:f?"auto":void 0,...f?{position:"fixed",top:A||!s?A?void 0:"116px":`${s.bottom+8}px`,bottom:A?`${Math.max(12,window.innerHeight-s.top+8)}px`:void 0,left:E===void 0?void 0:`${E}px`,right:E===void 0?"24px":void 0}:{},backgroundColor:((D=u.style)==null?void 0:D.backgroundColor)||r||t.colors.background,borderRadius:x?"0px":((j=u.style)==null?void 0:j.borderRadius)||(p?"16px 16px 0 0":"12px"),padding:x?"0.5rem":p?"16px":"24px",height:x?"100%":"auto",maxHeight:p?"90vh":x?void 0:"85vh",maxWidth:x?"520px":p?n.isMobileView?"none":"640px":((K=u.style)==null?void 0:K.width)||{sm:"min(360px, 92vw)",md:"min(480px, 92vw)",lg:"min(720px, 92vw)",full:"90vw"}[u.size||"sm"]||"min(400px, 92vw)",width:(H=u.style)!=null&&H.width?"100%":x?"90vw":p?"100%":"90%",boxShadow:x?y==="left"?"4px 0 24px rgba(0, 0, 0, 0.4)":"-4px 0 24px rgba(0, 0, 0, 0.4)":p?"0 -8px 32px rgba(0, 0, 0, 0.45)":"0 20px 40px rgba(0, 0, 0, 0.4)",...f?{minWidth:"min(360px, 92vw)",marginRight:"0px",boxShadow:"0 12px 32px rgba(0, 0, 0, 0.45)"}:{},border:"none",borderLeft:x&&y==="right"?`1px solid ${((z=u.style)==null?void 0:z.borderColor)||"rgba(255, 255, 255, 0.08)"}`:"none",borderRight:x&&y==="left"?`1px solid ${((Y=u.style)==null?void 0:Y.borderColor)||"rgba(255, 255, 255, 0.08)"}`:"none",overflow:"auto",animation:x?b?y==="left"?"bf-slide-out-left 0.2s ease forwards":"bf-slide-out-right 0.2s ease forwards":y==="left"?"bf-slide-in-left 0.2s ease":"bf-slide-in-right 0.2s ease":p?b?"bf-slide-out-down 0.2s ease forwards":"bf-slide-in-up 0.25s ease":b?"bf-fade-out 0.2s ease forwards":void 0,...S}},p?v.createElement("div",{key:"bf-sheet-handle",style:{width:"40px",height:"4px",borderRadius:"2px",backgroundColor:"rgba(255, 255, 255, 0.2)",margin:"0 auto 12px",flexShrink:0}}):null,u.icon?v.createElement("div",{style:{textAlign:"center",marginBottom:"12px",display:"flex",justifyContent:"center"}},n.renderIcon(u.icon,32)):null,u.title?v.createElement("h3",{style:{color:t.colors.text,fontSize:u.icon?"18px":"16px",fontWeight:600,marginBottom:"12px",marginTop:"4px",paddingLeft:x?"1.5rem":"0px",paddingRight:x?"1.5rem":"0px",textAlign:u.icon?"center":"left"}},n.interpolateText(u.title)):null,...(u.components||[]).map((J,lt)=>zf(n,J,lt,"modal")),(((G=u.actions)==null?void 0:G.length)||0)>0?v.createElement("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end",marginTop:"20px"}},...(u.actions||[]).map((J,lt)=>{const nt=(ct=>{const gt=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(ct);if(!gt)return!1;const[yt,Et,Tt]=[parseInt(gt[1],16),parseInt(gt[2],16),parseInt(gt[3],16)];return(yt*299+Et*587+Tt*114)/1e3>150})(t.colors.primary)?"#000000":"#ffffff",it={primary:{background:t.colors.primary,color:nt,border:"none"},secondary:{background:"rgba(255, 255, 255, 0.08)",color:t.colors.text,border:`1px solid ${t.colors.borderSubtle}`},ghost:{background:"transparent",color:t.colors.text,border:`1px solid ${t.colors.borderSubtle}`},danger:{background:t.colors.danger,color:"#ffffff",border:"none"}},at=it[J.variant||"primary"]||it.primary;return v.createElement("button",{key:lt,onClick:()=>{if(e.legacyOnConfirm&&J.label==="Confirm"){w(),setTimeout(()=>{var ct;return(ct=e.legacyOnConfirm)==null?void 0:ct.call(e)},250);return}J.onClick&&n.handleButtonClick(J.onClick,{onSuccess:J.onSuccess,onError:J.onError}),J.dismiss&&w()},style:{padding:"10px 20px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:500,...at}},J.label)})):null));return f&&typeof document<"u"?ub.createPortal(T,document.body):T}const aht=new va,hp=()=>{try{if(typeof window<"u")return window.localStorage.getItem("backflow_dev_diagnostics")==="1"}catch{}return!1},Zg=(...e)=>{hp()&&console.log(...e)},Yg=(...e)=>{hp()&&console.warn(...e)};let Q$=null;window.addEventListener("message",e=>{var t,n,r;(((t=e.data)==null?void 0:t.type)==="auth"||((n=e.data)==null?void 0:n.type)==="auth-token")&&((r=e.data)!=null&&r.token)&&(Q$=e.data.token,localStorage.setItem("token",e.data.token),e.data.refreshToken&&localStorage.setItem("backflow_refresh_token",e.data.refreshToken),e.data.userId&&localStorage.setItem("backflow_refresh_user_id",e.data.userId))});function $f(e){try{const t=JSON.parse(atob(e.split(".")[1]));return typeof t.exp!="number"||t.exp*1e3<=Date.now()}catch{return!0}}function lht({workflow:e,sdk:t,iconResolver:n,authToken:r,nativeAction:i,onRouteExecute:o,onJobProgress:s,appName:l,appIcon:c,selectedComponentKey:h,selectedComponentClass:u,styleOverrides:f,interactionDisabled:m,theme:y,imageReplacements:x,currentSceneId:p,onSceneChange:b,onGenerateScene:P,enableRouting:S,routingMode:A,previewElement:E,tenantId:w,appId:T,renderPhaserGame:O,renderMode:R,apiUrl:N,workflowBaseUrl:V,initialScene:D,previewMode:j,remoteSessionId:K,devDiagnostics:H}){var Vh,Rs,Uh,Cc,Hh,No,qh,Xi,Oc,Mc,Gh,Mr,kc,$c,jo,Zh;const z=(()=>{const M=Q$||localStorage.getItem("token");return!!M&&!$f(M)})(),[Y,G]=v.useState(!z),[J,lt]=v.useState(null),q=v.useMemo(()=>Array.isArray(e==null?void 0:e.steps)?e.steps:[],[e]),nt=v.useMemo(()=>{const M=q;return e&&!Array.isArray(e.steps)&&(Yg("[WorkflowRenderer] NON-ARRAY steps:",typeof e.steps,JSON.stringify(e.steps).slice(0,500)),Yg("[WorkflowRenderer] Workflow keys:",Object.keys(e))),Y!==!0?M:M.filter($=>{var I,Z;return!($.requiresAuth===!0||((I=$.config)==null?void 0:I.requireAuth)===!0||((Z=$.config)==null?void 0:Z.requiresAuth)===!0)})},[e,Y,q]),it=v.useCallback(M=>{var I;const $=q.find(Z=>Z.id===M);return((I=$==null?void 0:$.config)==null?void 0:I.requireAuth)===!0||($==null?void 0:$.requiresAuth)===!0},[q]),at=e&&!((Vh=e.config)!=null&&Vh.colorMode)?dI(e):void 0,ct=jT(at?{...(e==null?void 0:e.config)||{},colorMode:at}:e==null?void 0:e.config,void 0,y),gt=!((Rs=e==null?void 0:e.config)!=null&&Rs.colorMode)&&!at&&!(y!=null&&y.colorMode),yt=M=>Sx(M,{primary:le.colors.primary,accent:le.colors.accent,colorMode:le.colorMode},gt),Et=R||"legacy",Tt=A||(S?"hash":"memory"),ht=Tt!=="memory",[ft,Ct]=v.useState(z),[rt,Rt]=v.useState(!1),[bt,de]=v.useState(!1),{sceneToRoute:ne,routeToScene:Gt}=v.useMemo(()=>X$(nt),[nt]),Le=v.useMemo(()=>{var $,I;if(D&&nt.some(Z=>Z.id===D))return D;const M=nt.filter(Z=>Z.type==="render_scene");return(($=M.find(Z=>Z.route==="/"))==null?void 0:$.id)||((I=M[0])==null?void 0:I.id)||""},[nt,D]),Bt=v.useMemo(()=>{if(ht){const M=Tt==="hash"?lb(Gt):yT(Gt);if(M)return M}return Le},[Le,ht,Tt,Gt]),[Qt,te]=v.useState([]),[Ht,re]=v.useState(Bt),Ce=v.useRef(null),ie=_C(Ce),on=v.useRef(!1);v.useRef(null);const tn=v.useRef(!1),Ke=v.useRef(!1),_o=v.useRef(0),cn=v.useRef(null);v.useEffect(()=>(tn.current=!1,NT(),()=>{tn.current=!0}),[]),v.useEffect(()=>{r&&localStorage.setItem("token",r)},[r]);const Ot=p??Ht;v.useEffect(()=>{var tt,X,st;const M=nt.find(mt=>mt.id===Ot),$=!!((tt=e==null?void 0:e.config)!=null&&tt.remoteControl)&&!!(M!=null&&M.remoteScene);if(TT($),ET($&&!!((st=(X=e==null?void 0:e.config)==null?void 0:X.mouse)!=null&&st.enabled)),!$||!K){Jg();return}const I=N||(t==null?void 0:t.endpoint),Z=I&&/^https?:\/\//.test(I)?I:window.location.origin,B=new URL("/ws",Z);B.protocol=B.protocol==="https:"?"wss:":"ws:";const W=B.toString(),Q=`agent:${w||"default"}:${K}`;return LT(W,Q,r||localStorage.getItem("token")||void 0),()=>Jg()},[(Uh=e==null?void 0:e.config)==null?void 0:Uh.remoteControl,(Hh=(Cc=e==null?void 0:e.config)==null?void 0:Cc.mouse)==null?void 0:Hh.enabled,nt,Ot,K,w,N,t,r]);const Dn=v.useCallback(M=>{re(M),b==null||b(M)},[b]);v.useEffect(()=>{var I;const M=nt.find(Z=>Z.id===Ot),$=((I=M==null?void 0:M.config)==null?void 0:I.requireAuth)===!0||(M==null?void 0:M.requiresAuth)===!0;Ot&&!$&&Rt(!1)},[Ot,nt]);const Fe=(e==null?void 0:e.modals)||{};v.useEffect(()=>{if(!ft)return;const M=le.startupModal;!M||!Fe[M]||localStorage.getItem(`backflow_startup_modal_${M}`)||un({id:M,definition:Fe[M]})},[ft]);const Ci=v.useRef(typeof window>"u"?null:new URLSearchParams(window.location.search).get("customer_session_token"));v.useEffect(()=>{if(!ft||!Ci.current||!Fe["payment-success"])return;window.history.replaceState({},"",window.location.pathname);const $=setTimeout(()=>{Fe["payment-success"]&&un({id:"payment-success",definition:Fe["payment-success"]})},400);return()=>clearTimeout($)},[ft,Fe["payment-success"]]),v.useEffect(()=>{Y===!0&&(!Ot||nt.some(M=>M.id===Ot)||Le&&Dn(Le))},[Y,nt,Ot,Le]),v.useEffect(()=>{if(ht){if(on.current){on.current=!1;return}Tt==="hash"?Ff(Ot,ne,!1):Gg(Ot,ne,!1)}},[Ot,ht,Tt,ne]),v.useEffect(()=>{ht&&(Tt==="hash"?Ff(Ot,ne,!0):Gg(Ot,ne,!0))},[]);const So=v.useRef(!0);v.useEffect(()=>{const M=setTimeout(()=>{So.current=!1},1500);return()=>clearTimeout(M)},[]),v.useEffect(()=>{if(!ht)return;const M=$=>{var Z;if(So.current)return;const I=((Z=$.state)==null?void 0:Z.sceneId)||(Tt==="hash"?lb(Gt):yT(Gt));I&&I!==Ot&&(on.current=!0,Dn(I),te(B=>B.length>0&&B[B.length-1]===I?B.slice(0,-1):B))};return window.addEventListener("popstate",M),()=>window.removeEventListener("popstate",M)},[ht,Tt,Gt,Ot,Dn]),v.useEffect(()=>{var $;const M=(($=nt.find(I=>I.type==="render_scene"))==null?void 0:$.id)||"";if(M&&M!==Ot){if(re(M),te([]),b==null||b(M),!ht)return;Tt==="hash"?Ff(M,ne,!0):Gg(M,ne,!0)}},[e]),v.useEffect(()=>{p&&p!==Ht&&re(p)},[p]);const Po=v.useCallback(()=>{if(ht){window.history.back();return}if(Qt.length>0){const M=Qt[Qt.length-1];te($=>$.slice(0,-1)),Dn(M)}},[Qt,ht]),[he,se]=v.useState({}),ii=v.useRef(he);v.useEffect(()=>{ii.current=he},[he]),v.useEffect(()=>{K&&se(M=>M.remoteSessionId===K?M:{...M,remoteSessionId:K})},[K]);const Oi=v.useMemo(()=>Array.isArray(e==null?void 0:e.workflowRefs)?e.workflowRefs:[],[e]),Pr=v.useMemo(()=>Oi.filter(M=>M.sceneIds==="*"||Array.isArray(M.sceneIds)&&M.sceneIds.includes(Ot)),[Ot,Oi]),[Mi,ms]=v.useState({}),ki=v.useRef({}),oi=v.useCallback(async(M,$=!1)=>{if(!ft||!M.appId)return;const I=N||(t==null?void 0:t.endpoint)||window.location.origin,Z=!N&&typeof I=="string"&&I.startsWith("/")?I.replace(/\/+$/,""):"",B=/^https?:\/\//.test(I)?I:window.location.origin,W=`${Z}/mobile/apps/${encodeURIComponent(M.appId)}/workflow`,Q=await fetch(new URL(W,B).toString(),{cache:$?"no-cache":"default",headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`}});if(!Q.ok)throw new Error(`Workflow reference ${M.id} failed`);const tt=await Q.json(),X=(tt==null?void 0:tt.app)||tt;if(!Array.isArray(X==null?void 0:X.steps))throw new Error(`Workflow reference ${M.id} is invalid`);ms(st=>({...st,[M.id]:X}))},[N,r,ft,t]);v.useEffect(()=>{let M=!1;for(const $ of Pr){const I=`${$.appId}:${$.sourceSceneId||""}`;ki.current[$.id]!==I&&(ki.current[$.id]=I,oi($).catch(()=>{M||delete ki.current[$.id]}))}return()=>{M=!0}},[Pr,oi]),v.useEffect(()=>{var Z;const M=Pr.filter(B=>{var W;return((W=B.realtime)==null?void 0:W.mode)==="ws"});if(M.length===0||!w)return;const $=(Z=t==null?void 0:t.client)==null?void 0:Z.createWebSocket;if(!$)return;const I=$(`tenant:${w}:entities`);return I.onmessage=B=>{let W;try{W=JSON.parse(B.data)}catch{return}if(!(W.type!=="entity_changed"||W.entity!=="mobile_apps"))for(const Q of M)W.id===Q.appId&&oi(Q,!0).catch(()=>{})},()=>I.close()},[Pr,oi,w,t]);const[$i,Wr]=v.useState({}),Ao=v.useRef(new Set),[Ii,Ri]=v.useState({}),[Ar,Li]=v.useState({}),[Ni,En]=v.useState({}),[$t,To]=v.useState({}),[Cn,ji]=v.useState({}),[Eo,si]=v.useState([]),Di=v.useRef(new Set),pr=v.useRef(new Map),Bi=v.useCallback((M,$)=>{if(!(H??hp()))return;const I=`${M}:${$}`;Di.current.has(I)||(Di.current.add(I),si(Z=>[...Z,{level:"warn",code:M,where:`runtime:${Ot}`,msg:$}]))},[Ot,H]),gs=v.useCallback((M,$)=>{if(!(H??hp()))return;const I=Date.now(),Z=(pr.current.get(M)||[]).filter(Q=>I-Q.at<2e3),B=Z.find(Q=>Q.componentKey!==$&&I-Q.at<500);Z.push({componentKey:$,at:I}),pr.current.set(M,Z),B&&Bi("DATASOURCE_DUPLICATE_RUNTIME",`"${M}" fetched by ${B.componentKey} and ${$} within 500ms`);const W=Z.filter(Q=>Q.componentKey===$);W.length>=3&&Bi("RENDER_FETCH_LOOP",`"${M}" fetched ${W.length} times by ${$} within 2s`)},[H,Bi]);v.useEffect(()=>{Di.current.clear(),pr.current.clear(),si([])},[Ot]);const Gn=v.useRef(new Map),zi=v.useRef(new Map),ys=v.useRef(new Set),[vs,bs]=v.useState(!1),[Ae,un]=v.useState(null),[Ea,xs]=v.useState(null),ws=v.useRef(null);v.useEffect(()=>{var $;if(!(($=Ae==null?void 0:Ae.definition)!=null&&$.popover))return;const M=()=>{const I=ws.current;I&&xs(I.getBoundingClientRect())};return window.addEventListener("scroll",M,!0),window.addEventListener("resize",M),M(),()=>{window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[Ae==null?void 0:Ae.id,(No=Ae==null?void 0:Ae.definition)==null?void 0:No.popover]);const Fi=v.useCallback(()=>{un(M=>M?{...M,closing:!0}:null),setTimeout(()=>un(null),250)},[]),[_n,tr]=v.useState(null),Co=v.useCallback(()=>{tr(M=>M?{...M,closing:!0}:null),setTimeout(()=>tr(null),250)},[]),ai=ie>0&&ie<Eu.md;v.useEffect(()=>{e&&typeof e=="object"&&(e.auth={signedIn:ft})},[e,ft]),v.useEffect(()=>{const M=e;if(!(M!=null&&M.config))return;if(c){M.config.logo=c,se(I=>I&&{...I});return}if(!V)return;let $=!1;return(async()=>{for(const I of["svg","png","jpg","jpeg"]){const Z=`${V}logo.${I}`;try{if((await fetch(Z,{method:"HEAD"})).ok&&!$){M.config.logo=Z,se(W=>W&&{...W});return}}catch{}}})(),()=>{$=!0}},[e,V,c]);const[On,ee]=v.useState("login"),[qt,mr]=v.useState(""),[ye,wt]=v.useState(""),[ve,It]=v.useState(""),[ae,_s]=v.useState({}),[Wi,Mn]=v.useState(""),[li,hn]=v.useState(null),[qe,ke]=v.useState(!1),[Te,Ss]=v.useState({}),Vr=M=>M?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(M)?null:"Invalid email address":null,Vi=M=>M?M.length>=6?null:"Password must be at least 6 characters":null,Ps=(M,$)=>$?$===M?null:"Passwords do not match":null,Tr=(M,$)=>Ss(I=>({...I,[M]:$||""})),Oo=M=>{var $,I;return M?typeof M=="string"?M:Array.isArray(M)?(($=M[0])==null?void 0:$.message)||"Validation failed":typeof M.message=="string"?M.message:typeof M.error=="string"?M.error:(I=M.error)!=null&&I.message?M.error.message:"An error occurred":"An error occurred"},Ui=(he==null?void 0:he._colorMode)||ct.colorMode,mc=Ui==="dark"?xu:wu,le=Ui!==ct.colorMode?{...ct,colorMode:Ui,colors:{...mc,...ct.colors&&Ui==="dark"?ct.colors:{}}}:ct;v.useEffect(()=>{typeof document>"u"||document.documentElement.setAttribute("data-theme",le.colorMode==="dark"?"dark":"light")},[le.colorMode]);const As=v.useCallback(M=>{try{localStorage.setItem("bf_theme",M)}catch{}se($=>({...$,_colorMode:M}))},[]);v.useEffect(()=>{if(typeof localStorage>"u")return;const M=localStorage.getItem("bf_theme");(M==="dark"||M==="light")&&se($=>({...$,_colorMode:M}))},[]),v.useEffect(()=>{const M=localStorage.getItem("token"),$=!!M&&!$f(M);$?(Ke.current=!1,G(!1)):G(!0),Ct($);const I=()=>{const W=localStorage.getItem("token"),Q=!!W&&!$f(W);Q?(Ke.current=!1,G(!1)):G(!0),Ct(Q)};window.addEventListener("storage",I);const Z=W=>{var Q,tt,X;if((((Q=W.data)==null?void 0:Q.type)==="auth"||((tt=W.data)==null?void 0:tt.type)==="auth-token")&&((X=W.data)!=null&&X.token)){if(localStorage.setItem("token",W.data.token),W.data.refreshToken&&localStorage.setItem("backflow_refresh_token",W.data.refreshToken),W.data.userId&&localStorage.setItem("backflow_refresh_user_id",W.data.userId),$f(W.data.token)){Ke.current=!0,Ct(!1);return}if(!ft&&(rt||Ke.current||!!cn.current)){window.location.reload();return}Ct(!0),Rt(!1),G(!1),Ke.current=!1}};window.addEventListener("message",Z);const B=()=>{var W;if(!Ke.current){const Q=nt.find(X=>X.id===Ot);if(!(((W=Q==null?void 0:Q.config)==null?void 0:W.requireAuth)===!0||(Q==null?void 0:Q.requiresAuth)===!0))return;Ke.current=!0,Ct(!1),Rt(!0)}};return window.addEventListener("auth:required",B),()=>{window.removeEventListener("storage",I),window.removeEventListener("message",Z),window.removeEventListener("auth:required",B)}},[]);const Eh=async()=>{var I;const M=localStorage.getItem("backflow_refresh_token"),$=localStorage.getItem("backflow_refresh_user_id");if(!M||!$)return!1;try{const B=await(await fetch(`${window.location.origin}/api/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:M,userId:$})})).json();if(B.success&&((I=B.data)!=null&&I.token))return B.data.refreshToken&&localStorage.setItem("backflow_refresh_token",B.data.refreshToken),localStorage.setItem("token",B.data.token),!0}catch{}return localStorage.removeItem("backflow_refresh_token"),localStorage.removeItem("backflow_refresh_user_id"),!1},Mo=async(M,$=!1)=>{var I;if(M.status===401&&!rt){if(await Eh())return!1;if(Zg("[bf] 401 intercepted, showAuth:",rt,"authInterceptedRef:",Ke.current),!Ke.current){Ke.current=!0,localStorage.removeItem("token"),Ct(!1);const B=nt.find(Q=>Q.id===Ot),W=((I=B==null?void 0:B.config)==null?void 0:I.requireAuth)===!0||(B==null?void 0:B.requiresAuth)===!0;($||W)&&(Rt(!0),Ot&&(cn.current=Ot))}return!0}return!1},xm=Ot&&nt.some(M=>M.id===Ot)?Ot:(qh=nt[0])==null?void 0:qh.id,Dt=nt.find(M=>M.id===xm),pe=(Dt==null?void 0:Dt.type)==="render_scene"?Dt.config:null;v.useEffect(()=>{if(!pe)return;const M=w||"default",$={TENANT_ID:M,tenantId:M,role:"user"};se(I=>{const Z={};for(const B of Object.keys(I))B.startsWith("_")&&(Z[B]=I[B]);return{...$,...pe.sceneData||{},...Z}})},[Ot,pe]),v.useEffect(()=>{const M=le.persistedKeys;if(!M||M.length===0)return;const $={};for(const I of M){const Z=localStorage.getItem(`bf_persist_${I}`);Z&&($[I]=Z)}Object.keys($).length>0&&se(I=>({...I,...$}))},[Ot]),v.useEffect(()=>{const M=le.persistedKeys;if(!(!M||M.length===0))for(const $ of M){const I=he[$];I&&localStorage.setItem(`bf_persist_${$}`,String(I))}});const Ee=M=>{const $=M.match(/^(GET|POST|PATCH|DELETE|PUT)\s+(.+)/);return{method:$?$[1]:"POST",path:$?$[2]:M}},gc=M=>{const $={...M};return delete $.TENANT_ID,delete $.tenantId,delete $.role,$},Ur=v.useCallback(async M=>{var Z,B,W;if(!M.action)return;const $=String(M.action),I=ii.current;try{if($.startsWith("execute_workflow:")){if(!ft)return;const{method:Q,path:tt}=Ee($.replace("execute_workflow:","")),X=tt.replace(/:(\w+)/g,(At,a)=>{const d=I[a];return d===void 0?At:String(d)}).replace(/\{\{(\w+)\}\}/g,(At,a)=>{const d=I[a];return d===void 0?At:String(d)}),st=er(),mt=Q!=="GET"&&Q!=="DELETE";Q!=="GET"&&Ch(Q,X,I,!0);const vt=await fetch(new URL(X,st).toString(),{method:Q,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},...mt?{body:JSON.stringify(gc(I))}:{}});if(tn.current||await Mo(vt)||tn.current)return;if(!vt.ok)throw Zt(X),new Error(`Route failed: ${vt.statusText}`);const pt=await vt.json();if(tn.current)return;if(pt&&typeof pt=="object"&&!Array.isArray(pt)&&se(At=>({...At,feedback:pt})),((Z=M.onSuccess)==null?void 0:Z.type)==="toast"&&M.onSuccess.value)$e(M.onSuccess.value,"success");else if(((B=M.onSuccess)==null?void 0:B.type)==="navigate"&&M.onSuccess.value){const At=M.onSuccess.value;if(it(At)&&!ft){cn.current=At,Rt(!0);return}te(d=>[...d,Ot]),Dn(At)}pt!=null&&pt.data&&se(At=>({...At,...pt.data})),pt!=null&&pt.user&&typeof pt.user=="object"&&se(At=>({...At,user:pt.user})),sn.current[X.replace(/^\//,"")]={response:pt},se(At=>({...At}))}else if($.startsWith("navigate:")){const Q=$.replace("navigate:","");if(it(Q)&&!ft){cn.current=Q,Rt(!0);return}te(X=>[...X,Ot]),Dn(Q)}else if($.startsWith("go_to_step:")){const Q=$.replace("go_to_step:","").split("?")[0].trim();if(it(Q)&&!ft){cn.current=Q,Rt(!0);return}te(X=>[...X,Ot]),Dn(Q)}else if($.startsWith("show_toast:")){const Q=$.replace("show_toast:","");Q&&$e(Q,"success")}else if($.startsWith("show_modal:")){const Q=$.replace("show_modal:","");if(Fe[Q]){const tt=Fe[Q],X=tt.clearFormKeys;se(st=>{const mt={...st};let vt=Array.isArray(X)&&X.length>0;if(vt)for(const pt of X)delete mt[pt];for(const pt of Object.keys(mt))pt.startsWith("__acc_")&&(delete mt[pt],vt=!0);return vt?mt:st}),tt.preload&&await qi(String(tt.preload)),un({id:Q,definition:tt})}else{const tt=Q.split("|");un({id:"__legacy",definition:{title:tt[0]||"Notice",components:tt[1]?[{type:"text",text:tt[1],color:le.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.7)",fontSize:14}]:[],actions:[{label:"OK",variant:"primary",dismiss:!0}]}})}}else if($.startsWith("toast:")){const Q=$.replace("toast:","");$e(Q,"success")}}catch(Q){if(Q instanceof $o&&xc(Q,M==null?void 0:M.onError))return;(W=M.onError)!=null&&W.message&&$e(M.onError.message,"error")}},[Ot,nt,ft]),Ca=v.useRef(null),Oa=v.useRef(null);v.useEffect(()=>{const M=Oa.current;Oa.current=Ot;const $=pe==null?void 0:pe.events,I=Array.isArray($==null?void 0:$.onLoad)?$.onLoad:$!=null&&$.onLoad?[$.onLoad]:[];I.length!==0&&M!==Ot&&I.forEach(Z=>Ur(Z))},[Ot,pe==null?void 0:pe.events,Ur]),v.useEffect(()=>{var $,I;const M=Ca.current;if(Ca.current=Ot,M&&M!==Ot){const Z=nt.find(W=>W.id===M),B=(Z==null?void 0:Z.type)==="render_scene"?Z.config:null;(I=($=B==null?void 0:B.events)==null?void 0:$.onLeave)!=null&&I.action&&Ur(B.events.onLeave)}},[Ot,nt,Ur]),v.useEffect(()=>{const M=pe==null?void 0:pe.events;if(!(M!=null&&M.onVisibilityChange))return;const $=()=>{var I,Z,B,W;document.hidden?(Z=(I=M.onVisibilityChange)==null?void 0:I.onHidden)!=null&&Z.action&&Ur(M.onVisibilityChange.onHidden):(W=(B=M.onVisibilityChange)==null?void 0:B.onVisible)!=null&&W.action&&Ur(M.onVisibilityChange.onVisible)};return document.addEventListener("visibilitychange",$),()=>document.removeEventListener("visibilitychange",$)},[Ot,pe==null?void 0:pe.events,Ur]);const Hi=v.useCallback(async(M,$)=>{En(I=>({...I,[M]:!0}));try{await $()}finally{En(I=>({...I,[M]:!1}))}},[]),ci=v.useRef({}),ko=v.useRef(new Map),en=v.useRef(new Set),ui=v.useRef(new Set),Hr=v.useRef(null),Ma=v.useRef([]),Ts=v.useRef({}),kn=v.useCallback(async(M,$,I=0,Z=10,B,W,Q,tt=!1)=>{var vt;if(!M||Ke.current||!ft)return;const X=`${$}|${M}|${I}|${tt}`,st=ko.current.get(X)||0;if(Date.now()-st<1e3)return;ko.current.set(X,Date.now()),ci.current[$]=M;const mt=M.match(/^\{\{\s*\[([\w/.-]+)\](?:\.([\w.]+))?\s*\}\}$/);if(mt){const pt=Gr(`${mt[1]}${mt[2]?"."+mt[2]:""}`);if(Array.isArray(pt))return Wr(At=>({...At,[$]:pt})),sn.current[$]=pt,sn.current[M]=pt,ji(At=>({...At,[$]:{page:I,limit:Z,total:pt.length,hasMore:(I+1)*Z<pt.length}})),pt}Ao.current.has($)||Li(pt=>({...pt,[$]:!0}));try{let pt=[],At=0,a;const d=ii.current;if(gs(M,$),vu(M)&&t){const g=bc(M,{limit:Z,page:I}),_=B?wm(g,B,W):g,C=nu(_),k=await Wf(t,C,d);a=k,pt=(k==null?void 0:k.emails)||(k==null?void 0:k.items)||(k==null?void 0:k.data)||(k==null?void 0:k.history)||(Array.isArray(k)?k:[]),At=((vt=k==null?void 0:k.pagination)==null?void 0:vt.total)??(k==null?void 0:k.count)??pt.length}else if(!vu(M)){const g=t==null?void 0:t.endpoint,_=N||(g&&/^https?:\/\//.test(g)?g:window.location.origin);let C=M;!N&&g&&!/^https?:\/\//.test(g)&&typeof g=="string"&&(C=`${g.replace(/\/+$/,"")}${M.startsWith("/")?M:`/${M}`}`),Zg("[fetchListData] apiUrl=%s baseUrl=%s dataSource=%s origin=%s",N,_,M,window.location.origin);const k=new URL(C,_);k.searchParams.set("limit",String(Z)),k.searchParams.set("offset",String(I*Z)),B&&(k.searchParams.set("sort",B),k.searchParams.set("dir",W||"asc"));const F=await fetch(k.toString(),{headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`}});if(await Mo(F)||tn.current)return;let et=null;try{et=await F.json()}catch{}if(!F.ok){const ot=typeof(et==null?void 0:et.message)=="string"&&et.message||typeof(et==null?void 0:et.error)=="string"&&et.error||`Request failed: ${F.statusText}`;throw new $o([ot],et||void 0)}if(a=et,tn.current)return;pt=Array.isArray(et)?et:Array.isArray(et.data)?et.data:Array.isArray(et.items)?et.items:[],At=et.count??et.total??pt.length}if(Wr(g=>{if(tt&&Array.isArray(g[$])){const _=new Set(g[$].map(k=>k==null?void 0:k.id)),C=[...g[$],...pt.filter(k=>!_.has(k==null?void 0:k.id))];return{...g,[$]:C}}return{...g,[$]:pt}}),Ao.current.add($),sn.current[$]=pt,M&&(sn.current[M]=pt),Q&&(sn.current[Q]={items:pt,response:a},M)){const g=Ts.current[Q];g&&g!==M&&Yg(`[renderer] duplicate list key "${Q}" used for both ${g} and ${M}`),Ts.current[Q]=M}{const g=String(M||"").replace(/^\//,"").split("?")[0];g&&(sn.current[g]={response:a})}return ji(g=>({...g,[$]:{page:I,limit:Z,total:At,hasMore:(I+1)*Z<At}})),pt}catch(pt){if(pt instanceof $o&&xc(pt))return;Wr(At=>{const a=At[$];return Array.isArray(a)&&a.length>0?At:{...At,[$]:[]}})}finally{Li(pt=>({...pt,[$]:!1}))}},[t,ft,gs]),er=()=>{const M=N||(t==null?void 0:t.endpoint);return M&&/^https?:\/\//.test(M)?M:M!=null&&M.startsWith("/")?`${window.location.origin}${M}`:window.location.origin},yc=v.useRef(null);v.useEffect(()=>{var B;if(!ft)return;const M=r||localStorage.getItem("token");if(!M){G(!0);return}const $=((e==null?void 0:e.steps)||[]).find(W=>W.id===Ot);if(!(((B=$==null?void 0:$.config)==null?void 0:B.requireAuth)===!0||($==null?void 0:$.requiresAuth)===!0||rt)||yc.current===M)return;let Z=!1;return(async()=>{var W;try{const Q=await fetch(`${er()}/admin/users/me`,{headers:{Authorization:`Bearer ${M}`}});if(Z)return;if(Q.ok){const tt=await Q.json().catch(()=>null);yc.current=M,G(!1),lt(typeof((W=tt==null?void 0:tt.user)==null?void 0:W.emailVerified)=="boolean"?tt.user.emailVerified:null)}else Ot&&(cn.current=Ot),yc.current=null,G(!0),Ct(!1),lt(null)}catch{Z||(Ot&&(cn.current=Ot),G(!0))}})(),()=>{Z=!0}},[ft,Ot,e==null?void 0:e.steps]);const vc=v.useCallback((M,$,I)=>{!M||$.length===0||Wr(Z=>{const B={...Z};for(const[W,Q]of Object.entries(ci.current)){if(Q!==M||!Z[W])continue;const tt=Z[W];I==="remove"&&(B[W]=tt.filter(X=>!$.includes(X.id)))}return B})},[]),Zt=v.useCallback((M,$)=>{var Q,tt;const I=new Map;for(const[X,st]of Object.entries(Ts.current))I.set(st,X);const Z=new Map;for(const[X,st]of Object.entries(ci.current))Z.set(X,{ds:st,dataKey:I.get(st)});for(const[X,st]of Object.entries(Ts.current))Object.values(ci.current).includes(st)||Z.set(X,{ds:st,dataKey:X});if(Z.size===0)return;const B=Array.isArray($)?new Set($):void 0,W=(X,st)=>en.current.has(X)||(st?en.current.has(st):!1);for(const[X,{ds:st,dataKey:mt}]of Z){if(!W(X,mt))continue;const vt=!!(B!=null&&B.has(X)||mt&&(B!=null&&B.has(mt)));if($==="view"||vt){kn(st,X,0,((Q=Cn[X])==null?void 0:Q.limit)||10,void 0,void 0,mt);continue}const pt=st==null?void 0:st.split("?")[0];pt&&M.startsWith(pt)&&kn(st,X,0,((tt=Cn[X])==null?void 0:tt.limit)||10,void 0,void 0,mt)}},[kn,Cn]),Ch=v.useCallback((M,$,I,Z)=>{const B=String(M||"").toUpperCase();if(B==="GET"||Z===!1)return;const W=Z==="remove"||Z==="merge"||Z==="add"||Z==="refresh"?Z:B==="DELETE"?"remove":B==="PUT"||B==="PATCH"?"merge":B==="POST"?"add":null;if(!W||W==="refresh")return;const Q=()=>{const X=String($).match(/\/([^/]+)\/?$/);return X?decodeURIComponent(X[1]):void 0},tt=[];for(const[X,st]of Object.entries(ci.current))st&&$.startsWith(st)&&tt.push({key:X,ds:st});tt.length!==0&&Wr(X=>{const st={...X};for(const{key:mt,ds:vt}of tt){const pt=X[mt]||[];if(W==="remove"){const At=(I==null?void 0:I.id)||Q();st[mt]=pt.filter(a=>a.id!==At)}else if(W==="merge"){const At=(I==null?void 0:I.id)||Q();st[mt]=pt.map(a=>a.id===At?{...a,...I}:a)}else{const At={...I||{},id:(I==null?void 0:I.id)||`temp_${Date.now()}`};W==="add"&&At.status===void 0&&(At.status="queued"),st[mt]=[At,...pt]}}return st})},[]),Bn=v.useCallback((M,$,I,Z)=>{var X;const B=er();let W=!1;const Q=st=>{W||(W=!0,st())},tt=t==null?void 0:t.queues;if(M==="sse"&&(tt!=null&&tt.subscribe))try{const st=Z.sseUrl||`${B}/queues/bulk-operations/jobs/${$}/subscribe?token=${encodeURIComponent(I)}`,mt=((t==null?void 0:t.endpoint)||B).replace(/\/$/,""),vt=st.startsWith(mt)?st.slice(mt.length):st;tt.subscribe(vt,{onComplete:pt=>Q(()=>Z.onComplete(pt)),onFailed:pt=>Q(()=>Z.onFailed({message:pt||"Subscription failed",kind:"transport"})),onError:()=>Q(()=>Z.onFailed({message:"Stream error",kind:"transport"})),onConnected:()=>{},onProgress:pt=>{var At;return(At=Z.onProgress)==null?void 0:At.call(Z,pt)}}),setTimeout(()=>Q(()=>Z.onFailed({message:"Timed out",kind:"transport"})),3e4);return}catch{}if(M==="ws"&&((X=t==null?void 0:t.client)!=null&&X.createWebSocket))try{const st=t.client.createWebSocket(`job:${$}`);st.onmessage=mt=>{try{const vt=JSON.parse(mt.data);(vt==null?void 0:vt.type)==="completed"?Q(()=>Z.onComplete(vt.result)):(vt==null?void 0:vt.type)==="failed"&&Q(()=>Z.onFailed({message:vt.error||"Job failed",kind:"job"}))}catch{}},st.onerror=()=>Q(()=>Z.onFailed({message:"Connection error",kind:"transport"})),setTimeout(()=>Q(()=>Z.onFailed({message:"Timed out",kind:"transport"})),3e4);return}catch{}if(M==="poll"&&(tt!=null&&tt.getJob)){const st=window.setInterval(async()=>{var mt;try{const vt=await tt.getJob("bulk-operations",$),pt=(vt==null?void 0:vt.status)||((mt=vt==null?void 0:vt.job)==null?void 0:mt.status),At=(vt==null?void 0:vt.result)||(vt==null?void 0:vt.data);pt==="failed"||At!=null&&At.final?(window.clearInterval(st),Q(()=>pt==="failed"?Z.onFailed({message:(At==null?void 0:At.error)||"Job failed",kind:"job"}):Z.onComplete(At))):pt==="completed"&&(window.clearInterval(st),Q(()=>Z.onComplete(At)))}catch{}},600);setTimeout(()=>{window.clearInterval(st),Q(()=>Z.onFailed({message:"Timed out",kind:"transport"}))},3e4);return}Q(()=>Z.onFailed({message:"Feedback transport unavailable",kind:"transport"}))},[]),Es=v.useCallback(async(M,$,I)=>{var mt,vt;const Z=t==null?void 0:t.files,B=encodeURIComponent(r||localStorage.getItem("token")||"");if(Z!=null&&Z.upload){const pt=await Z.upload(M,$||{},I),At=(pt==null?void 0:pt.url)||(pt==null?void 0:pt.path)||"";return At?(pt==null?void 0:pt.visibility)==="public"?At:`${er()}${At}?token=${B}`:""}const W=new FormData;W.append("file",M),$!=null&&$.entityType&&W.append("entityType",$.entityType),$!=null&&$.entityId&&W.append("entityId",$.entityId),$!=null&&$.visibility&&W.append("visibility",$.visibility);const Q=await fetch(`${er()}/files/upload`,{method:"POST",headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},body:W});if(!Q.ok)throw new Error("Upload failed");const tt=await Q.json(),X=((mt=tt==null?void 0:tt.asset)==null?void 0:mt.url)||(tt==null?void 0:tt.url)||(tt==null?void 0:tt.path)||(tt==null?void 0:tt.id)||"";return X?((vt=tt==null?void 0:tt.asset)==null?void 0:vt.visibility)==="public"?X:`${er()}${X}?token=${B}`:""},[]),Oh=v.useCallback(async(M,$,I,Z)=>{var Q;if(!(M!=null&&M.endpoint)||Z.length===0)return;const B=M.endpoint,W=M.optimistic??!0;try{const tt=await fetch(er()+B,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},body:JSON.stringify({ids:Z})});let X={};try{X=await tt.json()}catch{}if(!tt.ok){$e(((Q=X==null?void 0:X.error)==null?void 0:Q.message)||"Request failed","error");return}W!==!1&&(W==="remove"||W==="refresh"?W:X.softUpdate||(M.action==="delete"?"remove":"refresh"))==="remove"&&vc($,Z,"remove"),se(mt=>({...mt,_selIds:[],_selectMode:!1}));const st=(mt,vt,pt)=>{var At;if(mt)$e(pt||"Bulk operation failed","error");else{const a=vt||{},d=a.total??Z.length,g=a.successful??d;$e(g>=d?`${g} ${M.action}d`:`${g} of ${d} ${M.action}d`,"success")}kn($,I,0,((At=Cn[I])==null?void 0:At.limit)||10)};X.jobId&&X.token&&M.feedback?Bn(M.feedback,X.jobId,X.token,{onComplete:mt=>st(!1,mt),onFailed:mt=>{var vt;if(mt.kind==="transport"){kn($,I,0,((vt=Cn[I])==null?void 0:vt.limit)||10);return}st(!0,null,mt.message)}}):st(!1,X)}catch{$e("Request failed","error")}},[vc,Bn,kn,Cn]),wm=(M,$,I)=>{const Z=nu(M),B=Z.indexOf("(");if(B===-1)return M;const W=Z.slice(B+1,-1).trim(),Q=`sort: "${$}", dir: ${I==="desc"?'"desc"':'"asc"'}`;if(!W)return M.replace(/\(\)$/,`({${Q}})`);const tt=W.lastIndexOf(",");if(tt===-1)return M.replace(/\(([^)]*)\)$/,`(${W}, {${Q}})`);const X=W.slice(tt+1).trim();return X.startsWith("{")?M.replace(/\(([^)]*)\)$/,`(${W.slice(0,tt)}, {${X.slice(1,-1)}, ${Q}})`):M.replace(/\(([^)]*)\)$/,`(${W}, {${Q}})`)},bc=(M,$)=>{const I=nu(M),Z=I.indexOf("(");if(Z===-1)return M;const B=I.slice(Z+1,-1).trim(),W=`limit: ${$.limit}, page: ${$.page}`;if(!B)return M.replace(/\(\)$/,`({${W}})`);const Q=B.lastIndexOf(",");if(Q===-1)return M.replace(/\(([^)]*)\)$/,`(${B}, {${W}})`);const tt=B.slice(Q+1).trim();return tt.startsWith("{")?M.replace(/\(([^)]*)\)$/,`(${B.slice(0,Q)}, {${tt.slice(1,-1)}, ${W}})`):M.replace(/\(([^)]*)\)$/,`(${B}, {${W}})`)};v.useEffect(()=>()=>{tn.current=!0},[]),le.colors.background;const $n=v.useMemo(()=>`bf-preview-${Math.random().toString(36).slice(2,9)}`,[]),Mh=M=>M.replace(/:(\w+)/g,($,I)=>{const Z=he[I];return Z===void 0?$:String(Z)}),_m=M=>{try{const $=JSON.parse(M);if(Array.isArray($)&&$.length>0)return $.map(I=>{var Z;return I.message||`${((Z=I.path)==null?void 0:Z.join("."))||"field"} is invalid`})}catch{}return null};class $o extends Error{constructor(I,Z){super(I.join(", "));km(this,"errors");km(this,"body");this.errors=I,this.body=Z}}const qi=async(M,$)=>{var At,a,d,g,_;if(Ke.current||!ft)return;const{method:I,path:Z}=Ee(M),B=Mh(Z),W=I!=="GET"&&I!=="DELETE",Q=er();I!=="GET"&&Ch(I,B,he,($==null?void 0:$.optimistic)??!0);let tt;if($!=null&&$.payload&&typeof $.payload=="object"){tt={};for(const[C,k]of Object.entries($.payload))tt[C]=typeof k=="string"&&k.includes("{{")?Cs(k):k}else tt=he;tt=gc(tt);const X=await fetch(new URL(B,Q).toString(),{method:I,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},...W?{body:JSON.stringify(tt)}:{}});if(await Mo(X)||tn.current)return;let st;try{st=await X.json()}catch{if(tn.current)return;if(!X.ok)throw new $o([`Request failed: ${X.statusText}`]);return}if(!X.ok||st.success===!1){Zt(B,$==null?void 0:$.refetchScope);let C=["Something went wrong"];const k=typeof st.error=="string"?st.error:(At=st.error)==null?void 0:At.message;if(k){const F=k.replace(/^Validation failed:\s*/i,"");C=_m(F)||[F]}else st.message&&(C=[st.message]);throw new $o(C,st)}st.token&&localStorage.setItem("token",st.token),$!=null&&$.openUrl&&(st!=null&&st.url)&&String(st.url).startsWith("http")&&window.open(String(st.url),"_blank","noopener,noreferrer"),st&&typeof st=="object"&&!Array.isArray(st)&&se(C=>({...C,feedback:st})),st.data&&($==null?void 0:$.mergeResponse)!==!1&&se(C=>({...C,...st.data})),st.user&&typeof st.user=="object"?se(C=>({...C,user:st.user})):se(C=>({...C})),sn.current[B.replace(/^\//,"")]={response:st};for(const[C,k]of Object.entries(Ts.current))if(k===B||k.endsWith(B)){const F=sn.current[C];sn.current[C]={items:Array.isArray(F)?F:Array.isArray(F==null?void 0:F.items)?F.items:[],response:st}}const mt=(d=(a=st.subscribe)==null?void 0:a.websocket)==null?void 0:d.workflowChannel;mt&&($==null?void 0:$.mergeResponse)!==!1&&se(C=>{var k,F,et,ot;return{...C,liveCastChannel:mt,execution_id:st.draftId||C.execution_id,id:st.sessionId||C.id,status:"running",test_session:{...C.test_session||{},id:st.sessionId||((k=C.test_session)==null?void 0:k.id),execution_id:st.draftId||((F=C.test_session)==null?void 0:F.execution_id),status:"running",liveCastChannel:mt,prompt:(tt==null?void 0:tt.prompt)||((et=C.test_session)==null?void 0:et.prompt),url:(tt==null?void 0:tt.url)||((ot=C.test_session)==null?void 0:ot.url)}}}),Zt(B,$==null?void 0:$.refetchScope);const vt=$==null?void 0:$.feedback,pt=typeof vt=="string"?vt:vt==null?void 0:vt.transport;if(pt&&st.jobId&&(st.token||(g=st.subscribe)!=null&&g.sse||typeof vt=="object")){let C=(_=st.subscribe)!=null&&_.sse?/^https?:\/\//.test(st.subscribe.sse)?st.subscribe.sse:Q+st.subscribe.sse:void 0;if(typeof vt=="object"&&vt.subscribeUrl){const k=String(vt.subscribeUrl).trim(),F=k.startsWith("{{")&&k.endsWith("}}")?k.slice(2,-2).trim():k,et=F.match(/^\[(.+?)\](?:\.(.*))?$/),ot=et?Gr(`${et[1]}${et[2]?"."+et[2]:""}`):F.split(".").reduce((dt,Pt)=>dt==null?void 0:dt[Pt],st);ot&&(C=/^https?:\/\//.test(ot)?ot:Q+ot)}if(C){Bn(pt,st.jobId,st.token,{sseUrl:C,onProgress:k=>{s==null||s(k);const F=Date.now();F-_o.current>=2e3&&(_o.current=F,Zt(B,$==null?void 0:$.refetchScope))},onComplete:k=>{const F=(k==null?void 0:k.result)??k;if(F&&typeof F=="object"){const et=B.replace(/^\//,"");sn.current[et]={response:F},se(ot=>({...ot}))}Zt(B,$==null?void 0:$.refetchScope)},onFailed:k=>{Zt(B,$==null?void 0:$.refetchScope),k.kind!=="transport"&&$e(k.message||"Job failed","error")}});return}Bn(pt,st.jobId,st.token,{onComplete:k=>{const F=k||{},et=F.total,ot=F.successful;et!==void 0&&$e(ot>=et?`${ot} completed`:`${ot} of ${et} completed`,"success"),Zt(B,$==null?void 0:$.refetchScope)},onFailed:k=>{if(k.kind==="transport"){Zt(B,$==null?void 0:$.refetchScope);return}$e(k.message||"Job failed","error"),Zt(B,$==null?void 0:$.refetchScope)}})}},qr=M=>{var Z,B;un(null);const $=M==="/"&&(((Z=nt.find(W=>W.route==="/"))==null?void 0:Z.id)||((B=nt.find(W=>W.type==="render_scene"))==null?void 0:B.id))||M;if(it($)&&!ft){cn.current=$,Rt(!0);return}te(W=>[...W,Ot]),Dn($)},nr=(M,$="error")=>{if(se(I=>({...I,gateTitle:M.uiTitle||"Usage Notice",gateMessage:M.message})),M.uiVariant!=="modal"){const I=M.uiTitle?`${M.uiTitle}
195
195
  ${M.message}`:M.message;$e(I,$);return}if(M.modalId&&Fe[M.modalId]){un({id:M.modalId,definition:Fe[M.modalId]});return}un({id:"__legacy",definition:{title:M.uiTitle||"Usage Notice",components:[{type:"text",text:M.message,color:le.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.7)",fontSize:14}],actions:[{label:"OK",variant:"primary",dismiss:!0}]}})},xc=(M,$)=>{const I=M.body;if(!I)return!1;const Z=typeof(I==null?void 0:I.message)=="string"&&I.message||M.errors[0]||"Request blocked by limits",B=()=>nr({message:Z,uiVariant:I.uiVariant,uiTitle:typeof(I==null?void 0:I.uiTitle)=="string"?I.uiTitle:void 0,modalId:typeof(I==null?void 0:I.modalId)=="string"?I.modalId:void 0});return I.gateAction==="login"?(ee("login"),!0):I.gateAction==="upgrade"?I.uiVariant==="modal"||typeof(I==null?void 0:I.modalId)=="string"?(B(),!0):$!=null&&$.upgradeScene?(qr($.upgradeScene),!0):(B(),!0):I.gateAction==="block"||I.gateAction==="warn"||I.warning?(B(),!0):!1};v.useEffect(()=>{if(!ft||Y)return;const M=cn.current;!M||!nt.some($=>$.id===M)||(cn.current=null,qr(M))},[ft,Y,nt]);const $e=(M,$="success",I)=>{const Z=Array.isArray(M)?M.join(`
196
- `):M,B=$==="success",F=B?"#10B981":"#EF4444",Q=le.toast||{},tt=I??Q.duration??3e3,X=Q.position||"bottom-right",st={"bottom-right":{right:"24px",bottom:"24px"},"bottom-left":{left:"24px",bottom:"24px"},"bottom-center":{left:"50%",bottom:"24px",transform:"translateX(-50%)"},"top-right":{right:"24px",top:"24px"},"top-left":{left:"24px",top:"24px"},"top-center":{left:"50%",top:"24px",transform:"translateX(-50%)"}},gt=st[X]||st["bottom-right"],vt=document.createElement("div"),pt=document.createElement("span");pt.textContent=B?"✓":"✕",Object.assign(pt.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"22px",height:"22px",minWidth:"22px",borderRadius:"50%",backgroundColor:`${F}26`,color:F,fontSize:"12px",fontWeight:"700"});const At=document.createElement("span");At.textContent=Z,Object.assign(At.style,{color:"rgba(255, 255, 255, 0.92)",fontSize:"13.5px",lineHeight:"1.45",whiteSpace:"pre-line"}),Object.assign(vt.style,{position:"fixed",...gt,zIndex:"2147483647",display:"flex",alignItems:"flex-start",gap:"10px",padding:"12px 16px",borderRadius:"12px",backgroundColor:"rgba(23, 25, 35, 0.97)",border:"1px solid rgba(148, 163, 184, 0.25)",boxShadow:"0 8px 28px rgba(0, 0, 0, 0.4)",maxWidth:"380px",opacity:"0",pointerEvents:"auto"}),vt.appendChild(pt),vt.appendChild(At),document.body.appendChild(vt),vt.animate([{opacity:0,transform:"translateX(24px)"},{opacity:1,transform:"translateX(0)"}],{duration:250,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"both"}).finished.catch(()=>{});const d=()=>{vt.animate([{opacity:1,transform:"translateX(0)"},{opacity:0,transform:"translateX(16px)"}],{duration:200,easing:"ease",fill:"both"}).finished.then(()=>vt.remove()).catch(()=>vt.remove())};return tt>0&&setTimeout(d,tt),{update:g=>{At.textContent=Array.isArray(g)?g.join(`
197
- `):g},dismiss:d}},Zn=(M,$=!0)=>{if($&&(M!=null&&M.onSuccess)){const I=Array.isArray(M.onSuccess)?M.onSuccess:[M.onSuccess];for(const Z of I){const{type:B,value:F,title:Q,key:tt}=Z;switch(B){case"toast":$e(F||"Success!","success");break;case"navigate":F&&qr(F);break;case"redirect":F&&(window.location.href=F);break;case"modal":F&&Fe[F]?un({id:F,definition:Fe[F]}):un({id:"__legacy",definition:{title:Q||"Success",components:F?[{type:"text",text:F,color:le.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.7)",fontSize:14}]:[],actions:[{label:"OK",variant:"primary",dismiss:!0}]}});break;case"route":F&&qi(F);break;case"set_data":tt&&F!==void 0&&se(X=>({...X,[tt]:F}));break}}}else!$&&(M!=null&&M.onError)&&$e(M.onError.message||"An error occurred","error")},kh=()=>{var ot,dt,Pt,kt,Yt,fn,oe;const M=async()=>{var Kt,Ne,Ge,Ji,zn,Ls;if(!qt||!ye||On==="register"&&!ve)return;const St=Vr(qt),jt=Vi(ye);if(St||jt){hn(St||jt);return}if(On==="register"&&ve!==ye){Tr("confirm","Passwords do not match"),hn("Passwords do not match");return}ke(!0),hn(null);try{const sr=On==="login"?"/auth/login":"/auth/register",be=`${er().replace(/\/+$/,"")}${sr}`,Ba=On==="login"?{email:qt,password:ye,tenantId:w}:{email:qt,password:ye,displayName:qt.split("@")[0],tenantId:w},Yh={"Content-Type":"application/json"},Mm=["localhost","127.0.0.1","[::1]"].includes(window.location.hostname);T&&!Mm&&(Yh["x-app-id"]=T);const Ic=await fetch(be,{method:"POST",headers:Yh,body:JSON.stringify(Ba)});if(!Ic.ok){const t2=await Ic.json().catch(()=>({error:"Authentication failed"}));throw new Error(Oo(t2))}const Fn=await Ic.json();if(Array.isArray(Fn)||Fn.success===!1)throw new Error(Oo(Fn));const Rc=((Kt=Fn.data)==null?void 0:Kt.token)||Fn.token||Fn.accessToken||Fn.idToken;Rc&&localStorage.setItem("token",Rc);const Kh=((Ne=Fn.data)==null?void 0:Ne.refreshToken)||Fn.refreshToken;Kh&&localStorage.setItem("backflow_refresh_token",Kh);const Ax=((Ji=(Ge=Fn.data)==null?void 0:Ge.user)==null?void 0:Ji.id)||((zn=Fn.user)==null?void 0:zn.id)||((Ls=Fn.data)==null?void 0:Ls.userId);if(Ax&&localStorage.setItem("backflow_refresh_user_id",Ax),!ft&&(rt||Ke.current||!!cn.current)){window.location.reload();return}Ke.current=!1,Ct(!0),Rt(!1),G(!1),mr(""),wt(""),It(""),_s({}),hn(null)}catch(sr){const be=typeof sr=="string"?sr:(sr==null?void 0:sr.message)||JSON.stringify(sr)||"Authentication failed";hn(be),$e(be,"error")}finally{ke(!1)}},$=async()=>{if(!qt)return;const St=Vr(qt);if(St){hn(St);return}ke(!0),hn(null);try{const jt=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:qt})});if(!jt.ok){const Kt=await jt.json().catch(()=>({error:"Failed to send reset email"}));throw new Error(Oo(Kt))}ee("reset"),Mn(""),wt(""),hn(null)}catch(jt){const Kt=typeof jt=="string"?jt:(jt==null?void 0:jt.message)||"Failed to send reset email";hn(Kt),$e(Kt,"error")}finally{ke(!1)}},I=async()=>{if(!Wi||!ye)return;const St=Vi(ye);if(St){hn(St);return}ke(!0),hn(null);try{const jt=await fetch("/api/auth/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:Wi,password:ye})});if(!jt.ok){const Kt=await jt.json().catch(()=>({error:"Failed to reset password"}));throw new Error(Oo(Kt))}ee("login"),mr(""),wt(""),Mn(""),hn(null)}catch(jt){const Kt=typeof jt=="string"?jt:(jt==null?void 0:jt.message)||"Failed to reset password";hn(Kt),$e(Kt,"error")}finally{ke(!1)}},Z=St=>{ee(St),hn(null),St!=="reset"&&(Mn(""),wt("")),It(""),_s({})},B=le.colorMode==="dark",F=B?"#f3f4f6":"#111827",Q=B?"#9ca3af":"#6b7280",tt=B?"#374151":"#f3f4f6",X=B?"#4b5563":"#d1d5db",st=B?"#ffffff":"#000000",gt=B?"#000000":"#ffffff",vt=B?"#1f2937":"#ffffff",pt="#ef4444",At=(St="12px")=>({width:"100%",padding:"12px 16px",border:`1px solid ${X}`,borderRadius:"8px",fontSize:"14px",backgroundColor:tt,color:F,outline:"none",marginBottom:St,boxSizing:"border-box"}),a=(St,jt,Kt,Ne,Ge,Ji)=>v.createElement("div",{key:St,style:{position:"relative",marginBottom:"12px"}},U("input",{key:"input",type:ae[St]?"text":"password",placeholder:jt,value:Kt,onChange:zn=>Ne(zn.target.value),onKeyDown:zn=>{zn.key==="Enter"&&Ge()},style:{...At("0px"),paddingRight:"40px",borderColor:Ji?pt:X}}),v.createElement("button",{key:"toggle",type:"button","aria-label":ae[St]?"Hide password":"Show password",onClick:()=>_s(zn=>({...zn,[St]:!zn[St]})),style:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:Q,display:"flex",alignItems:"center",padding:"4px"}},In.renderIcon(ae[St]?"eye-off":"eye",16)));l||e!=null&&e.title;const d=(ot=e==null?void 0:e.config)!=null&&ot.logo&&((dt=e==null?void 0:e.config)==null?void 0:dt.logo)!==""?e.config.logo:"",g=c||((Pt=e==null?void 0:e.navigation)==null?void 0:Pt.logo)||"mail",_=[];_.push(v.createElement("div",{key:"brand",role:"button","aria-label":"Go back home",onClick:()=>{qr("/"),Rt(!1),Ke.current=!1,cn.current=null},style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"20px",cursor:"pointer"}},d?v.createElement("img",{src:d,alt:"",style:{width:"56px",height:"56px",objectFit:"contain"}}):In.renderIcon(g,56))),On==="login"?(_.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:F,marginBottom:"8px",textAlign:"center"}},"Sign In")),_.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:Q,marginBottom:"24px",textAlign:"center"}},"Enter your credentials to continue")),_.push(U("input",{key:"email",type:"email",placeholder:"Email Address",value:qt,onChange:St=>{mr(St.target.value),Tr("email",Vr(St.target.value))},style:{...At(),borderColor:Te.email&&qt?pt:X}})),Te.email&&qt&&_.push(v.createElement("p",{key:"email-err",style:{color:pt,fontSize:"12px",marginTop:"-8px",marginBottom:"8px"}},Te.email)),_.push(a("pass","Password",ye,St=>{wt(St),Tr("pass",Vi(St))},M,!!(Te.pass&&ye))),Te.pass&&ye&&_.push(v.createElement("p",{key:"pass-err",style:{color:pt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Te.pass)),li&&_.push(v.createElement("p",{key:"err",style:{color:pt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},li)),_.push(v.createElement("button",{key:"submt",onClick:M,disabled:qe||!qt||!ye,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:qe?B?"#4b5563":"#9ca3af":st,color:gt,border:"none",cursor:qe?"not-allowed":"pointer",marginBottom:"8px"}},qe?"Please wait...":"Sign In")),_.push(v.createElement("p",{key:"forgot",style:{fontSize:"13px",color:Q,textAlign:"center",cursor:"pointer",marginBottom:"16px"},onClick:()=>Z("forgot")},"Forgot password?")),_.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:Q,textAlign:"center",cursor:"pointer"},onClick:()=>Z("register")},"Don’t have an account? Register"))):On==="register"?(_.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:F,marginBottom:"8px",textAlign:"center"}},"Create Account")),_.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:Q,marginBottom:"24px",textAlign:"center"}},"Create an account to get started")),_.push(U("input",{key:"email",type:"email",placeholder:"Email",value:qt,onChange:St=>{mr(St.target.value),Tr("email",Vr(St.target.value))},style:{...At(),borderColor:Te.email&&qt?pt:X}})),Te.email&&qt&&_.push(v.createElement("p",{key:"email-err",style:{color:pt,fontSize:"12px",marginTop:"-8px",marginBottom:"8px"}},Te.email)),_.push(a("pass","Password",ye,St=>{wt(St),Tr("pass",Vi(St))},M,!!(Te.pass&&ye))),Te.pass&&ye&&_.push(v.createElement("p",{key:"pass-err",style:{color:pt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Te.pass)),_.push(a("confirm","Confirm password",ve,St=>{It(St),Tr("confirm",Ps(ye,St))},M,!!(Te.confirm&&ve))),Te.confirm&&ve&&_.push(v.createElement("p",{key:"confirm-err",style:{color:pt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Te.confirm)),li&&_.push(v.createElement("p",{key:"err",style:{color:pt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},li)),_.push(v.createElement("button",{key:"submt",onClick:M,disabled:qe||!qt||!ye||!ve,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:qe?B?"#4b5563":"#9ca3af":st,color:gt,border:"none",cursor:qe?"not-allowed":"pointer",marginBottom:"16px"}},qe?"Please wait...":"Create Account")),_.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:Q,textAlign:"center",cursor:"pointer"},onClick:()=>Z("login")},"Already have an account? Sign In"))):On==="forgot"?(_.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:F,marginBottom:"8px",textAlign:"center"}},"Reset Password")),_.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:Q,marginBottom:"24px",textAlign:"center"}},"Enter your email to receive a reset link")),_.push(U("input",{key:"email",type:"email",placeholder:"Email",value:qt,onChange:St=>{mr(St.target.value),Tr("email",Vr(St.target.value))},onKeyDown:St=>{St.key==="Enter"&&$()},style:{...At("16px"),borderColor:Te.email&&qt?pt:X}})),Te.email&&qt&&_.push(v.createElement("p",{key:"email-err",style:{color:pt,fontSize:"12px",marginTop:"-8px",marginBottom:"8px"}},Te.email)),li&&_.push(v.createElement("p",{key:"err",style:{color:pt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},li)),_.push(v.createElement("button",{key:"submt",onClick:$,disabled:qe||!qt,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:qe?B?"#4b5563":"#9ca3af":st,color:gt,border:"none",cursor:qe?"not-allowed":"pointer",marginBottom:"16px"}},qe?"Please wait...":"Send Reset Link")),_.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:Q,textAlign:"center",cursor:"pointer"},onClick:()=>Z("login")},"Back to Sign In"))):On==="reset"&&(_.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:F,marginBottom:"8px",textAlign:"center"}},"Set New Password")),_.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:Q,marginBottom:"24px",textAlign:"center"}},"Enter the reset code and your new password")),_.push(U("input",{key:"code",type:"text",placeholder:"Reset code",value:Wi,onChange:St=>Mn(St.target.value),style:At()})),_.push(a("pass","New password",ye,St=>{wt(St),Tr("pass",Vi(St))},I,!!(Te.pass&&ye))),Te.pass&&ye&&_.push(v.createElement("p",{key:"pass-err",style:{color:pt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Te.pass)),li&&_.push(v.createElement("p",{key:"err",style:{color:pt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},li)),_.push(v.createElement("button",{key:"submt",onClick:I,disabled:qe||!Wi||!ye,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:qe?B?"#4b5563":"#9ca3af":st,color:gt,border:"none",cursor:qe?"not-allowed":"pointer",marginBottom:"16px"}},qe?"Please wait...":"Reset Password")),_.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:Q,textAlign:"center",cursor:"pointer"},onClick:()=>Z("login")},"Back to Sign In")));const C=((kt=e==null?void 0:e.config)==null?void 0:kt.auth)||{},k=C.style==="page"?"page":"modal",W=C.containerStyle||{},et=v.createElement("div",{key:"auth-box",style:{width:"100%",maxWidth:k==="page"?"400px":"360px",padding:"24px",backgroundColor:"#000000",borderRadius:"12px",...W}},..._);if(k==="page"){const St=((Yt=le.colors)==null?void 0:Yt.primary)||"#4f46e5",jt=C.coverImage?`url(${C.coverImage}) center/cover no-repeat`:St,Kt=(fn=e==null?void 0:e.config)!=null&&fn.logo&&((oe=e==null?void 0:e.config)==null?void 0:oe.logo)!==""?e.config.logo:"",Ne=Kt?v.createElement("img",{src:Kt,alt:"",style:{position:"absolute",bottom:"-6%",left:"50%",width:"90%",maxWidth:"660px",height:"auto",objectFit:"contain",transform:"translateX(-50%) rotate(-8deg)",opacity:.92,filter:"brightness(0) invert(1)"}}):v.createElement("div",{style:{color:"#ffffff",opacity:.95}},In.renderIcon(g,96));return v.createElement("div",{key:"auth-page",style:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",backgroundColor:vt,zIndex:1e4,animation:"bf-fade-in 0.2s ease"}},v.createElement("div",{style:{flex:ai?"1 1 100%":"0 0 40%",display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",backgroundColor:"#000000"}},et),v.createElement("div",{style:{flex:"0 0 60%",background:jt,display:ai?"none":"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"}},Ne))}return v.createElement("div",{key:"auth-form",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,animation:"bf-fade-in 0.15s ease"}},et)},ka=async(M,$,I)=>{var Z,B;try{let F=String(Cs(M)??"");const Q=F.match(/^\{\{\s*(.+?)\s*\?\s*(.*?)\s+:\s+(.*?)\s*\}\}$/);Q&&(F=fi(Q[1])?Q[2]:Q[3]);const tt=F.split(";").map(a=>a.trim()).filter(Boolean);if(tt.length>1){for(const a of tt)await ka(a,void 0,I);return}if(F==="go_back"){Po();return}if(F==="toggle_theme"){As((he._colorMode||le.colorMode)==="dark"?"light":"dark");return}if(F==="close_modal"){Fi();return}const X=F.match(/^(toast|show_toast):(.*)$/);if(X){const a=X[2].trim();a&&$e(a,"success");return}const st=F.match(/^scroll_to:([\w-]+)$/);if(st){(Z=document.getElementById(st[1]))==null||Z.scrollIntoView({behavior:"smooth",block:"start"});return}const gt=F.match(/^set_data:([\w.]+)=(.*)$/);if(gt){se(a=>({...a,[gt[1]]:gt[2]}));return}const vt=F.match(/^native:([a-z][\w.-]*)$/i);if(vt){if(!i){$e("Native app required","error");return}const a=vt[1],d=await i(a,he);if(d&&typeof d=="object"&&!Array.isArray(d)){const g=a.replace(/[^\w]/g,"_");se(_=>({..._,native:{..._.native||{},[g]:d}}))}return}const pt=F.match(/^copy_to_clipboard:(.*)$/);if(pt){const a=pt[1];try{await navigator.clipboard.writeText(a)}catch{const d=document.createElement("textarea");d.value=a,d.style.position="fixed",d.style.opacity="0",document.body.appendChild(d),d.select(),document.execCommand("copy"),d.remove()}$e("API key copied","success");return}const At=F.match(/^auth:(login|register|forgot|reset|logout)$/);if(At){if(At[1]==="logout"){if(!ft)return;localStorage.removeItem("token"),localStorage.removeItem("backflow_refresh_token"),localStorage.removeItem("backflow_refresh_user_id"),Ke.current=!1,cn.current=null,Ct(!1),Rt(!1),lt(null),G(!1),qr("/");return}if(ft)return;hn(null),ee(At[1]),Rt(!0);return}if(F==="accept_startup_modal"){const a=le.startupModal;a&&localStorage.setItem(`backflow_startup_modal_${a}`,"1"),Fi();const d=nt.find(g=>g.route==="/");d&&(te(g=>[...g,Ot]),Dn(d.id));return}if(F==="decline_startup_modal"){Fi();const a=nt.find(d=>d.route==="/");a&&(te(d=>[...d,Ot]),Dn(a.id));return}if(F==="toggle_select"){se(a=>({...a,_selectMode:!a._selectMode,...a._selectMode?{_selIds:[]}:{}}));return}if(F.startsWith("go_to_step:"))qr(F.replace("go_to_step:","")),Zn($,!0);else if(F.startsWith("navigate:"))qr(F.replace("navigate:","")),Zn($,!0);else if(vu(F)&&t){const a=nu(F),d=await Wf(t,a,he);d!=null&&d.data?se(g=>({...g,...d.data})):d&&typeof d=="object"&&!Array.isArray(d)&&se(g=>({...g,...d})),d!=null&&d.url&&String(d.url).startsWith("http")&&window.open(String(d.url),"_blank","noopener,noreferrer"),Zn($,!0)}else if(F.startsWith("show_modal:")){const a=F.replace("show_modal:","");if(Fe[a]){const d=Fe[a];if(xs(d.popover&&(I!=null&&I.anchorElement)?I.anchorElement.getBoundingClientRect():null),ws.current=d.popover&&(I==null?void 0:I.anchorElement)||null,Hr.current&&typeof Hr.current=="object"){const C=Object.keys(Hr.current);se(k=>{const W={...k};for(const et of Ma.current)C.includes(et)||delete W[et];return{...W,...Hr.current}}),Ma.current=C}const g=d.clearFormKeys;Array.isArray(g)&&g.length>0&&se(C=>{const k={...C};for(const W of g)delete k[W];return k});const _=d.defaults;_&&typeof _=="object"&&se(C=>{const k={...C};for(const[W,et]of Object.entries(_))k[W]===void 0&&(k[W]=et);return k}),d.preload&&await qi(String(d.preload)),(Ae==null?void 0:Ae.id)===a||(_n==null?void 0:_n.id)===a||(tr(null),un({id:a,definition:d}))}else{const d=a.split("|");un({id:"__legacy",definition:{title:d[0]||"Notice",components:d[1]?[{type:"text",text:d[1],color:"rgba(255,255,255,0.7)",fontSize:14}]:[],actions:[{label:"OK",variant:"primary",dismiss:!0}]}})}Zn($,!0)}else F.startsWith("execute_workflow:")?(await qi(F.replace("execute_workflow:",""),I),Zn($,!0)):F.startsWith("fetch:")&&(await qi(F.replace("fetch:",""),I),o==null||o(F.replace("fetch:","")),Zn($,!0))}catch(F){if(Zg("[handleButtonClick] caught error:",F,"callbacks:",$),(F==null?void 0:F.status)===401){await Mo({status:401},!0);return}if(F instanceof $o){if(xc(F,$==null?void 0:$.onError))return;$e(F.errors.length>1?F.errors:F.errors[0],"error")}else(B=$==null?void 0:$.onError)!=null&&B.message?$e($.onError.message,"error"):$e(F instanceof Error?F.message:"An error occurred","error")}},$a=M=>{const $=M&&typeof M=="object"&&"_seconds"in M?new Date(M._seconds*1e3):new Date(M);if(isNaN($.getTime()))return String(M??"");const I=Math.floor((Date.now()-$.getTime())/6e4);if(I<1)return"just now";if(I<60)return`${I}m ago`;const Z=Math.floor(I/60);if(Z<24)return`${Z}h ago`;const B=Math.floor(Z/24);return B<7?`${B}d ago`:$.toLocaleDateString()},Gi=(M,$)=>{if($==="timeago")return $a(M);const I=M&&typeof M=="object"&&"_seconds"in M?new Date(M._seconds*1e3):new Date(M);if(!isNaN(I.getTime())){if($==="date")return I.toLocaleDateString();if($==="time")return I.toLocaleTimeString();if($==="datetime")return I.toLocaleString()}return String(M??"")},sn=v.useRef({}),Gr=M=>{const $=M.split(".").filter(Boolean);if($.length===0)return;let I=sn.current[$[0]]??he[$[0]];for(let Z=1;Z<$.length;Z++){if(I==null)return;const B=$[Z];if(Array.isArray(I))if(B==="first")I=I[0];else if(B==="last")I=I[I.length-1];else if(B==="length")I=I.length;else if(/^\d+$/.test(B))I=I[Number(B)];else if(B==="index")I=I[0];else return;else if(I&&typeof I=="object"&&Array.isArray(I.items))B==="response"?I=I.response:B==="first"?I=I.items[0]:B==="last"?I=I.items[I.items.length-1]:B==="length"?I=I.items.length:/^\d+$/.test(B)?I=I.items[Number(B)]:B==="index"?I=I.items[0]:I=I[B];else if(typeof I=="object")I=I[B];else return}return I},wc=v.useRef({}),[$h,Ia]=v.useState({}),Sm=v.useCallback(M=>(wc.current[M]||(wc.current[M]=import(M).catch(()=>fetch(M).then($=>$.text()).then($=>{const I={};return new Function("module","exports",$)(I,I),I.exports||I}))),wc.current[M]),[]),_c=(M,$,I,Z)=>{if(!M)return"";if(M.startsWith("sdk:")){const Q=I||"",tt=$h[Q];if(Q&&tt!==void 0)return tt;const X=M.slice(4);return t&&Wf(t,X,{...he,$data:sn.current}).then(st=>{tn.current||(Z&&(sn.current[Z]=st),Ia(gt=>({...gt,[Q]:String(st??"")})))}).catch(()=>{}),""}const B=M.match(/^([A-Za-z_]\w*)\s*\(\s*(.*?)\s*\)$/s);if(B){const Q=B[1],tt=_c(B[2]);if($){const X=$h[I||""];return I&&X!==void 0?X:(Sm($).then(st=>{var vt,pt;const gt=st&&(st[Q]||((vt=st.default)==null?void 0:vt[Q])||((pt=st.exports)==null?void 0:pt[Q]))||(typeof st=="function"?st:void 0);typeof gt=="function"&&I&&Promise.resolve(gt(tt,{data:sn.current})).then(At=>{tn.current||(Z&&(sn.current[Z]=At),Ia(a=>({...a,[I]:String(At??"")})))})}).catch(()=>{}),"")}return Q==="timeago"?$a(tt):Q==="date"?Gi(tt,"date"):Q==="time"?Gi(tt,"time"):Q==="datetime"?Gi(tt,"datetime"):Q==="upper"?String(tt).toUpperCase():Q==="lower"?String(tt).toLowerCase():String(tt??"")}if(M.startsWith("{{")&&M.endsWith("}}")){const tt=M.slice(2,-2).trim().split("|").map(vt=>vt.trim()),X=tt[0],st=tt[1],gt=X.startsWith("{")&&X.endsWith("}")?Gr(X.slice(1,-1)):X.startsWith("$")?Gr(X.slice(1)):he[X];return st?Gi(gt,st):String(gt??"")}if(M.startsWith("{")&&M.endsWith("}"))return String(Gr(M.slice(1,-1))??"");const F=M.trim();return/^[A-Za-z_][\w.-]*$/.test(F)?String(Gr(F)??""):String(M??"")},Cs=M=>M?M.replace(/\{\{\s*\[([\w/.-]+)\](?:\.([\w.]+(?:\|\w+)?))?\s*(?:\|\|\s*(.+?))?\}\}/g,($,I,Z,B)=>{let F,Q=Z;if(Z!=null&&Z.includes("|")){const X=Z.split("|");Q=X[0],F=X[1]}const tt=Gr(Q?`${I}.${Q}`:I);if(tt!=null){const X=F?Gi(tt,F):tt;return Array.isArray(X)||typeof X=="object"?JSON.stringify(X):String(X)}return B!==void 0?B.replace(/^["']|["']$/g,""):""}).replace(/\{\{(\w+(?:\.\w+)*)\s*(?:\|(date|time|datetime|timeago)\s*)?(?:\|\|\s*(.+?))?\}\}/g,($,I,Z,B)=>{const F=I.split(".");let Q=he;for(const tt of F)Q=Q==null?void 0:Q[tt];if(Q!==void 0)return Z?Gi(Q,Z):String(Q);if(Hr.current){let tt=Hr.current;for(const X of F)tt=tt==null?void 0:tt[X];if(tt!==void 0)return Z?Gi(tt,Z):String(tt)}if(F[0]==="config"){let tt=e==null?void 0:e.config;for(const X of F.slice(1))tt=tt==null?void 0:tt[X];if(tt!==void 0)return String(tt)}return B!==void 0?B.replace(/^["']|["']$/g,""):""}):"",hi=(M,$)=>{if(!M)return!0;if(typeof M=="object")try{const F=tt=>{const X=Date.parse(String(tt));return Number.isNaN(X)?Number(tt):X},Q={...he,...$,now:()=>Date.now(),date:F,isAfter:(tt,X)=>F(tt)>F(X),isBefore:(tt,X)=>F(tt)<F(X),includes:(tt,X)=>Array.isArray(tt)?tt.includes(X):String(tt??"").includes(String(X??"")),length:tt=>String(tt??"").length,lower:tt=>String(tt??"").toLowerCase(),upper:tt=>String(tt??"").toUpperCase(),round:Math.round,abs:Math.abs};return!!aht.evaluate(M.expression,Q)}catch{return!1}const I=F=>{var tt;if(F==="auth"){const X=(tt=e==null?void 0:e.auth)==null?void 0:tt.signedIn;return X===void 0?ft:X}if(F.startsWith("[")&&F.includes("]")){const X=F.indexOf("]"),st=sn.current[F.slice(1,X)],gt=F.slice(X+1).replace(/^\./,"");let vt;const pt=gt.split(".").filter(Boolean);pt[0]==="response"||pt[0]==="items"?vt=st:vt=(st==null?void 0:st.items)??st;for(const At of pt){if(vt==null)return;Array.isArray(vt)&&At==="length"?vt=vt.length:vt=vt==null?void 0:vt[At]}return vt}let Q=$;for(const X of F.split("."))Q=Q==null?void 0:Q[X];return Q},Z=M.trim();if(Z.includes("||"))return Z.split("||").some(F=>hi(F,$));if(Z.includes("&&"))return Z.split("&&").every(F=>hi(F,$));if(Z.startsWith("!"))return!I(Z.slice(1).trim());const B=Z.match(/^(\[[^\]]+\](?:\.\w+)*|\w+(?:\.\w+)*)\s*(==|!=|>|<|>=|<=)\s*(.+)$/);if(B){const F=I(B[1]),Q=B[3].trim().replace(/^["']|["']$/g,"");switch(B[2]){case"==":return String(F)===Q;case"!=":return String(F)!==Q;case">":return Number(F)>Number(Q);case"<":return Number(F)<Number(Q);case">=":return Number(F)>=Number(Q);case"<=":return Number(F)<=Number(Q)}}return!!I(Z)},fi=(M,$)=>hi(M,$||he),Pm=(M,$,I)=>{if(!f||h!==$&&!(u&&I&&u===I))return M;const B={...M};return f.size!==void 0&&(B.transform=`scale(${f.size/100})`,B.transformOrigin="center center"),f.spacing!==void 0&&(B.margin=`${f.spacing}px`),f.alignment&&(B.textAlign=f.alignment,f.alignment==="left"?(B.marginLeft="0",B.marginRight="auto"):f.alignment==="right"&&(B.marginLeft="auto",B.marginRight="0")),f.color&&(B.color=f.color),f.gridCols!==void 0&&(B.gridTemplateColumns=`repeat(${f.gridCols}, minmax(0, 1fr))`),f.gridGap!==void 0&&(B.gap=`${f.gridGap}px`),f.buttonBackground&&(B.background=f.buttonBackground),f.buttonTextColor&&(B.color=f.buttonTextColor),f.buttonBorderRadius!==void 0&&(B.borderRadius=`${f.buttonBorderRadius}px`),f.linkColor&&(B.color=f.linkColor),f.linkTextDecoration&&(B.textDecoration=f.linkTextDecoration),f.flexDirection&&(B.flexDirection=f.flexDirection),f.flexGap!==void 0&&(B.gap=`${f.flexGap}px`),B},Os=(M,$)=>{const I={...M};return $.scale!==void 0&&$.scale!==100&&(I.transform=`scale(${$.scale/100})`,I.transformOrigin="center center"),$.spacing!==void 0&&$.spacing!==0&&(I.margin=`${$.spacing}px`),$.alignment&&$.alignment!=="center"&&(I.textAlign=$.alignment,$.alignment==="left"?(I.marginLeft="0",I.marginRight="auto"):$.alignment==="right"&&(I.marginLeft="auto",I.marginRight="0")),$.color&&(I.color=$.color),$.background&&(I.backgroundColor=$.background),$.borderColor&&(I.borderColor=$.borderColor),I},rr=(M,$,I)=>{const Z=I==null?void 0:I.componentClass,F=h===M||u&&Z&&u===Z,Q=I?Os($,I):$,tt=Pm(Q,M,Z),X=(I==null?void 0:I.className)||"";/\bfont-serif\b/.test(X)&&(tt.fontFamily=le.typography.headingFontFamily),/\bfont-sans\b/.test(X)&&(tt.fontFamily=le.typography.fontFamily),I!=null&&I.fieldSpan&&I.fieldSpan>1&&(tt.gridColumn=`span ${I.fieldSpan} / span ${I.fieldSpan}`),I!=null&&I.rawStyle&&Object.assign(tt,I.rawStyle);const st=Et==="css-driven"?{"data-bf-r":`${$n}-${M}`}:{};if(F){const vt=tt.boxShadow?`${tt.boxShadow}, `:"";return{"data-component-key":M,...st,style:{...tt,boxShadow:`${vt}0 0 0 3px ${le.colors.primary}`}}}return Object.keys(tt).length>0?{"data-component-key":M,...st,style:tt}:{"data-component-key":M,...st}},Ih=(M,$)=>{var Q;if(!M)return{};const I=by(M),Z=M.split(/\s+/).filter(tt=>!/^(sm|md|lg|xl|2xl):/.test(tt)).join(" "),B=yt(Z||"flex");if(!vy(I))return B;if(Et==="css-driven"){const tt={flexDirection:"fd",gap:"gap",width:"w",minHeight:"min-h",alignItems:"items",justifyContent:"justify",display:"display",gridTemplateColumns:"grid-template",fontSize:"text",borderRadius:"radius",padding:"p",paddingLeft:"px",paddingRight:"px",paddingTop:"py",paddingBottom:"py",margin:"m",marginTop:"mt",marginRight:"mr",marginBottom:"mb",marginLeft:"ml"},X=(st,gt)=>`var(--bf-${tt[st]||st}-${$}, ${B[st]||gt})`;if(I.flexDirection.size>0&&(B.flexDirection=X("flexDirection","column")),I.gap.size>0&&(B.gap=X("gap","0px")),I.width.size>0&&(B.width=X("width","auto")),I.minHeight.size>0&&(B.minHeight=X("minHeight","0px")),I.alignItems.size>0&&(B.alignItems=X("alignItems","stretch")),I.justifyContent.size>0&&(B.justifyContent=X("justifyContent","flex-start")),I.display.size>0&&(B.display=X("display","flex")),I.gridCols.size>0){const st=B.gridTemplateColumns||"1",gt=typeof st=="string"?(Q=st.match(/^repeat\((\d+)/))==null?void 0:Q[1]:st;B.gridTemplateColumns=`repeat(var(--bf-cols-${$}, ${gt||"1"}), minmax(0, 1fr))`}return I.gridTemplateColumns.size>0&&(B.gridTemplateColumns=X("gridTemplateColumns",String(B.gridTemplateColumns||"none"))),I.textSize.size>0&&(B.fontSize=X("fontSize","1rem")),I.borderRadius.size>0&&(B.borderRadius=X("borderRadius","0px")),I.padding.p.size>0&&(B.padding=X("padding","0px")),I.padding.px.size>0&&(B.paddingLeft=X("paddingLeft","0px"),B.paddingRight=X("paddingRight","0px")),I.padding.py.size>0&&(B.paddingTop=X("paddingTop","0px"),B.paddingBottom=X("paddingBottom","0px")),I.margin.all.size>0&&(B.margin=X("margin","0px")),I.margin.t.size>0&&(B.marginTop=X("marginTop","0px")),I.margin.r.size>0&&(B.marginRight=X("marginRight","0px")),I.margin.b.size>0&&(B.marginBottom=X("marginBottom","0px")),I.margin.l.size>0&&(B.marginLeft=X("marginLeft","0px")),I.margin.x.size>0&&(B.marginLeft=X("marginLeft","0px"),B.marginRight=X("marginRight","0px")),I.margin.y.size>0&&(B.marginTop=X("marginTop","0px"),B.marginBottom=X("marginBottom","0px")),B}const F=ie;if(I.flexDirection.size>0&&(B.flexDirection=zt(I.flexDirection,F,"column")),I.gap.size>0&&(B.gap=zt(I.gap,F,"0px")),I.width.size>0&&(B.width=zt(I.width,F,"auto")),I.minHeight.size>0&&(B.minHeight=zt(I.minHeight,F,"0px")),I.alignItems.size>0&&(B.alignItems=zt(I.alignItems,F,"stretch")),I.justifyContent.size>0&&(B.justifyContent=zt(I.justifyContent,F,"flex-start")),I.display.size>0&&(B.display=zt(I.display,F,"flex")),I.gridCols.size>0){const tt=zt(I.gridCols,F,1);B.gridTemplateColumns=`repeat(${tt}, minmax(0, 1fr))`}return I.gridTemplateColumns.size>0&&(B.gridTemplateColumns=zt(I.gridTemplateColumns,F,String(B.gridTemplateColumns||"none"))),I.textSize.size>0&&(B.fontSize=zt(I.textSize,F,"1rem")),I.borderRadius.size>0&&(B.borderRadius=zt(I.borderRadius,F,"0px")),I.padding.p.size>0&&(B.padding=zt(I.padding.p,F,"0px")),I.padding.px.size>0&&(B.paddingLeft=zt(I.padding.px,F,"0px"),B.paddingRight=zt(I.padding.px,F,"0px")),I.padding.py.size>0&&(B.paddingTop=zt(I.padding.py,F,"0px"),B.paddingBottom=zt(I.padding.py,F,"0px")),I.margin.all.size>0&&(B.margin=zt(I.margin.all,F,"0px")),I.margin.t.size>0&&(B.marginTop=zt(I.margin.t,F,"0px")),I.margin.r.size>0&&(B.marginRight=zt(I.margin.r,F,"0px")),I.margin.b.size>0&&(B.marginBottom=zt(I.margin.b,F,"0px")),I.margin.l.size>0&&(B.marginLeft=zt(I.margin.l,F,"0px")),I.margin.x.size>0&&(B.marginLeft=zt(I.margin.x,F,"0px"),B.marginRight=zt(I.margin.x,F,"0px")),I.margin.y.size>0&&(B.marginTop=zt(I.margin.y,F,"0px"),B.marginBottom=zt(I.margin.y,F,"0px")),B},Sc=v.useRef(new Map),Am=v.useCallback(async M=>{const $=Sc.current.get(M);if($)return $;const I=r||localStorage.getItem("token")||"",Z=t==null?void 0:t.endpoint,B=N||(typeof Z=="string"?Z.replace(/\/+$/,""):"")||"/api",F=`?collection=${encodeURIComponent(M)}`;for(const Q of[`${B}/tenant/schema${F}`,`${B}/admin/schema${F}`])try{const tt=await fetch(Q,{headers:{Authorization:`Bearer ${I}`}});if(!tt.ok)continue;const X=await tt.json(),gt=(Array.isArray(X)?X:Array.isArray(X==null?void 0:X.data)?X.data:[]).find(vt=>vt.collection===M)||null;if(!gt)continue;return Sc.current.set(M,gt),gt}catch{}return null},[r,N,t]),In={cfg:le,sdk:t,apiUrl:N,renderMode:Et,scopeId:$n,widgets:[...Array.isArray(e==null?void 0:e.widgets)?e.widgets:[],...Object.values(Mi).flatMap(M=>M.widgets||[])],widgetStack:[],parseClassName:yt,containerWidth:ie,interactionDisabled:m,previewMode:j,isAuthenticated:ft,styleOverrides:f,selectedComponentKey:h,selectedComponentClass:u,sceneData:he,setSceneData:se,setColorMode:M=>As(M),portalTarget:Ce.current,imageErrors:$t,setImageErrors:To,handleButtonClick:ka,interpolateText:Cs,evaluateExpression:_c,evaluateCondition:fi,showToast:$e,setActiveModal:un,dismissModal:Fi,setOverlayModal:tr,dismissOverlayModal:Co,fetchListData:kn,fetchEntitySchema:Am,goBack:Po,currentSceneId:Ot,isMobileView:ai,navigateToScene:qr,mobileMenuOpen:vs,setMobileMenuOpen:bs,renderComponent:(M,$,I)=>zf(In,M,$,I),renderIcon:(M,$,I)=>(n==null?void 0:n(M,$,I))??wb(M,$,I),getCommonProps:rr,imageReplacements:x,listData:$i,rowContextRef:Hr,uploadFile:Es,runBulkSelectAction:Oh,selectDynamicOptions:Ii,setSelectDynamicOptions:Ri,loading:Ar,buttonLoading:Ni,withLoading:Hi,paginationState:Cn,parseClassNameResponsive:Ih};O&&(In.renderPhaserGame=(M,$)=>O(In,M,$));let gn=[];const Rh=v.useMemo(()=>{const M={};for(const[$,I]of Object.entries(he))$.startsWith("_")||(M[$]=I);return JSON.stringify(M)},[he]),Io=v.useRef({}),Ra=v.useRef(""),Lh=v.useRef(""),ir=v.useRef(""),di=v.useRef({}),Nh=v.useRef({}),Er=v.useRef(Cn);Er.current=Cn;const jh=v.useRef(Ar);jh.current=Ar;const pi=v.useRef({}),Pc=v.useRef(new Set),Cr=v.useRef(null);v.useEffect(()=>{if(!pe||!ft){Gn.current.forEach($=>$()),Gn.current.clear(),zi.current.clear();return}const M=$=>{var Z;const I=$.getAttribute("data-bf-scroll-load");!I||Pc.current.has(I)||(Pc.current.add(I),(Z=Cr.current)==null||Z.observe($))};Cr.current||(Cr.current=new IntersectionObserver($=>{for(const I of $){if(!I.isIntersecting)continue;const Z=I.target.getAttribute("data-bf-scroll-load");if(!Z||pi.current[Z])continue;const B=Er.current[Z],F=ci.current[Z];if(!F||!(B!=null&&B.hasMore)||jh.current[Z])continue;pi.current[Z]=!0;const Q=di.current[Z]||1;di.current[Z]=Q+1;const tt=Nh.current[Z];kn(F,Z,Q,B.limit,tt==null?void 0:tt.field,tt==null?void 0:tt.direction,void 0,!0).finally(()=>{var X;if(pi.current[Z]=!1,I.target.isConnected){const st=I.target.getBoundingClientRect();st.bottom>-160&&st.top<(window.innerHeight||800)+160&&((X=Cr.current)==null||X.observe(I.target))}})}},{rootMargin:"160px 0px"})),document.querySelectorAll("[data-bf-scroll-load]").forEach(M)},[Ot,pe,kn,$i,Ar,Cn]),v.useEffect(()=>()=>{var M;(M=Cr.current)==null||M.disconnect(),Cr.current=null,Pc.current=new Set},[Ot]),v.useEffect(()=>{if(!pe)return;const M=Q=>typeof Q=="string"?Q.replace(/\{\{\s*\[([\w/.-]+)\](?:\.([\w.]+))?\s*(?:\|\|\s*(.+?))?\}\}/g,(tt,X,st,gt)=>{const vt=Gr(st?`${X}.${st}`:X);return vt!=null?String(vt):gt!==void 0?gt.replace(/^["']|["']$/g,""):""}).replace(/\{\{([\w.]+)\}\}/g,(tt,X)=>{const st=X.split(".").reduce((gt,vt)=>gt==null?void 0:gt[vt],he);return st!=null?String(st):""}):"";Ra.current!==Ot&&(Ra.current=Ot);let $=new Set;const I=(Q,tt="")=>{Array.isArray(Q)&&Q.forEach((X,st)=>{var At;const gt=`${tt}-${st}`;if((X.type==="list"||X.type==="table")&&X.dataSource){$.add(gt),X.key&&$.add(X.key),Nh.current[gt]=X.sort||{};const a=M(X.dataSource),d=Io.current[gt]!==a;d&&(Io.current[gt]=a,di.current[gt]=1,kn(a,gt,0,X.pageSize||10,void 0,void 0,X.key));const g=X.realtime,_=g?M(g.channel||""):"",C=g?M(g.url||""):"",k=g?M(g.event||""):"",W=g?`${C}|${_}|${k}`:"",et=zi.current.get(gt)!==W;if(g&&(d||et)){zi.current.set(gt,W);const ot=Gn.current.get(gt);ot&&ot();const dt=X.pageSize||10;let Pt;const kt=oe=>{if(!g.bind)return;let St=oe;try{St=typeof oe=="string"?JSON.parse(oe):oe}catch{}g.bindField&&(!St||St[g.bindField]===void 0)||St&&typeof St=="object"&&se(jt=>({...jt,[g.bind]:St}))},Yt=oe=>{if(!g.filter)return!0;let St=oe;if(typeof St=="string")try{St=JSON.parse(St)}catch{return!1}return!St||typeof St!="object"?!1:Object.entries(g.filter).every(([jt,Kt])=>{const Ne=typeof Kt=="string"?Cs(Kt):Kt;return Ne===""||St[jt]===Ne})},fn=(oe,St)=>{if(!g.onEvent||!Array.isArray(St))return;let jt=oe;if(typeof jt=="string")try{jt=JSON.parse(jt)}catch{return}const Kt=jt==null?void 0:jt.id,Ne=St.find(Ge=>(Ge==null?void 0:Ge.id)===Kt);if(Ne&&!(g.onEvent.when&&!hi(g.onEvent.when,Ne))){if(g.onEvent.once===!0){const Ge=[gt,g.onEvent.action,g.onEvent.when||"",(Ne==null?void 0:Ne.id)||Kt||""].join(":");if(ys.current.has(Ge))return;ys.current.add(Ge)}Hr.current=Ne,Ma.current=Object.keys(Ne),se(Ge=>({...Ge,...Ne})),ka(g.onEvent.action,{}).catch(()=>{})}};switch(g.mode){case"poll":{const oe=g.interval||5e3,St=window.setInterval(()=>{g.while&&!hi(g.while,ii.current)||kn(a,gt,0,dt)},oe);Pt=()=>clearInterval(St);break}case"sse":{if(!C&&!_){Pt=()=>{};break}const oe=r||localStorage.getItem("token")||"",St=C||`/events?channel=${_}`,jt=oe&&!St.includes("token=")?`${St}${St.includes("?")?"&":"?"}token=${encodeURIComponent(oe)}`:St,Kt=new EventSource(jt),Ne=Ge=>{Yt(Ge.data)&&(kt(Ge.data),kn(a,gt,0,dt))};k?Kt.addEventListener(k,Ne):Kt.onmessage=Ne,Kt.onerror=()=>Kt.close(),Pt=()=>Kt.close();break}case"ws":{const oe=_||(w?`tenant:${w}:entities`:"");if(!C&&!oe){Pt=()=>{};break}let St=null;const jt=()=>{var Ne;let Kt;if(oe&&((Ne=t==null?void 0:t.client)!=null&&Ne.createWebSocket))Kt=t.client.createWebSocket(oe);else{const Ge=C||`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws?channel=${oe}`;Kt=new WebSocket(Ge)}Kt.onmessage=Ge=>{Yt(Ge.data)&&(kt(Ge.data),kn(a,gt,0,dt).then(Ji=>{const zn=Array.isArray(Ji)?Ji:$i[gt];g.onEvent&&fn(Ge.data,zn);const Ls=he==null?void 0:he.id;if(Ls&&Array.isArray(zn)&&Ra.current===Ot){const sr=zn.find(be=>(be==null?void 0:be.id)===Ls);sr&&se(be=>({...be,...sr}))}}))},Kt.onclose=()=>setTimeout(jt,3e3),St=Kt};jt(),Pt=()=>St==null?void 0:St.close();break}default:Pt=()=>{}}Gn.current.set(gt,Pt)}}if(X.type==="select"&&X.dataSource){const a=`${gt}-sel`,d=M(X.dataSource);Io.current[a]!==d&&(Io.current[a]=d,(async()=>{try{const g=X.dataSource,_=M(g),C=await fetch(_,{headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`}});if(!C.ok)return;const k=await C.json(),W=X.dataField||"configs",et=X.optionLabel||"label",ot=X.optionValue||"value",dt=k[W]||k.data||k,Pt=Array.isArray(dt)?dt.map(kt=>({label:kt[et]||kt.name||kt.label,value:kt[ot]||kt.id||kt.name||kt.label})):[];Ri(kt=>({...kt,[gt]:Pt}))}catch{}})())}X.children&&I(X.children,gt);const vt=X.accordionItems||(X.type==="accordion"?X.items:null);Array.isArray(vt)&&vt.forEach((a,d)=>{Array.isArray(a==null?void 0:a.content)&&I(a.content,`${gt}-acc-${d}-content`)}),Array.isArray(X.tabItems)&&X.tabItems.forEach((a,d)=>{const g=Array.isArray(a==null?void 0:a.content)?a.content:Array.isArray(a==null?void 0:a.children)?a.children:null;g&&I(g,`${gt}-tabcontent-${d}`)});const pt=X;if(pt.type==="widget"&&pt.widgetId){const a=(At=e==null?void 0:e.widgets)==null?void 0:At.find(d=>d.id===pt.widgetId);a&&Array.isArray(a.components)&&I(a.components,`${gt}-${pt.widgetId}`)}})},Z=`${Ot}|${Rh}|${ft}`;Lh.current!==Z&&(Lh.current=Z,I(gn),ui.current=$);const B=Ae||_n;if(ir.current!==((B==null?void 0:B.id)||"")){ir.current=(B==null?void 0:B.id)||"";for(const[Q,tt]of Gn.current)Q.startsWith("modal")&&(tt(),Gn.current.delete(Q),delete Io.current[Q])}const F=B?Fe==null?void 0:Fe[B.id]:void 0;$=new Set,F&&Array.isArray(F==null?void 0:F.components)&&I(F.components,"modal"),en.current=new Set([...ui.current,...$]);for(const[Q,tt]of Gn.current)en.current.has(Q)||(tt(),Gn.current.delete(Q),zi.current.delete(Q),delete Io.current[Q])},[Ot,kn,Rh,Ae==null?void 0:Ae.id,_n==null?void 0:_n.id,ft]),v.useEffect(()=>()=>{Gn.current.forEach(M=>M()),Gn.current.clear()},[Ot]);const La=v.useMemo(()=>{if(!pe||Et!=="css-driven")return null;const M=new Map,$=(I,Z)=>{I.forEach((B,F)=>{const Q=`${Z}-${F}`;if(B.className){const tt=by(B.className);if(vy(tt)){const X=J$($n,Q,tt);X&&M.set(Q,X)}}B.children&&$(B.children,Q)})};return $(gn,""),M},[Ot,gn,Et,$n]),Ms=v.useRef(nr);Ms.current=nr;const Ro=le.realtime,Zr=Ro==null?void 0:Ro.mode,Zi=Ro==null?void 0:Ro.url;if(v.useEffect(()=>{if(!ft||Zr!=="sse"||!Zi)return;const M=r||localStorage.getItem("token");if(!M)return;let $=null,I=!1;return(async()=>{try{const Z=N||(t==null?void 0:t.endpoint)||window.location.origin,B=await fetch(`${Z}${Zi}/token`,{headers:{Authorization:`Bearer ${M}`}});if(!B.ok)return;const{token:F}=await B.json();if(!F||I)return;$=new EventSource(`${Z}${Zi}/subscribe?token=${encodeURIComponent(F)}`),$.onmessage=Q=>{try{const tt=JSON.parse(Q.data);tt!=null&&tt.message&&Ms.current(tt,"success")}catch{}},$.onerror=()=>$==null?void 0:$.close()}catch{}})(),()=>{I=!0,$==null||$.close()}},[ft,N,r,Zr,Zi]),!pe)return v.createElement(v.Fragment,null,oht(ct,Qt.length,Po,P));const fe=pe,Yi=fe.backgroundColor,Dh=Yi&&Qg(Yi)!==(le.colorMode==="dark"?"dark":"light")?Qg(Yi)==="dark"?xu.text:wu.text:le.colors.text,or=fe.height!==void 0?typeof fe.height=="number"?`${fe.height}px`:fe.height:void 0,Na=fe.minHeight!==void 0?typeof fe.minHeight=="number"?`${fe.minHeight}px`:fe.minHeight:void 0,Lo=fe.className?{...vT,fontFamily:le.typography.fontFamily,display:"flex",flexDirection:"column",width:"100%",maxWidth:"100%",position:"relative",...or?{height:or}:{},...Na?{minHeight:Na}:{},backgroundColor:Yi||le.colors.background,color:Dh,...yt(fe.className)}:{...vT,fontFamily:le.typography.fontFamily,display:"flex",flexDirection:"column",position:"relative",width:"100%",maxWidth:"100%",...or?{height:or}:{},...Na?{minHeight:Na}:{},backgroundColor:Yi||le.colors.background,color:Dh},Bh=Array.isArray(fe.components)?fe.components:[],Yr=iht($n),ks=(pe==null?void 0:pe.requireAuth)===!0||(fe==null?void 0:fe.requiresAuth)===!0||(Dt==null?void 0:Dt.requiresAuth)===!0||((Xi=Dt==null?void 0:Dt.config)==null?void 0:Xi.requiresAuth)===!0,Ac=(ks||rt)&&!ft?kh():null,Ec=ft&&ks&&J===!1&&!bt?v.createElement("div",{key:"email-banner",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"10px 40px",backgroundColor:le.colorMode==="dark"?"#78350f":"#fef3c7",color:le.colorMode==="dark"?"#fef3c7":"#92400e",fontSize:"13px",fontWeight:500,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"}},In.renderIcon("alert-triangle",14),v.createElement("span",null,"Verify your email — check your inbox for the confirmation link."),v.createElement("button",{"aria-label":"Dismiss",onClick:()=>de(!0),style:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"inherit",display:"flex",alignItems:"center",padding:"4px"}},In.renderIcon("x",16))):null,gr=e,Ki=Array.isArray(gr==null?void 0:gr.widgets)?gr.widgets:[],$s=new Set,Is=M=>{if(Array.isArray(M))for(const $ of M)$&&$.type==="widget"&&$.widgetId&&$s.add($.widgetId),$&&Array.isArray($.children)&&Is($.children)};Is(Bh);for(const M of Ki)Is(M.components);const zh=Ki.filter(M=>$s.has(M.id)?!1:M.sceneIds==="*"?!0:Array.isArray(M.sceneIds)?M.sceneIds.includes("*")||M.sceneIds.includes(Ot):!1),Em=Pr.map(M=>{var Z,B,F;const $=Mi[M.id],I=M.sourceSceneId?(Z=$==null?void 0:$.steps)==null?void 0:Z.find(Q=>Q.id===M.sourceSceneId):(B=$==null?void 0:$.steps)==null?void 0:B.find(Q=>Q.type==="render_scene");return(F=I==null?void 0:I.config)!=null&&F.components?{...M,components:I.config.components}:null}).filter(Boolean);gn=[...Bh],(Mc=(Oc=gr.layout)==null?void 0:Oc.header)!=null&&Mc.length?gn.splice(0,0,...gr.layout.header):(Mr=(Gh=fe==null?void 0:fe.layout)==null?void 0:Gh.header)!=null&&Mr.length&&gn.splice(0,0,...fe.layout.header);for(const M of zh||[]){const $=M.components||[];if(!$.length)continue;if(M.targetKey){const Z=M.targetKey.split("-").filter(Boolean).map(Number);if(Z.length>0){let B=gn,F=Z[0];for(let tt=0;tt<Z.length-1;tt++){const X=B[Z[tt]];if(!X||!Array.isArray(X.children))break;B=X.children,F=Z[tt+1]}const Q=M.targetPosition||"before";if(Q==="inside"){const tt=B[F];tt&&(Array.isArray(tt.children)||(tt.children=[]),tt.children.unshift(...$))}else Q==="after"?B.splice(F+1,0,...$):B.splice(F,0,...$);continue}}const I=M.index??gn.length;gn.splice(I,0,...$)}for(const M of Em){if(M.targetKey){const $=M.targetKey.split("-").filter(Boolean).map(Number);let I=gn,Z=$[0];for(let F=0;F<$.length-1;F++){const Q=I[$[F]];if(!Q||!Array.isArray(Q.children))break;I=Q.children,Z=$[F+1]}const B=M.targetPosition||"before";if(B==="inside"){const F=I[Z];F&&(Array.isArray(F.children)||(F.children=[]),F.children.unshift(...M.components))}else B==="after"?I.splice(Z+1,0,...M.components):I.splice(Z,0,...M.components);continue}gn.splice(M.index??gn.length,0,...M.components)}($c=(kc=gr.layout)==null?void 0:kc.footer)!=null&&$c.length?gn.push(...gr.layout.footer):(Zh=(jo=fe==null?void 0:fe.layout)==null?void 0:jo.footer)!=null&&Zh.length&&gn.push(...fe.layout.footer);const ja=La&&La.size>0?v.createElement("style",{key:"bf-responsive"},Array.from(La.values()).join(`
196
+ `):M,B=$==="success",W=B?"#10B981":"#EF4444",Q=le.toast||{},tt=I??Q.duration??3e3,X=Q.position||"bottom-right",st={"bottom-right":{right:"24px",bottom:"24px"},"bottom-left":{left:"24px",bottom:"24px"},"bottom-center":{left:"50%",bottom:"24px",transform:"translateX(-50%)"},"top-right":{right:"24px",top:"24px"},"top-left":{left:"24px",top:"24px"},"top-center":{left:"50%",top:"24px",transform:"translateX(-50%)"}},mt=st[X]||st["bottom-right"],vt=document.createElement("div"),pt=document.createElement("span");pt.textContent=B?"✓":"✕",Object.assign(pt.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"22px",height:"22px",minWidth:"22px",borderRadius:"50%",backgroundColor:`${W}26`,color:W,fontSize:"12px",fontWeight:"700"});const At=document.createElement("span");At.textContent=Z,Object.assign(At.style,{color:"rgba(255, 255, 255, 0.92)",fontSize:"13.5px",lineHeight:"1.45",whiteSpace:"pre-line"}),Object.assign(vt.style,{position:"fixed",...mt,zIndex:"2147483647",display:"flex",alignItems:"flex-start",gap:"10px",padding:"12px 16px",borderRadius:"12px",backgroundColor:"rgba(23, 25, 35, 0.97)",border:"1px solid rgba(148, 163, 184, 0.25)",boxShadow:"0 8px 28px rgba(0, 0, 0, 0.4)",maxWidth:"380px",opacity:"0",pointerEvents:"auto"}),vt.appendChild(pt),vt.appendChild(At),document.body.appendChild(vt),vt.animate([{opacity:0,transform:"translateX(24px)"},{opacity:1,transform:"translateX(0)"}],{duration:250,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"both"}).finished.catch(()=>{});const d=()=>{vt.animate([{opacity:1,transform:"translateX(0)"},{opacity:0,transform:"translateX(16px)"}],{duration:200,easing:"ease",fill:"both"}).finished.then(()=>vt.remove()).catch(()=>vt.remove())};return tt>0&&setTimeout(d,tt),{update:g=>{At.textContent=Array.isArray(g)?g.join(`
197
+ `):g},dismiss:d}},Zn=(M,$=!0)=>{if($&&(M!=null&&M.onSuccess)){const I=Array.isArray(M.onSuccess)?M.onSuccess:[M.onSuccess];for(const Z of I){const{type:B,value:W,title:Q,key:tt}=Z;switch(B){case"toast":$e(W||"Success!","success");break;case"navigate":W&&qr(W);break;case"redirect":W&&(window.location.href=W);break;case"modal":W&&Fe[W]?un({id:W,definition:Fe[W]}):un({id:"__legacy",definition:{title:Q||"Success",components:W?[{type:"text",text:W,color:le.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.7)",fontSize:14}]:[],actions:[{label:"OK",variant:"primary",dismiss:!0}]}});break;case"route":W&&qi(W);break;case"set_data":tt&&W!==void 0&&se(X=>({...X,[tt]:W}));break}}}else!$&&(M!=null&&M.onError)&&$e(M.onError.message||"An error occurred","error")},kh=()=>{var ot,dt,Pt,kt,Yt,fn,oe;const M=async()=>{var Kt,Ne,Ge,Ji,zn,Ls;if(!qt||!ye||On==="register"&&!ve)return;const St=Vr(qt),jt=Vi(ye);if(St||jt){hn(St||jt);return}if(On==="register"&&ve!==ye){Tr("confirm","Passwords do not match"),hn("Passwords do not match");return}ke(!0),hn(null);try{const sr=On==="login"?"/auth/login":"/auth/register",be=`${er().replace(/\/+$/,"")}${sr}`,Ba=On==="login"?{email:qt,password:ye,tenantId:w}:{email:qt,password:ye,displayName:qt.split("@")[0],tenantId:w},Yh={"Content-Type":"application/json"},Mm=["localhost","127.0.0.1","[::1]"].includes(window.location.hostname);T&&!Mm&&(Yh["x-app-id"]=T);const Ic=await fetch(be,{method:"POST",headers:Yh,body:JSON.stringify(Ba)});if(!Ic.ok){const t2=await Ic.json().catch(()=>({error:"Authentication failed"}));throw new Error(Oo(t2))}const Fn=await Ic.json();if(Array.isArray(Fn)||Fn.success===!1)throw new Error(Oo(Fn));const Rc=((Kt=Fn.data)==null?void 0:Kt.token)||Fn.token||Fn.accessToken||Fn.idToken;Rc&&localStorage.setItem("token",Rc);const Kh=((Ne=Fn.data)==null?void 0:Ne.refreshToken)||Fn.refreshToken;Kh&&localStorage.setItem("backflow_refresh_token",Kh);const Ax=((Ji=(Ge=Fn.data)==null?void 0:Ge.user)==null?void 0:Ji.id)||((zn=Fn.user)==null?void 0:zn.id)||((Ls=Fn.data)==null?void 0:Ls.userId);if(Ax&&localStorage.setItem("backflow_refresh_user_id",Ax),!ft&&(rt||Ke.current||!!cn.current)){window.location.reload();return}Ke.current=!1,Ct(!0),Rt(!1),G(!1),mr(""),wt(""),It(""),_s({}),hn(null)}catch(sr){const be=typeof sr=="string"?sr:(sr==null?void 0:sr.message)||JSON.stringify(sr)||"Authentication failed";hn(be),$e(be,"error")}finally{ke(!1)}},$=async()=>{if(!qt)return;const St=Vr(qt);if(St){hn(St);return}ke(!0),hn(null);try{const jt=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:qt})});if(!jt.ok){const Kt=await jt.json().catch(()=>({error:"Failed to send reset email"}));throw new Error(Oo(Kt))}ee("reset"),Mn(""),wt(""),hn(null)}catch(jt){const Kt=typeof jt=="string"?jt:(jt==null?void 0:jt.message)||"Failed to send reset email";hn(Kt),$e(Kt,"error")}finally{ke(!1)}},I=async()=>{if(!Wi||!ye)return;const St=Vi(ye);if(St){hn(St);return}ke(!0),hn(null);try{const jt=await fetch("/api/auth/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:Wi,password:ye})});if(!jt.ok){const Kt=await jt.json().catch(()=>({error:"Failed to reset password"}));throw new Error(Oo(Kt))}ee("login"),mr(""),wt(""),Mn(""),hn(null)}catch(jt){const Kt=typeof jt=="string"?jt:(jt==null?void 0:jt.message)||"Failed to reset password";hn(Kt),$e(Kt,"error")}finally{ke(!1)}},Z=St=>{ee(St),hn(null),St!=="reset"&&(Mn(""),wt("")),It(""),_s({})},B=le.colorMode==="dark",W=B?"#f3f4f6":"#111827",Q=B?"#9ca3af":"#6b7280",tt=B?"#374151":"#f3f4f6",X=B?"#4b5563":"#d1d5db",st=B?"#ffffff":"#000000",mt=B?"#000000":"#ffffff",vt=B?"#1f2937":"#ffffff",pt="#ef4444",At=(St="12px")=>({width:"100%",padding:"12px 16px",border:`1px solid ${X}`,borderRadius:"8px",fontSize:"14px",backgroundColor:tt,color:W,outline:"none",marginBottom:St,boxSizing:"border-box"}),a=(St,jt,Kt,Ne,Ge,Ji)=>v.createElement("div",{key:St,style:{position:"relative",marginBottom:"12px"}},U("input",{key:"input",type:ae[St]?"text":"password",placeholder:jt,value:Kt,onChange:zn=>Ne(zn.target.value),onKeyDown:zn=>{zn.key==="Enter"&&Ge()},style:{...At("0px"),paddingRight:"40px",borderColor:Ji?pt:X}}),v.createElement("button",{key:"toggle",type:"button","aria-label":ae[St]?"Hide password":"Show password",onClick:()=>_s(zn=>({...zn,[St]:!zn[St]})),style:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:Q,display:"flex",alignItems:"center",padding:"4px"}},In.renderIcon(ae[St]?"eye-off":"eye",16)));l||e!=null&&e.title;const d=(ot=e==null?void 0:e.config)!=null&&ot.logo&&((dt=e==null?void 0:e.config)==null?void 0:dt.logo)!==""?e.config.logo:"",g=c||((Pt=e==null?void 0:e.navigation)==null?void 0:Pt.logo)||"mail",_=[];_.push(v.createElement("div",{key:"brand",role:"button","aria-label":"Go back home",onClick:()=>{qr("/"),Rt(!1),Ke.current=!1,cn.current=null},style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"20px",cursor:"pointer"}},d?v.createElement("img",{src:d,alt:"",style:{width:"56px",height:"56px",objectFit:"contain"}}):In.renderIcon(g,56))),On==="login"?(_.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:W,marginBottom:"8px",textAlign:"center"}},"Sign In")),_.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:Q,marginBottom:"24px",textAlign:"center"}},"Enter your credentials to continue")),_.push(U("input",{key:"email",type:"email",placeholder:"Email Address",value:qt,onChange:St=>{mr(St.target.value),Tr("email",Vr(St.target.value))},style:{...At(),borderColor:Te.email&&qt?pt:X}})),Te.email&&qt&&_.push(v.createElement("p",{key:"email-err",style:{color:pt,fontSize:"12px",marginTop:"-8px",marginBottom:"8px"}},Te.email)),_.push(a("pass","Password",ye,St=>{wt(St),Tr("pass",Vi(St))},M,!!(Te.pass&&ye))),Te.pass&&ye&&_.push(v.createElement("p",{key:"pass-err",style:{color:pt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Te.pass)),li&&_.push(v.createElement("p",{key:"err",style:{color:pt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},li)),_.push(v.createElement("button",{key:"submt",onClick:M,disabled:qe||!qt||!ye,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:qe?B?"#4b5563":"#9ca3af":st,color:mt,border:"none",cursor:qe?"not-allowed":"pointer",marginBottom:"8px"}},qe?"Please wait...":"Sign In")),_.push(v.createElement("p",{key:"forgot",style:{fontSize:"13px",color:Q,textAlign:"center",cursor:"pointer",marginBottom:"16px"},onClick:()=>Z("forgot")},"Forgot password?")),_.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:Q,textAlign:"center",cursor:"pointer"},onClick:()=>Z("register")},"Don’t have an account? Register"))):On==="register"?(_.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:W,marginBottom:"8px",textAlign:"center"}},"Create Account")),_.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:Q,marginBottom:"24px",textAlign:"center"}},"Create an account to get started")),_.push(U("input",{key:"email",type:"email",placeholder:"Email",value:qt,onChange:St=>{mr(St.target.value),Tr("email",Vr(St.target.value))},style:{...At(),borderColor:Te.email&&qt?pt:X}})),Te.email&&qt&&_.push(v.createElement("p",{key:"email-err",style:{color:pt,fontSize:"12px",marginTop:"-8px",marginBottom:"8px"}},Te.email)),_.push(a("pass","Password",ye,St=>{wt(St),Tr("pass",Vi(St))},M,!!(Te.pass&&ye))),Te.pass&&ye&&_.push(v.createElement("p",{key:"pass-err",style:{color:pt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Te.pass)),_.push(a("confirm","Confirm password",ve,St=>{It(St),Tr("confirm",Ps(ye,St))},M,!!(Te.confirm&&ve))),Te.confirm&&ve&&_.push(v.createElement("p",{key:"confirm-err",style:{color:pt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Te.confirm)),li&&_.push(v.createElement("p",{key:"err",style:{color:pt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},li)),_.push(v.createElement("button",{key:"submt",onClick:M,disabled:qe||!qt||!ye||!ve,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:qe?B?"#4b5563":"#9ca3af":st,color:mt,border:"none",cursor:qe?"not-allowed":"pointer",marginBottom:"16px"}},qe?"Please wait...":"Create Account")),_.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:Q,textAlign:"center",cursor:"pointer"},onClick:()=>Z("login")},"Already have an account? Sign In"))):On==="forgot"?(_.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:W,marginBottom:"8px",textAlign:"center"}},"Reset Password")),_.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:Q,marginBottom:"24px",textAlign:"center"}},"Enter your email to receive a reset link")),_.push(U("input",{key:"email",type:"email",placeholder:"Email",value:qt,onChange:St=>{mr(St.target.value),Tr("email",Vr(St.target.value))},onKeyDown:St=>{St.key==="Enter"&&$()},style:{...At("16px"),borderColor:Te.email&&qt?pt:X}})),Te.email&&qt&&_.push(v.createElement("p",{key:"email-err",style:{color:pt,fontSize:"12px",marginTop:"-8px",marginBottom:"8px"}},Te.email)),li&&_.push(v.createElement("p",{key:"err",style:{color:pt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},li)),_.push(v.createElement("button",{key:"submt",onClick:$,disabled:qe||!qt,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:qe?B?"#4b5563":"#9ca3af":st,color:mt,border:"none",cursor:qe?"not-allowed":"pointer",marginBottom:"16px"}},qe?"Please wait...":"Send Reset Link")),_.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:Q,textAlign:"center",cursor:"pointer"},onClick:()=>Z("login")},"Back to Sign In"))):On==="reset"&&(_.push(v.createElement("h2",{key:"title",style:{fontSize:"24px",fontWeight:700,color:W,marginBottom:"8px",textAlign:"center"}},"Set New Password")),_.push(v.createElement("p",{key:"sub",style:{fontSize:"14px",color:Q,marginBottom:"24px",textAlign:"center"}},"Enter the reset code and your new password")),_.push(U("input",{key:"code",type:"text",placeholder:"Reset code",value:Wi,onChange:St=>Mn(St.target.value),style:At()})),_.push(a("pass","New password",ye,St=>{wt(St),Tr("pass",Vi(St))},I,!!(Te.pass&&ye))),Te.pass&&ye&&_.push(v.createElement("p",{key:"pass-err",style:{color:pt,fontSize:"12px",marginTop:"-12px",marginBottom:"12px"}},Te.pass)),li&&_.push(v.createElement("p",{key:"err",style:{color:pt,fontSize:"13px",marginBottom:"12px",textAlign:"center"}},li)),_.push(v.createElement("button",{key:"submt",onClick:I,disabled:qe||!Wi||!ye,style:{width:"100%",padding:"12px",borderRadius:"8px",fontSize:"15px",fontWeight:600,backgroundColor:qe?B?"#4b5563":"#9ca3af":st,color:mt,border:"none",cursor:qe?"not-allowed":"pointer",marginBottom:"16px"}},qe?"Please wait...":"Reset Password")),_.push(v.createElement("p",{key:"sw",style:{fontSize:"13px",color:Q,textAlign:"center",cursor:"pointer"},onClick:()=>Z("login")},"Back to Sign In")));const C=((kt=e==null?void 0:e.config)==null?void 0:kt.auth)||{},k=C.style==="page"?"page":"modal",F=C.containerStyle||{},et=v.createElement("div",{key:"auth-box",style:{width:"100%",maxWidth:k==="page"?"400px":"360px",padding:"24px",backgroundColor:"#000000",borderRadius:"12px",...F}},..._);if(k==="page"){const St=((Yt=le.colors)==null?void 0:Yt.primary)||"#4f46e5",jt=C.coverImage?`url(${C.coverImage}) center/cover no-repeat`:St,Kt=(fn=e==null?void 0:e.config)!=null&&fn.logo&&((oe=e==null?void 0:e.config)==null?void 0:oe.logo)!==""?e.config.logo:"",Ne=Kt?v.createElement("img",{src:Kt,alt:"",style:{position:"absolute",bottom:"-6%",left:"50%",width:"90%",maxWidth:"660px",height:"auto",objectFit:"contain",transform:"translateX(-50%) rotate(-8deg)",opacity:.92,filter:"brightness(0) invert(1)",animation:"bf-logo-excited 4s ease-in-out infinite"}}):v.createElement("div",{style:{color:"#ffffff",opacity:.95}},In.renderIcon(g,96));return v.createElement("div",{key:"auth-page",style:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",backgroundColor:vt,zIndex:1e4,animation:"bf-fade-in 0.2s ease"}},v.createElement("div",{style:{flex:ai?"1 1 100%":"0 0 40%",display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",backgroundColor:"#000000"}},et),v.createElement("div",{style:{flex:"0 0 60%",background:jt,display:ai?"none":"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"}},Ne))}return v.createElement("div",{key:"auth-form",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,animation:"bf-fade-in 0.15s ease"}},et)},ka=async(M,$,I)=>{var Z,B;try{let W=String(Cs(M)??"");const Q=W.match(/^\{\{\s*(.+?)\s*\?\s*(.*?)\s+:\s+(.*?)\s*\}\}$/);Q&&(W=fi(Q[1])?Q[2]:Q[3]);const tt=W.split(";").map(a=>a.trim()).filter(Boolean);if(tt.length>1){for(const a of tt)await ka(a,void 0,I);return}if(W==="go_back"){Po();return}if(W==="toggle_theme"){As((he._colorMode||le.colorMode)==="dark"?"light":"dark");return}if(W==="close_modal"){Fi();return}const X=W.match(/^(toast|show_toast):(.*)$/);if(X){const a=X[2].trim();a&&$e(a,"success");return}const st=W.match(/^scroll_to:([\w-]+)$/);if(st){(Z=document.getElementById(st[1]))==null||Z.scrollIntoView({behavior:"smooth",block:"start"});return}const mt=W.match(/^set_data:([\w.]+)=(.*)$/);if(mt){se(a=>({...a,[mt[1]]:mt[2]}));return}const vt=W.match(/^native:([a-z][\w.-]*)$/i);if(vt){if(!i){$e("Native app required","error");return}const a=vt[1],d=await i(a,he);if(d&&typeof d=="object"&&!Array.isArray(d)){const g=a.replace(/[^\w]/g,"_");se(_=>({..._,native:{..._.native||{},[g]:d}}))}return}const pt=W.match(/^copy_to_clipboard:(.*)$/);if(pt){const a=pt[1];try{await navigator.clipboard.writeText(a)}catch{const d=document.createElement("textarea");d.value=a,d.style.position="fixed",d.style.opacity="0",document.body.appendChild(d),d.select(),document.execCommand("copy"),d.remove()}$e("API key copied","success");return}const At=W.match(/^auth:(login|register|forgot|reset|logout)$/);if(At){if(At[1]==="logout"){if(!ft)return;localStorage.removeItem("token"),localStorage.removeItem("backflow_refresh_token"),localStorage.removeItem("backflow_refresh_user_id"),Ke.current=!1,cn.current=null,Ct(!1),Rt(!1),lt(null),G(!1),qr("/");return}if(ft)return;hn(null),ee(At[1]),Rt(!0);return}if(W==="accept_startup_modal"){const a=le.startupModal;a&&localStorage.setItem(`backflow_startup_modal_${a}`,"1"),Fi();const d=nt.find(g=>g.route==="/");d&&(te(g=>[...g,Ot]),Dn(d.id));return}if(W==="decline_startup_modal"){Fi();const a=nt.find(d=>d.route==="/");a&&(te(d=>[...d,Ot]),Dn(a.id));return}if(W==="toggle_select"){se(a=>({...a,_selectMode:!a._selectMode,...a._selectMode?{_selIds:[]}:{}}));return}if(W.startsWith("go_to_step:"))qr(W.replace("go_to_step:","")),Zn($,!0);else if(W.startsWith("navigate:"))qr(W.replace("navigate:","")),Zn($,!0);else if(vu(W)&&t){const a=nu(W),d=await Wf(t,a,he);d!=null&&d.data?se(g=>({...g,...d.data})):d&&typeof d=="object"&&!Array.isArray(d)&&se(g=>({...g,...d})),d!=null&&d.url&&String(d.url).startsWith("http")&&window.open(String(d.url),"_blank","noopener,noreferrer"),Zn($,!0)}else if(W.startsWith("show_modal:")){const a=W.replace("show_modal:","");if(Fe[a]){const d=Fe[a];if(xs(d.popover&&(I!=null&&I.anchorElement)?I.anchorElement.getBoundingClientRect():null),ws.current=d.popover&&(I==null?void 0:I.anchorElement)||null,Hr.current&&typeof Hr.current=="object"){const C=Object.keys(Hr.current);se(k=>{const F={...k};for(const et of Ma.current)C.includes(et)||delete F[et];return{...F,...Hr.current}}),Ma.current=C}const g=d.clearFormKeys;Array.isArray(g)&&g.length>0&&se(C=>{const k={...C};for(const F of g)delete k[F];return k});const _=d.defaults;_&&typeof _=="object"&&se(C=>{const k={...C};for(const[F,et]of Object.entries(_))k[F]===void 0&&(k[F]=et);return k}),d.preload&&await qi(String(d.preload)),(Ae==null?void 0:Ae.id)===a||(_n==null?void 0:_n.id)===a||(tr(null),un({id:a,definition:d}))}else{const d=a.split("|");un({id:"__legacy",definition:{title:d[0]||"Notice",components:d[1]?[{type:"text",text:d[1],color:"rgba(255,255,255,0.7)",fontSize:14}]:[],actions:[{label:"OK",variant:"primary",dismiss:!0}]}})}Zn($,!0)}else W.startsWith("execute_workflow:")?(await qi(W.replace("execute_workflow:",""),I),Zn($,!0)):W.startsWith("fetch:")&&(await qi(W.replace("fetch:",""),I),o==null||o(W.replace("fetch:","")),Zn($,!0))}catch(W){if(Zg("[handleButtonClick] caught error:",W,"callbacks:",$),(W==null?void 0:W.status)===401){await Mo({status:401},!0);return}if(W instanceof $o){if(xc(W,$==null?void 0:$.onError))return;$e(W.errors.length>1?W.errors:W.errors[0],"error")}else(B=$==null?void 0:$.onError)!=null&&B.message?$e($.onError.message,"error"):$e(W instanceof Error?W.message:"An error occurred","error")}},$a=M=>{const $=M&&typeof M=="object"&&"_seconds"in M?new Date(M._seconds*1e3):new Date(M);if(isNaN($.getTime()))return String(M??"");const I=Math.floor((Date.now()-$.getTime())/6e4);if(I<1)return"just now";if(I<60)return`${I}m ago`;const Z=Math.floor(I/60);if(Z<24)return`${Z}h ago`;const B=Math.floor(Z/24);return B<7?`${B}d ago`:$.toLocaleDateString()},Gi=(M,$)=>{if($==="timeago")return $a(M);const I=M&&typeof M=="object"&&"_seconds"in M?new Date(M._seconds*1e3):new Date(M);if(!isNaN(I.getTime())){if($==="date")return I.toLocaleDateString();if($==="time")return I.toLocaleTimeString();if($==="datetime")return I.toLocaleString()}return String(M??"")},sn=v.useRef({}),Gr=M=>{const $=M.split(".").filter(Boolean);if($.length===0)return;let I=sn.current[$[0]]??he[$[0]];for(let Z=1;Z<$.length;Z++){if(I==null)return;const B=$[Z];if(Array.isArray(I))if(B==="first")I=I[0];else if(B==="last")I=I[I.length-1];else if(B==="length")I=I.length;else if(/^\d+$/.test(B))I=I[Number(B)];else if(B==="index")I=I[0];else return;else if(I&&typeof I=="object"&&Array.isArray(I.items))B==="response"?I=I.response:B==="first"?I=I.items[0]:B==="last"?I=I.items[I.items.length-1]:B==="length"?I=I.items.length:/^\d+$/.test(B)?I=I.items[Number(B)]:B==="index"?I=I.items[0]:I=I[B];else if(typeof I=="object")I=I[B];else return}return I},wc=v.useRef({}),[$h,Ia]=v.useState({}),Sm=v.useCallback(M=>(wc.current[M]||(wc.current[M]=import(M).catch(()=>fetch(M).then($=>$.text()).then($=>{const I={};return new Function("module","exports",$)(I,I),I.exports||I}))),wc.current[M]),[]),_c=(M,$,I,Z)=>{if(!M)return"";if(M.startsWith("sdk:")){const Q=I||"",tt=$h[Q];if(Q&&tt!==void 0)return tt;const X=M.slice(4);return t&&Wf(t,X,{...he,$data:sn.current}).then(st=>{tn.current||(Z&&(sn.current[Z]=st),Ia(mt=>({...mt,[Q]:String(st??"")})))}).catch(()=>{}),""}const B=M.match(/^([A-Za-z_]\w*)\s*\(\s*(.*?)\s*\)$/s);if(B){const Q=B[1],tt=_c(B[2]);if($){const X=$h[I||""];return I&&X!==void 0?X:(Sm($).then(st=>{var vt,pt;const mt=st&&(st[Q]||((vt=st.default)==null?void 0:vt[Q])||((pt=st.exports)==null?void 0:pt[Q]))||(typeof st=="function"?st:void 0);typeof mt=="function"&&I&&Promise.resolve(mt(tt,{data:sn.current})).then(At=>{tn.current||(Z&&(sn.current[Z]=At),Ia(a=>({...a,[I]:String(At??"")})))})}).catch(()=>{}),"")}return Q==="timeago"?$a(tt):Q==="date"?Gi(tt,"date"):Q==="time"?Gi(tt,"time"):Q==="datetime"?Gi(tt,"datetime"):Q==="upper"?String(tt).toUpperCase():Q==="lower"?String(tt).toLowerCase():String(tt??"")}if(M.startsWith("{{")&&M.endsWith("}}")){const tt=M.slice(2,-2).trim().split("|").map(vt=>vt.trim()),X=tt[0],st=tt[1],mt=X.startsWith("{")&&X.endsWith("}")?Gr(X.slice(1,-1)):X.startsWith("$")?Gr(X.slice(1)):he[X];return st?Gi(mt,st):String(mt??"")}if(M.startsWith("{")&&M.endsWith("}"))return String(Gr(M.slice(1,-1))??"");const W=M.trim();return/^[A-Za-z_][\w.-]*$/.test(W)?String(Gr(W)??""):String(M??"")},Cs=M=>M?M.replace(/\{\{\s*\[([\w/.-]+)\](?:\.([\w.]+(?:\|\w+)?))?\s*(?:\|\|\s*(.+?))?\}\}/g,($,I,Z,B)=>{let W,Q=Z;if(Z!=null&&Z.includes("|")){const X=Z.split("|");Q=X[0],W=X[1]}const tt=Gr(Q?`${I}.${Q}`:I);if(tt!=null){const X=W?Gi(tt,W):tt;return Array.isArray(X)||typeof X=="object"?JSON.stringify(X):String(X)}return B!==void 0?B.replace(/^["']|["']$/g,""):""}).replace(/\{\{(\w+(?:\.\w+)*)\s*(?:\|(date|time|datetime|timeago)\s*)?(?:\|\|\s*(.+?))?\}\}/g,($,I,Z,B)=>{const W=I.split(".");let Q=he;for(const tt of W)Q=Q==null?void 0:Q[tt];if(Q!==void 0)return Z?Gi(Q,Z):String(Q);if(Hr.current){let tt=Hr.current;for(const X of W)tt=tt==null?void 0:tt[X];if(tt!==void 0)return Z?Gi(tt,Z):String(tt)}if(W[0]==="config"){let tt=e==null?void 0:e.config;for(const X of W.slice(1))tt=tt==null?void 0:tt[X];if(tt!==void 0)return String(tt)}return B!==void 0?B.replace(/^["']|["']$/g,""):""}):"",hi=(M,$)=>{if(!M)return!0;if(typeof M=="object")try{const W=tt=>{const X=Date.parse(String(tt));return Number.isNaN(X)?Number(tt):X},Q={...he,...$,now:()=>Date.now(),date:W,isAfter:(tt,X)=>W(tt)>W(X),isBefore:(tt,X)=>W(tt)<W(X),includes:(tt,X)=>Array.isArray(tt)?tt.includes(X):String(tt??"").includes(String(X??"")),length:tt=>String(tt??"").length,lower:tt=>String(tt??"").toLowerCase(),upper:tt=>String(tt??"").toUpperCase(),round:Math.round,abs:Math.abs};return!!aht.evaluate(M.expression,Q)}catch{return!1}const I=W=>{var tt;if(W==="auth"){const X=(tt=e==null?void 0:e.auth)==null?void 0:tt.signedIn;return X===void 0?ft:X}if(W.startsWith("[")&&W.includes("]")){const X=W.indexOf("]"),st=sn.current[W.slice(1,X)],mt=W.slice(X+1).replace(/^\./,"");let vt;const pt=mt.split(".").filter(Boolean);pt[0]==="response"||pt[0]==="items"?vt=st:vt=(st==null?void 0:st.items)??st;for(const At of pt){if(vt==null)return;Array.isArray(vt)&&At==="length"?vt=vt.length:vt=vt==null?void 0:vt[At]}return vt}let Q=$;for(const X of W.split("."))Q=Q==null?void 0:Q[X];return Q},Z=M.trim();if(Z.includes("||"))return Z.split("||").some(W=>hi(W,$));if(Z.includes("&&"))return Z.split("&&").every(W=>hi(W,$));if(Z.startsWith("!"))return!I(Z.slice(1).trim());const B=Z.match(/^(\[[^\]]+\](?:\.\w+)*|\w+(?:\.\w+)*)\s*(==|!=|>|<|>=|<=)\s*(.+)$/);if(B){const W=I(B[1]),Q=B[3].trim().replace(/^["']|["']$/g,"");switch(B[2]){case"==":return String(W)===Q;case"!=":return String(W)!==Q;case">":return Number(W)>Number(Q);case"<":return Number(W)<Number(Q);case">=":return Number(W)>=Number(Q);case"<=":return Number(W)<=Number(Q)}}return!!I(Z)},fi=(M,$)=>hi(M,$||he),Pm=(M,$,I)=>{if(!f||h!==$&&!(u&&I&&u===I))return M;const B={...M};return f.size!==void 0&&(B.transform=`scale(${f.size/100})`,B.transformOrigin="center center"),f.spacing!==void 0&&(B.margin=`${f.spacing}px`),f.alignment&&(B.textAlign=f.alignment,f.alignment==="left"?(B.marginLeft="0",B.marginRight="auto"):f.alignment==="right"&&(B.marginLeft="auto",B.marginRight="0")),f.color&&(B.color=f.color),f.gridCols!==void 0&&(B.gridTemplateColumns=`repeat(${f.gridCols}, minmax(0, 1fr))`),f.gridGap!==void 0&&(B.gap=`${f.gridGap}px`),f.buttonBackground&&(B.background=f.buttonBackground),f.buttonTextColor&&(B.color=f.buttonTextColor),f.buttonBorderRadius!==void 0&&(B.borderRadius=`${f.buttonBorderRadius}px`),f.linkColor&&(B.color=f.linkColor),f.linkTextDecoration&&(B.textDecoration=f.linkTextDecoration),f.flexDirection&&(B.flexDirection=f.flexDirection),f.flexGap!==void 0&&(B.gap=`${f.flexGap}px`),B},Os=(M,$)=>{const I={...M};return $.scale!==void 0&&$.scale!==100&&(I.transform=`scale(${$.scale/100})`,I.transformOrigin="center center"),$.spacing!==void 0&&$.spacing!==0&&(I.margin=`${$.spacing}px`),$.alignment&&$.alignment!=="center"&&(I.textAlign=$.alignment,$.alignment==="left"?(I.marginLeft="0",I.marginRight="auto"):$.alignment==="right"&&(I.marginLeft="auto",I.marginRight="0")),$.color&&(I.color=$.color),$.background&&(I.backgroundColor=$.background),$.borderColor&&(I.borderColor=$.borderColor),I},rr=(M,$,I)=>{const Z=I==null?void 0:I.componentClass,W=h===M||u&&Z&&u===Z,Q=I?Os($,I):$,tt=Pm(Q,M,Z),X=(I==null?void 0:I.className)||"";/\bfont-serif\b/.test(X)&&(tt.fontFamily=le.typography.headingFontFamily),/\bfont-sans\b/.test(X)&&(tt.fontFamily=le.typography.fontFamily),I!=null&&I.fieldSpan&&I.fieldSpan>1&&(tt.gridColumn=`span ${I.fieldSpan} / span ${I.fieldSpan}`),I!=null&&I.rawStyle&&Object.assign(tt,I.rawStyle);const st=Et==="css-driven"?{"data-bf-r":`${$n}-${M}`}:{};if(W){const vt=tt.boxShadow?`${tt.boxShadow}, `:"";return{"data-component-key":M,...st,style:{...tt,boxShadow:`${vt}0 0 0 3px ${le.colors.primary}`}}}return Object.keys(tt).length>0?{"data-component-key":M,...st,style:tt}:{"data-component-key":M,...st}},Ih=(M,$)=>{var Q;if(!M)return{};const I=by(M),Z=M.split(/\s+/).filter(tt=>!/^(sm|md|lg|xl|2xl):/.test(tt)).join(" "),B=yt(Z||"flex");if(!vy(I))return B;if(Et==="css-driven"){const tt={flexDirection:"fd",gap:"gap",width:"w",minHeight:"min-h",alignItems:"items",justifyContent:"justify",display:"display",gridTemplateColumns:"grid-template",fontSize:"text",borderRadius:"radius",padding:"p",paddingLeft:"px",paddingRight:"px",paddingTop:"py",paddingBottom:"py",margin:"m",marginTop:"mt",marginRight:"mr",marginBottom:"mb",marginLeft:"ml"},X=(st,mt)=>`var(--bf-${tt[st]||st}-${$}, ${B[st]||mt})`;if(I.flexDirection.size>0&&(B.flexDirection=X("flexDirection","column")),I.gap.size>0&&(B.gap=X("gap","0px")),I.width.size>0&&(B.width=X("width","auto")),I.minHeight.size>0&&(B.minHeight=X("minHeight","0px")),I.alignItems.size>0&&(B.alignItems=X("alignItems","stretch")),I.justifyContent.size>0&&(B.justifyContent=X("justifyContent","flex-start")),I.display.size>0&&(B.display=X("display","flex")),I.gridCols.size>0){const st=B.gridTemplateColumns||"1",mt=typeof st=="string"?(Q=st.match(/^repeat\((\d+)/))==null?void 0:Q[1]:st;B.gridTemplateColumns=`repeat(var(--bf-cols-${$}, ${mt||"1"}), minmax(0, 1fr))`}return I.gridTemplateColumns.size>0&&(B.gridTemplateColumns=X("gridTemplateColumns",String(B.gridTemplateColumns||"none"))),I.textSize.size>0&&(B.fontSize=X("fontSize","1rem")),I.borderRadius.size>0&&(B.borderRadius=X("borderRadius","0px")),I.padding.p.size>0&&(B.padding=X("padding","0px")),I.padding.px.size>0&&(B.paddingLeft=X("paddingLeft","0px"),B.paddingRight=X("paddingRight","0px")),I.padding.py.size>0&&(B.paddingTop=X("paddingTop","0px"),B.paddingBottom=X("paddingBottom","0px")),I.margin.all.size>0&&(B.margin=X("margin","0px")),I.margin.t.size>0&&(B.marginTop=X("marginTop","0px")),I.margin.r.size>0&&(B.marginRight=X("marginRight","0px")),I.margin.b.size>0&&(B.marginBottom=X("marginBottom","0px")),I.margin.l.size>0&&(B.marginLeft=X("marginLeft","0px")),I.margin.x.size>0&&(B.marginLeft=X("marginLeft","0px"),B.marginRight=X("marginRight","0px")),I.margin.y.size>0&&(B.marginTop=X("marginTop","0px"),B.marginBottom=X("marginBottom","0px")),B}const W=ie;if(I.flexDirection.size>0&&(B.flexDirection=zt(I.flexDirection,W,"column")),I.gap.size>0&&(B.gap=zt(I.gap,W,"0px")),I.width.size>0&&(B.width=zt(I.width,W,"auto")),I.minHeight.size>0&&(B.minHeight=zt(I.minHeight,W,"0px")),I.alignItems.size>0&&(B.alignItems=zt(I.alignItems,W,"stretch")),I.justifyContent.size>0&&(B.justifyContent=zt(I.justifyContent,W,"flex-start")),I.display.size>0&&(B.display=zt(I.display,W,"flex")),I.gridCols.size>0){const tt=zt(I.gridCols,W,1);B.gridTemplateColumns=`repeat(${tt}, minmax(0, 1fr))`}return I.gridTemplateColumns.size>0&&(B.gridTemplateColumns=zt(I.gridTemplateColumns,W,String(B.gridTemplateColumns||"none"))),I.textSize.size>0&&(B.fontSize=zt(I.textSize,W,"1rem")),I.borderRadius.size>0&&(B.borderRadius=zt(I.borderRadius,W,"0px")),I.padding.p.size>0&&(B.padding=zt(I.padding.p,W,"0px")),I.padding.px.size>0&&(B.paddingLeft=zt(I.padding.px,W,"0px"),B.paddingRight=zt(I.padding.px,W,"0px")),I.padding.py.size>0&&(B.paddingTop=zt(I.padding.py,W,"0px"),B.paddingBottom=zt(I.padding.py,W,"0px")),I.margin.all.size>0&&(B.margin=zt(I.margin.all,W,"0px")),I.margin.t.size>0&&(B.marginTop=zt(I.margin.t,W,"0px")),I.margin.r.size>0&&(B.marginRight=zt(I.margin.r,W,"0px")),I.margin.b.size>0&&(B.marginBottom=zt(I.margin.b,W,"0px")),I.margin.l.size>0&&(B.marginLeft=zt(I.margin.l,W,"0px")),I.margin.x.size>0&&(B.marginLeft=zt(I.margin.x,W,"0px"),B.marginRight=zt(I.margin.x,W,"0px")),I.margin.y.size>0&&(B.marginTop=zt(I.margin.y,W,"0px"),B.marginBottom=zt(I.margin.y,W,"0px")),B},Sc=v.useRef(new Map),Am=v.useCallback(async M=>{const $=Sc.current.get(M);if($)return $;const I=r||localStorage.getItem("token")||"",Z=t==null?void 0:t.endpoint,B=N||(typeof Z=="string"?Z.replace(/\/+$/,""):"")||"/api",W=`?collection=${encodeURIComponent(M)}`;for(const Q of[`${B}/tenant/schema${W}`,`${B}/admin/schema${W}`])try{const tt=await fetch(Q,{headers:{Authorization:`Bearer ${I}`}});if(!tt.ok)continue;const X=await tt.json(),st=Array.isArray(X)?X:Array.isArray(X==null?void 0:X.data)?X.data:[],mt=st.find(vt=>vt.collection===M)||null;if(console.log(`[SchemaDebug][FE] fetchEntitySchema collection=${M} found=${!!mt} totalSchemas=${st.length}`,mt),!mt)continue;return Sc.current.set(M,mt),mt}catch{}return null},[r,N,t]),In={cfg:le,sdk:t,apiUrl:N,renderMode:Et,scopeId:$n,widgets:[...Array.isArray(e==null?void 0:e.widgets)?e.widgets:[],...Object.values(Mi).flatMap(M=>M.widgets||[])],widgetStack:[],parseClassName:yt,containerWidth:ie,interactionDisabled:m,previewMode:j,isAuthenticated:ft,styleOverrides:f,selectedComponentKey:h,selectedComponentClass:u,sceneData:he,setSceneData:se,setColorMode:M=>As(M),portalTarget:Ce.current,imageErrors:$t,setImageErrors:To,handleButtonClick:ka,interpolateText:Cs,evaluateExpression:_c,evaluateCondition:fi,showToast:$e,setActiveModal:un,dismissModal:Fi,setOverlayModal:tr,dismissOverlayModal:Co,fetchListData:kn,fetchEntitySchema:Am,goBack:Po,currentSceneId:Ot,isMobileView:ai,navigateToScene:qr,mobileMenuOpen:vs,setMobileMenuOpen:bs,renderComponent:(M,$,I)=>zf(In,M,$,I),renderIcon:(M,$,I)=>(n==null?void 0:n(M,$,I))??wb(M,$,I),getCommonProps:rr,imageReplacements:x,listData:$i,rowContextRef:Hr,uploadFile:Es,runBulkSelectAction:Oh,selectDynamicOptions:Ii,setSelectDynamicOptions:Ri,loading:Ar,buttonLoading:Ni,withLoading:Hi,paginationState:Cn,parseClassNameResponsive:Ih};O&&(In.renderPhaserGame=(M,$)=>O(In,M,$));let gn=[];const Rh=v.useMemo(()=>{const M={};for(const[$,I]of Object.entries(he))$.startsWith("_")||(M[$]=I);return JSON.stringify(M)},[he]),Io=v.useRef({}),Ra=v.useRef(""),Lh=v.useRef(""),ir=v.useRef(""),di=v.useRef({}),Nh=v.useRef({}),Er=v.useRef(Cn);Er.current=Cn;const jh=v.useRef(Ar);jh.current=Ar;const pi=v.useRef({}),Pc=v.useRef(new Set),Cr=v.useRef(null);v.useEffect(()=>{if(!pe||!ft){Gn.current.forEach($=>$()),Gn.current.clear(),zi.current.clear();return}const M=$=>{var Z;const I=$.getAttribute("data-bf-scroll-load");!I||Pc.current.has(I)||(Pc.current.add(I),(Z=Cr.current)==null||Z.observe($))};Cr.current||(Cr.current=new IntersectionObserver($=>{for(const I of $){if(!I.isIntersecting)continue;const Z=I.target.getAttribute("data-bf-scroll-load");if(!Z||pi.current[Z])continue;const B=Er.current[Z],W=ci.current[Z];if(!W||!(B!=null&&B.hasMore)||jh.current[Z])continue;pi.current[Z]=!0;const Q=di.current[Z]||1;di.current[Z]=Q+1;const tt=Nh.current[Z];kn(W,Z,Q,B.limit,tt==null?void 0:tt.field,tt==null?void 0:tt.direction,void 0,!0).finally(()=>{var X;if(pi.current[Z]=!1,I.target.isConnected){const st=I.target.getBoundingClientRect();st.bottom>-160&&st.top<(window.innerHeight||800)+160&&((X=Cr.current)==null||X.observe(I.target))}})}},{rootMargin:"160px 0px"})),document.querySelectorAll("[data-bf-scroll-load]").forEach(M)},[Ot,pe,kn,$i,Ar,Cn]),v.useEffect(()=>()=>{var M;(M=Cr.current)==null||M.disconnect(),Cr.current=null,Pc.current=new Set},[Ot]),v.useEffect(()=>{if(!pe)return;const M=Q=>typeof Q=="string"?Q.replace(/\{\{\s*\[([\w/.-]+)\](?:\.([\w.]+))?\s*(?:\|\|\s*(.+?))?\}\}/g,(tt,X,st,mt)=>{const vt=Gr(st?`${X}.${st}`:X);return vt!=null?String(vt):mt!==void 0?mt.replace(/^["']|["']$/g,""):""}).replace(/\{\{([\w.]+)\}\}/g,(tt,X)=>{const st=X.split(".").reduce((mt,vt)=>mt==null?void 0:mt[vt],he);return st!=null?String(st):""}):"";Ra.current!==Ot&&(Ra.current=Ot);let $=new Set;const I=(Q,tt="")=>{Array.isArray(Q)&&Q.forEach((X,st)=>{var At;const mt=`${tt}-${st}`;if((X.type==="list"||X.type==="table")&&X.dataSource){$.add(mt),X.key&&$.add(X.key),Nh.current[mt]=X.sort||{};const a=M(X.dataSource),d=Io.current[mt]!==a;d&&(Io.current[mt]=a,di.current[mt]=1,kn(a,mt,0,X.pageSize||10,void 0,void 0,X.key));const g=X.realtime,_=g?M(g.channel||""):"",C=g?M(g.url||""):"",k=g?M(g.event||""):"",F=g?`${C}|${_}|${k}`:"",et=zi.current.get(mt)!==F;if(g&&(d||et)){zi.current.set(mt,F);const ot=Gn.current.get(mt);ot&&ot();const dt=X.pageSize||10;let Pt;const kt=oe=>{if(!g.bind)return;let St=oe;try{St=typeof oe=="string"?JSON.parse(oe):oe}catch{}g.bindField&&(!St||St[g.bindField]===void 0)||St&&typeof St=="object"&&se(jt=>({...jt,[g.bind]:St}))},Yt=oe=>{if(!g.filter)return!0;let St=oe;if(typeof St=="string")try{St=JSON.parse(St)}catch{return!1}return!St||typeof St!="object"?!1:Object.entries(g.filter).every(([jt,Kt])=>{const Ne=typeof Kt=="string"?Cs(Kt):Kt;return Ne===""||St[jt]===Ne})},fn=(oe,St)=>{if(!g.onEvent||!Array.isArray(St))return;let jt=oe;if(typeof jt=="string")try{jt=JSON.parse(jt)}catch{return}const Kt=jt==null?void 0:jt.id,Ne=St.find(Ge=>(Ge==null?void 0:Ge.id)===Kt);if(Ne&&!(g.onEvent.when&&!hi(g.onEvent.when,Ne))){if(g.onEvent.once===!0){const Ge=[mt,g.onEvent.action,g.onEvent.when||"",(Ne==null?void 0:Ne.id)||Kt||""].join(":");if(ys.current.has(Ge))return;ys.current.add(Ge)}Hr.current=Ne,Ma.current=Object.keys(Ne),se(Ge=>({...Ge,...Ne})),ka(g.onEvent.action,{}).catch(()=>{})}};switch(g.mode){case"poll":{const oe=g.interval||5e3,St=window.setInterval(()=>{g.while&&!hi(g.while,ii.current)||kn(a,mt,0,dt)},oe);Pt=()=>clearInterval(St);break}case"sse":{if(!C&&!_){Pt=()=>{};break}const oe=r||localStorage.getItem("token")||"",St=C||`/events?channel=${_}`,jt=oe&&!St.includes("token=")?`${St}${St.includes("?")?"&":"?"}token=${encodeURIComponent(oe)}`:St,Kt=new EventSource(jt),Ne=Ge=>{Yt(Ge.data)&&(kt(Ge.data),kn(a,mt,0,dt))};k?Kt.addEventListener(k,Ne):Kt.onmessage=Ne,Kt.onerror=()=>Kt.close(),Pt=()=>Kt.close();break}case"ws":{const oe=_||(w?`tenant:${w}:entities`:"");if(!C&&!oe){Pt=()=>{};break}let St=null;const jt=()=>{var Ne;let Kt;if(oe&&((Ne=t==null?void 0:t.client)!=null&&Ne.createWebSocket))Kt=t.client.createWebSocket(oe);else{const Ge=C||`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws?channel=${oe}`;Kt=new WebSocket(Ge)}Kt.onmessage=Ge=>{Yt(Ge.data)&&(kt(Ge.data),kn(a,mt,0,dt).then(Ji=>{const zn=Array.isArray(Ji)?Ji:$i[mt];g.onEvent&&fn(Ge.data,zn);const Ls=he==null?void 0:he.id;if(Ls&&Array.isArray(zn)&&Ra.current===Ot){const sr=zn.find(be=>(be==null?void 0:be.id)===Ls);sr&&se(be=>({...be,...sr}))}}))},Kt.onclose=()=>setTimeout(jt,3e3),St=Kt};jt(),Pt=()=>St==null?void 0:St.close();break}default:Pt=()=>{}}Gn.current.set(mt,Pt)}}if(X.type==="select"&&X.dataSource){const a=`${mt}-sel`,d=M(X.dataSource);Io.current[a]!==d&&(Io.current[a]=d,(async()=>{try{const g=X.dataSource,_=M(g),C=await fetch(_,{headers:{Authorization:`Bearer ${r||localStorage.getItem("token")||""}`}});if(!C.ok)return;const k=await C.json(),F=X.dataField||"configs",et=X.optionLabel||"label",ot=X.optionValue||"value",dt=k[F]||k.data||k,Pt=Array.isArray(dt)?dt.map(kt=>({label:kt[et]||kt.name||kt.label,value:kt[ot]||kt.id||kt.name||kt.label})):[];Ri(kt=>({...kt,[mt]:Pt}))}catch{}})())}X.children&&I(X.children,mt);const vt=X.accordionItems||(X.type==="accordion"?X.items:null);Array.isArray(vt)&&vt.forEach((a,d)=>{Array.isArray(a==null?void 0:a.content)&&I(a.content,`${mt}-acc-${d}-content`)}),Array.isArray(X.tabItems)&&X.tabItems.forEach((a,d)=>{const g=Array.isArray(a==null?void 0:a.content)?a.content:Array.isArray(a==null?void 0:a.children)?a.children:null;g&&I(g,`${mt}-tabcontent-${d}`)});const pt=X;if(pt.type==="widget"&&pt.widgetId){const a=(At=e==null?void 0:e.widgets)==null?void 0:At.find(d=>d.id===pt.widgetId);a&&Array.isArray(a.components)&&I(a.components,`${mt}-${pt.widgetId}`)}})},Z=`${Ot}|${Rh}|${ft}`;Lh.current!==Z&&(Lh.current=Z,I(gn),ui.current=$);const B=Ae||_n;if(ir.current!==((B==null?void 0:B.id)||"")){ir.current=(B==null?void 0:B.id)||"";for(const[Q,tt]of Gn.current)Q.startsWith("modal")&&(tt(),Gn.current.delete(Q),delete Io.current[Q])}const W=B?Fe==null?void 0:Fe[B.id]:void 0;$=new Set,W&&Array.isArray(W==null?void 0:W.components)&&I(W.components,"modal"),en.current=new Set([...ui.current,...$]);for(const[Q,tt]of Gn.current)en.current.has(Q)||(tt(),Gn.current.delete(Q),zi.current.delete(Q),delete Io.current[Q])},[Ot,kn,Rh,Ae==null?void 0:Ae.id,_n==null?void 0:_n.id,ft]),v.useEffect(()=>()=>{Gn.current.forEach(M=>M()),Gn.current.clear()},[Ot]);const La=v.useMemo(()=>{if(!pe||Et!=="css-driven")return null;const M=new Map,$=(I,Z)=>{I.forEach((B,W)=>{const Q=`${Z}-${W}`;if(B.className){const tt=by(B.className);if(vy(tt)){const X=J$($n,Q,tt);X&&M.set(Q,X)}}B.children&&$(B.children,Q)})};return $(gn,""),M},[Ot,gn,Et,$n]),Ms=v.useRef(nr);Ms.current=nr;const Ro=le.realtime,Zr=Ro==null?void 0:Ro.mode,Zi=Ro==null?void 0:Ro.url;if(v.useEffect(()=>{if(!ft||Zr!=="sse"||!Zi)return;const M=r||localStorage.getItem("token");if(!M)return;let $=null,I=!1;return(async()=>{try{const Z=N||(t==null?void 0:t.endpoint)||window.location.origin,B=await fetch(`${Z}${Zi}/token`,{headers:{Authorization:`Bearer ${M}`}});if(!B.ok)return;const{token:W}=await B.json();if(!W||I)return;$=new EventSource(`${Z}${Zi}/subscribe?token=${encodeURIComponent(W)}`),$.onmessage=Q=>{try{const tt=JSON.parse(Q.data);tt!=null&&tt.message&&Ms.current(tt,"success")}catch{}},$.onerror=()=>$==null?void 0:$.close()}catch{}})(),()=>{I=!0,$==null||$.close()}},[ft,N,r,Zr,Zi]),!pe)return v.createElement(v.Fragment,null,oht(ct,Qt.length,Po,P));const fe=pe,Yi=fe.backgroundColor,Dh=Yi&&Qg(Yi)!==(le.colorMode==="dark"?"dark":"light")?Qg(Yi)==="dark"?xu.text:wu.text:le.colors.text,or=fe.height!==void 0?typeof fe.height=="number"?`${fe.height}px`:fe.height:void 0,Na=fe.minHeight!==void 0?typeof fe.minHeight=="number"?`${fe.minHeight}px`:fe.minHeight:void 0,Lo=fe.className?{...vT,fontFamily:le.typography.fontFamily,display:"flex",flexDirection:"column",width:"100%",maxWidth:"100%",position:"relative",...or?{height:or}:{},...Na?{minHeight:Na}:{},backgroundColor:Yi||le.colors.background,color:Dh,...yt(fe.className)}:{...vT,fontFamily:le.typography.fontFamily,display:"flex",flexDirection:"column",position:"relative",width:"100%",maxWidth:"100%",...or?{height:or}:{},...Na?{minHeight:Na}:{},backgroundColor:Yi||le.colors.background,color:Dh},Bh=Array.isArray(fe.components)?fe.components:[],Yr=iht($n),ks=(pe==null?void 0:pe.requireAuth)===!0||(fe==null?void 0:fe.requiresAuth)===!0||(Dt==null?void 0:Dt.requiresAuth)===!0||((Xi=Dt==null?void 0:Dt.config)==null?void 0:Xi.requiresAuth)===!0,Ac=(ks||rt)&&!ft?kh():null,Ec=ft&&ks&&J===!1&&!bt?v.createElement("div",{key:"email-banner",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"10px 40px",backgroundColor:le.colorMode==="dark"?"#78350f":"#fef3c7",color:le.colorMode==="dark"?"#fef3c7":"#92400e",fontSize:"13px",fontWeight:500,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"}},In.renderIcon("alert-triangle",14),v.createElement("span",null,"Verify your email — check your inbox for the confirmation link."),v.createElement("button",{"aria-label":"Dismiss",onClick:()=>de(!0),style:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"inherit",display:"flex",alignItems:"center",padding:"4px"}},In.renderIcon("x",16))):null,gr=e,Ki=Array.isArray(gr==null?void 0:gr.widgets)?gr.widgets:[],$s=new Set,Is=M=>{if(Array.isArray(M))for(const $ of M)$&&$.type==="widget"&&$.widgetId&&$s.add($.widgetId),$&&Array.isArray($.children)&&Is($.children)};Is(Bh);for(const M of Ki)Is(M.components);const zh=Ki.filter(M=>$s.has(M.id)?!1:M.sceneIds==="*"?!0:Array.isArray(M.sceneIds)?M.sceneIds.includes("*")||M.sceneIds.includes(Ot):!1),Em=Pr.map(M=>{var Z,B,W;const $=Mi[M.id],I=M.sourceSceneId?(Z=$==null?void 0:$.steps)==null?void 0:Z.find(Q=>Q.id===M.sourceSceneId):(B=$==null?void 0:$.steps)==null?void 0:B.find(Q=>Q.type==="render_scene");return(W=I==null?void 0:I.config)!=null&&W.components?{...M,components:I.config.components}:null}).filter(Boolean);gn=[...Bh],(Mc=(Oc=gr.layout)==null?void 0:Oc.header)!=null&&Mc.length?gn.splice(0,0,...gr.layout.header):(Mr=(Gh=fe==null?void 0:fe.layout)==null?void 0:Gh.header)!=null&&Mr.length&&gn.splice(0,0,...fe.layout.header);for(const M of zh||[]){const $=M.components||[];if(!$.length)continue;if(M.targetKey){const Z=M.targetKey.split("-").filter(Boolean).map(Number);if(Z.length>0){let B=gn,W=Z[0];for(let tt=0;tt<Z.length-1;tt++){const X=B[Z[tt]];if(!X||!Array.isArray(X.children))break;B=X.children,W=Z[tt+1]}const Q=M.targetPosition||"before";if(Q==="inside"){const tt=B[W];tt&&(Array.isArray(tt.children)||(tt.children=[]),tt.children.unshift(...$))}else Q==="after"?B.splice(W+1,0,...$):B.splice(W,0,...$);continue}}const I=M.index??gn.length;gn.splice(I,0,...$)}for(const M of Em){if(M.targetKey){const $=M.targetKey.split("-").filter(Boolean).map(Number);let I=gn,Z=$[0];for(let W=0;W<$.length-1;W++){const Q=I[$[W]];if(!Q||!Array.isArray(Q.children))break;I=Q.children,Z=$[W+1]}const B=M.targetPosition||"before";if(B==="inside"){const W=I[Z];W&&(Array.isArray(W.children)||(W.children=[]),W.children.unshift(...M.components))}else B==="after"?I.splice(Z+1,0,...M.components):I.splice(Z,0,...M.components);continue}gn.splice(M.index??gn.length,0,...M.components)}($c=(kc=gr.layout)==null?void 0:kc.footer)!=null&&$c.length?gn.push(...gr.layout.footer):(Zh=(jo=fe==null?void 0:fe.layout)==null?void 0:jo.footer)!=null&&Zh.length&&gn.push(...fe.layout.footer);const ja=La&&La.size>0?v.createElement("style",{key:"bf-responsive"},Array.from(La.values()).join(`
198
198
  `)):null,Cm=v.createElement("style",{key:"bf-transitions"},`#${$n} * { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease; }
199
199
  @keyframes bf-fade-in { from { opacity: 0; } to { opacity: 1; } }
200
200
  @keyframes bf-fade-out { from { opacity: 1; } to { opacity: 0; } }
@@ -216,6 +216,17 @@ ${M.message}`:M.message;$e(I,$);return}if(M.modalId&&Fe[M.modalId]){un({id:M.mod
216
216
  #${$n} .bf-loader-spinner { animation: bf-spin 0.7s linear infinite; }
217
217
  #${$n} .bf-btn-spinner { animation: bf-spin 0.7s linear infinite; }
218
218
  @keyframes bf-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
219
+ @keyframes bf-logo-excited {
220
+ 0%, 100% { transform: translateX(-50%) translateY(0) rotate(-8deg); }
221
+ 8% { transform: translateX(-50%) translateY(-18px) rotate(-8deg); }
222
+ 14% { transform: translateX(-50%) translateY(0) rotate(-8deg); }
223
+ 22% { transform: translateX(-50%) translateY(-38px) rotate(-8deg); }
224
+ 30% { transform: translateX(-50%) translateY(0) rotate(-8deg); }
225
+ 48% { transform: translateX(-50%) translateY(0) rotate(6deg); }
226
+ 64% { transform: translateX(-50%) translateY(0) rotate(-8deg); }
227
+ 74% { transform: translateX(-50%) translateY(-30px) rotate(-8deg); }
228
+ 84% { transform: translateX(-50%) translateY(0) rotate(-8deg); }
229
+ }
219
230
  @keyframes bf-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }`),Fh=gn.map((M,$)=>zf(In,M,$)),Wh=Object.values(Ar).some(Boolean)||Object.values(Ni).some(Boolean)?fe!=null&&fe.loadingComponent?v.createElement("div",{key:"scene-loader",style:{position:"absolute",inset:0,zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.15)",backdropFilter:"blur(1px)"}},zf(In,fe.loadingComponent,0,`${$n}-sceneloader`)):v.createElement("div",{key:"scene-loader",style:{position:"absolute",inset:0,zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.08)"}},v.createElement("div",{className:"bf-loader-spinner",style:{width:"32px",height:"32px",border:"3px solid rgba(128,128,128,0.15)",borderTopColor:"currentColor",borderRadius:"50%"}})):null,Om=[Ac,E==="modal"&&sht(ct),bT(Ae,le,In,fe==null?void 0:fe.backgroundColor,void 0,void 0,Ea),_n&&_n.id!==(Ae==null?void 0:Ae.id)?bT(_n,le,In,fe==null?void 0:fe.backgroundColor,In.dismissOverlayModal,10001):null,Wh,LI(e,{sceneId:Ot,sceneData:he,registry:sn.current,isAuthenticated:ft,colorMode:le.colorMode,runtimeIssues:Eo,enabled:H,navigateToScene:qr,openModal:M=>{const $=Fe[M];$&&un({id:M,definition:$})},submitReport:async M=>{const $=await fetch(new URL("/tenant/diagnostics/ui",er()).toString(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r||localStorage.getItem("token")||""}`},body:JSON.stringify(M)}),I=await $.json().catch(()=>null);return{submitted:$.ok,status:$.status,body:I,report:M}}})].filter(Boolean),Or=le.effects.scrollBehavior||"smooth",Da=v.createElement("style",{key:"bf-scroll-behavior"},`
220
231
  html {
221
232
  scroll-behavior: ${Or};