@stigg/react-sdk 7.24.1 → 7.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
- import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,SubscriptionStatus,PricingType,MeterType,BOOLEAN_DEFAULT_FALLBACK_ENTITLEMENT,NUMERIC_DEFAULT_FALLBACK_ENTITLEMENT,METERED_DEFAULT_FALLBACK_ENTITLEMENT,ENUM_DEFAULT_FALLBACK_ENTITLEMENT,BillingPeriod,SubscriptionScheduleType,ThresholdType,EntitlementResetPeriod,DiscountType,DiscountDurationType,Currency,BillingVendorIdentifier,CreditGrantType,WidgetType,FontWeight,TiersMode,Alignment}from'@stigg/js-client-sdk';export*from'@stigg/js-client-sdk';import xc,{forwardRef,useRef,useEffect,useContext,useState,useCallback,useMemo,createElement}from'react';import rp from'@emotion/styled';import j2 from'classnames';import Pe from'@mui/material/Grid';import Vf from'lodash/compact';import {NumericFormat,numericFormatter}from'react-number-format';import {useTheme,css,ThemeProvider as ThemeProvider$1,Global}from'@emotion/react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {padStart,keyBy,compact,range,isEmpty,capitalize,countBy,uniq,isFunction,isNil,partition,sum,map,startCase,upperCase,isString}from'lodash';import s2 from'react-spinners/ClipLoader';import Do from'color';import e2 from'lodash/merge';import Xc from'moment';import vr from'lodash/isNil';import x2 from'currency-symbol-map';import v2 from'@mui/material/InputAdornment';import b2,{buttonClasses}from'@mui/material/Button';import S2 from'@mui/material/TextField';import sf from'@mui/material/Divider';import ro,{SkeletonTheme}from'react-loading-skeleton';import _2 from'@mui/material/OutlinedInput';import A2 from'@mui/material/Select';import M2 from'@mui/material/MenuItem';import {styled,Grid,Autocomplete,Box,Select,OutlinedInput,TableContainer,Table,Divider,TableCell,TableRow,TablePagination,TableBody,Chip,Alert,FormControlLabel,Checkbox,useMediaQuery,MenuItem,TableHead,IconButton,Collapse}from'@mui/material';import xP from'react-switch';import If from'lodash/sortBy';import {createTheme,ThemeProvider,THEME_ID}from'@mui/material/styles';import PS from'lodash/flatMap';import Ma from'@mui/material/Box';import Pm from'@mui/material/Tab';import SS from'lodash/isEmpty';import AS from'@mui/material/Tabs';import {ExternalLink,Minus,Plus,ChevronRight,Info,ArrowDown}from'react-feather';import fT from'@mui/material/Link';import cT,{tooltipClasses}from'@mui/material/Tooltip';import bT,{linearProgressClasses}from'@mui/material/LinearProgress';import ff from'lodash/isUndefined';import rc from'lodash/lowerCase';import {produce}from'immer';import KT from'lodash/cloneDeep';import qT from'lodash/remove';import $f from'lodash/keyBy';import {BillingPeriod as BillingPeriod$1}from'@stigg/api-client-js/src/generated/sdk';import {Elements,useStripe,useElements,AddressElement,PaymentElement}from'@stripe/react-stripe-js';import Zk from'@mui/material/StepIcon';import M3 from'lodash/partition';import aw from'@mui/material/CircularProgress';import E3 from'@mui/material/Paper';import F3 from'@mui/material/Alert';import*as b from'country-flag-icons/react/3x2';import Zw from'react-lottie';import w3 from'@mui/material/Collapse';import r5 from'@mui/material/Radio';import h5 from'@mui/material/Chip';import f9 from'lodash/debounce';var op=Object.defineProperty,Qb=Object.defineProperties;var Jb=Object.getOwnPropertyDescriptors;var yr=Object.getOwnPropertySymbols;var np=Object.prototype.hasOwnProperty,ip=Object.prototype.propertyIsEnumerable;var ep=(e,t,o)=>t in e?op(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o,S=(e,t)=>{for(var o in t||(t={}))np.call(t,o)&&ep(e,o,t[o]);if(yr)for(var o of yr(t))ip.call(t,o)&&ep(e,o,t[o]);return e},_=(e,t)=>Qb(e,Jb(t));var ot=(e,t)=>{var o={};for(var n in e)np.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&yr)for(var n of yr(e))t.indexOf(n)<0&&ip.call(e,n)&&(o[n]=e[n]);return o};var tC=(e,t)=>{for(var o in t)op(e,o,{get:t[o],enumerable:true});};var R=(e,t,o)=>new Promise((n,i)=>{var r=l=>{try{s(o.next(l));}catch(c){i(c);}},a=l=>{try{s(o.throw(l));}catch(c){i(c);}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(r,a);s((o=o.apply(e,t)).next());});var ap={shouldForwardProp:e=>!e.startsWith("$")},sp=e=>rp(e,ap),eC=["div","span","button","input","form","p","h1","h2","h3","h4","h5","h6","a","img","ul","ol","li","table","thead","tbody","tr","td","th"];eC.forEach(e=>{sp[e]=rp(e,ap);});var x=sp;function xr(e,t,o){let n=o?` ${o}`:"";return (!e||e===1)&&t?`Up to ${t}${n}`:e&&e>1&&t?`${e}-${t}${n}`:e&&e>1?`Minimum ${e}${n}`:""}function At(e,t="en-US"){if(e==null)return;let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:0,fixedDecimalScale:true};return numericFormatter(String(Math.round(e)),o)}function al(e,t="en-US"){let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:2,fixedDecimalScale:true};return numericFormatter(String(e),o)}function ci(e,t=1){if(e<1e6)return At(e)||"0";let o=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"}];for(let{value:n,suffix:i}of o)if(e>=n){let a=(e/n).toFixed(t);return a.includes(".")&&(a=a.replace(/\.0+$/,"").replace(/(\.\d*[1-9])0+$/,"$1")),`${a}${i}`}return At(e)||"0"}function iC(e,t){let o=e.stigg.palette;switch(t){case "white":return "white";case "primary.main":return o.primary;case "primary.main.light":return o.primaryLight;case "warning":return o.warning;case "error":return o.error;default:return o.text[t]||o.text.primary}}function sl(e,t="body1"){let o=e.stigg.typography,n={h1:o.h1,h3:o.h2,h6:o.h3,body1:o.body,caption:o.caption};return n[t]||n.body1}var rC=x.div`
1
+ import rh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,SubscriptionStatus,PricingType,BOOLEAN_DEFAULT_FALLBACK_ENTITLEMENT,NUMERIC_DEFAULT_FALLBACK_ENTITLEMENT,METERED_DEFAULT_FALLBACK_ENTITLEMENT,ENUM_DEFAULT_FALLBACK_ENTITLEMENT,BillingPeriod,SubscriptionScheduleType,ThresholdType,DiscountType,DiscountDurationType,Currency,BillingVendorIdentifier,CreditGrantType,WidgetType,FontWeight,MeterType,EntitlementResetPeriod,TiersMode,Alignment}from'@stigg/js-client-sdk';export*from'@stigg/js-client-sdk';import Ac,{forwardRef,useRef,useEffect,useContext,useState,useMemo,useCallback,createElement}from'react';import gp from'@emotion/styled';import aP from'classnames';import Se from'@mui/material/Grid';import ef from'lodash/compact';import {NumericFormat,numericFormatter}from'react-number-format';import {useTheme,css,ThemeProvider as ThemeProvider$1,Global}from'@emotion/react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {padStart,keyBy,range,isEmpty,capitalize,countBy,uniq,isFunction,compact,isNil,partition,sum,map,startCase,upperCase,isString}from'lodash';import P2 from'react-spinners/ClipLoader';import Do from'color';import g2 from'lodash/merge';import rd from'moment';import _r from'lodash/isNil';import F2 from'currency-symbol-map';import z2 from'@mui/material/InputAdornment';import L2,{buttonClasses}from'@mui/material/Button';import D2 from'@mui/material/TextField';import gg from'@mui/material/Divider';import ro,{SkeletonTheme}from'react-loading-skeleton';import V2 from'@mui/material/OutlinedInput';import $2 from'@mui/material/Select';import H2 from'@mui/material/MenuItem';import {styled,Grid,Autocomplete,Box,Select,OutlinedInput,TableContainer,Table,Divider,TableCell,TableRow,TablePagination,TableBody,Chip,Alert,FormControlLabel,Checkbox,useMediaQuery,MenuItem,TableHead,IconButton,Collapse}from'@mui/material';import FP from'react-switch';import Hg from'lodash/sortBy';import {createTheme,ThemeProvider,THEME_ID}from'@mui/material/styles';import RS from'lodash/flatMap';import Na from'@mui/material/Box';import Eh from'@mui/material/Tab';import DS from'lodash/isEmpty';import $S from'@mui/material/Tabs';import {ExternalLink,ChevronRight,Info,Minus,Plus,ArrowDown}from'react-feather';import MT from'@mui/material/Link';import TT,{tooltipClasses}from'@mui/material/Tooltip';import LT,{linearProgressClasses}from'@mui/material/LinearProgress';import Sg from'lodash/keyBy';import Ig from'lodash/isUndefined';import {BillingModel as BillingModel$1,BillingPeriod as BillingPeriod$1}from'@stigg/api-client-js/src/generated/sdk';import mc from'lodash/lowerCase';import {produce}from'immer';import xk from'lodash/cloneDeep';import bk from'lodash/remove';import {Elements,useStripe,useElements,AddressElement,PaymentElement}from'@stripe/react-stripe-js';import fw from'@mui/material/StepIcon';import q3 from'lodash/partition';import Aw from'@mui/material/CircularProgress';import e5 from'@mui/material/Paper';import o5 from'@mui/material/Alert';import*as C from'country-flag-icons/react/3x2';import f3 from'react-lottie';import Y3 from'@mui/material/Collapse';import _5 from'@mui/material/Radio';import R5 from'@mui/material/Chip';import N9 from'lodash/debounce';var pp=Object.defineProperty,pC=Object.defineProperties;var mC=Object.getOwnPropertyDescriptors;var xr=Object.getOwnPropertySymbols;var mp=Object.prototype.hasOwnProperty,hp=Object.prototype.propertyIsEnumerable;var up=(e,t,o)=>t in e?pp(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o,S=(e,t)=>{for(var o in t||(t={}))mp.call(t,o)&&up(e,o,t[o]);if(xr)for(var o of xr(t))hp.call(t,o)&&up(e,o,t[o]);return e},A=(e,t)=>pC(e,mC(t));var ot=(e,t)=>{var o={};for(var n in e)mp.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&xr)for(var n of xr(e))t.indexOf(n)<0&&hp.call(e,n)&&(o[n]=e[n]);return o};var hC=(e,t)=>{for(var o in t)pp(e,o,{get:t[o],enumerable:true});};var R=(e,t,o)=>new Promise((n,i)=>{var r=l=>{try{s(o.next(l));}catch(c){i(c);}},a=l=>{try{s(o.throw(l));}catch(c){i(c);}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(r,a);s((o=o.apply(e,t)).next());});var fp={shouldForwardProp:e=>!e.startsWith("$")},yp=e=>gp(e,fp),gC=["div","span","button","input","form","p","h1","h2","h3","h4","h5","h6","a","img","ul","ol","li","table","thead","tbody","tr","td","th"];gC.forEach(e=>{yp[e]=gp(e,fp);});var y=yp;function br(e,t,o){let n=o?` ${o}`:"";return (!e||e===1)&&t?`Up to ${t}${n}`:e&&e>1&&t?`${e}-${t}${n}`:e&&e>1?`Minimum ${e}${n}`:""}function At(e,t="en-US"){if(e==null)return;let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:0,fixedDecimalScale:true};return numericFormatter(String(Math.round(e)),o)}function hl(e,t="en-US"){let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:2,fixedDecimalScale:true};return numericFormatter(String(e),o)}function ci(e,t=1){if(e<1e6)return At(e)||"0";let o=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"}];for(let{value:n,suffix:i}of o)if(e>=n){let a=(e/n).toFixed(t);return a.includes(".")&&(a=a.replace(/\.0+$/,"").replace(/(\.\d*[1-9])0+$/,"$1")),`${a}${i}`}return At(e)||"0"}function xC(e,t){let o=e.stigg.palette;switch(t){case "white":return "white";case "primary.main":return o.primary;case "primary.main.light":return o.primaryLight;case "warning":return o.warning;case "error":return o.error;default:return o.text[t]||o.text.primary}}function gl(e,t="body1"){let o=e.stigg.typography,n={h1:o.h1,h3:o.h2,h6:o.h3,body1:o.body,caption:o.caption};return n[t]||n.body1}var bC=y.div`
2
2
  margin: 0;
3
3
  ${({$isInline:e})=>e&&"display: inline"};
4
4
 
5
5
  /* Apply typography styles from theme */
6
6
  font-family: ${({theme:e})=>e.stigg.typography.fontFamily};
7
7
  color: ${({$color:e})=>e};
8
- font-weight: ${({$bold:e,theme:t,$variant:o})=>e?"bold":sl(t,o).fontWeight};
9
- font-size: ${({theme:e,$variant:t})=>sl(e,t).fontSize};
8
+ font-weight: ${({$bold:e,theme:t,$variant:o})=>e?"bold":gl(t,o).fontWeight};
9
+ font-size: ${({theme:e,$variant:t})=>gl(e,t).fontSize};
10
10
  ${({$lineHeight:e})=>e&&`line-height: ${e};`}
11
- `,C=forwardRef((e,t)=>{let g=e,{children:o,style:n,variant:i="body1",color:r="primary",overrideColor:a,bold:s=false,as:l,className:c,lineHeight:d}=g,u=ot(g,["children","style","variant","color","overrideColor","bold","as","className","lineHeight"]),p=useTheme(),m=sl(p,i),h=l||m.semanticElement,f=a||iC(p,r);return jsx(rC,_(S({as:h,ref:t},u),{className:c,style:n,$variant:i,$bold:s,$color:f,$lineHeight:d,$isInline:h==="span",children:o}))});C.displayName="Typography";var br=(e,t)=>{switch(e){case "primary":return t.stigg.palette.text.primary;case "secondary":return t.stigg.palette.text.secondary;default:return e}};var pl={};tC(pl,{Add:()=>Wp,Addons:()=>dp,ArrowForward:()=>Dp,BillingInfoCustomer:()=>pp,Check:()=>Up,Close:()=>Op,ContactSupport:()=>mp,Coupon:()=>Vp,CreditCard:()=>gp,DollarCoin:()=>xp,EntitlementCheck:()=>Zp,MiniSchedule:()=>Cr,OutlinedCheckedCircle:()=>Ep,OutlinedCheckedCircleDisabled:()=>Fp,OutlinedCircle:()=>Bp,PayAsYouGoCharge:()=>$p,PaymentMethod:()=>Ip,Promotions:()=>Pp,Remove:()=>jp,RenewSubscription:()=>_p,Restore:()=>Pr,ScheduleBox:()=>Tp,ScheduleClock:()=>wp,Trash:()=>Ap});var sC=e=>jsxs("svg",_(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxs("g",{clipPath:"url(#clip0_834_118930)",children:[jsx("path",{d:"M12 6.85712V17.1428",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M6.85712 12H17.1428",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M18 0.857117H5.99997C3.15966 0.857117 0.857117 3.15966 0.857117 5.99997V18C0.857117 20.8404 3.15966 23.1428 5.99997 23.1428H18C20.8404 23.1428 23.1428 20.8404 23.1428 18V5.99997C23.1428 3.15966 20.8404 0.857117 18 0.857117Z",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsx("defs",{children:jsx("clipPath",{id:"clip0_834_118930",children:jsx("rect",{width:24,height:24,fill:"white"})})})]})),dp=sC;var lC=e=>jsxs("svg",_(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsx("path",{d:"M26 27V25C26 22.7909 24.2091 21 22 21H14C11.7909 21 10 22.7909 10 25V27",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18 17C20.2091 17 22 15.2091 22 13C22 10.7909 20.2091 9 18 9C15.7909 9 14 10.7909 14 13C14 15.2091 15.7909 17 18 17Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("defs",{children:jsxs("linearGradient",{id:"paint0_linear_67_8545",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsx("stop",{stopColor:"#56ACF6"}),jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),pp=lC;var cC=e=>jsxs("svg",_(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsx("path",{d:"M27 18.22C27 12.73 22.74 9 18 9C13.31 9 9 12.65 9 18.28C8.4 18.62 8 19.26 8 20V22C8 23.1 8.9 24 10 24H11V17.9C11 14.03 14.13 10.9 18 10.9C21.87 10.9 25 14.03 25 17.9V25H17V27H25C26.1 27 27 26.1 27 25V23.78C27.59 23.47 28 22.86 28 22.14V19.84C28 19.14 27.59 18.53 27 18.22Z",fill:"#7586B0"}),jsx("path",{d:"M15 20C15.5523 20 16 19.5523 16 19C16 18.4477 15.5523 18 15 18C14.4477 18 14 18.4477 14 19C14 19.5523 14.4477 20 15 20Z",fill:"#7586B0"}),jsx("path",{d:"M21 20C21.5523 20 22 19.5523 22 19C22 18.4477 21.5523 18 21 18C20.4477 18 20 18.4477 20 19C20 19.5523 20.4477 20 21 20Z",fill:"#7586B0"}),jsx("path",{d:"M24 17.03C23.52 14.18 21.04 12 18.05 12C15.02 12 11.76 14.51 12.02 18.45C14.49 17.44 16.35 15.24 16.88 12.56C18.19 15.19 20.88 17 24 17.03Z",fill:"#7586B0"}),jsx("defs",{children:jsxs("linearGradient",{id:"paint0_linear_267_19310",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsx("stop",{stopColor:"#56ACF6"}),jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),mp=cC;var dC=e=>jsxs("svg",_(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsx("path",{d:"M26 10H10C8.89 10 8.01 10.89 8.01 12L8 24C8 25.11 8.89 26 10 26H26C27.11 26 28 25.11 28 24V12C28 10.89 27.11 10 26 10ZM26 24H10V18H26V24ZM26 14H10V12H26V14Z",fill:"#7586B0"}),jsx("defs",{children:jsxs("linearGradient",{id:"paint0_linear_67_8556",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsx("stop",{stopColor:"#56ACF6"}),jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),gp=dC;var uC=e=>jsxs("svg",_(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxs("g",{clipPath:"url(#clip0_834_120339)",children:[jsx("path",{d:"M10.3336 19.2858C15.462 19.2858 19.6193 15.1285 19.6193 10.0001C19.6193 4.87171 15.462 0.714355 10.3336 0.714355C5.20521 0.714355 1.04785 4.87171 1.04785 10.0001C1.04785 15.1285 5.20521 19.2858 10.3336 19.2858Z",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M12.7649 7.46052C12.6813 7.22393 12.5523 7.0088 12.3883 6.8256C12.0395 6.43592 11.5327 6.19067 10.9685 6.19067H9.4942C8.55517 6.19067 7.79395 6.9519 7.79395 7.89093C7.79395 8.68995 8.3503 9.38116 9.13086 9.5519L11.3756 10.0429C12.25 10.2342 12.8733 11.0091 12.8733 11.9043C12.8733 12.9562 12.0205 13.8097 10.9685 13.8097H9.6987C8.86936 13.8097 8.16382 13.2797 7.90233 12.5399",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M10.3335 6.19065V4.28589",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M10.3335 15.7144V13.8096",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsx("defs",{children:jsx("clipPath",{id:"clip0_834_120339",children:jsx("rect",{width:20,height:20,fill:"white",transform:"translate(0.333496)"})})})]})),xp=uC;var pC=e=>jsx("svg",_(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.95392 1.03353C7.1196 1.56038 6.82682 2.12178 6.29997 2.28746C5.79034 2.44773 5.30237 2.68036 4.85175 2.98146C3.76168 3.70982 2.95789 4.79361 2.57732 6.04817C2.19675 7.30273 2.26296 8.65044 2.76466 9.86166C3.26637 11.0729 4.17252 12.0727 5.32873 12.6907C6.48494 13.3087 7.81967 13.5067 9.10549 13.2509C10.3913 12.9951 11.5487 12.3014 12.3804 11.288C13.2121 10.2746 13.6666 9.00413 13.6666 7.69312C13.6666 7.14083 14.1144 6.69312 14.6666 6.69312C15.2189 6.69312 15.6666 7.14083 15.6666 7.69312C15.6666 7.92228 15.6564 8.15052 15.6361 8.37721C15.6465 8.44937 15.6492 8.52379 15.6432 8.59952L15.6392 8.64883C15.6298 8.75932 15.6028 8.86407 15.5612 8.96057C15.3409 10.2743 14.7807 11.5158 13.9264 12.5568C12.8012 13.9279 11.2353 14.8664 9.49568 15.2125C7.75603 15.5585 5.95022 15.2906 4.38594 14.4545C2.82166 13.6184 1.59568 12.2657 0.916905 10.627C0.238131 8.98832 0.148554 7.16495 0.663439 5.4676C1.17832 3.77025 2.26581 2.30394 3.74061 1.31852C4.35023 0.911179 5.01049 0.596408 5.69999 0.379577C6.22684 0.213898 6.78824 0.506683 6.95392 1.03353ZM7.56761 1.27284C7.61434 0.722538 8.09832 0.314306 8.64863 0.361031L8.69791 0.365373C9.24791 0.415584 9.65307 0.902149 9.60286 1.45215C9.55265 2.00214 9.06608 2.4073 8.51608 2.35709L8.47942 2.35386C7.92912 2.30714 7.52089 1.82315 7.56761 1.27284ZM12.4186 2.90891C12.8384 2.55014 13.4697 2.59967 13.8284 3.01954C13.8498 3.04454 13.871 3.06967 13.892 3.09494C14.2454 3.51937 14.1878 4.14991 13.7634 4.50329C13.339 4.85667 12.7084 4.79906 12.355 4.37463C12.3395 4.35592 12.3238 4.33731 12.3079 4.31879C11.9492 3.89892 11.9987 3.26769 12.4186 2.90891ZM8.99998 5.33352C8.99998 4.78124 8.55226 4.33352 7.99998 4.33352C7.44769 4.33352 6.99998 4.78124 6.99998 5.33352V8.00019C6.99998 8.55247 7.44769 9.00019 7.99998 9.00019H10.6666C11.2189 9.00019 11.6666 8.55247 11.6666 8.00019C11.6666 7.4479 11.2189 7.00019 10.6666 7.00019H8.99998V5.33352Z",fill:"#7586B0"})})),Cr=pC;var hC=e=>jsxs("svg",_(S({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxs("g",{clipPath:"url(#clip0_834_116282)",children:[jsx("path",{d:"M21.4286 5.32483H2.57146C1.62469 5.32483 0.857178 6.09235 0.857178 7.03911V10.4677C0.857178 11.4145 1.62469 12.182 2.57146 12.182H21.4286C22.3754 12.182 23.1429 11.4145 23.1429 10.4677V7.03911C23.1429 6.09235 22.3754 5.32483 21.4286 5.32483Z",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M21.4287 12.182V21.6106C21.4287 22.0652 21.248 22.5013 20.9266 22.8227C20.6051 23.1442 20.169 23.3249 19.7144 23.3249H4.28582C3.83116 23.3249 3.39513 23.1442 3.07363 22.8227C2.75215 22.5013 2.57153 22.0652 2.57153 21.6106V12.182",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M12 5.32483V23.3248",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M17.1429 1.03912L12 5.32484L6.85718 1.03912",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsx("defs",{children:jsx("clipPath",{id:"clip0_834_116282",children:jsx("rect",{width:24,height:24,fill:"white",transform:"translate(0 0.182007)"})})})]})),Pp=hC;var mC=e=>jsx("svg",_(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{d:"M10.8333 2.5C6.69168 2.5 3.33334 5.85833 3.33334 10H0.833344L4.07501 13.2417L4.13334 13.3583L7.50001 10H5.00001C5.00001 6.775 7.60834 4.16667 10.8333 4.16667C14.0583 4.16667 16.6667 6.775 16.6667 10C16.6667 13.225 14.0583 15.8333 10.8333 15.8333C9.22501 15.8333 7.76668 15.175 6.71668 14.1167L5.53334 15.3C6.89168 16.6583 8.75834 17.5 10.8333 17.5C14.975 17.5 18.3333 14.1417 18.3333 10C18.3333 5.85833 14.975 2.5 10.8333 2.5ZM10 6.66667V10.8333L13.5667 12.95L14.1667 11.9417L11.25 10.2083V6.66667H10Z",fill:"#6678A7"})})),Pr=mC;var fC=e=>jsxs("svg",_(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("rect",{width:36,height:36,rx:10,fill:"url(#paint0_linear_834_118583)"}),jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9539 7.70028C16.1196 8.22713 15.8268 8.78853 15.3 8.95421C14.4906 9.20875 13.7155 9.57824 12.9999 10.0564C11.2686 11.2132 9.99197 12.9346 9.38754 14.9271C8.78311 16.9196 8.88826 19.0601 9.68509 20.9838C10.4819 22.9075 11.9211 24.4954 13.7574 25.477C15.5938 26.4585 17.7136 26.7729 19.7558 26.3667C21.798 25.9605 23.6362 24.8588 24.9571 23.2492C26.278 21.6396 27 19.6219 27 17.5397C27 16.9874 27.4477 16.5397 28 16.5397C28.5523 16.5397 29 16.9874 29 17.5397C29 17.8969 28.9826 18.2526 28.9483 18.6056C28.9662 18.6949 28.9722 18.7883 28.9645 18.8837L28.9606 18.9309C28.9496 19.0607 28.9143 19.1825 28.8595 19.2924C28.5513 21.2017 27.7432 23.007 26.5031 24.518C24.8886 26.4852 22.642 27.8318 20.146 28.3283C17.65 28.8248 15.059 28.4405 12.8146 27.2408C10.5702 26.0411 8.81122 24.1004 7.83733 21.7492C6.86343 19.398 6.73491 16.7819 7.47366 14.3465C8.21241 11.9112 9.77272 9.80737 11.8887 8.3935C12.7634 7.80905 13.7107 7.35743 14.7 7.04633C15.2269 6.88065 15.7883 7.17343 15.9539 7.70028ZM17.8497 7.95155C17.8964 7.40125 18.3804 6.99302 18.9307 7.03974L18.9779 7.04385C19.528 7.0929 19.9342 7.57861 19.8851 8.12871C19.8361 8.67881 19.3503 9.085 18.8002 9.03595L18.7615 9.03257C18.2112 8.98585 17.8029 8.50186 17.8497 7.95155ZM22.8579 9.19953C23.172 8.74525 23.7949 8.63161 24.2492 8.9457C24.2751 8.96361 24.3009 8.98162 24.3266 8.99974C24.7782 9.31772 24.8865 9.94155 24.5685 10.3931C24.2505 10.8447 23.6267 10.953 23.1751 10.635C23.1541 10.6202 23.1329 10.6054 23.1118 10.5908C22.6575 10.2767 22.5438 9.6538 22.8579 9.19953ZM26.6058 12.8085C27.1045 12.5712 27.7011 12.7831 27.9384 13.2818C27.9519 13.3102 27.9653 13.3387 27.9786 13.3672C28.2116 13.868 27.9946 14.4628 27.4939 14.6958C26.9931 14.9288 26.3983 14.7117 26.1653 14.211L26.1506 14.1796L26.1324 14.1411C25.8951 13.6424 26.1071 13.0458 26.6058 12.8085ZM19 14.0003C19 13.448 18.5523 13.0003 18 13.0003C17.4477 13.0003 17 13.448 17 14.0003V18.0003C17 18.5526 17.4477 19.0003 18 19.0003H22C22.5523 19.0003 23 18.5526 23 18.0003C23 17.448 22.5523 17.0003 22 17.0003H19V14.0003Z",fill:"#7586B0"}),jsx("defs",{children:jsx("linearGradient",{id:"paint0_linear_834_118583",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse"})})]})),Tp=fC;var yC=e=>jsx("svg",_(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.95394 1.70028C10.1196 2.22713 9.82684 2.78853 9.29999 2.95421C8.49057 3.20875 7.71555 3.57824 6.99987 4.05644C5.26859 5.21324 3.99197 6.93456 3.38754 8.9271C2.78311 10.9196 2.88826 13.0601 3.68509 14.9838C4.48191 16.9075 5.9211 18.4954 7.75743 19.477C9.59377 20.4585 11.7136 20.7729 13.7558 20.3667C15.798 19.9605 17.6362 18.8588 18.9571 17.2492C20.278 15.6396 21 13.6219 21 11.5397C21 10.9874 21.4477 10.5397 22 10.5397C22.5523 10.5397 23 10.9874 23 11.5397C23 11.8969 22.9826 12.2526 22.9483 12.6056C22.9662 12.6949 22.9722 12.7883 22.9645 12.8837L22.9606 12.9309C22.9496 13.0607 22.9143 13.1825 22.8595 13.2924C22.5513 15.2017 21.7432 17.007 20.5031 18.518C18.8886 20.4852 16.642 21.8318 14.146 22.3283C11.65 22.8248 9.05905 22.4405 6.81464 21.2408C4.57023 20.0411 2.81122 18.1004 1.83733 15.7492C0.863434 13.398 0.734911 10.7819 1.47366 8.34653C2.21241 5.91121 3.77272 3.80737 5.88873 2.3935C6.76341 1.80905 7.71072 1.35743 8.70001 1.04633C9.22686 0.880646 9.78826 1.17343 9.95394 1.70028ZM11.8497 1.95155C11.8964 1.40125 12.3804 0.993017 12.9307 1.03974L12.9779 1.04385C13.528 1.0929 13.9342 1.57861 13.8851 2.12871C13.8361 2.67881 13.3503 3.085 12.8002 3.03595L12.7615 3.03257C12.2112 2.98585 11.8029 2.50186 11.8497 1.95155ZM16.8579 3.19953C17.172 2.74525 17.7949 2.63161 18.2492 2.9457C18.2751 2.96361 18.3009 2.98162 18.3266 2.99974C18.7782 3.31772 18.8865 3.94155 18.5685 4.39311C18.2505 4.84467 17.6267 4.95296 17.1751 4.63498C17.1541 4.62016 17.1329 4.60542 17.1118 4.59078C16.6575 4.27669 16.5438 3.6538 16.8579 3.19953ZM20.6058 6.80846C21.1045 6.57117 21.7011 6.78308 21.9384 7.28179C21.9519 7.3102 21.9653 7.33869 21.9786 7.36723C22.2116 7.86796 21.9946 8.46276 21.4939 8.69577C20.9931 8.92877 20.3983 8.71174 20.1653 8.21101L20.1506 8.17957L20.1324 8.14112C19.8951 7.64241 20.1071 7.04576 20.6058 6.80846ZM13 8.00027C13 7.44798 12.5523 7.00027 12 7.00027C11.4477 7.00027 11 7.44798 11 8.00027V12.0003C11 12.5526 11.4477 13.0003 12 13.0003H16C16.5523 13.0003 17 12.5526 17 12.0003C17 11.448 16.5523 11.0003 16 11.0003H13V8.00027Z",fill:"#7586B0"})})),wp=yC;var xC=e=>jsxs("svg",_(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 10.8954 9.89543 10 11 10H25C26.1046 10 27 10.8954 27 12V26C27 27.1046 26.1046 28 25 28H11C9.89543 28 9 27.1046 9 26V12Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M22 8V12",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M14 8V12",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M9 16H27",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("defs",{children:jsxs("linearGradient",{id:"paint0_linear_45_8861",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsx("stop",{stopColor:"#56ACF6"}),jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),_p=xC;var bC=e=>jsx("svg",_(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxs("g",{id:"trash-2",children:[jsx("path",{id:"Shape",d:"M3 6H5H21",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{id:"Shape_2",d:"M20 6C20 5.44772 19.5523 5 19 5C18.4477 5 18 5.44772 18 6H20ZM6 6C6 5.44772 5.55228 5 5 5C4.44772 5 4 5.44772 4 6H6ZM7 6C7 6.55228 7.44772 7 8 7C8.55228 7 9 6.55228 9 6H7ZM15 6C15 6.55228 15.4477 7 16 7C16.5523 7 17 6.55228 17 6H15ZM18 6V20H20V6H18ZM18 20C18 20.5523 17.5523 21 17 21V23C18.6569 23 20 21.6569 20 20H18ZM17 21H7V23H17V21ZM7 21C6.44772 21 6 20.5523 6 20H4C4 21.6569 5.34315 23 7 23V21ZM6 20V6H4V20H6ZM9 6V4H7V6H9ZM9 4C9 3.44772 9.44772 3 10 3V1C8.34315 1 7 2.34315 7 4H9ZM10 3H14V1H10V3ZM14 3C14.5523 3 15 3.44772 15 4H17C17 2.34315 15.6569 1 14 1V3ZM15 4V6H17V4H15Z",fill:"#F88078"}),jsx("path",{id:"Shape_3",d:"M10 11V17",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{id:"Shape_4",d:"M14 11V17",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Ap=bC;var PC=e=>jsxs("svg",_(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("path",{d:"M21.1667 4H2.83333C1.82081 4 1 4.89543 1 6V18C1 19.1046 1.82081 20 2.83333 20H21.1667C22.1792 20 23 19.1046 23 18V6C23 4.89543 22.1792 4 21.1667 4Z",fill:"#C6C6C7"}),jsx("path",{opacity:.3,d:"M19.75 16.4286H17.5C17.0125 16.4286 16.75 16.2 16.75 15.6667C16.75 15.1334 17.0125 14.9048 17.5 14.9048H19.75C20.2375 14.9048 20.5 15.1334 20.5 15.6667C20.5 16.2 20.2375 16.4286 19.75 16.4286ZM15.25 16.4286H13C12.5125 16.4286 12.25 16.2 12.25 15.6667C12.25 15.1334 12.5125 14.9048 13 14.9048H15.25C15.7375 14.9048 16 15.1334 16 15.6667C16 16.2 15.7375 16.4286 15.25 16.4286ZM10.75 16.4286H8.5C8.0125 16.4286 7.75 16.2 7.75 15.6667C7.75 15.1334 8.0125 14.9048 8.5 14.9048H10.75C11.2375 14.9048 11.5 15.1334 11.5 15.6667C11.5 16.2 11.2375 16.4286 10.75 16.4286ZM6.25 16.4286H4C3.5125 16.4286 3.25 16.2 3.25 15.6667C3.25 15.1334 3.5125 14.9048 4 14.9048H6.25C6.7375 14.9048 7 15.1334 7 15.6667C7 16.2 6.7375 16.4286 6.25 16.4286Z",fill:"black"})]})),Ip=PC;var TC=e=>jsx("svg",_(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("circle",{cx:10.333,cy:10,r:9,fill:"white",stroke:"#327EEE",strokeWidth:2})})),Bp=TC;var kC=e=>jsx("svg",_(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxs("g",{id:"Group 16159",children:[jsx("circle",{id:"Ellipse 5",cx:10,cy:10,r:9.25,fill:"#327EEE",stroke:"#327EEE",strokeWidth:1.5}),jsx("path",{id:"Shape",d:"M5 10.3636L8.63667 14L12.637 10L14.6372 8",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Ep=kC;var vC=e=>jsx("svg",_(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxs("g",{id:"Stepper indicators",children:[jsx("circle",{id:"Ellipse 5",cx:10.667,cy:10,r:9.25,fill:"#B3BCD3",stroke:"#B3BCD3",strokeWidth:1.5}),jsx("path",{id:"Shape",d:"M5.66699 10.3636L9.30366 14L13.304 10L15.3042 8",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Fp=vC;var AC=e=>jsx("svg",_(S({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{d:"M9 3L7.9425 4.0575L12.1275 8.25H3V9.75H12.1275L7.9425 13.9425L9 15L15 9L9 3Z",fill:"white"})})),Dp=AC;var MC=e=>jsx("svg",_(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{d:"M15.8337 5.34199L14.6587 4.16699L10.0003 8.82533L5.34199 4.16699L4.16699 5.34199L8.82533 10.0003L4.16699 14.6587L5.34199 15.8337L10.0003 11.1753L14.6587 15.8337L15.8337 14.6587L11.1753 10.0003L15.8337 5.34199Z",fill:"#327EEE"})})),Op=MC;var IC=e=>jsx("svg",_(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("g",{id:"check",children:jsx("path",{id:"Shape",d:"M20 7L9 18L4 13",stroke:"#F5F6F9",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})})),Up=IC;var LC=e=>jsxs("svg",_(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxs("g",{clipPath:"url(#clip0_1889_12169)",children:[jsx("path",{d:"M11.4286 7.42578L8 13.1401",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M14.857 13.1412C15.3274 12.0123 15.5118 10.7848 15.3938 9.56751C15.2758 8.35027 14.8592 7.18097 14.1808 6.16341C13.5024 5.14585 12.5833 4.31152 11.5051 3.73446C10.4268 3.1574 9.22281 2.85547 7.99986 2.85547C6.77691 2.85547 5.57288 3.1574 4.49463 3.73446C3.41639 4.31152 2.49729 5.14585 1.81892 6.16341C1.14055 7.18097 0.723889 8.35027 0.605928 9.56751C0.487968 10.7848 0.672354 12.0123 1.14272 13.1412H14.857Z",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsx("defs",{children:jsx("clipPath",{id:"clip0_1889_12169",children:jsx("rect",{width:16,height:16,fill:"white"})})})]})),$p=LC;var BC=e=>jsx("svg",_(S({width:16,height:16,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxs("g",{id:"tag--tags-bookmark-favorite",children:[jsx("path",{id:"Vector",d:"M1.26995 11.9426L6.05743 16.7301C6.2305 16.903 6.4651 17.0001 6.7097 17.0001C6.95431 17.0001 7.18891 16.903 7.36198 16.7301L16.8631 7.22895C16.9108 7.18332 16.9478 7.12758 16.9712 7.06583C16.9946 7.00408 17.0039 6.93787 16.9985 6.87205L16.2724 2.15839C16.2664 2.04607 16.2192 1.93992 16.1396 1.86038C16.0601 1.78085 15.9539 1.73357 15.8416 1.72764L11.128 1.00152C11.0622 0.996055 10.9959 1.00538 10.9342 1.0288C10.8724 1.05222 10.8167 1.08916 10.7711 1.1369L1.26995 10.638C1.09709 10.8111 1 11.0457 1 11.2903C1 11.5349 1.09709 11.7695 1.26995 11.9426Z",stroke:"#327EEE",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{id:"Vector_2",d:"M12.5548 6.05884C12.3916 6.05884 12.2351 5.99401 12.1197 5.87861C12.0043 5.76321 11.9395 5.60669 11.9395 5.44348C11.9395 5.28028 12.0043 5.12376 12.1197 5.00836C12.2351 4.89296 12.3916 4.82812 12.5548 4.82812C12.718 4.82812 12.8745 4.89296 12.9899 5.00836C13.1053 5.12376 13.1702 5.28028 13.1702 5.44348C13.1702 5.60669 13.1053 5.76321 12.9899 5.87861C12.8745 5.99401 12.718 6.05884 12.5548 6.05884Z",stroke:"#327EEE",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Vp=BC;var FC=e=>jsx("svg",_(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{d:"M12 3V21.0001M3 11.9446H21",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),Wp=FC;var RC=e=>jsx("svg",_(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{d:"M3 12H21",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),jp=RC;var DC=e=>jsx("svg",_(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{d:"M3 11.1429L9.71572 17.8586C9.79383 17.9367 9.92046 17.9367 9.99856 17.8586L21.8571 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})})),Zp=DC;var OC=x.div`
11
+ `,P=forwardRef((e,t)=>{let f=e,{children:o,style:n,variant:i="body1",color:r="primary",overrideColor:a,bold:s=false,as:l,className:c,lineHeight:d}=f,u=ot(f,["children","style","variant","color","overrideColor","bold","as","className","lineHeight"]),p=useTheme(),h=gl(p,i),m=l||h.semanticElement,g=a||xC(p,r);return jsx(bC,A(S({as:m,ref:t},u),{className:c,style:n,$variant:i,$bold:s,$color:g,$lineHeight:d,$isInline:m==="span",children:o}))});P.displayName="Typography";var Cr=(e,t)=>{switch(e){case "primary":return t.stigg.palette.text.primary;case "secondary":return t.stigg.palette.text.secondary;default:return e}};var Cl={};hC(Cl,{Add:()=>tm,Addons:()=>Cp,ArrowForward:()=>jp,BillingInfoCustomer:()=>Sp,Check:()=>Xp,Close:()=>Zp,ContactSupport:()=>kp,Coupon:()=>Qp,CreditCard:()=>vp,DollarCoin:()=>Ap,EntitlementCheck:()=>im,MiniSchedule:()=>Pr,OutlinedCheckedCircle:()=>Hp,OutlinedCheckedCircleDisabled:()=>Wp,OutlinedCircle:()=>$p,PayAsYouGoCharge:()=>qp,PaymentMethod:()=>zp,Promotions:()=>Ep,Remove:()=>om,RenewSubscription:()=>Np,Restore:()=>Sr,ScheduleBox:()=>Lp,ScheduleClock:()=>Rp,Trash:()=>Up});var PC=e=>jsxs("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxs("g",{clipPath:"url(#clip0_834_118930)",children:[jsx("path",{d:"M12 6.85712V17.1428",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M6.85712 12H17.1428",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M18 0.857117H5.99997C3.15966 0.857117 0.857117 3.15966 0.857117 5.99997V18C0.857117 20.8404 3.15966 23.1428 5.99997 23.1428H18C20.8404 23.1428 23.1428 20.8404 23.1428 18V5.99997C23.1428 3.15966 20.8404 0.857117 18 0.857117Z",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsx("defs",{children:jsx("clipPath",{id:"clip0_834_118930",children:jsx("rect",{width:24,height:24,fill:"white"})})})]})),Cp=PC;var SC=e=>jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsx("path",{d:"M26 27V25C26 22.7909 24.2091 21 22 21H14C11.7909 21 10 22.7909 10 25V27",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18 17C20.2091 17 22 15.2091 22 13C22 10.7909 20.2091 9 18 9C15.7909 9 14 10.7909 14 13C14 15.2091 15.7909 17 18 17Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("defs",{children:jsxs("linearGradient",{id:"paint0_linear_67_8545",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsx("stop",{stopColor:"#56ACF6"}),jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),Sp=SC;var TC=e=>jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsx("path",{d:"M27 18.22C27 12.73 22.74 9 18 9C13.31 9 9 12.65 9 18.28C8.4 18.62 8 19.26 8 20V22C8 23.1 8.9 24 10 24H11V17.9C11 14.03 14.13 10.9 18 10.9C21.87 10.9 25 14.03 25 17.9V25H17V27H25C26.1 27 27 26.1 27 25V23.78C27.59 23.47 28 22.86 28 22.14V19.84C28 19.14 27.59 18.53 27 18.22Z",fill:"#7586B0"}),jsx("path",{d:"M15 20C15.5523 20 16 19.5523 16 19C16 18.4477 15.5523 18 15 18C14.4477 18 14 18.4477 14 19C14 19.5523 14.4477 20 15 20Z",fill:"#7586B0"}),jsx("path",{d:"M21 20C21.5523 20 22 19.5523 22 19C22 18.4477 21.5523 18 21 18C20.4477 18 20 18.4477 20 19C20 19.5523 20.4477 20 21 20Z",fill:"#7586B0"}),jsx("path",{d:"M24 17.03C23.52 14.18 21.04 12 18.05 12C15.02 12 11.76 14.51 12.02 18.45C14.49 17.44 16.35 15.24 16.88 12.56C18.19 15.19 20.88 17 24 17.03Z",fill:"#7586B0"}),jsx("defs",{children:jsxs("linearGradient",{id:"paint0_linear_267_19310",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsx("stop",{stopColor:"#56ACF6"}),jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),kp=TC;var kC=e=>jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsx("path",{d:"M26 10H10C8.89 10 8.01 10.89 8.01 12L8 24C8 25.11 8.89 26 10 26H26C27.11 26 28 25.11 28 24V12C28 10.89 27.11 10 26 10ZM26 24H10V18H26V24ZM26 14H10V12H26V14Z",fill:"#7586B0"}),jsx("defs",{children:jsxs("linearGradient",{id:"paint0_linear_67_8556",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsx("stop",{stopColor:"#56ACF6"}),jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),vp=kC;var wC=e=>jsxs("svg",A(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxs("g",{clipPath:"url(#clip0_834_120339)",children:[jsx("path",{d:"M10.3336 19.2858C15.462 19.2858 19.6193 15.1285 19.6193 10.0001C19.6193 4.87171 15.462 0.714355 10.3336 0.714355C5.20521 0.714355 1.04785 4.87171 1.04785 10.0001C1.04785 15.1285 5.20521 19.2858 10.3336 19.2858Z",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M12.7649 7.46052C12.6813 7.22393 12.5523 7.0088 12.3883 6.8256C12.0395 6.43592 11.5327 6.19067 10.9685 6.19067H9.4942C8.55517 6.19067 7.79395 6.9519 7.79395 7.89093C7.79395 8.68995 8.3503 9.38116 9.13086 9.5519L11.3756 10.0429C12.25 10.2342 12.8733 11.0091 12.8733 11.9043C12.8733 12.9562 12.0205 13.8097 10.9685 13.8097H9.6987C8.86936 13.8097 8.16382 13.2797 7.90233 12.5399",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M10.3335 6.19065V4.28589",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M10.3335 15.7144V13.8096",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsx("defs",{children:jsx("clipPath",{id:"clip0_834_120339",children:jsx("rect",{width:20,height:20,fill:"white",transform:"translate(0.333496)"})})})]})),Ap=wC;var vC=e=>jsx("svg",A(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.95392 1.03353C7.1196 1.56038 6.82682 2.12178 6.29997 2.28746C5.79034 2.44773 5.30237 2.68036 4.85175 2.98146C3.76168 3.70982 2.95789 4.79361 2.57732 6.04817C2.19675 7.30273 2.26296 8.65044 2.76466 9.86166C3.26637 11.0729 4.17252 12.0727 5.32873 12.6907C6.48494 13.3087 7.81967 13.5067 9.10549 13.2509C10.3913 12.9951 11.5487 12.3014 12.3804 11.288C13.2121 10.2746 13.6666 9.00413 13.6666 7.69312C13.6666 7.14083 14.1144 6.69312 14.6666 6.69312C15.2189 6.69312 15.6666 7.14083 15.6666 7.69312C15.6666 7.92228 15.6564 8.15052 15.6361 8.37721C15.6465 8.44937 15.6492 8.52379 15.6432 8.59952L15.6392 8.64883C15.6298 8.75932 15.6028 8.86407 15.5612 8.96057C15.3409 10.2743 14.7807 11.5158 13.9264 12.5568C12.8012 13.9279 11.2353 14.8664 9.49568 15.2125C7.75603 15.5585 5.95022 15.2906 4.38594 14.4545C2.82166 13.6184 1.59568 12.2657 0.916905 10.627C0.238131 8.98832 0.148554 7.16495 0.663439 5.4676C1.17832 3.77025 2.26581 2.30394 3.74061 1.31852C4.35023 0.911179 5.01049 0.596408 5.69999 0.379577C6.22684 0.213898 6.78824 0.506683 6.95392 1.03353ZM7.56761 1.27284C7.61434 0.722538 8.09832 0.314306 8.64863 0.361031L8.69791 0.365373C9.24791 0.415584 9.65307 0.902149 9.60286 1.45215C9.55265 2.00214 9.06608 2.4073 8.51608 2.35709L8.47942 2.35386C7.92912 2.30714 7.52089 1.82315 7.56761 1.27284ZM12.4186 2.90891C12.8384 2.55014 13.4697 2.59967 13.8284 3.01954C13.8498 3.04454 13.871 3.06967 13.892 3.09494C14.2454 3.51937 14.1878 4.14991 13.7634 4.50329C13.339 4.85667 12.7084 4.79906 12.355 4.37463C12.3395 4.35592 12.3238 4.33731 12.3079 4.31879C11.9492 3.89892 11.9987 3.26769 12.4186 2.90891ZM8.99998 5.33352C8.99998 4.78124 8.55226 4.33352 7.99998 4.33352C7.44769 4.33352 6.99998 4.78124 6.99998 5.33352V8.00019C6.99998 8.55247 7.44769 9.00019 7.99998 9.00019H10.6666C11.2189 9.00019 11.6666 8.55247 11.6666 8.00019C11.6666 7.4479 11.2189 7.00019 10.6666 7.00019H8.99998V5.33352Z",fill:"#7586B0"})})),Pr=vC;var _C=e=>jsxs("svg",A(S({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxs("g",{clipPath:"url(#clip0_834_116282)",children:[jsx("path",{d:"M21.4286 5.32483H2.57146C1.62469 5.32483 0.857178 6.09235 0.857178 7.03911V10.4677C0.857178 11.4145 1.62469 12.182 2.57146 12.182H21.4286C22.3754 12.182 23.1429 11.4145 23.1429 10.4677V7.03911C23.1429 6.09235 22.3754 5.32483 21.4286 5.32483Z",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M21.4287 12.182V21.6106C21.4287 22.0652 21.248 22.5013 20.9266 22.8227C20.6051 23.1442 20.169 23.3249 19.7144 23.3249H4.28582C3.83116 23.3249 3.39513 23.1442 3.07363 22.8227C2.75215 22.5013 2.57153 22.0652 2.57153 21.6106V12.182",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M12 5.32483V23.3248",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M17.1429 1.03912L12 5.32484L6.85718 1.03912",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsx("defs",{children:jsx("clipPath",{id:"clip0_834_116282",children:jsx("rect",{width:24,height:24,fill:"white",transform:"translate(0 0.182007)"})})})]})),Ep=_C;var AC=e=>jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{d:"M10.8333 2.5C6.69168 2.5 3.33334 5.85833 3.33334 10H0.833344L4.07501 13.2417L4.13334 13.3583L7.50001 10H5.00001C5.00001 6.775 7.60834 4.16667 10.8333 4.16667C14.0583 4.16667 16.6667 6.775 16.6667 10C16.6667 13.225 14.0583 15.8333 10.8333 15.8333C9.22501 15.8333 7.76668 15.175 6.71668 14.1167L5.53334 15.3C6.89168 16.6583 8.75834 17.5 10.8333 17.5C14.975 17.5 18.3333 14.1417 18.3333 10C18.3333 5.85833 14.975 2.5 10.8333 2.5ZM10 6.66667V10.8333L13.5667 12.95L14.1667 11.9417L11.25 10.2083V6.66667H10Z",fill:"#6678A7"})})),Sr=AC;var MC=e=>jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("rect",{width:36,height:36,rx:10,fill:"url(#paint0_linear_834_118583)"}),jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9539 7.70028C16.1196 8.22713 15.8268 8.78853 15.3 8.95421C14.4906 9.20875 13.7155 9.57824 12.9999 10.0564C11.2686 11.2132 9.99197 12.9346 9.38754 14.9271C8.78311 16.9196 8.88826 19.0601 9.68509 20.9838C10.4819 22.9075 11.9211 24.4954 13.7574 25.477C15.5938 26.4585 17.7136 26.7729 19.7558 26.3667C21.798 25.9605 23.6362 24.8588 24.9571 23.2492C26.278 21.6396 27 19.6219 27 17.5397C27 16.9874 27.4477 16.5397 28 16.5397C28.5523 16.5397 29 16.9874 29 17.5397C29 17.8969 28.9826 18.2526 28.9483 18.6056C28.9662 18.6949 28.9722 18.7883 28.9645 18.8837L28.9606 18.9309C28.9496 19.0607 28.9143 19.1825 28.8595 19.2924C28.5513 21.2017 27.7432 23.007 26.5031 24.518C24.8886 26.4852 22.642 27.8318 20.146 28.3283C17.65 28.8248 15.059 28.4405 12.8146 27.2408C10.5702 26.0411 8.81122 24.1004 7.83733 21.7492C6.86343 19.398 6.73491 16.7819 7.47366 14.3465C8.21241 11.9112 9.77272 9.80737 11.8887 8.3935C12.7634 7.80905 13.7107 7.35743 14.7 7.04633C15.2269 6.88065 15.7883 7.17343 15.9539 7.70028ZM17.8497 7.95155C17.8964 7.40125 18.3804 6.99302 18.9307 7.03974L18.9779 7.04385C19.528 7.0929 19.9342 7.57861 19.8851 8.12871C19.8361 8.67881 19.3503 9.085 18.8002 9.03595L18.7615 9.03257C18.2112 8.98585 17.8029 8.50186 17.8497 7.95155ZM22.8579 9.19953C23.172 8.74525 23.7949 8.63161 24.2492 8.9457C24.2751 8.96361 24.3009 8.98162 24.3266 8.99974C24.7782 9.31772 24.8865 9.94155 24.5685 10.3931C24.2505 10.8447 23.6267 10.953 23.1751 10.635C23.1541 10.6202 23.1329 10.6054 23.1118 10.5908C22.6575 10.2767 22.5438 9.6538 22.8579 9.19953ZM26.6058 12.8085C27.1045 12.5712 27.7011 12.7831 27.9384 13.2818C27.9519 13.3102 27.9653 13.3387 27.9786 13.3672C28.2116 13.868 27.9946 14.4628 27.4939 14.6958C26.9931 14.9288 26.3983 14.7117 26.1653 14.211L26.1506 14.1796L26.1324 14.1411C25.8951 13.6424 26.1071 13.0458 26.6058 12.8085ZM19 14.0003C19 13.448 18.5523 13.0003 18 13.0003C17.4477 13.0003 17 13.448 17 14.0003V18.0003C17 18.5526 17.4477 19.0003 18 19.0003H22C22.5523 19.0003 23 18.5526 23 18.0003C23 17.448 22.5523 17.0003 22 17.0003H19V14.0003Z",fill:"#7586B0"}),jsx("defs",{children:jsx("linearGradient",{id:"paint0_linear_834_118583",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse"})})]})),Lp=MC;var EC=e=>jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.95394 1.70028C10.1196 2.22713 9.82684 2.78853 9.29999 2.95421C8.49057 3.20875 7.71555 3.57824 6.99987 4.05644C5.26859 5.21324 3.99197 6.93456 3.38754 8.9271C2.78311 10.9196 2.88826 13.0601 3.68509 14.9838C4.48191 16.9075 5.9211 18.4954 7.75743 19.477C9.59377 20.4585 11.7136 20.7729 13.7558 20.3667C15.798 19.9605 17.6362 18.8588 18.9571 17.2492C20.278 15.6396 21 13.6219 21 11.5397C21 10.9874 21.4477 10.5397 22 10.5397C22.5523 10.5397 23 10.9874 23 11.5397C23 11.8969 22.9826 12.2526 22.9483 12.6056C22.9662 12.6949 22.9722 12.7883 22.9645 12.8837L22.9606 12.9309C22.9496 13.0607 22.9143 13.1825 22.8595 13.2924C22.5513 15.2017 21.7432 17.007 20.5031 18.518C18.8886 20.4852 16.642 21.8318 14.146 22.3283C11.65 22.8248 9.05905 22.4405 6.81464 21.2408C4.57023 20.0411 2.81122 18.1004 1.83733 15.7492C0.863434 13.398 0.734911 10.7819 1.47366 8.34653C2.21241 5.91121 3.77272 3.80737 5.88873 2.3935C6.76341 1.80905 7.71072 1.35743 8.70001 1.04633C9.22686 0.880646 9.78826 1.17343 9.95394 1.70028ZM11.8497 1.95155C11.8964 1.40125 12.3804 0.993017 12.9307 1.03974L12.9779 1.04385C13.528 1.0929 13.9342 1.57861 13.8851 2.12871C13.8361 2.67881 13.3503 3.085 12.8002 3.03595L12.7615 3.03257C12.2112 2.98585 11.8029 2.50186 11.8497 1.95155ZM16.8579 3.19953C17.172 2.74525 17.7949 2.63161 18.2492 2.9457C18.2751 2.96361 18.3009 2.98162 18.3266 2.99974C18.7782 3.31772 18.8865 3.94155 18.5685 4.39311C18.2505 4.84467 17.6267 4.95296 17.1751 4.63498C17.1541 4.62016 17.1329 4.60542 17.1118 4.59078C16.6575 4.27669 16.5438 3.6538 16.8579 3.19953ZM20.6058 6.80846C21.1045 6.57117 21.7011 6.78308 21.9384 7.28179C21.9519 7.3102 21.9653 7.33869 21.9786 7.36723C22.2116 7.86796 21.9946 8.46276 21.4939 8.69577C20.9931 8.92877 20.3983 8.71174 20.1653 8.21101L20.1506 8.17957L20.1324 8.14112C19.8951 7.64241 20.1071 7.04576 20.6058 6.80846ZM13 8.00027C13 7.44798 12.5523 7.00027 12 7.00027C11.4477 7.00027 11 7.44798 11 8.00027V12.0003C11 12.5526 11.4477 13.0003 12 13.0003H16C16.5523 13.0003 17 12.5526 17 12.0003C17 11.448 16.5523 11.0003 16 11.0003H13V8.00027Z",fill:"#7586B0"})})),Rp=EC;var FC=e=>jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 10.8954 9.89543 10 11 10H25C26.1046 10 27 10.8954 27 12V26C27 27.1046 26.1046 28 25 28H11C9.89543 28 9 27.1046 9 26V12Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M22 8V12",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M14 8V12",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M9 16H27",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("defs",{children:jsxs("linearGradient",{id:"paint0_linear_45_8861",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsx("stop",{stopColor:"#56ACF6"}),jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),Np=FC;var LC=e=>jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxs("g",{id:"trash-2",children:[jsx("path",{id:"Shape",d:"M3 6H5H21",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{id:"Shape_2",d:"M20 6C20 5.44772 19.5523 5 19 5C18.4477 5 18 5.44772 18 6H20ZM6 6C6 5.44772 5.55228 5 5 5C4.44772 5 4 5.44772 4 6H6ZM7 6C7 6.55228 7.44772 7 8 7C8.55228 7 9 6.55228 9 6H7ZM15 6C15 6.55228 15.4477 7 16 7C16.5523 7 17 6.55228 17 6H15ZM18 6V20H20V6H18ZM18 20C18 20.5523 17.5523 21 17 21V23C18.6569 23 20 21.6569 20 20H18ZM17 21H7V23H17V21ZM7 21C6.44772 21 6 20.5523 6 20H4C4 21.6569 5.34315 23 7 23V21ZM6 20V6H4V20H6ZM9 6V4H7V6H9ZM9 4C9 3.44772 9.44772 3 10 3V1C8.34315 1 7 2.34315 7 4H9ZM10 3H14V1H10V3ZM14 3C14.5523 3 15 3.44772 15 4H17C17 2.34315 15.6569 1 14 1V3ZM15 4V6H17V4H15Z",fill:"#F88078"}),jsx("path",{id:"Shape_3",d:"M10 11V17",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{id:"Shape_4",d:"M14 11V17",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Up=LC;var RC=e=>jsxs("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("path",{d:"M21.1667 4H2.83333C1.82081 4 1 4.89543 1 6V18C1 19.1046 1.82081 20 2.83333 20H21.1667C22.1792 20 23 19.1046 23 18V6C23 4.89543 22.1792 4 21.1667 4Z",fill:"#C6C6C7"}),jsx("path",{opacity:.3,d:"M19.75 16.4286H17.5C17.0125 16.4286 16.75 16.2 16.75 15.6667C16.75 15.1334 17.0125 14.9048 17.5 14.9048H19.75C20.2375 14.9048 20.5 15.1334 20.5 15.6667C20.5 16.2 20.2375 16.4286 19.75 16.4286ZM15.25 16.4286H13C12.5125 16.4286 12.25 16.2 12.25 15.6667C12.25 15.1334 12.5125 14.9048 13 14.9048H15.25C15.7375 14.9048 16 15.1334 16 15.6667C16 16.2 15.7375 16.4286 15.25 16.4286ZM10.75 16.4286H8.5C8.0125 16.4286 7.75 16.2 7.75 15.6667C7.75 15.1334 8.0125 14.9048 8.5 14.9048H10.75C11.2375 14.9048 11.5 15.1334 11.5 15.6667C11.5 16.2 11.2375 16.4286 10.75 16.4286ZM6.25 16.4286H4C3.5125 16.4286 3.25 16.2 3.25 15.6667C3.25 15.1334 3.5125 14.9048 4 14.9048H6.25C6.7375 14.9048 7 15.1334 7 15.6667C7 16.2 6.7375 16.4286 6.25 16.4286Z",fill:"black"})]})),zp=RC;var NC=e=>jsx("svg",A(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("circle",{cx:10.333,cy:10,r:9,fill:"white",stroke:"#327EEE",strokeWidth:2})})),$p=NC;var UC=e=>jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxs("g",{id:"Group 16159",children:[jsx("circle",{id:"Ellipse 5",cx:10,cy:10,r:9.25,fill:"#327EEE",stroke:"#327EEE",strokeWidth:1.5}),jsx("path",{id:"Shape",d:"M5 10.3636L8.63667 14L12.637 10L14.6372 8",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Hp=UC;var zC=e=>jsx("svg",A(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxs("g",{id:"Stepper indicators",children:[jsx("circle",{id:"Ellipse 5",cx:10.667,cy:10,r:9.25,fill:"#B3BCD3",stroke:"#B3BCD3",strokeWidth:1.5}),jsx("path",{id:"Shape",d:"M5.66699 10.3636L9.30366 14L13.304 10L15.3042 8",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Wp=zC;var $C=e=>jsx("svg",A(S({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{d:"M9 3L7.9425 4.0575L12.1275 8.25H3V9.75H12.1275L7.9425 13.9425L9 15L15 9L9 3Z",fill:"white"})})),jp=$C;var HC=e=>jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{d:"M15.8337 5.34199L14.6587 4.16699L10.0003 8.82533L5.34199 4.16699L4.16699 5.34199L8.82533 10.0003L4.16699 14.6587L5.34199 15.8337L10.0003 11.1753L14.6587 15.8337L15.8337 14.6587L11.1753 10.0003L15.8337 5.34199Z",fill:"#327EEE"})})),Zp=HC;var WC=e=>jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("g",{id:"check",children:jsx("path",{id:"Shape",d:"M20 7L9 18L4 13",stroke:"#F5F6F9",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})})),Xp=WC;var GC=e=>jsxs("svg",A(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxs("g",{clipPath:"url(#clip0_1889_12169)",children:[jsx("path",{d:"M11.4286 7.42578L8 13.1401",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M14.857 13.1412C15.3274 12.0123 15.5118 10.7848 15.3938 9.56751C15.2758 8.35027 14.8592 7.18097 14.1808 6.16341C13.5024 5.14585 12.5833 4.31152 11.5051 3.73446C10.4268 3.1574 9.22281 2.85547 7.99986 2.85547C6.77691 2.85547 5.57288 3.1574 4.49463 3.73446C3.41639 4.31152 2.49729 5.14585 1.81892 6.16341C1.14055 7.18097 0.723889 8.35027 0.605928 9.56751C0.487968 10.7848 0.672354 12.0123 1.14272 13.1412H14.857Z",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsx("defs",{children:jsx("clipPath",{id:"clip0_1889_12169",children:jsx("rect",{width:16,height:16,fill:"white"})})})]})),qp=GC;var jC=e=>jsx("svg",A(S({width:16,height:16,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxs("g",{id:"tag--tags-bookmark-favorite",children:[jsx("path",{id:"Vector",d:"M1.26995 11.9426L6.05743 16.7301C6.2305 16.903 6.4651 17.0001 6.7097 17.0001C6.95431 17.0001 7.18891 16.903 7.36198 16.7301L16.8631 7.22895C16.9108 7.18332 16.9478 7.12758 16.9712 7.06583C16.9946 7.00408 17.0039 6.93787 16.9985 6.87205L16.2724 2.15839C16.2664 2.04607 16.2192 1.93992 16.1396 1.86038C16.0601 1.78085 15.9539 1.73357 15.8416 1.72764L11.128 1.00152C11.0622 0.996055 10.9959 1.00538 10.9342 1.0288C10.8724 1.05222 10.8167 1.08916 10.7711 1.1369L1.26995 10.638C1.09709 10.8111 1 11.0457 1 11.2903C1 11.5349 1.09709 11.7695 1.26995 11.9426Z",stroke:"#327EEE",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{id:"Vector_2",d:"M12.5548 6.05884C12.3916 6.05884 12.2351 5.99401 12.1197 5.87861C12.0043 5.76321 11.9395 5.60669 11.9395 5.44348C11.9395 5.28028 12.0043 5.12376 12.1197 5.00836C12.2351 4.89296 12.3916 4.82812 12.5548 4.82812C12.718 4.82812 12.8745 4.89296 12.9899 5.00836C13.1053 5.12376 13.1702 5.28028 13.1702 5.44348C13.1702 5.60669 13.1053 5.76321 12.9899 5.87861C12.8745 5.99401 12.718 6.05884 12.5548 6.05884Z",stroke:"#327EEE",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Qp=jC;var ZC=e=>jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{d:"M12 3V21.0001M3 11.9446H21",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),tm=ZC;var XC=e=>jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{d:"M3 12H21",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),om=XC;var KC=e=>jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{d:"M3 11.1429L9.71572 17.8586C9.79383 17.9367 9.92046 17.9367 9.99856 17.8586L21.8571 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})})),im=KC;var QC=y.div`
12
12
  ${({$pathColor:e})=>e&&css`
13
13
  path {
14
14
  fill: ${e};
@@ -27,27 +27,27 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
27
27
  stroke: ${e};
28
28
  }
29
29
  `}
30
- `;function pt({icon:e,className:t,style:o,svgPathColor:n,svgRectColor:i,svgStrokeColor:r}){let a=pl[e],s=useTheme();return jsx(OC,{className:t,style:o,$pathColor:br(n,s),$rectColor:br(i,s),$strokeColor:br(r,s),children:jsx(a,{})})}var UC=x(C)`
30
+ `;function mt({icon:e,className:t,style:o,svgPathColor:n,svgRectColor:i,svgStrokeColor:r}){let a=Cl[e],s=useTheme();return jsx(QC,{className:t,style:o,$pathColor:Cr(n,s),$rectColor:Cr(i,s),$strokeColor:Cr(r,s),children:jsx(a,{})})}var JC=y(P)`
31
31
  margin: 0;
32
- `,zC=x.div`
32
+ `,t2=y.div`
33
33
  display: flex;
34
34
  align-items: center;
35
35
  gap: 16px;
36
- `,$C=x.div`
36
+ `,e2=y.div`
37
37
  display: flex;
38
38
  align-items: center;
39
39
  flex-shrink: 0;
40
- `,VC=x(pt)`
40
+ `,o2=y(mt)`
41
41
  width: 24px;
42
42
  height: 24px;
43
43
  color: ${({theme:e})=>e.stigg.palette.primary};
44
- `;function Sr({displayName:e,className:t}){return jsxs(zC,{className:`stigg-entitlement-row-container ${t}`,children:[jsx($C,{children:jsx(VC,{icon:"EntitlementCheck",className:"stigg-entitlement-row-icon"})}),jsx(UC,{className:"stigg-entitlement-name",variant:"h6",color:"secondary",children:e})]})}function WC(e){if(!e)return "";switch(e){case EntitlementResetPeriod.Day:return "per day";case EntitlementResetPeriod.Hour:return "per hour";case EntitlementResetPeriod.Week:return "per week";case EntitlementResetPeriod.Month:return "per month";case EntitlementResetPeriod.Year:return "per year";default:return ""}}function GC({hasUnlimitedUsage:e,feature:t,resetPeriod:o,usageLimit:n,minUnitQuantity:i,maxUnitQuantity:r,isCustom:a,enumValues:s}){let l=i||r,c=`${o&&n?`${WC(o)}`:""}`;if(s){let d=s.length===1?t==null?void 0:t.featureUnits:t==null?void 0:t.featureUnitsPlural;return `${s.length} ${d}`}if(e)return `Unlimited ${t==null?void 0:t.featureUnitsPlural}`;if(a)return `Custom ${t==null?void 0:t.featureUnitsPlural}`;if(n){let d=n===1?t==null?void 0:t.featureUnits:t==null?void 0:t.featureUnitsPlural;return `${At(n)} ${d} ${c}`}return l?xr(i,r,t==null?void 0:t.featureUnitsPlural):t==null?void 0:t.displayName}function fl(e){let r=e,{displayNameOverride:t,feature:o}=r,n=ot(r,["displayNameOverride","feature"]),i=t||GC(S({feature:o},n))||"";return jsx(Sr,{displayName:i,className:`stigg-entitlement-${o==null?void 0:o.refId}`})}function YC(e){var r,a;let{amount:t,customCurrency:o,displayNameOverride:n}=e;if(n)return n;let i=t===1?(r=o.units)==null?void 0:r.singular:(a=o.units)==null?void 0:a.plural;return `${At(t)} ${i||o.displayName}`}function Kp({entitlement:e}){let t=YC(e);return jsx(Sr,{displayName:t,className:`stigg-credit-entitlement-${e.id}`})}function qC(e){return e.__typename==="PackageCreditEntitlement"}var QC=x.div`
44
+ `;function Tr({displayName:e,className:t}){return jsxs(t2,{className:`stigg-entitlement-row-container ${t}`,children:[jsx(e2,{children:jsx(o2,{icon:"EntitlementCheck",className:"stigg-entitlement-row-icon"})}),jsx(JC,{className:"stigg-entitlement-name",variant:"h6",color:"secondary",children:e})]})}function i2(e){if(!e)return "";switch(e){case EntitlementResetPeriod.Day:return "per day";case EntitlementResetPeriod.Hour:return "per hour";case EntitlementResetPeriod.Week:return "per week";case EntitlementResetPeriod.Month:return "per month";case EntitlementResetPeriod.Year:return "per year";default:return ""}}function r2({hasUnlimitedUsage:e,feature:t,resetPeriod:o,usageLimit:n,minUnitQuantity:i,maxUnitQuantity:r,isCustom:a,enumValues:s}){let l=i||r,c=`${o&&n?`${i2(o)}`:""}`;if(s){let d=s.length===1?t==null?void 0:t.featureUnits:t==null?void 0:t.featureUnitsPlural;return `${s.length} ${d}`}if(e)return `Unlimited ${t==null?void 0:t.featureUnitsPlural}`;if(a)return `Custom ${t==null?void 0:t.featureUnitsPlural}`;if(n){let d=n===1?t==null?void 0:t.featureUnits:t==null?void 0:t.featureUnitsPlural;return `${At(n)} ${d} ${c}`}return l?br(i,r,t==null?void 0:t.featureUnitsPlural):t==null?void 0:t.displayName}function Tl(e){let r=e,{displayNameOverride:t,feature:o}=r,n=ot(r,["displayNameOverride","feature"]),i=t||r2(S({feature:o},n))||"";return jsx(Tr,{displayName:i,className:`stigg-entitlement-${o==null?void 0:o.refId}`})}function s2(e){var a,s;let{amount:t,customCurrency:o,displayNameOverride:n}=e,i=t!=null?t:0;if(n)return n;let r=i===1?(a=o.units)==null?void 0:a.singular:(s=o.units)==null?void 0:s.plural;return `${At(i)} ${r||o.displayName}`}function am({entitlement:e}){let t=s2(e);return jsx(Tr,{displayName:t,className:`stigg-credit-entitlement-${e.id}`})}function u2(e){return e.__typename==="PackageCreditEntitlement"}var p2=y.div`
45
45
  display: flex;
46
46
  flex-direction: column;
47
47
  gap: 16px;
48
- `;function JC(e,t,o){if(t.entitlementsTitle)return t.entitlementsTitle(e);let n=o?"Includes:":"";return e.basePlan&&(n=`Everything in ${e.basePlan.displayName}${o?", plus:":""}`),n}function Qp({plan:e,billingPeriod:t,paywallLocale:o}){var s;let i=(((s=e.pricePoints)==null?void 0:s.filter(l=>l.billingPeriod===t))||[]).filter(l=>(l==null?void 0:l.minUnitQuantity)&&(l==null?void 0:l.minUnitQuantity)>1||(l==null?void 0:l.maxUnitQuantity)).map(l=>{var c;return jsx(fl,{feature:l!=null&&l.feature?{refId:l.feature.featureId,featureUnits:l.feature.units,featureUnitsPlural:l.feature.unitsPlural,unitQuantity:l.feature.unitQuantity,displayName:l.feature.displayName}:null,minUnitQuantity:l==null?void 0:l.minUnitQuantity,maxUnitQuantity:l==null?void 0:l.maxUnitQuantity},`priceUnitEntitlement-${(c=l==null?void 0:l.feature)==null?void 0:c.displayName}`)}),r=Vf(e.packageEntitlements).filter(l=>l.isGranted).filter(l=>{var c;return !((c=l.hiddenFromWidgets)!=null&&c.includes(WidgetType.Paywall))}),a=i.length>0||r.length>0;return jsxs(QC,{className:"stigg-plan-entitlements-container",children:[jsx(C,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:true,children:JC(e,o,a)}),i,r.map(l=>qC(l)?jsx(Kp,{entitlement:l},qp(l)):jsx(fl,{displayNameOverride:l.displayNameOverride,feature:l.feature,resetPeriod:l.resetPeriod,hasUnlimitedUsage:l.hasUnlimitedUsage,usageLimit:l.usageLimit,enumValues:l.enumValues,isCustom:l.isCustom},qp(l)))]})}function qp(e){return `${e.__typename}:${e.id}`}var gl=(l=>(l.START_TRIAL="START_TRIAL",l.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",l.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",l.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",l.CHANGE_UNIT_QUANTITY="CHANGE_UNIT_QUANTITY",l.UPGRADE_PLAN="UPGRADE_PLAN",l.DOWNGRADE_PLAN="DOWNGRADE_PLAN",l.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES",l))(gl||{});var kr=e=>({left:"flex-start",center:"center",right:"flex-end"})[e],Jp=e=>{var c,d,u;let t=Do(((c=e==null?void 0:e.palette)==null?void 0:c.primary)||"#327EEE"),o=Do(((u=(d=e==null?void 0:e.palette)==null?void 0:d.text)==null?void 0:u.primary)||"#001E6C"),n=Do("#4CAF50"),i=Do("#f44336"),r=Do("#ff9800"),a=Do("#2196f3"),s=Do("#9e9e9e"),l={palette:{primary:t.hex(),primaryDark:t.darken(.3).hex(),primaryLight:t.alpha(.5).toString(),backgroundPaper:"#FFFFFF",backgroundHighlight:"#F5F6F9",backgroundSection:t.alpha(.1).toString(),backgroundButton:t.alpha(.08).toString(),outlinedBorder:"#C4CBDD",outlinedRestingBorder:t.alpha(.5).toString(),outlinedHoverBackground:t.lightness(95).hex(),switchBorder:t.lighten(.1).hex(),switchFill:t.lighten(.5).hex(),switchHandle:t.hex(),warning:"#ed6c02",error:i.hex(),errorDark:i.darken(.3).hex(),success:n.hex(),successDark:n.darken(.3).hex(),white:"#FFFFFF",text:{primary:o.hex(),secondary:o.alpha(.75).toString(),tertiary:o.alpha(.5).toString(),disabled:o.alpha(.35).toString()},statusChips:{success:{background:n.alpha(.15).toString(),text:n.darken(.2).hex(),border:"transparent"},warning:{background:r.alpha(.15).toString(),text:r.darken(.2).hex(),border:"transparent"},error:{background:i.alpha(.15).toString(),text:i.darken(.1).hex(),border:"transparent"},info:{background:a.alpha(.15).toString(),text:a.darken(.2).hex(),border:"transparent"},neutral:{background:s.alpha(.15).toString(),text:s.darken(.2).hex(),border:"transparent"}},progress:{background:"#e0e0e0",low:"#4caf50",medium:"#ff9800",high:"#f44336"}},layout:{planMinWidth:"330px",planMaxWidth:"330px",planMargin:"20px",planPadding:"40px",ctaAlignment:"left",headerAlignment:"left",descriptionAlignment:"left",descriptionMinHeight:"80px",switchBottomSpacing:"40px"},shadows:{light:"0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px rgba(0, 0, 0, 0.14), 0px 1px 3px rgba(0, 0, 0, 0.12)",popover:"0px 4px 5px -2px rgba(0, 30, 108, 0.2), 0px 7px 10px 1px rgba(0, 30, 108, 0.14), 0px 2px 16px 1px rgba(0, 30, 108, 0.12)"},border:{radius:"10px"},typography:{fontFamily:"custom-font, DM Sans, sans-serif",h1:{fontSize:"32px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"24px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"},caption:{fontSize:"12px",fontWeight:"normal",semanticElement:"span"}},customCss:""};return e2(l,e)};var xl=e=>Xc.utc(e).format("MMMM Do, yyyy");function wr({scheduledUpdate:e,subscriptionPrices:t,billingPeriodRange:o,options:n={}}){var a,s;if(!e)return {};let{withDate:i,postfix:r=""}=n;switch(e.subscriptionScheduleType){case SubscriptionScheduleType.Downgrade:{let l=i;return isNil(l)&&(o!=null&&o.end)&&(l=!Xc(e.scheduledExecutionTime).isSame(o==null?void 0:o.end,"day")),{line1:jsxs(Fragment,{children:["Your subscription will be downgraded to the ",jsxs("b",{children:[(a=e.targetPackage)==null?void 0:a.displayName," plan"]})," ",l?jsxs(Fragment,{children:["on ",xl(e.scheduledExecutionTime)]}):r,"."]}),line2:"Until then you still have access to your current plan."}}case SubscriptionScheduleType.BillingPeriod:{let l=e.scheduleVariables;return {line1:jsxs(Fragment,{children:["Your billing cycle will change to ",jsx("b",{children:(s=l.billingPeriod)==null?void 0:s.toLocaleLowerCase()})," ",i?jsxs(Fragment,{children:["on ",xl(e.scheduledExecutionTime)]}):r,"."]})}}case SubscriptionScheduleType.UnitAmount:{let l=e.scheduleVariables,d=compact(t==null?void 0:t.map(({feature:g})=>g)).find(({id:g})=>g===l.featureId),{featureUnits:u,featureUnitsPlural:p}=d||{},m=l.newUnitAmount===1?u:p,h=jsxs(Fragment,{children:["Your subscription will be updated to ",jsx("b",{children:l.newUnitAmount})," ",m," ",i?jsxs(Fragment,{children:["on ",xl(e.scheduledExecutionTime)]}):r,"."]}),f=`Until then you still have access to your current ${u} count.`;return {line1:h,line2:f}}default:return {}}}function ih(e){return e.feature&&(e.feature.unitQuantity!==1?e.feature.unitsPlural:e.feature.units)||""}function Pl(e,t){let o=[...e];o.sort((n,i)=>n.upTo?i.upTo?n.upTo-i.upTo:-1:1);for(let n of o)if(n.upTo&&t<=n.upTo)return n;return o[o.length-1]}function nh(e,t,o){return t===BillingPeriod.Annually&&o?e/12:e}function Cl(e,t,o,n){let i=0;if(e.unitPrice){let r=nh(e.unitPrice.amount,o,n);i+=r*t;}return e.flatPrice&&(i+=nh(e.flatPrice.amount,o,n)),i}function Sl(e,t,o,n){let i=t,r=0,a=0,s=[];for(;i>0&&a<e.length;){let c=e[a],{upTo:d}=c;if(vr(d))s.push({unitQuantity:i,amount:Cl(c,i,o,n)}),i=0;else {let u=d-r,p=Math.min(i,u);s.push({unitQuantity:p,amount:Cl(c,p,o,n)}),i-=p,r=d;}a+=1;}let l=sum(s.map(({amount:c})=>c));return {breakdown:s,total:l}}function Cn(e,t,o,n){if(!e.tiers)return 0;switch(e.tiersMode){case TiersMode.Volume:{let i=Pl(e.tiers,t);return Cl(i,t,o,n)}case TiersMode.Graduated:return Sl(e.tiers,t,o,n).total;default:return 0}}function fi(e){return e==null?void 0:e.some(({unitPrice:t,upTo:o})=>t&&!vr(o))}function rh(e){return e==null?void 0:e.every(({unitPrice:t,upTo:o})=>!t||vr(o))}function ah(e,t){return (e==null?void 0:e[0].upTo)&&t<=e[0].upTo}function _r({plan:e,billingPeriod:t,currentSubscription:o,currentSubscriptionOverride:n,selectDefaultTierIndex:i}){let r=e.pricePoints.filter(a=>a.billingPeriod===t&&a.isTieredPrice);if(r.length===1){let[a]=r,{featureId:s}=a.feature,l=i?i({plan:e}):0,c=a.tiers[l],d=fi(a.tiers)?1:c.upTo||1;if(o&&o.plan.id===e.id){let p=o.prices.find(m=>{var h;return m.pricingModel===BillingModel.PerUnit&&m.tiersMode&&((h=m.feature)==null?void 0:h.featureId)===s});p&&(d=p.feature.unitQuantity||1);}if((n==null?void 0:n.planId)===e.id){let p=n.billableFeatures.find(m=>m.featureId===s);p&&(d=p.quantity);}let u={};return u[s]=d,u}return {}}function sh({perUnitQuantityByFeature:e,plan:t,currentSubscription:o,currentSubscriptionOverride:n}){var d,u;if(!o)return 0;let i=o.prices.find(p=>p.pricingModel===BillingModel.PerUnit&&p.tiersMode),r=t.id===(n==null?void 0:n.planId);if(r&&(i=(d=t.pricePoints.find(p=>p.pricingModel===BillingModel.PerUnit&&p.tiersMode))!=null?d:i),!i)return 0;let{featureId:a,unitQuantity:s}=i.feature,l=s;if(r){let p=(u=n==null?void 0:n.billableFeatures)==null?void 0:u.find(m=>m.featureId===a);p&&(l=p.quantity);}if(vr(l))return 0;let c=e[a];return c<l?-1:c>l?1:0}var d2=x(s2)`
48
+ `;function m2(e,t,o){if(t.entitlementsTitle)return t.entitlementsTitle(e);let n=o?"Includes:":"";return e.basePlan&&(n=`Everything in ${e.basePlan.displayName}${o?", plus:":""}`),n}function lm({plan:e,billingPeriod:t,paywallLocale:o}){var s;let i=(((s=e.pricePoints)==null?void 0:s.filter(l=>l.billingPeriod===t))||[]).filter(l=>(l==null?void 0:l.minUnitQuantity)&&(l==null?void 0:l.minUnitQuantity)>1||(l==null?void 0:l.maxUnitQuantity)).map(l=>{var c;return jsx(Tl,{feature:l!=null&&l.feature?{refId:l.feature.featureId,featureUnits:l.feature.units,featureUnitsPlural:l.feature.unitsPlural,unitQuantity:l.feature.unitQuantity,displayName:l.feature.displayName}:null,minUnitQuantity:l==null?void 0:l.minUnitQuantity,maxUnitQuantity:l==null?void 0:l.maxUnitQuantity},`priceUnitEntitlement-${(c=l==null?void 0:l.feature)==null?void 0:c.displayName}`)}),r=ef(e.packageEntitlements).filter(l=>l.isGranted).filter(l=>{var c;return !((c=l.hiddenFromWidgets)!=null&&c.includes(WidgetType.Paywall))}),a=i.length>0||r.length>0;return jsxs(p2,{className:"stigg-plan-entitlements-container",children:[jsx(P,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:true,children:m2(e,o,a)}),i,r.map(l=>u2(l)?jsx(am,{entitlement:l},sm(l)):jsx(Tl,{displayNameOverride:l.displayNameOverride,feature:l.feature,resetPeriod:l.resetPeriod,hasUnlimitedUsage:l.hasUnlimitedUsage,usageLimit:l.usageLimit,enumValues:l.enumValues,isCustom:l.isCustom},sm(l)))]})}function sm(e){return `${e.__typename}:${e.id}`}var kl=(l=>(l.START_TRIAL="START_TRIAL",l.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",l.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",l.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",l.CHANGE_UNIT_QUANTITY="CHANGE_UNIT_QUANTITY",l.UPGRADE_PLAN="UPGRADE_PLAN",l.DOWNGRADE_PLAN="DOWNGRADE_PLAN",l.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES",l))(kl||{});var wr=e=>({left:"flex-start",center:"center",right:"flex-end"})[e],cm=e=>{var c,d,u;let t=Do(((c=e==null?void 0:e.palette)==null?void 0:c.primary)||"#327EEE"),o=Do(((u=(d=e==null?void 0:e.palette)==null?void 0:d.text)==null?void 0:u.primary)||"#001E6C"),n=Do("#4CAF50"),i=Do("#f44336"),r=Do("#ff9800"),a=Do("#2196f3"),s=Do("#9e9e9e"),l={palette:{primary:t.hex(),primaryDark:t.darken(.3).hex(),primaryLight:t.alpha(.5).toString(),backgroundPaper:"#FFFFFF",backgroundHighlight:"#F5F6F9",backgroundSection:t.alpha(.1).toString(),backgroundButton:t.alpha(.08).toString(),outlinedBorder:"#C4CBDD",outlinedRestingBorder:t.alpha(.5).toString(),outlinedHoverBackground:t.lightness(95).hex(),switchBorder:t.lighten(.1).hex(),switchFill:t.lighten(.5).hex(),switchHandle:t.hex(),warning:"#ed6c02",error:i.hex(),errorDark:i.darken(.3).hex(),success:n.hex(),successDark:n.darken(.3).hex(),white:"#FFFFFF",text:{primary:o.hex(),secondary:o.alpha(.75).toString(),tertiary:o.alpha(.5).toString(),disabled:o.alpha(.35).toString()},statusChips:{success:{background:n.alpha(.15).toString(),text:n.darken(.2).hex(),border:"transparent"},warning:{background:r.alpha(.15).toString(),text:r.darken(.2).hex(),border:"transparent"},error:{background:i.alpha(.15).toString(),text:i.darken(.1).hex(),border:"transparent"},info:{background:a.alpha(.15).toString(),text:a.darken(.2).hex(),border:"transparent"},neutral:{background:s.alpha(.15).toString(),text:s.darken(.2).hex(),border:"transparent"}},progress:{background:"#e0e0e0",low:"#4caf50",medium:"#ff9800",high:"#f44336"}},layout:{planMinWidth:"330px",planMaxWidth:"330px",planMargin:"20px",planPadding:"40px",ctaAlignment:"left",headerAlignment:"left",descriptionAlignment:"left",descriptionMinHeight:"80px",switchBottomSpacing:"40px"},shadows:{light:"0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px rgba(0, 0, 0, 0.14), 0px 1px 3px rgba(0, 0, 0, 0.12)",popover:"0px 4px 5px -2px rgba(0, 30, 108, 0.2), 0px 7px 10px 1px rgba(0, 30, 108, 0.14), 0px 2px 16px 1px rgba(0, 30, 108, 0.12)"},border:{radius:"10px"},typography:{fontFamily:"custom-font, DM Sans, sans-serif",h1:{fontSize:"32px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"24px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"},caption:{fontSize:"12px",fontWeight:"normal",semanticElement:"span"}},customCss:""};return g2(l,e)};var vl=e=>rd.utc(e).format("MMMM Do, yyyy");function vr({scheduledUpdate:e,subscriptionPrices:t,billingPeriodRange:o,options:n={}}){var a,s;if(!e)return {};let{withDate:i,postfix:r=""}=n;switch(e.subscriptionScheduleType){case SubscriptionScheduleType.Downgrade:{let l=i;return isNil(l)&&(o!=null&&o.end)&&(l=!rd(e.scheduledExecutionTime).isSame(o==null?void 0:o.end,"day")),{line1:jsxs(Fragment,{children:["Your subscription will be downgraded to the ",jsxs("b",{children:[(a=e.targetPackage)==null?void 0:a.displayName," plan"]})," ",l?jsxs(Fragment,{children:["on ",vl(e.scheduledExecutionTime)]}):r,"."]}),line2:"Until then you still have access to your current plan."}}case SubscriptionScheduleType.BillingPeriod:{let l=e.scheduleVariables;return {line1:jsxs(Fragment,{children:["Your billing cycle will change to ",jsx("b",{children:(s=l.billingPeriod)==null?void 0:s.toLocaleLowerCase()})," ",i?jsxs(Fragment,{children:["on ",vl(e.scheduledExecutionTime)]}):r,"."]})}}case SubscriptionScheduleType.UnitAmount:{let l=e.scheduleVariables,d=compact(t==null?void 0:t.map(({feature:f})=>f)).find(({id:f})=>f===l.featureId),{featureUnits:u,featureUnitsPlural:p}=d||{},h=l.newUnitAmount===1?u:p,m=jsxs(Fragment,{children:["Your subscription will be updated to ",jsx("b",{children:l.newUnitAmount})," ",h," ",i?jsxs(Fragment,{children:["on ",vl(e.scheduledExecutionTime)]}):r,"."]}),g=`Until then you still have access to your current ${u} count.`;return {line1:m,line2:g}}default:return {}}}function hm(e){return e.feature&&(e.feature.unitQuantity!==1?e.feature.unitsPlural:e.feature.units)||""}function Ml(e,t){let o=[...e];o.sort((n,i)=>n.upTo?i.upTo?n.upTo-i.upTo:-1:1);for(let n of o)if(n.upTo&&t<=n.upTo)return n;return o[o.length-1]}function mm(e,t,o){return t===BillingPeriod.Annually&&o?e/12:e}function Al(e,t,o,n){let i=0;if(e.unitPrice){let r=mm(e.unitPrice.amount,o,n);i+=r*t;}return e.flatPrice&&(i+=mm(e.flatPrice.amount,o,n)),i}function Il(e,t,o,n){let i=t,r=0,a=0,s=[];for(;i>0&&a<e.length;){let c=e[a],{upTo:d}=c;if(_r(d))s.push({unitQuantity:i,amount:Al(c,i,o,n)}),i=0;else {let u=d-r,p=Math.min(i,u);s.push({unitQuantity:p,amount:Al(c,p,o,n)}),i-=p,r=d;}a+=1;}let l=sum(s.map(({amount:c})=>c));return {breakdown:s,total:l}}function Cn(e,t,o,n){if(!e.tiers)return 0;switch(e.tiersMode){case TiersMode.Volume:{let i=Ml(e.tiers,t);return Al(i,t,o,n)}case TiersMode.Graduated:return Il(e.tiers,t,o,n).total;default:return 0}}function gi(e){return e==null?void 0:e.some(({unitPrice:t,upTo:o})=>t&&!_r(o))}function gm(e){return e==null?void 0:e.every(({unitPrice:t,upTo:o})=>!t||_r(o))}function fm(e,t){return (e==null?void 0:e[0].upTo)&&t<=e[0].upTo}function Ar({plan:e,billingPeriod:t,currentSubscription:o,currentSubscriptionOverride:n,selectDefaultTierIndex:i}){let r=e.pricePoints.filter(a=>a.billingPeriod===t&&a.isTieredPrice);if(r.length===1){let[a]=r,{featureId:s}=a.feature,l=i?i({plan:e}):0,c=a.tiers[l],d=gi(a.tiers)?1:c.upTo||1;if(o&&o.plan.id===e.id){let p=o.prices.find(h=>{var m;return h.pricingModel===BillingModel.PerUnit&&h.tiersMode&&((m=h.feature)==null?void 0:m.featureId)===s});p&&(d=p.feature.unitQuantity||1);}if((n==null?void 0:n.planId)===e.id){let p=n.billableFeatures.find(h=>h.featureId===s);p&&(d=p.quantity);}let u={};return u[s]=d,u}return {}}function ym({perUnitQuantityByFeature:e,plan:t,currentSubscription:o,currentSubscriptionOverride:n}){var d,u;if(!o)return 0;let i=o.prices.find(p=>p.pricingModel===BillingModel.PerUnit&&p.tiersMode),r=t.id===(n==null?void 0:n.planId);if(r&&(i=(d=t.pricePoints.find(p=>p.pricingModel===BillingModel.PerUnit&&p.tiersMode))!=null?d:i),!i)return 0;let{featureId:a,unitQuantity:s}=i.feature,l=s;if(r){let p=(u=n==null?void 0:n.billableFeatures)==null?void 0:u.find(h=>h.featureId===a);p&&(l=p.quantity);}if(_r(l))return 0;let c=e[a];return c<l?-1:c>l?1:0}var k2=y(P2)`
49
49
  margin-left: 10px;
50
- `,u2=x.button`
50
+ `,w2=y.button`
51
51
  cursor: ${({$disabled:e})=>e?"default":"pointer"};
52
52
  padding: 8px 12px;
53
53
  background-color: ${({theme:e})=>e.stigg.palette.backgroundButton};
@@ -66,12 +66,12 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
66
66
  &:hover {
67
67
  background-color: ${({theme:e,$disabled:t})=>t?e.stigg.palette.backgroundButton:e.stigg.palette.outlinedHoverBackground};
68
68
  }
69
- `,p2=x(C)`
69
+ `,v2=y(P)`
70
70
  margin: 0;
71
71
  font-size: 15px;
72
- `,h2=x(C)`
72
+ `,_2=y(P)`
73
73
  min-height: 87px;
74
- `,m2=x.button`
74
+ `,A2=y.button`
75
75
  background: none;
76
76
  border: none;
77
77
  padding: 0;
@@ -79,17 +79,17 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
79
79
 
80
80
  text-decoration: underline;
81
81
  cursor: pointer;
82
- `,f2=x(C)`
82
+ `,M2=y(P)`
83
83
  margin-top: 8px;
84
84
  margin-bottom: 17px;
85
85
  min-height: 20px;
86
- `,g2=x.div`
86
+ `,I2=y.div`
87
87
  display: flex;
88
88
  flex-direction: column;
89
89
  margin-top: 4px;
90
- align-self: ${({theme:e})=>kr(e.stigg.layout.ctaAlignment)};
90
+ align-self: ${({theme:e})=>wr(e.stigg.layout.ctaAlignment)};
91
91
  width: 100%;
92
- `;function ch({isNextPlan:e,customer:t,plan:o,billingPeriod:n,isCustomerOnTrial:i,onPlanSelected:r,paywallLocale:a,withTrialLeftRow:s,currentSubscription:l,currentSubscriptionOverride:c,perUnitQuantityByFeature:d}){let u=useTheme(),[p,m]=useState(false),{currentPlan:h,custom:f,downgrade:g,startTrial:y,upgrade:P,startNew:T,switchToBillingPeriod:k,cancelScheduledUpdate:w}=a.planCTAButton,v=isFunction(g)?g(o):g,A=isFunction(P)?P(o):P,M={title:t?o.isLowerThanCurrentPlan?v:A:T,disabled:false,intentionType:o.isLowerThanCurrentPlan?"DOWNGRADE_PLAN":i?"UPGRADE_TRIAL_TO_PAID":"UPGRADE_PLAN"},I=o.pricingType===PricingType.Custom,{line1:B}=wr({scheduledUpdate:o.scheduledUpdate,options:{withDate:true}});if(o.isTriable&&!o.isCurrentCustomerPlan&&!i)M.title=y(o),M.intentionType="START_TRIAL";else if(o.isCurrentCustomerPlan&&!i)if(n===o.currentCustomerPlanBillingPeriod||o.pricingType&&[PricingType.Free,PricingType.Custom].includes(o.pricingType))switch(sh({perUnitQuantityByFeature:d,plan:o,currentSubscription:l,currentSubscriptionOverride:c})){case -1:M.intentionType="CHANGE_UNIT_QUANTITY",M.title=v;break;case 1:M.intentionType="CHANGE_UNIT_QUANTITY",M.title=A;break;default:M.title=h,M.disabled=true;break}else M.title=k(n),M.intentionType="CHANGE_BILLING_PERIOD";else I&&(M.title=typeof f=="function"?f({plan:o,selectedBillingPeriod:n}):f,M.intentionType="REQUEST_CUSTOM_PLAN_ACCESS");e&&o.scheduledUpdate&&(M.disabled=false,M.title=w,M.intentionType="CANCEL_SCHEDULED_UPDATES");let L=p||M.disabled;return jsx(Fragment,{children:jsx(g2,{className:"stigg-paywall-plan-button-layout",children:e&&B?jsxs(h2,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text",children:[B," ",jsx(m2,{color:"secondary",onClick:()=>{m(true),Promise.resolve(r(M.intentionType)).finally(()=>m(false));},children:M.title})]}):jsxs(Fragment,{children:[jsxs(u2,{className:"stigg-paywall-plan-button","data-testid":`paywall-card-cta-${o.displayName}`,disabled:L,$disabled:L,onClick:()=>{m(true),Promise.resolve(r(M.intentionType)).finally(()=>m(false));},children:[jsx(p2,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main",children:M.title}),p&&jsx(d2,{color:u.stigg.palette.text.disabled,loading:true,size:16})]}),s?jsx(f2,{className:"stigg-trial-days-left-text",variant:"h6",color:"secondary",children:o.isCurrentCustomerPlan&&o.trialDaysLeft&&jsxs(Fragment,{children:[jsxs("b",{children:[o.trialDaysLeft," days"]})," left on your free trial"]})}):jsx("div",{style:{height:"20px"}})]})})})}var at=({amount:e,currency:t=Currency.Usd,locale:o,maximumFractionDigits:n=5,minimumFractionDigits:i=0,removeTrailingZero:r})=>{let a=t.toString(),s=x2(a),l=new Intl.NumberFormat(o,S({maximumFractionDigits:n,minimumFractionDigits:i,style:"currency",currency:a,trailingZeroDisplay:r?"stripIfInteger":"auto"},s?{currencyDisplay:"code"}:{})).format(e||0);return s&&(l=l.replace(a,s)),l=l.replace(/\s/g,""),l};function gt(e,{locale:t,maximumFractionDigits:o}={}){return new Intl.NumberFormat(t,{maximumFractionDigits:o}).format(e)}function uh({planPrices:e,paywallCalculatedPrice:t,selectedBillingPeriod:o,locale:n,shouldShowMonthlyPriceAmount:i,paywallLocale:r,perUnitQuantityByFeature:a}){var g,y,P;let{amount:s,currency:l}=t||e[0],c=s||0,d=e.length===1,u=o===BillingPeriod.Annually&&i?c/12:c,p,m,h=r.price.pricePeriod(i?BillingPeriod.Monthly:BillingPeriod.Annually),f=h;for(let T of e)if(T.isTieredPrice&&T.tiers){let k=(a==null?void 0:a[T.feature.featureId])||1;p=T.tiers,m=ih(T),u+=Cn(T,k,o,i);}if(d){let T=e[0],k=T.blockSize&&T.blockSize>1?`for ${gt(T.blockSize)} ${((g=T.feature)==null?void 0:g.unitsPlural)||((y=T.feature)==null?void 0:y.units)||""}`:`per ${((P=T.feature)==null?void 0:P.units)||""}`;T.pricingModel===BillingModel.PerUnit&&!T.isTieredPrice?f=`${k} ${h}`:T.pricingModel===BillingModel.UsageBased&&(f=`${k}`);}return {price:at({amount:u,currency:l,locale:n,minimumFractionDigits:2,removeTrailingZero:true}),unit:f,tiers:p,tierUnits:m}}function Ar(e,t,o,n,i,r){var a;switch(e.pricingType){case PricingType.Free:return typeof o.price.free=="function"?o.price.free(e.paywallCurrency):o.price.free;case PricingType.Custom:return {price:typeof o.price.custom=="function"?o.price.custom({plan:e,selectedBillingPeriod:t}):o.price.custom};case PricingType.Paid:{let s=e.pricePoints.filter(d=>d.billingPeriod===t),l=(a=e.paywallCalculatedPricePoints)==null?void 0:a.find(d=>d.billingPeriod===t);if(!(s!=null&&s.length)&&!l)return {price:o.price.priceNotSet};let c={planPrices:s,paywallCalculatedPrice:l,selectedBillingPeriod:t,perUnitQuantityByFeature:r||{}};return o.price.paid?o.price.paid(_(S({},c),{plan:e})):uh(_(S({},c),{locale:n,shouldShowMonthlyPriceAmount:i,paywallLocale:o}))}default:return {price:""}}}var C2=x(b2)`
92
+ `;function bm({isNextPlan:e,customer:t,plan:o,billingPeriod:n,isCustomerOnTrial:i,onPlanSelected:r,paywallLocale:a,withTrialLeftRow:s,currentSubscription:l,currentSubscriptionOverride:c,perUnitQuantityByFeature:d}){let u=useTheme(),[p,h]=useState(false),{currentPlan:m,custom:g,downgrade:f,startTrial:x,upgrade:b,startNew:T,switchToBillingPeriod:k,cancelScheduledUpdate:w}=a.planCTAButton,v=isFunction(f)?f(o):f,_=isFunction(b)?b(o):b,M={title:t?o.isLowerThanCurrentPlan?v:_:T,disabled:false,intentionType:o.isLowerThanCurrentPlan?"DOWNGRADE_PLAN":i?"UPGRADE_TRIAL_TO_PAID":"UPGRADE_PLAN"},I=o.pricingType===PricingType.Custom,{line1:F}=vr({scheduledUpdate:o.scheduledUpdate,options:{withDate:true}});if(o.isTriable&&!o.isCurrentCustomerPlan&&!i)M.title=x(o),M.intentionType="START_TRIAL";else if(o.isCurrentCustomerPlan&&!i)if(n===o.currentCustomerPlanBillingPeriod||o.pricingType&&[PricingType.Free,PricingType.Custom].includes(o.pricingType))switch(ym({perUnitQuantityByFeature:d,plan:o,currentSubscription:l,currentSubscriptionOverride:c})){case -1:M.intentionType="CHANGE_UNIT_QUANTITY",M.title=v;break;case 1:M.intentionType="CHANGE_UNIT_QUANTITY",M.title=_;break;default:M.title=m,M.disabled=true;break}else M.title=k(n),M.intentionType="CHANGE_BILLING_PERIOD";else I&&(M.title=typeof g=="function"?g({plan:o,selectedBillingPeriod:n}):g,M.intentionType="REQUEST_CUSTOM_PLAN_ACCESS");e&&o.scheduledUpdate&&(M.disabled=false,M.title=w,M.intentionType="CANCEL_SCHEDULED_UPDATES");let E=p||M.disabled;return jsx(Fragment,{children:jsx(I2,{className:"stigg-paywall-plan-button-layout",children:e&&F?jsxs(_2,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text",children:[F," ",jsx(A2,{color:"secondary",onClick:()=>{h(true),Promise.resolve(r(M.intentionType)).finally(()=>h(false));},children:M.title})]}):jsxs(Fragment,{children:[jsxs(w2,{className:"stigg-paywall-plan-button","data-testid":`paywall-card-cta-${o.displayName}`,disabled:E,$disabled:E,onClick:()=>{h(true),Promise.resolve(r(M.intentionType)).finally(()=>h(false));},children:[jsx(v2,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main",children:M.title}),p&&jsx(k2,{color:u.stigg.palette.text.disabled,loading:true,size:16})]}),s?jsx(M2,{className:"stigg-trial-days-left-text",variant:"h6",color:"secondary",children:o.isCurrentCustomerPlan&&o.trialDaysLeft&&jsxs(Fragment,{children:[jsxs("b",{children:[o.trialDaysLeft," days"]})," left on your free trial"]})}):jsx("div",{style:{height:"20px"}})]})})})}var at=({amount:e,currency:t=Currency.Usd,locale:o,maximumFractionDigits:n=5,minimumFractionDigits:i=0,removeTrailingZero:r})=>{let a=t.toString(),s=F2(a),l=new Intl.NumberFormat(o,S({maximumFractionDigits:n,minimumFractionDigits:i,style:"currency",currency:a,trailingZeroDisplay:r?"stripIfInteger":"auto"},s?{currencyDisplay:"code"}:{})).format(e||0);return s&&(l=l.replace(a,s)),l=l.replace(/\s/g,""),l};function ft(e,{locale:t,maximumFractionDigits:o}={}){return new Intl.NumberFormat(t,{maximumFractionDigits:o}).format(e)}function Pm({planPrices:e,paywallCalculatedPrice:t,selectedBillingPeriod:o,locale:n,shouldShowMonthlyPriceAmount:i,paywallLocale:r,perUnitQuantityByFeature:a}){var f,x,b;let{amount:s,currency:l}=t||e[0],c=s||0,d=e.length===1,u=o===BillingPeriod.Annually&&i?c/12:c,p,h,m=r.price.pricePeriod(i?BillingPeriod.Monthly:BillingPeriod.Annually),g=m;for(let T of e)if(T.isTieredPrice&&T.tiers){let k=(a==null?void 0:a[T.feature.featureId])||1;p=T.tiers,h=hm(T),u+=Cn(T,k,o,i);}if(d){let T=e[0],k=T.blockSize&&T.blockSize>1?`for ${ft(T.blockSize)} ${((f=T.feature)==null?void 0:f.unitsPlural)||((x=T.feature)==null?void 0:x.units)||""}`:`per ${((b=T.feature)==null?void 0:b.units)||""}`;T.pricingModel===BillingModel.PerUnit&&!T.isTieredPrice?g=`${k} ${m}`:T.pricingModel===BillingModel.UsageBased&&(g=`${k}`);}return {price:at({amount:u,currency:l,locale:n,minimumFractionDigits:2,removeTrailingZero:true}),unit:g,tiers:p,tierUnits:h}}function Mr(e,t,o,n,i,r){var a;switch(e.pricingType){case PricingType.Free:return typeof o.price.free=="function"?o.price.free(e.paywallCurrency):o.price.free;case PricingType.Custom:return {price:typeof o.price.custom=="function"?o.price.custom({plan:e,selectedBillingPeriod:t}):o.price.custom};case PricingType.Paid:{let s=e.pricePoints.filter(d=>d.billingPeriod===t),l=(a=e.paywallCalculatedPricePoints)==null?void 0:a.find(d=>d.billingPeriod===t);if(!(s!=null&&s.length)&&!l)return {price:o.price.priceNotSet};let c={planPrices:s,paywallCalculatedPrice:l,selectedBillingPeriod:t,perUnitQuantityByFeature:r||{}};return o.price.paid?o.price.paid(A(S({},c),{plan:e})):Pm(A(S({},c),{locale:n,shouldShowMonthlyPriceAmount:i,paywallLocale:o}))}default:return {price:""}}}var B2=y(L2)`
93
93
  border-radius: 10px;
94
94
  text-transform: none;
95
95
  font-weight: 300;
@@ -100,26 +100,26 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
100
100
  &:hover {
101
101
  background-color: ${({theme:e,$success:t,$error:o})=>t?e.stigg.palette.successDark:o?e.stigg.palette.errorDark:""};
102
102
  }
103
- `,kt=o=>{var n=o,{variant:e="outlined"}=n,t=ot(n,["variant"]);return jsx(C2,S({variant:e},t))};var Rt=x(S2)(({theme:e})=>({"& .MuiOutlinedInput-root":{height:"42px",borderRadius:e.stigg.border.radius,fieldset:{borderColor:e.stigg.palette.outlinedBorder},"&:not(.Mui-focused):hover fieldset":{borderColor:e.stigg.palette.outlinedRestingBorder}},"& .MuiInputBase-input":S({padding:"8px 12px",borderRadius:e.stigg.border.radius,fontFamily:e.stigg.typography.fontFamily,color:e.stigg.palette.text.primary},e.stigg.typography.body),"& .Mui-error":{fontFamily:e.stigg.typography.fontFamily},"& .MuiFormHelperText-root":{whiteSpace:"nowrap"}}));var Uo=x(Pe)`
103
+ `,kt=o=>{var n=o,{variant:e="outlined"}=n,t=ot(n,["variant"]);return jsx(B2,S({variant:e},t))};var Rt=y(D2)(({theme:e})=>({"& .MuiOutlinedInput-root":{height:"42px",borderRadius:e.stigg.border.radius,fieldset:{borderColor:e.stigg.palette.outlinedBorder},"&:not(.Mui-focused):hover fieldset":{borderColor:e.stigg.palette.outlinedRestingBorder}},"& .MuiInputBase-input":S({padding:"8px 12px",borderRadius:e.stigg.border.radius,fontFamily:e.stigg.typography.fontFamily,color:e.stigg.palette.text.primary},e.stigg.typography.body),"& .Mui-error":{fontFamily:e.stigg.typography.fontFamily},"& .MuiFormHelperText-root":{whiteSpace:"nowrap"}}));var Oo=y(Se)`
104
104
  display: flex;
105
105
  flex-direction: ${({$flexDirection:e})=>e||"row"};
106
106
  gap: ${({$gap:e})=>e}px;
107
- `,hh=x(Uo)`
107
+ `,Tm=y(Oo)`
108
108
  span {
109
109
  display: flex;
110
110
  flex: 1;
111
111
  }
112
- `,yi=x(Pe)`
112
+ `,yi=y(Se)`
113
113
  span {
114
114
  display: flex;
115
115
  flex: ${({flex:e})=>e};
116
116
  }
117
- `,dt=x(ro)`
117
+ `,dt=y(ro)`
118
118
  border-radius: 4px;
119
- `;var mh=x(Pe)`
119
+ `;var km=y(Se)`
120
120
  display: flex;
121
121
  flex-direction: column;
122
- `;function fh(){return jsxs(mh,{container:true,children:[jsxs(Uo,{item:true,$gap:48,children:[jsx(dt,{width:120,height:20}),jsx(dt,{width:120,height:20})]}),jsx(sf,{className:"stigg-checkout-plan-header-divider",sx:{marginY:2}}),jsxs(mh,{item:true,children:[jsx(dt,{width:120,height:20}),jsxs(hh,{$gap:16,marginTop:3,children:[jsx(dt,{height:20}),jsx(dt,{height:20})]}),jsxs(Uo,{$gap:130,marginTop:3,children:[jsx(yi,{flex:1,children:jsx(dt,{height:20})}),jsx(yi,{flex:3,children:jsx(dt,{height:20})})]})]})]})}var Pn=e=>e.target.blur();function gh({width:e,tierUnits:t,value:o,handleChange:n,errorMessage:i}){return jsx(Rt,{type:"number",onWheel:Pn,fullWidth:true,error:!!i,sx:{minHeight:"46px",width:e},InputProps:{endAdornment:jsx(v2,{position:"end",children:jsx(C,{variant:"body1",color:"primary",children:t})})},value:o,onChange:r=>{var s,l;let a=(s=r==null?void 0:r.target)!=null&&s.value?Number((l=r==null?void 0:r.target)==null?void 0:l.value):null;a&&n(a);}})}var L2=x(A2)`
122
+ `;function wm(){return jsxs(km,{container:true,children:[jsxs(Oo,{item:true,$gap:48,children:[jsx(dt,{width:120,height:20}),jsx(dt,{width:120,height:20})]}),jsx(gg,{className:"stigg-checkout-plan-header-divider",sx:{marginY:2}}),jsxs(km,{item:true,children:[jsx(dt,{width:120,height:20}),jsxs(Tm,{$gap:16,marginTop:3,children:[jsx(dt,{height:20}),jsx(dt,{height:20})]}),jsxs(Oo,{$gap:130,marginTop:3,children:[jsx(yi,{flex:1,children:jsx(dt,{height:20})}),jsx(yi,{flex:3,children:jsx(dt,{height:20})})]})]})]})}var Pn=e=>e.target.blur();function vm({width:e,tierUnits:t,value:o,handleChange:n,errorMessage:i}){return jsx(Rt,{type:"number",onWheel:Pn,fullWidth:true,error:!!i,sx:{minHeight:"46px",width:e},InputProps:{endAdornment:jsx(z2,{position:"end",children:jsx(P,{variant:"body1",color:"primary",children:t})})},value:o,onChange:r=>{var s,l;let a=(s=r==null?void 0:r.target)!=null&&s.value?Number((l=r==null?void 0:r.target)==null?void 0:l.value):null;a&&n(a);}})}var G2=y($2)`
123
123
  border-radius: 10px;
124
124
  min-height: 42px;
125
125
  min-width: 120px;
@@ -127,7 +127,7 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
127
127
  &:hover .MuiOutlinedInput-notchedOutline {
128
128
  border-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
129
129
  }
130
- `,B2=x(_2)`
130
+ `,j2=y(V2)`
131
131
  & .MuiInputBase-input {
132
132
  padding: 10px 12px;
133
133
  }
@@ -135,34 +135,34 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
135
135
  &.Mui-focused .MuiOutlinedInput-notchedOutline {
136
136
  border-color: ${({theme:e})=>e.stigg.palette.primary} !important;
137
137
  }
138
- `;function yh({value:e,componentId:t,tierUnits:o,tiers:n,handleChange:i,errorMessage:r}){return n?jsx(L2,{value:e.toString(),fullWidth:true,error:!!r,onChange:a=>{var l,c;let s=(l=a==null?void 0:a.target)!=null&&l.value?Number((c=a==null?void 0:a.target)==null?void 0:c.value):null;s&&i(s);},id:t,input:jsx(B2,{}),MenuProps:{MenuListProps:{disablePadding:true},PaperProps:{sx:{marginTop:"4px",borderRadius:"10px"}}},children:map(n,a=>{var s;return jsx(M2,{className:"stigg-price-tier-menu-item-text",value:(s=a.upTo)==null?void 0:s.toString(),children:jsxs(C,{variant:"body1",color:"primary",style:{lineHeight:"unset"},children:[At(a.upTo)," ",o]})},a.upTo)})}):null}var R2=x(C)`
138
+ `;function _m({value:e,componentId:t,tierUnits:o,tiers:n,handleChange:i,errorMessage:r}){return n?jsx(G2,{value:e.toString(),fullWidth:true,error:!!r,onChange:a=>{var l,c;let s=(l=a==null?void 0:a.target)!=null&&l.value?Number((c=a==null?void 0:a.target)==null?void 0:c.value):null;s&&i(s);},id:t,input:jsx(j2,{}),MenuProps:{MenuListProps:{disablePadding:true},PaperProps:{sx:{marginTop:"4px",borderRadius:"10px"}}},children:map(n,a=>{var s;return jsx(H2,{className:"stigg-price-tier-menu-item-text",value:(s=a.upTo)==null?void 0:s.toString(),children:jsxs(P,{variant:"body1",color:"primary",style:{lineHeight:"unset"},children:[At(a.upTo)," ",o]})},a.upTo)})}):null}var X2=y(P)`
139
139
  min-height: 46px;
140
- `;function Mr(e){let{tiers:t,errorMessage:o}=e;return jsx(Fragment,{children:jsxs(Box,{display:"flex",flexDirection:"column",justifyContent:"center",style:{width:"100%"},children:[jsx(R2,{as:"div",className:"stigg-price-tier-select",children:fi(t)?jsx(gh,S({},e)):jsx(yh,S({},e))}),jsx(C,{style:{margin:"4px"},variant:"caption",color:"error",children:o})]})})}var bh="\u200E",O2=x(C)`
140
+ `;function Ir(e){let{tiers:t,errorMessage:o}=e;return jsx(Fragment,{children:jsxs(Box,{display:"flex",flexDirection:"column",justifyContent:"center",style:{width:"100%"},children:[jsx(X2,{as:"div",className:"stigg-price-tier-select",children:gi(t)?jsx(vm,S({},e)):jsx(_m,S({},e))}),jsx(P,{style:{margin:"4px"},variant:"caption",color:"error",children:o})]})})}var Mm="\u200E",Q2=y(P)`
141
141
  word-break: break-word;
142
142
  width: 100%;
143
- `,U2=x(C)`
143
+ `,J2=y(P)`
144
144
  white-space: nowrap;
145
- `,z2=x(C)`
145
+ `,tP=y(P)`
146
146
  white-space: normal;
147
147
  min-height: 39px;
148
- `;function $2({plan:e,billingPeriod:t,hasMonthlyPrice:o,hasAnnuallyPrice:n,paywallLocale:i}){var s,l;let r=e.pricePoints.find(c=>c.billingPeriod===t),a=bh;return r&&o&&n&&(a=((l=(s=i.price).billingPeriod)==null?void 0:l.call(s,t))||`, billed ${t.toLowerCase()}`),jsx(C,{as:"span",className:"stigg-price-billing-period-text",variant:"h6",color:"secondary",children:a})}var Ch=({showStartingAt:e,withUnitPriceRow:t,withStartingAtRow:o,withTiersRow:n,plan:i,billingPeriod:r,paywallLocale:a,locale:s,hasMonthlyPrice:l,hasAnnuallyPrice:c,perUnitQuantityByFeature:d,setPerUnitQuantityByFeature:u})=>{var k;let{price:p,unit:m,tiers:h,tierUnits:f}=Ar(i,r,a,s,l,d),g=i.pricePoints.find(w=>w.billingPeriod===r&&w.isTieredPrice),y=g?g.feature.featureId:void 0,P=(k=d[y||""])!=null?k:1,T=w=>{y&&u(v=>_(S({},v),{[y]:w}));};return jsx(O2,{as:"div",className:"stigg-price-text",children:jsxs(Fragment,{children:[o&&jsx(C,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary",children:e?a.price.startingAtCaption:bh}),jsx(z2,{className:"stigg-price-point",variant:"h1",children:p}),t&&jsxs(C,{as:"div",className:"stigg-price-unit-and-billing-period-text",style:{minHeight:"48px"},children:[jsx(U2,{className:"stigg-price-unit-text",as:"span",variant:"h6",color:"secondary",children:m}),jsx($2,{plan:i,billingPeriod:r,hasAnnuallyPrice:c,hasMonthlyPrice:l,paywallLocale:a})]}),n?jsx(Mr,{componentId:`${i.id}_${y}_tier`,tiers:h,tierUnits:f,tiersMode:g==null?void 0:g.tiersMode,handleChange:T,value:P}):null]})})};var Y2=x(b2)`
148
+ `;function eP({plan:e,billingPeriod:t,hasMonthlyPrice:o,hasAnnuallyPrice:n,paywallLocale:i}){var s,l;let r=e.pricePoints.find(c=>c.billingPeriod===t),a=Mm;return r&&o&&n&&(a=((l=(s=i.price).billingPeriod)==null?void 0:l.call(s,t))||`, billed ${t.toLowerCase()}`),jsx(P,{as:"span",className:"stigg-price-billing-period-text",variant:"h6",color:"secondary",children:a})}var Im=({showStartingAt:e,withUnitPriceRow:t,withStartingAtRow:o,withTiersRow:n,plan:i,billingPeriod:r,paywallLocale:a,locale:s,hasMonthlyPrice:l,hasAnnuallyPrice:c,perUnitQuantityByFeature:d,setPerUnitQuantityByFeature:u})=>{var k;let{price:p,unit:h,tiers:m,tierUnits:g}=Mr(i,r,a,s,l,d),f=i.pricePoints.find(w=>w.billingPeriod===r&&w.isTieredPrice),x=f?f.feature.featureId:void 0,b=(k=d[x||""])!=null?k:1,T=w=>{x&&u(v=>A(S({},v),{[x]:w}));};return jsx(Q2,{as:"div",className:"stigg-price-text",children:jsxs(Fragment,{children:[o&&jsx(P,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary",children:e?a.price.startingAtCaption:Mm}),jsx(tP,{className:"stigg-price-point",variant:"h1",children:p}),t&&jsxs(P,{as:"div",className:"stigg-price-unit-and-billing-period-text",style:{minHeight:"48px"},children:[jsx(J2,{className:"stigg-price-unit-text",as:"span",variant:"h6",color:"secondary",children:h}),jsx(eP,{plan:i,billingPeriod:r,hasAnnuallyPrice:c,hasMonthlyPrice:l,paywallLocale:a})]}),n?jsx(Ir,{componentId:`${i.id}_${x}_tier`,tiers:m,tierUnits:g,tiersMode:f==null?void 0:f.tiersMode,handleChange:T,value:b}):null]})})};var sP=y(L2)`
149
149
  padding: 0px;
150
150
  text-transform: none;
151
151
  margin-left: 0px;
152
- `,Z2=x(C)`
152
+ `,lP=y(P)`
153
153
  font-size: 14px;
154
154
  font-weight: 500;
155
- `,X2=x.div`
155
+ `,cP=y.div`
156
156
  width: 100%;
157
157
  gap: 10px;
158
- `,K2=x.div`
158
+ `,dP=y.div`
159
159
  margin-top: 10px;
160
160
  overflow: hidden;
161
161
  display: flex;
162
162
  flex-direction: column;
163
163
  gap: 4px;
164
164
  width: 100%;
165
- `,q2=x.div`
165
+ `,uP=y.div`
166
166
  display: flex;
167
167
  flex-direction: row;
168
168
  flex-wrap: nowrap;
@@ -171,7 +171,7 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
171
171
  padding: 8px 0px;
172
172
  max-height: 44px;
173
173
  gap: 16px;
174
- `,Q2=x(C)`
174
+ `,pP=y(P)`
175
175
  overflow: hidden;
176
176
  font-feature-settings: 'liga' off, 'clig' off;
177
177
  text-overflow: ellipsis;
@@ -180,17 +180,17 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
180
180
  white-space: nowrap;
181
181
  min-width: 0;
182
182
  flex-shrink: 1;
183
- `,J2=x(pt)`
183
+ `,mP=y(mt)`
184
184
  width: 24px;
185
185
  height: 24px;
186
186
  color: ${({theme:e})=>e.stigg.palette.primary};
187
- `,tP=x.div`
187
+ `,hP=y.div`
188
188
  flex: 1;
189
189
  min-width: 0;
190
- `,eP=x.div`
190
+ `,gP=y.div`
191
191
  margin-top: 16px;
192
192
  display: flex;
193
- `,Ml=4;function Il({addons:e,paywallLocale:t}){let[o,n]=useState(false);if(!e||e.length===0)return null;let i=e.filter(s=>{var l;return !((l=s.hiddenFromWidgets)!=null&&l.includes(WidgetType.Paywall))}),r=()=>{n(!o);},a=o?i:i.slice(0,Ml);return a.length===0?null:jsxs(X2,{className:"stigg-compatible-addons-container",children:[jsx(C,{className:"stigg-compatible-addons-header",color:"secondary",variant:"body1",bold:true,children:t.addonsTitle}),jsx(K2,{className:"stigg-compatible-addons-list",children:a.map(s=>jsxs(q2,{className:j2(`stigg-compatible-addon--${s.id}`,"stigg-compatible-addon-item"),children:[jsx(J2,{icon:"Add",className:"stigg-compatible-addon-icon"}),jsx(tP,{className:"stigg-compatible-addon-content",children:jsx(Q2,{variant:"body1",color:"primary",className:"stigg-compatible-addon-name",children:s.displayName})})]},s.id))}),i.length>Ml&&jsx(eP,{children:jsx(Y2,{variant:"text",onClick:r,children:jsx(Z2,{color:"primary.main",children:o?"Show less":`Show ${i.length-Ml} more`})})})]})}var aP="66px",sP=x.div`
193
+ `,Nl=4;function Ul({addons:e,paywallLocale:t}){let[o,n]=useState(false);if(!e||e.length===0)return null;let i=e.filter(s=>{var l;return !((l=s.hiddenFromWidgets)!=null&&l.includes(WidgetType.Paywall))}),r=()=>{n(!o);},a=o?i:i.slice(0,Nl);return a.length===0?null:jsxs(cP,{className:"stigg-compatible-addons-container",children:[jsx(P,{className:"stigg-compatible-addons-header",color:"secondary",variant:"body1",bold:true,children:t.addonsTitle}),jsx(dP,{className:"stigg-compatible-addons-list",children:a.map(s=>jsxs(uP,{className:aP(`stigg-compatible-addon--${s.id}`,"stigg-compatible-addon-item"),children:[jsx(mP,{icon:"Add",className:"stigg-compatible-addon-icon"}),jsx(hP,{className:"stigg-compatible-addon-content",children:jsx(pP,{variant:"body1",color:"primary",className:"stigg-compatible-addon-name",children:s.displayName})})]},s.id))}),i.length>Nl&&jsx(gP,{children:jsx(sP,{variant:"text",onClick:r,children:jsx(lP,{color:"primary.main",children:o?"Show less":`Show ${i.length-Nl} more`})})})]})}var CP="66px",PP=y.div`
194
194
  position: relative;
195
195
  background-color: ${({theme:e,$isCurrentPlan:t})=>t?e.stigg.palette.backgroundHighlight:e.stigg.palette.backgroundPaper};
196
196
  border: ${({theme:e,$isHighlighted:t})=>t?`3px solid ${e.stigg.palette.primary}`:`1px solid ${e.stigg.palette.outlinedBorder}`};
@@ -203,38 +203,38 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
203
203
  align-items: flex-start;
204
204
  justify-content: flex-start;
205
205
  position: relative;
206
- `,lP=x.div`
206
+ `,SP=y.div`
207
207
  margin-top: ${({$planHasEntitlements:e})=>e?"32px":"0px"};
208
- `,cP=x(C)`
208
+ `,TP=y(P)`
209
209
  padding-bottom: 8px;
210
- `,dP=x.div`
210
+ `,kP=y.div`
211
211
  height: 2px;
212
212
  width: 100%;
213
213
  background-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
214
214
  margin-bottom: 40px;
215
- `,uP=x(C)`
215
+ `,wP=y(P)`
216
216
  text-align: ${({theme:e})=>e.stigg.layout.descriptionAlignment};
217
217
  min-height: ${({theme:e})=>e.stigg.layout.descriptionMinHeight};
218
- `,pP=x.div`
218
+ `,vP=y.div`
219
219
  background-color: ${({theme:e})=>e.stigg.palette.primary};
220
220
  border-radius: 40px;
221
221
  position: absolute;
222
222
  top: -12px;
223
- `,hP=x(C)`
223
+ `,_P=y(P)`
224
224
  margin: 0;
225
225
  padding: 2px 8px;
226
- `,mP=x.div`
226
+ `,AP=y.div`
227
227
  width: 100%;
228
228
  display: flex;
229
229
  flex-direction: column;
230
- align-items: ${({theme:e})=>kr(e.stigg.layout.headerAlignment)};
231
- `,fP=x.div`
230
+ align-items: ${({theme:e})=>wr(e.stigg.layout.headerAlignment)};
231
+ `,MP=y.div`
232
232
  position: absolute;
233
233
  top: 0;
234
234
  background-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
235
235
  border-radius: 0px 0px 10px 10px;
236
236
  padding: 3px 12px;
237
- `,gP=x(Cr)`
237
+ `,IP=y(Pr)`
238
238
  display: flex;
239
239
  height: 100%;
240
240
  margin-right: 4px;
@@ -242,7 +242,7 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
242
242
  path {
243
243
  fill: ${({theme:e})=>e.stigg.palette.text.primary};
244
244
  }
245
- `;function yP({text:e="Next",iconsColor:t}){return jsx(fP,{children:jsxs(Pe,{display:"flex",alignItems:"center",gap:1,children:[jsx(gP,{$iconsColor:t}),jsx(C,{color:"primary",variant:"body1",children:e})]})})}function Sh({withUnitPriceRow:e,withTiersRow:t,withTrialLeftRow:o,customer:n,plan:i,billingPeriod:r,isHighlighted:a,currentSubscription:s,currentSubscriptionOverride:l,shouldShowDescriptionSection:c,hasMonthlyPrice:d,hasAnnuallyPrice:u,isCustomerOnTrial:p,onPlanSelected:m,paywallLocale:h,locale:f,withStartingAtRow:g,isCustomerInCustomPlan:y,selectDefaultTierIndex:P,hideCompatibleAddons:T}){var O,N,F;let k=i.isNextPlan&&i.isNextPlan(r),w=i.pricePoints.filter($=>$.billingPeriod===r),v=(O=i.paywallCalculatedPricePoints)==null?void 0:O.find($=>$.billingPeriod===r),A=w.length>1&&!!(v!=null&&v.additionalChargesMayApply),M=!y||i.pricingType===PricingType.Custom,I=null;k?I=jsx(yP,{text:"Next plan"}):a&&h.highlightChip&&(I=jsx(pP,{className:"stigg-highlight-badge",children:jsx(hP,{className:"stigg-highlight-badge-text",color:"white",bold:true,children:h.highlightChip})}));let[B,L]=useState(_r({plan:i,billingPeriod:r,currentSubscription:s,currentSubscriptionOverride:l,selectDefaultTierIndex:P})),E=$=>{let J=Object.keys(B).map(Ft=>({featureId:Ft,quantity:B[Ft]}));return m($,J)};return jsxs(sP,{className:j2(`stigg-${i.id}`,"stigg-plan-offering-container",{"stigg-current-plan":i.isCurrentCustomerPlan}),$isHighlighted:a,$isCurrentPlan:i.isCurrentCustomerPlan,children:[I,jsxs(mP,{className:"stigg-header-wrapper",children:[jsx(cP,{className:"stigg-plan-header",variant:"h3",children:i.displayName}),c&&jsx(uP,{className:"stigg-plan-description",variant:"h6",color:"secondary",children:i.description}),jsx(Ch,{showStartingAt:A,withUnitPriceRow:e,withStartingAtRow:g,withTiersRow:t,plan:i,billingPeriod:r,paywallLocale:h,locale:f,hasAnnuallyPrice:u,hasMonthlyPrice:d,setPerUnitQuantityByFeature:L,perUnitQuantityByFeature:B}),M?jsx(ch,{isNextPlan:k,customer:n,plan:i,currentSubscription:s,currentSubscriptionOverride:l,billingPeriod:r,isCustomerOnTrial:p,onPlanSelected:E,paywallLocale:h,withTrialLeftRow:o,perUnitQuantityByFeature:B}):jsx("div",{style:{height:aP}}),jsx(dP,{className:"stigg-plan-header-divider"})]}),jsx(Qp,{plan:i,billingPeriod:r,paywallLocale:h}),jsx(lP,{$planHasEntitlements:((F=(N=i.packageEntitlements)==null?void 0:N.length)!=null?F:0)>0,className:"stigg-addons-container",children:!T&&i.compatibleAddons&&i.compatibleAddons.length>0&&jsx(Il,{addons:i.compatibleAddons,paywallLocale:h})})]})}var bP=x.div`
245
+ `;function EP({text:e="Next",iconsColor:t}){return jsx(MP,{children:jsxs(Se,{display:"flex",alignItems:"center",gap:1,children:[jsx(IP,{$iconsColor:t}),jsx(P,{color:"primary",variant:"body1",children:e})]})})}function Fm({withUnitPriceRow:e,withTiersRow:t,withTrialLeftRow:o,customer:n,plan:i,billingPeriod:r,isHighlighted:a,currentSubscription:s,currentSubscriptionOverride:l,shouldShowDescriptionSection:c,hasMonthlyPrice:d,hasAnnuallyPrice:u,isCustomerOnTrial:p,onPlanSelected:h,paywallLocale:m,locale:g,withStartingAtRow:f,isCustomerInCustomPlan:x,selectDefaultTierIndex:b,hideCompatibleAddons:T}){var O,U,L;let k=i.isNextPlan&&i.isNextPlan(r),w=i.pricePoints.filter(V=>V.billingPeriod===r),v=(O=i.paywallCalculatedPricePoints)==null?void 0:O.find(V=>V.billingPeriod===r),_=w.length>1&&!!(v!=null&&v.additionalChargesMayApply),M=!x||i.pricingType===PricingType.Custom,I=null;k?I=jsx(EP,{text:"Next plan"}):a&&m.highlightChip&&(I=jsx(vP,{className:"stigg-highlight-badge",children:jsx(_P,{className:"stigg-highlight-badge-text",color:"white",bold:true,children:m.highlightChip})}));let[F,E]=useState(Ar({plan:i,billingPeriod:r,currentSubscription:s,currentSubscriptionOverride:l,selectDefaultTierIndex:b})),B=V=>{let J=Object.keys(F).map(Bt=>({featureId:Bt,quantity:F[Bt]}));return h(V,J)};return jsxs(PP,{className:aP(`stigg-${i.id}`,"stigg-plan-offering-container",{"stigg-current-plan":i.isCurrentCustomerPlan}),$isHighlighted:a,$isCurrentPlan:i.isCurrentCustomerPlan,children:[I,jsxs(AP,{className:"stigg-header-wrapper",children:[jsx(TP,{className:"stigg-plan-header",variant:"h3",children:i.displayName}),c&&jsx(wP,{className:"stigg-plan-description",variant:"h6",color:"secondary",children:i.description}),jsx(Im,{showStartingAt:_,withUnitPriceRow:e,withStartingAtRow:f,withTiersRow:t,plan:i,billingPeriod:r,paywallLocale:m,locale:g,hasAnnuallyPrice:u,hasMonthlyPrice:d,setPerUnitQuantityByFeature:E,perUnitQuantityByFeature:F}),M?jsx(bm,{isNextPlan:k,customer:n,plan:i,currentSubscription:s,currentSubscriptionOverride:l,billingPeriod:r,isCustomerOnTrial:p,onPlanSelected:B,paywallLocale:m,withTrialLeftRow:o,perUnitQuantityByFeature:F}):jsx("div",{style:{height:CP}}),jsx(kP,{className:"stigg-plan-header-divider"})]}),jsx(lm,{plan:i,billingPeriod:r,paywallLocale:m}),jsx(SP,{$planHasEntitlements:((L=(U=i.packageEntitlements)==null?void 0:U.length)!=null?L:0)>0,className:"stigg-addons-container",children:!T&&i.compatibleAddons&&i.compatibleAddons.length>0&&jsx(Ul,{addons:i.compatibleAddons,paywallLocale:m})})]})}var LP=y.div`
246
246
  height: 40px;
247
247
  padding: 0 20px;
248
248
  margin-bottom: ${({theme:e})=>e.stigg.layout.switchBottomSpacing};
@@ -252,9 +252,9 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
252
252
  display: flex;
253
253
  align-items: center;
254
254
  justify-content: center;
255
- `,Th=x(C)`
255
+ `,Lm=y(P)`
256
256
  margin: 0 8px;
257
- `,CP=x(xP)`
257
+ `,BP=y(FP)`
258
258
  & .react-switch-bg {
259
259
  border: ${({theme:e})=>`1px solid ${e.stigg.palette.switchBorder}`};
260
260
  background: ${({theme:e})=>e.stigg.palette.switchFill} !important;
@@ -265,17 +265,17 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
265
265
  background: ${({theme:e})=>e.stigg.palette.switchHandle} !important;
266
266
  top: 0.5px !important;
267
267
  }
268
- `;function PP({discount:e,disabled:t}){return jsxs(C,{variant:"h6",color:t?"disabled":"primary",className:"stigg-discount-rate-text",children:[e,"% off"]})}function kh({discountRate:e,selectedBillingPeriod:t,onBillingPeriodChanged:o,availableBillingPeriods:n}){if(n.length<=1)return null;let i=t===BillingPeriod.Monthly;return jsxs(bP,{className:"stigg-period-picker-container",children:[jsx(Th,{variant:"h6",className:"stigg-monthly-period-text",color:i?"primary":"disabled",children:"Monthly"}),jsx(CP,{className:"stigg-period-switch",uncheckedIcon:false,checkedIcon:false,height:16,width:33,onChange:r=>o(r?BillingPeriod.Annually:BillingPeriod.Monthly),checked:!i,borderRadius:10,handleDiameter:19}),jsx(Th,{variant:"h6",className:"stigg-annual-period-text",color:i?"disabled":"primary",children:"Annual"}),e!==0&&jsx(PP,{discount:e,disabled:i})]})}function SP(e,t){if(!vr(e)&&!vr(t)){let o=t/12;return Math.round((e-o)/e*100)}return null}function Ah(e,t){var n;let o;if(o=(n=e.paywallCalculatedPricePoints)==null?void 0:n.find(i=>i.billingPeriod===t),o||(o=e.pricePoints.find(i=>i.billingPeriod===t)),!(o!=null&&o.amount)){let i=e.pricePoints.find(r=>r.isTieredPrice&&r.billingPeriod===t);if(i)return Cn(i,1)}return o==null?void 0:o.amount}function Mh(e){return e.reduce((t,o)=>{let n=Ah(o,BillingPeriod.Monthly),i=Ah(o,BillingPeriod.Annually),r=SP(n,i);return r&&(t=Math.max(t,r)),t},0)}var TP=e=>jsxs("svg",_(S({width:135,height:16,viewBox:"0 0 135 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("path",{d:"M0.0987549 3.43016V12.9878H1.15589V9.52681H3.96527C5.94922 9.52681 7.28874 8.25245 7.28874 6.47848C7.28874 4.70452 5.94922 3.43016 3.96527 3.43016H0.0987549ZM1.15589 8.55656V4.40765H4.04492C5.33376 4.40765 6.18816 5.26205 6.18816 6.47848C6.18816 7.69492 5.33376 8.55656 4.04492 8.55656H1.15589Z",fill:"#001E6C"}),jsx("path",{d:"M11.7787 13.1616C13.9075 13.1616 15.6525 11.5397 15.6525 9.38199C15.6525 7.21703 13.9365 5.62408 11.8077 5.62408C9.64999 5.62408 7.93395 7.24599 7.93395 9.41095C7.93395 11.5687 9.62103 13.1616 11.7787 13.1616ZM11.7932 12.2276C10.2365 12.2276 9.02005 11.0256 9.02005 9.39647C9.02005 7.76732 10.2365 6.56537 11.7932 6.56537C13.321 6.56537 14.5664 7.76732 14.5664 9.39647C14.5664 11.0256 13.321 12.2276 11.7932 12.2276Z",fill:"#001E6C"}),jsx("path",{d:"M19.9054 12.9878L21.4766 6.94189H21.5056L23.0623 12.9878H24.4018L26.5958 5.8051H25.4155L23.7936 11.909H23.7647L22.2152 5.8051H20.7815L19.232 11.909H19.203L17.5522 5.8051H16.3575L18.5659 12.9878H19.9054Z",fill:"#001E6C"}),jsx("path",{d:"M34.9835 9.42544C34.9835 7.30392 33.4051 5.62408 31.1532 5.62408C29.0534 5.62408 27.3084 7.18083 27.3084 9.41095C27.3084 11.5542 28.9086 13.1616 31.1822 13.1616C32.7679 13.1616 34.0567 12.3941 34.6794 11.1922L33.7816 10.707C33.3688 11.6049 32.3696 12.2348 31.1966 12.2348C29.5241 12.2348 28.5031 10.9894 28.4017 9.7223H34.969C34.9835 9.59197 34.9835 9.54129 34.9835 9.42544ZM31.1387 6.55089C32.5434 6.55089 33.6657 7.49942 33.854 8.80998H28.4307C28.6552 7.5501 29.7558 6.55089 31.1387 6.55089Z",fill:"#001E6C"}),jsx("path",{d:"M39.5922 5.68201C38.564 5.68201 37.8182 6.20334 37.4924 6.93464L37.391 5.8051H36.486V12.9878H37.5431V8.5638C37.5431 7.44873 38.1585 6.77535 39.3171 6.77535H39.9977V5.68201H39.5922Z",fill:"#001E6C"}),jsx("path",{d:"M48.2486 9.42544C48.2486 7.30392 46.6702 5.62408 44.4183 5.62408C42.3185 5.62408 40.5735 7.18083 40.5735 9.41095C40.5735 11.5542 42.1737 13.1616 44.4473 13.1616C46.033 13.1616 47.3218 12.3941 47.9445 11.1922L47.0467 10.707C46.634 11.6049 45.6348 12.2348 44.4618 12.2348C42.7892 12.2348 41.7682 10.9894 41.6669 9.7223H48.2342C48.2486 9.59197 48.2486 9.54129 48.2486 9.42544ZM44.4039 6.55089C45.8085 6.55089 46.9308 7.49942 47.1191 8.80998H41.6958C41.9203 7.5501 43.0209 6.55089 44.4039 6.55089Z",fill:"#001E6C"}),jsx("path",{d:"M55.846 7.02877C55.2161 6.13817 54.2024 5.63132 53.0149 5.63132C50.9224 5.63132 49.2425 7.21703 49.2425 9.39647C49.2425 11.5759 50.8934 13.1616 52.986 13.1616C54.1807 13.1616 55.2161 12.6403 55.8533 11.7425L55.9981 12.9878H56.9032V2.56128L55.846 2.67713V7.02877ZM53.0294 12.2276C51.5306 12.2276 50.3286 11.0401 50.3286 9.39647C50.3286 7.75284 51.5306 6.56537 53.0294 6.56537C54.5789 6.56537 55.846 7.76732 55.846 9.39647C55.846 11.0256 54.5789 12.2276 53.0294 12.2276Z",fill:"#001E6C"}),jsx("path",{d:"M65.7314 5.63132C64.5367 5.63132 63.5085 6.14541 62.8713 7.04325V2.56128L61.8142 2.67713V12.9878H62.7192L62.8641 11.7497C63.494 12.6475 64.5077 13.1616 65.7024 13.1616C67.795 13.1616 69.4748 11.5759 69.4748 9.39647C69.4748 7.21703 67.8239 5.63132 65.7314 5.63132ZM65.6879 12.2276C64.1384 12.2276 62.8713 11.0256 62.8713 9.39647C62.8713 7.76732 64.1384 6.56537 65.6879 6.56537C67.1867 6.56537 68.3887 7.75284 68.3887 9.39647C68.3887 11.0401 67.1867 12.2276 65.6879 12.2276Z",fill:"#001E6C"}),jsx("path",{d:"M76.2187 5.8051V9.9178C76.2187 11.3297 75.3136 12.1841 74.0465 12.1841C72.7866 12.1841 72.077 11.4456 72.077 10.1133V5.8051H71.0199V10.2726C71.0199 11.9669 72.1349 13.0965 73.7641 13.0965C74.843 13.0965 75.6901 12.6765 76.2187 11.9814V12.8937C76.2187 14.1608 75.2629 15.0804 73.8727 15.0804C72.7504 15.0804 71.8236 14.4794 71.5847 13.4295L70.6579 13.9074C71.0995 15.16 72.3087 16 73.8582 16C75.8132 16 77.2758 14.5953 77.2758 12.7923V5.8051H76.2187Z",fill:"#001E6C"}),jsx("path",{d:"M108.672 10.4867C108.672 11.9077 107.411 12.7873 105.491 12.7873C104.464 12.7873 103.634 12.6028 102.84 12.2091C102.914 11.76 102.982 11.2187 103 10.5913C103.738 11.0219 104.575 11.231 105.381 11.231C106.34 11.231 106.839 11.0096 106.839 10.5421C106.857 10.0807 106.5 9.87155 105.067 9.59473C103.406 9.26255 102.668 8.57359 102.668 7.35559C102.668 5.97767 103.929 5.0857 105.848 5.0857C106.697 5.0857 107.54 5.24564 108.186 5.52246L107.866 7.06647C107.226 6.7712 106.537 6.63587 105.848 6.63587C104.95 6.63587 104.507 6.85733 104.507 7.29408C104.507 7.67547 104.815 7.83541 106.217 8.12453C108.007 8.50592 108.678 9.19488 108.678 10.4744L108.672 10.4867ZM112.879 11.0957C112.16 11.0957 111.581 10.7143 111.581 9.70546V6.88808H113.408L113.747 5.25794H111.581V2.93884C111.157 3.06187 110.517 3.2095 109.681 3.28332L109.662 10.0315C109.662 11.8708 110.763 12.7996 112.412 12.7996C112.787 12.7996 113.113 12.7627 113.39 12.6951L113.753 10.9665C113.525 11.0465 113.236 11.1018 112.879 11.1018V11.0957ZM114.965 12.6889H116.884V5.25794H114.965V12.6889ZM115.93 2.21912C115.309 2.21297 114.829 2.66817 114.823 3.27102C114.823 3.89232 115.278 4.35983 115.894 4.36598C116.515 4.36598 116.976 3.92923 116.989 3.32638C117.001 2.70508 116.546 2.23142 115.937 2.21912H115.93ZM126.056 5.25794V11.5263C126.056 13.8946 124.456 15.5247 121.756 15.5247C120.784 15.5247 119.714 15.3094 118.994 14.8973C119.492 14.3867 119.831 13.9438 120.046 13.6239C120.532 13.79 121.042 13.8762 121.565 13.8762C123.275 13.8762 124.143 12.9288 124.143 11.7354V11.4955C123.534 12.1968 122.654 12.6336 121.602 12.6336C119.584 12.6336 118.065 11.1326 118.065 8.90577C118.065 6.67893 119.726 5.098 121.756 5.098C122.808 5.098 123.724 5.4794 124.333 6.19912L124.395 5.25179H126.062L126.056 5.25794ZM124.155 8.90577C124.155 7.72468 123.294 6.82657 122.107 6.82657C120.919 6.82657 120.046 7.72468 120.046 8.90577C120.046 10.0868 120.907 10.9542 122.107 10.9542C123.306 10.9542 124.155 10.0561 124.155 8.90577ZM134.994 5.25794V11.5263C134.994 13.8946 133.394 15.5247 130.694 15.5247C129.722 15.5247 128.652 15.3094 127.932 14.8973C128.43 14.3867 128.769 13.9438 128.984 13.6239C129.47 13.79 129.98 13.8762 130.503 13.8762C132.213 13.8762 133.081 12.9288 133.081 11.7354V11.4955C132.472 12.1968 131.592 12.6336 130.54 12.6336C128.523 12.6336 127.003 11.1326 127.003 8.90577C127.003 6.67893 128.664 5.098 130.694 5.098C131.746 5.098 132.662 5.4794 133.271 6.19912L133.333 5.25179H135L134.994 5.25794ZM133.093 8.90577C133.093 7.72468 132.232 6.82657 131.045 6.82657C129.857 6.82657 128.984 7.72468 128.984 8.90577C128.984 10.0868 129.845 10.9542 131.045 10.9542C132.244 10.9542 133.093 10.0561 133.093 8.90577Z",fill:"#001E6C"}),jsx("path",{d:"M95.7092 14.9825C95.6354 15.0194 94.2267 15.6407 91.7353 15.5238C90.4374 15.4623 89.3117 15.2224 88.512 15.0009L92.8241 9.99361C93.5931 10.1905 94.5835 10.375 95.7092 10.4304C98.2005 10.5534 99.6092 9.92594 99.683 9.88903L95.7092 14.9886V14.9825ZM89.2686 5.36155C88.5612 2.96863 88.838 1.45537 88.8564 1.3754L84.8457 6.44421C84.8334 6.52418 84.5566 8.03744 85.2578 10.4304C85.6269 11.673 86.1252 12.7126 86.5312 13.4384L90.3759 8.0682C90.0068 7.36693 89.5885 6.44421 89.2686 5.3677V5.36155ZM99.2647 5.89058C98.6988 3.97132 97.813 2.55033 97.4501 2.009L93.8822 6.55494L94.5527 9.77216C94.9526 9.82752 95.3462 9.86443 95.7461 9.88903C95.9491 9.89518 96.1521 9.90134 96.3489 9.90134C98.2805 9.90134 99.357 9.44613 99.4739 9.39076L99.7507 9.26773C99.7753 8.60338 99.7322 7.42844 99.2709 5.88443L99.2647 5.89058ZM97.0256 1.68297C96.4166 1.45537 94.8295 0.932493 92.8303 0.83407C91.2248 0.754101 90.0744 0.987856 89.4347 1.1724L89.3793 1.46767C89.367 1.52919 89.121 2.96248 89.7792 5.20777C89.8899 5.58916 90.0252 5.9644 90.1729 6.33964L93.4577 6.22891L97.0318 1.68912L97.0256 1.68297Z",fill:"#001E6C"})]})),Ih=TP;var El="stigg-watermark",wP=x(Ih)`
268
+ `;function RP({discount:e,disabled:t}){return jsxs(P,{variant:"h6",color:t?"disabled":"primary",className:"stigg-discount-rate-text",children:[e,"% off"]})}function Bm({discountRate:e,selectedBillingPeriod:t,onBillingPeriodChanged:o,availableBillingPeriods:n}){if(n.length<=1)return null;let i=t===BillingPeriod.Monthly;return jsxs(LP,{className:"stigg-period-picker-container",children:[jsx(Lm,{variant:"h6",className:"stigg-monthly-period-text",color:i?"primary":"disabled",children:"Monthly"}),jsx(BP,{className:"stigg-period-switch",uncheckedIcon:false,checkedIcon:false,height:16,width:33,onChange:r=>o(r?BillingPeriod.Annually:BillingPeriod.Monthly),checked:!i,borderRadius:10,handleDiameter:19}),jsx(Lm,{variant:"h6",className:"stigg-annual-period-text",color:i?"disabled":"primary",children:"Annual"}),e!==0&&jsx(RP,{discount:e,disabled:i})]})}function DP(e,t){if(!_r(e)&&!_r(t)){let o=t/12;return Math.round((e-o)/e*100)}return null}function Um(e,t){var n;let o;if(o=(n=e.paywallCalculatedPricePoints)==null?void 0:n.find(i=>i.billingPeriod===t),o||(o=e.pricePoints.find(i=>i.billingPeriod===t)),!(o!=null&&o.amount)){let i=e.pricePoints.find(r=>r.isTieredPrice&&r.billingPeriod===t);if(i)return Cn(i,1)}return o==null?void 0:o.amount}function Om(e){return e.reduce((t,o)=>{let n=Um(o,BillingPeriod.Monthly),i=Um(o,BillingPeriod.Annually),r=DP(n,i);return r&&(t=Math.max(t,r)),t},0)}var NP=e=>jsxs("svg",A(S({width:135,height:16,viewBox:"0 0 135 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("path",{d:"M0.0987549 3.43016V12.9878H1.15589V9.52681H3.96527C5.94922 9.52681 7.28874 8.25245 7.28874 6.47848C7.28874 4.70452 5.94922 3.43016 3.96527 3.43016H0.0987549ZM1.15589 8.55656V4.40765H4.04492C5.33376 4.40765 6.18816 5.26205 6.18816 6.47848C6.18816 7.69492 5.33376 8.55656 4.04492 8.55656H1.15589Z",fill:"#001E6C"}),jsx("path",{d:"M11.7787 13.1616C13.9075 13.1616 15.6525 11.5397 15.6525 9.38199C15.6525 7.21703 13.9365 5.62408 11.8077 5.62408C9.64999 5.62408 7.93395 7.24599 7.93395 9.41095C7.93395 11.5687 9.62103 13.1616 11.7787 13.1616ZM11.7932 12.2276C10.2365 12.2276 9.02005 11.0256 9.02005 9.39647C9.02005 7.76732 10.2365 6.56537 11.7932 6.56537C13.321 6.56537 14.5664 7.76732 14.5664 9.39647C14.5664 11.0256 13.321 12.2276 11.7932 12.2276Z",fill:"#001E6C"}),jsx("path",{d:"M19.9054 12.9878L21.4766 6.94189H21.5056L23.0623 12.9878H24.4018L26.5958 5.8051H25.4155L23.7936 11.909H23.7647L22.2152 5.8051H20.7815L19.232 11.909H19.203L17.5522 5.8051H16.3575L18.5659 12.9878H19.9054Z",fill:"#001E6C"}),jsx("path",{d:"M34.9835 9.42544C34.9835 7.30392 33.4051 5.62408 31.1532 5.62408C29.0534 5.62408 27.3084 7.18083 27.3084 9.41095C27.3084 11.5542 28.9086 13.1616 31.1822 13.1616C32.7679 13.1616 34.0567 12.3941 34.6794 11.1922L33.7816 10.707C33.3688 11.6049 32.3696 12.2348 31.1966 12.2348C29.5241 12.2348 28.5031 10.9894 28.4017 9.7223H34.969C34.9835 9.59197 34.9835 9.54129 34.9835 9.42544ZM31.1387 6.55089C32.5434 6.55089 33.6657 7.49942 33.854 8.80998H28.4307C28.6552 7.5501 29.7558 6.55089 31.1387 6.55089Z",fill:"#001E6C"}),jsx("path",{d:"M39.5922 5.68201C38.564 5.68201 37.8182 6.20334 37.4924 6.93464L37.391 5.8051H36.486V12.9878H37.5431V8.5638C37.5431 7.44873 38.1585 6.77535 39.3171 6.77535H39.9977V5.68201H39.5922Z",fill:"#001E6C"}),jsx("path",{d:"M48.2486 9.42544C48.2486 7.30392 46.6702 5.62408 44.4183 5.62408C42.3185 5.62408 40.5735 7.18083 40.5735 9.41095C40.5735 11.5542 42.1737 13.1616 44.4473 13.1616C46.033 13.1616 47.3218 12.3941 47.9445 11.1922L47.0467 10.707C46.634 11.6049 45.6348 12.2348 44.4618 12.2348C42.7892 12.2348 41.7682 10.9894 41.6669 9.7223H48.2342C48.2486 9.59197 48.2486 9.54129 48.2486 9.42544ZM44.4039 6.55089C45.8085 6.55089 46.9308 7.49942 47.1191 8.80998H41.6958C41.9203 7.5501 43.0209 6.55089 44.4039 6.55089Z",fill:"#001E6C"}),jsx("path",{d:"M55.846 7.02877C55.2161 6.13817 54.2024 5.63132 53.0149 5.63132C50.9224 5.63132 49.2425 7.21703 49.2425 9.39647C49.2425 11.5759 50.8934 13.1616 52.986 13.1616C54.1807 13.1616 55.2161 12.6403 55.8533 11.7425L55.9981 12.9878H56.9032V2.56128L55.846 2.67713V7.02877ZM53.0294 12.2276C51.5306 12.2276 50.3286 11.0401 50.3286 9.39647C50.3286 7.75284 51.5306 6.56537 53.0294 6.56537C54.5789 6.56537 55.846 7.76732 55.846 9.39647C55.846 11.0256 54.5789 12.2276 53.0294 12.2276Z",fill:"#001E6C"}),jsx("path",{d:"M65.7314 5.63132C64.5367 5.63132 63.5085 6.14541 62.8713 7.04325V2.56128L61.8142 2.67713V12.9878H62.7192L62.8641 11.7497C63.494 12.6475 64.5077 13.1616 65.7024 13.1616C67.795 13.1616 69.4748 11.5759 69.4748 9.39647C69.4748 7.21703 67.8239 5.63132 65.7314 5.63132ZM65.6879 12.2276C64.1384 12.2276 62.8713 11.0256 62.8713 9.39647C62.8713 7.76732 64.1384 6.56537 65.6879 6.56537C67.1867 6.56537 68.3887 7.75284 68.3887 9.39647C68.3887 11.0401 67.1867 12.2276 65.6879 12.2276Z",fill:"#001E6C"}),jsx("path",{d:"M76.2187 5.8051V9.9178C76.2187 11.3297 75.3136 12.1841 74.0465 12.1841C72.7866 12.1841 72.077 11.4456 72.077 10.1133V5.8051H71.0199V10.2726C71.0199 11.9669 72.1349 13.0965 73.7641 13.0965C74.843 13.0965 75.6901 12.6765 76.2187 11.9814V12.8937C76.2187 14.1608 75.2629 15.0804 73.8727 15.0804C72.7504 15.0804 71.8236 14.4794 71.5847 13.4295L70.6579 13.9074C71.0995 15.16 72.3087 16 73.8582 16C75.8132 16 77.2758 14.5953 77.2758 12.7923V5.8051H76.2187Z",fill:"#001E6C"}),jsx("path",{d:"M108.672 10.4867C108.672 11.9077 107.411 12.7873 105.491 12.7873C104.464 12.7873 103.634 12.6028 102.84 12.2091C102.914 11.76 102.982 11.2187 103 10.5913C103.738 11.0219 104.575 11.231 105.381 11.231C106.34 11.231 106.839 11.0096 106.839 10.5421C106.857 10.0807 106.5 9.87155 105.067 9.59473C103.406 9.26255 102.668 8.57359 102.668 7.35559C102.668 5.97767 103.929 5.0857 105.848 5.0857C106.697 5.0857 107.54 5.24564 108.186 5.52246L107.866 7.06647C107.226 6.7712 106.537 6.63587 105.848 6.63587C104.95 6.63587 104.507 6.85733 104.507 7.29408C104.507 7.67547 104.815 7.83541 106.217 8.12453C108.007 8.50592 108.678 9.19488 108.678 10.4744L108.672 10.4867ZM112.879 11.0957C112.16 11.0957 111.581 10.7143 111.581 9.70546V6.88808H113.408L113.747 5.25794H111.581V2.93884C111.157 3.06187 110.517 3.2095 109.681 3.28332L109.662 10.0315C109.662 11.8708 110.763 12.7996 112.412 12.7996C112.787 12.7996 113.113 12.7627 113.39 12.6951L113.753 10.9665C113.525 11.0465 113.236 11.1018 112.879 11.1018V11.0957ZM114.965 12.6889H116.884V5.25794H114.965V12.6889ZM115.93 2.21912C115.309 2.21297 114.829 2.66817 114.823 3.27102C114.823 3.89232 115.278 4.35983 115.894 4.36598C116.515 4.36598 116.976 3.92923 116.989 3.32638C117.001 2.70508 116.546 2.23142 115.937 2.21912H115.93ZM126.056 5.25794V11.5263C126.056 13.8946 124.456 15.5247 121.756 15.5247C120.784 15.5247 119.714 15.3094 118.994 14.8973C119.492 14.3867 119.831 13.9438 120.046 13.6239C120.532 13.79 121.042 13.8762 121.565 13.8762C123.275 13.8762 124.143 12.9288 124.143 11.7354V11.4955C123.534 12.1968 122.654 12.6336 121.602 12.6336C119.584 12.6336 118.065 11.1326 118.065 8.90577C118.065 6.67893 119.726 5.098 121.756 5.098C122.808 5.098 123.724 5.4794 124.333 6.19912L124.395 5.25179H126.062L126.056 5.25794ZM124.155 8.90577C124.155 7.72468 123.294 6.82657 122.107 6.82657C120.919 6.82657 120.046 7.72468 120.046 8.90577C120.046 10.0868 120.907 10.9542 122.107 10.9542C123.306 10.9542 124.155 10.0561 124.155 8.90577ZM134.994 5.25794V11.5263C134.994 13.8946 133.394 15.5247 130.694 15.5247C129.722 15.5247 128.652 15.3094 127.932 14.8973C128.43 14.3867 128.769 13.9438 128.984 13.6239C129.47 13.79 129.98 13.8762 130.503 13.8762C132.213 13.8762 133.081 12.9288 133.081 11.7354V11.4955C132.472 12.1968 131.592 12.6336 130.54 12.6336C128.523 12.6336 127.003 11.1326 127.003 8.90577C127.003 6.67893 128.664 5.098 130.694 5.098C131.746 5.098 132.662 5.4794 133.271 6.19912L133.333 5.25179H135L134.994 5.25794ZM133.093 8.90577C133.093 7.72468 132.232 6.82657 131.045 6.82657C129.857 6.82657 128.984 7.72468 128.984 8.90577C128.984 10.0868 129.845 10.9542 131.045 10.9542C132.244 10.9542 133.093 10.0561 133.093 8.90577Z",fill:"#001E6C"}),jsx("path",{d:"M95.7092 14.9825C95.6354 15.0194 94.2267 15.6407 91.7353 15.5238C90.4374 15.4623 89.3117 15.2224 88.512 15.0009L92.8241 9.99361C93.5931 10.1905 94.5835 10.375 95.7092 10.4304C98.2005 10.5534 99.6092 9.92594 99.683 9.88903L95.7092 14.9886V14.9825ZM89.2686 5.36155C88.5612 2.96863 88.838 1.45537 88.8564 1.3754L84.8457 6.44421C84.8334 6.52418 84.5566 8.03744 85.2578 10.4304C85.6269 11.673 86.1252 12.7126 86.5312 13.4384L90.3759 8.0682C90.0068 7.36693 89.5885 6.44421 89.2686 5.3677V5.36155ZM99.2647 5.89058C98.6988 3.97132 97.813 2.55033 97.4501 2.009L93.8822 6.55494L94.5527 9.77216C94.9526 9.82752 95.3462 9.86443 95.7461 9.88903C95.9491 9.89518 96.1521 9.90134 96.3489 9.90134C98.2805 9.90134 99.357 9.44613 99.4739 9.39076L99.7507 9.26773C99.7753 8.60338 99.7322 7.42844 99.2709 5.88443L99.2647 5.89058ZM97.0256 1.68297C96.4166 1.45537 94.8295 0.932493 92.8303 0.83407C91.2248 0.754101 90.0744 0.987856 89.4347 1.1724L89.3793 1.46767C89.367 1.52919 89.121 2.96248 89.7792 5.20777C89.8899 5.58916 90.0252 5.9644 90.1729 6.33964L93.4577 6.22891L97.0318 1.68912L97.0256 1.68297Z",fill:"#001E6C"})]})),zm=NP;var Vl="stigg-watermark",OP=y(zm)`
269
269
  * {
270
270
  fill: ${({theme:e})=>e.stigg.palette.text.secondary};
271
271
  }
272
- `,vP=x.div`
272
+ `,zP=y.div`
273
273
  align-self: ${({$alignSelf:e})=>e||"unset"};
274
274
 
275
275
  @media (max-width: 1040px) {
276
276
  ${({$smallScreenAlign:e})=>e&&`align-self: ${e};`}
277
277
  }
278
- `;function Jt({source:e,showWatermark:t,align:o,smallScreenAlign:n="center",style:i={}}){if(!t)return null;let r=()=>{let a=window.location.hostname.replace("www.","");window.open(`https://www.stigg.io/?utm_source=${a}&utm_medium=referral&utm_campaign=${e}`,"_blank");};return jsx(vP,{$alignSelf:o,$smallScreenAlign:n,className:El,style:S({cursor:"pointer"},i),onClick:r,children:jsx(wP,{})})}function Fl(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function Rl(e,t){return e.some(o=>Fl(o,t))}function Bh(e,t,o){return e.filter(n=>n.pricingType!==PricingType.Paid||Fl(n,t)).filter(n=>!o||!o({plan:n}))}var IP=x.div`
278
+ `;function Jt({source:e,showWatermark:t,align:o,smallScreenAlign:n="center",style:i={}}){if(!t)return null;let r=()=>{let a=window.location.hostname.replace("www.","");window.open(`https://www.stigg.io/?utm_source=${a}&utm_medium=referral&utm_campaign=${e}`,"_blank");};return jsx(zP,{$alignSelf:o,$smallScreenAlign:n,className:Vl,style:S({cursor:"pointer"},i),onClick:r,children:jsx(OP,{})})}function $l(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function Hl(e,t){return e.some(o=>$l(o,t))}function $m(e,t,o){return e.filter(n=>n.pricingType!==PricingType.Paid||$l(n,t)).filter(n=>!o||!o({plan:n}))}var WP=y.div`
279
279
  color: ${({theme:e})=>e.stigg.palette.text.primary};
280
280
  display: flex;
281
281
  align-items: stretch;
@@ -283,7 +283,7 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
283
283
  flex-wrap: wrap;
284
284
  padding: 10px 0;
285
285
  gap: ${({theme:e})=>e.stigg.layout.planMargin};
286
- `,LP=x.div`
286
+ `,GP=y.div`
287
287
  display: flex;
288
288
  flex-direction: column;
289
289
  align-items: center;
@@ -291,17 +291,17 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
291
291
  & * {
292
292
  box-sizing: border-box;
293
293
  }
294
- `,BP=x.div`
294
+ `,jP=y.div`
295
295
  display: flex;
296
296
  flex-direction: column;
297
297
  align-items: center;
298
- `,Fh=({plans:e,customer:t,currentSubscription:o,highlightedPlanId:n,selectedBillingPeriod:i,onBillingPeriodChanged:r,availableBillingPeriods:a,isCustomerOnTrial:s,onPlanSelected:l,paywallLocale:c,locale:d,shouldHidePlan:u,selectDefaultTierIndex:p,currentSubscriptionOverride:m,hideCompatibleAddons:h,showWatermark:f})=>{let g=Mh(e),y=e.some(L=>!!L.description),P=Rl(e,BillingPeriod.Monthly),T=Rl(e,BillingPeriod.Annually),k=Bh(e,i,u),w=useCallback((L,E,O)=>l({plan:L,customer:t,subscription:o,intentionType:E,selectedBillingPeriod:i,billableFeatures:O}),[t,i,o,l]),v=!!o&&o.plan.pricingType===PricingType.Custom,A=useMemo(()=>k.some(L=>{var N;let E=L.pricePoints.filter(F=>F.billingPeriod===i),O=(N=L.paywallCalculatedPricePoints)==null?void 0:N.find(F=>F.billingPeriod===i);return E.length>1&&!!(O!=null&&O.additionalChargesMayApply)}),[i,k]),M=useMemo(()=>k.some(L=>!!Ar(L,i,c,d,P).unit),[i,P,d,c,k]),I=useMemo(()=>!v&&k.some(L=>{let E=_r({plan:L,billingPeriod:i,currentSubscription:o,currentSubscriptionOverride:m});return Object.values(E).length>0}),[i,o,m,v,k]),B=k.some(L=>L.isCurrentCustomerPlan&&L.trialDaysLeft);return jsx(LP,{className:"stigg-paywall-container",children:jsxs(BP,{className:"stigg-paywall-layout",children:[jsx(kh,{onBillingPeriodChanged:r,selectedBillingPeriod:i,availableBillingPeriods:a,discountRate:g}),jsx(IP,{className:"stigg-paywall-plans-layout",children:k.map(L=>jsx(Sh,{withUnitPriceRow:M,withTiersRow:I,withTrialLeftRow:B,shouldShowDescriptionSection:y,hasMonthlyPrice:P,hasAnnuallyPrice:T,plan:L,withStartingAtRow:A,currentSubscription:o,currentSubscriptionOverride:m,billingPeriod:i,isHighlighted:L.id===n,isCustomerOnTrial:s,onPlanSelected:(E,O)=>w(L,E,O),paywallLocale:c,locale:d,customer:t,isCustomerInCustomPlan:v,selectDefaultTierIndex:p,hideCompatibleAddons:h},L.id))}),jsx(Jt,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:f})]})})};var Nl=class{error(t,o,...n){console.error(t,o||{},n);}log(t,o){console.log(t,o||{});}debug(t,o){console.debug(t,o||{});}},no=new Nl;function Rh(e,t,o){let n=e.flatMap(s=>s.pricePoints).map(s=>s.billingPeriod),i=countBy(n),r=uniq(n),a;if(o&&r.includes(o))a=o;else if(t){let s=t.find(l=>l.status===SubscriptionStatus.Active);s&&s.prices.length>0&&(a=s==null?void 0:s.prices[0].billingPeriod);}return a||(a=(i[BillingPeriod.Monthly]||0)>(i[BillingPeriod.Annually]||0)?BillingPeriod.Monthly:BillingPeriod.Annually),{defaultBillingPeriod:a,availableBillingPeriods:r}}function Nh(e){return Xc.utc(e).diff(Xc.utc(),"days",false)+1}var Br={h1:{fontSize:"24px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"16px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"}};function io(e,t="px"){if(e)return `${e}${t}`}function Er(e){if(!e)return "normal";switch(e){case FontWeight.Normal:return "normal";case FontWeight.Bold:return "bold";default:return "normal"}}function Pi(e,t){var n,i,r,a,s,l,c,d;let o=t||{h1:{fontSize:"32px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"24px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"}};return {fontFamilyUrl:(e==null?void 0:e.fontFamily)||void 0,h1:{fontSize:io((n=e==null?void 0:e.h1)==null?void 0:n.fontSize)||o.h1.fontSize,fontWeight:Er((i=e==null?void 0:e.h1)==null?void 0:i.fontWeight)||o.h1.fontWeight,semanticElement:o.h1.semanticElement},h2:{fontSize:io((r=e==null?void 0:e.h2)==null?void 0:r.fontSize)||o.h2.fontSize,fontWeight:Er((a=e==null?void 0:e.h2)==null?void 0:a.fontWeight)||o.h2.fontWeight,semanticElement:o.h2.semanticElement},h3:{fontSize:io((s=e==null?void 0:e.h3)==null?void 0:s.fontSize)||o.h3.fontSize,fontWeight:Er((l=e==null?void 0:e.h3)==null?void 0:l.fontWeight)||o.h3.fontWeight,semanticElement:o.h3.semanticElement},body:{fontSize:io((c=e==null?void 0:e.body)==null?void 0:c.fontSize)||o.body.fontSize,fontWeight:Er((d=e==null?void 0:e.body)==null?void 0:d.fontWeight)||o.body.fontWeight,semanticElement:o.body.semanticElement}}}function Ul(e){if(e)switch(e){case Alignment.Left:return "left";case Alignment.Center:return "center";case Alignment.Right:return "right";default:return}}function Uh(e){let{palette:t,customCss:o,typography:n}=e;return {palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.paywallBackgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,backgroundHighlight:(t==null?void 0:t.currentPlanBackground)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0}},typography:Pi(n),customCss:o||void 0}}function zh(e){let{palette:t,layout:o,customCss:n,typography:i}=e;return {customCss:n||void 0,palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.backgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,backgroundHighlight:(t==null?void 0:t.currentPlanBackground)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0}},typography:Pi(i),layout:{ctaAlignment:Ul(o==null?void 0:o.alignment),headerAlignment:Ul(o==null?void 0:o.alignment),descriptionAlignment:Ul(o==null?void 0:o.alignment),planMaxWidth:io(o==null?void 0:o.planWidth),planMinWidth:io(o==null?void 0:o.planWidth),planMargin:io(o==null?void 0:o.planMargin),planPadding:io(o==null?void 0:o.planPadding)}}}function $h(e){let{palette:t,typography:o,customCss:n}=e;return {palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.backgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0},backgroundHighlight:(t==null?void 0:t.summaryBackgroundColor)||void 0},typography:Pi(o,Br),customCss:n||void 0}}function OP(e){let t=true,o=(e==null?void 0:e.find(r=>r.status===SubscriptionStatus.InTrial))||null,n=o==null?void 0:o.plan,i=o!=null&&o.trialEndDate?Nh(o.trialEndDate):void 0;return n||(t=false,o=(e==null?void 0:e.find(r=>r.status===SubscriptionStatus.Active))||null,n=o==null?void 0:o.plan),{currentSubscription:o,currentPlan:n,isCustomerOnTrial:t,trialDaysLeft:i}}function Gh(e,t,o){var k,w;let{plans:n,currency:i,configuration:r,customer:a,activeSubscriptions:s,paywallCalculatedPricePoints:l}=e||{},{currentSubscription:c,currentPlan:d,isCustomerOnTrial:u,trialDaysLeft:p}=OP(s),m=o==null?void 0:o({currentSubscription:c}),h=(c==null?void 0:c.scheduledUpdates)||[],f=(k=c==null?void 0:c.price)==null?void 0:k.billingPeriod,g=h.find(({subscriptionScheduleType:v})=>v===SubscriptionScheduleType.Downgrade),y=h.find(({subscriptionScheduleType:v})=>v===SubscriptionScheduleType.BillingPeriod),P=If(n,v=>v.order).map(v=>{var B;let A=(B=a==null?void 0:a.eligibleForTrial)==null?void 0:B.find(L=>L.productId===v.product.id),M=m!=null&&m.planId?(m==null?void 0:m.planId)===v.id:v.id===(d==null?void 0:d.id),I=L=>{var F;let E=g==null?void 0:g.scheduleVariables,O=y==null?void 0:y.scheduleVariables,N=v.pricePoints.some($=>$.billingPeriod===L);return g?((F=g.targetPackage)==null?void 0:F.refId)===v.id&&(!N||E.billingPeriod===L):y&&M?O.billingPeriod===L:false};return _(S({},v),{paywallCalculatedPricePoints:l==null?void 0:l.filter(L=>L.planId===v.id),isTriable:!vr(v.defaultTrialConfig)&&(!A||A.eligible),isCurrentCustomerPlan:M,currentCustomerPlanBillingPeriod:f,isUpcomingPlan:false,trialDaysLeft:p,isNextPlan:I,paywallCurrency:i,scheduledUpdate:g||y})});if(n&&d){let v=d&&((w=n==null?void 0:n.find(A=>A.id===(d==null?void 0:d.id)))==null?void 0:w.order);vr(v)||(P=P.map(A=>_(S({},A),{isLowerThanCurrentPlan:v>A.order})),t&&(P=P.filter(A=>A.order>=v)));}let T=r?zh(r):void 0;return {currentPlan:d,currentSubscription:c,currentSubscriptionOverride:m,isCustomerOnTrial:u,plans:P,paywallConfiguration:T}}var Yh="7.24.1";var Zh="@stigg/react-sdk";var Si=xc.createContext(null);Si.displayName="StiggContext";var HP="en-US",WP=({apiKey:e,baseUri:t,baseEdgeUri:o,enableEdge:n,customerId:i,customerToken:r,resourceId:a,theme:s,locale:l,cacheTtlMs:c,useEntitlementPolling:d,entitlementPollingInterval:u,entitlementsFallback:p,stiggClient:m,children:h,offline:f,clientName:g=Zh,clientVersion:y=Yh})=>{let P=useRef(e),T={apiKey:e,customerId:i,customerToken:r,resourceId:a,baseUri:t,baseEdgeUri:o,enableEdge:n,entitlementsFallback:p,cacheTtlMs:c,useEntitlementPolling:d,entitlementPollingInterval:u,clientName:g,clientVersion:y,offline:f},[k,w]=useState(()=>({stigg:m!=null?m:Xh__default.initialize(_(S({},T),{lazyLoad:true})),locale:l||HP,isInitialized:false,theme:s,refreshData:()=>R(null,null,function*(){w(v=>_(S({},v),{customerPortalUpdatedAt:new Date})),yield k.stigg.refresh();})}));return useEffect(()=>{let v=true,A=L=>{v&&w(L);},M=()=>A(L=>_(S({},L),{updatedAt:new Date})),I=L=>A(E=>(E.stigg&&E.stigg.removeListener("entitlementsUpdated",M),L.addListener("entitlementsUpdated",M),_(S({},E),{stigg:L,isInitialized:true,updatedAt:new Date})));return R(null,null,function*(){let L=k.stigg;e!==P.current&&(no.log("Updating stigg client",{apiKey:e}),P.current=e,L=Xh__default.initialize(S({},T)),A(E=>_(S({},E),{isInitialized:false,updatedAt:new Date}))),yield L.waitForInitialization(),I(L);}),()=>{v=false,k.stigg.removeListener("entitlementsUpdated",M),k.stigg.clearCustomer();}},[e]),useEffect(()=>{let v=k.stigg;i?v.setCustomerId(i,r,a):v.clearCustomer();},[i,r,a]),useEffect(()=>{w(v=>_(S({},v),{theme:s}));},[s]),jsx(Si.Provider,{value:k,children:jsx(SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea",children:h})})};function D(e){let{optional:t}=e||{},o=useContext(Si);if(!o&&!t)throw new Error("Could not find Stigg context; You need to wrap your app in an <StiggProvider> component.");return o}function qh({productId:e,resourceId:t,showOnlyEligiblePlans:o,billingCountryCode:n,preferredBillingPeriod:i,currentSubscriptionOverrideFn:r}){let{stigg:a,locale:s}=D(),[l,c]=useState(BillingPeriod.Annually),[d,u]=useState([]),[p,m]=useState(null),[h,f]=useState(true);useEffect(()=>{R(null,null,function*(){try{f(!0),yield a.waitForInitialization();let P=yield a.getPaywall({productId:e,resourceId:t,billingCountryCode:n}),{availableBillingPeriods:T,defaultBillingPeriod:k}=Rh(P.plans,P.activeSubscriptions,i);m(P),u(T),c(k);}catch(P){no.error(`Failed to load paywall ${P==null?void 0:P.message}`,P);}finally{f(false);}});},[a,e,a.isCustomerLoaded,n,t,i]);let g=Gh(p,o,r);return S({customer:(p==null?void 0:p.customer)||null,isLoading:h,selectedBillingPeriod:l,setSelectedBillingPeriod:c,availableBillingPeriods:d,locale:s,configuration:g.paywallConfiguration,showWatermark:a.getShowWatermark()},g)}function Jh(e){return e2({highlightChip:"Recommended",addonsTitle:"Available add-ons:",planCTAButton:{upgrade:"Upgrade",downgrade:"Downgrade",startTrial:o=>{var n;return `Start ${(n=o.defaultTrialConfig)==null?void 0:n.duration} day trial`},custom:"Contact us",currentPlan:"Current plan",startNew:"Get started",switchToBillingPeriod:o=>o===BillingPeriod.Monthly?"Switch to monthly billing":"Switch to annual billing",cancelScheduledUpdate:"Cancel"},price:{startingAtCaption:"Starts at",pricePeriod:o=>o===BillingPeriod.Monthly?"/ month":"/ year",free:o=>({price:`${o==null?void 0:o.symbol}0`}),custom:"Custom",priceNotSet:"Price not set"}},e)}var XP=e=>jsx("svg",_(S({width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{d:"M5.59 7.9899L2.125 4.5249C1.73524 4.13514 1.10365 4.13402 0.712509 4.52241V4.52241C0.319409 4.91274 0.318286 5.54819 0.710005 5.9399L5.59 10.8199L14.2948 2.11513C14.6843 1.72565 14.6843 1.09417 14.2948 0.704691V0.704691C13.9055 0.315381 13.2743 0.315184 12.8848 0.70425L5.59 7.9899Z",fill:"#B2BBD3"})})),em=XP;var KP=x.div`
298
+ `,Wm=({plans:e,customer:t,currentSubscription:o,highlightedPlanId:n,selectedBillingPeriod:i,onBillingPeriodChanged:r,availableBillingPeriods:a,isCustomerOnTrial:s,onPlanSelected:l,paywallLocale:c,locale:d,shouldHidePlan:u,selectDefaultTierIndex:p,currentSubscriptionOverride:h,hideCompatibleAddons:m,showWatermark:g})=>{let f=Om(e),x=e.some(E=>!!E.description),b=Hl(e,BillingPeriod.Monthly),T=Hl(e,BillingPeriod.Annually),k=$m(e,i,u),w=useCallback((E,B,O)=>l({plan:E,customer:t,subscription:o,intentionType:B,selectedBillingPeriod:i,billableFeatures:O}),[t,i,o,l]),v=!!o&&o.plan.pricingType===PricingType.Custom,_=useMemo(()=>k.some(E=>{var U;let B=E.pricePoints.filter(L=>L.billingPeriod===i),O=(U=E.paywallCalculatedPricePoints)==null?void 0:U.find(L=>L.billingPeriod===i);return B.length>1&&!!(O!=null&&O.additionalChargesMayApply)}),[i,k]),M=useMemo(()=>k.some(E=>!!Mr(E,i,c,d,b).unit),[i,b,d,c,k]),I=useMemo(()=>!v&&k.some(E=>{let B=Ar({plan:E,billingPeriod:i,currentSubscription:o,currentSubscriptionOverride:h});return Object.values(B).length>0}),[i,o,h,v,k]),F=k.some(E=>E.isCurrentCustomerPlan&&E.trialDaysLeft);return jsx(GP,{className:"stigg-paywall-container",children:jsxs(jP,{className:"stigg-paywall-layout",children:[jsx(Bm,{onBillingPeriodChanged:r,selectedBillingPeriod:i,availableBillingPeriods:a,discountRate:f}),jsx(WP,{className:"stigg-paywall-plans-layout",children:k.map(E=>jsx(Fm,{withUnitPriceRow:M,withTiersRow:I,withTrialLeftRow:F,shouldShowDescriptionSection:x,hasMonthlyPrice:b,hasAnnuallyPrice:T,plan:E,withStartingAtRow:_,currentSubscription:o,currentSubscriptionOverride:h,billingPeriod:i,isHighlighted:E.id===n,isCustomerOnTrial:s,onPlanSelected:(B,O)=>w(E,B,O),paywallLocale:c,locale:d,customer:t,isCustomerInCustomPlan:v,selectDefaultTierIndex:p,hideCompatibleAddons:m},E.id))}),jsx(Jt,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:g})]})})};var Gl=class{error(t,o,...n){console.error(t,o||{},n);}log(t,o){console.log(t,o||{});}debug(t,o){console.debug(t,o||{});}},no=new Gl;function Gm(e,t,o){let n=e.flatMap(s=>s.pricePoints).map(s=>s.billingPeriod),i=countBy(n),r=uniq(n),a;if(o&&r.includes(o))a=o;else if(t){let s=t.find(l=>l.status===SubscriptionStatus.Active);s&&s.prices.length>0&&(a=s==null?void 0:s.prices[0].billingPeriod);}return a||(a=(i[BillingPeriod.Monthly]||0)>(i[BillingPeriod.Annually]||0)?BillingPeriod.Monthly:BillingPeriod.Annually),{defaultBillingPeriod:a,availableBillingPeriods:r}}function Ym(e){return rd.utc(e).diff(rd.utc(),"days",false)+1}var Lr={h1:{fontSize:"24px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"16px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"}};function io(e,t="px"){if(e)return `${e}${t}`}function Br(e){if(!e)return "normal";switch(e){case FontWeight.Normal:return "normal";case FontWeight.Bold:return "bold";default:return "normal"}}function Pi(e,t){var n,i,r,a,s,l,c,d;let o=t||{h1:{fontSize:"32px",fontWeight:"bold",semanticElement:"h1"},h2:{fontSize:"24px",fontWeight:"normal",semanticElement:"h2"},h3:{fontSize:"16px",fontWeight:"normal",semanticElement:"h3"},body:{fontSize:"14px",fontWeight:"normal",semanticElement:"p"}};return {fontFamilyUrl:(e==null?void 0:e.fontFamily)||void 0,h1:{fontSize:io((n=e==null?void 0:e.h1)==null?void 0:n.fontSize)||o.h1.fontSize,fontWeight:Br((i=e==null?void 0:e.h1)==null?void 0:i.fontWeight)||o.h1.fontWeight,semanticElement:o.h1.semanticElement},h2:{fontSize:io((r=e==null?void 0:e.h2)==null?void 0:r.fontSize)||o.h2.fontSize,fontWeight:Br((a=e==null?void 0:e.h2)==null?void 0:a.fontWeight)||o.h2.fontWeight,semanticElement:o.h2.semanticElement},h3:{fontSize:io((s=e==null?void 0:e.h3)==null?void 0:s.fontSize)||o.h3.fontSize,fontWeight:Br((l=e==null?void 0:e.h3)==null?void 0:l.fontWeight)||o.h3.fontWeight,semanticElement:o.h3.semanticElement},body:{fontSize:io((c=e==null?void 0:e.body)==null?void 0:c.fontSize)||o.body.fontSize,fontWeight:Br((d=e==null?void 0:e.body)==null?void 0:d.fontWeight)||o.body.fontWeight,semanticElement:o.body.semanticElement}}}function Yl(e){if(e)switch(e){case Alignment.Left:return "left";case Alignment.Center:return "center";case Alignment.Right:return "right";default:return}}function Xm(e){let{palette:t,customCss:o,typography:n}=e;return {palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.paywallBackgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,backgroundHighlight:(t==null?void 0:t.currentPlanBackground)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0}},typography:Pi(n),customCss:o||void 0}}function Km(e){let{palette:t,layout:o,customCss:n,typography:i}=e;return {customCss:n||void 0,palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.backgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,backgroundHighlight:(t==null?void 0:t.currentPlanBackground)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0}},typography:Pi(i),layout:{ctaAlignment:Yl(o==null?void 0:o.alignment),headerAlignment:Yl(o==null?void 0:o.alignment),descriptionAlignment:Yl(o==null?void 0:o.alignment),planMaxWidth:io(o==null?void 0:o.planWidth),planMinWidth:io(o==null?void 0:o.planWidth),planMargin:io(o==null?void 0:o.planMargin),planPadding:io(o==null?void 0:o.planPadding)}}}function qm(e){let{palette:t,typography:o,customCss:n}=e;return {palette:{primary:(t==null?void 0:t.primary)||void 0,backgroundPaper:(t==null?void 0:t.backgroundColor)||void 0,outlinedBorder:(t==null?void 0:t.borderColor)||void 0,text:{primary:(t==null?void 0:t.textColor)||void 0},backgroundHighlight:(t==null?void 0:t.summaryBackgroundColor)||void 0},typography:Pi(o,Lr),customCss:n||void 0}}function QP(e){let t=true,o=(e==null?void 0:e.find(r=>r.status===SubscriptionStatus.InTrial))||null,n=o==null?void 0:o.plan,i=o!=null&&o.trialEndDate?Ym(o.trialEndDate):void 0;return n||(t=false,o=(e==null?void 0:e.find(r=>r.status===SubscriptionStatus.Active))||null,n=o==null?void 0:o.plan),{currentSubscription:o,currentPlan:n,isCustomerOnTrial:t,trialDaysLeft:i}}function eh(e,t,o){var k,w;let{plans:n,currency:i,configuration:r,customer:a,activeSubscriptions:s,paywallCalculatedPricePoints:l}=e||{},{currentSubscription:c,currentPlan:d,isCustomerOnTrial:u,trialDaysLeft:p}=QP(s),h=o==null?void 0:o({currentSubscription:c}),m=(c==null?void 0:c.scheduledUpdates)||[],g=(k=c==null?void 0:c.price)==null?void 0:k.billingPeriod,f=m.find(({subscriptionScheduleType:v})=>v===SubscriptionScheduleType.Downgrade),x=m.find(({subscriptionScheduleType:v})=>v===SubscriptionScheduleType.BillingPeriod),b=Hg(n,v=>v.order).map(v=>{var F;let _=(F=a==null?void 0:a.eligibleForTrial)==null?void 0:F.find(E=>E.productId===v.product.id),M=h!=null&&h.planId?(h==null?void 0:h.planId)===v.id:v.id===(d==null?void 0:d.id),I=E=>{var L;let B=f==null?void 0:f.scheduleVariables,O=x==null?void 0:x.scheduleVariables,U=v.pricePoints.some(V=>V.billingPeriod===E);return f?((L=f.targetPackage)==null?void 0:L.refId)===v.id&&(!U||B.billingPeriod===E):x&&M?O.billingPeriod===E:false};return A(S({},v),{paywallCalculatedPricePoints:l==null?void 0:l.filter(E=>E.planId===v.id),isTriable:!_r(v.defaultTrialConfig)&&(!_||_.eligible),isCurrentCustomerPlan:M,currentCustomerPlanBillingPeriod:g,isUpcomingPlan:false,trialDaysLeft:p,isNextPlan:I,paywallCurrency:i,scheduledUpdate:f||x})});if(n&&d){let v=d&&((w=n==null?void 0:n.find(_=>_.id===(d==null?void 0:d.id)))==null?void 0:w.order);_r(v)||(b=b.map(_=>A(S({},_),{isLowerThanCurrentPlan:v>_.order})),t&&(b=b.filter(_=>_.order>=v)));}let T=r?Km(r):void 0;return {currentPlan:d,currentSubscription:c,currentSubscriptionOverride:h,isCustomerOnTrial:u,plans:b,paywallConfiguration:T}}var nh="7.25.0";var ih="@stigg/react-sdk";var Si=Ac.createContext(null);Si.displayName="StiggContext";var nS="en-US",iS=({apiKey:e,baseUri:t,baseEdgeUri:o,enableEdge:n,customerId:i,customerToken:r,resourceId:a,theme:s,locale:l,cacheTtlMs:c,useEntitlementPolling:d,entitlementPollingInterval:u,entitlementsFallback:p,stiggClient:h,children:m,offline:g,clientName:f=ih,clientVersion:x=nh})=>{let b=useRef(e),T={apiKey:e,customerId:i,customerToken:r,resourceId:a,baseUri:t,baseEdgeUri:o,enableEdge:n,entitlementsFallback:p,cacheTtlMs:c,useEntitlementPolling:d,entitlementPollingInterval:u,clientName:f,clientVersion:x,offline:g},[k,w]=useState(()=>({stigg:h!=null?h:rh__default.initialize(A(S({},T),{lazyLoad:true})),locale:l||nS,isInitialized:false,theme:s,refreshData:()=>R(null,null,function*(){w(v=>A(S({},v),{customerPortalUpdatedAt:new Date})),yield k.stigg.refresh();})}));return useEffect(()=>{let v=true,_=E=>{v&&w(E);},M=()=>_(E=>A(S({},E),{updatedAt:new Date})),I=E=>_(B=>(B.stigg&&B.stigg.removeListener("entitlementsUpdated",M),E.addListener("entitlementsUpdated",M),A(S({},B),{stigg:E,isInitialized:true,updatedAt:new Date})));return R(null,null,function*(){let E=k.stigg;e!==b.current&&(no.log("Updating stigg client",{apiKey:e}),b.current=e,E=rh__default.initialize(S({},T)),_(B=>A(S({},B),{isInitialized:false,updatedAt:new Date}))),yield E.waitForInitialization(),I(E);}),()=>{v=false,k.stigg.removeListener("entitlementsUpdated",M),k.stigg.clearCustomer();}},[e]),useEffect(()=>{let v=k.stigg;i?v.setCustomerId(i,r,a):v.clearCustomer();},[i,r,a]),useEffect(()=>{w(v=>A(S({},v),{theme:s}));},[s]),jsx(Si.Provider,{value:k,children:jsx(SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea",children:m})})};function D(e){let{optional:t}=e||{},o=useContext(Si);if(!o&&!t)throw new Error("Could not find Stigg context; You need to wrap your app in an <StiggProvider> component.");return o}function sh({productId:e,resourceId:t,showOnlyEligiblePlans:o,billingCountryCode:n,preferredBillingPeriod:i,currentSubscriptionOverrideFn:r}){let{stigg:a,locale:s}=D(),[l,c]=useState(BillingPeriod.Annually),[d,u]=useState([]),[p,h]=useState(null),[m,g]=useState(true);useEffect(()=>{R(null,null,function*(){try{g(!0),yield a.waitForInitialization();let b=yield a.getPaywall({productId:e,resourceId:t,billingCountryCode:n}),{availableBillingPeriods:T,defaultBillingPeriod:k}=Gm(b.plans,b.activeSubscriptions,i);h(b),u(T),c(k);}catch(b){no.error(`Failed to load paywall ${b==null?void 0:b.message}`,b);}finally{g(false);}});},[a,e,a.isCustomerLoaded,n,t,i]);let f=eh(p,o,r);return S({customer:(p==null?void 0:p.customer)||null,isLoading:m,selectedBillingPeriod:l,setSelectedBillingPeriod:c,availableBillingPeriods:d,locale:s,configuration:f.paywallConfiguration,showWatermark:a.getShowWatermark()},f)}function ch(e){return g2({highlightChip:"Recommended",addonsTitle:"Available add-ons:",planCTAButton:{upgrade:"Upgrade",downgrade:"Downgrade",startTrial:o=>{var n;return `Start ${(n=o.defaultTrialConfig)==null?void 0:n.duration} day trial`},custom:"Contact us",currentPlan:"Current plan",startNew:"Get started",switchToBillingPeriod:o=>o===BillingPeriod.Monthly?"Switch to monthly billing":"Switch to annual billing",cancelScheduledUpdate:"Cancel"},price:{startingAtCaption:"Starts at",pricePeriod:o=>o===BillingPeriod.Monthly?"/ month":"/ year",free:o=>({price:`${o==null?void 0:o.symbol}0`}),custom:"Custom",priceNotSet:"Price not set"}},e)}var cS=e=>jsx("svg",A(S({width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{d:"M5.59 7.9899L2.125 4.5249C1.73524 4.13514 1.10365 4.13402 0.712509 4.52241V4.52241C0.319409 4.91274 0.318286 5.54819 0.710005 5.9399L5.59 10.8199L14.2948 2.11513C14.6843 1.72565 14.6843 1.09417 14.2948 0.704691V0.704691C13.9055 0.315381 13.2743 0.315184 12.8848 0.70425L5.59 7.9899Z",fill:"#B2BBD3"})})),uh=cS;var dS=y.div`
299
299
  display: flex;
300
300
  flex-direction: column;
301
301
  align-items: center;
302
- `,$l=x(em)`
302
+ `,Xl=y(uh)`
303
303
  margin-right: 16px;
304
- `,qP=x.div`
304
+ `,uS=y.div`
305
305
  display: flex;
306
306
  flex-direction: column;
307
307
  align-items: flex-start;
@@ -313,25 +313,25 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
313
313
  max-width: ${({theme:e})=>e.stigg.layout.planMaxWidth};
314
314
  min-height: 450px;
315
315
  border: ${({theme:e})=>`1px solid ${e.stigg.palette.outlinedBorder}`};
316
- `,QP=x.div`
316
+ `,pS=y.div`
317
317
  display: flex;
318
318
  gap: ${({theme:e})=>e.stigg.layout.planMargin};
319
319
  flex-wrap: wrap;
320
320
  justify-content: center;
321
- `,Vl=x.div`
321
+ `,Kl=y.div`
322
322
  display: flex;
323
323
  align-items: center;
324
324
  margin-bottom: 12px;
325
- `,JP=x.div`
325
+ `,mS=y.div`
326
326
  margin-top: auto;
327
- `,tS=x.div`
327
+ `,hS=y.div`
328
328
  width: 150px;
329
329
  margin-bottom: ${({theme:e})=>e.stigg.layout.switchBottomSpacing};
330
330
  padding: 12px 12px;
331
331
  border-radius: 10px;
332
332
  background-color: white;
333
333
  border: ${({theme:e})=>`1px solid ${e.stigg.palette.outlinedBorder}`};
334
- `;function eS(){return jsxs(qP,{children:[jsx(ro,{width:120,borderRadius:4}),jsx(ro,{circle:true,width:40,height:40}),jsx(ro,{style:{marginBottom:33},width:120,borderRadius:4}),jsxs(Vl,{children:[jsx($l,{}),jsx(ro,{width:120,borderRadius:4})]}),jsxs(Vl,{children:[jsx($l,{}),jsx(ro,{width:120,borderRadius:4})]}),jsxs(Vl,{children:[jsx($l,{}),jsx(ro,{width:120,borderRadius:4})]}),jsx(JP,{children:jsx(ro,{height:50,borderRadius:4})})]})}function om({skeletonPlanCount:e=3}){return jsxs(KP,{className:"stigg-skeleton-loader-container",children:[jsx(tS,{className:"stigg-skeleton-loader-billing-period",children:jsx(ro,{borderRadius:4})}),jsx(QP,{className:"stigg-skeleton-loader-plans-container",children:Array.from({length:e}).map((t,o)=>jsx(eS,{},o))})]})}var nm=({externalFontUrl:e})=>jsx(Global,{styles:css`
334
+ `;function gS(){return jsxs(uS,{children:[jsx(ro,{width:120,borderRadius:4}),jsx(ro,{circle:true,width:40,height:40}),jsx(ro,{style:{marginBottom:33},width:120,borderRadius:4}),jsxs(Kl,{children:[jsx(Xl,{}),jsx(ro,{width:120,borderRadius:4})]}),jsxs(Kl,{children:[jsx(Xl,{}),jsx(ro,{width:120,borderRadius:4})]}),jsxs(Kl,{children:[jsx(Xl,{}),jsx(ro,{width:120,borderRadius:4})]}),jsx(mS,{children:jsx(ro,{height:50,borderRadius:4})})]})}function ph({skeletonPlanCount:e=3}){return jsxs(dS,{className:"stigg-skeleton-loader-container",children:[jsx(hS,{className:"stigg-skeleton-loader-billing-period",children:jsx(ro,{borderRadius:4})}),jsx(pS,{className:"stigg-skeleton-loader-plans-container",children:Array.from({length:e}).map((t,o)=>jsx(gS,{},o))})]})}var mh=({externalFontUrl:e})=>jsx(Global,{styles:css`
335
335
  ${e&&`
336
336
  @font-face {
337
337
  font-family: 'custom-font';
@@ -401,11 +401,11 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
401
401
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,
402
402
  U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
403
403
  }
404
- `});var uS=x.div`
404
+ `});var wS=y.div`
405
405
  ${({$customCss:e})=>e&&css`
406
406
  ${e}
407
407
  `}
408
- `;function $o(e){let{theme:t}=D(),o=e2(e,t);return Jp(o)}var pS=e=>({primary:{main:e.palette.primary}}),ht=({children:e,componentTheme:t})=>{let o=$o(t),n=pS(o),i=createTheme({palette:n,stigg:o});return jsx(ThemeProvider,{theme:{[THEME_ID]:i},children:jsx(ThemeProvider$1,{theme:{stigg:o},children:jsxs(uS,{$customCss:o.customCss,children:[jsx(nm,{externalFontUrl:o.typography.fontFamilyUrl}),e]})})})};var St=xc.createContext(null);St.displayName="CustomerPortalContext";var ft=()=>{let e=useContext(St);if(!e)throw new Error("Could not find Customer portal context; You need to wrap your customer portal components in an <CustomerPortalProvider> component.");return e};function jt(e){return !!useContext(e)}var rm=({productId:e,resourceId:t,highlightedPlanId:o,showOnlyEligiblePlans:n,textOverrides:i,onPlanSelected:r,preferredBillingPeriod:a,onBillingPeriodChange:s,billingCountryCode:l,shouldHidePlan:c,selectDefaultTierIndex:d,currentSubscriptionOverride:u,hideCompatibleAddons:p,skeletonPlanCount:m=3})=>{let h=jt(St),f=false;if(h){let{isLoading:F,resourceId:$}=ft();f=F,t=$;}let{plans:g,customer:y,currentSubscription:P,currentSubscriptionOverride:T,isCustomerOnTrial:k,isLoading:w,selectedBillingPeriod:v,setSelectedBillingPeriod:A,availableBillingPeriods:M,locale:I,configuration:B,showWatermark:L}=qh({productId:e,resourceId:t,showOnlyEligiblePlans:n,billingCountryCode:l,preferredBillingPeriod:a,currentSubscriptionOverrideFn:u}),E=Jh(i),N=!g||w||f?jsx(om,{skeletonPlanCount:m}):jsx(Fh,{plans:g,customer:y,currentSubscription:P,currentSubscriptionOverride:T,selectedBillingPeriod:v,onBillingPeriodChanged:F=>{A(F),s&&s(F);},availableBillingPeriods:M,highlightedPlanId:o,isCustomerOnTrial:k,onPlanSelected:r,paywallLocale:E,locale:I,shouldHidePlan:c,selectDefaultTierIndex:d,hideCompatibleAddons:p,showWatermark:L});return h?N:jsx(ht,{componentTheme:B,children:N})};function sm({resourceId:e,productId:t}){let{stigg:o,customerPortalUpdatedAt:n}=D(),[i,r]=useState(false),[a,s]=useState();return useEffect(()=>{R(null,null,function*(){if(o.isCustomerLoaded)try{r(!0);let c=yield o.getCustomerPortal({resourceId:e,productId:t});s(c);}catch(c){no.error(`Failed to load customer portal ${c==null?void 0:c.message}`,c);}finally{r(false);}});},[o,o.isCustomerLoaded,n,e,t]),{customerPortal:a,showWatermark:o.getShowWatermark(),isLoading:i}}function lm(e){return e2({manageSubscription:"Manage",usageTabTitle:"Usage",addonsTabTitle:"Add-ons",promotionsTabTitle:"Promotions",promotionsSubtitle:"You were granted access to additional functionality at no additional cost.",contactSupportTitle:"Have questions about your subscription?",contactSupportLink:"Contact support",editBilling:"Edit billing details",invoicesTitle:"Invoices",viewInvoiceHistory:"View invoice history",editPaymentDetails:"Edit",paywallSectionTitle:"Plans",cancelScheduledUpdatesButtonTitle:"Cancel"},e)}function cm(e,t,o){var i,r,a,s;return {sectionTitleColor:(t==null?void 0:t.sectionTitleColor)||e.palette.text.secondary,planNameColor:(t==null?void 0:t.planNameColor)||e.palette.text.primary,backgroundColor:(t==null?void 0:t.backgroundColor)||((i=o==null?void 0:o.palette)==null?void 0:i.backgroundColor)||"white",borderColor:(t==null?void 0:t.borderColor)||((r=o==null?void 0:o.palette)==null?void 0:r.borderColor)||"rgba(0, 30, 108, 0.15)",listItemBackgroundColor:(t==null?void 0:t.backgroundColor)||((a=o==null?void 0:o.palette)==null?void 0:a.backgroundColor)||"white",tabMaxHeight:(t==null?void 0:t.tabMaxHeight)||"380px",iconsColor:(t==null?void 0:t.iconsColor)||((s=o==null?void 0:o.palette)==null?void 0:s.iconsColor)||void 0,iconsBackgroundColor:t==null?void 0:t.iconsBackgroundColor}}function Rr({children:e,textOverrides:t,theme:o,resourceId:n,productId:i}){let{customerPortalUpdatedAt:r}=D(),{customerPortal:a,isLoading:s,showWatermark:l}=sm({resourceId:n,productId:i}),c=a!=null&&a.configuration?Uh(a.configuration):void 0,d=$o(c),u=cm(d,o,a==null?void 0:a.configuration),p=lm(t);return jsx(ht,{componentTheme:c,children:jsx(St.Provider,{value:{customerPortal:a,isLoading:s,showWatermark:l,textOverrides:p,theme:u,resourceId:n},children:e},r==null?void 0:r.toString())})}var ao=x(b2)`
408
+ `;function Vo(e){let{theme:t}=D(),o=g2(e,t);return cm(o)}var vS=e=>({primary:{main:e.palette.primary}}),ht=({children:e,componentTheme:t})=>{let o=Vo(t),n=vS(o),i=createTheme({palette:n,stigg:o});return jsx(ThemeProvider,{theme:{[THEME_ID]:i},children:jsx(ThemeProvider$1,{theme:{stigg:o},children:jsxs(wS,{$customCss:o.customCss,children:[jsx(mh,{externalFontUrl:o.typography.fontFamilyUrl}),e]})})})};var St=Ac.createContext(null);St.displayName="CustomerPortalContext";var ut=()=>{let e=useContext(St);if(!e)throw new Error("Could not find Customer portal context; You need to wrap your customer portal components in an <CustomerPortalProvider> component.");return e};function jt(e){return !!useContext(e)}var gh=({productId:e,resourceId:t,highlightedPlanId:o,showOnlyEligiblePlans:n,textOverrides:i,onPlanSelected:r,preferredBillingPeriod:a,onBillingPeriodChange:s,billingCountryCode:l,shouldHidePlan:c,selectDefaultTierIndex:d,currentSubscriptionOverride:u,hideCompatibleAddons:p,skeletonPlanCount:h=3})=>{let m=jt(St),g=false;if(m){let{isLoading:L,resourceId:V}=ut();g=L,t=V;}let{plans:f,customer:x,currentSubscription:b,currentSubscriptionOverride:T,isCustomerOnTrial:k,isLoading:w,selectedBillingPeriod:v,setSelectedBillingPeriod:_,availableBillingPeriods:M,locale:I,configuration:F,showWatermark:E}=sh({productId:e,resourceId:t,showOnlyEligiblePlans:n,billingCountryCode:l,preferredBillingPeriod:a,currentSubscriptionOverrideFn:u}),B=ch(i),U=!f||w||g?jsx(ph,{skeletonPlanCount:h}):jsx(Wm,{plans:f,customer:x,currentSubscription:b,currentSubscriptionOverride:T,selectedBillingPeriod:v,onBillingPeriodChanged:L=>{_(L),s&&s(L);},availableBillingPeriods:M,highlightedPlanId:o,isCustomerOnTrial:k,onPlanSelected:r,paywallLocale:B,locale:I,shouldHidePlan:c,selectDefaultTierIndex:d,hideCompatibleAddons:p,showWatermark:E});return m?U:jsx(ht,{componentTheme:F,children:U})};function yh({resourceId:e,productId:t}){let{stigg:o,customerPortalUpdatedAt:n}=D(),[i,r]=useState(false),[a,s]=useState();return useEffect(()=>{R(null,null,function*(){if(o.isCustomerLoaded)try{r(!0);let c=yield o.getCustomerPortal({resourceId:e,productId:t});s(c);}catch(c){no.error(`Failed to load customer portal ${c==null?void 0:c.message}`,c);}finally{r(false);}});},[o,o.isCustomerLoaded,n,e,t]),{customerPortal:a,showWatermark:o.getShowWatermark(),isLoading:i}}function xh(e){return g2({manageSubscription:"Manage",usageTabTitle:"Usage",addonsTabTitle:"Add-ons",promotionsTabTitle:"Promotions",promotionsSubtitle:"You were granted access to additional functionality at no additional cost.",contactSupportTitle:"Have questions about your subscription?",contactSupportLink:"Contact support",editBilling:"Edit billing details",invoicesTitle:"Invoices",viewInvoiceHistory:"View invoice history",editPaymentDetails:"Edit",paywallSectionTitle:"Plans",cancelScheduledUpdatesButtonTitle:"Cancel"},e)}function bh(e,t,o){var i,r,a,s;return {sectionTitleColor:(t==null?void 0:t.sectionTitleColor)||e.palette.text.secondary,planNameColor:(t==null?void 0:t.planNameColor)||e.palette.text.primary,backgroundColor:(t==null?void 0:t.backgroundColor)||((i=o==null?void 0:o.palette)==null?void 0:i.backgroundColor)||"white",borderColor:(t==null?void 0:t.borderColor)||((r=o==null?void 0:o.palette)==null?void 0:r.borderColor)||"rgba(0, 30, 108, 0.15)",listItemBackgroundColor:(t==null?void 0:t.backgroundColor)||((a=o==null?void 0:o.palette)==null?void 0:a.backgroundColor)||"white",tabMaxHeight:(t==null?void 0:t.tabMaxHeight)||"380px",iconsColor:(t==null?void 0:t.iconsColor)||((s=o==null?void 0:o.palette)==null?void 0:s.iconsColor)||void 0,iconsBackgroundColor:t==null?void 0:t.iconsBackgroundColor}}function Dr({children:e,textOverrides:t,theme:o,resourceId:n,productId:i}){let{customerPortalUpdatedAt:r}=D(),{customerPortal:a,isLoading:s,showWatermark:l}=yh({resourceId:n,productId:i}),c=a!=null&&a.configuration?Xm(a.configuration):void 0,d=Vo(c),u=bh(d,o,a==null?void 0:a.configuration),p=xh(t);return jsx(ht,{componentTheme:c,children:jsx(St.Provider,{value:{customerPortal:a,isLoading:s,showWatermark:l,textOverrides:p,theme:u,resourceId:n},children:e},r==null?void 0:r.toString())})}var ao=y(L2)`
409
409
  border-radius: 10px;
410
410
  padding: 8px 16px;
411
411
  text-transform: none;
@@ -414,7 +414,7 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
414
414
  &:hover {
415
415
  border-color: ${({theme:e})=>e.stigg.palette.outlinedRestingBorder};
416
416
  }
417
- `;var xS=e=>jsx("svg",_(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.3333 2.5L17.5 6.66667L6.66667 17.5H2.5V13.3333L13.3333 2.5V2.5Z",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),pm=xS;var be=x.div`
417
+ `;var FS=e=>jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.3333 2.5L17.5 6.66667L6.66667 17.5H2.5V13.3333L13.3333 2.5V2.5Z",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),Sh=FS;var Ce=y.div`
418
418
  display: flex;
419
419
  align-items: center;
420
420
  justify-content: space-between;
@@ -424,11 +424,11 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
424
424
  margin-bottom: 32px;
425
425
  }
426
426
  `};
427
- `;function Ce({title:e,className:t,isLoading:o}){let{theme:n}=ft();return o?jsx(ro,{width:120}):jsx(C,{className:t,overrideColor:n.sectionTitleColor,variant:"h3",bold:true,children:e})}var CS=x(pm)`
427
+ `;function Pe({title:e,className:t,isLoading:o}){let{theme:n}=ut();return o?jsx(ro,{width:120}):jsx(P,{className:t,overrideColor:n.sectionTitleColor,variant:"h3",bold:true,children:e})}var BS=y(Sh)`
428
428
  path {
429
429
  stroke: ${({theme:e})=>e.stigg.palette.primary};
430
430
  }
431
- `;function gm({onManageSubscription:e,hideManageButton:t,textOverrides:o}){return jsxs(be,{className:"stigg-customer-portal-overview-header",$disableMargin:true,children:[jsx(Ce,{title:"Subscription",className:"stigg-overview-title"}),!t&&jsxs(ao,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:()=>e({intentionType:"MANAGE_SUBSCRIPTION"}),children:[jsx(CS,{className:"stigg-manage-subscription-button-image"}),jsx(C,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1",children:o==null?void 0:o.manageSubscription})]})]})}function Dr(){let{customerPortal:e}=ft(),t=PS(e==null?void 0:e.subscriptions,o=>o.addons);return SS(t)?null:jsx("div",{className:"stigg-addons-list-layout",children:t.map((o,n)=>jsxs(C,{as:"span",className:"stigg-addon-list-item-text",variant:"body1",children:[o.quantity>1&&`${o.quantity} X `,o.displayName,n===t.length-1?"":", "]},o.addonId))})}var ym=x.div`
431
+ `;function vh({onManageSubscription:e,hideManageButton:t,textOverrides:o}){return jsxs(Ce,{className:"stigg-customer-portal-overview-header",$disableMargin:true,children:[jsx(Pe,{title:"Subscription",className:"stigg-overview-title"}),!t&&jsxs(ao,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:()=>e({intentionType:"MANAGE_SUBSCRIPTION"}),children:[jsx(BS,{className:"stigg-manage-subscription-button-image"}),jsx(P,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1",children:o==null?void 0:o.manageSubscription})]})]})}function Nr(){let{customerPortal:e}=ut(),t=RS(e==null?void 0:e.subscriptions,o=>o.addons);return DS(t)?null:jsx("div",{className:"stigg-addons-list-layout",children:t.map((o,n)=>jsxs(P,{as:"span",className:"stigg-addon-list-item-text",variant:"body1",children:[o.quantity>1&&`${o.quantity} X `,o.displayName,n===t.length-1?"":", "]},o.addonId))})}var _h=y.div`
432
432
  display: flex;
433
433
  justify-content: space-between;
434
434
  align-items: center;
@@ -439,19 +439,19 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
439
439
  & > *:first-of-type {
440
440
  max-width: 60%;
441
441
  }
442
- `;function vS(e){var i;let{displayName:t,usageLimit:o,hasUnlimitedUsage:n}=e;return n?`Unlimited ${t}`:o?`${t} x ${(i=e.usageLimit)==null?void 0:i.toLocaleString()}`:t}function Or(){let{customerPortal:e,textOverrides:t,theme:o}=ft(),n=e==null?void 0:e.promotionalEntitlements;return jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsx(C,{color:"secondary",children:t.promotionsSubtitle}),jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxs(ym,{$borderColor:o.borderColor,children:[jsx(C,{variant:"body1",bold:true,children:"Feature"}),jsx(C,{variant:"body1",bold:true,children:"Expiration date"})]}),n==null?void 0:n.map((i,r)=>jsxs(ym,{$borderColor:o.borderColor,children:[jsx(C,{variant:"body1",children:vS(i)}),jsx(C,{variant:"body1",color:"disabled",children:i.endDate?Xc.utc(i.endDate).format("MMM Do, YYYY"):"None"})]},`${i.displayName}-${r}`))]})]})}var xm=x(AS)`
442
+ `;function zS(e){var i;let{displayName:t,usageLimit:o,hasUnlimitedUsage:n}=e;return n?`Unlimited ${t}`:o?`${t} x ${(i=e.usageLimit)==null?void 0:i.toLocaleString()}`:t}function Or(){let{customerPortal:e,textOverrides:t,theme:o}=ut(),n=e==null?void 0:e.promotionalEntitlements;return jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsx(P,{color:"secondary",children:t.promotionsSubtitle}),jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxs(_h,{$borderColor:o.borderColor,children:[jsx(P,{variant:"body1",bold:true,children:"Feature"}),jsx(P,{variant:"body1",bold:true,children:"Expiration date"})]}),n==null?void 0:n.map((i,r)=>jsxs(_h,{$borderColor:o.borderColor,children:[jsx(P,{variant:"body1",children:zS(i)}),jsx(P,{variant:"body1",color:"disabled",children:i.endDate?rd.utc(i.endDate).format("MMM Do, YYYY"):"None"})]},`${i.displayName}-${r}`))]})]})}var Ah=y($S)`
443
443
  .MuiTabs-indicator {
444
444
  background-color: #001e6c;
445
445
  }
446
- `,bm=x.div`
446
+ `,Mh=y.div`
447
447
  width: 100%;
448
448
  flex: 1;
449
449
  margin-top: 16px;
450
- `,Cm=x(Ma)`
450
+ `,Ih=y(Na)`
451
451
  margin-top: 16px;
452
452
  max-height: ${({$maxHeight:e})=>e};
453
453
  overflow-y: auto;
454
- `;x.div`
454
+ `;y.div`
455
455
  display: flex;
456
456
  flex-direction: column;
457
457
  padding: 24px;
@@ -460,28 +460,28 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
460
460
  margin-bottom: 16px;
461
461
  row-gap: 16px;
462
462
  background-color: ${({$backgroundColor:e})=>e};
463
- `;function Sm(e){let a=e,{children:t,value:o,index:n,maxHeight:i}=a,r=ot(a,["children","value","index","maxHeight"]);return jsx("div",_(S({role:"tabpanel",hidden:o!==n},r),{children:o===n&&jsx(Cm,{$maxHeight:i,children:t})}))}function Tm({isSelected:e,label:t,icon:o}){let n=e?"primary":"secondary";return jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[jsx(pt,{icon:o,svgStrokeColor:n}),jsx(C,{variant:"h6",bold:e,color:n,children:t})]})}function km({customerPortal:e,hiddenSections:t,textOverrides:o,theme:n}){let i=PS(e.subscriptions,p=>p.addons),r=p=>t==null?void 0:t.some(m=>m===p),a=i.length>0&&!r("addons"),s=e.promotionalEntitlements.length>0&&!r("promotionalEntitlements"),[l,c]=useState(a?1:2),d=(p,m)=>{c(m);};return a||s?jsxs(bm,{children:[jsx(Ma,{sx:{borderBottom:1,borderColor:"divider"},children:jsxs(xm,{value:l,onChange:d,children:[a?jsx(Pm,{sx:{textTransform:"none"},value:1,label:jsx(Tm,{isSelected:l===1,label:o.addonsTabTitle,icon:"Addons"})}):null,s?jsx(Pm,{sx:{textTransform:"none"},value:2,label:jsx(Tm,{isSelected:l===2,label:o.promotionsTabTitle,icon:"Promotions"})}):null]})}),jsx(Sm,{value:l,index:1,maxHeight:n.tabMaxHeight,children:jsx(Dr,{})}),jsx(Sm,{value:l,index:2,maxHeight:n.tabMaxHeight,children:jsx(Or,{})})]}):null}var wm={xs:320,sm:640,md:768,lg:1024,xl:1280,xxl:1536},Yl=e=>`(min-width: ${wm[e]}px)`,wt=Object.keys(wm).reduce((e,t)=>_(S({},e),{[t]:`@media ${Yl(t)}`}),{});function Dt(e){return useMediaQuery(Yl(e))}var ES=x.div`
463
+ `;function Fh(e){let a=e,{children:t,value:o,index:n,maxHeight:i}=a,r=ot(a,["children","value","index","maxHeight"]);return jsx("div",A(S({role:"tabpanel",hidden:o!==n},r),{children:o===n&&jsx(Ih,{$maxHeight:i,children:t})}))}function Lh({isSelected:e,label:t,icon:o}){let n=e?"primary":"secondary";return jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[jsx(mt,{icon:o,svgStrokeColor:n}),jsx(P,{variant:"h6",bold:e,color:n,children:t})]})}function Bh({customerPortal:e,hiddenSections:t,textOverrides:o,theme:n}){let i=RS(e.subscriptions,p=>p.addons),r=p=>t==null?void 0:t.some(h=>h===p),a=i.length>0&&!r("addons"),s=e.promotionalEntitlements.length>0&&!r("promotionalEntitlements"),[l,c]=useState(a?1:2),d=(p,h)=>{c(h);};return a||s?jsxs(Mh,{children:[jsx(Na,{sx:{borderBottom:1,borderColor:"divider"},children:jsxs(Ah,{value:l,onChange:d,children:[a?jsx(Eh,{sx:{textTransform:"none"},value:1,label:jsx(Lh,{isSelected:l===1,label:o.addonsTabTitle,icon:"Addons"})}):null,s?jsx(Eh,{sx:{textTransform:"none"},value:2,label:jsx(Lh,{isSelected:l===2,label:o.promotionsTabTitle,icon:"Promotions"})}):null]})}),jsx(Fh,{value:l,index:1,maxHeight:n.tabMaxHeight,children:jsx(Nr,{})}),jsx(Fh,{value:l,index:2,maxHeight:n.tabMaxHeight,children:jsx(Or,{})})]}):null}var Rh={xs:320,sm:640,md:768,lg:1024,xl:1280,xxl:1536},ec=e=>`(min-width: ${Rh[e]}px)`,wt=Object.keys(Rh).reduce((e,t)=>A(S({},e),{[t]:`@media ${ec(t)}`}),{});function Dt(e){return useMediaQuery(ec(e))}var YS=y.div`
464
464
  display: flex;
465
465
  justify-content: space-between;
466
466
  flex-wrap: wrap;
467
- `,FS=x.div`
467
+ `,ZS=y.div`
468
468
  display: flex;
469
469
  flex-direction: column;
470
470
  gap: 32px;
471
- `;function _m(){let e=Dt("md");return jsxs(ES,{className:"stigg-subscription-overview-skeleton-layout",children:[jsxs(FS,{children:[jsx(ro,{width:120}),jsx(ro,{width:120})]}),jsx(ro,{width:e?295:260,height:193})]})}function DS({scheduleUpdate:e}){let{targetPackage:t}=e;return jsxs(Pe,{container:true,alignItems:"center",children:[jsx(Pe,{children:jsx(ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsx(Pe,{item:true,children:jsxs(C,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Downgrade to the ",jsx("b",{children:t==null?void 0:t.displayName})," plan"]})})]})}function NS({scheduleUpdate:e}){let{scheduleVariables:t}=e,{billingPeriod:o}=t,n=o===BillingPeriod.Monthly?"annually":"monthly",i=o===BillingPeriod.Monthly?"monthly":"annually";return jsxs(Pe,{container:true,alignItems:"center",children:[jsx(Pe,{children:jsx(ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsx(Pe,{item:true,children:jsxs(C,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Change from an ",n," to a ",jsx("b",{children:i})," billing cycle"]})})]})}function OS({subscription:e,scheduleUpdate:t}){let{scheduleVariables:o}=t,{newUnitAmount:n,featureId:i}=o,a=compact(e.prices.map(({feature:d})=>d)).find(d=>d.id===i);if(!a)return null;let{featureUnits:s,featureUnitsPlural:l}=a;return jsxs(Pe,{container:true,alignItems:"flex-start",flexWrap:"nowrap",children:[jsx(Pe,{children:jsx(ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsx(Pe,{item:true,children:jsxs(C,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Reduce the ",jsx("b",{children:s})," quantity to ",n," ",n===1?s:l]})})]})}function Mm({scheduleUpdate:e,subscription:t}){switch(e.subscriptionScheduleType){case SubscriptionScheduleType.Downgrade:return jsx(DS,{scheduleUpdate:e});case SubscriptionScheduleType.BillingPeriod:return jsx(NS,{scheduleUpdate:e});case SubscriptionScheduleType.UnitAmount:return jsx(OS,{scheduleUpdate:e,subscription:t});default:return null}}var HS=x(Ma)`
471
+ `;function Nh(){let e=Dt("md");return jsxs(YS,{className:"stigg-subscription-overview-skeleton-layout",children:[jsxs(ZS,{children:[jsx(ro,{width:120}),jsx(ro,{width:120})]}),jsx(ro,{width:e?295:260,height:193})]})}function KS({scheduleUpdate:e}){let{targetPackage:t}=e;return jsxs(Se,{container:true,alignItems:"center",children:[jsx(Se,{children:jsx(ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsx(Se,{item:true,children:jsxs(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Downgrade to the ",jsx("b",{children:t==null?void 0:t.displayName})," plan"]})})]})}function qS({scheduleUpdate:e}){let{scheduleVariables:t}=e,{billingPeriod:o}=t,n=o===BillingPeriod.Monthly?"annually":"monthly",i=o===BillingPeriod.Monthly?"monthly":"annually";return jsxs(Se,{container:true,alignItems:"center",children:[jsx(Se,{children:jsx(ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsx(Se,{item:true,children:jsxs(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Change from an ",n," to a ",jsx("b",{children:i})," billing cycle"]})})]})}function QS({subscription:e,scheduleUpdate:t}){let{scheduleVariables:o}=t,{newUnitAmount:n,featureId:i}=o,a=compact(e.prices.map(({feature:d})=>d)).find(d=>d.id===i);if(!a)return null;let{featureUnits:s,featureUnitsPlural:l}=a;return jsxs(Se,{container:true,alignItems:"flex-start",flexWrap:"nowrap",children:[jsx(Se,{children:jsx(ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsx(Se,{item:true,children:jsxs(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Reduce the ",jsx("b",{children:s})," quantity to ",n," ",n===1?s:l]})})]})}function Oh({scheduleUpdate:e,subscription:t}){switch(e.subscriptionScheduleType){case SubscriptionScheduleType.Downgrade:return jsx(KS,{scheduleUpdate:e});case SubscriptionScheduleType.BillingPeriod:return jsx(qS,{scheduleUpdate:e});case SubscriptionScheduleType.UnitAmount:return jsx(QS,{scheduleUpdate:e,subscription:t});default:return null}}var nT=y(Na)`
472
472
  border-bottom: ${({$borderColor:e})=>`1px solid ${e}`};
473
473
  border-top-left-radius: 10px;
474
474
  border-top-right-radius: 10px;
475
475
  margin: -64px -64px 64px -64px;
476
476
  padding: 24px 32px;
477
- `,WS=x(s2)`
477
+ `,iT=y(P2)`
478
478
  margin-left: 4px;
479
- `,GS=x(Pr)`
479
+ `,rT=y(Sr)`
480
480
  color: ${({theme:e})=>e.stigg.palette.primary};
481
481
  path {
482
482
  fill: ${({theme:e})=>e.stigg.palette.primary};
483
483
  }
484
- `;function jS({subscription:e}){let{scheduledUpdates:t}=e;return jsxs(Fragment,{children:[jsx(Pe,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsx(Pe,{children:jsx(C,{className:"stigg-scheduled-updates-description",variant:"body1",children:"The following updates will take effect in the next billing cycle:"})})}),jsx(Pe,{children:(t||[]).map(o=>jsx(Mm,{scheduleUpdate:o,subscription:e},o.subscriptionScheduleType))})]})}function YS({subscription:e}){let{scheduledUpdates:t}=e,[o]=t||[],{line1:n,line2:i}=wr({scheduledUpdate:o,subscriptionPrices:e.prices,billingPeriodRange:e.billingPeriodRange,options:{postfix:"at the end of the current billing period"}});return jsxs(Fragment,{children:[jsx(Pe,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsx(Pe,{children:jsx(C,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary",children:n})})}),i&&jsx(Pe,{children:jsx(C,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary",children:i})})]})}function Im({subscription:e,onCancelScheduledUpdates:t,theme:o,cancelScheduledUpdatesButtonTitle:n}){let i=useTheme(),[r,a]=useState(false),{scheduledUpdates:s}=e;if(!s||s.length===0)return null;let l=s.length===1;return jsx(HS,{$borderColor:o.borderColor,className:"stigg-scheduled-updates-alert-container",children:jsxs(Pe,{container:true,alignItems:l?"center":"flex-start",gap:2,children:[jsx(Pe,{item:true,display:"flex",children:jsx(pt,{icon:"ScheduleBox",svgPathColor:o.iconsColor,svgRectColor:o.iconsBackgroundColor})}),jsx(Pe,{item:true,flex:1,children:l?jsx(YS,{subscription:e}):jsx(jS,{subscription:e})}),!!t&&jsx(Pe,{item:true,children:jsxs(ao,{variant:"outlined",onClick:()=>{a(true),Promise.resolve(t(e)).finally(()=>a(false));},children:[r?jsx(WS,{loading:true,size:16,color:i.stigg.palette.text.disabled}):jsx(GS,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),jsx(C,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button",children:n})]})})]})})}var Se=x.div`
484
+ `;function aT({subscription:e}){let{scheduledUpdates:t}=e;return jsxs(Fragment,{children:[jsx(Se,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsx(Se,{children:jsx(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:"The following updates will take effect in the next billing cycle:"})})}),jsx(Se,{children:(t||[]).map(o=>jsx(Oh,{scheduleUpdate:o,subscription:e},o.subscriptionScheduleType))})]})}function sT({subscription:e}){let{scheduledUpdates:t}=e,[o]=t||[],{line1:n,line2:i}=vr({scheduledUpdate:o,subscriptionPrices:e.prices,billingPeriodRange:e.billingPeriodRange,options:{postfix:"at the end of the current billing period"}});return jsxs(Fragment,{children:[jsx(Se,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsx(Se,{children:jsx(P,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary",children:n})})}),i&&jsx(Se,{children:jsx(P,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary",children:i})})]})}function zh({subscription:e,onCancelScheduledUpdates:t,theme:o,cancelScheduledUpdatesButtonTitle:n}){let i=useTheme(),[r,a]=useState(false),{scheduledUpdates:s}=e;if(!s||s.length===0)return null;let l=s.length===1;return jsx(nT,{$borderColor:o.borderColor,className:"stigg-scheduled-updates-alert-container",children:jsxs(Se,{container:true,alignItems:l?"center":"flex-start",gap:2,children:[jsx(Se,{item:true,display:"flex",children:jsx(mt,{icon:"ScheduleBox",svgPathColor:o.iconsColor,svgRectColor:o.iconsBackgroundColor})}),jsx(Se,{item:true,flex:1,children:l?jsx(sT,{subscription:e}):jsx(aT,{subscription:e})}),!!t&&jsx(Se,{item:true,children:jsxs(ao,{variant:"outlined",onClick:()=>{a(true),Promise.resolve(t(e)).finally(()=>a(false));},children:[r?jsx(iT,{loading:true,size:16,color:i.stigg.palette.text.disabled}):jsx(rT,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),jsx(P,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button",children:n})]})})]})})}var Te=y.div`
485
485
  width: 100%;
486
486
  display: flex;
487
487
  flex-direction: column;
@@ -499,12 +499,12 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
499
499
  ${wt.lg} {
500
500
  padding: 64px;
501
501
  }
502
- `;function Em({billingPeriod:e,rangeEnd:t,amount:o,currency:n}){return jsxs(Fragment,{children:[jsx(C,{variant:"h6",children:"Next estimated bill"}),jsx(C,{variant:"h1",children:at({amount:o,currency:n,maximumFractionDigits:2})}),jsxs(C,{as:"div",variant:"body1",color:"secondary",children:["Billed ",e===BillingPeriod.Monthly?"monthly":"annually"," on"," ",jsx(C,{variant:"body1",as:"span",color:"primary",children:Xc.utc(t).format("MMM Do, YYYY")})]}),jsx(C,{variant:"body1",color:"secondary",children:"* Additional tax rates may apply"})]})}function $r({description:e}){return jsxs(Fragment,{children:[jsx(C,{variant:"h6",color:"secondary",children:"No upcoming bill"}),jsx(C,{variant:"body1",color:"secondary",children:e})]})}var tT=x.div`
502
+ `;function Hh({billingPeriod:e,rangeEnd:t,amount:o,currency:n}){return jsxs(Fragment,{children:[jsx(P,{variant:"h6",children:"Next estimated bill"}),jsx(P,{variant:"h1",children:at({amount:o,currency:n,maximumFractionDigits:2})}),jsxs(P,{as:"div",variant:"body1",color:"secondary",children:["Billed ",e===BillingPeriod.Monthly?"monthly":"annually"," on"," ",jsx(P,{variant:"body1",as:"span",color:"primary",children:rd.utc(t).format("MMM Do, YYYY")})]}),jsx(P,{variant:"body1",color:"secondary",children:"* Additional tax rates may apply"})]})}function $r({description:e}){return jsxs(Fragment,{children:[jsx(P,{variant:"h6",color:"secondary",children:"No upcoming bill"}),jsx(P,{variant:"body1",color:"secondary",children:e})]})}var hT=y.div`
503
503
  display: flex;
504
504
  flex-direction: column;
505
505
  align-items: left;
506
506
  gap: 8px;
507
- `,eT=x(b2)`
507
+ `,gT=y(L2)`
508
508
  width: fit-content;
509
509
  &.MuiButton-root {
510
510
  padding: 0;
@@ -512,7 +512,7 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
512
512
  background: none;
513
513
  }
514
514
  }
515
- `;function Rm({onContactSupport:e,label:t,linkLabel:o}){let n=jsx(C,{color:e?"primary.main":"secondary",children:o});return jsxs(tT,{className:"stigg-contact-support-layout",children:[jsx(C,{className:"stigg-contact-support-label",color:"secondary",children:t}),e?jsx(eT,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:e,children:n}):n]})}var aT=x.div`
515
+ `;function Gh({onContactSupport:e,label:t,linkLabel:o}){let n=jsx(P,{color:e?"primary.main":"secondary",children:o});return jsxs(hT,{className:"stigg-contact-support-layout",children:[jsx(P,{className:"stigg-contact-support-label",color:"secondary",children:t}),e?jsx(gT,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:e,children:n}):n]})}var CT=y.div`
516
516
  max-height: 278px;
517
517
  display: flex;
518
518
  flex-direction: column;
@@ -521,7 +521,7 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
521
521
  border: ${({$borderColor:e})=>`1px solid ${e}`};
522
522
  padding: 32px;
523
523
  gap: 16px;
524
- `;function Dm({subscription:e,theme:t,textOverrides:o,onContactSupport:n}){var l,c,d,u,p,m,h;let{pricingType:i}=e,r,a=(c=(l=e.prices)==null?void 0:l.every(f=>f.billingModel!==BillingModel.UsageBased))!=null?c:true,s=(d=e.scheduledUpdates)==null?void 0:d.find(({subscriptionScheduleType:f,targetPackage:g})=>f===SubscriptionScheduleType.Downgrade&&(g==null?void 0:g.pricingType)===PricingType.Free);if(i===PricingType.Free)r=jsx($r,{description:"You're on a free plan, so you don\u2019t have any upcoming charges"});else if(i===PricingType.Paid)if(s&&a)r=jsx($r,{description:"Your plan will be downgraded to a free plan, so you don\u2019t have any upcoming charges"});else if(e.status===SubscriptionStatus.InTrial)r=jsx($r,{description:`You\u2019re on a free trial of the ${e.planName} plan, so you don\u2019t have any upcoming charges`});else {let f=(p=(u=e.prices)==null?void 0:u[0])==null?void 0:p.billingPeriod,g=(m=e.billingPeriodRange)==null?void 0:m.end,y=(h=e.totalPrice)==null?void 0:h.total;f&&g&&y&&(r=jsx(Em,{billingPeriod:f,rangeEnd:g,amount:y.amount,currency:y.currency}));}else i===PricingType.Custom&&(r=jsx(Rm,{onContactSupport:n,label:o.contactSupportTitle,linkLabel:o.contactSupportLink}));return jsx(aT,{className:"stigg-subscription-total-price-layout",$borderColor:t.borderColor,children:r})}var sT=e=>jsxs("svg",_(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("path",{d:"M12.9469 13.5999H11.9344L11.935 10.7756C11.935 10.6288 11.87 10.4819 11.7557 10.3838L8.62061 7.91816L11.755 5.4532C11.8694 5.35507 11.9344 5.22444 11.9344 5.06132L11.935 2.40004H12.9475C13.225 2.40004 13.4375 2.18755 13.4375 1.91004C13.4375 1.63254 13.225 1.42004 12.9475 1.42004L3.05311 1.42067C2.77561 1.42067 2.56311 1.63316 2.56311 1.91067C2.56311 2.18817 2.77561 2.40067 3.05311 2.40067H4.06561L4.06498 5.06131C4.06498 5.20818 4.12998 5.35505 4.24436 5.45318L7.36244 7.91814L4.245 10.3837C4.13062 10.4819 4.06562 10.6125 4.06562 10.7756V13.5999H3.05313C2.77562 13.5999 2.56313 13.8124 2.56313 14.0899C2.56313 14.3674 2.77562 14.5799 3.05313 14.5799H12.9469C13.2244 14.5799 13.4369 14.3674 13.4369 14.0899C13.4369 13.8124 13.2244 13.5999 12.9469 13.5999ZM5.04498 2.39995H10.9551V4.81627L8.00002 7.16747L5.04498 4.81627V2.39995ZM5.04498 11.0206L8.00002 8.66939L10.9551 11.0044V13.5838H5.04498V11.0206Z",fill:"white"}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.05303 1.25404L12.9474 1.25342C13.317 1.25342 13.6041 1.54053 13.6041 1.91008C13.6041 2.27964 13.317 2.56675 12.9474 2.56675H12.1016L12.101 5.06136V5.06136C12.101 5.2747 12.0135 5.45101 11.8635 5.57973L11.8581 5.58436L8.89014 7.9182L11.8642 10.2572C12.0164 10.3878 12.1016 10.5814 12.1016 10.7757L12.101 13.4333H12.9468C13.3164 13.4333 13.6035 13.7204 13.6035 14.09C13.6035 14.4595 13.3164 14.7466 12.9468 14.7466H3.05304C2.68349 14.7466 2.39638 14.4595 2.39638 14.09C2.39638 13.7204 2.68349 13.4333 3.05304 13.4333H3.89887V10.7757C3.89887 10.5623 3.98635 10.386 4.13639 10.2573L4.14144 10.253L7.09365 7.91821L4.13566 5.57982C3.98346 5.44923 3.89823 5.25562 3.89823 5.06135L3.89882 2.56738H3.05303C2.68348 2.56738 2.39636 2.28026 2.39636 1.91071C2.39636 1.54116 2.68348 1.25405 3.05303 1.25404V1.25404ZM12.9474 1.58675L3.05304 1.58738C2.86758 1.58738 2.7297 1.72525 2.7297 1.91071C2.7297 2.09617 2.86757 2.23404 3.05303 2.23404H4.23223L4.23157 5.06135V5.06135C4.23158 5.15983 4.27538 5.25908 4.35053 5.32476L7.63107 7.91815L4.35113 10.5123C4.2739 10.5795 4.23221 10.6639 4.23221 10.7757V13.7666H3.05304C2.86759 13.7666 2.72971 13.9045 2.72971 14.09C2.72971 14.2754 2.86759 14.4133 3.05304 14.4133H12.9468C13.1323 14.4133 13.2701 14.2754 13.2701 14.09C13.2701 13.9045 13.1323 13.7667 12.9468 13.7667H11.7676L11.7683 10.7757V10.7757C11.7683 10.6772 11.7245 10.5781 11.6495 10.5124L8.35092 7.91819L11.6489 5.32461C11.726 5.25743 11.7676 5.17306 11.7676 5.06136L11.7683 2.23342H12.9474C13.1329 2.23342 13.2708 2.09554 13.2708 1.91008C13.2708 1.72463 13.1329 1.58676 12.9474 1.58675V1.58675ZM4.87823 2.23332H11.1216V4.89669L7.99994 7.3805L4.87823 4.89669V2.23332ZM5.21157 2.56666V4.73593L7.99994 6.95452L10.7883 4.73593V2.56666H5.21157ZM7.99958 8.45673L11.1216 10.9237V13.7505H4.87823V10.9403L7.99958 8.45673ZM8.0003 8.88213L5.21157 11.101V13.4172H10.7883V11.0852L8.0003 8.88213Z",fill:"white"})]})),Om=sT;var Fe=x(i=>{var r=i,{children:e,className:t,placement:o="top"}=r,n=ot(r,["children","className","placement"]);return jsx(cT,_(S({arrow:true,placement:o},n),{classes:{popper:t,tooltip:"stigg-tooltip",arrow:"stigg-tooltip-arrow"},children:jsx("div",{children:e})}))})(({theme:e,$padding:t=8,$maxWidth:o=300})=>({[`& .${tooltipClasses.tooltip}`]:{backgroundColor:e.stigg.palette.white,maxWidth:o,boxShadow:e.stigg.shadows.popover,padding:t,borderRadius:e.stigg.border.radius,color:e.stigg.palette.text.primary},[`& .${tooltipClasses.arrow}`]:{color:e.stigg.palette.white}}));var hT=x(C)`
524
+ `;function jh({subscription:e,theme:t,textOverrides:o,onContactSupport:n}){var l,c,d,u,p,h,m;let{pricingType:i}=e,r,a=(c=(l=e.prices)==null?void 0:l.every(g=>g.billingModel!==BillingModel.UsageBased))!=null?c:true,s=(d=e.scheduledUpdates)==null?void 0:d.find(({subscriptionScheduleType:g,targetPackage:f})=>g===SubscriptionScheduleType.Downgrade&&(f==null?void 0:f.pricingType)===PricingType.Free);if(i===PricingType.Free)r=jsx($r,{description:"You're on a free plan, so you don\u2019t have any upcoming charges"});else if(i===PricingType.Paid)if(s&&a)r=jsx($r,{description:"Your plan will be downgraded to a free plan, so you don\u2019t have any upcoming charges"});else if(e.status===SubscriptionStatus.InTrial)r=jsx($r,{description:`You\u2019re on a free trial of the ${e.planName} plan, so you don\u2019t have any upcoming charges`});else {let g=(p=(u=e.prices)==null?void 0:u[0])==null?void 0:p.billingPeriod,f=(h=e.billingPeriodRange)==null?void 0:h.end,x=(m=e.totalPrice)==null?void 0:m.total;g&&f&&x&&(r=jsx(Hh,{billingPeriod:g,rangeEnd:f,amount:x.amount,currency:x.currency}));}else i===PricingType.Custom&&(r=jsx(Gh,{onContactSupport:n,label:o.contactSupportTitle,linkLabel:o.contactSupportLink}));return jsx(CT,{className:"stigg-subscription-total-price-layout",$borderColor:t.borderColor,children:r})}var PT=e=>jsxs("svg",A(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsx("path",{d:"M12.9469 13.5999H11.9344L11.935 10.7756C11.935 10.6288 11.87 10.4819 11.7557 10.3838L8.62061 7.91816L11.755 5.4532C11.8694 5.35507 11.9344 5.22444 11.9344 5.06132L11.935 2.40004H12.9475C13.225 2.40004 13.4375 2.18755 13.4375 1.91004C13.4375 1.63254 13.225 1.42004 12.9475 1.42004L3.05311 1.42067C2.77561 1.42067 2.56311 1.63316 2.56311 1.91067C2.56311 2.18817 2.77561 2.40067 3.05311 2.40067H4.06561L4.06498 5.06131C4.06498 5.20818 4.12998 5.35505 4.24436 5.45318L7.36244 7.91814L4.245 10.3837C4.13062 10.4819 4.06562 10.6125 4.06562 10.7756V13.5999H3.05313C2.77562 13.5999 2.56313 13.8124 2.56313 14.0899C2.56313 14.3674 2.77562 14.5799 3.05313 14.5799H12.9469C13.2244 14.5799 13.4369 14.3674 13.4369 14.0899C13.4369 13.8124 13.2244 13.5999 12.9469 13.5999ZM5.04498 2.39995H10.9551V4.81627L8.00002 7.16747L5.04498 4.81627V2.39995ZM5.04498 11.0206L8.00002 8.66939L10.9551 11.0044V13.5838H5.04498V11.0206Z",fill:"white"}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.05303 1.25404L12.9474 1.25342C13.317 1.25342 13.6041 1.54053 13.6041 1.91008C13.6041 2.27964 13.317 2.56675 12.9474 2.56675H12.1016L12.101 5.06136V5.06136C12.101 5.2747 12.0135 5.45101 11.8635 5.57973L11.8581 5.58436L8.89014 7.9182L11.8642 10.2572C12.0164 10.3878 12.1016 10.5814 12.1016 10.7757L12.101 13.4333H12.9468C13.3164 13.4333 13.6035 13.7204 13.6035 14.09C13.6035 14.4595 13.3164 14.7466 12.9468 14.7466H3.05304C2.68349 14.7466 2.39638 14.4595 2.39638 14.09C2.39638 13.7204 2.68349 13.4333 3.05304 13.4333H3.89887V10.7757C3.89887 10.5623 3.98635 10.386 4.13639 10.2573L4.14144 10.253L7.09365 7.91821L4.13566 5.57982C3.98346 5.44923 3.89823 5.25562 3.89823 5.06135L3.89882 2.56738H3.05303C2.68348 2.56738 2.39636 2.28026 2.39636 1.91071C2.39636 1.54116 2.68348 1.25405 3.05303 1.25404V1.25404ZM12.9474 1.58675L3.05304 1.58738C2.86758 1.58738 2.7297 1.72525 2.7297 1.91071C2.7297 2.09617 2.86757 2.23404 3.05303 2.23404H4.23223L4.23157 5.06135V5.06135C4.23158 5.15983 4.27538 5.25908 4.35053 5.32476L7.63107 7.91815L4.35113 10.5123C4.2739 10.5795 4.23221 10.6639 4.23221 10.7757V13.7666H3.05304C2.86759 13.7666 2.72971 13.9045 2.72971 14.09C2.72971 14.2754 2.86759 14.4133 3.05304 14.4133H12.9468C13.1323 14.4133 13.2701 14.2754 13.2701 14.09C13.2701 13.9045 13.1323 13.7667 12.9468 13.7667H11.7676L11.7683 10.7757V10.7757C11.7683 10.6772 11.7245 10.5781 11.6495 10.5124L8.35092 7.91819L11.6489 5.32461C11.726 5.25743 11.7676 5.17306 11.7676 5.06136L11.7683 2.23342H12.9474C13.1329 2.23342 13.2708 2.09554 13.2708 1.91008C13.2708 1.72463 13.1329 1.58676 12.9474 1.58675V1.58675ZM4.87823 2.23332H11.1216V4.89669L7.99994 7.3805L4.87823 4.89669V2.23332ZM5.21157 2.56666V4.73593L7.99994 6.95452L10.7883 4.73593V2.56666H5.21157ZM7.99958 8.45673L11.1216 10.9237V13.7505H4.87823V10.9403L7.99958 8.45673ZM8.0003 8.88213L5.21157 11.101V13.4172H10.7883V11.0852L8.0003 8.88213Z",fill:"white"})]})),Zh=PT;var Be=y(i=>{var r=i,{children:e,className:t,placement:o="top"}=r,n=ot(r,["children","className","placement"]);return jsx(TT,A(S({arrow:true,placement:o},n),{classes:{popper:t,tooltip:"stigg-tooltip",arrow:"stigg-tooltip-arrow"},children:jsx("div",{children:e})}))})(({theme:e,$padding:t=8,$maxWidth:o=300})=>({[`& .${tooltipClasses.tooltip}`]:{backgroundColor:e.stigg.palette.white,maxWidth:o,boxShadow:e.stigg.shadows.popover,padding:t,borderRadius:e.stigg.border.radius,color:e.stigg.palette.text.primary},[`& .${tooltipClasses.arrow}`]:{color:e.stigg.palette.white}}));var _T=y(P)`
525
525
  display: ${({$display:e})=>e};
526
526
  -webkit-line-clamp: ${({$maxLines:e})=>e};
527
527
  -webkit-box-orient: vertical;
@@ -535,7 +535,7 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
535
535
  ${({$bold:e})=>e&&css`
536
536
  font-weight: bold;
537
537
  `}
538
- `;function Vm(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var so=({leaveDelay:e,children:t,variant:o,color:n,maxLines:i=1,wordBreak:r,bold:a,tooltipPlacement:s="top",className:l,display:c="-webkit-box",style:d,"data-testid":u})=>{let[p,m]=useState(false),h=useRef(null),f=jsx(hT,{ref:h,variant:o,color:n,$maxLines:i,$wordBreak:r,$bold:a,className:l,$display:c,style:d,"data-testid":u,children:t});useEffect(()=>{if(h!=null&&h.current){let y=Vm(h.current);m(y);}},[h]);let g=(h==null?void 0:h.current)&&Vm(h.current);return jsx("span",{children:p||g?jsx(Fe,{placement:s,leaveDelay:e,title:jsx(C,{variant:"body1",children:t}),children:f}):f})};var gT=x.div`
538
+ `;function Qh(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var ue=({leaveDelay:e,children:t,variant:o,color:n,maxLines:i=1,wordBreak:r,bold:a,tooltipPlacement:s="top",className:l,display:c="-webkit-box",style:d,"data-testid":u})=>{let[p,h]=useState(false),m=useRef(null),g=jsx(_T,{ref:m,variant:o,color:n,$maxLines:i,$wordBreak:r,$bold:a,className:l,$display:c,style:d,"data-testid":u,children:t});useEffect(()=>{if(m!=null&&m.current){let x=Qh(m.current);h(x);}},[m]);let f=(m==null?void 0:m.current)&&Qh(m.current);return jsx("span",{children:p||f?jsx(Be,{placement:s,leaveDelay:e,title:jsx(P,{variant:"body1",children:t}),children:g}):g})};var IT=y.div`
539
539
  width: 100%;
540
540
  display: flex;
541
541
  align-items: center;
@@ -544,48 +544,48 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
544
544
  border-radius: 10px;
545
545
  padding: 8px 16px;
546
546
  margin-top: 16px;
547
- `,yT=x(fT)`
547
+ `,ET=y(MT)`
548
548
  text-decoration-color: white;
549
549
  color: white;
550
550
  cursor: pointer;
551
- `;function Wm({subscription:e,includePlanName:t,onManageSubscription:o}){return (e==null?void 0:e.status)!==SubscriptionStatus.InTrial?null:jsxs(gT,{className:"stigg-subscription-trial-badge",children:[jsx(Om,{className:"stigg-subscription-trial-badge-image"}),jsx("div",{style:{flex:1,marginRight:4},children:jsxs(so,{variant:"body1",className:"stigg-subscription-trial-badge-text",color:"white",children:[`${e.trialRemainingDays} days remaining in trial`,t&&` of the ${e.planName} plan`]})}),jsx(yT,{className:"stigg-subscription-trial-upgrade-button",onClick:()=>o({intentionType:"UPGRADE_TRIAL_PLAN"}),children:jsx(C,{color:"white",children:"Upgrade plan"})})]})}function jm({mainSubscription:e,trialSubscription:t,onManageSubscription:o,theme:n}){return jsxs("div",{className:"stigg-subscription-view-layout",children:[jsxs(C,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:n.planNameColor,style:{marginTop:8},children:[e.planName," plan"]}),jsx(Wm,{subscription:t,includePlanName:(t==null?void 0:t.planName)!==e.planName,onManageSubscription:o})]})}var Jl=70;function kn(e,t){return Math.min(Math.floor(e/t*100),100)}function Zm(e){let t;return e<Jl?t="standard":e<100?t="warning":t="error",t}function Xm(e){if(!e.resetPeriod||!e.usagePeriodEnd)return null;let t=o=>Xc.utc(e.usagePeriodEnd).diff(Xc.utc(),o);switch(e.resetPeriod){case EntitlementResetPeriod.Month:return `Resets monthly - in ${t("days")} days`;case EntitlementResetPeriod.Week:return `Resets weekly - in ${t("days")} days`;case EntitlementResetPeriod.Day:return `Resets daily - in ${t("hours")} hours`;case EntitlementResetPeriod.Hour:return `Resets hourly - in ${t("minutes")} minutes`;default:return null}}var PT=x(bT)`
551
+ `;function tg({subscription:e,includePlanName:t,onManageSubscription:o}){return (e==null?void 0:e.status)!==SubscriptionStatus.InTrial?null:jsxs(IT,{className:"stigg-subscription-trial-badge",children:[jsx(Zh,{className:"stigg-subscription-trial-badge-image"}),jsx("div",{style:{flex:1,marginRight:4},children:jsxs(ue,{variant:"body1",className:"stigg-subscription-trial-badge-text",color:"white",children:[`${e.trialRemainingDays} days remaining in trial`,t&&` of the ${e.planName} plan`]})}),jsx(ET,{className:"stigg-subscription-trial-upgrade-button",onClick:()=>o({intentionType:"UPGRADE_TRIAL_PLAN"}),children:jsx(P,{color:"white",children:"Upgrade plan"})})]})}function og({mainSubscription:e,trialSubscription:t,onManageSubscription:o,theme:n}){return jsxs("div",{className:"stigg-subscription-view-layout",children:[jsxs(P,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:n.planNameColor,style:{marginTop:8},children:[e.planName," plan"]}),jsx(tg,{subscription:t,includePlanName:(t==null?void 0:t.planName)!==e.planName,onManageSubscription:o})]})}var sc=70;function so(e,t){return t===0?0:Math.min(Math.floor(e/t*100),100)}function ig(e){let t;return e<sc?t="standard":e<100?t="warning":t="error",t}function rg(e){if(!e.resetPeriod||!e.usagePeriodEnd)return null;let t=o=>rd.utc(e.usagePeriodEnd).diff(rd.utc(),o);switch(e.resetPeriod){case EntitlementResetPeriod.Month:return `Resets monthly - in ${t("days")} days`;case EntitlementResetPeriod.Week:return `Resets weekly - in ${t("days")} days`;case EntitlementResetPeriod.Day:return `Resets daily - in ${t("hours")} hours`;case EntitlementResetPeriod.Hour:return `Resets hourly - in ${t("minutes")} minutes`;default:return null}}var RT=y(LT)`
552
552
  height: 4px;
553
553
  background-color: ${({theme:e})=>Do(e.stigg.palette.primary).alpha(.4).string()};
554
554
 
555
555
  span {
556
556
  background-color: ${({$progressStatus:e,theme:t})=>{switch(e){case "standard":return t.stigg.palette.primary;case "warning":return t.stigg.palette.warning;case "error":return t.stigg.palette.error;default:return t.stigg.palette.primary}}};
557
557
  }
558
- `,ST=x(sf)`
558
+ `;function Yr({currentUsage:e,usageLimit:t,classNamePrefix:o="stigg-usage-progress-bar"}){let n=so(e,t),i=ig(n);return jsx(RT,{$progressStatus:i,className:`${o} ${o}-${i}`,variant:"determinate",value:n})}var OT=y(gg)`
559
559
  border-style: dotted;
560
560
  border-bottom-width: 2px;
561
561
  border-color: ${({theme:e})=>Do(e.stigg.palette.outlinedRestingBorder).alpha(.4).string()};
562
- `;function jr({entitlement:e}){if(e.hasUnlimitedUsage)return jsx(ST,{});let t=kn(e.currentUsage||0,e.usageLimit),o=Zm(t);return jsx(PT,{$progressStatus:o,className:`stigg-feature-usage-progress-bar-${o.toString()}`,variant:"determinate",value:t})}var Qm=x(b2)`
562
+ `;function Zr({entitlement:e}){return e.hasUnlimitedUsage?jsx(OT,{}):jsx(Yr,{currentUsage:e.currentUsage||0,usageLimit:e.usageLimit,classNamePrefix:"stigg-feature-usage-progress-bar"})}var sg=y(L2)`
563
563
  text-transform: none;
564
564
  padding: 0;
565
565
  white-space: nowrap;
566
- `;function Zr({entitlement:e,feature:t,onManageSubscription:o,onBuyMore:n,canBuyMore:i,canUpgradeSubscription:r,hasCustomSubscription:a}){return a||e.hasUnlimitedUsage||kn(e.currentUsage||0,e.usageLimit)<Jl?null:i?n?jsx(Qm,{variant:"text",onClick:()=>n(t,e),children:jsx(C,{color:"primary.main",children:"Buy more"})}):null:r&&o?jsx(Qm,{variant:"text",onClick:()=>o({intentionType:"UPGRADE_PLAN"}),children:jsx(C,{color:"primary.main",children:"Upgrade"})}):null}function Jm({amount:e,currency:t,blockSize:o,entitlement:n,feature:i,hideChargePrice:r,onBuyMore:a,onManageSubscription:s,canUpgradeSubscription:l,hasCustomSubscription:c}){var d,u,p;return jsxs("div",{className:`stigg-charge-list-item stigg-charge-list-item-${n.feature.refId}`,style:{display:"flex",flexDirection:"column",gap:12},children:[jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[jsxs("div",{style:{display:"flex",gap:12},children:[jsx(so,{variant:"body1",color:"primary",children:i.displayName}),!r&&jsxs(so,{variant:"body1",color:"secondary",children:[at({amount:e,currency:t})," per ",o?`${o} `:"",o?i.featureUnitsPlural:i.featureUnits]})]}),jsxs("div",{style:{display:"flex",gap:12},children:[jsx(Zr,{entitlement:n,feature:i,canBuyMore:true,onBuyMore:a,onManageSubscription:s,canUpgradeSubscription:l,hasCustomSubscription:c}),jsx(C,{variant:"body1",color:"primary",style:{whiteSpace:"nowrap"},children:n.hasUnlimitedUsage?(d=n.currentUsage)==null?void 0:d.toLocaleString():`${(u=n.currentUsage)==null?void 0:u.toLocaleString()} of ${(p=n.usageLimit)==null?void 0:p.toLocaleString()}`})]})]}),jsx(jr,{entitlement:n})]})}function ef({subscription:e,entitlements:t,onBuyMore:o,onManageSubscription:n,hasCustomSubscription:i,canUpgradeSubscription:r}){let a=keyBy(t,"feature.refId"),s=e.prices.filter(({feature:l,price:c})=>!!l&&a[l.refId]&&!!c);return s.length?jsx("div",{className:"stigg-charge-list",style:{display:"flex",flexDirection:"column",gap:16,marginTop:32},children:s.map(({feature:l,price:c,blockSize:d,billingModel:u})=>{if(!l||!c)return null;let p=a[l.refId];return !p||!p.feature?null:jsx(Jm,{entitlement:p,feature:p.feature,amount:c.amount,blockSize:d,currency:c.currency,hideChargePrice:u===BillingModel.PerUnit,onBuyMore:o,onManageSubscription:n,canUpgradeSubscription:r,hasCustomSubscription:i},l.refId)})}):null}function Kr({onManageSubscription:e,onBuyMore:t,onCancelScheduledUpdates:o,onContactSupport:n,hiddenSections:i,cancelScheduledUpdatesButtonTitle:r}){let{customerPortal:a,isLoading:s,textOverrides:l,theme:c}=ft(),d=s||!a,{subscriptions:u,entitlements:p,canUpgradeSubscription:m}=a||{},h=u==null?void 0:u.find(({status:P})=>P===SubscriptionStatus.Active),f=u==null?void 0:u.find(({status:P})=>P===SubscriptionStatus.InTrial),g=(h==null?void 0:h.pricingType)===PricingType.Custom,y=h||f;return jsxs(Se,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:c.backgroundColor,$borderColor:c.borderColor,children:[!d&&h&&h.scheduledUpdates&&jsx(Im,{theme:c,subscription:h,onCancelScheduledUpdates:o,cancelScheduledUpdatesButtonTitle:r}),d||!y?jsx(_m,{}):jsxs("div",{className:"stigg-overview-layout",style:{display:"flex",alignItems:"flex-start",gap:64,flexWrap:"wrap"},children:[jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[jsx(gm,{onManageSubscription:e,hideManageButton:g,textOverrides:l}),jsx(jm,{mainSubscription:y,trialSubscription:f,theme:c,onManageSubscription:e}),h&&p&&jsx(ef,{subscription:h,entitlements:p,onBuyMore:t,onManageSubscription:e,canUpgradeSubscription:!!m,hasCustomSubscription:g}),jsx(km,{customerPortal:a,hiddenSections:i,textOverrides:l,theme:c})]}),jsx("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24},children:jsx(Dm,{subscription:y,theme:c,onContactSupport:n,textOverrides:l})})]})]})}var _T=x.div`
566
+ `;function Kr({featureEntitlement:e,feature:t,onManageSubscription:o,onBuyMore:n,canBuyMore:i,canUpgradeSubscription:r,hasCustomSubscription:a}){return a||e.hasUnlimitedUsage||so(e.currentUsage||0,e.usageLimit)<sc?null:i?n?jsx(sg,{variant:"text",onClick:()=>n(t,e),children:jsx(P,{color:"primary.main",children:"Buy more"})}):null:r&&o?jsx(sg,{variant:"text",onClick:()=>o({intentionType:"UPGRADE_PLAN"}),children:jsx(P,{color:"primary.main",children:"Upgrade"})}):null}function lg({amount:e,currency:t,blockSize:o,featureEntitlement:n,feature:i,hideChargePrice:r,onBuyMore:a,onManageSubscription:s,canUpgradeSubscription:l,hasCustomSubscription:c}){var d,u,p;return jsxs("div",{className:`stigg-charge-list-item stigg-charge-list-item-${n.feature.refId}`,style:{display:"flex",flexDirection:"column",gap:12},children:[jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[jsxs("div",{style:{display:"flex",gap:12},children:[jsx(ue,{variant:"body1",color:"primary",children:i.displayName}),!r&&jsxs(ue,{variant:"body1",color:"secondary",children:[at({amount:e,currency:t})," per ",o?`${o} `:"",o?i.featureUnitsPlural:i.featureUnits]})]}),jsxs("div",{style:{display:"flex",gap:12},children:[jsx(Kr,{featureEntitlement:n,feature:i,canBuyMore:true,onBuyMore:a,onManageSubscription:s,canUpgradeSubscription:l,hasCustomSubscription:c}),jsx(P,{variant:"body1",color:"primary",style:{whiteSpace:"nowrap"},children:n.hasUnlimitedUsage?(d=n.currentUsage)==null?void 0:d.toLocaleString():`${(u=n.currentUsage)==null?void 0:u.toLocaleString()} of ${(p=n.usageLimit)==null?void 0:p.toLocaleString()}`})]})]}),jsx(Zr,{entitlement:n})]})}function dg({subscription:e,entitlements:t,onBuyMore:o,onManageSubscription:n,hasCustomSubscription:i,canUpgradeSubscription:r}){let a=keyBy(t,"feature.refId"),s=e.prices.filter(({feature:l,price:c})=>!!l&&a[l.refId]&&!!c);return s.length?jsx("div",{className:"stigg-charge-list",style:{display:"flex",flexDirection:"column",gap:16,marginTop:32},children:s.map(({feature:l,price:c,blockSize:d,billingModel:u})=>{if(!l||!c)return null;let p=a[l.refId];return !p||!p.feature?null:jsx(lg,{featureEntitlement:p,feature:p.feature,amount:c.amount,blockSize:d,currency:c.currency,hideChargePrice:u===BillingModel.PerUnit,onBuyMore:o,onManageSubscription:n,canUpgradeSubscription:r,hasCustomSubscription:i},l.refId)})}):null}function kn(e){return e.__typename==="FeatureEntitlement"}function Qr(e){return e.__typename==="CreditEntitlement"}function Jr({onManageSubscription:e,onBuyMore:t,onCancelScheduledUpdates:o,onContactSupport:n,hiddenSections:i,cancelScheduledUpdatesButtonTitle:r}){let{customerPortal:a,isLoading:s,textOverrides:l,theme:c}=ut(),d=s||!a,{subscriptions:u,entitlementsV2:p,canUpgradeSubscription:h}=a||{},m=useMemo(()=>p?p.filter(kn):[],[p]),g=u==null?void 0:u.find(({status:T})=>T===SubscriptionStatus.Active),f=u==null?void 0:u.find(({status:T})=>T===SubscriptionStatus.InTrial),x=(g==null?void 0:g.pricingType)===PricingType.Custom,b=g||f;return jsxs(Te,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:c.backgroundColor,$borderColor:c.borderColor,children:[!d&&g&&g.scheduledUpdates&&jsx(zh,{theme:c,subscription:g,onCancelScheduledUpdates:o,cancelScheduledUpdatesButtonTitle:r}),d||!b?jsx(Nh,{}):jsxs("div",{className:"stigg-overview-layout",style:{display:"flex",alignItems:"flex-start",gap:64,flexWrap:"wrap"},children:[jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[jsx(vh,{onManageSubscription:e,hideManageButton:x,textOverrides:l}),jsx(og,{mainSubscription:b,trialSubscription:f,theme:c,onManageSubscription:e}),g&&m.length>0&&jsx(dg,{subscription:g,entitlements:m,onBuyMore:t,onManageSubscription:e,canUpgradeSubscription:!!h,hasCustomSubscription:x}),jsx(Bh,{customerPortal:a,hiddenSections:i,textOverrides:l,theme:c})]}),jsx("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24},children:jsx(jh,{subscription:b,theme:c,onContactSupport:n,textOverrides:l})})]})]})}var GT=y.div`
567
567
  display: flex;
568
568
  width: 100%;
569
569
  align-items: flex-end;
570
570
  justify-content: flex-end;
571
571
  margin-bottom: 24px;
572
- `;function rf({showWatermark:e}){return jsx(_T,{className:"stigg-customer-portal-header-layout",children:jsx(Jt,{source:"customer_portal",showWatermark:e})})}var MT=x(C)`
572
+ `;function mg({showWatermark:e}){return jsx(GT,{className:"stigg-customer-portal-header-layout",children:jsx(Jt,{source:"customer_portal",showWatermark:e})})}var YT=y(P)`
573
573
  text-transform: none;
574
- `,IT=x(ExternalLink)`
574
+ `,ZT=y(ExternalLink)`
575
575
  color: ${({theme:e})=>e.stigg.palette.primary};
576
- `;function qr({text:e,url:t,className:o}){return jsx(ao,{className:o,variant:"outlined",startIcon:jsx(IT,{size:20,strokeWidth:2.5}),onClick:()=>{window.open(t,"_blank");},children:jsx(MT,{color:"primary.main",children:e})})}var Qr=x.div`
576
+ `;function ta({text:e,url:t,className:o}){return jsx(ao,{className:o,variant:"outlined",startIcon:jsx(ZT,{size:20,strokeWidth:2.5}),onClick:()=>{window.open(t,"_blank");},children:jsx(YT,{color:"primary.main",children:e})})}var ea=y.div`
577
577
  display: flex;
578
578
  flex-direction: column;
579
579
  align-items: flex-start;
580
580
  gap: 16px;
581
581
  flex: 1 0 0;
582
- `,LT=x.div`
582
+ `,XT=y.div`
583
583
  display: flex;
584
584
  align-items: flex-start;
585
585
  gap: 16px;
586
586
  align-self: stretch;
587
587
  flex-wrap: wrap;
588
- `;function nc({title:e,rows:t}){return jsxs(Qr,{children:[jsx(C,{variant:"h6",color:"secondary",bold:true,children:e}),t.map(({classNamePrefix:o,label:n,value:i,labelTypographyProps:r,valueTypographyProps:a})=>jsxs(LT,{children:[jsx(C,_(S({className:`${o}-label`,variant:"body1",color:"secondary",style:{width:80}},r),{children:n})),jsx(C,_(S({className:`${o}-text`,variant:"body1",color:"secondary"},a),{children:i}))]},n))]})}function Jr(){return jsx(ro,{width:220,height:42})}var lf="-";function ea(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:n}=ft(),i=Dt("md"),{billingInformation:r}=e||{},a=!r||t,s=[];if(a?s.push(jsxs(Qr,{children:[jsx(ro,{width:220,height:12}),jsx(ro,{width:220,height:12}),jsx(ro,{width:220,height:12})]},"information-loading-data-top"),jsx(sf,{orientation:"vertical",style:{minHeight:93,display:i?"block":"none"}},"information-loading-data-divider"),jsxs(Qr,{children:[jsx(ro,{width:220,height:12}),jsx(ro,{width:220,height:12}),jsx(ro,{width:220,height:12})]},"information-loading-data-bottom")):(s.push(jsx(nc,{title:"Billed to",rows:[{classNamePrefix:"stigg-customer-name",label:"Name",value:(r==null?void 0:r.name)||lf,valueTypographyProps:r!=null&&r.name?{}:{color:"disabled"}},{classNamePrefix:"stigg-customer-email",label:"Email",value:(r==null?void 0:r.email)||lf,valueTypographyProps:r!=null&&r.email?{}:{color:"disabled"}}]},"information-billing-data-billed-to")),r!=null&&r.defaultPaymentMethodId&&r.defaultPaymentMethodLast4Digits&&r.defaultPaymentExpirationMonth&&r.defaultPaymentExpirationYear&&(s.unshift(jsx(sf,{orientation:"vertical",style:{minHeight:93,display:i?"block":"none"}},"information-billing-data-divider")),s.unshift(jsx(nc,{title:"Payment method",rows:[{classNamePrefix:"stigg-credit-card",label:"Card",value:`Ending in ${r.defaultPaymentMethodLast4Digits}`},{classNamePrefix:"stigg-credit-card-expiration",label:"Expires",value:`${padStart(r.defaultPaymentExpirationMonth.toString(),2,"0")}/${r.defaultPaymentExpirationYear}`}]},"information-billing-data-payment-method")))),!a&&!(r!=null&&r.name)&&!(r!=null&&r.email)&&!(r!=null&&r.defaultPaymentMethodId))return null;let l=a?jsx(Jr,{}):e!=null&&e.billingPortalUrl?jsx(qr,{url:e.billingPortalUrl,text:o.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return jsxs(Se,{className:"stigg-payment-details-section-layout",$backgroundColor:n.backgroundColor,$borderColor:n.borderColor,children:[jsxs(be,{className:"stigg-payment-details-section-header",children:[jsx(Ce,{isLoading:a,className:"stigg-payment-details-section-title",title:"Payment details"}),l]}),jsx("div",{style:{display:"flex",alignItems:"stretch",gap:i?64:32,flexWrap:"wrap"},children:s})]})}var cf=x(Se)`
588
+ `;function uc({title:e,rows:t}){return jsxs(ea,{children:[jsx(P,{variant:"h6",color:"secondary",bold:true,children:e}),t.map(({classNamePrefix:o,label:n,value:i,labelTypographyProps:r,valueTypographyProps:a})=>jsxs(XT,{children:[jsx(P,A(S({className:`${o}-label`,variant:"body1",color:"secondary",style:{width:80}},r),{children:n})),jsx(P,A(S({className:`${o}-text`,variant:"body1",color:"secondary"},a),{children:i}))]},n))]})}function oa(){return jsx(ro,{width:220,height:42})}var fg="-";function ia(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:n}=ut(),i=Dt("md"),{billingInformation:r}=e||{},a=!r||t,s=[];if(a?s.push(jsxs(ea,{children:[jsx(ro,{width:220,height:12}),jsx(ro,{width:220,height:12}),jsx(ro,{width:220,height:12})]},"information-loading-data-top"),jsx(gg,{orientation:"vertical",style:{minHeight:93,display:i?"block":"none"}},"information-loading-data-divider"),jsxs(ea,{children:[jsx(ro,{width:220,height:12}),jsx(ro,{width:220,height:12}),jsx(ro,{width:220,height:12})]},"information-loading-data-bottom")):(s.push(jsx(uc,{title:"Billed to",rows:[{classNamePrefix:"stigg-customer-name",label:"Name",value:(r==null?void 0:r.name)||fg,valueTypographyProps:r!=null&&r.name?{}:{color:"disabled"}},{classNamePrefix:"stigg-customer-email",label:"Email",value:(r==null?void 0:r.email)||fg,valueTypographyProps:r!=null&&r.email?{}:{color:"disabled"}}]},"information-billing-data-billed-to")),r!=null&&r.defaultPaymentMethodId&&r.defaultPaymentMethodLast4Digits&&r.defaultPaymentExpirationMonth&&r.defaultPaymentExpirationYear&&(s.unshift(jsx(gg,{orientation:"vertical",style:{minHeight:93,display:i?"block":"none"}},"information-billing-data-divider")),s.unshift(jsx(uc,{title:"Payment method",rows:[{classNamePrefix:"stigg-credit-card",label:"Card",value:`Ending in ${r.defaultPaymentMethodLast4Digits}`},{classNamePrefix:"stigg-credit-card-expiration",label:"Expires",value:`${padStart(r.defaultPaymentExpirationMonth.toString(),2,"0")}/${r.defaultPaymentExpirationYear}`}]},"information-billing-data-payment-method")))),!a&&!(r!=null&&r.name)&&!(r!=null&&r.email)&&!(r!=null&&r.defaultPaymentMethodId))return null;let l=a?jsx(oa,{}):e!=null&&e.billingPortalUrl?jsx(ta,{url:e.billingPortalUrl,text:o.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return jsxs(Te,{className:"stigg-payment-details-section-layout",$backgroundColor:n.backgroundColor,$borderColor:n.borderColor,children:[jsxs(Ce,{className:"stigg-payment-details-section-header",children:[jsx(Pe,{isLoading:a,className:"stigg-payment-details-section-title",title:"Payment details"}),l]}),jsx("div",{style:{display:"flex",alignItems:"stretch",gap:i?64:32,flexWrap:"wrap"},children:s})]})}var yg=y(Te)`
589
589
  position: relative;
590
590
 
591
591
  .stigg-paywall-layout {
@@ -607,10 +607,10 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
607
607
  margin-right: auto;
608
608
  }
609
609
 
610
- .${El} {
610
+ .${Vl} {
611
611
  display: none;
612
612
  }
613
- `;var ic=forwardRef(({paywallComponent:e,theme:t,title:o,isLoading:n},i)=>e?jsxs(cf,{className:"stigg-customer-portal-paywall-section",ref:i,$backgroundColor:t.backgroundColor,$borderColor:t.borderColor,children:[jsx(be,{className:"stigg-customer-portal-paywall-header",children:jsx(Ce,{isLoading:n,className:"stigg-customer-portal-paywall-section-title",title:o})}),e]}):null);ic.displayName="CustomerPortalPaywall";var uf=x.div`
613
+ `;var pc=forwardRef(({paywallComponent:e,theme:t,title:o,isLoading:n},i)=>e?jsxs(yg,{className:"stigg-customer-portal-paywall-section",ref:i,$backgroundColor:t.backgroundColor,$borderColor:t.borderColor,children:[jsx(Ce,{className:"stigg-customer-portal-paywall-header",children:jsx(Pe,{isLoading:n,className:"stigg-customer-portal-paywall-section-title",title:o})}),e]}):null);pc.displayName="CustomerPortalPaywall";var bg=y.div`
614
614
  width: 100%;
615
615
  display: flex;
616
616
  flex-direction: column;
@@ -619,13 +619,13 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
619
619
  & * {
620
620
  box-sizing: border-box;
621
621
  }
622
- `,pf=x.div`
622
+ `,Cg=y.div`
623
623
  width: 100%;
624
624
  display: flex;
625
625
  flex-direction: column;
626
626
  align-items: center;
627
627
  row-gap: 24px;
628
- `;function vi(e,t,o){if(!t&&!o)return e;let n=rc(e);return n===rc(t||"")||n===rc(o||"")?e:`${e} (${o})`}function hf(e){return vi(e.displayName,e.featureUnits,e.featureUnitsPlural)}var mf=x.div`
628
+ `;var Tg=6;function wg({featureEntitlements:e,creditEntitlements:t,showAll:o}){let n=e.length+t.length,i=o?n:Math.min(n,Tg),r=e.slice(0,i),a=i-r.length,s=t.slice(0,Math.max(0,a)),l=n>Tg;return {entitlementsToShow:r,creditsToShow:s,totalItemsCount:n,showMoreVisible:l}}function ok(e){var t,o;return ((t=e.feature)==null?void 0:t.meterType)===MeterType.Fluctuating||((o=e.feature)==null?void 0:o.meterType)===MeterType.Incremental}function vg(e,t){return t?e>2?4:6:12}function kg(e){let t=[],o=[];for(let n of e)kn(n)?t.push(n):Qr(n)&&o.push(n);return {feature:t,credit:o}}function _g({packageEntitlements:e,activeSubscription:t,filterEntitlements:o,filterPackageEntitlements:n}){var b,T;let{feature:i,credit:r}=kg(e!=null?e:[]),a=i.filter(ok),s=Sg((b=t==null?void 0:t.prices)!=null?b:[],"feature.refId"),l=Sg(a,"feature.refId"),c=((T=t==null?void 0:t.prices)!=null?T:[]).map(k=>k.feature?l[k.feature.refId]:void 0).filter(k=>!!k),d=a.filter(k=>k.feature&&!s[k.feature.refId]),u=[...c,...d].filter(k=>k.usageLimit!==0),p=r.filter(k=>{var w;return ((w=k.usageLimit)!=null?w:0)>0}),h=[...u,...p],m=n?n({entitlements:h}).entitlements:[...o?o(u):u,...p],{feature:g,credit:f}=kg(m),x=(t==null?void 0:t.pricingType)===PricingType.Custom;return {subscriptionPriceByFeature:s,filteredFeatureEntitlements:g,filteredCreditEntitlements:f,hasCustomSubscription:x}}function Ag({filterEntitlements:e,filterPackageEntitlements:t}){let[o,n]=useState(false),i=Dt("md"),{customerPortal:r,isLoading:a}=ut(),s=useMemo(()=>{var _;let w=r==null?void 0:r.entitlementsV2,v=(_=r==null?void 0:r.subscriptions)==null?void 0:_.find(M=>M.status===SubscriptionStatus.Active);return _g({packageEntitlements:w,activeSubscription:v,filterEntitlements:e,filterPackageEntitlements:t})},[r==null?void 0:r.entitlementsV2,r==null?void 0:r.subscriptions,e,t]),{subscriptionPriceByFeature:l,filteredFeatureEntitlements:c,filteredCreditEntitlements:d,hasCustomSubscription:u}=s,p=a||!r,h=!!(r!=null&&r.canUpgradeSubscription),{entitlementsToShow:m,creditsToShow:g,totalItemsCount:f,showMoreVisible:x}=wg({featureEntitlements:c,creditEntitlements:d,showAll:o}),b=vg(f,i),T=()=>n(w=>!w),k=!p&&c.length===0&&d.length===0;return {isLoadingData:p,entitlementsToShow:m,creditsToShow:g,subscriptionPriceByFeature:l,totalItemsCount:f,gridSizeXs:b,hasCustomSubscription:u,canUpgradeSubscription:h,showAll:o,toggleShowAll:T,hasNoItems:k,showMoreVisible:x}}function vi(e,t,o){if(!t&&!o)return e;let n=mc(e);return n===mc(t||"")||n===mc(o||"")?e:`${e} (${o})`}function Mg(e){return vi(e.displayName,e.featureUnits,e.featureUnitsPlural)}var ra=y.div`
629
629
  display: flex;
630
630
  flex-direction: column;
631
631
  padding: 24px;
@@ -635,12 +635,12 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
635
635
  height: 100%;
636
636
 
637
637
  ${({theme:e,$highlight:t})=>t&&`background-color: ${e.stigg.palette.backgroundSection}`};
638
- `;function gf({entitlement:e,subscriptionPrice:t,onManageSubscription:o,onBuyMore:n,hasCustomSubscription:i,canUpgradeSubscription:r}){var l,c,d;let{theme:a}=ft(),s=!e.hasUnlimitedUsage&&e.currentUsage>e.usageLimit;return e.feature?jsxs(mf,{$highlight:!!t,$borderColor:a.borderColor,children:[jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[jsx(so,{variant:"body1",children:e.feature&&hf(e.feature)}),t&&jsx(Fe,{title:jsx(C,{variant:"body1",children:t.billingModel===BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage"}),children:jsx(pt,{icon:"DollarCoin",svgStrokeColor:a.iconsColor})})]}),jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[jsxs(so,{variant:"body1",color:s?"error":"primary","data-testid":`usage-data-${(l=e.feature)==null?void 0:l.refId}`,children:[(c=e.currentUsage)==null?void 0:c.toLocaleString(),!e.hasUnlimitedUsage&&` / ${(d=e.usageLimit)==null?void 0:d.toLocaleString()} (${kn(e.currentUsage||0,e.usageLimit)}%)`]}),jsx(Zr,{entitlement:e,feature:e.feature,onBuyMore:n,canBuyMore:!!t,onManageSubscription:o,canUpgradeSubscription:r,hasCustomSubscription:i})]}),jsx(jr,{entitlement:e}),!e.hasUnlimitedUsage&&!ff(e.usageLimit)&&!ff(e.currentUsage)&&e.resetPeriod&&e.usagePeriodEnd?jsx(C,{color:"secondary",children:Xm(e)}):null,e.hasUnlimitedUsage&&jsx(C,{color:"secondary",children:"In current billing period"})]}):null}var xf=x.div`
638
+ `;function Eg({entitlement:e,subscriptionPrice:t,onManageSubscription:o,onBuyMore:n,hasCustomSubscription:i,canUpgradeSubscription:r}){var l,c,d;let{theme:a}=ut(),s=!e.hasUnlimitedUsage&&e.currentUsage>e.usageLimit;return e.feature?jsxs(ra,{$highlight:!!t,$borderColor:a.borderColor,children:[jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[jsx(ue,{variant:"body1",children:e.feature&&Mg(e.feature)}),t&&jsx(Be,{title:jsx(P,{variant:"body1",children:t.billingModel===BillingModel$1.PerUnit?"Billed for committed usage":"Billed for actual usage"}),children:jsx(mt,{icon:"DollarCoin",svgStrokeColor:a.iconsColor})})]}),jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[jsxs(ue,{variant:"body1",color:s?"error":"primary","data-testid":`usage-data-${(l=e.feature)==null?void 0:l.refId}`,children:[(c=e.currentUsage)==null?void 0:c.toLocaleString(),!e.hasUnlimitedUsage&&` / ${(d=e.usageLimit)==null?void 0:d.toLocaleString()} (${so(e.currentUsage||0,e.usageLimit)}%)`]}),jsx(Kr,{featureEntitlement:e,feature:e.feature,onBuyMore:n,canBuyMore:!!t,onManageSubscription:o,canUpgradeSubscription:r,hasCustomSubscription:i})]}),jsx(Zr,{entitlement:e}),!e.hasUnlimitedUsage&&!Ig(e.usageLimit)&&!Ig(e.currentUsage)&&e.resetPeriod&&e.usagePeriodEnd?jsx(P,{color:"secondary",children:rg(e)}):null,e.hasUnlimitedUsage&&jsx(P,{color:"secondary",children:"In current billing period"})]}):null}function hc({currentUsage:e,usageLimit:t}){return jsx(Yr,{currentUsage:e,usageLimit:t,classNamePrefix:"stigg-credit-usage-progress-bar"})}function la({creditEntitlement:e}){let{theme:t}=ut(),{currency:o,currentUsage:n,usageLimit:i}=e,r=(n!=null?n:0)>(i!=null?i:0),a=so(n!=null?n:0,i!=null?i:0),s=o.displayName;return jsxs(ra,{$highlight:false,$borderColor:t.borderColor,className:"stigg-credit-usage-container",children:[jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:jsx(ue,{variant:"body1",className:"stigg-credit-usage-title",children:s})}),jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:jsxs(ue,{variant:"body1",color:r?"error":"primary",className:"stigg-credit-usage-value","data-testid":`credit-usage-data-${o.currencyId}`,children:[(n!=null?n:0).toLocaleString()," / ",(i!=null?i:0).toLocaleString()," (",a,"%)"]})}),jsx(hc,{currentUsage:n!=null?n:0,usageLimit:i!=null?i:0})]})}function Lg({featureEntitlements:e,creditEntitlements:t,subscriptionPriceByFeature:o,gridSizeXs:n,onManageSubscription:i,onBuyMore:r,hasCustomSubscription:a,canUpgradeSubscription:s}){return jsxs(Se,{container:true,spacing:4,children:[e.filter(l=>!!l.feature).map(l=>{let c=l.feature;return jsx(Se,{className:`stigg-entitlement-usage-${c.refId}`,item:true,xs:n,children:jsx(Eg,{entitlement:l,subscriptionPrice:o[c.refId],onManageSubscription:i,onBuyMore:r,hasCustomSubscription:a,canUpgradeSubscription:s})},c.refId)}),t.map(l=>jsx(Se,{className:`stigg-credit-usage-${l.currency.currencyId}`,item:true,xs:n,children:jsx(la,{creditEntitlement:l})},l.currency.currencyId))]})}var Rg=y.div`
639
639
  margin-top: 32px;
640
- `;function bf(){let e=Dt("md");return jsx(Pe,{container:true,spacing:4,className:"stigg-subscription-usage-skeleton-layout",sx:{flexWrap:"wrap"},children:range(6).map(t=>jsx(Pe,{item:true,xs:e?4:12,children:jsx(ro,{width:280,height:120})},t))})}var kf=6;function na({onManageSubscription:e,onBuyMore:t,filterEntitlements:o}){var B,L;let[n,i]=useState(false),r=Dt("md"),{customerPortal:a,isLoading:s,textOverrides:l,theme:c}=ft(),d=s||!a,{entitlements:u,subscriptions:p}=a||{},m=u==null?void 0:u.filter(E=>{var O,N;return ((O=E.feature)==null?void 0:O.meterType)===MeterType.Fluctuating||((N=E.feature)==null?void 0:N.meterType)===MeterType.Incremental}),h=p==null?void 0:p.find(({status:E})=>E===SubscriptionStatus.Active),f=(h==null?void 0:h.pricingType)===PricingType.Custom,g=!!(a!=null&&a.canUpgradeSubscription),y=keyBy((B=h==null?void 0:h.prices)!=null?B:[],"feature.refId"),P=keyBy(m!=null?m:[],"feature.refId"),T=compact(((L=h==null?void 0:h.prices)!=null?L:[]).map(E=>E.feature&&P[E.feature.refId]||void 0)),k=compact((m!=null?m:[]).filter(E=>!y[E.feature.refId])),w=[...T,...k].filter(E=>E.usageLimit!==0),v=o?o(w):w,A=r?v.length>2?4:6:12,M=n?v:v.slice(0,kf),I=()=>i(E=>!E);return !d&&!(m!=null&&m.length)?null:jsxs(Se,{className:"stigg-subscription-usage-layout",$backgroundColor:c.backgroundColor,$borderColor:c.borderColor,children:[jsx(be,{children:jsx(Ce,{title:l.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:d})}),d?jsx(bf,{}):jsxs(Fragment,{children:[jsx(Pe,{container:true,spacing:4,children:M.map(E=>jsx(Pe,{className:`stigg-entitlement-usage-${E.feature.refId}`,item:true,xs:A,children:jsx(gf,{subscriptionPrice:y[E.feature.refId],entitlement:E,onManageSubscription:e,onBuyMore:t,hasCustomSubscription:f,canUpgradeSubscription:g},E.feature.refId)},E.feature.refId))}),v.length>kf&&jsx(xf,{children:jsx(ao,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:n?jsx(Minus,{}):jsx(Plus,{}),onClick:I,children:n?"Show less":"Show more"})})]})]})}function _f({onManageSubscription:e,onBuyMore:t,onCancelScheduledUpdates:o,onContactSupport:n,paywallComponent:i,hiddenSections:r,filterEntitlements:a}){let{customerPortal:s,textOverrides:l,theme:c,isLoading:d,showWatermark:u}=ft(),p=useRef(null),m=({intentionType:y})=>{var P,T;e?e({intentionType:y,customerSubscriptions:(P=s==null?void 0:s.subscriptions)!=null?P:[]}):(T=p==null?void 0:p.current)==null||T.scrollIntoView({behavior:"smooth"});},h=!(r!=null&&r.some(y=>y==="usage")),f=!(r!=null&&r.some(y=>y==="paymentDetails"||y==="billingInformation")),g=!(r!=null&&r.some(y=>y==="invoices"||y==="billingInformation"));return jsxs(uf,{className:"stigg-customer-portal-layout",children:[jsx(rf,{showWatermark:u}),jsxs(pf,{className:"stigg-customer-portal-sections",children:[jsx(Kr,{onCancelScheduledUpdates:o,onBuyMore:t,onManageSubscription:m,onContactSupport:n,hiddenSections:r,cancelScheduledUpdatesButtonTitle:l.cancelScheduledUpdatesButtonTitle}),h&&jsx(na,{onManageSubscription:m,onBuyMore:t,filterEntitlements:a}),jsx(ic,{ref:p,paywallComponent:i,theme:c,title:l.paywallSectionTitle,isLoading:!s||d}),f&&jsx(ea,{}),g&&jsx(ia,{})]})]})}function Mf(r){var a=r,{textOverrides:e,theme:t,resourceId:o,productId:n}=a,i=ot(a,["textOverrides","theme","resourceId","productId"]);return jsx(Rr,{textOverrides:e,theme:t,resourceId:o,productId:n,children:jsx(_f,S({},i))})}function ia(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:n}=ft(),i=!e||t,r=i?jsx(Jr,{}):e!=null&&e.billingPortalUrl?jsx(qr,{url:e.billingPortalUrl,text:o.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return !i&&!(e!=null&&e.billingPortalUrl)?null:jsx(Se,{className:"stigg-invoices-section-layout",$backgroundColor:n.backgroundColor,$borderColor:n.borderColor,children:jsxs(be,{className:"stigg-invoices-section-header",children:[jsx(Ce,{isLoading:i,className:"stigg-invoices-section-title",title:o.invoicesTitle}),r]})})}var Lf=e=>If(e,"displayName"),sc=e=>If(e,"addon.displayName");function Vo(e){var n,i;let t=(n=e.pricePoints)==null?void 0:n.some(r=>r.amount&&r.amount>0);return !!((i=e.hiddenFromWidgets)!=null&&i.includes(WidgetType.Checkout))&&!t}function XT(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function Bf({addon:e,currency:t,billingCountryCode:o}){return _(S({},e),{pricePoints:e.pricePoints.filter(n=>n.currency===t&&(o?n.billingCountryCode===o:true))})}function Ef({addons:e,billingCountryCode:t,currency:o}){return (e==null?void 0:e.map(n=>Bf({addon:n,currency:o,billingCountryCode:t})))||[]}function Ff({addons:e,billingPeriod:t,billingCountryCode:o,currency:n}){var i;return ((i=e==null?void 0:e.filter(r=>XT(r.addon,t)))==null?void 0:i.map(r=>_(S({},r),{addon:Bf({addon:r.addon,currency:n,billingCountryCode:o})})))||[]}function Rf({activeSubscription:e,plan:t,billingCountryCode:o,billingPeriod:n}){var c,d;let i=[],r=((d=(c=t==null?void 0:t.pricePoints)==null?void 0:c[0])==null?void 0:d.currency)||Currency.Usd,a=Ef({addons:t==null?void 0:t.compatibleAddons,billingCountryCode:o,currency:r}),s=Lf(a.filter(u=>!Vo(u))),l=Ff({addons:e==null?void 0:e.addons,billingPeriod:n,billingCountryCode:o,currency:r});return l!=null&&l.length&&(a!=null&&a.length)&&(i=sc(l.filter(u=>a.some(p=>p.id===u.addon.id)))),{addons:i,initialAddons:KT(i),availableAddons:s}}function JT(){let[,e]=j();return (t,o)=>e(n=>{if(Vo(t))return;let i=n.addonsStep.addons.find(r=>r.addon.id===t.id);if(i){if(Vo(i.addon))return;i.quantity=o;}else n.addonsStep.addons.push({addon:t,quantity:o}),n.addonsStep.addons=sc(n.addonsStep.addons);})}function tk(){let[,e]=j();return t=>e(o=>{let n=o.addonsStep.addons.find(i=>i.addon.id===t);n&&Vo(n.addon)||qT(o.addonsStep.addons,i=>i.addon.id===t);})}function ek(){let[{addonsStep:e}]=j();return e}function Df(){let e=ek();return _(S({},e),{setAddon:JT(),removeAddon:tk()})}function ok(){let[{checkout:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n}]=j();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n}}function nk(){let[,e]=j();return t=>e(o=>{o.widgetState.readOnly=t;})}function ik(){let[,e]=j();return t=>e(o=>{o.widgetState.isValid=t;})}function rk(){let[,e]=j();return t=>e(o=>{o.checkoutSuccess=t;})}function Y(){let{checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n}=ok();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n,setWidgetReadOnly:nk(),setIsValid:ik(),setCheckoutSuccess:rk()}}function Of({planId:e,resourceId:t,billingCountryCode:o,onMockCheckoutState:n}){let{stigg:i}=D(),[r,a]=useState(true),[s,l]=useState();return useEffect(()=>{let c=()=>R(null,null,function*(){try{let d=yield i.getCheckoutState({planId:e,resourceId:t,billingCountryCode:o});l(d);}catch(d){no.error(`Failed to load checkout ${d==null?void 0:d.message}`,d);}finally{a(false);}});if(n){a(false),l(n({planId:e,resourceId:t,billingCountryCode:o}));return}i.isCustomerLoaded&&(a(true),c());},[i,i.isCustomerLoaded,t,e,o,n]),{checkout:s,isLoading:r,showWatermark:i.getShowWatermark()}}var aa=(e,t)=>e.minUnitQuantity&&t<e.minUnitQuantity?e.minUnitQuantity:e.maxUnitQuantity&&t>e.maxUnitQuantity?e.maxUnitQuantity:t;var lc=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===BillingPeriod$1.Monthly)),cc=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===BillingPeriod$1.Annually)),zf=e=>lc(e)&&cc(e);var Hf=(e,t,o)=>e===BillingPeriod$1.Monthly&&t||e===BillingPeriod$1.Annually&&o?e:null,Wf=({pricingModel:e})=>e===BillingModel.PerUnit;function lk(e,t,o){var r;if(!t)return [];let n=$f(e,"featureId"),i=$f(Vf((r=o==null?void 0:o.prices)==null?void 0:r.map(a=>{let{feature:s}=a;return !s||!Wf(a)?null:{featureId:s.featureId,quantity:s.unitQuantity||null}})),"featureId");return Vf(t==null?void 0:t.map(a=>{var d,u,p;let s=(d=a.feature)==null?void 0:d.featureId;if(!s||!Wf(a))return null;let l,c=((u=n[s])==null?void 0:u.quantity)||((p=i[s])==null?void 0:p.quantity);return l=aa(a,c||1),a.isTieredPrice&&!fi(a.tiers)&&(l=Pl(a.tiers,l).upTo),{featureId:s,quantity:l}}))}function ck({plan:e,activeSubscription:t,preferredBillingPeriod:o}){var a,s;let n=lc(e),i=cc(e);if(o){let l=Hf(o,n,i);if(l)return l}if(((a=t==null?void 0:t.plan)==null?void 0:a.id)===(e==null?void 0:e.id))return ((s=t==null?void 0:t.price)==null?void 0:s.billingPeriod)||BillingPeriod$1.Monthly;if(t!=null&&t.prices&&(t==null?void 0:t.prices.length)>0){let l=Hf(t==null?void 0:t.prices[0].billingPeriod,n,i);if(l)return l}return i?BillingPeriod$1.Annually:BillingPeriod$1.Monthly}function Gf({preferredBillingPeriod:e,plan:t,activeSubscription:o,billingCountryCode:n,preconfiguredBillableFeatures:i}){let r=ck({plan:t,activeSubscription:o,preferredBillingPeriod:e}),a=t==null?void 0:t.pricePoints.filter(l=>l.billingPeriod===r),s=lk(i,a,o);return {billingPeriod:r,billableFeatures:s,billingCountryCode:n}}function dk(){let[{planStep:e}]=j();return e}function uk(){let[,e]=j();return (t,o)=>e(n=>{let i=n.planStep.billableFeatures.find(r=>r.featureId===t);i?i.quantity=o:n.planStep.billableFeatures.push({featureId:t,quantity:o});})}function pk(){let[,e]=j();return t=>e(o=>{o.planStep.billingPeriod=t,o.addonsStep.addons=o.addonsStep.addons.filter(n=>n.addon.pricePoints.some(i=>i.billingPeriod===t));})}function te(){let e=dk();return _(S({},e),{setBillingPeriod:pk(),setBillableFeature:uk()})}var Yf=[{key:"PLAN",label:"Plan"},{key:"ADDONS",label:"Add-ons"},{key:"PAYMENT",label:"Payment details"}],jf={activeStep:0,completedSteps:[],steps:Yf,isDisabled:false},mk=(e,t,o,n)=>{if(zf(e)&&!n)return false;let i=t.map(a=>a.featureId),r=o.map(a=>a.featureId);return !(i.length!==r.length||!i.every(a=>r.includes(a)))};function Zf({isLoading:e,skipCheckoutSteps:t,plan:o,availableAddons:n,availableCharges:i,preferredBillingPeriod:r,preconfiguredBillableFeatures:a}){if(e||!o)return jf;let s=[];return t.includes("PLAN")&&mk(o,i,a,r)&&s.push("PLAN"),((n==null?void 0:n.length)===0||t.includes("ADDONS"))&&s.push("ADDONS"),_(S({},jf),{steps:Yf.filter(l=>!s.includes(l.key))})}function fk(){let[{progressBar:e}]=j();return e}function gk(){let[e,t]=j();return o=>R(null,null,function*(){let{progressBar:n,planStep:i,addonsStep:r,paymentStep:a,onBeforeStepChange:s}=e;if(o!==n.activeStep&&s){let l=n.steps[n.activeStep],c=n.steps[o];if(l&&c){let d={planStep:i,addonsStep:r,paymentStep:a};if(!(yield s({from:l.key,to:c.key,state:d})))return}}t(({progressBar:l})=>{l.activeStep=o;});})}function yk(){let[,e]=j();return t=>e(({progressBar:o})=>{o.completedSteps.push(t);})}function xk(e){return e.completedSteps.length>=e.steps.length-1}function bk(){let[e,t]=j();return ()=>R(null,null,function*(){let{progressBar:o,planStep:n,addonsStep:i,paymentStep:r,onBeforeStepChange:a}=e;if(o.isDisabled)return;let s=o.steps[o.activeStep],l=o.steps[o.activeStep+1];if(l&&a){let c={planStep:n,addonsStep:i,paymentStep:r};if(!(yield a({from:s.key,to:l.key,state:c})))return}t(({progressBar:c})=>{c.completedSteps.includes(c.activeStep)||c.completedSteps.push(c.activeStep),c.activeStep<c.steps.length-1&&(c.activeStep+=1);});})}function Ck(){let[,e]=j();return t=>e(({progressBar:o})=>{o.isDisabled=!!t;})}function ke(){let e=fk();return {currentStep:e.steps[e.activeStep],progressBarState:e,isLastStep:e.activeStep===e.steps.length-1,isCheckoutComplete:xk(e),setActiveStep:gk(),markStepAsCompleted:yk(),goNext:bk(),setIsDisabled:Ck()}}function _n(){let[{planStep:e,addonsStep:t,promotionCode:o,paymentStep:n}]=j();return _(S({},e),{addons:t.addons,promotionCode:o,billingAddress:n.billingAddress,taxPercentage:n.taxPercentage,taxId:n.taxId})}function sa({billingAddress:e,taxPercentage:t,taxIds:o}){if(!e&&!t&&!(o!=null&&o.length))return {};let n=o!=null&&o.length?o==null?void 0:o.filter(i=>i.value&&i.type):void 0;return {billingInformation:_(S(S({},e?{billingAddress:e}:{}),t?{taxPercentage:t}:{}),{taxIds:n})}}var kk=m=>R(null,[m],function*({stigg:e,customerId:t,planId:o,resourceId:n,promotionCode:i,addons:r,billableFeatures:a,billingCountryCode:s,billingPeriod:l,billingAddress:c,taxPercentage:d,taxIds:u,onMockCheckoutPreview:p}){var y;let h=r.map(({addon:P,quantity:T})=>({addonId:P.id,quantity:T})),f=null,g=null;try{if(t&&o){let P=S({customerId:t,planId:o,resourceId:n,billingCountryCode:s,addons:h,billingPeriod:l,promotionCode:i,billableFeatures:SS(a)?void 0:a},sa({billingAddress:c,taxPercentage:d,taxIds:u}));f=p?p(P):yield e.previewSubscription(P);}}catch(P){let[,T]=((y=P==null?void 0:P.message)==null?void 0:y.split("Error:"))||[];g=T==null?void 0:T.trim();}return {subscriptionPreview:f,errorMessage:g}}),uc=({onMockCheckoutPreview:e}={})=>{let{stigg:t}=D(),o=_n(),[{resourceId:n}]=j(),{checkoutState:i,widgetState:r}=Y(),{plan:a,customer:s}=i||{};return {previewSubscriptionAction:useCallback((...d)=>R(null,[...d],function*({promotionCode:c}={}){return r.isValid?kk({stigg:t,customerId:s==null?void 0:s.id,planId:a==null?void 0:a.id,resourceId:n,addons:o.addons,billableFeatures:o.billableFeatures,billingCountryCode:o.billingCountryCode,billingPeriod:o.billingPeriod,billingAddress:o.billingAddress,taxPercentage:o.taxPercentage,promotionCode:c!=null?c:o.promotionCode,taxIds:o.taxId?[o.taxId]:void 0,onMockCheckoutPreview:e}):{subscriptionPreview:null,errorMessage:null}}),[t,s==null?void 0:s.id,a==null?void 0:a.id,n,o.addons,o.billableFeatures,o.billingCountryCode,o.billingPeriod,o.billingAddress,o.taxPercentage,o.taxId,o.promotionCode,r.isValid,e])}},wk=500,Xf=({onMockCheckoutPreview:e}={})=>{let[t,o]=useState(null),[n,i]=useState(null),[r,a]=useState(false),{previewSubscriptionAction:s}=uc({onMockCheckoutPreview:e});return useEffect(()=>{let l=()=>R(null,null,function*(){let{subscriptionPreview:d,errorMessage:u}=yield s();d&&(o(d),i(null)),u&&(i(u),o(null)),a(false);});a(true);let c=setTimeout(()=>{a(true),l();},wk);return ()=>{clearTimeout(c);}},[s]),{subscriptionPreview:t,isFetchingSubscriptionPreview:r,errorMessage:n}};function Kf({customer:e,taxPercentage:t,taxId:o}){return {useNewPaymentMethod:!(e!=null&&e.paymentMethodDetails),taxPercentage:t,taxId:o}}function vk(){let[,e]=j();return useCallback(t=>e(o=>{o.paymentStep.useNewPaymentMethod=t;}),[e])}function _k(){let[,e]=j();return useCallback(t=>e(o=>{o.paymentStep.errorMessage=t;}),[e])}function Ak(){let[,e]=j();return useCallback(t=>e(o=>{o.paymentStep.billingAddress=t;}),[e])}function Mk(){let[{paymentStep:e}]=j();return e}function Ik(){let[,e]=j();return useCallback(t=>e(o=>{o.paymentStep.taxId=t;}),[e])}function vt(){let e=Mk();return _(S({},e),{setUseNewPaymentMethod:vk(),setErrorMessage:_k(),setBillingAddress:Ak(),setTaxId:Ik()})}function Qf(e){return e2({changePlan:"Change",billingPeriodsTitle:"Billing cycle",addAddonText:"Add",addonBillingPeriodNotAvailableText:({planBillingPeriod:o})=>o===BillingPeriod.Monthly?"Exclusively available on annual plans":"Exclusively available on monthly plans",newPaymentMethodText:"New payment method",newPaymentMethodBillingAddressTitle:"Billing address",newPaymentMethodCardTitle:"Payment method",summary:{title:"Order summary",planName:({plan:o})=>`${o.displayName} plan`,addCouponCodeText:"Add promotion code",couponCodeTitle:"Promotion code",addonsSectionTitle:"Add-ons",discountsSectionTitle:"Discounts",onlyPayAsYouGoText:"Varies by usage",startsAtText:"Starts at ",proratedTotalDueText:"Prorated charge today",baseChargeText:()=>"Base charge",totalText:"Total",totalDueText:"Total due today",totalBillingPeriodText:({billingPeriod:o})=>`Billed ${o.toLowerCase()}`,appliedCreditsTitle:"Applied credits",creditsForUnusedTimeText:({credits:o})=>`Your account will be granted credits worth ${o} for unused time, which will be automatically applied to future payments.`,discountText:({discountDetails:o,currency:n})=>{let i="";o.type===DiscountType.Percentage?i=`${o.value}% off`:i=`${at({amount:o.value,currency:n})}`;let r="";switch(o.durationType){case DiscountDurationType.Once:{r=" once";break}case DiscountDurationType.Repeating:{r=`${o.type===DiscountType.Fixed?" per month":""} for ${o.durationInMonths} months`;break}case DiscountDurationType.Forever:default:r="";}return `${i}${r}`},taxTitle:({taxDetails:o})=>`Tax (${o==null?void 0:o.percentage}%)`,changesWillApplyAtEndOfBillingPeriod:({billingPeriodEnd:o})=>`Your changes will take effect at the end of your current billing cycle on ${Xc(o).format("MMMM D, YYYY")}.`,checkoutSuccessText:"Changes applied",payAsYouGoTooltipText:"Billed according to actual usage"},checkoutButton:{nextText:"Next",noChangesText:"No changes",updateText:"Update subscription",downgradeToFreeText:"Cancel subscription",upgradeText:"Subscribe"},downgradeToFree:{alertText:()=>"We\u2019re sorry to see you cancel your paid subscription \u{1F62D}",freePlanHeader:()=>"New plan",freePlanName:({plan:o})=>`${o.displayName}`,freePlanPriceText:()=>"Free",paidPlanHeader:()=>"Current plan",paidPlanName:({plan:o})=>`${o.displayName}`,paidPlanPriceText:({billingPeriod:o})=>`Paid plan${o?`, billed ${o.toLowerCase()}`:""}`},nextBillingCaption:()=>""},e)}var Ai={primary:"rgb(50, 126, 238)",textColor:"rgb(0, 30, 108)",backgroundColor:"rgb(255, 255, 255)",borderColor:"rgb(235, 237, 243)",summaryBackgroundColor:"rgb(109, 121, 144)"};function Jf(e,t,o){let{palette:n}=e||{};return {primary:(t==null?void 0:t.primary)||(n==null?void 0:n.primary)||Ai.primary,textColor:(t==null?void 0:t.textColor)||(n==null?void 0:n.text.primary)||Ai.textColor,backgroundColor:(t==null?void 0:t.backgroundColor)||(n==null?void 0:n.backgroundPaper)||Ai.backgroundColor,borderColor:(t==null?void 0:t.borderColor)||(n==null?void 0:n.outlinedBorder)||Ai.borderColor,summaryBackgroundColor:(t==null?void 0:t.summaryBackgroundColor)||(n==null?void 0:n.backgroundHighlight)||Ai.summaryBackgroundColor,paymentInputBackgroundColor:t==null?void 0:t.paymentInputBackgroundColor,paymentInputBorderColor:t==null?void 0:t.paymentInputBorderColor,paymentInputBorderRadius:t==null?void 0:t.paymentInputBorderRadius}}var mc=xc.createContext(null);mc.displayName="CheckoutContext";var j=()=>{let e=useContext(mc);if(!e)throw new Error("Could not find Checkout context; You need to wrap your checkout components in an <CheckoutProvider> component.");return e},zk=({children:e,initialState:t})=>{let[o,n]=useState(t);useEffect(()=>{n(t);},[t]);let i=useCallback(s=>n(l=>produce(l,c=>s(c))),[n]),[r,a]=useMemo(()=>[o,i],[i,o]);return jsx(mc.Provider,{value:[r,a],children:e})};function eg({children:e,textOverrides:t,theme:o,preferredBillingPeriod:n,billableFeatures:i,resourceId:r,planId:a,billingCountryCode:s,billingInformation:l,onMockCheckoutState:c,skipCheckoutSteps:d,onBeforeStepChange:u}){var P;let{checkout:p,isLoading:m,showWatermark:h}=Of({resourceId:r,planId:a,billingCountryCode:s,onMockCheckoutState:c}),f=p!=null&&p.configuration?$h(p.configuration):{typography:Pi(null,Br)},g=$o(f),y=useMemo(()=>{var B,L;let T=Jf(g,o,p==null?void 0:p.configuration),k=Qf(t),w=Gf({preferredBillingPeriod:n,plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingCountryCode:s,preconfiguredBillableFeatures:i!=null?i:[]}),v=Rf({plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingPeriod:w.billingPeriod}),A=Kf({customer:p==null?void 0:p.customer,taxPercentage:(B=l==null?void 0:l.taxDetails)==null?void 0:B.taxPercentage}),M=Zf({isLoading:m,skipCheckoutSteps:d!=null?d:[],plan:p==null?void 0:p.plan,availableAddons:v.availableAddons,availableCharges:w.billableFeatures,preferredBillingPeriod:n,preconfiguredBillableFeatures:i!=null?i:[]});return {checkout:p,checkoutLocalization:k,stiggTheme:g,theme:T,progressBar:M,planStep:w,addonsStep:v,paymentStep:A,resourceId:(L=p==null?void 0:p.resource)==null?void 0:L.id,widgetState:{readOnly:false,isValid:true,isLoadingCheckoutData:m},showWatermark:h,checkoutSuccess:false,onBeforeStepChange:u}},[n,s,p,m,d,(P=l==null?void 0:l.taxDetails)==null?void 0:P.taxPercentage,u]);return jsx(ht,{componentTheme:f,children:jsx(zk,{initialState:y,children:e})},p==null?void 0:p.plan.id)}var og="920px",ig=x.div`
640
+ `;function Dg(){let e=Dt("md");return jsx(Se,{container:true,spacing:4,className:"stigg-subscription-usage-skeleton-layout",sx:{flexWrap:"wrap"},children:range(6).map(t=>jsx(Se,{item:true,xs:e?4:12,children:jsx(ro,{width:280,height:120})},t))})}function Ng({showAll:e,onToggle:t}){return jsx(Rg,{children:jsx(ao,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:e?jsx(Minus,{}):jsx(Plus,{}),onClick:t,children:e?"Show less":"Show more"})})}function ua({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:n}){let{textOverrides:i,theme:r}=ut(),{isLoadingData:a,entitlementsToShow:s,creditsToShow:l,subscriptionPriceByFeature:c,gridSizeXs:d,hasCustomSubscription:u,canUpgradeSubscription:p,showAll:h,toggleShowAll:m,hasNoItems:g,showMoreVisible:f}=Ag({filterEntitlements:o,filterPackageEntitlements:n});return g?null:jsxs(Te,{className:"stigg-subscription-usage-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:[jsx(Ce,{children:jsx(Pe,{title:i.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:a})}),a?jsx(Dg,{}):jsxs(Fragment,{children:[jsx(Lg,{featureEntitlements:s,creditEntitlements:l,subscriptionPriceByFeature:c,gridSizeXs:d,onManageSubscription:e,onBuyMore:t,hasCustomSubscription:u,canUpgradeSubscription:p}),f&&jsx(Ng,{showAll:h,onToggle:m})]})]})}function zg({onManageSubscription:e,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:n,onCancelScheduledUpdates:i,onContactSupport:r,paywallComponent:a,hiddenSections:s}){let{customerPortal:l,textOverrides:c,theme:d,isLoading:u,showWatermark:p}=ut(),h=useRef(null),m=({intentionType:b})=>{var T,k;e?e({intentionType:b,customerSubscriptions:(T=l==null?void 0:l.subscriptions)!=null?T:[]}):(k=h==null?void 0:h.current)==null||k.scrollIntoView({behavior:"smooth"});},g=!(s!=null&&s.some(b=>b==="usage")),f=!(s!=null&&s.some(b=>b==="paymentDetails"||b==="billingInformation")),x=!(s!=null&&s.some(b=>b==="invoices"||b==="billingInformation"));return jsxs(bg,{className:"stigg-customer-portal-layout",children:[jsx(mg,{showWatermark:p}),jsxs(Cg,{className:"stigg-customer-portal-sections",children:[jsx(Jr,{onCancelScheduledUpdates:i,onBuyMore:t,onManageSubscription:m,onContactSupport:r,hiddenSections:s,cancelScheduledUpdatesButtonTitle:c.cancelScheduledUpdatesButtonTitle}),g&&jsx(ua,{onManageSubscription:m,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:n}),jsx(pc,{ref:h,paywallComponent:a,theme:d,title:c.paywallSectionTitle,isLoading:!l||u}),f&&jsx(ia,{}),x&&jsx(pa,{})]})]})}function $g(r){var a=r,{textOverrides:e,theme:t,resourceId:o,productId:n}=a,i=ot(a,["textOverrides","theme","resourceId","productId"]);return jsx(Dr,{textOverrides:e,theme:t,resourceId:o,productId:n,children:jsx(zg,S({},i))})}function pa(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:n}=ut(),i=!e||t,r=i?jsx(oa,{}):e!=null&&e.billingPortalUrl?jsx(ta,{url:e.billingPortalUrl,text:o.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return !i&&!(e!=null&&e.billingPortalUrl)?null:jsx(Te,{className:"stigg-invoices-section-layout",$backgroundColor:n.backgroundColor,$borderColor:n.borderColor,children:jsxs(Ce,{className:"stigg-invoices-section-header",children:[jsx(Pe,{isLoading:i,className:"stigg-invoices-section-title",title:o.invoicesTitle}),r]})})}var Wg=e=>Hg(e,"displayName"),yc=e=>Hg(e,"addon.displayName");function $o(e){var n,i;let t=(n=e.pricePoints)==null?void 0:n.some(r=>r.amount&&r.amount>0);return !!((i=e.hiddenFromWidgets)!=null&&i.includes(WidgetType.Checkout))&&!t}function yk(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function Gg({addon:e,currency:t,billingCountryCode:o}){return A(S({},e),{pricePoints:e.pricePoints.filter(n=>n.currency===t&&(o?n.billingCountryCode===o:true))})}function jg({addons:e,billingCountryCode:t,currency:o}){return (e==null?void 0:e.map(n=>Gg({addon:n,currency:o,billingCountryCode:t})))||[]}function Yg({addons:e,billingPeriod:t,billingCountryCode:o,currency:n}){var i;return ((i=e==null?void 0:e.filter(r=>yk(r.addon,t)))==null?void 0:i.map(r=>A(S({},r),{addon:Gg({addon:r.addon,currency:n,billingCountryCode:o})})))||[]}function Zg({activeSubscription:e,plan:t,billingCountryCode:o,billingPeriod:n}){var c,d;let i=[],r=((d=(c=t==null?void 0:t.pricePoints)==null?void 0:c[0])==null?void 0:d.currency)||Currency.Usd,a=jg({addons:t==null?void 0:t.compatibleAddons,billingCountryCode:o,currency:r}),s=Wg(a.filter(u=>!$o(u))),l=Yg({addons:e==null?void 0:e.addons,billingPeriod:n,billingCountryCode:o,currency:r});return l!=null&&l.length&&(a!=null&&a.length)&&(i=yc(l.filter(u=>a.some(p=>p.id===u.addon.id)))),{addons:i,initialAddons:xk(i),availableAddons:s}}function Pk(){let[,e]=j();return (t,o)=>e(n=>{if($o(t))return;let i=n.addonsStep.addons.find(r=>r.addon.id===t.id);if(i){if($o(i.addon))return;i.quantity=o;}else n.addonsStep.addons.push({addon:t,quantity:o}),n.addonsStep.addons=yc(n.addonsStep.addons);})}function Sk(){let[,e]=j();return t=>e(o=>{let n=o.addonsStep.addons.find(i=>i.addon.id===t);n&&$o(n.addon)||bk(o.addonsStep.addons,i=>i.addon.id===t);})}function Tk(){let[{addonsStep:e}]=j();return e}function Xg(){let e=Tk();return A(S({},e),{setAddon:Pk(),removeAddon:Sk()})}function kk(){let[{checkout:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n}]=j();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n}}function wk(){let[,e]=j();return t=>e(o=>{o.widgetState.readOnly=t;})}function vk(){let[,e]=j();return t=>e(o=>{o.widgetState.isValid=t;})}function _k(){let[,e]=j();return t=>e(o=>{o.checkoutSuccess=t;})}function Y(){let{checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n}=kk();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n,setWidgetReadOnly:wk(),setIsValid:vk(),setCheckoutSuccess:_k()}}function qg({planId:e,resourceId:t,billingCountryCode:o,onMockCheckoutState:n}){let{stigg:i}=D(),[r,a]=useState(true),[s,l]=useState();return useEffect(()=>{let c=()=>R(null,null,function*(){try{let d=yield i.getCheckoutState({planId:e,resourceId:t,billingCountryCode:o});l(d);}catch(d){no.error(`Failed to load checkout ${d==null?void 0:d.message}`,d);}finally{a(false);}});if(n){a(false),l(n({planId:e,resourceId:t,billingCountryCode:o}));return}i.isCustomerLoaded&&(a(true),c());},[i,i.isCustomerLoaded,t,e,o,n]),{checkout:s,isLoading:r,showWatermark:i.getShowWatermark()}}var ha=(e,t)=>e.minUnitQuantity&&t<e.minUnitQuantity?e.minUnitQuantity:e.maxUnitQuantity&&t>e.maxUnitQuantity?e.maxUnitQuantity:t;var xc=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===BillingPeriod$1.Monthly)),bc=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===BillingPeriod$1.Annually)),Jg=e=>xc(e)&&bc(e);var of=(e,t,o)=>e===BillingPeriod$1.Monthly&&t||e===BillingPeriod$1.Annually&&o?e:null,nf=({pricingModel:e})=>e===BillingModel.PerUnit;function Ik(e,t,o){var r;if(!t)return [];let n=Sg(e,"featureId"),i=Sg(ef((r=o==null?void 0:o.prices)==null?void 0:r.map(a=>{let{feature:s}=a;return !s||!nf(a)?null:{featureId:s.featureId,quantity:s.unitQuantity||null}})),"featureId");return ef(t==null?void 0:t.map(a=>{var d,u,p;let s=(d=a.feature)==null?void 0:d.featureId;if(!s||!nf(a))return null;let l,c=((u=n[s])==null?void 0:u.quantity)||((p=i[s])==null?void 0:p.quantity);return l=ha(a,c||1),a.isTieredPrice&&!gi(a.tiers)&&(l=Ml(a.tiers,l).upTo),{featureId:s,quantity:l}}))}function Ek({plan:e,activeSubscription:t,preferredBillingPeriod:o}){var a,s;let n=xc(e),i=bc(e);if(o){let l=of(o,n,i);if(l)return l}if(((a=t==null?void 0:t.plan)==null?void 0:a.id)===(e==null?void 0:e.id))return ((s=t==null?void 0:t.price)==null?void 0:s.billingPeriod)||BillingPeriod$1.Monthly;if(t!=null&&t.prices&&(t==null?void 0:t.prices.length)>0){let l=of(t==null?void 0:t.prices[0].billingPeriod,n,i);if(l)return l}return i?BillingPeriod$1.Annually:BillingPeriod$1.Monthly}function rf({preferredBillingPeriod:e,plan:t,activeSubscription:o,billingCountryCode:n,preconfiguredBillableFeatures:i}){let r=Ek({plan:t,activeSubscription:o,preferredBillingPeriod:e}),a=t==null?void 0:t.pricePoints.filter(l=>l.billingPeriod===r),s=Ik(i,a,o);return {billingPeriod:r,billableFeatures:s,billingCountryCode:n}}function Fk(){let[{planStep:e}]=j();return e}function Lk(){let[,e]=j();return (t,o)=>e(n=>{let i=n.planStep.billableFeatures.find(r=>r.featureId===t);i?i.quantity=o:n.planStep.billableFeatures.push({featureId:t,quantity:o});})}function Bk(){let[,e]=j();return t=>e(o=>{o.planStep.billingPeriod=t,o.addonsStep.addons=o.addonsStep.addons.filter(n=>n.addon.pricePoints.some(i=>i.billingPeriod===t));})}function te(){let e=Fk();return A(S({},e),{setBillingPeriod:Bk(),setBillableFeature:Lk()})}var sf=[{key:"PLAN",label:"Plan"},{key:"ADDONS",label:"Add-ons"},{key:"PAYMENT",label:"Payment details"}],af={activeStep:0,completedSteps:[],steps:sf,isDisabled:false},Dk=(e,t,o,n)=>{if(Jg(e)&&!n)return false;let i=t.map(a=>a.featureId),r=o.map(a=>a.featureId);return !(i.length!==r.length||!i.every(a=>r.includes(a)))};function lf({isLoading:e,skipCheckoutSteps:t,plan:o,availableAddons:n,availableCharges:i,preferredBillingPeriod:r,preconfiguredBillableFeatures:a}){if(e||!o)return af;let s=[];return t.includes("PLAN")&&Dk(o,i,a,r)&&s.push("PLAN"),((n==null?void 0:n.length)===0||t.includes("ADDONS"))&&s.push("ADDONS"),A(S({},af),{steps:sf.filter(l=>!s.includes(l.key))})}function Nk(){let[{progressBar:e}]=j();return e}function Uk(){let[e,t]=j();return o=>R(null,null,function*(){let{progressBar:n,planStep:i,addonsStep:r,paymentStep:a,onBeforeStepChange:s}=e;if(o!==n.activeStep&&s){let l=n.steps[n.activeStep],c=n.steps[o];if(l&&c){let d={planStep:i,addonsStep:r,paymentStep:a};if(!(yield s({from:l.key,to:c.key,state:d})))return}}t(({progressBar:l})=>{l.activeStep=o;});})}function Ok(){let[,e]=j();return t=>e(({progressBar:o})=>{o.completedSteps.push(t);})}function zk(e){return e.completedSteps.length>=e.steps.length-1}function Vk(){let[e,t]=j();return ()=>R(null,null,function*(){let{progressBar:o,planStep:n,addonsStep:i,paymentStep:r,onBeforeStepChange:a}=e;if(o.isDisabled)return;let s=o.steps[o.activeStep],l=o.steps[o.activeStep+1];if(l&&a){let c={planStep:n,addonsStep:i,paymentStep:r};if(!(yield a({from:s.key,to:l.key,state:c})))return}t(({progressBar:c})=>{c.completedSteps.includes(c.activeStep)||c.completedSteps.push(c.activeStep),c.activeStep<c.steps.length-1&&(c.activeStep+=1);});})}function $k(){let[,e]=j();return t=>e(({progressBar:o})=>{o.isDisabled=!!t;})}function ke(){let e=Nk();return {currentStep:e.steps[e.activeStep],progressBarState:e,isLastStep:e.activeStep===e.steps.length-1,isCheckoutComplete:zk(e),setActiveStep:Uk(),markStepAsCompleted:Ok(),goNext:Vk(),setIsDisabled:$k()}}function _n(){let[{planStep:e,addonsStep:t,promotionCode:o,paymentStep:n}]=j();return A(S({},e),{addons:t.addons,promotionCode:o,billingAddress:n.billingAddress,taxPercentage:n.taxPercentage,taxId:n.taxId})}function ga({billingAddress:e,taxPercentage:t,taxIds:o}){if(!e&&!t&&!(o!=null&&o.length))return {};let n=o!=null&&o.length?o==null?void 0:o.filter(i=>i.value&&i.type):void 0;return {billingInformation:A(S(S({},e?{billingAddress:e}:{}),t?{taxPercentage:t}:{}),{taxIds:n})}}var jk=h=>R(null,[h],function*({stigg:e,customerId:t,planId:o,resourceId:n,promotionCode:i,addons:r,billableFeatures:a,billingCountryCode:s,billingPeriod:l,billingAddress:c,taxPercentage:d,taxIds:u,onMockCheckoutPreview:p}){var x;let m=r.map(({addon:b,quantity:T})=>({addonId:b.id,quantity:T})),g=null,f=null;try{if(t&&o){let b=S({customerId:t,planId:o,resourceId:n,billingCountryCode:s,addons:m,billingPeriod:l,promotionCode:i,billableFeatures:DS(a)?void 0:a},ga({billingAddress:c,taxPercentage:d,taxIds:u}));g=p?p(b):yield e.previewSubscription(b);}}catch(b){let[,T]=((x=b==null?void 0:b.message)==null?void 0:x.split("Error:"))||[];f=T==null?void 0:T.trim();}return {subscriptionPreview:g,errorMessage:f}}),Pc=({onMockCheckoutPreview:e}={})=>{let{stigg:t}=D(),o=_n(),[{resourceId:n}]=j(),{checkoutState:i,widgetState:r}=Y(),{plan:a,customer:s}=i||{};return {previewSubscriptionAction:useCallback((...d)=>R(null,[...d],function*({promotionCode:c}={}){return r.isValid?jk({stigg:t,customerId:s==null?void 0:s.id,planId:a==null?void 0:a.id,resourceId:n,addons:o.addons,billableFeatures:o.billableFeatures,billingCountryCode:o.billingCountryCode,billingPeriod:o.billingPeriod,billingAddress:o.billingAddress,taxPercentage:o.taxPercentage,promotionCode:c!=null?c:o.promotionCode,taxIds:o.taxId?[o.taxId]:void 0,onMockCheckoutPreview:e}):{subscriptionPreview:null,errorMessage:null}}),[t,s==null?void 0:s.id,a==null?void 0:a.id,n,o.addons,o.billableFeatures,o.billingCountryCode,o.billingPeriod,o.billingAddress,o.taxPercentage,o.taxId,o.promotionCode,r.isValid,e])}},Yk=500,cf=({onMockCheckoutPreview:e}={})=>{let[t,o]=useState(null),[n,i]=useState(null),[r,a]=useState(false),{previewSubscriptionAction:s}=Pc({onMockCheckoutPreview:e});return useEffect(()=>{let l=()=>R(null,null,function*(){let{subscriptionPreview:d,errorMessage:u}=yield s();d&&(o(d),i(null)),u&&(i(u),o(null)),a(false);});a(true);let c=setTimeout(()=>{a(true),l();},Yk);return ()=>{clearTimeout(c);}},[s]),{subscriptionPreview:t,isFetchingSubscriptionPreview:r,errorMessage:n}};function df({customer:e,taxPercentage:t,taxId:o}){return {useNewPaymentMethod:!(e!=null&&e.paymentMethodDetails),taxPercentage:t,taxId:o}}function Zk(){let[,e]=j();return useCallback(t=>e(o=>{o.paymentStep.useNewPaymentMethod=t;}),[e])}function Xk(){let[,e]=j();return useCallback(t=>e(o=>{o.paymentStep.errorMessage=t;}),[e])}function Kk(){let[,e]=j();return useCallback(t=>e(o=>{o.paymentStep.billingAddress=t;}),[e])}function qk(){let[{paymentStep:e}]=j();return e}function Qk(){let[,e]=j();return useCallback(t=>e(o=>{o.paymentStep.taxId=t;}),[e])}function vt(){let e=qk();return A(S({},e),{setUseNewPaymentMethod:Zk(),setErrorMessage:Xk(),setBillingAddress:Kk(),setTaxId:Qk()})}function pf(e){return g2({changePlan:"Change",billingPeriodsTitle:"Billing cycle",addAddonText:"Add",addonBillingPeriodNotAvailableText:({planBillingPeriod:o})=>o===BillingPeriod.Monthly?"Exclusively available on annual plans":"Exclusively available on monthly plans",newPaymentMethodText:"New payment method",newPaymentMethodBillingAddressTitle:"Billing address",newPaymentMethodCardTitle:"Payment method",summary:{title:"Order summary",planName:({plan:o})=>`${o.displayName} plan`,addCouponCodeText:"Add promotion code",couponCodeTitle:"Promotion code",addonsSectionTitle:"Add-ons",discountsSectionTitle:"Discounts",onlyPayAsYouGoText:"Varies by usage",startsAtText:"Starts at ",proratedTotalDueText:"Prorated charge today",baseChargeText:()=>"Base charge",totalText:"Total",totalDueText:"Total due today",totalBillingPeriodText:({billingPeriod:o})=>`Billed ${o.toLowerCase()}`,appliedCreditsTitle:"Applied credits",creditsForUnusedTimeText:({credits:o})=>`Your account will be granted credits worth ${o} for unused time, which will be automatically applied to future payments.`,discountText:({discountDetails:o,currency:n})=>{let i="";o.type===DiscountType.Percentage?i=`${o.value}% off`:i=`${at({amount:o.value,currency:n})}`;let r="";switch(o.durationType){case DiscountDurationType.Once:{r=" once";break}case DiscountDurationType.Repeating:{r=`${o.type===DiscountType.Fixed?" per month":""} for ${o.durationInMonths} months`;break}case DiscountDurationType.Forever:default:r="";}return `${i}${r}`},taxTitle:({taxDetails:o})=>`Tax (${o==null?void 0:o.percentage}%)`,changesWillApplyAtEndOfBillingPeriod:({billingPeriodEnd:o})=>`Your changes will take effect at the end of your current billing cycle on ${rd(o).format("MMMM D, YYYY")}.`,checkoutSuccessText:"Changes applied",payAsYouGoTooltipText:"Billed according to actual usage"},checkoutButton:{nextText:"Next",noChangesText:"No changes",updateText:"Update subscription",downgradeToFreeText:"Cancel subscription",upgradeText:"Subscribe"},downgradeToFree:{alertText:()=>"We\u2019re sorry to see you cancel your paid subscription \u{1F62D}",freePlanHeader:()=>"New plan",freePlanName:({plan:o})=>`${o.displayName}`,freePlanPriceText:()=>"Free",paidPlanHeader:()=>"Current plan",paidPlanName:({plan:o})=>`${o.displayName}`,paidPlanPriceText:({billingPeriod:o})=>`Paid plan${o?`, billed ${o.toLowerCase()}`:""}`},nextBillingCaption:()=>""},e)}var Mi={primary:"rgb(50, 126, 238)",textColor:"rgb(0, 30, 108)",backgroundColor:"rgb(255, 255, 255)",borderColor:"rgb(235, 237, 243)",summaryBackgroundColor:"rgb(109, 121, 144)"};function mf(e,t,o){let{palette:n}=e||{};return {primary:(t==null?void 0:t.primary)||(n==null?void 0:n.primary)||Mi.primary,textColor:(t==null?void 0:t.textColor)||(n==null?void 0:n.text.primary)||Mi.textColor,backgroundColor:(t==null?void 0:t.backgroundColor)||(n==null?void 0:n.backgroundPaper)||Mi.backgroundColor,borderColor:(t==null?void 0:t.borderColor)||(n==null?void 0:n.outlinedBorder)||Mi.borderColor,summaryBackgroundColor:(t==null?void 0:t.summaryBackgroundColor)||(n==null?void 0:n.backgroundHighlight)||Mi.summaryBackgroundColor,paymentInputBackgroundColor:t==null?void 0:t.paymentInputBackgroundColor,paymentInputBorderColor:t==null?void 0:t.paymentInputBorderColor,paymentInputBorderRadius:t==null?void 0:t.paymentInputBorderRadius}}var kc=Ac.createContext(null);kc.displayName="CheckoutContext";var j=()=>{let e=useContext(kc);if(!e)throw new Error("Could not find Checkout context; You need to wrap your checkout components in an <CheckoutProvider> component.");return e},lw=({children:e,initialState:t})=>{let[o,n]=useState(t);useEffect(()=>{n(t);},[t]);let i=useCallback(s=>n(l=>produce(l,c=>s(c))),[n]),[r,a]=useMemo(()=>[o,i],[i,o]);return jsx(kc.Provider,{value:[r,a],children:e})};function gf({children:e,textOverrides:t,theme:o,preferredBillingPeriod:n,billableFeatures:i,resourceId:r,planId:a,billingCountryCode:s,billingInformation:l,onMockCheckoutState:c,skipCheckoutSteps:d,onBeforeStepChange:u}){var b;let{checkout:p,isLoading:h,showWatermark:m}=qg({resourceId:r,planId:a,billingCountryCode:s,onMockCheckoutState:c}),g=p!=null&&p.configuration?qm(p.configuration):{typography:Pi(null,Lr)},f=Vo(g),x=useMemo(()=>{var F,E;let T=mf(f,o,p==null?void 0:p.configuration),k=pf(t),w=rf({preferredBillingPeriod:n,plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingCountryCode:s,preconfiguredBillableFeatures:i!=null?i:[]}),v=Zg({plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingPeriod:w.billingPeriod}),_=df({customer:p==null?void 0:p.customer,taxPercentage:(F=l==null?void 0:l.taxDetails)==null?void 0:F.taxPercentage}),M=lf({isLoading:h,skipCheckoutSteps:d!=null?d:[],plan:p==null?void 0:p.plan,availableAddons:v.availableAddons,availableCharges:w.billableFeatures,preferredBillingPeriod:n,preconfiguredBillableFeatures:i!=null?i:[]});return {checkout:p,checkoutLocalization:k,stiggTheme:f,theme:T,progressBar:M,planStep:w,addonsStep:v,paymentStep:_,resourceId:(E=p==null?void 0:p.resource)==null?void 0:E.id,widgetState:{readOnly:false,isValid:true,isLoadingCheckoutData:h},showWatermark:m,checkoutSuccess:false,onBeforeStepChange:u}},[n,s,p,h,d,(b=l==null?void 0:l.taxDetails)==null?void 0:b.taxPercentage,u]);return jsx(ht,{componentTheme:g,children:jsx(lw,{initialState:x,children:e})},p==null?void 0:p.plan.id)}var ff="920px",xf=y.div`
641
641
  margin: auto;
642
642
  min-height: 760px;
643
- max-width: ${og};
643
+ max-width: ${ff};
644
644
  display: flex;
645
645
  position: relative;
646
646
  flex-direction: column;
@@ -657,9 +657,9 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
657
657
  ${wt.md} {
658
658
  padding: 32px;
659
659
  border-radius: 10px;
660
- width: ${og};
660
+ width: ${ff};
661
661
  }
662
- `,rg=x(Ma)`
662
+ `,bf=y(Na)`
663
663
  display: flex;
664
664
  align-items: flex-start;
665
665
  gap: 32px;
@@ -670,7 +670,7 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
670
670
  ${wt.md} {
671
671
  flex-direction: row;
672
672
  }
673
- `,ag=x(Ma)`
673
+ `,Cf=y(Na)`
674
674
  display: flex;
675
675
  flex-direction: column;
676
676
  gap: 0;
@@ -680,18 +680,18 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
680
680
  ${wt.md} {
681
681
  width: auto;
682
682
  }
683
- `;var lg=x(bT)(({theme:e,$disabled:t})=>({[`&.${linearProgressClasses.root}`]:{borderRadius:e.stigg.border.radius,backgroundColor:e.stigg.palette.outlinedBorder},[`& .${linearProgressClasses.bar}`]:{backgroundColor:t?e.stigg.palette.primaryLight:e.stigg.palette.primary}})),cg=x(b2)({[`&.${buttonClasses.root}`]:{textTransform:"none",lineHeight:"inherit",justifyContent:"flex-start",padding:"8px 4px"}}),dg=x(pt)(({theme:e,$disabled:t,$shouldFill:o})=>({circle:{stroke:t?e.stigg.palette.primaryLight:e.stigg.palette.primary,fill:o?t?e.stigg.palette.primaryLight:e.stigg.palette.primary:void 0}}));var pg=()=>{let{progressBarState:e,setActiveStep:t,currentStep:o}=ke(),{widgetState:n}=Y(),i=Dt("md"),r=useRef(),{readOnly:a,isLoadingCheckoutData:s}=n,{activeStep:l,completedSteps:c,steps:d}=e||{},u=(l+1)*100/d.length,[p,m]=xc.useState(o);return useEffect(()=>{i||r.current&&o!==p&&r.current.scrollIntoView({behavior:"smooth"}),m(o);},[o,i,p,m]),e.steps.length===1?null:jsxs(Ma,{className:"stigg-checkout-progress-container",sx:{width:"100%",mb:3},ref:r,children:[jsx(lg,{variant:"determinate",value:u,$disabled:a}),jsx(Pe,{container:true,display:"flex",children:d.map(({key:h,label:f},g)=>{let y=c.includes(g),P=a||g>l&&!y&&!c.includes(g-1)||l!==g&&e.isDisabled;return jsx(Pe,{item:true,display:"flex",flexDirection:"row",flex:i?1:"auto",justifyContent:"flex-start",children:s?jsx(dt,{width:120,height:20,style:{marginTop:8}}):jsx(cg,{onClick:()=>t(g),fullWidth:true,disabled:P,children:jsxs(Pe,{item:true,display:"flex",flexDirection:"row",alignItems:"center",gap:1,children:[jsx(Zk,{icon:jsx(dg,{icon:y?P?"OutlinedCheckedCircleDisabled":"OutlinedCheckedCircle":"OutlinedCircle",$disabled:P,$shouldFill:y})}),jsx(C,{variant:"h6",color:P?"primary.main.light":"primary.main",children:f})]})})},h)})})]})};var qk=[BillingModel.FlatFee,BillingModel.PerUnit,BillingModel.UsageBased],Qk=e=>If(e,[t=>qk.indexOf(t.pricingModel),t=>{var o;return (o=t.feature)==null?void 0:o.displayName}]),ca=e=>useMemo(()=>Qk(e),[e]);function Jk(){let[{promotionCode:e}]=j();return e}function tw(){let[,e]=j();return t=>e(o=>{o.promotionCode=t;})}function An(){return {promotionCode:Jk(),setPromotionCode:tw()}}var ew=e=>jsx("svg",_(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxs("g",{id:"plus",children:[jsx("path",{id:"Shape",d:"M10 4.16666V15.8333",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{id:"Shape_2",d:"M4.16699 10H15.8337",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),da=ew;var nw=x(da)`
683
+ `;var Sf=y(LT)(({theme:e,$disabled:t})=>({[`&.${linearProgressClasses.root}`]:{borderRadius:e.stigg.border.radius,backgroundColor:e.stigg.palette.outlinedBorder},[`& .${linearProgressClasses.bar}`]:{backgroundColor:t?e.stigg.palette.primaryLight:e.stigg.palette.primary}})),Tf=y(L2)({[`&.${buttonClasses.root}`]:{textTransform:"none",lineHeight:"inherit",justifyContent:"flex-start",padding:"8px 4px"}}),kf=y(mt)(({theme:e,$disabled:t,$shouldFill:o})=>({circle:{stroke:t?e.stigg.palette.primaryLight:e.stigg.palette.primary,fill:o?t?e.stigg.palette.primaryLight:e.stigg.palette.primary:void 0}}));var vf=()=>{let{progressBarState:e,setActiveStep:t,currentStep:o}=ke(),{widgetState:n}=Y(),i=Dt("md"),r=useRef(),{readOnly:a,isLoadingCheckoutData:s}=n,{activeStep:l,completedSteps:c,steps:d}=e||{},u=(l+1)*100/d.length,[p,h]=Ac.useState(o);return useEffect(()=>{i||r.current&&o!==p&&r.current.scrollIntoView({behavior:"smooth"}),h(o);},[o,i,p,h]),e.steps.length===1?null:jsxs(Na,{className:"stigg-checkout-progress-container",sx:{width:"100%",mb:3},ref:r,children:[jsx(Sf,{variant:"determinate",value:u,$disabled:a}),jsx(Se,{container:true,display:"flex",children:d.map(({key:m,label:g},f)=>{let x=c.includes(f),b=a||f>l&&!x&&!c.includes(f-1)||l!==f&&e.isDisabled;return jsx(Se,{item:true,display:"flex",flexDirection:"row",flex:i?1:"auto",justifyContent:"flex-start",children:s?jsx(dt,{width:120,height:20,style:{marginTop:8}}):jsx(Tf,{onClick:()=>t(f),fullWidth:true,disabled:b,children:jsxs(Se,{item:true,display:"flex",flexDirection:"row",alignItems:"center",gap:1,children:[jsx(fw,{icon:jsx(kf,{icon:x?b?"OutlinedCheckedCircleDisabled":"OutlinedCheckedCircle":"OutlinedCircle",$disabled:b,$shouldFill:x})}),jsx(P,{variant:"h6",color:b?"primary.main.light":"primary.main",children:g})]})})},m)})})]})};var bw=[BillingModel.FlatFee,BillingModel.PerUnit,BillingModel.UsageBased],Cw=e=>Hg(e,[t=>bw.indexOf(t.pricingModel),t=>{var o;return (o=t.feature)==null?void 0:o.displayName}]),ya=e=>useMemo(()=>Cw(e),[e]);function Pw(){let[{promotionCode:e}]=j();return e}function Sw(){let[,e]=j();return t=>e(o=>{o.promotionCode=t;})}function An(){return {promotionCode:Pw(),setPromotionCode:Sw()}}var Tw=e=>jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxs("g",{id:"plus",children:[jsx("path",{id:"Shape",d:"M10 4.16666V15.8333",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{id:"Shape_2",d:"M4.16699 10H15.8337",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),xa=Tw;var ww=y(xa)`
684
684
  margin-right: 8px;
685
685
  path {
686
686
  stroke: ${({theme:e,$disabled:t})=>t?e.stigg.palette.text.disabled:e.stigg.palette.primary};
687
687
  }
688
- `,mg=({onAddClick:e,checkoutLocalization:t,disabled:o})=>jsxs(kt,{disabled:o,fullWidth:true,className:"stigg-checkout-summary-add-coupon-code-button",sx:{textTransform:"none",justifyContent:"flex-start",color:o?"text.disabled":"primary.main"},variant:"text",size:"medium",onClick:e,children:[jsx(nw,{$disabled:o,className:"stigg-checkout-summary-add-coupon-code-button-icon"}),jsx(C,{className:"stigg-checkout-change-plan-button-text",color:o?"disabled":"primary.main",style:{lineHeight:"24px"},variant:"h3",children:t.summary.addCouponCodeText})]});var lw=x(kt)`
688
+ `,Af=({onAddClick:e,checkoutLocalization:t,disabled:o})=>jsxs(kt,{disabled:o,fullWidth:true,className:"stigg-checkout-summary-add-coupon-code-button",sx:{textTransform:"none",justifyContent:"flex-start",color:o?"text.disabled":"primary.main"},variant:"text",size:"medium",onClick:e,children:[jsx(ww,{$disabled:o,className:"stigg-checkout-summary-add-coupon-code-button-icon"}),jsx(P,{className:"stigg-checkout-change-plan-button-text",color:o?"disabled":"primary.main",style:{lineHeight:"24px"},variant:"h3",children:t.summary.addCouponCodeText})]});var Iw=y(kt)`
689
689
  padding: 4px 10px;
690
690
  min-width: unset;
691
691
  border-radius: ${({theme:e})=>e.stigg.border.radius};
692
692
  display: flex;
693
693
  align-items: center;
694
- `,fg=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{setPromotionCode:n}=An(),[i,r]=useState(false),[a,s]=xc.useState(""),[l,c]=xc.useState(false),[d,u]=xc.useState(""),{previewSubscriptionAction:p}=uc({onMockCheckoutPreview:o}),m=()=>R(null,null,function*(){var g;c(true),u("");let{subscriptionPreview:h,errorMessage:f}=yield p({promotionCode:a});!f&&((g=h==null?void 0:h.immediateInvoice)!=null&&g.discountDetails)?(n(a.toUpperCase()),r(false)):f&&u(f),c(false);});return i?jsxs(Pe,{children:[jsx(C,{variant:"body1",color:d?"error":e?"disabled":"primary.main",children:t.summary.couponCodeTitle}),jsx(Rt,{disabled:e,autoFocus:true,variant:"outlined",fullWidth:true,error:!!d,value:a,onChange:h=>{s(h.target.value);},inputProps:{maxLength:20},onKeyDown:h=>{h.key==="Enter"&&(m(),h.preventDefault());},InputProps:{endAdornment:jsx(lw,{variant:"contained",disabled:e,onClick:()=>{m();},children:l?jsx(aw,{size:18,sx:{color:"white"}}):jsx(pt,{style:{display:"flex"},icon:"ArrowForward"})})}}),!!d&&jsx(C,{variant:"body1",color:"error",children:d})]}):jsx(mg,{disabled:e,onAddClick:()=>r(true),checkoutLocalization:t})};var dw=x(Pe)`
694
+ `,Mf=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{setPromotionCode:n}=An(),[i,r]=useState(false),[a,s]=Ac.useState(""),[l,c]=Ac.useState(false),[d,u]=Ac.useState(""),{previewSubscriptionAction:p}=Pc({onMockCheckoutPreview:o}),h=()=>R(null,null,function*(){var f;c(true),u("");let{subscriptionPreview:m,errorMessage:g}=yield p({promotionCode:a});!g&&((f=m==null?void 0:m.immediateInvoice)!=null&&f.discountDetails)?(n(a.toUpperCase()),r(false)):g&&u(g),c(false);});return i?jsxs(Se,{children:[jsx(P,{variant:"body1",color:d?"error":e?"disabled":"primary.main",children:t.summary.couponCodeTitle}),jsx(Rt,{disabled:e,autoFocus:true,variant:"outlined",fullWidth:true,error:!!d,value:a,onChange:m=>{s(m.target.value);},inputProps:{maxLength:20},onKeyDown:m=>{m.key==="Enter"&&(h(),m.preventDefault());},InputProps:{endAdornment:jsx(Iw,{variant:"contained",disabled:e,onClick:()=>{h();},children:l?jsx(Aw,{size:18,sx:{color:"white"}}):jsx(mt,{style:{display:"flex"},icon:"ArrowForward"})})}}),!!d&&jsx(P,{variant:"body1",color:"error",children:d})]}):jsx(Af,{disabled:e,onAddClick:()=>r(true),checkoutLocalization:t})};var Fw=y(Se)`
695
695
  width: auto;
696
696
  display: inline-flex;
697
697
  align-items: center;
@@ -700,7 +700,7 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
700
700
  padding: 6px 8px;
701
701
  border-radius: ${({theme:e})=>e.stigg.border.radius};
702
702
  border: 1px solid ${({theme:e})=>e.stigg.palette.primary};
703
- `,gg=x(pt)`
703
+ `,If=y(mt)`
704
704
  display: flex;
705
705
 
706
706
  g {
@@ -710,9 +710,9 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
710
710
  path {
711
711
  fill: ${({theme:e,$shouldFill:t})=>t?e.stigg.palette.primary:void 0};
712
712
  }
713
- `,xg=({promotionCode:e,onClearPromotionCode:t})=>jsxs(dw,{container:true,children:[jsxs(Pe,{item:true,display:"flex",gap:1,alignItems:"center",children:[jsx(gg,{icon:"Coupon"}),jsx(C,{variant:"body1",color:"primary.main",lineHeight:"auto",children:e})]}),jsx(Pe,{item:true,children:jsx(kt,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:t,children:jsx(gg,{icon:"Close",$shouldFill:true})})})]});var uw=x.div`
713
+ `,Ff=({promotionCode:e,onClearPromotionCode:t})=>jsxs(Fw,{container:true,children:[jsxs(Se,{item:true,display:"flex",gap:1,alignItems:"center",children:[jsx(If,{icon:"Coupon"}),jsx(P,{variant:"body1",color:"primary.main",lineHeight:"auto",children:e})]}),jsx(Se,{item:true,children:jsx(kt,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:t,children:jsx(If,{icon:"Close",$shouldFill:true})})})]});var Lw=y.div`
714
714
  margin: 16px 0;
715
- `,bg=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{promotionCode:n,setPromotionCode:i}=An();return jsx(uw,{children:n?jsx(xg,{promotionCode:n,onClearPromotionCode:()=>{i("");}}):jsx(fg,{disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})})};var Cg=({label:e,checked:t,onChange:o,onClick:n,value:i,disabled:r,dataTestId:a})=>jsx(FormControlLabel,{onClick:n,value:i,control:jsx(Checkbox,{checked:t,onChange:o,disabled:r,"data-testid":a}),label:isString(e)?jsx(C,{variant:"body1",lineHeight:"20px",color:"secondary",children:e}):e});var Sc=[{country:"Albania",countryCode:"AL",taxIdType:"al_tin",FlagComponent:b.AL,example:"J12345678N"},{country:"Andorra",countryCode:"AD",taxIdType:"ad_nrt",FlagComponent:b.AD,example:"A-123456-Z"},{country:"Angola",countryCode:"AO",taxIdType:"ao_tin",FlagComponent:b.AO,example:"5123456789"},{country:"Argentina",countryCode:"AR",taxIdType:"ar_cuit",FlagComponent:b.AR,example:"12-3456789-01"},{country:"Armenia",countryCode:"AM",taxIdType:"am_tin",FlagComponent:b.AM,example:"02538904"},{country:"Aruba",countryCode:"AW",taxIdType:"aw_tin",FlagComponent:b.AW,example:"12345678"},{country:"Australia",countryCode:"AU",taxIdType:"au_abn",FlagComponent:b.AU,example:"12345678912"},{country:"Australia",countryCode:"AU",taxIdType:"au_arn",FlagComponent:b.AU,example:"123456789123"},{country:"Austria",countryCode:"AT",taxIdType:"eu_vat",FlagComponent:b.AT,example:"ATU12345678"},{country:"Azerbaijan",countryCode:"AZ",taxIdType:"az_tin",FlagComponent:b.AZ,example:"0123456789"},{country:"Bahamas",countryCode:"BS",taxIdType:"bs_tin",FlagComponent:b.BS,example:"123.456.789"},{country:"Bahrain",countryCode:"BH",taxIdType:"bh_vat",FlagComponent:b.BH,example:"123456789012345"},{country:"Bangladesh",countryCode:"BD",taxIdType:"bd_bin",FlagComponent:b.BD,example:"123456789-0123"},{country:"Barbados",countryCode:"BB",taxIdType:"bb_tin",FlagComponent:b.BB,example:"1123456789012"},{country:"Belarus",countryCode:"BY",taxIdType:"by_tin",FlagComponent:b.BY,example:"123456789"},{country:"Belgium",countryCode:"BE",taxIdType:"eu_vat",FlagComponent:b.BE,example:"BE0123456789"},{country:"Benin",countryCode:"BJ",taxIdType:"bj_ifu",FlagComponent:b.BJ,example:"1234567890123"},{country:"Bolivia",countryCode:"BO",taxIdType:"bo_tin",FlagComponent:b.BO,example:"123456789"},{country:"Bosnia & Herzegovina",countryCode:"BA",taxIdType:"ba_tin",FlagComponent:b.BA,example:"123456789012"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cnpj",FlagComponent:b.BR,example:"01.234.456/5432-10"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cpf",FlagComponent:b.BR,example:"123.456.789-87"},{country:"Bulgaria",countryCode:"BG",taxIdType:"bg_uic",FlagComponent:b.BG,example:"123456789"},{country:"Bulgaria",countryCode:"BG",taxIdType:"eu_vat",FlagComponent:b.BG,example:"BG0123456789"},{country:"Burkina Faso",countryCode:"BF",taxIdType:"bf_ifu",FlagComponent:b.BF,example:"12345678A"},{country:"Cambodia",countryCode:"KH",taxIdType:"kh_tin",FlagComponent:b.KH,example:"1001-123456789"},{country:"Cameroon",countryCode:"CM",taxIdType:"cm_niu",FlagComponent:b.CM,example:"M123456789000L"},{country:"Canada",countryCode:"CA",taxIdType:"ca_bn",FlagComponent:b.CA,example:"123456789"},{country:"Canada",countryCode:"CA",taxIdType:"ca_gst_hst",FlagComponent:b.CA,example:"123456789RT0002"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_bc",FlagComponent:b.CA,example:"PST-1234-5678"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_mb",FlagComponent:b.CA,example:"123456-7"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_sk",FlagComponent:b.CA,example:"1234567"},{country:"Canada",countryCode:"CA",taxIdType:"ca_qst",FlagComponent:b.CA,example:"1234567890TQ1234"},{country:"Cape Verde",countryCode:"CV",taxIdType:"cv_nif",FlagComponent:b.CV,example:"213456789"},{country:"Chile",countryCode:"CL",taxIdType:"cl_tin",FlagComponent:b.CL,example:"12.345.678-K"},{country:"China",countryCode:"CN",taxIdType:"cn_tin",FlagComponent:b.CN,example:"123456789012345678"},{country:"Colombia",countryCode:"CO",taxIdType:"co_nit",FlagComponent:b.CO,example:"123.456.789-0"},{country:"Congo - Kinshasa",countryCode:"CD",taxIdType:"cd_nif",FlagComponent:b.CD,example:"A0123456M"},{country:"Costa Rica",countryCode:"CR",taxIdType:"cr_tin",FlagComponent:b.CR,example:"1-234-567890"},{country:"Croatia",countryCode:"HR",taxIdType:"eu_vat",FlagComponent:b.HR,example:"HR12345678912"},{country:"Croatia",countryCode:"HR",taxIdType:"hr_oib",FlagComponent:b.HR,example:"12345678901"},{country:"Cyprus",countryCode:"CY",taxIdType:"eu_vat",FlagComponent:b.CY,example:"CY12345678Z"},{country:"Czech Republic",countryCode:"CZ",taxIdType:"eu_vat",FlagComponent:b.CZ,example:"CZ1234567890"},{country:"Denmark",countryCode:"DK",taxIdType:"eu_vat",FlagComponent:b.DK,example:"DK12345678"},{country:"Dominican Republic",countryCode:"DO",taxIdType:"do_rcn",FlagComponent:b.DO,example:"123-4567890-1"},{country:"Ecuador",countryCode:"EC",taxIdType:"ec_ruc",FlagComponent:b.EC,example:"1234567890001"},{country:"Egypt",countryCode:"EG",taxIdType:"eg_tin",FlagComponent:b.EG,example:"123456789"},{country:"El Salvador",countryCode:"SV",taxIdType:"sv_nit",FlagComponent:b.SV,example:"1234-567890-123-4"},{country:"Estonia",countryCode:"EE",taxIdType:"eu_vat",FlagComponent:b.EE,example:"EE123456789"},{country:"Ethiopia",countryCode:"ET",taxIdType:"et_tin",FlagComponent:b.ET,example:"1234567890"},{country:"EU",countryCode:"EU",taxIdType:"eu_oss_vat",FlagComponent:b.EU,example:"EU123456789"},{country:"Finland",countryCode:"FI",taxIdType:"eu_vat",FlagComponent:b.FI,example:"FI12345678"},{country:"France",countryCode:"FR",taxIdType:"eu_vat",FlagComponent:b.FR,example:"FRAB123456789"},{country:"Georgia",countryCode:"GE",taxIdType:"ge_vat",FlagComponent:b.GE,example:"123456789"},{country:"Germany",countryCode:"DE",taxIdType:"de_stn",FlagComponent:b.DE,example:"1234567890"},{country:"Germany",countryCode:"DE",taxIdType:"eu_vat",FlagComponent:b.DE,example:"DE123456789"},{country:"Greece",countryCode:"GR",taxIdType:"eu_vat",FlagComponent:b.GR,example:"EL123456789"},{country:"Guinea",countryCode:"GN",taxIdType:"gn_nif",FlagComponent:b.GN,example:"123456789"},{country:"Hong Kong",countryCode:"HK",taxIdType:"hk_br",FlagComponent:b.HK,example:"12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"eu_vat",FlagComponent:b.HU,example:"HU12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"hu_tin",FlagComponent:b.HU,example:"12345678-1-23"},{country:"Iceland",countryCode:"IS",taxIdType:"is_vat",FlagComponent:b.IS,example:"123456"},{country:"India",countryCode:"IN",taxIdType:"in_gst",FlagComponent:b.IN,example:"12ABCDE3456FGZH"},{country:"Indonesia",countryCode:"ID",taxIdType:"id_npwp",FlagComponent:b.ID,example:"012.345.678.9-012.345"},{country:"Ireland",countryCode:"IE",taxIdType:"eu_vat",FlagComponent:b.IE,example:"IE1234567AB"},{country:"Israel",countryCode:"IL",taxIdType:"il_vat",FlagComponent:b.IL,example:"000012345"},{country:"Italy",countryCode:"IT",taxIdType:"eu_vat",FlagComponent:b.IT,example:"IT12345678912"},{country:"Japan",countryCode:"JP",taxIdType:"jp_cn",FlagComponent:b.JP,example:"1234567891234"},{country:"Japan",countryCode:"JP",taxIdType:"jp_rn",FlagComponent:b.JP,example:"12345"},{country:"Japan",countryCode:"JP",taxIdType:"jp_trn",FlagComponent:b.JP,example:"T1234567891234"},{country:"Kazakhstan",countryCode:"KZ",taxIdType:"kz_bin",FlagComponent:b.KZ,example:"123456789012"},{country:"Kenya",countryCode:"KE",taxIdType:"ke_pin",FlagComponent:b.KE,example:"P000111111A"},{country:"Kyrgyzstan",countryCode:"KG",taxIdType:"kg_tin",FlagComponent:b.KG,example:"12345678901234"},{country:"Laos",countryCode:"LA",taxIdType:"la_tin",FlagComponent:b.LA,example:"123456789-000"},{country:"Latvia",countryCode:"LV",taxIdType:"eu_vat",FlagComponent:b.LV,example:"LV12345678912"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_uid",FlagComponent:b.LI,example:"CHE123456789"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_vat",FlagComponent:b.LI,example:"12345"},{country:"Lithuania",countryCode:"LT",taxIdType:"eu_vat",FlagComponent:b.LT,example:"LT123456789123"},{country:"Luxembourg",countryCode:"LU",taxIdType:"eu_vat",FlagComponent:b.LU,example:"LU12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_frp",FlagComponent:b.MY,example:"12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_itn",FlagComponent:b.MY,example:"C 1234567890"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_sst",FlagComponent:b.MY,example:"A12-3456-78912345"},{country:"Malta",countryCode:"MT",taxIdType:"eu_vat",FlagComponent:b.MT,example:"MT12345678"},{country:"Mauritania",countryCode:"MR",taxIdType:"mr_nif",FlagComponent:b.MR,example:"12345678"},{country:"Mexico",countryCode:"MX",taxIdType:"mx_rfc",FlagComponent:b.MX,example:"ABC010203AB9"},{country:"Moldova",countryCode:"MD",taxIdType:"md_vat",FlagComponent:b.MD,example:"1234567"},{country:"Montenegro",countryCode:"ME",taxIdType:"me_pib",FlagComponent:b.ME,example:"12345678"},{country:"Morocco",countryCode:"MA",taxIdType:"ma_vat",FlagComponent:b.MA,example:"12345678"},{country:"Nepal",countryCode:"NP",taxIdType:"np_pan",FlagComponent:b.NP,example:"123456789"},{country:"Netherlands",countryCode:"NL",taxIdType:"eu_vat",FlagComponent:b.NL,example:"NL123456789B12"},{country:"New Zealand",countryCode:"NZ",taxIdType:"nz_gst",FlagComponent:b.NZ,example:"123456789"},{country:"Nigeria",countryCode:"NG",taxIdType:"ng_tin",FlagComponent:b.NG,example:"12345678-0001"},{country:"North Macedonia",countryCode:"MK",taxIdType:"mk_vat",FlagComponent:b.MK,example:"MK1234567890123"},{country:"Norway",countryCode:"NO",taxIdType:"no_vat",FlagComponent:b.NO,example:"123456789MVA"},{country:"Norway",countryCode:"NO",taxIdType:"no_voec",FlagComponent:b.NO,example:"1234567"},{country:"Oman",countryCode:"OM",taxIdType:"om_vat",FlagComponent:b.OM,example:"OM1234567890"},{country:"Peru",countryCode:"PE",taxIdType:"pe_ruc",FlagComponent:b.PE,example:"12345678901"},{country:"Philippines",countryCode:"PH",taxIdType:"ph_tin",FlagComponent:b.PH,example:"123456789012"},{country:"Poland",countryCode:"PL",taxIdType:"eu_vat",FlagComponent:b.PL,example:"PL1234567890"},{country:"Portugal",countryCode:"PT",taxIdType:"eu_vat",FlagComponent:b.PT,example:"PT123456789"},{country:"Romania",countryCode:"RO",taxIdType:"eu_vat",FlagComponent:b.RO,example:"RO1234567891"},{country:"Romania",countryCode:"RO",taxIdType:"ro_tin",FlagComponent:b.RO,example:"1234567890123"},{country:"Russia",countryCode:"RU",taxIdType:"ru_inn",FlagComponent:b.RU,example:"1234567891"},{country:"Russia",countryCode:"RU",taxIdType:"ru_kpp",FlagComponent:b.RU,example:"123456789"},{country:"Saudi Arabia",countryCode:"SA",taxIdType:"sa_vat",FlagComponent:b.SA,example:"123456789012345"},{country:"Senegal",countryCode:"SN",taxIdType:"sn_ninea",FlagComponent:b.SN,example:"12345672A2"},{country:"Serbia",countryCode:"RS",taxIdType:"rs_pib",FlagComponent:b.RS,example:"123456789"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_gst",FlagComponent:b.SG,example:"M12345678X"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_uen",FlagComponent:b.SG,example:"123456789F"},{country:"Slovakia",countryCode:"SK",taxIdType:"eu_vat",FlagComponent:b.SK,example:"SK1234567891"},{country:"Slovenia",countryCode:"SI",taxIdType:"eu_vat",FlagComponent:b.SI,example:"SI12345678"},{country:"Slovenia",countryCode:"SI",taxIdType:"si_tin",FlagComponent:b.SI,example:"12345678"},{country:"South Africa",countryCode:"ZA",taxIdType:"za_vat",FlagComponent:b.ZA,example:"4123456789"},{country:"South Korea",countryCode:"KR",taxIdType:"kr_brn",FlagComponent:b.KR,example:"123-45-67890"},{country:"Spain",countryCode:"ES",taxIdType:"es_cif",FlagComponent:b.ES,example:"A12345678"},{country:"Spain",countryCode:"ES",taxIdType:"eu_vat",FlagComponent:b.ES,example:"ESA1234567Z"},{country:"Suriname",countryCode:"SR",taxIdType:"sr_fin",FlagComponent:b.SR,example:"1234567890"},{country:"Sweden",countryCode:"SE",taxIdType:"eu_vat",FlagComponent:b.SE,example:"SE123456789123"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_uid",FlagComponent:b.CH,example:"CHE-123.456.789 HR"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_vat",FlagComponent:b.CH,example:"CHE-123.456.789 MWST"},{country:"Taiwan",countryCode:"TW",taxIdType:"tw_vat",FlagComponent:b.TW,example:"12345678"},{country:"Tajikistan",countryCode:"TJ",taxIdType:"tj_tin",FlagComponent:b.TJ,example:"123456789"},{country:"Tanzania",countryCode:"TZ",taxIdType:"tz_vat",FlagComponent:b.TZ,example:"12345678A"},{country:"Thailand",countryCode:"TH",taxIdType:"th_vat",FlagComponent:b.TH,example:"1234567891234"},{country:"Turkey",countryCode:"TR",taxIdType:"tr_tin",FlagComponent:b.TR,example:"0123456789"},{country:"Uganda",countryCode:"UG",taxIdType:"ug_tin",FlagComponent:b.UG,example:"1014751879"},{country:"Ukraine",countryCode:"UA",taxIdType:"ua_vat",FlagComponent:b.UA,example:"123456789"},{country:"United Arab Emirates",countryCode:"AE",taxIdType:"ae_trn",FlagComponent:b.AE,example:"123456789012345"},{country:"United Kingdom",countryCode:"GB",taxIdType:"eu_vat",FlagComponent:b.GB,example:"XI123456789"},{country:"United Kingdom",countryCode:"GB",taxIdType:"gb_vat",FlagComponent:b.GB,example:"GB123456789"},{country:"United States",countryCode:"US",taxIdType:"us_ein",FlagComponent:b.US,example:"12-3456789"},{country:"Uruguay",countryCode:"UY",taxIdType:"uy_ruc",FlagComponent:b.UY,example:"123456789012"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_tin",FlagComponent:b.UZ,example:"123456789"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_vat",FlagComponent:b.UZ,example:"123456789012"},{country:"Venezuela",countryCode:"VE",taxIdType:"ve_rif",FlagComponent:b.VE,example:"A-12345678-9"},{country:"Vietnam",countryCode:"VN",taxIdType:"vn_tin",FlagComponent:b.VN,example:"1234567890"},{country:"Zambia",countryCode:"ZM",taxIdType:"zm_tin",FlagComponent:b.ZM,example:"1004751879"},{country:"Zimbabwe",countryCode:"ZW",taxIdType:"zw_tin",FlagComponent:b.ZW,example:"1234567890"}],fw="United States",gw=" # ",ua="us_ein",pa=(e,t)=>`${e}${gw}${t}`,Tc=new Map(Sc.map(e=>[pa(e.taxIdType,e.country),e])),Mn=e=>Tc.get(e),ha=pa(ua,fw);var kc=x(Rt)(()=>({"& .MuiOutlinedInput-root":{borderRadius:"5px",padding:"12px",fieldset:{borderColor:"#e6e6e6"}},"& .MuiInputBase-input":{borderRadius:"5px",fontSize:"16px",padding:"0 0"}}));var Pw=x(Autocomplete)(()=>({"& .MuiAutocomplete-input":{padding:"0 !important"}})),ma=x(C)({});ma.defaultProps={variant:"body1",color:"secondary"};function Tg(){let[e,t]=useState(false),{billingAddress:o,taxId:n,setTaxId:i}=vt(),[r,a]=useState(ha),[s,l]=useState(false),c=useCallback((h,f,g)=>{i({type:f,value:g}),a(h);},[i,a]);useEffect(()=>{l(false);},[o==null?void 0:o.country]),useEffect(()=>{if(!(o!=null&&o.country)||s||!e)return;let h=Sc.find(f=>f.countryCode===o.country);h&&c(pa(h.taxIdType,h.country),h.taxIdType,"");},[o,e,s,c]);let d=h=>{if(!h)return;let f=Mn(h);if(f){if(l(true),n!=null&&n.value){c(h,f.taxIdType,n.value);return}a(h),n!=null&&n.type&&i(void 0);}},u=useMemo(()=>Array.from(Tc.keys()),[]),p=useMemo(()=>u.find(h=>h===r)||null,[u,r]),m=useMemo(()=>{let h=Mn(r);return (h==null?void 0:h.example)||"Add your VAT/GST or local tax ID."},[r]);return useEffect(()=>(e||(l(false),c(ha,ua,"")),()=>{c(ha,ua,"");}),[e,c]),jsxs(Pe,{flexDirection:"column",container:true,gap:2,children:[jsx(Pe,{flexDirection:"row",container:true,gap:2,children:jsx(Cg,{checked:e,onChange:()=>t(h=>!h),label:jsx(ma,{children:"I'm purchasing as a business"})})}),jsx(Collapse,{in:e,children:jsxs(Pe,{container:true,spacing:0,sx:{width:"100%"},children:[jsxs(Pe,{item:true,xs:6,children:[jsx(ma,{children:"Tax ID Type"}),jsx(Pw,{fullWidth:true,options:u,value:p,onChange:(h,f)=>d(f),renderInput:h=>jsx(kc,_(S({},h),{id:"id-type",InputProps:h.InputProps})),renderOption:(h,f)=>{let g=Mn(f);if(!g)return null;let{taxIdType:y,country:P,FlagComponent:T}=g;return createElement(MenuItem,_(S({},h),{key:f}),jsxs(C,{variant:"body1",lineHeight:"20px",color:"secondary",children:[T&&jsx(T,{width:15,style:{marginRight:"5px",borderRadius:"8%"}}),startCase(P)," - ",upperCase(y)]}))},getOptionLabel:h=>{let f=Mn(h);return f?`${startCase(f.country)} - ${upperCase(f.taxIdType)}`:h},ListboxProps:{sx:{maxHeight:200}}})]}),jsxs(Pe,{item:true,xs:6,paddingLeft:"12px",children:[jsx(ma,{children:"Tax ID"}),jsx(kc,{id:"tax-id-value",placeholder:m,type:"text",fullWidth:true,value:(n==null?void 0:n.value)||"",onChange:h=>{let f=Mn(r);f&&c(r,f.taxIdType,h.target.value);}})]})]})})]})}function kg({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o}){var h;let{checkoutState:n,checkoutLocalization:i,widgetState:r,setWidgetReadOnly:a}=Y(),{setBillingAddress:s}=vt(),{customer:l,configuration:c}=n||{},{readOnly:d}=r,u=!!(t!=null?t:(h=c==null?void 0:c.content)!=null&&h.collectPhoneNumber),p=useMemo(()=>o&&!(l!=null&&l.billingId)&&!(l!=null&&l.paymentMethodDetails),[o,l==null?void 0:l.billingId,l==null?void 0:l.paymentMethodDetails]),m=f=>{if(!f.complete)return;let T=f.value.address,{postal_code:g}=T,y=ot(T,["postal_code"]),P=S({postalCode:g},y);a(true),s(P),e?R(null,null,function*(){yield e({billingAddress:P}),a(false);}):a(false);};return jsxs(Pe,{flexDirection:"column",container:true,gap:3,padding:"16px",sx:{pointerEvents:d?"none":void 0},children:[jsxs(Pe,{flexDirection:"column",container:true,gap:2,children:[jsx(C,{variant:"h6",children:i.newPaymentMethodBillingAddressTitle}),jsx(AddressElement,{onChange:m,options:{mode:"billing",fields:{phone:u?"always":"auto"},defaultValues:S({},(l==null?void 0:l.name)&&{name:l.name})}})]}),jsxs(Pe,{flexDirection:"column",container:true,gap:2,children:[jsx(C,{variant:"h6",children:i.newPaymentMethodCardTitle}),jsx(PaymentElement,{onChange:()=>{},onReady:()=>{},options:{readOnly:d,terms:{card:"never"},defaultValues:{billingDetails:S(S({},(l==null?void 0:l.name)&&{name:l.name}),(l==null?void 0:l.email)&&{email:l.email})}}})]}),p&&jsx(Tg,{})]})}function wg(){let[e,t]=useState(null),{checkoutState:o}=Y(),{billingIntegration:n,setupSecret:i}=o||{};return useEffect(()=>{if(n){let{billingIdentifier:r,credentials:a}=n;if(r!==BillingVendorIdentifier.Stripe)return;let{accountId:s,publicKey:l}=a;if(!s||!l){console.error("Stripe account ID or public key is missing");return}import('@stripe/stripe-js').then(({loadStripe:c})=>{t(c(l,{stripeAccount:s}));});}},[n]),{stripePromise:e,setupIntentClientSecret:i}}function fa(e){var n;let t=D({optional:true}),o=t==null?void 0:t.stigg;return o?o.getBooleanEntitlement(e):S(S({},BOOLEAN_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function ga(e){var n;let t=D({optional:true}),o=t==null?void 0:t.stigg;return o?o.getNumericEntitlement(e):S(S({},NUMERIC_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function ya(e){var n;let t=D({optional:true}),o=t==null?void 0:t.stigg;return o?o.getMeteredEntitlement(e):S(S({},METERED_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function xa(e){var n;let t=D({optional:true}),o=t==null?void 0:t.stigg;return o?o.getEnumEntitlement(e):S(S({},ENUM_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function Ot({func:e}){let[t,o]=useState(true),[n,i]=useState(null),[r,a]=useState(null),s=useRef(false);return useEffect(()=>{R(null,null,function*(){s.current||o(true);try{let c=yield e();a(c),i(null),c!==null&&(s.current=!0);}catch(c){i(c),s.current=true;}finally{s.current?o(false):o(true);}});},[e]),{isLoading:t,error:n,data:r}}function vg(e){let t=D({optional:true}),o=t==null?void 0:t.stigg,n=useCallback(()=>o?o.getActiveSubscriptions(e):Promise.resolve([]),[e,o]),{data:i,error:r,isLoading:a}=Ot({func:n});return useMemo(()=>({activeSubscriptions:i,isLoading:a,error:r}),[i,r,a])}function _g(e){let t=D({optional:true}),o=t==null?void 0:t.stigg,n=useCallback(()=>o?o.getPaywall(e):Promise.resolve(null),[e,o]),{data:i,error:r,isLoading:a}=Ot({func:n});return useMemo(()=>({paywall:i,isLoading:a,error:r}),[i,r,a])}function Ag(e){let t=D({optional:true}),o=t==null?void 0:t.stigg,n=useCallback(()=>o?o.getCustomerPortal(e):Promise.resolve(null),[e,o]),{data:i,error:r,isLoading:a}=Ot({func:n});return useMemo(()=>({customerPortal:i,isLoading:a,error:r}),[i,r,a])}function ba(){let e=_n(),[{resourceId:t}]=j(),{checkoutState:o}=Y(),{plan:n}=o||{},i=e.addons.map(({addon:r,quantity:a})=>({addonId:r.id,quantity:a}));if(n!=null&&n.id)return S({resourceId:t,planId:n.id,billingPeriod:e.billingPeriod,billableFeatures:e.billableFeatures,addons:i,promotionCode:e.promotionCode,billingCountryCode:e.billingCountryCode},sa({taxIds:e.taxId?[e.taxId]:void 0}))}var $w=[PaymentCollection.Failed,PaymentCollection.Processing];function Vw(t){return R(this,arguments,function*({elements:e}){if(!e){let n="Stripe elements not initialized";return console.error(n),{success:false,errorMessage:n}}let{error:o}=yield e.submit();return o?(console.log(o.message),{success:false,errorMessage:o.message||""}):{success:true}})}function Bc(o){return R(this,arguments,function*({applySubscriptionResults:e,stripe:t}){var a,s;let n=e==null?void 0:e.subscription,i=(a=n==null?void 0:n.latestInvoice)==null?void 0:a.paymentSecret,r=n==null?void 0:n.paymentCollection;if(t&&i&&r===PaymentCollection.ActionRequired){let{error:l}=yield t.handleNextAction({clientSecret:i});if(l)return {errorMessage:l.message||""}}else if(r&&$w.includes(r))return {errorMessage:((s=n==null?void 0:n.latestInvoice)==null?void 0:s.errorMessage)||"An error occurred - try again later"};return {subscription:n}})}function Hw(n){return R(this,arguments,function*({stripe:e,elements:t,clientSecret:o}){let i,r,{error:a}=yield e.confirmSetup({elements:t,confirmParams:{return_url:window.location.href},redirect:"if_required"});if(a)a.type==="card_error"||a.type==="validation_error"?a.type==="card_error"&&(r=a.message||""):r="An unexpected error occurred.";else try{let{setupIntent:s}=yield e.retrieveSetupIntent(o);s!=null&&s.payment_method&&(i=s.payment_method);}catch(s){r="An unexpected error occurred.",console.error(s);}return {newPaymentMethodId:i,setupErrorMessage:r}})}function Mg(n){return R(this,arguments,function*({stripe:e,elements:t,setupIntentClientSecret:o}){if(!e||!t||!o)return {success:false};let i=yield Vw({elements:t});if(!i.success)return {success:false,errorMessage:i.errorMessage};let{newPaymentMethodId:r,setupErrorMessage:a}=yield Hw({stripe:e,elements:t,clientSecret:o});return a||!r?{success:false,errorMessage:a}:{success:true,paymentMethodId:r}})}var Ig={v:"5.12.1",fr:30,ip:0,op:201,w:700,h:700,nm:"Check",ddd:0,assets:[],layers:[{ddd:0,ind:1,ty:4,nm:"Shape Layer 8",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:315,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Shape Layer 7",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:270,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:3,ty:4,nm:"Shape Layer 6",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:225,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:4,ty:4,nm:"Shape Layer 5",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:180,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:5,ty:4,nm:"Shape Layer 4",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:135,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:6,ty:4,nm:"Shape Layer 3",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:90,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:7,ty:4,nm:"Shape Layer 2",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:45,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:8,ty:4,nm:"Shape Layer 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:9,ty:4,nm:"Check v",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:-1.9,ix:10},p:{a:0,k:[352,360,0],ix:2,l:2},a:{a:0,k:[-120.265,116.765,0],ix:1,l:2},s:{a:0,k:[278,278,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0]],v:[[-161,123],[-137,148],[-79.531,85.531]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:5.5,ix:5},lc:2,lj:2,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[0],y:[1]},o:{x:[.333],y:[0]},t:135,s:[0]},{t:148,s:[100]}],ix:1},e:{a:0,k:0,ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:135,op:201,st:-35,ct:1,bm:0},{ddd:0,ind:11,ty:4,nm:"Circle Stroke",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:7,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[4,-6,0],ix:1,l:2},s:{a:0,k:[132,132,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[306,306],ix:2},p:{a:0,k:[0,0],ix:3},nm:"Ellipse Path 1",mn:"ADBE Vector Shape - Ellipse",hd:false},{ty:"st",c:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:30,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:61,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:87,s:[1,1,1,1]},{t:136,s:[1,1,1,1]}],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:8,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[4,-6],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Ellipse 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[50]},{t:122,s:[100]}],ix:1},e:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[45]},{t:122,s:[0]}],ix:2},o:{a:1,k:[{i:{x:[.474],y:[1]},o:{x:[.43],y:[0]},t:0,s:[-170.4]},{t:111,s:[-1250.4]}],ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:0,op:201,st:0,ct:1,bm:0},{ddd:0,ind:13,ty:1,nm:"Dark Gray Solid 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[350,350,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,sw:700,sh:700,sc:"#2d2d2d",ip:0,op:201,st:0,bm:0}],markers:[],props:{}};var Ca=5e3,Xw=x(Ma)`
715
+ `,Lf=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{promotionCode:n,setPromotionCode:i}=An();return jsx(Lw,{children:n?jsx(Ff,{promotionCode:n,onClearPromotionCode:()=>{i("");}}):jsx(Mf,{disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})})};var Bf=({label:e,checked:t,onChange:o,onClick:n,value:i,disabled:r,dataTestId:a})=>jsx(FormControlLabel,{onClick:n,value:i,control:jsx(Checkbox,{checked:t,onChange:o,disabled:r,"data-testid":a}),label:isString(e)?jsx(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:e}):e});var Fc=[{country:"Albania",countryCode:"AL",taxIdType:"al_tin",FlagComponent:C.AL,example:"J12345678N"},{country:"Andorra",countryCode:"AD",taxIdType:"ad_nrt",FlagComponent:C.AD,example:"A-123456-Z"},{country:"Angola",countryCode:"AO",taxIdType:"ao_tin",FlagComponent:C.AO,example:"5123456789"},{country:"Argentina",countryCode:"AR",taxIdType:"ar_cuit",FlagComponent:C.AR,example:"12-3456789-01"},{country:"Armenia",countryCode:"AM",taxIdType:"am_tin",FlagComponent:C.AM,example:"02538904"},{country:"Aruba",countryCode:"AW",taxIdType:"aw_tin",FlagComponent:C.AW,example:"12345678"},{country:"Australia",countryCode:"AU",taxIdType:"au_abn",FlagComponent:C.AU,example:"12345678912"},{country:"Australia",countryCode:"AU",taxIdType:"au_arn",FlagComponent:C.AU,example:"123456789123"},{country:"Austria",countryCode:"AT",taxIdType:"eu_vat",FlagComponent:C.AT,example:"ATU12345678"},{country:"Azerbaijan",countryCode:"AZ",taxIdType:"az_tin",FlagComponent:C.AZ,example:"0123456789"},{country:"Bahamas",countryCode:"BS",taxIdType:"bs_tin",FlagComponent:C.BS,example:"123.456.789"},{country:"Bahrain",countryCode:"BH",taxIdType:"bh_vat",FlagComponent:C.BH,example:"123456789012345"},{country:"Bangladesh",countryCode:"BD",taxIdType:"bd_bin",FlagComponent:C.BD,example:"123456789-0123"},{country:"Barbados",countryCode:"BB",taxIdType:"bb_tin",FlagComponent:C.BB,example:"1123456789012"},{country:"Belarus",countryCode:"BY",taxIdType:"by_tin",FlagComponent:C.BY,example:"123456789"},{country:"Belgium",countryCode:"BE",taxIdType:"eu_vat",FlagComponent:C.BE,example:"BE0123456789"},{country:"Benin",countryCode:"BJ",taxIdType:"bj_ifu",FlagComponent:C.BJ,example:"1234567890123"},{country:"Bolivia",countryCode:"BO",taxIdType:"bo_tin",FlagComponent:C.BO,example:"123456789"},{country:"Bosnia & Herzegovina",countryCode:"BA",taxIdType:"ba_tin",FlagComponent:C.BA,example:"123456789012"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cnpj",FlagComponent:C.BR,example:"01.234.456/5432-10"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cpf",FlagComponent:C.BR,example:"123.456.789-87"},{country:"Bulgaria",countryCode:"BG",taxIdType:"bg_uic",FlagComponent:C.BG,example:"123456789"},{country:"Bulgaria",countryCode:"BG",taxIdType:"eu_vat",FlagComponent:C.BG,example:"BG0123456789"},{country:"Burkina Faso",countryCode:"BF",taxIdType:"bf_ifu",FlagComponent:C.BF,example:"12345678A"},{country:"Cambodia",countryCode:"KH",taxIdType:"kh_tin",FlagComponent:C.KH,example:"1001-123456789"},{country:"Cameroon",countryCode:"CM",taxIdType:"cm_niu",FlagComponent:C.CM,example:"M123456789000L"},{country:"Canada",countryCode:"CA",taxIdType:"ca_bn",FlagComponent:C.CA,example:"123456789"},{country:"Canada",countryCode:"CA",taxIdType:"ca_gst_hst",FlagComponent:C.CA,example:"123456789RT0002"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_bc",FlagComponent:C.CA,example:"PST-1234-5678"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_mb",FlagComponent:C.CA,example:"123456-7"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_sk",FlagComponent:C.CA,example:"1234567"},{country:"Canada",countryCode:"CA",taxIdType:"ca_qst",FlagComponent:C.CA,example:"1234567890TQ1234"},{country:"Cape Verde",countryCode:"CV",taxIdType:"cv_nif",FlagComponent:C.CV,example:"213456789"},{country:"Chile",countryCode:"CL",taxIdType:"cl_tin",FlagComponent:C.CL,example:"12.345.678-K"},{country:"China",countryCode:"CN",taxIdType:"cn_tin",FlagComponent:C.CN,example:"123456789012345678"},{country:"Colombia",countryCode:"CO",taxIdType:"co_nit",FlagComponent:C.CO,example:"123.456.789-0"},{country:"Congo - Kinshasa",countryCode:"CD",taxIdType:"cd_nif",FlagComponent:C.CD,example:"A0123456M"},{country:"Costa Rica",countryCode:"CR",taxIdType:"cr_tin",FlagComponent:C.CR,example:"1-234-567890"},{country:"Croatia",countryCode:"HR",taxIdType:"eu_vat",FlagComponent:C.HR,example:"HR12345678912"},{country:"Croatia",countryCode:"HR",taxIdType:"hr_oib",FlagComponent:C.HR,example:"12345678901"},{country:"Cyprus",countryCode:"CY",taxIdType:"eu_vat",FlagComponent:C.CY,example:"CY12345678Z"},{country:"Czech Republic",countryCode:"CZ",taxIdType:"eu_vat",FlagComponent:C.CZ,example:"CZ1234567890"},{country:"Denmark",countryCode:"DK",taxIdType:"eu_vat",FlagComponent:C.DK,example:"DK12345678"},{country:"Dominican Republic",countryCode:"DO",taxIdType:"do_rcn",FlagComponent:C.DO,example:"123-4567890-1"},{country:"Ecuador",countryCode:"EC",taxIdType:"ec_ruc",FlagComponent:C.EC,example:"1234567890001"},{country:"Egypt",countryCode:"EG",taxIdType:"eg_tin",FlagComponent:C.EG,example:"123456789"},{country:"El Salvador",countryCode:"SV",taxIdType:"sv_nit",FlagComponent:C.SV,example:"1234-567890-123-4"},{country:"Estonia",countryCode:"EE",taxIdType:"eu_vat",FlagComponent:C.EE,example:"EE123456789"},{country:"Ethiopia",countryCode:"ET",taxIdType:"et_tin",FlagComponent:C.ET,example:"1234567890"},{country:"EU",countryCode:"EU",taxIdType:"eu_oss_vat",FlagComponent:C.EU,example:"EU123456789"},{country:"Finland",countryCode:"FI",taxIdType:"eu_vat",FlagComponent:C.FI,example:"FI12345678"},{country:"France",countryCode:"FR",taxIdType:"eu_vat",FlagComponent:C.FR,example:"FRAB123456789"},{country:"Georgia",countryCode:"GE",taxIdType:"ge_vat",FlagComponent:C.GE,example:"123456789"},{country:"Germany",countryCode:"DE",taxIdType:"de_stn",FlagComponent:C.DE,example:"1234567890"},{country:"Germany",countryCode:"DE",taxIdType:"eu_vat",FlagComponent:C.DE,example:"DE123456789"},{country:"Greece",countryCode:"GR",taxIdType:"eu_vat",FlagComponent:C.GR,example:"EL123456789"},{country:"Guinea",countryCode:"GN",taxIdType:"gn_nif",FlagComponent:C.GN,example:"123456789"},{country:"Hong Kong",countryCode:"HK",taxIdType:"hk_br",FlagComponent:C.HK,example:"12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"eu_vat",FlagComponent:C.HU,example:"HU12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"hu_tin",FlagComponent:C.HU,example:"12345678-1-23"},{country:"Iceland",countryCode:"IS",taxIdType:"is_vat",FlagComponent:C.IS,example:"123456"},{country:"India",countryCode:"IN",taxIdType:"in_gst",FlagComponent:C.IN,example:"12ABCDE3456FGZH"},{country:"Indonesia",countryCode:"ID",taxIdType:"id_npwp",FlagComponent:C.ID,example:"012.345.678.9-012.345"},{country:"Ireland",countryCode:"IE",taxIdType:"eu_vat",FlagComponent:C.IE,example:"IE1234567AB"},{country:"Israel",countryCode:"IL",taxIdType:"il_vat",FlagComponent:C.IL,example:"000012345"},{country:"Italy",countryCode:"IT",taxIdType:"eu_vat",FlagComponent:C.IT,example:"IT12345678912"},{country:"Japan",countryCode:"JP",taxIdType:"jp_cn",FlagComponent:C.JP,example:"1234567891234"},{country:"Japan",countryCode:"JP",taxIdType:"jp_rn",FlagComponent:C.JP,example:"12345"},{country:"Japan",countryCode:"JP",taxIdType:"jp_trn",FlagComponent:C.JP,example:"T1234567891234"},{country:"Kazakhstan",countryCode:"KZ",taxIdType:"kz_bin",FlagComponent:C.KZ,example:"123456789012"},{country:"Kenya",countryCode:"KE",taxIdType:"ke_pin",FlagComponent:C.KE,example:"P000111111A"},{country:"Kyrgyzstan",countryCode:"KG",taxIdType:"kg_tin",FlagComponent:C.KG,example:"12345678901234"},{country:"Laos",countryCode:"LA",taxIdType:"la_tin",FlagComponent:C.LA,example:"123456789-000"},{country:"Latvia",countryCode:"LV",taxIdType:"eu_vat",FlagComponent:C.LV,example:"LV12345678912"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_uid",FlagComponent:C.LI,example:"CHE123456789"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_vat",FlagComponent:C.LI,example:"12345"},{country:"Lithuania",countryCode:"LT",taxIdType:"eu_vat",FlagComponent:C.LT,example:"LT123456789123"},{country:"Luxembourg",countryCode:"LU",taxIdType:"eu_vat",FlagComponent:C.LU,example:"LU12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_frp",FlagComponent:C.MY,example:"12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_itn",FlagComponent:C.MY,example:"C 1234567890"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_sst",FlagComponent:C.MY,example:"A12-3456-78912345"},{country:"Malta",countryCode:"MT",taxIdType:"eu_vat",FlagComponent:C.MT,example:"MT12345678"},{country:"Mauritania",countryCode:"MR",taxIdType:"mr_nif",FlagComponent:C.MR,example:"12345678"},{country:"Mexico",countryCode:"MX",taxIdType:"mx_rfc",FlagComponent:C.MX,example:"ABC010203AB9"},{country:"Moldova",countryCode:"MD",taxIdType:"md_vat",FlagComponent:C.MD,example:"1234567"},{country:"Montenegro",countryCode:"ME",taxIdType:"me_pib",FlagComponent:C.ME,example:"12345678"},{country:"Morocco",countryCode:"MA",taxIdType:"ma_vat",FlagComponent:C.MA,example:"12345678"},{country:"Nepal",countryCode:"NP",taxIdType:"np_pan",FlagComponent:C.NP,example:"123456789"},{country:"Netherlands",countryCode:"NL",taxIdType:"eu_vat",FlagComponent:C.NL,example:"NL123456789B12"},{country:"New Zealand",countryCode:"NZ",taxIdType:"nz_gst",FlagComponent:C.NZ,example:"123456789"},{country:"Nigeria",countryCode:"NG",taxIdType:"ng_tin",FlagComponent:C.NG,example:"12345678-0001"},{country:"North Macedonia",countryCode:"MK",taxIdType:"mk_vat",FlagComponent:C.MK,example:"MK1234567890123"},{country:"Norway",countryCode:"NO",taxIdType:"no_vat",FlagComponent:C.NO,example:"123456789MVA"},{country:"Norway",countryCode:"NO",taxIdType:"no_voec",FlagComponent:C.NO,example:"1234567"},{country:"Oman",countryCode:"OM",taxIdType:"om_vat",FlagComponent:C.OM,example:"OM1234567890"},{country:"Peru",countryCode:"PE",taxIdType:"pe_ruc",FlagComponent:C.PE,example:"12345678901"},{country:"Philippines",countryCode:"PH",taxIdType:"ph_tin",FlagComponent:C.PH,example:"123456789012"},{country:"Poland",countryCode:"PL",taxIdType:"eu_vat",FlagComponent:C.PL,example:"PL1234567890"},{country:"Portugal",countryCode:"PT",taxIdType:"eu_vat",FlagComponent:C.PT,example:"PT123456789"},{country:"Romania",countryCode:"RO",taxIdType:"eu_vat",FlagComponent:C.RO,example:"RO1234567891"},{country:"Romania",countryCode:"RO",taxIdType:"ro_tin",FlagComponent:C.RO,example:"1234567890123"},{country:"Russia",countryCode:"RU",taxIdType:"ru_inn",FlagComponent:C.RU,example:"1234567891"},{country:"Russia",countryCode:"RU",taxIdType:"ru_kpp",FlagComponent:C.RU,example:"123456789"},{country:"Saudi Arabia",countryCode:"SA",taxIdType:"sa_vat",FlagComponent:C.SA,example:"123456789012345"},{country:"Senegal",countryCode:"SN",taxIdType:"sn_ninea",FlagComponent:C.SN,example:"12345672A2"},{country:"Serbia",countryCode:"RS",taxIdType:"rs_pib",FlagComponent:C.RS,example:"123456789"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_gst",FlagComponent:C.SG,example:"M12345678X"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_uen",FlagComponent:C.SG,example:"123456789F"},{country:"Slovakia",countryCode:"SK",taxIdType:"eu_vat",FlagComponent:C.SK,example:"SK1234567891"},{country:"Slovenia",countryCode:"SI",taxIdType:"eu_vat",FlagComponent:C.SI,example:"SI12345678"},{country:"Slovenia",countryCode:"SI",taxIdType:"si_tin",FlagComponent:C.SI,example:"12345678"},{country:"South Africa",countryCode:"ZA",taxIdType:"za_vat",FlagComponent:C.ZA,example:"4123456789"},{country:"South Korea",countryCode:"KR",taxIdType:"kr_brn",FlagComponent:C.KR,example:"123-45-67890"},{country:"Spain",countryCode:"ES",taxIdType:"es_cif",FlagComponent:C.ES,example:"A12345678"},{country:"Spain",countryCode:"ES",taxIdType:"eu_vat",FlagComponent:C.ES,example:"ESA1234567Z"},{country:"Suriname",countryCode:"SR",taxIdType:"sr_fin",FlagComponent:C.SR,example:"1234567890"},{country:"Sweden",countryCode:"SE",taxIdType:"eu_vat",FlagComponent:C.SE,example:"SE123456789123"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_uid",FlagComponent:C.CH,example:"CHE-123.456.789 HR"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_vat",FlagComponent:C.CH,example:"CHE-123.456.789 MWST"},{country:"Taiwan",countryCode:"TW",taxIdType:"tw_vat",FlagComponent:C.TW,example:"12345678"},{country:"Tajikistan",countryCode:"TJ",taxIdType:"tj_tin",FlagComponent:C.TJ,example:"123456789"},{country:"Tanzania",countryCode:"TZ",taxIdType:"tz_vat",FlagComponent:C.TZ,example:"12345678A"},{country:"Thailand",countryCode:"TH",taxIdType:"th_vat",FlagComponent:C.TH,example:"1234567891234"},{country:"Turkey",countryCode:"TR",taxIdType:"tr_tin",FlagComponent:C.TR,example:"0123456789"},{country:"Uganda",countryCode:"UG",taxIdType:"ug_tin",FlagComponent:C.UG,example:"1014751879"},{country:"Ukraine",countryCode:"UA",taxIdType:"ua_vat",FlagComponent:C.UA,example:"123456789"},{country:"United Arab Emirates",countryCode:"AE",taxIdType:"ae_trn",FlagComponent:C.AE,example:"123456789012345"},{country:"United Kingdom",countryCode:"GB",taxIdType:"eu_vat",FlagComponent:C.GB,example:"XI123456789"},{country:"United Kingdom",countryCode:"GB",taxIdType:"gb_vat",FlagComponent:C.GB,example:"GB123456789"},{country:"United States",countryCode:"US",taxIdType:"us_ein",FlagComponent:C.US,example:"12-3456789"},{country:"Uruguay",countryCode:"UY",taxIdType:"uy_ruc",FlagComponent:C.UY,example:"123456789012"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_tin",FlagComponent:C.UZ,example:"123456789"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_vat",FlagComponent:C.UZ,example:"123456789012"},{country:"Venezuela",countryCode:"VE",taxIdType:"ve_rif",FlagComponent:C.VE,example:"A-12345678-9"},{country:"Vietnam",countryCode:"VN",taxIdType:"vn_tin",FlagComponent:C.VN,example:"1234567890"},{country:"Zambia",countryCode:"ZM",taxIdType:"zm_tin",FlagComponent:C.ZM,example:"1004751879"},{country:"Zimbabwe",countryCode:"ZW",taxIdType:"zw_tin",FlagComponent:C.ZW,example:"1234567890"}],Nw="United States",Uw=" # ",ba="us_ein",Ca=(e,t)=>`${e}${Uw}${t}`,Lc=new Map(Fc.map(e=>[Ca(e.taxIdType,e.country),e])),Mn=e=>Lc.get(e),Pa=Ca(ba,Nw);var Bc=y(Rt)(()=>({"& .MuiOutlinedInput-root":{borderRadius:"5px",padding:"12px",fieldset:{borderColor:"#e6e6e6"}},"& .MuiInputBase-input":{borderRadius:"5px",fontSize:"16px",padding:"0 0"}}));var Hw=y(Autocomplete)(()=>({"& .MuiAutocomplete-input":{padding:"0 !important"}})),Sa=y(P)({});Sa.defaultProps={variant:"body1",color:"secondary"};function Nf(){let[e,t]=useState(false),{billingAddress:o,taxId:n,setTaxId:i}=vt(),[r,a]=useState(Pa),[s,l]=useState(false),c=useCallback((m,g,f)=>{i({type:g,value:f}),a(m);},[i,a]);useEffect(()=>{l(false);},[o==null?void 0:o.country]),useEffect(()=>{if(!(o!=null&&o.country)||s||!e)return;let m=Fc.find(g=>g.countryCode===o.country);m&&c(Ca(m.taxIdType,m.country),m.taxIdType,"");},[o,e,s,c]);let d=m=>{if(!m)return;let g=Mn(m);if(g){if(l(true),n!=null&&n.value){c(m,g.taxIdType,n.value);return}a(m),n!=null&&n.type&&i(void 0);}},u=useMemo(()=>Array.from(Lc.keys()),[]),p=useMemo(()=>u.find(m=>m===r)||null,[u,r]),h=useMemo(()=>{let m=Mn(r);return (m==null?void 0:m.example)||"Add your VAT/GST or local tax ID."},[r]);return useEffect(()=>(e||(l(false),c(Pa,ba,"")),()=>{c(Pa,ba,"");}),[e,c]),jsxs(Se,{flexDirection:"column",container:true,gap:2,children:[jsx(Se,{flexDirection:"row",container:true,gap:2,children:jsx(Bf,{checked:e,onChange:()=>t(m=>!m),label:jsx(Sa,{children:"I'm purchasing as a business"})})}),jsx(Collapse,{in:e,children:jsxs(Se,{container:true,spacing:0,sx:{width:"100%"},children:[jsxs(Se,{item:true,xs:6,children:[jsx(Sa,{children:"Tax ID Type"}),jsx(Hw,{fullWidth:true,options:u,value:p,onChange:(m,g)=>d(g),renderInput:m=>jsx(Bc,A(S({},m),{id:"id-type",InputProps:m.InputProps})),renderOption:(m,g)=>{let f=Mn(g);if(!f)return null;let{taxIdType:x,country:b,FlagComponent:T}=f;return createElement(MenuItem,A(S({},m),{key:g}),jsxs(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:[T&&jsx(T,{width:15,style:{marginRight:"5px",borderRadius:"8%"}}),startCase(b)," - ",upperCase(x)]}))},getOptionLabel:m=>{let g=Mn(m);return g?`${startCase(g.country)} - ${upperCase(g.taxIdType)}`:m},ListboxProps:{sx:{maxHeight:200}}})]}),jsxs(Se,{item:true,xs:6,paddingLeft:"12px",children:[jsx(Sa,{children:"Tax ID"}),jsx(Bc,{id:"tax-id-value",placeholder:h,type:"text",fullWidth:true,value:(n==null?void 0:n.value)||"",onChange:m=>{let g=Mn(r);g&&c(r,g.taxIdType,m.target.value);}})]})]})})]})}function Uf({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o}){var m;let{checkoutState:n,checkoutLocalization:i,widgetState:r,setWidgetReadOnly:a}=Y(),{setBillingAddress:s}=vt(),{customer:l,configuration:c}=n||{},{readOnly:d}=r,u=!!(t!=null?t:(m=c==null?void 0:c.content)!=null&&m.collectPhoneNumber),p=useMemo(()=>o&&!(l!=null&&l.billingId)&&!(l!=null&&l.paymentMethodDetails),[o,l==null?void 0:l.billingId,l==null?void 0:l.paymentMethodDetails]),h=g=>{if(!g.complete)return;let T=g.value.address,{postal_code:f}=T,x=ot(T,["postal_code"]),b=S({postalCode:f},x);a(true),s(b),e?R(null,null,function*(){yield e({billingAddress:b}),a(false);}):a(false);};return jsxs(Se,{flexDirection:"column",container:true,gap:3,padding:"16px",sx:{pointerEvents:d?"none":void 0},children:[jsxs(Se,{flexDirection:"column",container:true,gap:2,children:[jsx(P,{variant:"h6",children:i.newPaymentMethodBillingAddressTitle}),jsx(AddressElement,{onChange:h,options:{mode:"billing",fields:{phone:u?"always":"auto"},defaultValues:S({},(l==null?void 0:l.name)&&{name:l.name})}})]}),jsxs(Se,{flexDirection:"column",container:true,gap:2,children:[jsx(P,{variant:"h6",children:i.newPaymentMethodCardTitle}),jsx(PaymentElement,{onChange:()=>{},onReady:()=>{},options:{readOnly:d,terms:{card:"never"},defaultValues:{billingDetails:S(S({},(l==null?void 0:l.name)&&{name:l.name}),(l==null?void 0:l.email)&&{email:l.email})}}})]}),p&&jsx(Nf,{})]})}function Of(){let[e,t]=useState(null),{checkoutState:o}=Y(),{billingIntegration:n,setupSecret:i}=o||{};return useEffect(()=>{if(n){let{billingIdentifier:r,credentials:a}=n;if(r!==BillingVendorIdentifier.Stripe)return;let{accountId:s,publicKey:l}=a;if(!s||!l){console.error("Stripe account ID or public key is missing");return}import('@stripe/stripe-js').then(({loadStripe:c})=>{t(c(l,{stripeAccount:s}));});}},[n]),{stripePromise:e,setupIntentClientSecret:i}}function Ta(e){var n;let t=D({optional:true}),o=t==null?void 0:t.stigg;return o?o.getBooleanEntitlement(e):S(S({},BOOLEAN_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function ka(e){var n;let t=D({optional:true}),o=t==null?void 0:t.stigg;return o?o.getNumericEntitlement(e):S(S({},NUMERIC_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function wa(e){var n;let t=D({optional:true}),o=t==null?void 0:t.stigg;return o?o.getMeteredEntitlement(e):S(S({},METERED_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function va(e){var n;let t=D({optional:true}),o=t==null?void 0:t.stigg;return o?o.getEnumEntitlement(e):S(S({},ENUM_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function Ut({func:e}){let[t,o]=useState(true),[n,i]=useState(null),[r,a]=useState(null),s=useRef(false);return useEffect(()=>{R(null,null,function*(){s.current||o(true);try{let c=yield e();a(c),i(null),c!==null&&(s.current=!0);}catch(c){i(c),s.current=true;}finally{s.current?o(false):o(true);}});},[e]),{isLoading:t,error:n,data:r}}function zf(e){let t=D({optional:true}),o=t==null?void 0:t.stigg,n=useCallback(()=>o?o.getActiveSubscriptions(e):Promise.resolve([]),[e,o]),{data:i,error:r,isLoading:a}=Ut({func:n});return useMemo(()=>({activeSubscriptions:i,isLoading:a,error:r}),[i,r,a])}function Vf(e){let t=D({optional:true}),o=t==null?void 0:t.stigg,n=useCallback(()=>o?o.getPaywall(e):Promise.resolve(null),[e,o]),{data:i,error:r,isLoading:a}=Ut({func:n});return useMemo(()=>({paywall:i,isLoading:a,error:r}),[i,r,a])}function $f(e){let t=D({optional:true}),o=t==null?void 0:t.stigg,n=useCallback(()=>o?o.getCustomerPortal(e):Promise.resolve(null),[e,o]),{data:i,error:r,isLoading:a}=Ut({func:n});return useMemo(()=>({customerPortal:i,isLoading:a,error:r}),[i,r,a])}function _a(){let e=_n(),[{resourceId:t}]=j(),{checkoutState:o}=Y(),{plan:n}=o||{},i=e.addons.map(({addon:r,quantity:a})=>({addonId:r.id,quantity:a}));if(n!=null&&n.id)return S({resourceId:t,planId:n.id,billingPeriod:e.billingPeriod,billableFeatures:e.billableFeatures,addons:i,promotionCode:e.promotionCode,billingCountryCode:e.billingCountryCode},ga({taxIds:e.taxId?[e.taxId]:void 0}))}var c3=[PaymentCollection.Failed,PaymentCollection.Processing];function d3(t){return R(this,arguments,function*({elements:e}){if(!e){let n="Stripe elements not initialized";return console.error(n),{success:false,errorMessage:n}}let{error:o}=yield e.submit();return o?(console.log(o.message),{success:false,errorMessage:o.message||""}):{success:true}})}function $c(o){return R(this,arguments,function*({applySubscriptionResults:e,stripe:t}){var a,s;let n=e==null?void 0:e.subscription,i=(a=n==null?void 0:n.latestInvoice)==null?void 0:a.paymentSecret,r=n==null?void 0:n.paymentCollection;if(t&&i&&r===PaymentCollection.ActionRequired){let{error:l}=yield t.handleNextAction({clientSecret:i});if(l)return {errorMessage:l.message||""}}else if(r&&c3.includes(r))return {errorMessage:((s=n==null?void 0:n.latestInvoice)==null?void 0:s.errorMessage)||"An error occurred - try again later"};return {subscription:n}})}function u3(n){return R(this,arguments,function*({stripe:e,elements:t,clientSecret:o}){let i,r,{error:a}=yield e.confirmSetup({elements:t,confirmParams:{return_url:window.location.href},redirect:"if_required"});if(a)a.type==="card_error"||a.type==="validation_error"?a.type==="card_error"&&(r=a.message||""):r="An unexpected error occurred.";else try{let{setupIntent:s}=yield e.retrieveSetupIntent(o);s!=null&&s.payment_method&&(i=s.payment_method);}catch(s){r="An unexpected error occurred.",console.error(s);}return {newPaymentMethodId:i,setupErrorMessage:r}})}function Hf(n){return R(this,arguments,function*({stripe:e,elements:t,setupIntentClientSecret:o}){if(!e||!t||!o)return {success:false};let i=yield d3({elements:t});if(!i.success)return {success:false,errorMessage:i.errorMessage};let{newPaymentMethodId:r,setupErrorMessage:a}=yield u3({stripe:e,elements:t,clientSecret:o});return a||!r?{success:false,errorMessage:a}:{success:true,paymentMethodId:r}})}var Wf={v:"5.12.1",fr:30,ip:0,op:201,w:700,h:700,nm:"Check",ddd:0,assets:[],layers:[{ddd:0,ind:1,ty:4,nm:"Shape Layer 8",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:315,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Shape Layer 7",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:270,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:3,ty:4,nm:"Shape Layer 6",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:225,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:4,ty:4,nm:"Shape Layer 5",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:180,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:5,ty:4,nm:"Shape Layer 4",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:135,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:6,ty:4,nm:"Shape Layer 3",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:90,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:7,ty:4,nm:"Shape Layer 2",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:45,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:8,ty:4,nm:"Shape Layer 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[-304,91,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-304,-241],[-304,-161]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:9,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:135,s:[100]},{t:145.5,s:[0]}],ix:1},e:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:130,s:[100]},{t:139.6005859375,s:[0]}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:130,op:204,st:-2,ct:1,bm:0},{ddd:0,ind:9,ty:4,nm:"Check v",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:-1.9,ix:10},p:{a:0,k:[352,360,0],ix:2,l:2},a:{a:0,k:[-120.265,116.765,0],ix:1,l:2},s:{a:0,k:[278,278,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0]],v:[[-161,123],[-137,148],[-79.531,85.531]],c:false},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:false},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:5.5,ix:5},lc:2,lj:2,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[0],y:[1]},o:{x:[.333],y:[0]},t:135,s:[0]},{t:148,s:[100]}],ix:1},e:{a:0,k:0,ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:135,op:201,st:-35,ct:1,bm:0},{ddd:0,ind:11,ty:4,nm:"Circle Stroke",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:7,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[4,-6,0],ix:1,l:2},s:{a:0,k:[132,132,100],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[306,306],ix:2},p:{a:0,k:[0,0],ix:3},nm:"Ellipse Path 1",mn:"ADBE Vector Shape - Ellipse",hd:false},{ty:"st",c:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:30,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:61,s:[1,1,1,1]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:87,s:[1,1,1,1]},{t:136,s:[1,1,1,1]}],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:8,ix:5},lc:2,lj:1,ml:4,bm:0,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:false},{ty:"tr",p:{a:0,k:[4,-6],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Ellipse 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:false},{ty:"tm",s:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[50]},{t:122,s:[100]}],ix:1},e:{a:1,k:[{i:{x:[.338],y:[1]},o:{x:[.333],y:[0]},t:87,s:[45]},{t:122,s:[0]}],ix:2},o:{a:1,k:[{i:{x:[.474],y:[1]},o:{x:[.43],y:[0]},t:0,s:[-170.4]},{t:111,s:[-1250.4]}],ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:false}],ip:0,op:201,st:0,ct:1,bm:0},{ddd:0,ind:13,ty:1,nm:"Dark Gray Solid 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[350,350,0],ix:2,l:2},a:{a:0,k:[350,350,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,sw:700,sh:700,sc:"#2d2d2d",ip:0,op:201,st:0,bm:0}],markers:[],props:{}};var Aa=5e3,y3=y(Na)`
716
716
  @keyframes blurFade {
717
717
  0% {
718
718
  background-color: ${({theme:e})=>Do(e.stigg.palette.backgroundPaper).alpha(0).toString()};
@@ -743,7 +743,7 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
743
743
  & path {
744
744
  stroke: ${({theme:e})=>e.stigg.palette.primary};
745
745
  }
746
- `,Kw=x(C)`
746
+ `,x3=y(P)`
747
747
  @keyframes fadeIn {
748
748
  0% {
749
749
  opacity: 0;
@@ -758,19 +758,19 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
758
758
 
759
759
  align-self: center;
760
760
  animation: fadeIn 5s ease-in forwards;
761
- `;function Bg({checkoutLocalization:e}){let t=useRef();return useEffect(()=>{t.current&&t.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});},[]),jsxs(Xw,{className:"stigg-checkout-success-container",ref:t,children:[jsx(Zw,{options:{animationData:Ig,loop:false,autoplay:true},width:350,height:"auto",style:{display:"flex",justifyContent:"center"}}),jsx(Kw,{variant:"h1",color:"primary.main",children:e.summary.checkoutSuccessText})]})}var t3=e=>new Promise(t=>setTimeout(t,e));function Eg({isMocked:e=false,onCheckout:t,onCheckoutCompleted:o,onSuccess:n,disableSuccessAnimation:i}){let{stigg:r}=D(),{useNewPaymentMethod:a}=vt(),s=ba(),{checkoutState:l,widgetState:c,setWidgetReadOnly:d}=Y(),{setupSecret:u,customer:p}=l||{},m=useStripe(),h=useElements();return {handleSubmit:g=>R(null,null,function*(){if(g.preventDefault(),!s)return {success:false,errorMessage:"Unexpected error, please contact support."};let y=true,P,T=false,k;if(d(true),!e&&a){let M=yield Mg({elements:h,stripe:m,setupIntentClientSecret:u});M.success?k=M.paymentMethodId:(P=M.errorMessage,y=false);}let w=_(S({},s),{paymentMethodId:k}),v=M=>R(null,null,function*(){T=true;try{let I=yield r.applySubscription(M),B=yield Bc({applySubscriptionResults:I,stripe:m});return {success:!B.errorMessage,errorMessage:B.errorMessage,results:I}}catch(I){return console.error(I),P=I==null?void 0:I.message,{success:false,errorMessage:P}}}),A;if(y)if(t){let M=yield t({customerId:p.id,checkoutParams:w,checkoutAction:v});if(M.errorMessage&&(P=M.errorMessage),!T&&M.results&&M.success){let I=yield Bc({applySubscriptionResults:M.results,stripe:m});I.errorMessage&&(P=I.errorMessage,y=false);}y=y&&M.success&&!P,A=M.results;}else {let M=yield v(w);!M.success&&M.errorMessage&&(P=M.errorMessage),y=M.success&&!P,A=M.results;}return d(false),y&&n&&(n(),i||(yield t3(Ca))),yield o({success:y,error:P}),{results:A,success:!P,errorMessage:P}}),isLoading:!!(c!=null&&c.readOnly)}}function Fg(){return !!window.Zuora}function Rg(){let e=document.createElement("script");e.type="text/javascript",e.src="https://js.zuora.com/payment/v3/zuora.js",e.async=true,e.onerror=()=>{throw new Error("Failed to load Zuora library")},document.head.appendChild(e);}function Dg(e,t,o,n){return {locale:n||"en",region:(n==null?void 0:n.toUpperCase())||"US",currency:o,amount:"1",createPaymentSession:e,onComplete:t}}function In(){let{stigg:e}=D(),{setErrorMessage:t}=vt(),{billingCountryCode:o}=te(),[n,i]=useState(false),{checkoutState:r}=Y(),{billingIntegration:a}=r||{},s=useCallback(()=>R(null,null,function*(){if(!(r!=null&&r.customer.id)||!(r!=null&&r.plan.id))throw new Error("Customer and plan are required");let{token:d}=yield e.createPaymentSession({planId:r.plan.id,billingCountryCode:o});return d}),[r,e,o]),l=useCallback(()=>{try{Fg()||Rg(),i(!0);}catch(d){t("Failed to initialize Zuora");}},[i,t]);return useEffect(()=>{if(a){let{billingIdentifier:d}=a;d===BillingVendorIdentifier.Zuora&&l();}},[a,l]),{isZuoraIntegration:(a==null?void 0:a.billingIdentifier)===BillingVendorIdentifier.Zuora,isInitialized:n,createPaymentSession:s}}var i3=e=>new Promise(t=>setTimeout(t,e));function Pa({onCheckout:e,onCheckoutCompleted:t,onSuccess:o,disableSuccessAnimation:n}){let{stigg:i}=D(),r=ba(),{checkoutState:a,setWidgetReadOnly:s,setCheckoutSuccess:l}=Y(),{setErrorMessage:c}=vt();return {handleZuoraSubmit:useCallback(u=>R(null,null,function*(){s(true);let p=true,m,h=r;if(!h)p=false,m="Unexpected error, please contact support.";else {let f=_(S({},h),{paymentMethodId:u}),g=y=>R(null,null,function*(){try{return {success:!0,results:yield i.applySubscription(y)}}catch(P){return console.error(P),{success:false,errorMessage:(P==null?void 0:P.message)||"Failed to apply subscription"}}});try{if(e){let y=yield e({customerId:a.customer.id,checkoutParams:f,checkoutAction:g});y.errorMessage&&(m=y.errorMessage),p=p&&y.success&&!m;}else {let y=yield g(f);!y.success&&y.errorMessage&&(m=y.errorMessage),p=y.success&&!m;}}catch(y){p=false,m=y.message||"Failed to process checkout";}}return p?(l(true),o&&(o(),n||(yield i3(Ca)))):c(m),s(false),yield t({success:p,error:m}),{success:p,errorMessage:m}}),[i,r,a,e,t,o,n,s,l,c])}}var ue=({isLoading:e,width:t=50,height:o=16,children:n})=>e?jsx(dt,{width:t,height:o}):jsx(Fragment,{children:n});var s3=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{var a,s,l,c;let{immediateInvoice:n}=e||{};if(!((s=(a=n==null?void 0:n.proration)==null?void 0:a.netAmount)!=null&&s.amount)||((c=(l=n==null?void 0:n.proration)==null?void 0:l.netAmount)==null?void 0:c.amount)>=0)return null;let i=n.proration.netAmount.amount*-1,r=at({amount:i,currency:n.proration.netAmount.currency,minimumFractionDigits:2});return jsx(C,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-remaining-credits",children:jsx(ue,{isLoading:t,width:"100%",children:o.summary.creditsForUnusedTimeText({credits:r})})})},l3=({subscriptionPreview:e,activeSubscription:t,isFetchingSubscriptionPreview:o,checkoutLocalization:n})=>{if(!(e!=null&&e.hasScheduledUpdates)||!(t!=null&&t.currentBillingPeriodEnd))return null;let{currentBillingPeriodEnd:i}=t,r=typeof n.summary.changesWillApplyAtEndOfBillingPeriod=="function"?n.summary.changesWillApplyAtEndOfBillingPeriod({billingPeriodEnd:i}):n.summary.changesWillApplyAtEndOfBillingPeriod;return jsx(C,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-scheduled-updates",children:jsx(ue,{isLoading:o,width:"100%",children:r})})},c3=({subscriptionPreview:e,activeSubscription:t,plan:o,isFetchingSubscriptionPreview:n,billingPeriod:i,checkoutLocalization:r})=>{let{promotionCode:a}=An();if(!e)return null;let s=r.nextBillingCaption({plan:o,subscriptionPreview:e,billingPeriod:i,activeSubscription:t,promotionCode:a});return jsx(C,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-next-billing",children:jsx(ue,{isLoading:n,width:"100%",children:s})})};function zg(e){return jsxs(Box,{className:"stigg-checkout-summary-captions",children:[jsx(s3,S({},e)),jsx(l3,S({},e)),e.plan&&jsx(c3,S({},e))]})}function Fc({quantity:e,totalAmount:t,pricingModel:o,billingPeriod:n,currency:i,blockSize:r,priceAmount:a,availableBillingPeriods:s}){let l=s==null?void 0:s.has(BillingPeriod.Monthly),c=o===BillingModel.PerUnit,d=r||1,u=n===BillingPeriod.Annually&&l,p=e&&(c||e>1)?`${gt(e)} ${d>1?"for":"x"} `:"",m=u?" x 12 months":"",h=(a||t/e)/(u?12:1),f=at({amount:h,currency:i,minimumFractionDigits:2}),g=at({amount:t,currency:i,minimumFractionDigits:2});return `${p}${f}${m} ${m||p?` = ${g}`:""}`}function Vg(e){let{totalAmount:t,quantity:o,tiersMode:n,tiers:i,currency:r}=e;if(rh(i)||n===TiersMode.Graduated&&!ah(i,o)){let a=at({amount:t,currency:r,minimumFractionDigits:2});return `${gt(o)} for ${a}`}return Fc(e)}function m3(e,t){let{unitPrice:o,upTo:n}=e[t];if(!o)return "";if(t===0)return `First ${n}`;let r=(e[t-1].upTo||0)+1;return vr(n)?`${gt(r)} and above`:`Next ${gt(r)} to ${gt(n)}`}function Hg({price:e,unitQuantity:t}){let o=e.tiers||[],{checkoutState:n}=Y(),i=n==null?void 0:n.plan,{breakdown:r}=Sl(o,t);return r.length===1?null:jsx(Fragment,{children:r.map(({unitQuantity:a,amount:s},l)=>jsx(ve,{children:jsxs(pe,{style:{alignItems:"flex-start"},children:[jsx(C,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:m3(o,l)}),jsx(C,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:Fc({quantity:a,totalAmount:s,currency:e.currency,pricingModel:e.pricingModel,billingPeriod:e.billingPeriod,tiers:e.tiers,tiersMode:e.tiersMode,blockSize:e.blockSize,priceAmount:e.amount,availableBillingPeriods:new Set(i==null?void 0:i.pricePoints.map(c=>c.billingPeriod))})})]})},l))})}var Wg=x(ChevronRight)`
761
+ `;function jf({checkoutLocalization:e}){let t=useRef();return useEffect(()=>{t.current&&t.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});},[]),jsxs(y3,{className:"stigg-checkout-success-container",ref:t,children:[jsx(f3,{options:{animationData:Wf,loop:false,autoplay:true},width:350,height:"auto",style:{display:"flex",justifyContent:"center"}}),jsx(x3,{variant:"h1",color:"primary.main",children:e.summary.checkoutSuccessText})]})}var S3=e=>new Promise(t=>setTimeout(t,e));function Yf({isMocked:e=false,onCheckout:t,onCheckoutCompleted:o,onSuccess:n,disableSuccessAnimation:i}){let{stigg:r}=D(),{useNewPaymentMethod:a}=vt(),s=_a(),{checkoutState:l,widgetState:c,setWidgetReadOnly:d}=Y(),{setupSecret:u,customer:p}=l||{},h=useStripe(),m=useElements();return {handleSubmit:f=>R(null,null,function*(){if(f.preventDefault(),!s)return {success:false,errorMessage:"Unexpected error, please contact support."};let x=true,b,T=false,k;if(d(true),!e&&a){let M=yield Hf({elements:m,stripe:h,setupIntentClientSecret:u});M.success?k=M.paymentMethodId:(b=M.errorMessage,x=false);}let w=A(S({},s),{paymentMethodId:k}),v=M=>R(null,null,function*(){T=true;try{let I=yield r.applySubscription(M),F=yield $c({applySubscriptionResults:I,stripe:h});return {success:!F.errorMessage,errorMessage:F.errorMessage,results:I}}catch(I){return console.error(I),b=I==null?void 0:I.message,{success:false,errorMessage:b}}}),_;if(x)if(t){let M=yield t({customerId:p.id,checkoutParams:w,checkoutAction:v});if(M.errorMessage&&(b=M.errorMessage),!T&&M.results&&M.success){let I=yield $c({applySubscriptionResults:M.results,stripe:h});I.errorMessage&&(b=I.errorMessage,x=false);}x=x&&M.success&&!b,_=M.results;}else {let M=yield v(w);!M.success&&M.errorMessage&&(b=M.errorMessage),x=M.success&&!b,_=M.results;}return d(false),x&&n&&(n(),i||(yield S3(Aa))),yield o({success:x,error:b}),{results:_,success:!b,errorMessage:b}}),isLoading:!!(c!=null&&c.readOnly)}}function Zf(){return !!window.Zuora}function Xf(){let e=document.createElement("script");e.type="text/javascript",e.src="https://js.zuora.com/payment/v3/zuora.js",e.async=true,e.onerror=()=>{throw new Error("Failed to load Zuora library")},document.head.appendChild(e);}function Kf(e,t,o,n){return {locale:n||"en",region:(n==null?void 0:n.toUpperCase())||"US",currency:o,amount:"1",createPaymentSession:e,onComplete:t}}function In(){let{stigg:e}=D(),{setErrorMessage:t}=vt(),{billingCountryCode:o}=te(),[n,i]=useState(false),{checkoutState:r}=Y(),{billingIntegration:a}=r||{},s=useCallback(()=>R(null,null,function*(){if(!(r!=null&&r.customer.id)||!(r!=null&&r.plan.id))throw new Error("Customer and plan are required");let{token:d}=yield e.createPaymentSession({planId:r.plan.id,billingCountryCode:o});return d}),[r,e,o]),l=useCallback(()=>{try{Zf()||Xf(),i(!0);}catch(d){t("Failed to initialize Zuora");}},[i,t]);return useEffect(()=>{if(a){let{billingIdentifier:d}=a;d===BillingVendorIdentifier.Zuora&&l();}},[a,l]),{isZuoraIntegration:(a==null?void 0:a.billingIdentifier)===BillingVendorIdentifier.Zuora,isInitialized:n,createPaymentSession:s}}var v3=e=>new Promise(t=>setTimeout(t,e));function Ma({onCheckout:e,onCheckoutCompleted:t,onSuccess:o,disableSuccessAnimation:n}){let{stigg:i}=D(),r=_a(),{checkoutState:a,setWidgetReadOnly:s,setCheckoutSuccess:l}=Y(),{setErrorMessage:c}=vt();return {handleZuoraSubmit:useCallback(u=>R(null,null,function*(){s(true);let p=true,h,m=r;if(!m)p=false,h="Unexpected error, please contact support.";else {let g=A(S({},m),{paymentMethodId:u}),f=x=>R(null,null,function*(){try{return {success:!0,results:yield i.applySubscription(x)}}catch(b){return console.error(b),{success:false,errorMessage:(b==null?void 0:b.message)||"Failed to apply subscription"}}});try{if(e){let x=yield e({customerId:a.customer.id,checkoutParams:g,checkoutAction:f});x.errorMessage&&(h=x.errorMessage),p=p&&x.success&&!h;}else {let x=yield f(g);!x.success&&x.errorMessage&&(h=x.errorMessage),p=x.success&&!h;}}catch(x){p=false,h=x.message||"Failed to process checkout";}}return p?(l(true),o&&(o(),n||(yield v3(Aa)))):c(h),s(false),yield t({success:p,error:h}),{success:p,errorMessage:h}}),[i,r,a,e,t,o,n,s,l,c])}}var pe=({isLoading:e,width:t=50,height:o=16,children:n})=>e?jsx(dt,{width:t,height:o}):jsx(Fragment,{children:n});var M3=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{var a,s,l,c;let{immediateInvoice:n}=e||{};if(!((s=(a=n==null?void 0:n.proration)==null?void 0:a.netAmount)!=null&&s.amount)||((c=(l=n==null?void 0:n.proration)==null?void 0:l.netAmount)==null?void 0:c.amount)>=0)return null;let i=n.proration.netAmount.amount*-1,r=at({amount:i,currency:n.proration.netAmount.currency,minimumFractionDigits:2});return jsx(P,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-remaining-credits",children:jsx(pe,{isLoading:t,width:"100%",children:o.summary.creditsForUnusedTimeText({credits:r})})})},I3=({subscriptionPreview:e,activeSubscription:t,isFetchingSubscriptionPreview:o,checkoutLocalization:n})=>{if(!(e!=null&&e.hasScheduledUpdates)||!(t!=null&&t.currentBillingPeriodEnd))return null;let{currentBillingPeriodEnd:i}=t,r=typeof n.summary.changesWillApplyAtEndOfBillingPeriod=="function"?n.summary.changesWillApplyAtEndOfBillingPeriod({billingPeriodEnd:i}):n.summary.changesWillApplyAtEndOfBillingPeriod;return jsx(P,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-scheduled-updates",children:jsx(pe,{isLoading:o,width:"100%",children:r})})},E3=({subscriptionPreview:e,activeSubscription:t,plan:o,isFetchingSubscriptionPreview:n,billingPeriod:i,checkoutLocalization:r})=>{let{promotionCode:a}=An();if(!e)return null;let s=r.nextBillingCaption({plan:o,subscriptionPreview:e,billingPeriod:i,activeSubscription:t,promotionCode:a});return jsx(P,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-next-billing",children:jsx(pe,{isLoading:n,width:"100%",children:s})})};function ty(e){return jsxs(Box,{className:"stigg-checkout-summary-captions",children:[jsx(M3,S({},e)),jsx(I3,S({},e)),e.plan&&jsx(E3,S({},e))]})}function Wc({quantity:e,totalAmount:t,pricingModel:o,billingPeriod:n,currency:i,blockSize:r,priceAmount:a,availableBillingPeriods:s}){let l=s==null?void 0:s.has(BillingPeriod.Monthly),c=o===BillingModel.PerUnit,d=r||1,u=n===BillingPeriod.Annually&&l,p=e&&(c||e>1)?`${ft(e)} ${d>1?"for":"x"} `:"",h=u?" x 12 months":"",m=(a||t/e)/(u?12:1),g=at({amount:m,currency:i,minimumFractionDigits:2}),f=at({amount:t,currency:i,minimumFractionDigits:2});return `${p}${g}${h} ${h||p?` = ${f}`:""}`}function oy(e){let{totalAmount:t,quantity:o,tiersMode:n,tiers:i,currency:r}=e;if(gm(i)||n===TiersMode.Graduated&&!fm(i,o)){let a=at({amount:t,currency:r,minimumFractionDigits:2});return `${ft(o)} for ${a}`}return Wc(e)}function D3(e,t){let{unitPrice:o,upTo:n}=e[t];if(!o)return "";if(t===0)return `First ${n}`;let r=(e[t-1].upTo||0)+1;return _r(n)?`${ft(r)} and above`:`Next ${ft(r)} to ${ft(n)}`}function ny({price:e,unitQuantity:t}){let o=e.tiers||[],{checkoutState:n}=Y(),i=n==null?void 0:n.plan,{breakdown:r}=Il(o,t);return r.length===1?null:jsx(Fragment,{children:r.map(({unitQuantity:a,amount:s},l)=>jsx(ve,{children:jsxs(me,{style:{alignItems:"flex-start"},children:[jsx(P,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:D3(o,l)}),jsx(P,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:Wc({quantity:a,totalAmount:s,currency:e.currency,pricingModel:e.pricingModel,billingPeriod:e.billingPeriod,tiers:e.tiers,tiersMode:e.tiersMode,blockSize:e.blockSize,priceAmount:e.amount,availableBillingPeriods:new Set(i==null?void 0:i.pricePoints.map(c=>c.billingPeriod))})})]})},l))})}var iy=y(ChevronRight)`
762
762
  height: ${({$size:e=24})=>`${e}px`};
763
763
  width: ${({$size:e=24})=>`${e}px`};
764
764
  transition: all 0.2s ease-in;
765
765
  ${({$isOpen:e})=>e&&"transform: rotate(90deg)"}
766
- `;var ve=x.div`
766
+ `;var ve=y.div`
767
767
  & + & {
768
768
  margin-top: 16px;
769
769
  }
770
- `,v3=x.div`
770
+ `,Z3=y.div`
771
771
  margin-top: 16px;
772
772
  margin-left: 16px;
773
- `,pe=x.div`
773
+ `,me=y.div`
774
774
  display: flex;
775
775
  flex-direction: column;
776
776
  gap: 16px;
@@ -780,28 +780,28 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
780
780
  align-items: center;
781
781
  justify-content: space-between;
782
782
  }
783
- `,_3=({checkoutLocalization:e})=>{let t=jsx(C,{variant:"body1",children:e.summary.payAsYouGoTooltipText});return jsx(Fe,{placement:"left",title:t,children:jsx(pt,{icon:"PayAsYouGoCharge",style:{display:"flex"}})})},ka=({checkoutLocalization:e,label:t,quantity:o,price:n})=>{let{checkoutState:i}=Y(),r=i==null?void 0:i.plan,a=Dt("lg"),[s,l]=useState(false),c=()=>l(f=>!f),d=n.pricingModel===BillingModel.UsageBased,u=n.isTieredPrice?Cn(n,o):(n.amount||0)*Math.ceil(o/(n.blockSize||1)),p;n.tiersMode===TiersMode.Graduated&&!!n.tiers&&!SS(n.tiers)&&!vr(n.tiers[0].upTo)&&o>n.tiers[0].upTo&&(p=jsx(Hg,{price:n,unitQuantity:o}));let h=jsx(C,{variant:"body1",color:"secondary",children:t});return p&&(h=jsx(fT,{onClick:c,underline:"none",style:{cursor:"pointer"},children:h})),jsxs(ve,{className:"stigg-checkout-summary-base-charges-container",children:[jsxs(pe,{style:{alignItems:"flex-start"},children:[jsxs(Pe,{item:true,display:"flex",gap:.5,style:{whiteSpace:a?"nowrap":"break-spaces"},children:[h,p&&jsx(IconButton,{onClick:c,sx:{padding:0},children:jsx(Wg,{$isOpen:s,$size:16})})]}),jsxs(Pe,{item:true,display:"flex",gap:1,alignItems:"center",children:[d&&jsx(_3,{checkoutLocalization:e}),jsxs(C,{variant:"body1",color:"secondary",style:{whiteSpace:a?"nowrap":"break-spaces"},children:[Vg({totalAmount:u,quantity:o,currency:n.currency,pricingModel:n.pricingModel,billingPeriod:n.billingPeriod,tiers:n.tiers,tiersMode:n.tiersMode,blockSize:n.blockSize,priceAmount:n.amount,availableBillingPeriods:new Set(r==null?void 0:r.pricePoints.map(f=>f.billingPeriod))}),d&&" / unit"]})]})]}),p&&jsx(w3,{in:s,children:jsx(v3,{children:p})})]})},Gg=({label:e})=>jsx(ve,{children:jsxs(pe,{style:{alignItems:"flex-end"},children:[jsx(Pe,{item:true,children:jsx(C,{variant:"body1",color:"secondary",children:e})}),jsx(Pe,{item:true,display:"flex",gap:1,alignItems:"center",children:jsx(C,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"},children:"Free"})})]})}),jg=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:n,recurringInvoice:i}=e,{discount:r,discountDetails:a}=i||{};return !r||!a?null:jsx(ve,{children:jsxs(pe,{children:[jsx(C,{variant:"body1",color:"secondary",children:o.summary.discountText({discountDetails:a,currency:n.total.currency})}),jsx(C,{variant:"body1",color:"secondary",children:t?jsx(dt,{width:50,height:16}):at({amount:r.amount,currency:r.currency,minimumFractionDigits:2})})]})})},Yg=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:n}=e||{},{credits:i}=n||{};return !i||!i.used||i.used.amount<=0?null:jsx(ve,{children:jsxs(pe,{children:[jsx(C,{variant:"body1",color:"secondary",children:o.summary.appliedCreditsTitle}),jsx(C,{variant:"body1",color:"secondary",children:jsx(ue,{isLoading:t,children:at({amount:-1*i.used.amount,currency:i.used.currency,minimumFractionDigits:2})})})]})})},Zg=({tax:e,taxDetails:t,isFetchingSubscriptionPreview:o,checkoutLocalization:n})=>!t||!e||(e==null?void 0:e.amount)<=0?null:jsx(ve,{children:jsxs(pe,{children:[jsx(C,{variant:"body1",color:"secondary",children:n.summary.taxTitle({taxDetails:t})}),jsx(C,{variant:"body1",color:"secondary",children:jsx(ue,{isLoading:o,children:at({amount:e==null?void 0:e.amount,currency:e==null?void 0:e.currency,minimumFractionDigits:2})})})]})});var Nc=x(Ma)`
783
+ `,X3=({checkoutLocalization:e})=>{let t=jsx(P,{variant:"body1",children:e.summary.payAsYouGoTooltipText});return jsx(Be,{placement:"left",title:t,children:jsx(mt,{icon:"PayAsYouGoCharge",style:{display:"flex"}})})},Fa=({checkoutLocalization:e,label:t,quantity:o,price:n})=>{let{checkoutState:i}=Y(),r=i==null?void 0:i.plan,a=Dt("lg"),[s,l]=useState(false),c=()=>l(g=>!g),d=n.pricingModel===BillingModel.UsageBased,u=n.isTieredPrice?Cn(n,o):(n.amount||0)*Math.ceil(o/(n.blockSize||1)),p;n.tiersMode===TiersMode.Graduated&&!!n.tiers&&!DS(n.tiers)&&!_r(n.tiers[0].upTo)&&o>n.tiers[0].upTo&&(p=jsx(ny,{price:n,unitQuantity:o}));let m=jsx(P,{variant:"body1",color:"secondary",children:t});return p&&(m=jsx(MT,{onClick:c,underline:"none",style:{cursor:"pointer"},children:m})),jsxs(ve,{className:"stigg-checkout-summary-base-charges-container",children:[jsxs(me,{style:{alignItems:"flex-start"},children:[jsxs(Se,{item:true,display:"flex",gap:.5,style:{whiteSpace:a?"nowrap":"break-spaces"},children:[m,p&&jsx(IconButton,{onClick:c,sx:{padding:0},children:jsx(iy,{$isOpen:s,$size:16})})]}),jsxs(Se,{item:true,display:"flex",gap:1,alignItems:"center",children:[d&&jsx(X3,{checkoutLocalization:e}),jsxs(P,{variant:"body1",color:"secondary",style:{whiteSpace:a?"nowrap":"break-spaces"},children:[oy({totalAmount:u,quantity:o,currency:n.currency,pricingModel:n.pricingModel,billingPeriod:n.billingPeriod,tiers:n.tiers,tiersMode:n.tiersMode,blockSize:n.blockSize,priceAmount:n.amount,availableBillingPeriods:new Set(r==null?void 0:r.pricePoints.map(g=>g.billingPeriod))}),d&&" / unit"]})]})]}),p&&jsx(Y3,{in:s,children:jsx(Z3,{children:p})})]})},ry=({label:e})=>jsx(ve,{children:jsxs(me,{style:{alignItems:"flex-end"},children:[jsx(Se,{item:true,children:jsx(P,{variant:"body1",color:"secondary",children:e})}),jsx(Se,{item:true,display:"flex",gap:1,alignItems:"center",children:jsx(P,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"},children:"Free"})})]})}),ay=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:n,recurringInvoice:i}=e,{discount:r,discountDetails:a}=i||{};return !r||!a?null:jsx(ve,{children:jsxs(me,{children:[jsx(P,{variant:"body1",color:"secondary",children:o.summary.discountText({discountDetails:a,currency:n.total.currency})}),jsx(P,{variant:"body1",color:"secondary",children:t?jsx(dt,{width:50,height:16}):at({amount:r.amount,currency:r.currency,minimumFractionDigits:2})})]})})},sy=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:n}=e||{},{credits:i}=n||{};return !i||!i.used||i.used.amount<=0?null:jsx(ve,{children:jsxs(me,{children:[jsx(P,{variant:"body1",color:"secondary",children:o.summary.appliedCreditsTitle}),jsx(P,{variant:"body1",color:"secondary",children:jsx(pe,{isLoading:t,children:at({amount:-1*i.used.amount,currency:i.used.currency,minimumFractionDigits:2})})})]})})},ly=({tax:e,taxDetails:t,isFetchingSubscriptionPreview:o,checkoutLocalization:n})=>!t||!e||(e==null?void 0:e.amount)<=0?null:jsx(ve,{children:jsxs(me,{children:[jsx(P,{variant:"body1",color:"secondary",children:n.summary.taxTitle({taxDetails:t})}),jsx(P,{variant:"body1",color:"secondary",children:jsx(pe,{isLoading:o,children:at({amount:e==null?void 0:e.amount,currency:e==null?void 0:e.currency,minimumFractionDigits:2})})})]})});var Yc=y(Na)`
784
784
  width: 100%;
785
785
  max-width: 470px;
786
786
  flex: 1.5;
787
- `,wa=x(E3)`
787
+ `,La=y(e5)`
788
788
  background: ${({theme:e})=>e.stigg.palette.backgroundHighlight};
789
789
  padding: 16px;
790
790
 
791
791
  ${wt.md} {
792
792
  border-radius: 10px;
793
793
  }
794
- `;wa.defaultProps={elevation:0};var R3=x(C)`
794
+ `;La.defaultProps={elevation:0};var n5=y(P)`
795
795
  margin-bottom: 16px;
796
796
  font-weight: 500;
797
- `,Ln=x(sf)`
797
+ `,En=y(gg)`
798
798
  margin: 16px 0;
799
- `,Kg=x(C)`
799
+ `,dy=y(P)`
800
800
  margin-bottom: 8px;
801
- `;function D3({isLastStep:e,checkoutHasChanges:t,isFreeDowngrade:o,checkoutLocalization:n,isPlanUpdate:i}){return e?t?i?n.checkoutButton.updateText:o?n.checkoutButton.downgradeToFreeText:n.checkoutButton.upgradeText:n.checkoutButton.noChangesText:n.checkoutButton.nextText}var qg=({onCheckout:e,onCheckoutCompleted:t,disablePromotionCode:o,disableSuccessAnimation:n,isFreeDowngrade:i,onMockCheckoutPreview:r,showWatermark:a})=>{var ju,Yu,Zu,Xu;let[s,l]=useState(false),{setErrorMessage:c,useNewPaymentMethod:d}=vt(),u=ke(),p=_n(),{checkoutState:m,checkoutLocalization:h,checkoutSuccess:f,widgetState:g}=Y(),{plan:y,activeSubscription:P}=m||{},T=ca(((ju=y==null?void 0:y.pricePoints)==null?void 0:ju.filter(q=>q.billingPeriod===p.billingPeriod))||[]),[k,w]=M3(T,q=>q.pricingModel===BillingModel.FlatFee),v=k[0],A=i||u.isCheckoutComplete&&u.isLastStep,{isZuoraIntegration:M}=In(),I=s||f,{subscriptionPreview:B,isFetchingSubscriptionPreview:L,errorMessage:E}=Xf({onMockCheckoutPreview:r}),{handleSubmit:O,isLoading:N}=Eg({isMocked:!!r,disableSuccessAnimation:n,onCheckout:e,onCheckoutCompleted:t,onSuccess:()=>{l(true),u.markStepAsCompleted(u.progressBarState.activeStep);}}),{handleZuoraSubmit:F}=Pa({onCheckout:e,onCheckoutCompleted:t,disableSuccessAnimation:n,onSuccess:()=>{u.markStepAsCompleted(u.progressBarState.activeStep);}}),$=q=>R(null,null,function*(){if(I)return;let ce;M&&!d?ce=yield F():ce=yield O(q);let{errorMessage:Gt}=ce||{};Gt?(c(Gt),l(false)):c(void 0);}),J=M&&!d?g.readOnly:N,Ft=q=>R(null,null,function*(){J||(A?yield $(q):u.goNext());}),{immediateInvoice:tt,recurringInvoice:bt}=B||{},Lo=!!B&&(!!(tt!=null&&tt.proration)||!!B.hasScheduledUpdates),Be=!o&&!i&&!M,Je=!!(bt!=null&&bt.discountDetails)&&!i,Bo=Be||Je,fn=w.some(q=>q.pricingModel===BillingModel.UsageBased),Eo=fn&&!v&&w.every(q=>q.pricingModel===BillingModel.UsageBased),Hu=typeof h.summary.baseChargeText=="function"?h.summary.baseChargeText({billingPeriod:p.billingPeriod}):h.summary.baseChargeText,Wu=useMemo(()=>{var q,ce;return (ce=(q=p.addons)==null?void 0:q.filter(Gt=>!Vo(Gt.addon)))!=null?ce:[]},[p.addons]),Gu=useMemo(()=>Wu.filter(q=>{var Gt;return !!((Gt=q.addon.pricePoints)==null?void 0:Gt.find(gn=>gn.billingPeriod===p.billingPeriod))}).map(q=>{let ce=q.addon.pricePoints.find(gn=>gn.billingPeriod===p.billingPeriod),Gt=q.quantity&&q.quantity>0?q.quantity:1;return jsx(ka,{checkoutLocalization:h,label:q.addon.displayName,quantity:Gt,price:ce},q.addon.id)}),[Wu,p.billingPeriod,h]);return jsxs(Nc,{className:"stigg-checkout-summary-container",children:[jsxs(wa,{children:[jsx(R3,{variant:"h3",children:h.summary.title}),jsxs(Pe,{className:"stigg-checkout-summary-plan-title-container",display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsx(C,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:h.summary.planName({plan:y})}),jsx(Ln,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),v&&jsx(ka,{checkoutLocalization:h,label:Hu,quantity:1,price:v}),!v&&i?jsx(Gg,{label:Hu}):null,jsx(Pe,{item:true,className:"stigg-checkout-summary-usage-charges-container",children:w.map((q,ce)=>{var gn,Ku,qu,Qu,Ju;let Gt=(gn=p.billableFeatures)==null?void 0:gn.find(qb=>{var tp;return qb.featureId===((tp=q.feature)==null?void 0:tp.featureId)});return jsx(ka,{checkoutLocalization:h,label:vi(((qu=q.feature)==null?void 0:qu.displayName)||"",(Qu=q.feature)==null?void 0:Qu.units,(Ju=q.feature)==null?void 0:Ju.unitsPlural),quantity:(Gt==null?void 0:Gt.quantity)||1,price:q},((Ku=q.feature)==null?void 0:Ku.featureId)||`usage-charge-${ce}`)})}),Gu.length>0&&jsxs(Fragment,{children:[jsxs(Pe,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsx(C,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:h.summary.addonsSectionTitle}),jsx(Ln,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),Gu]}),!Bo&&jsx(Ln,{className:"stigg-checkout-summary-divider"}),Bo&&jsxs(Pe,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsx(C,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:h.summary.discountsSectionTitle}),jsx(Ln,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),Be&&jsx(bg,{disabled:J||L,checkoutLocalization:h,onMockCheckoutPreview:r}),Je&&B&&jsx(jg,{subscriptionPreview:B,isFetchingSubscriptionPreview:L,checkoutLocalization:h}),Bo&&jsx(Ln,{className:"stigg-checkout-summary-divider"}),jsx(Zg,{tax:bt==null?void 0:bt.tax,taxDetails:bt==null?void 0:bt.taxDetails,isFetchingSubscriptionPreview:L,checkoutLocalization:h}),i?null:jsxs(Fragment,{children:[jsx(pe,{style:{marginTop:16},children:jsxs(Pe,{display:"flex",flexDirection:"column",container:true,children:[jsxs(Pe,{item:true,display:"flex",justifyContent:"space-between",children:[jsx(C,{variant:"h6",children:h.summary.totalText}),jsx(C,{variant:"h6",children:jsxs(ue,{isLoading:L,children:[Eo?h.summary.onlyPayAsYouGoText:null,!Eo&&fn?h.summary.startsAtText:null,Eo?null:at(_(S({amount:0},bt==null?void 0:bt.total),{minimumFractionDigits:2}))]})})]}),jsx(Pe,{item:true,children:jsx(C,{variant:"body1",color:"secondary",children:h.summary.totalBillingPeriodText({billingPeriod:p.billingPeriod})})})]})}),jsx(Ln,{className:"stigg-checkout-summary-divider"})]}),(Yu=tt==null?void 0:tt.proration)!=null&&Yu.hasProrations&&(tt!=null&&tt.subTotal)&&(tt==null?void 0:tt.subTotal.amount)>0?jsx(ve,{children:jsxs(pe,{children:[jsx(C,{variant:"body1",color:"secondary",children:h.summary.proratedTotalDueText}),jsx(C,{variant:"body1",color:"secondary",children:jsx(ue,{isLoading:L,children:at({amount:Number(((Zu=tt==null?void 0:tt.subTotal)==null?void 0:Zu.amount)||0)+Number(((Xu=tt==null?void 0:tt.tax)==null?void 0:Xu.amount)||0),currency:tt==null?void 0:tt.subTotal.currency,minimumFractionDigits:2})})})]})}):null,jsx(Yg,{subscriptionPreview:B,isFetchingSubscriptionPreview:L,checkoutLocalization:h}),jsx(ve,{children:jsxs(pe,{children:[jsx(Kg,{variant:"h6",children:h.summary.totalDueText}),jsx(Kg,{variant:"h6",children:jsx(ue,{isLoading:L,children:at(_(S({amount:0},tt==null?void 0:tt.total),{minimumFractionDigits:2}))})})]})}),jsx(zg,{plan:y,activeSubscription:P,subscriptionPreview:B,isFetchingSubscriptionPreview:L,checkoutLocalization:h,billingPeriod:p.billingPeriod}),(!A||!M||M&&!d)&&jsxs(Fragment,{children:[jsx(kt,{$success:I,$error:A&&i,disabled:J||L||u.progressBarState.isDisabled||A&&!Lo||!!E,className:"stigg-checkout-summary-cta-button",sx:{textTransform:"none",borderRadius:"10px",marginTop:"24px",height:"36px"},variant:"contained",size:"medium",onClick:q=>{Ft(q);},fullWidth:true,children:jsx(C,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"},children:I?jsx(pt,{icon:"Check",style:{display:"contents"}}):J||L?jsx(aw,{size:20,sx:{color:"white"}}):D3({isLastStep:A,checkoutHasChanges:Lo,isFreeDowngrade:i,checkoutLocalization:h,isPlanUpdate:!!P&&(P==null?void 0:P.plan.id)===(y==null?void 0:y.id)})})}),E&&jsx(F3,{severity:"error",sx:{alignItems:"center",marginTop:"12px"},children:jsx(C,{overrideColor:"inherit",children:E})})]})]}),jsx(Jt,{source:"checkout",showWatermark:a,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!n&&I&&jsx(Bg,{checkoutLocalization:h})]})};var Qg=({showWatermark:e})=>jsxs(Nc,{children:[jsxs(wa,{children:[jsxs(Uo,{$flexDirection:"column",$gap:24,children:[jsx(dt,{width:120,height:20}),jsx(dt,{width:120,height:20}),jsx(dt,{width:120,height:20}),jsx(dt,{width:120,height:20})]}),jsxs(Uo,{$flexDirection:"column",$gap:24,marginTop:5,children:[jsx(dt,{height:20}),jsx(dt,{height:20}),jsx(dt,{height:20})]}),jsx(yi,{flex:1,marginTop:5,children:jsx(dt,{height:34})})]}),jsx(Jt,{source:"checkout",showWatermark:e,style:{marginTop:8,display:"flex",justifyContent:"center"}})]});var ty=x(Pe)`
801
+ `;function i5({isLastStep:e,checkoutHasChanges:t,isFreeDowngrade:o,checkoutLocalization:n,isPlanUpdate:i}){return e?t?i?n.checkoutButton.updateText:o?n.checkoutButton.downgradeToFreeText:n.checkoutButton.upgradeText:n.checkoutButton.noChangesText:n.checkoutButton.nextText}var uy=({onCheckout:e,onCheckoutCompleted:t,disablePromotionCode:o,disableSuccessAnimation:n,isFreeDowngrade:i,onMockCheckoutPreview:r,showWatermark:a})=>{var op,np,ip,rp;let[s,l]=useState(false),{setErrorMessage:c,useNewPaymentMethod:d}=vt(),u=ke(),p=_n(),{checkoutState:h,checkoutLocalization:m,checkoutSuccess:g,widgetState:f}=Y(),{plan:x,activeSubscription:b}=h||{},T=ya(((op=x==null?void 0:x.pricePoints)==null?void 0:op.filter(q=>q.billingPeriod===p.billingPeriod))||[]),[k,w]=q3(T,q=>q.pricingModel===BillingModel.FlatFee),v=k[0],_=i||u.isCheckoutComplete&&u.isLastStep,{isZuoraIntegration:M}=In(),I=s||g,{subscriptionPreview:F,isFetchingSubscriptionPreview:E,errorMessage:B}=cf({onMockCheckoutPreview:r}),{handleSubmit:O,isLoading:U}=Yf({isMocked:!!r,disableSuccessAnimation:n,onCheckout:e,onCheckoutCompleted:t,onSuccess:()=>{l(true),u.markStepAsCompleted(u.progressBarState.activeStep);}}),{handleZuoraSubmit:L}=Ma({onCheckout:e,onCheckoutCompleted:t,disableSuccessAnimation:n,onSuccess:()=>{u.markStepAsCompleted(u.progressBarState.activeStep);}}),V=q=>R(null,null,function*(){if(I)return;let ce;M&&!d?ce=yield L():ce=yield O(q);let{errorMessage:Gt}=ce||{};Gt?(c(Gt),l(false)):c(void 0);}),J=M&&!d?f.readOnly:U,Bt=q=>R(null,null,function*(){J||(_?yield V(q):u.goNext());}),{immediateInvoice:tt,recurringInvoice:bt}=F||{},Eo=!!F&&(!!(tt!=null&&tt.proration)||!!F.hasScheduledUpdates),Fe=!o&&!i&&!M,Je=!!(bt!=null&&bt.discountDetails)&&!i,Fo=Fe||Je,gn=w.some(q=>q.pricingModel===BillingModel.UsageBased),Lo=gn&&!v&&w.every(q=>q.pricingModel===BillingModel.UsageBased),Ju=typeof m.summary.baseChargeText=="function"?m.summary.baseChargeText({billingPeriod:p.billingPeriod}):m.summary.baseChargeText,tp=useMemo(()=>{var q,ce;return (ce=(q=p.addons)==null?void 0:q.filter(Gt=>!$o(Gt.addon)))!=null?ce:[]},[p.addons]),ep=useMemo(()=>tp.filter(q=>{var Gt;return !!((Gt=q.addon.pricePoints)==null?void 0:Gt.find(fn=>fn.billingPeriod===p.billingPeriod))}).map(q=>{let ce=q.addon.pricePoints.find(fn=>fn.billingPeriod===p.billingPeriod),Gt=q.quantity&&q.quantity>0?q.quantity:1;return jsx(Fa,{checkoutLocalization:m,label:q.addon.displayName,quantity:Gt,price:ce},q.addon.id)}),[tp,p.billingPeriod,m]);return jsxs(Yc,{className:"stigg-checkout-summary-container",children:[jsxs(La,{children:[jsx(n5,{variant:"h3",children:m.summary.title}),jsxs(Se,{className:"stigg-checkout-summary-plan-title-container",display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsx(P,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:m.summary.planName({plan:x})}),jsx(En,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),v&&jsx(Fa,{checkoutLocalization:m,label:Ju,quantity:1,price:v}),!v&&i?jsx(ry,{label:Ju}):null,jsx(Se,{item:true,className:"stigg-checkout-summary-usage-charges-container",children:w.map((q,ce)=>{var fn,ap,sp,lp,cp;let Gt=(fn=p.billableFeatures)==null?void 0:fn.find(uC=>{var dp;return uC.featureId===((dp=q.feature)==null?void 0:dp.featureId)});return jsx(Fa,{checkoutLocalization:m,label:vi(((sp=q.feature)==null?void 0:sp.displayName)||"",(lp=q.feature)==null?void 0:lp.units,(cp=q.feature)==null?void 0:cp.unitsPlural),quantity:(Gt==null?void 0:Gt.quantity)||1,price:q},((ap=q.feature)==null?void 0:ap.featureId)||`usage-charge-${ce}`)})}),ep.length>0&&jsxs(Fragment,{children:[jsxs(Se,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsx(P,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:m.summary.addonsSectionTitle}),jsx(En,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),ep]}),!Fo&&jsx(En,{className:"stigg-checkout-summary-divider"}),Fo&&jsxs(Se,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsx(P,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:m.summary.discountsSectionTitle}),jsx(En,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),Fe&&jsx(Lf,{disabled:J||E,checkoutLocalization:m,onMockCheckoutPreview:r}),Je&&F&&jsx(ay,{subscriptionPreview:F,isFetchingSubscriptionPreview:E,checkoutLocalization:m}),Fo&&jsx(En,{className:"stigg-checkout-summary-divider"}),jsx(ly,{tax:bt==null?void 0:bt.tax,taxDetails:bt==null?void 0:bt.taxDetails,isFetchingSubscriptionPreview:E,checkoutLocalization:m}),i?null:jsxs(Fragment,{children:[jsx(me,{style:{marginTop:16},children:jsxs(Se,{display:"flex",flexDirection:"column",container:true,children:[jsxs(Se,{item:true,display:"flex",justifyContent:"space-between",children:[jsx(P,{variant:"h6",children:m.summary.totalText}),jsx(P,{variant:"h6",children:jsxs(pe,{isLoading:E,children:[Lo?m.summary.onlyPayAsYouGoText:null,!Lo&&gn?m.summary.startsAtText:null,Lo?null:at(A(S({amount:0},bt==null?void 0:bt.total),{minimumFractionDigits:2}))]})})]}),jsx(Se,{item:true,children:jsx(P,{variant:"body1",color:"secondary",children:m.summary.totalBillingPeriodText({billingPeriod:p.billingPeriod})})})]})}),jsx(En,{className:"stigg-checkout-summary-divider"})]}),(np=tt==null?void 0:tt.proration)!=null&&np.hasProrations&&(tt!=null&&tt.subTotal)&&(tt==null?void 0:tt.subTotal.amount)>0?jsx(ve,{children:jsxs(me,{children:[jsx(P,{variant:"body1",color:"secondary",children:m.summary.proratedTotalDueText}),jsx(P,{variant:"body1",color:"secondary",children:jsx(pe,{isLoading:E,children:at({amount:Number(((ip=tt==null?void 0:tt.subTotal)==null?void 0:ip.amount)||0)+Number(((rp=tt==null?void 0:tt.tax)==null?void 0:rp.amount)||0),currency:tt==null?void 0:tt.subTotal.currency,minimumFractionDigits:2})})})]})}):null,jsx(sy,{subscriptionPreview:F,isFetchingSubscriptionPreview:E,checkoutLocalization:m}),jsx(ve,{children:jsxs(me,{children:[jsx(dy,{variant:"h6",children:m.summary.totalDueText}),jsx(dy,{variant:"h6",children:jsx(pe,{isLoading:E,children:at(A(S({amount:0},tt==null?void 0:tt.total),{minimumFractionDigits:2}))})})]})}),jsx(ty,{plan:x,activeSubscription:b,subscriptionPreview:F,isFetchingSubscriptionPreview:E,checkoutLocalization:m,billingPeriod:p.billingPeriod}),(!_||!M||M&&!d)&&jsxs(Fragment,{children:[jsx(kt,{$success:I,$error:_&&i,disabled:J||E||u.progressBarState.isDisabled||_&&!Eo||!!B,className:"stigg-checkout-summary-cta-button",sx:{textTransform:"none",borderRadius:"10px",marginTop:"24px",height:"36px"},variant:"contained",size:"medium",onClick:q=>{Bt(q);},fullWidth:true,children:jsx(P,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"},children:I?jsx(mt,{icon:"Check",style:{display:"contents"}}):J||E?jsx(Aw,{size:20,sx:{color:"white"}}):i5({isLastStep:_,checkoutHasChanges:Eo,isFreeDowngrade:i,checkoutLocalization:m,isPlanUpdate:!!b&&(b==null?void 0:b.plan.id)===(x==null?void 0:x.id)})})}),B&&jsx(o5,{severity:"error",sx:{alignItems:"center",marginTop:"12px"},children:jsx(P,{overrideColor:"inherit",children:B})})]})]}),jsx(Jt,{source:"checkout",showWatermark:a,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!n&&I&&jsx(jf,{checkoutLocalization:m})]})};var py=({showWatermark:e})=>jsxs(Yc,{children:[jsxs(La,{children:[jsxs(Oo,{$flexDirection:"column",$gap:24,children:[jsx(dt,{width:120,height:20}),jsx(dt,{width:120,height:20}),jsx(dt,{width:120,height:20}),jsx(dt,{width:120,height:20})]}),jsxs(Oo,{$flexDirection:"column",$gap:24,marginTop:5,children:[jsx(dt,{height:20}),jsx(dt,{height:20}),jsx(dt,{height:20})]}),jsx(yi,{flex:1,marginTop:5,children:jsx(dt,{height:34})})]}),jsx(Jt,{source:"checkout",showWatermark:e,style:{marginTop:8,display:"flex",justifyContent:"center"}})]});var hy=y(Se)`
802
802
  width: 100%;
803
803
  gap: 8px;
804
- `,ey=x(Pe)`
804
+ `,gy=y(Se)`
805
805
  display: flex;
806
806
  flex-direction: column;
807
807
  gap: 16px;
@@ -816,51 +816,51 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
816
816
  padding-top: 16px;
817
817
  padding-bottom: 16px;
818
818
  }
819
- `,oy=x(kt)`
819
+ `,fy=y(kt)`
820
820
  min-width: unset;
821
821
  width: 41px;
822
822
  height: 41px;
823
823
  padding: 0;
824
- `;var O3=styled(Grid)`
824
+ `;var a5=styled(Grid)`
825
825
  display: flex;
826
826
  flex-direction: row;
827
827
  align-items: center;
828
828
  width: 100%;
829
829
  justify-content: flex-end;
830
- `;function ry({addon:e,addonState:t,hasChanges:o,errorMessage:n,isPriceForBillingPeriodAvailable:i,checkoutLocalization:r,handleQuantityChange:a,handleUndo:s,handleRemoveAddon:l}){var p;let c=Dt("lg"),d=!!t,u=e.maxQuantity!==1;return jsxs(O3,{item:true,sx:{gap:"16px"},container:!c,children:[o&&jsx(kt,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:s,children:jsx(C,{color:"primary.main",variant:"body1",children:"Undo"})}),d&&jsxs(Grid,{sx:{display:"flex",width:"100%",justifyContent:"flex-end"},children:[u&&jsx(Rt,{id:`${e.id}-input`,type:"number",onWheel:Pn,sx:c?{marginX:2,width:"100%"}:{flex:1},value:(p=t==null?void 0:t.quantity)!=null?p:"",error:!!n,helperText:n,FormHelperTextProps:{sx:{margin:"4px"}},onChange:m=>{var h,f;return a((h=m==null?void 0:m.target)!=null&&h.value?Number((f=m==null?void 0:m.target)==null?void 0:f.value):null)},onFocus:m=>m.target.select()}),jsx(oy,{color:"error",onClick:l,children:jsx(pt,{icon:"Trash",style:{display:"flex",padding:"8px"}})})]}),!d&&jsx(kt,{sx:{paddingX:"22px",paddingY:"8px"},onClick:()=>a(1),disabled:!i,children:jsx(C,{color:i?"primary.main":"disabled",variant:"body1",children:r.addAddonText})})]})}var $3=x(Grid)`
830
+ `;function by({addon:e,addonState:t,hasChanges:o,errorMessage:n,isPriceForBillingPeriodAvailable:i,checkoutLocalization:r,handleQuantityChange:a,handleUndo:s,handleRemoveAddon:l}){var p;let c=Dt("lg"),d=!!t,u=e.maxQuantity!==1;return jsxs(a5,{item:true,sx:{gap:"16px"},container:!c,children:[o&&jsx(kt,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:s,children:jsx(P,{color:"primary.main",variant:"body1",children:"Undo"})}),d&&jsxs(Grid,{sx:{display:"flex",width:"100%",justifyContent:"flex-end"},children:[u&&jsx(Rt,{id:`${e.id}-input`,type:"number",onWheel:Pn,sx:c?{marginX:2,width:"100%"}:{flex:1},value:(p=t==null?void 0:t.quantity)!=null?p:"",error:!!n,helperText:n,FormHelperTextProps:{sx:{margin:"4px"}},onChange:h=>{var m,g;return a((m=h==null?void 0:h.target)!=null&&m.value?Number((g=h==null?void 0:h.target)==null?void 0:g.value):null)},onFocus:h=>h.target.select()}),jsx(fy,{color:"error",onClick:l,children:jsx(mt,{icon:"Trash",style:{display:"flex",padding:"8px"}})})]}),!d&&jsx(kt,{sx:{paddingX:"22px",paddingY:"8px"},onClick:()=>a(1),disabled:!i,children:jsx(P,{color:i?"primary.main":"disabled",variant:"body1",children:r.addAddonText})})]})}var c5=y(Grid)`
831
831
  display: flex;
832
832
  flex-direction: column;
833
833
  justify-content: center;
834
834
  width: 100%;
835
835
  height: 42px;
836
- `;function ay({addon:e,billingPeriod:t,checkoutLocalization:o}){let n=e.pricePoints.find(i=>i.billingPeriod===t);return jsxs($3,{item:true,children:[jsx(C,{variant:"h6",lineHeight:"24px",children:e.displayName}),n?jsx(C,{variant:"body1",lineHeight:"20px",color:"secondary",children:`${at({amount:n.amount,currency:n.currency,minimumFractionDigits:2})}/${t===BillingPeriod.Annually?"year":"month"}`}):jsx(C,{variant:"body1",lineHeight:"20px",color:"secondary",children:o.addonBillingPeriodNotAvailableText({planBillingPeriod:t})})]})}function W3({addon:e,billingPeriod:t,addonState:o,initialAddonState:n,setAddon:i,removeAddon:r,checkoutLocalization:a,onAddonsValidationChange:s,onAddonChange:l}){let[c,d]=useState(void 0),u=!!o&&!!n&&o.quantity!==n.quantity||!!n&&!o,p=e.pricePoints.some(g=>g.billingPeriod===t),m=g=>R(null,null,function*(){if(!g||g<=0){s({addonId:e.id,isValid:false}),d("Minimum 1"),i(e,g!=null?g:null);return}let y=yield l==null?void 0:l({addon:e,quantity:g});d(y==null?void 0:y.errorMessage),s({addonId:e.id,isValid:!(y!=null&&y.disableNextStep)}),i(e,g);}),h=()=>R(null,null,function*(){yield l==null?void 0:l({addon:e,quantity:0}),r(e.id),s({addonId:e.id,isValid:true});});return jsxs(ey,{children:[jsx(ay,{addon:e,billingPeriod:t,checkoutLocalization:a}),jsx(ry,{addon:e,addonState:o,hasChanges:u,handleUndo:()=>R(null,null,function*(){if(n){let g=yield l==null?void 0:l({addon:e,quantity:n.quantity});s({addonId:e.id,isValid:!(g!=null&&g.disableNextStep)}),i(e,n.quantity);}else yield h();s({addonId:e.id,isValid:true});}),errorMessage:c,handleQuantityChange:m,isPriceForBillingPeriodAvailable:p,checkoutLocalization:a,handleRemoveAddon:h})]})}function ly({onAddonChange:e}){let{checkoutLocalization:t,setIsValid:o}=Y(),{billingPeriod:n}=te(),{setIsDisabled:i}=ke(),{initialAddons:r,addons:a,availableAddons:s,setAddon:l,removeAddon:c}=Df(),[d,u]=useState((s==null?void 0:s.reduce((p,m)=>(p[m.id]=true,p),{}))||{});return useEffect(()=>{let p=Object.values(d).some(m=>!m);i(p),o(!p);},[d,i,o]),jsx(ty,{container:true,children:s==null?void 0:s.map(p=>{let m=a.find(f=>f.addon.id===p.id),h=r==null?void 0:r.find(f=>f.addon.id===p.id);return jsx(W3,{addon:p,billingPeriod:n,addonState:m,initialAddonState:h,setAddon:l,removeAddon:c,checkoutLocalization:t,onAddonsValidationChange:({addonId:f,isValid:g})=>u(_(S({},d),{[f]:g})),onAddonChange:e},p.id)})})}var zc=x(Pe)`
836
+ `;function Cy({addon:e,billingPeriod:t,checkoutLocalization:o}){let n=e.pricePoints.find(i=>i.billingPeriod===t);return jsxs(c5,{item:true,children:[jsx(P,{variant:"h6",lineHeight:"24px",children:e.displayName}),n?jsx(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:`${at({amount:n.amount,currency:n.currency,minimumFractionDigits:2})}/${t===BillingPeriod.Annually?"year":"month"}`}):jsx(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:o.addonBillingPeriodNotAvailableText({planBillingPeriod:t})})]})}function p5({addon:e,billingPeriod:t,addonState:o,initialAddonState:n,setAddon:i,removeAddon:r,checkoutLocalization:a,onAddonsValidationChange:s,onAddonChange:l}){let[c,d]=useState(void 0),u=!!o&&!!n&&o.quantity!==n.quantity||!!n&&!o,p=e.pricePoints.some(f=>f.billingPeriod===t),h=f=>R(null,null,function*(){if(!f||f<=0){s({addonId:e.id,isValid:false}),d("Minimum 1"),i(e,f!=null?f:null);return}let x=yield l==null?void 0:l({addon:e,quantity:f});d(x==null?void 0:x.errorMessage),s({addonId:e.id,isValid:!(x!=null&&x.disableNextStep)}),i(e,f);}),m=()=>R(null,null,function*(){yield l==null?void 0:l({addon:e,quantity:0}),r(e.id),s({addonId:e.id,isValid:true});});return jsxs(gy,{children:[jsx(Cy,{addon:e,billingPeriod:t,checkoutLocalization:a}),jsx(by,{addon:e,addonState:o,hasChanges:u,handleUndo:()=>R(null,null,function*(){if(n){let f=yield l==null?void 0:l({addon:e,quantity:n.quantity});s({addonId:e.id,isValid:!(f!=null&&f.disableNextStep)}),i(e,n.quantity);}else yield m();s({addonId:e.id,isValid:true});}),errorMessage:c,handleQuantityChange:h,isPriceForBillingPeriodAvailable:p,checkoutLocalization:a,handleRemoveAddon:m})]})}function Sy({onAddonChange:e}){let{checkoutLocalization:t,setIsValid:o}=Y(),{billingPeriod:n}=te(),{setIsDisabled:i}=ke(),{initialAddons:r,addons:a,availableAddons:s,setAddon:l,removeAddon:c}=Xg(),[d,u]=useState((s==null?void 0:s.reduce((p,h)=>(p[h.id]=true,p),{}))||{});return useEffect(()=>{let p=Object.values(d).some(h=>!h);i(p),o(!p);},[d,i,o]),jsx(hy,{container:true,children:s==null?void 0:s.map(p=>{let h=a.find(g=>g.addon.id===p.id),m=r==null?void 0:r.find(g=>g.addon.id===p.id);return jsx(p5,{addon:p,billingPeriod:n,addonState:h,initialAddonState:m,setAddon:l,removeAddon:c,checkoutLocalization:t,onAddonsValidationChange:({addonId:g,isValid:f})=>u(A(S({},d),{[g]:f})),onAddonChange:e},p.id)})})}var Kc=y(Se)`
837
837
  padding: 8px;
838
838
  border-radius: 10px;
839
839
  border: 1px solid ${({theme:e})=>e.stigg.palette.outlinedBorder};
840
840
  cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
841
841
  opacity: ${({$disabled:e})=>e?.6:1};
842
- `,cy=x(zc)`
842
+ `,Ty=y(Kc)`
843
843
  flex-direction: column;
844
844
  align-items: unset;
845
845
  ${({$hideBorders:e})=>e&&css`
846
846
  border: none;
847
847
  padding: 0;
848
848
  `}
849
- `,dy=x(Pe)`
849
+ `,ky=y(Se)`
850
850
  display: flex;
851
851
  align-items: center;
852
852
  flex: 1;
853
853
  gap: 12px;
854
- `,uy=x(Pe)`
854
+ `,wy=y(Se)`
855
855
  display: flex;
856
856
  flex-direction: column;
857
- `;var J3=x(Ma)`
857
+ `;var P5=y(Na)`
858
858
  position: relative;
859
859
  max-width: 500px;
860
- `,t5=x(Ma)`
860
+ `,S5=y(Na)`
861
861
  opacity: ${({$showLoading:e})=>e?.6:1};
862
862
  pointer-events: ${({$showLoading:e})=>e?"none":"auto"};
863
- `,e5=x(Ma)`
863
+ `,T5=y(Na)`
864
864
  position: absolute;
865
865
  top: 40px;
866
866
  left: 0;
@@ -872,18 +872,18 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
872
872
  justify-content: center;
873
873
  border-radius: 4px;
874
874
  z-index: 10;
875
- `,o5=x(Ma)`
875
+ `,k5=y(Na)`
876
876
  display: flex;
877
877
  flex-direction: column;
878
878
  align-items: center;
879
879
  gap: 12px;
880
- `;function py({onCheckout:e,onCheckoutCompleted:t}){var g,y,P;let{isZuoraIntegration:o,isInitialized:n,createPaymentSession:i}=In(),{setErrorMessage:r}=vt(),{billingCountryCode:a}=te(),{checkoutState:s,widgetState:l}=Y(),{handleZuoraSubmit:c}=Pa({onCheckout:e,onCheckoutCompleted:t}),d=useRef(false),[u,p]=xc.useState(false),m=((P=(y=(g=s==null?void 0:s.plan)==null?void 0:g.pricePoints)==null?void 0:y[0])==null?void 0:P.currency)||Currency.Usd,{publishableKey:h}=s==null?void 0:s.billingIntegration.billingCredentials,f=useCallback(T=>R(null,null,function*(){var k;if(!T.success||!T.paymentMethodId){let w=((k=T.error)==null?void 0:k.message)||"Payment failed";r(w),yield t({success:false,error:w});return}yield c(T.paymentMethodId);}),[c,r,t]);return useEffect(()=>(R(null,null,function*(){if(!(!n||d.current)){p(true),r(void 0);try{d.current=!0;let k=window.Zuora(h),w=Dg(i,f,m,a);(yield k.createPaymentForm(w)).mount("#zuora_payment");}catch(k){d.current=false,r("Failed to render Zuora payment form");}finally{p(false);}}}),()=>{d.current=false;}),[n]),o?jsxs(J3,{children:[jsx(t5,{id:"zuora_payment",$showLoading:l.readOnly||u}),(l.readOnly||u)&&jsx(e5,{children:jsx(o5,{children:jsx(aw,{size:28})})})]}):null}function my({checked:e,text:t,subtitle:o,readOnly:n}){return jsxs(dy,{children:[jsx(r5,{checked:e,disabled:n}),jsxs(uy,{container:true,children:[jsx(Pe,{item:true,children:t}),o&&jsx(Pe,{item:true,children:o})]})]})}function fy({checked:e,paymentMethodDetails:t,readOnly:o,onSelect:n}){if(!t)return null;let{last4Digits:i,expirationMonth:r,expirationYear:a}=t;return jsx(zc,{item:true,onClick:n,$disabled:o,children:jsx(my,{checked:e,readOnly:o,text:jsx(C,{variant:"h6",children:`Card ending in ${i}`}),subtitle:!!r&&!!a&&jsx(C,{variant:"body1",children:`Expires ${r.toString().padStart(2,"0")}/${a}`})})})}function gy({hasExistingPaymentMethod:e,checked:t,onSelect:o,readOnly:n,checkoutLocalization:i,onBillingAddressChange:r,collectPhoneNumber:a,collectTaxId:s,onCheckout:l,onCheckoutCompleted:c}){let{isZuoraIntegration:d}=In();return jsxs(cy,{item:true,$hideBorders:!e,onClick:o,$disabled:n,children:[e&&jsx(my,{checked:t,readOnly:n,text:jsx(C,{variant:"h6",children:i.newPaymentMethodText})}),jsx(w3,{in:t,children:d?jsx(py,{onCheckout:l,onCheckoutCompleted:c}):jsx(kg,{onBillingAddressChange:r,collectPhoneNumber:a,collectTaxId:s})})]})}var l5=x(Pe)`
880
+ `;function vy({onCheckout:e,onCheckoutCompleted:t}){var f,x,b;let{isZuoraIntegration:o,isInitialized:n,createPaymentSession:i}=In(),{setErrorMessage:r}=vt(),{billingCountryCode:a}=te(),{checkoutState:s,widgetState:l}=Y(),{handleZuoraSubmit:c}=Ma({onCheckout:e,onCheckoutCompleted:t}),d=useRef(false),[u,p]=Ac.useState(false),h=((b=(x=(f=s==null?void 0:s.plan)==null?void 0:f.pricePoints)==null?void 0:x[0])==null?void 0:b.currency)||Currency.Usd,{publishableKey:m}=s==null?void 0:s.billingIntegration.billingCredentials,g=useCallback(T=>R(null,null,function*(){var k;if(!T.success||!T.paymentMethodId){let w=((k=T.error)==null?void 0:k.message)||"Payment failed";r(w),yield t({success:false,error:w});return}yield c(T.paymentMethodId);}),[c,r,t]);return useEffect(()=>(R(null,null,function*(){if(!(!n||d.current)){p(true),r(void 0);try{d.current=!0;let k=window.Zuora(m),w=Kf(i,g,h,a);(yield k.createPaymentForm(w)).mount("#zuora_payment");}catch(k){d.current=false,r("Failed to render Zuora payment form");}finally{p(false);}}}),()=>{d.current=false;}),[n]),o?jsxs(P5,{children:[jsx(S5,{id:"zuora_payment",$showLoading:l.readOnly||u}),(l.readOnly||u)&&jsx(T5,{children:jsx(k5,{children:jsx(Aw,{size:28})})})]}):null}function Ay({checked:e,text:t,subtitle:o,readOnly:n}){return jsxs(ky,{children:[jsx(_5,{checked:e,disabled:n}),jsxs(wy,{container:true,children:[jsx(Se,{item:true,children:t}),o&&jsx(Se,{item:true,children:o})]})]})}function My({checked:e,paymentMethodDetails:t,readOnly:o,onSelect:n}){if(!t)return null;let{last4Digits:i,expirationMonth:r,expirationYear:a}=t;return jsx(Kc,{item:true,onClick:n,$disabled:o,children:jsx(Ay,{checked:e,readOnly:o,text:jsx(P,{variant:"h6",children:`Card ending in ${i}`}),subtitle:!!r&&!!a&&jsx(P,{variant:"body1",children:`Expires ${r.toString().padStart(2,"0")}/${a}`})})})}function Iy({hasExistingPaymentMethod:e,checked:t,onSelect:o,readOnly:n,checkoutLocalization:i,onBillingAddressChange:r,collectPhoneNumber:a,collectTaxId:s,onCheckout:l,onCheckoutCompleted:c}){let{isZuoraIntegration:d}=In();return jsxs(Ty,{item:true,$hideBorders:!e,onClick:o,$disabled:n,children:[e&&jsx(Ay,{checked:t,readOnly:n,text:jsx(P,{variant:"h6",children:i.newPaymentMethodText})}),jsx(Y3,{in:t,children:d?jsx(vy,{onCheckout:l,onCheckoutCompleted:c}):jsx(Uf,{onBillingAddressChange:r,collectPhoneNumber:a,collectTaxId:s})})]})}var I5=y(Se)`
881
881
  display: flex;
882
882
  flex-direction: column;
883
883
  gap: 24px;
884
- `;function yy({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:n,onCheckoutCompleted:i}){let{checkoutState:r,checkoutLocalization:a,widgetState:s}=Y(),{customer:l}=r||{},{errorMessage:c,useNewPaymentMethod:d,setUseNewPaymentMethod:u}=vt(),{readOnly:p}=s,m=h=>{p||u(h);};return jsxs(l5,{container:true,children:[!!c&&jsx(F3,{severity:"error",sx:{alignItems:"center"},children:jsx(C,{overrideColor:"inherit",children:c})}),jsx(fy,{readOnly:p,checked:!d,paymentMethodDetails:l==null?void 0:l.paymentMethodDetails,onSelect:()=>m(false)}),jsx(gy,{hasExistingPaymentMethod:!!(l!=null&&l.paymentMethodDetails),readOnly:p,checked:d,checkoutLocalization:a,onSelect:()=>m(true),onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:n,onCheckoutCompleted:i})]})}var La=({onClick:e,checkoutLocalization:t,size:o})=>jsx(b2,{className:"stigg-checkout-change-plan-button",sx:{textTransform:"none"},variant:"text",size:o,onClick:e,children:jsx(C,{className:"stigg-checkout-change-plan-button-text",color:"primary.main",variant:"h3",style:{lineHeight:"24px"},children:t.changePlan})});function Cy({allowChangePlan:e=false,onChangePlan:t}){let{checkoutState:o,checkoutLocalization:n}=Y(),{plan:i}=o||{};return jsxs(Fragment,{children:[jsxs(Ma,{sx:{marginBottom:"16px"},children:[jsx(C,{variant:"body1",color:"disabled",style:{opacity:.6,marginBottom:"8px"},children:"Selected plan"}),jsxs(Ma,{sx:{display:"flex",justifyContent:"space-between"},children:[jsx(C,{variant:"h1",children:i==null?void 0:i.displayName}),e&&t&&jsx(La,{onClick:()=>{t({currentPlan:i});},checkoutLocalization:n,size:"medium"})]})]}),jsx(sf,{className:"stigg-checkout-plan-header-divider"})]})}function Hc(e){switch(e){case BillingPeriod.Annually:return "Annual";case BillingPeriod.Monthly:return "Monthly";default:return ""}}var Ty=x(Ma)`
884
+ `;function Ey({onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:n,onCheckoutCompleted:i}){let{checkoutState:r,checkoutLocalization:a,widgetState:s}=Y(),{customer:l}=r||{},{errorMessage:c,useNewPaymentMethod:d,setUseNewPaymentMethod:u}=vt(),{readOnly:p}=s,h=m=>{p||u(m);};return jsxs(I5,{container:true,children:[!!c&&jsx(o5,{severity:"error",sx:{alignItems:"center"},children:jsx(P,{overrideColor:"inherit",children:c})}),jsx(My,{readOnly:p,checked:!d,paymentMethodDetails:l==null?void 0:l.paymentMethodDetails,onSelect:()=>h(false)}),jsx(Iy,{hasExistingPaymentMethod:!!(l!=null&&l.paymentMethodDetails),readOnly:p,checked:d,checkoutLocalization:a,onSelect:()=>h(true),onBillingAddressChange:e,collectPhoneNumber:t,collectTaxId:o,onCheckout:n,onCheckoutCompleted:i})]})}var Oa=({onClick:e,checkoutLocalization:t,size:o})=>jsx(L2,{className:"stigg-checkout-change-plan-button",sx:{textTransform:"none"},variant:"text",size:o,onClick:e,children:jsx(P,{className:"stigg-checkout-change-plan-button-text",color:"primary.main",variant:"h3",style:{lineHeight:"24px"},children:t.changePlan})});function By({allowChangePlan:e=false,onChangePlan:t}){let{checkoutState:o,checkoutLocalization:n}=Y(),{plan:i}=o||{};return jsxs(Fragment,{children:[jsxs(Na,{sx:{marginBottom:"16px"},children:[jsx(P,{variant:"body1",color:"disabled",style:{opacity:.6,marginBottom:"8px"},children:"Selected plan"}),jsxs(Na,{sx:{display:"flex",justifyContent:"space-between"},children:[jsx(P,{variant:"h1",children:i==null?void 0:i.displayName}),e&&t&&jsx(Oa,{onClick:()=>{t({currentPlan:i});},checkoutLocalization:n,size:"medium"})]})]}),jsx(gg,{className:"stigg-checkout-plan-header-divider"})]})}function Jc(e){switch(e){case BillingPeriod.Annually:return "Annual";case BillingPeriod.Monthly:return "Monthly";default:return ""}}var Ny=y(Na)`
885
885
  margin: 16px 0;
886
- `,ky=x.button`
886
+ `,Uy=y.button`
887
887
  cursor: ${({$disabled:e,$isOnlyBillingPeriod:t})=>e||t?"default":"pointer"};
888
888
  flex: 1;
889
889
  display: flex;
@@ -903,19 +903,19 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
903
903
  background: none;
904
904
  }
905
905
  }
906
- `,wy=x(Ma)`
906
+ `,Oy=y(Na)`
907
907
  display: flex;
908
908
  gap: 16px;
909
909
  margin-top: 16px;
910
- `;x.div`
910
+ `;y.div`
911
911
  display: flex;
912
912
  align-items: baseline;
913
913
  gap: 8px;
914
- `;x(h5)`
914
+ `;y(R5)`
915
915
  & .MuiChip-label {
916
916
  font-size: 12px;
917
917
  }
918
- `;var vy=({billingPeriod:e,isOnlyBillingPeriod:t})=>{let{billingPeriod:o,setBillingPeriod:n}=te(),i=o===e;return jsxs(ky,{onClick:()=>n(e),$isActive:i,$isOnlyBillingPeriod:t,children:[jsx(r5,{checked:i,onChange:()=>n(e),value:e,disabled:t,inputProps:{"aria-label":Hc(e)},sx:{padding:0,marginRight:"8px"}}),jsx(Ma,{children:jsx(C,{variant:"h3",color:"primary",children:Hc(e)})})]})};function _y({plan:e,checkoutLocalization:t}){let[o,n]=partition(e==null?void 0:e.pricePoints,r=>r.billingPeriod===BillingPeriod.Monthly),i=!!(o!=null&&o.length)&&!!(n!=null&&n.length);return i?jsxs(Ty,{children:[jsx(C,{variant:"h6",color:"primary",children:t.billingPeriodsTitle}),jsxs(wy,{children:[!!(o!=null&&o.length)&&jsx(vy,{billingPeriod:BillingPeriod.Monthly,isOnlyBillingPeriod:!i},BillingPeriod.Monthly),!!(n!=null&&n.length)&&jsx(vy,{billingPeriod:BillingPeriod.Annually,isOnlyBillingPeriod:!i},BillingPeriod.Annually)]})]}):null}var P5=x.div`
918
+ `;var zy=({billingPeriod:e,isOnlyBillingPeriod:t})=>{let{billingPeriod:o,setBillingPeriod:n}=te(),i=o===e;return jsxs(Uy,{onClick:()=>n(e),$isActive:i,$isOnlyBillingPeriod:t,children:[jsx(_5,{checked:i,onChange:()=>n(e),value:e,disabled:t,inputProps:{"aria-label":Jc(e)},sx:{padding:0,marginRight:"8px"}}),jsx(Na,{children:jsx(P,{variant:"h3",color:"primary",children:Jc(e)})})]})};function Vy({plan:e,checkoutLocalization:t}){let[o,n]=partition(e==null?void 0:e.pricePoints,r=>r.billingPeriod===BillingPeriod.Monthly),i=!!(o!=null&&o.length)&&!!(n!=null&&n.length);return i?jsxs(Ny,{children:[jsx(P,{variant:"h6",color:"primary",children:t.billingPeriodsTitle}),jsxs(Oy,{children:[!!(o!=null&&o.length)&&jsx(zy,{billingPeriod:BillingPeriod.Monthly,isOnlyBillingPeriod:!i},BillingPeriod.Monthly),!!(n!=null&&n.length)&&jsx(zy,{billingPeriod:BillingPeriod.Annually,isOnlyBillingPeriod:!i},BillingPeriod.Annually)]})]}):null}var H5=y.div`
919
919
  display: flex;
920
920
  min-height: 60px;
921
921
  margin-top: 16px;
@@ -926,39 +926,39 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
926
926
  align-items: flex-start;
927
927
  justify-content: space-between;
928
928
  }
929
- `,S5=x(Ma)`
929
+ `,W5=y(Na)`
930
930
  display: flex;
931
931
  flex-direction: column;
932
932
  justify-content: center;
933
933
  width: 100%;
934
934
  height: 42px;
935
- `,T5=x(C)`
935
+ `,G5=y(P)`
936
936
  display: flex;
937
937
  align-items: center;
938
938
  justify-content: flex-end;
939
939
  width: 100%;
940
940
  min-height: 42px;
941
- `,k5=(e,t)=>{let{minUnitQuantity:o,maxUnitQuantity:n}=e;return !t||t<(o||1)?`Minimum ${o||1}`:n&&t>n?`Maximum ${n}`:""};function w5({charge:e,setBillableFeature:t,billableFeature:o,onValidationChange:n,onBillableFeatureChange:i}){var h,f,g,y,P,T;let[r,a]=useState(void 0),s=(h=e.feature)==null?void 0:h.featureId,l=!s,c=e.pricingModel===BillingModel.UsageBased,d=l?"Base charge":vi(((f=e.feature)==null?void 0:f.displayName)||"",(g=e.feature)==null?void 0:g.units,(y=e.feature)==null?void 0:y.unitsPlural),u=!!(e!=null&&e.minUnitQuantity||e!=null&&e.maxUnitQuantity),p=k=>R(null,null,function*(){var B,L;if(l||!s)return;let{minUnitQuantity:w,maxUnitQuantity:v}=e,A=(B=k==null?void 0:k.target)!=null&&B.value?Number((L=k==null?void 0:k.target)==null?void 0:L.value):null;if(!A||A<=0||w&&A<w||v&&A>v){n({featureId:s,isValid:false}),a(k5(e,A!=null?A:void 0)),t(s,A!=null?A:null);return}let M=aa(e,A),I=yield i==null?void 0:i({feature:e.feature,quantity:M});a(I==null?void 0:I.errorMessage),n({featureId:s,isValid:!(I!=null&&I.disableNextStep)}),t(s,M);}),m;if(l||c)m=`${at({amount:e.amount,currency:e.currency,locale:"en-us",minimumFractionDigits:2})}`,c&&(m+=" / unit");else if(e.isTieredPrice&&e.tiersMode&&s){let k=(o==null?void 0:o.quantity)||1;m=jsx(Mr,{componentId:`${s}-tiers`,tiers:e.tiers,tiersMode:e.tiersMode,value:k,errorMessage:r,handleChange:w=>R(null,null,function*(){let v=yield i==null?void 0:i({feature:e.feature,quantity:w});a(v==null?void 0:v.errorMessage),n({featureId:s,isValid:!(v!=null&&v.disableNextStep)}),t(s,w);}),width:"100%"});}else m=jsx(Rt,{sx:{width:"100%"},id:`${s}-input`,type:"number",onWheel:Pn,error:!!r,helperText:r,FormHelperTextProps:{sx:{margin:"4px"}},value:(P=o==null?void 0:o.quantity)!=null?P:"",onChange:p});return jsxs(P5,{children:[jsxs(S5,{children:[jsx(C,{variant:"h6",color:"primary",lineHeight:"24px",children:d}),u&&jsx(C,{variant:"body1",color:"secondary",lineHeight:"20px",children:xr(e.minUnitQuantity,e.maxUnitQuantity,(T=e.feature)==null?void 0:T.unitsPlural)})]}),jsx(T5,{variant:"h6",color:"primary",children:m})]})}function Iy({plan:e,billingPeriod:t,onBillableFeatureChange:o}){var d;let{billableFeatures:n,setBillableFeature:i}=te(),{setIsDisabled:r}=ke(),{setIsValid:a}=Y(),s=ca(((d=e==null?void 0:e.pricePoints)==null?void 0:d.filter(u=>u.billingPeriod===t))||[]),[l,c]=useState(s==null?void 0:s.reduce((u,p)=>{var m;return u[((m=p.feature)==null?void 0:m.featureId)||"base-charge"]=true,u},{}));return useEffect(()=>{let u=Object.values(l).some(p=>!p);r(u),a(!u);},[l,r,a]),jsx(Fragment,{children:s==null?void 0:s.map(u=>{var m;let p=n.find(h=>{var f;return h.featureId===((f=u.feature)==null?void 0:f.featureId)});return jsx(w5,{charge:u,setBillableFeature:i,billableFeature:p,onValidationChange:({featureId:h,isValid:f})=>c(g=>_(S({},g),{[h]:f})),onBillableFeatureChange:o},((m=u.feature)==null?void 0:m.featureId)||"base-charge")})})}var Ly=x(Ma)`
941
+ `,j5=(e,t)=>{let{minUnitQuantity:o,maxUnitQuantity:n}=e;return !t||t<(o||1)?`Minimum ${o||1}`:n&&t>n?`Maximum ${n}`:""};function Y5({charge:e,setBillableFeature:t,billableFeature:o,onValidationChange:n,onBillableFeatureChange:i}){var m,g,f,x,b,T;let[r,a]=useState(void 0),s=(m=e.feature)==null?void 0:m.featureId,l=!s,c=e.pricingModel===BillingModel.UsageBased,d=l?"Base charge":vi(((g=e.feature)==null?void 0:g.displayName)||"",(f=e.feature)==null?void 0:f.units,(x=e.feature)==null?void 0:x.unitsPlural),u=!!(e!=null&&e.minUnitQuantity||e!=null&&e.maxUnitQuantity),p=k=>R(null,null,function*(){var F,E;if(l||!s)return;let{minUnitQuantity:w,maxUnitQuantity:v}=e,_=(F=k==null?void 0:k.target)!=null&&F.value?Number((E=k==null?void 0:k.target)==null?void 0:E.value):null;if(!_||_<=0||w&&_<w||v&&_>v){n({featureId:s,isValid:false}),a(j5(e,_!=null?_:void 0)),t(s,_!=null?_:null);return}let M=ha(e,_),I=yield i==null?void 0:i({feature:e.feature,quantity:M});a(I==null?void 0:I.errorMessage),n({featureId:s,isValid:!(I!=null&&I.disableNextStep)}),t(s,M);}),h;if(l||c)h=`${at({amount:e.amount,currency:e.currency,locale:"en-us",minimumFractionDigits:2})}`,c&&(h+=" / unit");else if(e.isTieredPrice&&e.tiersMode&&s){let k=(o==null?void 0:o.quantity)||1;h=jsx(Ir,{componentId:`${s}-tiers`,tiers:e.tiers,tiersMode:e.tiersMode,value:k,errorMessage:r,handleChange:w=>R(null,null,function*(){let v=yield i==null?void 0:i({feature:e.feature,quantity:w});a(v==null?void 0:v.errorMessage),n({featureId:s,isValid:!(v!=null&&v.disableNextStep)}),t(s,w);}),width:"100%"});}else h=jsx(Rt,{sx:{width:"100%"},id:`${s}-input`,type:"number",onWheel:Pn,error:!!r,helperText:r,FormHelperTextProps:{sx:{margin:"4px"}},value:(b=o==null?void 0:o.quantity)!=null?b:"",onChange:p});return jsxs(H5,{children:[jsxs(W5,{children:[jsx(P,{variant:"h6",color:"primary",lineHeight:"24px",children:d}),u&&jsx(P,{variant:"body1",color:"secondary",lineHeight:"20px",children:br(e.minUnitQuantity,e.maxUnitQuantity,(T=e.feature)==null?void 0:T.unitsPlural)})]}),jsx(G5,{variant:"h6",color:"primary",children:h})]})}function Wy({plan:e,billingPeriod:t,onBillableFeatureChange:o}){var d;let{billableFeatures:n,setBillableFeature:i}=te(),{setIsDisabled:r}=ke(),{setIsValid:a}=Y(),s=ya(((d=e==null?void 0:e.pricePoints)==null?void 0:d.filter(u=>u.billingPeriod===t))||[]),[l,c]=useState(s==null?void 0:s.reduce((u,p)=>{var h;return u[((h=p.feature)==null?void 0:h.featureId)||"base-charge"]=true,u},{}));return useEffect(()=>{let u=Object.values(l).some(p=>!p);r(u),a(!u);},[l,r,a]),jsx(Fragment,{children:s==null?void 0:s.map(u=>{var h;let p=n.find(m=>{var g;return m.featureId===((g=u.feature)==null?void 0:g.featureId)});return jsx(Y5,{charge:u,setBillableFeature:i,billableFeature:p,onValidationChange:({featureId:m,isValid:g})=>c(f=>A(S({},f),{[m]:g})),onBillableFeatureChange:o},((h=u.feature)==null?void 0:h.featureId)||"base-charge")})})}var Gy=y(Na)`
942
942
  width: 100%;
943
- `;var Ey=({onChangePlan:e,onBillableFeatureChange:t})=>{let{checkoutState:o,checkoutLocalization:n}=Y(),{plan:i}=o||{},{billingPeriod:r}=te();return jsxs(Fragment,{children:[jsx(Cy,{allowChangePlan:true,onChangePlan:e}),jsxs(Ly,{children:[jsx(_y,{plan:i,checkoutLocalization:n}),jsx(Iy,{plan:i,billingPeriod:r,onBillableFeatureChange:t})]})]})};var M5=e=>jsx("svg",_(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxs("g",{id:"arrow-right",children:[jsx("path",{id:"Shape",d:"M2.66699 8H13.3337",stroke:"#7586B0",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{id:"Shape_2",d:"M9.33301 4L13.333 8L9.33301 12",stroke:"#7586B0",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Fy=M5;var Ry=x(Fy)`
943
+ `;var Yy=({onChangePlan:e,onBillableFeatureChange:t})=>{let{checkoutState:o,checkoutLocalization:n}=Y(),{plan:i}=o||{},{billingPeriod:r}=te();return jsxs(Fragment,{children:[jsx(By,{allowChangePlan:true,onChangePlan:e}),jsxs(Gy,{children:[jsx(Vy,{plan:i,checkoutLocalization:n}),jsx(Wy,{plan:i,billingPeriod:r,onBillableFeatureChange:t})]})]})};var q5=e=>jsx("svg",A(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxs("g",{id:"arrow-right",children:[jsx("path",{id:"Shape",d:"M2.66699 8H13.3337",stroke:"#7586B0",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{id:"Shape_2",d:"M9.33301 4L13.333 8L9.33301 12",stroke:"#7586B0",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Zy=q5;var Xy=y(Zy)`
944
944
  path {
945
945
  stroke: ${({theme:e})=>e.stigg.palette.text.secondary};
946
946
  }
947
- `;var B5=x(Ma)`
947
+ `;var tv=y(Na)`
948
948
  display: flex;
949
- `,E5=x(F3)`
949
+ `,ev=y(o5)`
950
950
  margin-bottom: 16px;
951
- `,F5=x(Ma)`
951
+ `,ov=y(Na)`
952
952
  padding: 16px;
953
953
  border-radius: 10px;
954
954
  width: 100%;
955
955
  border: ${({theme:e})=>`1px solid ${e.stigg.palette.outlinedBorder}`};
956
- `,Dy=({headerText:e,planName:t,priceText:o})=>jsxs(F5,{className:"stigg-checkout-downgrade-to-free-container",children:[jsx(C,{className:"stigg-checkout-downgrade-to-free-text-header",style:{opacity:.8},variant:"caption",color:"disabled",children:e}),jsx(C,{className:"stigg-checkout-downgrade-to-free-plan-name",bold:true,variant:"h3",color:"primary",children:t}),jsx(C,{className:"stigg-checkout-downgrade-to-free-price-text",color:"secondary",children:o})]}),Oy=({checkoutLocalization:e,activeSubscription:t,freePlan:o,allowChangePlan:n=false,onChangePlan:i})=>{let r;n&&i&&(r=jsx(La,{onClick:()=>{i({currentPlan:o});},checkoutLocalization:e,size:"small"}));let a=t.prices.length>0?t.prices[0].billingPeriod:void 0;return jsxs(Fragment,{children:[jsx(E5,{action:r,className:"stigg-checkout-downgrade-to-free-alert",severity:"info",children:jsx(C,{as:"span",color:"secondary",children:e.downgradeToFree.alertText({plan:t.plan})})}),jsxs(B5,{className:"stigg-checkout-downgrade-to-free-plans-container",children:[jsx(Dy,{headerText:e.downgradeToFree.paidPlanHeader({plan:t.plan}),planName:e.downgradeToFree.paidPlanName({plan:t.plan}),priceText:e.downgradeToFree.paidPlanPriceText({plan:t.plan,billingPeriod:a})}),jsx(Ry,{className:"stigg-checkout-downgrade-to-free-arrow",style:{margin:"auto 16px",minWidth:"16px"}}),jsx(Dy,{headerText:e.downgradeToFree.freePlanHeader({plan:o}),planName:e.downgradeToFree.freePlanName({plan:o}),priceText:e.downgradeToFree.freePlanPriceText({plan:o})})]})]})};var O5=(e,{onBillingAddressChange:t,onChangePlan:o,onBillableFeatureChange:n,onAddonChange:i,collectPhoneNumber:r,collectTaxId:a,onCheckout:s,onCheckoutCompleted:l})=>{switch(e.key){case "PLAN":return {content:jsx(Ey,{onChangePlan:o,onBillableFeatureChange:n})};case "ADDONS":return {content:jsx(ly,{onAddonChange:i})};case "PAYMENT":return {content:jsx(yy,{onBillingAddressChange:t,collectPhoneNumber:r,collectTaxId:a,onCheckout:s,onCheckoutCompleted:l})};default:return {content:null}}};function Vy({onCheckout:e,onCheckoutCompleted:t,onChangePlan:o,onBillingAddressChange:n,onBillableFeatureChange:i,onAddonChange:r,collectPhoneNumber:a,collectTaxId:s,disablePromotionCode:l,disableSuccessAnimation:c,onMockCheckoutPreview:d}){let{stripePromise:u,setupIntentClientSecret:p}=wg(),[{stiggTheme:m,widgetState:h,theme:f,showWatermark:g}]=j(),{currentStep:y}=ke(),{isLoadingCheckoutData:P}=h,{checkoutState:T,checkoutLocalization:k}=Y(),{plan:w,activeSubscription:v}=T||{},A=!!w&&w.pricingType===PricingType.Free&&!!v&&v.pricingType!==PricingType.Free,{content:M}=O5(y,{onBillingAddressChange:n,onChangePlan:o,onBillableFeatureChange:i,onAddonChange:r,collectPhoneNumber:a,collectTaxId:s,onCheckout:e,onCheckoutCompleted:t}),I=jsx(Fragment,{children:A?jsx(Oy,{freePlan:w,activeSubscription:v,allowChangePlan:true,checkoutLocalization:k,onChangePlan:o}):jsx(Fragment,{children:M})}),B=useMemo(()=>p?{clientSecret:p}:{mode:"setup",currency:"usd"},[p]);return jsx(Elements,{stripe:u,options:_(S({},B),{appearance:{theme:"stripe",variables:{colorText:m.palette.text.primary,colorPrimaryText:m.palette.text.primary,colorTextPlaceholder:m.palette.text.disabled,fontFamily:m.typography.fontFamily,colorBackground:f==null?void 0:f.paymentInputBackgroundColor,borderRadius:f==null?void 0:f.paymentInputBorderRadius},rules:f!=null&&f.paymentInputBorderColor?{".Input":{borderColor:f==null?void 0:f.paymentInputBorderColor}}:void 0}}),children:jsxs(ig,{className:"stigg-checkout-layout",children:[!A&&jsx(pg,{}),jsxs(rg,{children:[jsx(ag,{children:P?jsx(fh,{}):I}),P?jsx(Qg,{showWatermark:g}):jsx(qg,{disablePromotionCode:l,disableSuccessAnimation:c,onCheckout:e,onCheckoutCompleted:t,isFreeDowngrade:A,onMockCheckoutPreview:d,showWatermark:g})]})]})},p)}var Wy=p=>{var m=p,{textOverrides:e,theme:t,resourceId:o,planId:n,preferredBillingPeriod:i,billingCountryCode:r,billableFeatures:a,billingInformation:s,onMockCheckoutState:l,skipCheckoutSteps:c,onBeforeStepChange:d}=m,u=ot(m,["textOverrides","theme","resourceId","planId","preferredBillingPeriod","billingCountryCode","billableFeatures","billingInformation","onMockCheckoutState","skipCheckoutSteps","onBeforeStepChange"]);return jsx(eg,{textOverrides:e,theme:t,resourceId:o,planId:n,preferredBillingPeriod:i,billingCountryCode:r,billableFeatures:a,billingInformation:s,onMockCheckoutState:l,skipCheckoutSteps:c,onBeforeStepChange:d,children:jsx(Vy,S({},u))})};function $5(e){return useMemo(()=>{let t=new URLSearchParams(window.location.search);return t.get(e)},[e,window.location.search])}var Zc=(n=>(n.IN_PROGRESS="IN_PROGRESS",n.SUCCEEDED="SUCCEEDED",n.FAILED="FAILED",n))(Zc||{}),jy=({onProvisionStart:e,onProvisionSucceeded:t,onProvisionFailed:o}={})=>{let{stigg:n}=D(),[i,r]=useState("IN_PROGRESS"),[a,s]=useState(false),l=$5("checkoutCompleted");return useEffect(()=>{R(null,null,function*(){if(!(!l||l.toLowerCase()==="false"||a)){s(true),e&&e();try{let d=yield n.waitForCheckoutCompleted();r("SUCCEEDED"),t&&t(d);}catch(d){console.error("Failed to wait for checkout to complete",d),r("FAILED"),o&&o(d);}finally{s(false);}}});},[n,l]),{isAwaitingCheckout:a,provisionStatus:i}};function V5(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=fa(o);return r?t:jsx(Fragment,{children:e!=null?e:null})}function G5(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=ga(o);return r?t:jsx(Fragment,{children:e!=null?e:null})}function Z5(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=ya(o);return r?t:jsx(Fragment,{children:e!=null?e:null})}function q5(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=xa(o);return r?t:jsx(Fragment,{children:e!=null?e:null})}function po(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=useCallback(()=>R(null,null,function*(){if(!o||!o.isCustomerLoaded)return null;try{let l={currencyId:e.currencyId},[c,d]=yield Promise.allSettled([o.getCreditBalance(l),o.getCreditEntitlement({currencyId:e.currencyId})]);if(c.status==="rejected")throw c.reason;let u=c.value,p=d.status==="fulfilled"?d.value:null;if(u.balances&&u.balances.length>0){let{currentBalance:m,totalConsumed:h,totalGranted:f,currency:{currencyId:g,displayName:y,units:P,symbol:T}}=u.balances[0];return {currentBalance:m,totalConsumed:h,totalGranted:f,currencyId:g,displayName:y,units:P,symbol:T,usagePeriodEnd:p!=null&&p.usagePeriodEnd?new Date(p.usagePeriodEnd):void 0}}return {currencyId:e.currencyId,currentBalance:0,totalConsumed:0,totalGranted:0,usagePeriodEnd:p!=null&&p.usagePeriodEnd?new Date(p.usagePeriodEnd):void 0}}catch(l){throw console.error(l),l}}),[o,e.currencyId,n]),{data:r,error:a,isLoading:s}=Ot({func:i});return useMemo(()=>({balance:r,isLoading:s,error:a}),[r,a,s])}var En=x.div`
956
+ `,Ky=({headerText:e,planName:t,priceText:o})=>jsxs(ov,{className:"stigg-checkout-downgrade-to-free-container",children:[jsx(P,{className:"stigg-checkout-downgrade-to-free-text-header",style:{opacity:.8},variant:"caption",color:"disabled",children:e}),jsx(P,{className:"stigg-checkout-downgrade-to-free-plan-name",bold:true,variant:"h3",color:"primary",children:t}),jsx(P,{className:"stigg-checkout-downgrade-to-free-price-text",color:"secondary",children:o})]}),Qy=({checkoutLocalization:e,activeSubscription:t,freePlan:o,allowChangePlan:n=false,onChangePlan:i})=>{let r;n&&i&&(r=jsx(Oa,{onClick:()=>{i({currentPlan:o});},checkoutLocalization:e,size:"small"}));let a=t.prices.length>0?t.prices[0].billingPeriod:void 0;return jsxs(Fragment,{children:[jsx(ev,{action:r,className:"stigg-checkout-downgrade-to-free-alert",severity:"info",children:jsx(P,{as:"span",color:"secondary",children:e.downgradeToFree.alertText({plan:t.plan})})}),jsxs(tv,{className:"stigg-checkout-downgrade-to-free-plans-container",children:[jsx(Ky,{headerText:e.downgradeToFree.paidPlanHeader({plan:t.plan}),planName:e.downgradeToFree.paidPlanName({plan:t.plan}),priceText:e.downgradeToFree.paidPlanPriceText({plan:t.plan,billingPeriod:a})}),jsx(Xy,{className:"stigg-checkout-downgrade-to-free-arrow",style:{margin:"auto 16px",minWidth:"16px"}}),jsx(Ky,{headerText:e.downgradeToFree.freePlanHeader({plan:o}),planName:e.downgradeToFree.freePlanName({plan:o}),priceText:e.downgradeToFree.freePlanPriceText({plan:o})})]})]})};var av=(e,{onBillingAddressChange:t,onChangePlan:o,onBillableFeatureChange:n,onAddonChange:i,collectPhoneNumber:r,collectTaxId:a,onCheckout:s,onCheckoutCompleted:l})=>{switch(e.key){case "PLAN":return {content:jsx(Yy,{onChangePlan:o,onBillableFeatureChange:n})};case "ADDONS":return {content:jsx(Sy,{onAddonChange:i})};case "PAYMENT":return {content:jsx(Ey,{onBillingAddressChange:t,collectPhoneNumber:r,collectTaxId:a,onCheckout:s,onCheckoutCompleted:l})};default:return {content:null}}};function o1({onCheckout:e,onCheckoutCompleted:t,onChangePlan:o,onBillingAddressChange:n,onBillableFeatureChange:i,onAddonChange:r,collectPhoneNumber:a,collectTaxId:s,disablePromotionCode:l,disableSuccessAnimation:c,onMockCheckoutPreview:d}){let{stripePromise:u,setupIntentClientSecret:p}=Of(),[{stiggTheme:h,widgetState:m,theme:g,showWatermark:f}]=j(),{currentStep:x}=ke(),{isLoadingCheckoutData:b}=m,{checkoutState:T,checkoutLocalization:k}=Y(),{plan:w,activeSubscription:v}=T||{},_=!!w&&w.pricingType===PricingType.Free&&!!v&&v.pricingType!==PricingType.Free,{content:M}=av(x,{onBillingAddressChange:n,onChangePlan:o,onBillableFeatureChange:i,onAddonChange:r,collectPhoneNumber:a,collectTaxId:s,onCheckout:e,onCheckoutCompleted:t}),I=jsx(Fragment,{children:_?jsx(Qy,{freePlan:w,activeSubscription:v,allowChangePlan:true,checkoutLocalization:k,onChangePlan:o}):jsx(Fragment,{children:M})}),F=useMemo(()=>p?{clientSecret:p}:{mode:"setup",currency:"usd"},[p]);return jsx(Elements,{stripe:u,options:A(S({},F),{appearance:{theme:"stripe",variables:{colorText:h.palette.text.primary,colorPrimaryText:h.palette.text.primary,colorTextPlaceholder:h.palette.text.disabled,fontFamily:h.typography.fontFamily,colorBackground:g==null?void 0:g.paymentInputBackgroundColor,borderRadius:g==null?void 0:g.paymentInputBorderRadius},rules:g!=null&&g.paymentInputBorderColor?{".Input":{borderColor:g==null?void 0:g.paymentInputBorderColor}}:void 0}}),children:jsxs(xf,{className:"stigg-checkout-layout",children:[!_&&jsx(vf,{}),jsxs(bf,{children:[jsx(Cf,{children:b?jsx(wm,{}):I}),b?jsx(py,{showWatermark:f}):jsx(uy,{disablePromotionCode:l,disableSuccessAnimation:c,onCheckout:e,onCheckoutCompleted:t,isFreeDowngrade:_,onMockCheckoutPreview:d,showWatermark:f})]})]})},p)}var i1=p=>{var h=p,{textOverrides:e,theme:t,resourceId:o,planId:n,preferredBillingPeriod:i,billingCountryCode:r,billableFeatures:a,billingInformation:s,onMockCheckoutState:l,skipCheckoutSteps:c,onBeforeStepChange:d}=h,u=ot(h,["textOverrides","theme","resourceId","planId","preferredBillingPeriod","billingCountryCode","billableFeatures","billingInformation","onMockCheckoutState","skipCheckoutSteps","onBeforeStepChange"]);return jsx(gf,{textOverrides:e,theme:t,resourceId:o,planId:n,preferredBillingPeriod:i,billingCountryCode:r,billableFeatures:a,billingInformation:s,onMockCheckoutState:l,skipCheckoutSteps:c,onBeforeStepChange:d,children:jsx(o1,S({},u))})};function cv(e){return useMemo(()=>{let t=new URLSearchParams(window.location.search);return t.get(e)},[e,window.location.search])}var id=(n=>(n.IN_PROGRESS="IN_PROGRESS",n.SUCCEEDED="SUCCEEDED",n.FAILED="FAILED",n))(id||{}),a1=({onProvisionStart:e,onProvisionSucceeded:t,onProvisionFailed:o}={})=>{let{stigg:n}=D(),[i,r]=useState("IN_PROGRESS"),[a,s]=useState(false),l=cv("checkoutCompleted");return useEffect(()=>{R(null,null,function*(){if(!(!l||l.toLowerCase()==="false"||a)){s(true),e&&e();try{let d=yield n.waitForCheckoutCompleted();r("SUCCEEDED"),t&&t(d);}catch(d){console.error("Failed to wait for checkout to complete",d),r("FAILED"),o&&o(d);}finally{s(false);}}});},[n,l]),{isAwaitingCheckout:a,provisionStatus:i}};function dv(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=Ta(o);return r?t:jsx(Fragment,{children:e!=null?e:null})}function mv(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=ka(o);return r?t:jsx(Fragment,{children:e!=null?e:null})}function fv(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=wa(o);return r?t:jsx(Fragment,{children:e!=null?e:null})}function bv(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=va(o);return r?t:jsx(Fragment,{children:e!=null?e:null})}function po(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=useCallback(()=>R(null,null,function*(){if(!o||!o.isCustomerLoaded)return null;try{let l={currencyId:e.currencyId},[c,d]=yield Promise.allSettled([o.getCreditBalance(l),o.getCreditEntitlement({currencyId:e.currencyId})]);if(c.status==="rejected")throw c.reason;let u=c.value,p=d.status==="fulfilled"?d.value:null;if(u.balances&&u.balances.length>0){let{currentBalance:h,totalConsumed:m,totalGranted:g,currency:{currencyId:f,displayName:x,units:b,symbol:T}}=u.balances[0];return {currentBalance:h,totalConsumed:m,totalGranted:g,currencyId:f,displayName:x,units:b,symbol:T,usagePeriodEnd:p!=null&&p.usagePeriodEnd?new Date(p.usagePeriodEnd):void 0}}return {currencyId:e.currencyId,currentBalance:0,totalConsumed:0,totalGranted:0,usagePeriodEnd:p!=null&&p.usagePeriodEnd?new Date(p.usagePeriodEnd):void 0}}catch(l){throw console.error(l),l}}),[o,e.currencyId,n]),{data:r,error:a,isLoading:s}=Ut({func:i});return useMemo(()=>({balance:r,isLoading:s,error:a}),[r,a,s])}var Ln=y.div`
957
957
  display: flex;
958
958
  align-items: center;
959
959
  justify-content: space-between;
960
960
  width: 100%;
961
- `;var Fn=x.button`
961
+ `;var Bn=y.button`
962
962
  display: flex;
963
963
  align-items: center;
964
964
  gap: 4px;
@@ -984,27 +984,27 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
984
984
  outline: 2px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.primary}};
985
985
  outline-offset: 2px;
986
986
  }
987
- `;var ho=(e,t)=>e?gt(e,{maximumFractionDigits:t!=null?t:void 0}):0,Ea=(e,t=true,o=false)=>{let{currentBalance:n,displayName:i,units:r,symbol:a}=e,s=o&&a,l=r?n===1?r.singular:r.plural:null,c=l!=null?l:i;return [s,t?c:""].filter(Boolean).join(" ")},Fa=(e,t)=>t===0?0:Math.min(e/t*100,100);function Kc(e){return Xc(e).format("MMM D, YYYY h:mmA")}function qc(e){return Xc(e).format("MMM D, YYYY")}function ov(e){return Xc(e).fromNow()}function Yy(e){let{usagePeriodEnd:t,formatter:o}=e;return !t||t.getTime()<=Date.now()?null:`Resets ${o?o(t):ov(t)}.`}function Ra({usagePeriodEnd:e,formatResetPeriod:t,className:o}){let n=Yy({usagePeriodEnd:e,formatter:t});return n?jsx(C,{variant:"caption",color:"secondary",className:o,children:n}):null}var rv=x.div`
987
+ `;var mo=(e,t)=>e?ft(e,{maximumFractionDigits:t!=null?t:void 0}):0,Va=(e,t=true,o=false)=>{let{currentBalance:n,displayName:i,units:r,symbol:a}=e,s=o&&a,l=r?n===1?r.singular:r.plural:null,c=l!=null?l:i;return [s,t?c:""].filter(Boolean).join(" ")},$a=(e,t)=>t===0?0:Math.min(e/t*100,100);function ad(e){return rd(e).format("MMM D, YYYY h:mmA")}function sd(e){return rd(e).format("MMM D, YYYY")}function kv(e){return rd(e).fromNow()}function s1(e){let{usagePeriodEnd:t,formatter:o}=e;return !t||t.getTime()<=Date.now()?null:`Resets ${o?o(t):kv(t)}.`}function Ha({usagePeriodEnd:e,formatResetPeriod:t,className:o}){let n=s1({usagePeriodEnd:e,formatter:t});return n?jsx(P,{variant:"caption",color:"secondary",className:o,children:n}):null}var _v=y.div`
988
988
  display: flex;
989
989
  flex-direction: column;
990
990
  gap: 4px;
991
- `,av=x.div`
991
+ `,Av=y.div`
992
992
  display: flex;
993
993
  flex-direction: row;
994
994
  gap: 4px;
995
995
  align-items: baseline;
996
- `;function Xy({balance:e,isLoading:t,error:o,decimalPlaces:n=null,showUnits:i=true,showSymbol:r=false}){if(o)return jsx(C,{variant:"body1",color:"error",className:"stigg-credit-balance-value-error",children:o.message||"Failed to load balance"});if(t)return jsx(ro,{width:120,height:24,className:"stigg-credit-balance-value-loading"});if(e){let a=Ea(e,i,r);return jsxs(rv,{children:[jsxs(av,{children:[jsx(C,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-balance-value-amount",children:ho(e.currentBalance,n)}),jsx(C,{variant:"caption",color:"secondary",className:"stigg-credit-balance-value-suffix",children:a})]}),jsx(Ra,{usagePeriodEnd:e.usagePeriodEnd,className:"stigg-credit-balance-reset-period"})]})}return jsx(C,{variant:"body1",color:"disabled",className:"stigg-credit-balance-value-no-balance",children:"No balance data available"})}var Ky={title:"Credit balance",addCredits:"Add credits"},Da={title:"Credit utilization",remaining:"Remaining",addCredits:"Add credits"},qy={receivedAt:"Received",effectiveAt:"Effective At",grantType:"Grant Type",status:"State",balance:"Balance",expiryDate:"Expires",emptyState:"No credit grants found",loadingState:"Loading credit grants...",errorState:"Failed to load credit grants"},Qy={title:"Usage",totalSpend:"Total spend"},Jy={title:"Auto-recharge",activeLabel:"Active",manageButton:"Manage",descriptionTemplate:"Recharge to {{target}} {{unit}} when balance drops to {{threshold}}",emptyStateMessage:"Manage auto-recharge to avoid running out.",spendTemplate:"Spend: {{currency}}{{current}} / {{currency}}{{limit}} per month",unlimitedSpendLimit:"Unlimited spend."};var Na=x(da)`
996
+ `;function c1({balance:e,isLoading:t,error:o,decimalPlaces:n=null,showUnits:i=true,showSymbol:r=false}){if(o)return jsx(P,{variant:"body1",color:"error",className:"stigg-credit-balance-value-error",children:o.message||"Failed to load balance"});if(t)return jsx(ro,{width:120,height:24,className:"stigg-credit-balance-value-loading"});if(e){let a=Va(e,i,r);return jsxs(_v,{children:[jsxs(Av,{children:[jsx(P,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-balance-value-amount",children:mo(e.currentBalance,n)}),jsx(P,{variant:"caption",color:"secondary",className:"stigg-credit-balance-value-suffix",children:a})]}),jsx(Ha,{usagePeriodEnd:e.usagePeriodEnd,className:"stigg-credit-balance-reset-period"})]})}return jsx(P,{variant:"body1",color:"disabled",className:"stigg-credit-balance-value-no-balance",children:"No balance data available"})}var d1={title:"Credit balance",addCredits:"Add credits"},Wa={title:"Credit utilization",remaining:"Remaining",addCredits:"Add credits"},u1={receivedAt:"Received",effectiveAt:"Effective At",grantType:"Grant Type",status:"State",balance:"Balance",expiryDate:"Expires",emptyState:"No credit grants found",loadingState:"Loading credit grants...",errorState:"Failed to load credit grants"},p1={title:"Usage",totalSpend:"Total spend"},m1={title:"Auto-recharge",activeLabel:"Active",manageButton:"Manage",descriptionTemplate:"Recharge to {{target}} {{unit}} when balance drops to {{threshold}}",emptyStateMessage:"Manage auto-recharge to avoid running out.",spendTemplate:"Spend: {{currency}}{{current}} / {{currency}}{{limit}} per month",unlimitedSpendLimit:"Unlimited spend."};var Ga=y(xa)`
997
997
  width: 16px;
998
998
  height: 16px;
999
999
  path {
1000
1000
  stroke: ${({theme:e})=>{var t,o,n;return (n=(o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.text)==null?void 0:n.primary}};
1001
1001
  }
1002
- `;var sv=x.div`
1002
+ `;var Mv=y.div`
1003
1003
  display: flex;
1004
1004
  flex-direction: column;
1005
1005
  gap: 8px;
1006
1006
  width: 100%;
1007
- `,lv=x.div`
1007
+ `,Iv=y.div`
1008
1008
  display: flex;
1009
1009
  flex-direction: column;
1010
1010
  gap: 8px;
@@ -1012,12 +1012,12 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
1012
1012
  border-radius: 8px;
1013
1013
  border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
1014
1014
  background-color: ${({theme:e})=>{var t,o;return (o=(t=e==null?void 0:e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
1015
- `;function t1({currencyId:e,localization:t,decimalPlaces:o,showUnits:n=true,showSymbol:i=false,onAddCredits:r}){let a=jt(St),s=D({optional:true}),l=s==null?void 0:s.theme,{balance:c,isLoading:d,error:u}=po({currencyId:e}),{title:p,addCredits:m}=S(S({},Ky),t),h=jsx(sv,{className:"stigg-credit-balance-container",children:jsxs(lv,{className:"stigg-credit-balance-card",children:[jsxs(En,{children:[jsx(C,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:p}),r&&c&&!u&&jsxs(Fn,{type:"button",onClick:()=>r(c),className:"stigg-credit-balance-add-credits-button",children:[jsx(Na,{className:"stigg-credit-balance-add-credits-icon"}),m]})]}),jsx(Xy,{balance:c,isLoading:d,error:u,decimalPlaces:o,showUnits:n,showSymbol:i})]})});return a?h:jsx(ht,{componentTheme:l,children:h})}function he(){}var rd=(function(){let e=0;return function(){return e++}})();function W(e){return e===null||typeof e=="undefined"}function Z(e){if(Array.isArray&&Array.isArray(e))return true;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function z(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}var lt=e=>(typeof e=="number"||e instanceof Number)&&isFinite(+e);function Ut(e,t){return lt(e)?e:t}function U(e,t){return typeof e=="undefined"?t:e}var ad=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:e/t,Ga=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function X(e,t,o){if(e&&typeof e.call=="function")return e.apply(o,t)}function K(e,t,o,n){let i,r,a;if(Z(e))if(r=e.length,n);else for(i=0;i<r;i++)t.call(o,e[i],i);else if(z(e))for(a=Object.keys(e),r=a.length,i=0;i<r;i++)t.call(o,e[a[i]],a[i]);}function zn(e,t){let o,n,i,r;if(!e||!t||e.length!==t.length)return false;for(o=0,n=e.length;o<n;++o)if(i=e[o],r=t[o],i.datasetIndex!==r.datasetIndex||i.index!==r.index)return false;return true}function Ni(e){if(Z(e))return e.map(Ni);if(z(e)){let t=Object.create(null),o=Object.keys(e),n=o.length,i=0;for(;i<n;++i)t[o[i]]=Ni(e[o[i]]);return t}return e}function m1(e){return ["__proto__","prototype","constructor"].indexOf(e)===-1}function f1(e,t,o,n){if(!m1(e))return;let i=t[e],r=o[e];z(i)&&z(r)?Xt(i,r,n):t[e]=Ni(r);}function Xt(e,t,o){let n=Z(t)?t:[t],i=n.length;if(!z(e))return e;o=o||{};let r=o.merger||f1;for(let a=0;a<i;++a){if(t=n[a],!z(t))continue;let s=Object.keys(t);for(let l=0,c=s.length;l<c;++l)r(s[l],e,t,o);}return e}function Ko(e,t){return Xt(e,t,{merger:g1})}function g1(e,t,o){if(!m1(e))return;let n=t[e],i=o[e];z(n)&&z(i)?Ko(n,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ni(i));}var e1={"":e=>e,x:e=>e.x,y:e=>e.y};function Ae(e,t){return (e1[t]||(e1[t]=cv(t)))(e)}function cv(e){let t=y1(e);return o=>{for(let n of t){if(n==="")break;o=o&&o[n];}return o}}function y1(e){let t=e.split("."),o=[],n="";for(let i of t)n+=i,n.endsWith("\\")?n=n.slice(0,-1)+".":(o.push(n),n="");return o}function Ui(e){return e.charAt(0).toUpperCase()+e.slice(1)}var st=e=>typeof e!="undefined",Tt=e=>typeof e=="function",ja=(e,t)=>{if(e.size!==t.size)return false;for(let o of e)if(!t.has(o))return false;return true};function sd(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}var G=Math.PI,Q=2*G,x1=Q+G,Oi=Number.POSITIVE_INFINITY,zi=G/180,et=G/2,ie=G/4,Nn=G*2/3,zt=Math.log10,re=Math.sign;function Ya(e){let t=Math.round(e);e=qo(e,t,e/1e3)?t:e;let o=Math.pow(10,Math.floor(zt(e))),n=e/o;return (n<=1?1:n<=2?2:n<=5?5:10)*o}function ld(e){let t=[],o=Math.sqrt(e),n;for(n=1;n<o;n++)e%n===0&&(t.push(n),t.push(e/n));return o===(o|0)&&t.push(o),t.sort((i,r)=>i-r).pop(),t}function Kt(e){return !isNaN(parseFloat(e))&&isFinite(e)}function qo(e,t,o){return Math.abs(e-t)<o}function cd(e,t){let o=Math.round(e);return o-t<=e&&o+t>=e}function Za(e,t,o){let n,i,r;for(n=0,i=e.length;n<i;n++)r=e[n][o],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r));}function mt(e){return e*(G/180)}function Qo(e){return e*(180/G)}function Xa(e){if(!lt(e))return;let t=1,o=0;for(;Math.round(e*t)/t!==e;)t*=10,o++;return o}function Ka(e,t){let o=t.x-e.x,n=t.y-e.y,i=Math.sqrt(o*o+n*n),r=Math.atan2(n,o);return r<-0.5*G&&(r+=Q),{angle:r,distance:i}}function $e(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function b1(e,t){return (e-t+x1)%Q-G}function Bt(e){return (e%Q+Q)%Q}function Jo(e,t,o,n){let i=Bt(e),r=Bt(t),a=Bt(o),s=Bt(r-i),l=Bt(a-i),c=Bt(i-r),d=Bt(i-a);return i===r||i===a||n&&r===a||s>l&&c<d}function Ct(e,t,o){return Math.max(t,Math.min(o,e))}function dd(e){return Ct(e,-32768,32767)}function me(e,t,o,n=1e-6){return e>=Math.min(t,o)-n&&e<=Math.max(t,o)+n}function $i(e,t,o){o=o||(a=>e[a]<t);let n=e.length-1,i=0,r;for(;n-i>1;)r=i+n>>1,o(r)?i=r:n=r;return {lo:i,hi:n}}var ze=(e,t,o,n)=>$i(e,o,n?i=>e[i][t]<=o:i=>e[i][t]<o),ud=(e,t,o)=>$i(e,o,n=>e[n][t]>=o);function pd(e,t,o){let n=0,i=e.length;for(;n<i&&e[n]<t;)n++;for(;i>n&&e[i-1]>o;)i--;return n>0||i<e.length?e.slice(n,i):e}var C1=["push","pop","shift","splice","unshift"];function hd(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:true,enumerable:false,value:{listeners:[t]}}),C1.forEach(o=>{let n="_onData"+Ui(o),i=e[o];Object.defineProperty(e,o,{configurable:true,enumerable:false,value(...r){let a=i.apply(this,r);return e._chartjs.listeners.forEach(s=>{typeof s[n]=="function"&&s[n](...r);}),a}});});}function qa(e,t){let o=e._chartjs;if(!o)return;let n=o.listeners,i=n.indexOf(t);i!==-1&&n.splice(i,1),!(n.length>0)&&(C1.forEach(r=>{delete e[r];}),delete e._chartjs);}function Qa(e){let t=new Set,o,n;for(o=0,n=e.length;o<n;++o)t.add(e[o]);return t.size===n?e:Array.from(t)}var Ja=(function(){return typeof window=="undefined"?function(e){return e()}:window.requestAnimationFrame})();function ts(e,t,o){let n=o||(a=>Array.prototype.slice.call(a)),i=false,r=[];return function(...a){r=n(a),i||(i=true,Ja.call(window,()=>{i=false,e.apply(t,r);}));}}function md(e,t){let o;return function(...n){return t?(clearTimeout(o),o=setTimeout(e,t,n)):e.apply(this,n),t}}var Vi=e=>e==="start"?"left":e==="end"?"right":"center",Pt=(e,t,o)=>e==="start"?t:e==="end"?o:(t+o)/2,fd=(e,t,o,n)=>e===(n?"left":"right")?o:e==="center"?(t+o)/2:t;function es(e,t,o){let n=t.length,i=0,r=n;if(e._sorted){let{iScale:a,_parsed:s}=e,l=a.axis,{min:c,max:d,minDefined:u,maxDefined:p}=a.getUserBounds();u&&(i=Ct(Math.min(ze(s,a.axis,c).lo,o?n:ze(t,l,a.getPixelForValue(c)).lo),0,n-1)),p?r=Ct(Math.max(ze(s,a.axis,d,true).hi+1,o?0:ze(t,l,a.getPixelForValue(d),true).hi+1),i,n)-i:r=n-i;}return {start:i,count:r}}function os(e){let{xScale:t,yScale:o,_scaleRanges:n}=e,i={xmin:t.min,xmax:t.max,ymin:o.min,ymax:o.max};if(!n)return e._scaleRanges=i,true;let r=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==o.min||n.ymax!==o.max;return Object.assign(n,i),r}var Oa=e=>e===0||e===1,o1=(e,t,o)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Q/o)),n1=(e,t,o)=>Math.pow(2,-10*e)*Math.sin((e-t)*Q/o)+1,Yo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-0.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-0.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*et)+1,easeOutSine:e=>Math.sin(e*et),easeInOutSine:e=>-0.5*(Math.cos(G*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Oa(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-0.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Oa(e)?e:o1(e,.075,.3),easeOutElastic:e=>Oa(e)?e:n1(e,.075,.3),easeInOutElastic(e){return Oa(e)?e:e<.5?.5*o1(e*2,.1125,.45):.5+.5*n1(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return (e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return (e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Yo.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Yo.easeInBounce(e*2)*.5:Yo.easeOutBounce(e*2-1)*.5+.5};function Hi(e){return e+.5|0}var mo=(e,t,o)=>Math.max(Math.min(e,o),t);function Ri(e){return mo(Hi(e*2.55),0,255)}function fo(e){return mo(Hi(e*255),0,255)}function Oe(e){return mo(Hi(e/2.55)/100,0,1)}function i1(e){return mo(Hi(e*100),0,100)}var ne={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},od=[..."0123456789ABCDEF"],dv=e=>od[e&15],uv=e=>od[(e&240)>>4]+od[e&15],Ua=e=>(e&240)>>4===(e&15),pv=e=>Ua(e.r)&&Ua(e.g)&&Ua(e.b)&&Ua(e.a);function hv(e){var t=e.length,o;return e[0]==="#"&&(t===4||t===5?o={r:255&ne[e[1]]*17,g:255&ne[e[2]]*17,b:255&ne[e[3]]*17,a:t===5?ne[e[4]]*17:255}:(t===7||t===9)&&(o={r:ne[e[1]]<<4|ne[e[2]],g:ne[e[3]]<<4|ne[e[4]],b:ne[e[5]]<<4|ne[e[6]],a:t===9?ne[e[7]]<<4|ne[e[8]]:255})),o}var mv=(e,t)=>e<255?t(e):"";function fv(e){var t=pv(e)?dv:uv;return e?"#"+t(e.r)+t(e.g)+t(e.b)+mv(e.a,t):void 0}var gv=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function P1(e,t,o){let n=t*Math.min(o,1-o),i=(r,a=(r+e/30)%12)=>o-n*Math.max(Math.min(a-3,9-a,1),-1);return [i(0),i(8),i(4)]}function yv(e,t,o){let n=(i,r=(i+e/60)%6)=>o-o*t*Math.max(Math.min(r,4-r,1),0);return [n(5),n(3),n(1)]}function xv(e,t,o){let n=P1(e,1,.5),i;for(t+o>1&&(i=1/(t+o),t*=i,o*=i),i=0;i<3;i++)n[i]*=1-t-o,n[i]+=t;return n}function bv(e,t,o,n,i){return e===i?(t-o)/n+(t<o?6:0):t===i?(o-e)/n+2:(e-t)/n+4}function gd(e){let o=e.r/255,n=e.g/255,i=e.b/255,r=Math.max(o,n,i),a=Math.min(o,n,i),s=(r+a)/2,l,c,d;return r!==a&&(d=r-a,c=s>.5?d/(2-r-a):d/(r+a),l=bv(o,n,i,d,r),l=l*60+.5),[l|0,c||0,s]}function yd(e,t,o,n){return (Array.isArray(t)?e(t[0],t[1],t[2]):e(t,o,n)).map(fo)}function xd(e,t,o){return yd(P1,e,t,o)}function Cv(e,t,o){return yd(xv,e,t,o)}function Pv(e,t,o){return yd(yv,e,t,o)}function S1(e){return (e%360+360)%360}function Sv(e){let t=gv.exec(e),o=255,n;if(!t)return;t[5]!==n&&(o=t[6]?Ri(+t[5]):fo(+t[5]));let i=S1(+t[2]),r=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?n=Cv(i,r,a):t[1]==="hsv"?n=Pv(i,r,a):n=xd(i,r,a),{r:n[0],g:n[1],b:n[2],a:o}}function Tv(e,t){var o=gd(e);o[0]=S1(o[0]+t),o=xd(o),e.r=o[0],e.g=o[1],e.b=o[2];}function kv(e){if(!e)return;let t=gd(e),o=t[0],n=i1(t[1]),i=i1(t[2]);return e.a<255?`hsla(${o}, ${n}%, ${i}%, ${Oe(e.a)})`:`hsl(${o}, ${n}%, ${i}%)`}var r1={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},a1={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function wv(){let e={},t=Object.keys(a1),o=Object.keys(r1),n,i,r,a,s;for(n=0;n<t.length;n++){for(a=s=t[n],i=0;i<o.length;i++)r=o[i],s=s.replace(r,r1[r]);r=parseInt(a1[a],16),e[s]=[r>>16&255,r>>8&255,r&255];}return e}var za;function vv(e){za||(za=wv(),za.transparent=[0,0,0,0]);let t=za[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var _v=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Av(e){let t=_v.exec(e),o=255,n,i,r;if(t){if(t[7]!==n){let a=+t[7];o=t[8]?Ri(a):mo(a*255,0,255);}return n=+t[1],i=+t[3],r=+t[5],n=255&(t[2]?Ri(n):mo(n,0,255)),i=255&(t[4]?Ri(i):mo(i,0,255)),r=255&(t[6]?Ri(r):mo(r,0,255)),{r:n,g:i,b:r,a:o}}}function Mv(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Oe(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var Jc=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Dn=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Iv(e,t,o){let n=Dn(Oe(e.r)),i=Dn(Oe(e.g)),r=Dn(Oe(e.b));return {r:fo(Jc(n+o*(Dn(Oe(t.r))-n))),g:fo(Jc(i+o*(Dn(Oe(t.g))-i))),b:fo(Jc(r+o*(Dn(Oe(t.b))-r))),a:e.a+o*(t.a-e.a)}}function $a(e,t,o){if(e){let n=gd(e);n[t]=Math.max(0,Math.min(n[t]+n[t]*o,t===0?360:1)),n=xd(n),e.r=n[0],e.g=n[1],e.b=n[2];}}function T1(e,t){return e&&Object.assign(t||{},e)}function s1(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=fo(e[3]))):(t=T1(e,{r:0,g:0,b:0,a:1}),t.a=fo(t.a)),t}function Lv(e){return e.charAt(0)==="r"?Av(e):Sv(e)}var nd=class e{constructor(t){if(t instanceof e)return t;let o=typeof t,n;o==="object"?n=s1(t):o==="string"&&(n=hv(t)||vv(t)||Lv(t)),this._rgb=n,this._valid=!!n;}get valid(){return this._valid}get rgb(){var t=T1(this._rgb);return t&&(t.a=Oe(t.a)),t}set rgb(t){this._rgb=s1(t);}rgbString(){return this._valid?Mv(this._rgb):void 0}hexString(){return this._valid?fv(this._rgb):void 0}hslString(){return this._valid?kv(this._rgb):void 0}mix(t,o){if(t){let n=this.rgb,i=t.rgb,r,a=o===r?.5:o,s=2*a-1,l=n.a-i.a,c=((s*l===-1?s:(s+l)/(1+s*l))+1)/2;r=1-c,n.r=255&c*n.r+r*i.r+.5,n.g=255&c*n.g+r*i.g+.5,n.b=255&c*n.b+r*i.b+.5,n.a=a*n.a+(1-a)*i.a,this.rgb=n;}return this}interpolate(t,o){return t&&(this._rgb=Iv(this._rgb,t._rgb,o)),this}clone(){return new e(this.rgb)}alpha(t){return this._rgb.a=fo(t),this}clearer(t){let o=this._rgb;return o.a*=1-t,this}greyscale(){let t=this._rgb,o=Hi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=o,this}opaquer(t){let o=this._rgb;return o.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return $a(this._rgb,2,t),this}darken(t){return $a(this._rgb,2,-t),this}saturate(t){return $a(this._rgb,1,t),this}desaturate(t){return $a(this._rgb,1,-t),this}rotate(t){return Tv(this._rgb,t),this}};function k1(e){return new nd(e)}function bd(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return false}function tn(e){return bd(e)?e:k1(e)}function Ha(e){return bd(e)?e:k1(e).saturate(.5).darken(.1).hexString()}var yo=Object.create(null),ns=Object.create(null);function Di(e,t){if(!t)return e;let o=t.split(".");for(let n=0,i=o.length;n<i;++n){let r=o[n];e=e[r]||(e[r]=Object.create(null));}return e}function td(e,t,o){return typeof t=="string"?Xt(Di(e,t),o):Xt(Di(e,""),t)}var id=class{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=o=>o.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(o,n)=>Ha(n.backgroundColor),this.hoverBorderColor=(o,n)=>Ha(n.borderColor),this.hoverColor=(o,n)=>Ha(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:true,includeInvisible:false},this.maintainAspectRatio=true,this.onHover=null,this.onClick=null,this.parsing=true,this.plugins={},this.responsive=true,this.scale=void 0,this.scales={},this.showLine=true,this.drawActiveElementsOnTop=true,this.describe(t);}set(t,o){return td(this,t,o)}get(t){return Di(this,t)}describe(t,o){return td(ns,t,o)}override(t,o){return td(yo,t,o)}route(t,o,n,i){let r=Di(this,t),a=Di(this,n),s="_"+o;Object.defineProperties(r,{[s]:{value:r[o],writable:true},[o]:{enumerable:true,get(){let l=this[s],c=a[i];return z(l)?Object.assign({},c,l):U(l,c)},set(l){this[s]=l;}}});}},H=new id({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:false,_indexable:false}});function w1(e){return !e||W(e.size)||W(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function On(e,t,o,n,i){let r=t[i];return r||(r=t[i]=e.measureText(i).width,o.push(i)),r>n&&(n=r),n}function Cd(e,t,o,n){n=n||{};let i=n.data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(i=n.data={},r=n.garbageCollect=[],n.font=t),e.save(),e.font=t;let a=0,s=o.length,l,c,d,u,p;for(l=0;l<s;l++)if(u=o[l],u!=null&&Z(u)!==true)a=On(e,i,r,a,u);else if(Z(u))for(c=0,d=u.length;c<d;c++)p=u[c],p!=null&&!Z(p)&&(a=On(e,i,r,a,p));e.restore();let m=r.length/2;if(m>o.length){for(l=0;l<m;l++)delete i[r[l]];r.splice(0,m);}return a}function Ve(e,t,o){let n=e.currentDevicePixelRatio,i=o!==0?Math.max(o/2,.5):0;return Math.round((t-i)*n)/n+i}function is(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore();}function Wi(e,t,o,n){rs(e,t,o,n,null);}function rs(e,t,o,n,i){let r,a,s,l,c,d,u=t.pointStyle,p=t.rotation,m=t.radius,h=(p||0)*zi;if(u&&typeof u=="object"&&(r=u.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){e.save(),e.translate(o,n),e.rotate(h),e.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),u){default:i?e.ellipse(o,n,i/2,m,0,0,Q):e.arc(o,n,m,0,Q),e.closePath();break;case "triangle":e.moveTo(o+Math.sin(h)*m,n-Math.cos(h)*m),h+=Nn,e.lineTo(o+Math.sin(h)*m,n-Math.cos(h)*m),h+=Nn,e.lineTo(o+Math.sin(h)*m,n-Math.cos(h)*m),e.closePath();break;case "rectRounded":c=m*.516,l=m-c,a=Math.cos(h+ie)*l,s=Math.sin(h+ie)*l,e.arc(o-a,n-s,c,h-G,h-et),e.arc(o+s,n-a,c,h-et,h),e.arc(o+a,n+s,c,h,h+et),e.arc(o-s,n+a,c,h+et,h+G),e.closePath();break;case "rect":if(!p){l=Math.SQRT1_2*m,d=i?i/2:l,e.rect(o-d,n-l,2*d,2*l);break}h+=ie;case "rectRot":a=Math.cos(h)*m,s=Math.sin(h)*m,e.moveTo(o-a,n-s),e.lineTo(o+s,n-a),e.lineTo(o+a,n+s),e.lineTo(o-s,n+a),e.closePath();break;case "crossRot":h+=ie;case "cross":a=Math.cos(h)*m,s=Math.sin(h)*m,e.moveTo(o-a,n-s),e.lineTo(o+a,n+s),e.moveTo(o+s,n-a),e.lineTo(o-s,n+a);break;case "star":a=Math.cos(h)*m,s=Math.sin(h)*m,e.moveTo(o-a,n-s),e.lineTo(o+a,n+s),e.moveTo(o+s,n-a),e.lineTo(o-s,n+a),h+=ie,a=Math.cos(h)*m,s=Math.sin(h)*m,e.moveTo(o-a,n-s),e.lineTo(o+a,n+s),e.moveTo(o+s,n-a),e.lineTo(o-s,n+a);break;case "line":a=i?i/2:Math.cos(h)*m,s=Math.sin(h)*m,e.moveTo(o-a,n-s),e.lineTo(o+a,n+s);break;case "dash":e.moveTo(o,n),e.lineTo(o+Math.cos(h)*m,n+Math.sin(h)*m);break}e.fill(),t.borderWidth>0&&e.stroke();}}function Xo(e,t,o){return o=o||.5,!t||e&&e.x>t.left-o&&e.x<t.right+o&&e.y>t.top-o&&e.y<t.bottom+o}function xo(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip();}function bo(e){e.restore();}function Pd(e,t,o,n,i){if(!t)return e.lineTo(o.x,o.y);if(i==="middle"){let r=(t.x+o.x)/2;e.lineTo(r,t.y),e.lineTo(r,o.y);}else i==="after"!=!!n?e.lineTo(t.x,o.y):e.lineTo(o.x,t.y);e.lineTo(o.x,o.y);}function Sd(e,t,o,n){if(!t)return e.lineTo(o.x,o.y);e.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?o.cp2x:o.cp1x,n?o.cp2y:o.cp1y,o.x,o.y);}function He(e,t,o,n,i,r={}){let a=Z(t)?t:[t],s=r.strokeWidth>0&&r.strokeColor!=="",l,c;for(e.save(),e.font=i.string,Bv(e,r),l=0;l<a.length;++l)c=a[l],s&&(r.strokeColor&&(e.strokeStyle=r.strokeColor),W(r.strokeWidth)||(e.lineWidth=r.strokeWidth),e.strokeText(c,o,n,r.maxWidth)),e.fillText(c,o,n,r.maxWidth),Ev(e,o,n,c,r),n+=i.lineHeight;e.restore();}function Bv(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),W(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline);}function Ev(e,t,o,n,i){if(i.strikethrough||i.underline){let r=e.measureText(n),a=t-r.actualBoundingBoxLeft,s=t+r.actualBoundingBoxRight,l=o-r.actualBoundingBoxAscent,c=o+r.actualBoundingBoxDescent,d=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(a,d),e.lineTo(s,d),e.stroke();}}function We(e,t){let{x:o,y:n,w:i,h:r,radius:a}=t;e.arc(o+a.topLeft,n+a.topLeft,a.topLeft,-et,G,true),e.lineTo(o,n+r-a.bottomLeft),e.arc(o+a.bottomLeft,n+r-a.bottomLeft,a.bottomLeft,G,et,true),e.lineTo(o+i-a.bottomRight,n+r),e.arc(o+i-a.bottomRight,n+r-a.bottomRight,a.bottomRight,et,0,true),e.lineTo(o+i,n+a.topRight),e.arc(o+i-a.topRight,n+a.topRight,a.topRight,0,-et,true),e.lineTo(o+a.topLeft,n);}var Fv=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Rv=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function v1(e,t){let o=(""+e).match(Fv);if(!o||o[1]==="normal")return t*1.2;switch(e=+o[2],o[3]){case "px":return e;case "%":e/=100;break}return t*e}var Dv=e=>+e||0;function Gi(e,t){let o={},n=z(t),i=n?Object.keys(t):t,r=z(e)?n?a=>U(e[a],e[t[a]]):a=>e[a]:()=>e;for(let a of i)o[a]=Dv(r(a));return o}function as(e){return Gi(e,{top:"y",right:"x",bottom:"y",left:"x"})}function fe(e){return Gi(e,["topLeft","topRight","bottomLeft","bottomRight"])}function ut(e){let t=as(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function it(e,t){e=e||{},t=t||H.font;let o=U(e.size,t.size);typeof o=="string"&&(o=parseInt(o,10));let n=U(e.style,t.style);n&&!(""+n).match(Rv)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");let i={family:U(e.family,t.family),lineHeight:v1(U(e.lineHeight,t.lineHeight),o),size:o,style:n,weight:U(e.weight,t.weight),string:""};return i.string=w1(i),i}function rt(e,t,o,n){let r,a,s;for(r=0,a=e.length;r<a;++r)if(s=e[r],s!==void 0&&(t!==void 0&&typeof s=="function"&&(s=s(t),false),o!==void 0&&Z(s)&&(s=s[o%s.length],false),s!==void 0))return s}function Td(e,t,o){let{min:n,max:i}=e,r=Ga(t,(i-n)/2),a=(s,l)=>o&&s===0?0:s+l;return {min:a(n,-Math.abs(r)),max:a(i,r)}}function Me(e,t){return Object.assign(Object.create(e),t)}function ji(e,t=[""],o=e,n,i=()=>e[0]){st(n)||(n=M1("_fallback",e));let r={[Symbol.toStringTag]:"Object",_cacheable:true,_scopes:e,_rootScopes:o,_fallback:n,_getTarget:i,override:a=>ji([a,...e],t,o,n)};return new Proxy(r,{deleteProperty(a,s){return delete a[s],delete a._keys,delete e[0][s],true},get(a,s){return _1(a,s,()=>Wv(s,t,e,a))},getOwnPropertyDescriptor(a,s){return Reflect.getOwnPropertyDescriptor(a._scopes[0],s)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,s){return c1(a).includes(s)},ownKeys(a){return c1(a)},set(a,s,l){let c=a._storage||(a._storage=i());return a[s]=c[s]=l,delete a._keys,true}})}function go(e,t,o,n){let i={_cacheable:false,_proxy:e,_context:t,_subProxy:o,_stack:new Set,_descriptors:ss(e,n),setContext:r=>go(e,r,o,n),override:r=>go(e.override(r),t,o,n)};return new Proxy(i,{deleteProperty(r,a){return delete r[a],delete e[a],true},get(r,a,s){return _1(r,a,()=>Ov(r,a,s))},getOwnPropertyDescriptor(r,a){return r._descriptors.allKeys?Reflect.has(e,a)?{enumerable:true,configurable:true}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(r,a,s){return e[a]=s,delete r[a],true}})}function ss(e,t={scriptable:true,indexable:true}){let{_scriptable:o=t.scriptable,_indexable:n=t.indexable,_allKeys:i=t.allKeys}=e;return {allKeys:i,scriptable:o,indexable:n,isScriptable:Tt(o)?o:()=>o,isIndexable:Tt(n)?n:()=>n}}var Nv=(e,t)=>e?e+Ui(t):t,kd=(e,t)=>z(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function _1(e,t,o){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=o();return e[t]=n,n}function Ov(e,t,o){let{_proxy:n,_context:i,_subProxy:r,_descriptors:a}=e,s=n[t];return Tt(s)&&a.isScriptable(t)&&(s=Uv(t,s,e,o)),Z(s)&&s.length&&(s=zv(t,s,e,a.isIndexable)),kd(t,s)&&(s=go(s,i,r&&r[t],a)),s}function Uv(e,t,o,n){let{_proxy:i,_context:r,_subProxy:a,_stack:s}=o;if(s.has(e))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+e);return s.add(e),t=t(r,a||n),s.delete(e),kd(e,t)&&(t=wd(i._scopes,i,e,t)),t}function zv(e,t,o,n){let{_proxy:i,_context:r,_subProxy:a,_descriptors:s}=o;if(st(r.index)&&n(e))t=t[r.index%t.length];else if(z(t[0])){let l=t,c=i._scopes.filter(d=>d!==l);t=[];for(let d of l){let u=wd(c,i,e,d);t.push(go(u,r,a&&a[e],s));}}return t}function A1(e,t,o){return Tt(e)?e(t,o):e}var $v=(e,t)=>e===true?t:typeof e=="string"?Ae(t,e):void 0;function Vv(e,t,o,n,i){for(let r of t){let a=$v(o,r);if(a){e.add(a);let s=A1(a._fallback,o,i);if(st(s)&&s!==o&&s!==n)return s}else if(a===false&&st(n)&&o!==n)return null}return false}function wd(e,t,o,n){let i=t._rootScopes,r=A1(t._fallback,o,n),a=[...e,...i],s=new Set;s.add(n);let l=l1(s,a,o,r||o,n);return l===null||st(r)&&r!==o&&(l=l1(s,a,r,l,n),l===null)?false:ji(Array.from(s),[""],i,r,()=>Hv(t,o,n))}function l1(e,t,o,n,i){for(;o;)o=Vv(e,t,o,n,i);return o}function Hv(e,t,o){let n=e._getTarget();t in n||(n[t]={});let i=n[t];return Z(i)&&z(o)?o:i}function Wv(e,t,o,n){let i;for(let r of t)if(i=M1(Nv(r,e),o),st(i))return kd(e,i)?wd(o,n,e,i):i}function M1(e,t){for(let o of t){if(!o)continue;let n=o[e];if(st(n))return n}}function c1(e){let t=e._keys;return t||(t=e._keys=Gv(e._scopes)),t}function Gv(e){let t=new Set;for(let o of e)for(let n of Object.keys(o).filter(i=>!i.startsWith("_")))t.add(n);return Array.from(t)}function ls(e,t,o,n){let{iScale:i}=e,{key:r="r"}=this._parsing,a=new Array(n),s,l,c,d;for(s=0,l=n;s<l;++s)c=s+o,d=t[c],a[s]={r:i.parse(Ae(d,r),c)};return a}var jv=Number.EPSILON||1e-14,Un=(e,t)=>t<e.length&&!e[t].skip&&e[t],I1=e=>e==="x"?"y":"x";function L1(e,t,o,n){let i=e.skip?t:e,r=t,a=o.skip?t:o,s=$e(r,i),l=$e(a,r),c=s/(s+l),d=l/(s+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;let u=n*c,p=n*d;return {previous:{x:r.x-u*(a.x-i.x),y:r.y-u*(a.y-i.y)},next:{x:r.x+p*(a.x-i.x),y:r.y+p*(a.y-i.y)}}}function Yv(e,t,o){let n=e.length,i,r,a,s,l,c=Un(e,0);for(let d=0;d<n-1;++d)if(l=c,c=Un(e,d+1),!(!l||!c)){if(qo(t[d],0,jv)){o[d]=o[d+1]=0;continue}i=o[d]/t[d],r=o[d+1]/t[d],s=Math.pow(i,2)+Math.pow(r,2),!(s<=9)&&(a=3/Math.sqrt(s),o[d]=i*a*t[d],o[d+1]=r*a*t[d]);}}function Zv(e,t,o="x"){let n=I1(o),i=e.length,r,a,s,l=Un(e,0);for(let c=0;c<i;++c){if(a=s,s=l,l=Un(e,c+1),!s)continue;let d=s[o],u=s[n];a&&(r=(d-a[o])/3,s[`cp1${o}`]=d-r,s[`cp1${n}`]=u-r*t[c]),l&&(r=(l[o]-d)/3,s[`cp2${o}`]=d+r,s[`cp2${n}`]=u+r*t[c]);}}function B1(e,t="x"){let o=I1(t),n=e.length,i=Array(n).fill(0),r=Array(n),a,s,l,c=Un(e,0);for(a=0;a<n;++a)if(s=l,l=c,c=Un(e,a+1),!!l){if(c){let d=c[t]-l[t];i[a]=d!==0?(c[o]-l[o])/d:0;}r[a]=s?c?re(i[a-1])!==re(i[a])?0:(i[a-1]+i[a])/2:i[a-1]:i[a];}Yv(e,i,r),Zv(e,r,t);}function Va(e,t,o){return Math.max(Math.min(e,o),t)}function Xv(e,t){let o,n,i,r,a,s=Xo(e[0],t);for(o=0,n=e.length;o<n;++o)a=r,r=s,s=o<n-1&&Xo(e[o+1],t),r&&(i=e[o],a&&(i.cp1x=Va(i.cp1x,t.left,t.right),i.cp1y=Va(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=Va(i.cp2x,t.left,t.right),i.cp2y=Va(i.cp2y,t.top,t.bottom)));}function vd(e,t,o,n,i){let r,a,s,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")B1(e,i);else {let c=n?e[e.length-1]:e[0];for(r=0,a=e.length;r<a;++r)s=e[r],l=L1(c,s,e[Math.min(r+1,a-(n?0:1))%a],t.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,c=s;}t.capBezierPoints&&Xv(e,o);}function cs(){return typeof window!="undefined"&&typeof document!="undefined"}function Yi(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Wa(e,t,o){let n;return typeof e=="string"?(n=parseInt(e,10),e.indexOf("%")!==-1&&(n=n/100*t.parentNode[o])):n=e,n}var ds=e=>window.getComputedStyle(e,null);function E1(e,t){return ds(e).getPropertyValue(t)}var Kv=["top","right","bottom","left"];function Zo(e,t,o){let n={};o=o?"-"+o:"";for(let i=0;i<4;i++){let r=Kv[i];n[r]=parseFloat(e[t+"-"+r+o])||0;}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}var qv=(e,t,o)=>(e>0||t>0)&&(!o||!o.shadowRoot);function Qv(e,t){let o=e.touches,n=o&&o.length?o[0]:e,{offsetX:i,offsetY:r}=n,a=false,s,l;if(qv(i,r,e.target))s=i,l=r;else {let c=t.getBoundingClientRect();s=n.clientX-c.left,l=n.clientY-c.top,a=true;}return {x:s,y:l,box:a}}function Ge(e,t){if("native"in e)return e;let{canvas:o,currentDevicePixelRatio:n}=t,i=ds(o),r=i.boxSizing==="border-box",a=Zo(i,"padding"),s=Zo(i,"border","width"),{x:l,y:c,box:d}=Qv(e,o),u=a.left+(d&&s.left),p=a.top+(d&&s.top),{width:m,height:h}=t;return r&&(m-=a.width+s.width,h-=a.height+s.height),{x:Math.round((l-u)/m*o.width/n),y:Math.round((c-p)/h*o.height/n)}}function Jv(e,t,o){let n,i;if(t===void 0||o===void 0){let r=Yi(e);if(!r)t=e.clientWidth,o=e.clientHeight;else {let a=r.getBoundingClientRect(),s=ds(r),l=Zo(s,"border","width"),c=Zo(s,"padding");t=a.width-c.width-l.width,o=a.height-c.height-l.height,n=Wa(s.maxWidth,r,"clientWidth"),i=Wa(s.maxHeight,r,"clientHeight");}}return {width:t,height:o,maxWidth:n||Oi,maxHeight:i||Oi}}var ed=e=>Math.round(e*10)/10;function _d(e,t,o,n){let i=ds(e),r=Zo(i,"margin"),a=Wa(i.maxWidth,e,"clientWidth")||Oi,s=Wa(i.maxHeight,e,"clientHeight")||Oi,l=Jv(e,t,o),{width:c,height:d}=l;if(i.boxSizing==="content-box"){let u=Zo(i,"border","width"),p=Zo(i,"padding");c-=p.width+u.width,d-=p.height+u.height;}return c=Math.max(0,c-r.width),d=Math.max(0,n?Math.floor(c/n):d-r.height),c=ed(Math.min(c,a,l.maxWidth)),d=ed(Math.min(d,s,l.maxHeight)),c&&!d&&(d=ed(c/2)),{width:c,height:d}}function us(e,t,o){let n=t||1,i=Math.floor(e.height*n),r=Math.floor(e.width*n);e.height=i/n,e.width=r/n;let a=e.canvas;return a.style&&(o||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==n||a.height!==i||a.width!==r?(e.currentDevicePixelRatio=n,a.height=i,a.width=r,e.ctx.setTransform(n,0,0,n,0,0),true):false}var Ad=(function(){let e=false;try{let t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t);}catch(t){}return e})();function ps(e,t){let o=E1(e,t),n=o&&o.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Ue(e,t,o,n){return {x:e.x+o*(t.x-e.x),y:e.y+o*(t.y-e.y)}}function Md(e,t,o,n){return {x:e.x+o*(t.x-e.x),y:n==="middle"?o<.5?e.y:t.y:n==="after"?o<1?e.y:t.y:o>0?t.y:e.y}}function Id(e,t,o,n){let i={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},a=Ue(e,i,o),s=Ue(i,r,o),l=Ue(r,t,o),c=Ue(a,s,o),d=Ue(s,l,o);return Ue(c,d,o)}var d1=new Map;function t6(e,t){t=t||{};let o=e+JSON.stringify(t),n=d1.get(o);return n||(n=new Intl.NumberFormat(e,t),d1.set(o,n)),n}function en(e,t,o){return t6(t,o).format(e)}var e6=function(e,t){return {x(o){return e+e+t-o},setWidth(o){t=o;},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,n){return o-n},leftForLtr(o,n){return o-n}}},o6=function(){return {x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Co(e,t,o){return e?e6(t,o):o6()}function hs(e,t){let o,n;(t==="ltr"||t==="rtl")&&(o=e.canvas.style,n=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",t,"important"),e.prevTextDirection=n);}function ms(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]));}function F1(e){return e==="angle"?{between:Jo,compare:b1,normalize:Bt}:{between:me,compare:(t,o)=>t-o,normalize:t=>t}}function u1({start:e,end:t,count:o,loop:n,style:i}){return {start:e%o,end:t%o,loop:n&&(t-e+1)%o===0,style:i}}function n6(e,t,o){let{property:n,start:i,end:r}=o,{between:a,normalize:s}=F1(n),l=t.length,{start:c,end:d,loop:u}=e,p,m;if(u){for(c+=l,d+=l,p=0,m=l;p<m&&a(s(t[c%l][n]),i,r);++p)c--,d--;c%=l,d%=l;}return d<c&&(d+=l),{start:c,end:d,loop:u,style:e.style}}function fs(e,t,o){if(!o)return [e];let{property:n,start:i,end:r}=o,a=t.length,{compare:s,between:l,normalize:c}=F1(n),{start:d,end:u,loop:p,style:m}=n6(e,t,o),h=[],f=false,g=null,y,P,T,k=()=>l(i,T,y)&&s(i,T)!==0,w=()=>s(r,y)===0||l(r,T,y),v=()=>f||k(),A=()=>!f||w();for(let M=d,I=d;M<=u;++M)P=t[M%a],!P.skip&&(y=c(P[n]),y!==T&&(f=l(y,i,r),g===null&&v()&&(g=s(y,i)===0?M:I),g!==null&&A()&&(h.push(u1({start:g,end:M,loop:p,count:a,style:m})),g=null),I=M,T=y));return g!==null&&h.push(u1({start:g,end:u,loop:p,count:a,style:m})),h}function gs(e,t){let o=[],n=e.segments;for(let i=0;i<n.length;i++){let r=fs(n[i],e.points,t);r.length&&o.push(...r);}return o}function i6(e,t,o,n){let i=0,r=t-1;if(o&&!n)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,o&&(r+=i);r>i&&e[r%t].skip;)r--;return r%=t,{start:i,end:r}}function r6(e,t,o,n){let i=e.length,r=[],a=t,s=e[t],l;for(l=t+1;l<=o;++l){let c=e[l%i];c.skip||c.stop?s.skip||(n=false,r.push({start:t%i,end:(l-1)%i,loop:n}),t=a=c.stop?l:null):(a=l,s.skip&&(t=l)),s=c;}return a!==null&&r.push({start:t%i,end:a%i,loop:n}),r}function Ld(e,t){let o=e.points,n=e.options.spanGaps,i=o.length;if(!i)return [];let r=!!e._loop,{start:a,end:s}=i6(o,i,r,n);if(n===true)return p1(e,[{start:a,end:s,loop:r}],o,t);let l=s<a?s+i:s,c=!!e._fullLoop&&a===0&&s===i-1;return p1(e,r6(o,a,l,c),o,t)}function p1(e,t,o,n){return !n||!n.setContext||!o?t:a6(e,t,o,n)}function a6(e,t,o,n){let i=e._chart.getContext(),r=h1(e.options),{_datasetIndex:a,options:{spanGaps:s}}=e,l=o.length,c=[],d=r,u=t[0].start,p=u;function m(h,f,g,y){let P=s?-1:1;if(h!==f){for(h+=l;o[h%l].skip;)h-=P;for(;o[f%l].skip;)f+=P;h%l!==f%l&&(c.push({start:h%l,end:f%l,loop:g,style:y}),d=y,u=f%l);}}for(let h of t){u=s?u:h.start;let f=o[u%l],g;for(p=u+1;p<=h.end;p++){let y=o[p%l];g=h1(n.setContext(Me(i,{type:"segment",p0:f,p1:y,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:a}))),s6(g,d)&&m(u,p-1,h.loop,d),f=y,d=g;}u<p-1&&m(u,p-1,h.loop,d);}return c}function h1(e){return {backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function s6(e,t){return t&&JSON.stringify(e)!==JSON.stringify(t)}var $d=class{constructor(){this._request=null,this._charts=new Map,this._running=false,this._lastDate=void 0;}_notify(t,o,n,i){let r=o.listeners[i],a=o.duration;r.forEach(s=>s({chart:t,initial:o.initial,numSteps:a,currentStep:Math.min(n-o.start,a)}));}_refresh(){this._request||(this._running=true,this._request=Ja.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh();}));}_update(t=Date.now()){let o=0;this._charts.forEach((n,i)=>{if(!n.running||!n.items.length)return;let r=n.items,a=r.length-1,s=false,l;for(;a>=0;--a)l=r[a],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),s=true):(r[a]=r[r.length-1],r.pop());s&&(i.draw(),this._notify(i,n,t,"progress")),r.length||(n.running=false,this._notify(i,n,t,"complete"),n.initial=false),o+=r.length;}),this._lastDate=t,o===0&&(this._running=false);}_getAnims(t){let o=this._charts,n=o.get(t);return n||(n={running:false,initial:true,items:[],listeners:{complete:[],progress:[]}},o.set(t,n)),n}listen(t,o,n){this._getAnims(t).listeners[o].push(n);}add(t,o){!o||!o.length||this._getAnims(t).items.push(...o);}has(t){return this._getAnims(t).items.length>0}start(t){let o=this._charts.get(t);o&&(o.running=true,o.start=Date.now(),o.duration=o.items.reduce((n,i)=>Math.max(n,i._duration),0),this._refresh());}running(t){if(!this._running)return false;let o=this._charts.get(t);return !(!o||!o.running||!o.items.length)}stop(t){let o=this._charts.get(t);if(!o||!o.items.length)return;let n=o.items,i=n.length-1;for(;i>=0;--i)n[i].cancel();o.items=[],this._notify(t,o,Date.now(),"complete");}remove(t){return this._charts.delete(t)}},je=new $d,R1="transparent",l6={boolean(e,t,o){return o>.5?t:e},color(e,t,o){let n=tn(e||R1),i=n.valid&&tn(t||R1);return i&&i.valid?i.mix(n,o).hexString():t},number(e,t,o){return e+(t-e)*o}},Vd=class{constructor(t,o,n,i){let r=o[n];i=rt([t.to,i,r,t.from]);let a=rt([t.from,r,i]);this._active=true,this._fn=t.fn||l6[t.type||typeof a],this._easing=Yo[t.easing]||Yo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=o,this._prop=n,this._from=a,this._to=i,this._promises=void 0;}active(){return this._active}update(t,o,n){if(this._active){this._notify(false);let i=this._target[this._prop],r=n-this._start,a=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=rt([t.to,o,i,t.from]),this._from=rt([t.from,i,o]);}}cancel(){this._active&&(this.tick(Date.now()),this._active=false,this._notify(false));}tick(t){let o=t-this._start,n=this._duration,i=this._prop,r=this._from,a=this._loop,s=this._to,l;if(this._active=r!==s&&(a||o<n),!this._active){this._target[i]=s,this._notify(true);return}if(o<0){this._target[i]=r;return}l=o/n%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(r,s,l);}wait(){let t=this._promises||(this._promises=[]);return new Promise((o,n)=>{t.push({res:o,rej:n});})}_notify(t){let o=t?"res":"rej",n=this._promises||[];for(let i=0;i<n.length;i++)n[i][o]();}},c6=["x","y","borderWidth","radius","tension"],d6=["color","borderColor","backgroundColor"];H.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});var u6=Object.keys(H.animation);H.describe("animation",{_fallback:false,_indexable:false,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"});H.set("animations",{colors:{type:"color",properties:d6},numbers:{type:"number",properties:c6}});H.describe("animations",{_fallback:"animation"});H.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}});var Hn=class{constructor(t,o){this._chart=t,this._properties=new Map,this.configure(o);}configure(t){if(!z(t))return;let o=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{let i=t[n];if(!z(i))return;let r={};for(let a of u6)r[a]=i[a];(Z(i.properties)&&i.properties||[n]).forEach(a=>{(a===n||!o.has(a))&&o.set(a,r);});});}_animateOptions(t,o){let n=o.options,i=h6(t,n);if(!i)return [];let r=this._createAnimations(i,n);return n.$shared&&p6(t.options.$animations,n).then(()=>{t.options=n;},()=>{}),r}_createAnimations(t,o){let n=this._properties,i=[],r=t.$animations||(t.$animations={}),a=Object.keys(o),s=Date.now(),l;for(l=a.length-1;l>=0;--l){let c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,o));continue}let d=o[c],u=r[c],p=n.get(c);if(u)if(p&&u.active()){u.update(p,d,s);continue}else u.cancel();if(!p||!p.duration){t[c]=d;continue}r[c]=u=new Vd(p,t,c,d),i.push(u);}return i}update(t,o){if(this._properties.size===0){Object.assign(t,o);return}let n=this._createAnimations(t,o);if(n.length)return je.add(this._chart,n),true}};function p6(e,t){let o=[],n=Object.keys(t);for(let i=0;i<n.length;i++){let r=e[n[i]];r&&r.active()&&o.push(r.wait());}return Promise.all(o)}function h6(e,t){if(!t)return;let o=e.options;if(!o){e.options=t;return}return o.$shared&&(e.options=o=Object.assign({},o,{$shared:false,$animations:{}})),o}function D1(e,t){let o=e&&e.options||{},n=o.reverse,i=o.min===void 0?t:0,r=o.max===void 0?t:0;return {start:n?r:i,end:n?i:r}}function m6(e,t,o){if(o===false)return false;let n=D1(e,o),i=D1(t,o);return {top:i.end,right:n.end,bottom:i.start,left:n.start}}function f6(e){let t,o,n,i;return z(e)?(t=e.top,o=e.right,n=e.bottom,i=e.left):t=o=n=i=e,{top:t,right:o,bottom:n,left:i,disabled:e===false}}function w0(e,t){let o=[],n=e._getSortedDatasetMetas(t),i,r;for(i=0,r=n.length;i<r;++i)o.push(n[i].index);return o}function N1(e,t,o,n={}){let i=e.keys,r=n.mode==="single",a,s,l,c;if(t!==null){for(a=0,s=i.length;a<s;++a){if(l=+i[a],l===o){if(n.all)continue;break}c=e.values[l],lt(c)&&(r||t===0||re(t)===re(c))&&(t+=c);}return t}}function g6(e){let t=Object.keys(e),o=new Array(t.length),n,i,r;for(n=0,i=t.length;n<i;++n)r=t[n],o[n]={x:r,y:e[r]};return o}function O1(e,t){let o=e&&e.options.stacked;return o||o===void 0&&t.stack!==void 0}function y6(e,t,o){return `${e.id}.${t.id}.${o.stack||o.type}`}function x6(e){let{min:t,max:o,minDefined:n,maxDefined:i}=e.getUserBounds();return {min:n?t:Number.NEGATIVE_INFINITY,max:i?o:Number.POSITIVE_INFINITY}}function b6(e,t,o){let n=e[t]||(e[t]={});return n[o]||(n[o]={})}function U1(e,t,o,n){for(let i of t.getMatchingVisibleMetas(n).reverse()){let r=e[i.index];if(o&&r>0||!o&&r<0)return i.index}return null}function z1(e,t){let{chart:o,_cachedMeta:n}=e,i=o._stacks||(o._stacks={}),{iScale:r,vScale:a,index:s}=n,l=r.axis,c=a.axis,d=y6(r,a,n),u=t.length,p;for(let m=0;m<u;++m){let h=t[m],{[l]:f,[c]:g}=h,y=h._stacks||(h._stacks={});p=y[c]=b6(i,d,f),p[s]=g,p._top=U1(p,a,true,n.type),p._bottom=U1(p,a,false,n.type);}}function Bd(e,t){let o=e.scales;return Object.keys(o).filter(n=>o[n].axis===t).shift()}function C6(e,t){return Me(e,{active:false,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function P6(e,t,o){return Me(e,{active:false,dataIndex:t,parsed:void 0,raw:void 0,element:o,index:t,mode:"default",type:"data"})}function Zi(e,t){let o=e.controller.index,n=e.vScale&&e.vScale.axis;if(n){t=t||e._parsed;for(let i of t){let r=i._stacks;if(!r||r[n]===void 0||r[n][o]===void 0)return;delete r[n][o];}}}var Ed=e=>e==="reset"||e==="none",$1=(e,t)=>t?e:Object.assign({},e),S6=(e,t,o)=>e&&!t.hidden&&t._stacked&&{keys:w0(o,true),values:null},qt=class{constructor(t,o){this.chart=t,this._ctx=t.ctx,this.index=o,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=false,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=false,this.supportsDecimation=false,this.$context=void 0,this._syncList=[],this.initialize();}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=O1(t.vScale,t),this.addElements();}updateIndex(t){this.index!==t&&Zi(this._cachedMeta),this.index=t;}linkScales(){let t=this.chart,o=this._cachedMeta,n=this.getDataset(),i=(u,p,m,h)=>u==="x"?p:u==="r"?h:m,r=o.xAxisID=U(n.xAxisID,Bd(t,"x")),a=o.yAxisID=U(n.yAxisID,Bd(t,"y")),s=o.rAxisID=U(n.rAxisID,Bd(t,"r")),l=o.indexAxis,c=o.iAxisID=i(l,r,a,s),d=o.vAxisID=i(l,a,r,s);o.xScale=this.getScaleForId(r),o.yScale=this.getScaleForId(a),o.rScale=this.getScaleForId(s),o.iScale=this.getScaleForId(c),o.vScale=this.getScaleForId(d);}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let o=this._cachedMeta;return t===o.iScale?o.vScale:o.iScale}reset(){this._update("reset");}_destroy(){let t=this._cachedMeta;this._data&&qa(this._data,this),t._stacked&&Zi(t);}_dataCheck(){let t=this.getDataset(),o=t.data||(t.data=[]),n=this._data;if(z(o))this._data=g6(o);else if(n!==o){if(n){qa(n,this);let i=this._cachedMeta;Zi(i),i._parsed=[];}o&&Object.isExtensible(o)&&hd(o,this),this._syncList=[],this._data=o;}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType);}buildOrUpdateElements(t){let o=this._cachedMeta,n=this.getDataset(),i=false;this._dataCheck();let r=o._stacked;o._stacked=O1(o.vScale,o),o.stack!==n.stack&&(i=true,Zi(o),o.stack=n.stack),this._resyncElements(t),(i||r!==o._stacked)&&z1(this,o._parsed);}configure(){let t=this.chart.config,o=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),o,true);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={};}parse(t,o){let{_cachedMeta:n,_data:i}=this,{iScale:r,_stacked:a}=n,s=r.axis,l=t===0&&o===i.length?true:n._sorted,c=t>0&&n._parsed[t-1],d,u,p;if(this._parsing===false)n._parsed=i,n._sorted=true,p=i;else {Z(i[t])?p=this.parseArrayData(n,i,t,o):z(i[t])?p=this.parseObjectData(n,i,t,o):p=this.parsePrimitiveData(n,i,t,o);let m=()=>u[s]===null||c&&u[s]<c[s];for(d=0;d<o;++d)n._parsed[d+t]=u=p[d],l&&(m()&&(l=false),c=u);n._sorted=l;}a&&z1(this,p);}parsePrimitiveData(t,o,n,i){let{iScale:r,vScale:a}=t,s=r.axis,l=a.axis,c=r.getLabels(),d=r===a,u=new Array(i),p,m,h;for(p=0,m=i;p<m;++p)h=p+n,u[p]={[s]:d||r.parse(c[h],h),[l]:a.parse(o[h],h)};return u}parseArrayData(t,o,n,i){let{xScale:r,yScale:a}=t,s=new Array(i),l,c,d,u;for(l=0,c=i;l<c;++l)d=l+n,u=o[d],s[l]={x:r.parse(u[0],d),y:a.parse(u[1],d)};return s}parseObjectData(t,o,n,i){let{xScale:r,yScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=new Array(i),d,u,p,m;for(d=0,u=i;d<u;++d)p=d+n,m=o[p],c[d]={x:r.parse(Ae(m,s),p),y:a.parse(Ae(m,l),p)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,o,n){let i=this.chart,r=this._cachedMeta,a=o[t.axis],s={keys:w0(i,true),values:o._stacks[t.axis]};return N1(s,a,r.index,{mode:n})}updateRangeFromParsed(t,o,n,i){let r=n[o.axis],a=r===null?NaN:r,s=i&&n._stacks[o.axis];i&&s&&(i.values=s,a=N1(i,r,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a);}getMinMax(t,o){let n=this._cachedMeta,i=n._parsed,r=n._sorted&&t===n.iScale,a=i.length,s=this._getOtherScale(t),l=S6(o,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=x6(s),p,m;function h(){m=i[p];let f=m[s.axis];return !lt(m[t.axis])||d>f||u<f}for(p=0;p<a&&!(!h()&&(this.updateRangeFromParsed(c,t,m,l),r));++p);if(r){for(p=a-1;p>=0;--p)if(!h()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){let o=this._cachedMeta._parsed,n=[],i,r,a;for(i=0,r=o.length;i<r;++i)a=o[i][t.axis],lt(a)&&n.push(a);return n}getMaxOverflow(){return false}getLabelAndValue(t){let o=this._cachedMeta,n=o.iScale,i=o.vScale,r=this.getParsed(t);return {label:n?""+n.getLabelForValue(r[n.axis]):"",value:i?""+i.getLabelForValue(r[i.axis]):""}}_update(t){let o=this._cachedMeta;this.update(t||"default"),o._clip=f6(U(this.options.clip,m6(o.xScale,o.yScale,this.getMaxOverflow())));}update(t){}draw(){let t=this._ctx,o=this.chart,n=this._cachedMeta,i=n.data||[],r=o.chartArea,a=[],s=this._drawStart||0,l=this._drawCount||i.length-s,c=this.options.drawActiveElementsOnTop,d;for(n.dataset&&n.dataset.draw(t,r,s,l),d=s;d<s+l;++d){let u=i[d];u.hidden||(u.active&&c?a.push(u):u.draw(t,r));}for(d=0;d<a.length;++d)a[d].draw(t,r);}getStyle(t,o){let n=o?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,o,n){let i=this.getDataset(),r;if(t>=0&&t<this._cachedMeta.data.length){let a=this._cachedMeta.data[t];r=a.$context||(a.$context=P6(this.getContext(),t,a)),r.parsed=this.getParsed(t),r.raw=i.data[t],r.index=r.dataIndex=t;}else r=this.$context||(this.$context=C6(this.chart.getContext(),this.index)),r.dataset=i,r.index=r.datasetIndex=this.index;return r.active=!!o,r.mode=n,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,o){return this._resolveElementOptions(this.dataElementType.id,o,t)}_resolveElementOptions(t,o="default",n){let i=o==="active",r=this._cachedDataOpts,a=t+"-"+o,s=r[a],l=this.enableOptionSharing&&st(n);if(s)return $1(s,l);let c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),u=i?[`${t}Hover`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),d),m=Object.keys(H.elements[t]),h=()=>this.getContext(n,i),f=c.resolveNamedOptions(p,m,h,u);return f.$shared&&(f.$shared=l,r[a]=Object.freeze($1(f,l))),f}_resolveAnimations(t,o,n){let i=this.chart,r=this._cachedDataOpts,a=`animation-${o}`,s=r[a];if(s)return s;let l;if(i.options.animation!==false){let d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,o),p=d.getOptionScopes(this.getDataset(),u);l=d.createResolver(p,this.getContext(t,n,o));}let c=new Hn(i,l&&l.animations);return l&&l._cacheable&&(r[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,o){return !o||Ed(t)||this.chart._animationsDisabled}_getSharedOptions(t,o){let n=this.resolveDataElementOptions(t,o),i=this._sharedOptions,r=this.getSharedOptions(n),a=this.includeOptions(o,r)||r!==i;return this.updateSharedOptions(r,o,n),{sharedOptions:r,includeOptions:a}}updateElement(t,o,n,i){Ed(i)?Object.assign(t,n):this._resolveAnimations(o,i).update(t,n);}updateSharedOptions(t,o,n){t&&!Ed(o)&&this._resolveAnimations(void 0,o).update(t,n);}_setStyle(t,o,n,i){t.active=i;let r=this.getStyle(o,i);this._resolveAnimations(o,n,i).update(t,{options:!i&&this.getSharedOptions(r)||r});}removeHoverStyle(t,o,n){this._setStyle(t,n,"active",false);}setHoverStyle(t,o,n){this._setStyle(t,n,"active",true);}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",false);}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",true);}_resyncElements(t){let o=this._data,n=this._cachedMeta.data;for(let[s,l,c]of this._syncList)this[s](l,c);this._syncList=[];let i=n.length,r=o.length,a=Math.min(r,i);a&&this.parse(0,a),r>i?this._insertElements(i,r-i,t):r<i&&this._removeElements(r,i-r);}_insertElements(t,o,n=true){let i=this._cachedMeta,r=i.data,a=t+o,s,l=c=>{for(c.length+=o,s=c.length-1;s>=a;s--)c[s]=c[s-o];};for(l(r),s=t;s<a;++s)r[s]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,o),n&&this.updateElements(r,t,o,"reset");}updateElements(t,o,n,i){}_removeElements(t,o){let n=this._cachedMeta;if(this._parsing){let i=n._parsed.splice(t,o);n._stacked&&Zi(n,i);}n.data.splice(t,o);}_sync(t){if(this._parsing)this._syncList.push(t);else {let[o,n,i]=t;this[o](n,i);}this.chart._dataChanges.push([this.index,...t]);}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t]);}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1]);}_onDataShift(){this._sync(["_removeElements",0,1]);}_onDataSplice(t,o){o&&this._sync(["_removeElements",t,o]);let n=arguments.length-2;n&&this._sync(["_insertElements",t,n]);}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length]);}};qt.defaults={};qt.prototype.datasetElementType=null;qt.prototype.dataElementType=null;function T6(e,t){if(!e._cache.$bar){let o=e.getMatchingVisibleMetas(t),n=[];for(let i=0,r=o.length;i<r;i++)n=n.concat(o[i].controller.getAllParsedValues(e));e._cache.$bar=Qa(n.sort((i,r)=>i-r));}return e._cache.$bar}function k6(e){let t=e.iScale,o=T6(t,e.type),n=t._length,i,r,a,s,l=()=>{a===32767||a===-32768||(st(s)&&(n=Math.min(n,Math.abs(a-s)||n)),s=a);};for(i=0,r=o.length;i<r;++i)a=t.getPixelForValue(o[i]),l();for(s=void 0,i=0,r=t.ticks.length;i<r;++i)a=t.getPixelForTick(i),l();return n}function w6(e,t,o,n){let i=o.barThickness,r,a;return W(i)?(r=t.min*o.categoryPercentage,a=o.barPercentage):(r=i*n,a=1),{chunk:r/n,ratio:a,start:t.pixels[e]-r/2}}function v6(e,t,o,n){let i=t.pixels,r=i[e],a=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null,l=o.categoryPercentage;a===null&&(a=r-(s===null?t.end-t.start:s-r)),s===null&&(s=r+r-a);let c=r-(r-Math.min(a,s))/2*l;return {chunk:Math.abs(s-a)/2*l/n,ratio:o.barPercentage,start:c}}function _6(e,t,o,n){let i=o.parse(e[0],n),r=o.parse(e[1],n),a=Math.min(i,r),s=Math.max(i,r),l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),t[o.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:r,min:a,max:s};}function v0(e,t,o,n){return Z(e)?_6(e,t,o,n):t[o.axis]=o.parse(e,n),t}function V1(e,t,o,n){let i=e.iScale,r=e.vScale,a=i.getLabels(),s=i===r,l=[],c,d,u,p;for(c=o,d=o+n;c<d;++c)p=t[c],u={},u[i.axis]=s||i.parse(a[c],c),l.push(v0(p,u,r,c));return l}function Fd(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function A6(e,t,o){return e!==0?re(e):(t.isHorizontal()?1:-1)*(t.min>=o?1:-1)}function M6(e){let t,o,n,i,r;return e.horizontal?(t=e.base>e.x,o="left",n="right"):(t=e.base<e.y,o="bottom",n="top"),t?(i="end",r="start"):(i="start",r="end"),{start:o,end:n,reverse:t,top:i,bottom:r}}function I6(e,t,o,n){let i=t.borderSkipped,r={};if(!i){e.borderSkipped=r;return}if(i===true){e.borderSkipped={top:true,right:true,bottom:true,left:true};return}let{start:a,end:s,reverse:l,top:c,bottom:d}=M6(e);i==="middle"&&o&&(e.enableBorderRadius=true,(o._top||0)===n?i=c:(o._bottom||0)===n?i=d:(r[H1(d,a,s,l)]=true,i=c)),r[H1(i,a,s,l)]=true,e.borderSkipped=r;}function H1(e,t,o,n){return n?(e=L6(e,t,o),e=W1(e,o,t)):e=W1(e,t,o),e}function L6(e,t,o){return e===t?o:e===o?t:e}function W1(e,t,o){return e==="start"?t:e==="end"?o:e}function B6(e,{inflateAmount:t},o){e.inflateAmount=t==="auto"?o===1?.33:0:t;}var nn=class extends qt{parsePrimitiveData(t,o,n,i){return V1(t,o,n,i)}parseArrayData(t,o,n,i){return V1(t,o,n,i)}parseObjectData(t,o,n,i){let{iScale:r,vScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?s:l,d=a.axis==="x"?s:l,u=[],p,m,h,f;for(p=n,m=n+i;p<m;++p)f=o[p],h={},h[r.axis]=r.parse(Ae(f,c),p),u.push(v0(Ae(f,d),h,a,p));return u}updateRangeFromParsed(t,o,n,i){super.updateRangeFromParsed(t,o,n,i);let r=n._custom;r&&o===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max));}getMaxOverflow(){return 0}getLabelAndValue(t){let o=this._cachedMeta,{iScale:n,vScale:i}=o,r=this.getParsed(t),a=r._custom,s=Fd(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(r[i.axis]);return {label:""+n.getLabelForValue(r[n.axis]),value:s}}initialize(){this.enableOptionSharing=true,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack;}update(t){let o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,t);}updateElements(t,o,n,i){let r=i==="reset",{index:a,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),c=s.isHorizontal(),d=this._getRuler(),{sharedOptions:u,includeOptions:p}=this._getSharedOptions(o,i);for(let m=o;m<o+n;m++){let h=this.getParsed(m),f=r||W(h[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),g=this._calculateBarIndexPixels(m,d),y=(h._stacks||{})[s.axis],P={horizontal:c,base:f.base,enableBorderRadius:!y||Fd(h._custom)||a===y._top||a===y._bottom,x:c?f.head:g.center,y:c?g.center:f.head,height:c?g.size:Math.abs(f.size),width:c?Math.abs(f.size):g.size};p&&(P.options=u||this.resolveDataElementOptions(m,t[m].active?"active":i));let T=P.options||t[m].options;I6(P,T,y,a),B6(P,T,d.ratio),this.updateElement(t[m],m,P,i);}}_getStacks(t,o){let{iScale:n}=this._cachedMeta,i=n.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),r=n.options.stacked,a=[],s=l=>{let c=l.controller.getParsed(o),d=c&&c[l.vScale.axis];if(W(d)||isNaN(d))return true};for(let l of i)if(!(o!==void 0&&s(l))&&((r===false||a.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&a.push(l.stack),l.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,o,n){let i=this._getStacks(t,n),r=o!==void 0?i.indexOf(o):-1;return r===-1?i.length-1:r}_getRuler(){let t=this.options,o=this._cachedMeta,n=o.iScale,i=[],r,a;for(r=0,a=o.data.length;r<a;++r)i.push(n.getPixelForValue(this.getParsed(r)[n.axis],r));let s=t.barThickness;return {min:s||k6(o),pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:s?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:o,_stacked:n},options:{base:i,minBarLength:r}}=this,a=i||0,s=this.getParsed(t),l=s._custom,c=Fd(l),d=s[o.axis],u=0,p=n?this.applyStack(o,s,n):d,m,h;p!==d&&(u=p-d,p=d),c&&(d=l.barStart,p=l.barEnd-l.barStart,d!==0&&re(d)!==re(l.barEnd)&&(u=0),u+=d);let f=!W(i)&&!c?i:u,g=o.getPixelForValue(f);if(this.chart.getDataVisibility(t)?m=o.getPixelForValue(u+p):m=g,h=m-g,Math.abs(h)<r){h=A6(h,o,a)*r,d===a&&(g-=h/2);let y=o.getPixelForDecimal(0),P=o.getPixelForDecimal(1),T=Math.min(y,P),k=Math.max(y,P);g=Math.max(Math.min(g,k),T),m=g+h;}if(g===o.getPixelForValue(a)){let y=re(h)*o.getLineWidthForValue(a)/2;g+=y,h-=y;}return {size:h,base:g,head:m,center:m+h/2}}_calculateBarIndexPixels(t,o){let n=o.scale,i=this.options,r=i.skipNull,a=U(i.maxBarThickness,1/0),s,l;if(o.grouped){let c=r?this._getStackCount(t):o.stackCount,d=i.barThickness==="flex"?v6(t,o,i,c):w6(t,o,i,c),u=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);s=d.start+d.chunk*u+d.chunk/2,l=Math.min(a,d.chunk*d.ratio);}else s=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(a,o.min*o.ratio);return {base:s-l/2,head:s+l/2,center:s,size:l}}draw(){let t=this._cachedMeta,o=t.vScale,n=t.data,i=n.length,r=0;for(;r<i;++r)this.getParsed(r)[o.axis]!==null&&n[r].draw(this._ctx);}};nn.id="bar";nn.defaults={datasetElementType:false,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:true,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};nn.overrides={scales:{_index_:{type:"category",offset:true,grid:{offset:true}},_value_:{type:"linear",beginAtZero:true}}};var Wn=class extends qt{initialize(){this.enableOptionSharing=true,super.initialize();}parsePrimitiveData(t,o,n,i){let r=super.parsePrimitiveData(t,o,n,i);for(let a=0;a<r.length;a++)r[a]._custom=this.resolveDataElementOptions(a+n).radius;return r}parseArrayData(t,o,n,i){let r=super.parseArrayData(t,o,n,i);for(let a=0;a<r.length;a++){let s=o[n+a];r[a]._custom=U(s[2],this.resolveDataElementOptions(a+n).radius);}return r}parseObjectData(t,o,n,i){let r=super.parseObjectData(t,o,n,i);for(let a=0;a<r.length;a++){let s=o[n+a];r[a]._custom=U(s&&s.r&&+s.r,this.resolveDataElementOptions(a+n).radius);}return r}getMaxOverflow(){let t=this._cachedMeta.data,o=0;for(let n=t.length-1;n>=0;--n)o=Math.max(o,t[n].size(this.resolveDataElementOptions(n))/2);return o>0&&o}getLabelAndValue(t){let o=this._cachedMeta,{xScale:n,yScale:i}=o,r=this.getParsed(t),a=n.getLabelForValue(r.x),s=i.getLabelForValue(r.y),l=r._custom;return {label:o.label,value:"("+a+", "+s+(l?", "+l:"")+")"}}update(t){let o=this._cachedMeta.data;this.updateElements(o,0,o.length,t);}updateElements(t,o,n,i){let r=i==="reset",{iScale:a,vScale:s}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(o,i),d=a.axis,u=s.axis;for(let p=o;p<o+n;p++){let m=t[p],h=!r&&this.getParsed(p),f={},g=f[d]=r?a.getPixelForDecimal(.5):a.getPixelForValue(h[d]),y=f[u]=r?s.getBasePixel():s.getPixelForValue(h[u]);f.skip=isNaN(g)||isNaN(y),c&&(f.options=l||this.resolveDataElementOptions(p,m.active?"active":i),r&&(f.options.radius=0)),this.updateElement(m,p,f,i);}}resolveDataElementOptions(t,o){let n=this.getParsed(t),i=super.resolveDataElementOptions(t,o);i.$shared&&(i=Object.assign({},i,{$shared:false}));let r=i.radius;return o!=="active"&&(i.radius=0),i.radius+=U(n&&n._custom,r),i}};Wn.id="bubble";Wn.defaults={datasetElementType:false,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Wn.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return ""}}}}};function E6(e,t,o){let n=1,i=1,r=0,a=0;if(t<Q){let s=e,l=s+t,c=Math.cos(s),d=Math.sin(s),u=Math.cos(l),p=Math.sin(l),m=(T,k,w)=>Jo(T,s,l,true)?1:Math.max(k,k*o,w,w*o),h=(T,k,w)=>Jo(T,s,l,true)?-1:Math.min(k,k*o,w,w*o),f=m(0,c,u),g=m(et,d,p),y=h(G,c,u),P=h(G+et,d,p);n=(f-y)/2,i=(g-P)/2,r=-(f+y)/2,a=-(g+P)/2;}return {ratioX:n,ratioY:i,offsetX:r,offsetY:a}}var To=class extends qt{constructor(t,o){super(t,o),this.enableOptionSharing=true,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0;}linkScales(){}parse(t,o){let n=this.getDataset().data,i=this._cachedMeta;if(this._parsing===false)i._parsed=n;else {let r=l=>+n[l];if(z(n[t])){let{key:l="value"}=this._parsing;r=c=>+Ae(n[c],l);}let a,s;for(a=t,s=t+o;a<s;++a)i._parsed[a]=r(a);}}_getRotation(){return mt(this.options.rotation-90)}_getCircumference(){return mt(this.options.circumference)}_getRotationExtents(){let t=Q,o=-Q;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)){let i=this.chart.getDatasetMeta(n).controller,r=i._getRotation(),a=i._getCircumference();t=Math.min(t,r),o=Math.max(o,r+a);}return {rotation:t,circumference:o-t}}update(t){let o=this.chart,{chartArea:n}=o,i=this._cachedMeta,r=i.data,a=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,s=Math.max((Math.min(n.width,n.height)-a)/2,0),l=Math.min(ad(this.options.cutout,s),1),c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:p,ratioY:m,offsetX:h,offsetY:f}=E6(u,d,l),g=(n.width-a)/p,y=(n.height-a)/m,P=Math.max(Math.min(g,y)/2,0),T=Ga(this.options.radius,P),k=Math.max(T*l,0),w=(T-k)/this._getVisibleDatasetWeightTotal();this.offsetX=h*T,this.offsetY=f*T,i.total=this.calculateTotal(),this.outerRadius=T-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*c,0),this.updateElements(r,0,r.length,t);}_circumference(t,o){let n=this.options,i=this._cachedMeta,r=this._getCircumference();return o&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*r/Q)}updateElements(t,o,n,i){let r=i==="reset",a=this.chart,s=a.chartArea,c=a.options.animation,d=(s.left+s.right)/2,u=(s.top+s.bottom)/2,p=r&&c.animateScale,m=p?0:this.innerRadius,h=p?0:this.outerRadius,{sharedOptions:f,includeOptions:g}=this._getSharedOptions(o,i),y=this._getRotation(),P;for(P=0;P<o;++P)y+=this._circumference(P,r);for(P=o;P<o+n;++P){let T=this._circumference(P,r),k=t[P],w={x:d+this.offsetX,y:u+this.offsetY,startAngle:y,endAngle:y+T,circumference:T,outerRadius:h,innerRadius:m};g&&(w.options=f||this.resolveDataElementOptions(P,k.active?"active":i)),y+=T,this.updateElement(k,P,w,i);}}calculateTotal(){let t=this._cachedMeta,o=t.data,n=0,i;for(i=0;i<o.length;i++){let r=t._parsed[i];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(i)&&!o[i].hidden&&(n+=Math.abs(r));}return n}calculateCircumference(t){let o=this._cachedMeta.total;return o>0&&!isNaN(t)?Q*(Math.abs(t)/o):0}getLabelAndValue(t){let o=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=en(o._parsed[t],n.options.locale);return {label:i[t]||"",value:r}}getMaxBorderWidth(t){let o=0,n=this.chart,i,r,a,s,l;if(!t){for(i=0,r=n.data.datasets.length;i<r;++i)if(n.isDatasetVisible(i)){a=n.getDatasetMeta(i),t=a.data,s=a.controller;break}}if(!t)return 0;for(i=0,r=t.length;i<r;++i)l=s.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(o=Math.max(o,l.borderWidth||0,l.hoverBorderWidth||0));return o}getMaxOffset(t){let o=0;for(let n=0,i=t.length;n<i;++n){let r=this.resolveDataElementOptions(n);o=Math.max(o,r.offset||0,r.hoverOffset||0);}return o}_getRingWeightOffset(t){let o=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(o+=this._getRingWeight(n));return o}_getRingWeight(t){return Math.max(U(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};To.id="doughnut";To.defaults={datasetElementType:false,dataElementType:"arc",animation:{animateRotate:true,animateScale:false},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};To.descriptors={_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"};To.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:o}}=e.legend.options;return t.labels.map((n,i)=>{let a=e.getDatasetMeta(0).controller.getStyle(i);return {text:n,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(i),index:i}})}return []}},onClick(e,t,o){o.chart.toggleDataVisibility(t.index),o.chart.update();}},tooltip:{callbacks:{title(){return ""},label(e){let t=e.label,o=": "+e.formattedValue;return Z(t)?(t=t.slice(),t[0]+=o):t+=o,t}}}}};var Gn=class extends qt{initialize(){this.enableOptionSharing=true,this.supportsDecimation=true,super.initialize();}update(t){let o=this._cachedMeta,{dataset:n,data:i=[],_dataset:r}=o,a=this.chart._animationsDisabled,{start:s,count:l}=es(o,i,a);this._drawStart=s,this._drawCount=l,os(o)&&(s=0,l=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=i;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},t),this.updateElements(i,s,l,t);}updateElements(t,o,n,i){let r=i==="reset",{iScale:a,vScale:s,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:u}=this._getSharedOptions(o,i),p=a.axis,m=s.axis,{spanGaps:h,segment:f}=this.options,g=Kt(h)?h:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||i==="none",P=o>0&&this.getParsed(o-1);for(let T=o;T<o+n;++T){let k=t[T],w=this.getParsed(T),v=y?k:{},A=W(w[m]),M=v[p]=a.getPixelForValue(w[p],T),I=v[m]=r||A?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,w,l):w[m],T);v.skip=isNaN(M)||isNaN(I)||A,v.stop=T>0&&Math.abs(w[p]-P[p])>g,f&&(v.parsed=w,v.raw=c.data[T]),u&&(v.options=d||this.resolveDataElementOptions(T,k.active?"active":i)),y||this.updateElement(k,T,v,i),P=w;}}getMaxOverflow(){let t=this._cachedMeta,o=t.dataset,n=o.options&&o.options.borderWidth||0,i=t.data||[];if(!i.length)return n;let r=i[0].size(this.resolveDataElementOptions(0)),a=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,r,a)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw();}};Gn.id="line";Gn.defaults={datasetElementType:"line",dataElementType:"point",showLine:true,spanGaps:false};Gn.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var jn=class extends qt{constructor(t,o){super(t,o),this.innerRadius=void 0,this.outerRadius=void 0;}getLabelAndValue(t){let o=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=en(o._parsed[t].r,n.options.locale);return {label:i[t]||"",value:r}}parseObjectData(t,o,n,i){return ls.bind(this)(t,o,n,i)}update(t){let o=this._cachedMeta.data;this._updateRadius(),this.updateElements(o,0,o.length,t);}getMinMax(){let t=this._cachedMeta,o={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,i)=>{let r=this.getParsed(i).r;!isNaN(r)&&this.chart.getDataVisibility(i)&&(r<o.min&&(o.min=r),r>o.max&&(o.max=r));}),o}_updateRadius(){let t=this.chart,o=t.chartArea,n=t.options,i=Math.min(o.right-o.left,o.bottom-o.top),r=Math.max(i/2,0),a=Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0),s=(r-a)/t.getVisibleDatasetCount();this.outerRadius=r-s*this.index,this.innerRadius=this.outerRadius-s;}updateElements(t,o,n,i){let r=i==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,u=c.yCenter,p=c.getIndexAngle(0)-.5*G,m=p,h,f=360/this.countVisibleElements();for(h=0;h<o;++h)m+=this._computeAngle(h,i,f);for(h=o;h<o+n;h++){let g=t[h],y=m,P=m+this._computeAngle(h,i,f),T=a.getDataVisibility(h)?c.getDistanceFromCenterForValue(this.getParsed(h).r):0;m=P,r&&(l.animateScale&&(T=0),l.animateRotate&&(y=P=p));let k={x:d,y:u,innerRadius:0,outerRadius:T,startAngle:y,endAngle:P,options:this.resolveDataElementOptions(h,g.active?"active":i)};this.updateElement(g,h,k,i);}}countVisibleElements(){let t=this._cachedMeta,o=0;return t.data.forEach((n,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&o++;}),o}_computeAngle(t,o,n){return this.chart.getDataVisibility(t)?mt(this.resolveDataElementOptions(t,o).angle||n):0}};jn.id="polarArea";jn.defaults={dataElementType:"arc",animation:{animateRotate:true,animateScale:true},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};jn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:o}}=e.legend.options;return t.labels.map((n,i)=>{let a=e.getDatasetMeta(0).controller.getStyle(i);return {text:n,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(i),index:i}})}return []}},onClick(e,t,o){o.chart.toggleDataVisibility(t.index),o.chart.update();}},tooltip:{callbacks:{title(){return ""},label(e){return e.chart.data.labels[e.dataIndex]+": "+e.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:false},beginAtZero:true,grid:{circular:true},pointLabels:{display:false},startAngle:0}}};var er=class extends To{};er.id="pie";er.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var Yn=class extends qt{getLabelAndValue(t){let o=this._cachedMeta.vScale,n=this.getParsed(t);return {label:o.getLabels()[t],value:""+o.getLabelForValue(n[o.axis])}}parseObjectData(t,o,n,i){return ls.bind(this)(t,o,n,i)}update(t){let o=this._cachedMeta,n=o.dataset,i=o.data||[],r=o.iScale.getLabels();if(n.points=i,t!=="resize"){let a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);let s={_loop:true,_fullLoop:r.length===i.length,options:a};this.updateElement(n,void 0,s,t);}this.updateElements(i,0,i.length,t);}updateElements(t,o,n,i){let r=this._cachedMeta.rScale,a=i==="reset";for(let s=o;s<o+n;s++){let l=t[s],c=this.resolveDataElementOptions(s,l.active?"active":i),d=r.getPointPositionForValue(s,this.getParsed(s).r),u=a?r.xCenter:d.x,p=a?r.yCenter:d.y,m={x:u,y:p,angle:d.angle,skip:isNaN(u)||isNaN(p),options:c};this.updateElement(l,s,m,i);}}};Yn.id="radar";Yn.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:true,elements:{line:{fill:"start"}}};Yn.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};var xt=class{constructor(){this.x=void 0,this.y=void 0,this.active=false,this.options=void 0,this.$animations=void 0;}tooltipPosition(t){let{x:o,y:n}=this.getProps(["x","y"],t);return {x:o,y:n}}hasValue(){return Kt(this.x)&&Kt(this.y)}getProps(t,o){let n=this.$animations;if(!o||!n)return this;let i={};return t.forEach(r=>{i[r]=n[r]&&n[r].active()?n[r]._to:this[r];}),i}};xt.defaults={};xt.defaultRoutes=void 0;var _0={values(e){return Z(e)?e:""+e},numeric(e,t,o){if(e===0)return "0";let n=this.chart.options.locale,i,r=e;if(o.length>1){let c=Math.max(Math.abs(o[0].value),Math.abs(o[o.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),r=F6(e,o);}let a=zt(Math.abs(r)),s=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),en(e,n,l)},logarithmic(e,t,o){if(e===0)return "0";let n=e/Math.pow(10,Math.floor(zt(e)));return n===1||n===2||n===5?_0.numeric.call(this,e,t,o):""}};function F6(e,t){let o=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(o)>=1&&e!==Math.floor(e)&&(o=e-Math.floor(e)),o}var Ls={formatters:_0};H.set("scale",{display:true,offset:false,reverse:false,beginAtZero:false,bounds:"ticks",grace:0,grid:{display:true,lineWidth:1,drawBorder:true,drawOnChartArea:true,drawTicks:true,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:false,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:false,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:false,textStrokeWidth:0,textStrokeColor:"",padding:3,display:true,autoSkip:true,autoSkipPadding:3,labelOffset:0,callback:Ls.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:false,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});H.route("scale.ticks","color","","color");H.route("scale.grid","color","","borderColor");H.route("scale.grid","borderColor","","borderColor");H.route("scale.title","color","","color");H.describe("scale",{_fallback:false,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"});H.describe("scales",{_fallback:"scale"});H.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"});function R6(e,t){let o=e.options.ticks,n=o.maxTicksLimit||D6(e),i=o.major.enabled?O6(t):[],r=i.length,a=i[0],s=i[r-1],l=[];if(r>n)return U6(t,l,i,r/n),l;let c=N6(i,t,n);if(r>0){let d,u,p=r>1?Math.round((s-a)/(r-1)):null;for(ys(t,l,c,W(p)?0:a-p,a),d=0,u=r-1;d<u;d++)ys(t,l,c,i[d],i[d+1]);return ys(t,l,c,s,W(p)?t.length:s+p),l}return ys(t,l,c),l}function D6(e){let t=e.options.offset,o=e._tickSize(),n=e._length/o+(t?0:1),i=e._maxLength/o;return Math.floor(Math.min(n,i))}function N6(e,t,o){let n=z6(e),i=t.length/o;if(!n)return Math.max(i,1);let r=ld(n);for(let a=0,s=r.length-1;a<s;a++){let l=r[a];if(l>i)return l}return Math.max(i,1)}function O6(e){let t=[],o,n;for(o=0,n=e.length;o<n;o++)e[o].major&&t.push(o);return t}function U6(e,t,o,n){let i=0,r=o[0],a;for(n=Math.ceil(n),a=0;a<e.length;a++)a===r&&(t.push(e[a]),i++,r=o[i*n]);}function ys(e,t,o,n,i){let r=U(n,0),a=Math.min(U(i,e.length),e.length),s=0,l,c,d;for(o=Math.ceil(o),i&&(l=i-n,o=l/Math.floor(l/o)),d=r;d<0;)s++,d=Math.round(r+s*o);for(c=Math.max(r,0);c<a;c++)c===d&&(t.push(e[c]),s++,d=Math.round(r+s*o));}function z6(e){let t=e.length,o,n;if(t<2)return false;for(n=e[0],o=1;o<t;++o)if(e[o]-e[o-1]!==n)return false;return n}var $6=e=>e==="left"?"right":e==="right"?"left":e,G1=(e,t,o)=>t==="top"||t==="left"?e[t]+o:e[t]-o;function j1(e,t){let o=[],n=e.length/t,i=e.length,r=0;for(;r<i;r+=n)o.push(e[Math.floor(r)]);return o}function V6(e,t,o){let n=e.ticks.length,i=Math.min(t,n-1),r=e._startPixel,a=e._endPixel,s=1e-6,l=e.getPixelForTick(i),c;if(!(o&&(n===1?c=Math.max(l-r,a-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<r-s||l>a+s)))return l}function H6(e,t){K(e,o=>{let n=o.gc,i=n.length/2,r;if(i>t){for(r=0;r<i;++r)delete o.data[n[r]];n.splice(0,i);}});}function Xi(e){return e.drawTicks?e.tickLength:0}function Y1(e,t){if(!e.display)return 0;let o=it(e.font,t),n=ut(e.padding);return (Z(e.text)?e.text.length:1)*o.lineHeight+n.height}function W6(e,t){return Me(e,{scale:t,type:"scale"})}function G6(e,t,o){return Me(e,{tick:o,index:t,type:"tick"})}function j6(e,t,o){let n=Vi(e);return (o&&t!=="right"||!o&&t==="right")&&(n=$6(n)),n}function Y6(e,t,o,n){let{top:i,left:r,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:d}=l,u=0,p,m,h,f=a-i,g=s-r;if(e.isHorizontal()){if(m=Pt(n,r,s),z(o)){let y=Object.keys(o)[0],P=o[y];h=d[y].getPixelForValue(P)+f-t;}else o==="center"?h=(c.bottom+c.top)/2+f-t:h=G1(e,o,t);p=s-r;}else {if(z(o)){let y=Object.keys(o)[0],P=o[y];m=d[y].getPixelForValue(P)-g+t;}else o==="center"?m=(c.left+c.right)/2-g+t:m=G1(e,o,t);h=Pt(n,a,i),u=o==="left"?-et:et;}return {titleX:m,titleY:h,maxWidth:p,rotation:u}}var rn=class e extends xt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=false,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=false,this.$context=void 0;}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax);}parse(t,o){return t}getUserBounds(){let{_userMin:t,_userMax:o,_suggestedMin:n,_suggestedMax:i}=this;return t=Ut(t,Number.POSITIVE_INFINITY),o=Ut(o,Number.NEGATIVE_INFINITY),n=Ut(n,Number.POSITIVE_INFINITY),i=Ut(i,Number.NEGATIVE_INFINITY),{min:Ut(t,n),max:Ut(o,i),minDefined:lt(t),maxDefined:lt(o)}}getMinMax(t){let{min:o,max:n,minDefined:i,maxDefined:r}=this.getUserBounds(),a;if(i&&r)return {min:o,max:n};let s=this.getMatchingVisibleMetas();for(let l=0,c=s.length;l<c;++l)a=s[l].controller.getMinMax(this,t),i||(o=Math.min(o,a.min)),r||(n=Math.max(n,a.max));return o=r&&o>n?n:o,n=i&&o>n?o:n,{min:Ut(o,Ut(n,o)),max:Ut(n,Ut(o,n))}}getPadding(){return {left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=false;}beforeUpdate(){X(this.options.beforeUpdate,[this]);}update(t,o,n){let{beginAtZero:i,grace:r,ticks:a}=this.options,s=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=o,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Td(this,r,i),this._dataLimitsCached=true),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=s<this.ticks.length;this._convertTicksToLabels(l?j1(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=R6(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate();}configure(){let t=this.options.reverse,o,n;this.isHorizontal()?(o=this.left,n=this.right):(o=this.top,n=this.bottom,t=!t),this._startPixel=o,this._endPixel=n,this._reversePixels=t,this._length=n-o,this._alignToPixels=this.options.alignToPixels;}afterUpdate(){X(this.options.afterUpdate,[this]);}beforeSetDimensions(){X(this.options.beforeSetDimensions,[this]);}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0;}afterSetDimensions(){X(this.options.afterSetDimensions,[this]);}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),X(this.options[t],[this]);}beforeDataLimits(){this._callHooks("beforeDataLimits");}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits");}beforeBuildTicks(){this._callHooks("beforeBuildTicks");}buildTicks(){return []}afterBuildTicks(){this._callHooks("afterBuildTicks");}beforeTickToLabelConversion(){X(this.options.beforeTickToLabelConversion,[this]);}generateTickLabels(t){let o=this.options.ticks,n,i,r;for(n=0,i=t.length;n<i;n++)r=t[n],r.label=X(o.callback,[r.value,n,t],this);}afterTickToLabelConversion(){X(this.options.afterTickToLabelConversion,[this]);}beforeCalculateLabelRotation(){X(this.options.beforeCalculateLabelRotation,[this]);}calculateLabelRotation(){let t=this.options,o=t.ticks,n=this.ticks.length,i=o.minRotation||0,r=o.maxRotation,a=i,s,l,c;if(!this._isVisible()||!o.display||i>=r||n<=1||!this.isHorizontal()){this.labelRotation=i;return}let d=this._getLabelSizes(),u=d.widest.width,p=d.highest.height,m=Ct(this.chart.width-u,0,this.maxWidth);s=t.offset?this.maxWidth/n:m/(n-1),u+6>s&&(s=m/(n-(t.offset?.5:1)),l=this.maxHeight-Xi(t.grid)-o.padding-Y1(t.title,this.chart.options.font),c=Math.sqrt(u*u+p*p),a=Qo(Math.min(Math.asin(Ct((d.highest.height+6)/s,-1,1)),Math.asin(Ct(l/c,-1,1))-Math.asin(Ct(p/c,-1,1)))),a=Math.max(i,Math.min(r,a))),this.labelRotation=a;}afterCalculateLabelRotation(){X(this.options.afterCalculateLabelRotation,[this]);}afterAutoSkip(){}beforeFit(){X(this.options.beforeFit,[this]);}fit(){let t={width:0,height:0},{chart:o,options:{ticks:n,title:i,grid:r}}=this,a=this._isVisible(),s=this.isHorizontal();if(a){let l=Y1(i,o.options.font);if(s?(t.width=this.maxWidth,t.height=Xi(r)+l):(t.height=this.maxHeight,t.width=Xi(r)+l),n.display&&this.ticks.length){let{first:c,last:d,widest:u,highest:p}=this._getLabelSizes(),m=n.padding*2,h=mt(this.labelRotation),f=Math.cos(h),g=Math.sin(h);if(s){let y=n.mirror?0:g*u.width+f*p.height;t.height=Math.min(this.maxHeight,t.height+y+m);}else {let y=n.mirror?0:f*u.width+g*p.height;t.width=Math.min(this.maxWidth,t.width+y+m);}this._calculatePadding(c,d,g,f);}}this._handleMargins(),s?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom);}_calculatePadding(t,o,n,i){let{ticks:{align:r,padding:a},position:s}=this.options,l=this.labelRotation!==0,c=s!=="top"&&this.axis==="x";if(this.isHorizontal()){let d=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1),p=0,m=0;l?c?(p=i*t.width,m=n*o.height):(p=n*t.height,m=i*o.width):r==="start"?m=o.width:r==="end"?p=t.width:r!=="inner"&&(p=t.width/2,m=o.width/2),this.paddingLeft=Math.max((p-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((m-u+a)*this.width/(this.width-u),0);}else {let d=o.height/2,u=t.height/2;r==="start"?(d=0,u=t.height):r==="end"&&(d=o.height,u=0),this.paddingTop=d+a,this.paddingBottom=u+a;}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom));}afterFit(){X(this.options.afterFit,[this]);}isHorizontal(){let{axis:t,position:o}=this.options;return o==="top"||o==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let o,n;for(o=0,n=t.length;o<n;o++)W(t[o].label)&&(t.splice(o,1),n--,o--);this.afterTickToLabelConversion();}_getLabelSizes(){let t=this._labelSizes;if(!t){let o=this.options.ticks.sampleSize,n=this.ticks;o<n.length&&(n=j1(n,o)),this._labelSizes=t=this._computeLabelSizes(n,n.length);}return t}_computeLabelSizes(t,o){let{ctx:n,_longestTextCache:i}=this,r=[],a=[],s=0,l=0,c,d,u,p,m,h,f,g,y,P,T;for(c=0;c<o;++c){if(p=t[c].label,m=this._resolveTickFontOptions(c),n.font=h=m.string,f=i[h]=i[h]||{data:{},gc:[]},g=m.lineHeight,y=P=0,!W(p)&&!Z(p))y=On(n,f.data,f.gc,y,p),P=g;else if(Z(p))for(d=0,u=p.length;d<u;++d)T=p[d],!W(T)&&!Z(T)&&(y=On(n,f.data,f.gc,y,T),P+=g);r.push(y),a.push(P),s=Math.max(y,s),l=Math.max(P,l);}H6(i,o);let k=r.indexOf(s),w=a.indexOf(l),v=A=>({width:r[A]||0,height:a[A]||0});return {first:v(0),last:v(o-1),widest:v(k),highest:v(w),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,o){return NaN}getValueForPixel(t){}getPixelForTick(t){let o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let o=this._startPixel+t*this._length;return dd(this._alignToPixels?Ve(this.chart,o,0):o)}getDecimalForPixel(t){let o=(t-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:o}=this;return t<0&&o<0?o:t>0&&o>0?t:0}getContext(t){let o=this.ticks||[];if(t>=0&&t<o.length){let n=o[t];return n.$context||(n.$context=G6(this.getContext(),t,n))}return this.$context||(this.$context=W6(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,o=mt(this.labelRotation),n=Math.abs(Math.cos(o)),i=Math.abs(Math.sin(o)),r=this._getLabelSizes(),a=t.autoSkipPadding||0,s=r?r.widest.width+a:0,l=r?r.highest.height+a:0;return this.isHorizontal()?l*n>s*i?s/n:l/i:l*i<s*n?l/n:s/i}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let o=this.axis,n=this.chart,i=this.options,{grid:r,position:a}=i,s=r.offset,l=this.isHorizontal(),d=this.ticks.length+(s?1:0),u=Xi(r),p=[],m=r.setContext(this.getContext()),h=m.drawBorder?m.borderWidth:0,f=h/2,g=function(F){return Ve(n,F,h)},y,P,T,k,w,v,A,M,I,B,L,E;if(a==="top")y=g(this.bottom),v=this.bottom-u,M=y-f,B=g(t.top)+f,E=t.bottom;else if(a==="bottom")y=g(this.top),B=t.top,E=g(t.bottom)-f,v=y+f,M=this.top+u;else if(a==="left")y=g(this.right),w=this.right-u,A=y-f,I=g(t.left)+f,L=t.right;else if(a==="right")y=g(this.left),I=t.left,L=g(t.right)-f,w=y+f,A=this.left+u;else if(o==="x"){if(a==="center")y=g((t.top+t.bottom)/2+.5);else if(z(a)){let F=Object.keys(a)[0],$=a[F];y=g(this.chart.scales[F].getPixelForValue($));}B=t.top,E=t.bottom,v=y+f,M=v+u;}else if(o==="y"){if(a==="center")y=g((t.left+t.right)/2);else if(z(a)){let F=Object.keys(a)[0],$=a[F];y=g(this.chart.scales[F].getPixelForValue($));}w=y-f,A=w-u,I=t.left,L=t.right;}let O=U(i.ticks.maxTicksLimit,d),N=Math.max(1,Math.ceil(d/O));for(P=0;P<d;P+=N){let F=r.setContext(this.getContext(P)),$=F.lineWidth,J=F.color,Ft=F.borderDash||[],tt=F.borderDashOffset,bt=F.tickWidth,Lo=F.tickColor,Be=F.tickBorderDash||[],Je=F.tickBorderDashOffset;T=V6(this,P,s),T!==void 0&&(k=Ve(n,T,$),l?w=A=I=L=k:v=M=B=E=k,p.push({tx1:w,ty1:v,tx2:A,ty2:M,x1:I,y1:B,x2:L,y2:E,width:$,color:J,borderDash:Ft,borderDashOffset:tt,tickWidth:bt,tickColor:Lo,tickBorderDash:Be,tickBorderDashOffset:Je}));}return this._ticksLength=d,this._borderValue=y,p}_computeLabelItems(t){let o=this.axis,n=this.options,{position:i,ticks:r}=n,a=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:c,padding:d,mirror:u}=r,p=Xi(n.grid),m=p+d,h=u?-d:m,f=-mt(this.labelRotation),g=[],y,P,T,k,w,v,A,M,I,B,L,E,O="middle";if(i==="top")v=this.bottom-h,A=this._getXAxisLabelAlignment();else if(i==="bottom")v=this.top+h,A=this._getXAxisLabelAlignment();else if(i==="left"){let F=this._getYAxisLabelAlignment(p);A=F.textAlign,w=F.x;}else if(i==="right"){let F=this._getYAxisLabelAlignment(p);A=F.textAlign,w=F.x;}else if(o==="x"){if(i==="center")v=(t.top+t.bottom)/2+m;else if(z(i)){let F=Object.keys(i)[0],$=i[F];v=this.chart.scales[F].getPixelForValue($)+m;}A=this._getXAxisLabelAlignment();}else if(o==="y"){if(i==="center")w=(t.left+t.right)/2-m;else if(z(i)){let F=Object.keys(i)[0],$=i[F];w=this.chart.scales[F].getPixelForValue($);}A=this._getYAxisLabelAlignment(p).textAlign;}o==="y"&&(l==="start"?O="top":l==="end"&&(O="bottom"));let N=this._getLabelSizes();for(y=0,P=s.length;y<P;++y){T=s[y],k=T.label;let F=r.setContext(this.getContext(y));M=this.getPixelForTick(y)+r.labelOffset,I=this._resolveTickFontOptions(y),B=I.lineHeight,L=Z(k)?k.length:1;let $=L/2,J=F.color,Ft=F.textStrokeColor,tt=F.textStrokeWidth,bt=A;a?(w=M,A==="inner"&&(y===P-1?bt=this.options.reverse?"left":"right":y===0?bt=this.options.reverse?"right":"left":bt="center"),i==="top"?c==="near"||f!==0?E=-L*B+B/2:c==="center"?E=-N.highest.height/2-$*B+B:E=-N.highest.height+B/2:c==="near"||f!==0?E=B/2:c==="center"?E=N.highest.height/2-$*B:E=N.highest.height-L*B,u&&(E*=-1)):(v=M,E=(1-L)*B/2);let Lo;if(F.showLabelBackdrop){let Be=ut(F.backdropPadding),Je=N.heights[y],Bo=N.widths[y],fn=v+E-Be.top,Eo=w-Be.left;switch(O){case "middle":fn-=Je/2;break;case "bottom":fn-=Je;break}switch(A){case "center":Eo-=Bo/2;break;case "right":Eo-=Bo;break}Lo={left:Eo,top:fn,width:Bo+Be.width,height:Je+Be.height,color:F.backdropColor};}g.push({rotation:f,label:k,font:I,color:J,strokeColor:Ft,strokeWidth:tt,textOffset:E,textAlign:bt,textBaseline:O,translation:[w,v],backdrop:Lo});}return g}_getXAxisLabelAlignment(){let{position:t,ticks:o}=this.options;if(-mt(this.labelRotation))return t==="top"?"left":"right";let i="center";return o.align==="start"?i="left":o.align==="end"?i="right":o.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){let{position:o,ticks:{crossAlign:n,mirror:i,padding:r}}=this.options,a=this._getLabelSizes(),s=t+r,l=a.widest.width,c,d;return o==="left"?i?(d=this.right+r,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-s,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d=this.left)):o==="right"?i?(d=this.left+r,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+s,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,o=this.options.position;if(o==="left"||o==="right")return {top:0,left:this.left,bottom:t.height,right:this.right};if(o==="top"||o==="bottom")return {top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:o},left:n,top:i,width:r,height:a}=this;o&&(t.save(),t.fillStyle=o,t.fillRect(n,i,r,a),t.restore());}getLineWidthForValue(t){let o=this.options.grid;if(!this._isVisible()||!o.display)return 0;let i=this.ticks.findIndex(r=>r.value===t);return i>=0?o.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){let o=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),r,a,s=(l,c,d)=>{!d.width||!d.color||(n.save(),n.lineWidth=d.width,n.strokeStyle=d.color,n.setLineDash(d.borderDash||[]),n.lineDashOffset=d.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore());};if(o.display)for(r=0,a=i.length;r<a;++r){let l=i[r];o.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),o.drawTicks&&s({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset});}}drawBorder(){let{chart:t,ctx:o,options:{grid:n}}=this,i=n.setContext(this.getContext()),r=n.drawBorder?i.borderWidth:0;if(!r)return;let a=n.setContext(this.getContext(0)).lineWidth,s=this._borderValue,l,c,d,u;this.isHorizontal()?(l=Ve(t,this.left,r)-r/2,c=Ve(t,this.right,a)+a/2,d=u=s):(d=Ve(t,this.top,r)-r/2,u=Ve(t,this.bottom,a)+a/2,l=c=s),o.save(),o.lineWidth=i.borderWidth,o.strokeStyle=i.borderColor,o.beginPath(),o.moveTo(l,d),o.lineTo(c,u),o.stroke(),o.restore();}drawLabels(t){if(!this.options.ticks.display)return;let n=this.ctx,i=this._computeLabelArea();i&&xo(n,i);let r=this._labelItems||(this._labelItems=this._computeLabelItems(t)),a,s;for(a=0,s=r.length;a<s;++a){let l=r[a],c=l.font,d=l.label;l.backdrop&&(n.fillStyle=l.backdrop.color,n.fillRect(l.backdrop.left,l.backdrop.top,l.backdrop.width,l.backdrop.height));let u=l.textOffset;He(n,d,0,u,c,l);}i&&bo(n);}drawTitle(){let{ctx:t,options:{position:o,title:n,reverse:i}}=this;if(!n.display)return;let r=it(n.font),a=ut(n.padding),s=n.align,l=r.lineHeight/2;o==="bottom"||o==="center"||z(o)?(l+=a.bottom,Z(n.text)&&(l+=r.lineHeight*(n.text.length-1))):l+=a.top;let{titleX:c,titleY:d,maxWidth:u,rotation:p}=Y6(this,l,o,s);He(t,n.text,0,0,r,{color:n.color,maxWidth:u,rotation:p,textAlign:j6(s,o,i),textBaseline:"middle",translation:[c,d]});}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t));}_layers(){let t=this.options,o=t.ticks&&t.ticks.z||0,n=U(t.grid&&t.grid.z,-1);return !this._isVisible()||this.draw!==e.prototype.draw?[{z:o,draw:i=>{this.draw(i);}}]:[{z:n,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle();}},{z:n+1,draw:()=>{this.drawBorder();}},{z:o,draw:i=>{this.drawLabels(i);}}]}getMatchingVisibleMetas(t){let o=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[],r,a;for(r=0,a=o.length;r<a;++r){let s=o[r];s[n]===this.id&&(!t||s.type===t)&&i.push(s);}return i}_resolveTickFontOptions(t){let o=this.options.ticks.setContext(this.getContext(t));return it(o.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return (this.isHorizontal()?this.width:this.height)/t}},Vn=class{constructor(t,o,n){this.type=t,this.scope=o,this.override=n,this.items=Object.create(null);}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let o=Object.getPrototypeOf(t),n;K6(o)&&(n=this.register(o));let i=this.items,r=t.id,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in i||(i[r]=t,Z6(t,a,n),this.override&&H.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){let o=this.items,n=t.id,i=this.scope;n in o&&delete o[n],i&&n in H[i]&&(delete H[i][n],this.override&&delete yo[n]);}};function Z6(e,t,o){let n=Xt(Object.create(null),[o?H.get(o):{},H.get(t),e.defaults]);H.set(t,n),e.defaultRoutes&&X6(t,e.defaultRoutes),e.descriptors&&H.describe(t,e.descriptors);}function X6(e,t){Object.keys(t).forEach(o=>{let n=o.split("."),i=n.pop(),r=[e].concat(n).join("."),a=t[o].split("."),s=a.pop(),l=a.join(".");H.route(r,i,l,s);});}function K6(e){return "id"in e&&"defaults"in e}var Hd=class{constructor(){this.controllers=new Vn(qt,"datasets",true),this.elements=new Vn(xt,"elements"),this.plugins=new Vn(Object,"plugins"),this.scales=new Vn(rn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements];}add(...t){this._each("register",t);}remove(...t){this._each("unregister",t);}addControllers(...t){this._each("register",t,this.controllers);}addElements(...t){this._each("register",t,this.elements);}addPlugins(...t){this._each("register",t,this.plugins);}addScales(...t){this._each("register",t,this.scales);}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers);}removeElements(...t){this._each("unregister",t,this.elements);}removePlugins(...t){this._each("unregister",t,this.plugins);}removeScales(...t){this._each("unregister",t,this.scales);}_each(t,o,n){[...o].forEach(i=>{let r=n||this._getRegistryForType(i);n||r.isForType(i)||r===this.plugins&&i.id?this._exec(t,r,i):K(i,a=>{let s=n||this._getRegistryForType(a);this._exec(t,s,a);});});}_exec(t,o,n){let i=Ui(t);X(n["before"+i],[],n),o[t](n),X(n["after"+i],[],n);}_getRegistryForType(t){for(let o=0;o<this._typedRegistries.length;o++){let n=this._typedRegistries[o];if(n.isForType(t))return n}return this.plugins}_get(t,o,n){let i=o.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return i}},Le=new Hd,Zn=class extends qt{update(t){let o=this._cachedMeta,{data:n=[]}=o,i=this.chart._animationsDisabled,{start:r,count:a}=es(o,n,i);if(this._drawStart=r,this._drawCount=a,os(o)&&(r=0,a=n.length),this.options.showLine){let{dataset:s,_dataset:l}=o;s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!l._decimated,s.points=n;let c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!i,options:c},t);}this.updateElements(n,r,a,t);}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=Le.getElement("line")),super.addElements();}updateElements(t,o,n,i){let r=i==="reset",{iScale:a,vScale:s,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(o,i),u=this.getSharedOptions(d),p=this.includeOptions(i,u),m=a.axis,h=s.axis,{spanGaps:f,segment:g}=this.options,y=Kt(f)?f:Number.POSITIVE_INFINITY,P=this.chart._animationsDisabled||r||i==="none",T=o>0&&this.getParsed(o-1);for(let k=o;k<o+n;++k){let w=t[k],v=this.getParsed(k),A=P?w:{},M=W(v[h]),I=A[m]=a.getPixelForValue(v[m],k),B=A[h]=r||M?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,v,l):v[h],k);A.skip=isNaN(I)||isNaN(B)||M,A.stop=k>0&&Math.abs(v[m]-T[m])>y,g&&(A.parsed=v,A.raw=c.data[k]),p&&(A.options=u||this.resolveDataElementOptions(k,w.active?"active":i)),P||this.updateElement(w,k,A,i),T=v;}this.updateSharedOptions(u,i,d);}getMaxOverflow(){let t=this._cachedMeta,o=t.data||[];if(!this.options.showLine){let s=0;for(let l=o.length-1;l>=0;--l)s=Math.max(s,o[l].size(this.resolveDataElementOptions(l))/2);return s>0&&s}let n=t.dataset,i=n.options&&n.options.borderWidth||0;if(!o.length)return i;let r=o[0].size(this.resolveDataElementOptions(0)),a=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(i,r,a)/2}};Zn.id="scatter";Zn.defaults={datasetElementType:false,dataElementType:"point",showLine:false,fill:false};Zn.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return ""},label(e){return "("+e.label+", "+e.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function on(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var or=class{constructor(t){this.options=t||{};}init(t){}formats(){return on()}parse(t,o){return on()}format(t,o){return on()}add(t,o,n){return on()}diff(t,o,n){return on()}startOf(t,o,n){return on()}endOf(t,o){return on()}};or.override=function(e){Object.assign(or.prototype,e);};var q6={_date:or};function Q6(e,t,o,n){let{controller:i,data:r,_sorted:a}=e,s=i._cachedMeta.iScale;if(s&&t===s.axis&&t!=="r"&&a&&r.length){let l=s._reversePixels?ud:ze;if(n){if(i._sharedOptions){let c=r[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){let u=l(r,t,o-d),p=l(r,t,o+d);return {lo:u.lo,hi:p.hi}}}}else return l(r,t,o)}return {lo:0,hi:r.length-1}}function rr(e,t,o,n,i){let r=e.getSortedVisibleDatasetMetas(),a=o[t];for(let s=0,l=r.length;s<l;++s){let{index:c,data:d}=r[s],{lo:u,hi:p}=Q6(r[s],t,a,i);for(let m=u;m<=p;++m){let h=d[m];h.skip||n(h,c,m);}}}function J6(e){let t=e.indexOf("x")!==-1,o=e.indexOf("y")!==-1;return function(n,i){let r=t?Math.abs(n.x-i.x):0,a=o?Math.abs(n.y-i.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}function Rd(e,t,o,n,i){let r=[];return !i&&!e.isPointInArea(t)||rr(e,o,t,function(s,l,c){!i&&!Xo(s,e.chartArea,0)||s.inRange(t.x,t.y,n)&&r.push({element:s,datasetIndex:l,index:c});},true),r}function t_(e,t,o,n){let i=[];function r(a,s,l){let{startAngle:c,endAngle:d}=a.getProps(["startAngle","endAngle"],n),{angle:u}=Ka(a,{x:t.x,y:t.y});Jo(u,c,d)&&i.push({element:a,datasetIndex:s,index:l});}return rr(e,o,t,r),i}function e_(e,t,o,n,i,r){let a=[],s=J6(o),l=Number.POSITIVE_INFINITY;function c(d,u,p){let m=d.inRange(t.x,t.y,i);if(n&&!m)return;let h=d.getCenterPoint(i);if(!(!!r||e.isPointInArea(h))&&!m)return;let g=s(t,h);g<l?(a=[{element:d,datasetIndex:u,index:p}],l=g):g===l&&a.push({element:d,datasetIndex:u,index:p});}return rr(e,o,t,c),a}function Dd(e,t,o,n,i,r){return !r&&!e.isPointInArea(t)?[]:o==="r"&&!n?t_(e,t,o,i):e_(e,t,o,n,i,r)}function Z1(e,t,o,n,i){let r=[],a=o==="x"?"inXRange":"inYRange",s=false;return rr(e,o,t,(l,c,d)=>{l[a](t[o],i)&&(r.push({element:l,datasetIndex:c,index:d}),s=s||l.inRange(t.x,t.y,i));}),n&&!s?[]:r}var o_={modes:{index(e,t,o,n){let i=Ge(t,e),r=o.axis||"x",a=o.includeInvisible||false,s=o.intersect?Rd(e,i,r,n,a):Dd(e,i,r,false,n,a),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let d=s[0].index,u=c.data[d];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:d});}),l):[]},dataset(e,t,o,n){let i=Ge(t,e),r=o.axis||"xy",a=o.includeInvisible||false,s=o.intersect?Rd(e,i,r,n,a):Dd(e,i,r,false,n,a);if(s.length>0){let l=s[0].datasetIndex,c=e.getDatasetMeta(l).data;s=[];for(let d=0;d<c.length;++d)s.push({element:c[d],datasetIndex:l,index:d});}return s},point(e,t,o,n){let i=Ge(t,e),r=o.axis||"xy",a=o.includeInvisible||false;return Rd(e,i,r,n,a)},nearest(e,t,o,n){let i=Ge(t,e),r=o.axis||"xy",a=o.includeInvisible||false;return Dd(e,i,r,o.intersect,n,a)},x(e,t,o,n){let i=Ge(t,e);return Z1(e,i,"x",o.intersect,n)},y(e,t,o,n){let i=Ge(t,e);return Z1(e,i,"y",o.intersect,n)}}},A0=["left","top","right","bottom"];function Ki(e,t){return e.filter(o=>o.pos===t)}function X1(e,t){return e.filter(o=>A0.indexOf(o.pos)===-1&&o.box.axis===t)}function qi(e,t){return e.sort((o,n)=>{let i=t?n:o,r=t?o:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight})}function n_(e){let t=[],o,n,i,r,a,s;for(o=0,n=(e||[]).length;o<n;++o)i=e[o],{position:r,options:{stack:a,stackWeight:s=1}}=i,t.push({index:o,box:i,pos:r,horizontal:i.isHorizontal(),weight:i.weight,stack:a&&r+a,stackWeight:s});return t}function i_(e){let t={};for(let o of e){let{stack:n,pos:i,stackWeight:r}=o;if(!n||!A0.includes(i))continue;let a=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=r;}return t}function r_(e,t){let o=i_(e),{vBoxMaxWidth:n,hBoxMaxHeight:i}=t,r,a,s;for(r=0,a=e.length;r<a;++r){s=e[r];let{fullSize:l}=s.box,c=o[s.stack],d=c&&s.stackWeight/c.weight;s.horizontal?(s.width=d?d*n:l&&t.availableWidth,s.height=i):(s.width=n,s.height=d?d*i:l&&t.availableHeight);}return o}function a_(e){let t=n_(e),o=qi(t.filter(c=>c.box.fullSize),true),n=qi(Ki(t,"left"),true),i=qi(Ki(t,"right")),r=qi(Ki(t,"top"),true),a=qi(Ki(t,"bottom")),s=X1(t,"x"),l=X1(t,"y");return {fullSize:o,leftAndTop:n.concat(r),rightAndBottom:i.concat(l).concat(a).concat(s),chartArea:Ki(t,"chartArea"),vertical:n.concat(i).concat(l),horizontal:r.concat(a).concat(s)}}function K1(e,t,o,n){return Math.max(e[o],t[o])+Math.max(e[n],t[n])}function M0(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right);}function s_(e,t,o,n){let{pos:i,box:r}=o,a=e.maxPadding;if(!z(i)){o.size&&(e[i]-=o.size);let u=n[o.stack]||{size:0,count:1};u.size=Math.max(u.size,o.horizontal?r.height:r.width),o.size=u.size/u.count,e[i]+=o.size;}r.getPadding&&M0(a,r.getPadding());let s=Math.max(0,t.outerWidth-K1(a,e,"left","right")),l=Math.max(0,t.outerHeight-K1(a,e,"top","bottom")),c=s!==e.w,d=l!==e.h;return e.w=s,e.h=l,o.horizontal?{same:c,other:d}:{same:d,other:c}}function l_(e){let t=e.maxPadding;function o(n){let i=Math.max(t[n]-e[n],0);return e[n]+=i,i}e.y+=o("top"),e.x+=o("left"),o("right"),o("bottom");}function c_(e,t){let o=t.maxPadding;function n(i){let r={left:0,top:0,right:0,bottom:0};return i.forEach(a=>{r[a]=Math.max(t[a],o[a]);}),r}return n(e?["left","right"]:["top","bottom"])}function Ji(e,t,o,n){let i=[],r,a,s,l,c,d;for(r=0,a=e.length,c=0;r<a;++r){s=e[r],l=s.box,l.update(s.width||t.w,s.height||t.h,c_(s.horizontal,t));let{same:u,other:p}=s_(t,o,s,n);c|=u&&i.length,d=d||p,l.fullSize||i.push(s);}return c&&Ji(i,t,o,n)||d}function xs(e,t,o,n,i){e.top=o,e.left=t,e.right=t+n,e.bottom=o+i,e.width=n,e.height=i;}function q1(e,t,o,n){let i=o.padding,{x:r,y:a}=t;for(let s of e){let l=s.box,c=n[s.stack]||{placed:0,weight:1},d=s.stackWeight/c.weight||1;if(s.horizontal){let u=t.w*d,p=c.size||l.height;st(c.start)&&(a=c.start),l.fullSize?xs(l,i.left,a,o.outerWidth-i.right-i.left,p):xs(l,t.left+c.placed,a,u,p),c.start=a,c.placed+=u,a=l.bottom;}else {let u=t.h*d,p=c.size||l.width;st(c.start)&&(r=c.start),l.fullSize?xs(l,r,i.top,p,o.outerHeight-i.bottom-i.top):xs(l,r,t.top+c.placed,p,u),c.start=r,c.placed+=u,r=l.right;}}t.x=r,t.y=a;}H.set("layout",{autoPadding:true,padding:{top:0,right:0,bottom:0,left:0}});var ae={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||false,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return [{z:0,draw(o){t.draw(o);}}]},e.boxes.push(t);},removeBox(e,t){let o=e.boxes?e.boxes.indexOf(t):-1;o!==-1&&e.boxes.splice(o,1);},configure(e,t,o){t.fullSize=o.fullSize,t.position=o.position,t.weight=o.weight;},update(e,t,o,n){if(!e)return;let i=ut(e.options.layout.padding),r=Math.max(t-i.width,0),a=Math.max(o-i.height,0),s=a_(e.boxes),l=s.vertical,c=s.horizontal;K(e.boxes,f=>{typeof f.beforeLayout=="function"&&f.beforeLayout();});let d=l.reduce((f,g)=>g.box.options&&g.box.options.display===false?f:f+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:o,padding:i,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/d,hBoxMaxHeight:a/2}),p=Object.assign({},i);M0(p,ut(n));let m=Object.assign({maxPadding:p,w:r,h:a,x:i.left,y:i.top},i),h=r_(l.concat(c),u);Ji(s.fullSize,m,u,h),Ji(l,m,u,h),Ji(c,m,u,h)&&Ji(l,m,u,h),l_(m),q1(s.leftAndTop,m,u,h),m.x+=m.w,m.y+=m.h,q1(s.rightAndBottom,m,u,h),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},K(s.chartArea,f=>{let g=f.box;Object.assign(g,e.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0});});}},Ts=class{acquireContext(t,o){}releaseContext(t){return false}addEventListener(t,o,n){}removeEventListener(t,o,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,o,n,i){return o=Math.max(0,o||t.width),n=n||t.height,{width:o,height:Math.max(0,i?Math.floor(o/i):n)}}isAttached(t){return true}updateConfig(t){}},Wd=class extends Ts{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=false;}},Ss="$chartjs",d_={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Q1=e=>e===null||e==="";function u_(e,t){let o=e.style,n=e.getAttribute("height"),i=e.getAttribute("width");if(e[Ss]={initial:{height:n,width:i,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",Q1(i)){let r=ps(e,"width");r!==void 0&&(e.width=r);}if(Q1(n))if(e.style.height==="")e.height=e.width/(t||2);else {let r=ps(e,"height");r!==void 0&&(e.height=r);}return e}var I0=Ad?{passive:true}:false;function p_(e,t,o){e.addEventListener(t,o,I0);}function h_(e,t,o){e.canvas.removeEventListener(t,o,I0);}function m_(e,t){let o=d_[e.type]||e.type,{x:n,y:i}=Ge(e,t);return {type:o,chart:t,native:e,x:n!==void 0?n:null,y:i!==void 0?i:null}}function ks(e,t){for(let o of e)if(o===t||o.contains(t))return true}function f_(e,t,o){let n=e.canvas,i=new MutationObserver(r=>{let a=false;for(let s of r)a=a||ks(s.addedNodes,n),a=a&&!ks(s.removedNodes,n);a&&o();});return i.observe(document,{childList:true,subtree:true}),i}function g_(e,t,o){let n=e.canvas,i=new MutationObserver(r=>{let a=false;for(let s of r)a=a||ks(s.removedNodes,n),a=a&&!ks(s.addedNodes,n);a&&o();});return i.observe(document,{childList:true,subtree:true}),i}var nr=new Map,J1=0;function L0(){let e=window.devicePixelRatio;e!==J1&&(J1=e,nr.forEach((t,o)=>{o.currentDevicePixelRatio!==e&&t();}));}function y_(e,t){nr.size||window.addEventListener("resize",L0),nr.set(e,t);}function x_(e){nr.delete(e),nr.size||window.removeEventListener("resize",L0);}function b_(e,t,o){let n=e.canvas,i=n&&Yi(n);if(!i)return;let r=ts((s,l)=>{let c=i.clientWidth;o(s,l),c<i.clientWidth&&o();},window),a=new ResizeObserver(s=>{let l=s[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||r(c,d);});return a.observe(i),y_(e,r),a}function Nd(e,t,o){o&&o.disconnect(),t==="resize"&&x_(e);}function C_(e,t,o){let n=e.canvas,i=ts(r=>{e.ctx!==null&&o(m_(r,e));},e,r=>{let a=r[0];return [a,a.offsetX,a.offsetY]});return p_(n,t,i),i}var Gd=class extends Ts{acquireContext(t,o){let n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(u_(t,o),n):null}releaseContext(t){let o=t.canvas;if(!o[Ss])return false;let n=o[Ss].initial;["height","width"].forEach(r=>{let a=n[r];W(a)?o.removeAttribute(r):o.setAttribute(r,a);});let i=n.style||{};return Object.keys(i).forEach(r=>{o.style[r]=i[r];}),o.width=o.width,delete o[Ss],true}addEventListener(t,o,n){this.removeEventListener(t,o);let i=t.$proxies||(t.$proxies={}),a={attach:f_,detach:g_,resize:b_}[o]||C_;i[o]=a(t,o,n);}removeEventListener(t,o){let n=t.$proxies||(t.$proxies={}),i=n[o];if(!i)return;(({attach:Nd,detach:Nd,resize:Nd})[o]||h_)(t,o,i),n[o]=void 0;}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,o,n,i){return _d(t,o,n,i)}isAttached(t){let o=Yi(t);return !!(o&&o.isConnected)}};function P_(e){return !cs()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?Wd:Gd}var jd=class{constructor(){this._init=[];}notify(t,o,n,i){o==="beforeInit"&&(this._init=this._createDescriptors(t,true),this._notify(this._init,t,"install"));let r=i?this._descriptors(t).filter(i):this._descriptors(t),a=this._notify(r,t,o,n);return o==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,o,n,i){i=i||{};for(let r of t){let a=r.plugin,s=a[n],l=[o,i,r.options];if(X(s,l,a)===false&&i.cancelable)return false}return true}invalidate(){W(this._cache)||(this._oldCache=this._cache,this._cache=void 0);}_descriptors(t){if(this._cache)return this._cache;let o=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),o}_createDescriptors(t,o){let n=t&&t.config,i=U(n.options&&n.options.plugins,{}),r=S_(n);return i===false&&!o?[]:k_(t,r,i,o)}_notifyStateChanges(t){let o=this._oldCache||[],n=this._cache,i=(r,a)=>r.filter(s=>!a.some(l=>s.plugin.id===l.plugin.id));this._notify(i(o,n),t,"stop"),this._notify(i(n,o),t,"start");}};function S_(e){let t={},o=[],n=Object.keys(Le.plugins.items);for(let r=0;r<n.length;r++)o.push(Le.getPlugin(n[r]));let i=e.plugins||[];for(let r=0;r<i.length;r++){let a=i[r];o.indexOf(a)===-1&&(o.push(a),t[a.id]=true);}return {plugins:o,localIds:t}}function T_(e,t){return !t&&e===false?null:e===true?{}:e}function k_(e,{plugins:t,localIds:o},n,i){let r=[],a=e.getContext();for(let s of t){let l=s.id,c=T_(n[l],i);c!==null&&r.push({plugin:s,options:w_(e.config,{plugin:s,local:o[l]},c,a)});}return r}function w_(e,{plugin:t,local:o},n,i){let r=e.pluginScopeKeys(t),a=e.getOptionScopes(n,r);return o&&t.defaults&&a.push(t.defaults),e.createResolver(a,i,[""],{scriptable:false,indexable:false,allKeys:true})}function Yd(e,t){let o=H.datasets[e]||{};return ((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||o.indexAxis||"x"}function v_(e,t){let o=e;return e==="_index_"?o=t:e==="_value_"&&(o=t==="x"?"y":"x"),o}function __(e,t){return e===t?"_index_":"_value_"}function A_(e){if(e==="top"||e==="bottom")return "x";if(e==="left"||e==="right")return "y"}function Zd(e,t){return e==="x"||e==="y"?e:t.axis||A_(t.position)||e.charAt(0).toLowerCase()}function M_(e,t){let o=yo[e.type]||{scales:{}},n=t.scales||{},i=Yd(e.type,t),r=Object.create(null),a=Object.create(null);return Object.keys(n).forEach(s=>{let l=n[s];if(!z(l))return console.error(`Invalid scale configuration for scale: ${s}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);let c=Zd(s,l),d=__(c,i),u=o.scales||{};r[c]=r[c]||s,a[s]=Ko(Object.create(null),[{axis:c},l,u[c],u[d]]);}),e.data.datasets.forEach(s=>{let l=s.type||e.type,c=s.indexAxis||Yd(l,t),u=(yo[l]||{}).scales||{};Object.keys(u).forEach(p=>{let m=v_(p,c),h=s[m+"AxisID"]||r[m]||m;a[h]=a[h]||Object.create(null),Ko(a[h],[{axis:m},n[h],u[p]]);});}),Object.keys(a).forEach(s=>{let l=a[s];Ko(l,[H.scales[l.type],H.scale]);}),a}function B0(e){let t=e.options||(e.options={});t.plugins=U(t.plugins,{}),t.scales=M_(e,t);}function E0(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function I_(e){return e=e||{},e.data=E0(e.data),B0(e),e}var t0=new Map,F0=new Set;function bs(e,t){let o=t0.get(e);return o||(o=t(),t0.set(e,o),F0.add(o)),o}var Qi=(e,t,o)=>{let n=Ae(t,o);n!==void 0&&e.add(n);},Xd=class{constructor(t){this._config=I_(t),this._scopeCache=new Map,this._resolverCache=new Map;}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t;}get data(){return this._config.data}set data(t){this._config.data=E0(t);}get options(){return this._config.options}set options(t){this._config.options=t;}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),B0(t);}clearCache(){this._scopeCache.clear(),this._resolverCache.clear();}datasetScopeKeys(t){return bs(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,o){return bs(`${t}.transition.${o}`,()=>[[`datasets.${t}.transitions.${o}`,`transitions.${o}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,o){return bs(`${t}-${o}`,()=>[[`datasets.${t}.elements.${o}`,`datasets.${t}`,`elements.${o}`,""]])}pluginScopeKeys(t){let o=t.id,n=this.type;return bs(`${n}-plugin-${o}`,()=>[[`plugins.${o}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,o){let n=this._scopeCache,i=n.get(t);return (!i||o)&&(i=new Map,n.set(t,i)),i}getOptionScopes(t,o,n){let{options:i,type:r}=this,a=this._cachedScopes(t,n),s=a.get(o);if(s)return s;let l=new Set;o.forEach(d=>{t&&(l.add(t),d.forEach(u=>Qi(l,t,u))),d.forEach(u=>Qi(l,i,u)),d.forEach(u=>Qi(l,yo[r]||{},u)),d.forEach(u=>Qi(l,H,u)),d.forEach(u=>Qi(l,ns,u));});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),F0.has(o)&&a.set(o,c),c}chartOptionScopes(){let{options:t,type:o}=this;return [t,yo[o]||{},H.datasets[o]||{},{type:o},H,ns]}resolveNamedOptions(t,o,n,i=[""]){let r={$shared:true},{resolver:a,subPrefixes:s}=e0(this._resolverCache,t,i),l=a;if(B_(a,o)){r.$shared=false,n=Tt(n)?n():n;let c=this.createResolver(t,n,s);l=go(a,n,c);}for(let c of o)r[c]=l[c];return r}createResolver(t,o,n=[""],i){let{resolver:r}=e0(this._resolverCache,t,n);return z(o)?go(r,o,void 0,i):r}};function e0(e,t,o){let n=e.get(t);n||(n=new Map,e.set(t,n));let i=o.join(),r=n.get(i);return r||(r={resolver:ji(t,o),subPrefixes:o.filter(s=>!s.toLowerCase().includes("hover"))},n.set(i,r)),r}var L_=e=>z(e)&&Object.getOwnPropertyNames(e).reduce((t,o)=>t||Tt(e[o]),false);function B_(e,t){let{isScriptable:o,isIndexable:n}=ss(e);for(let i of t){let r=o(i),a=n(i),s=(a||r)&&e[i];if(r&&(Tt(s)||L_(s))||a&&Z(s))return true}return false}var E_="3.9.1",F_=["top","bottom","left","right","chartArea"];function o0(e,t){return e==="top"||e==="bottom"||F_.indexOf(e)===-1&&t==="x"}function n0(e,t){return function(o,n){return o[e]===n[e]?o[t]-n[t]:o[e]-n[e]}}function i0(e){let t=e.chart,o=t.options.animation;t.notifyPlugins("afterRender"),X(o&&o.onComplete,[e],t);}function R_(e){let t=e.chart,o=t.options.animation;X(o&&o.onProgress,[e],t);}function R0(e){return cs()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var ws={},D0=e=>{let t=R0(e);return Object.values(ws).filter(o=>o.canvas===t).pop()};function D_(e,t,o){let n=Object.keys(e);for(let i of n){let r=+i;if(r>=t){let a=e[i];delete e[i],(o>0||r>t)&&(e[r+o]=a);}}}function N_(e,t,o,n){return !o||e.type==="mouseout"?null:n?t:e}var Et=class{constructor(t,o){let n=this.config=new Xd(o),i=R0(t),r=D0(i);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||P_(i)),this.platform.updateConfig(n);let s=this.platform.acquireContext(i,a.aspectRatio),l=s&&s.canvas,c=l&&l.height,d=l&&l.width;if(this.id=rd(),this.ctx=s,this.canvas=l,this.width=d,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new jd,this.$proxies={},this._hiddenIndices={},this.attached=false,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=md(u=>this.update(u),a.resizeDelay||0),this._dataChanges=[],ws[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}je.listen(this,"complete",i0),je.listen(this,"progress",R_),this._initialize(),this.attached&&this.update();}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:o},width:n,height:i,_aspectRatio:r}=this;return W(t)?o&&r?r:i?n/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t;}get options(){return this._options}set options(t){this.config.options=t;}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():us(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return is(this.canvas,this.ctx),this}stop(){return je.stop(this),this}resize(t,o){je.running(this)?this._resizeBeforeDraw={width:t,height:o}:this._resize(t,o);}_resize(t,o){let n=this.options,i=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(i,t,o,r),s=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,us(this,s,true)&&(this.notifyPlugins("resize",{size:a}),X(n.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render());}ensureScalesHaveIDs(){let o=this.options.scales||{};K(o,(n,i)=>{n.id=i;});}buildOrUpdateScales(){let t=this.options,o=t.scales,n=this.scales,i=Object.keys(n).reduce((a,s)=>(a[s]=false,a),{}),r=[];o&&(r=r.concat(Object.keys(o).map(a=>{let s=o[a],l=Zd(a,s),c=l==="r",d=l==="x";return {options:s,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),K(r,a=>{let s=a.options,l=s.id,c=Zd(l,s),d=U(s.type,a.dtype);(s.position===void 0||o0(s.position,c)!==o0(a.dposition))&&(s.position=a.dposition),i[l]=true;let u=null;if(l in n&&n[l].type===d)u=n[l];else {let p=Le.getScale(d);u=new p({id:l,type:d,ctx:this.ctx,chart:this}),n[u.id]=u;}u.init(s,t);}),K(i,(a,s)=>{a||delete n[s];}),K(n,a=>{ae.configure(this,a,a.options),ae.addBox(this,a);});}_updateMetasets(){let t=this._metasets,o=this.data.datasets.length,n=t.length;if(t.sort((i,r)=>i.index-r.index),n>o){for(let i=o;i<n;++i)this._destroyDatasetMeta(i);t.splice(o,n-o);}this._sortedMetasets=t.slice(0).sort(n0("order","index"));}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:o}}=this;t.length>o.length&&delete this._stacks,t.forEach((n,i)=>{o.filter(r=>r===n._dataset).length===0&&this._destroyDatasetMeta(i);});}buildOrUpdateControllers(){let t=[],o=this.data.datasets,n,i;for(this._removeUnreferencedMetasets(),n=0,i=o.length;n<i;n++){let r=o[n],a=this.getDatasetMeta(n),s=r.type||this.config.type;if(a.type&&a.type!==s&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=s,a.indexAxis=r.indexAxis||Yd(s,this.options),a.order=r.order||0,a.index=n,a.label=""+r.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else {let l=Le.getController(s),{datasetElementType:c,dataElementType:d}=H.datasets[s];Object.assign(l.prototype,{dataElementType:Le.getElement(d),datasetElementType:c&&Le.getElement(c)}),a.controller=new l(this,n),t.push(a.controller);}}return this._updateMetasets(),t}_resetElements(){K(this.data.datasets,(t,o)=>{this.getDatasetMeta(o).controller.reset();},this);}reset(){this._resetElements(),this.notifyPlugins("reset");}update(t){let o=this.config;o.update();let n=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:true})===false)return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,d=this.data.datasets.length;c<d;c++){let{controller:u}=this.getDatasetMeta(c),p=!i&&r.indexOf(u)===-1;u.buildOrUpdateElements(p),a=Math.max(+u.getMaxOverflow(),a);}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),i||K(r,c=>{c.reset();}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(n0("z","_idx"));let{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,true):s.length&&this._updateHoverStyles(s,s,true),this.render();}_updateScales(){K(this.scales,t=>{ae.removeBox(this,t);}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales();}_checkEventBindings(){let t=this.options,o=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!ja(o,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents());}_updateHiddenIndices(){let{_hiddenIndices:t}=this,o=this._getUniformDataChanges()||[];for(let{method:n,start:i,count:r}of o){let a=n==="_removeElements"?-r:r;D_(t,i,a);}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let o=this.data.datasets.length,n=r=>new Set(t.filter(a=>a[0]===r).map((a,s)=>s+","+a.splice(1).join(","))),i=n(0);for(let r=1;r<o;r++)if(!ja(i,n(r)))return;return Array.from(i).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:true})===false)return;ae.update(this,this.width,this.height,t);let o=this.chartArea,n=o.width<=0||o.height<=0;this._layers=[],K(this.boxes,i=>{n&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()));},this),this._layers.forEach((i,r)=>{i._idx=r;}),this.notifyPlugins("afterLayout");}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:true})!==false){for(let o=0,n=this.data.datasets.length;o<n;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,n=this.data.datasets.length;o<n;++o)this._updateDataset(o,Tt(t)?t({datasetIndex:o}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t});}}_updateDataset(t,o){let n=this.getDatasetMeta(t),i={meta:n,index:t,mode:o,cancelable:true};this.notifyPlugins("beforeDatasetUpdate",i)!==false&&(n.controller._update(o),i.cancelable=false,this.notifyPlugins("afterDatasetUpdate",i));}render(){this.notifyPlugins("beforeRender",{cancelable:true})!==false&&(je.has(this)?this.attached&&!je.running(this)&&je.start(this):(this.draw(),i0({chart:this})));}draw(){let t;if(this._resizeBeforeDraw){let{width:n,height:i}=this._resizeBeforeDraw;this._resize(n,i),this._resizeBeforeDraw=null;}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:true})===false)return;let o=this._layers;for(t=0;t<o.length&&o[t].z<=0;++t)o[t].draw(this.chartArea);for(this._drawDatasets();t<o.length;++t)o[t].draw(this.chartArea);this.notifyPlugins("afterDraw");}_getSortedDatasetMetas(t){let o=this._sortedMetasets,n=[],i,r;for(i=0,r=o.length;i<r;++i){let a=o[i];(!t||a.visible)&&n.push(a);}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(true)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:true})===false)return;let t=this.getSortedVisibleDatasetMetas();for(let o=t.length-1;o>=0;--o)this._drawDataset(t[o]);this.notifyPlugins("afterDatasetsDraw");}_drawDataset(t){let o=this.ctx,n=t._clip,i=!n.disabled,r=this.chartArea,a={meta:t,index:t.index,cancelable:true};this.notifyPlugins("beforeDatasetDraw",a)!==false&&(i&&xo(o,{left:n.left===false?0:r.left-n.left,right:n.right===false?this.width:r.right+n.right,top:n.top===false?0:r.top-n.top,bottom:n.bottom===false?this.height:r.bottom+n.bottom}),t.controller.draw(),i&&bo(o),a.cancelable=false,this.notifyPlugins("afterDatasetDraw",a));}isPointInArea(t){return Xo(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,o,n,i){let r=o_.modes[o];return typeof r=="function"?r(this,t,n,i):[]}getDatasetMeta(t){let o=this.data.datasets[t],n=this._metasets,i=n.filter(r=>r&&r._dataset===o).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:t,_dataset:o,_parsed:[],_sorted:false},n.push(i)),i}getContext(){return this.$context||(this.$context=Me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let o=this.data.datasets[t];if(!o)return false;let n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!o.hidden}setDatasetVisibility(t,o){let n=this.getDatasetMeta(t);n.hidden=!o;}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t];}getDataVisibility(t){return !this._hiddenIndices[t]}_updateVisibility(t,o,n){let i=n?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,i);st(o)?(r.data[o].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(r,{visible:n}),this.update(s=>s.datasetIndex===t?i:void 0));}hide(t,o){this._updateVisibility(t,o,false);}show(t,o){this._updateVisibility(t,o,true);}_destroyDatasetMeta(t){let o=this._metasets[t];o&&o.controller&&o.controller._destroy(),delete this._metasets[t];}_stop(){let t,o;for(this.stop(),je.remove(this),t=0,o=this.data.datasets.length;t<o;++t)this._destroyDatasetMeta(t);}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:o}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),is(t,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete ws[this.id],this.notifyPlugins("afterDestroy");}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=true;}bindUserEvents(){let t=this._listeners,o=this.platform,n=(r,a)=>{o.addEventListener(this,r,a),t[r]=a;},i=(r,a,s)=>{r.offsetX=a,r.offsetY=s,this._eventHandler(r);};K(this.options.events,r=>n(r,i));}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,o=this.platform,n=(l,c)=>{o.addEventListener(this,l,c),t[l]=c;},i=(l,c)=>{t[l]&&(o.removeEventListener(this,l,c),delete t[l]);},r=(l,c)=>{this.canvas&&this.resize(l,c);},a,s=()=>{i("attach",s),this.attached=true,this.resize(),n("resize",r),n("detach",a);};a=()=>{this.attached=false,i("resize",r),this._stop(),this._resize(0,0),n("attach",s);},o.isAttached(this.canvas)?s():a();}unbindEvents(){K(this._listeners,(t,o)=>{this.platform.removeEventListener(this,o,t);}),this._listeners={},K(this._responsiveListeners,(t,o)=>{this.platform.removeEventListener(this,o,t);}),this._responsiveListeners=void 0;}updateHoverStyle(t,o,n){let i=n?"set":"remove",r,a,s,l;for(o==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),s=0,l=t.length;s<l;++s){a=t[s];let c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[i+"HoverStyle"](a.element,a.datasetIndex,a.index);}}getActiveElements(){return this._active||[]}setActiveElements(t){let o=this._active||[],n=t.map(({datasetIndex:r,index:a})=>{let s=this.getDatasetMeta(r);if(!s)throw new Error("No dataset found at index "+r);return {datasetIndex:r,element:s.data[a],index:a}});!zn(n,o)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,o));}notifyPlugins(t,o,n){return this._plugins.notify(this,t,o,n)}_updateHoverStyles(t,o,n){let i=this.options.hover,r=(l,c)=>l.filter(d=>!c.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),a=r(o,t),s=n?t:r(t,o);a.length&&this.updateHoverStyle(a,i.mode,false),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,true);}_eventHandler(t,o){let n={event:t,replay:o,cancelable:true,inChartArea:this.isPointInArea(t)},i=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,i)===false)return;let r=this._handleEvent(t,o,n.inChartArea);return n.cancelable=false,this.notifyPlugins("afterEvent",n,i),(r||n.changed)&&this.render(),this}_handleEvent(t,o,n){let{_active:i=[],options:r}=this,a=o,s=this._getActiveElements(t,i,n,a),l=sd(t),c=N_(t,this._lastEvent,n,l);n&&(this._lastEvent=null,X(r.onHover,[t,s,this],this),l&&X(r.onClick,[t,s,this],this));let d=!zn(s,i);return (d||o)&&(this._active=s,this._updateHoverStyles(s,i,o)),this._lastEvent=c,d}_getActiveElements(t,o,n,i){if(t.type==="mouseout")return [];if(!n)return o;let r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,i)}},r0=()=>K(Et.instances,e=>e._plugins.invalidate()),Po=true;Object.defineProperties(Et,{defaults:{enumerable:Po,value:H},instances:{enumerable:Po,value:ws},overrides:{enumerable:Po,value:yo},registry:{enumerable:Po,value:Le},version:{enumerable:Po,value:E_},getChart:{enumerable:Po,value:D0},register:{enumerable:Po,value:(...e)=>{Le.add(...e),r0();}},unregister:{enumerable:Po,value:(...e)=>{Le.remove(...e),r0();}}});function N0(e,t,o){let{startAngle:n,pixelMargin:i,x:r,y:a,outerRadius:s,innerRadius:l}=t,c=i/s;e.beginPath(),e.arc(r,a,s,n-c,o+c),l>i?(c=i/l,e.arc(r,a,l,o+c,n-c,true)):e.arc(r,a,i,o+et,n-et),e.closePath(),e.clip();}function O_(e){return Gi(e,["outerStart","outerEnd","innerStart","innerEnd"])}function U_(e,t,o,n){let i=O_(e.options.borderRadius),r=(o-t)/2,a=Math.min(r,n*t/2),s=l=>{let c=(o-Math.min(r,l))*n/2;return Ct(l,0,Math.min(r,c))};return {outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:Ct(i.innerStart,0,a),innerEnd:Ct(i.innerEnd,0,a)}}function $n(e,t,o,n){return {x:o+e*Math.cos(t),y:n+e*Math.sin(t)}}function Kd(e,t,o,n,i,r){let{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:d}=t,u=Math.max(t.outerRadius+n+o-c,0),p=d>0?d+n+o+c:0,m=0,h=i-l;if(n){let F=d>0?d-n:0,$=u>0?u-n:0,J=(F+$)/2,Ft=J!==0?h*J/(J+n):h;m=(h-Ft)/2;}let f=Math.max(.001,h*u-o/G)/u,g=(h-f)/2,y=l+g+m,P=i-g-m,{outerStart:T,outerEnd:k,innerStart:w,innerEnd:v}=U_(t,p,u,P-y),A=u-T,M=u-k,I=y+T/A,B=P-k/M,L=p+w,E=p+v,O=y+w/L,N=P-v/E;if(e.beginPath(),r){if(e.arc(a,s,u,I,B),k>0){let J=$n(M,B,a,s);e.arc(J.x,J.y,k,B,P+et);}let F=$n(E,P,a,s);if(e.lineTo(F.x,F.y),v>0){let J=$n(E,N,a,s);e.arc(J.x,J.y,v,P+et,N+Math.PI);}if(e.arc(a,s,p,P-v/p,y+w/p,true),w>0){let J=$n(L,O,a,s);e.arc(J.x,J.y,w,O+Math.PI,y-et);}let $=$n(A,y,a,s);if(e.lineTo($.x,$.y),T>0){let J=$n(A,I,a,s);e.arc(J.x,J.y,T,y-et,I);}}else {e.moveTo(a,s);let F=Math.cos(I)*u+a,$=Math.sin(I)*u+s;e.lineTo(F,$);let J=Math.cos(B)*u+a,Ft=Math.sin(B)*u+s;e.lineTo(J,Ft);}e.closePath();}function z_(e,t,o,n,i){let{fullCircles:r,startAngle:a,circumference:s}=t,l=t.endAngle;if(r){Kd(e,t,o,n,a+Q,i);for(let c=0;c<r;++c)e.fill();isNaN(s)||(l=a+s%Q,s%Q===0&&(l+=Q));}return Kd(e,t,o,n,l,i),e.fill(),l}function $_(e,t,o){let{x:n,y:i,startAngle:r,pixelMargin:a,fullCircles:s}=t,l=Math.max(t.outerRadius-a,0),c=t.innerRadius+a,d;for(o&&N0(e,t,r+Q),e.beginPath(),e.arc(n,i,c,r+Q,r,true),d=0;d<s;++d)e.stroke();for(e.beginPath(),e.arc(n,i,l,r,r+Q),d=0;d<s;++d)e.stroke();}function V_(e,t,o,n,i,r){let{options:a}=t,{borderWidth:s,borderJoinStyle:l}=a,c=a.borderAlign==="inner";s&&(c?(e.lineWidth=s*2,e.lineJoin=l||"round"):(e.lineWidth=s,e.lineJoin=l||"bevel"),t.fullCircles&&$_(e,t,c),c&&N0(e,t,i),Kd(e,t,o,n,i,r),e.stroke());}var Ze=class extends xt{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t);}inRange(t,o,n){let i=this.getProps(["x","y"],n),{angle:r,distance:a}=Ka(i,{x:t,y:o}),{startAngle:s,endAngle:l,innerRadius:c,outerRadius:d,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),p=this.options.spacing/2,h=U(u,l-s)>=Q||Jo(r,s,l),f=me(a,c+p,d+p);return h&&f}getCenterPoint(t){let{x:o,y:n,startAngle:i,endAngle:r,innerRadius:a,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,d=(i+r)/2,u=(a+s+c+l)/2;return {x:o+Math.cos(d)*u,y:n+Math.sin(d)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:o,circumference:n}=this,i=(o.offset||0)/2,r=(o.spacing||0)/2,a=o.circular;if(this.pixelMargin=o.borderAlign==="inner"?.33:0,this.fullCircles=n>Q?Math.floor(n/Q):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let s=0;if(i){s=i/2;let c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*s,Math.sin(c)*s),this.circumference>=G&&(s=i);}t.fillStyle=o.backgroundColor,t.strokeStyle=o.borderColor;let l=z_(t,this,s,r,a);V_(t,this,s,r,l,a),t.restore();}};Ze.id="arc";Ze.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:true};Ze.defaultRoutes={backgroundColor:"backgroundColor"};function O0(e,t,o=t){e.lineCap=U(o.borderCapStyle,t.borderCapStyle),e.setLineDash(U(o.borderDash,t.borderDash)),e.lineDashOffset=U(o.borderDashOffset,t.borderDashOffset),e.lineJoin=U(o.borderJoinStyle,t.borderJoinStyle),e.lineWidth=U(o.borderWidth,t.borderWidth),e.strokeStyle=U(o.borderColor,t.borderColor);}function H_(e,t,o){e.lineTo(o.x,o.y);}function W_(e){return e.stepped?Pd:e.tension||e.cubicInterpolationMode==="monotone"?Sd:H_}function U0(e,t,o={}){let n=e.length,{start:i=0,end:r=n-1}=o,{start:a,end:s}=t,l=Math.max(i,a),c=Math.min(r,s),d=i<a&&r<a||i>s&&r>s;return {count:n,start:l,loop:t.loop,ilen:c<l&&!d?n+c-l:c-l}}function G_(e,t,o,n){let{points:i,options:r}=t,{count:a,start:s,loop:l,ilen:c}=U0(i,o,n),d=W_(r),{move:u=true,reverse:p}=n||{},m,h,f;for(m=0;m<=c;++m)h=i[(s+(p?c-m:m))%a],!h.skip&&(u?(e.moveTo(h.x,h.y),u=false):d(e,f,h,p,r.stepped),f=h);return l&&(h=i[(s+(p?c:0))%a],d(e,f,h,p,r.stepped)),!!l}function j_(e,t,o,n){let i=t.points,{count:r,start:a,ilen:s}=U0(i,o,n),{move:l=true,reverse:c}=n||{},d=0,u=0,p,m,h,f,g,y,P=k=>(a+(c?s-k:k))%r,T=()=>{f!==g&&(e.lineTo(d,g),e.lineTo(d,f),e.lineTo(d,y));};for(l&&(m=i[P(0)],e.moveTo(m.x,m.y)),p=0;p<=s;++p){if(m=i[P(p)],m.skip)continue;let k=m.x,w=m.y,v=k|0;v===h?(w<f?f=w:w>g&&(g=w),d=(u*d+k)/++u):(T(),e.lineTo(k,w),h=v,u=0,f=g=w),y=w;}T();}function qd(e){let t=e.options,o=t.borderDash&&t.borderDash.length;return !e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!o?j_:G_}function Y_(e){return e.stepped?Md:e.tension||e.cubicInterpolationMode==="monotone"?Id:Ue}function Z_(e,t,o,n){let i=t._path;i||(i=t._path=new Path2D,t.path(i,o,n)&&i.closePath()),O0(e,t.options),e.stroke(i);}function X_(e,t,o,n){let{segments:i,options:r}=t,a=qd(t);for(let s of i)O0(e,r,s.style),e.beginPath(),a(e,t,s,{start:o,end:o+n-1})&&e.closePath(),e.stroke();}var K_=typeof Path2D=="function";function q_(e,t,o,n){K_&&!t.options.segment?Z_(e,t,o,n):X_(e,t,o,n);}var ge=class extends xt{constructor(t){super(),this.animated=true,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=false,this._pointsUpdated=false,this._datasetIndex=void 0,t&&Object.assign(this,t);}updateControlPoints(t,o){let n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){let i=n.spanGaps?this._loop:this._fullLoop;vd(this._points,n,t,i,o),this._pointsUpdated=true;}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=false;}get points(){return this._points}get segments(){return this._segments||(this._segments=Ld(this,this.options.segment))}first(){let t=this.segments,o=this.points;return t.length&&o[t[0].start]}last(){let t=this.segments,o=this.points,n=t.length;return n&&o[t[n-1].end]}interpolate(t,o){let n=this.options,i=t[o],r=this.points,a=gs(this,{property:o,start:i,end:i});if(!a.length)return;let s=[],l=Y_(n),c,d;for(c=0,d=a.length;c<d;++c){let{start:u,end:p}=a[c],m=r[u],h=r[p];if(m===h){s.push(m);continue}let f=Math.abs((i-m[o])/(h[o]-m[o])),g=l(m,h,f,n.stepped);g[o]=t[o],s.push(g);}return s.length===1?s[0]:s}pathSegment(t,o,n){return qd(this)(t,this,o,n)}path(t,o,n){let i=this.segments,r=qd(this),a=this._loop;o=o||0,n=n||this.points.length-o;for(let s of i)a&=r(t,this,s,{start:o,end:o+n-1});return !!a}draw(t,o,n,i){let r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),q_(t,this,n,i),t.restore()),this.animated&&(this._pointsUpdated=false,this._path=void 0);}};ge.id="line";ge.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:true,cubicInterpolationMode:"default",fill:false,spanGaps:false,stepped:false,tension:0};ge.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};ge.descriptors={_scriptable:true,_indexable:e=>e!=="borderDash"&&e!=="fill"};function a0(e,t,o,n){let i=e.options,{[o]:r}=e.getProps([o],n);return Math.abs(t-r)<i.radius+i.hitRadius}var Xe=class extends xt{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t);}inRange(t,o,n){let i=this.options,{x:r,y:a}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(o-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,o){return a0(this,t,"x",o)}inYRange(t,o){return a0(this,t,"y",o)}getCenterPoint(t){let{x:o,y:n}=this.getProps(["x","y"],t);return {x:o,y:n}}size(t){t=t||this.options||{};let o=t.radius||0;o=Math.max(o,o&&t.hoverRadius||0);let n=o&&t.borderWidth||0;return (o+n)*2}draw(t,o){let n=this.options;this.skip||n.radius<.1||!Xo(this,o,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,Wi(t,n,this.x,this.y));}getRange(){let t=this.options||{};return t.radius+t.hitRadius}};Xe.id="point";Xe.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};Xe.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function z0(e,t){let{x:o,y:n,base:i,width:r,height:a}=e.getProps(["x","y","base","width","height"],t),s,l,c,d,u;return e.horizontal?(u=a/2,s=Math.min(o,i),l=Math.max(o,i),c=n-u,d=n+u):(u=r/2,s=o-u,l=o+u,c=Math.min(n,i),d=Math.max(n,i)),{left:s,top:c,right:l,bottom:d}}function So(e,t,o,n){return e?0:Ct(t,o,n)}function Q_(e,t,o){let n=e.options.borderWidth,i=e.borderSkipped,r=as(n);return {t:So(i.top,r.top,0,o),r:So(i.right,r.right,0,t),b:So(i.bottom,r.bottom,0,o),l:So(i.left,r.left,0,t)}}function J_(e,t,o){let{enableBorderRadius:n}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,r=fe(i),a=Math.min(t,o),s=e.borderSkipped,l=n||z(i);return {topLeft:So(!l||s.top||s.left,r.topLeft,0,a),topRight:So(!l||s.top||s.right,r.topRight,0,a),bottomLeft:So(!l||s.bottom||s.left,r.bottomLeft,0,a),bottomRight:So(!l||s.bottom||s.right,r.bottomRight,0,a)}}function t4(e){let t=z0(e),o=t.right-t.left,n=t.bottom-t.top,i=Q_(e,o/2,n/2),r=J_(e,o/2,n/2);return {outer:{x:t.left,y:t.top,w:o,h:n,radius:r},inner:{x:t.left+i.l,y:t.top+i.t,w:o-i.l-i.r,h:n-i.t-i.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,r.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(i.b,i.r))}}}}function Od(e,t,o,n){let i=t===null,r=o===null,s=e&&!(i&&r)&&z0(e,n);return s&&(i||me(t,s.left,s.right))&&(r||me(o,s.top,s.bottom))}function e4(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function o4(e,t){e.rect(t.x,t.y,t.w,t.h);}function Ud(e,t,o={}){let n=e.x!==o.x?-t:0,i=e.y!==o.y?-t:0,r=(e.x+e.w!==o.x+o.w?t:0)-n,a=(e.y+e.h!==o.y+o.h?t:0)-i;return {x:e.x+n,y:e.y+i,w:e.w+r,h:e.h+a,radius:e.radius}}var Ke=class extends xt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t);}draw(t){let{inflateAmount:o,options:{borderColor:n,backgroundColor:i}}=this,{inner:r,outer:a}=t4(this),s=e4(a.radius)?We:o4;t.save(),(a.w!==r.w||a.h!==r.h)&&(t.beginPath(),s(t,Ud(a,o,r)),t.clip(),s(t,Ud(r,-o,a)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),s(t,Ud(r,o)),t.fillStyle=i,t.fill(),t.restore();}inRange(t,o,n){return Od(this,t,o,n)}inXRange(t,o){return Od(this,t,null,o)}inYRange(t,o){return Od(this,null,t,o)}getCenterPoint(t){let{x:o,y:n,base:i,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return {x:r?(o+i)/2:o,y:r?n:(n+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}};Ke.id="bar";Ke.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Ke.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function n4(e,t,o){let n=e.segments,i=e.points,r=t.points,a=[];for(let s of n){let{start:l,end:c}=s;c=tu(l,c,i);let d=Qd(o,i[l],i[c],s.loop);if(!t.segments){a.push({source:s,target:d,start:i[l],end:i[c]});continue}let u=gs(t,d);for(let p of u){let m=Qd(o,r[p.start],r[p.end],p.loop),h=fs(s,i,m);for(let f of h)a.push({source:f,target:p,start:{[o]:s0(d,m,"start",Math.max)},end:{[o]:s0(d,m,"end",Math.min)}});}}return a}function Qd(e,t,o,n){if(n)return;let i=t[e],r=o[e];return e==="angle"&&(i=Bt(i),r=Bt(r)),{property:e,start:i,end:r}}function i4(e,t){let{x:o=null,y:n=null}=e||{},i=t.points,r=[];return t.segments.forEach(({start:a,end:s})=>{s=tu(a,s,i);let l=i[a],c=i[s];n!==null?(r.push({x:l.x,y:n}),r.push({x:c.x,y:n})):o!==null&&(r.push({x:o,y:l.y}),r.push({x:o,y:c.y}));}),r}function tu(e,t,o){for(;t>e;t--){let n=o[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function s0(e,t,o,n){return e&&t?n(e[o],t[o]):e?e[o]:t?t[o]:0}function $0(e,t){let o=[],n=false;return Z(e)?(n=true,o=e):o=i4(e,t),o.length?new ge({points:o,options:{tension:0},_loop:n,_fullLoop:n}):null}function l0(e){return e&&e.fill!==false}function r4(e,t,o){let i=e[t].fill,r=[t],a;if(!o)return i;for(;i!==false&&r.indexOf(i)===-1;){if(!lt(i))return i;if(a=e[i],!a)return false;if(a.visible)return i;r.push(i),i=a.fill;}return false}function a4(e,t,o){let n=d4(e);if(z(n))return isNaN(n.value)?false:n;let i=parseFloat(n);return lt(i)&&Math.floor(i)===i?s4(n[0],t,i,o):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function s4(e,t,o,n){return (e==="-"||e==="+")&&(o=t+o),o===t||o<0||o>=n?false:o}function l4(e,t){let o=null;return e==="start"?o=t.bottom:e==="end"?o=t.top:z(e)?o=t.getPixelForValue(e.value):t.getBasePixel&&(o=t.getBasePixel()),o}function c4(e,t,o){let n;return e==="start"?n=o:e==="end"?n=t.options.reverse?t.min:t.max:z(e)?n=e.value:n=t.getBaseValue(),n}function d4(e){let t=e.options,o=t.fill,n=U(o&&o.target,o);return n===void 0&&(n=!!t.backgroundColor),n===false||n===null?false:n===true?"origin":n}function u4(e){let{scale:t,index:o,line:n}=e,i=[],r=n.segments,a=n.points,s=p4(t,o);s.push($0({x:null,y:t.bottom},n));for(let l=0;l<r.length;l++){let c=r[l];for(let d=c.start;d<=c.end;d++)h4(i,a[d],s);}return new ge({points:i,options:{}})}function p4(e,t){let o=[],n=e.getMatchingVisibleMetas("line");for(let i=0;i<n.length;i++){let r=n[i];if(r.index===t)break;r.hidden||o.unshift(r.dataset);}return o}function h4(e,t,o){let n=[];for(let i=0;i<o.length;i++){let r=o[i],{first:a,last:s,point:l}=m4(r,t,"x");if(!(!l||a&&s)){if(a)n.unshift(l);else if(e.push(l),!s)break}}e.push(...n);}function m4(e,t,o){let n=e.interpolate(t,o);if(!n)return {};let i=n[o],r=e.segments,a=e.points,s=false,l=false;for(let c=0;c<r.length;c++){let d=r[c],u=a[d.start][o],p=a[d.end][o];if(me(i,u,p)){s=i===u,l=i===p;break}}return {first:s,last:l,point:n}}var vs=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius;}pathSegment(t,o,n){let{x:i,y:r,radius:a}=this;return o=o||{start:0,end:Q},t.arc(i,r,a,o.end,o.start,true),!n.bounds}interpolate(t){let{x:o,y:n,radius:i}=this,r=t.angle;return {x:o+Math.cos(r)*i,y:n+Math.sin(r)*i,angle:r}}};function f4(e){let{chart:t,fill:o,line:n}=e;if(lt(o))return g4(t,o);if(o==="stack")return u4(e);if(o==="shape")return true;let i=y4(e);return i instanceof vs?i:$0(i,n)}function g4(e,t){let o=e.getDatasetMeta(t);return o&&e.isDatasetVisible(t)?o.dataset:null}function y4(e){return (e.scale||{}).getPointPositionForValue?b4(e):x4(e)}function x4(e){let{scale:t={},fill:o}=e,n=l4(o,t);if(lt(n)){let i=t.isHorizontal();return {x:i?n:null,y:i?null:n}}return null}function b4(e){let{scale:t,fill:o}=e,n=t.options,i=t.getLabels().length,r=n.reverse?t.max:t.min,a=c4(o,t,r),s=[];if(n.grid.circular){let l=t.getPointPositionForValue(0,r);return new vs({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<i;++l)s.push(t.getPointPositionForValue(l,a));return s}function zd(e,t,o){let n=f4(t),{line:i,scale:r,axis:a}=t,s=i.options,l=s.fill,c=s.backgroundColor,{above:d=c,below:u=c}=l||{};n&&i.points.length&&(xo(e,o),C4(e,{line:i,target:n,above:d,below:u,area:o,scale:r,axis:a}),bo(e));}function C4(e,t){let{line:o,target:n,above:i,below:r,area:a,scale:s}=t,l=o._loop?"angle":t.axis;e.save(),l==="x"&&r!==i&&(c0(e,n,a.top),d0(e,{line:o,target:n,color:i,scale:s,property:l}),e.restore(),e.save(),c0(e,n,a.bottom)),d0(e,{line:o,target:n,color:r,scale:s,property:l}),e.restore();}function c0(e,t,o){let{segments:n,points:i}=t,r=true,a=false;e.beginPath();for(let s of n){let{start:l,end:c}=s,d=i[l],u=i[tu(l,c,i)];r?(e.moveTo(d.x,d.y),r=false):(e.lineTo(d.x,o),e.lineTo(d.x,d.y)),a=!!t.pathSegment(e,s,{move:a}),a?e.closePath():e.lineTo(u.x,o);}e.lineTo(t.first().x,o),e.closePath(),e.clip();}function d0(e,t){let{line:o,target:n,property:i,color:r,scale:a}=t,s=n4(o,n,i);for(let{source:l,target:c,start:d,end:u}of s){let{style:{backgroundColor:p=r}={}}=l,m=n!==true;e.save(),e.fillStyle=p,P4(e,a,m&&Qd(i,d,u)),e.beginPath();let h=!!o.pathSegment(e,l),f;if(m){h?e.closePath():u0(e,n,u,i);let g=!!n.pathSegment(e,c,{move:h,reverse:true});f=h&&g,f||u0(e,n,d,i);}e.closePath(),e.fill(f?"evenodd":"nonzero"),e.restore();}}function P4(e,t,o){let{top:n,bottom:i}=t.chart.chartArea,{property:r,start:a,end:s}=o||{};r==="x"&&(e.beginPath(),e.rect(a,n,s-a,i-n),e.clip());}function u0(e,t,o,n){let i=t.interpolate(o,n);i&&e.lineTo(i.x,i.y);}var V0={id:"filler",afterDatasetsUpdate(e,t,o){let n=(e.data.datasets||[]).length,i=[],r,a,s,l;for(a=0;a<n;++a)r=e.getDatasetMeta(a),s=r.dataset,l=null,s&&s.options&&s instanceof ge&&(l={visible:e.isDatasetVisible(a),index:a,fill:a4(s,a,n),chart:e,axis:r.controller.options.indexAxis,scale:r.vScale,line:s}),r.$filler=l,i.push(l);for(a=0;a<n;++a)l=i[a],!(!l||l.fill===false)&&(l.fill=r4(i,a,o.propagate));},beforeDraw(e,t,o){let n=o.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),r=e.chartArea;for(let a=i.length-1;a>=0;--a){let s=i[a].$filler;s&&(s.line.updateControlPoints(r,s.axis),n&&s.fill&&zd(e.ctx,s,r));}},beforeDatasetsDraw(e,t,o){if(o.drawTime!=="beforeDatasetsDraw")return;let n=e.getSortedVisibleDatasetMetas();for(let i=n.length-1;i>=0;--i){let r=n[i].$filler;l0(r)&&zd(e.ctx,r,e.chartArea);}},beforeDatasetDraw(e,t,o){let n=t.meta.$filler;!l0(n)||o.drawTime!=="beforeDatasetDraw"||zd(e.ctx,n,e.chartArea);},defaults:{propagate:true,drawTime:"beforeDatasetDraw"}},p0=(e,t)=>{let{boxHeight:o=t,boxWidth:n=t}=e;return e.usePointStyle&&(o=Math.min(o,t),n=e.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:o,itemHeight:Math.max(t,o)}},S4=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,_s=class extends xt{constructor(t){super(),this._added=false,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=false,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0;}update(t,o,n){this.maxWidth=t,this.maxHeight=o,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit();}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height);}buildLabels(){let t=this.options.labels||{},o=X(t.generateLabels,[this.chart],this)||[];t.filter&&(o=o.filter(n=>t.filter(n,this.chart.data))),t.sort&&(o=o.sort((n,i)=>t.sort(n,i,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o;}fit(){let{options:t,ctx:o}=this;if(!t.display){this.width=this.height=0;return}let n=t.labels,i=it(n.font),r=i.size,a=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=p0(n,r),c,d;o.font=i.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(a,r,s,l)+10):(d=this.maxHeight,c=this._fitCols(a,r,s,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight);}_fitRows(t,o,n,i){let{ctx:r,maxWidth:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=i+s,u=t;r.textAlign="left",r.textBaseline="middle";let p=-1,m=-d;return this.legendItems.forEach((h,f)=>{let g=n+o/2+r.measureText(h.text).width;(f===0||c[c.length-1]+g+2*s>a)&&(u+=d,c[c.length-(f>0?0:1)]=0,m+=d,p++),l[f]={left:0,top:m,row:p,width:g,height:i},c[c.length-1]+=g+s;}),u}_fitCols(t,o,n,i){let{ctx:r,maxHeight:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=a-t,u=s,p=0,m=0,h=0,f=0;return this.legendItems.forEach((g,y)=>{let P=n+o/2+r.measureText(g.text).width;y>0&&m+i+2*s>d&&(u+=p+s,c.push({width:p,height:m}),h+=p+s,f++,p=m=0),l[y]={left:h,top:m,col:f,width:P,height:i},p=Math.max(p,P),m+=i+s;}),u+=p,c.push({width:p,height:m}),u}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:n,labels:{padding:i},rtl:r}}=this,a=Co(r,this.left,this.width);if(this.isHorizontal()){let s=0,l=Pt(n,this.left+i,this.right-this.lineWidths[s]);for(let c of o)s!==c.row&&(s=c.row,l=Pt(n,this.left+i,this.right-this.lineWidths[s])),c.top+=this.top+t+i,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+i;}else {let s=0,l=Pt(n,this.top+t+i,this.bottom-this.columnSizes[s].height);for(let c of o)c.col!==s&&(s=c.col,l=Pt(n,this.top+t+i,this.bottom-this.columnSizes[s].height)),c.top=l,c.left+=this.left+i,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+i;}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;xo(t,this),this._draw(),bo(t);}}_draw(){let{options:t,columnSizes:o,lineWidths:n,ctx:i}=this,{align:r,labels:a}=t,s=H.color,l=Co(t.rtl,this.left,this.width),c=it(a.font),{color:d,padding:u}=a,p=c.size,m=p/2,h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;let{boxWidth:f,boxHeight:g,itemHeight:y}=p0(a,p),P=function(A,M,I){if(isNaN(f)||f<=0||isNaN(g)||g<0)return;i.save();let B=U(I.lineWidth,1);if(i.fillStyle=U(I.fillStyle,s),i.lineCap=U(I.lineCap,"butt"),i.lineDashOffset=U(I.lineDashOffset,0),i.lineJoin=U(I.lineJoin,"miter"),i.lineWidth=B,i.strokeStyle=U(I.strokeStyle,s),i.setLineDash(U(I.lineDash,[])),a.usePointStyle){let L={radius:g*Math.SQRT2/2,pointStyle:I.pointStyle,rotation:I.rotation,borderWidth:B},E=l.xPlus(A,f/2),O=M+m;rs(i,L,E,O,a.pointStyleWidth&&f);}else {let L=M+Math.max((p-g)/2,0),E=l.leftForLtr(A,f),O=fe(I.borderRadius);i.beginPath(),Object.values(O).some(N=>N!==0)?We(i,{x:E,y:L,w:f,h:g,radius:O}):i.rect(E,L,f,g),i.fill(),B!==0&&i.stroke();}i.restore();},T=function(A,M,I){He(i,I.text,A,M+y/2,c,{strikethrough:I.hidden,textAlign:l.textAlign(I.textAlign)});},k=this.isHorizontal(),w=this._computeTitleHeight();k?h={x:Pt(r,this.left+u,this.right-n[0]),y:this.top+u+w,line:0}:h={x:this.left+u,y:Pt(r,this.top+w+u,this.bottom-o[0].height),line:0},hs(this.ctx,t.textDirection);let v=y+u;this.legendItems.forEach((A,M)=>{i.strokeStyle=A.fontColor||d,i.fillStyle=A.fontColor||d;let I=i.measureText(A.text).width,B=l.textAlign(A.textAlign||(A.textAlign=a.textAlign)),L=f+m+I,E=h.x,O=h.y;l.setWidth(this.width),k?M>0&&E+L+u>this.right&&(O=h.y+=v,h.line++,E=h.x=Pt(r,this.left+u,this.right-n[h.line])):M>0&&O+v>this.bottom&&(E=h.x=E+o[h.line].width+u,h.line++,O=h.y=Pt(r,this.top+w+u,this.bottom-o[h.line].height));let N=l.x(E);P(N,O,A),E=fd(B,E+f+m,k?E+L:this.right,t.rtl),T(l.x(E),O,A),k?h.x+=L+u:h.y+=v;}),ms(this.ctx,t.textDirection);}drawTitle(){let t=this.options,o=t.title,n=it(o.font),i=ut(o.padding);if(!o.display)return;let r=Co(t.rtl,this.left,this.width),a=this.ctx,s=o.position,l=n.size/2,c=i.top+l,d,u=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),d=this.top+c,u=Pt(t.align,u,this.right-p);else {let h=this.columnSizes.reduce((f,g)=>Math.max(f,g.height),0);d=c+Pt(t.align,this.top,this.bottom-h-t.labels.padding-this._computeTitleHeight());}let m=Pt(s,u,u+p);a.textAlign=r.textAlign(Vi(s)),a.textBaseline="middle",a.strokeStyle=o.color,a.fillStyle=o.color,a.font=n.string,He(a,o.text,m,d,n);}_computeTitleHeight(){let t=this.options.title,o=it(t.font),n=ut(t.padding);return t.display?o.lineHeight+n.height:0}_getLegendItemAt(t,o){let n,i,r;if(me(t,this.left,this.right)&&me(o,this.top,this.bottom)){for(r=this.legendHitBoxes,n=0;n<r.length;++n)if(i=r[n],me(t,i.left,i.left+i.width)&&me(o,i.top,i.top+i.height))return this.legendItems[n]}return null}handleEvent(t){let o=this.options;if(!T4(t.type,o))return;let n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let i=this._hoveredItem,r=S4(i,n);i&&!r&&X(o.onLeave,[t,i,this],this),this._hoveredItem=n,n&&!r&&X(o.onHover,[t,n,this],this);}else n&&X(o.onClick,[t,n,this],this);}};function T4(e,t){return !!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var H0={id:"legend",_element:_s,start(e,t,o){let n=e.legend=new _s({ctx:e.ctx,options:o,chart:e});ae.configure(e,n,o),ae.addBox(e,n);},stop(e){ae.removeBox(e,e.legend),delete e.legend;},beforeUpdate(e,t,o){let n=e.legend;ae.configure(e,n,o),n.options=o;},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes();},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event);},defaults:{display:true,position:"top",align:"center",fullSize:true,reverse:false,weight:1e3,onClick(e,t,o){let n=t.datasetIndex,i=o.chart;i.isDatasetVisible(n)?(i.hide(n),t.hidden=true):(i.show(n),t.hidden=false);},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:o,pointStyle:n,textAlign:i,color:r}}=e.legend.options;return e._getSortedDatasetMetas().map(a=>{let s=a.controller.getStyle(o?0:void 0),l=ut(s.borderWidth);return {text:t[a.index].label,fillStyle:s.backgroundColor,fontColor:r,hidden:!a.visible,lineCap:s.borderCapStyle,lineDash:s.borderDash,lineDashOffset:s.borderDashOffset,lineJoin:s.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:s.borderColor,pointStyle:n||s.pointStyle,rotation:s.rotation,textAlign:i||s.textAlign,borderRadius:0,datasetIndex:a.index}},this)}},title:{color:e=>e.chart.options.color,display:false,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},As=class extends xt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0;}update(t,o){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=o;let i=Z(n.text)?n.text.length:1;this._padding=ut(n.padding);let r=i*it(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r;}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:o,left:n,bottom:i,right:r,options:a}=this,s=a.align,l=0,c,d,u;return this.isHorizontal()?(d=Pt(s,n,r),u=o+t,c=r-n):(a.position==="left"?(d=n+t,u=Pt(s,i,o),l=G*-0.5):(d=r-t,u=Pt(s,o,i),l=G*.5),c=i-o),{titleX:d,titleY:u,maxWidth:c,rotation:l}}draw(){let t=this.ctx,o=this.options;if(!o.display)return;let n=it(o.font),r=n.lineHeight/2+this._padding.top,{titleX:a,titleY:s,maxWidth:l,rotation:c}=this._drawArgs(r);He(t,o.text,0,0,n,{color:o.color,maxWidth:l,rotation:c,textAlign:Vi(o.align),textBaseline:"middle",translation:[a,s]});}};function k4(e,t){let o=new As({ctx:e.ctx,options:t,chart:e});ae.configure(e,o,t),ae.addBox(e,o),e.titleBlock=o;}var W0={id:"title",_element:As,start(e,t,o){k4(e,o);},stop(e){let t=e.titleBlock;ae.removeBox(e,t),delete e.titleBlock;},beforeUpdate(e,t,o){let n=e.titleBlock;ae.configure(e,n,o),n.options=o;},defaults:{align:"center",display:false,font:{weight:"bold"},fullSize:true,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:true,_indexable:false}};var tr={average(e){if(!e.length)return false;let t,o,n=0,i=0,r=0;for(t=0,o=e.length;t<o;++t){let a=e[t].element;if(a&&a.hasValue()){let s=a.tooltipPosition();n+=s.x,i+=s.y,++r;}}return {x:n/r,y:i/r}},nearest(e,t){if(!e.length)return false;let o=t.x,n=t.y,i=Number.POSITIVE_INFINITY,r,a,s;for(r=0,a=e.length;r<a;++r){let l=e[r].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),d=$e(t,c);d<i&&(i=d,s=l);}}if(s){let l=s.tooltipPosition();o=l.x,n=l.y;}return {x:o,y:n}}};function Ie(e,t){return t&&(Z(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ye(e){return (typeof e=="string"||e instanceof String)&&e.indexOf(`
1015
+ `;function h1({currencyId:e,localization:t,decimalPlaces:o,showUnits:n=true,showSymbol:i=false,onAddCredits:r}){let a=jt(St),s=D({optional:true}),l=s==null?void 0:s.theme,{balance:c,isLoading:d,error:u}=po({currencyId:e}),{title:p,addCredits:h}=S(S({},d1),t),m=jsx(Mv,{className:"stigg-credit-balance-container",children:jsxs(Iv,{className:"stigg-credit-balance-card",children:[jsxs(Ln,{children:[jsx(P,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:p}),r&&c&&!u&&jsxs(Bn,{type:"button",onClick:()=>r(c),className:"stigg-credit-balance-add-credits-button",children:[jsx(Ga,{className:"stigg-credit-balance-add-credits-icon"}),h]})]}),jsx(c1,{balance:c,isLoading:d,error:u,decimalPlaces:o,showUnits:n,showSymbol:i})]})});return a?m:jsx(ht,{componentTheme:l,children:m})}function he(){}var gd=(function(){let e=0;return function(){return e++}})();function W(e){return e===null||typeof e=="undefined"}function Z(e){if(Array.isArray&&Array.isArray(e))return true;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function z(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}var lt=e=>(typeof e=="number"||e instanceof Number)&&isFinite(+e);function Ot(e,t){return lt(e)?e:t}function N(e,t){return typeof e=="undefined"?t:e}var fd=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:e/t,Ja=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function X(e,t,o){if(e&&typeof e.call=="function")return e.apply(o,t)}function K(e,t,o,n){let i,r,a;if(Z(e))if(r=e.length,n);else for(i=0;i<r;i++)t.call(o,e[i],i);else if(z(e))for(a=Object.keys(e),r=a.length,i=0;i<r;i++)t.call(o,e[a[i]],a[i]);}function zn(e,t){let o,n,i,r;if(!e||!t||e.length!==t.length)return false;for(o=0,n=e.length;o<n;++o)if(i=e[o],r=t[o],i.datasetIndex!==r.datasetIndex||i.index!==r.index)return false;return true}function Ui(e){if(Z(e))return e.map(Ui);if(z(e)){let t=Object.create(null),o=Object.keys(e),n=o.length,i=0;for(;i<n;++i)t[o[i]]=Ui(e[o[i]]);return t}return e}function A1(e){return ["__proto__","prototype","constructor"].indexOf(e)===-1}function M1(e,t,o,n){if(!A1(e))return;let i=t[e],r=o[e];z(i)&&z(r)?Xt(i,r,n):t[e]=Ui(r);}function Xt(e,t,o){let n=Z(t)?t:[t],i=n.length;if(!z(e))return e;o=o||{};let r=o.merger||M1;for(let a=0;a<i;++a){if(t=n[a],!z(t))continue;let s=Object.keys(t);for(let l=0,c=s.length;l<c;++l)r(s[l],e,t,o);}return e}function Ko(e,t){return Xt(e,t,{merger:I1})}function I1(e,t,o){if(!A1(e))return;let n=t[e],i=o[e];z(n)&&z(i)?Ko(n,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ui(i));}var g1={"":e=>e,x:e=>e.x,y:e=>e.y};function Ae(e,t){return (g1[t]||(g1[t]=Ev(t)))(e)}function Ev(e){let t=E1(e);return o=>{for(let n of t){if(n==="")break;o=o&&o[n];}return o}}function E1(e){let t=e.split("."),o=[],n="";for(let i of t)n+=i,n.endsWith("\\")?n=n.slice(0,-1)+".":(o.push(n),n="");return o}function zi(e){return e.charAt(0).toUpperCase()+e.slice(1)}var st=e=>typeof e!="undefined",Tt=e=>typeof e=="function",ts=(e,t)=>{if(e.size!==t.size)return false;for(let o of e)if(!t.has(o))return false;return true};function yd(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}var G=Math.PI,Q=2*G,F1=Q+G,Oi=Number.POSITIVE_INFINITY,Vi=G/180,et=G/2,ie=G/4,Nn=G*2/3,zt=Math.log10,re=Math.sign;function es(e){let t=Math.round(e);e=qo(e,t,e/1e3)?t:e;let o=Math.pow(10,Math.floor(zt(e))),n=e/o;return (n<=1?1:n<=2?2:n<=5?5:10)*o}function xd(e){let t=[],o=Math.sqrt(e),n;for(n=1;n<o;n++)e%n===0&&(t.push(n),t.push(e/n));return o===(o|0)&&t.push(o),t.sort((i,r)=>i-r).pop(),t}function Kt(e){return !isNaN(parseFloat(e))&&isFinite(e)}function qo(e,t,o){return Math.abs(e-t)<o}function bd(e,t){let o=Math.round(e);return o-t<=e&&o+t>=e}function os(e,t,o){let n,i,r;for(n=0,i=e.length;n<i;n++)r=e[n][o],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r));}function gt(e){return e*(G/180)}function Qo(e){return e*(180/G)}function ns(e){if(!lt(e))return;let t=1,o=0;for(;Math.round(e*t)/t!==e;)t*=10,o++;return o}function is(e,t){let o=t.x-e.x,n=t.y-e.y,i=Math.sqrt(o*o+n*n),r=Math.atan2(n,o);return r<-0.5*G&&(r+=Q),{angle:r,distance:i}}function Ve(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function L1(e,t){return (e-t+F1)%Q-G}function Ft(e){return (e%Q+Q)%Q}function Jo(e,t,o,n){let i=Ft(e),r=Ft(t),a=Ft(o),s=Ft(r-i),l=Ft(a-i),c=Ft(i-r),d=Ft(i-a);return i===r||i===a||n&&r===a||s>l&&c<d}function Ct(e,t,o){return Math.max(t,Math.min(o,e))}function Cd(e){return Ct(e,-32768,32767)}function ge(e,t,o,n=1e-6){return e>=Math.min(t,o)-n&&e<=Math.max(t,o)+n}function $i(e,t,o){o=o||(a=>e[a]<t);let n=e.length-1,i=0,r;for(;n-i>1;)r=i+n>>1,o(r)?i=r:n=r;return {lo:i,hi:n}}var ze=(e,t,o,n)=>$i(e,o,n?i=>e[i][t]<=o:i=>e[i][t]<o),Pd=(e,t,o)=>$i(e,o,n=>e[n][t]>=o);function Sd(e,t,o){let n=0,i=e.length;for(;n<i&&e[n]<t;)n++;for(;i>n&&e[i-1]>o;)i--;return n>0||i<e.length?e.slice(n,i):e}var B1=["push","pop","shift","splice","unshift"];function Td(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:true,enumerable:false,value:{listeners:[t]}}),B1.forEach(o=>{let n="_onData"+zi(o),i=e[o];Object.defineProperty(e,o,{configurable:true,enumerable:false,value(...r){let a=i.apply(this,r);return e._chartjs.listeners.forEach(s=>{typeof s[n]=="function"&&s[n](...r);}),a}});});}function rs(e,t){let o=e._chartjs;if(!o)return;let n=o.listeners,i=n.indexOf(t);i!==-1&&n.splice(i,1),!(n.length>0)&&(B1.forEach(r=>{delete e[r];}),delete e._chartjs);}function as(e){let t=new Set,o,n;for(o=0,n=e.length;o<n;++o)t.add(e[o]);return t.size===n?e:Array.from(t)}var ss=(function(){return typeof window=="undefined"?function(e){return e()}:window.requestAnimationFrame})();function ls(e,t,o){let n=o||(a=>Array.prototype.slice.call(a)),i=false,r=[];return function(...a){r=n(a),i||(i=true,ss.call(window,()=>{i=false,e.apply(t,r);}));}}function kd(e,t){let o;return function(...n){return t?(clearTimeout(o),o=setTimeout(e,t,n)):e.apply(this,n),t}}var Hi=e=>e==="start"?"left":e==="end"?"right":"center",Pt=(e,t,o)=>e==="start"?t:e==="end"?o:(t+o)/2,wd=(e,t,o,n)=>e===(n?"left":"right")?o:e==="center"?(t+o)/2:t;function cs(e,t,o){let n=t.length,i=0,r=n;if(e._sorted){let{iScale:a,_parsed:s}=e,l=a.axis,{min:c,max:d,minDefined:u,maxDefined:p}=a.getUserBounds();u&&(i=Ct(Math.min(ze(s,a.axis,c).lo,o?n:ze(t,l,a.getPixelForValue(c)).lo),0,n-1)),p?r=Ct(Math.max(ze(s,a.axis,d,true).hi+1,o?0:ze(t,l,a.getPixelForValue(d),true).hi+1),i,n)-i:r=n-i;}return {start:i,count:r}}function ds(e){let{xScale:t,yScale:o,_scaleRanges:n}=e,i={xmin:t.min,xmax:t.max,ymin:o.min,ymax:o.max};if(!n)return e._scaleRanges=i,true;let r=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==o.min||n.ymax!==o.max;return Object.assign(n,i),r}var ja=e=>e===0||e===1,f1=(e,t,o)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Q/o)),y1=(e,t,o)=>Math.pow(2,-10*e)*Math.sin((e-t)*Q/o)+1,Yo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-0.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-0.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*et)+1,easeOutSine:e=>Math.sin(e*et),easeInOutSine:e=>-0.5*(Math.cos(G*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>ja(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-0.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ja(e)?e:f1(e,.075,.3),easeOutElastic:e=>ja(e)?e:y1(e,.075,.3),easeInOutElastic(e){return ja(e)?e:e<.5?.5*f1(e*2,.1125,.45):.5+.5*y1(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return (e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return (e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Yo.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Yo.easeInBounce(e*2)*.5:Yo.easeOutBounce(e*2-1)*.5+.5};function Wi(e){return e+.5|0}var ho=(e,t,o)=>Math.max(Math.min(e,o),t);function Di(e){return ho(Wi(e*2.55),0,255)}function go(e){return ho(Wi(e*255),0,255)}function Ue(e){return ho(Wi(e/2.55)/100,0,1)}function x1(e){return ho(Wi(e*100),0,100)}var ne={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},pd=[..."0123456789ABCDEF"],Fv=e=>pd[e&15],Lv=e=>pd[(e&240)>>4]+pd[e&15],Ya=e=>(e&240)>>4===(e&15),Bv=e=>Ya(e.r)&&Ya(e.g)&&Ya(e.b)&&Ya(e.a);function Rv(e){var t=e.length,o;return e[0]==="#"&&(t===4||t===5?o={r:255&ne[e[1]]*17,g:255&ne[e[2]]*17,b:255&ne[e[3]]*17,a:t===5?ne[e[4]]*17:255}:(t===7||t===9)&&(o={r:ne[e[1]]<<4|ne[e[2]],g:ne[e[3]]<<4|ne[e[4]],b:ne[e[5]]<<4|ne[e[6]],a:t===9?ne[e[7]]<<4|ne[e[8]]:255})),o}var Dv=(e,t)=>e<255?t(e):"";function Nv(e){var t=Bv(e)?Fv:Lv;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Dv(e.a,t):void 0}var Uv=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function R1(e,t,o){let n=t*Math.min(o,1-o),i=(r,a=(r+e/30)%12)=>o-n*Math.max(Math.min(a-3,9-a,1),-1);return [i(0),i(8),i(4)]}function Ov(e,t,o){let n=(i,r=(i+e/60)%6)=>o-o*t*Math.max(Math.min(r,4-r,1),0);return [n(5),n(3),n(1)]}function zv(e,t,o){let n=R1(e,1,.5),i;for(t+o>1&&(i=1/(t+o),t*=i,o*=i),i=0;i<3;i++)n[i]*=1-t-o,n[i]+=t;return n}function Vv(e,t,o,n,i){return e===i?(t-o)/n+(t<o?6:0):t===i?(o-e)/n+2:(e-t)/n+4}function vd(e){let o=e.r/255,n=e.g/255,i=e.b/255,r=Math.max(o,n,i),a=Math.min(o,n,i),s=(r+a)/2,l,c,d;return r!==a&&(d=r-a,c=s>.5?d/(2-r-a):d/(r+a),l=Vv(o,n,i,d,r),l=l*60+.5),[l|0,c||0,s]}function _d(e,t,o,n){return (Array.isArray(t)?e(t[0],t[1],t[2]):e(t,o,n)).map(go)}function Ad(e,t,o){return _d(R1,e,t,o)}function $v(e,t,o){return _d(zv,e,t,o)}function Hv(e,t,o){return _d(Ov,e,t,o)}function D1(e){return (e%360+360)%360}function Wv(e){let t=Uv.exec(e),o=255,n;if(!t)return;t[5]!==n&&(o=t[6]?Di(+t[5]):go(+t[5]));let i=D1(+t[2]),r=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?n=$v(i,r,a):t[1]==="hsv"?n=Hv(i,r,a):n=Ad(i,r,a),{r:n[0],g:n[1],b:n[2],a:o}}function Gv(e,t){var o=vd(e);o[0]=D1(o[0]+t),o=Ad(o),e.r=o[0],e.g=o[1],e.b=o[2];}function jv(e){if(!e)return;let t=vd(e),o=t[0],n=x1(t[1]),i=x1(t[2]);return e.a<255?`hsla(${o}, ${n}%, ${i}%, ${Ue(e.a)})`:`hsl(${o}, ${n}%, ${i}%)`}var b1={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},C1={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Yv(){let e={},t=Object.keys(C1),o=Object.keys(b1),n,i,r,a,s;for(n=0;n<t.length;n++){for(a=s=t[n],i=0;i<o.length;i++)r=o[i],s=s.replace(r,b1[r]);r=parseInt(C1[a],16),e[s]=[r>>16&255,r>>8&255,r&255];}return e}var Za;function Zv(e){Za||(Za=Yv(),Za.transparent=[0,0,0,0]);let t=Za[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Xv=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Kv(e){let t=Xv.exec(e),o=255,n,i,r;if(t){if(t[7]!==n){let a=+t[7];o=t[8]?Di(a):ho(a*255,0,255);}return n=+t[1],i=+t[3],r=+t[5],n=255&(t[2]?Di(n):ho(n,0,255)),i=255&(t[4]?Di(i):ho(i,0,255)),r=255&(t[6]?Di(r):ho(r,0,255)),{r:n,g:i,b:r,a:o}}}function qv(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ue(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var cd=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Dn=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Qv(e,t,o){let n=Dn(Ue(e.r)),i=Dn(Ue(e.g)),r=Dn(Ue(e.b));return {r:go(cd(n+o*(Dn(Ue(t.r))-n))),g:go(cd(i+o*(Dn(Ue(t.g))-i))),b:go(cd(r+o*(Dn(Ue(t.b))-r))),a:e.a+o*(t.a-e.a)}}function Xa(e,t,o){if(e){let n=vd(e);n[t]=Math.max(0,Math.min(n[t]+n[t]*o,t===0?360:1)),n=Ad(n),e.r=n[0],e.g=n[1],e.b=n[2];}}function N1(e,t){return e&&Object.assign(t||{},e)}function P1(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=go(e[3]))):(t=N1(e,{r:0,g:0,b:0,a:1}),t.a=go(t.a)),t}function Jv(e){return e.charAt(0)==="r"?Kv(e):Wv(e)}var md=class e{constructor(t){if(t instanceof e)return t;let o=typeof t,n;o==="object"?n=P1(t):o==="string"&&(n=Rv(t)||Zv(t)||Jv(t)),this._rgb=n,this._valid=!!n;}get valid(){return this._valid}get rgb(){var t=N1(this._rgb);return t&&(t.a=Ue(t.a)),t}set rgb(t){this._rgb=P1(t);}rgbString(){return this._valid?qv(this._rgb):void 0}hexString(){return this._valid?Nv(this._rgb):void 0}hslString(){return this._valid?jv(this._rgb):void 0}mix(t,o){if(t){let n=this.rgb,i=t.rgb,r,a=o===r?.5:o,s=2*a-1,l=n.a-i.a,c=((s*l===-1?s:(s+l)/(1+s*l))+1)/2;r=1-c,n.r=255&c*n.r+r*i.r+.5,n.g=255&c*n.g+r*i.g+.5,n.b=255&c*n.b+r*i.b+.5,n.a=a*n.a+(1-a)*i.a,this.rgb=n;}return this}interpolate(t,o){return t&&(this._rgb=Qv(this._rgb,t._rgb,o)),this}clone(){return new e(this.rgb)}alpha(t){return this._rgb.a=go(t),this}clearer(t){let o=this._rgb;return o.a*=1-t,this}greyscale(){let t=this._rgb,o=Wi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=o,this}opaquer(t){let o=this._rgb;return o.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Xa(this._rgb,2,t),this}darken(t){return Xa(this._rgb,2,-t),this}saturate(t){return Xa(this._rgb,1,t),this}desaturate(t){return Xa(this._rgb,1,-t),this}rotate(t){return Gv(this._rgb,t),this}};function U1(e){return new md(e)}function Md(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return false}function tn(e){return Md(e)?e:U1(e)}function qa(e){return Md(e)?e:U1(e).saturate(.5).darken(.1).hexString()}var yo=Object.create(null),us=Object.create(null);function Ni(e,t){if(!t)return e;let o=t.split(".");for(let n=0,i=o.length;n<i;++n){let r=o[n];e=e[r]||(e[r]=Object.create(null));}return e}function dd(e,t,o){return typeof t=="string"?Xt(Ni(e,t),o):Xt(Ni(e,""),t)}var hd=class{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=o=>o.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(o,n)=>qa(n.backgroundColor),this.hoverBorderColor=(o,n)=>qa(n.borderColor),this.hoverColor=(o,n)=>qa(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:true,includeInvisible:false},this.maintainAspectRatio=true,this.onHover=null,this.onClick=null,this.parsing=true,this.plugins={},this.responsive=true,this.scale=void 0,this.scales={},this.showLine=true,this.drawActiveElementsOnTop=true,this.describe(t);}set(t,o){return dd(this,t,o)}get(t){return Ni(this,t)}describe(t,o){return dd(us,t,o)}override(t,o){return dd(yo,t,o)}route(t,o,n,i){let r=Ni(this,t),a=Ni(this,n),s="_"+o;Object.defineProperties(r,{[s]:{value:r[o],writable:true},[o]:{enumerable:true,get(){let l=this[s],c=a[i];return z(l)?Object.assign({},c,l):N(l,c)},set(l){this[s]=l;}}});}},H=new hd({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:false,_indexable:false}});function O1(e){return !e||W(e.size)||W(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Un(e,t,o,n,i){let r=t[i];return r||(r=t[i]=e.measureText(i).width,o.push(i)),r>n&&(n=r),n}function Id(e,t,o,n){n=n||{};let i=n.data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(i=n.data={},r=n.garbageCollect=[],n.font=t),e.save(),e.font=t;let a=0,s=o.length,l,c,d,u,p;for(l=0;l<s;l++)if(u=o[l],u!=null&&Z(u)!==true)a=Un(e,i,r,a,u);else if(Z(u))for(c=0,d=u.length;c<d;c++)p=u[c],p!=null&&!Z(p)&&(a=Un(e,i,r,a,p));e.restore();let h=r.length/2;if(h>o.length){for(l=0;l<h;l++)delete i[r[l]];r.splice(0,h);}return a}function $e(e,t,o){let n=e.currentDevicePixelRatio,i=o!==0?Math.max(o/2,.5):0;return Math.round((t-i)*n)/n+i}function ps(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore();}function Gi(e,t,o,n){ms(e,t,o,n,null);}function ms(e,t,o,n,i){let r,a,s,l,c,d,u=t.pointStyle,p=t.rotation,h=t.radius,m=(p||0)*Vi;if(u&&typeof u=="object"&&(r=u.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){e.save(),e.translate(o,n),e.rotate(m),e.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),e.restore();return}if(!(isNaN(h)||h<=0)){switch(e.beginPath(),u){default:i?e.ellipse(o,n,i/2,h,0,0,Q):e.arc(o,n,h,0,Q),e.closePath();break;case "triangle":e.moveTo(o+Math.sin(m)*h,n-Math.cos(m)*h),m+=Nn,e.lineTo(o+Math.sin(m)*h,n-Math.cos(m)*h),m+=Nn,e.lineTo(o+Math.sin(m)*h,n-Math.cos(m)*h),e.closePath();break;case "rectRounded":c=h*.516,l=h-c,a=Math.cos(m+ie)*l,s=Math.sin(m+ie)*l,e.arc(o-a,n-s,c,m-G,m-et),e.arc(o+s,n-a,c,m-et,m),e.arc(o+a,n+s,c,m,m+et),e.arc(o-s,n+a,c,m+et,m+G),e.closePath();break;case "rect":if(!p){l=Math.SQRT1_2*h,d=i?i/2:l,e.rect(o-d,n-l,2*d,2*l);break}m+=ie;case "rectRot":a=Math.cos(m)*h,s=Math.sin(m)*h,e.moveTo(o-a,n-s),e.lineTo(o+s,n-a),e.lineTo(o+a,n+s),e.lineTo(o-s,n+a),e.closePath();break;case "crossRot":m+=ie;case "cross":a=Math.cos(m)*h,s=Math.sin(m)*h,e.moveTo(o-a,n-s),e.lineTo(o+a,n+s),e.moveTo(o+s,n-a),e.lineTo(o-s,n+a);break;case "star":a=Math.cos(m)*h,s=Math.sin(m)*h,e.moveTo(o-a,n-s),e.lineTo(o+a,n+s),e.moveTo(o+s,n-a),e.lineTo(o-s,n+a),m+=ie,a=Math.cos(m)*h,s=Math.sin(m)*h,e.moveTo(o-a,n-s),e.lineTo(o+a,n+s),e.moveTo(o+s,n-a),e.lineTo(o-s,n+a);break;case "line":a=i?i/2:Math.cos(m)*h,s=Math.sin(m)*h,e.moveTo(o-a,n-s),e.lineTo(o+a,n+s);break;case "dash":e.moveTo(o,n),e.lineTo(o+Math.cos(m)*h,n+Math.sin(m)*h);break}e.fill(),t.borderWidth>0&&e.stroke();}}function Xo(e,t,o){return o=o||.5,!t||e&&e.x>t.left-o&&e.x<t.right+o&&e.y>t.top-o&&e.y<t.bottom+o}function xo(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip();}function bo(e){e.restore();}function Ed(e,t,o,n,i){if(!t)return e.lineTo(o.x,o.y);if(i==="middle"){let r=(t.x+o.x)/2;e.lineTo(r,t.y),e.lineTo(r,o.y);}else i==="after"!=!!n?e.lineTo(t.x,o.y):e.lineTo(o.x,t.y);e.lineTo(o.x,o.y);}function Fd(e,t,o,n){if(!t)return e.lineTo(o.x,o.y);e.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?o.cp2x:o.cp1x,n?o.cp2y:o.cp1y,o.x,o.y);}function He(e,t,o,n,i,r={}){let a=Z(t)?t:[t],s=r.strokeWidth>0&&r.strokeColor!=="",l,c;for(e.save(),e.font=i.string,t6(e,r),l=0;l<a.length;++l)c=a[l],s&&(r.strokeColor&&(e.strokeStyle=r.strokeColor),W(r.strokeWidth)||(e.lineWidth=r.strokeWidth),e.strokeText(c,o,n,r.maxWidth)),e.fillText(c,o,n,r.maxWidth),e6(e,o,n,c,r),n+=i.lineHeight;e.restore();}function t6(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),W(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline);}function e6(e,t,o,n,i){if(i.strikethrough||i.underline){let r=e.measureText(n),a=t-r.actualBoundingBoxLeft,s=t+r.actualBoundingBoxRight,l=o-r.actualBoundingBoxAscent,c=o+r.actualBoundingBoxDescent,d=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(a,d),e.lineTo(s,d),e.stroke();}}function We(e,t){let{x:o,y:n,w:i,h:r,radius:a}=t;e.arc(o+a.topLeft,n+a.topLeft,a.topLeft,-et,G,true),e.lineTo(o,n+r-a.bottomLeft),e.arc(o+a.bottomLeft,n+r-a.bottomLeft,a.bottomLeft,G,et,true),e.lineTo(o+i-a.bottomRight,n+r),e.arc(o+i-a.bottomRight,n+r-a.bottomRight,a.bottomRight,et,0,true),e.lineTo(o+i,n+a.topRight),e.arc(o+i-a.topRight,n+a.topRight,a.topRight,0,-et,true),e.lineTo(o+a.topLeft,n);}var o6=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),n6=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function z1(e,t){let o=(""+e).match(o6);if(!o||o[1]==="normal")return t*1.2;switch(e=+o[2],o[3]){case "px":return e;case "%":e/=100;break}return t*e}var i6=e=>+e||0;function ji(e,t){let o={},n=z(t),i=n?Object.keys(t):t,r=z(e)?n?a=>N(e[a],e[t[a]]):a=>e[a]:()=>e;for(let a of i)o[a]=i6(r(a));return o}function hs(e){return ji(e,{top:"y",right:"x",bottom:"y",left:"x"})}function fe(e){return ji(e,["topLeft","topRight","bottomLeft","bottomRight"])}function pt(e){let t=hs(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function it(e,t){e=e||{},t=t||H.font;let o=N(e.size,t.size);typeof o=="string"&&(o=parseInt(o,10));let n=N(e.style,t.style);n&&!(""+n).match(n6)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");let i={family:N(e.family,t.family),lineHeight:z1(N(e.lineHeight,t.lineHeight),o),size:o,style:n,weight:N(e.weight,t.weight),string:""};return i.string=O1(i),i}function rt(e,t,o,n){let r,a,s;for(r=0,a=e.length;r<a;++r)if(s=e[r],s!==void 0&&(t!==void 0&&typeof s=="function"&&(s=s(t),false),o!==void 0&&Z(s)&&(s=s[o%s.length],false),s!==void 0))return s}function Ld(e,t,o){let{min:n,max:i}=e,r=Ja(t,(i-n)/2),a=(s,l)=>o&&s===0?0:s+l;return {min:a(n,-Math.abs(r)),max:a(i,r)}}function Me(e,t){return Object.assign(Object.create(e),t)}function Yi(e,t=[""],o=e,n,i=()=>e[0]){st(n)||(n=H1("_fallback",e));let r={[Symbol.toStringTag]:"Object",_cacheable:true,_scopes:e,_rootScopes:o,_fallback:n,_getTarget:i,override:a=>Yi([a,...e],t,o,n)};return new Proxy(r,{deleteProperty(a,s){return delete a[s],delete a._keys,delete e[0][s],true},get(a,s){return V1(a,s,()=>p6(s,t,e,a))},getOwnPropertyDescriptor(a,s){return Reflect.getOwnPropertyDescriptor(a._scopes[0],s)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,s){return T1(a).includes(s)},ownKeys(a){return T1(a)},set(a,s,l){let c=a._storage||(a._storage=i());return a[s]=c[s]=l,delete a._keys,true}})}function fo(e,t,o,n){let i={_cacheable:false,_proxy:e,_context:t,_subProxy:o,_stack:new Set,_descriptors:gs(e,n),setContext:r=>fo(e,r,o,n),override:r=>fo(e.override(r),t,o,n)};return new Proxy(i,{deleteProperty(r,a){return delete r[a],delete e[a],true},get(r,a,s){return V1(r,a,()=>a6(r,a,s))},getOwnPropertyDescriptor(r,a){return r._descriptors.allKeys?Reflect.has(e,a)?{enumerable:true,configurable:true}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(r,a,s){return e[a]=s,delete r[a],true}})}function gs(e,t={scriptable:true,indexable:true}){let{_scriptable:o=t.scriptable,_indexable:n=t.indexable,_allKeys:i=t.allKeys}=e;return {allKeys:i,scriptable:o,indexable:n,isScriptable:Tt(o)?o:()=>o,isIndexable:Tt(n)?n:()=>n}}var r6=(e,t)=>e?e+zi(t):t,Bd=(e,t)=>z(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function V1(e,t,o){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=o();return e[t]=n,n}function a6(e,t,o){let{_proxy:n,_context:i,_subProxy:r,_descriptors:a}=e,s=n[t];return Tt(s)&&a.isScriptable(t)&&(s=s6(t,s,e,o)),Z(s)&&s.length&&(s=l6(t,s,e,a.isIndexable)),Bd(t,s)&&(s=fo(s,i,r&&r[t],a)),s}function s6(e,t,o,n){let{_proxy:i,_context:r,_subProxy:a,_stack:s}=o;if(s.has(e))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+e);return s.add(e),t=t(r,a||n),s.delete(e),Bd(e,t)&&(t=Rd(i._scopes,i,e,t)),t}function l6(e,t,o,n){let{_proxy:i,_context:r,_subProxy:a,_descriptors:s}=o;if(st(r.index)&&n(e))t=t[r.index%t.length];else if(z(t[0])){let l=t,c=i._scopes.filter(d=>d!==l);t=[];for(let d of l){let u=Rd(c,i,e,d);t.push(fo(u,r,a&&a[e],s));}}return t}function $1(e,t,o){return Tt(e)?e(t,o):e}var c6=(e,t)=>e===true?t:typeof e=="string"?Ae(t,e):void 0;function d6(e,t,o,n,i){for(let r of t){let a=c6(o,r);if(a){e.add(a);let s=$1(a._fallback,o,i);if(st(s)&&s!==o&&s!==n)return s}else if(a===false&&st(n)&&o!==n)return null}return false}function Rd(e,t,o,n){let i=t._rootScopes,r=$1(t._fallback,o,n),a=[...e,...i],s=new Set;s.add(n);let l=S1(s,a,o,r||o,n);return l===null||st(r)&&r!==o&&(l=S1(s,a,r,l,n),l===null)?false:Yi(Array.from(s),[""],i,r,()=>u6(t,o,n))}function S1(e,t,o,n,i){for(;o;)o=d6(e,t,o,n,i);return o}function u6(e,t,o){let n=e._getTarget();t in n||(n[t]={});let i=n[t];return Z(i)&&z(o)?o:i}function p6(e,t,o,n){let i;for(let r of t)if(i=H1(r6(r,e),o),st(i))return Bd(e,i)?Rd(o,n,e,i):i}function H1(e,t){for(let o of t){if(!o)continue;let n=o[e];if(st(n))return n}}function T1(e){let t=e._keys;return t||(t=e._keys=m6(e._scopes)),t}function m6(e){let t=new Set;for(let o of e)for(let n of Object.keys(o).filter(i=>!i.startsWith("_")))t.add(n);return Array.from(t)}function fs(e,t,o,n){let{iScale:i}=e,{key:r="r"}=this._parsing,a=new Array(n),s,l,c,d;for(s=0,l=n;s<l;++s)c=s+o,d=t[c],a[s]={r:i.parse(Ae(d,r),c)};return a}var h6=Number.EPSILON||1e-14,On=(e,t)=>t<e.length&&!e[t].skip&&e[t],W1=e=>e==="x"?"y":"x";function G1(e,t,o,n){let i=e.skip?t:e,r=t,a=o.skip?t:o,s=Ve(r,i),l=Ve(a,r),c=s/(s+l),d=l/(s+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;let u=n*c,p=n*d;return {previous:{x:r.x-u*(a.x-i.x),y:r.y-u*(a.y-i.y)},next:{x:r.x+p*(a.x-i.x),y:r.y+p*(a.y-i.y)}}}function g6(e,t,o){let n=e.length,i,r,a,s,l,c=On(e,0);for(let d=0;d<n-1;++d)if(l=c,c=On(e,d+1),!(!l||!c)){if(qo(t[d],0,h6)){o[d]=o[d+1]=0;continue}i=o[d]/t[d],r=o[d+1]/t[d],s=Math.pow(i,2)+Math.pow(r,2),!(s<=9)&&(a=3/Math.sqrt(s),o[d]=i*a*t[d],o[d+1]=r*a*t[d]);}}function f6(e,t,o="x"){let n=W1(o),i=e.length,r,a,s,l=On(e,0);for(let c=0;c<i;++c){if(a=s,s=l,l=On(e,c+1),!s)continue;let d=s[o],u=s[n];a&&(r=(d-a[o])/3,s[`cp1${o}`]=d-r,s[`cp1${n}`]=u-r*t[c]),l&&(r=(l[o]-d)/3,s[`cp2${o}`]=d+r,s[`cp2${n}`]=u+r*t[c]);}}function j1(e,t="x"){let o=W1(t),n=e.length,i=Array(n).fill(0),r=Array(n),a,s,l,c=On(e,0);for(a=0;a<n;++a)if(s=l,l=c,c=On(e,a+1),!!l){if(c){let d=c[t]-l[t];i[a]=d!==0?(c[o]-l[o])/d:0;}r[a]=s?c?re(i[a-1])!==re(i[a])?0:(i[a-1]+i[a])/2:i[a-1]:i[a];}g6(e,i,r),f6(e,r,t);}function Ka(e,t,o){return Math.max(Math.min(e,o),t)}function y6(e,t){let o,n,i,r,a,s=Xo(e[0],t);for(o=0,n=e.length;o<n;++o)a=r,r=s,s=o<n-1&&Xo(e[o+1],t),r&&(i=e[o],a&&(i.cp1x=Ka(i.cp1x,t.left,t.right),i.cp1y=Ka(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=Ka(i.cp2x,t.left,t.right),i.cp2y=Ka(i.cp2y,t.top,t.bottom)));}function Dd(e,t,o,n,i){let r,a,s,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")j1(e,i);else {let c=n?e[e.length-1]:e[0];for(r=0,a=e.length;r<a;++r)s=e[r],l=G1(c,s,e[Math.min(r+1,a-(n?0:1))%a],t.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,c=s;}t.capBezierPoints&&y6(e,o);}function ys(){return typeof window!="undefined"&&typeof document!="undefined"}function Zi(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Qa(e,t,o){let n;return typeof e=="string"?(n=parseInt(e,10),e.indexOf("%")!==-1&&(n=n/100*t.parentNode[o])):n=e,n}var xs=e=>window.getComputedStyle(e,null);function Y1(e,t){return xs(e).getPropertyValue(t)}var x6=["top","right","bottom","left"];function Zo(e,t,o){let n={};o=o?"-"+o:"";for(let i=0;i<4;i++){let r=x6[i];n[r]=parseFloat(e[t+"-"+r+o])||0;}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}var b6=(e,t,o)=>(e>0||t>0)&&(!o||!o.shadowRoot);function C6(e,t){let o=e.touches,n=o&&o.length?o[0]:e,{offsetX:i,offsetY:r}=n,a=false,s,l;if(b6(i,r,e.target))s=i,l=r;else {let c=t.getBoundingClientRect();s=n.clientX-c.left,l=n.clientY-c.top,a=true;}return {x:s,y:l,box:a}}function Ge(e,t){if("native"in e)return e;let{canvas:o,currentDevicePixelRatio:n}=t,i=xs(o),r=i.boxSizing==="border-box",a=Zo(i,"padding"),s=Zo(i,"border","width"),{x:l,y:c,box:d}=C6(e,o),u=a.left+(d&&s.left),p=a.top+(d&&s.top),{width:h,height:m}=t;return r&&(h-=a.width+s.width,m-=a.height+s.height),{x:Math.round((l-u)/h*o.width/n),y:Math.round((c-p)/m*o.height/n)}}function P6(e,t,o){let n,i;if(t===void 0||o===void 0){let r=Zi(e);if(!r)t=e.clientWidth,o=e.clientHeight;else {let a=r.getBoundingClientRect(),s=xs(r),l=Zo(s,"border","width"),c=Zo(s,"padding");t=a.width-c.width-l.width,o=a.height-c.height-l.height,n=Qa(s.maxWidth,r,"clientWidth"),i=Qa(s.maxHeight,r,"clientHeight");}}return {width:t,height:o,maxWidth:n||Oi,maxHeight:i||Oi}}var ud=e=>Math.round(e*10)/10;function Nd(e,t,o,n){let i=xs(e),r=Zo(i,"margin"),a=Qa(i.maxWidth,e,"clientWidth")||Oi,s=Qa(i.maxHeight,e,"clientHeight")||Oi,l=P6(e,t,o),{width:c,height:d}=l;if(i.boxSizing==="content-box"){let u=Zo(i,"border","width"),p=Zo(i,"padding");c-=p.width+u.width,d-=p.height+u.height;}return c=Math.max(0,c-r.width),d=Math.max(0,n?Math.floor(c/n):d-r.height),c=ud(Math.min(c,a,l.maxWidth)),d=ud(Math.min(d,s,l.maxHeight)),c&&!d&&(d=ud(c/2)),{width:c,height:d}}function bs(e,t,o){let n=t||1,i=Math.floor(e.height*n),r=Math.floor(e.width*n);e.height=i/n,e.width=r/n;let a=e.canvas;return a.style&&(o||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==n||a.height!==i||a.width!==r?(e.currentDevicePixelRatio=n,a.height=i,a.width=r,e.ctx.setTransform(n,0,0,n,0,0),true):false}var Ud=(function(){let e=false;try{let t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t);}catch(t){}return e})();function Cs(e,t){let o=Y1(e,t),n=o&&o.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Oe(e,t,o,n){return {x:e.x+o*(t.x-e.x),y:e.y+o*(t.y-e.y)}}function Od(e,t,o,n){return {x:e.x+o*(t.x-e.x),y:n==="middle"?o<.5?e.y:t.y:n==="after"?o<1?e.y:t.y:o>0?t.y:e.y}}function zd(e,t,o,n){let i={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},a=Oe(e,i,o),s=Oe(i,r,o),l=Oe(r,t,o),c=Oe(a,s,o),d=Oe(s,l,o);return Oe(c,d,o)}var k1=new Map;function S6(e,t){t=t||{};let o=e+JSON.stringify(t),n=k1.get(o);return n||(n=new Intl.NumberFormat(e,t),k1.set(o,n)),n}function en(e,t,o){return S6(t,o).format(e)}var T6=function(e,t){return {x(o){return e+e+t-o},setWidth(o){t=o;},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,n){return o-n},leftForLtr(o,n){return o-n}}},k6=function(){return {x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Co(e,t,o){return e?T6(t,o):k6()}function Ps(e,t){let o,n;(t==="ltr"||t==="rtl")&&(o=e.canvas.style,n=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",t,"important"),e.prevTextDirection=n);}function Ss(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]));}function Z1(e){return e==="angle"?{between:Jo,compare:L1,normalize:Ft}:{between:ge,compare:(t,o)=>t-o,normalize:t=>t}}function w1({start:e,end:t,count:o,loop:n,style:i}){return {start:e%o,end:t%o,loop:n&&(t-e+1)%o===0,style:i}}function w6(e,t,o){let{property:n,start:i,end:r}=o,{between:a,normalize:s}=Z1(n),l=t.length,{start:c,end:d,loop:u}=e,p,h;if(u){for(c+=l,d+=l,p=0,h=l;p<h&&a(s(t[c%l][n]),i,r);++p)c--,d--;c%=l,d%=l;}return d<c&&(d+=l),{start:c,end:d,loop:u,style:e.style}}function Ts(e,t,o){if(!o)return [e];let{property:n,start:i,end:r}=o,a=t.length,{compare:s,between:l,normalize:c}=Z1(n),{start:d,end:u,loop:p,style:h}=w6(e,t,o),m=[],g=false,f=null,x,b,T,k=()=>l(i,T,x)&&s(i,T)!==0,w=()=>s(r,x)===0||l(r,T,x),v=()=>g||k(),_=()=>!g||w();for(let M=d,I=d;M<=u;++M)b=t[M%a],!b.skip&&(x=c(b[n]),x!==T&&(g=l(x,i,r),f===null&&v()&&(f=s(x,i)===0?M:I),f!==null&&_()&&(m.push(w1({start:f,end:M,loop:p,count:a,style:h})),f=null),I=M,T=x));return f!==null&&m.push(w1({start:f,end:u,loop:p,count:a,style:h})),m}function ks(e,t){let o=[],n=e.segments;for(let i=0;i<n.length;i++){let r=Ts(n[i],e.points,t);r.length&&o.push(...r);}return o}function v6(e,t,o,n){let i=0,r=t-1;if(o&&!n)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,o&&(r+=i);r>i&&e[r%t].skip;)r--;return r%=t,{start:i,end:r}}function _6(e,t,o,n){let i=e.length,r=[],a=t,s=e[t],l;for(l=t+1;l<=o;++l){let c=e[l%i];c.skip||c.stop?s.skip||(n=false,r.push({start:t%i,end:(l-1)%i,loop:n}),t=a=c.stop?l:null):(a=l,s.skip&&(t=l)),s=c;}return a!==null&&r.push({start:t%i,end:a%i,loop:n}),r}function Vd(e,t){let o=e.points,n=e.options.spanGaps,i=o.length;if(!i)return [];let r=!!e._loop,{start:a,end:s}=v6(o,i,r,n);if(n===true)return v1(e,[{start:a,end:s,loop:r}],o,t);let l=s<a?s+i:s,c=!!e._fullLoop&&a===0&&s===i-1;return v1(e,_6(o,a,l,c),o,t)}function v1(e,t,o,n){return !n||!n.setContext||!o?t:A6(e,t,o,n)}function A6(e,t,o,n){let i=e._chart.getContext(),r=_1(e.options),{_datasetIndex:a,options:{spanGaps:s}}=e,l=o.length,c=[],d=r,u=t[0].start,p=u;function h(m,g,f,x){let b=s?-1:1;if(m!==g){for(m+=l;o[m%l].skip;)m-=b;for(;o[g%l].skip;)g+=b;m%l!==g%l&&(c.push({start:m%l,end:g%l,loop:f,style:x}),d=x,u=g%l);}}for(let m of t){u=s?u:m.start;let g=o[u%l],f;for(p=u+1;p<=m.end;p++){let x=o[p%l];f=_1(n.setContext(Me(i,{type:"segment",p0:g,p1:x,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:a}))),M6(f,d)&&h(u,p-1,m.loop,d),g=x,d=f;}u<p-1&&h(u,p-1,m.loop,d);}return c}function _1(e){return {backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function M6(e,t){return t&&JSON.stringify(e)!==JSON.stringify(t)}var qd=class{constructor(){this._request=null,this._charts=new Map,this._running=false,this._lastDate=void 0;}_notify(t,o,n,i){let r=o.listeners[i],a=o.duration;r.forEach(s=>s({chart:t,initial:o.initial,numSteps:a,currentStep:Math.min(n-o.start,a)}));}_refresh(){this._request||(this._running=true,this._request=ss.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh();}));}_update(t=Date.now()){let o=0;this._charts.forEach((n,i)=>{if(!n.running||!n.items.length)return;let r=n.items,a=r.length-1,s=false,l;for(;a>=0;--a)l=r[a],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),s=true):(r[a]=r[r.length-1],r.pop());s&&(i.draw(),this._notify(i,n,t,"progress")),r.length||(n.running=false,this._notify(i,n,t,"complete"),n.initial=false),o+=r.length;}),this._lastDate=t,o===0&&(this._running=false);}_getAnims(t){let o=this._charts,n=o.get(t);return n||(n={running:false,initial:true,items:[],listeners:{complete:[],progress:[]}},o.set(t,n)),n}listen(t,o,n){this._getAnims(t).listeners[o].push(n);}add(t,o){!o||!o.length||this._getAnims(t).items.push(...o);}has(t){return this._getAnims(t).items.length>0}start(t){let o=this._charts.get(t);o&&(o.running=true,o.start=Date.now(),o.duration=o.items.reduce((n,i)=>Math.max(n,i._duration),0),this._refresh());}running(t){if(!this._running)return false;let o=this._charts.get(t);return !(!o||!o.running||!o.items.length)}stop(t){let o=this._charts.get(t);if(!o||!o.items.length)return;let n=o.items,i=n.length-1;for(;i>=0;--i)n[i].cancel();o.items=[],this._notify(t,o,Date.now(),"complete");}remove(t){return this._charts.delete(t)}},je=new qd,X1="transparent",I6={boolean(e,t,o){return o>.5?t:e},color(e,t,o){let n=tn(e||X1),i=n.valid&&tn(t||X1);return i&&i.valid?i.mix(n,o).hexString():t},number(e,t,o){return e+(t-e)*o}},Qd=class{constructor(t,o,n,i){let r=o[n];i=rt([t.to,i,r,t.from]);let a=rt([t.from,r,i]);this._active=true,this._fn=t.fn||I6[t.type||typeof a],this._easing=Yo[t.easing]||Yo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=o,this._prop=n,this._from=a,this._to=i,this._promises=void 0;}active(){return this._active}update(t,o,n){if(this._active){this._notify(false);let i=this._target[this._prop],r=n-this._start,a=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=rt([t.to,o,i,t.from]),this._from=rt([t.from,i,o]);}}cancel(){this._active&&(this.tick(Date.now()),this._active=false,this._notify(false));}tick(t){let o=t-this._start,n=this._duration,i=this._prop,r=this._from,a=this._loop,s=this._to,l;if(this._active=r!==s&&(a||o<n),!this._active){this._target[i]=s,this._notify(true);return}if(o<0){this._target[i]=r;return}l=o/n%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(r,s,l);}wait(){let t=this._promises||(this._promises=[]);return new Promise((o,n)=>{t.push({res:o,rej:n});})}_notify(t){let o=t?"res":"rej",n=this._promises||[];for(let i=0;i<n.length;i++)n[i][o]();}},E6=["x","y","borderWidth","radius","tension"],F6=["color","borderColor","backgroundColor"];H.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});var L6=Object.keys(H.animation);H.describe("animation",{_fallback:false,_indexable:false,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"});H.set("animations",{colors:{type:"color",properties:F6},numbers:{type:"number",properties:E6}});H.describe("animations",{_fallback:"animation"});H.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}});var Hn=class{constructor(t,o){this._chart=t,this._properties=new Map,this.configure(o);}configure(t){if(!z(t))return;let o=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{let i=t[n];if(!z(i))return;let r={};for(let a of L6)r[a]=i[a];(Z(i.properties)&&i.properties||[n]).forEach(a=>{(a===n||!o.has(a))&&o.set(a,r);});});}_animateOptions(t,o){let n=o.options,i=R6(t,n);if(!i)return [];let r=this._createAnimations(i,n);return n.$shared&&B6(t.options.$animations,n).then(()=>{t.options=n;},()=>{}),r}_createAnimations(t,o){let n=this._properties,i=[],r=t.$animations||(t.$animations={}),a=Object.keys(o),s=Date.now(),l;for(l=a.length-1;l>=0;--l){let c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,o));continue}let d=o[c],u=r[c],p=n.get(c);if(u)if(p&&u.active()){u.update(p,d,s);continue}else u.cancel();if(!p||!p.duration){t[c]=d;continue}r[c]=u=new Qd(p,t,c,d),i.push(u);}return i}update(t,o){if(this._properties.size===0){Object.assign(t,o);return}let n=this._createAnimations(t,o);if(n.length)return je.add(this._chart,n),true}};function B6(e,t){let o=[],n=Object.keys(t);for(let i=0;i<n.length;i++){let r=e[n[i]];r&&r.active()&&o.push(r.wait());}return Promise.all(o)}function R6(e,t){if(!t)return;let o=e.options;if(!o){e.options=t;return}return o.$shared&&(e.options=o=Object.assign({},o,{$shared:false,$animations:{}})),o}function K1(e,t){let o=e&&e.options||{},n=o.reverse,i=o.min===void 0?t:0,r=o.max===void 0?t:0;return {start:n?r:i,end:n?i:r}}function D6(e,t,o){if(o===false)return false;let n=K1(e,o),i=K1(t,o);return {top:i.end,right:n.end,bottom:i.start,left:n.start}}function N6(e){let t,o,n,i;return z(e)?(t=e.top,o=e.right,n=e.bottom,i=e.left):t=o=n=i=e,{top:t,right:o,bottom:n,left:i,disabled:e===false}}function O0(e,t){let o=[],n=e._getSortedDatasetMetas(t),i,r;for(i=0,r=n.length;i<r;++i)o.push(n[i].index);return o}function q1(e,t,o,n={}){let i=e.keys,r=n.mode==="single",a,s,l,c;if(t!==null){for(a=0,s=i.length;a<s;++a){if(l=+i[a],l===o){if(n.all)continue;break}c=e.values[l],lt(c)&&(r||t===0||re(t)===re(c))&&(t+=c);}return t}}function U6(e){let t=Object.keys(e),o=new Array(t.length),n,i,r;for(n=0,i=t.length;n<i;++n)r=t[n],o[n]={x:r,y:e[r]};return o}function Q1(e,t){let o=e&&e.options.stacked;return o||o===void 0&&t.stack!==void 0}function O6(e,t,o){return `${e.id}.${t.id}.${o.stack||o.type}`}function z6(e){let{min:t,max:o,minDefined:n,maxDefined:i}=e.getUserBounds();return {min:n?t:Number.NEGATIVE_INFINITY,max:i?o:Number.POSITIVE_INFINITY}}function V6(e,t,o){let n=e[t]||(e[t]={});return n[o]||(n[o]={})}function J1(e,t,o,n){for(let i of t.getMatchingVisibleMetas(n).reverse()){let r=e[i.index];if(o&&r>0||!o&&r<0)return i.index}return null}function t0(e,t){let{chart:o,_cachedMeta:n}=e,i=o._stacks||(o._stacks={}),{iScale:r,vScale:a,index:s}=n,l=r.axis,c=a.axis,d=O6(r,a,n),u=t.length,p;for(let h=0;h<u;++h){let m=t[h],{[l]:g,[c]:f}=m,x=m._stacks||(m._stacks={});p=x[c]=V6(i,d,g),p[s]=f,p._top=J1(p,a,true,n.type),p._bottom=J1(p,a,false,n.type);}}function $d(e,t){let o=e.scales;return Object.keys(o).filter(n=>o[n].axis===t).shift()}function $6(e,t){return Me(e,{active:false,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function H6(e,t,o){return Me(e,{active:false,dataIndex:t,parsed:void 0,raw:void 0,element:o,index:t,mode:"default",type:"data"})}function Xi(e,t){let o=e.controller.index,n=e.vScale&&e.vScale.axis;if(n){t=t||e._parsed;for(let i of t){let r=i._stacks;if(!r||r[n]===void 0||r[n][o]===void 0)return;delete r[n][o];}}}var Hd=e=>e==="reset"||e==="none",e0=(e,t)=>t?e:Object.assign({},e),W6=(e,t,o)=>e&&!t.hidden&&t._stacked&&{keys:O0(o,true),values:null},qt=class{constructor(t,o){this.chart=t,this._ctx=t.ctx,this.index=o,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=false,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=false,this.supportsDecimation=false,this.$context=void 0,this._syncList=[],this.initialize();}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Q1(t.vScale,t),this.addElements();}updateIndex(t){this.index!==t&&Xi(this._cachedMeta),this.index=t;}linkScales(){let t=this.chart,o=this._cachedMeta,n=this.getDataset(),i=(u,p,h,m)=>u==="x"?p:u==="r"?m:h,r=o.xAxisID=N(n.xAxisID,$d(t,"x")),a=o.yAxisID=N(n.yAxisID,$d(t,"y")),s=o.rAxisID=N(n.rAxisID,$d(t,"r")),l=o.indexAxis,c=o.iAxisID=i(l,r,a,s),d=o.vAxisID=i(l,a,r,s);o.xScale=this.getScaleForId(r),o.yScale=this.getScaleForId(a),o.rScale=this.getScaleForId(s),o.iScale=this.getScaleForId(c),o.vScale=this.getScaleForId(d);}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let o=this._cachedMeta;return t===o.iScale?o.vScale:o.iScale}reset(){this._update("reset");}_destroy(){let t=this._cachedMeta;this._data&&rs(this._data,this),t._stacked&&Xi(t);}_dataCheck(){let t=this.getDataset(),o=t.data||(t.data=[]),n=this._data;if(z(o))this._data=U6(o);else if(n!==o){if(n){rs(n,this);let i=this._cachedMeta;Xi(i),i._parsed=[];}o&&Object.isExtensible(o)&&Td(o,this),this._syncList=[],this._data=o;}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType);}buildOrUpdateElements(t){let o=this._cachedMeta,n=this.getDataset(),i=false;this._dataCheck();let r=o._stacked;o._stacked=Q1(o.vScale,o),o.stack!==n.stack&&(i=true,Xi(o),o.stack=n.stack),this._resyncElements(t),(i||r!==o._stacked)&&t0(this,o._parsed);}configure(){let t=this.chart.config,o=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),o,true);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={};}parse(t,o){let{_cachedMeta:n,_data:i}=this,{iScale:r,_stacked:a}=n,s=r.axis,l=t===0&&o===i.length?true:n._sorted,c=t>0&&n._parsed[t-1],d,u,p;if(this._parsing===false)n._parsed=i,n._sorted=true,p=i;else {Z(i[t])?p=this.parseArrayData(n,i,t,o):z(i[t])?p=this.parseObjectData(n,i,t,o):p=this.parsePrimitiveData(n,i,t,o);let h=()=>u[s]===null||c&&u[s]<c[s];for(d=0;d<o;++d)n._parsed[d+t]=u=p[d],l&&(h()&&(l=false),c=u);n._sorted=l;}a&&t0(this,p);}parsePrimitiveData(t,o,n,i){let{iScale:r,vScale:a}=t,s=r.axis,l=a.axis,c=r.getLabels(),d=r===a,u=new Array(i),p,h,m;for(p=0,h=i;p<h;++p)m=p+n,u[p]={[s]:d||r.parse(c[m],m),[l]:a.parse(o[m],m)};return u}parseArrayData(t,o,n,i){let{xScale:r,yScale:a}=t,s=new Array(i),l,c,d,u;for(l=0,c=i;l<c;++l)d=l+n,u=o[d],s[l]={x:r.parse(u[0],d),y:a.parse(u[1],d)};return s}parseObjectData(t,o,n,i){let{xScale:r,yScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=new Array(i),d,u,p,h;for(d=0,u=i;d<u;++d)p=d+n,h=o[p],c[d]={x:r.parse(Ae(h,s),p),y:a.parse(Ae(h,l),p)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,o,n){let i=this.chart,r=this._cachedMeta,a=o[t.axis],s={keys:O0(i,true),values:o._stacks[t.axis]};return q1(s,a,r.index,{mode:n})}updateRangeFromParsed(t,o,n,i){let r=n[o.axis],a=r===null?NaN:r,s=i&&n._stacks[o.axis];i&&s&&(i.values=s,a=q1(i,r,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a);}getMinMax(t,o){let n=this._cachedMeta,i=n._parsed,r=n._sorted&&t===n.iScale,a=i.length,s=this._getOtherScale(t),l=W6(o,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=z6(s),p,h;function m(){h=i[p];let g=h[s.axis];return !lt(h[t.axis])||d>g||u<g}for(p=0;p<a&&!(!m()&&(this.updateRangeFromParsed(c,t,h,l),r));++p);if(r){for(p=a-1;p>=0;--p)if(!m()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){let o=this._cachedMeta._parsed,n=[],i,r,a;for(i=0,r=o.length;i<r;++i)a=o[i][t.axis],lt(a)&&n.push(a);return n}getMaxOverflow(){return false}getLabelAndValue(t){let o=this._cachedMeta,n=o.iScale,i=o.vScale,r=this.getParsed(t);return {label:n?""+n.getLabelForValue(r[n.axis]):"",value:i?""+i.getLabelForValue(r[i.axis]):""}}_update(t){let o=this._cachedMeta;this.update(t||"default"),o._clip=N6(N(this.options.clip,D6(o.xScale,o.yScale,this.getMaxOverflow())));}update(t){}draw(){let t=this._ctx,o=this.chart,n=this._cachedMeta,i=n.data||[],r=o.chartArea,a=[],s=this._drawStart||0,l=this._drawCount||i.length-s,c=this.options.drawActiveElementsOnTop,d;for(n.dataset&&n.dataset.draw(t,r,s,l),d=s;d<s+l;++d){let u=i[d];u.hidden||(u.active&&c?a.push(u):u.draw(t,r));}for(d=0;d<a.length;++d)a[d].draw(t,r);}getStyle(t,o){let n=o?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,o,n){let i=this.getDataset(),r;if(t>=0&&t<this._cachedMeta.data.length){let a=this._cachedMeta.data[t];r=a.$context||(a.$context=H6(this.getContext(),t,a)),r.parsed=this.getParsed(t),r.raw=i.data[t],r.index=r.dataIndex=t;}else r=this.$context||(this.$context=$6(this.chart.getContext(),this.index)),r.dataset=i,r.index=r.datasetIndex=this.index;return r.active=!!o,r.mode=n,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,o){return this._resolveElementOptions(this.dataElementType.id,o,t)}_resolveElementOptions(t,o="default",n){let i=o==="active",r=this._cachedDataOpts,a=t+"-"+o,s=r[a],l=this.enableOptionSharing&&st(n);if(s)return e0(s,l);let c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),u=i?[`${t}Hover`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),d),h=Object.keys(H.elements[t]),m=()=>this.getContext(n,i),g=c.resolveNamedOptions(p,h,m,u);return g.$shared&&(g.$shared=l,r[a]=Object.freeze(e0(g,l))),g}_resolveAnimations(t,o,n){let i=this.chart,r=this._cachedDataOpts,a=`animation-${o}`,s=r[a];if(s)return s;let l;if(i.options.animation!==false){let d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,o),p=d.getOptionScopes(this.getDataset(),u);l=d.createResolver(p,this.getContext(t,n,o));}let c=new Hn(i,l&&l.animations);return l&&l._cacheable&&(r[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,o){return !o||Hd(t)||this.chart._animationsDisabled}_getSharedOptions(t,o){let n=this.resolveDataElementOptions(t,o),i=this._sharedOptions,r=this.getSharedOptions(n),a=this.includeOptions(o,r)||r!==i;return this.updateSharedOptions(r,o,n),{sharedOptions:r,includeOptions:a}}updateElement(t,o,n,i){Hd(i)?Object.assign(t,n):this._resolveAnimations(o,i).update(t,n);}updateSharedOptions(t,o,n){t&&!Hd(o)&&this._resolveAnimations(void 0,o).update(t,n);}_setStyle(t,o,n,i){t.active=i;let r=this.getStyle(o,i);this._resolveAnimations(o,n,i).update(t,{options:!i&&this.getSharedOptions(r)||r});}removeHoverStyle(t,o,n){this._setStyle(t,n,"active",false);}setHoverStyle(t,o,n){this._setStyle(t,n,"active",true);}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",false);}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",true);}_resyncElements(t){let o=this._data,n=this._cachedMeta.data;for(let[s,l,c]of this._syncList)this[s](l,c);this._syncList=[];let i=n.length,r=o.length,a=Math.min(r,i);a&&this.parse(0,a),r>i?this._insertElements(i,r-i,t):r<i&&this._removeElements(r,i-r);}_insertElements(t,o,n=true){let i=this._cachedMeta,r=i.data,a=t+o,s,l=c=>{for(c.length+=o,s=c.length-1;s>=a;s--)c[s]=c[s-o];};for(l(r),s=t;s<a;++s)r[s]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,o),n&&this.updateElements(r,t,o,"reset");}updateElements(t,o,n,i){}_removeElements(t,o){let n=this._cachedMeta;if(this._parsing){let i=n._parsed.splice(t,o);n._stacked&&Xi(n,i);}n.data.splice(t,o);}_sync(t){if(this._parsing)this._syncList.push(t);else {let[o,n,i]=t;this[o](n,i);}this.chart._dataChanges.push([this.index,...t]);}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t]);}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1]);}_onDataShift(){this._sync(["_removeElements",0,1]);}_onDataSplice(t,o){o&&this._sync(["_removeElements",t,o]);let n=arguments.length-2;n&&this._sync(["_insertElements",t,n]);}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length]);}};qt.defaults={};qt.prototype.datasetElementType=null;qt.prototype.dataElementType=null;function G6(e,t){if(!e._cache.$bar){let o=e.getMatchingVisibleMetas(t),n=[];for(let i=0,r=o.length;i<r;i++)n=n.concat(o[i].controller.getAllParsedValues(e));e._cache.$bar=as(n.sort((i,r)=>i-r));}return e._cache.$bar}function j6(e){let t=e.iScale,o=G6(t,e.type),n=t._length,i,r,a,s,l=()=>{a===32767||a===-32768||(st(s)&&(n=Math.min(n,Math.abs(a-s)||n)),s=a);};for(i=0,r=o.length;i<r;++i)a=t.getPixelForValue(o[i]),l();for(s=void 0,i=0,r=t.ticks.length;i<r;++i)a=t.getPixelForTick(i),l();return n}function Y6(e,t,o,n){let i=o.barThickness,r,a;return W(i)?(r=t.min*o.categoryPercentage,a=o.barPercentage):(r=i*n,a=1),{chunk:r/n,ratio:a,start:t.pixels[e]-r/2}}function Z6(e,t,o,n){let i=t.pixels,r=i[e],a=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null,l=o.categoryPercentage;a===null&&(a=r-(s===null?t.end-t.start:s-r)),s===null&&(s=r+r-a);let c=r-(r-Math.min(a,s))/2*l;return {chunk:Math.abs(s-a)/2*l/n,ratio:o.barPercentage,start:c}}function X6(e,t,o,n){let i=o.parse(e[0],n),r=o.parse(e[1],n),a=Math.min(i,r),s=Math.max(i,r),l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),t[o.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:r,min:a,max:s};}function z0(e,t,o,n){return Z(e)?X6(e,t,o,n):t[o.axis]=o.parse(e,n),t}function o0(e,t,o,n){let i=e.iScale,r=e.vScale,a=i.getLabels(),s=i===r,l=[],c,d,u,p;for(c=o,d=o+n;c<d;++c)p=t[c],u={},u[i.axis]=s||i.parse(a[c],c),l.push(z0(p,u,r,c));return l}function Wd(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function K6(e,t,o){return e!==0?re(e):(t.isHorizontal()?1:-1)*(t.min>=o?1:-1)}function q6(e){let t,o,n,i,r;return e.horizontal?(t=e.base>e.x,o="left",n="right"):(t=e.base<e.y,o="bottom",n="top"),t?(i="end",r="start"):(i="start",r="end"),{start:o,end:n,reverse:t,top:i,bottom:r}}function Q6(e,t,o,n){let i=t.borderSkipped,r={};if(!i){e.borderSkipped=r;return}if(i===true){e.borderSkipped={top:true,right:true,bottom:true,left:true};return}let{start:a,end:s,reverse:l,top:c,bottom:d}=q6(e);i==="middle"&&o&&(e.enableBorderRadius=true,(o._top||0)===n?i=c:(o._bottom||0)===n?i=d:(r[n0(d,a,s,l)]=true,i=c)),r[n0(i,a,s,l)]=true,e.borderSkipped=r;}function n0(e,t,o,n){return n?(e=J6(e,t,o),e=i0(e,o,t)):e=i0(e,t,o),e}function J6(e,t,o){return e===t?o:e===o?t:e}function i0(e,t,o){return e==="start"?t:e==="end"?o:e}function t_(e,{inflateAmount:t},o){e.inflateAmount=t==="auto"?o===1?.33:0:t;}var nn=class extends qt{parsePrimitiveData(t,o,n,i){return o0(t,o,n,i)}parseArrayData(t,o,n,i){return o0(t,o,n,i)}parseObjectData(t,o,n,i){let{iScale:r,vScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?s:l,d=a.axis==="x"?s:l,u=[],p,h,m,g;for(p=n,h=n+i;p<h;++p)g=o[p],m={},m[r.axis]=r.parse(Ae(g,c),p),u.push(z0(Ae(g,d),m,a,p));return u}updateRangeFromParsed(t,o,n,i){super.updateRangeFromParsed(t,o,n,i);let r=n._custom;r&&o===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max));}getMaxOverflow(){return 0}getLabelAndValue(t){let o=this._cachedMeta,{iScale:n,vScale:i}=o,r=this.getParsed(t),a=r._custom,s=Wd(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(r[i.axis]);return {label:""+n.getLabelForValue(r[n.axis]),value:s}}initialize(){this.enableOptionSharing=true,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack;}update(t){let o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,t);}updateElements(t,o,n,i){let r=i==="reset",{index:a,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),c=s.isHorizontal(),d=this._getRuler(),{sharedOptions:u,includeOptions:p}=this._getSharedOptions(o,i);for(let h=o;h<o+n;h++){let m=this.getParsed(h),g=r||W(m[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),f=this._calculateBarIndexPixels(h,d),x=(m._stacks||{})[s.axis],b={horizontal:c,base:g.base,enableBorderRadius:!x||Wd(m._custom)||a===x._top||a===x._bottom,x:c?g.head:f.center,y:c?f.center:g.head,height:c?f.size:Math.abs(g.size),width:c?Math.abs(g.size):f.size};p&&(b.options=u||this.resolveDataElementOptions(h,t[h].active?"active":i));let T=b.options||t[h].options;Q6(b,T,x,a),t_(b,T,d.ratio),this.updateElement(t[h],h,b,i);}}_getStacks(t,o){let{iScale:n}=this._cachedMeta,i=n.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),r=n.options.stacked,a=[],s=l=>{let c=l.controller.getParsed(o),d=c&&c[l.vScale.axis];if(W(d)||isNaN(d))return true};for(let l of i)if(!(o!==void 0&&s(l))&&((r===false||a.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&a.push(l.stack),l.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,o,n){let i=this._getStacks(t,n),r=o!==void 0?i.indexOf(o):-1;return r===-1?i.length-1:r}_getRuler(){let t=this.options,o=this._cachedMeta,n=o.iScale,i=[],r,a;for(r=0,a=o.data.length;r<a;++r)i.push(n.getPixelForValue(this.getParsed(r)[n.axis],r));let s=t.barThickness;return {min:s||j6(o),pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:s?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:o,_stacked:n},options:{base:i,minBarLength:r}}=this,a=i||0,s=this.getParsed(t),l=s._custom,c=Wd(l),d=s[o.axis],u=0,p=n?this.applyStack(o,s,n):d,h,m;p!==d&&(u=p-d,p=d),c&&(d=l.barStart,p=l.barEnd-l.barStart,d!==0&&re(d)!==re(l.barEnd)&&(u=0),u+=d);let g=!W(i)&&!c?i:u,f=o.getPixelForValue(g);if(this.chart.getDataVisibility(t)?h=o.getPixelForValue(u+p):h=f,m=h-f,Math.abs(m)<r){m=K6(m,o,a)*r,d===a&&(f-=m/2);let x=o.getPixelForDecimal(0),b=o.getPixelForDecimal(1),T=Math.min(x,b),k=Math.max(x,b);f=Math.max(Math.min(f,k),T),h=f+m;}if(f===o.getPixelForValue(a)){let x=re(m)*o.getLineWidthForValue(a)/2;f+=x,m-=x;}return {size:m,base:f,head:h,center:h+m/2}}_calculateBarIndexPixels(t,o){let n=o.scale,i=this.options,r=i.skipNull,a=N(i.maxBarThickness,1/0),s,l;if(o.grouped){let c=r?this._getStackCount(t):o.stackCount,d=i.barThickness==="flex"?Z6(t,o,i,c):Y6(t,o,i,c),u=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);s=d.start+d.chunk*u+d.chunk/2,l=Math.min(a,d.chunk*d.ratio);}else s=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(a,o.min*o.ratio);return {base:s-l/2,head:s+l/2,center:s,size:l}}draw(){let t=this._cachedMeta,o=t.vScale,n=t.data,i=n.length,r=0;for(;r<i;++r)this.getParsed(r)[o.axis]!==null&&n[r].draw(this._ctx);}};nn.id="bar";nn.defaults={datasetElementType:false,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:true,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};nn.overrides={scales:{_index_:{type:"category",offset:true,grid:{offset:true}},_value_:{type:"linear",beginAtZero:true}}};var Wn=class extends qt{initialize(){this.enableOptionSharing=true,super.initialize();}parsePrimitiveData(t,o,n,i){let r=super.parsePrimitiveData(t,o,n,i);for(let a=0;a<r.length;a++)r[a]._custom=this.resolveDataElementOptions(a+n).radius;return r}parseArrayData(t,o,n,i){let r=super.parseArrayData(t,o,n,i);for(let a=0;a<r.length;a++){let s=o[n+a];r[a]._custom=N(s[2],this.resolveDataElementOptions(a+n).radius);}return r}parseObjectData(t,o,n,i){let r=super.parseObjectData(t,o,n,i);for(let a=0;a<r.length;a++){let s=o[n+a];r[a]._custom=N(s&&s.r&&+s.r,this.resolveDataElementOptions(a+n).radius);}return r}getMaxOverflow(){let t=this._cachedMeta.data,o=0;for(let n=t.length-1;n>=0;--n)o=Math.max(o,t[n].size(this.resolveDataElementOptions(n))/2);return o>0&&o}getLabelAndValue(t){let o=this._cachedMeta,{xScale:n,yScale:i}=o,r=this.getParsed(t),a=n.getLabelForValue(r.x),s=i.getLabelForValue(r.y),l=r._custom;return {label:o.label,value:"("+a+", "+s+(l?", "+l:"")+")"}}update(t){let o=this._cachedMeta.data;this.updateElements(o,0,o.length,t);}updateElements(t,o,n,i){let r=i==="reset",{iScale:a,vScale:s}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(o,i),d=a.axis,u=s.axis;for(let p=o;p<o+n;p++){let h=t[p],m=!r&&this.getParsed(p),g={},f=g[d]=r?a.getPixelForDecimal(.5):a.getPixelForValue(m[d]),x=g[u]=r?s.getBasePixel():s.getPixelForValue(m[u]);g.skip=isNaN(f)||isNaN(x),c&&(g.options=l||this.resolveDataElementOptions(p,h.active?"active":i),r&&(g.options.radius=0)),this.updateElement(h,p,g,i);}}resolveDataElementOptions(t,o){let n=this.getParsed(t),i=super.resolveDataElementOptions(t,o);i.$shared&&(i=Object.assign({},i,{$shared:false}));let r=i.radius;return o!=="active"&&(i.radius=0),i.radius+=N(n&&n._custom,r),i}};Wn.id="bubble";Wn.defaults={datasetElementType:false,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Wn.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return ""}}}}};function e_(e,t,o){let n=1,i=1,r=0,a=0;if(t<Q){let s=e,l=s+t,c=Math.cos(s),d=Math.sin(s),u=Math.cos(l),p=Math.sin(l),h=(T,k,w)=>Jo(T,s,l,true)?1:Math.max(k,k*o,w,w*o),m=(T,k,w)=>Jo(T,s,l,true)?-1:Math.min(k,k*o,w,w*o),g=h(0,c,u),f=h(et,d,p),x=m(G,c,u),b=m(G+et,d,p);n=(g-x)/2,i=(f-b)/2,r=-(g+x)/2,a=-(f+b)/2;}return {ratioX:n,ratioY:i,offsetX:r,offsetY:a}}var To=class extends qt{constructor(t,o){super(t,o),this.enableOptionSharing=true,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0;}linkScales(){}parse(t,o){let n=this.getDataset().data,i=this._cachedMeta;if(this._parsing===false)i._parsed=n;else {let r=l=>+n[l];if(z(n[t])){let{key:l="value"}=this._parsing;r=c=>+Ae(n[c],l);}let a,s;for(a=t,s=t+o;a<s;++a)i._parsed[a]=r(a);}}_getRotation(){return gt(this.options.rotation-90)}_getCircumference(){return gt(this.options.circumference)}_getRotationExtents(){let t=Q,o=-Q;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)){let i=this.chart.getDatasetMeta(n).controller,r=i._getRotation(),a=i._getCircumference();t=Math.min(t,r),o=Math.max(o,r+a);}return {rotation:t,circumference:o-t}}update(t){let o=this.chart,{chartArea:n}=o,i=this._cachedMeta,r=i.data,a=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,s=Math.max((Math.min(n.width,n.height)-a)/2,0),l=Math.min(fd(this.options.cutout,s),1),c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:m,offsetY:g}=e_(u,d,l),f=(n.width-a)/p,x=(n.height-a)/h,b=Math.max(Math.min(f,x)/2,0),T=Ja(this.options.radius,b),k=Math.max(T*l,0),w=(T-k)/this._getVisibleDatasetWeightTotal();this.offsetX=m*T,this.offsetY=g*T,i.total=this.calculateTotal(),this.outerRadius=T-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*c,0),this.updateElements(r,0,r.length,t);}_circumference(t,o){let n=this.options,i=this._cachedMeta,r=this._getCircumference();return o&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*r/Q)}updateElements(t,o,n,i){let r=i==="reset",a=this.chart,s=a.chartArea,c=a.options.animation,d=(s.left+s.right)/2,u=(s.top+s.bottom)/2,p=r&&c.animateScale,h=p?0:this.innerRadius,m=p?0:this.outerRadius,{sharedOptions:g,includeOptions:f}=this._getSharedOptions(o,i),x=this._getRotation(),b;for(b=0;b<o;++b)x+=this._circumference(b,r);for(b=o;b<o+n;++b){let T=this._circumference(b,r),k=t[b],w={x:d+this.offsetX,y:u+this.offsetY,startAngle:x,endAngle:x+T,circumference:T,outerRadius:m,innerRadius:h};f&&(w.options=g||this.resolveDataElementOptions(b,k.active?"active":i)),x+=T,this.updateElement(k,b,w,i);}}calculateTotal(){let t=this._cachedMeta,o=t.data,n=0,i;for(i=0;i<o.length;i++){let r=t._parsed[i];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(i)&&!o[i].hidden&&(n+=Math.abs(r));}return n}calculateCircumference(t){let o=this._cachedMeta.total;return o>0&&!isNaN(t)?Q*(Math.abs(t)/o):0}getLabelAndValue(t){let o=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=en(o._parsed[t],n.options.locale);return {label:i[t]||"",value:r}}getMaxBorderWidth(t){let o=0,n=this.chart,i,r,a,s,l;if(!t){for(i=0,r=n.data.datasets.length;i<r;++i)if(n.isDatasetVisible(i)){a=n.getDatasetMeta(i),t=a.data,s=a.controller;break}}if(!t)return 0;for(i=0,r=t.length;i<r;++i)l=s.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(o=Math.max(o,l.borderWidth||0,l.hoverBorderWidth||0));return o}getMaxOffset(t){let o=0;for(let n=0,i=t.length;n<i;++n){let r=this.resolveDataElementOptions(n);o=Math.max(o,r.offset||0,r.hoverOffset||0);}return o}_getRingWeightOffset(t){let o=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(o+=this._getRingWeight(n));return o}_getRingWeight(t){return Math.max(N(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};To.id="doughnut";To.defaults={datasetElementType:false,dataElementType:"arc",animation:{animateRotate:true,animateScale:false},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};To.descriptors={_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"};To.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:o}}=e.legend.options;return t.labels.map((n,i)=>{let a=e.getDatasetMeta(0).controller.getStyle(i);return {text:n,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(i),index:i}})}return []}},onClick(e,t,o){o.chart.toggleDataVisibility(t.index),o.chart.update();}},tooltip:{callbacks:{title(){return ""},label(e){let t=e.label,o=": "+e.formattedValue;return Z(t)?(t=t.slice(),t[0]+=o):t+=o,t}}}}};var Gn=class extends qt{initialize(){this.enableOptionSharing=true,this.supportsDecimation=true,super.initialize();}update(t){let o=this._cachedMeta,{dataset:n,data:i=[],_dataset:r}=o,a=this.chart._animationsDisabled,{start:s,count:l}=cs(o,i,a);this._drawStart=s,this._drawCount=l,ds(o)&&(s=0,l=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=i;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},t),this.updateElements(i,s,l,t);}updateElements(t,o,n,i){let r=i==="reset",{iScale:a,vScale:s,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:u}=this._getSharedOptions(o,i),p=a.axis,h=s.axis,{spanGaps:m,segment:g}=this.options,f=Kt(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||r||i==="none",b=o>0&&this.getParsed(o-1);for(let T=o;T<o+n;++T){let k=t[T],w=this.getParsed(T),v=x?k:{},_=W(w[h]),M=v[p]=a.getPixelForValue(w[p],T),I=v[h]=r||_?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,w,l):w[h],T);v.skip=isNaN(M)||isNaN(I)||_,v.stop=T>0&&Math.abs(w[p]-b[p])>f,g&&(v.parsed=w,v.raw=c.data[T]),u&&(v.options=d||this.resolveDataElementOptions(T,k.active?"active":i)),x||this.updateElement(k,T,v,i),b=w;}}getMaxOverflow(){let t=this._cachedMeta,o=t.dataset,n=o.options&&o.options.borderWidth||0,i=t.data||[];if(!i.length)return n;let r=i[0].size(this.resolveDataElementOptions(0)),a=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,r,a)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw();}};Gn.id="line";Gn.defaults={datasetElementType:"line",dataElementType:"point",showLine:true,spanGaps:false};Gn.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var jn=class extends qt{constructor(t,o){super(t,o),this.innerRadius=void 0,this.outerRadius=void 0;}getLabelAndValue(t){let o=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=en(o._parsed[t].r,n.options.locale);return {label:i[t]||"",value:r}}parseObjectData(t,o,n,i){return fs.bind(this)(t,o,n,i)}update(t){let o=this._cachedMeta.data;this._updateRadius(),this.updateElements(o,0,o.length,t);}getMinMax(){let t=this._cachedMeta,o={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,i)=>{let r=this.getParsed(i).r;!isNaN(r)&&this.chart.getDataVisibility(i)&&(r<o.min&&(o.min=r),r>o.max&&(o.max=r));}),o}_updateRadius(){let t=this.chart,o=t.chartArea,n=t.options,i=Math.min(o.right-o.left,o.bottom-o.top),r=Math.max(i/2,0),a=Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0),s=(r-a)/t.getVisibleDatasetCount();this.outerRadius=r-s*this.index,this.innerRadius=this.outerRadius-s;}updateElements(t,o,n,i){let r=i==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,u=c.yCenter,p=c.getIndexAngle(0)-.5*G,h=p,m,g=360/this.countVisibleElements();for(m=0;m<o;++m)h+=this._computeAngle(m,i,g);for(m=o;m<o+n;m++){let f=t[m],x=h,b=h+this._computeAngle(m,i,g),T=a.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;h=b,r&&(l.animateScale&&(T=0),l.animateRotate&&(x=b=p));let k={x:d,y:u,innerRadius:0,outerRadius:T,startAngle:x,endAngle:b,options:this.resolveDataElementOptions(m,f.active?"active":i)};this.updateElement(f,m,k,i);}}countVisibleElements(){let t=this._cachedMeta,o=0;return t.data.forEach((n,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&o++;}),o}_computeAngle(t,o,n){return this.chart.getDataVisibility(t)?gt(this.resolveDataElementOptions(t,o).angle||n):0}};jn.id="polarArea";jn.defaults={dataElementType:"arc",animation:{animateRotate:true,animateScale:true},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};jn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:o}}=e.legend.options;return t.labels.map((n,i)=>{let a=e.getDatasetMeta(0).controller.getStyle(i);return {text:n,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(i),index:i}})}return []}},onClick(e,t,o){o.chart.toggleDataVisibility(t.index),o.chart.update();}},tooltip:{callbacks:{title(){return ""},label(e){return e.chart.data.labels[e.dataIndex]+": "+e.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:false},beginAtZero:true,grid:{circular:true},pointLabels:{display:false},startAngle:0}}};var or=class extends To{};or.id="pie";or.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var Yn=class extends qt{getLabelAndValue(t){let o=this._cachedMeta.vScale,n=this.getParsed(t);return {label:o.getLabels()[t],value:""+o.getLabelForValue(n[o.axis])}}parseObjectData(t,o,n,i){return fs.bind(this)(t,o,n,i)}update(t){let o=this._cachedMeta,n=o.dataset,i=o.data||[],r=o.iScale.getLabels();if(n.points=i,t!=="resize"){let a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);let s={_loop:true,_fullLoop:r.length===i.length,options:a};this.updateElement(n,void 0,s,t);}this.updateElements(i,0,i.length,t);}updateElements(t,o,n,i){let r=this._cachedMeta.rScale,a=i==="reset";for(let s=o;s<o+n;s++){let l=t[s],c=this.resolveDataElementOptions(s,l.active?"active":i),d=r.getPointPositionForValue(s,this.getParsed(s).r),u=a?r.xCenter:d.x,p=a?r.yCenter:d.y,h={x:u,y:p,angle:d.angle,skip:isNaN(u)||isNaN(p),options:c};this.updateElement(l,s,h,i);}}};Yn.id="radar";Yn.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:true,elements:{line:{fill:"start"}}};Yn.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};var xt=class{constructor(){this.x=void 0,this.y=void 0,this.active=false,this.options=void 0,this.$animations=void 0;}tooltipPosition(t){let{x:o,y:n}=this.getProps(["x","y"],t);return {x:o,y:n}}hasValue(){return Kt(this.x)&&Kt(this.y)}getProps(t,o){let n=this.$animations;if(!o||!n)return this;let i={};return t.forEach(r=>{i[r]=n[r]&&n[r].active()?n[r]._to:this[r];}),i}};xt.defaults={};xt.defaultRoutes=void 0;var V0={values(e){return Z(e)?e:""+e},numeric(e,t,o){if(e===0)return "0";let n=this.chart.options.locale,i,r=e;if(o.length>1){let c=Math.max(Math.abs(o[0].value),Math.abs(o[o.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),r=o_(e,o);}let a=zt(Math.abs(r)),s=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),en(e,n,l)},logarithmic(e,t,o){if(e===0)return "0";let n=e/Math.pow(10,Math.floor(zt(e)));return n===1||n===2||n===5?V0.numeric.call(this,e,t,o):""}};function o_(e,t){let o=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(o)>=1&&e!==Math.floor(e)&&(o=e-Math.floor(e)),o}var Os={formatters:V0};H.set("scale",{display:true,offset:false,reverse:false,beginAtZero:false,bounds:"ticks",grace:0,grid:{display:true,lineWidth:1,drawBorder:true,drawOnChartArea:true,drawTicks:true,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:false,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:false,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:false,textStrokeWidth:0,textStrokeColor:"",padding:3,display:true,autoSkip:true,autoSkipPadding:3,labelOffset:0,callback:Os.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:false,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});H.route("scale.ticks","color","","color");H.route("scale.grid","color","","borderColor");H.route("scale.grid","borderColor","","borderColor");H.route("scale.title","color","","color");H.describe("scale",{_fallback:false,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"});H.describe("scales",{_fallback:"scale"});H.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"});function n_(e,t){let o=e.options.ticks,n=o.maxTicksLimit||i_(e),i=o.major.enabled?a_(t):[],r=i.length,a=i[0],s=i[r-1],l=[];if(r>n)return s_(t,l,i,r/n),l;let c=r_(i,t,n);if(r>0){let d,u,p=r>1?Math.round((s-a)/(r-1)):null;for(ws(t,l,c,W(p)?0:a-p,a),d=0,u=r-1;d<u;d++)ws(t,l,c,i[d],i[d+1]);return ws(t,l,c,s,W(p)?t.length:s+p),l}return ws(t,l,c),l}function i_(e){let t=e.options.offset,o=e._tickSize(),n=e._length/o+(t?0:1),i=e._maxLength/o;return Math.floor(Math.min(n,i))}function r_(e,t,o){let n=l_(e),i=t.length/o;if(!n)return Math.max(i,1);let r=xd(n);for(let a=0,s=r.length-1;a<s;a++){let l=r[a];if(l>i)return l}return Math.max(i,1)}function a_(e){let t=[],o,n;for(o=0,n=e.length;o<n;o++)e[o].major&&t.push(o);return t}function s_(e,t,o,n){let i=0,r=o[0],a;for(n=Math.ceil(n),a=0;a<e.length;a++)a===r&&(t.push(e[a]),i++,r=o[i*n]);}function ws(e,t,o,n,i){let r=N(n,0),a=Math.min(N(i,e.length),e.length),s=0,l,c,d;for(o=Math.ceil(o),i&&(l=i-n,o=l/Math.floor(l/o)),d=r;d<0;)s++,d=Math.round(r+s*o);for(c=Math.max(r,0);c<a;c++)c===d&&(t.push(e[c]),s++,d=Math.round(r+s*o));}function l_(e){let t=e.length,o,n;if(t<2)return false;for(n=e[0],o=1;o<t;++o)if(e[o]-e[o-1]!==n)return false;return n}var c_=e=>e==="left"?"right":e==="right"?"left":e,r0=(e,t,o)=>t==="top"||t==="left"?e[t]+o:e[t]-o;function a0(e,t){let o=[],n=e.length/t,i=e.length,r=0;for(;r<i;r+=n)o.push(e[Math.floor(r)]);return o}function d_(e,t,o){let n=e.ticks.length,i=Math.min(t,n-1),r=e._startPixel,a=e._endPixel,s=1e-6,l=e.getPixelForTick(i),c;if(!(o&&(n===1?c=Math.max(l-r,a-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<r-s||l>a+s)))return l}function u_(e,t){K(e,o=>{let n=o.gc,i=n.length/2,r;if(i>t){for(r=0;r<i;++r)delete o.data[n[r]];n.splice(0,i);}});}function Ki(e){return e.drawTicks?e.tickLength:0}function s0(e,t){if(!e.display)return 0;let o=it(e.font,t),n=pt(e.padding);return (Z(e.text)?e.text.length:1)*o.lineHeight+n.height}function p_(e,t){return Me(e,{scale:t,type:"scale"})}function m_(e,t,o){return Me(e,{tick:o,index:t,type:"tick"})}function h_(e,t,o){let n=Hi(e);return (o&&t!=="right"||!o&&t==="right")&&(n=c_(n)),n}function g_(e,t,o,n){let{top:i,left:r,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:d}=l,u=0,p,h,m,g=a-i,f=s-r;if(e.isHorizontal()){if(h=Pt(n,r,s),z(o)){let x=Object.keys(o)[0],b=o[x];m=d[x].getPixelForValue(b)+g-t;}else o==="center"?m=(c.bottom+c.top)/2+g-t:m=r0(e,o,t);p=s-r;}else {if(z(o)){let x=Object.keys(o)[0],b=o[x];h=d[x].getPixelForValue(b)-f+t;}else o==="center"?h=(c.left+c.right)/2-f+t:h=r0(e,o,t);m=Pt(n,a,i),u=o==="left"?-et:et;}return {titleX:h,titleY:m,maxWidth:p,rotation:u}}var rn=class e extends xt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=false,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=false,this.$context=void 0;}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax);}parse(t,o){return t}getUserBounds(){let{_userMin:t,_userMax:o,_suggestedMin:n,_suggestedMax:i}=this;return t=Ot(t,Number.POSITIVE_INFINITY),o=Ot(o,Number.NEGATIVE_INFINITY),n=Ot(n,Number.POSITIVE_INFINITY),i=Ot(i,Number.NEGATIVE_INFINITY),{min:Ot(t,n),max:Ot(o,i),minDefined:lt(t),maxDefined:lt(o)}}getMinMax(t){let{min:o,max:n,minDefined:i,maxDefined:r}=this.getUserBounds(),a;if(i&&r)return {min:o,max:n};let s=this.getMatchingVisibleMetas();for(let l=0,c=s.length;l<c;++l)a=s[l].controller.getMinMax(this,t),i||(o=Math.min(o,a.min)),r||(n=Math.max(n,a.max));return o=r&&o>n?n:o,n=i&&o>n?o:n,{min:Ot(o,Ot(n,o)),max:Ot(n,Ot(o,n))}}getPadding(){return {left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=false;}beforeUpdate(){X(this.options.beforeUpdate,[this]);}update(t,o,n){let{beginAtZero:i,grace:r,ticks:a}=this.options,s=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=o,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Ld(this,r,i),this._dataLimitsCached=true),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=s<this.ticks.length;this._convertTicksToLabels(l?a0(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=n_(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate();}configure(){let t=this.options.reverse,o,n;this.isHorizontal()?(o=this.left,n=this.right):(o=this.top,n=this.bottom,t=!t),this._startPixel=o,this._endPixel=n,this._reversePixels=t,this._length=n-o,this._alignToPixels=this.options.alignToPixels;}afterUpdate(){X(this.options.afterUpdate,[this]);}beforeSetDimensions(){X(this.options.beforeSetDimensions,[this]);}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0;}afterSetDimensions(){X(this.options.afterSetDimensions,[this]);}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),X(this.options[t],[this]);}beforeDataLimits(){this._callHooks("beforeDataLimits");}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits");}beforeBuildTicks(){this._callHooks("beforeBuildTicks");}buildTicks(){return []}afterBuildTicks(){this._callHooks("afterBuildTicks");}beforeTickToLabelConversion(){X(this.options.beforeTickToLabelConversion,[this]);}generateTickLabels(t){let o=this.options.ticks,n,i,r;for(n=0,i=t.length;n<i;n++)r=t[n],r.label=X(o.callback,[r.value,n,t],this);}afterTickToLabelConversion(){X(this.options.afterTickToLabelConversion,[this]);}beforeCalculateLabelRotation(){X(this.options.beforeCalculateLabelRotation,[this]);}calculateLabelRotation(){let t=this.options,o=t.ticks,n=this.ticks.length,i=o.minRotation||0,r=o.maxRotation,a=i,s,l,c;if(!this._isVisible()||!o.display||i>=r||n<=1||!this.isHorizontal()){this.labelRotation=i;return}let d=this._getLabelSizes(),u=d.widest.width,p=d.highest.height,h=Ct(this.chart.width-u,0,this.maxWidth);s=t.offset?this.maxWidth/n:h/(n-1),u+6>s&&(s=h/(n-(t.offset?.5:1)),l=this.maxHeight-Ki(t.grid)-o.padding-s0(t.title,this.chart.options.font),c=Math.sqrt(u*u+p*p),a=Qo(Math.min(Math.asin(Ct((d.highest.height+6)/s,-1,1)),Math.asin(Ct(l/c,-1,1))-Math.asin(Ct(p/c,-1,1)))),a=Math.max(i,Math.min(r,a))),this.labelRotation=a;}afterCalculateLabelRotation(){X(this.options.afterCalculateLabelRotation,[this]);}afterAutoSkip(){}beforeFit(){X(this.options.beforeFit,[this]);}fit(){let t={width:0,height:0},{chart:o,options:{ticks:n,title:i,grid:r}}=this,a=this._isVisible(),s=this.isHorizontal();if(a){let l=s0(i,o.options.font);if(s?(t.width=this.maxWidth,t.height=Ki(r)+l):(t.height=this.maxHeight,t.width=Ki(r)+l),n.display&&this.ticks.length){let{first:c,last:d,widest:u,highest:p}=this._getLabelSizes(),h=n.padding*2,m=gt(this.labelRotation),g=Math.cos(m),f=Math.sin(m);if(s){let x=n.mirror?0:f*u.width+g*p.height;t.height=Math.min(this.maxHeight,t.height+x+h);}else {let x=n.mirror?0:g*u.width+f*p.height;t.width=Math.min(this.maxWidth,t.width+x+h);}this._calculatePadding(c,d,f,g);}}this._handleMargins(),s?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom);}_calculatePadding(t,o,n,i){let{ticks:{align:r,padding:a},position:s}=this.options,l=this.labelRotation!==0,c=s!=="top"&&this.axis==="x";if(this.isHorizontal()){let d=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1),p=0,h=0;l?c?(p=i*t.width,h=n*o.height):(p=n*t.height,h=i*o.width):r==="start"?h=o.width:r==="end"?p=t.width:r!=="inner"&&(p=t.width/2,h=o.width/2),this.paddingLeft=Math.max((p-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((h-u+a)*this.width/(this.width-u),0);}else {let d=o.height/2,u=t.height/2;r==="start"?(d=0,u=t.height):r==="end"&&(d=o.height,u=0),this.paddingTop=d+a,this.paddingBottom=u+a;}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom));}afterFit(){X(this.options.afterFit,[this]);}isHorizontal(){let{axis:t,position:o}=this.options;return o==="top"||o==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let o,n;for(o=0,n=t.length;o<n;o++)W(t[o].label)&&(t.splice(o,1),n--,o--);this.afterTickToLabelConversion();}_getLabelSizes(){let t=this._labelSizes;if(!t){let o=this.options.ticks.sampleSize,n=this.ticks;o<n.length&&(n=a0(n,o)),this._labelSizes=t=this._computeLabelSizes(n,n.length);}return t}_computeLabelSizes(t,o){let{ctx:n,_longestTextCache:i}=this,r=[],a=[],s=0,l=0,c,d,u,p,h,m,g,f,x,b,T;for(c=0;c<o;++c){if(p=t[c].label,h=this._resolveTickFontOptions(c),n.font=m=h.string,g=i[m]=i[m]||{data:{},gc:[]},f=h.lineHeight,x=b=0,!W(p)&&!Z(p))x=Un(n,g.data,g.gc,x,p),b=f;else if(Z(p))for(d=0,u=p.length;d<u;++d)T=p[d],!W(T)&&!Z(T)&&(x=Un(n,g.data,g.gc,x,T),b+=f);r.push(x),a.push(b),s=Math.max(x,s),l=Math.max(b,l);}u_(i,o);let k=r.indexOf(s),w=a.indexOf(l),v=_=>({width:r[_]||0,height:a[_]||0});return {first:v(0),last:v(o-1),widest:v(k),highest:v(w),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,o){return NaN}getValueForPixel(t){}getPixelForTick(t){let o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let o=this._startPixel+t*this._length;return Cd(this._alignToPixels?$e(this.chart,o,0):o)}getDecimalForPixel(t){let o=(t-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:o}=this;return t<0&&o<0?o:t>0&&o>0?t:0}getContext(t){let o=this.ticks||[];if(t>=0&&t<o.length){let n=o[t];return n.$context||(n.$context=m_(this.getContext(),t,n))}return this.$context||(this.$context=p_(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,o=gt(this.labelRotation),n=Math.abs(Math.cos(o)),i=Math.abs(Math.sin(o)),r=this._getLabelSizes(),a=t.autoSkipPadding||0,s=r?r.widest.width+a:0,l=r?r.highest.height+a:0;return this.isHorizontal()?l*n>s*i?s/n:l/i:l*i<s*n?l/n:s/i}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let o=this.axis,n=this.chart,i=this.options,{grid:r,position:a}=i,s=r.offset,l=this.isHorizontal(),d=this.ticks.length+(s?1:0),u=Ki(r),p=[],h=r.setContext(this.getContext()),m=h.drawBorder?h.borderWidth:0,g=m/2,f=function(L){return $e(n,L,m)},x,b,T,k,w,v,_,M,I,F,E,B;if(a==="top")x=f(this.bottom),v=this.bottom-u,M=x-g,F=f(t.top)+g,B=t.bottom;else if(a==="bottom")x=f(this.top),F=t.top,B=f(t.bottom)-g,v=x+g,M=this.top+u;else if(a==="left")x=f(this.right),w=this.right-u,_=x-g,I=f(t.left)+g,E=t.right;else if(a==="right")x=f(this.left),I=t.left,E=f(t.right)-g,w=x+g,_=this.left+u;else if(o==="x"){if(a==="center")x=f((t.top+t.bottom)/2+.5);else if(z(a)){let L=Object.keys(a)[0],V=a[L];x=f(this.chart.scales[L].getPixelForValue(V));}F=t.top,B=t.bottom,v=x+g,M=v+u;}else if(o==="y"){if(a==="center")x=f((t.left+t.right)/2);else if(z(a)){let L=Object.keys(a)[0],V=a[L];x=f(this.chart.scales[L].getPixelForValue(V));}w=x-g,_=w-u,I=t.left,E=t.right;}let O=N(i.ticks.maxTicksLimit,d),U=Math.max(1,Math.ceil(d/O));for(b=0;b<d;b+=U){let L=r.setContext(this.getContext(b)),V=L.lineWidth,J=L.color,Bt=L.borderDash||[],tt=L.borderDashOffset,bt=L.tickWidth,Eo=L.tickColor,Fe=L.tickBorderDash||[],Je=L.tickBorderDashOffset;T=d_(this,b,s),T!==void 0&&(k=$e(n,T,V),l?w=_=I=E=k:v=M=F=B=k,p.push({tx1:w,ty1:v,tx2:_,ty2:M,x1:I,y1:F,x2:E,y2:B,width:V,color:J,borderDash:Bt,borderDashOffset:tt,tickWidth:bt,tickColor:Eo,tickBorderDash:Fe,tickBorderDashOffset:Je}));}return this._ticksLength=d,this._borderValue=x,p}_computeLabelItems(t){let o=this.axis,n=this.options,{position:i,ticks:r}=n,a=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:c,padding:d,mirror:u}=r,p=Ki(n.grid),h=p+d,m=u?-d:h,g=-gt(this.labelRotation),f=[],x,b,T,k,w,v,_,M,I,F,E,B,O="middle";if(i==="top")v=this.bottom-m,_=this._getXAxisLabelAlignment();else if(i==="bottom")v=this.top+m,_=this._getXAxisLabelAlignment();else if(i==="left"){let L=this._getYAxisLabelAlignment(p);_=L.textAlign,w=L.x;}else if(i==="right"){let L=this._getYAxisLabelAlignment(p);_=L.textAlign,w=L.x;}else if(o==="x"){if(i==="center")v=(t.top+t.bottom)/2+h;else if(z(i)){let L=Object.keys(i)[0],V=i[L];v=this.chart.scales[L].getPixelForValue(V)+h;}_=this._getXAxisLabelAlignment();}else if(o==="y"){if(i==="center")w=(t.left+t.right)/2-h;else if(z(i)){let L=Object.keys(i)[0],V=i[L];w=this.chart.scales[L].getPixelForValue(V);}_=this._getYAxisLabelAlignment(p).textAlign;}o==="y"&&(l==="start"?O="top":l==="end"&&(O="bottom"));let U=this._getLabelSizes();for(x=0,b=s.length;x<b;++x){T=s[x],k=T.label;let L=r.setContext(this.getContext(x));M=this.getPixelForTick(x)+r.labelOffset,I=this._resolveTickFontOptions(x),F=I.lineHeight,E=Z(k)?k.length:1;let V=E/2,J=L.color,Bt=L.textStrokeColor,tt=L.textStrokeWidth,bt=_;a?(w=M,_==="inner"&&(x===b-1?bt=this.options.reverse?"left":"right":x===0?bt=this.options.reverse?"right":"left":bt="center"),i==="top"?c==="near"||g!==0?B=-E*F+F/2:c==="center"?B=-U.highest.height/2-V*F+F:B=-U.highest.height+F/2:c==="near"||g!==0?B=F/2:c==="center"?B=U.highest.height/2-V*F:B=U.highest.height-E*F,u&&(B*=-1)):(v=M,B=(1-E)*F/2);let Eo;if(L.showLabelBackdrop){let Fe=pt(L.backdropPadding),Je=U.heights[x],Fo=U.widths[x],gn=v+B-Fe.top,Lo=w-Fe.left;switch(O){case "middle":gn-=Je/2;break;case "bottom":gn-=Je;break}switch(_){case "center":Lo-=Fo/2;break;case "right":Lo-=Fo;break}Eo={left:Lo,top:gn,width:Fo+Fe.width,height:Je+Fe.height,color:L.backdropColor};}f.push({rotation:g,label:k,font:I,color:J,strokeColor:Bt,strokeWidth:tt,textOffset:B,textAlign:bt,textBaseline:O,translation:[w,v],backdrop:Eo});}return f}_getXAxisLabelAlignment(){let{position:t,ticks:o}=this.options;if(-gt(this.labelRotation))return t==="top"?"left":"right";let i="center";return o.align==="start"?i="left":o.align==="end"?i="right":o.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){let{position:o,ticks:{crossAlign:n,mirror:i,padding:r}}=this.options,a=this._getLabelSizes(),s=t+r,l=a.widest.width,c,d;return o==="left"?i?(d=this.right+r,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-s,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d=this.left)):o==="right"?i?(d=this.left+r,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+s,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,o=this.options.position;if(o==="left"||o==="right")return {top:0,left:this.left,bottom:t.height,right:this.right};if(o==="top"||o==="bottom")return {top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:o},left:n,top:i,width:r,height:a}=this;o&&(t.save(),t.fillStyle=o,t.fillRect(n,i,r,a),t.restore());}getLineWidthForValue(t){let o=this.options.grid;if(!this._isVisible()||!o.display)return 0;let i=this.ticks.findIndex(r=>r.value===t);return i>=0?o.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){let o=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),r,a,s=(l,c,d)=>{!d.width||!d.color||(n.save(),n.lineWidth=d.width,n.strokeStyle=d.color,n.setLineDash(d.borderDash||[]),n.lineDashOffset=d.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore());};if(o.display)for(r=0,a=i.length;r<a;++r){let l=i[r];o.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),o.drawTicks&&s({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset});}}drawBorder(){let{chart:t,ctx:o,options:{grid:n}}=this,i=n.setContext(this.getContext()),r=n.drawBorder?i.borderWidth:0;if(!r)return;let a=n.setContext(this.getContext(0)).lineWidth,s=this._borderValue,l,c,d,u;this.isHorizontal()?(l=$e(t,this.left,r)-r/2,c=$e(t,this.right,a)+a/2,d=u=s):(d=$e(t,this.top,r)-r/2,u=$e(t,this.bottom,a)+a/2,l=c=s),o.save(),o.lineWidth=i.borderWidth,o.strokeStyle=i.borderColor,o.beginPath(),o.moveTo(l,d),o.lineTo(c,u),o.stroke(),o.restore();}drawLabels(t){if(!this.options.ticks.display)return;let n=this.ctx,i=this._computeLabelArea();i&&xo(n,i);let r=this._labelItems||(this._labelItems=this._computeLabelItems(t)),a,s;for(a=0,s=r.length;a<s;++a){let l=r[a],c=l.font,d=l.label;l.backdrop&&(n.fillStyle=l.backdrop.color,n.fillRect(l.backdrop.left,l.backdrop.top,l.backdrop.width,l.backdrop.height));let u=l.textOffset;He(n,d,0,u,c,l);}i&&bo(n);}drawTitle(){let{ctx:t,options:{position:o,title:n,reverse:i}}=this;if(!n.display)return;let r=it(n.font),a=pt(n.padding),s=n.align,l=r.lineHeight/2;o==="bottom"||o==="center"||z(o)?(l+=a.bottom,Z(n.text)&&(l+=r.lineHeight*(n.text.length-1))):l+=a.top;let{titleX:c,titleY:d,maxWidth:u,rotation:p}=g_(this,l,o,s);He(t,n.text,0,0,r,{color:n.color,maxWidth:u,rotation:p,textAlign:h_(s,o,i),textBaseline:"middle",translation:[c,d]});}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t));}_layers(){let t=this.options,o=t.ticks&&t.ticks.z||0,n=N(t.grid&&t.grid.z,-1);return !this._isVisible()||this.draw!==e.prototype.draw?[{z:o,draw:i=>{this.draw(i);}}]:[{z:n,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle();}},{z:n+1,draw:()=>{this.drawBorder();}},{z:o,draw:i=>{this.drawLabels(i);}}]}getMatchingVisibleMetas(t){let o=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[],r,a;for(r=0,a=o.length;r<a;++r){let s=o[r];s[n]===this.id&&(!t||s.type===t)&&i.push(s);}return i}_resolveTickFontOptions(t){let o=this.options.ticks.setContext(this.getContext(t));return it(o.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return (this.isHorizontal()?this.width:this.height)/t}},$n=class{constructor(t,o,n){this.type=t,this.scope=o,this.override=n,this.items=Object.create(null);}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let o=Object.getPrototypeOf(t),n;x_(o)&&(n=this.register(o));let i=this.items,r=t.id,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in i||(i[r]=t,f_(t,a,n),this.override&&H.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){let o=this.items,n=t.id,i=this.scope;n in o&&delete o[n],i&&n in H[i]&&(delete H[i][n],this.override&&delete yo[n]);}};function f_(e,t,o){let n=Xt(Object.create(null),[o?H.get(o):{},H.get(t),e.defaults]);H.set(t,n),e.defaultRoutes&&y_(t,e.defaultRoutes),e.descriptors&&H.describe(t,e.descriptors);}function y_(e,t){Object.keys(t).forEach(o=>{let n=o.split("."),i=n.pop(),r=[e].concat(n).join("."),a=t[o].split("."),s=a.pop(),l=a.join(".");H.route(r,i,l,s);});}function x_(e){return "id"in e&&"defaults"in e}var Jd=class{constructor(){this.controllers=new $n(qt,"datasets",true),this.elements=new $n(xt,"elements"),this.plugins=new $n(Object,"plugins"),this.scales=new $n(rn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements];}add(...t){this._each("register",t);}remove(...t){this._each("unregister",t);}addControllers(...t){this._each("register",t,this.controllers);}addElements(...t){this._each("register",t,this.elements);}addPlugins(...t){this._each("register",t,this.plugins);}addScales(...t){this._each("register",t,this.scales);}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers);}removeElements(...t){this._each("unregister",t,this.elements);}removePlugins(...t){this._each("unregister",t,this.plugins);}removeScales(...t){this._each("unregister",t,this.scales);}_each(t,o,n){[...o].forEach(i=>{let r=n||this._getRegistryForType(i);n||r.isForType(i)||r===this.plugins&&i.id?this._exec(t,r,i):K(i,a=>{let s=n||this._getRegistryForType(a);this._exec(t,s,a);});});}_exec(t,o,n){let i=zi(t);X(n["before"+i],[],n),o[t](n),X(n["after"+i],[],n);}_getRegistryForType(t){for(let o=0;o<this._typedRegistries.length;o++){let n=this._typedRegistries[o];if(n.isForType(t))return n}return this.plugins}_get(t,o,n){let i=o.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return i}},Ee=new Jd,Zn=class extends qt{update(t){let o=this._cachedMeta,{data:n=[]}=o,i=this.chart._animationsDisabled,{start:r,count:a}=cs(o,n,i);if(this._drawStart=r,this._drawCount=a,ds(o)&&(r=0,a=n.length),this.options.showLine){let{dataset:s,_dataset:l}=o;s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!l._decimated,s.points=n;let c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!i,options:c},t);}this.updateElements(n,r,a,t);}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=Ee.getElement("line")),super.addElements();}updateElements(t,o,n,i){let r=i==="reset",{iScale:a,vScale:s,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(o,i),u=this.getSharedOptions(d),p=this.includeOptions(i,u),h=a.axis,m=s.axis,{spanGaps:g,segment:f}=this.options,x=Kt(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||i==="none",T=o>0&&this.getParsed(o-1);for(let k=o;k<o+n;++k){let w=t[k],v=this.getParsed(k),_=b?w:{},M=W(v[m]),I=_[h]=a.getPixelForValue(v[h],k),F=_[m]=r||M?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,v,l):v[m],k);_.skip=isNaN(I)||isNaN(F)||M,_.stop=k>0&&Math.abs(v[h]-T[h])>x,f&&(_.parsed=v,_.raw=c.data[k]),p&&(_.options=u||this.resolveDataElementOptions(k,w.active?"active":i)),b||this.updateElement(w,k,_,i),T=v;}this.updateSharedOptions(u,i,d);}getMaxOverflow(){let t=this._cachedMeta,o=t.data||[];if(!this.options.showLine){let s=0;for(let l=o.length-1;l>=0;--l)s=Math.max(s,o[l].size(this.resolveDataElementOptions(l))/2);return s>0&&s}let n=t.dataset,i=n.options&&n.options.borderWidth||0;if(!o.length)return i;let r=o[0].size(this.resolveDataElementOptions(0)),a=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(i,r,a)/2}};Zn.id="scatter";Zn.defaults={datasetElementType:false,dataElementType:"point",showLine:false,fill:false};Zn.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return ""},label(e){return "("+e.label+", "+e.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function on(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var nr=class{constructor(t){this.options=t||{};}init(t){}formats(){return on()}parse(t,o){return on()}format(t,o){return on()}add(t,o,n){return on()}diff(t,o,n){return on()}startOf(t,o,n){return on()}endOf(t,o){return on()}};nr.override=function(e){Object.assign(nr.prototype,e);};var b_={_date:nr};function C_(e,t,o,n){let{controller:i,data:r,_sorted:a}=e,s=i._cachedMeta.iScale;if(s&&t===s.axis&&t!=="r"&&a&&r.length){let l=s._reversePixels?Pd:ze;if(n){if(i._sharedOptions){let c=r[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){let u=l(r,t,o-d),p=l(r,t,o+d);return {lo:u.lo,hi:p.hi}}}}else return l(r,t,o)}return {lo:0,hi:r.length-1}}function ar(e,t,o,n,i){let r=e.getSortedVisibleDatasetMetas(),a=o[t];for(let s=0,l=r.length;s<l;++s){let{index:c,data:d}=r[s],{lo:u,hi:p}=C_(r[s],t,a,i);for(let h=u;h<=p;++h){let m=d[h];m.skip||n(m,c,h);}}}function P_(e){let t=e.indexOf("x")!==-1,o=e.indexOf("y")!==-1;return function(n,i){let r=t?Math.abs(n.x-i.x):0,a=o?Math.abs(n.y-i.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}function Gd(e,t,o,n,i){let r=[];return !i&&!e.isPointInArea(t)||ar(e,o,t,function(s,l,c){!i&&!Xo(s,e.chartArea,0)||s.inRange(t.x,t.y,n)&&r.push({element:s,datasetIndex:l,index:c});},true),r}function S_(e,t,o,n){let i=[];function r(a,s,l){let{startAngle:c,endAngle:d}=a.getProps(["startAngle","endAngle"],n),{angle:u}=is(a,{x:t.x,y:t.y});Jo(u,c,d)&&i.push({element:a,datasetIndex:s,index:l});}return ar(e,o,t,r),i}function T_(e,t,o,n,i,r){let a=[],s=P_(o),l=Number.POSITIVE_INFINITY;function c(d,u,p){let h=d.inRange(t.x,t.y,i);if(n&&!h)return;let m=d.getCenterPoint(i);if(!(!!r||e.isPointInArea(m))&&!h)return;let f=s(t,m);f<l?(a=[{element:d,datasetIndex:u,index:p}],l=f):f===l&&a.push({element:d,datasetIndex:u,index:p});}return ar(e,o,t,c),a}function jd(e,t,o,n,i,r){return !r&&!e.isPointInArea(t)?[]:o==="r"&&!n?S_(e,t,o,i):T_(e,t,o,n,i,r)}function l0(e,t,o,n,i){let r=[],a=o==="x"?"inXRange":"inYRange",s=false;return ar(e,o,t,(l,c,d)=>{l[a](t[o],i)&&(r.push({element:l,datasetIndex:c,index:d}),s=s||l.inRange(t.x,t.y,i));}),n&&!s?[]:r}var k_={modes:{index(e,t,o,n){let i=Ge(t,e),r=o.axis||"x",a=o.includeInvisible||false,s=o.intersect?Gd(e,i,r,n,a):jd(e,i,r,false,n,a),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let d=s[0].index,u=c.data[d];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:d});}),l):[]},dataset(e,t,o,n){let i=Ge(t,e),r=o.axis||"xy",a=o.includeInvisible||false,s=o.intersect?Gd(e,i,r,n,a):jd(e,i,r,false,n,a);if(s.length>0){let l=s[0].datasetIndex,c=e.getDatasetMeta(l).data;s=[];for(let d=0;d<c.length;++d)s.push({element:c[d],datasetIndex:l,index:d});}return s},point(e,t,o,n){let i=Ge(t,e),r=o.axis||"xy",a=o.includeInvisible||false;return Gd(e,i,r,n,a)},nearest(e,t,o,n){let i=Ge(t,e),r=o.axis||"xy",a=o.includeInvisible||false;return jd(e,i,r,o.intersect,n,a)},x(e,t,o,n){let i=Ge(t,e);return l0(e,i,"x",o.intersect,n)},y(e,t,o,n){let i=Ge(t,e);return l0(e,i,"y",o.intersect,n)}}},$0=["left","top","right","bottom"];function qi(e,t){return e.filter(o=>o.pos===t)}function c0(e,t){return e.filter(o=>$0.indexOf(o.pos)===-1&&o.box.axis===t)}function Qi(e,t){return e.sort((o,n)=>{let i=t?n:o,r=t?o:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight})}function w_(e){let t=[],o,n,i,r,a,s;for(o=0,n=(e||[]).length;o<n;++o)i=e[o],{position:r,options:{stack:a,stackWeight:s=1}}=i,t.push({index:o,box:i,pos:r,horizontal:i.isHorizontal(),weight:i.weight,stack:a&&r+a,stackWeight:s});return t}function v_(e){let t={};for(let o of e){let{stack:n,pos:i,stackWeight:r}=o;if(!n||!$0.includes(i))continue;let a=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=r;}return t}function __(e,t){let o=v_(e),{vBoxMaxWidth:n,hBoxMaxHeight:i}=t,r,a,s;for(r=0,a=e.length;r<a;++r){s=e[r];let{fullSize:l}=s.box,c=o[s.stack],d=c&&s.stackWeight/c.weight;s.horizontal?(s.width=d?d*n:l&&t.availableWidth,s.height=i):(s.width=n,s.height=d?d*i:l&&t.availableHeight);}return o}function A_(e){let t=w_(e),o=Qi(t.filter(c=>c.box.fullSize),true),n=Qi(qi(t,"left"),true),i=Qi(qi(t,"right")),r=Qi(qi(t,"top"),true),a=Qi(qi(t,"bottom")),s=c0(t,"x"),l=c0(t,"y");return {fullSize:o,leftAndTop:n.concat(r),rightAndBottom:i.concat(l).concat(a).concat(s),chartArea:qi(t,"chartArea"),vertical:n.concat(i).concat(l),horizontal:r.concat(a).concat(s)}}function d0(e,t,o,n){return Math.max(e[o],t[o])+Math.max(e[n],t[n])}function H0(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right);}function M_(e,t,o,n){let{pos:i,box:r}=o,a=e.maxPadding;if(!z(i)){o.size&&(e[i]-=o.size);let u=n[o.stack]||{size:0,count:1};u.size=Math.max(u.size,o.horizontal?r.height:r.width),o.size=u.size/u.count,e[i]+=o.size;}r.getPadding&&H0(a,r.getPadding());let s=Math.max(0,t.outerWidth-d0(a,e,"left","right")),l=Math.max(0,t.outerHeight-d0(a,e,"top","bottom")),c=s!==e.w,d=l!==e.h;return e.w=s,e.h=l,o.horizontal?{same:c,other:d}:{same:d,other:c}}function I_(e){let t=e.maxPadding;function o(n){let i=Math.max(t[n]-e[n],0);return e[n]+=i,i}e.y+=o("top"),e.x+=o("left"),o("right"),o("bottom");}function E_(e,t){let o=t.maxPadding;function n(i){let r={left:0,top:0,right:0,bottom:0};return i.forEach(a=>{r[a]=Math.max(t[a],o[a]);}),r}return n(e?["left","right"]:["top","bottom"])}function tr(e,t,o,n){let i=[],r,a,s,l,c,d;for(r=0,a=e.length,c=0;r<a;++r){s=e[r],l=s.box,l.update(s.width||t.w,s.height||t.h,E_(s.horizontal,t));let{same:u,other:p}=M_(t,o,s,n);c|=u&&i.length,d=d||p,l.fullSize||i.push(s);}return c&&tr(i,t,o,n)||d}function vs(e,t,o,n,i){e.top=o,e.left=t,e.right=t+n,e.bottom=o+i,e.width=n,e.height=i;}function u0(e,t,o,n){let i=o.padding,{x:r,y:a}=t;for(let s of e){let l=s.box,c=n[s.stack]||{placed:0,weight:1},d=s.stackWeight/c.weight||1;if(s.horizontal){let u=t.w*d,p=c.size||l.height;st(c.start)&&(a=c.start),l.fullSize?vs(l,i.left,a,o.outerWidth-i.right-i.left,p):vs(l,t.left+c.placed,a,u,p),c.start=a,c.placed+=u,a=l.bottom;}else {let u=t.h*d,p=c.size||l.width;st(c.start)&&(r=c.start),l.fullSize?vs(l,r,i.top,p,o.outerHeight-i.bottom-i.top):vs(l,r,t.top+c.placed,p,u),c.start=r,c.placed+=u,r=l.right;}}t.x=r,t.y=a;}H.set("layout",{autoPadding:true,padding:{top:0,right:0,bottom:0,left:0}});var ae={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||false,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return [{z:0,draw(o){t.draw(o);}}]},e.boxes.push(t);},removeBox(e,t){let o=e.boxes?e.boxes.indexOf(t):-1;o!==-1&&e.boxes.splice(o,1);},configure(e,t,o){t.fullSize=o.fullSize,t.position=o.position,t.weight=o.weight;},update(e,t,o,n){if(!e)return;let i=pt(e.options.layout.padding),r=Math.max(t-i.width,0),a=Math.max(o-i.height,0),s=A_(e.boxes),l=s.vertical,c=s.horizontal;K(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout();});let d=l.reduce((g,f)=>f.box.options&&f.box.options.display===false?g:g+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:o,padding:i,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/d,hBoxMaxHeight:a/2}),p=Object.assign({},i);H0(p,pt(n));let h=Object.assign({maxPadding:p,w:r,h:a,x:i.left,y:i.top},i),m=__(l.concat(c),u);tr(s.fullSize,h,u,m),tr(l,h,u,m),tr(c,h,u,m)&&tr(l,h,u,m),I_(h),u0(s.leftAndTop,h,u,m),h.x+=h.w,h.y+=h.h,u0(s.rightAndBottom,h,u,m),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},K(s.chartArea,g=>{let f=g.box;Object.assign(f,e.chartArea),f.update(h.w,h.h,{left:0,top:0,right:0,bottom:0});});}},Es=class{acquireContext(t,o){}releaseContext(t){return false}addEventListener(t,o,n){}removeEventListener(t,o,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,o,n,i){return o=Math.max(0,o||t.width),n=n||t.height,{width:o,height:Math.max(0,i?Math.floor(o/i):n)}}isAttached(t){return true}updateConfig(t){}},tu=class extends Es{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=false;}},Is="$chartjs",F_={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},p0=e=>e===null||e==="";function L_(e,t){let o=e.style,n=e.getAttribute("height"),i=e.getAttribute("width");if(e[Is]={initial:{height:n,width:i,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",p0(i)){let r=Cs(e,"width");r!==void 0&&(e.width=r);}if(p0(n))if(e.style.height==="")e.height=e.width/(t||2);else {let r=Cs(e,"height");r!==void 0&&(e.height=r);}return e}var W0=Ud?{passive:true}:false;function B_(e,t,o){e.addEventListener(t,o,W0);}function R_(e,t,o){e.canvas.removeEventListener(t,o,W0);}function D_(e,t){let o=F_[e.type]||e.type,{x:n,y:i}=Ge(e,t);return {type:o,chart:t,native:e,x:n!==void 0?n:null,y:i!==void 0?i:null}}function Fs(e,t){for(let o of e)if(o===t||o.contains(t))return true}function N_(e,t,o){let n=e.canvas,i=new MutationObserver(r=>{let a=false;for(let s of r)a=a||Fs(s.addedNodes,n),a=a&&!Fs(s.removedNodes,n);a&&o();});return i.observe(document,{childList:true,subtree:true}),i}function U_(e,t,o){let n=e.canvas,i=new MutationObserver(r=>{let a=false;for(let s of r)a=a||Fs(s.removedNodes,n),a=a&&!Fs(s.addedNodes,n);a&&o();});return i.observe(document,{childList:true,subtree:true}),i}var ir=new Map,m0=0;function G0(){let e=window.devicePixelRatio;e!==m0&&(m0=e,ir.forEach((t,o)=>{o.currentDevicePixelRatio!==e&&t();}));}function O_(e,t){ir.size||window.addEventListener("resize",G0),ir.set(e,t);}function z_(e){ir.delete(e),ir.size||window.removeEventListener("resize",G0);}function V_(e,t,o){let n=e.canvas,i=n&&Zi(n);if(!i)return;let r=ls((s,l)=>{let c=i.clientWidth;o(s,l),c<i.clientWidth&&o();},window),a=new ResizeObserver(s=>{let l=s[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||r(c,d);});return a.observe(i),O_(e,r),a}function Yd(e,t,o){o&&o.disconnect(),t==="resize"&&z_(e);}function $_(e,t,o){let n=e.canvas,i=ls(r=>{e.ctx!==null&&o(D_(r,e));},e,r=>{let a=r[0];return [a,a.offsetX,a.offsetY]});return B_(n,t,i),i}var eu=class extends Es{acquireContext(t,o){let n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(L_(t,o),n):null}releaseContext(t){let o=t.canvas;if(!o[Is])return false;let n=o[Is].initial;["height","width"].forEach(r=>{let a=n[r];W(a)?o.removeAttribute(r):o.setAttribute(r,a);});let i=n.style||{};return Object.keys(i).forEach(r=>{o.style[r]=i[r];}),o.width=o.width,delete o[Is],true}addEventListener(t,o,n){this.removeEventListener(t,o);let i=t.$proxies||(t.$proxies={}),a={attach:N_,detach:U_,resize:V_}[o]||$_;i[o]=a(t,o,n);}removeEventListener(t,o){let n=t.$proxies||(t.$proxies={}),i=n[o];if(!i)return;(({attach:Yd,detach:Yd,resize:Yd})[o]||R_)(t,o,i),n[o]=void 0;}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,o,n,i){return Nd(t,o,n,i)}isAttached(t){let o=Zi(t);return !!(o&&o.isConnected)}};function H_(e){return !ys()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?tu:eu}var ou=class{constructor(){this._init=[];}notify(t,o,n,i){o==="beforeInit"&&(this._init=this._createDescriptors(t,true),this._notify(this._init,t,"install"));let r=i?this._descriptors(t).filter(i):this._descriptors(t),a=this._notify(r,t,o,n);return o==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,o,n,i){i=i||{};for(let r of t){let a=r.plugin,s=a[n],l=[o,i,r.options];if(X(s,l,a)===false&&i.cancelable)return false}return true}invalidate(){W(this._cache)||(this._oldCache=this._cache,this._cache=void 0);}_descriptors(t){if(this._cache)return this._cache;let o=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),o}_createDescriptors(t,o){let n=t&&t.config,i=N(n.options&&n.options.plugins,{}),r=W_(n);return i===false&&!o?[]:j_(t,r,i,o)}_notifyStateChanges(t){let o=this._oldCache||[],n=this._cache,i=(r,a)=>r.filter(s=>!a.some(l=>s.plugin.id===l.plugin.id));this._notify(i(o,n),t,"stop"),this._notify(i(n,o),t,"start");}};function W_(e){let t={},o=[],n=Object.keys(Ee.plugins.items);for(let r=0;r<n.length;r++)o.push(Ee.getPlugin(n[r]));let i=e.plugins||[];for(let r=0;r<i.length;r++){let a=i[r];o.indexOf(a)===-1&&(o.push(a),t[a.id]=true);}return {plugins:o,localIds:t}}function G_(e,t){return !t&&e===false?null:e===true?{}:e}function j_(e,{plugins:t,localIds:o},n,i){let r=[],a=e.getContext();for(let s of t){let l=s.id,c=G_(n[l],i);c!==null&&r.push({plugin:s,options:Y_(e.config,{plugin:s,local:o[l]},c,a)});}return r}function Y_(e,{plugin:t,local:o},n,i){let r=e.pluginScopeKeys(t),a=e.getOptionScopes(n,r);return o&&t.defaults&&a.push(t.defaults),e.createResolver(a,i,[""],{scriptable:false,indexable:false,allKeys:true})}function nu(e,t){let o=H.datasets[e]||{};return ((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||o.indexAxis||"x"}function Z_(e,t){let o=e;return e==="_index_"?o=t:e==="_value_"&&(o=t==="x"?"y":"x"),o}function X_(e,t){return e===t?"_index_":"_value_"}function K_(e){if(e==="top"||e==="bottom")return "x";if(e==="left"||e==="right")return "y"}function iu(e,t){return e==="x"||e==="y"?e:t.axis||K_(t.position)||e.charAt(0).toLowerCase()}function q_(e,t){let o=yo[e.type]||{scales:{}},n=t.scales||{},i=nu(e.type,t),r=Object.create(null),a=Object.create(null);return Object.keys(n).forEach(s=>{let l=n[s];if(!z(l))return console.error(`Invalid scale configuration for scale: ${s}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);let c=iu(s,l),d=X_(c,i),u=o.scales||{};r[c]=r[c]||s,a[s]=Ko(Object.create(null),[{axis:c},l,u[c],u[d]]);}),e.data.datasets.forEach(s=>{let l=s.type||e.type,c=s.indexAxis||nu(l,t),u=(yo[l]||{}).scales||{};Object.keys(u).forEach(p=>{let h=Z_(p,c),m=s[h+"AxisID"]||r[h]||h;a[m]=a[m]||Object.create(null),Ko(a[m],[{axis:h},n[m],u[p]]);});}),Object.keys(a).forEach(s=>{let l=a[s];Ko(l,[H.scales[l.type],H.scale]);}),a}function j0(e){let t=e.options||(e.options={});t.plugins=N(t.plugins,{}),t.scales=q_(e,t);}function Y0(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Q_(e){return e=e||{},e.data=Y0(e.data),j0(e),e}var h0=new Map,Z0=new Set;function _s(e,t){let o=h0.get(e);return o||(o=t(),h0.set(e,o),Z0.add(o)),o}var Ji=(e,t,o)=>{let n=Ae(t,o);n!==void 0&&e.add(n);},ru=class{constructor(t){this._config=Q_(t),this._scopeCache=new Map,this._resolverCache=new Map;}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t;}get data(){return this._config.data}set data(t){this._config.data=Y0(t);}get options(){return this._config.options}set options(t){this._config.options=t;}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),j0(t);}clearCache(){this._scopeCache.clear(),this._resolverCache.clear();}datasetScopeKeys(t){return _s(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,o){return _s(`${t}.transition.${o}`,()=>[[`datasets.${t}.transitions.${o}`,`transitions.${o}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,o){return _s(`${t}-${o}`,()=>[[`datasets.${t}.elements.${o}`,`datasets.${t}`,`elements.${o}`,""]])}pluginScopeKeys(t){let o=t.id,n=this.type;return _s(`${n}-plugin-${o}`,()=>[[`plugins.${o}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,o){let n=this._scopeCache,i=n.get(t);return (!i||o)&&(i=new Map,n.set(t,i)),i}getOptionScopes(t,o,n){let{options:i,type:r}=this,a=this._cachedScopes(t,n),s=a.get(o);if(s)return s;let l=new Set;o.forEach(d=>{t&&(l.add(t),d.forEach(u=>Ji(l,t,u))),d.forEach(u=>Ji(l,i,u)),d.forEach(u=>Ji(l,yo[r]||{},u)),d.forEach(u=>Ji(l,H,u)),d.forEach(u=>Ji(l,us,u));});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Z0.has(o)&&a.set(o,c),c}chartOptionScopes(){let{options:t,type:o}=this;return [t,yo[o]||{},H.datasets[o]||{},{type:o},H,us]}resolveNamedOptions(t,o,n,i=[""]){let r={$shared:true},{resolver:a,subPrefixes:s}=g0(this._resolverCache,t,i),l=a;if(t4(a,o)){r.$shared=false,n=Tt(n)?n():n;let c=this.createResolver(t,n,s);l=fo(a,n,c);}for(let c of o)r[c]=l[c];return r}createResolver(t,o,n=[""],i){let{resolver:r}=g0(this._resolverCache,t,n);return z(o)?fo(r,o,void 0,i):r}};function g0(e,t,o){let n=e.get(t);n||(n=new Map,e.set(t,n));let i=o.join(),r=n.get(i);return r||(r={resolver:Yi(t,o),subPrefixes:o.filter(s=>!s.toLowerCase().includes("hover"))},n.set(i,r)),r}var J_=e=>z(e)&&Object.getOwnPropertyNames(e).reduce((t,o)=>t||Tt(e[o]),false);function t4(e,t){let{isScriptable:o,isIndexable:n}=gs(e);for(let i of t){let r=o(i),a=n(i),s=(a||r)&&e[i];if(r&&(Tt(s)||J_(s))||a&&Z(s))return true}return false}var e4="3.9.1",o4=["top","bottom","left","right","chartArea"];function f0(e,t){return e==="top"||e==="bottom"||o4.indexOf(e)===-1&&t==="x"}function y0(e,t){return function(o,n){return o[e]===n[e]?o[t]-n[t]:o[e]-n[e]}}function x0(e){let t=e.chart,o=t.options.animation;t.notifyPlugins("afterRender"),X(o&&o.onComplete,[e],t);}function n4(e){let t=e.chart,o=t.options.animation;X(o&&o.onProgress,[e],t);}function X0(e){return ys()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Ls={},K0=e=>{let t=X0(e);return Object.values(Ls).filter(o=>o.canvas===t).pop()};function i4(e,t,o){let n=Object.keys(e);for(let i of n){let r=+i;if(r>=t){let a=e[i];delete e[i],(o>0||r>t)&&(e[r+o]=a);}}}function r4(e,t,o,n){return !o||e.type==="mouseout"?null:n?t:e}var Lt=class{constructor(t,o){let n=this.config=new ru(o),i=X0(t),r=K0(i);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||H_(i)),this.platform.updateConfig(n);let s=this.platform.acquireContext(i,a.aspectRatio),l=s&&s.canvas,c=l&&l.height,d=l&&l.width;if(this.id=gd(),this.ctx=s,this.canvas=l,this.width=d,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new ou,this.$proxies={},this._hiddenIndices={},this.attached=false,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=kd(u=>this.update(u),a.resizeDelay||0),this._dataChanges=[],Ls[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}je.listen(this,"complete",x0),je.listen(this,"progress",n4),this._initialize(),this.attached&&this.update();}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:o},width:n,height:i,_aspectRatio:r}=this;return W(t)?o&&r?r:i?n/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t;}get options(){return this._options}set options(t){this.config.options=t;}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():bs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ps(this.canvas,this.ctx),this}stop(){return je.stop(this),this}resize(t,o){je.running(this)?this._resizeBeforeDraw={width:t,height:o}:this._resize(t,o);}_resize(t,o){let n=this.options,i=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(i,t,o,r),s=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,bs(this,s,true)&&(this.notifyPlugins("resize",{size:a}),X(n.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render());}ensureScalesHaveIDs(){let o=this.options.scales||{};K(o,(n,i)=>{n.id=i;});}buildOrUpdateScales(){let t=this.options,o=t.scales,n=this.scales,i=Object.keys(n).reduce((a,s)=>(a[s]=false,a),{}),r=[];o&&(r=r.concat(Object.keys(o).map(a=>{let s=o[a],l=iu(a,s),c=l==="r",d=l==="x";return {options:s,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),K(r,a=>{let s=a.options,l=s.id,c=iu(l,s),d=N(s.type,a.dtype);(s.position===void 0||f0(s.position,c)!==f0(a.dposition))&&(s.position=a.dposition),i[l]=true;let u=null;if(l in n&&n[l].type===d)u=n[l];else {let p=Ee.getScale(d);u=new p({id:l,type:d,ctx:this.ctx,chart:this}),n[u.id]=u;}u.init(s,t);}),K(i,(a,s)=>{a||delete n[s];}),K(n,a=>{ae.configure(this,a,a.options),ae.addBox(this,a);});}_updateMetasets(){let t=this._metasets,o=this.data.datasets.length,n=t.length;if(t.sort((i,r)=>i.index-r.index),n>o){for(let i=o;i<n;++i)this._destroyDatasetMeta(i);t.splice(o,n-o);}this._sortedMetasets=t.slice(0).sort(y0("order","index"));}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:o}}=this;t.length>o.length&&delete this._stacks,t.forEach((n,i)=>{o.filter(r=>r===n._dataset).length===0&&this._destroyDatasetMeta(i);});}buildOrUpdateControllers(){let t=[],o=this.data.datasets,n,i;for(this._removeUnreferencedMetasets(),n=0,i=o.length;n<i;n++){let r=o[n],a=this.getDatasetMeta(n),s=r.type||this.config.type;if(a.type&&a.type!==s&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=s,a.indexAxis=r.indexAxis||nu(s,this.options),a.order=r.order||0,a.index=n,a.label=""+r.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else {let l=Ee.getController(s),{datasetElementType:c,dataElementType:d}=H.datasets[s];Object.assign(l.prototype,{dataElementType:Ee.getElement(d),datasetElementType:c&&Ee.getElement(c)}),a.controller=new l(this,n),t.push(a.controller);}}return this._updateMetasets(),t}_resetElements(){K(this.data.datasets,(t,o)=>{this.getDatasetMeta(o).controller.reset();},this);}reset(){this._resetElements(),this.notifyPlugins("reset");}update(t){let o=this.config;o.update();let n=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:true})===false)return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,d=this.data.datasets.length;c<d;c++){let{controller:u}=this.getDatasetMeta(c),p=!i&&r.indexOf(u)===-1;u.buildOrUpdateElements(p),a=Math.max(+u.getMaxOverflow(),a);}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),i||K(r,c=>{c.reset();}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(y0("z","_idx"));let{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,true):s.length&&this._updateHoverStyles(s,s,true),this.render();}_updateScales(){K(this.scales,t=>{ae.removeBox(this,t);}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales();}_checkEventBindings(){let t=this.options,o=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!ts(o,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents());}_updateHiddenIndices(){let{_hiddenIndices:t}=this,o=this._getUniformDataChanges()||[];for(let{method:n,start:i,count:r}of o){let a=n==="_removeElements"?-r:r;i4(t,i,a);}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let o=this.data.datasets.length,n=r=>new Set(t.filter(a=>a[0]===r).map((a,s)=>s+","+a.splice(1).join(","))),i=n(0);for(let r=1;r<o;r++)if(!ts(i,n(r)))return;return Array.from(i).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:true})===false)return;ae.update(this,this.width,this.height,t);let o=this.chartArea,n=o.width<=0||o.height<=0;this._layers=[],K(this.boxes,i=>{n&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()));},this),this._layers.forEach((i,r)=>{i._idx=r;}),this.notifyPlugins("afterLayout");}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:true})!==false){for(let o=0,n=this.data.datasets.length;o<n;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,n=this.data.datasets.length;o<n;++o)this._updateDataset(o,Tt(t)?t({datasetIndex:o}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t});}}_updateDataset(t,o){let n=this.getDatasetMeta(t),i={meta:n,index:t,mode:o,cancelable:true};this.notifyPlugins("beforeDatasetUpdate",i)!==false&&(n.controller._update(o),i.cancelable=false,this.notifyPlugins("afterDatasetUpdate",i));}render(){this.notifyPlugins("beforeRender",{cancelable:true})!==false&&(je.has(this)?this.attached&&!je.running(this)&&je.start(this):(this.draw(),x0({chart:this})));}draw(){let t;if(this._resizeBeforeDraw){let{width:n,height:i}=this._resizeBeforeDraw;this._resize(n,i),this._resizeBeforeDraw=null;}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:true})===false)return;let o=this._layers;for(t=0;t<o.length&&o[t].z<=0;++t)o[t].draw(this.chartArea);for(this._drawDatasets();t<o.length;++t)o[t].draw(this.chartArea);this.notifyPlugins("afterDraw");}_getSortedDatasetMetas(t){let o=this._sortedMetasets,n=[],i,r;for(i=0,r=o.length;i<r;++i){let a=o[i];(!t||a.visible)&&n.push(a);}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(true)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:true})===false)return;let t=this.getSortedVisibleDatasetMetas();for(let o=t.length-1;o>=0;--o)this._drawDataset(t[o]);this.notifyPlugins("afterDatasetsDraw");}_drawDataset(t){let o=this.ctx,n=t._clip,i=!n.disabled,r=this.chartArea,a={meta:t,index:t.index,cancelable:true};this.notifyPlugins("beforeDatasetDraw",a)!==false&&(i&&xo(o,{left:n.left===false?0:r.left-n.left,right:n.right===false?this.width:r.right+n.right,top:n.top===false?0:r.top-n.top,bottom:n.bottom===false?this.height:r.bottom+n.bottom}),t.controller.draw(),i&&bo(o),a.cancelable=false,this.notifyPlugins("afterDatasetDraw",a));}isPointInArea(t){return Xo(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,o,n,i){let r=k_.modes[o];return typeof r=="function"?r(this,t,n,i):[]}getDatasetMeta(t){let o=this.data.datasets[t],n=this._metasets,i=n.filter(r=>r&&r._dataset===o).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:t,_dataset:o,_parsed:[],_sorted:false},n.push(i)),i}getContext(){return this.$context||(this.$context=Me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let o=this.data.datasets[t];if(!o)return false;let n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!o.hidden}setDatasetVisibility(t,o){let n=this.getDatasetMeta(t);n.hidden=!o;}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t];}getDataVisibility(t){return !this._hiddenIndices[t]}_updateVisibility(t,o,n){let i=n?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,i);st(o)?(r.data[o].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(r,{visible:n}),this.update(s=>s.datasetIndex===t?i:void 0));}hide(t,o){this._updateVisibility(t,o,false);}show(t,o){this._updateVisibility(t,o,true);}_destroyDatasetMeta(t){let o=this._metasets[t];o&&o.controller&&o.controller._destroy(),delete this._metasets[t];}_stop(){let t,o;for(this.stop(),je.remove(this),t=0,o=this.data.datasets.length;t<o;++t)this._destroyDatasetMeta(t);}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:o}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ps(t,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Ls[this.id],this.notifyPlugins("afterDestroy");}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=true;}bindUserEvents(){let t=this._listeners,o=this.platform,n=(r,a)=>{o.addEventListener(this,r,a),t[r]=a;},i=(r,a,s)=>{r.offsetX=a,r.offsetY=s,this._eventHandler(r);};K(this.options.events,r=>n(r,i));}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,o=this.platform,n=(l,c)=>{o.addEventListener(this,l,c),t[l]=c;},i=(l,c)=>{t[l]&&(o.removeEventListener(this,l,c),delete t[l]);},r=(l,c)=>{this.canvas&&this.resize(l,c);},a,s=()=>{i("attach",s),this.attached=true,this.resize(),n("resize",r),n("detach",a);};a=()=>{this.attached=false,i("resize",r),this._stop(),this._resize(0,0),n("attach",s);},o.isAttached(this.canvas)?s():a();}unbindEvents(){K(this._listeners,(t,o)=>{this.platform.removeEventListener(this,o,t);}),this._listeners={},K(this._responsiveListeners,(t,o)=>{this.platform.removeEventListener(this,o,t);}),this._responsiveListeners=void 0;}updateHoverStyle(t,o,n){let i=n?"set":"remove",r,a,s,l;for(o==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),s=0,l=t.length;s<l;++s){a=t[s];let c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[i+"HoverStyle"](a.element,a.datasetIndex,a.index);}}getActiveElements(){return this._active||[]}setActiveElements(t){let o=this._active||[],n=t.map(({datasetIndex:r,index:a})=>{let s=this.getDatasetMeta(r);if(!s)throw new Error("No dataset found at index "+r);return {datasetIndex:r,element:s.data[a],index:a}});!zn(n,o)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,o));}notifyPlugins(t,o,n){return this._plugins.notify(this,t,o,n)}_updateHoverStyles(t,o,n){let i=this.options.hover,r=(l,c)=>l.filter(d=>!c.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),a=r(o,t),s=n?t:r(t,o);a.length&&this.updateHoverStyle(a,i.mode,false),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,true);}_eventHandler(t,o){let n={event:t,replay:o,cancelable:true,inChartArea:this.isPointInArea(t)},i=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,i)===false)return;let r=this._handleEvent(t,o,n.inChartArea);return n.cancelable=false,this.notifyPlugins("afterEvent",n,i),(r||n.changed)&&this.render(),this}_handleEvent(t,o,n){let{_active:i=[],options:r}=this,a=o,s=this._getActiveElements(t,i,n,a),l=yd(t),c=r4(t,this._lastEvent,n,l);n&&(this._lastEvent=null,X(r.onHover,[t,s,this],this),l&&X(r.onClick,[t,s,this],this));let d=!zn(s,i);return (d||o)&&(this._active=s,this._updateHoverStyles(s,i,o)),this._lastEvent=c,d}_getActiveElements(t,o,n,i){if(t.type==="mouseout")return [];if(!n)return o;let r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,i)}},b0=()=>K(Lt.instances,e=>e._plugins.invalidate()),Po=true;Object.defineProperties(Lt,{defaults:{enumerable:Po,value:H},instances:{enumerable:Po,value:Ls},overrides:{enumerable:Po,value:yo},registry:{enumerable:Po,value:Ee},version:{enumerable:Po,value:e4},getChart:{enumerable:Po,value:K0},register:{enumerable:Po,value:(...e)=>{Ee.add(...e),b0();}},unregister:{enumerable:Po,value:(...e)=>{Ee.remove(...e),b0();}}});function q0(e,t,o){let{startAngle:n,pixelMargin:i,x:r,y:a,outerRadius:s,innerRadius:l}=t,c=i/s;e.beginPath(),e.arc(r,a,s,n-c,o+c),l>i?(c=i/l,e.arc(r,a,l,o+c,n-c,true)):e.arc(r,a,i,o+et,n-et),e.closePath(),e.clip();}function a4(e){return ji(e,["outerStart","outerEnd","innerStart","innerEnd"])}function s4(e,t,o,n){let i=a4(e.options.borderRadius),r=(o-t)/2,a=Math.min(r,n*t/2),s=l=>{let c=(o-Math.min(r,l))*n/2;return Ct(l,0,Math.min(r,c))};return {outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:Ct(i.innerStart,0,a),innerEnd:Ct(i.innerEnd,0,a)}}function Vn(e,t,o,n){return {x:o+e*Math.cos(t),y:n+e*Math.sin(t)}}function au(e,t,o,n,i,r){let{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:d}=t,u=Math.max(t.outerRadius+n+o-c,0),p=d>0?d+n+o+c:0,h=0,m=i-l;if(n){let L=d>0?d-n:0,V=u>0?u-n:0,J=(L+V)/2,Bt=J!==0?m*J/(J+n):m;h=(m-Bt)/2;}let g=Math.max(.001,m*u-o/G)/u,f=(m-g)/2,x=l+f+h,b=i-f-h,{outerStart:T,outerEnd:k,innerStart:w,innerEnd:v}=s4(t,p,u,b-x),_=u-T,M=u-k,I=x+T/_,F=b-k/M,E=p+w,B=p+v,O=x+w/E,U=b-v/B;if(e.beginPath(),r){if(e.arc(a,s,u,I,F),k>0){let J=Vn(M,F,a,s);e.arc(J.x,J.y,k,F,b+et);}let L=Vn(B,b,a,s);if(e.lineTo(L.x,L.y),v>0){let J=Vn(B,U,a,s);e.arc(J.x,J.y,v,b+et,U+Math.PI);}if(e.arc(a,s,p,b-v/p,x+w/p,true),w>0){let J=Vn(E,O,a,s);e.arc(J.x,J.y,w,O+Math.PI,x-et);}let V=Vn(_,x,a,s);if(e.lineTo(V.x,V.y),T>0){let J=Vn(_,I,a,s);e.arc(J.x,J.y,T,x-et,I);}}else {e.moveTo(a,s);let L=Math.cos(I)*u+a,V=Math.sin(I)*u+s;e.lineTo(L,V);let J=Math.cos(F)*u+a,Bt=Math.sin(F)*u+s;e.lineTo(J,Bt);}e.closePath();}function l4(e,t,o,n,i){let{fullCircles:r,startAngle:a,circumference:s}=t,l=t.endAngle;if(r){au(e,t,o,n,a+Q,i);for(let c=0;c<r;++c)e.fill();isNaN(s)||(l=a+s%Q,s%Q===0&&(l+=Q));}return au(e,t,o,n,l,i),e.fill(),l}function c4(e,t,o){let{x:n,y:i,startAngle:r,pixelMargin:a,fullCircles:s}=t,l=Math.max(t.outerRadius-a,0),c=t.innerRadius+a,d;for(o&&q0(e,t,r+Q),e.beginPath(),e.arc(n,i,c,r+Q,r,true),d=0;d<s;++d)e.stroke();for(e.beginPath(),e.arc(n,i,l,r,r+Q),d=0;d<s;++d)e.stroke();}function d4(e,t,o,n,i,r){let{options:a}=t,{borderWidth:s,borderJoinStyle:l}=a,c=a.borderAlign==="inner";s&&(c?(e.lineWidth=s*2,e.lineJoin=l||"round"):(e.lineWidth=s,e.lineJoin=l||"bevel"),t.fullCircles&&c4(e,t,c),c&&q0(e,t,i),au(e,t,o,n,i,r),e.stroke());}var Ze=class extends xt{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t);}inRange(t,o,n){let i=this.getProps(["x","y"],n),{angle:r,distance:a}=is(i,{x:t,y:o}),{startAngle:s,endAngle:l,innerRadius:c,outerRadius:d,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),p=this.options.spacing/2,m=N(u,l-s)>=Q||Jo(r,s,l),g=ge(a,c+p,d+p);return m&&g}getCenterPoint(t){let{x:o,y:n,startAngle:i,endAngle:r,innerRadius:a,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,d=(i+r)/2,u=(a+s+c+l)/2;return {x:o+Math.cos(d)*u,y:n+Math.sin(d)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:o,circumference:n}=this,i=(o.offset||0)/2,r=(o.spacing||0)/2,a=o.circular;if(this.pixelMargin=o.borderAlign==="inner"?.33:0,this.fullCircles=n>Q?Math.floor(n/Q):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let s=0;if(i){s=i/2;let c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*s,Math.sin(c)*s),this.circumference>=G&&(s=i);}t.fillStyle=o.backgroundColor,t.strokeStyle=o.borderColor;let l=l4(t,this,s,r,a);d4(t,this,s,r,l,a),t.restore();}};Ze.id="arc";Ze.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:true};Ze.defaultRoutes={backgroundColor:"backgroundColor"};function Q0(e,t,o=t){e.lineCap=N(o.borderCapStyle,t.borderCapStyle),e.setLineDash(N(o.borderDash,t.borderDash)),e.lineDashOffset=N(o.borderDashOffset,t.borderDashOffset),e.lineJoin=N(o.borderJoinStyle,t.borderJoinStyle),e.lineWidth=N(o.borderWidth,t.borderWidth),e.strokeStyle=N(o.borderColor,t.borderColor);}function u4(e,t,o){e.lineTo(o.x,o.y);}function p4(e){return e.stepped?Ed:e.tension||e.cubicInterpolationMode==="monotone"?Fd:u4}function J0(e,t,o={}){let n=e.length,{start:i=0,end:r=n-1}=o,{start:a,end:s}=t,l=Math.max(i,a),c=Math.min(r,s),d=i<a&&r<a||i>s&&r>s;return {count:n,start:l,loop:t.loop,ilen:c<l&&!d?n+c-l:c-l}}function m4(e,t,o,n){let{points:i,options:r}=t,{count:a,start:s,loop:l,ilen:c}=J0(i,o,n),d=p4(r),{move:u=true,reverse:p}=n||{},h,m,g;for(h=0;h<=c;++h)m=i[(s+(p?c-h:h))%a],!m.skip&&(u?(e.moveTo(m.x,m.y),u=false):d(e,g,m,p,r.stepped),g=m);return l&&(m=i[(s+(p?c:0))%a],d(e,g,m,p,r.stepped)),!!l}function h4(e,t,o,n){let i=t.points,{count:r,start:a,ilen:s}=J0(i,o,n),{move:l=true,reverse:c}=n||{},d=0,u=0,p,h,m,g,f,x,b=k=>(a+(c?s-k:k))%r,T=()=>{g!==f&&(e.lineTo(d,f),e.lineTo(d,g),e.lineTo(d,x));};for(l&&(h=i[b(0)],e.moveTo(h.x,h.y)),p=0;p<=s;++p){if(h=i[b(p)],h.skip)continue;let k=h.x,w=h.y,v=k|0;v===m?(w<g?g=w:w>f&&(f=w),d=(u*d+k)/++u):(T(),e.lineTo(k,w),m=v,u=0,g=f=w),x=w;}T();}function su(e){let t=e.options,o=t.borderDash&&t.borderDash.length;return !e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!o?h4:m4}function g4(e){return e.stepped?Od:e.tension||e.cubicInterpolationMode==="monotone"?zd:Oe}function f4(e,t,o,n){let i=t._path;i||(i=t._path=new Path2D,t.path(i,o,n)&&i.closePath()),Q0(e,t.options),e.stroke(i);}function y4(e,t,o,n){let{segments:i,options:r}=t,a=su(t);for(let s of i)Q0(e,r,s.style),e.beginPath(),a(e,t,s,{start:o,end:o+n-1})&&e.closePath(),e.stroke();}var x4=typeof Path2D=="function";function b4(e,t,o,n){x4&&!t.options.segment?f4(e,t,o,n):y4(e,t,o,n);}var ye=class extends xt{constructor(t){super(),this.animated=true,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=false,this._pointsUpdated=false,this._datasetIndex=void 0,t&&Object.assign(this,t);}updateControlPoints(t,o){let n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){let i=n.spanGaps?this._loop:this._fullLoop;Dd(this._points,n,t,i,o),this._pointsUpdated=true;}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=false;}get points(){return this._points}get segments(){return this._segments||(this._segments=Vd(this,this.options.segment))}first(){let t=this.segments,o=this.points;return t.length&&o[t[0].start]}last(){let t=this.segments,o=this.points,n=t.length;return n&&o[t[n-1].end]}interpolate(t,o){let n=this.options,i=t[o],r=this.points,a=ks(this,{property:o,start:i,end:i});if(!a.length)return;let s=[],l=g4(n),c,d;for(c=0,d=a.length;c<d;++c){let{start:u,end:p}=a[c],h=r[u],m=r[p];if(h===m){s.push(h);continue}let g=Math.abs((i-h[o])/(m[o]-h[o])),f=l(h,m,g,n.stepped);f[o]=t[o],s.push(f);}return s.length===1?s[0]:s}pathSegment(t,o,n){return su(this)(t,this,o,n)}path(t,o,n){let i=this.segments,r=su(this),a=this._loop;o=o||0,n=n||this.points.length-o;for(let s of i)a&=r(t,this,s,{start:o,end:o+n-1});return !!a}draw(t,o,n,i){let r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),b4(t,this,n,i),t.restore()),this.animated&&(this._pointsUpdated=false,this._path=void 0);}};ye.id="line";ye.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:true,cubicInterpolationMode:"default",fill:false,spanGaps:false,stepped:false,tension:0};ye.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};ye.descriptors={_scriptable:true,_indexable:e=>e!=="borderDash"&&e!=="fill"};function C0(e,t,o,n){let i=e.options,{[o]:r}=e.getProps([o],n);return Math.abs(t-r)<i.radius+i.hitRadius}var Xe=class extends xt{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t);}inRange(t,o,n){let i=this.options,{x:r,y:a}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(o-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,o){return C0(this,t,"x",o)}inYRange(t,o){return C0(this,t,"y",o)}getCenterPoint(t){let{x:o,y:n}=this.getProps(["x","y"],t);return {x:o,y:n}}size(t){t=t||this.options||{};let o=t.radius||0;o=Math.max(o,o&&t.hoverRadius||0);let n=o&&t.borderWidth||0;return (o+n)*2}draw(t,o){let n=this.options;this.skip||n.radius<.1||!Xo(this,o,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,Gi(t,n,this.x,this.y));}getRange(){let t=this.options||{};return t.radius+t.hitRadius}};Xe.id="point";Xe.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};Xe.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function tx(e,t){let{x:o,y:n,base:i,width:r,height:a}=e.getProps(["x","y","base","width","height"],t),s,l,c,d,u;return e.horizontal?(u=a/2,s=Math.min(o,i),l=Math.max(o,i),c=n-u,d=n+u):(u=r/2,s=o-u,l=o+u,c=Math.min(n,i),d=Math.max(n,i)),{left:s,top:c,right:l,bottom:d}}function So(e,t,o,n){return e?0:Ct(t,o,n)}function C4(e,t,o){let n=e.options.borderWidth,i=e.borderSkipped,r=hs(n);return {t:So(i.top,r.top,0,o),r:So(i.right,r.right,0,t),b:So(i.bottom,r.bottom,0,o),l:So(i.left,r.left,0,t)}}function P4(e,t,o){let{enableBorderRadius:n}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,r=fe(i),a=Math.min(t,o),s=e.borderSkipped,l=n||z(i);return {topLeft:So(!l||s.top||s.left,r.topLeft,0,a),topRight:So(!l||s.top||s.right,r.topRight,0,a),bottomLeft:So(!l||s.bottom||s.left,r.bottomLeft,0,a),bottomRight:So(!l||s.bottom||s.right,r.bottomRight,0,a)}}function S4(e){let t=tx(e),o=t.right-t.left,n=t.bottom-t.top,i=C4(e,o/2,n/2),r=P4(e,o/2,n/2);return {outer:{x:t.left,y:t.top,w:o,h:n,radius:r},inner:{x:t.left+i.l,y:t.top+i.t,w:o-i.l-i.r,h:n-i.t-i.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,r.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(i.b,i.r))}}}}function Zd(e,t,o,n){let i=t===null,r=o===null,s=e&&!(i&&r)&&tx(e,n);return s&&(i||ge(t,s.left,s.right))&&(r||ge(o,s.top,s.bottom))}function T4(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function k4(e,t){e.rect(t.x,t.y,t.w,t.h);}function Xd(e,t,o={}){let n=e.x!==o.x?-t:0,i=e.y!==o.y?-t:0,r=(e.x+e.w!==o.x+o.w?t:0)-n,a=(e.y+e.h!==o.y+o.h?t:0)-i;return {x:e.x+n,y:e.y+i,w:e.w+r,h:e.h+a,radius:e.radius}}var Ke=class extends xt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t);}draw(t){let{inflateAmount:o,options:{borderColor:n,backgroundColor:i}}=this,{inner:r,outer:a}=S4(this),s=T4(a.radius)?We:k4;t.save(),(a.w!==r.w||a.h!==r.h)&&(t.beginPath(),s(t,Xd(a,o,r)),t.clip(),s(t,Xd(r,-o,a)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),s(t,Xd(r,o)),t.fillStyle=i,t.fill(),t.restore();}inRange(t,o,n){return Zd(this,t,o,n)}inXRange(t,o){return Zd(this,t,null,o)}inYRange(t,o){return Zd(this,null,t,o)}getCenterPoint(t){let{x:o,y:n,base:i,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return {x:r?(o+i)/2:o,y:r?n:(n+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}};Ke.id="bar";Ke.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Ke.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function w4(e,t,o){let n=e.segments,i=e.points,r=t.points,a=[];for(let s of n){let{start:l,end:c}=s;c=du(l,c,i);let d=lu(o,i[l],i[c],s.loop);if(!t.segments){a.push({source:s,target:d,start:i[l],end:i[c]});continue}let u=ks(t,d);for(let p of u){let h=lu(o,r[p.start],r[p.end],p.loop),m=Ts(s,i,h);for(let g of m)a.push({source:g,target:p,start:{[o]:P0(d,h,"start",Math.max)},end:{[o]:P0(d,h,"end",Math.min)}});}}return a}function lu(e,t,o,n){if(n)return;let i=t[e],r=o[e];return e==="angle"&&(i=Ft(i),r=Ft(r)),{property:e,start:i,end:r}}function v4(e,t){let{x:o=null,y:n=null}=e||{},i=t.points,r=[];return t.segments.forEach(({start:a,end:s})=>{s=du(a,s,i);let l=i[a],c=i[s];n!==null?(r.push({x:l.x,y:n}),r.push({x:c.x,y:n})):o!==null&&(r.push({x:o,y:l.y}),r.push({x:o,y:c.y}));}),r}function du(e,t,o){for(;t>e;t--){let n=o[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function P0(e,t,o,n){return e&&t?n(e[o],t[o]):e?e[o]:t?t[o]:0}function ex(e,t){let o=[],n=false;return Z(e)?(n=true,o=e):o=v4(e,t),o.length?new ye({points:o,options:{tension:0},_loop:n,_fullLoop:n}):null}function S0(e){return e&&e.fill!==false}function _4(e,t,o){let i=e[t].fill,r=[t],a;if(!o)return i;for(;i!==false&&r.indexOf(i)===-1;){if(!lt(i))return i;if(a=e[i],!a)return false;if(a.visible)return i;r.push(i),i=a.fill;}return false}function A4(e,t,o){let n=F4(e);if(z(n))return isNaN(n.value)?false:n;let i=parseFloat(n);return lt(i)&&Math.floor(i)===i?M4(n[0],t,i,o):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function M4(e,t,o,n){return (e==="-"||e==="+")&&(o=t+o),o===t||o<0||o>=n?false:o}function I4(e,t){let o=null;return e==="start"?o=t.bottom:e==="end"?o=t.top:z(e)?o=t.getPixelForValue(e.value):t.getBasePixel&&(o=t.getBasePixel()),o}function E4(e,t,o){let n;return e==="start"?n=o:e==="end"?n=t.options.reverse?t.min:t.max:z(e)?n=e.value:n=t.getBaseValue(),n}function F4(e){let t=e.options,o=t.fill,n=N(o&&o.target,o);return n===void 0&&(n=!!t.backgroundColor),n===false||n===null?false:n===true?"origin":n}function L4(e){let{scale:t,index:o,line:n}=e,i=[],r=n.segments,a=n.points,s=B4(t,o);s.push(ex({x:null,y:t.bottom},n));for(let l=0;l<r.length;l++){let c=r[l];for(let d=c.start;d<=c.end;d++)R4(i,a[d],s);}return new ye({points:i,options:{}})}function B4(e,t){let o=[],n=e.getMatchingVisibleMetas("line");for(let i=0;i<n.length;i++){let r=n[i];if(r.index===t)break;r.hidden||o.unshift(r.dataset);}return o}function R4(e,t,o){let n=[];for(let i=0;i<o.length;i++){let r=o[i],{first:a,last:s,point:l}=D4(r,t,"x");if(!(!l||a&&s)){if(a)n.unshift(l);else if(e.push(l),!s)break}}e.push(...n);}function D4(e,t,o){let n=e.interpolate(t,o);if(!n)return {};let i=n[o],r=e.segments,a=e.points,s=false,l=false;for(let c=0;c<r.length;c++){let d=r[c],u=a[d.start][o],p=a[d.end][o];if(ge(i,u,p)){s=i===u,l=i===p;break}}return {first:s,last:l,point:n}}var Bs=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius;}pathSegment(t,o,n){let{x:i,y:r,radius:a}=this;return o=o||{start:0,end:Q},t.arc(i,r,a,o.end,o.start,true),!n.bounds}interpolate(t){let{x:o,y:n,radius:i}=this,r=t.angle;return {x:o+Math.cos(r)*i,y:n+Math.sin(r)*i,angle:r}}};function N4(e){let{chart:t,fill:o,line:n}=e;if(lt(o))return U4(t,o);if(o==="stack")return L4(e);if(o==="shape")return true;let i=O4(e);return i instanceof Bs?i:ex(i,n)}function U4(e,t){let o=e.getDatasetMeta(t);return o&&e.isDatasetVisible(t)?o.dataset:null}function O4(e){return (e.scale||{}).getPointPositionForValue?V4(e):z4(e)}function z4(e){let{scale:t={},fill:o}=e,n=I4(o,t);if(lt(n)){let i=t.isHorizontal();return {x:i?n:null,y:i?null:n}}return null}function V4(e){let{scale:t,fill:o}=e,n=t.options,i=t.getLabels().length,r=n.reverse?t.max:t.min,a=E4(o,t,r),s=[];if(n.grid.circular){let l=t.getPointPositionForValue(0,r);return new Bs({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<i;++l)s.push(t.getPointPositionForValue(l,a));return s}function Kd(e,t,o){let n=N4(t),{line:i,scale:r,axis:a}=t,s=i.options,l=s.fill,c=s.backgroundColor,{above:d=c,below:u=c}=l||{};n&&i.points.length&&(xo(e,o),$4(e,{line:i,target:n,above:d,below:u,area:o,scale:r,axis:a}),bo(e));}function $4(e,t){let{line:o,target:n,above:i,below:r,area:a,scale:s}=t,l=o._loop?"angle":t.axis;e.save(),l==="x"&&r!==i&&(T0(e,n,a.top),k0(e,{line:o,target:n,color:i,scale:s,property:l}),e.restore(),e.save(),T0(e,n,a.bottom)),k0(e,{line:o,target:n,color:r,scale:s,property:l}),e.restore();}function T0(e,t,o){let{segments:n,points:i}=t,r=true,a=false;e.beginPath();for(let s of n){let{start:l,end:c}=s,d=i[l],u=i[du(l,c,i)];r?(e.moveTo(d.x,d.y),r=false):(e.lineTo(d.x,o),e.lineTo(d.x,d.y)),a=!!t.pathSegment(e,s,{move:a}),a?e.closePath():e.lineTo(u.x,o);}e.lineTo(t.first().x,o),e.closePath(),e.clip();}function k0(e,t){let{line:o,target:n,property:i,color:r,scale:a}=t,s=w4(o,n,i);for(let{source:l,target:c,start:d,end:u}of s){let{style:{backgroundColor:p=r}={}}=l,h=n!==true;e.save(),e.fillStyle=p,H4(e,a,h&&lu(i,d,u)),e.beginPath();let m=!!o.pathSegment(e,l),g;if(h){m?e.closePath():w0(e,n,u,i);let f=!!n.pathSegment(e,c,{move:m,reverse:true});g=m&&f,g||w0(e,n,d,i);}e.closePath(),e.fill(g?"evenodd":"nonzero"),e.restore();}}function H4(e,t,o){let{top:n,bottom:i}=t.chart.chartArea,{property:r,start:a,end:s}=o||{};r==="x"&&(e.beginPath(),e.rect(a,n,s-a,i-n),e.clip());}function w0(e,t,o,n){let i=t.interpolate(o,n);i&&e.lineTo(i.x,i.y);}var ox={id:"filler",afterDatasetsUpdate(e,t,o){let n=(e.data.datasets||[]).length,i=[],r,a,s,l;for(a=0;a<n;++a)r=e.getDatasetMeta(a),s=r.dataset,l=null,s&&s.options&&s instanceof ye&&(l={visible:e.isDatasetVisible(a),index:a,fill:A4(s,a,n),chart:e,axis:r.controller.options.indexAxis,scale:r.vScale,line:s}),r.$filler=l,i.push(l);for(a=0;a<n;++a)l=i[a],!(!l||l.fill===false)&&(l.fill=_4(i,a,o.propagate));},beforeDraw(e,t,o){let n=o.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),r=e.chartArea;for(let a=i.length-1;a>=0;--a){let s=i[a].$filler;s&&(s.line.updateControlPoints(r,s.axis),n&&s.fill&&Kd(e.ctx,s,r));}},beforeDatasetsDraw(e,t,o){if(o.drawTime!=="beforeDatasetsDraw")return;let n=e.getSortedVisibleDatasetMetas();for(let i=n.length-1;i>=0;--i){let r=n[i].$filler;S0(r)&&Kd(e.ctx,r,e.chartArea);}},beforeDatasetDraw(e,t,o){let n=t.meta.$filler;!S0(n)||o.drawTime!=="beforeDatasetDraw"||Kd(e.ctx,n,e.chartArea);},defaults:{propagate:true,drawTime:"beforeDatasetDraw"}},v0=(e,t)=>{let{boxHeight:o=t,boxWidth:n=t}=e;return e.usePointStyle&&(o=Math.min(o,t),n=e.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:o,itemHeight:Math.max(t,o)}},W4=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,Rs=class extends xt{constructor(t){super(),this._added=false,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=false,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0;}update(t,o,n){this.maxWidth=t,this.maxHeight=o,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit();}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height);}buildLabels(){let t=this.options.labels||{},o=X(t.generateLabels,[this.chart],this)||[];t.filter&&(o=o.filter(n=>t.filter(n,this.chart.data))),t.sort&&(o=o.sort((n,i)=>t.sort(n,i,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o;}fit(){let{options:t,ctx:o}=this;if(!t.display){this.width=this.height=0;return}let n=t.labels,i=it(n.font),r=i.size,a=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=v0(n,r),c,d;o.font=i.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(a,r,s,l)+10):(d=this.maxHeight,c=this._fitCols(a,r,s,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight);}_fitRows(t,o,n,i){let{ctx:r,maxWidth:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=i+s,u=t;r.textAlign="left",r.textBaseline="middle";let p=-1,h=-d;return this.legendItems.forEach((m,g)=>{let f=n+o/2+r.measureText(m.text).width;(g===0||c[c.length-1]+f+2*s>a)&&(u+=d,c[c.length-(g>0?0:1)]=0,h+=d,p++),l[g]={left:0,top:h,row:p,width:f,height:i},c[c.length-1]+=f+s;}),u}_fitCols(t,o,n,i){let{ctx:r,maxHeight:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=a-t,u=s,p=0,h=0,m=0,g=0;return this.legendItems.forEach((f,x)=>{let b=n+o/2+r.measureText(f.text).width;x>0&&h+i+2*s>d&&(u+=p+s,c.push({width:p,height:h}),m+=p+s,g++,p=h=0),l[x]={left:m,top:h,col:g,width:b,height:i},p=Math.max(p,b),h+=i+s;}),u+=p,c.push({width:p,height:h}),u}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:n,labels:{padding:i},rtl:r}}=this,a=Co(r,this.left,this.width);if(this.isHorizontal()){let s=0,l=Pt(n,this.left+i,this.right-this.lineWidths[s]);for(let c of o)s!==c.row&&(s=c.row,l=Pt(n,this.left+i,this.right-this.lineWidths[s])),c.top+=this.top+t+i,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+i;}else {let s=0,l=Pt(n,this.top+t+i,this.bottom-this.columnSizes[s].height);for(let c of o)c.col!==s&&(s=c.col,l=Pt(n,this.top+t+i,this.bottom-this.columnSizes[s].height)),c.top=l,c.left+=this.left+i,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+i;}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;xo(t,this),this._draw(),bo(t);}}_draw(){let{options:t,columnSizes:o,lineWidths:n,ctx:i}=this,{align:r,labels:a}=t,s=H.color,l=Co(t.rtl,this.left,this.width),c=it(a.font),{color:d,padding:u}=a,p=c.size,h=p/2,m;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;let{boxWidth:g,boxHeight:f,itemHeight:x}=v0(a,p),b=function(_,M,I){if(isNaN(g)||g<=0||isNaN(f)||f<0)return;i.save();let F=N(I.lineWidth,1);if(i.fillStyle=N(I.fillStyle,s),i.lineCap=N(I.lineCap,"butt"),i.lineDashOffset=N(I.lineDashOffset,0),i.lineJoin=N(I.lineJoin,"miter"),i.lineWidth=F,i.strokeStyle=N(I.strokeStyle,s),i.setLineDash(N(I.lineDash,[])),a.usePointStyle){let E={radius:f*Math.SQRT2/2,pointStyle:I.pointStyle,rotation:I.rotation,borderWidth:F},B=l.xPlus(_,g/2),O=M+h;ms(i,E,B,O,a.pointStyleWidth&&g);}else {let E=M+Math.max((p-f)/2,0),B=l.leftForLtr(_,g),O=fe(I.borderRadius);i.beginPath(),Object.values(O).some(U=>U!==0)?We(i,{x:B,y:E,w:g,h:f,radius:O}):i.rect(B,E,g,f),i.fill(),F!==0&&i.stroke();}i.restore();},T=function(_,M,I){He(i,I.text,_,M+x/2,c,{strikethrough:I.hidden,textAlign:l.textAlign(I.textAlign)});},k=this.isHorizontal(),w=this._computeTitleHeight();k?m={x:Pt(r,this.left+u,this.right-n[0]),y:this.top+u+w,line:0}:m={x:this.left+u,y:Pt(r,this.top+w+u,this.bottom-o[0].height),line:0},Ps(this.ctx,t.textDirection);let v=x+u;this.legendItems.forEach((_,M)=>{i.strokeStyle=_.fontColor||d,i.fillStyle=_.fontColor||d;let I=i.measureText(_.text).width,F=l.textAlign(_.textAlign||(_.textAlign=a.textAlign)),E=g+h+I,B=m.x,O=m.y;l.setWidth(this.width),k?M>0&&B+E+u>this.right&&(O=m.y+=v,m.line++,B=m.x=Pt(r,this.left+u,this.right-n[m.line])):M>0&&O+v>this.bottom&&(B=m.x=B+o[m.line].width+u,m.line++,O=m.y=Pt(r,this.top+w+u,this.bottom-o[m.line].height));let U=l.x(B);b(U,O,_),B=wd(F,B+g+h,k?B+E:this.right,t.rtl),T(l.x(B),O,_),k?m.x+=E+u:m.y+=v;}),Ss(this.ctx,t.textDirection);}drawTitle(){let t=this.options,o=t.title,n=it(o.font),i=pt(o.padding);if(!o.display)return;let r=Co(t.rtl,this.left,this.width),a=this.ctx,s=o.position,l=n.size/2,c=i.top+l,d,u=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),d=this.top+c,u=Pt(t.align,u,this.right-p);else {let m=this.columnSizes.reduce((g,f)=>Math.max(g,f.height),0);d=c+Pt(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight());}let h=Pt(s,u,u+p);a.textAlign=r.textAlign(Hi(s)),a.textBaseline="middle",a.strokeStyle=o.color,a.fillStyle=o.color,a.font=n.string,He(a,o.text,h,d,n);}_computeTitleHeight(){let t=this.options.title,o=it(t.font),n=pt(t.padding);return t.display?o.lineHeight+n.height:0}_getLegendItemAt(t,o){let n,i,r;if(ge(t,this.left,this.right)&&ge(o,this.top,this.bottom)){for(r=this.legendHitBoxes,n=0;n<r.length;++n)if(i=r[n],ge(t,i.left,i.left+i.width)&&ge(o,i.top,i.top+i.height))return this.legendItems[n]}return null}handleEvent(t){let o=this.options;if(!G4(t.type,o))return;let n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let i=this._hoveredItem,r=W4(i,n);i&&!r&&X(o.onLeave,[t,i,this],this),this._hoveredItem=n,n&&!r&&X(o.onHover,[t,n,this],this);}else n&&X(o.onClick,[t,n,this],this);}};function G4(e,t){return !!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var nx={id:"legend",_element:Rs,start(e,t,o){let n=e.legend=new Rs({ctx:e.ctx,options:o,chart:e});ae.configure(e,n,o),ae.addBox(e,n);},stop(e){ae.removeBox(e,e.legend),delete e.legend;},beforeUpdate(e,t,o){let n=e.legend;ae.configure(e,n,o),n.options=o;},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes();},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event);},defaults:{display:true,position:"top",align:"center",fullSize:true,reverse:false,weight:1e3,onClick(e,t,o){let n=t.datasetIndex,i=o.chart;i.isDatasetVisible(n)?(i.hide(n),t.hidden=true):(i.show(n),t.hidden=false);},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:o,pointStyle:n,textAlign:i,color:r}}=e.legend.options;return e._getSortedDatasetMetas().map(a=>{let s=a.controller.getStyle(o?0:void 0),l=pt(s.borderWidth);return {text:t[a.index].label,fillStyle:s.backgroundColor,fontColor:r,hidden:!a.visible,lineCap:s.borderCapStyle,lineDash:s.borderDash,lineDashOffset:s.borderDashOffset,lineJoin:s.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:s.borderColor,pointStyle:n||s.pointStyle,rotation:s.rotation,textAlign:i||s.textAlign,borderRadius:0,datasetIndex:a.index}},this)}},title:{color:e=>e.chart.options.color,display:false,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},Ds=class extends xt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0;}update(t,o){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=o;let i=Z(n.text)?n.text.length:1;this._padding=pt(n.padding);let r=i*it(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r;}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:o,left:n,bottom:i,right:r,options:a}=this,s=a.align,l=0,c,d,u;return this.isHorizontal()?(d=Pt(s,n,r),u=o+t,c=r-n):(a.position==="left"?(d=n+t,u=Pt(s,i,o),l=G*-0.5):(d=r-t,u=Pt(s,o,i),l=G*.5),c=i-o),{titleX:d,titleY:u,maxWidth:c,rotation:l}}draw(){let t=this.ctx,o=this.options;if(!o.display)return;let n=it(o.font),r=n.lineHeight/2+this._padding.top,{titleX:a,titleY:s,maxWidth:l,rotation:c}=this._drawArgs(r);He(t,o.text,0,0,n,{color:o.color,maxWidth:l,rotation:c,textAlign:Hi(o.align),textBaseline:"middle",translation:[a,s]});}};function j4(e,t){let o=new Ds({ctx:e.ctx,options:t,chart:e});ae.configure(e,o,t),ae.addBox(e,o),e.titleBlock=o;}var ix={id:"title",_element:Ds,start(e,t,o){j4(e,o);},stop(e){let t=e.titleBlock;ae.removeBox(e,t),delete e.titleBlock;},beforeUpdate(e,t,o){let n=e.titleBlock;ae.configure(e,n,o),n.options=o;},defaults:{align:"center",display:false,font:{weight:"bold"},fullSize:true,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:true,_indexable:false}};var er={average(e){if(!e.length)return false;let t,o,n=0,i=0,r=0;for(t=0,o=e.length;t<o;++t){let a=e[t].element;if(a&&a.hasValue()){let s=a.tooltipPosition();n+=s.x,i+=s.y,++r;}}return {x:n/r,y:i/r}},nearest(e,t){if(!e.length)return false;let o=t.x,n=t.y,i=Number.POSITIVE_INFINITY,r,a,s;for(r=0,a=e.length;r<a;++r){let l=e[r].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),d=Ve(t,c);d<i&&(i=d,s=l);}}if(s){let l=s.tooltipPosition();o=l.x,n=l.y;}return {x:o,y:n}}};function Ie(e,t){return t&&(Z(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ye(e){return (typeof e=="string"||e instanceof String)&&e.indexOf(`
1016
1016
  `)>-1?e.split(`
1017
- `):e}function w4(e,t){let{element:o,datasetIndex:n,index:i}=t,r=e.getDatasetMeta(n).controller,{label:a,value:s}=r.getLabelAndValue(i);return {chart:e,label:a,parsed:r.getParsed(i),raw:e.data.datasets[n].data[i],formattedValue:s,dataset:r.getDataset(),dataIndex:i,datasetIndex:n,element:o}}function h0(e,t){let o=e.chart.ctx,{body:n,footer:i,title:r}=e,{boxWidth:a,boxHeight:s}=t,l=it(t.bodyFont),c=it(t.titleFont),d=it(t.footerFont),u=r.length,p=i.length,m=n.length,h=ut(t.padding),f=h.height,g=0,y=n.reduce((k,w)=>k+w.before.length+w.lines.length+w.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,u&&(f+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),y){let k=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;f+=m*k+(y-m)*l.lineHeight+(y-1)*t.bodySpacing;}p&&(f+=t.footerMarginTop+p*d.lineHeight+(p-1)*t.footerSpacing);let P=0,T=function(k){g=Math.max(g,o.measureText(k).width+P);};return o.save(),o.font=c.string,K(e.title,T),o.font=l.string,K(e.beforeBody.concat(e.afterBody),T),P=t.displayColors?a+2+t.boxPadding:0,K(n,k=>{K(k.before,T),K(k.lines,T),K(k.after,T);}),P=0,o.font=d.string,K(e.footer,T),o.restore(),g+=h.width,{width:g,height:f}}function v4(e,t){let{y:o,height:n}=t;return o<n/2?"top":o>e.height-n/2?"bottom":"center"}function _4(e,t,o,n){let{x:i,width:r}=n,a=o.caretSize+o.caretPadding;if(e==="left"&&i+r+a>t.width||e==="right"&&i-r-a<0)return true}function A4(e,t,o,n){let{x:i,width:r}=o,{width:a,chartArea:{left:s,right:l}}=e,c="center";return n==="center"?c=i<=(s+l)/2?"left":"right":i<=r/2?c="left":i>=a-r/2&&(c="right"),_4(c,e,t,o)&&(c="center"),c}function m0(e,t,o){let n=o.yAlign||t.yAlign||v4(e,o);return {xAlign:o.xAlign||t.xAlign||A4(e,t,o,n),yAlign:n}}function M4(e,t){let{x:o,width:n}=e;return t==="right"?o-=n:t==="center"&&(o-=n/2),o}function I4(e,t,o){let{y:n,height:i}=e;return t==="top"?n+=o:t==="bottom"?n-=i+o:n-=i/2,n}function f0(e,t,o,n){let{caretSize:i,caretPadding:r,cornerRadius:a}=e,{xAlign:s,yAlign:l}=o,c=i+r,{topLeft:d,topRight:u,bottomLeft:p,bottomRight:m}=fe(a),h=M4(t,s),f=I4(t,l,c);return l==="center"?s==="left"?h+=c:s==="right"&&(h-=c):s==="left"?h-=Math.max(d,p)+i:s==="right"&&(h+=Math.max(u,m)+i),{x:Ct(h,0,n.width-t.width),y:Ct(f,0,n.height-t.height)}}function Cs(e,t,o){let n=ut(o.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-n.right:e.x+n.left}function g0(e){return Ie([],Ye(e))}function L4(e,t,o){return Me(e,{tooltip:t,tooltipItems:o,type:"tooltip"})}function y0(e,t){let o=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return o?e.override(o):e}var ir=class extends xt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0;}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0;}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let o=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&o.options.animation&&n.animations,r=new Hn(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=L4(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,o){let{callbacks:n}=o,i=n.beforeTitle.apply(this,[t]),r=n.title.apply(this,[t]),a=n.afterTitle.apply(this,[t]),s=[];return s=Ie(s,Ye(i)),s=Ie(s,Ye(r)),s=Ie(s,Ye(a)),s}getBeforeBody(t,o){return g0(o.callbacks.beforeBody.apply(this,[t]))}getBody(t,o){let{callbacks:n}=o,i=[];return K(t,r=>{let a={before:[],lines:[],after:[]},s=y0(n,r);Ie(a.before,Ye(s.beforeLabel.call(this,r))),Ie(a.lines,s.label.call(this,r)),Ie(a.after,Ye(s.afterLabel.call(this,r))),i.push(a);}),i}getAfterBody(t,o){return g0(o.callbacks.afterBody.apply(this,[t]))}getFooter(t,o){let{callbacks:n}=o,i=n.beforeFooter.apply(this,[t]),r=n.footer.apply(this,[t]),a=n.afterFooter.apply(this,[t]),s=[];return s=Ie(s,Ye(i)),s=Ie(s,Ye(r)),s=Ie(s,Ye(a)),s}_createItems(t){let o=this._active,n=this.chart.data,i=[],r=[],a=[],s=[],l,c;for(l=0,c=o.length;l<c;++l)s.push(w4(this.chart,o[l]));return t.filter&&(s=s.filter((d,u,p)=>t.filter(d,u,p,n))),t.itemSort&&(s=s.sort((d,u)=>t.itemSort(d,u,n))),K(s,d=>{let u=y0(t.callbacks,d);i.push(u.labelColor.call(this,d)),r.push(u.labelPointStyle.call(this,d)),a.push(u.labelTextColor.call(this,d));}),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=s,s}update(t,o){let n=this.options.setContext(this.getContext()),i=this._active,r,a=[];if(!i.length)this.opacity!==0&&(r={opacity:0});else {let s=tr[n.position].call(this,i,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let l=this._size=h0(this,n),c=Object.assign({},s,l),d=m0(this.chart,n,c),u=f0(n,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,r={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y};}this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:o});}drawCaret(t,o,n,i){let r=this.getCaretPosition(t,n,i);o.lineTo(r.x1,r.y1),o.lineTo(r.x2,r.y2),o.lineTo(r.x3,r.y3);}getCaretPosition(t,o,n){let{xAlign:i,yAlign:r}=this,{caretSize:a,cornerRadius:s}=n,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:u}=fe(s),{x:p,y:m}=t,{width:h,height:f}=o,g,y,P,T,k,w;return r==="center"?(k=m+f/2,i==="left"?(g=p,y=g-a,T=k+a,w=k-a):(g=p+h,y=g+a,T=k-a,w=k+a),P=g):(i==="left"?y=p+Math.max(l,d)+a:i==="right"?y=p+h-Math.max(c,u)-a:y=this.caretX,r==="top"?(T=m,k=T-a,g=y-a,P=y+a):(T=m+f,k=T+a,g=y+a,P=y-a),w=T),{x1:g,x2:y,x3:P,y1:T,y2:k,y3:w}}drawTitle(t,o,n){let i=this.title,r=i.length,a,s,l;if(r){let c=Co(n.rtl,this.x,this.width);for(t.x=Cs(this,n.titleAlign,n),o.textAlign=c.textAlign(n.titleAlign),o.textBaseline="middle",a=it(n.titleFont),s=n.titleSpacing,o.fillStyle=n.titleColor,o.font=a.string,l=0;l<r;++l)o.fillText(i[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===r&&(t.y+=n.titleMarginBottom-s);}}_drawColorBox(t,o,n,i,r){let a=this.labelColors[n],s=this.labelPointStyles[n],{boxHeight:l,boxWidth:c,boxPadding:d}=r,u=it(r.bodyFont),p=Cs(this,"left",r),m=i.x(p),h=l<u.lineHeight?(u.lineHeight-l)/2:0,f=o.y+h;if(r.usePointStyle){let g={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},y=i.leftForLtr(m,c)+c/2,P=f+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Wi(t,g,y,P),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Wi(t,g,y,P);}else {t.lineWidth=z(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;let g=i.leftForLtr(m,c-d),y=i.leftForLtr(i.xPlus(m,1),c-d-2),P=fe(a.borderRadius);Object.values(P).some(T=>T!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,We(t,{x:g,y:f,w:c,h:l,radius:P}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),We(t,{x:y,y:f+1,w:c-2,h:l-2,radius:P}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(g,f,c,l),t.strokeRect(g,f,c,l),t.fillStyle=a.backgroundColor,t.fillRect(y,f+1,c-2,l-2));}t.fillStyle=this.labelTextColors[n];}drawBody(t,o,n){let{body:i}=this,{bodySpacing:r,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c,boxPadding:d}=n,u=it(n.bodyFont),p=u.lineHeight,m=0,h=Co(n.rtl,this.x,this.width),f=function(M){o.fillText(M,h.x(t.x+m),t.y+p/2),t.y+=p+r;},g=h.textAlign(a),y,P,T,k,w,v,A;for(o.textAlign=a,o.textBaseline="middle",o.font=u.string,t.x=Cs(this,g,n),o.fillStyle=n.bodyColor,K(this.beforeBody,f),m=s&&g!=="right"?a==="center"?c/2+d:c+2+d:0,k=0,v=i.length;k<v;++k){for(y=i[k],P=this.labelTextColors[k],o.fillStyle=P,K(y.before,f),T=y.lines,s&&T.length&&(this._drawColorBox(o,t,k,h,n),p=Math.max(u.lineHeight,l)),w=0,A=T.length;w<A;++w)f(T[w]),p=u.lineHeight;K(y.after,f);}m=0,p=u.lineHeight,K(this.afterBody,f),t.y-=r;}drawFooter(t,o,n){let i=this.footer,r=i.length,a,s;if(r){let l=Co(n.rtl,this.x,this.width);for(t.x=Cs(this,n.footerAlign,n),t.y+=n.footerMarginTop,o.textAlign=l.textAlign(n.footerAlign),o.textBaseline="middle",a=it(n.footerFont),o.fillStyle=n.footerColor,o.font=a.string,s=0;s<r;++s)o.fillText(i[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+n.footerSpacing;}}drawBackground(t,o,n,i){let{xAlign:r,yAlign:a}=this,{x:s,y:l}=t,{width:c,height:d}=n,{topLeft:u,topRight:p,bottomLeft:m,bottomRight:h}=fe(i.cornerRadius);o.fillStyle=i.backgroundColor,o.strokeStyle=i.borderColor,o.lineWidth=i.borderWidth,o.beginPath(),o.moveTo(s+u,l),a==="top"&&this.drawCaret(t,o,n,i),o.lineTo(s+c-p,l),o.quadraticCurveTo(s+c,l,s+c,l+p),a==="center"&&r==="right"&&this.drawCaret(t,o,n,i),o.lineTo(s+c,l+d-h),o.quadraticCurveTo(s+c,l+d,s+c-h,l+d),a==="bottom"&&this.drawCaret(t,o,n,i),o.lineTo(s+m,l+d),o.quadraticCurveTo(s,l+d,s,l+d-m),a==="center"&&r==="left"&&this.drawCaret(t,o,n,i),o.lineTo(s,l+u),o.quadraticCurveTo(s,l,s+u,l),o.closePath(),o.fill(),i.borderWidth>0&&o.stroke();}_updateAnimationTarget(t){let o=this.chart,n=this.$animations,i=n&&n.x,r=n&&n.y;if(i||r){let a=tr[t.position].call(this,this._active,this._eventPosition);if(!a)return;let s=this._size=h0(this,t),l=Object.assign({},a,this._size),c=m0(o,t,l),d=f0(t,l,c,o);(i._to!==d.x||r._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d));}}_willRender(){return !!this.opacity}draw(t){let o=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(o);let i={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=ut(o.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&s&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,i,o),hs(t,o.textDirection),r.y+=a.top,this.drawTitle(r,t,o),this.drawBody(r,t,o),this.drawFooter(r,t,o),ms(t,o.textDirection),t.restore());}getActiveElements(){return this._active||[]}setActiveElements(t,o){let n=this._active,i=t.map(({datasetIndex:s,index:l})=>{let c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return {datasetIndex:s,element:c.data[l],index:l}}),r=!zn(n,i),a=this._positionChanged(i,o);(r||a)&&(this._active=i,this._eventPosition=o,this._ignoreReplayEvents=true,this.update(true));}handleEvent(t,o,n=true){if(o&&this._ignoreReplayEvents)return false;this._ignoreReplayEvents=false;let i=this.options,r=this._active||[],a=this._getActiveElements(t,r,o,n),s=this._positionChanged(a,t),l=o||!zn(a,r)||s;return l&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(true,o))),l}_getActiveElements(t,o,n,i){let r=this.options;if(t.type==="mouseout")return [];if(!i)return o;let a=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&a.reverse(),a}_positionChanged(t,o){let{caretX:n,caretY:i,options:r}=this,a=tr[r.position].call(this,t,o);return a!==false&&(n!==a.x||i!==a.y)}};ir.positioners=tr;var G0={id:"tooltip",_element:ir,positioners:tr,afterInit(e,t,o){o&&(e.tooltip=new ir({chart:e,options:o}));},beforeUpdate(e,t,o){e.tooltip&&e.tooltip.initialize(o);},reset(e,t,o){e.tooltip&&e.tooltip.initialize(o);},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let o={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",o)===false)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",o);}},afterEvent(e,t){if(e.tooltip){let o=t.replay;e.tooltip.handleEvent(t.event,o,t.inChartArea)&&(t.changed=true);}},defaults:{enabled:true,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:true,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:he,title(e){if(e.length>0){let t=e[0],o=t.chart.data.labels,n=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return o[t.dataIndex]}return ""},afterTitle:he,beforeBody:he,beforeLabel:he,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let o=e.formattedValue;return W(o)||(t+=o),t},labelColor(e){let o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return {borderColor:o.borderColor,backgroundColor:o.backgroundColor,borderWidth:o.borderWidth,borderDash:o.borderDash,borderDashOffset:o.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return {pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:he,afterBody:he,beforeFooter:he,footer:he,afterFooter:he}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:false,callbacks:{_scriptable:false,_indexable:false},animation:{_fallback:false},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};var B4=(e,t,o,n)=>(typeof t=="string"?(o=e.push(t)-1,n.unshift({index:o,label:t})):isNaN(t)&&(o=null),o);function E4(e,t,o,n){let i=e.indexOf(t);if(i===-1)return B4(e,t,o,n);let r=e.lastIndexOf(t);return i!==r?o:i}var F4=(e,t)=>e===null?null:Ct(Math.round(e),0,t),an=class extends rn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[];}init(t){let o=this._addedLabels;if(o.length){let n=this.getLabels();for(let{index:i,label:r}of o)n[i]===r&&n.splice(i,1);this._addedLabels=[];}super.init(t);}parse(t,o){if(W(t))return null;let n=this.getLabels();return o=isFinite(o)&&n[o]===t?o:E4(n,t,U(o,t),this._addedLabels),F4(o,n.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:o}=this.getUserBounds(),{min:n,max:i}=this.getMinMax(true);this.options.bounds==="ticks"&&(t||(n=0),o||(i=this.getLabels().length-1)),this.min=n,this.max=i;}buildTicks(){let t=this.min,o=this.max,n=this.options.offset,i=[],r=this.getLabels();r=t===0&&o===r.length-1?r:r.slice(t,o+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let a=t;a<=o;a++)i.push({value:a});return i}getLabelForValue(t){let o=this.getLabels();return t>=0&&t<o.length?o[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels);}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};an.id="category";an.defaults={ticks:{callback:an.prototype.getLabelForValue}};function R4(e,t){let o=[],{bounds:i,step:r,min:a,max:s,precision:l,count:c,maxTicks:d,maxDigits:u,includeBounds:p}=e,m=r||1,h=d-1,{min:f,max:g}=t,y=!W(a),P=!W(s),T=!W(c),k=(g-f)/(u+1),w=Ya((g-f)/h/m)*m,v,A,M,I;if(w<1e-14&&!y&&!P)return [{value:f},{value:g}];I=Math.ceil(g/w)-Math.floor(f/w),I>h&&(w=Ya(I*w/h/m)*m),W(l)||(v=Math.pow(10,l),w=Math.ceil(w*v)/v),i==="ticks"?(A=Math.floor(f/w)*w,M=Math.ceil(g/w)*w):(A=f,M=g),y&&P&&r&&cd((s-a)/r,w/1e3)?(I=Math.round(Math.min((s-a)/w,d)),w=(s-a)/I,A=a,M=s):T?(A=y?a:A,M=P?s:M,I=c-1,w=(M-A)/I):(I=(M-A)/w,qo(I,Math.round(I),w/1e3)?I=Math.round(I):I=Math.ceil(I));let B=Math.max(Xa(w),Xa(A));v=Math.pow(10,W(l)?B:l),A=Math.round(A*v)/v,M=Math.round(M*v)/v;let L=0;for(y&&(p&&A!==a?(o.push({value:a}),A<a&&L++,qo(Math.round((A+L*w)*v)/v,a,x0(a,k,e))&&L++):A<a&&L++);L<I;++L)o.push({value:Math.round((A+L*w)*v)/v});return P&&p&&M!==s?o.length&&qo(o[o.length-1].value,s,x0(s,k,e))?o[o.length-1].value=s:o.push({value:s}):(!P||M===s)&&o.push({value:M}),o}function x0(e,t,{horizontal:o,minRotation:n}){let i=mt(n),r=(o?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+e).length;return Math.min(t/r,a)}var Xn=class extends rn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0;}parse(t,o){return W(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:o,maxDefined:n}=this.getUserBounds(),{min:i,max:r}=this,a=l=>i=o?i:l,s=l=>r=n?r:l;if(t){let l=re(i),c=re(r);l<0&&c<0?s(0):l>0&&c>0&&a(0);}if(i===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||i<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(r*.05)),s(r+l),t||a(i-l);}this.min=i,this.max=r;}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:o,stepSize:n}=t,i;return n?(i=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),o=o||11),o&&(i=Math.min(o,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,o=t.ticks,n=this.getTickLimit();n=Math.max(2,n);let i={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:o.precision,step:o.stepSize,count:o.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:o.minRotation||0,includeBounds:o.includeBounds!==false},r=this._range||this,a=R4(i,r);return t.bounds==="ticks"&&Za(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){let t=this.ticks,o=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){let i=(n-o)/Math.max(t.length-1,1)/2;o-=i,n+=i;}this._startValue=o,this._endValue=n,this._valueRange=n-o;}getLabelForValue(t){return en(t,this.chart.options.locale,this.options.ticks.format)}},Kn=class extends Xn{determineDataLimits(){let{min:t,max:o}=this.getMinMax(true);this.min=lt(t)?t:0,this.max=lt(o)?o:1,this.handleTickRangeOptions();}computeTickLimit(){let t=this.isHorizontal(),o=t?this.width:this.height,n=mt(this.options.ticks.minRotation),i=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,r.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};Kn.id="linear";Kn.defaults={ticks:{callback:Ls.formatters.numeric}};function b0(e){return e/Math.pow(10,Math.floor(zt(e)))===1}function D4(e,t){let o=Math.floor(zt(t.max)),n=Math.ceil(t.max/Math.pow(10,o)),i=[],r=Ut(e.min,Math.pow(10,Math.floor(zt(t.min)))),a=Math.floor(zt(r)),s=Math.floor(r/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do i.push({value:r,major:b0(r)}),++s,s===10&&(s=1,++a,l=a>=0?1:l),r=Math.round(s*Math.pow(10,a)*l)/l;while(a<o||a===o&&s<n);let c=Ut(e.max,r);return i.push({value:c,major:b0(r)}),i}var Ms=class extends rn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0;}parse(t,o){let n=Xn.prototype.parse.apply(this,[t,o]);if(n===0){this._zero=true;return}return lt(n)&&n>0?n:null}determineDataLimits(){let{min:t,max:o}=this.getMinMax(true);this.min=lt(t)?Math.max(0,t):null,this.max=lt(o)?Math.max(0,o):null,this.options.beginAtZero&&(this._zero=true),this.handleTickRangeOptions();}handleTickRangeOptions(){let{minDefined:t,maxDefined:o}=this.getUserBounds(),n=this.min,i=this.max,r=l=>n=t?n:l,a=l=>i=o?i:l,s=(l,c)=>Math.pow(10,Math.floor(zt(l))+c);n===i&&(n<=0?(r(1),a(10)):(r(s(n,-1)),a(s(i,1)))),n<=0&&r(s(i,-1)),i<=0&&a(s(n,1)),this._zero&&this.min!==this._suggestedMin&&n===s(this.min,0)&&r(s(n,-1)),this.min=n,this.max=i;}buildTicks(){let t=this.options,o={min:this._userMin,max:this._userMax},n=D4(o,this);return t.bounds==="ticks"&&Za(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":en(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=zt(t),this._valueRange=zt(this.max)-zt(t);}getPixelForValue(t){return (t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(zt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let o=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+o*this._valueRange)}};Ms.id="logarithmic";Ms.defaults={ticks:{callback:Ls.formatters.logarithmic,major:{enabled:true}}};function Jd(e){let t=e.ticks;if(t.display&&e.display){let o=ut(t.backdropPadding);return U(t.font&&t.font.size,H.font.size)+o.height}return 0}function N4(e,t,o){return o=Z(o)?o:[o],{w:Cd(e,t.string,o),h:o.length*t.lineHeight}}function C0(e,t,o,n,i){return e===n||e===i?{start:t-o/2,end:t+o/2}:e<n||e>i?{start:t-o,end:t}:{start:t,end:t+o}}function O4(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},o=Object.assign({},t),n=[],i=[],r=e._pointLabels.length,a=e.options.pointLabels,s=a.centerPointLabels?G/r:0;for(let l=0;l<r;l++){let c=a.setContext(e.getPointLabelContext(l));i[l]=c.padding;let d=e.getPointPosition(l,e.drawingArea+i[l],s),u=it(c.font),p=N4(e.ctx,u,e._pointLabels[l]);n[l]=p;let m=Bt(e.getIndexAngle(l)+s),h=Math.round(Qo(m)),f=C0(h,d.x,p.w,0,180),g=C0(h,d.y,p.h,90,270);U4(o,t,m,f,g);}e.setCenterPoint(t.l-o.l,o.r-t.r,t.t-o.t,o.b-t.b),e._pointLabelItems=z4(e,n,i);}function U4(e,t,o,n,i){let r=Math.abs(Math.sin(o)),a=Math.abs(Math.cos(o)),s=0,l=0;n.start<t.l?(s=(t.l-n.start)/r,e.l=Math.min(e.l,t.l-s)):n.end>t.r&&(s=(n.end-t.r)/r,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(l=(t.t-i.start)/a,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/a,e.b=Math.max(e.b,t.b+l));}function z4(e,t,o){let n=[],i=e._pointLabels.length,r=e.options,a=Jd(r)/2,s=e.drawingArea,l=r.pointLabels.centerPointLabels?G/i:0;for(let c=0;c<i;c++){let d=e.getPointPosition(c,s+a+o[c],l),u=Math.round(Qo(Bt(d.angle+et))),p=t[c],m=H4(d.y,p.h,u),h=$4(u),f=V4(d.x,p.w,h);n.push({x:d.x,y:m,textAlign:h,left:f,top:m,right:f+p.w,bottom:m+p.h});}return n}function $4(e){return e===0||e===180?"center":e<180?"left":"right"}function V4(e,t,o){return o==="right"?e-=t:o==="center"&&(e-=t/2),e}function H4(e,t,o){return o===90||o===270?e-=t/2:(o>270||o<90)&&(e-=t),e}function W4(e,t){let{ctx:o,options:{pointLabels:n}}=e;for(let i=t-1;i>=0;i--){let r=n.setContext(e.getPointLabelContext(i)),a=it(r.font),{x:s,y:l,textAlign:c,left:d,top:u,right:p,bottom:m}=e._pointLabelItems[i],{backdropColor:h}=r;if(!W(h)){let f=fe(r.borderRadius),g=ut(r.backdropPadding);o.fillStyle=h;let y=d-g.left,P=u-g.top,T=p-d+g.width,k=m-u+g.height;Object.values(f).some(w=>w!==0)?(o.beginPath(),We(o,{x:y,y:P,w:T,h:k,radius:f}),o.fill()):o.fillRect(y,P,T,k);}He(o,e._pointLabels[i],s,l+a.lineHeight/2,a,{color:r.color,textAlign:c,textBaseline:"middle"});}}function j0(e,t,o,n){let{ctx:i}=e;if(o)i.arc(e.xCenter,e.yCenter,t,0,Q);else {let r=e.getPointPosition(0,t);i.moveTo(r.x,r.y);for(let a=1;a<n;a++)r=e.getPointPosition(a,t),i.lineTo(r.x,r.y);}}function G4(e,t,o,n){let i=e.ctx,r=t.circular,{color:a,lineWidth:s}=t;!r&&!n||!a||!s||o<0||(i.save(),i.strokeStyle=a,i.lineWidth=s,i.setLineDash(t.borderDash),i.lineDashOffset=t.borderDashOffset,i.beginPath(),j0(e,o,r,n),i.closePath(),i.stroke(),i.restore());}function j4(e,t,o){return Me(e,{label:o,index:t,type:"pointLabel"})}var qn=class extends Xn{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[];}setDimensions(){let t=this._padding=ut(Jd(this.options)/2),o=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+o/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(o,n)/2);}determineDataLimits(){let{min:t,max:o}=this.getMinMax(false);this.min=lt(t)&&!isNaN(t)?t:0,this.max=lt(o)&&!isNaN(o)?o:0,this.handleTickRangeOptions();}computeTickLimit(){return Math.ceil(this.drawingArea/Jd(this.options))}generateTickLabels(t){Xn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((o,n)=>{let i=X(this.options.pointLabels.callback,[o,n],this);return i||i===0?i:""}).filter((o,n)=>this.chart.getDataVisibility(n));}fit(){let t=this.options;t.display&&t.pointLabels.display?O4(this):this.setCenterPoint(0,0,0,0);}setCenterPoint(t,o,n,i){this.xCenter+=Math.floor((t-o)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,o,n,i));}getIndexAngle(t){let o=Q/(this._pointLabels.length||1),n=this.options.startAngle||0;return Bt(t*o+mt(n))}getDistanceFromCenterForValue(t){if(W(t))return NaN;let o=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*o:(t-this.min)*o}getValueForDistanceFromCenter(t){if(W(t))return NaN;let o=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-o:this.min+o}getPointLabelContext(t){let o=this._pointLabels||[];if(t>=0&&t<o.length){let n=o[t];return j4(this.getContext(),t,n)}}getPointPosition(t,o,n=0){let i=this.getIndexAngle(t)-et+n;return {x:Math.cos(i)*o+this.xCenter,y:Math.sin(i)*o+this.yCenter,angle:i}}getPointPositionForValue(t,o){return this.getPointPosition(t,this.getDistanceFromCenterForValue(o))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:o,top:n,right:i,bottom:r}=this._pointLabelItems[t];return {left:o,top:n,right:i,bottom:r}}drawBackground(){let{backgroundColor:t,grid:{circular:o}}=this.options;if(t){let n=this.ctx;n.save(),n.beginPath(),j0(this,this.getDistanceFromCenterForValue(this._endValue),o,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore();}}drawGrid(){let t=this.ctx,o=this.options,{angleLines:n,grid:i}=o,r=this._pointLabels.length,a,s,l;if(o.pointLabels.display&&W4(this,r),i.display&&this.ticks.forEach((c,d)=>{if(d!==0){s=this.getDistanceFromCenterForValue(c.value);let u=i.setContext(this.getContext(d-1));G4(this,u,s,r);}}),n.display){for(t.save(),a=r-1;a>=0;a--){let c=n.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:u}=c;!u||!d||(t.lineWidth=u,t.strokeStyle=d,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,s=this.getDistanceFromCenterForValue(o.ticks.reverse?this.min:this.max),l=this.getPointPosition(a,s),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke());}t.restore();}}drawBorder(){}drawLabels(){let t=this.ctx,o=this.options,n=o.ticks;if(!n.display)return;let i=this.getIndexAngle(0),r,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,l)=>{if(l===0&&!o.reverse)return;let c=n.setContext(this.getContext(l)),d=it(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,a=t.measureText(s.label).width,t.fillStyle=c.backdropColor;let u=ut(c.backdropPadding);t.fillRect(-a/2-u.left,-r-d.size/2-u.top,a+u.width,d.size+u.height);}He(t,s.label,0,-r,d,{color:c.color});}),t.restore();}drawTitle(){}};qn.id="radialLinear";qn.defaults={display:true,animate:true,position:"chartArea",angleLines:{display:true,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:false},startAngle:0,ticks:{showLabelBackdrop:true,callback:Ls.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:true,font:{size:10},callback(e){return e},padding:5,centerPointLabels:false}};qn.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};qn.descriptors={angleLines:{_fallback:"grid"}};var Bs={millisecond:{common:true,size:1,steps:1e3},second:{common:true,size:1e3,steps:60},minute:{common:true,size:6e4,steps:60},hour:{common:true,size:36e5,steps:24},day:{common:true,size:864e5,steps:30},week:{common:false,size:6048e5,steps:4},month:{common:true,size:2628e6,steps:12},quarter:{common:false,size:7884e6,steps:4},year:{common:true,size:3154e7}},$t=Object.keys(Bs);function Y4(e,t){return e-t}function P0(e,t){if(W(t))return null;let o=e._adapter,{parser:n,round:i,isoWeekday:r}=e._parseOpts,a=t;return typeof n=="function"&&(a=n(a)),lt(a)||(a=typeof n=="string"?o.parse(a,n):o.parse(a)),a===null?null:(i&&(a=i==="week"&&(Kt(r)||r===true)?o.startOf(a,"isoWeek",r):o.startOf(a,i)),+a)}function S0(e,t,o,n){let i=$t.length;for(let r=$t.indexOf(e);r<i-1;++r){let a=Bs[$t[r]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((o-t)/(s*a.size))<=n)return $t[r]}return $t[i-1]}function Z4(e,t,o,n,i){for(let r=$t.length-1;r>=$t.indexOf(o);r--){let a=$t[r];if(Bs[a].common&&e._adapter.diff(i,n,a)>=t-1)return a}return $t[o?$t.indexOf(o):0]}function X4(e){for(let t=$t.indexOf(e)+1,o=$t.length;t<o;++t)if(Bs[$t[t]].common)return $t[t]}function T0(e,t,o){if(!o)e[t]=true;else if(o.length){let{lo:n,hi:i}=$i(o,t),r=o[n]>=t?o[n]:o[i];e[r]=true;}}function K4(e,t,o,n){let i=e._adapter,r=+i.startOf(t[0].value,n),a=t[t.length-1].value,s,l;for(s=r;s<=a;s=+i.add(s,1,n))l=o[s],l>=0&&(t[l].major=true);return t}function k0(e,t,o){let n=[],i={},r=t.length,a,s;for(a=0;a<r;++a)s=t[a],i[s]=a,n.push({value:s,major:false});return r===0||!o?n:K4(e,n,i,o)}var Qn=class extends rn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=false,this._parseOpts=void 0;}init(t,o){let n=t.time||(t.time={}),i=this._adapter=new q6._date(t.adapters.date);i.init(o),Ko(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=o.normalized;}parse(t,o){return t===void 0?null:P0(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]};}determineDataLimits(){let t=this.options,o=this._adapter,n=t.time.unit||"day",{min:i,max:r,minDefined:a,maxDefined:s}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!s&&!isNaN(c.max)&&(r=Math.max(r,c.max));}(!a||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(false))),i=lt(i)&&!isNaN(i)?i:+o.startOf(Date.now(),n),r=lt(r)&&!isNaN(r)?r:+o.endOf(Date.now(),n)+1,this.min=Math.min(i,r-1),this.max=Math.max(i+1,r);}_getLabelBounds(){let t=this.getLabelTimestamps(),o=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(o=t[0],n=t[t.length-1]),{min:o,max:n}}buildTicks(){let t=this.options,o=t.time,n=t.ticks,i=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);let r=this.min,a=this.max,s=pd(i,r,a);return this._unit=o.unit||(n.autoSkip?S0(o.minUnit,this.min,this.max,this._getLabelCapacity(r)):Z4(this,s.length,o.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:X4(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),k0(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value));}initOffsets(t){let o=0,n=0,i,r;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?o=1-i:o=(this.getDecimalForValue(t[1])-i)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?n=r:n=(r-this.getDecimalForValue(t[t.length-2]))/2);let a=t.length<3?.5:.25;o=Ct(o,0,a),n=Ct(n,0,a),this._offsets={start:o,end:n,factor:1/(o+1+n)};}_generate(){let t=this._adapter,o=this.min,n=this.max,i=this.options,r=i.time,a=r.unit||S0(r.minUnit,o,n,this._getLabelCapacity(o)),s=U(r.stepSize,1),l=a==="week"?r.isoWeekday:false,c=Kt(l)||l===true,d={},u=o,p,m;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":a),t.diff(n,o,a)>1e5*s)throw new Error(o+" and "+n+" are too far apart with stepSize of "+s+" "+a);let h=i.ticks.source==="data"&&this.getDataTimestamps();for(p=u,m=0;p<n;p=+t.add(p,s,a),m++)T0(d,p,h);return (p===n||i.bounds==="ticks"||m===1)&&T0(d,p,h),Object.keys(d).sort((f,g)=>f-g).map(f=>+f)}getLabelForValue(t){let o=this._adapter,n=this.options.time;return n.tooltipFormat?o.format(t,n.tooltipFormat):o.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,o,n,i){let r=this.options,a=r.time.displayFormats,s=this._unit,l=this._majorUnit,c=s&&a[s],d=l&&a[l],u=n[o],p=l&&d&&u&&u.major,m=this._adapter.format(t,i||(p?d:c)),h=r.ticks.callback;return h?X(h,[m,o,n],this):m}generateTickLabels(t){let o,n,i;for(o=0,n=t.length;o<n;++o)i=t[o],i.label=this._tickFormatFunction(i.value,o,t);}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let o=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((o.start+n)*o.factor)}getValueForPixel(t){let o=this._offsets,n=this.getDecimalForPixel(t)/o.factor-o.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){let o=this.options.ticks,n=this.ctx.measureText(t).width,i=mt(this.isHorizontal()?o.maxRotation:o.minRotation),r=Math.cos(i),a=Math.sin(i),s=this._resolveTickFontOptions(0).size;return {w:n*r+s*a,h:n*a+s*r}}_getLabelCapacity(t){let o=this.options.time,n=o.displayFormats,i=n[o.unit]||n.millisecond,r=this._tickFormatFunction(t,0,k0(this,[t],this._majorUnit),i),a=this._getLabelSize(r),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],o,n;if(t.length)return t;let i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(o=0,n=i.length;o<n;++o)t=t.concat(i[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],o,n;if(t.length)return t;let i=this.getLabels();for(o=0,n=i.length;o<n;++o)t.push(P0(this,i[o]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Qa(t.sort(Y4))}};Qn.id="time";Qn.defaults={bounds:"data",adapters:{},time:{parser:false,unit:false,round:false,isoWeekday:false,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:false}}};function Ps(e,t,o){let n=0,i=e.length-1,r,a,s,l;o?(t>=e[n].pos&&t<=e[i].pos&&({lo:n,hi:i}=ze(e,"pos",t)),{pos:r,time:s}=e[n],{pos:a,time:l}=e[i]):(t>=e[n].time&&t<=e[i].time&&({lo:n,hi:i}=ze(e,"time",t)),{time:r,pos:s}=e[n],{time:a,pos:l}=e[i]);let c=a-r;return c?s+(l-s)*(t-r)/c:s}var Is=class extends Qn{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0;}initOffsets(){let t=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(t);this._minPos=Ps(o,this.min),this._tableRange=Ps(o,this.max)-this._minPos,super.initOffsets(t);}buildLookupTable(t){let{min:o,max:n}=this,i=[],r=[],a,s,l,c,d;for(a=0,s=t.length;a<s;++a)c=t[a],c>=o&&c<=n&&i.push(c);if(i.length<2)return [{time:o,pos:0},{time:n,pos:1}];for(a=0,s=i.length;a<s;++a)d=i[a+1],l=i[a-1],c=i[a],Math.round((d+l)/2)!==c&&r.push({time:c,pos:a/(s-1)});return r}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let o=this.getDataTimestamps(),n=this.getLabelTimestamps();return o.length&&n.length?t=this.normalize(o.concat(n)):t=o.length?o:n,t=this._cache.all=t,t}getDecimalForValue(t){return (Ps(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let o=this._offsets,n=this.getDecimalForPixel(t)/o.factor-o.end;return Ps(this._table,n*this._tableRange+this._minPos,true)}};Is.id="timeseries";Is.defaults=Qn.defaults;var Y0=(function(){if(typeof window!="undefined"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return (e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1})(),sr={toTextLines:function(e){var t=[],o;for(e=[].concat(e);e.length;)o=e.pop(),typeof o=="string"?t.unshift.apply(t,o.split(`
1018
- `)):Array.isArray(o)?e.push.apply(e,o):W(e)||t.unshift(""+o);return t},textSize:function(e,t,o){var n=[].concat(t),i=n.length,r=e.font,a=0,s;for(e.font=o.string,s=0;s<i;++s)a=Math.max(e.measureText(n[s]).width,a);return e.font=r,{height:i*o.lineHeight,width:a}},bound:function(e,t,o){return Math.max(e,Math.min(t,o))},arrayDiff:function(e,t){var o=e.slice(),n=[],i,r,a,s;for(i=0,a=t.length;i<a;++i)s=t[i],r=o.indexOf(s),r===-1?n.push([s,1]):o.splice(r,1);for(i=0,a=o.length;i<a;++i)n.push([o[i],-1]);return n},rasterize:function(e){return Math.round(e*Y0)/Y0}};function eu(e,t){var o=t.x,n=t.y;if(o===null)return {x:0,y:-1};if(n===null)return {x:1,y:0};var i=e.x-o,r=e.y-n,a=Math.sqrt(i*i+r*r);return {x:a?i/a:0,y:a?r/a:-1}}function q4(e,t,o,n,i){switch(i){case "center":o=n=0;break;case "bottom":o=0,n=1;break;case "right":o=1,n=0;break;case "left":o=-1,n=0;break;case "top":o=0,n=-1;break;case "start":o=-o,n=-n;break;case "end":break;default:i*=Math.PI/180,o=Math.cos(i),n=Math.sin(i);break}return {x:e,y:t,vx:o,vy:n}}var Q4=0,X0=1,K0=2,q0=4,Q0=8;function Es(e,t,o){var n=Q4;return e<o.left?n|=X0:e>o.right&&(n|=K0),t<o.top?n|=Q0:t>o.bottom&&(n|=q0),n}function J4(e,t){for(var o=e.x0,n=e.y0,i=e.x1,r=e.y1,a=Es(o,n,t),s=Es(i,r,t),l,c,d;!(!(a|s)||a&s);)l=a||s,l&Q0?(c=o+(i-o)*(t.top-n)/(r-n),d=t.top):l&q0?(c=o+(i-o)*(t.bottom-n)/(r-n),d=t.bottom):l&K0?(d=n+(r-n)*(t.right-o)/(i-o),c=t.right):l&X0&&(d=n+(r-n)*(t.left-o)/(i-o),c=t.left),l===a?(o=c,n=d,a=Es(o,n,t)):(i=c,r=d,s=Es(i,r,t));return {x0:o,x1:i,y0:n,y1:r}}function Fs(e,t){var o=t.anchor,n=e,i,r;return t.clamp&&(n=J4(n,t.area)),o==="start"?(i=n.x0,r=n.y0):o==="end"?(i=n.x1,r=n.y1):(i=(n.x0+n.x1)/2,r=(n.y0+n.y1)/2),q4(i,r,e.vx,e.vy,t.align)}var Rs={arc:function(e,t){var o=(e.startAngle+e.endAngle)/2,n=Math.cos(o),i=Math.sin(o),r=e.innerRadius,a=e.outerRadius;return Fs({x0:e.x+n*r,y0:e.y+i*r,x1:e.x+n*a,y1:e.y+i*a,vx:n,vy:i},t)},point:function(e,t){var o=eu(e,t.origin),n=o.x*e.options.radius,i=o.y*e.options.radius;return Fs({x0:e.x-n,y0:e.y-i,x1:e.x+n,y1:e.y+i,vx:o.x,vy:o.y},t)},bar:function(e,t){var o=eu(e,t.origin),n=e.x,i=e.y,r=0,a=0;return e.horizontal?(n=Math.min(e.x,e.base),r=Math.abs(e.base-e.x)):(i=Math.min(e.y,e.base),a=Math.abs(e.base-e.y)),Fs({x0:n,y0:i+a,x1:n+r,y1:i,vx:o.x,vy:o.y},t)},fallback:function(e,t){var o=eu(e,t.origin);return Fs({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:o.x,vy:o.y},t)}},qe=sr.rasterize;function t8(e){var t=e.borderWidth||0,o=e.padding,n=e.size.height,i=e.size.width,r=-i/2,a=-n/2;return {frame:{x:r-o.left-t,y:a-o.top-t,w:i+o.width+t*2,h:n+o.height+t*2},text:{x:r,y:a,w:i,h:n}}}function e8(e,t){var o=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!o)return null;if(o.xCenter!==void 0&&o.yCenter!==void 0)return {x:o.xCenter,y:o.yCenter};var n=o.getBasePixel();return e.horizontal?{x:n,y:null}:{x:null,y:n}}function o8(e){return e instanceof Ze?Rs.arc:e instanceof Xe?Rs.point:e instanceof Ke?Rs.bar:Rs.fallback}function n8(e,t,o,n,i,r){var a=Math.PI/2;if(r){var s=Math.min(r,i/2,n/2),l=t+s,c=o+s,d=t+n-s,u=o+i-s;e.moveTo(t,c),l<d&&c<u?(e.arc(l,c,s,-Math.PI,-a),e.arc(d,c,s,-a,0),e.arc(d,u,s,0,a),e.arc(l,u,s,a,Math.PI)):l<d?(e.moveTo(l,o),e.arc(d,c,s,-a,a),e.arc(l,c,s,a,Math.PI+a)):c<u?(e.arc(l,c,s,-Math.PI,0),e.arc(l,u,s,0,Math.PI)):e.arc(l,c,s,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,o);}else e.rect(t,o,n,i);}function i8(e,t,o){var n=o.backgroundColor,i=o.borderColor,r=o.borderWidth;!n&&(!i||!r)||(e.beginPath(),n8(e,qe(t.x)+r/2,qe(t.y)+r/2,qe(t.w)-r,qe(t.h)-r,o.borderRadius),e.closePath(),n&&(e.fillStyle=n,e.fill()),i&&r&&(e.strokeStyle=i,e.lineWidth=r,e.lineJoin="miter",e.stroke()));}function r8(e,t,o){var n=o.lineHeight,i=e.w,r=e.x,a=e.y+n/2;return t==="center"?r+=i/2:(t==="end"||t==="right")&&(r+=i),{h:n,w:i,x:r,y:a}}function a8(e,t,o){var n=e.shadowBlur,i=o.stroked,r=qe(o.x),a=qe(o.y),s=qe(o.w);i&&e.strokeText(t,r,a,s),o.filled&&(n&&i&&(e.shadowBlur=0),e.fillText(t,r,a,s),n&&i&&(e.shadowBlur=n));}function s8(e,t,o,n){var i=n.textAlign,r=n.color,a=!!r,s=n.font,l=t.length,c=n.textStrokeColor,d=n.textStrokeWidth,u=c&&d,p;if(!(!l||!a&&!u))for(o=r8(o,i,s),e.font=s.string,e.textAlign=i,e.textBaseline="middle",e.shadowBlur=n.textShadowBlur,e.shadowColor=n.textShadowColor,a&&(e.fillStyle=r),u&&(e.lineJoin="round",e.lineWidth=d,e.strokeStyle=c),p=0,l=t.length;p<l;++p)a8(e,t[p],{stroked:u,filled:a,w:o.w,x:o.x,y:o.y+o.h*p});}var J0=function(e,t,o,n){var i=this;i._config=e,i._index=n,i._model=null,i._rects=null,i._ctx=t,i._el=o;};Xt(J0.prototype,{_modelize:function(e,t,o,n){var i=this,r=i._index,a=it(rt([o.font,{}],n,r)),s=rt([o.color,H.color],n,r);return {align:rt([o.align,"center"],n,r),anchor:rt([o.anchor,"center"],n,r),area:n.chart.chartArea,backgroundColor:rt([o.backgroundColor,null],n,r),borderColor:rt([o.borderColor,null],n,r),borderRadius:rt([o.borderRadius,0],n,r),borderWidth:rt([o.borderWidth,0],n,r),clamp:rt([o.clamp,false],n,r),clip:rt([o.clip,false],n,r),color:s,display:e,font:a,lines:t,offset:rt([o.offset,4],n,r),opacity:rt([o.opacity,1],n,r),origin:e8(i._el,n),padding:ut(rt([o.padding,4],n,r)),positioner:o8(i._el),rotation:rt([o.rotation,0],n,r)*(Math.PI/180),size:sr.textSize(i._ctx,t,a),textAlign:rt([o.textAlign,"start"],n,r),textShadowBlur:rt([o.textShadowBlur,0],n,r),textShadowColor:rt([o.textShadowColor,s],n,r),textStrokeColor:rt([o.textStrokeColor,s],n,r),textStrokeWidth:rt([o.textStrokeWidth,0],n,r)}},update:function(e){var t=this,o=null,n=null,i=t._index,r=t._config,a,s,l,c=rt([r.display,true],e,i);c&&(a=e.dataset.data[i],s=U(X(r.formatter,[a,e]),a),l=W(s)?[]:sr.toTextLines(s),l.length&&(o=t._modelize(c,l,r,e),n=t8(o))),t._model=o,t._rects=n;},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var o=this,n=e.ctx,i=o._model,r=o._rects,a;this.visible()&&(n.save(),i.clip&&(a=i.area,n.beginPath(),n.rect(a.left,a.top,a.right-a.left,a.bottom-a.top),n.clip()),n.globalAlpha=sr.bound(0,i.opacity,1),n.translate(qe(t.x),qe(t.y)),n.rotate(i.rotation),i8(n,r.frame,i),s8(n,i.lines,r.text,i),n.restore());}});var l8=Number.MIN_SAFE_INTEGER||-9007199254740991,c8=Number.MAX_SAFE_INTEGER||9007199254740991;function ar(e,t,o){var n=Math.cos(o),i=Math.sin(o),r=t.x,a=t.y;return {x:r+n*(e.x-r)-i*(e.y-a),y:a+i*(e.x-r)+n*(e.y-a)}}function Z0(e,t){var o=c8,n=l8,i=t.origin,r,a,s,l,c;for(r=0;r<e.length;++r)a=e[r],s=a.x-i.x,l=a.y-i.y,c=t.vx*s+t.vy*l,o=Math.min(o,c),n=Math.max(n,c);return {min:o,max:n}}function Ds(e,t){var o=t.x-e.x,n=t.y-e.y,i=Math.sqrt(o*o+n*n);return {vx:(t.x-e.x)/i,vy:(t.y-e.y)/i,origin:e,ln:i}}var tx=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0};};Xt(tx.prototype,{center:function(){var e=this._rect;return {x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,o){this._rotation=o,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h};},contains:function(e){var t=this,o=1,n=t._rect;return e=ar(e,t.center(),-t._rotation),!(e.x<n.x-o||e.y<n.y-o||e.x>n.x+n.w+o*2||e.y>n.y+n.h+o*2)},intersects:function(e){var t=this._points(),o=e._points(),n=[Ds(t[0],t[1]),Ds(t[0],t[3])],i,r,a;for(this._rotation!==e._rotation&&n.push(Ds(o[0],o[1]),Ds(o[0],o[3])),i=0;i<n.length;++i)if(r=Z0(t,n[i]),a=Z0(o,n[i]),r.max<a.min||a.max<r.min)return false;return true},_points:function(){var e=this,t=e._rect,o=e._rotation,n=e.center();return [ar({x:t.x,y:t.y},n,o),ar({x:t.x+t.w,y:t.y},n,o),ar({x:t.x+t.w,y:t.y+t.h},n,o),ar({x:t.x,y:t.y+t.h},n,o)]}});function ex(e,t,o){var n=t.positioner(e,t),i=n.vx,r=n.vy;if(!i&&!r)return {x:n.x,y:n.y};var a=o.w,s=o.h,l=t.rotation,c=Math.abs(a/2*Math.cos(l))+Math.abs(s/2*Math.sin(l)),d=Math.abs(a/2*Math.sin(l))+Math.abs(s/2*Math.cos(l)),u=1/Math.max(Math.abs(i),Math.abs(r));return c*=i*u,d*=r*u,c+=t.offset*i,d+=t.offset*r,{x:n.x+c,y:n.y+d}}function d8(e,t){var o,n,i,r;for(o=e.length-1;o>=0;--o)for(i=e[o].$layout,n=o-1;n>=0&&i._visible;--n)r=e[n].$layout,r._visible&&i._box.intersects(r._box)&&t(i,r);return e}function u8(e){var t,o,n,i,r,a,s;for(t=0,o=e.length;t<o;++t)n=e[t],i=n.$layout,i._visible&&(s=new Proxy(n._el,{get:(l,c)=>l.getProps([c],true)[c]}),r=n.geometry(),a=ex(s,n.model(),r),i._box.update(a,r,n.rotation()));return d8(e,function(l,c){var d=l._hidable,u=c._hidable;d&&u||u?c._visible=false:d&&(l._visible=false);})}var lr={prepare:function(e){var t=[],o,n,i,r,a;for(o=0,i=e.length;o<i;++o)for(n=0,r=e[o].length;n<r;++n)a=e[o][n],t.push(a),a.$layout={_box:new tx,_hidable:false,_visible:true,_set:o,_idx:a._index};return t.sort(function(s,l){var c=s.$layout,d=l.$layout;return c._idx===d._idx?d._set-c._set:d._idx-c._idx}),this.update(t),t},update:function(e){var t=false,o,n,i,r,a;for(o=0,n=e.length;o<n;++o)i=e[o],r=i.model(),a=i.$layout,a._hidable=r&&r.display==="auto",a._visible=i.visible(),t|=a._hidable;t&&u8(e);},lookup:function(e,t){var o,n;for(o=e.length-1;o>=0;--o)if(n=e[o].$layout,n&&n._visible&&n._box.contains(t))return e[o];return null},draw:function(e,t){var o,n,i,r,a,s;for(o=0,n=t.length;o<n;++o)i=t[o],r=i.$layout,r._visible&&(a=i.geometry(),s=ex(i._el,i.model(),a),r._box.update(s,a,i.rotation()),i.draw(e,s));}},p8=function(e){if(W(e))return null;var t=e,o,n,i;if(z(e))if(!W(e.label))t=e.label;else if(!W(e.r))t=e.r;else for(t="",o=Object.keys(e),i=0,n=o.length;i<n;++i)t+=(i!==0?", ":"")+o[i]+": "+e[o[i]];return ""+t},h8={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:false,clip:false,color:void 0,display:true,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:p8,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},Vt="$datalabels",ox="$default";function m8(e,t){var o=e.datalabels,n={},i=[],r,a;return o===false?null:(o===true&&(o={}),t=Xt({},[t,o]),r=t.labels||{},a=Object.keys(r),delete t.labels,a.length?a.forEach(function(s){r[s]&&i.push(Xt({},[t,r[s],{_key:s}]));}):i.push(t),n=i.reduce(function(s,l){return K(l.listeners||{},function(c,d){s[d]=s[d]||{},s[d][l._key||ox]=c;}),delete l.listeners,s},{}),{labels:i,listeners:n})}function ou(e,t,o,n){if(t){var i=o.$context,r=o.$groups,a;t[r._set]&&(a=t[r._set][r._key],a&&X(a,[i,n])===true&&(e[Vt]._dirty=true,o.update(i)));}}function f8(e,t,o,n,i){var r,a;!o&&!n||(o?n?o!==n&&(a=r=true):a=true:r=true,a&&ou(e,t.leave,o,i),r&&ou(e,t.enter,n,i));}function g8(e,t){var o=e[Vt],n=o._listeners,i,r;if(!(!n.enter&&!n.leave)){if(t.type==="mousemove")r=lr.lookup(o._labels,t);else if(t.type!=="mouseout")return;i=o._hovered,o._hovered=r,f8(e,n,i,r,t);}}function y8(e,t){var o=e[Vt],n=o._listeners.click,i=n&&lr.lookup(o._labels,t);i&&ou(e,n,i,t);}var nx={id:"datalabels",defaults:h8,beforeInit:function(e){e[Vt]={_actives:[]};},beforeUpdate:function(e){var t=e[Vt];t._listened=false,t._listeners={},t._datasets=[],t._labels=[];},afterDatasetUpdate:function(e,t,o){var n=t.index,i=e[Vt],r=i._datasets[n]=[],a=e.isDatasetVisible(n),s=e.data.datasets[n],l=m8(s,o),c=t.meta.data||[],d=e.ctx,u,p,m,h,f,g,y,P;for(d.save(),u=0,m=c.length;u<m;++u)if(y=c[u],y[Vt]=[],a&&y&&e.getDataVisibility(u)&&!y.skip)for(p=0,h=l.labels.length;p<h;++p)f=l.labels[p],g=f._key,P=new J0(f,d,y,u),P.$groups={_set:n,_key:g||ox},P.$context={active:false,chart:e,dataIndex:u,dataset:s,datasetIndex:n},P.update(P.$context),y[Vt].push(P),r.push(P);d.restore(),Xt(i._listeners,l.listeners,{merger:function(T,k,w){k[T]=k[T]||{},k[T][t.index]=w[T],i._listened=true;}});},afterUpdate:function(e){e[Vt]._labels=lr.prepare(e[Vt]._datasets);},afterDatasetsDraw:function(e){lr.draw(e,e[Vt]._labels);},beforeEvent:function(e,t){if(e[Vt]._listened){var o=t.event;switch(o.type){case "mousemove":case "mouseout":g8(e,o);break;case "click":y8(e,o);break}}},afterEvent:function(e){var t=e[Vt],o=t._actives,n=t._actives=e.getActiveElements(),i=sr.arrayDiff(o,n),r,a,s,l,c,d,u;for(r=0,a=i.length;r<a;++r)if(c=i[r],c[1])for(u=c[0].element[Vt]||[],s=0,l=u.length;s<l;++s)d=u[s],d.$context.active=c[1]===1,d.update(d.$context);(t._dirty||i.length)&&(lr.update(t._labels),e.render()),delete t._dirty;}};var ix={modes:{point(e,t){return Os(e,t,{intersect:true})},nearest(e,t,o){return C8(e,t,o)},x(e,t,o){return Os(e,t,{intersect:o.intersect,axis:"x"})},y(e,t,o){return Os(e,t,{intersect:o.intersect,axis:"y"})}}};function uu(e,t,o){return (ix.modes[o.mode]||ix.modes.nearest)(e,t,o)}function x8(e,t,o){return o!=="x"&&o!=="y"?e.inRange(t.x,t.y,"x",true)||e.inRange(t.x,t.y,"y",true):e.inRange(t.x,t.y,o,true)}function b8(e,t,o){return o==="x"?{x:e.x,y:t.y}:o==="y"?{x:t.x,y:e.y}:t}function Os(e,t,o){return e.visibleElements.filter(n=>o.intersect?n.inRange(t.x,t.y):x8(n,t,o.axis))}function C8(e,t,o){let n=Number.POSITIVE_INFINITY;return Os(e,t,o).reduce((i,r)=>{let a=r.getCenterPoint(),s=b8(t,a,o.axis),l=$e(t,s);return l<n?(i=[r],n=l):l===n&&i.push(r),i},[]).sort((i,r)=>i._index-r._index).slice(0,1)}var P8=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,sn=.001,zs=(e,t,o)=>Math.min(o,Math.max(t,e));function S8(e,t,o){for(let n of Object.keys(e))e[n]=zs(e[n],t,o);return e}function T8(e,t,o,n){if(!e||!t||o<=0)return false;let i=n/2;return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(o+i,2)}function Tx(e,{x:t,y:o,x2:n,y2:i},r,a){let s=a/2,l=e.x>=t-s-sn&&e.x<=n+s+sn,c=e.y>=o-s-sn&&e.y<=i+s+sn;return r==="x"?l:(r==="y"||l)&&c}function oi(e,t){let{centerX:o,centerY:n}=e.getProps(["centerX","centerY"],t);return {x:o,y:n}}function k8(e,t,o,n=true){let i=o.split("."),r=0;for(let a of t.split(".")){let s=i[r++];if(parseInt(a,10)<parseInt(s,10))break;if(P8(s,a)){if(n)throw new Error(`${e} v${o} is not supported. v${t} or newer is required.`);return false}}return true}var kx=e=>typeof e=="string"&&e.endsWith("%"),wx=e=>parseFloat(e)/100,vx=e=>zs(wx(e),0,1);function pu(e,t){return t==="start"?0:t==="end"?e:kx(t)?vx(t)*e:e/2}function vo(e,t,o=true){return typeof t=="number"?t:kx(t)?(o?vx(t):wx(t))*e:e}function w8(e,t){let{x:o,width:n}=e,i=t.textAlign;return i==="center"?o+n/2:i==="end"||i==="right"?o+n:o}function hu(e,t="center"){return z(e)?{x:U(e.x,t),y:U(e.y,t)}:(e=U(e,t),{x:e,y:e})}function _x(e){return e&&(st(e.xValue)||st(e.yValue))}function dr(e,t,o,n=false){let i=o.init;if(i){if(i===true)return Mx(t,n)}else return;return v8(t,n,X(i,[{chart:e,properties:t,options:o}]))}function Ax(e,t,o){let n=false;return t.forEach(i=>{Tt(e[i])?(n=true,o[i]=e[i]):st(o[i])&&delete o[i];}),n}function Mx({centerX:e,centerY:t},o){return o?{centerX:e,centerY:t,radius:0,width:0,height:0}:{x:e,y:t,x2:e,y2:t,width:0,height:0}}function v8(e,t,o){if(o===true)return Mx(e,t);if(z(o))return o}var nu=new Map,_8=e=>isNaN(e)||e<=0,A8=e=>e.reduce(function(t,o){return t+=o.string,t},"");function $s(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function mu(e,{x:t,y:o},n){n&&(e.translate(t,o),e.rotate(mt(n)),e.translate(-t,-o));}function _o(e,t){if(t&&t.borderWidth)return e.lineCap=t.borderCapStyle,e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,e.lineJoin=t.borderJoinStyle,e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,true}function ni(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY;}function fu(e,t){let o=t.content;if($s(o))return {width:vo(o.width,t.width),height:vo(o.height,t.height)};let n=t.font,i=Z(n)?n.map(l=>it(l)):[it(n)],r=t.textStrokeWidth,a=Z(o)?o:[o],s=a.join()+A8(i)+r+(e._measureText?"-spriting":"");return nu.has(s)||nu.set(s,E8(e,a,i,r)),nu.get(s)}function Ix(e,t,o){let{x:n,y:i,width:r,height:a}=t;e.save(),ni(e,o);let s=_o(e,o);e.fillStyle=o.backgroundColor,e.beginPath(),We(e,{x:n,y:i,w:r,h:a,radius:S8(fe(o.borderRadius),0,Math.min(r,a)/2)}),e.closePath(),e.fill(),s&&(e.shadowColor=o.borderShadowColor,e.stroke()),e.restore();}function M8(e,t,o){let n=o.content;if($s(n)){e.save(),e.globalAlpha=D8(o.opacity,n.style.opacity),e.drawImage(n,t.x,t.y,t.width,t.height),e.restore();return}let i=Z(n)?n:[n],r=o.font,a=Z(r)?r.map(u=>it(u)):[it(r)],s=o.color,l=Z(s)?s:[s],c=w8(t,o),d=t.y+o.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=o.textAlign,I8(e,o)&&F8(e,{x:c,y:d},i,a),R8(e,{x:c,y:d},i,{fonts:a,colors:l}),e.restore();}function I8(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,true}function L8(e,t,o,n){let{radius:i,options:r}=t,a=r.pointStyle,s=r.rotation,l=(s||0)*zi;if($s(a)){e.save(),e.translate(o,n),e.rotate(l),e.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),e.restore();return}_8(i)||B8(e,{x:o,y:n,radius:i,rotation:s,style:a,rad:l});}function B8(e,{x:t,y:o,radius:n,rotation:i,style:r,rad:a}){let s,l,c,d;switch(e.beginPath(),r){default:e.arc(t,o,n,0,Q),e.closePath();break;case "triangle":e.moveTo(t+Math.sin(a)*n,o-Math.cos(a)*n),a+=Nn,e.lineTo(t+Math.sin(a)*n,o-Math.cos(a)*n),a+=Nn,e.lineTo(t+Math.sin(a)*n,o-Math.cos(a)*n),e.closePath();break;case "rectRounded":d=n*.516,c=n-d,s=Math.cos(a+ie)*c,l=Math.sin(a+ie)*c,e.arc(t-s,o-l,d,a-G,a-et),e.arc(t+l,o-s,d,a-et,a),e.arc(t+s,o+l,d,a,a+et),e.arc(t-l,o+s,d,a+et,a+G),e.closePath();break;case "rect":if(!i){c=Math.SQRT1_2*n,e.rect(t-c,o-c,2*c,2*c);break}a+=ie;case "rectRot":s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+l,o-s),e.lineTo(t+s,o+l),e.lineTo(t-l,o+s),e.closePath();break;case "crossRot":a+=ie;case "cross":s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+s,o+l),e.moveTo(t+l,o-s),e.lineTo(t-l,o+s);break;case "star":s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+s,o+l),e.moveTo(t+l,o-s),e.lineTo(t-l,o+s),a+=ie,s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+s,o+l),e.moveTo(t+l,o-s),e.lineTo(t-l,o+s);break;case "line":s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+s,o+l);break;case "dash":e.moveTo(t,o),e.lineTo(t+Math.cos(a)*n,o+Math.sin(a)*n);break}e.fill();}function E8(e,t,o,n){e.save();let i=t.length,r=0,a=n;for(let s=0;s<i;s++){let l=o[Math.min(s,o.length-1)];e.font=l.string;let c=t[s];r=Math.max(r,e.measureText(c).width+n),a+=l.lineHeight;}return e.restore(),{width:r,height:a}}function F8(e,{x:t,y:o},n,i){e.beginPath();let r=0;n.forEach(function(a,s){let l=i[Math.min(s,i.length-1)],c=l.lineHeight;e.font=l.string,e.strokeText(a,t,o+c/2+r),r+=c;}),e.stroke();}function R8(e,{x:t,y:o},n,{fonts:i,colors:r}){let a=0;n.forEach(function(s,l){let c=r[Math.min(l,r.length-1)],d=i[Math.min(l,i.length-1)],u=d.lineHeight;e.beginPath(),e.font=d.string,e.fillStyle=c,e.fillText(s,t,o+u/2+a),a+=u,e.fill();});}function D8(e,t){let o=Kt(e)?e:t;return Kt(o)?zs(o,0,1):1}var rx={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function Jn(e,t,o){return t=typeof t=="number"?t:e.parse(t),lt(t)?e.getPixelForValue(t):o}function ln(e,t,o){let n=t[o];if(n||o==="scaleID")return n;let i=o.charAt(0),r=Object.values(e).filter(a=>a.axis&&a.axis===i);return r.length?r[0].id:i}function Lx(e,t){if(e){let o=e.options.reverse,n=Jn(e,t.min,o?t.end:t.start),i=Jn(e,t.max,o?t.start:t.end);return {start:n,end:i}}}function Bx(e,t){let{chartArea:o,scales:n}=e,i=n[ln(n,t,"xScaleID")],r=n[ln(n,t,"yScaleID")],a=o.width/2,s=o.height/2;return i&&(a=Jn(i,t.xValue,i.left+i.width/2)),r&&(s=Jn(r,t.yValue,r.top+r.height/2)),{x:a,y:s}}function gu(e,t){let o=e.scales,n=o[ln(o,t,"xScaleID")],i=o[ln(o,t,"yScaleID")];if(!n&&!i)return {};let{left:r,right:a}=n||e.chartArea,{top:s,bottom:l}=i||e.chartArea,c=ax(n,{min:t.xMin,max:t.xMax,start:r,end:a});r=c.start,a=c.end;let d=ax(i,{min:t.yMin,max:t.yMax,start:l,end:s});return s=d.start,l=d.end,{x:r,y:s,x2:a,y2:l,width:a-r,height:l-s,centerX:r+(a-r)/2,centerY:s+(l-s)/2}}function Ex(e,t){if(!_x(t)){let o=gu(e,t),n=t.radius;(!n||isNaN(n))&&(n=Math.min(o.width,o.height)/2,t.radius=n);let i=n*2,r=o.centerX+t.xAdjust,a=o.centerY+t.yAdjust;return {x:r-n,y:a-n,x2:r+n,y2:a+n,centerX:r,centerY:a,width:i,height:i,radius:n}}return O8(e,t)}function N8(e,t){let{scales:o,chartArea:n}=e,i=o[t.scaleID],r={x:n.left,y:n.top,x2:n.right,y2:n.bottom};return i?U8(i,r,t):z8(o,r,t),r}function Fx(e,t,o){let n=gu(e,t);return n.initProperties=dr(e,n,t,o),n.elements=[{type:"label",optionScope:"label",properties:H8(e,n,t),initProperties:n.initProperties}],n}function O8(e,t){let o=Bx(e,t),n=t.radius*2;return {x:o.x-t.radius+t.xAdjust,y:o.y-t.radius+t.yAdjust,x2:o.x+t.radius+t.xAdjust,y2:o.y+t.radius+t.yAdjust,centerX:o.x+t.xAdjust,centerY:o.y+t.yAdjust,radius:t.radius,width:n,height:n}}function ax(e,t){let o=Lx(e,t)||t;return {start:Math.min(o.start,o.end),end:Math.max(o.start,o.end)}}function U8(e,t,o){let n=Jn(e,o.value,NaN),i=Jn(e,o.endValue,n);e.isHorizontal()?(t.x=n,t.x2=i):(t.y=n,t.y2=i);}function z8(e,t,o){for(let n of Object.keys(rx)){let i=e[ln(e,o,n)];if(i){let{min:r,max:a,start:s,end:l,startProp:c,endProp:d}=rx[n],u=Lx(i,{min:o[r],max:o[a],start:i[s],end:i[l]});t[c]=u.start,t[d]=u.end;}}}function $8({properties:e,options:t},o,n,i){let{x:r,x2:a,width:s}=e;return Rx({start:r,end:a,borderWidth:t.borderWidth},{position:n.x,padding:{start:i.left,end:i.right},adjust:t.label.xAdjust,size:o.width})}function V8({properties:e,options:t},o,n,i){let{y:r,y2:a,height:s}=e;return Rx({start:r,end:a,borderWidth:t.borderWidth},{position:n.y,padding:{start:i.top,end:i.bottom},adjust:t.label.yAdjust,size:o.height})}function Rx(e,t){let{start:o,end:n,borderWidth:i}=e,{position:r,padding:{start:a,end:s},adjust:l}=t,c=n-i-o-a-s-t.size;return o+i/2+l+pu(c,r)}function H8(e,t,o){let n=o.label;n.backgroundColor="transparent",n.callout.display=false;let i=hu(n.position),r=ut(n.padding),a=fu(e.ctx,n),s=$8({properties:t,options:o},a,i,r),l=V8({properties:t,options:o},a,i,r),c=a.width+r.width,d=a.height+r.height;return {x:s,y:l,x2:s+c,y2:l+d,width:c,height:d,centerX:s+c/2,centerY:l+d/2,rotation:n.rotation}}function pn(e,t,o){let n=Math.cos(o),i=Math.sin(o),r=t.x,a=t.y;return {x:r+n*(e.x-r)-i*(e.y-a),y:a+i*(e.x-r)+n*(e.y-a)}}var iu=["enter","leave"],yu=iu.concat("click");function W8(e,t,o){t.listened=Ax(o,yu,t.listeners),t.moveListened=false,t._getElements=uu,iu.forEach(n=>{Tt(o[n])&&(t.moveListened=true);}),(!t.listened||!t.moveListened)&&t.annotations.forEach(n=>{!t.listened&&Tt(n.click)&&(t.listened=true),t.moveListened||iu.forEach(i=>{Tt(n[i])&&(t.listened=true,t.moveListened=true);});});}function G8(e,t,o){if(e.listened)switch(t.type){case "mousemove":case "mouseout":return j8(e,t,o);case "click":return Y8(e,t,o)}}function j8(e,t,o){if(!e.moveListened)return;let n;t.type==="mousemove"?n=uu(e,t,o.interaction):n=[];let i=e.hovered;e.hovered=n;let r={state:e,event:t},a=sx(r,"leave",i,n);return sx(r,"enter",n,i)||a}function sx({state:e,event:t},o,n,i){let r;for(let a of n)i.indexOf(a)<0&&(r=Dx(a.options[o]||e.listeners[o],a,t)||r);return r}function Y8(e,t,o){let n=e.listeners,i=uu(e,t,o.interaction),r;for(let a of i)r=Dx(a.options.click||n.click,a,t)||r;return r}function Dx(e,t,o){return X(e,[t.$context,o])===true}var Us=["afterDraw","beforeDraw"];function Z8(e,t,o){let n=t.visibleElements;t.hooked=Ax(o,Us,t.hooks),t.hooked||n.forEach(i=>{t.hooked||Us.forEach(r=>{Tt(i.options[r])&&(t.hooked=true);});});}function lx(e,t,o){if(e.hooked){let n=t.options[o]||e.hooks[o];return X(n,[t.$context])}}function X8(e,t,o){let n=t7(e.scales,t,o),i=cx(t,n,"min","suggestedMin");i=cx(t,n,"max","suggestedMax")||i,i&&Tt(t.handleTickRangeOptions)&&t.handleTickRangeOptions();}function K8(e,t){for(let o of e)Q8(o,t);}function cx(e,t,o,n){if(lt(t[o])&&!q8(e.options,o,n)){let i=e[o]!==t[o];return e[o]=t[o],i}}function q8(e,t,o){return st(e[t])||st(e[o])}function Q8(e,t){for(let o of ["scaleID","xScaleID","yScaleID"]){let n=ln(t,e,o);n&&!t[n]&&J8(e,o)&&console.warn(`No scale found with id '${n}' for annotation '${e.id}'`);}}function J8(e,t){if(t==="scaleID")return true;let o=t.charAt(0);for(let n of ["Min","Max","Value"])if(st(e[o+n]))return true;return false}function t7(e,t,o){let n=t.axis,i=t.id,r=n+"ScaleID",a={min:U(t.min,Number.NEGATIVE_INFINITY),max:U(t.max,Number.POSITIVE_INFINITY)};for(let s of o)s.scaleID===i?dx(s,t,["value","endValue"],a):ln(e,s,r)===i&&dx(s,t,[n+"Min",n+"Max",n+"Value"],a);return a}function dx(e,t,o,n){for(let i of o){let r=e[i];if(st(r)){let a=t.parse(r);n.min=Math.min(n.min,a),n.max=Math.max(n.max,a);}}}var Ao=class extends xt{inRange(t,o,n,i){let{x:r,y:a}=pn({x:t,y:o},this.getCenterPoint(i),mt(-this.options.rotation));return Tx({x:r,y:a},this.getProps(["x","y","x2","y2"],i),n,this.options.borderWidth)}getCenterPoint(t){return oi(this,t)}draw(t){t.save(),mu(t,this.getCenterPoint(),this.options.rotation),Ix(t,this,this.options),t.restore();}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,o){return Fx(t,o)}};Ao.id="boxAnnotation";Ao.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:false},color:"black",content:null,display:false,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};Ao.defaultRoutes={borderColor:"color",backgroundColor:"color"};Ao.descriptors={label:{_fallback:true}};var Nx=["left","bottom","top","right"],cn=class extends xt{inRange(t,o,n,i){let{x:r,y:a}=pn({x:t,y:o},this.getCenterPoint(i),mt(-this.rotation));return Tx({x:r,y:a},this.getProps(["x","y","x2","y2"],i),n,this.options.borderWidth)}getCenterPoint(t){return oi(this,t)}draw(t){let o=this.options,n=!st(this._visible)||this._visible;!o.display||!o.content||!n||(t.save(),mu(t,this.getCenterPoint(),this.rotation),o7(t,this),Ix(t,this,o),M8(t,c7(this),o),t.restore());}resolveElementProperties(t,o){let n;if(_x(o))n=Bx(t,o);else {let{centerX:s,centerY:l}=gu(t,o);n={x:s,y:l};}let i=ut(o.padding),r=fu(t.ctx,o),a=e7(n,r,o,i);return _(S({initProperties:dr(t,a,o),pointX:n.x,pointY:n.y},a),{rotation:o.rotation})}};cn.id="labelAnnotation";cn.defaults={adjustScaleRange:true,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:false,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:true,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};cn.defaultRoutes={borderColor:"color"};function e7(e,t,o,n){let i=t.width+n.width+o.borderWidth,r=t.height+n.height+o.borderWidth,a=hu(o.position,"center"),s=ux(e.x,i,o.xAdjust,a.x),l=ux(e.y,r,o.yAdjust,a.y);return {x:s,y:l,x2:s+i,y2:l+r,width:i,height:r,centerX:s+i/2,centerY:l+r/2}}function ux(e,t,o=0,n){return e-pu(t,n)+o}function o7(e,t){let{pointX:o,pointY:n,options:i}=t,r=i.callout,a=r&&r.display&&s7(t,r);if(!a||d7(t,r,a))return;if(e.save(),e.beginPath(),!_o(e,r))return e.restore();let{separatorStart:l,separatorEnd:c}=n7(t,a),{sideStart:d,sideEnd:u}=r7(t,a,l);(r.margin>0||i.borderWidth===0)&&(e.moveTo(l.x,l.y),e.lineTo(c.x,c.y)),e.moveTo(d.x,d.y),e.lineTo(u.x,u.y);let p=pn({x:o,y:n},t.getCenterPoint(),mt(-t.rotation));e.lineTo(p.x,p.y),e.stroke(),e.restore();}function n7(e,t){let{x:o,y:n,x2:i,y2:r}=e,a=i7(e,t),s,l;return t==="left"||t==="right"?(s={x:o+a,y:n},l={x:s.x,y:r}):(s={x:o,y:n+a},l={x:i,y:s.y}),{separatorStart:s,separatorEnd:l}}function i7(e,t){let{width:o,height:n,options:i}=e,r=i.callout.margin+i.borderWidth/2;return t==="right"?o+r:t==="bottom"?n+r:-r}function r7(e,t,o){let{y:n,width:i,height:r,options:a}=e,s=a.callout.start,l=a7(t,a.callout),c,d;return t==="left"||t==="right"?(c={x:o.x,y:n+vo(r,s)},d={x:c.x+l,y:c.y}):(c={x:o.x+vo(i,s),y:o.y},d={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:d}}function a7(e,t){let o=t.side;return e==="left"||e==="top"?-o:o}function s7(e,t){let o=t.position;return Nx.includes(o)?o:l7(e,t)}function l7(e,t){let{x:o,y:n,x2:i,y2:r,width:a,height:s,pointX:l,pointY:c,centerX:d,centerY:u,rotation:p}=e,m={x:d,y:u},h=t.start,f=vo(a,h),g=vo(s,h),y=[o,o+f,o+f,i],P=[n+g,r,n,r],T=[];for(let k=0;k<4;k++){let w=pn({x:y[k],y:P[k]},m,mt(p));T.push({position:Nx[k],distance:$e(w,{x:l,y:c})});}return T.sort((k,w)=>k.distance-w.distance)[0].position}function c7({x:e,y:t,width:o,height:n,options:i}){let r=i.borderWidth/2,a=ut(i.padding);return {x:e+a.left+r,y:t+a.top+r,width:o-a.left-a.right-i.borderWidth,height:n-a.top-a.bottom-i.borderWidth}}function d7(e,t,o){let{pointX:n,pointY:i}=e,r=t.margin,a=n,s=i;return o==="left"?a+=r:o==="right"?a-=r:o==="top"?s+=r:o==="bottom"&&(s-=r),e.inRange(a,s)}var xu=(e,t,o)=>({x:e.x+o*(t.x-e.x),y:e.y+o*(t.y-e.y)}),ru=(e,t,o)=>xu(t,o,Math.abs((e-t.y)/(o.y-t.y))).x,px=(e,t,o)=>xu(t,o,Math.abs((e-t.x)/(o.x-t.x))).y,cr=e=>e*e,u7=(e,t,{x:o,y:n,x2:i,y2:r},a)=>a==="y"?{start:Math.min(n,r),end:Math.max(n,r),value:t}:{start:Math.min(o,i),end:Math.max(o,i),value:e},hx=(e,t,o,n)=>(1-n)*(1-n)*e+2*(1-n)*n*t+n*n*o,au=(e,t,o,n)=>({x:hx(e.x,t.x,o.x,n),y:hx(e.y,t.y,o.y,n)}),mx=(e,t,o,n)=>2*(1-n)*(t-e)+2*n*(o-t),fx=(e,t,o,n)=>-Math.atan2(mx(e.x,t.x,o.x,n),mx(e.y,t.y,o.y,n))+.5*G,dn=class extends xt{inRange(t,o,n,i){let r=this.options.borderWidth/2;if(n!=="x"&&n!=="y"){let a={mouseX:t,mouseY:o},{path:s,ctx:l}=this;if(s){_o(l,this.options);let{chart:d}=this.$context,u=t*d.currentDevicePixelRatio,p=o*d.currentDevicePixelRatio,m=l.isPointInStroke(s,u,p)||su(this,a,i);return l.restore(),m}let c=cr(r);return f7(this,a,c,i)||su(this,a,i)}return p7(this,{mouseX:t,mouseY:o},n,{hBorderWidth:r,useFinalPosition:i})}getCenterPoint(t){return oi(this,t)}draw(t){let{x:o,y:n,x2:i,y2:r,cp:a,options:s}=this;if(t.save(),!_o(t,s))return t.restore();ni(t,s);let l=Math.sqrt(Math.pow(i-o,2)+Math.pow(r-n,2));if(s.curve&&a)return T7(t,this,a,l),t.restore();let{startOpts:c,endOpts:d,startAdjust:u,endAdjust:p}=Ox(this),m=Math.atan2(r-n,i-o);t.translate(o,n),t.rotate(m),t.beginPath(),t.moveTo(0+u,0),t.lineTo(l-p,0),t.shadowColor=s.borderShadowColor,t.stroke(),lu(t,0,u,c),lu(t,l,-p,d),t.restore();}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,o){let n=N8(t,o),{x:i,y:r,x2:a,y2:s}=n,l=h7(n,t.chartArea),c=l?m7({x:i,y:r},{x:a,y:s},t.chartArea):{x:i,y:r,x2:a,y2:s,width:Math.abs(a-i),height:Math.abs(s-r)};if(c.centerX=(a+i)/2,c.centerY=(s+r)/2,c.initProperties=dr(t,c,o),o.curve){let u={x:c.x,y:c.y},p={x:c.x2,y:c.y2};c.cp=S7(c,o,$e(u,p));}let d=g7(t,c,o.label);return d._visible=l,c.elements=[{type:"label",optionScope:"label",properties:d,initProperties:c.initProperties}],c}};dn.id="lineAnnotation";var gx={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};dn.defaults={adjustScaleRange:true,arrowHeads:{display:false,end:Object.assign({},gx),fill:false,length:12,start:Object.assign({},gx),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:false,controlPoint:{y:"-50%"},display:true,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},cn.defaults.callout),color:"#fff",content:null,display:false,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};dn.descriptors={arrowHeads:{start:{_fallback:true},end:{_fallback:true},_fallback:true}};dn.defaultRoutes={borderColor:"color"};function p7(e,{mouseX:t,mouseY:o},n,{hBorderWidth:i,useFinalPosition:r}){let a=u7(t,o,e.getProps(["x","y","x2","y2"],r),n);return a.value>=a.start-i&&a.value<=a.end+i||su(e,{mouseX:t,mouseY:o},r,n)}function h7({x:e,y:t,x2:o,y2:n},{top:i,right:r,bottom:a,left:s}){return !(e<s&&o<s||e>r&&o>r||t<i&&n<i||t>a&&n>a)}function yx({x:e,y:t},o,{top:n,right:i,bottom:r,left:a}){return e<a&&(t=px(a,{x:e,y:t},o),e=a),e>i&&(t=px(i,{x:e,y:t},o),e=i),t<n&&(e=ru(n,{x:e,y:t},o),t=n),t>r&&(e=ru(r,{x:e,y:t},o),t=r),{x:e,y:t}}function m7(e,t,o){let{x:n,y:i}=yx(e,t,o),{x:r,y:a}=yx(t,e,o);return {x:n,y:i,x2:r,y2:a,width:Math.abs(r-n),height:Math.abs(a-i)}}function f7(e,{mouseX:t,mouseY:o},n=sn,i){let{x:r,y:a,x2:s,y2:l}=e.getProps(["x","y","x2","y2"],i),c=s-r,d=l-a,u=cr(c)+cr(d),p=u===0?-1:((t-r)*c+(o-a)*d)/u,m,h;return p<0?(m=r,h=a):p>1?(m=s,h=l):(m=r+p*c,h=a+p*d),cr(t-m)+cr(o-h)<=n}function su(e,{mouseX:t,mouseY:o},n,i){let r=e.label;return r.options.display&&r.inRange(t,o,i,n)}function g7(e,t,o){let n=o.borderWidth,i=ut(o.padding),r=fu(e.ctx,o),a=r.width+i.width+n,s=r.height+i.height+n;return x7(t,o,{width:a,height:s,padding:i},e.chartArea)}function y7(e){let{x:t,y:o,x2:n,y2:i}=e,r=Math.atan2(i-o,n-t);return r>G/2?r-G:r<G/-2?r+G:r}function x7(e,t,o,n){let{width:i,height:r,padding:a}=o,{xAdjust:s,yAdjust:l}=t,c={x:e.x,y:e.y},d={x:e.x2,y:e.y2},u=t.rotation==="auto"?y7(e):mt(t.rotation),p=b7(i,r,u),m=C7(e,t,{labelSize:p,padding:a},n),h=e.cp?au(c,e.cp,d,m):xu(c,d,m),f={size:p.w,min:n.left,max:n.right,padding:a.left},g={size:p.h,min:n.top,max:n.bottom,padding:a.top},y=bx(h.x,f)+s,P=bx(h.y,g)+l;return {x:y-i/2,y:P-r/2,x2:y+i/2,y2:P+r/2,centerX:y,centerY:P,pointX:h.x,pointY:h.y,width:i,height:r,rotation:Qo(u)}}function b7(e,t,o){let n=Math.cos(o),i=Math.sin(o);return {w:Math.abs(e*n)+Math.abs(t*i),h:Math.abs(e*i)+Math.abs(t*n)}}function C7(e,t,o,n){let i,r=P7(e,n);return t.position==="start"?i=xx({w:e.x2-e.x,h:e.y2-e.y},o,t,r):t.position==="end"?i=1-xx({w:e.x-e.x2,h:e.y-e.y2},o,t,r):i=pu(1,t.position),i}function xx(e,t,o,n){let{labelSize:i,padding:r}=t,a=e.w*n.dx,s=e.h*n.dy,l=a>0&&(i.w/2+r.left-n.x)/a,c=s>0&&(i.h/2+r.top-n.y)/s;return zs(Math.max(l,c),0,.25)}function P7(e,t){let{x:o,x2:n,y:i,y2:r}=e,a=Math.min(i,r)-t.top,s=Math.min(o,n)-t.left,l=t.bottom-Math.max(i,r),c=t.right-Math.max(o,n);return {x:Math.min(s,c),y:Math.min(a,l),dx:s<=c?1:-1,dy:a<=l?1:-1}}function bx(e,t){let{size:o,min:n,max:i,padding:r}=t,a=o/2;return o>i-n?(i+n)/2:(n>=e-r-a&&(e=n+r+a),i<=e+r+a&&(e=i-r-a),e)}function Ox(e){let t=e.options,o=t.arrowHeads&&t.arrowHeads.start,n=t.arrowHeads&&t.arrowHeads.end;return {startOpts:o,endOpts:n,startAdjust:Cx(e,o),endAdjust:Cx(e,n)}}function Cx(e,t){if(!t||!t.display)return 0;let{length:o,width:n}=t,i=e.options.borderWidth/2,r={x:o,y:n+i};return Math.abs(ru(0,r,{x:0,y:i}))}function lu(e,t,o,n){if(!n||!n.display)return;let{length:i,width:r,fill:a,backgroundColor:s,borderColor:l}=n,c=Math.abs(t-i)+o;e.beginPath(),ni(e,n),_o(e,n),e.moveTo(c,-r),e.lineTo(t+o,0),e.lineTo(c,r),a===true?(e.fillStyle=s||l,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=n.borderShadowColor,e.stroke();}function S7(e,t,o){let{x:n,y:i,x2:r,y2:a,centerX:s,centerY:l}=e,c=Math.atan2(a-i,r-n),d=hu(t.controlPoint,0),u={x:s+vo(o,d.x,false),y:l+vo(o,d.y,false)};return pn(u,{x:s,y:l},c)}function Px(e,{x:t,y:o},{angle:n,adjust:i},r){!r||!r.display||(e.save(),e.translate(t,o),e.rotate(n),lu(e,0,-i,r),e.restore());}function T7(e,t,o,n){let{x:i,y:r,x2:a,y2:s,options:l}=t,{startOpts:c,endOpts:d,startAdjust:u,endAdjust:p}=Ox(t),m={x:i,y:r},h={x:a,y:s},f=fx(m,o,h,0),g=fx(m,o,h,1)-G,y=au(m,o,h,u/n),P=au(m,o,h,1-p/n),T=new Path2D;e.beginPath(),T.moveTo(y.x,y.y),T.quadraticCurveTo(o.x,o.y,P.x,P.y),e.shadowColor=l.borderShadowColor,e.stroke(T),t.path=T,t.ctx=e,Px(e,y,{angle:f,adjust:u},c),Px(e,P,{angle:g,adjust:p},d);}var un=class extends xt{inRange(t,o,n,i){let r=this.options.rotation,a=this.options.borderWidth;if(n!=="x"&&n!=="y")return k7({x:t,y:o},this.getProps(["width","height","centerX","centerY"],i),r,a);let{x:s,y:l,x2:c,y2:d}=this.getProps(["x","y","x2","y2"],i),u=a/2,p=n==="y"?{start:l,end:d}:{start:s,end:c},m=pn({x:t,y:o},this.getCenterPoint(i),mt(-r));return m[n]>=p.start-u-sn&&m[n]<=p.end+u+sn}getCenterPoint(t){return oi(this,t)}draw(t){let{width:o,height:n,centerX:i,centerY:r,options:a}=this;t.save(),mu(t,this.getCenterPoint(),a.rotation),ni(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;let s=_o(t,a);t.ellipse(i,r,n/2,o/2,G/2,0,2*G),t.fill(),s&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore();}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,o){return Fx(t,o,true)}};un.id="ellipseAnnotation";un.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,label:Object.assign({},Ao.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};un.defaultRoutes={borderColor:"color",backgroundColor:"color"};un.descriptors={label:{_fallback:true}};function k7(e,t,o,n){let{width:i,height:r,centerX:a,centerY:s}=t,l=i/2,c=r/2;if(l<=0||c<=0)return false;let d=mt(o||0),u=n/2||0,p=Math.cos(d),m=Math.sin(d),h=Math.pow(p*(e.x-a)+m*(e.y-s),2),f=Math.pow(m*(e.x-a)-p*(e.y-s),2);return h/Math.pow(l+u,2)+f/Math.pow(c+u,2)<=1.0001}var ti=class extends xt{inRange(t,o,n,i){let{x:r,y:a,x2:s,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],i),d=this.options.borderWidth;if(n!=="x"&&n!=="y")return T8({x:t,y:o},this.getCenterPoint(i),c/2,d);let u=d/2,p=n==="y"?{start:a,end:l,value:o}:{start:r,end:s,value:t};return p.value>=p.start-u&&p.value<=p.end+u}getCenterPoint(t){return oi(this,t)}draw(t){let o=this.options,n=o.borderWidth;if(o.radius<.1)return;t.save(),t.fillStyle=o.backgroundColor,ni(t,o);let i=_o(t,o);L8(t,this,this.centerX,this.centerY),i&&!$s(o.pointStyle)&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore(),o.borderWidth=n;}resolveElementProperties(t,o){let n=Ex(t,o);return n.initProperties=dr(t,n,o,true),n}};ti.id="pointAnnotation";ti.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};ti.defaultRoutes={borderColor:"color",backgroundColor:"color"};var ei=class extends xt{inRange(t,o,n,i){if(n!=="x"&&n!=="y")return this.options.radius>=.1&&this.elements.length>1&&v7(this.elements,t,o,i);let r=pn({x:t,y:o},this.getCenterPoint(i),mt(-this.options.rotation)),a=this.elements.map(c=>n==="y"?c.bY:c.bX),s=Math.min(...a),l=Math.max(...a);return r[n]>=s&&r[n]<=l}getCenterPoint(t){return oi(this,t)}draw(t){let{elements:o,options:n}=this;t.save(),t.beginPath(),t.fillStyle=n.backgroundColor,ni(t,n);let i=_o(t,n),r=true;for(let a of o)r?(t.moveTo(a.x,a.y),r=false):t.lineTo(a.x,a.y);t.closePath(),t.fill(),i&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore();}resolveElementProperties(t,o){let n=Ex(t,o),{sides:i,rotation:r}=o,a=[],s=2*G/i,l=r*zi;for(let c=0;c<i;c++,l+=s){let d=w7(n,o,l);d.initProperties=dr(t,n,o),a.push(d);}return n.elements=a,n}};ei.id="polygonAnnotation";ei.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};ei.defaultRoutes={borderColor:"color",backgroundColor:"color"};function w7({centerX:e,centerY:t},{radius:o,borderWidth:n},i){let r=n/2,a=Math.sin(i),s=Math.cos(i),l={x:e+a*o,y:t-s*o};return {type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:e+a*(o+r),bY:t-s*(o+r)}}}function v7(e,t,o,n){let i=false,r=e[e.length-1].getProps(["bX","bY"],n);for(let a of e){let s=a.getProps(["bX","bY"],n);s.bY>o!=r.bY>o&&t<(r.bX-s.bX)*(o-s.bY)/(r.bY-s.bY)+s.bX&&(i=!i),r=s;}return i}var wo={box:Ao,ellipse:un,label:cn,line:dn,point:ti,polygon:ei};Object.keys(wo).forEach(e=>{H.describe(`elements.${wo[e].id}`,{_fallback:"plugins.annotation.common"});});var _7={update:Object.assign},A7=yu.concat(Us),Sx=(e,t)=>z(t)?du(e,t):e,cu=e=>e==="color"||e==="font";function bu(e="line"){return wo[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function M7(e,t,o,n){let i=L7(e,o.animations,n),r=t.annotations,a=F7(t.elements,r);for(let s=0;s<r.length;s++){let l=r[s],c=Ux(a,s,l.type),d=l.setContext(E7(e,c,l)),u=c.resolveElementProperties(e,d);u.skip=I7(u),"elements"in u&&(B7(c,u.elements,d,i),delete u.elements),st(c.x)||Object.assign(c,u),Object.assign(c,u.initProperties),u.options=zx(d),i.update(c,u);}}function I7(e){return isNaN(e.x)||isNaN(e.y)}function L7(e,t,o){return o==="reset"||o==="none"||o==="resize"?_7:new Hn(e,t)}function B7(e,t,o,n){let i=e.elements||(e.elements=[]);i.length=t.length;for(let r=0;r<t.length;r++){let a=t[r],s=a.properties,l=Ux(i,r,a.type,a.initProperties),c=o[a.optionScope].override(a);s.options=zx(c),n.update(l,s);}}function Ux(e,t,o,n){let i=wo[bu(o)],r=e[t];return (!r||!(r instanceof i))&&(r=e[t]=new i,Object.assign(r,n)),r}function zx(e){let t=wo[bu(e.type)],o={};o.id=e.id,o.type=e.type,o.drawTime=e.drawTime,Object.assign(o,du(e,t.defaults),du(e,t.defaultRoutes));for(let n of A7)o[n]=e[n];return o}function du(e,t){let o={};for(let n of Object.keys(t)){let i=t[n],r=e[n];cu(n)&&Z(r)?o[n]=r.map(a=>Sx(a,i)):o[n]=Sx(r,i);}return o}function E7(e,t,o){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,id:o.id,type:"annotation"}))}function F7(e,t){let o=t.length,n=e.length;if(n<o){let i=o-n;e.splice(n,0,...new Array(i));}else n>o&&e.splice(o,n-o);return e}var R7="2.2.1",ko=new Map,D7=yu.concat(Us),$x={id:"annotation",version:R7,beforeRegister(){k8("chart.js","3.7",Et.version);},afterRegister(){Et.register(wo);},afterUnregister(){Et.unregister(wo);},beforeInit(e){ko.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:false,moveListened:false,hooks:{},hooked:false,hovered:[]});},beforeUpdate(e,t,o){let n=ko.get(e),i=n.annotations=[],r=o.annotations;z(r)?Object.keys(r).forEach(a=>{let s=r[a];z(s)&&(s.id=a,i.push(s));}):Z(r)&&i.push(...r),K8(i,e.scales);},afterDataLimits(e,t){let o=ko.get(e);X8(e,t.scale,o.annotations.filter(n=>n.display&&n.adjustScaleRange));},afterUpdate(e,t,o){let n=ko.get(e);W8(e,n,o),M7(e,n,o,t.mode),n.visibleElements=n.elements.filter(i=>!i.skip&&i.options.display),Z8(e,n,o);},beforeDatasetsDraw(e,t,o){Ns(e,"beforeDatasetsDraw",o.clip);},afterDatasetsDraw(e,t,o){Ns(e,"afterDatasetsDraw",o.clip);},beforeDraw(e,t,o){Ns(e,"beforeDraw",o.clip);},afterDraw(e,t,o){Ns(e,"afterDraw",o.clip);},beforeEvent(e,t,o){let n=ko.get(e);G8(n,t.event,o)&&(t.changed=true);},afterDestroy(e){ko.delete(e);},_getState(e){return ko.get(e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:true,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:false,label:{}}},descriptors:{_indexable:false,_scriptable:e=>!D7.includes(e)&&e!=="init",annotations:{_allKeys:false,_fallback:(e,t)=>`elements.${wo[bu(t.type)].id}`},interaction:{_fallback:true},common:{label:{_indexable:cu,_fallback:true},_indexable:cu}},additionalOptionScopes:[""]};function Ns(e,t,o){let{ctx:n,chartArea:i}=e,r=ko.get(e);o&&xo(n,i);let a=N7(r.visibleElements,t).sort((s,l)=>s.element.options.z-l.element.options.z);for(let s of a)O7(n,i,r,s);o&&bo(n);}function N7(e,t){let o=[];for(let n of e)if(n.options.drawTime===t&&o.push({element:n,main:true}),n.elements&&n.elements.length)for(let i of n.elements)i.options.display&&i.options.drawTime===t&&o.push({element:i});return o}function O7(e,t,o,n){let i=n.element;n.main?(lx(o,i,"beforeDraw"),i.draw(e,t),lx(o,i,"afterDraw")):i.draw(e,t);}var Pu=Et.version,U7=Pu?(e,t)=>e.parse(t):(e,t)=>t;function z7(e,t){let o=Kt(t)?parseFloat(t):U7(e,t);return e.getPixelForValue(o)}var Vx=e=>e&&e.right>e.left&&e.bottom>e.top;function Hx(e,t,o){return t==="r"?e.createRadialGradient(o.xCenter,o.yCenter,0,o.xCenter,o.yCenter,o.drawingArea):t==="y"?e.createLinearGradient(0,o.bottom,0,o.top):e.createLinearGradient(o.left,0,o.right,0)}function Wx(e,t){t.forEach(function(o){e.addColorStop(o.stop,o.color.rgbString());});}function Gx(e,t,o){if(e.options.has(t.key)){let i=e.options.get(t.key).filter(r=>r.datasetIndex===o);if(i.length)return i[0]}}function jx(e,t){if(e.type==="radialLinear"){let r=e.getDistanceFromCenterForValue(t);return {pixel:r,stop:r/e.drawingArea}}let o=e.options.reverse,n=z7(e,t),i=e.getDecimalForPixel(n);return {pixel:n,stop:o?1-i:i}}var Cu=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,ii=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function $7(e,t,o){let n=t.color.rgb,i=ii(n.r/255),r=ii(n.g/255),a=ii(n.b/255),s=o.color.rgb,l=ii(s.r/255),c=ii(s.g/255),d=ii(s.b/255);return tn({r:Math.round(Cu(i+e*(l-i))*255),g:Math.round(Cu(r+e*(c-r))*255),b:Math.round(Cu(a+e*(d-a))*255),a:n.a+e*Math.abs(s.a-n.a)})}function V7(e,t,o,n){let i=Gx(e,t,o);if(!i||!i.stopColors.length)return;let{stop:r}=jx(i.scale,n),a,s;for(let l of i.stopColors){if(l.stop===r)return l.color;l.stop<r?a=l:l.stop>r&&!s&&(s=l);}return s?$7(r,a,s):a}var Yx=[{key:"backgroundColor",legendItemKey:"fillStyle"},{key:"borderColor",legendItemKey:"strokeStyle"}],H7=(e,t)=>t.labels&&t.labels.font&&st(t.labels.font.size)?t.labels.font.size:e.options.font.size;function W7(e,t,o,n,i){let r=Gx(e,o,n.datasetIndex);if(!r||!r.stopColors.length)return;let a=Hx(t,r.axis,i);Wx(a,r.stopColors),n[o.legendItemKey]=a;}function G7(e,{boxWidth:t,boxHeight:o}){return {top:e.top,left:e.left,bottom:e.top+o,right:e.left+t,xCenter:e.left+t/2,yCenter:e.top+o/2,drawingArea:Math.max(t,o)/2}}function j7(e,t,o,n){let i=e.legend.legendHitBoxes[o.datasetIndex],r=G7(i,n);Vx(r)&&Yx.forEach(function(a){W7(t,e.ctx,a,o,r);});}function Y7(e,t,o,n){for(let i of e.legend.legendItems)Yx.forEach(function(r){let a=o.data[i.index],s=V7(t,r,n,a);s&&s.valid&&(i[r.legendItemKey]=s.rgbString());});}function Z7(e,t){let o=e.legend,n=o.options,i=n.labels.boxHeight?n.labels.boxHeight:H7(e,n),r=n.labels.boxWidth,a=e.data.datasets;for(let s=0;s<a.length;s++){let l=o.legendItems[s];l.datasetIndex===s?j7(e,t,l,{boxWidth:r,boxHeight:i}):Y7(e,t,a[s],s);}}var Vs=new Map,X7=Pu?(e,t)=>e[t+"Scale"]:(e,t)=>e.controller["_"+t+"Scale"];function K7(e,t,o){for(let n of Object.keys(t)){let{pixel:i,stop:r}=jx(e,n);if(isFinite(i)&&isFinite(r)){let a=tn(t[n]);a&&a.valid&&o.push({stop:Math.max(0,Math.min(1,r)),color:a});}}o.sort((n,i)=>n.stop-i.stop);}function q7(e,t,o,n){t[o]=n,e.dataset&&(e.dataset.options?e.dataset.options[o]=n:e.dataset[o]=n);}function Q7(e,t,o,n){let i=e.options.get(o);return i?t.hidden||(i=i.filter(r=>r.datasetIndex!==n),e.options.set(o,i)):(i=[],e.options.set(o,i)),i}function J7(e,t,o,n,i){let r=e.ctx,a=e.getDatasetMeta(i);if(!a.hidden)for(let[s,l]of Object.entries(o)){let{axis:c,colors:d}=l;if(!d)continue;let u=X7(a,c);if(!u){console.warn(`Scale not found for '${c}'-axis in datasets[${i}] of chart id ${e.id}, skipping.`);continue}let p=Q7(t,a,s,i),m={datasetIndex:i,axis:c,scale:u,stopColors:[]};p.push(m);let h=Hx(r,c,u);K7(u,d,m.stopColors),m.stopColors.length&&(Wx(h,m.stopColors),q7(a,n,s,h));}}var Zx={id:"gradient",beforeInit(e){let t={};t.options=new Map,Vs.set(e,t);},beforeDatasetsUpdate(e){let t=e.chartArea;if(!Vx(t))return;let o=Vs.get(e),n=e.data.datasets;for(let i=0;i<n.length;i++){let r=n[i],a=r.gradient;a&&J7(e,o,a,r,i);}},afterUpdate(e){let t=Vs.get(e);e.legend&&e.legend.options.display!==false&&Pu&&Z7(e,t);},destroy(e){Vs.delete(e);}};var t9=[an,Kn,Ke,W0,G0,H0,nx,Xe,ge,V0,Ze,$x,Zx];Et.register(...t9);var Jx="label";function Kx(e,t){typeof e=="function"?e(t):e&&(e.current=t);}function e9(e,t){Object.assign(e.options,t);}function tb(e,t){e.labels=t;}function eb(e,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Jx,n=[];e.datasets=t.map(i=>{let r=e.datasets.find(a=>a[o]===i[o]);return !r||!i.data||n.includes(r)?S({},i):(n.push(r),Object.assign(r,i),r)});}function o9(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Jx,o={labels:[],datasets:[]};return tb(o,e.labels),eb(o,e.datasets,t),o}function n9(e,t){let y=e,{height:o=150,width:n=300,redraw:i=false,datasetIdKey:r,type:a,data:s,options:l,plugins:c=[],fallbackContent:d,updateMode:u}=y,p=ot(y,["height","width","redraw","datasetIdKey","type","data","options","plugins","fallbackContent","updateMode"]),m=useRef(null),h=useRef(),f=()=>{m.current&&(h.current=new Et(m.current,{type:a,data:o9(s,r),options:l&&S({},l),plugins:c}),Kx(t,h.current));},g=()=>{Kx(t,null),h.current&&(h.current.destroy(),h.current=null);};return useEffect(()=>{!i&&h.current&&l&&e9(h.current,l);},[i,l]),useEffect(()=>{!i&&h.current&&tb(h.current.config.data,s.labels);},[i,s.labels]),useEffect(()=>{!i&&h.current&&s.datasets&&eb(h.current.config.data,s.datasets,r);},[i,s.datasets]),useEffect(()=>{h.current&&(i?(g(),setTimeout(f)):h.current.update(u));},[i,l,s.labels,s.datasets,u]),useEffect(()=>{h.current&&(g(),setTimeout(f));},[a]),useEffect(()=>(f(),()=>g()),[]),xc.createElement("canvas",Object.assign({ref:m,role:"img",height:o,width:n},p),d)}var i9=forwardRef(n9);function r9(e,t){return Et.register(t),forwardRef((o,n)=>xc.createElement(i9,Object.assign({},o,{ref:n,type:e})))}var ob=r9("bar",nn);function Hs(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=useCallback(()=>R(null,null,function*(){if(!o||!o.isCustomerLoaded)return null;try{let l={currencyId:e.currencyId,timeRange:e.timeRange};return yield o.getCreditUsage(l)}catch(l){throw console.error(l),l}}),[o,e.currencyId,e.timeRange,n]),{data:r,error:a,isLoading:s}=Ot({func:i});return useMemo(()=>({creditUsage:r,isLoading:s,error:a}),[r,a,s])}var nb={id:"redrawBeforeFirstDrawPlugin",beforeDraw(e){e.$rendered||(e.$rendered=true,e.update("none"));}};var Su=(e,t=1)=>{let o=Math.round(t*255).toString(16).padStart(2,"0");return `${e}${o}`};var Tu=e=>e.palette.text.secondary,ku=e=>e.palette.outlinedBorder,wu=e=>({family:e.typography.fontFamily,size:parseInt(e.typography.body.fontSize)});function vu(e){let t=["#4caf50","#2196f3","#ff5722","#ff9800","#e91e63","#3f51b5","#00bcd4","#81c784","#64b5f6","#ff8a65","#ffb74d","#f06292","#7986cb","#4dd0e1","#a5d6a7","#90caf9","#ffab91","#ffcc80","#f48fb1","#9fa8da","#80deea"];return t[e%t.length]}function l9(e){let t=[],o=new Date;switch(e){case CreditUsageTimeRange.LastDay:{let n=new Date(o);n.setHours(n.getHours()-23),n.setMinutes(0,0,0);for(let i=0;i<24;i++){let r=new Date(n);r.setHours(r.getHours()+i),t.push(r.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}));}break}case CreditUsageTimeRange.LastWeek:{for(let n=6;n>=0;n--){let i=new Date(o);i.setDate(i.getDate()-n),t.push(i.toLocaleDateString("en-US",{month:"short",day:"2-digit"}));}break}case CreditUsageTimeRange.LastYear:{for(let n=11;n>=0;n--){let i=new Date(o);i.setMonth(i.getMonth()-n),t.push(i.toLocaleDateString("en-US",{month:"short",year:"2-digit"}));}break}case CreditUsageTimeRange.LastMonth:default:{for(let n=29;n>=0;n--){let i=new Date(o);i.setDate(i.getDate()-n),t.push(i.toLocaleDateString("en-US",{month:"short",day:"2-digit"}));}break}}return t}function c9(e,t){let o=new Date(e);switch(o.setMinutes(0,0,0),t){case CreditUsageTimeRange.LastDay:return o.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});case CreditUsageTimeRange.LastYear:return e.toLocaleDateString("en-US",{month:"short",year:"2-digit"});case CreditUsageTimeRange.LastWeek:case CreditUsageTimeRange.LastMonth:default:return e.toLocaleDateString("en-US",{month:"short",day:"2-digit"})}}function d9(e,t){return {responsive:true,maintainAspectRatio:false,interaction:{mode:"point",intersect:true},elements:{bar:{borderRadius:4,borderSkipped:"bottom"}},plugins:{legend:{display:false},tooltip:{enabled:false,external:t},datalabels:{display:false}},scales:{x:{type:"category",stacked:true,ticks:{color:Tu(e),font:wu(e),maxRotation:45,maxTicksLimit:15},grid:{color:ku(e),drawOnChartArea:false,drawTicks:false}},y:{type:"linear",stacked:true,beginAtZero:true,ticks:{color:Tu(e),font:wu(e),callback:o=>gt(Number(o))},grid:{color:Su(ku(e),.5),drawOnChartArea:true,drawTicks:false,borderDash:[5,5]}}}}}function ib(e,t,o,n){let i=l9(n);if(!e||!e.series||e.series.length===0)return {data:null,options:null};let r=e.series.map((l,c)=>{let d=l.featureName,u=new Map;l.points.forEach(h=>{let f=c9(new Date(h.timestamp),n),g=u.get(f)||0;u.set(f,g+h.value);});let p=i.map(h=>u.get(h)||0),m=vu(c);return {label:d,data:p,backgroundColor:Su(m,.8),borderColor:m,borderWidth:1}}).reverse(),a={labels:i,datasets:r},s=d9(t,o);return {data:a,options:s}}var g9=300;function ab(e,t){let o=t.dataPoints[0],n=o.parsed.y,i=e.scales.y,r=n/i.max*(i.bottom-i.top),a=t.caretY+r/2,s=e.getDatasetMeta(o.datasetIndex).data[o.dataIndex],l=s.x-s.width/2,c=e.canvas.offsetTop+a,d=e.canvas.offsetLeft+l;return {top:c,left:d}}function y9(e,t){let o=e.canvas.offsetTop+t.caretY,n=e.canvas.offsetLeft+t.caretX;return {top:o,left:n}}function sb(e,t=y9){let[o,n]=useState(0),[i,r]=useState(0),[a,s]=useState(false),[l,c]=useState(),d=useCallback(p=>{let{chart:m,tooltip:h}=p;if(h.opacity===0){s(false);return}let{top:f,left:g}=t(m,h);r(g),n(f),c(e(h)),s(true);},[e,t]);return {tooltipInfo:{positionTop:o,positionLeft:i,isOpen:a,payload:l},tooltipHandler:d}}var x9=x(Box)`
1017
+ `):e}function Y4(e,t){let{element:o,datasetIndex:n,index:i}=t,r=e.getDatasetMeta(n).controller,{label:a,value:s}=r.getLabelAndValue(i);return {chart:e,label:a,parsed:r.getParsed(i),raw:e.data.datasets[n].data[i],formattedValue:s,dataset:r.getDataset(),dataIndex:i,datasetIndex:n,element:o}}function _0(e,t){let o=e.chart.ctx,{body:n,footer:i,title:r}=e,{boxWidth:a,boxHeight:s}=t,l=it(t.bodyFont),c=it(t.titleFont),d=it(t.footerFont),u=r.length,p=i.length,h=n.length,m=pt(t.padding),g=m.height,f=0,x=n.reduce((k,w)=>k+w.before.length+w.lines.length+w.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,u&&(g+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),x){let k=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;g+=h*k+(x-h)*l.lineHeight+(x-1)*t.bodySpacing;}p&&(g+=t.footerMarginTop+p*d.lineHeight+(p-1)*t.footerSpacing);let b=0,T=function(k){f=Math.max(f,o.measureText(k).width+b);};return o.save(),o.font=c.string,K(e.title,T),o.font=l.string,K(e.beforeBody.concat(e.afterBody),T),b=t.displayColors?a+2+t.boxPadding:0,K(n,k=>{K(k.before,T),K(k.lines,T),K(k.after,T);}),b=0,o.font=d.string,K(e.footer,T),o.restore(),f+=m.width,{width:f,height:g}}function Z4(e,t){let{y:o,height:n}=t;return o<n/2?"top":o>e.height-n/2?"bottom":"center"}function X4(e,t,o,n){let{x:i,width:r}=n,a=o.caretSize+o.caretPadding;if(e==="left"&&i+r+a>t.width||e==="right"&&i-r-a<0)return true}function K4(e,t,o,n){let{x:i,width:r}=o,{width:a,chartArea:{left:s,right:l}}=e,c="center";return n==="center"?c=i<=(s+l)/2?"left":"right":i<=r/2?c="left":i>=a-r/2&&(c="right"),X4(c,e,t,o)&&(c="center"),c}function A0(e,t,o){let n=o.yAlign||t.yAlign||Z4(e,o);return {xAlign:o.xAlign||t.xAlign||K4(e,t,o,n),yAlign:n}}function q4(e,t){let{x:o,width:n}=e;return t==="right"?o-=n:t==="center"&&(o-=n/2),o}function Q4(e,t,o){let{y:n,height:i}=e;return t==="top"?n+=o:t==="bottom"?n-=i+o:n-=i/2,n}function M0(e,t,o,n){let{caretSize:i,caretPadding:r,cornerRadius:a}=e,{xAlign:s,yAlign:l}=o,c=i+r,{topLeft:d,topRight:u,bottomLeft:p,bottomRight:h}=fe(a),m=q4(t,s),g=Q4(t,l,c);return l==="center"?s==="left"?m+=c:s==="right"&&(m-=c):s==="left"?m-=Math.max(d,p)+i:s==="right"&&(m+=Math.max(u,h)+i),{x:Ct(m,0,n.width-t.width),y:Ct(g,0,n.height-t.height)}}function As(e,t,o){let n=pt(o.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-n.right:e.x+n.left}function I0(e){return Ie([],Ye(e))}function J4(e,t,o){return Me(e,{tooltip:t,tooltipItems:o,type:"tooltip"})}function E0(e,t){let o=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return o?e.override(o):e}var rr=class extends xt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0;}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0;}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let o=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&o.options.animation&&n.animations,r=new Hn(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=J4(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,o){let{callbacks:n}=o,i=n.beforeTitle.apply(this,[t]),r=n.title.apply(this,[t]),a=n.afterTitle.apply(this,[t]),s=[];return s=Ie(s,Ye(i)),s=Ie(s,Ye(r)),s=Ie(s,Ye(a)),s}getBeforeBody(t,o){return I0(o.callbacks.beforeBody.apply(this,[t]))}getBody(t,o){let{callbacks:n}=o,i=[];return K(t,r=>{let a={before:[],lines:[],after:[]},s=E0(n,r);Ie(a.before,Ye(s.beforeLabel.call(this,r))),Ie(a.lines,s.label.call(this,r)),Ie(a.after,Ye(s.afterLabel.call(this,r))),i.push(a);}),i}getAfterBody(t,o){return I0(o.callbacks.afterBody.apply(this,[t]))}getFooter(t,o){let{callbacks:n}=o,i=n.beforeFooter.apply(this,[t]),r=n.footer.apply(this,[t]),a=n.afterFooter.apply(this,[t]),s=[];return s=Ie(s,Ye(i)),s=Ie(s,Ye(r)),s=Ie(s,Ye(a)),s}_createItems(t){let o=this._active,n=this.chart.data,i=[],r=[],a=[],s=[],l,c;for(l=0,c=o.length;l<c;++l)s.push(Y4(this.chart,o[l]));return t.filter&&(s=s.filter((d,u,p)=>t.filter(d,u,p,n))),t.itemSort&&(s=s.sort((d,u)=>t.itemSort(d,u,n))),K(s,d=>{let u=E0(t.callbacks,d);i.push(u.labelColor.call(this,d)),r.push(u.labelPointStyle.call(this,d)),a.push(u.labelTextColor.call(this,d));}),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=s,s}update(t,o){let n=this.options.setContext(this.getContext()),i=this._active,r,a=[];if(!i.length)this.opacity!==0&&(r={opacity:0});else {let s=er[n.position].call(this,i,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let l=this._size=_0(this,n),c=Object.assign({},s,l),d=A0(this.chart,n,c),u=M0(n,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,r={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y};}this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:o});}drawCaret(t,o,n,i){let r=this.getCaretPosition(t,n,i);o.lineTo(r.x1,r.y1),o.lineTo(r.x2,r.y2),o.lineTo(r.x3,r.y3);}getCaretPosition(t,o,n){let{xAlign:i,yAlign:r}=this,{caretSize:a,cornerRadius:s}=n,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:u}=fe(s),{x:p,y:h}=t,{width:m,height:g}=o,f,x,b,T,k,w;return r==="center"?(k=h+g/2,i==="left"?(f=p,x=f-a,T=k+a,w=k-a):(f=p+m,x=f+a,T=k-a,w=k+a),b=f):(i==="left"?x=p+Math.max(l,d)+a:i==="right"?x=p+m-Math.max(c,u)-a:x=this.caretX,r==="top"?(T=h,k=T-a,f=x-a,b=x+a):(T=h+g,k=T+a,f=x+a,b=x-a),w=T),{x1:f,x2:x,x3:b,y1:T,y2:k,y3:w}}drawTitle(t,o,n){let i=this.title,r=i.length,a,s,l;if(r){let c=Co(n.rtl,this.x,this.width);for(t.x=As(this,n.titleAlign,n),o.textAlign=c.textAlign(n.titleAlign),o.textBaseline="middle",a=it(n.titleFont),s=n.titleSpacing,o.fillStyle=n.titleColor,o.font=a.string,l=0;l<r;++l)o.fillText(i[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===r&&(t.y+=n.titleMarginBottom-s);}}_drawColorBox(t,o,n,i,r){let a=this.labelColors[n],s=this.labelPointStyles[n],{boxHeight:l,boxWidth:c,boxPadding:d}=r,u=it(r.bodyFont),p=As(this,"left",r),h=i.x(p),m=l<u.lineHeight?(u.lineHeight-l)/2:0,g=o.y+m;if(r.usePointStyle){let f={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},x=i.leftForLtr(h,c)+c/2,b=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Gi(t,f,x,b),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Gi(t,f,x,b);}else {t.lineWidth=z(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;let f=i.leftForLtr(h,c-d),x=i.leftForLtr(i.xPlus(h,1),c-d-2),b=fe(a.borderRadius);Object.values(b).some(T=>T!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,We(t,{x:f,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),We(t,{x,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(f,g,c,l),t.strokeRect(f,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(x,g+1,c-2,l-2));}t.fillStyle=this.labelTextColors[n];}drawBody(t,o,n){let{body:i}=this,{bodySpacing:r,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c,boxPadding:d}=n,u=it(n.bodyFont),p=u.lineHeight,h=0,m=Co(n.rtl,this.x,this.width),g=function(M){o.fillText(M,m.x(t.x+h),t.y+p/2),t.y+=p+r;},f=m.textAlign(a),x,b,T,k,w,v,_;for(o.textAlign=a,o.textBaseline="middle",o.font=u.string,t.x=As(this,f,n),o.fillStyle=n.bodyColor,K(this.beforeBody,g),h=s&&f!=="right"?a==="center"?c/2+d:c+2+d:0,k=0,v=i.length;k<v;++k){for(x=i[k],b=this.labelTextColors[k],o.fillStyle=b,K(x.before,g),T=x.lines,s&&T.length&&(this._drawColorBox(o,t,k,m,n),p=Math.max(u.lineHeight,l)),w=0,_=T.length;w<_;++w)g(T[w]),p=u.lineHeight;K(x.after,g);}h=0,p=u.lineHeight,K(this.afterBody,g),t.y-=r;}drawFooter(t,o,n){let i=this.footer,r=i.length,a,s;if(r){let l=Co(n.rtl,this.x,this.width);for(t.x=As(this,n.footerAlign,n),t.y+=n.footerMarginTop,o.textAlign=l.textAlign(n.footerAlign),o.textBaseline="middle",a=it(n.footerFont),o.fillStyle=n.footerColor,o.font=a.string,s=0;s<r;++s)o.fillText(i[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+n.footerSpacing;}}drawBackground(t,o,n,i){let{xAlign:r,yAlign:a}=this,{x:s,y:l}=t,{width:c,height:d}=n,{topLeft:u,topRight:p,bottomLeft:h,bottomRight:m}=fe(i.cornerRadius);o.fillStyle=i.backgroundColor,o.strokeStyle=i.borderColor,o.lineWidth=i.borderWidth,o.beginPath(),o.moveTo(s+u,l),a==="top"&&this.drawCaret(t,o,n,i),o.lineTo(s+c-p,l),o.quadraticCurveTo(s+c,l,s+c,l+p),a==="center"&&r==="right"&&this.drawCaret(t,o,n,i),o.lineTo(s+c,l+d-m),o.quadraticCurveTo(s+c,l+d,s+c-m,l+d),a==="bottom"&&this.drawCaret(t,o,n,i),o.lineTo(s+h,l+d),o.quadraticCurveTo(s,l+d,s,l+d-h),a==="center"&&r==="left"&&this.drawCaret(t,o,n,i),o.lineTo(s,l+u),o.quadraticCurveTo(s,l,s+u,l),o.closePath(),o.fill(),i.borderWidth>0&&o.stroke();}_updateAnimationTarget(t){let o=this.chart,n=this.$animations,i=n&&n.x,r=n&&n.y;if(i||r){let a=er[t.position].call(this,this._active,this._eventPosition);if(!a)return;let s=this._size=_0(this,t),l=Object.assign({},a,this._size),c=A0(o,t,l),d=M0(t,l,c,o);(i._to!==d.x||r._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d));}}_willRender(){return !!this.opacity}draw(t){let o=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(o);let i={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=pt(o.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&s&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,i,o),Ps(t,o.textDirection),r.y+=a.top,this.drawTitle(r,t,o),this.drawBody(r,t,o),this.drawFooter(r,t,o),Ss(t,o.textDirection),t.restore());}getActiveElements(){return this._active||[]}setActiveElements(t,o){let n=this._active,i=t.map(({datasetIndex:s,index:l})=>{let c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return {datasetIndex:s,element:c.data[l],index:l}}),r=!zn(n,i),a=this._positionChanged(i,o);(r||a)&&(this._active=i,this._eventPosition=o,this._ignoreReplayEvents=true,this.update(true));}handleEvent(t,o,n=true){if(o&&this._ignoreReplayEvents)return false;this._ignoreReplayEvents=false;let i=this.options,r=this._active||[],a=this._getActiveElements(t,r,o,n),s=this._positionChanged(a,t),l=o||!zn(a,r)||s;return l&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(true,o))),l}_getActiveElements(t,o,n,i){let r=this.options;if(t.type==="mouseout")return [];if(!i)return o;let a=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&a.reverse(),a}_positionChanged(t,o){let{caretX:n,caretY:i,options:r}=this,a=er[r.position].call(this,t,o);return a!==false&&(n!==a.x||i!==a.y)}};rr.positioners=er;var rx={id:"tooltip",_element:rr,positioners:er,afterInit(e,t,o){o&&(e.tooltip=new rr({chart:e,options:o}));},beforeUpdate(e,t,o){e.tooltip&&e.tooltip.initialize(o);},reset(e,t,o){e.tooltip&&e.tooltip.initialize(o);},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let o={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",o)===false)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",o);}},afterEvent(e,t){if(e.tooltip){let o=t.replay;e.tooltip.handleEvent(t.event,o,t.inChartArea)&&(t.changed=true);}},defaults:{enabled:true,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:true,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:he,title(e){if(e.length>0){let t=e[0],o=t.chart.data.labels,n=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return o[t.dataIndex]}return ""},afterTitle:he,beforeBody:he,beforeLabel:he,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let o=e.formattedValue;return W(o)||(t+=o),t},labelColor(e){let o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return {borderColor:o.borderColor,backgroundColor:o.backgroundColor,borderWidth:o.borderWidth,borderDash:o.borderDash,borderDashOffset:o.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return {pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:he,afterBody:he,beforeFooter:he,footer:he,afterFooter:he}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:false,callbacks:{_scriptable:false,_indexable:false},animation:{_fallback:false},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};var t8=(e,t,o,n)=>(typeof t=="string"?(o=e.push(t)-1,n.unshift({index:o,label:t})):isNaN(t)&&(o=null),o);function e8(e,t,o,n){let i=e.indexOf(t);if(i===-1)return t8(e,t,o,n);let r=e.lastIndexOf(t);return i!==r?o:i}var o8=(e,t)=>e===null?null:Ct(Math.round(e),0,t),an=class extends rn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[];}init(t){let o=this._addedLabels;if(o.length){let n=this.getLabels();for(let{index:i,label:r}of o)n[i]===r&&n.splice(i,1);this._addedLabels=[];}super.init(t);}parse(t,o){if(W(t))return null;let n=this.getLabels();return o=isFinite(o)&&n[o]===t?o:e8(n,t,N(o,t),this._addedLabels),o8(o,n.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:o}=this.getUserBounds(),{min:n,max:i}=this.getMinMax(true);this.options.bounds==="ticks"&&(t||(n=0),o||(i=this.getLabels().length-1)),this.min=n,this.max=i;}buildTicks(){let t=this.min,o=this.max,n=this.options.offset,i=[],r=this.getLabels();r=t===0&&o===r.length-1?r:r.slice(t,o+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let a=t;a<=o;a++)i.push({value:a});return i}getLabelForValue(t){let o=this.getLabels();return t>=0&&t<o.length?o[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels);}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};an.id="category";an.defaults={ticks:{callback:an.prototype.getLabelForValue}};function n8(e,t){let o=[],{bounds:i,step:r,min:a,max:s,precision:l,count:c,maxTicks:d,maxDigits:u,includeBounds:p}=e,h=r||1,m=d-1,{min:g,max:f}=t,x=!W(a),b=!W(s),T=!W(c),k=(f-g)/(u+1),w=es((f-g)/m/h)*h,v,_,M,I;if(w<1e-14&&!x&&!b)return [{value:g},{value:f}];I=Math.ceil(f/w)-Math.floor(g/w),I>m&&(w=es(I*w/m/h)*h),W(l)||(v=Math.pow(10,l),w=Math.ceil(w*v)/v),i==="ticks"?(_=Math.floor(g/w)*w,M=Math.ceil(f/w)*w):(_=g,M=f),x&&b&&r&&bd((s-a)/r,w/1e3)?(I=Math.round(Math.min((s-a)/w,d)),w=(s-a)/I,_=a,M=s):T?(_=x?a:_,M=b?s:M,I=c-1,w=(M-_)/I):(I=(M-_)/w,qo(I,Math.round(I),w/1e3)?I=Math.round(I):I=Math.ceil(I));let F=Math.max(ns(w),ns(_));v=Math.pow(10,W(l)?F:l),_=Math.round(_*v)/v,M=Math.round(M*v)/v;let E=0;for(x&&(p&&_!==a?(o.push({value:a}),_<a&&E++,qo(Math.round((_+E*w)*v)/v,a,F0(a,k,e))&&E++):_<a&&E++);E<I;++E)o.push({value:Math.round((_+E*w)*v)/v});return b&&p&&M!==s?o.length&&qo(o[o.length-1].value,s,F0(s,k,e))?o[o.length-1].value=s:o.push({value:s}):(!b||M===s)&&o.push({value:M}),o}function F0(e,t,{horizontal:o,minRotation:n}){let i=gt(n),r=(o?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+e).length;return Math.min(t/r,a)}var Xn=class extends rn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0;}parse(t,o){return W(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:o,maxDefined:n}=this.getUserBounds(),{min:i,max:r}=this,a=l=>i=o?i:l,s=l=>r=n?r:l;if(t){let l=re(i),c=re(r);l<0&&c<0?s(0):l>0&&c>0&&a(0);}if(i===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||i<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(r*.05)),s(r+l),t||a(i-l);}this.min=i,this.max=r;}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:o,stepSize:n}=t,i;return n?(i=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),o=o||11),o&&(i=Math.min(o,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,o=t.ticks,n=this.getTickLimit();n=Math.max(2,n);let i={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:o.precision,step:o.stepSize,count:o.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:o.minRotation||0,includeBounds:o.includeBounds!==false},r=this._range||this,a=n8(i,r);return t.bounds==="ticks"&&os(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){let t=this.ticks,o=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){let i=(n-o)/Math.max(t.length-1,1)/2;o-=i,n+=i;}this._startValue=o,this._endValue=n,this._valueRange=n-o;}getLabelForValue(t){return en(t,this.chart.options.locale,this.options.ticks.format)}},Kn=class extends Xn{determineDataLimits(){let{min:t,max:o}=this.getMinMax(true);this.min=lt(t)?t:0,this.max=lt(o)?o:1,this.handleTickRangeOptions();}computeTickLimit(){let t=this.isHorizontal(),o=t?this.width:this.height,n=gt(this.options.ticks.minRotation),i=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,r.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};Kn.id="linear";Kn.defaults={ticks:{callback:Os.formatters.numeric}};function L0(e){return e/Math.pow(10,Math.floor(zt(e)))===1}function i8(e,t){let o=Math.floor(zt(t.max)),n=Math.ceil(t.max/Math.pow(10,o)),i=[],r=Ot(e.min,Math.pow(10,Math.floor(zt(t.min)))),a=Math.floor(zt(r)),s=Math.floor(r/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do i.push({value:r,major:L0(r)}),++s,s===10&&(s=1,++a,l=a>=0?1:l),r=Math.round(s*Math.pow(10,a)*l)/l;while(a<o||a===o&&s<n);let c=Ot(e.max,r);return i.push({value:c,major:L0(r)}),i}var Ns=class extends rn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0;}parse(t,o){let n=Xn.prototype.parse.apply(this,[t,o]);if(n===0){this._zero=true;return}return lt(n)&&n>0?n:null}determineDataLimits(){let{min:t,max:o}=this.getMinMax(true);this.min=lt(t)?Math.max(0,t):null,this.max=lt(o)?Math.max(0,o):null,this.options.beginAtZero&&(this._zero=true),this.handleTickRangeOptions();}handleTickRangeOptions(){let{minDefined:t,maxDefined:o}=this.getUserBounds(),n=this.min,i=this.max,r=l=>n=t?n:l,a=l=>i=o?i:l,s=(l,c)=>Math.pow(10,Math.floor(zt(l))+c);n===i&&(n<=0?(r(1),a(10)):(r(s(n,-1)),a(s(i,1)))),n<=0&&r(s(i,-1)),i<=0&&a(s(n,1)),this._zero&&this.min!==this._suggestedMin&&n===s(this.min,0)&&r(s(n,-1)),this.min=n,this.max=i;}buildTicks(){let t=this.options,o={min:this._userMin,max:this._userMax},n=i8(o,this);return t.bounds==="ticks"&&os(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":en(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=zt(t),this._valueRange=zt(this.max)-zt(t);}getPixelForValue(t){return (t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(zt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let o=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+o*this._valueRange)}};Ns.id="logarithmic";Ns.defaults={ticks:{callback:Os.formatters.logarithmic,major:{enabled:true}}};function cu(e){let t=e.ticks;if(t.display&&e.display){let o=pt(t.backdropPadding);return N(t.font&&t.font.size,H.font.size)+o.height}return 0}function r8(e,t,o){return o=Z(o)?o:[o],{w:Id(e,t.string,o),h:o.length*t.lineHeight}}function B0(e,t,o,n,i){return e===n||e===i?{start:t-o/2,end:t+o/2}:e<n||e>i?{start:t-o,end:t}:{start:t,end:t+o}}function a8(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},o=Object.assign({},t),n=[],i=[],r=e._pointLabels.length,a=e.options.pointLabels,s=a.centerPointLabels?G/r:0;for(let l=0;l<r;l++){let c=a.setContext(e.getPointLabelContext(l));i[l]=c.padding;let d=e.getPointPosition(l,e.drawingArea+i[l],s),u=it(c.font),p=r8(e.ctx,u,e._pointLabels[l]);n[l]=p;let h=Ft(e.getIndexAngle(l)+s),m=Math.round(Qo(h)),g=B0(m,d.x,p.w,0,180),f=B0(m,d.y,p.h,90,270);s8(o,t,h,g,f);}e.setCenterPoint(t.l-o.l,o.r-t.r,t.t-o.t,o.b-t.b),e._pointLabelItems=l8(e,n,i);}function s8(e,t,o,n,i){let r=Math.abs(Math.sin(o)),a=Math.abs(Math.cos(o)),s=0,l=0;n.start<t.l?(s=(t.l-n.start)/r,e.l=Math.min(e.l,t.l-s)):n.end>t.r&&(s=(n.end-t.r)/r,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(l=(t.t-i.start)/a,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/a,e.b=Math.max(e.b,t.b+l));}function l8(e,t,o){let n=[],i=e._pointLabels.length,r=e.options,a=cu(r)/2,s=e.drawingArea,l=r.pointLabels.centerPointLabels?G/i:0;for(let c=0;c<i;c++){let d=e.getPointPosition(c,s+a+o[c],l),u=Math.round(Qo(Ft(d.angle+et))),p=t[c],h=u8(d.y,p.h,u),m=c8(u),g=d8(d.x,p.w,m);n.push({x:d.x,y:h,textAlign:m,left:g,top:h,right:g+p.w,bottom:h+p.h});}return n}function c8(e){return e===0||e===180?"center":e<180?"left":"right"}function d8(e,t,o){return o==="right"?e-=t:o==="center"&&(e-=t/2),e}function u8(e,t,o){return o===90||o===270?e-=t/2:(o>270||o<90)&&(e-=t),e}function p8(e,t){let{ctx:o,options:{pointLabels:n}}=e;for(let i=t-1;i>=0;i--){let r=n.setContext(e.getPointLabelContext(i)),a=it(r.font),{x:s,y:l,textAlign:c,left:d,top:u,right:p,bottom:h}=e._pointLabelItems[i],{backdropColor:m}=r;if(!W(m)){let g=fe(r.borderRadius),f=pt(r.backdropPadding);o.fillStyle=m;let x=d-f.left,b=u-f.top,T=p-d+f.width,k=h-u+f.height;Object.values(g).some(w=>w!==0)?(o.beginPath(),We(o,{x,y:b,w:T,h:k,radius:g}),o.fill()):o.fillRect(x,b,T,k);}He(o,e._pointLabels[i],s,l+a.lineHeight/2,a,{color:r.color,textAlign:c,textBaseline:"middle"});}}function ax(e,t,o,n){let{ctx:i}=e;if(o)i.arc(e.xCenter,e.yCenter,t,0,Q);else {let r=e.getPointPosition(0,t);i.moveTo(r.x,r.y);for(let a=1;a<n;a++)r=e.getPointPosition(a,t),i.lineTo(r.x,r.y);}}function m8(e,t,o,n){let i=e.ctx,r=t.circular,{color:a,lineWidth:s}=t;!r&&!n||!a||!s||o<0||(i.save(),i.strokeStyle=a,i.lineWidth=s,i.setLineDash(t.borderDash),i.lineDashOffset=t.borderDashOffset,i.beginPath(),ax(e,o,r,n),i.closePath(),i.stroke(),i.restore());}function h8(e,t,o){return Me(e,{label:o,index:t,type:"pointLabel"})}var qn=class extends Xn{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[];}setDimensions(){let t=this._padding=pt(cu(this.options)/2),o=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+o/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(o,n)/2);}determineDataLimits(){let{min:t,max:o}=this.getMinMax(false);this.min=lt(t)&&!isNaN(t)?t:0,this.max=lt(o)&&!isNaN(o)?o:0,this.handleTickRangeOptions();}computeTickLimit(){return Math.ceil(this.drawingArea/cu(this.options))}generateTickLabels(t){Xn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((o,n)=>{let i=X(this.options.pointLabels.callback,[o,n],this);return i||i===0?i:""}).filter((o,n)=>this.chart.getDataVisibility(n));}fit(){let t=this.options;t.display&&t.pointLabels.display?a8(this):this.setCenterPoint(0,0,0,0);}setCenterPoint(t,o,n,i){this.xCenter+=Math.floor((t-o)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,o,n,i));}getIndexAngle(t){let o=Q/(this._pointLabels.length||1),n=this.options.startAngle||0;return Ft(t*o+gt(n))}getDistanceFromCenterForValue(t){if(W(t))return NaN;let o=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*o:(t-this.min)*o}getValueForDistanceFromCenter(t){if(W(t))return NaN;let o=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-o:this.min+o}getPointLabelContext(t){let o=this._pointLabels||[];if(t>=0&&t<o.length){let n=o[t];return h8(this.getContext(),t,n)}}getPointPosition(t,o,n=0){let i=this.getIndexAngle(t)-et+n;return {x:Math.cos(i)*o+this.xCenter,y:Math.sin(i)*o+this.yCenter,angle:i}}getPointPositionForValue(t,o){return this.getPointPosition(t,this.getDistanceFromCenterForValue(o))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:o,top:n,right:i,bottom:r}=this._pointLabelItems[t];return {left:o,top:n,right:i,bottom:r}}drawBackground(){let{backgroundColor:t,grid:{circular:o}}=this.options;if(t){let n=this.ctx;n.save(),n.beginPath(),ax(this,this.getDistanceFromCenterForValue(this._endValue),o,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore();}}drawGrid(){let t=this.ctx,o=this.options,{angleLines:n,grid:i}=o,r=this._pointLabels.length,a,s,l;if(o.pointLabels.display&&p8(this,r),i.display&&this.ticks.forEach((c,d)=>{if(d!==0){s=this.getDistanceFromCenterForValue(c.value);let u=i.setContext(this.getContext(d-1));m8(this,u,s,r);}}),n.display){for(t.save(),a=r-1;a>=0;a--){let c=n.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:u}=c;!u||!d||(t.lineWidth=u,t.strokeStyle=d,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,s=this.getDistanceFromCenterForValue(o.ticks.reverse?this.min:this.max),l=this.getPointPosition(a,s),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke());}t.restore();}}drawBorder(){}drawLabels(){let t=this.ctx,o=this.options,n=o.ticks;if(!n.display)return;let i=this.getIndexAngle(0),r,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,l)=>{if(l===0&&!o.reverse)return;let c=n.setContext(this.getContext(l)),d=it(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,a=t.measureText(s.label).width,t.fillStyle=c.backdropColor;let u=pt(c.backdropPadding);t.fillRect(-a/2-u.left,-r-d.size/2-u.top,a+u.width,d.size+u.height);}He(t,s.label,0,-r,d,{color:c.color});}),t.restore();}drawTitle(){}};qn.id="radialLinear";qn.defaults={display:true,animate:true,position:"chartArea",angleLines:{display:true,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:false},startAngle:0,ticks:{showLabelBackdrop:true,callback:Os.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:true,font:{size:10},callback(e){return e},padding:5,centerPointLabels:false}};qn.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};qn.descriptors={angleLines:{_fallback:"grid"}};var zs={millisecond:{common:true,size:1,steps:1e3},second:{common:true,size:1e3,steps:60},minute:{common:true,size:6e4,steps:60},hour:{common:true,size:36e5,steps:24},day:{common:true,size:864e5,steps:30},week:{common:false,size:6048e5,steps:4},month:{common:true,size:2628e6,steps:12},quarter:{common:false,size:7884e6,steps:4},year:{common:true,size:3154e7}},Vt=Object.keys(zs);function g8(e,t){return e-t}function R0(e,t){if(W(t))return null;let o=e._adapter,{parser:n,round:i,isoWeekday:r}=e._parseOpts,a=t;return typeof n=="function"&&(a=n(a)),lt(a)||(a=typeof n=="string"?o.parse(a,n):o.parse(a)),a===null?null:(i&&(a=i==="week"&&(Kt(r)||r===true)?o.startOf(a,"isoWeek",r):o.startOf(a,i)),+a)}function D0(e,t,o,n){let i=Vt.length;for(let r=Vt.indexOf(e);r<i-1;++r){let a=zs[Vt[r]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((o-t)/(s*a.size))<=n)return Vt[r]}return Vt[i-1]}function f8(e,t,o,n,i){for(let r=Vt.length-1;r>=Vt.indexOf(o);r--){let a=Vt[r];if(zs[a].common&&e._adapter.diff(i,n,a)>=t-1)return a}return Vt[o?Vt.indexOf(o):0]}function y8(e){for(let t=Vt.indexOf(e)+1,o=Vt.length;t<o;++t)if(zs[Vt[t]].common)return Vt[t]}function N0(e,t,o){if(!o)e[t]=true;else if(o.length){let{lo:n,hi:i}=$i(o,t),r=o[n]>=t?o[n]:o[i];e[r]=true;}}function x8(e,t,o,n){let i=e._adapter,r=+i.startOf(t[0].value,n),a=t[t.length-1].value,s,l;for(s=r;s<=a;s=+i.add(s,1,n))l=o[s],l>=0&&(t[l].major=true);return t}function U0(e,t,o){let n=[],i={},r=t.length,a,s;for(a=0;a<r;++a)s=t[a],i[s]=a,n.push({value:s,major:false});return r===0||!o?n:x8(e,n,i,o)}var Qn=class extends rn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=false,this._parseOpts=void 0;}init(t,o){let n=t.time||(t.time={}),i=this._adapter=new b_._date(t.adapters.date);i.init(o),Ko(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=o.normalized;}parse(t,o){return t===void 0?null:R0(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]};}determineDataLimits(){let t=this.options,o=this._adapter,n=t.time.unit||"day",{min:i,max:r,minDefined:a,maxDefined:s}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!s&&!isNaN(c.max)&&(r=Math.max(r,c.max));}(!a||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(false))),i=lt(i)&&!isNaN(i)?i:+o.startOf(Date.now(),n),r=lt(r)&&!isNaN(r)?r:+o.endOf(Date.now(),n)+1,this.min=Math.min(i,r-1),this.max=Math.max(i+1,r);}_getLabelBounds(){let t=this.getLabelTimestamps(),o=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(o=t[0],n=t[t.length-1]),{min:o,max:n}}buildTicks(){let t=this.options,o=t.time,n=t.ticks,i=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);let r=this.min,a=this.max,s=Sd(i,r,a);return this._unit=o.unit||(n.autoSkip?D0(o.minUnit,this.min,this.max,this._getLabelCapacity(r)):f8(this,s.length,o.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:y8(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),U0(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value));}initOffsets(t){let o=0,n=0,i,r;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?o=1-i:o=(this.getDecimalForValue(t[1])-i)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?n=r:n=(r-this.getDecimalForValue(t[t.length-2]))/2);let a=t.length<3?.5:.25;o=Ct(o,0,a),n=Ct(n,0,a),this._offsets={start:o,end:n,factor:1/(o+1+n)};}_generate(){let t=this._adapter,o=this.min,n=this.max,i=this.options,r=i.time,a=r.unit||D0(r.minUnit,o,n,this._getLabelCapacity(o)),s=N(r.stepSize,1),l=a==="week"?r.isoWeekday:false,c=Kt(l)||l===true,d={},u=o,p,h;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":a),t.diff(n,o,a)>1e5*s)throw new Error(o+" and "+n+" are too far apart with stepSize of "+s+" "+a);let m=i.ticks.source==="data"&&this.getDataTimestamps();for(p=u,h=0;p<n;p=+t.add(p,s,a),h++)N0(d,p,m);return (p===n||i.bounds==="ticks"||h===1)&&N0(d,p,m),Object.keys(d).sort((g,f)=>g-f).map(g=>+g)}getLabelForValue(t){let o=this._adapter,n=this.options.time;return n.tooltipFormat?o.format(t,n.tooltipFormat):o.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,o,n,i){let r=this.options,a=r.time.displayFormats,s=this._unit,l=this._majorUnit,c=s&&a[s],d=l&&a[l],u=n[o],p=l&&d&&u&&u.major,h=this._adapter.format(t,i||(p?d:c)),m=r.ticks.callback;return m?X(m,[h,o,n],this):h}generateTickLabels(t){let o,n,i;for(o=0,n=t.length;o<n;++o)i=t[o],i.label=this._tickFormatFunction(i.value,o,t);}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let o=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((o.start+n)*o.factor)}getValueForPixel(t){let o=this._offsets,n=this.getDecimalForPixel(t)/o.factor-o.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){let o=this.options.ticks,n=this.ctx.measureText(t).width,i=gt(this.isHorizontal()?o.maxRotation:o.minRotation),r=Math.cos(i),a=Math.sin(i),s=this._resolveTickFontOptions(0).size;return {w:n*r+s*a,h:n*a+s*r}}_getLabelCapacity(t){let o=this.options.time,n=o.displayFormats,i=n[o.unit]||n.millisecond,r=this._tickFormatFunction(t,0,U0(this,[t],this._majorUnit),i),a=this._getLabelSize(r),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],o,n;if(t.length)return t;let i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(o=0,n=i.length;o<n;++o)t=t.concat(i[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],o,n;if(t.length)return t;let i=this.getLabels();for(o=0,n=i.length;o<n;++o)t.push(R0(this,i[o]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return as(t.sort(g8))}};Qn.id="time";Qn.defaults={bounds:"data",adapters:{},time:{parser:false,unit:false,round:false,isoWeekday:false,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:false}}};function Ms(e,t,o){let n=0,i=e.length-1,r,a,s,l;o?(t>=e[n].pos&&t<=e[i].pos&&({lo:n,hi:i}=ze(e,"pos",t)),{pos:r,time:s}=e[n],{pos:a,time:l}=e[i]):(t>=e[n].time&&t<=e[i].time&&({lo:n,hi:i}=ze(e,"time",t)),{time:r,pos:s}=e[n],{time:a,pos:l}=e[i]);let c=a-r;return c?s+(l-s)*(t-r)/c:s}var Us=class extends Qn{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0;}initOffsets(){let t=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(t);this._minPos=Ms(o,this.min),this._tableRange=Ms(o,this.max)-this._minPos,super.initOffsets(t);}buildLookupTable(t){let{min:o,max:n}=this,i=[],r=[],a,s,l,c,d;for(a=0,s=t.length;a<s;++a)c=t[a],c>=o&&c<=n&&i.push(c);if(i.length<2)return [{time:o,pos:0},{time:n,pos:1}];for(a=0,s=i.length;a<s;++a)d=i[a+1],l=i[a-1],c=i[a],Math.round((d+l)/2)!==c&&r.push({time:c,pos:a/(s-1)});return r}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let o=this.getDataTimestamps(),n=this.getLabelTimestamps();return o.length&&n.length?t=this.normalize(o.concat(n)):t=o.length?o:n,t=this._cache.all=t,t}getDecimalForValue(t){return (Ms(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let o=this._offsets,n=this.getDecimalForPixel(t)/o.factor-o.end;return Ms(this._table,n*this._tableRange+this._minPos,true)}};Us.id="timeseries";Us.defaults=Qn.defaults;var sx=(function(){if(typeof window!="undefined"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return (e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1})(),lr={toTextLines:function(e){var t=[],o;for(e=[].concat(e);e.length;)o=e.pop(),typeof o=="string"?t.unshift.apply(t,o.split(`
1018
+ `)):Array.isArray(o)?e.push.apply(e,o):W(e)||t.unshift(""+o);return t},textSize:function(e,t,o){var n=[].concat(t),i=n.length,r=e.font,a=0,s;for(e.font=o.string,s=0;s<i;++s)a=Math.max(e.measureText(n[s]).width,a);return e.font=r,{height:i*o.lineHeight,width:a}},bound:function(e,t,o){return Math.max(e,Math.min(t,o))},arrayDiff:function(e,t){var o=e.slice(),n=[],i,r,a,s;for(i=0,a=t.length;i<a;++i)s=t[i],r=o.indexOf(s),r===-1?n.push([s,1]):o.splice(r,1);for(i=0,a=o.length;i<a;++i)n.push([o[i],-1]);return n},rasterize:function(e){return Math.round(e*sx)/sx}};function uu(e,t){var o=t.x,n=t.y;if(o===null)return {x:0,y:-1};if(n===null)return {x:1,y:0};var i=e.x-o,r=e.y-n,a=Math.sqrt(i*i+r*r);return {x:a?i/a:0,y:a?r/a:-1}}function b8(e,t,o,n,i){switch(i){case "center":o=n=0;break;case "bottom":o=0,n=1;break;case "right":o=1,n=0;break;case "left":o=-1,n=0;break;case "top":o=0,n=-1;break;case "start":o=-o,n=-n;break;case "end":break;default:i*=Math.PI/180,o=Math.cos(i),n=Math.sin(i);break}return {x:e,y:t,vx:o,vy:n}}var C8=0,cx=1,dx=2,ux=4,px=8;function Vs(e,t,o){var n=C8;return e<o.left?n|=cx:e>o.right&&(n|=dx),t<o.top?n|=px:t>o.bottom&&(n|=ux),n}function P8(e,t){for(var o=e.x0,n=e.y0,i=e.x1,r=e.y1,a=Vs(o,n,t),s=Vs(i,r,t),l,c,d;!(!(a|s)||a&s);)l=a||s,l&px?(c=o+(i-o)*(t.top-n)/(r-n),d=t.top):l&ux?(c=o+(i-o)*(t.bottom-n)/(r-n),d=t.bottom):l&dx?(d=n+(r-n)*(t.right-o)/(i-o),c=t.right):l&cx&&(d=n+(r-n)*(t.left-o)/(i-o),c=t.left),l===a?(o=c,n=d,a=Vs(o,n,t)):(i=c,r=d,s=Vs(i,r,t));return {x0:o,x1:i,y0:n,y1:r}}function $s(e,t){var o=t.anchor,n=e,i,r;return t.clamp&&(n=P8(n,t.area)),o==="start"?(i=n.x0,r=n.y0):o==="end"?(i=n.x1,r=n.y1):(i=(n.x0+n.x1)/2,r=(n.y0+n.y1)/2),b8(i,r,e.vx,e.vy,t.align)}var Hs={arc:function(e,t){var o=(e.startAngle+e.endAngle)/2,n=Math.cos(o),i=Math.sin(o),r=e.innerRadius,a=e.outerRadius;return $s({x0:e.x+n*r,y0:e.y+i*r,x1:e.x+n*a,y1:e.y+i*a,vx:n,vy:i},t)},point:function(e,t){var o=uu(e,t.origin),n=o.x*e.options.radius,i=o.y*e.options.radius;return $s({x0:e.x-n,y0:e.y-i,x1:e.x+n,y1:e.y+i,vx:o.x,vy:o.y},t)},bar:function(e,t){var o=uu(e,t.origin),n=e.x,i=e.y,r=0,a=0;return e.horizontal?(n=Math.min(e.x,e.base),r=Math.abs(e.base-e.x)):(i=Math.min(e.y,e.base),a=Math.abs(e.base-e.y)),$s({x0:n,y0:i+a,x1:n+r,y1:i,vx:o.x,vy:o.y},t)},fallback:function(e,t){var o=uu(e,t.origin);return $s({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:o.x,vy:o.y},t)}},qe=lr.rasterize;function S8(e){var t=e.borderWidth||0,o=e.padding,n=e.size.height,i=e.size.width,r=-i/2,a=-n/2;return {frame:{x:r-o.left-t,y:a-o.top-t,w:i+o.width+t*2,h:n+o.height+t*2},text:{x:r,y:a,w:i,h:n}}}function T8(e,t){var o=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!o)return null;if(o.xCenter!==void 0&&o.yCenter!==void 0)return {x:o.xCenter,y:o.yCenter};var n=o.getBasePixel();return e.horizontal?{x:n,y:null}:{x:null,y:n}}function k8(e){return e instanceof Ze?Hs.arc:e instanceof Xe?Hs.point:e instanceof Ke?Hs.bar:Hs.fallback}function w8(e,t,o,n,i,r){var a=Math.PI/2;if(r){var s=Math.min(r,i/2,n/2),l=t+s,c=o+s,d=t+n-s,u=o+i-s;e.moveTo(t,c),l<d&&c<u?(e.arc(l,c,s,-Math.PI,-a),e.arc(d,c,s,-a,0),e.arc(d,u,s,0,a),e.arc(l,u,s,a,Math.PI)):l<d?(e.moveTo(l,o),e.arc(d,c,s,-a,a),e.arc(l,c,s,a,Math.PI+a)):c<u?(e.arc(l,c,s,-Math.PI,0),e.arc(l,u,s,0,Math.PI)):e.arc(l,c,s,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,o);}else e.rect(t,o,n,i);}function v8(e,t,o){var n=o.backgroundColor,i=o.borderColor,r=o.borderWidth;!n&&(!i||!r)||(e.beginPath(),w8(e,qe(t.x)+r/2,qe(t.y)+r/2,qe(t.w)-r,qe(t.h)-r,o.borderRadius),e.closePath(),n&&(e.fillStyle=n,e.fill()),i&&r&&(e.strokeStyle=i,e.lineWidth=r,e.lineJoin="miter",e.stroke()));}function _8(e,t,o){var n=o.lineHeight,i=e.w,r=e.x,a=e.y+n/2;return t==="center"?r+=i/2:(t==="end"||t==="right")&&(r+=i),{h:n,w:i,x:r,y:a}}function A8(e,t,o){var n=e.shadowBlur,i=o.stroked,r=qe(o.x),a=qe(o.y),s=qe(o.w);i&&e.strokeText(t,r,a,s),o.filled&&(n&&i&&(e.shadowBlur=0),e.fillText(t,r,a,s),n&&i&&(e.shadowBlur=n));}function M8(e,t,o,n){var i=n.textAlign,r=n.color,a=!!r,s=n.font,l=t.length,c=n.textStrokeColor,d=n.textStrokeWidth,u=c&&d,p;if(!(!l||!a&&!u))for(o=_8(o,i,s),e.font=s.string,e.textAlign=i,e.textBaseline="middle",e.shadowBlur=n.textShadowBlur,e.shadowColor=n.textShadowColor,a&&(e.fillStyle=r),u&&(e.lineJoin="round",e.lineWidth=d,e.strokeStyle=c),p=0,l=t.length;p<l;++p)A8(e,t[p],{stroked:u,filled:a,w:o.w,x:o.x,y:o.y+o.h*p});}var mx=function(e,t,o,n){var i=this;i._config=e,i._index=n,i._model=null,i._rects=null,i._ctx=t,i._el=o;};Xt(mx.prototype,{_modelize:function(e,t,o,n){var i=this,r=i._index,a=it(rt([o.font,{}],n,r)),s=rt([o.color,H.color],n,r);return {align:rt([o.align,"center"],n,r),anchor:rt([o.anchor,"center"],n,r),area:n.chart.chartArea,backgroundColor:rt([o.backgroundColor,null],n,r),borderColor:rt([o.borderColor,null],n,r),borderRadius:rt([o.borderRadius,0],n,r),borderWidth:rt([o.borderWidth,0],n,r),clamp:rt([o.clamp,false],n,r),clip:rt([o.clip,false],n,r),color:s,display:e,font:a,lines:t,offset:rt([o.offset,4],n,r),opacity:rt([o.opacity,1],n,r),origin:T8(i._el,n),padding:pt(rt([o.padding,4],n,r)),positioner:k8(i._el),rotation:rt([o.rotation,0],n,r)*(Math.PI/180),size:lr.textSize(i._ctx,t,a),textAlign:rt([o.textAlign,"start"],n,r),textShadowBlur:rt([o.textShadowBlur,0],n,r),textShadowColor:rt([o.textShadowColor,s],n,r),textStrokeColor:rt([o.textStrokeColor,s],n,r),textStrokeWidth:rt([o.textStrokeWidth,0],n,r)}},update:function(e){var t=this,o=null,n=null,i=t._index,r=t._config,a,s,l,c=rt([r.display,true],e,i);c&&(a=e.dataset.data[i],s=N(X(r.formatter,[a,e]),a),l=W(s)?[]:lr.toTextLines(s),l.length&&(o=t._modelize(c,l,r,e),n=S8(o))),t._model=o,t._rects=n;},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var o=this,n=e.ctx,i=o._model,r=o._rects,a;this.visible()&&(n.save(),i.clip&&(a=i.area,n.beginPath(),n.rect(a.left,a.top,a.right-a.left,a.bottom-a.top),n.clip()),n.globalAlpha=lr.bound(0,i.opacity,1),n.translate(qe(t.x),qe(t.y)),n.rotate(i.rotation),v8(n,r.frame,i),M8(n,i.lines,r.text,i),n.restore());}});var I8=Number.MIN_SAFE_INTEGER||-9007199254740991,E8=Number.MAX_SAFE_INTEGER||9007199254740991;function sr(e,t,o){var n=Math.cos(o),i=Math.sin(o),r=t.x,a=t.y;return {x:r+n*(e.x-r)-i*(e.y-a),y:a+i*(e.x-r)+n*(e.y-a)}}function lx(e,t){var o=E8,n=I8,i=t.origin,r,a,s,l,c;for(r=0;r<e.length;++r)a=e[r],s=a.x-i.x,l=a.y-i.y,c=t.vx*s+t.vy*l,o=Math.min(o,c),n=Math.max(n,c);return {min:o,max:n}}function Ws(e,t){var o=t.x-e.x,n=t.y-e.y,i=Math.sqrt(o*o+n*n);return {vx:(t.x-e.x)/i,vy:(t.y-e.y)/i,origin:e,ln:i}}var hx=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0};};Xt(hx.prototype,{center:function(){var e=this._rect;return {x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,o){this._rotation=o,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h};},contains:function(e){var t=this,o=1,n=t._rect;return e=sr(e,t.center(),-t._rotation),!(e.x<n.x-o||e.y<n.y-o||e.x>n.x+n.w+o*2||e.y>n.y+n.h+o*2)},intersects:function(e){var t=this._points(),o=e._points(),n=[Ws(t[0],t[1]),Ws(t[0],t[3])],i,r,a;for(this._rotation!==e._rotation&&n.push(Ws(o[0],o[1]),Ws(o[0],o[3])),i=0;i<n.length;++i)if(r=lx(t,n[i]),a=lx(o,n[i]),r.max<a.min||a.max<r.min)return false;return true},_points:function(){var e=this,t=e._rect,o=e._rotation,n=e.center();return [sr({x:t.x,y:t.y},n,o),sr({x:t.x+t.w,y:t.y},n,o),sr({x:t.x+t.w,y:t.y+t.h},n,o),sr({x:t.x,y:t.y+t.h},n,o)]}});function gx(e,t,o){var n=t.positioner(e,t),i=n.vx,r=n.vy;if(!i&&!r)return {x:n.x,y:n.y};var a=o.w,s=o.h,l=t.rotation,c=Math.abs(a/2*Math.cos(l))+Math.abs(s/2*Math.sin(l)),d=Math.abs(a/2*Math.sin(l))+Math.abs(s/2*Math.cos(l)),u=1/Math.max(Math.abs(i),Math.abs(r));return c*=i*u,d*=r*u,c+=t.offset*i,d+=t.offset*r,{x:n.x+c,y:n.y+d}}function F8(e,t){var o,n,i,r;for(o=e.length-1;o>=0;--o)for(i=e[o].$layout,n=o-1;n>=0&&i._visible;--n)r=e[n].$layout,r._visible&&i._box.intersects(r._box)&&t(i,r);return e}function L8(e){var t,o,n,i,r,a,s;for(t=0,o=e.length;t<o;++t)n=e[t],i=n.$layout,i._visible&&(s=new Proxy(n._el,{get:(l,c)=>l.getProps([c],true)[c]}),r=n.geometry(),a=gx(s,n.model(),r),i._box.update(a,r,n.rotation()));return F8(e,function(l,c){var d=l._hidable,u=c._hidable;d&&u||u?c._visible=false:d&&(l._visible=false);})}var cr={prepare:function(e){var t=[],o,n,i,r,a;for(o=0,i=e.length;o<i;++o)for(n=0,r=e[o].length;n<r;++n)a=e[o][n],t.push(a),a.$layout={_box:new hx,_hidable:false,_visible:true,_set:o,_idx:a._index};return t.sort(function(s,l){var c=s.$layout,d=l.$layout;return c._idx===d._idx?d._set-c._set:d._idx-c._idx}),this.update(t),t},update:function(e){var t=false,o,n,i,r,a;for(o=0,n=e.length;o<n;++o)i=e[o],r=i.model(),a=i.$layout,a._hidable=r&&r.display==="auto",a._visible=i.visible(),t|=a._hidable;t&&L8(e);},lookup:function(e,t){var o,n;for(o=e.length-1;o>=0;--o)if(n=e[o].$layout,n&&n._visible&&n._box.contains(t))return e[o];return null},draw:function(e,t){var o,n,i,r,a,s;for(o=0,n=t.length;o<n;++o)i=t[o],r=i.$layout,r._visible&&(a=i.geometry(),s=gx(i._el,i.model(),a),r._box.update(s,a,i.rotation()),i.draw(e,s));}},B8=function(e){if(W(e))return null;var t=e,o,n,i;if(z(e))if(!W(e.label))t=e.label;else if(!W(e.r))t=e.r;else for(t="",o=Object.keys(e),i=0,n=o.length;i<n;++i)t+=(i!==0?", ":"")+o[i]+": "+e[o[i]];return ""+t},R8={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:false,clip:false,color:void 0,display:true,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:B8,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},$t="$datalabels",fx="$default";function D8(e,t){var o=e.datalabels,n={},i=[],r,a;return o===false?null:(o===true&&(o={}),t=Xt({},[t,o]),r=t.labels||{},a=Object.keys(r),delete t.labels,a.length?a.forEach(function(s){r[s]&&i.push(Xt({},[t,r[s],{_key:s}]));}):i.push(t),n=i.reduce(function(s,l){return K(l.listeners||{},function(c,d){s[d]=s[d]||{},s[d][l._key||fx]=c;}),delete l.listeners,s},{}),{labels:i,listeners:n})}function pu(e,t,o,n){if(t){var i=o.$context,r=o.$groups,a;t[r._set]&&(a=t[r._set][r._key],a&&X(a,[i,n])===true&&(e[$t]._dirty=true,o.update(i)));}}function N8(e,t,o,n,i){var r,a;!o&&!n||(o?n?o!==n&&(a=r=true):a=true:r=true,a&&pu(e,t.leave,o,i),r&&pu(e,t.enter,n,i));}function U8(e,t){var o=e[$t],n=o._listeners,i,r;if(!(!n.enter&&!n.leave)){if(t.type==="mousemove")r=cr.lookup(o._labels,t);else if(t.type!=="mouseout")return;i=o._hovered,o._hovered=r,N8(e,n,i,r,t);}}function O8(e,t){var o=e[$t],n=o._listeners.click,i=n&&cr.lookup(o._labels,t);i&&pu(e,n,i,t);}var yx={id:"datalabels",defaults:R8,beforeInit:function(e){e[$t]={_actives:[]};},beforeUpdate:function(e){var t=e[$t];t._listened=false,t._listeners={},t._datasets=[],t._labels=[];},afterDatasetUpdate:function(e,t,o){var n=t.index,i=e[$t],r=i._datasets[n]=[],a=e.isDatasetVisible(n),s=e.data.datasets[n],l=D8(s,o),c=t.meta.data||[],d=e.ctx,u,p,h,m,g,f,x,b;for(d.save(),u=0,h=c.length;u<h;++u)if(x=c[u],x[$t]=[],a&&x&&e.getDataVisibility(u)&&!x.skip)for(p=0,m=l.labels.length;p<m;++p)g=l.labels[p],f=g._key,b=new mx(g,d,x,u),b.$groups={_set:n,_key:f||fx},b.$context={active:false,chart:e,dataIndex:u,dataset:s,datasetIndex:n},b.update(b.$context),x[$t].push(b),r.push(b);d.restore(),Xt(i._listeners,l.listeners,{merger:function(T,k,w){k[T]=k[T]||{},k[T][t.index]=w[T],i._listened=true;}});},afterUpdate:function(e){e[$t]._labels=cr.prepare(e[$t]._datasets);},afterDatasetsDraw:function(e){cr.draw(e,e[$t]._labels);},beforeEvent:function(e,t){if(e[$t]._listened){var o=t.event;switch(o.type){case "mousemove":case "mouseout":U8(e,o);break;case "click":O8(e,o);break}}},afterEvent:function(e){var t=e[$t],o=t._actives,n=t._actives=e.getActiveElements(),i=lr.arrayDiff(o,n),r,a,s,l,c,d,u;for(r=0,a=i.length;r<a;++r)if(c=i[r],c[1])for(u=c[0].element[$t]||[],s=0,l=u.length;s<l;++s)d=u[s],d.$context.active=c[1]===1,d.update(d.$context);(t._dirty||i.length)&&(cr.update(t._labels),e.render()),delete t._dirty;}};var xx={modes:{point(e,t){return js(e,t,{intersect:true})},nearest(e,t,o){return $8(e,t,o)},x(e,t,o){return js(e,t,{intersect:o.intersect,axis:"x"})},y(e,t,o){return js(e,t,{intersect:o.intersect,axis:"y"})}}};function Pu(e,t,o){return (xx.modes[o.mode]||xx.modes.nearest)(e,t,o)}function z8(e,t,o){return o!=="x"&&o!=="y"?e.inRange(t.x,t.y,"x",true)||e.inRange(t.x,t.y,"y",true):e.inRange(t.x,t.y,o,true)}function V8(e,t,o){return o==="x"?{x:e.x,y:t.y}:o==="y"?{x:t.x,y:e.y}:t}function js(e,t,o){return e.visibleElements.filter(n=>o.intersect?n.inRange(t.x,t.y):z8(n,t,o.axis))}function $8(e,t,o){let n=Number.POSITIVE_INFINITY;return js(e,t,o).reduce((i,r)=>{let a=r.getCenterPoint(),s=V8(t,a,o.axis),l=Ve(t,s);return l<n?(i=[r],n=l):l===n&&i.push(r),i},[]).sort((i,r)=>i._index-r._index).slice(0,1)}var H8=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,sn=.001,Zs=(e,t,o)=>Math.min(o,Math.max(t,e));function W8(e,t,o){for(let n of Object.keys(e))e[n]=Zs(e[n],t,o);return e}function G8(e,t,o,n){if(!e||!t||o<=0)return false;let i=n/2;return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(o+i,2)}function Nx(e,{x:t,y:o,x2:n,y2:i},r,a){let s=a/2,l=e.x>=t-s-sn&&e.x<=n+s+sn,c=e.y>=o-s-sn&&e.y<=i+s+sn;return r==="x"?l:(r==="y"||l)&&c}function oi(e,t){let{centerX:o,centerY:n}=e.getProps(["centerX","centerY"],t);return {x:o,y:n}}function j8(e,t,o,n=true){let i=o.split("."),r=0;for(let a of t.split(".")){let s=i[r++];if(parseInt(a,10)<parseInt(s,10))break;if(H8(s,a)){if(n)throw new Error(`${e} v${o} is not supported. v${t} or newer is required.`);return false}}return true}var Ux=e=>typeof e=="string"&&e.endsWith("%"),Ox=e=>parseFloat(e)/100,zx=e=>Zs(Ox(e),0,1);function Su(e,t){return t==="start"?0:t==="end"?e:Ux(t)?zx(t)*e:e/2}function vo(e,t,o=true){return typeof t=="number"?t:Ux(t)?(o?zx(t):Ox(t))*e:e}function Y8(e,t){let{x:o,width:n}=e,i=t.textAlign;return i==="center"?o+n/2:i==="end"||i==="right"?o+n:o}function Tu(e,t="center"){return z(e)?{x:N(e.x,t),y:N(e.y,t)}:(e=N(e,t),{x:e,y:e})}function Vx(e){return e&&(st(e.xValue)||st(e.yValue))}function ur(e,t,o,n=false){let i=o.init;if(i){if(i===true)return Hx(t,n)}else return;return Z8(t,n,X(i,[{chart:e,properties:t,options:o}]))}function $x(e,t,o){let n=false;return t.forEach(i=>{Tt(e[i])?(n=true,o[i]=e[i]):st(o[i])&&delete o[i];}),n}function Hx({centerX:e,centerY:t},o){return o?{centerX:e,centerY:t,radius:0,width:0,height:0}:{x:e,y:t,x2:e,y2:t,width:0,height:0}}function Z8(e,t,o){if(o===true)return Hx(e,t);if(z(o))return o}var mu=new Map,X8=e=>isNaN(e)||e<=0,K8=e=>e.reduce(function(t,o){return t+=o.string,t},"");function Xs(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function ku(e,{x:t,y:o},n){n&&(e.translate(t,o),e.rotate(gt(n)),e.translate(-t,-o));}function _o(e,t){if(t&&t.borderWidth)return e.lineCap=t.borderCapStyle,e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,e.lineJoin=t.borderJoinStyle,e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,true}function ni(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY;}function wu(e,t){let o=t.content;if(Xs(o))return {width:vo(o.width,t.width),height:vo(o.height,t.height)};let n=t.font,i=Z(n)?n.map(l=>it(l)):[it(n)],r=t.textStrokeWidth,a=Z(o)?o:[o],s=a.join()+K8(i)+r+(e._measureText?"-spriting":"");return mu.has(s)||mu.set(s,e7(e,a,i,r)),mu.get(s)}function Wx(e,t,o){let{x:n,y:i,width:r,height:a}=t;e.save(),ni(e,o);let s=_o(e,o);e.fillStyle=o.backgroundColor,e.beginPath(),We(e,{x:n,y:i,w:r,h:a,radius:W8(fe(o.borderRadius),0,Math.min(r,a)/2)}),e.closePath(),e.fill(),s&&(e.shadowColor=o.borderShadowColor,e.stroke()),e.restore();}function q8(e,t,o){let n=o.content;if(Xs(n)){e.save(),e.globalAlpha=i7(o.opacity,n.style.opacity),e.drawImage(n,t.x,t.y,t.width,t.height),e.restore();return}let i=Z(n)?n:[n],r=o.font,a=Z(r)?r.map(u=>it(u)):[it(r)],s=o.color,l=Z(s)?s:[s],c=Y8(t,o),d=t.y+o.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=o.textAlign,Q8(e,o)&&o7(e,{x:c,y:d},i,a),n7(e,{x:c,y:d},i,{fonts:a,colors:l}),e.restore();}function Q8(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,true}function J8(e,t,o,n){let{radius:i,options:r}=t,a=r.pointStyle,s=r.rotation,l=(s||0)*Vi;if(Xs(a)){e.save(),e.translate(o,n),e.rotate(l),e.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),e.restore();return}X8(i)||t7(e,{x:o,y:n,radius:i,rotation:s,style:a,rad:l});}function t7(e,{x:t,y:o,radius:n,rotation:i,style:r,rad:a}){let s,l,c,d;switch(e.beginPath(),r){default:e.arc(t,o,n,0,Q),e.closePath();break;case "triangle":e.moveTo(t+Math.sin(a)*n,o-Math.cos(a)*n),a+=Nn,e.lineTo(t+Math.sin(a)*n,o-Math.cos(a)*n),a+=Nn,e.lineTo(t+Math.sin(a)*n,o-Math.cos(a)*n),e.closePath();break;case "rectRounded":d=n*.516,c=n-d,s=Math.cos(a+ie)*c,l=Math.sin(a+ie)*c,e.arc(t-s,o-l,d,a-G,a-et),e.arc(t+l,o-s,d,a-et,a),e.arc(t+s,o+l,d,a,a+et),e.arc(t-l,o+s,d,a+et,a+G),e.closePath();break;case "rect":if(!i){c=Math.SQRT1_2*n,e.rect(t-c,o-c,2*c,2*c);break}a+=ie;case "rectRot":s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+l,o-s),e.lineTo(t+s,o+l),e.lineTo(t-l,o+s),e.closePath();break;case "crossRot":a+=ie;case "cross":s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+s,o+l),e.moveTo(t+l,o-s),e.lineTo(t-l,o+s);break;case "star":s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+s,o+l),e.moveTo(t+l,o-s),e.lineTo(t-l,o+s),a+=ie,s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+s,o+l),e.moveTo(t+l,o-s),e.lineTo(t-l,o+s);break;case "line":s=Math.cos(a)*n,l=Math.sin(a)*n,e.moveTo(t-s,o-l),e.lineTo(t+s,o+l);break;case "dash":e.moveTo(t,o),e.lineTo(t+Math.cos(a)*n,o+Math.sin(a)*n);break}e.fill();}function e7(e,t,o,n){e.save();let i=t.length,r=0,a=n;for(let s=0;s<i;s++){let l=o[Math.min(s,o.length-1)];e.font=l.string;let c=t[s];r=Math.max(r,e.measureText(c).width+n),a+=l.lineHeight;}return e.restore(),{width:r,height:a}}function o7(e,{x:t,y:o},n,i){e.beginPath();let r=0;n.forEach(function(a,s){let l=i[Math.min(s,i.length-1)],c=l.lineHeight;e.font=l.string,e.strokeText(a,t,o+c/2+r),r+=c;}),e.stroke();}function n7(e,{x:t,y:o},n,{fonts:i,colors:r}){let a=0;n.forEach(function(s,l){let c=r[Math.min(l,r.length-1)],d=i[Math.min(l,i.length-1)],u=d.lineHeight;e.beginPath(),e.font=d.string,e.fillStyle=c,e.fillText(s,t,o+u/2+a),a+=u,e.fill();});}function i7(e,t){let o=Kt(e)?e:t;return Kt(o)?Zs(o,0,1):1}var bx={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function Jn(e,t,o){return t=typeof t=="number"?t:e.parse(t),lt(t)?e.getPixelForValue(t):o}function ln(e,t,o){let n=t[o];if(n||o==="scaleID")return n;let i=o.charAt(0),r=Object.values(e).filter(a=>a.axis&&a.axis===i);return r.length?r[0].id:i}function Gx(e,t){if(e){let o=e.options.reverse,n=Jn(e,t.min,o?t.end:t.start),i=Jn(e,t.max,o?t.start:t.end);return {start:n,end:i}}}function jx(e,t){let{chartArea:o,scales:n}=e,i=n[ln(n,t,"xScaleID")],r=n[ln(n,t,"yScaleID")],a=o.width/2,s=o.height/2;return i&&(a=Jn(i,t.xValue,i.left+i.width/2)),r&&(s=Jn(r,t.yValue,r.top+r.height/2)),{x:a,y:s}}function vu(e,t){let o=e.scales,n=o[ln(o,t,"xScaleID")],i=o[ln(o,t,"yScaleID")];if(!n&&!i)return {};let{left:r,right:a}=n||e.chartArea,{top:s,bottom:l}=i||e.chartArea,c=Cx(n,{min:t.xMin,max:t.xMax,start:r,end:a});r=c.start,a=c.end;let d=Cx(i,{min:t.yMin,max:t.yMax,start:l,end:s});return s=d.start,l=d.end,{x:r,y:s,x2:a,y2:l,width:a-r,height:l-s,centerX:r+(a-r)/2,centerY:s+(l-s)/2}}function Yx(e,t){if(!Vx(t)){let o=vu(e,t),n=t.radius;(!n||isNaN(n))&&(n=Math.min(o.width,o.height)/2,t.radius=n);let i=n*2,r=o.centerX+t.xAdjust,a=o.centerY+t.yAdjust;return {x:r-n,y:a-n,x2:r+n,y2:a+n,centerX:r,centerY:a,width:i,height:i,radius:n}}return a7(e,t)}function r7(e,t){let{scales:o,chartArea:n}=e,i=o[t.scaleID],r={x:n.left,y:n.top,x2:n.right,y2:n.bottom};return i?s7(i,r,t):l7(o,r,t),r}function Zx(e,t,o){let n=vu(e,t);return n.initProperties=ur(e,n,t,o),n.elements=[{type:"label",optionScope:"label",properties:u7(e,n,t),initProperties:n.initProperties}],n}function a7(e,t){let o=jx(e,t),n=t.radius*2;return {x:o.x-t.radius+t.xAdjust,y:o.y-t.radius+t.yAdjust,x2:o.x+t.radius+t.xAdjust,y2:o.y+t.radius+t.yAdjust,centerX:o.x+t.xAdjust,centerY:o.y+t.yAdjust,radius:t.radius,width:n,height:n}}function Cx(e,t){let o=Gx(e,t)||t;return {start:Math.min(o.start,o.end),end:Math.max(o.start,o.end)}}function s7(e,t,o){let n=Jn(e,o.value,NaN),i=Jn(e,o.endValue,n);e.isHorizontal()?(t.x=n,t.x2=i):(t.y=n,t.y2=i);}function l7(e,t,o){for(let n of Object.keys(bx)){let i=e[ln(e,o,n)];if(i){let{min:r,max:a,start:s,end:l,startProp:c,endProp:d}=bx[n],u=Gx(i,{min:o[r],max:o[a],start:i[s],end:i[l]});t[c]=u.start,t[d]=u.end;}}}function c7({properties:e,options:t},o,n,i){let{x:r,x2:a,width:s}=e;return Xx({start:r,end:a,borderWidth:t.borderWidth},{position:n.x,padding:{start:i.left,end:i.right},adjust:t.label.xAdjust,size:o.width})}function d7({properties:e,options:t},o,n,i){let{y:r,y2:a,height:s}=e;return Xx({start:r,end:a,borderWidth:t.borderWidth},{position:n.y,padding:{start:i.top,end:i.bottom},adjust:t.label.yAdjust,size:o.height})}function Xx(e,t){let{start:o,end:n,borderWidth:i}=e,{position:r,padding:{start:a,end:s},adjust:l}=t,c=n-i-o-a-s-t.size;return o+i/2+l+Su(c,r)}function u7(e,t,o){let n=o.label;n.backgroundColor="transparent",n.callout.display=false;let i=Tu(n.position),r=pt(n.padding),a=wu(e.ctx,n),s=c7({properties:t,options:o},a,i,r),l=d7({properties:t,options:o},a,i,r),c=a.width+r.width,d=a.height+r.height;return {x:s,y:l,x2:s+c,y2:l+d,width:c,height:d,centerX:s+c/2,centerY:l+d/2,rotation:n.rotation}}function pn(e,t,o){let n=Math.cos(o),i=Math.sin(o),r=t.x,a=t.y;return {x:r+n*(e.x-r)-i*(e.y-a),y:a+i*(e.x-r)+n*(e.y-a)}}var hu=["enter","leave"],_u=hu.concat("click");function p7(e,t,o){t.listened=$x(o,_u,t.listeners),t.moveListened=false,t._getElements=Pu,hu.forEach(n=>{Tt(o[n])&&(t.moveListened=true);}),(!t.listened||!t.moveListened)&&t.annotations.forEach(n=>{!t.listened&&Tt(n.click)&&(t.listened=true),t.moveListened||hu.forEach(i=>{Tt(n[i])&&(t.listened=true,t.moveListened=true);});});}function m7(e,t,o){if(e.listened)switch(t.type){case "mousemove":case "mouseout":return h7(e,t,o);case "click":return g7(e,t,o)}}function h7(e,t,o){if(!e.moveListened)return;let n;t.type==="mousemove"?n=Pu(e,t,o.interaction):n=[];let i=e.hovered;e.hovered=n;let r={state:e,event:t},a=Px(r,"leave",i,n);return Px(r,"enter",n,i)||a}function Px({state:e,event:t},o,n,i){let r;for(let a of n)i.indexOf(a)<0&&(r=Kx(a.options[o]||e.listeners[o],a,t)||r);return r}function g7(e,t,o){let n=e.listeners,i=Pu(e,t,o.interaction),r;for(let a of i)r=Kx(a.options.click||n.click,a,t)||r;return r}function Kx(e,t,o){return X(e,[t.$context,o])===true}var Ys=["afterDraw","beforeDraw"];function f7(e,t,o){let n=t.visibleElements;t.hooked=$x(o,Ys,t.hooks),t.hooked||n.forEach(i=>{t.hooked||Ys.forEach(r=>{Tt(i.options[r])&&(t.hooked=true);});});}function Sx(e,t,o){if(e.hooked){let n=t.options[o]||e.hooks[o];return X(n,[t.$context])}}function y7(e,t,o){let n=S7(e.scales,t,o),i=Tx(t,n,"min","suggestedMin");i=Tx(t,n,"max","suggestedMax")||i,i&&Tt(t.handleTickRangeOptions)&&t.handleTickRangeOptions();}function x7(e,t){for(let o of e)C7(o,t);}function Tx(e,t,o,n){if(lt(t[o])&&!b7(e.options,o,n)){let i=e[o]!==t[o];return e[o]=t[o],i}}function b7(e,t,o){return st(e[t])||st(e[o])}function C7(e,t){for(let o of ["scaleID","xScaleID","yScaleID"]){let n=ln(t,e,o);n&&!t[n]&&P7(e,o)&&console.warn(`No scale found with id '${n}' for annotation '${e.id}'`);}}function P7(e,t){if(t==="scaleID")return true;let o=t.charAt(0);for(let n of ["Min","Max","Value"])if(st(e[o+n]))return true;return false}function S7(e,t,o){let n=t.axis,i=t.id,r=n+"ScaleID",a={min:N(t.min,Number.NEGATIVE_INFINITY),max:N(t.max,Number.POSITIVE_INFINITY)};for(let s of o)s.scaleID===i?kx(s,t,["value","endValue"],a):ln(e,s,r)===i&&kx(s,t,[n+"Min",n+"Max",n+"Value"],a);return a}function kx(e,t,o,n){for(let i of o){let r=e[i];if(st(r)){let a=t.parse(r);n.min=Math.min(n.min,a),n.max=Math.max(n.max,a);}}}var Ao=class extends xt{inRange(t,o,n,i){let{x:r,y:a}=pn({x:t,y:o},this.getCenterPoint(i),gt(-this.options.rotation));return Nx({x:r,y:a},this.getProps(["x","y","x2","y2"],i),n,this.options.borderWidth)}getCenterPoint(t){return oi(this,t)}draw(t){t.save(),ku(t,this.getCenterPoint(),this.options.rotation),Wx(t,this,this.options),t.restore();}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,o){return Zx(t,o)}};Ao.id="boxAnnotation";Ao.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:false},color:"black",content:null,display:false,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};Ao.defaultRoutes={borderColor:"color",backgroundColor:"color"};Ao.descriptors={label:{_fallback:true}};var qx=["left","bottom","top","right"],cn=class extends xt{inRange(t,o,n,i){let{x:r,y:a}=pn({x:t,y:o},this.getCenterPoint(i),gt(-this.rotation));return Nx({x:r,y:a},this.getProps(["x","y","x2","y2"],i),n,this.options.borderWidth)}getCenterPoint(t){return oi(this,t)}draw(t){let o=this.options,n=!st(this._visible)||this._visible;!o.display||!o.content||!n||(t.save(),ku(t,this.getCenterPoint(),this.rotation),k7(t,this),Wx(t,this,o),q8(t,E7(this),o),t.restore());}resolveElementProperties(t,o){let n;if(Vx(o))n=jx(t,o);else {let{centerX:s,centerY:l}=vu(t,o);n={x:s,y:l};}let i=pt(o.padding),r=wu(t.ctx,o),a=T7(n,r,o,i);return A(S({initProperties:ur(t,a,o),pointX:n.x,pointY:n.y},a),{rotation:o.rotation})}};cn.id="labelAnnotation";cn.defaults={adjustScaleRange:true,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:false,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:true,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};cn.defaultRoutes={borderColor:"color"};function T7(e,t,o,n){let i=t.width+n.width+o.borderWidth,r=t.height+n.height+o.borderWidth,a=Tu(o.position,"center"),s=wx(e.x,i,o.xAdjust,a.x),l=wx(e.y,r,o.yAdjust,a.y);return {x:s,y:l,x2:s+i,y2:l+r,width:i,height:r,centerX:s+i/2,centerY:l+r/2}}function wx(e,t,o=0,n){return e-Su(t,n)+o}function k7(e,t){let{pointX:o,pointY:n,options:i}=t,r=i.callout,a=r&&r.display&&M7(t,r);if(!a||F7(t,r,a))return;if(e.save(),e.beginPath(),!_o(e,r))return e.restore();let{separatorStart:l,separatorEnd:c}=w7(t,a),{sideStart:d,sideEnd:u}=_7(t,a,l);(r.margin>0||i.borderWidth===0)&&(e.moveTo(l.x,l.y),e.lineTo(c.x,c.y)),e.moveTo(d.x,d.y),e.lineTo(u.x,u.y);let p=pn({x:o,y:n},t.getCenterPoint(),gt(-t.rotation));e.lineTo(p.x,p.y),e.stroke(),e.restore();}function w7(e,t){let{x:o,y:n,x2:i,y2:r}=e,a=v7(e,t),s,l;return t==="left"||t==="right"?(s={x:o+a,y:n},l={x:s.x,y:r}):(s={x:o,y:n+a},l={x:i,y:s.y}),{separatorStart:s,separatorEnd:l}}function v7(e,t){let{width:o,height:n,options:i}=e,r=i.callout.margin+i.borderWidth/2;return t==="right"?o+r:t==="bottom"?n+r:-r}function _7(e,t,o){let{y:n,width:i,height:r,options:a}=e,s=a.callout.start,l=A7(t,a.callout),c,d;return t==="left"||t==="right"?(c={x:o.x,y:n+vo(r,s)},d={x:c.x+l,y:c.y}):(c={x:o.x+vo(i,s),y:o.y},d={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:d}}function A7(e,t){let o=t.side;return e==="left"||e==="top"?-o:o}function M7(e,t){let o=t.position;return qx.includes(o)?o:I7(e,t)}function I7(e,t){let{x:o,y:n,x2:i,y2:r,width:a,height:s,pointX:l,pointY:c,centerX:d,centerY:u,rotation:p}=e,h={x:d,y:u},m=t.start,g=vo(a,m),f=vo(s,m),x=[o,o+g,o+g,i],b=[n+f,r,n,r],T=[];for(let k=0;k<4;k++){let w=pn({x:x[k],y:b[k]},h,gt(p));T.push({position:qx[k],distance:Ve(w,{x:l,y:c})});}return T.sort((k,w)=>k.distance-w.distance)[0].position}function E7({x:e,y:t,width:o,height:n,options:i}){let r=i.borderWidth/2,a=pt(i.padding);return {x:e+a.left+r,y:t+a.top+r,width:o-a.left-a.right-i.borderWidth,height:n-a.top-a.bottom-i.borderWidth}}function F7(e,t,o){let{pointX:n,pointY:i}=e,r=t.margin,a=n,s=i;return o==="left"?a+=r:o==="right"?a-=r:o==="top"?s+=r:o==="bottom"&&(s-=r),e.inRange(a,s)}var Au=(e,t,o)=>({x:e.x+o*(t.x-e.x),y:e.y+o*(t.y-e.y)}),gu=(e,t,o)=>Au(t,o,Math.abs((e-t.y)/(o.y-t.y))).x,vx=(e,t,o)=>Au(t,o,Math.abs((e-t.x)/(o.x-t.x))).y,dr=e=>e*e,L7=(e,t,{x:o,y:n,x2:i,y2:r},a)=>a==="y"?{start:Math.min(n,r),end:Math.max(n,r),value:t}:{start:Math.min(o,i),end:Math.max(o,i),value:e},_x=(e,t,o,n)=>(1-n)*(1-n)*e+2*(1-n)*n*t+n*n*o,fu=(e,t,o,n)=>({x:_x(e.x,t.x,o.x,n),y:_x(e.y,t.y,o.y,n)}),Ax=(e,t,o,n)=>2*(1-n)*(t-e)+2*n*(o-t),Mx=(e,t,o,n)=>-Math.atan2(Ax(e.x,t.x,o.x,n),Ax(e.y,t.y,o.y,n))+.5*G,dn=class extends xt{inRange(t,o,n,i){let r=this.options.borderWidth/2;if(n!=="x"&&n!=="y"){let a={mouseX:t,mouseY:o},{path:s,ctx:l}=this;if(s){_o(l,this.options);let{chart:d}=this.$context,u=t*d.currentDevicePixelRatio,p=o*d.currentDevicePixelRatio,h=l.isPointInStroke(s,u,p)||yu(this,a,i);return l.restore(),h}let c=dr(r);return N7(this,a,c,i)||yu(this,a,i)}return B7(this,{mouseX:t,mouseY:o},n,{hBorderWidth:r,useFinalPosition:i})}getCenterPoint(t){return oi(this,t)}draw(t){let{x:o,y:n,x2:i,y2:r,cp:a,options:s}=this;if(t.save(),!_o(t,s))return t.restore();ni(t,s);let l=Math.sqrt(Math.pow(i-o,2)+Math.pow(r-n,2));if(s.curve&&a)return G7(t,this,a,l),t.restore();let{startOpts:c,endOpts:d,startAdjust:u,endAdjust:p}=Qx(this),h=Math.atan2(r-n,i-o);t.translate(o,n),t.rotate(h),t.beginPath(),t.moveTo(0+u,0),t.lineTo(l-p,0),t.shadowColor=s.borderShadowColor,t.stroke(),xu(t,0,u,c),xu(t,l,-p,d),t.restore();}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,o){let n=r7(t,o),{x:i,y:r,x2:a,y2:s}=n,l=R7(n,t.chartArea),c=l?D7({x:i,y:r},{x:a,y:s},t.chartArea):{x:i,y:r,x2:a,y2:s,width:Math.abs(a-i),height:Math.abs(s-r)};if(c.centerX=(a+i)/2,c.centerY=(s+r)/2,c.initProperties=ur(t,c,o),o.curve){let u={x:c.x,y:c.y},p={x:c.x2,y:c.y2};c.cp=W7(c,o,Ve(u,p));}let d=U7(t,c,o.label);return d._visible=l,c.elements=[{type:"label",optionScope:"label",properties:d,initProperties:c.initProperties}],c}};dn.id="lineAnnotation";var Ix={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};dn.defaults={adjustScaleRange:true,arrowHeads:{display:false,end:Object.assign({},Ix),fill:false,length:12,start:Object.assign({},Ix),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:false,controlPoint:{y:"-50%"},display:true,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},cn.defaults.callout),color:"#fff",content:null,display:false,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};dn.descriptors={arrowHeads:{start:{_fallback:true},end:{_fallback:true},_fallback:true}};dn.defaultRoutes={borderColor:"color"};function B7(e,{mouseX:t,mouseY:o},n,{hBorderWidth:i,useFinalPosition:r}){let a=L7(t,o,e.getProps(["x","y","x2","y2"],r),n);return a.value>=a.start-i&&a.value<=a.end+i||yu(e,{mouseX:t,mouseY:o},r,n)}function R7({x:e,y:t,x2:o,y2:n},{top:i,right:r,bottom:a,left:s}){return !(e<s&&o<s||e>r&&o>r||t<i&&n<i||t>a&&n>a)}function Ex({x:e,y:t},o,{top:n,right:i,bottom:r,left:a}){return e<a&&(t=vx(a,{x:e,y:t},o),e=a),e>i&&(t=vx(i,{x:e,y:t},o),e=i),t<n&&(e=gu(n,{x:e,y:t},o),t=n),t>r&&(e=gu(r,{x:e,y:t},o),t=r),{x:e,y:t}}function D7(e,t,o){let{x:n,y:i}=Ex(e,t,o),{x:r,y:a}=Ex(t,e,o);return {x:n,y:i,x2:r,y2:a,width:Math.abs(r-n),height:Math.abs(a-i)}}function N7(e,{mouseX:t,mouseY:o},n=sn,i){let{x:r,y:a,x2:s,y2:l}=e.getProps(["x","y","x2","y2"],i),c=s-r,d=l-a,u=dr(c)+dr(d),p=u===0?-1:((t-r)*c+(o-a)*d)/u,h,m;return p<0?(h=r,m=a):p>1?(h=s,m=l):(h=r+p*c,m=a+p*d),dr(t-h)+dr(o-m)<=n}function yu(e,{mouseX:t,mouseY:o},n,i){let r=e.label;return r.options.display&&r.inRange(t,o,i,n)}function U7(e,t,o){let n=o.borderWidth,i=pt(o.padding),r=wu(e.ctx,o),a=r.width+i.width+n,s=r.height+i.height+n;return z7(t,o,{width:a,height:s,padding:i},e.chartArea)}function O7(e){let{x:t,y:o,x2:n,y2:i}=e,r=Math.atan2(i-o,n-t);return r>G/2?r-G:r<G/-2?r+G:r}function z7(e,t,o,n){let{width:i,height:r,padding:a}=o,{xAdjust:s,yAdjust:l}=t,c={x:e.x,y:e.y},d={x:e.x2,y:e.y2},u=t.rotation==="auto"?O7(e):gt(t.rotation),p=V7(i,r,u),h=$7(e,t,{labelSize:p,padding:a},n),m=e.cp?fu(c,e.cp,d,h):Au(c,d,h),g={size:p.w,min:n.left,max:n.right,padding:a.left},f={size:p.h,min:n.top,max:n.bottom,padding:a.top},x=Lx(m.x,g)+s,b=Lx(m.y,f)+l;return {x:x-i/2,y:b-r/2,x2:x+i/2,y2:b+r/2,centerX:x,centerY:b,pointX:m.x,pointY:m.y,width:i,height:r,rotation:Qo(u)}}function V7(e,t,o){let n=Math.cos(o),i=Math.sin(o);return {w:Math.abs(e*n)+Math.abs(t*i),h:Math.abs(e*i)+Math.abs(t*n)}}function $7(e,t,o,n){let i,r=H7(e,n);return t.position==="start"?i=Fx({w:e.x2-e.x,h:e.y2-e.y},o,t,r):t.position==="end"?i=1-Fx({w:e.x-e.x2,h:e.y-e.y2},o,t,r):i=Su(1,t.position),i}function Fx(e,t,o,n){let{labelSize:i,padding:r}=t,a=e.w*n.dx,s=e.h*n.dy,l=a>0&&(i.w/2+r.left-n.x)/a,c=s>0&&(i.h/2+r.top-n.y)/s;return Zs(Math.max(l,c),0,.25)}function H7(e,t){let{x:o,x2:n,y:i,y2:r}=e,a=Math.min(i,r)-t.top,s=Math.min(o,n)-t.left,l=t.bottom-Math.max(i,r),c=t.right-Math.max(o,n);return {x:Math.min(s,c),y:Math.min(a,l),dx:s<=c?1:-1,dy:a<=l?1:-1}}function Lx(e,t){let{size:o,min:n,max:i,padding:r}=t,a=o/2;return o>i-n?(i+n)/2:(n>=e-r-a&&(e=n+r+a),i<=e+r+a&&(e=i-r-a),e)}function Qx(e){let t=e.options,o=t.arrowHeads&&t.arrowHeads.start,n=t.arrowHeads&&t.arrowHeads.end;return {startOpts:o,endOpts:n,startAdjust:Bx(e,o),endAdjust:Bx(e,n)}}function Bx(e,t){if(!t||!t.display)return 0;let{length:o,width:n}=t,i=e.options.borderWidth/2,r={x:o,y:n+i};return Math.abs(gu(0,r,{x:0,y:i}))}function xu(e,t,o,n){if(!n||!n.display)return;let{length:i,width:r,fill:a,backgroundColor:s,borderColor:l}=n,c=Math.abs(t-i)+o;e.beginPath(),ni(e,n),_o(e,n),e.moveTo(c,-r),e.lineTo(t+o,0),e.lineTo(c,r),a===true?(e.fillStyle=s||l,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=n.borderShadowColor,e.stroke();}function W7(e,t,o){let{x:n,y:i,x2:r,y2:a,centerX:s,centerY:l}=e,c=Math.atan2(a-i,r-n),d=Tu(t.controlPoint,0),u={x:s+vo(o,d.x,false),y:l+vo(o,d.y,false)};return pn(u,{x:s,y:l},c)}function Rx(e,{x:t,y:o},{angle:n,adjust:i},r){!r||!r.display||(e.save(),e.translate(t,o),e.rotate(n),xu(e,0,-i,r),e.restore());}function G7(e,t,o,n){let{x:i,y:r,x2:a,y2:s,options:l}=t,{startOpts:c,endOpts:d,startAdjust:u,endAdjust:p}=Qx(t),h={x:i,y:r},m={x:a,y:s},g=Mx(h,o,m,0),f=Mx(h,o,m,1)-G,x=fu(h,o,m,u/n),b=fu(h,o,m,1-p/n),T=new Path2D;e.beginPath(),T.moveTo(x.x,x.y),T.quadraticCurveTo(o.x,o.y,b.x,b.y),e.shadowColor=l.borderShadowColor,e.stroke(T),t.path=T,t.ctx=e,Rx(e,x,{angle:g,adjust:u},c),Rx(e,b,{angle:f,adjust:p},d);}var un=class extends xt{inRange(t,o,n,i){let r=this.options.rotation,a=this.options.borderWidth;if(n!=="x"&&n!=="y")return j7({x:t,y:o},this.getProps(["width","height","centerX","centerY"],i),r,a);let{x:s,y:l,x2:c,y2:d}=this.getProps(["x","y","x2","y2"],i),u=a/2,p=n==="y"?{start:l,end:d}:{start:s,end:c},h=pn({x:t,y:o},this.getCenterPoint(i),gt(-r));return h[n]>=p.start-u-sn&&h[n]<=p.end+u+sn}getCenterPoint(t){return oi(this,t)}draw(t){let{width:o,height:n,centerX:i,centerY:r,options:a}=this;t.save(),ku(t,this.getCenterPoint(),a.rotation),ni(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;let s=_o(t,a);t.ellipse(i,r,n/2,o/2,G/2,0,2*G),t.fill(),s&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore();}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,o){return Zx(t,o,true)}};un.id="ellipseAnnotation";un.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,label:Object.assign({},Ao.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};un.defaultRoutes={borderColor:"color",backgroundColor:"color"};un.descriptors={label:{_fallback:true}};function j7(e,t,o,n){let{width:i,height:r,centerX:a,centerY:s}=t,l=i/2,c=r/2;if(l<=0||c<=0)return false;let d=gt(o||0),u=n/2||0,p=Math.cos(d),h=Math.sin(d),m=Math.pow(p*(e.x-a)+h*(e.y-s),2),g=Math.pow(h*(e.x-a)-p*(e.y-s),2);return m/Math.pow(l+u,2)+g/Math.pow(c+u,2)<=1.0001}var ti=class extends xt{inRange(t,o,n,i){let{x:r,y:a,x2:s,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],i),d=this.options.borderWidth;if(n!=="x"&&n!=="y")return G8({x:t,y:o},this.getCenterPoint(i),c/2,d);let u=d/2,p=n==="y"?{start:a,end:l,value:o}:{start:r,end:s,value:t};return p.value>=p.start-u&&p.value<=p.end+u}getCenterPoint(t){return oi(this,t)}draw(t){let o=this.options,n=o.borderWidth;if(o.radius<.1)return;t.save(),t.fillStyle=o.backgroundColor,ni(t,o);let i=_o(t,o);J8(t,this,this.centerX,this.centerY),i&&!Xs(o.pointStyle)&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore(),o.borderWidth=n;}resolveElementProperties(t,o){let n=Yx(t,o);return n.initProperties=ur(t,n,o,true),n}};ti.id="pointAnnotation";ti.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};ti.defaultRoutes={borderColor:"color",backgroundColor:"color"};var ei=class extends xt{inRange(t,o,n,i){if(n!=="x"&&n!=="y")return this.options.radius>=.1&&this.elements.length>1&&Z7(this.elements,t,o,i);let r=pn({x:t,y:o},this.getCenterPoint(i),gt(-this.options.rotation)),a=this.elements.map(c=>n==="y"?c.bY:c.bX),s=Math.min(...a),l=Math.max(...a);return r[n]>=s&&r[n]<=l}getCenterPoint(t){return oi(this,t)}draw(t){let{elements:o,options:n}=this;t.save(),t.beginPath(),t.fillStyle=n.backgroundColor,ni(t,n);let i=_o(t,n),r=true;for(let a of o)r?(t.moveTo(a.x,a.y),r=false):t.lineTo(a.x,a.y);t.closePath(),t.fill(),i&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore();}resolveElementProperties(t,o){let n=Yx(t,o),{sides:i,rotation:r}=o,a=[],s=2*G/i,l=r*Vi;for(let c=0;c<i;c++,l+=s){let d=Y7(n,o,l);d.initProperties=ur(t,n,o),a.push(d);}return n.elements=a,n}};ei.id="polygonAnnotation";ei.defaults={adjustScaleRange:true,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:true,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};ei.defaultRoutes={borderColor:"color",backgroundColor:"color"};function Y7({centerX:e,centerY:t},{radius:o,borderWidth:n},i){let r=n/2,a=Math.sin(i),s=Math.cos(i),l={x:e+a*o,y:t-s*o};return {type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:e+a*(o+r),bY:t-s*(o+r)}}}function Z7(e,t,o,n){let i=false,r=e[e.length-1].getProps(["bX","bY"],n);for(let a of e){let s=a.getProps(["bX","bY"],n);s.bY>o!=r.bY>o&&t<(r.bX-s.bX)*(o-s.bY)/(r.bY-s.bY)+s.bX&&(i=!i),r=s;}return i}var wo={box:Ao,ellipse:un,label:cn,line:dn,point:ti,polygon:ei};Object.keys(wo).forEach(e=>{H.describe(`elements.${wo[e].id}`,{_fallback:"plugins.annotation.common"});});var X7={update:Object.assign},K7=_u.concat(Ys),Dx=(e,t)=>z(t)?Cu(e,t):e,bu=e=>e==="color"||e==="font";function Mu(e="line"){return wo[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function q7(e,t,o,n){let i=J7(e,o.animations,n),r=t.annotations,a=o9(t.elements,r);for(let s=0;s<r.length;s++){let l=r[s],c=Jx(a,s,l.type),d=l.setContext(e9(e,c,l)),u=c.resolveElementProperties(e,d);u.skip=Q7(u),"elements"in u&&(t9(c,u.elements,d,i),delete u.elements),st(c.x)||Object.assign(c,u),Object.assign(c,u.initProperties),u.options=tb(d),i.update(c,u);}}function Q7(e){return isNaN(e.x)||isNaN(e.y)}function J7(e,t,o){return o==="reset"||o==="none"||o==="resize"?X7:new Hn(e,t)}function t9(e,t,o,n){let i=e.elements||(e.elements=[]);i.length=t.length;for(let r=0;r<t.length;r++){let a=t[r],s=a.properties,l=Jx(i,r,a.type,a.initProperties),c=o[a.optionScope].override(a);s.options=tb(c),n.update(l,s);}}function Jx(e,t,o,n){let i=wo[Mu(o)],r=e[t];return (!r||!(r instanceof i))&&(r=e[t]=new i,Object.assign(r,n)),r}function tb(e){let t=wo[Mu(e.type)],o={};o.id=e.id,o.type=e.type,o.drawTime=e.drawTime,Object.assign(o,Cu(e,t.defaults),Cu(e,t.defaultRoutes));for(let n of K7)o[n]=e[n];return o}function Cu(e,t){let o={};for(let n of Object.keys(t)){let i=t[n],r=e[n];bu(n)&&Z(r)?o[n]=r.map(a=>Dx(a,i)):o[n]=Dx(r,i);}return o}function e9(e,t,o){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,id:o.id,type:"annotation"}))}function o9(e,t){let o=t.length,n=e.length;if(n<o){let i=o-n;e.splice(n,0,...new Array(i));}else n>o&&e.splice(o,n-o);return e}var n9="2.2.1",ko=new Map,i9=_u.concat(Ys),eb={id:"annotation",version:n9,beforeRegister(){j8("chart.js","3.7",Lt.version);},afterRegister(){Lt.register(wo);},afterUnregister(){Lt.unregister(wo);},beforeInit(e){ko.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:false,moveListened:false,hooks:{},hooked:false,hovered:[]});},beforeUpdate(e,t,o){let n=ko.get(e),i=n.annotations=[],r=o.annotations;z(r)?Object.keys(r).forEach(a=>{let s=r[a];z(s)&&(s.id=a,i.push(s));}):Z(r)&&i.push(...r),x7(i,e.scales);},afterDataLimits(e,t){let o=ko.get(e);y7(e,t.scale,o.annotations.filter(n=>n.display&&n.adjustScaleRange));},afterUpdate(e,t,o){let n=ko.get(e);p7(e,n,o),q7(e,n,o,t.mode),n.visibleElements=n.elements.filter(i=>!i.skip&&i.options.display),f7(e,n,o);},beforeDatasetsDraw(e,t,o){Gs(e,"beforeDatasetsDraw",o.clip);},afterDatasetsDraw(e,t,o){Gs(e,"afterDatasetsDraw",o.clip);},beforeDraw(e,t,o){Gs(e,"beforeDraw",o.clip);},afterDraw(e,t,o){Gs(e,"afterDraw",o.clip);},beforeEvent(e,t,o){let n=ko.get(e);m7(n,t.event,o)&&(t.changed=true);},afterDestroy(e){ko.delete(e);},_getState(e){return ko.get(e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:true,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:false,label:{}}},descriptors:{_indexable:false,_scriptable:e=>!i9.includes(e)&&e!=="init",annotations:{_allKeys:false,_fallback:(e,t)=>`elements.${wo[Mu(t.type)].id}`},interaction:{_fallback:true},common:{label:{_indexable:bu,_fallback:true},_indexable:bu}},additionalOptionScopes:[""]};function Gs(e,t,o){let{ctx:n,chartArea:i}=e,r=ko.get(e);o&&xo(n,i);let a=r9(r.visibleElements,t).sort((s,l)=>s.element.options.z-l.element.options.z);for(let s of a)a9(n,i,r,s);o&&bo(n);}function r9(e,t){let o=[];for(let n of e)if(n.options.drawTime===t&&o.push({element:n,main:true}),n.elements&&n.elements.length)for(let i of n.elements)i.options.display&&i.options.drawTime===t&&o.push({element:i});return o}function a9(e,t,o,n){let i=n.element;n.main?(Sx(o,i,"beforeDraw"),i.draw(e,t),Sx(o,i,"afterDraw")):i.draw(e,t);}var Eu=Lt.version,s9=Eu?(e,t)=>e.parse(t):(e,t)=>t;function l9(e,t){let o=Kt(t)?parseFloat(t):s9(e,t);return e.getPixelForValue(o)}var ob=e=>e&&e.right>e.left&&e.bottom>e.top;function nb(e,t,o){return t==="r"?e.createRadialGradient(o.xCenter,o.yCenter,0,o.xCenter,o.yCenter,o.drawingArea):t==="y"?e.createLinearGradient(0,o.bottom,0,o.top):e.createLinearGradient(o.left,0,o.right,0)}function ib(e,t){t.forEach(function(o){e.addColorStop(o.stop,o.color.rgbString());});}function rb(e,t,o){if(e.options.has(t.key)){let i=e.options.get(t.key).filter(r=>r.datasetIndex===o);if(i.length)return i[0]}}function ab(e,t){if(e.type==="radialLinear"){let r=e.getDistanceFromCenterForValue(t);return {pixel:r,stop:r/e.drawingArea}}let o=e.options.reverse,n=l9(e,t),i=e.getDecimalForPixel(n);return {pixel:n,stop:o?1-i:i}}var Iu=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,ii=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function c9(e,t,o){let n=t.color.rgb,i=ii(n.r/255),r=ii(n.g/255),a=ii(n.b/255),s=o.color.rgb,l=ii(s.r/255),c=ii(s.g/255),d=ii(s.b/255);return tn({r:Math.round(Iu(i+e*(l-i))*255),g:Math.round(Iu(r+e*(c-r))*255),b:Math.round(Iu(a+e*(d-a))*255),a:n.a+e*Math.abs(s.a-n.a)})}function d9(e,t,o,n){let i=rb(e,t,o);if(!i||!i.stopColors.length)return;let{stop:r}=ab(i.scale,n),a,s;for(let l of i.stopColors){if(l.stop===r)return l.color;l.stop<r?a=l:l.stop>r&&!s&&(s=l);}return s?c9(r,a,s):a}var sb=[{key:"backgroundColor",legendItemKey:"fillStyle"},{key:"borderColor",legendItemKey:"strokeStyle"}],u9=(e,t)=>t.labels&&t.labels.font&&st(t.labels.font.size)?t.labels.font.size:e.options.font.size;function p9(e,t,o,n,i){let r=rb(e,o,n.datasetIndex);if(!r||!r.stopColors.length)return;let a=nb(t,r.axis,i);ib(a,r.stopColors),n[o.legendItemKey]=a;}function m9(e,{boxWidth:t,boxHeight:o}){return {top:e.top,left:e.left,bottom:e.top+o,right:e.left+t,xCenter:e.left+t/2,yCenter:e.top+o/2,drawingArea:Math.max(t,o)/2}}function h9(e,t,o,n){let i=e.legend.legendHitBoxes[o.datasetIndex],r=m9(i,n);ob(r)&&sb.forEach(function(a){p9(t,e.ctx,a,o,r);});}function g9(e,t,o,n){for(let i of e.legend.legendItems)sb.forEach(function(r){let a=o.data[i.index],s=d9(t,r,n,a);s&&s.valid&&(i[r.legendItemKey]=s.rgbString());});}function f9(e,t){let o=e.legend,n=o.options,i=n.labels.boxHeight?n.labels.boxHeight:u9(e,n),r=n.labels.boxWidth,a=e.data.datasets;for(let s=0;s<a.length;s++){let l=o.legendItems[s];l.datasetIndex===s?h9(e,t,l,{boxWidth:r,boxHeight:i}):g9(e,t,a[s],s);}}var Ks=new Map,y9=Eu?(e,t)=>e[t+"Scale"]:(e,t)=>e.controller["_"+t+"Scale"];function x9(e,t,o){for(let n of Object.keys(t)){let{pixel:i,stop:r}=ab(e,n);if(isFinite(i)&&isFinite(r)){let a=tn(t[n]);a&&a.valid&&o.push({stop:Math.max(0,Math.min(1,r)),color:a});}}o.sort((n,i)=>n.stop-i.stop);}function b9(e,t,o,n){t[o]=n,e.dataset&&(e.dataset.options?e.dataset.options[o]=n:e.dataset[o]=n);}function C9(e,t,o,n){let i=e.options.get(o);return i?t.hidden||(i=i.filter(r=>r.datasetIndex!==n),e.options.set(o,i)):(i=[],e.options.set(o,i)),i}function P9(e,t,o,n,i){let r=e.ctx,a=e.getDatasetMeta(i);if(!a.hidden)for(let[s,l]of Object.entries(o)){let{axis:c,colors:d}=l;if(!d)continue;let u=y9(a,c);if(!u){console.warn(`Scale not found for '${c}'-axis in datasets[${i}] of chart id ${e.id}, skipping.`);continue}let p=C9(t,a,s,i),h={datasetIndex:i,axis:c,scale:u,stopColors:[]};p.push(h);let m=nb(r,c,u);x9(u,d,h.stopColors),h.stopColors.length&&(ib(m,h.stopColors),b9(a,n,s,m));}}var lb={id:"gradient",beforeInit(e){let t={};t.options=new Map,Ks.set(e,t);},beforeDatasetsUpdate(e){let t=e.chartArea;if(!ob(t))return;let o=Ks.get(e),n=e.data.datasets;for(let i=0;i<n.length;i++){let r=n[i],a=r.gradient;a&&P9(e,o,a,r,i);}},afterUpdate(e){let t=Ks.get(e);e.legend&&e.legend.options.display!==false&&Eu&&f9(e,t);},destroy(e){Ks.delete(e);}};var S9=[an,Kn,Ke,ix,rx,nx,yx,Xe,ye,ox,Ze,eb,lb];Lt.register(...S9);var mb="label";function db(e,t){typeof e=="function"?e(t):e&&(e.current=t);}function T9(e,t){Object.assign(e.options,t);}function hb(e,t){e.labels=t;}function gb(e,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mb,n=[];e.datasets=t.map(i=>{let r=e.datasets.find(a=>a[o]===i[o]);return !r||!i.data||n.includes(r)?S({},i):(n.push(r),Object.assign(r,i),r)});}function k9(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mb,o={labels:[],datasets:[]};return hb(o,e.labels),gb(o,e.datasets,t),o}function w9(e,t){let x=e,{height:o=150,width:n=300,redraw:i=false,datasetIdKey:r,type:a,data:s,options:l,plugins:c=[],fallbackContent:d,updateMode:u}=x,p=ot(x,["height","width","redraw","datasetIdKey","type","data","options","plugins","fallbackContent","updateMode"]),h=useRef(null),m=useRef(),g=()=>{h.current&&(m.current=new Lt(h.current,{type:a,data:k9(s,r),options:l&&S({},l),plugins:c}),db(t,m.current));},f=()=>{db(t,null),m.current&&(m.current.destroy(),m.current=null);};return useEffect(()=>{!i&&m.current&&l&&T9(m.current,l);},[i,l]),useEffect(()=>{!i&&m.current&&hb(m.current.config.data,s.labels);},[i,s.labels]),useEffect(()=>{!i&&m.current&&s.datasets&&gb(m.current.config.data,s.datasets,r);},[i,s.datasets]),useEffect(()=>{m.current&&(i?(f(),setTimeout(g)):m.current.update(u));},[i,l,s.labels,s.datasets,u]),useEffect(()=>{m.current&&(f(),setTimeout(g));},[a]),useEffect(()=>(g(),()=>f()),[]),Ac.createElement("canvas",Object.assign({ref:h,role:"img",height:o,width:n},p),d)}var v9=forwardRef(w9);function _9(e,t){return Lt.register(t),forwardRef((o,n)=>Ac.createElement(v9,Object.assign({},o,{ref:n,type:e})))}var fb=_9("bar",nn);function qs(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=useCallback(()=>R(null,null,function*(){if(!o||!o.isCustomerLoaded)return null;try{let l={currencyId:e.currencyId,timeRange:e.timeRange};return yield o.getCreditUsage(l)}catch(l){throw console.error(l),l}}),[o,e.currencyId,e.timeRange,n]),{data:r,error:a,isLoading:s}=Ut({func:i});return useMemo(()=>({creditUsage:r,isLoading:s,error:a}),[r,a,s])}var yb={id:"redrawBeforeFirstDrawPlugin",beforeDraw(e){e.$rendered||(e.$rendered=true,e.update("none"));}};var Fu=(e,t=1)=>{let o=Math.round(t*255).toString(16).padStart(2,"0");return `${e}${o}`};var Lu=e=>e.palette.text.secondary,Bu=e=>e.palette.outlinedBorder,Ru=e=>({family:e.typography.fontFamily,size:parseInt(e.typography.body.fontSize)});function Du(e){let t=["#4caf50","#2196f3","#ff5722","#ff9800","#e91e63","#3f51b5","#00bcd4","#81c784","#64b5f6","#ff8a65","#ffb74d","#f06292","#7986cb","#4dd0e1","#a5d6a7","#90caf9","#ffab91","#ffcc80","#f48fb1","#9fa8da","#80deea"];return t[e%t.length]}function I9(e){let t=[],o=new Date;switch(e){case CreditUsageTimeRange.LastDay:{let n=new Date(o);n.setHours(n.getHours()-23),n.setMinutes(0,0,0);for(let i=0;i<24;i++){let r=new Date(n);r.setHours(r.getHours()+i),t.push(r.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}));}break}case CreditUsageTimeRange.LastWeek:{for(let n=6;n>=0;n--){let i=new Date(o);i.setDate(i.getDate()-n),t.push(i.toLocaleDateString("en-US",{month:"short",day:"2-digit"}));}break}case CreditUsageTimeRange.LastYear:{for(let n=11;n>=0;n--){let i=new Date(o);i.setMonth(i.getMonth()-n),t.push(i.toLocaleDateString("en-US",{month:"short",year:"2-digit"}));}break}case CreditUsageTimeRange.LastMonth:default:{for(let n=29;n>=0;n--){let i=new Date(o);i.setDate(i.getDate()-n),t.push(i.toLocaleDateString("en-US",{month:"short",day:"2-digit"}));}break}}return t}function E9(e,t){let o=new Date(e);switch(o.setMinutes(0,0,0),t){case CreditUsageTimeRange.LastDay:return o.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});case CreditUsageTimeRange.LastYear:return e.toLocaleDateString("en-US",{month:"short",year:"2-digit"});case CreditUsageTimeRange.LastWeek:case CreditUsageTimeRange.LastMonth:default:return e.toLocaleDateString("en-US",{month:"short",day:"2-digit"})}}function F9(e,t){return {responsive:true,maintainAspectRatio:false,interaction:{mode:"point",intersect:true},elements:{bar:{borderRadius:4,borderSkipped:"bottom"}},plugins:{legend:{display:false},tooltip:{enabled:false,external:t},datalabels:{display:false}},scales:{x:{type:"category",stacked:true,ticks:{color:Lu(e),font:Ru(e),maxRotation:45,maxTicksLimit:15},grid:{color:Bu(e),drawOnChartArea:false,drawTicks:false}},y:{type:"linear",stacked:true,beginAtZero:true,ticks:{color:Lu(e),font:Ru(e),callback:o=>ft(Number(o))},grid:{color:Fu(Bu(e),.5),drawOnChartArea:true,drawTicks:false,borderDash:[5,5]}}}}}function xb(e,t,o,n){let i=I9(n);if(!e||!e.series||e.series.length===0)return {data:null,options:null};let r=e.series.map((l,c)=>{let d=l.featureName,u=new Map;l.points.forEach(m=>{let g=E9(new Date(m.timestamp),n),f=u.get(g)||0;u.set(g,f+m.value);});let p=i.map(m=>u.get(m)||0),h=Du(c);return {label:d,data:p,backgroundColor:Fu(h,.8),borderColor:h,borderWidth:1}}).reverse(),a={labels:i,datasets:r},s=F9(t,o);return {data:a,options:s}}var U9=300;function Cb(e,t){let o=t.dataPoints[0],n=o.parsed.y,i=e.scales.y,r=n/i.max*(i.bottom-i.top),a=t.caretY+r/2,s=e.getDatasetMeta(o.datasetIndex).data[o.dataIndex],l=s.x-s.width/2,c=e.canvas.offsetTop+a,d=e.canvas.offsetLeft+l;return {top:c,left:d}}function O9(e,t){let o=e.canvas.offsetTop+t.caretY,n=e.canvas.offsetLeft+t.caretX;return {top:o,left:n}}function Pb(e,t=O9){let[o,n]=useState(0),[i,r]=useState(0),[a,s]=useState(false),[l,c]=useState(),d=useCallback(p=>{let{chart:h,tooltip:m}=p;if(m.opacity===0){s(false);return}let{top:g,left:f}=t(h,m);r(f),n(g),c(e(m)),s(true);},[e,t]);return {tooltipInfo:{positionTop:o,positionLeft:i,isOpen:a,payload:l},tooltipHandler:d}}var z9=y(Box)`
1019
1019
  position: absolute;
1020
- `,b9=x.div`
1020
+ `,V9=y.div`
1021
1021
  position: absolute;
1022
1022
  background-color: white;
1023
1023
  border-radius: 8px;
@@ -1042,21 +1042,21 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
1042
1042
  transform: translateY(-50%);
1043
1043
  filter: drop-shadow(2px 0 2px rgba(0, 0, 0, 0.1));
1044
1044
  }
1045
- `,lb=({children:e,tooltipInfo:{positionTop:t,positionLeft:o,payload:n,isOpen:i},$padding:r})=>{let[a,s]=useState(false),[l,c]=useState(false),d=useRef(f9(()=>c(false),g9));return useEffect(()=>{n&&(a||i)?(d.current.cancel(),c(true)):d.current();},[n,a,i]),jsxs(Fragment,{children:[jsx(x9,{style:{top:t,left:o}}),jsx(b9,{$isOpen:l,$padding:r,style:{top:t,left:o-140},onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),children:e})]})};var T9=x.div`
1045
+ `,Sb=({children:e,tooltipInfo:{positionTop:t,positionLeft:o,payload:n,isOpen:i},$padding:r})=>{let[a,s]=useState(false),[l,c]=useState(false),d=useRef(N9(()=>c(false),U9));return useEffect(()=>{n&&(a||i)?(d.current.cancel(),c(true)):d.current();},[n,a,i]),jsxs(Fragment,{children:[jsx(z9,{style:{top:t,left:o}}),jsx(V9,{$isOpen:l,$padding:r,style:{top:t,left:o-140},onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),children:e})]})};var G9=y.div`
1046
1046
  width: 3px;
1047
1047
  margin-right: 15px;
1048
- `;function db({tooltipInfo:e}){if(!e.payload)return jsx(Fragment,{});let{featureName:t,usage:o,date:n,color:i}=e.payload;return jsx(lb,{tooltipInfo:e,placement:"top",$padding:16,children:jsxs("div",{style:{display:"flex",flexDirection:"row",gap:8},className:"stigg-credit-usage-chart-tooltip",children:[jsx(T9,{style:{backgroundColor:i,marginTop:2}}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[jsx(C,{variant:"body1",color:"secondary",children:n}),jsx(C,{variant:"body1",color:"primary",children:t}),jsxs("div",{style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},children:[jsx(C,{variant:"body1",color:"primary",children:gt(o)}),jsx(C,{variant:"body1",color:"primary",children:"Credits"})]})]})]})})}function ub(){let e=useCallback(t=>{if(isEmpty(t.dataPoints)||isEmpty(t.labelColors))return;let o=t.dataPoints[0],n=t.labelColors[0];if(!o||!n)return;let i=o.dataset.label||"Unknown Feature",r=o.parsed.y||0,a=o.label||"",s=n.backgroundColor;return {featureName:i,usage:r,date:a,color:s}},[]);return sb(e,ab)}var w9=x.div`
1048
+ `;function kb({tooltipInfo:e}){if(!e.payload)return jsx(Fragment,{});let{featureName:t,usage:o,date:n,color:i}=e.payload;return jsx(Sb,{tooltipInfo:e,placement:"top",$padding:16,children:jsxs("div",{style:{display:"flex",flexDirection:"row",gap:8},className:"stigg-credit-usage-chart-tooltip",children:[jsx(G9,{style:{backgroundColor:i,marginTop:2}}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[jsx(P,{variant:"body1",color:"secondary",children:n}),jsx(P,{variant:"body1",color:"primary",children:t}),jsxs("div",{style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},children:[jsx(P,{variant:"body1",color:"primary",children:ft(o)}),jsx(P,{variant:"body1",color:"primary",children:"Credits"})]})]})]})})}function wb(){let e=useCallback(t=>{if(isEmpty(t.dataPoints)||isEmpty(t.labelColors))return;let o=t.dataPoints[0],n=t.labelColors[0];if(!o||!n)return;let i=o.dataset.label||"Unknown Feature",r=o.parsed.y||0,a=o.label||"",s=n.backgroundColor;return {featureName:i,usage:r,date:a,color:s}},[]);return Pb(e,Cb)}var Y9=y.div`
1049
1049
  padding: 8px;
1050
1050
  margin: 0 12px;
1051
- `,v9=x.div`
1051
+ `,Z9=y.div`
1052
1052
  display: flex;
1053
1053
  align-items: center;
1054
- `,_9=x.div`
1054
+ `,X9=y.div`
1055
1055
  flex: 1;
1056
1056
  position: relative;
1057
1057
  align-items: center;
1058
1058
  display: flex;
1059
- `,A9=x.div`
1059
+ `,K9=y.div`
1060
1060
  height: 24px;
1061
1061
  width: ${({$width:e,$minContentWidth:t})=>{let o=Math.min(e,100),n=Math.max(t,80);return `max(${o}%, ${n}px)`}};
1062
1062
  background-color: #f5f6f9;
@@ -1066,36 +1066,36 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
1066
1066
  align-items: center;
1067
1067
  justify-content: space-between;
1068
1068
  padding: 0 8px;
1069
- `,M9=x.div`
1069
+ `,q9=y.div`
1070
1070
  width: 12px;
1071
1071
  height: 12px;
1072
1072
  border-radius: 2px;
1073
1073
  background-color: ${({$color:e})=>e};
1074
1074
  margin-right: 8px;
1075
1075
  flex-shrink: 0;
1076
- `,I9=x.div`
1076
+ `,Q9=y.div`
1077
1077
  margin-right: 24px;
1078
1078
  flex-shrink: 0;
1079
1079
  overflow: hidden;
1080
1080
  text-overflow: ellipsis;
1081
1081
  white-space: nowrap;
1082
- `;function pb({creditUsageData:e}){var i,r;if(!e||!e.series||e.series.length===0)return null;let t=e.series.map((a,s)=>{let l=a.featureId,c=a.featureName,d=a.totalCredits,u=vu(s);return {featureId:l,featureName:c,totalCredits:d,color:u}}).sort((a,s)=>s.totalCredits-a.totalCredits),o=Math.max(...t.map(a=>a.totalCredits)),n=(a,s)=>{let l=Math.min(a.length*7,200),c=gt(s).length*8;return 20+l+16+c+16};return jsxs(w9,{className:"stigg-credit-usage-chart-legend",children:[jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[jsx(C,{style:{marginBottom:12},variant:"body1",color:"secondary",className:"stigg-credit-usage-chart-legend-title",children:"Top sources"}),jsx(C,{variant:"caption",color:"disabled",className:"stigg-credit-usage-chart-legend-title-currency-units",children:(r=(i=e.currency)==null?void 0:i.units)==null?void 0:r.plural})]}),jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:t.map(a=>{let s=o>0?a.totalCredits/o*100:0,l=n(a.featureName,a.totalCredits);return jsx(v9,{className:`stigg-credit-usage-chart-legend-item stigg-credit-usage-chart-legend-item-${a.featureId}`,children:jsx(_9,{className:"stigg-credit-usage-chart-legend-bar-container",children:jsxs(A9,{$width:s,$minContentWidth:l,children:[jsxs("div",{style:{display:"flex",alignItems:"center"},children:[jsx(M9,{$color:a.color}),jsx(I9,{className:"stigg-credit-usage-chart-legend-feature-name",children:jsx(C,{variant:"body1",color:"primary",className:"stigg-credit-usage-chart-legend-feature-name-text",children:a.featureName})})]}),jsx(C,{variant:"caption",color:"primary",bold:true,className:"stigg-credit-usage-chart-legend-value",children:gt(a.totalCredits)})]})})},a.featureId)})})]})}var L9=x.div`
1082
+ `;function vb({creditUsageData:e}){var i,r;if(!e||!e.series||e.series.length===0)return null;let t=e.series.map((a,s)=>{let l=a.featureId,c=a.featureName,d=a.totalCredits,u=Du(s);return {featureId:l,featureName:c,totalCredits:d,color:u}}).sort((a,s)=>s.totalCredits-a.totalCredits),o=Math.max(...t.map(a=>a.totalCredits)),n=(a,s)=>{let l=Math.min(a.length*7,200),c=ft(s).length*8;return 20+l+16+c+16};return jsxs(Y9,{className:"stigg-credit-usage-chart-legend",children:[jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[jsx(P,{style:{marginBottom:12},variant:"body1",color:"secondary",className:"stigg-credit-usage-chart-legend-title",children:"Top sources"}),jsx(P,{variant:"caption",color:"disabled",className:"stigg-credit-usage-chart-legend-title-currency-units",children:(r=(i=e.currency)==null?void 0:i.units)==null?void 0:r.plural})]}),jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:t.map(a=>{let s=o>0?a.totalCredits/o*100:0,l=n(a.featureName,a.totalCredits);return jsx(Z9,{className:`stigg-credit-usage-chart-legend-item stigg-credit-usage-chart-legend-item-${a.featureId}`,children:jsx(X9,{className:"stigg-credit-usage-chart-legend-bar-container",children:jsxs(K9,{$width:s,$minContentWidth:l,children:[jsxs("div",{style:{display:"flex",alignItems:"center"},children:[jsx(q9,{$color:a.color}),jsx(Q9,{className:"stigg-credit-usage-chart-legend-feature-name",children:jsx(P,{variant:"body1",color:"primary",className:"stigg-credit-usage-chart-legend-feature-name-text",children:a.featureName})})]}),jsx(P,{variant:"caption",color:"primary",bold:true,className:"stigg-credit-usage-chart-legend-value",children:ft(a.totalCredits)})]})})},a.featureId)})})]})}var J9=y.div`
1083
1083
  display: flex;
1084
1084
  flex-direction: column;
1085
1085
  justify-content: center;
1086
1086
  align-items: center;
1087
1087
  height: 100%;
1088
- `,B9=x(pt)`
1088
+ `,tA=y(mt)`
1089
1089
  svg {
1090
1090
  width: 32px;
1091
1091
  height: 32px;
1092
1092
  }
1093
- `;function mb(){return jsxs(L9,{className:"stigg-credit-usage-chart-empty-state",children:[jsx(B9,{icon:"PayAsYouGoCharge",style:{display:"flex"}}),jsx(C,{variant:"body1",color:"primary",bold:true,children:"No Usage Recorded"})]})}var F9=x.div`
1093
+ `;function Ab(){return jsxs(J9,{className:"stigg-credit-usage-chart-empty-state",children:[jsx(tA,{icon:"PayAsYouGoCharge",style:{display:"flex"}}),jsx(P,{variant:"body1",color:"primary",bold:true,children:"No Usage Recorded"})]})}var oA=y.div`
1094
1094
  display: flex;
1095
1095
  justify-content: center;
1096
1096
  align-items: center;
1097
1097
  height: 100%;
1098
- `;function gb(){return jsx(F9,{className:"stigg-credit-usage-chart-error-state",children:jsx(C,{variant:"body1",color:"error",children:"Failed to load credit usage"})})}var yb=[{value:CreditUsageTimeRange.LastDay,label:"Last 24 Hours"},{value:CreditUsageTimeRange.LastWeek,label:"Last 7 Days"},{value:CreditUsageTimeRange.LastMonth,label:"Last 30 Days"},{value:CreditUsageTimeRange.LastYear,label:"Last 12 Months"}],O9=x(Select)`
1098
+ `;function Ib(){return jsx(oA,{className:"stigg-credit-usage-chart-error-state",children:jsx(P,{variant:"body1",color:"error",children:"Failed to load credit usage"})})}var Eb=[{value:CreditUsageTimeRange.LastDay,label:"Last 24 Hours"},{value:CreditUsageTimeRange.LastWeek,label:"Last 7 Days"},{value:CreditUsageTimeRange.LastMonth,label:"Last 30 Days"},{value:CreditUsageTimeRange.LastYear,label:"Last 12 Months"}],aA=y(Select)`
1099
1099
  border-radius: 10px;
1100
1100
  height: 38px;
1101
1101
  min-width: 150px;
@@ -1103,7 +1103,7 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
1103
1103
  &:hover .MuiOutlinedInput-notchedOutline {
1104
1104
  border-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
1105
1105
  }
1106
- `,U9=x(OutlinedInput)`
1106
+ `,sA=y(OutlinedInput)`
1107
1107
  & .MuiInputBase-input {
1108
1108
  padding: 10px 12px;
1109
1109
  }
@@ -1111,11 +1111,11 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
1111
1111
  &.Mui-focused .MuiOutlinedInput-notchedOutline {
1112
1112
  border-color: ${({theme:e})=>e.stigg.palette.primary} !important;
1113
1113
  }
1114
- `;function xb({isLoading:e,totalCredits:t,selectedTimeRange:o,setSelectedTimeRange:n,error:i,localization:r,currencyUnit:a}){return jsxs("div",{className:"stigg-credit-usage-chart-header",style:{display:"flex",flexDirection:"row",marginBottom:16,justifyContent:"space-between"},children:[jsxs("div",{style:{display:"flex",flexDirection:"row",gap:8,alignItems:"center"},children:[jsx(C,{variant:"h3",color:"primary",className:"stigg-credit-usage-chart-title",children:r.title}),e?jsx(dt,{width:100,height:24}):jsxs(Fragment,{children:[jsx(C,{variant:"h6",color:"secondary",className:"stigg-credit-usage-chart-total",children:"|"}),jsxs(C,{variant:"h6",color:"secondary",className:"stigg-credit-usage-chart-total",children:[r.totalSpend,": ",gt(t||0)," ",a||""]})]})]}),!e&&!i&&jsx(O9,{className:"stigg-credit-usage-chart-time-range-select",value:o,input:jsx(U9,{}),onChange:s=>n(s.target.value),renderValue:s=>{var l;return jsxs(C,{variant:"body1",color:"primary",children:[((l=yb.find(c=>c.value===s))==null?void 0:l.label)||""," "]})},children:yb.map(s=>jsx(MenuItem,{value:s.value,children:jsx(C,{variant:"body1",color:"primary",children:s.label})},s.value))})]})}var H9=x.div`
1114
+ `;function Fb({isLoading:e,totalCredits:t,selectedTimeRange:o,setSelectedTimeRange:n,error:i,localization:r,currencyUnit:a}){return jsxs("div",{className:"stigg-credit-usage-chart-header",style:{display:"flex",flexDirection:"row",marginBottom:16,justifyContent:"space-between"},children:[jsxs("div",{style:{display:"flex",flexDirection:"row",gap:8,alignItems:"center"},children:[jsx(P,{variant:"h3",color:"primary",className:"stigg-credit-usage-chart-title",children:r.title}),e?jsx(dt,{width:100,height:24}):jsxs(Fragment,{children:[jsx(P,{variant:"h6",color:"secondary",className:"stigg-credit-usage-chart-total",children:"|"}),jsxs(P,{variant:"h6",color:"secondary",className:"stigg-credit-usage-chart-total",children:[r.totalSpend,": ",ft(t||0)," ",a||""]})]})]}),!e&&!i&&jsx(aA,{className:"stigg-credit-usage-chart-time-range-select",value:o,input:jsx(sA,{}),onChange:s=>n(s.target.value),renderValue:s=>{var l;return jsxs(P,{variant:"body1",color:"primary",children:[((l=Eb.find(c=>c.value===s))==null?void 0:l.label)||""," "]})},children:Eb.map(s=>jsx(MenuItem,{value:s.value,children:jsx(P,{variant:"body1",color:"primary",children:s.label})},s.value))})]})}var uA=y.div`
1115
1115
  display: flex;
1116
1116
  flex-direction: column;
1117
1117
  gap: 8px;
1118
- `,W9=x.div`
1118
+ `,pA=y.div`
1119
1119
  align-items: center;
1120
1120
  justify-content: center;
1121
1121
  min-height: 480px;
@@ -1126,44 +1126,44 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
1126
1126
  border-radius: 8px;
1127
1127
  border: 1px solid ${({theme:e})=>{var t,o;return ((o=(t=e==null?void 0:e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder)||"#e0e0e0"}};
1128
1128
  background-color: ${({theme:e})=>{var t,o;return ((o=(t=e==null?void 0:e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper)||"#ffffff"}};
1129
- `,G9=x(ro)`
1129
+ `,mA=y(ro)`
1130
1130
  border-radius: 4px;
1131
1131
  height: 400px;
1132
1132
  width: 100%;
1133
- `;function Cb({currencyId:e,timeRange:t,localization:o}){var P,T;let n=$o(),i=D({optional:true}),r=i==null?void 0:i.stigg,a=S(S({},Qy),o),[s,l]=useState(t),{creditUsage:c,isLoading:d,error:u}=Hs({currencyId:e,timeRange:s}),{tooltipInfo:p,tooltipHandler:m}=ub(),{data:h,options:f}=useMemo(()=>ib(c||null,n,m,s),[c,n,m,s]),g=useMemo(()=>(c==null?void 0:c.series.reduce((k,w)=>k+w.totalCredits,0))||0,[c]),y=(T=(P=c==null?void 0:c.currency)==null?void 0:P.units)==null?void 0:T.plural;return jsx(ht,{componentTheme:n,children:jsxs(H9,{className:"stigg-credit-usage-chart-container",children:[jsx(W9,{className:"stigg-credit-usage-chart-card",children:jsxs("div",{style:{width:"100%"},children:[jsx(xb,{isLoading:d,totalCredits:g,selectedTimeRange:s,setSelectedTimeRange:l,error:u,localization:a,currencyUnit:y}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[jsx("div",{style:{height:"400px",position:"relative"},children:d?jsx(G9,{className:"stigg-credit-usage-chart-skeleton"}):u?jsx(gb,{}):(c==null?void 0:c.series.length)===0?jsx(mb,{}):jsxs(Fragment,{children:[jsx(db,{tooltipInfo:p}),jsx(ob,{className:"stigg-credit-usage-chart-bar",data:h!=null?h:{labels:[],datasets:[]},options:f!=null?f:{},plugins:[nb]})]})}),!d&&jsx(pb,{creditUsageData:c})]})]})}),jsx(Jt,{source:"credit_usage_chart",align:"end",smallScreenAlign:"end",style:{marginTop:0},showWatermark:r==null?void 0:r.getShowWatermark()})]})})}var Y9=(e,t,o)=>o==="primary"?t.palette.primary:e>=100?t.palette.progress.high:e>=75?t.palette.progress.medium:t.palette.progress.low,Z9=x.div`
1133
+ `;function Bb({currencyId:e,timeRange:t,localization:o}){var b,T;let n=Vo(),i=D({optional:true}),r=i==null?void 0:i.stigg,a=S(S({},p1),o),[s,l]=useState(t),{creditUsage:c,isLoading:d,error:u}=qs({currencyId:e,timeRange:s}),{tooltipInfo:p,tooltipHandler:h}=wb(),{data:m,options:g}=useMemo(()=>xb(c||null,n,h,s),[c,n,h,s]),f=useMemo(()=>(c==null?void 0:c.series.reduce((k,w)=>k+w.totalCredits,0))||0,[c]),x=(T=(b=c==null?void 0:c.currency)==null?void 0:b.units)==null?void 0:T.plural;return jsx(ht,{componentTheme:n,children:jsxs(uA,{className:"stigg-credit-usage-chart-container",children:[jsx(pA,{className:"stigg-credit-usage-chart-card",children:jsxs("div",{style:{width:"100%"},children:[jsx(Fb,{isLoading:d,totalCredits:f,selectedTimeRange:s,setSelectedTimeRange:l,error:u,localization:a,currencyUnit:x}),jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[jsx("div",{style:{height:"400px",position:"relative"},children:d?jsx(mA,{className:"stigg-credit-usage-chart-skeleton"}):u?jsx(Ib,{}):(c==null?void 0:c.series.length)===0?jsx(Ab,{}):jsxs(Fragment,{children:[jsx(kb,{tooltipInfo:p}),jsx(fb,{className:"stigg-credit-usage-chart-bar",data:m!=null?m:{labels:[],datasets:[]},options:g!=null?g:{},plugins:[yb]})]})}),!d&&jsx(vb,{creditUsageData:c})]})]})}),jsx(Jt,{source:"credit_usage_chart",align:"end",smallScreenAlign:"end",style:{marginTop:0},showWatermark:r==null?void 0:r.getShowWatermark()})]})})}var gA=(e,t,o)=>o==="primary"?t.palette.primary:e>=100?t.palette.progress.high:e>=75?t.palette.progress.medium:t.palette.progress.low,fA=y.div`
1134
1134
  width: 100%;
1135
1135
  height: 8px;
1136
1136
  background-color: ${({theme:e})=>e.stigg.palette.progress.background};
1137
1137
  border-radius: 4px;
1138
1138
  overflow: hidden;
1139
- `,X9=x.div`
1139
+ `,yA=y.div`
1140
1140
  height: 100%;
1141
1141
  width: ${({percentage:e})=>Math.max(0,Math.min(100,e))}%;
1142
- background-color: ${({theme:e,percentage:t,variant:o})=>Y9(t,e.stigg,o)};
1142
+ background-color: ${({theme:e,percentage:t,variant:o})=>gA(t,e.stigg,o)};
1143
1143
  border-radius: 4px;
1144
1144
  transition: width 0.3s ease-in-out;
1145
- `;function Ys({percentage:e,className:t,variant:o="utilization"}){return jsx(Z9,{className:t,children:jsx(X9,{percentage:e,variant:o})})}var q9=x.div`
1145
+ `;function el({percentage:e,className:t,variant:o="utilization"}){return jsx(fA,{className:t,children:jsx(yA,{percentage:e,variant:o})})}var bA=y.div`
1146
1146
  display: flex;
1147
1147
  flex-direction: row;
1148
1148
  justify-content: space-between;
1149
1149
  align-items: baseline;
1150
1150
  width: 100%;
1151
- `,Q9=x.div`
1151
+ `,CA=y.div`
1152
1152
  display: flex;
1153
1153
  flex-direction: row;
1154
1154
  gap: 4px;
1155
1155
  align-items: baseline;
1156
- `,J9=x.div`
1156
+ `,PA=y.div`
1157
1157
  display: flex;
1158
1158
  flex-direction: row;
1159
1159
  gap: 4px;
1160
1160
  align-items: baseline;
1161
- `,tA=({totalConsumed:e,totalGranted:t})=>{let o=Fa(e!=null?e:0,t!=null?t:0);return jsx(Ys,{percentage:o,className:"stigg-credit-utilization-progress"})};function Sb({balance:e,isLoading:t,error:o,decimalPlaces:n=null,showUnits:i=true,showSymbol:r=false,remainingLabel:a=Da.remaining}){if(o)return jsx(C,{variant:"body1",color:"error",className:"stigg-credit-utilization-value-error",children:o.message||"Failed to load balance"});if(t)return jsx(ro,{width:280,height:24,className:"stigg-credit-utilization-value-loading"});if(e){let{currentBalance:s,totalConsumed:l,totalGranted:c}=e,d=Ea(e,i,r);return jsxs(Fragment,{children:[jsxs(q9,{children:[jsxs(Q9,{children:[jsx(C,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-utilization-usage",children:ho(l,n)}),jsx(C,{variant:"h3",color:"primary",className:"stigg-credit-utilization-separator",children:"/"}),jsx(C,{variant:"h3",color:"primary",className:"stigg-credit-utilization-total",children:ho(c,n)}),jsx(C,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-suffix",children:d})]}),jsxs(J9,{children:[jsx(C,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-remaining-label",children:a}),jsx(C,{variant:"caption",color:"primary",bold:true,className:"stigg-credit-utilization-remaining-value",children:ho(s,n)})]})]}),jsx(tA,{totalConsumed:e.totalConsumed,totalGranted:e.totalGranted}),jsx(Ra,{usagePeriodEnd:e.usagePeriodEnd,className:"stigg-credit-utilization-reset-period"})]})}return jsx(C,{variant:"body1",color:"disabled",className:"stigg-credit-utilization-value-no-balance",children:"No balance data available"})}var oA=x.div`
1161
+ `,SA=({totalConsumed:e,totalGranted:t})=>{let o=$a(e!=null?e:0,t!=null?t:0);return jsx(el,{percentage:o,className:"stigg-credit-utilization-progress"})};function Db({balance:e,isLoading:t,error:o,decimalPlaces:n=null,showUnits:i=true,showSymbol:r=false,remainingLabel:a=Wa.remaining}){if(o)return jsx(P,{variant:"body1",color:"error",className:"stigg-credit-utilization-value-error",children:o.message||"Failed to load balance"});if(t)return jsx(ro,{width:280,height:24,className:"stigg-credit-utilization-value-loading"});if(e){let{currentBalance:s,totalConsumed:l,totalGranted:c}=e,d=Va(e,i,r);return jsxs(Fragment,{children:[jsxs(bA,{children:[jsxs(CA,{children:[jsx(P,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-utilization-usage",children:mo(l,n)}),jsx(P,{variant:"h3",color:"primary",className:"stigg-credit-utilization-separator",children:"/"}),jsx(P,{variant:"h3",color:"primary",className:"stigg-credit-utilization-total",children:mo(c,n)}),jsx(P,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-suffix",children:d})]}),jsxs(PA,{children:[jsx(P,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-remaining-label",children:a}),jsx(P,{variant:"caption",color:"primary",bold:true,className:"stigg-credit-utilization-remaining-value",children:mo(s,n)})]})]}),jsx(SA,{totalConsumed:e.totalConsumed,totalGranted:e.totalGranted}),jsx(Ha,{usagePeriodEnd:e.usagePeriodEnd,className:"stigg-credit-utilization-reset-period"})]})}return jsx(P,{variant:"body1",color:"disabled",className:"stigg-credit-utilization-value-no-balance",children:"No balance data available"})}var kA=y.div`
1162
1162
  display: flex;
1163
1163
  flex-direction: column;
1164
1164
  gap: 8px;
1165
1165
  width: 100%;
1166
- `,nA=x.div`
1166
+ `,wA=y.div`
1167
1167
  display: flex;
1168
1168
  flex-direction: column;
1169
1169
  gap: 16px;
@@ -1172,7 +1172,7 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
1172
1172
  border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
1173
1173
  background-color: ${({theme:e})=>{var t,o;return (o=(t=e==null?void 0:e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
1174
1174
  min-height: 90px;
1175
- `;function Tb({currencyId:e,localization:t,decimalPlaces:o,showUnits:n=true,showSymbol:i=false,onAddCredits:r}){let a=jt(St),s=D({optional:true}),l=s==null?void 0:s.theme,{balance:c,isLoading:d,error:u}=po({currencyId:e}),{title:p,remaining:m,addCredits:h}=S(S({},Da),t),f=jsx(oA,{className:"stigg-credit-utilization-container",children:jsxs(nA,{className:"stigg-credit-utilization-card",children:[jsxs(En,{children:[jsx(C,{variant:"h6",color:"primary",className:"stigg-credit-utilization-title",children:p}),r&&c&&!u&&jsxs(Fn,{type:"button",onClick:()=>r(c),className:"stigg-credit-utilization-add-credits-button",children:[jsx(Na,{className:"stigg-credit-utilization-add-credits-icon"}),h]})]}),jsx(Sb,{balance:c,isLoading:d,error:u,decimalPlaces:o,showUnits:n,showSymbol:i,remainingLabel:m})]})});return a?f:jsx(ht,{componentTheme:l,children:f})}function Xs(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=useCallback(()=>R(null,null,function*(){if(!o||!o.isCustomerLoaded)return null;try{return o.getCreditGrants({currencyId:e.currencyId,paging:e.paging})}catch(l){throw console.error("Error fetching credit grants:",l),l}}),[o,e.currencyId,e.paging,n]),{data:r,error:a,isLoading:s}=Ot({func:i});return useMemo(()=>({creditGrants:(r==null?void 0:r.data)||[],paging:r==null?void 0:r.pageInfo,totalCount:r==null?void 0:r.totalCount,isLoading:s,error:a}),[r,a,s])}function Mu({skeletonRows:e,visibleHeadCells:t,hideLastRowBorder:o}){return jsx(Fragment,{children:Array.from({length:e}).map((n,i)=>jsx(TableRow,{children:t.map(r=>jsx(si,{$alignment:r.alignment,$width:r.width,$maxWidth:r.maxWidth,$minWidth:r.minWidth,$isLastRow:i===e-1,$hideLastRowBorder:o,children:jsx(ro,{width:r.width?parseInt(r.width.replace("px",""))-40:100,height:20})},String(r.id)))},i))})}function Iu({data:e,visibleHeadCells:t,onRowClick:o,hideLastRowBorder:n}){return jsx(Fragment,{children:e.map((i,r)=>jsx(Lu,{$clickable:!!o,onClick:()=>o&&o(i),children:t.map(a=>jsx(si,{$alignment:a.alignment,$width:a.width,$maxWidth:a.maxWidth,$minWidth:a.minWidth,$isLastRow:r===e.length-1,$hideLastRowBorder:n,onClick:a.disableClick?s=>s.stopPropagation():void 0,children:jsx(Bu,{$alignment:a.alignment,children:a.render(i)})},String(a.id)))},r))})}function Qs({errorMessage:e,className:t}){return e===void 0||typeof e=="string"?jsx(C,{variant:"body1",color:"error",className:t,children:e||"An error occurred"}):jsx(Fragment,{children:e})}function Js({message:e,className:t}){return e===void 0||typeof e=="string"?jsx(C,{variant:"body1",color:"secondary",className:t,children:e||"No data available"}):jsx(Fragment,{children:e})}var bA=x(TableContainer)`
1175
+ `;function Nb({currencyId:e,localization:t,decimalPlaces:o,showUnits:n=true,showSymbol:i=false,onAddCredits:r}){let a=jt(St),s=D({optional:true}),l=s==null?void 0:s.theme,{balance:c,isLoading:d,error:u}=po({currencyId:e}),{title:p,remaining:h,addCredits:m}=S(S({},Wa),t),g=jsx(kA,{className:"stigg-credit-utilization-container",children:jsxs(wA,{className:"stigg-credit-utilization-card",children:[jsxs(Ln,{children:[jsx(P,{variant:"h6",color:"primary",className:"stigg-credit-utilization-title",children:p}),r&&c&&!u&&jsxs(Bn,{type:"button",onClick:()=>r(c),className:"stigg-credit-utilization-add-credits-button",children:[jsx(Ga,{className:"stigg-credit-utilization-add-credits-icon"}),m]})]}),jsx(Db,{balance:c,isLoading:d,error:u,decimalPlaces:o,showUnits:n,showSymbol:i,remainingLabel:h})]})});return a?g:jsx(ht,{componentTheme:l,children:g})}function nl(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=useCallback(()=>R(null,null,function*(){if(!o||!o.isCustomerLoaded)return null;try{return o.getCreditGrants({currencyId:e.currencyId,paging:e.paging})}catch(l){throw console.error("Error fetching credit grants:",l),l}}),[o,e.currencyId,e.paging,n]),{data:r,error:a,isLoading:s}=Ut({func:i});return useMemo(()=>({creditGrants:(r==null?void 0:r.data)||[],paging:r==null?void 0:r.pageInfo,totalCount:r==null?void 0:r.totalCount,isLoading:s,error:a}),[r,a,s])}function Ou({skeletonRows:e,visibleHeadCells:t,hideLastRowBorder:o}){return jsx(Fragment,{children:Array.from({length:e}).map((n,i)=>jsx(TableRow,{children:t.map(r=>jsx(si,{$alignment:r.alignment,$width:r.width,$maxWidth:r.maxWidth,$minWidth:r.minWidth,$isLastRow:i===e-1,$hideLastRowBorder:o,children:jsx(ro,{width:r.width?parseInt(r.width.replace("px",""))-40:100,height:20})},String(r.id)))},i))})}function zu({data:e,visibleHeadCells:t,onRowClick:o,hideLastRowBorder:n}){return jsx(Fragment,{children:e.map((i,r)=>jsx(Vu,{$clickable:!!o,onClick:()=>o&&o(i),children:t.map(a=>jsx(si,{$alignment:a.alignment,$width:a.width,$maxWidth:a.maxWidth,$minWidth:a.minWidth,$isLastRow:r===e.length-1,$hideLastRowBorder:n,onClick:a.disableClick?s=>s.stopPropagation():void 0,children:jsx($u,{$alignment:a.alignment,children:a.render(i)})},String(a.id)))},r))})}function al({errorMessage:e,className:t}){return e===void 0||typeof e=="string"?jsx(P,{variant:"body1",color:"error",className:t,children:e||"An error occurred"}):jsx(Fragment,{children:e})}function sl({message:e,className:t}){return e===void 0||typeof e=="string"?jsx(P,{variant:"body1",color:"secondary",className:t,children:e||"No data available"}):jsx(Fragment,{children:e})}var VA=y(TableContainer)`
1176
1176
  border-radius: 8px;
1177
1177
  border: 1px solid ${({theme:e})=>e.stigg.palette.outlinedBorder};
1178
1178
  background-color: ${({theme:e})=>e.stigg.palette.backgroundPaper};
@@ -1185,13 +1185,13 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
1185
1185
  align-items: center;
1186
1186
  justify-content: center;
1187
1187
  `}
1188
- `,CA=x(Table)`
1188
+ `,$A=y(Table)`
1189
1189
  min-width: 600px;
1190
1190
  table-layout: auto;
1191
1191
  width: 100%;
1192
- `,PA=x(Divider)`
1192
+ `,HA=y(Divider)`
1193
1193
  border-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
1194
- `,si=x(TableCell)`
1194
+ `,si=y(TableCell)`
1195
1195
  padding: 8px 12px;
1196
1196
  border-bottom: 1px solid ${({theme:e})=>e.stigg.palette.outlinedBorder};
1197
1197
  text-align: ${({$alignment:e})=>e||"left"};
@@ -1204,38 +1204,38 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
1204
1204
  ${({$minWidth:e})=>e&&`min-width: ${e};`}
1205
1205
 
1206
1206
  ${({$isLastRow:e,$hideLastRowBorder:t})=>e&&t&&"border-bottom: none;"}
1207
- `,SA=x(si)`
1207
+ `,WA=y(si)`
1208
1208
  background-color: transparent;
1209
- `,Lu=x(TableRow)`
1209
+ `,Vu=y(TableRow)`
1210
1210
  ${({$clickable:e,theme:t})=>e&&`
1211
1211
  cursor: pointer;
1212
1212
  &:hover {
1213
1213
  background-color: ${t.stigg.palette.backgroundHighlight};
1214
1214
  }
1215
1215
  `}
1216
- `,Bu=x.div`
1216
+ `,$u=y.div`
1217
1217
  display: flex;
1218
1218
  align-items: center;
1219
1219
  justify-content: ${({$alignment:e})=>{switch(e){case "center":return "center";case "right":return "flex-end";default:return "flex-start"}}};
1220
1220
  width: 100%;
1221
- `,TA=x(TablePagination)`
1221
+ `,GA=y(TablePagination)`
1222
1222
  color: ${({theme:e})=>e.stigg.palette.text.secondary};
1223
- `;function kA({visibleHeadCells:e}){return jsx(TableHead,{children:jsx(TableRow,{children:e.map(t=>jsx(SA,{$alignment:t.alignment,$width:t.width,$maxWidth:t.maxWidth,$minWidth:t.minWidth,children:jsx(C,{variant:"caption",children:t.label})},String(t.id)))})})}function tl({data:e,headCells:t,isLoading:o=false,error:n=null,emptyMessage:i,errorMessage:r,onRowClick:a,className:s,skeletonRows:l=3,hideLastRowBorder:c=true,pageSize:d,pageNum:u,totalCount:p,onPageChange:m}){let h=t.filter(g=>g.visible!==false),f=!!n||!o&&e.length===0;return jsx(bA,{className:s,$hasMinHeight:f,children:n?jsx(Qs,{errorMessage:r,className:`${s}-error`}):!o&&e.length===0?jsx(Js,{message:i,className:`${s}-empty`}):jsxs(Fragment,{children:[jsxs(CA,{children:[jsx(kA,{visibleHeadCells:h}),jsx(TableBody,{children:o?jsx(Mu,{skeletonRows:l,visibleHeadCells:h,hideLastRowBorder:c}):jsx(Iu,{data:e,visibleHeadCells:h,onRowClick:a,hideLastRowBorder:c})})]}),!!(e!=null&&e.length)&&m&&jsxs(Fragment,{children:[jsx(PA,{}),jsx(TA,{component:"div",rowsPerPage:d!=null?d:e.length,rowsPerPageOptions:[d!=null?d:e.length],count:p!=null?p:e.length,page:u!=null?u:1,onPageChange:m,labelDisplayedRows:({from:g,to:y,count:P})=>`${At(g)}-${At(y)} of ${P!==-1?At(P):`more than ${At(y)}`}`})]})]})})}var vA=x(Chip)`
1223
+ `;function jA({visibleHeadCells:e}){return jsx(TableHead,{children:jsx(TableRow,{children:e.map(t=>jsx(WA,{$alignment:t.alignment,$width:t.width,$maxWidth:t.maxWidth,$minWidth:t.minWidth,children:jsx(P,{variant:"caption",children:t.label})},String(t.id)))})})}function ll({data:e,headCells:t,isLoading:o=false,error:n=null,emptyMessage:i,errorMessage:r,onRowClick:a,className:s,skeletonRows:l=3,hideLastRowBorder:c=true,pageSize:d,pageNum:u,totalCount:p,onPageChange:h}){let m=t.filter(f=>f.visible!==false),g=!!n||!o&&e.length===0;return jsx(VA,{className:s,$hasMinHeight:g,children:n?jsx(al,{errorMessage:r,className:`${s}-error`}):!o&&e.length===0?jsx(sl,{message:i,className:`${s}-empty`}):jsxs(Fragment,{children:[jsxs($A,{children:[jsx(jA,{visibleHeadCells:m}),jsx(TableBody,{children:o?jsx(Ou,{skeletonRows:l,visibleHeadCells:m,hideLastRowBorder:c}):jsx(zu,{data:e,visibleHeadCells:m,onRowClick:a,hideLastRowBorder:c})})]}),!!(e!=null&&e.length)&&h&&jsxs(Fragment,{children:[jsx(HA,{}),jsx(GA,{component:"div",rowsPerPage:d!=null?d:e.length,rowsPerPageOptions:[d!=null?d:e.length],count:p!=null?p:e.length,page:u!=null?u:1,onPageChange:h,labelDisplayedRows:({from:f,to:x,count:b})=>`${At(f)}-${At(x)} of ${b!==-1?At(b):`more than ${At(x)}`}`})]})]})})}var ZA=y(Chip)`
1224
1224
  font-size: 0.75rem;
1225
1225
  height: 24px;
1226
1226
  border-radius: 4px;
1227
1227
  border: none;
1228
1228
  background-color: ${({theme:e,$variant:t})=>{var o,n,i,r;return (r=(i=(n=(o=e==null?void 0:e.stigg)==null?void 0:o.palette)==null?void 0:n.statusChips)==null?void 0:i[t])==null?void 0:r.background}};
1229
1229
  color: ${({theme:e,$variant:t})=>{var o,n,i,r;return (r=(i=(n=(o=e==null?void 0:e.stigg)==null?void 0:o.palette)==null?void 0:n.statusChips)==null?void 0:i[t])==null?void 0:r.text}};
1230
- `;function hr(r){var a=r,{variant:e,label:t,className:o,size:n="small"}=a,i=ot(a,["variant","label","className","size"]);return jsx(vA,S({label:t,size:n,$variant:e,className:o},i))}function Ab(e){let t=Xc(),o=Xc(e.effectiveAt),n=e.expireAt?Xc(e.expireAt):null;return o.isAfter(t)?"SCHEDULED":n&&n.isBefore(t)?"EXPIRED":"AVAILABLE"}function Mb(e,t){return console.log("decimalPlaces",t),`${ho(e.consumedAmount,t)} / ${e.amount}`}var Du=e=>{switch(e){case "AVAILABLE":return "success";case "SCHEDULED":return "warning";case "EXPIRED":return "error";default:return "neutral"}},Ib=e=>{if(e.automaticRechargeConfigurationId)return "Automatic recharge";switch(e.grantType){case CreditGrantType.Promotional:return "Promotional";case CreditGrantType.Paid:return "Top-up";case CreditGrantType.Recurring:return "Recurring";default:return "Unknown"}};function Lb({creditGrants:e,isLoading:t,error:o,localization:n,decimalPlaces:i,pageSize:r,pageNum:a,totalCount:s,onPageChange:l}){let c=e.map(u=>_(S({},u),{status:Ab(u)})),d=[{id:"effectiveAt",label:n.receivedAt,width:"205px",render:({effectiveAt:u})=>jsx(C,{variant:"body1",className:"stigg-credit-grants-effective-date",children:Kc(u)})},{id:"grantType",label:n.grantType,width:"205px",render:u=>jsx(C,{variant:"body1",className:"stigg-credit-grants-grant-type",children:Ib(u)})},{id:"status",label:n.status,width:"205px",render:({status:u})=>{let p=capitalize(u),m=Du(u);return jsx(hr,{label:p,variant:m,className:"stigg-credit-grants-status-chip"})}},{id:"amount",label:n.balance,width:"205px",render:u=>jsx(C,{variant:"body1",className:"stigg-credit-grants-balance",children:Mb(u,i)})},{id:"expireAt",label:n.expiryDate,width:"205px",render:({expireAt:u})=>jsx(C,{variant:"body1",className:"stigg-credit-grants-expiry-date",children:u?qc(u):"-"})}];return jsx(tl,{data:c,headCells:d,isLoading:t,error:o,emptyMessage:n.emptyState,loadingMessage:n.loadingState,errorMessage:n.errorState,className:"stigg-credit-grants-table",skeletonRows:(c==null?void 0:c.length)||3,pageNum:a,pageSize:r,totalCount:s,onPageChange:l})}var Eb=(e,t,o)=>{let[n,i]=useState(0),[r,a]=useState(0);return {pageNumber:r,lastVisitedPage:n,pageChangeFunc:(l,c)=>{let d=c>r?{after:e==null?void 0:e.endCursor,first:o}:{before:e==null?void 0:e.startCursor,last:o};t(d),i(r),a(c);}}};var LA=10,BA=x.div`
1230
+ `;function hr(r){var a=r,{variant:e,label:t,className:o,size:n="small"}=a,i=ot(a,["variant","label","className","size"]);return jsx(ZA,S({label:t,size:n,$variant:e,className:o},i))}function $b(e){let t=rd(),o=rd(e.effectiveAt),n=e.expireAt?rd(e.expireAt):null;return o.isAfter(t)?"SCHEDULED":n&&n.isBefore(t)?"EXPIRED":"AVAILABLE"}function Hb(e,t){return console.log("decimalPlaces",t),`${mo(e.consumedAmount,t)} / ${e.amount}`}var ju=e=>{switch(e){case "AVAILABLE":return "success";case "SCHEDULED":return "warning";case "EXPIRED":return "error";default:return "neutral"}},Wb=e=>{if(e.automaticRechargeConfigurationId)return "Automatic recharge";switch(e.grantType){case CreditGrantType.Promotional:return "Promotional";case CreditGrantType.Paid:return "Top-up";case CreditGrantType.Recurring:return "Recurring";default:return "Unknown"}};function Gb({creditGrants:e,isLoading:t,error:o,localization:n,decimalPlaces:i,pageSize:r,pageNum:a,totalCount:s,onPageChange:l}){let c=e.map(u=>A(S({},u),{status:$b(u)})),d=[{id:"effectiveAt",label:n.receivedAt,width:"205px",render:({effectiveAt:u})=>jsx(P,{variant:"body1",className:"stigg-credit-grants-effective-date",children:ad(u)})},{id:"grantType",label:n.grantType,width:"205px",render:u=>jsx(P,{variant:"body1",className:"stigg-credit-grants-grant-type",children:Wb(u)})},{id:"status",label:n.status,width:"205px",render:({status:u})=>{let p=capitalize(u),h=ju(u);return jsx(hr,{label:p,variant:h,className:"stigg-credit-grants-status-chip"})}},{id:"amount",label:n.balance,width:"205px",render:u=>jsx(P,{variant:"body1",className:"stigg-credit-grants-balance",children:Hb(u,i)})},{id:"expireAt",label:n.expiryDate,width:"205px",render:({expireAt:u})=>jsx(P,{variant:"body1",className:"stigg-credit-grants-expiry-date",children:u?sd(u):"-"})}];return jsx(ll,{data:c,headCells:d,isLoading:t,error:o,emptyMessage:n.emptyState,loadingMessage:n.loadingState,errorMessage:n.errorState,className:"stigg-credit-grants-table",skeletonRows:(c==null?void 0:c.length)||3,pageNum:a,pageSize:r,totalCount:s,onPageChange:l})}var Yb=(e,t,o)=>{let[n,i]=useState(0),[r,a]=useState(0);return {pageNumber:r,lastVisitedPage:n,pageChangeFunc:(l,c)=>{let d=c>r?{after:e==null?void 0:e.endCursor,first:o}:{before:e==null?void 0:e.startCursor,last:o};t(d),i(r),a(c);}}};var JA=10,tM=y.div`
1231
1231
  display: flex;
1232
1232
  flex-direction: column;
1233
1233
  gap: 8px;
1234
- `,EA=x.div`
1234
+ `,eM=y.div`
1235
1235
  display: flex;
1236
1236
  flex-direction: column;
1237
1237
  gap: 16px;
1238
- `;function Fb({currencyId:e,localization:t,decimalPlaces:o,pageSize:n=LA}){let i=D({optional:true}),r=i==null?void 0:i.stigg,a=i==null?void 0:i.theme,s=S(S({},qy),t),[l,c]=useState({first:n}),{creditGrants:d,isLoading:u,error:p,paging:m,totalCount:h}=Xs({currencyId:e,pageSize:n,paging:l}),{pageNumber:f,pageChangeFunc:g}=Eb(m,c,n);return jsx(ht,{componentTheme:a,children:jsxs(BA,{className:"stigg-credit-grants-container",children:[jsx(EA,{className:"stigg-credit-grants-card",children:jsx(Lb,{creditGrants:d,isLoading:u,error:p,localization:s,decimalPlaces:o,pageSize:n,pageNum:f,totalCount:h,onPageChange:g})}),jsx(Jt,{source:"grant_list",align:"end",smallScreenAlign:"end",style:{marginTop:0},showWatermark:r==null?void 0:r.getShowWatermark()})]})})}var Rb=x.div`
1238
+ `;function Zb({currencyId:e,localization:t,decimalPlaces:o,pageSize:n=JA}){let i=D({optional:true}),r=i==null?void 0:i.stigg,a=i==null?void 0:i.theme,s=S(S({},u1),t),[l,c]=useState({first:n}),{creditGrants:d,isLoading:u,error:p,paging:h,totalCount:m}=nl({currencyId:e,pageSize:n,paging:l}),{pageNumber:g,pageChangeFunc:f}=Yb(h,c,n);return jsx(ht,{componentTheme:a,children:jsxs(tM,{className:"stigg-credit-grants-container",children:[jsx(eM,{className:"stigg-credit-grants-card",children:jsx(Gb,{creditGrants:d,isLoading:u,error:p,localization:s,decimalPlaces:o,pageSize:n,pageNum:g,totalCount:m,onPageChange:f})}),jsx(Jt,{source:"grant_list",align:"end",smallScreenAlign:"end",style:{marginTop:0},showWatermark:r==null?void 0:r.getShowWatermark()})]})})}var Xb=y.div`
1239
1239
  display: flex;
1240
1240
  flex-direction: column;
1241
1241
  gap: 16px;
@@ -1244,16 +1244,16 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
1244
1244
  border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
1245
1245
  background-color: ${({theme:e})=>{var t,o;return (o=(t=e==null?void 0:e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
1246
1246
  min-height: 90px;
1247
- `;var Db=x.div`
1247
+ `;var Kb=y.div`
1248
1248
  display: flex;
1249
1249
  align-items: center;
1250
1250
  gap: 4px;
1251
- `;var Nu=x.div`
1251
+ `;var Yu=y.div`
1252
1252
  display: flex;
1253
1253
  flex-direction: column;
1254
1254
  gap: 4px;
1255
1255
  width: 100%;
1256
- `;var Nb=x.div`
1256
+ `;var qb=y.div`
1257
1257
  display: flex;
1258
1258
  align-items: center;
1259
1259
  justify-content: center;
@@ -1261,26 +1261,26 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
1261
1261
  min-height: 60px;
1262
1262
  border: 1px dashed ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
1263
1263
  border-radius: 8px;
1264
- `;function ol(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=useCallback(()=>R(null,null,function*(){if(!o)throw new Error("Stigg SDK is not initialized. Please check your API configuration.");if(!o.isCustomerLoaded)return null;try{let l={customerId:e.customerId,currencyId:e.currencyId};return yield o.getAutomaticRechargeConfiguration(l)}catch(l){throw console.error("Error fetching automatic recharge configuration:",l),l}}),[o,e.customerId,e.currencyId,n]),{data:r,error:a,isLoading:s}=Ot({func:i});return {config:r,isLoading:s,error:a}}function Ob({customerId:e,currencyId:t}){let{config:o,isLoading:n,error:i}=ol({customerId:e,currencyId:t}),r=useMemo(()=>{if(!o)return {isConfigured:false,isEnabled:false,thresholdValue:0,targetBalance:0,currentMonthlySpend:0,maxSpendLimit:0,spendPercentage:0,showActiveState:false};let a=o.maxSpendLimit&&o.maxSpendLimit>0?Fa(o.currentMonthlySpend||0,o.maxSpendLimit):0,s=true,l=s&&o.isEnabled;return {isConfigured:s,isEnabled:o.isEnabled,thresholdValue:o.thresholdValue||0,targetBalance:o.targetBalance||0,currentMonthlySpend:o.currentMonthlySpend||0,maxSpendLimit:o.maxSpendLimit||0,spendPercentage:a,showActiveState:l}},[o]);return _(S({},r),{isLoading:n,error:i})}var Ub=x(Rb)`
1264
+ `;function dl(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=useCallback(()=>R(null,null,function*(){if(!o)throw new Error("Stigg SDK is not initialized. Please check your API configuration.");if(!o.isCustomerLoaded)return null;try{let l={customerId:e.customerId,currencyId:e.currencyId};return yield o.getAutomaticRechargeConfiguration(l)}catch(l){throw console.error("Error fetching automatic recharge configuration:",l),l}}),[o,e.customerId,e.currencyId,n]),{data:r,error:a,isLoading:s}=Ut({func:i});return {config:r,isLoading:s,error:a}}function Qb({customerId:e,currencyId:t}){let{config:o,isLoading:n,error:i}=dl({customerId:e,currencyId:t}),r=useMemo(()=>{if(!o)return {isConfigured:false,isEnabled:false,thresholdValue:0,targetBalance:0,currentMonthlySpend:0,maxSpendLimit:0,spendPercentage:0,showActiveState:false};let a=o.maxSpendLimit&&o.maxSpendLimit>0?$a(o.currentMonthlySpend||0,o.maxSpendLimit):0,s=true,l=s&&o.isEnabled;return {isConfigured:s,isEnabled:o.isEnabled,thresholdValue:o.thresholdValue||0,targetBalance:o.targetBalance||0,currentMonthlySpend:o.currentMonthlySpend||0,maxSpendLimit:o.maxSpendLimit||0,spendPercentage:a,showActiveState:l}},[o]);return A(S({},r),{isLoading:n,error:i})}var Jb=y(Xb)`
1265
1265
  width: 406px;
1266
1266
  box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.05);
1267
1267
  box-sizing: border-box;
1268
- `,zb=x.div`
1268
+ `,tC=y.div`
1269
1269
  display: flex;
1270
1270
  align-items: center;
1271
1271
  justify-content: flex-start;
1272
- `;function $b(e,t){return e?Object.entries(t).reduce((o,[n,i])=>{let r=new RegExp(`{{\\s*${n}\\s*}}`,"g"),s=String(i!=null?i:"").replace(/\$/g,"$$$$");return o.replace(r,s)},e):""}function Vb({customerId:e,currencyId:t,currencyUnit:o="Credits",billingCurrency:n="$",onManageClick:i,className:r,localization:a}){let{thresholdValue:s,targetBalance:l,currentMonthlySpend:c,maxSpendLimit:d,spendPercentage:u,showActiveState:p,isLoading:m,error:h}=Ob({customerId:e,currencyId:t}),f=S(S({},Jy),a&&Object.fromEntries(Object.entries(a).filter(([P,T])=>T!==void 0))),g=$b(f.descriptionTemplate,{target:ci(l),unit:o,threshold:ci(s)}),y=$b(f.spendTemplate,{currency:n,current:ci(c),limit:ci(d)});return h?jsx(Ub,{className:`stigg-auto-recharge-status stigg-auto-recharge-status-error ${r||""}`,children:jsx(C,{variant:"body1",color:"error",children:h.message||"Failed to load auto-recharge status"})}):jsxs(Ub,{className:`stigg-auto-recharge-status ${r||""}`,children:[jsxs(En,{children:[jsxs(Db,{children:[jsx(C,{variant:"h6",color:"primary",className:"stigg-auto-recharge-title",children:f.title}),!m&&p&&jsx(hr,{variant:"success",label:f.activeLabel,className:"stigg-auto-recharge-status-chip",size:"small"})]}),m?jsx(ro,{width:70,height:38,borderRadius:10}):jsx(Fn,{type:"button",onClick:i,className:"stigg-auto-recharge-manage-button","aria-label":`${f.manageButton} auto-recharge settings`,children:f.manageButton})]}),m?jsxs(Nu,{children:[jsx(ro,{width:"100%",height:20}),jsx(ro,{width:"100%",height:8,borderRadius:0}),jsx(zb,{children:jsx(ro,{width:200,height:16})})]}):p?jsxs(Nu,{children:[jsx(C,{variant:"body1",color:"primary",className:"stigg-auto-recharge-description",children:g}),jsx(Ys,{percentage:u,variant:"primary",className:"stigg-auto-recharge-progress"}),jsx(zb,{children:jsx(C,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-spend",children:d>0?y:f.unlimitedSpendLimit})})]}):jsx(Nb,{className:"stigg-auto-recharge-empty",children:jsx(C,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-empty-text",children:f.emptyStateMessage})})]})}var NA=x.div`
1272
+ `;function eC(e,t){return e?Object.entries(t).reduce((o,[n,i])=>{let r=new RegExp(`{{\\s*${n}\\s*}}`,"g"),s=String(i!=null?i:"").replace(/\$/g,"$$$$");return o.replace(r,s)},e):""}function oC({customerId:e,currencyId:t,currencyUnit:o="Credits",billingCurrency:n="$",onManageClick:i,className:r,localization:a}){let{thresholdValue:s,targetBalance:l,currentMonthlySpend:c,maxSpendLimit:d,spendPercentage:u,showActiveState:p,isLoading:h,error:m}=Qb({customerId:e,currencyId:t}),g=S(S({},m1),a&&Object.fromEntries(Object.entries(a).filter(([b,T])=>T!==void 0))),f=eC(g.descriptionTemplate,{target:ci(l),unit:o,threshold:ci(s)}),x=eC(g.spendTemplate,{currency:n,current:ci(c),limit:ci(d)});return m?jsx(Jb,{className:`stigg-auto-recharge-status stigg-auto-recharge-status-error ${r||""}`,children:jsx(P,{variant:"body1",color:"error",children:m.message||"Failed to load auto-recharge status"})}):jsxs(Jb,{className:`stigg-auto-recharge-status ${r||""}`,children:[jsxs(Ln,{children:[jsxs(Kb,{children:[jsx(P,{variant:"h6",color:"primary",className:"stigg-auto-recharge-title",children:g.title}),!h&&p&&jsx(hr,{variant:"success",label:g.activeLabel,className:"stigg-auto-recharge-status-chip",size:"small"})]}),h?jsx(ro,{width:70,height:38,borderRadius:10}):jsx(Bn,{type:"button",onClick:i,className:"stigg-auto-recharge-manage-button","aria-label":`${g.manageButton} auto-recharge settings`,children:g.manageButton})]}),h?jsxs(Yu,{children:[jsx(ro,{width:"100%",height:20}),jsx(ro,{width:"100%",height:8,borderRadius:0}),jsx(tC,{children:jsx(ro,{width:200,height:16})})]}):p?jsxs(Yu,{children:[jsx(P,{variant:"body1",color:"primary",className:"stigg-auto-recharge-description",children:f}),jsx(el,{percentage:u,variant:"primary",className:"stigg-auto-recharge-progress"}),jsx(tC,{children:jsx(P,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-spend",children:d>0?x:g.unlimitedSpendLimit})})]}):jsx(qb,{className:"stigg-auto-recharge-empty",children:jsx(P,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-empty-text",children:g.emptyStateMessage})})]})}var rM=y.div`
1273
1273
  display: flex;
1274
1274
  flex-direction: column;
1275
1275
  gap: 8px;
1276
1276
  width: 100%;
1277
- `;function Hb(e){let t=jt(St),o=D({optional:true}),n=o==null?void 0:o.theme,i=jsx(NA,{className:"stigg-auto-recharge-status-container",children:jsx(Vb,S({},e))});return t?i:jsx(ht,{componentTheme:n,children:i})}function Wb(e){return e2({},{title:"Auto recharge settings",enableLabel:"Recharge credits automatically when balance is low",enableDescription:"Allow auto-recharge",thresholdFieldPrefix:"When",thresholdFieldSuffix:"balance goes below",thresholdTooltip:"The credit balance threshold that triggers an automatic recharge",thresholdFieldPlaceholder:"Enter threshold amount",thresholdFieldHint:"Current threshold: {{value}}",thresholdRequired:"Threshold amount is required",thresholdMin:"Threshold must be at least 0",thresholdMax:"Threshold must be less than {{max}}",targetFieldPrefix:"Then",targetFieldSuffix:"recharge balance up to",targetBalanceTooltip:"The target credit balance to reach after a recharge",targetFieldPlaceholder:"Enter target balance",targetFieldHint:"Current target: {{value}}",targetRequired:"Target balance is required",targetMin:"Target must be greater than threshold",targetMax:"Target cannot exceed {{max}}",spendLimitFieldPrefix:"Limit",spendLimitFieldSuffix:"total spend",spendLimitFieldPlaceholder:"0.00",spendLimitHelpText:"Limit recharging to spending cap when enabled",spendLimitPeriod:"month",spendLimitPositive:"Spend limit must be greater than 0",spendLimitMin:"Spend limit must be at least {{min}}",spendLimitMax:"Spend limit cannot exceed {{max}}",immediateRechargeWarning:"Recharge will run immediately after saving. Current balance is below threshold {{threshold}} {{currencyUnit}}.",spendLimitTooLowWarning:"Auto-recharge may not run. Current monthly spend (${{currentSpend}} USD) is approaching or exceeds the spend limit (${{spendLimit}} USD).",cancelButton:"Cancel",saveButton:"Save settings",editButton:"Edit",loadingState:"Loading automatic recharge settings...",errorState:"Failed to load automatic recharge settings",emptyState:"No automatic recharge configuration found"},e)}function Io(e,t={},o){var a,s,l,c;let n={};if(!e.enabled)return n;let i=parseFloat(e.thresholdAmount);!e.thresholdAmount||e.thresholdAmount.trim()===""?n.thresholdAmount=o.thresholdRequired||"Threshold amount is required":isNaN(i)?n.thresholdAmount="Threshold must be a valid number":i<0?n.thresholdAmount=o.thresholdMin||"Threshold must be at least 0":t.poolSize!==void 0&&i>=t.poolSize&&(n.thresholdAmount=((a=o.thresholdMax)==null?void 0:a.replace("{{max}}",String(t.poolSize)))||`Threshold must be less than ${t.poolSize}`);let r=parseFloat(e.targetBalance);if(!e.targetBalance||e.targetBalance.trim()===""?n.targetBalance=o.targetRequired||"Target balance is required":isNaN(r)?n.targetBalance="Target balance must be a valid number":!isNaN(i)&&r<=i?n.targetBalance=o.targetMin||"Target balance must be greater than threshold":t.poolSize!==void 0&&r>t.poolSize&&(n.targetBalance=((s=o.targetMax)==null?void 0:s.replace("{{max}}",String(t.poolSize)))||`Target balance cannot exceed ${t.poolSize}`),e.maxSpendLimit&&e.maxSpendLimit.trim()!==""){let d=parseFloat(e.maxSpendLimit);isNaN(d)?n.maxSpendLimit="Spend limit must be a valid number":d<=0?n.maxSpendLimit=o.spendLimitPositive||"Spend limit must be greater than 0":t.minSpendLimit!==void 0&&d<t.minSpendLimit?n.maxSpendLimit=((l=o.spendLimitMin)==null?void 0:l.replace("{{min}}",String(t.minSpendLimit)))||`Spend limit must be at least ${t.minSpendLimit}`:t.maxSpendLimit!==void 0&&d>t.maxSpendLimit&&(n.maxSpendLimit=((c=o.spendLimitMax)==null?void 0:c.replace("{{max}}",String(t.maxSpendLimit)))||`Spend limit cannot exceed ${t.maxSpendLimit}`);}return n}function il({initialData:e,poolSize:t,localization:o}){var g,y,P,T,k,w,v,A,M,I,B,L,E,O;let[n,i]=useState({enabled:(g=e==null?void 0:e.enabled)!=null?g:false,thresholdAmount:(P=(y=e==null?void 0:e.thresholdAmount)==null?void 0:y.toString())!=null?P:"",targetBalance:(k=(T=e==null?void 0:e.targetBalance)==null?void 0:T.toString())!=null?k:"",maxSpendLimit:(v=(w=e==null?void 0:e.maxSpendLimit)==null?void 0:w.toString())!=null?v:""}),[r,a]=useState({thresholdAmount:true,targetBalance:true,maxSpendLimit:true}),s=Io({enabled:(A=e==null?void 0:e.enabled)!=null?A:false,thresholdAmount:(I=(M=e==null?void 0:e.thresholdAmount)==null?void 0:M.toString())!=null?I:"",targetBalance:(L=(B=e==null?void 0:e.targetBalance)==null?void 0:B.toString())!=null?L:"",maxSpendLimit:(O=(E=e==null?void 0:e.maxSpendLimit)==null?void 0:E.toString())!=null?O:""},{poolSize:t},o),[l,c]=useState(s);return {formData:n,errors:l,touched:r,handleEnabledChange:N=>{let F=N.target.checked;if(i($=>_(S({},$),{enabled:F})),!F)c({}),a({});else {let $=Io(_(S({},n),{enabled:true}),{poolSize:t},o);c($),a({thresholdAmount:true,targetBalance:true,maxSpendLimit:true});}},handleFieldChange:N=>F=>{let $=F.target.value,J=_(S({},n),{[N]:$});i(J),a(tt=>_(S({},tt),{[N]:true}));let Ft=Io(J,{poolSize:t},o);c(Ft);},handleFieldBlur:N=>()=>{a($=>_(S({},$),{[N]:true}));let F=Io(n,{poolSize:t},o);c(F);},getFieldError:N=>r[N]?l[N]:void 0,validate:()=>{let N=Io(n,{poolSize:t},o);return c(N),n.enabled&&a({thresholdAmount:true,targetBalance:true,maxSpendLimit:true}),Object.keys(N).length===0},getFormValues:()=>{var N,F,$;return {enabled:n.enabled,thresholdAmount:(N=n.thresholdAmount)!=null&&N.trim()?parseFloat(n.thresholdAmount.trim()):void 0,targetBalance:(F=n.targetBalance)!=null&&F.trim()?parseFloat(n.targetBalance.trim()):void 0,maxSpendLimit:($=n.maxSpendLimit)!=null&&$.trim()?parseFloat(n.maxSpendLimit.trim()):void 0}}}}var fr=x.div`
1277
+ `;function nC(e){let t=jt(St),o=D({optional:true}),n=o==null?void 0:o.theme,i=jsx(rM,{className:"stigg-auto-recharge-status-container",children:jsx(oC,S({},e))});return t?i:jsx(ht,{componentTheme:n,children:i})}function iC(e){return g2({},{title:"Auto recharge settings",enableLabel:"Recharge credits automatically when balance is low",enableDescription:"Allow auto-recharge",thresholdFieldPrefix:"When",thresholdFieldSuffix:"balance goes below",thresholdTooltip:"The credit balance threshold that triggers an automatic recharge",thresholdFieldPlaceholder:"Enter threshold amount",thresholdFieldHint:"Current threshold: {{value}}",thresholdRequired:"Threshold amount is required",thresholdMin:"Threshold must be at least 0",thresholdMax:"Threshold must be less than {{max}}",targetFieldPrefix:"Then",targetFieldSuffix:"recharge balance up to",targetBalanceTooltip:"The target credit balance to reach after a recharge",targetFieldPlaceholder:"Enter target balance",targetFieldHint:"Current target: {{value}}",targetRequired:"Target balance is required",targetMin:"Target must be greater than threshold",targetMax:"Target cannot exceed {{max}}",spendLimitFieldPrefix:"Limit",spendLimitFieldSuffix:"total spend",spendLimitFieldPlaceholder:"0.00",spendLimitHelpText:"Limit recharging to spending cap when enabled",spendLimitPeriod:"month",spendLimitPositive:"Spend limit must be greater than 0",spendLimitMin:"Spend limit must be at least {{min}}",spendLimitMax:"Spend limit cannot exceed {{max}}",immediateRechargeWarning:"Recharge will run immediately after saving. Current balance is below threshold {{threshold}} {{currencyUnit}}.",spendLimitTooLowWarning:"Auto-recharge may not run. Current monthly spend (${{currentSpend}} USD) is approaching or exceeds the spend limit (${{spendLimit}} USD).",cancelButton:"Cancel",saveButton:"Save settings",editButton:"Edit",loadingState:"Loading automatic recharge settings...",errorState:"Failed to load automatic recharge settings",emptyState:"No automatic recharge configuration found"},e)}function Io(e,t={},o){var a,s,l,c;let n={};if(!e.enabled)return n;let i=parseFloat(e.thresholdAmount);!e.thresholdAmount||e.thresholdAmount.trim()===""?n.thresholdAmount=o.thresholdRequired||"Threshold amount is required":isNaN(i)?n.thresholdAmount="Threshold must be a valid number":i<0?n.thresholdAmount=o.thresholdMin||"Threshold must be at least 0":t.poolSize!==void 0&&i>=t.poolSize&&(n.thresholdAmount=((a=o.thresholdMax)==null?void 0:a.replace("{{max}}",String(t.poolSize)))||`Threshold must be less than ${t.poolSize}`);let r=parseFloat(e.targetBalance);if(!e.targetBalance||e.targetBalance.trim()===""?n.targetBalance=o.targetRequired||"Target balance is required":isNaN(r)?n.targetBalance="Target balance must be a valid number":!isNaN(i)&&r<=i?n.targetBalance=o.targetMin||"Target balance must be greater than threshold":t.poolSize!==void 0&&r>t.poolSize&&(n.targetBalance=((s=o.targetMax)==null?void 0:s.replace("{{max}}",String(t.poolSize)))||`Target balance cannot exceed ${t.poolSize}`),e.maxSpendLimit&&e.maxSpendLimit.trim()!==""){let d=parseFloat(e.maxSpendLimit);isNaN(d)?n.maxSpendLimit="Spend limit must be a valid number":d<=0?n.maxSpendLimit=o.spendLimitPositive||"Spend limit must be greater than 0":t.minSpendLimit!==void 0&&d<t.minSpendLimit?n.maxSpendLimit=((l=o.spendLimitMin)==null?void 0:l.replace("{{min}}",String(t.minSpendLimit)))||`Spend limit must be at least ${t.minSpendLimit}`:t.maxSpendLimit!==void 0&&d>t.maxSpendLimit&&(n.maxSpendLimit=((c=o.spendLimitMax)==null?void 0:c.replace("{{max}}",String(t.maxSpendLimit)))||`Spend limit cannot exceed ${t.maxSpendLimit}`);}return n}function pl({initialData:e,poolSize:t,localization:o}){var f,x,b,T,k,w,v,_,M,I,F,E,B,O;let[n,i]=useState({enabled:(f=e==null?void 0:e.enabled)!=null?f:false,thresholdAmount:(b=(x=e==null?void 0:e.thresholdAmount)==null?void 0:x.toString())!=null?b:"",targetBalance:(k=(T=e==null?void 0:e.targetBalance)==null?void 0:T.toString())!=null?k:"",maxSpendLimit:(v=(w=e==null?void 0:e.maxSpendLimit)==null?void 0:w.toString())!=null?v:""}),[r,a]=useState({thresholdAmount:true,targetBalance:true,maxSpendLimit:true}),s=Io({enabled:(_=e==null?void 0:e.enabled)!=null?_:false,thresholdAmount:(I=(M=e==null?void 0:e.thresholdAmount)==null?void 0:M.toString())!=null?I:"",targetBalance:(E=(F=e==null?void 0:e.targetBalance)==null?void 0:F.toString())!=null?E:"",maxSpendLimit:(O=(B=e==null?void 0:e.maxSpendLimit)==null?void 0:B.toString())!=null?O:""},{poolSize:t},o),[l,c]=useState(s);return {formData:n,errors:l,touched:r,handleEnabledChange:U=>{let L=U.target.checked;if(i(V=>A(S({},V),{enabled:L})),!L)c({}),a({});else {let V=Io(A(S({},n),{enabled:true}),{poolSize:t},o);c(V),a({thresholdAmount:true,targetBalance:true,maxSpendLimit:true});}},handleFieldChange:U=>L=>{let V=L.target.value,J=A(S({},n),{[U]:V});i(J),a(tt=>A(S({},tt),{[U]:true}));let Bt=Io(J,{poolSize:t},o);c(Bt);},handleFieldBlur:U=>()=>{a(V=>A(S({},V),{[U]:true}));let L=Io(n,{poolSize:t},o);c(L);},getFieldError:U=>r[U]?l[U]:void 0,validate:()=>{let U=Io(n,{poolSize:t},o);return c(U),n.enabled&&a({thresholdAmount:true,targetBalance:true,maxSpendLimit:true}),Object.keys(U).length===0},getFormValues:()=>{var U,L,V;return {enabled:n.enabled,thresholdAmount:(U=n.thresholdAmount)!=null&&U.trim()?parseFloat(n.thresholdAmount.trim()):void 0,targetBalance:(L=n.targetBalance)!=null&&L.trim()?parseFloat(n.targetBalance.trim()):void 0,maxSpendLimit:(V=n.maxSpendLimit)!=null&&V.trim()?parseFloat(n.maxSpendLimit.trim()):void 0}}}}var fr=y.div`
1278
1278
  display: flex;
1279
1279
  flex-direction: column;
1280
1280
  gap: 16px;
1281
1281
  width: 100%;
1282
1282
  max-width: 506px;
1283
- `,gr=x.div`
1283
+ `,yr=y.div`
1284
1284
  display: flex;
1285
1285
  flex-direction: column;
1286
1286
  gap: 8px;
@@ -1289,15 +1289,15 @@ import Xh__default,{BillingModel,PaymentCollection,CreditUsageTimeRange,Subscrip
1289
1289
  border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
1290
1290
  background-color: ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
1291
1291
  box-shadow: 1px 6px 14px 0px rgba(26, 26, 26, 0.1);
1292
- `,zu=x(Info)`
1292
+ `,Ku=y(Info)`
1293
1293
  width: 12px;
1294
1294
  height: 12px;
1295
1295
  color: ${({theme:e})=>{var t,o,n;return (n=(o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.text)==null?void 0:n.secondary}};
1296
1296
  cursor: help;
1297
- `,$u=x(Alert)`
1297
+ `,qu=y(Alert)`
1298
1298
  font-family: custom-font, 'DM Sans', sans-serif;
1299
1299
  align-items: center;
1300
- `;function rl({customerId:e,currencyId:t,initialData:o,currencyUnit:n,poolSize:i,currentBalance:r,currentMonthlySpend:a,readOnly:s=false,localization:l,onSave:c,onCancel:d}){var B,L,E;let u=jt(St),p=D({optional:true}),m=p==null?void 0:p.theme,h=useMemo(()=>Wb(l),[l]),{formData:f,errors:g,handleEnabledChange:y,handleFieldChange:P,handleFieldBlur:T,getFieldError:k,validate:w,getFormValues:v}=il({initialData:o,poolSize:i,localization:h}),A=useMemo(()=>f.enabled?Object.keys(g).length>0:false,[g,f.enabled]),M=useCallback(()=>{if(w()&&c){let O=v();c(S({customerId:e,currencyId:t},O));}},[w,c,v,e,t]),I=jsx(fr,{className:"stigg-automatic-recharge-form-container",children:jsxs(gr,{className:"stigg-automatic-recharge-form-card",children:[jsxs(Box,{display:"flex",flexDirection:"column",gap:.5,children:[jsx(C,{variant:"h3",color:"primary",className:"stigg-automatic-recharge-form-title",children:h.title}),jsx(C,{variant:"body1",color:"secondary",className:"stigg-automatic-recharge-form-subtitle",children:h.enableLabel})]}),jsx(Box,{display:"flex",flexDirection:"column",gap:1,children:jsx(FormControlLabel,{control:jsx(Checkbox,{checked:f.enabled,onChange:y,disabled:s}),label:jsx(C,{variant:"body1",color:"primary",children:h.enableDescription}),className:"stigg-automatic-recharge-form-enable-checkbox"})}),jsxs(Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-threshold-field",children:[jsxs(Box,{display:"flex",alignItems:"center",gap:1,children:[jsxs(C,{variant:"body1",color:"primary",children:[jsx(Box,{component:"span",fontWeight:"bold",children:h.thresholdFieldPrefix})," ",h.thresholdFieldSuffix]}),jsx(Fe,{title:h.thresholdTooltip,children:jsx(zu,{})})]}),jsx(NumericFormat,{customInput:Rt,fullWidth:true,thousandSeparator:true,value:f.thresholdAmount,onValueChange:O=>{let N={target:{value:O.value}};P("thresholdAmount")(N);},onBlur:T("thresholdAmount"),placeholder:h.thresholdFieldPlaceholder,error:!!k("thresholdAmount"),helperText:(B=k("thresholdAmount"))!=null?B:"",disabled:s||!f.enabled,InputProps:{endAdornment:n?jsx(C,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:n}):void 0},className:"stigg-automatic-recharge-form-threshold-input"})]}),jsxs(Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-target-field",children:[jsxs(Box,{display:"flex",alignItems:"center",gap:1,children:[jsxs(C,{variant:"body1",color:"primary",children:[jsx(Box,{component:"span",fontWeight:"bold",children:h.targetFieldPrefix})," ",h.targetFieldSuffix]}),jsx(Fe,{title:h.targetBalanceTooltip,children:jsx(zu,{})})]}),jsx(NumericFormat,{customInput:Rt,fullWidth:true,thousandSeparator:true,value:f.targetBalance,onValueChange:O=>{let N={target:{value:O.value}};P("targetBalance")(N);},onBlur:T("targetBalance"),placeholder:h.targetFieldPlaceholder,error:!!k("targetBalance"),helperText:(L=k("targetBalance"))!=null?L:"",disabled:s||!f.enabled,InputProps:{endAdornment:n?jsx(C,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:n}):void 0},className:"stigg-automatic-recharge-form-target-input"})]}),jsxs(Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-spend-limit-field",children:[jsxs(Box,{display:"flex",flexDirection:"column",gap:.5,children:[jsxs(C,{variant:"body1",color:"primary",children:[jsx(Box,{component:"span",fontWeight:"bold",children:h.spendLimitFieldPrefix})," ",h.spendLimitFieldSuffix]}),jsx(C,{variant:"caption",color:"secondary",style:{fontSize:"12px"},children:h.spendLimitHelpText})]}),jsx(NumericFormat,{customInput:Rt,fullWidth:true,thousandSeparator:true,value:f.maxSpendLimit,onValueChange:O=>{let N={target:{value:O.value}};P("maxSpendLimit")(N);},onBlur:T("maxSpendLimit"),placeholder:h.spendLimitFieldPlaceholder,error:!!k("maxSpendLimit"),helperText:(E=k("maxSpendLimit"))!=null?E:"",disabled:s||!f.enabled,InputProps:{startAdornment:jsx(C,{variant:"body1",color:"secondary",children:"$"}),endAdornment:jsxs(C,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:["/ ",h.spendLimitPeriod]})},className:"stigg-automatic-recharge-form-spend-limit-input"})]}),!s&&f.enabled&&f.thresholdAmount&&jsxs(Fragment,{children:[r!==void 0&&r<=parseFloat(f.thresholdAmount)&&jsx($u,{severity:"warning",className:"stigg-automatic-recharge-form-warning",children:h.immediateRechargeWarning.replace("{{threshold}}",At(parseFloat(f.thresholdAmount))||"0").replace("{{currencyUnit}}",n||"")}),f.maxSpendLimit&&f.maxSpendLimit.trim()!==""&&parseFloat(f.maxSpendLimit)>0&&a!==void 0&&a+0>=parseFloat(f.maxSpendLimit)&&jsx($u,{severity:"warning",className:"stigg-automatic-recharge-form-spend-limit-warning",children:h.spendLimitTooLowWarning.replace("{{currentSpend}}",al(a)).replace("{{spendLimit}}",al(parseFloat(f.maxSpendLimit)))})]}),!s&&jsxs(Box,{display:"flex",justifyContent:"flex-end",gap:1,pt:2,className:"stigg-automatic-recharge-form-actions",children:[d&&jsx(kt,{variant:"outlined",onClick:d,className:"stigg-automatic-recharge-form-cancel-button",children:h.cancelButton}),c&&jsx(kt,{variant:"contained",onClick:M,disabled:A,className:"stigg-automatic-recharge-form-save-button",children:h.saveButton})]})]})});return u?I:jsx(ht,{componentTheme:m,children:I})}function Yb(){let e=D(),t=e==null?void 0:e.stigg,[o,n]=useState(false),[i,r]=useState(null);return {updateConfig:useCallback(s=>R(null,null,function*(){var l,c,d;if(!t||!t.isCustomerLoaded){let u=new Error("Stigg SDK not initialized or customer not loaded");throw r(u),u}n(true),r(null);try{let u={customerId:s.customerId,currencyId:s.currencyId,isEnabled:s.enabled,thresholdValue:(l=s.thresholdAmount)!=null?l:0,thresholdType:ThresholdType.CreditAmount,targetBalance:(c=s.targetBalance)!=null?c:0,maxSpendLimit:(d=s.maxSpendLimit)!=null?d:null},p=yield t.saveAutomaticRechargeConfiguration(u);return yield t.refresh(),n(!1),p}catch(u){let p=u instanceof Error?u:new Error("Failed to save automatic recharge configuration");throw console.error("Error saving automatic recharge configuration:",p),r(p),n(false),p}}),[t]),isLoading:o,error:i}}function Kb({customerId:e,currencyId:t,currencyUnit:o,poolSize:n,readOnly:i=false,localization:r,onSave:a,onCancel:s}){var M,I;let l=jt(St),c=D({optional:true}),d=c==null?void 0:c.theme,{config:u,isLoading:p,error:m}=ol({customerId:e,currencyId:t}),{balance:h,isLoading:f,error:g}=po({currencyId:t}),{updateConfig:y,isLoading:P,error:T}=Yb(),k=useCallback(B=>R(null,null,function*(){try{yield y(B),a&&a(B);}catch(L){console.error("Failed to save automatic recharge configuration:",L);}}),[y,a]),w=u?{id:"",enabled:u.isEnabled,thresholdAmount:u.thresholdValue,targetBalance:u.targetBalance,maxSpendLimit:(M=u.maxSpendLimit)!=null?M:void 0,currencyId:u.currencyId,customerId:u.customerId}:void 0;if(p||f){let B=jsxs("div",{children:[jsx(ro,{width:300,height:24,style:{marginBottom:"16px"}}),jsx(ro,{width:400,height:200})]});return l?B:jsx(ht,{componentTheme:d,children:B})}if(m){let B=jsx(fr,{className:"stigg-automatic-recharge-form-container",children:jsx(gr,{className:"stigg-automatic-recharge-form-card",children:jsx(C,{variant:"body1",color:"error",children:m.message||"Failed to load automatic recharge configuration"})})});return l?B:jsx(ht,{componentTheme:d,children:B})}if(g){let B=jsx(fr,{className:"stigg-automatic-recharge-form-container",children:jsx(gr,{className:"stigg-automatic-recharge-form-card",children:jsx(C,{variant:"body1",color:"error",children:g.message||"Failed to load credit balance"})})});return l?B:jsx(ht,{componentTheme:d,children:B})}let v=o||((I=h==null?void 0:h.units)==null?void 0:I.plural)||(h==null?void 0:h.displayName)||"Credits",A=jsxs(Fragment,{children:[T&&jsx(C,{variant:"body1",color:"error",style:{marginBottom:"16px"},children:T.message||"Failed to save automatic recharge configuration"}),jsx(rl,{customerId:e,currencyId:t,initialData:w,currencyUnit:v,poolSize:n,currentBalance:h==null?void 0:h.currentBalance,currentMonthlySpend:u==null?void 0:u.currentMonthlySpend,readOnly:i||P,localization:r,onSave:k,onCancel:s})]});return l?A:jsx(ht,{componentTheme:d,children:A})}/*! Bundled license information:
1300
+ `;function ml({customerId:e,currencyId:t,initialData:o,currencyUnit:n,poolSize:i,currentBalance:r,currentMonthlySpend:a,readOnly:s=false,localization:l,onSave:c,onCancel:d}){var F,E,B;let u=jt(St),p=D({optional:true}),h=p==null?void 0:p.theme,m=useMemo(()=>iC(l),[l]),{formData:g,errors:f,handleEnabledChange:x,handleFieldChange:b,handleFieldBlur:T,getFieldError:k,validate:w,getFormValues:v}=pl({initialData:o,poolSize:i,localization:m}),_=useMemo(()=>g.enabled?Object.keys(f).length>0:false,[f,g.enabled]),M=useCallback(()=>{if(w()&&c){let O=v();c(S({customerId:e,currencyId:t},O));}},[w,c,v,e,t]),I=jsx(fr,{className:"stigg-automatic-recharge-form-container",children:jsxs(yr,{className:"stigg-automatic-recharge-form-card",children:[jsxs(Box,{display:"flex",flexDirection:"column",gap:.5,children:[jsx(P,{variant:"h3",color:"primary",className:"stigg-automatic-recharge-form-title",children:m.title}),jsx(P,{variant:"body1",color:"secondary",className:"stigg-automatic-recharge-form-subtitle",children:m.enableLabel})]}),jsx(Box,{display:"flex",flexDirection:"column",gap:1,children:jsx(FormControlLabel,{control:jsx(Checkbox,{checked:g.enabled,onChange:x,disabled:s}),label:jsx(P,{variant:"body1",color:"primary",children:m.enableDescription}),className:"stigg-automatic-recharge-form-enable-checkbox"})}),jsxs(Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-threshold-field",children:[jsxs(Box,{display:"flex",alignItems:"center",gap:1,children:[jsxs(P,{variant:"body1",color:"primary",children:[jsx(Box,{component:"span",fontWeight:"bold",children:m.thresholdFieldPrefix})," ",m.thresholdFieldSuffix]}),jsx(Be,{title:m.thresholdTooltip,children:jsx(Ku,{})})]}),jsx(NumericFormat,{customInput:Rt,fullWidth:true,thousandSeparator:true,value:g.thresholdAmount,onValueChange:O=>{let U={target:{value:O.value}};b("thresholdAmount")(U);},onBlur:T("thresholdAmount"),placeholder:m.thresholdFieldPlaceholder,error:!!k("thresholdAmount"),helperText:(F=k("thresholdAmount"))!=null?F:"",disabled:s||!g.enabled,InputProps:{endAdornment:n?jsx(P,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:n}):void 0},className:"stigg-automatic-recharge-form-threshold-input"})]}),jsxs(Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-target-field",children:[jsxs(Box,{display:"flex",alignItems:"center",gap:1,children:[jsxs(P,{variant:"body1",color:"primary",children:[jsx(Box,{component:"span",fontWeight:"bold",children:m.targetFieldPrefix})," ",m.targetFieldSuffix]}),jsx(Be,{title:m.targetBalanceTooltip,children:jsx(Ku,{})})]}),jsx(NumericFormat,{customInput:Rt,fullWidth:true,thousandSeparator:true,value:g.targetBalance,onValueChange:O=>{let U={target:{value:O.value}};b("targetBalance")(U);},onBlur:T("targetBalance"),placeholder:m.targetFieldPlaceholder,error:!!k("targetBalance"),helperText:(E=k("targetBalance"))!=null?E:"",disabled:s||!g.enabled,InputProps:{endAdornment:n?jsx(P,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:n}):void 0},className:"stigg-automatic-recharge-form-target-input"})]}),jsxs(Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-spend-limit-field",children:[jsxs(Box,{display:"flex",flexDirection:"column",gap:.5,children:[jsxs(P,{variant:"body1",color:"primary",children:[jsx(Box,{component:"span",fontWeight:"bold",children:m.spendLimitFieldPrefix})," ",m.spendLimitFieldSuffix]}),jsx(P,{variant:"caption",color:"secondary",style:{fontSize:"12px"},children:m.spendLimitHelpText})]}),jsx(NumericFormat,{customInput:Rt,fullWidth:true,thousandSeparator:true,value:g.maxSpendLimit,onValueChange:O=>{let U={target:{value:O.value}};b("maxSpendLimit")(U);},onBlur:T("maxSpendLimit"),placeholder:m.spendLimitFieldPlaceholder,error:!!k("maxSpendLimit"),helperText:(B=k("maxSpendLimit"))!=null?B:"",disabled:s||!g.enabled,InputProps:{startAdornment:jsx(P,{variant:"body1",color:"secondary",children:"$"}),endAdornment:jsxs(P,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:["/ ",m.spendLimitPeriod]})},className:"stigg-automatic-recharge-form-spend-limit-input"})]}),!s&&g.enabled&&g.thresholdAmount&&jsxs(Fragment,{children:[r!==void 0&&r<=parseFloat(g.thresholdAmount)&&jsx(qu,{severity:"warning",className:"stigg-automatic-recharge-form-warning",children:m.immediateRechargeWarning.replace("{{threshold}}",At(parseFloat(g.thresholdAmount))||"0").replace("{{currencyUnit}}",n||"")}),g.maxSpendLimit&&g.maxSpendLimit.trim()!==""&&parseFloat(g.maxSpendLimit)>0&&a!==void 0&&a+0>=parseFloat(g.maxSpendLimit)&&jsx(qu,{severity:"warning",className:"stigg-automatic-recharge-form-spend-limit-warning",children:m.spendLimitTooLowWarning.replace("{{currentSpend}}",hl(a)).replace("{{spendLimit}}",hl(parseFloat(g.maxSpendLimit)))})]}),!s&&jsxs(Box,{display:"flex",justifyContent:"flex-end",gap:1,pt:2,className:"stigg-automatic-recharge-form-actions",children:[d&&jsx(kt,{variant:"outlined",onClick:d,className:"stigg-automatic-recharge-form-cancel-button",children:m.cancelButton}),c&&jsx(kt,{variant:"contained",onClick:M,disabled:_,className:"stigg-automatic-recharge-form-save-button",children:m.saveButton})]})]})});return u?I:jsx(ht,{componentTheme:h,children:I})}function sC(){let e=D(),t=e==null?void 0:e.stigg,[o,n]=useState(false),[i,r]=useState(null);return {updateConfig:useCallback(s=>R(null,null,function*(){var l,c,d;if(!t||!t.isCustomerLoaded){let u=new Error("Stigg SDK not initialized or customer not loaded");throw r(u),u}n(true),r(null);try{let u={customerId:s.customerId,currencyId:s.currencyId,isEnabled:s.enabled,thresholdValue:(l=s.thresholdAmount)!=null?l:0,thresholdType:ThresholdType.CreditAmount,targetBalance:(c=s.targetBalance)!=null?c:0,maxSpendLimit:(d=s.maxSpendLimit)!=null?d:null},p=yield t.saveAutomaticRechargeConfiguration(u);return yield t.refresh(),n(!1),p}catch(u){let p=u instanceof Error?u:new Error("Failed to save automatic recharge configuration");throw console.error("Error saving automatic recharge configuration:",p),r(p),n(false),p}}),[t]),isLoading:o,error:i}}function dC({customerId:e,currencyId:t,currencyUnit:o,poolSize:n,readOnly:i=false,localization:r,onSave:a,onCancel:s}){var M,I;let l=jt(St),c=D({optional:true}),d=c==null?void 0:c.theme,{config:u,isLoading:p,error:h}=dl({customerId:e,currencyId:t}),{balance:m,isLoading:g,error:f}=po({currencyId:t}),{updateConfig:x,isLoading:b,error:T}=sC(),k=useCallback(F=>R(null,null,function*(){try{yield x(F),a&&a(F);}catch(E){console.error("Failed to save automatic recharge configuration:",E);}}),[x,a]),w=u?{id:"",enabled:u.isEnabled,thresholdAmount:u.thresholdValue,targetBalance:u.targetBalance,maxSpendLimit:(M=u.maxSpendLimit)!=null?M:void 0,currencyId:u.currencyId,customerId:u.customerId}:void 0;if(p||g){let F=jsxs("div",{children:[jsx(ro,{width:300,height:24,style:{marginBottom:"16px"}}),jsx(ro,{width:400,height:200})]});return l?F:jsx(ht,{componentTheme:d,children:F})}if(h){let F=jsx(fr,{className:"stigg-automatic-recharge-form-container",children:jsx(yr,{className:"stigg-automatic-recharge-form-card",children:jsx(P,{variant:"body1",color:"error",children:h.message||"Failed to load automatic recharge configuration"})})});return l?F:jsx(ht,{componentTheme:d,children:F})}if(f){let F=jsx(fr,{className:"stigg-automatic-recharge-form-container",children:jsx(yr,{className:"stigg-automatic-recharge-form-card",children:jsx(P,{variant:"body1",color:"error",children:f.message||"Failed to load credit balance"})})});return l?F:jsx(ht,{componentTheme:d,children:F})}let v=o||((I=m==null?void 0:m.units)==null?void 0:I.plural)||(m==null?void 0:m.displayName)||"Credits",_=jsxs(Fragment,{children:[T&&jsx(P,{variant:"body1",color:"error",style:{marginBottom:"16px"},children:T.message||"Failed to save automatic recharge configuration"}),jsx(ml,{customerId:e,currencyId:t,initialData:w,currencyUnit:v,poolSize:n,currentBalance:m==null?void 0:m.currentBalance,currentMonthlySpend:u==null?void 0:u.currentMonthlySpend,readOnly:i||b,localization:r,onSave:k,onCancel:s})]});return l?_:jsx(ht,{componentTheme:d,children:_})}/*! Bundled license information:
1301
1301
 
1302
1302
  chart.js/dist/chunks/helpers.segment.mjs:
1303
1303
  chart.js/dist/chart.mjs:
@@ -1340,4 +1340,4 @@ chartjs-plugin-gradient/dist/chartjs-plugin-gradient.esm.js:
1340
1340
  * (c) 2022 Jukka Kurkela
1341
1341
  * Released under the MIT License
1342
1342
  *)
1343
- */export{Dr as AddonsList,Hb as AutoRechargeStatus,Kb as AutomaticRechargeConfig,rl as AutomaticRechargeConfigForm,V5 as BooleanEntitlementGuard,Wy as Checkout,t1 as CreditBalance,Fb as CreditGrants,Cb as CreditUsageChart,Tb as CreditUtilization,Mf as CustomerPortal,Rr as CustomerPortalProvider,na as CustomerUsageData,Js as EmptyState,q5 as EnumEntitlementGuard,Qs as ErrorState,tl as GenericTable,ia as InvoicesSection,Z5 as MeteredEntitlementGuard,G5 as NumericEntitlementGuard,ea as PaymentDetailsSection,rm as Paywall,Or as Promotions,Zc as ProvisionStatus,hr as StatusChip,Si as StiggContext,WP as StiggProvider,gl as SubscribeIntentionType,Kr as SubscriptionsOverview,qc as formatDateOnly,Kc as formatDateTime,Du as mapCreditGrantStatusToVariant,vg as useActiveSubscriptions,il as useAutomaticRechargeForm,fa as useBooleanEntitlement,po as useCreditBalance,Xs as useCreditGrants,Hs as useCreditUsage,Ag as useCustomerPortal,xa as useEnumEntitlement,ya as useMeteredEntitlement,ga as useNumericEntitlement,_g as usePaywall,D as useStiggContext,jy as useWaitForCheckoutCompleted,Io as validateAutomaticRechargeForm};
1343
+ */export{Nr as AddonsList,nC as AutoRechargeStatus,dC as AutomaticRechargeConfig,ml as AutomaticRechargeConfigForm,dv as BooleanEntitlementGuard,i1 as Checkout,h1 as CreditBalance,Zb as CreditGrants,Bb as CreditUsageChart,Nb as CreditUtilization,$g as CustomerPortal,Dr as CustomerPortalProvider,ua as CustomerUsageData,sl as EmptyState,bv as EnumEntitlementGuard,al as ErrorState,ll as GenericTable,pa as InvoicesSection,fv as MeteredEntitlementGuard,mv as NumericEntitlementGuard,ia as PaymentDetailsSection,gh as Paywall,Or as Promotions,id as ProvisionStatus,hr as StatusChip,Si as StiggContext,iS as StiggProvider,kl as SubscribeIntentionType,Jr as SubscriptionsOverview,sd as formatDateOnly,ad as formatDateTime,Qr as isCreditEntitlement,kn as isFeatureEntitlement,ju as mapCreditGrantStatusToVariant,zf as useActiveSubscriptions,pl as useAutomaticRechargeForm,Ta as useBooleanEntitlement,po as useCreditBalance,nl as useCreditGrants,qs as useCreditUsage,$f as useCustomerPortal,va as useEnumEntitlement,wa as useMeteredEntitlement,ka as useNumericEntitlement,Vf as usePaywall,D as useStiggContext,a1 as useWaitForCheckoutCompleted,Io as validateAutomaticRechargeForm};