@stigg/react-sdk 7.25.0 → 7.26.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
- 'use strict';var rh=require('@stigg/js-client-sdk'),Ac=require('react'),gp=require('@emotion/styled'),aP=require('classnames'),Se=require('@mui/material/Grid'),ef=require('lodash/compact'),reactNumberFormat=require('react-number-format'),react=require('@emotion/react'),jsxRuntime=require('react/jsx-runtime'),lodash=require('lodash'),P2=require('react-spinners/ClipLoader'),Do=require('color'),g2=require('lodash/merge'),rd=require('moment'),_r=require('lodash/isNil'),F2=require('currency-symbol-map'),z2=require('@mui/material/InputAdornment'),L2=require('@mui/material/Button'),D2=require('@mui/material/TextField'),gg=require('@mui/material/Divider'),ro=require('react-loading-skeleton'),V2=require('@mui/material/OutlinedInput'),$2=require('@mui/material/Select'),H2=require('@mui/material/MenuItem'),material=require('@mui/material'),FP=require('react-switch'),Hg=require('lodash/sortBy'),styles=require('@mui/material/styles'),RS=require('lodash/flatMap'),Na=require('@mui/material/Box'),Eh=require('@mui/material/Tab'),DS=require('lodash/isEmpty'),$S=require('@mui/material/Tabs'),reactFeather=require('react-feather'),MT=require('@mui/material/Link'),TT=require('@mui/material/Tooltip'),LT=require('@mui/material/LinearProgress'),Sg=require('lodash/keyBy'),Ig=require('lodash/isUndefined'),sdk=require('@stigg/api-client-js/src/generated/sdk'),mc=require('lodash/lowerCase'),immer=require('immer'),xk=require('lodash/cloneDeep'),bk=require('lodash/remove'),reactStripeJs=require('@stripe/react-stripe-js'),fw=require('@mui/material/StepIcon'),q3=require('lodash/partition'),Aw=require('@mui/material/CircularProgress'),e5=require('@mui/material/Paper'),o5=require('@mui/material/Alert'),C=require('country-flag-icons/react/3x2'),f3=require('react-lottie'),Y3=require('@mui/material/Collapse'),_5=require('@mui/material/Radio'),R5=require('@mui/material/Chip'),N9=require('lodash/debounce');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var rh__default=/*#__PURE__*/_interopDefault(rh);var Ac__default=/*#__PURE__*/_interopDefault(Ac);var gp__default=/*#__PURE__*/_interopDefault(gp);var aP__default=/*#__PURE__*/_interopDefault(aP);var Se__default=/*#__PURE__*/_interopDefault(Se);var ef__default=/*#__PURE__*/_interopDefault(ef);var P2__default=/*#__PURE__*/_interopDefault(P2);var Do__default=/*#__PURE__*/_interopDefault(Do);var g2__default=/*#__PURE__*/_interopDefault(g2);var rd__default=/*#__PURE__*/_interopDefault(rd);var _r__default=/*#__PURE__*/_interopDefault(_r);var F2__default=/*#__PURE__*/_interopDefault(F2);var z2__default=/*#__PURE__*/_interopDefault(z2);var L2__default=/*#__PURE__*/_interopDefault(L2);var D2__default=/*#__PURE__*/_interopDefault(D2);var gg__default=/*#__PURE__*/_interopDefault(gg);var ro__default=/*#__PURE__*/_interopDefault(ro);var V2__default=/*#__PURE__*/_interopDefault(V2);var $2__default=/*#__PURE__*/_interopDefault($2);var H2__default=/*#__PURE__*/_interopDefault(H2);var FP__default=/*#__PURE__*/_interopDefault(FP);var Hg__default=/*#__PURE__*/_interopDefault(Hg);var RS__default=/*#__PURE__*/_interopDefault(RS);var Na__default=/*#__PURE__*/_interopDefault(Na);var Eh__default=/*#__PURE__*/_interopDefault(Eh);var DS__default=/*#__PURE__*/_interopDefault(DS);var $S__default=/*#__PURE__*/_interopDefault($S);var MT__default=/*#__PURE__*/_interopDefault(MT);var TT__default=/*#__PURE__*/_interopDefault(TT);var LT__default=/*#__PURE__*/_interopDefault(LT);var Sg__default=/*#__PURE__*/_interopDefault(Sg);var Ig__default=/*#__PURE__*/_interopDefault(Ig);var mc__default=/*#__PURE__*/_interopDefault(mc);var xk__default=/*#__PURE__*/_interopDefault(xk);var bk__default=/*#__PURE__*/_interopDefault(bk);var fw__default=/*#__PURE__*/_interopDefault(fw);var q3__default=/*#__PURE__*/_interopDefault(q3);var Aw__default=/*#__PURE__*/_interopDefault(Aw);var e5__default=/*#__PURE__*/_interopDefault(e5);var o5__default=/*#__PURE__*/_interopDefault(o5);var C__namespace=/*#__PURE__*/_interopNamespace(C);var f3__default=/*#__PURE__*/_interopDefault(f3);var Y3__default=/*#__PURE__*/_interopDefault(Y3);var _5__default=/*#__PURE__*/_interopDefault(_5);var R5__default=/*#__PURE__*/_interopDefault(R5);var N9__default=/*#__PURE__*/_interopDefault(N9);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__default.default(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__default.default(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 reactNumberFormat.numericFormatter(String(Math.round(e)),o)}function hl(e,t="en-US"){let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:2,fixedDecimalScale:true};return reactNumberFormat.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`
1
+ 'use strict';var ah=require('@stigg/js-client-sdk'),Fc=require('react'),fp=require('@emotion/styled'),sP=require('classnames'),Se=require('@mui/material/Grid'),nf=require('lodash/compact'),reactNumberFormat=require('react-number-format'),react=require('@emotion/react'),jsxRuntime=require('react/jsx-runtime'),lodash=require('lodash'),S2=require('react-spinners/ClipLoader'),Do=require('color'),f2=require('lodash/merge'),fc=require('moment'),Ar=require('lodash/isNil'),L2=require('currency-symbol-map'),V2=require('@mui/material/InputAdornment'),B2=require('@mui/material/Button'),N2=require('@mui/material/TextField'),fg=require('@mui/material/Divider'),ro=require('react-loading-skeleton'),$2=require('@mui/material/OutlinedInput'),H2=require('@mui/material/Select'),W2=require('@mui/material/MenuItem'),material=require('@mui/material'),LP=require('react-switch'),Gg=require('lodash/sortBy'),styles=require('@mui/material/styles'),DS=require('lodash/flatMap'),Ua=require('@mui/material/Box'),Fh=require('@mui/material/Tab'),NS=require('lodash/isEmpty'),HS=require('@mui/material/Tabs'),reactFeather=require('react-feather'),IT=require('@mui/material/Link'),kT=require('@mui/material/Tooltip'),BT=require('@mui/material/LinearProgress'),Tg=require('lodash/keyBy'),Fg=require('lodash/isUndefined'),sdk=require('@stigg/api-client-js/src/generated/sdk'),hc=require('lodash/lowerCase'),immer=require('immer'),Ck=require('lodash/cloneDeep'),Pk=require('lodash/remove'),reactStripeJs=require('@stripe/react-stripe-js'),xw=require('@mui/material/StepIcon'),J3=require('lodash/partition'),Iw=require('@mui/material/CircularProgress'),n5=require('@mui/material/Paper'),i5=require('@mui/material/Alert'),C=require('country-flag-icons/react/3x2'),x3=require('react-lottie'),X3=require('@mui/material/Collapse'),M5=require('@mui/material/Radio'),N5=require('@mui/material/Chip'),U9=require('lodash/debounce');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var ah__default=/*#__PURE__*/_interopDefault(ah);var Fc__default=/*#__PURE__*/_interopDefault(Fc);var fp__default=/*#__PURE__*/_interopDefault(fp);var sP__default=/*#__PURE__*/_interopDefault(sP);var Se__default=/*#__PURE__*/_interopDefault(Se);var nf__default=/*#__PURE__*/_interopDefault(nf);var S2__default=/*#__PURE__*/_interopDefault(S2);var Do__default=/*#__PURE__*/_interopDefault(Do);var f2__default=/*#__PURE__*/_interopDefault(f2);var fc__default=/*#__PURE__*/_interopDefault(fc);var Ar__default=/*#__PURE__*/_interopDefault(Ar);var L2__default=/*#__PURE__*/_interopDefault(L2);var V2__default=/*#__PURE__*/_interopDefault(V2);var B2__default=/*#__PURE__*/_interopDefault(B2);var N2__default=/*#__PURE__*/_interopDefault(N2);var fg__default=/*#__PURE__*/_interopDefault(fg);var ro__default=/*#__PURE__*/_interopDefault(ro);var $2__default=/*#__PURE__*/_interopDefault($2);var H2__default=/*#__PURE__*/_interopDefault(H2);var W2__default=/*#__PURE__*/_interopDefault(W2);var LP__default=/*#__PURE__*/_interopDefault(LP);var Gg__default=/*#__PURE__*/_interopDefault(Gg);var DS__default=/*#__PURE__*/_interopDefault(DS);var Ua__default=/*#__PURE__*/_interopDefault(Ua);var Fh__default=/*#__PURE__*/_interopDefault(Fh);var NS__default=/*#__PURE__*/_interopDefault(NS);var HS__default=/*#__PURE__*/_interopDefault(HS);var IT__default=/*#__PURE__*/_interopDefault(IT);var kT__default=/*#__PURE__*/_interopDefault(kT);var BT__default=/*#__PURE__*/_interopDefault(BT);var Tg__default=/*#__PURE__*/_interopDefault(Tg);var Fg__default=/*#__PURE__*/_interopDefault(Fg);var hc__default=/*#__PURE__*/_interopDefault(hc);var Ck__default=/*#__PURE__*/_interopDefault(Ck);var Pk__default=/*#__PURE__*/_interopDefault(Pk);var xw__default=/*#__PURE__*/_interopDefault(xw);var J3__default=/*#__PURE__*/_interopDefault(J3);var Iw__default=/*#__PURE__*/_interopDefault(Iw);var n5__default=/*#__PURE__*/_interopDefault(n5);var i5__default=/*#__PURE__*/_interopDefault(i5);var C__namespace=/*#__PURE__*/_interopNamespace(C);var x3__default=/*#__PURE__*/_interopDefault(x3);var X3__default=/*#__PURE__*/_interopDefault(X3);var M5__default=/*#__PURE__*/_interopDefault(M5);var N5__default=/*#__PURE__*/_interopDefault(N5);var U9__default=/*#__PURE__*/_interopDefault(U9);var mp=Object.defineProperty,mC=Object.defineProperties;var hC=Object.getOwnPropertyDescriptors;var br=Object.getOwnPropertySymbols;var hp=Object.prototype.hasOwnProperty,gp=Object.prototype.propertyIsEnumerable;var pp=(e,t,o)=>t in e?mp(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o,S=(e,t)=>{for(var o in t||(t={}))hp.call(t,o)&&pp(e,o,t[o]);if(br)for(var o of br(t))gp.call(t,o)&&pp(e,o,t[o]);return e},A=(e,t)=>mC(e,hC(t));var ot=(e,t)=>{var o={};for(var n in e)hp.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&br)for(var n of br(e))t.indexOf(n)<0&&gp.call(e,n)&&(o[n]=e[n]);return o};var gC=(e,t)=>{for(var o in t)mp(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 yp={shouldForwardProp:e=>!e.startsWith("$")},xp=e=>fp__default.default(e,yp),fC=["div","span","button","input","form","p","h1","h2","h3","h4","h5","h6","a","img","ul","ol","li","table","thead","tbody","tr","td","th"];fC.forEach(e=>{xp[e]=fp__default.default(e,yp);});var y=xp;function Cr(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 reactNumberFormat.numericFormatter(String(Math.round(e)),o)}function gl(e,t="en-US"){let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:2,fixedDecimalScale:true};return reactNumberFormat.numericFormatter(String(e),o)}function di(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 bC(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 fl(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 CC=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":gl(t,o).fontWeight};
9
- font-size: ${({theme:e,$variant:t})=>gl(e,t).fontSize};
8
+ font-weight: ${({$bold:e,theme:t,$variant:o})=>e?"bold":fl(t,o).fontWeight};
9
+ font-size: ${({theme:e,$variant:t})=>fl(e,t).fontSize};
10
10
  ${({$lineHeight:e})=>e&&`line-height: ${e};`}
11
- `,P=Ac.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=react.useTheme(),h=gl(p,i),m=l||h.semanticElement,g=a||xC(p,r);return jsxRuntime.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=>jsxRuntime.jsxs("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_834_118930)",children:[jsxRuntime.jsx("path",{d:"M12 6.85712V17.1428",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M6.85712 12H17.1428",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.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"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_834_118930",children:jsxRuntime.jsx("rect",{width:24,height:24,fill:"white"})})})]})),Cp=PC;var SC=e=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"paint0_linear_67_8545",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#56ACF6"}),jsxRuntime.jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),Sp=SC;var TC=e=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"paint0_linear_267_19310",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#56ACF6"}),jsxRuntime.jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),kp=TC;var kC=e=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.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"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"paint0_linear_67_8556",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#56ACF6"}),jsxRuntime.jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),vp=kC;var wC=e=>jsxRuntime.jsxs("svg",A(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_834_120339)",children:[jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.jsx("path",{d:"M10.3335 6.19065V4.28589",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M10.3335 15.7144V13.8096",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_834_120339",children:jsxRuntime.jsx("rect",{width:20,height:20,fill:"white",transform:"translate(0.333496)"})})})]})),Ap=wC;var vC=e=>jsxRuntime.jsx("svg",A(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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=>jsxRuntime.jsxs("svg",A(S({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_834_116282)",children:[jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.jsx("path",{d:"M12 5.32483V23.3248",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M17.1429 1.03912L12 5.32484L6.85718 1.03912",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_834_116282",children:jsxRuntime.jsx("rect",{width:24,height:24,fill:"white",transform:"translate(0 0.182007)"})})})]})),Ep=_C;var AC=e=>jsxRuntime.jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"url(#paint0_linear_834_118583)"}),jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.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"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("linearGradient",{id:"paint0_linear_834_118583",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse"})})]})),Lp=MC;var EC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.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"}),jsxRuntime.jsx("path",{d:"M22 8V12",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M14 8V12",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M9 16H27",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"paint0_linear_45_8861",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#56ACF6"}),jsxRuntime.jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),Np=FC;var LC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"trash-2",children:[jsxRuntime.jsx("path",{id:"Shape",d:"M3 6H5H21",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.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"}),jsxRuntime.jsx("path",{id:"Shape_3",d:"M10 11V17",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{id:"Shape_4",d:"M14 11V17",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Up=LC;var RC=e=>jsxRuntime.jsxs("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.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"}),jsxRuntime.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=>jsxRuntime.jsx("svg",A(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("circle",{cx:10.333,cy:10,r:9,fill:"white",stroke:"#327EEE",strokeWidth:2})})),$p=NC;var UC=e=>jsxRuntime.jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"Group 16159",children:[jsxRuntime.jsx("circle",{id:"Ellipse 5",cx:10,cy:10,r:9.25,fill:"#327EEE",stroke:"#327EEE",strokeWidth:1.5}),jsxRuntime.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=>jsxRuntime.jsx("svg",A(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"Stepper indicators",children:[jsxRuntime.jsx("circle",{id:"Ellipse 5",cx:10.667,cy:10,r:9.25,fill:"#B3BCD3",stroke:"#B3BCD3",strokeWidth:1.5}),jsxRuntime.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=>jsxRuntime.jsx("svg",A(S({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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=>jsxRuntime.jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("g",{id:"check",children:jsxRuntime.jsx("path",{id:"Shape",d:"M20 7L9 18L4 13",stroke:"#F5F6F9",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})})),Xp=WC;var GC=e=>jsxRuntime.jsxs("svg",A(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_1889_12169)",children:[jsxRuntime.jsx("path",{d:"M11.4286 7.42578L8 13.1401",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.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"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_1889_12169",children:jsxRuntime.jsx("rect",{width:16,height:16,fill:"white"})})})]})),qp=GC;var jC=e=>jsxRuntime.jsx("svg",A(S({width:16,height:16,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"tag--tags-bookmark-favorite",children:[jsxRuntime.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"}),jsxRuntime.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=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M12 3V21.0001M3 11.9446H21",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),tm=ZC;var XC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M3 12H21",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),om=XC;var KC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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`
11
+ `,P=Fc.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=react.useTheme(),h=fl(p,i),m=l||h.semanticElement,g=a||bC(p,r);return jsxRuntime.jsx(CC,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 Pr=(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={};gC(Pl,{Add:()=>em,Addons:()=>Pp,ArrowForward:()=>Yp,BillingInfoCustomer:()=>Tp,Check:()=>Kp,Close:()=>Xp,ContactSupport:()=>wp,Coupon:()=>Jp,CreditCard:()=>_p,DollarCoin:()=>Mp,EntitlementCheck:()=>rm,MiniSchedule:()=>Sr,OutlinedCheckedCircle:()=>Wp,OutlinedCheckedCircleDisabled:()=>Gp,OutlinedCircle:()=>Hp,PayAsYouGoCharge:()=>Qp,PaymentMethod:()=>Vp,Promotions:()=>Fp,Remove:()=>nm,RenewSubscription:()=>Up,Restore:()=>Tr,ScheduleBox:()=>Bp,ScheduleClock:()=>Dp,Trash:()=>Op});var SC=e=>jsxRuntime.jsxs("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_834_118930)",children:[jsxRuntime.jsx("path",{d:"M12 6.85712V17.1428",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M6.85712 12H17.1428",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.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"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_834_118930",children:jsxRuntime.jsx("rect",{width:24,height:24,fill:"white"})})})]})),Pp=SC;var TC=e=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"paint0_linear_67_8545",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#56ACF6"}),jsxRuntime.jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),Tp=TC;var kC=e=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"paint0_linear_267_19310",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#56ACF6"}),jsxRuntime.jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),wp=kC;var wC=e=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.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"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"paint0_linear_67_8556",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#56ACF6"}),jsxRuntime.jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),_p=wC;var vC=e=>jsxRuntime.jsxs("svg",A(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_834_120339)",children:[jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.jsx("path",{d:"M10.3335 6.19065V4.28589",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M10.3335 15.7144V13.8096",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_834_120339",children:jsxRuntime.jsx("rect",{width:20,height:20,fill:"white",transform:"translate(0.333496)"})})})]})),Mp=vC;var _C=e=>jsxRuntime.jsx("svg",A(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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"})})),Sr=_C;var AC=e=>jsxRuntime.jsxs("svg",A(S({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_834_116282)",children:[jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.jsx("path",{d:"M12 5.32483V23.3248",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M17.1429 1.03912L12 5.32484L6.85718 1.03912",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_834_116282",children:jsxRuntime.jsx("rect",{width:24,height:24,fill:"white",transform:"translate(0 0.182007)"})})})]})),Fp=AC;var MC=e=>jsxRuntime.jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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"})})),Tr=MC;var IC=e=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"url(#paint0_linear_834_118583)"}),jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.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"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("linearGradient",{id:"paint0_linear_834_118583",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse"})})]})),Bp=IC;var FC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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"})})),Dp=FC;var LC=e=>jsxRuntime.jsxs("svg",A(S({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsx("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"}),jsxRuntime.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"}),jsxRuntime.jsx("path",{d:"M22 8V12",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M14 8V12",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M9 16H27",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:"paint0_linear_45_8861",x1:35.0204,y1:1.22449,x2:0,y2:36,gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx("stop",{stopColor:"#56ACF6"}),jsxRuntime.jsx("stop",{offset:1,stopColor:"#1559E6"})]})})]})),Up=LC;var BC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"trash-2",children:[jsxRuntime.jsx("path",{id:"Shape",d:"M3 6H5H21",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.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"}),jsxRuntime.jsx("path",{id:"Shape_3",d:"M10 11V17",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{id:"Shape_4",d:"M14 11V17",stroke:"#F88078",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Op=BC;var DC=e=>jsxRuntime.jsxs("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.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"}),jsxRuntime.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"})]})),Vp=DC;var UC=e=>jsxRuntime.jsx("svg",A(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("circle",{cx:10.333,cy:10,r:9,fill:"white",stroke:"#327EEE",strokeWidth:2})})),Hp=UC;var OC=e=>jsxRuntime.jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"Group 16159",children:[jsxRuntime.jsx("circle",{id:"Ellipse 5",cx:10,cy:10,r:9.25,fill:"#327EEE",stroke:"#327EEE",strokeWidth:1.5}),jsxRuntime.jsx("path",{id:"Shape",d:"M5 10.3636L8.63667 14L12.637 10L14.6372 8",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Wp=OC;var VC=e=>jsxRuntime.jsx("svg",A(S({width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"Stepper indicators",children:[jsxRuntime.jsx("circle",{id:"Ellipse 5",cx:10.667,cy:10,r:9.25,fill:"#B3BCD3",stroke:"#B3BCD3",strokeWidth:1.5}),jsxRuntime.jsx("path",{id:"Shape",d:"M5.66699 10.3636L9.30366 14L13.304 10L15.3042 8",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Gp=VC;var HC=e=>jsxRuntime.jsx("svg",A(S({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M9 3L7.9425 4.0575L12.1275 8.25H3V9.75H12.1275L7.9425 13.9425L9 15L15 9L9 3Z",fill:"white"})})),Yp=HC;var WC=e=>jsxRuntime.jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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"})})),Xp=WC;var GC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("g",{id:"check",children:jsxRuntime.jsx("path",{id:"Shape",d:"M20 7L9 18L4 13",stroke:"#F5F6F9",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})})),Kp=GC;var jC=e=>jsxRuntime.jsxs("svg",A(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_1889_12169)",children:[jsxRuntime.jsx("path",{d:"M11.4286 7.42578L8 13.1401",stroke:"#7586B0",strokeWidth:1.71429,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.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"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_1889_12169",children:jsxRuntime.jsx("rect",{width:16,height:16,fill:"white"})})})]})),Qp=jC;var YC=e=>jsxRuntime.jsx("svg",A(S({width:16,height:16,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"tag--tags-bookmark-favorite",children:[jsxRuntime.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"}),jsxRuntime.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"})]})})),Jp=YC;var XC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M12 3V21.0001M3 11.9446H21",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),em=XC;var KC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsx("path",{d:"M3 12H21",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})),nm=KC;var qC=e=>jsxRuntime.jsx("svg",A(S({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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"})})),rm=qC;var JC=y.div`
12
12
  ${({$pathColor:e})=>e&&react.css`
13
13
  path {
14
14
  fill: ${e};
@@ -27,27 +27,27 @@
27
27
  stroke: ${e};
28
28
  }
29
29
  `}
30
- `;function mt({icon:e,className:t,style:o,svgPathColor:n,svgRectColor:i,svgStrokeColor:r}){let a=Cl[e],s=react.useTheme();return jsxRuntime.jsx(QC,{className:t,style:o,$pathColor:Cr(n,s),$rectColor:Cr(i,s),$strokeColor:Cr(r,s),children:jsxRuntime.jsx(a,{})})}var JC=y(P)`
30
+ `;function mt({icon:e,className:t,style:o,svgPathColor:n,svgRectColor:i,svgStrokeColor:r}){let a=Pl[e],s=react.useTheme();return jsxRuntime.jsx(JC,{className:t,style:o,$pathColor:Pr(n,s),$rectColor:Pr(i,s),$strokeColor:Pr(r,s),children:jsxRuntime.jsx(a,{})})}var t2=y(P)`
31
31
  margin: 0;
32
- `,t2=y.div`
32
+ `,e2=y.div`
33
33
  display: flex;
34
34
  align-items: center;
35
35
  gap: 16px;
36
- `,e2=y.div`
36
+ `,o2=y.div`
37
37
  display: flex;
38
38
  align-items: center;
39
39
  flex-shrink: 0;
40
- `,o2=y(mt)`
40
+ `,n2=y(mt)`
41
41
  width: 24px;
42
42
  height: 24px;
43
43
  color: ${({theme:e})=>e.stigg.palette.primary};
44
- `;function Tr({displayName:e,className:t}){return jsxRuntime.jsxs(t2,{className:`stigg-entitlement-row-container ${t}`,children:[jsxRuntime.jsx(e2,{children:jsxRuntime.jsx(o2,{icon:"EntitlementCheck",className:"stigg-entitlement-row-icon"})}),jsxRuntime.jsx(JC,{className:"stigg-entitlement-name",variant:"h6",color:"secondary",children:e})]})}function i2(e){if(!e)return "";switch(e){case rh.EntitlementResetPeriod.Day:return "per day";case rh.EntitlementResetPeriod.Hour:return "per hour";case rh.EntitlementResetPeriod.Week:return "per week";case rh.EntitlementResetPeriod.Month:return "per month";case rh.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 jsxRuntime.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 jsxRuntime.jsx(Tr,{displayName:t,className:`stigg-credit-entitlement-${e.id}`})}function u2(e){return e.__typename==="PackageCreditEntitlement"}var p2=y.div`
44
+ `;function kr({displayName:e,className:t}){return jsxRuntime.jsxs(e2,{className:`stigg-entitlement-row-container ${t}`,children:[jsxRuntime.jsx(o2,{children:jsxRuntime.jsx(n2,{icon:"EntitlementCheck",className:"stigg-entitlement-row-icon"})}),jsxRuntime.jsx(t2,{className:"stigg-entitlement-name",variant:"h6",color:"secondary",children:e})]})}function r2(e){if(!e)return "";switch(e){case ah.EntitlementResetPeriod.Day:return "per day";case ah.EntitlementResetPeriod.Hour:return "per hour";case ah.EntitlementResetPeriod.Week:return "per week";case ah.EntitlementResetPeriod.Month:return "per month";case ah.EntitlementResetPeriod.Year:return "per year";default:return ""}}function a2({hasUnlimitedUsage:e,feature:t,resetPeriod:o,usageLimit:n,minUnitQuantity:i,maxUnitQuantity:r,isCustom:a,enumValues:s}){let l=i||r,c=`${o&&n?`${r2(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?Cr(i,r,t==null?void 0:t.featureUnitsPlural):t==null?void 0:t.displayName}function kl(e){let r=e,{displayNameOverride:t,feature:o}=r,n=ot(r,["displayNameOverride","feature"]),i=t||a2(S({feature:o},n))||"";return jsxRuntime.jsx(kr,{displayName:i,className:`stigg-entitlement-${o==null?void 0:o.refId}`})}function l2(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 sm({entitlement:e}){let t=l2(e);return jsxRuntime.jsx(kr,{displayName:t,className:`stigg-credit-entitlement-${e.id}`})}function p2(e){return e.__typename==="PackageCreditEntitlement"}var m2=y.div`
45
45
  display: flex;
46
46
  flex-direction: column;
47
47
  gap: 16px;
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 jsxRuntime.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__default.default(e.packageEntitlements).filter(l=>l.isGranted).filter(l=>{var c;return !((c=l.hiddenFromWidgets)!=null&&c.includes(rh.WidgetType.Paywall))}),a=i.length>0||r.length>0;return jsxRuntime.jsxs(p2,{className:"stigg-plan-entitlements-container",children:[jsxRuntime.jsx(P,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:true,children:m2(e,o,a)}),i,r.map(l=>u2(l)?jsxRuntime.jsx(am,{entitlement:l},sm(l)):jsxRuntime.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__default.default(((c=e==null?void 0:e.palette)==null?void 0:c.primary)||"#327EEE"),o=Do__default.default(((u=(d=e==null?void 0:e.palette)==null?void 0:d.text)==null?void 0:u.primary)||"#001E6C"),n=Do__default.default("#4CAF50"),i=Do__default.default("#f44336"),r=Do__default.default("#ff9800"),a=Do__default.default("#2196f3"),s=Do__default.default("#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__default.default(l,e)};var vl=e=>rd__default.default.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 rh.SubscriptionScheduleType.Downgrade:{let l=i;return lodash.isNil(l)&&(o!=null&&o.end)&&(l=!rd__default.default(e.scheduledExecutionTime).isSame(o==null?void 0:o.end,"day")),{line1:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your subscription will be downgraded to the ",jsxRuntime.jsxs("b",{children:[(a=e.targetPackage)==null?void 0:a.displayName," plan"]})," ",l?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",vl(e.scheduledExecutionTime)]}):r,"."]}),line2:"Until then you still have access to your current plan."}}case rh.SubscriptionScheduleType.BillingPeriod:{let l=e.scheduleVariables;return {line1:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your billing cycle will change to ",jsxRuntime.jsx("b",{children:(s=l.billingPeriod)==null?void 0:s.toLocaleLowerCase()})," ",i?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",vl(e.scheduledExecutionTime)]}):r,"."]})}}case rh.SubscriptionScheduleType.UnitAmount:{let l=e.scheduleVariables,d=lodash.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=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your subscription will be updated to ",jsxRuntime.jsx("b",{children:l.newUnitAmount})," ",h," ",i?jsxRuntime.jsxs(jsxRuntime.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===rh.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__default.default(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=lodash.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 rh.TiersMode.Volume:{let i=Ml(e.tiers,t);return Al(i,t,o,n)}case rh.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__default.default(o))}function gm(e){return e==null?void 0:e.every(({unitPrice:t,upTo:o})=>!t||_r__default.default(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===rh.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===rh.BillingModel.PerUnit&&p.tiersMode),r=t.id===(n==null?void 0:n.planId);if(r&&(i=(d=t.pricePoints.find(p=>p.pricingModel===rh.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__default.default(l))return 0;let c=e[a];return c<l?-1:c>l?1:0}var k2=y(P2__default.default)`
48
+ `;function h2(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 cm({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 jsxRuntime.jsx(kl,{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=nf__default.default(e.packageEntitlements).filter(l=>l.isGranted).filter(l=>{var c;return !((c=l.hiddenFromWidgets)!=null&&c.includes(ah.WidgetType.Paywall))}),a=i.length>0||r.length>0;return jsxRuntime.jsxs(m2,{className:"stigg-plan-entitlements-container",children:[jsxRuntime.jsx(P,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:true,children:h2(e,o,a)}),i,r.map(l=>p2(l)?jsxRuntime.jsx(sm,{entitlement:l},lm(l)):jsxRuntime.jsx(kl,{displayNameOverride:l.displayNameOverride,feature:l.feature,resetPeriod:l.resetPeriod,hasUnlimitedUsage:l.hasUnlimitedUsage,usageLimit:l.usageLimit,enumValues:l.enumValues,isCustom:l.isCustom},lm(l)))]})}function lm(e){return `${e.__typename}:${e.id}`}var wl=(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))(wl||{});var vr=e=>({left:"flex-start",center:"center",right:"flex-end"})[e],dm=e=>{var c,d,u;let t=Do__default.default(((c=e==null?void 0:e.palette)==null?void 0:c.primary)||"#327EEE"),o=Do__default.default(((u=(d=e==null?void 0:e.palette)==null?void 0:d.text)==null?void 0:u.primary)||"#001E6C"),n=Do__default.default("#4CAF50"),i=Do__default.default("#f44336"),r=Do__default.default("#ff9800"),a=Do__default.default("#2196f3"),s=Do__default.default("#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 f2__default.default(l,e)};var _l=e=>fc__default.default.utc(e).format("MMMM Do, yyyy");function _r({scheduledUpdate:e,subscriptionPrices:t,billingPeriodRange:o,options:n={}}){var a,s;if(!e)return {};let{withDate:i,postfix:r=""}=n;switch(e.subscriptionScheduleType){case ah.SubscriptionScheduleType.Downgrade:{let l=i;return lodash.isNil(l)&&(o!=null&&o.end)&&(l=!fc__default.default(e.scheduledExecutionTime).isSame(o==null?void 0:o.end,"day")),{line1:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your subscription will be downgraded to the ",jsxRuntime.jsxs("b",{children:[(a=e.targetPackage)==null?void 0:a.displayName," plan"]})," ",l?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",_l(e.scheduledExecutionTime)]}):r,"."]}),line2:"Until then you still have access to your current plan."}}case ah.SubscriptionScheduleType.BillingPeriod:{let l=e.scheduleVariables;return {line1:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your billing cycle will change to ",jsxRuntime.jsx("b",{children:(s=l.billingPeriod)==null?void 0:s.toLocaleLowerCase()})," ",i?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",_l(e.scheduledExecutionTime)]}):r,"."]})}}case ah.SubscriptionScheduleType.UnitAmount:{let l=e.scheduleVariables,d=lodash.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=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Your subscription will be updated to ",jsxRuntime.jsx("b",{children:l.newUnitAmount})," ",h," ",i?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["on ",_l(e.scheduledExecutionTime)]}):r,"."]}),g=`Until then you still have access to your current ${u} count.`;return {line1:m,line2:g}}default:return {}}}function gm(e){return e.feature&&(e.feature.unitQuantity!==1?e.feature.unitsPlural:e.feature.units)||""}function Il(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 hm(e,t,o){return t===ah.BillingPeriod.Annually&&o?e/12:e}function Ml(e,t,o,n){let i=0;if(e.unitPrice){let r=hm(e.unitPrice.amount,o,n);i+=r*t;}return e.flatPrice&&(i+=hm(e.flatPrice.amount,o,n)),i}function El(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(Ar__default.default(d))s.push({unitQuantity:i,amount:Ml(c,i,o,n)}),i=0;else {let u=d-r,p=Math.min(i,u);s.push({unitQuantity:p,amount:Ml(c,p,o,n)}),i-=p,r=d;}a+=1;}let l=lodash.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 ah.TiersMode.Volume:{let i=Il(e.tiers,t);return Ml(i,t,o,n)}case ah.TiersMode.Graduated:return El(e.tiers,t,o,n).total;default:return 0}}function fi(e){return e==null?void 0:e.some(({unitPrice:t,upTo:o})=>t&&!Ar__default.default(o))}function fm(e){return e==null?void 0:e.every(({unitPrice:t,upTo:o})=>!t||Ar__default.default(o))}function ym(e,t){return (e==null?void 0:e[0].upTo)&&t<=e[0].upTo}function Mr({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(h=>{var m;return h.pricingModel===ah.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 xm({perUnitQuantityByFeature:e,plan:t,currentSubscription:o,currentSubscriptionOverride:n}){var d,u;if(!o)return 0;let i=o.prices.find(p=>p.pricingModel===ah.BillingModel.PerUnit&&p.tiersMode),r=t.id===(n==null?void 0:n.planId);if(r&&(i=(d=t.pricePoints.find(p=>p.pricingModel===ah.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(Ar__default.default(l))return 0;let c=e[a];return c<l?-1:c>l?1:0}var w2=y(S2__default.default)`
49
49
  margin-left: 10px;
50
- `,w2=y.button`
50
+ `,v2=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 @@
66
66
  &:hover {
67
67
  background-color: ${({theme:e,$disabled:t})=>t?e.stigg.palette.backgroundButton:e.stigg.palette.outlinedHoverBackground};
68
68
  }
69
- `,v2=y(P)`
69
+ `,_2=y(P)`
70
70
  margin: 0;
71
71
  font-size: 15px;
72
- `,_2=y(P)`
72
+ `,A2=y(P)`
73
73
  min-height: 87px;
74
- `,A2=y.button`
74
+ `,M2=y.button`
75
75
  background: none;
76
76
  border: none;
77
77
  padding: 0;
@@ -79,17 +79,17 @@
79
79
 
80
80
  text-decoration: underline;
81
81
  cursor: pointer;
82
- `,M2=y(P)`
82
+ `,I2=y(P)`
83
83
  margin-top: 8px;
84
84
  margin-bottom: 17px;
85
85
  min-height: 20px;
86
- `,I2=y.div`
86
+ `,E2=y.div`
87
87
  display: flex;
88
88
  flex-direction: column;
89
89
  margin-top: 4px;
90
- align-self: ${({theme:e})=>wr(e.stigg.layout.ctaAlignment)};
90
+ align-self: ${({theme:e})=>vr(e.stigg.layout.ctaAlignment)};
91
91
  width: 100%;
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=react.useTheme(),[p,h]=Ac.useState(false),{currentPlan:m,custom:g,downgrade:f,startTrial:x,upgrade:b,startNew:T,switchToBillingPeriod:k,cancelScheduledUpdate:w}=a.planCTAButton,v=lodash.isFunction(f)?f(o):f,_=lodash.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===rh.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&&[rh.PricingType.Free,rh.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 jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(I2,{className:"stigg-paywall-plan-button-layout",children:e&&F?jsxRuntime.jsxs(_2,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text",children:[F," ",jsxRuntime.jsx(A2,{color:"secondary",onClick:()=>{h(true),Promise.resolve(r(M.intentionType)).finally(()=>h(false));},children:M.title})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.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:[jsxRuntime.jsx(v2,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main",children:M.title}),p&&jsxRuntime.jsx(k2,{color:u.stigg.palette.text.disabled,loading:true,size:16})]}),s?jsxRuntime.jsx(M2,{className:"stigg-trial-days-left-text",variant:"h6",color:"secondary",children:o.isCurrentCustomerPlan&&o.trialDaysLeft&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("b",{children:[o.trialDaysLeft," days"]})," left on your free trial"]})}):jsxRuntime.jsx("div",{style:{height:"20px"}})]})})})}var at=({amount:e,currency:t=rh.Currency.Usd,locale:o,maximumFractionDigits:n=5,minimumFractionDigits:i=0,removeTrailingZero:r})=>{let a=t.toString(),s=F2__default.default(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===rh.BillingPeriod.Annually&&i?c/12:c,p,h,m=r.price.pricePeriod(i?rh.BillingPeriod.Monthly:rh.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===rh.BillingModel.PerUnit&&!T.isTieredPrice?g=`${k} ${m}`:T.pricingModel===rh.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 rh.PricingType.Free:return typeof o.price.free=="function"?o.price.free(e.paywallCurrency):o.price.free;case rh.PricingType.Custom:return {price:typeof o.price.custom=="function"?o.price.custom({plan:e,selectedBillingPeriod:t}):o.price.custom};case rh.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__default.default)`
92
+ `;function Cm({isNextPlan:e,customer:t,plan:o,billingPeriod:n,isCustomerOnTrial:i,onPlanSelected:r,paywallLocale:a,withTrialLeftRow:s,currentSubscription:l,currentSubscriptionOverride:c,perUnitQuantityByFeature:d}){let u=react.useTheme(),[p,h]=Fc.useState(false),{currentPlan:m,custom:g,downgrade:f,startTrial:x,upgrade:b,startNew:T,switchToBillingPeriod:k,cancelScheduledUpdate:w}=a.planCTAButton,v=lodash.isFunction(f)?f(o):f,_=lodash.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===ah.PricingType.Custom,{line1:F}=_r({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&&[ah.PricingType.Free,ah.PricingType.Custom].includes(o.pricingType))switch(xm({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 jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(E2,{className:"stigg-paywall-plan-button-layout",children:e&&F?jsxRuntime.jsxs(A2,{color:"secondary",variant:"body1",className:"stigg-paywall-schedule-update-text",children:[F," ",jsxRuntime.jsx(M2,{color:"secondary",onClick:()=>{h(true),Promise.resolve(r(M.intentionType)).finally(()=>h(false));},children:M.title})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(v2,{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:[jsxRuntime.jsx(_2,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main",children:M.title}),p&&jsxRuntime.jsx(w2,{color:u.stigg.palette.text.disabled,loading:true,size:16})]}),s?jsxRuntime.jsx(I2,{className:"stigg-trial-days-left-text",variant:"h6",color:"secondary",children:o.isCurrentCustomerPlan&&o.trialDaysLeft&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("b",{children:[o.trialDaysLeft," days"]})," left on your free trial"]})}):jsxRuntime.jsx("div",{style:{height:"20px"}})]})})})}var at=({amount:e,currency:t=ah.Currency.Usd,locale:o,maximumFractionDigits:n=5,minimumFractionDigits:i=0,removeTrailingZero:r})=>{let a=t.toString(),s=L2__default.default(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 Sm({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===ah.BillingPeriod.Annually&&i?c/12:c,p,h,m=r.price.pricePeriod(i?ah.BillingPeriod.Monthly:ah.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=gm(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===ah.BillingModel.PerUnit&&!T.isTieredPrice?g=`${k} ${m}`:T.pricingModel===ah.BillingModel.UsageBased&&(g=`${k}`);}return {price:at({amount:u,currency:l,locale:n,minimumFractionDigits:2,removeTrailingZero:true}),unit:g,tiers:p,tierUnits:h}}function Ir(e,t,o,n,i,r){var a;switch(e.pricingType){case ah.PricingType.Free:return typeof o.price.free=="function"?o.price.free(e.paywallCurrency):o.price.free;case ah.PricingType.Custom:return {price:typeof o.price.custom=="function"?o.price.custom({plan:e,selectedBillingPeriod:t}):o.price.custom};case ah.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})):Sm(A(S({},c),{locale:n,shouldShowMonthlyPriceAmount:i,paywallLocale:o}))}default:return {price:""}}}var R2=y(B2__default.default)`
93
93
  border-radius: 10px;
94
94
  text-transform: none;
95
95
  font-weight: 300;
@@ -100,26 +100,26 @@
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 jsxRuntime.jsx(B2,S({variant:e},t))};var Rt=y(D2__default.default)(({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__default.default)`
103
+ `,kt=o=>{var n=o,{variant:e="outlined"}=n,t=ot(n,["variant"]);return jsxRuntime.jsx(R2,S({variant:e},t))};var Rt=y(N2__default.default)(({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__default.default)`
104
104
  display: flex;
105
105
  flex-direction: ${({$flexDirection:e})=>e||"row"};
106
106
  gap: ${({$gap:e})=>e}px;
107
- `,Tm=y(Oo)`
107
+ `,km=y(Oo)`
108
108
  span {
109
109
  display: flex;
110
110
  flex: 1;
111
111
  }
112
- `,yi=y(Se__default.default)`
112
+ `,xi=y(Se__default.default)`
113
113
  span {
114
114
  display: flex;
115
115
  flex: ${({flex:e})=>e};
116
116
  }
117
117
  `,dt=y(ro__default.default)`
118
118
  border-radius: 4px;
119
- `;var km=y(Se__default.default)`
119
+ `;var wm=y(Se__default.default)`
120
120
  display: flex;
121
121
  flex-direction: column;
122
- `;function wm(){return jsxRuntime.jsxs(km,{container:true,children:[jsxRuntime.jsxs(Oo,{item:true,$gap:48,children:[jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsx(dt,{width:120,height:20})]}),jsxRuntime.jsx(gg__default.default,{className:"stigg-checkout-plan-header-divider",sx:{marginY:2}}),jsxRuntime.jsxs(km,{item:true,children:[jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsxs(Tm,{$gap:16,marginTop:3,children:[jsxRuntime.jsx(dt,{height:20}),jsxRuntime.jsx(dt,{height:20})]}),jsxRuntime.jsxs(Oo,{$gap:130,marginTop:3,children:[jsxRuntime.jsx(yi,{flex:1,children:jsxRuntime.jsx(dt,{height:20})}),jsxRuntime.jsx(yi,{flex:3,children:jsxRuntime.jsx(dt,{height:20})})]})]})]})}var Pn=e=>e.target.blur();function vm({width:e,tierUnits:t,value:o,handleChange:n,errorMessage:i}){return jsxRuntime.jsx(Rt,{type:"number",onWheel:Pn,fullWidth:true,error:!!i,sx:{minHeight:"46px",width:e},InputProps:{endAdornment:jsxRuntime.jsx(z2__default.default,{position:"end",children:jsxRuntime.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__default.default)`
122
+ `;function vm(){return jsxRuntime.jsxs(wm,{container:true,children:[jsxRuntime.jsxs(Oo,{item:true,$gap:48,children:[jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsx(dt,{width:120,height:20})]}),jsxRuntime.jsx(fg__default.default,{className:"stigg-checkout-plan-header-divider",sx:{marginY:2}}),jsxRuntime.jsxs(wm,{item:true,children:[jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsxs(km,{$gap:16,marginTop:3,children:[jsxRuntime.jsx(dt,{height:20}),jsxRuntime.jsx(dt,{height:20})]}),jsxRuntime.jsxs(Oo,{$gap:130,marginTop:3,children:[jsxRuntime.jsx(xi,{flex:1,children:jsxRuntime.jsx(dt,{height:20})}),jsxRuntime.jsx(xi,{flex:3,children:jsxRuntime.jsx(dt,{height:20})})]})]})]})}var Pn=e=>e.target.blur();function _m({width:e,tierUnits:t,value:o,handleChange:n,errorMessage:i}){return jsxRuntime.jsx(Rt,{type:"number",onWheel:Pn,fullWidth:true,error:!!i,sx:{minHeight:"46px",width:e},InputProps:{endAdornment:jsxRuntime.jsx(V2__default.default,{position:"end",children:jsxRuntime.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 j2=y(H2__default.default)`
123
123
  border-radius: 10px;
124
124
  min-height: 42px;
125
125
  min-width: 120px;
@@ -127,7 +127,7 @@
127
127
  &:hover .MuiOutlinedInput-notchedOutline {
128
128
  border-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
129
129
  }
130
- `,j2=y(V2__default.default)`
130
+ `,Y2=y($2__default.default)`
131
131
  & .MuiInputBase-input {
132
132
  padding: 10px 12px;
133
133
  }
@@ -135,34 +135,34 @@
135
135
  &.Mui-focused .MuiOutlinedInput-notchedOutline {
136
136
  border-color: ${({theme:e})=>e.stigg.palette.primary} !important;
137
137
  }
138
- `;function _m({value:e,componentId:t,tierUnits:o,tiers:n,handleChange:i,errorMessage:r}){return n?jsxRuntime.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:jsxRuntime.jsx(j2,{}),MenuProps:{MenuListProps:{disablePadding:true},PaperProps:{sx:{marginTop:"4px",borderRadius:"10px"}}},children:lodash.map(n,a=>{var s;return jsxRuntime.jsx(H2__default.default,{className:"stigg-price-tier-menu-item-text",value:(s=a.upTo)==null?void 0:s.toString(),children:jsxRuntime.jsxs(P,{variant:"body1",color:"primary",style:{lineHeight:"unset"},children:[At(a.upTo)," ",o]})},a.upTo)})}):null}var X2=y(P)`
138
+ `;function Am({value:e,componentId:t,tierUnits:o,tiers:n,handleChange:i,errorMessage:r}){return n?jsxRuntime.jsx(j2,{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:jsxRuntime.jsx(Y2,{}),MenuProps:{MenuListProps:{disablePadding:true},PaperProps:{sx:{marginTop:"4px",borderRadius:"10px"}}},children:lodash.map(n,a=>{var s;return jsxRuntime.jsx(W2__default.default,{className:"stigg-price-tier-menu-item-text",value:(s=a.upTo)==null?void 0:s.toString(),children:jsxRuntime.jsxs(P,{variant:"body1",color:"primary",style:{lineHeight:"unset"},children:[At(a.upTo)," ",o]})},a.upTo)})}):null}var K2=y(P)`
139
139
  min-height: 46px;
140
- `;function Ir(e){let{tiers:t,errorMessage:o}=e;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",justifyContent:"center",style:{width:"100%"},children:[jsxRuntime.jsx(X2,{as:"div",className:"stigg-price-tier-select",children:gi(t)?jsxRuntime.jsx(vm,S({},e)):jsxRuntime.jsx(_m,S({},e))}),jsxRuntime.jsx(P,{style:{margin:"4px"},variant:"caption",color:"error",children:o})]})})}var Mm="\u200E",Q2=y(P)`
140
+ `;function Er(e){let{tiers:t,errorMessage:o}=e;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",justifyContent:"center",style:{width:"100%"},children:[jsxRuntime.jsx(K2,{as:"div",className:"stigg-price-tier-select",children:fi(t)?jsxRuntime.jsx(_m,S({},e)):jsxRuntime.jsx(Am,S({},e))}),jsxRuntime.jsx(P,{style:{margin:"4px"},variant:"caption",color:"error",children:o})]})})}var Im="\u200E",J2=y(P)`
141
141
  word-break: break-word;
142
142
  width: 100%;
143
- `,J2=y(P)`
144
- white-space: nowrap;
145
143
  `,tP=y(P)`
144
+ white-space: nowrap;
145
+ `,eP=y(P)`
146
146
  white-space: normal;
147
147
  min-height: 39px;
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()}`),jsxRuntime.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 jsxRuntime.jsx(Q2,{as:"div",className:"stigg-price-text",children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o&&jsxRuntime.jsx(P,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary",children:e?a.price.startingAtCaption:Mm}),jsxRuntime.jsx(tP,{className:"stigg-price-point",variant:"h1",children:p}),t&&jsxRuntime.jsxs(P,{as:"div",className:"stigg-price-unit-and-billing-period-text",style:{minHeight:"48px"},children:[jsxRuntime.jsx(J2,{className:"stigg-price-unit-text",as:"span",variant:"h6",color:"secondary",children:h}),jsxRuntime.jsx(eP,{plan:i,billingPeriod:r,hasAnnuallyPrice:c,hasMonthlyPrice:l,paywallLocale:a})]}),n?jsxRuntime.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__default.default)`
148
+ `;function oP({plan:e,billingPeriod:t,hasMonthlyPrice:o,hasAnnuallyPrice:n,paywallLocale:i}){var s,l;let r=e.pricePoints.find(c=>c.billingPeriod===t),a=Im;return r&&o&&n&&(a=((l=(s=i.price).billingPeriod)==null?void 0:l.call(s,t))||`, billed ${t.toLowerCase()}`),jsxRuntime.jsx(P,{as:"span",className:"stigg-price-billing-period-text",variant:"h6",color:"secondary",children:a})}var Em=({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}=Ir(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 jsxRuntime.jsx(J2,{as:"div",className:"stigg-price-text",children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o&&jsxRuntime.jsx(P,{style:{minHeight:"20px"},className:"stigg-starting-at-text",variant:"body1",color:"secondary",children:e?a.price.startingAtCaption:Im}),jsxRuntime.jsx(eP,{className:"stigg-price-point",variant:"h1",children:p}),t&&jsxRuntime.jsxs(P,{as:"div",className:"stigg-price-unit-and-billing-period-text",style:{minHeight:"48px"},children:[jsxRuntime.jsx(tP,{className:"stigg-price-unit-text",as:"span",variant:"h6",color:"secondary",children:h}),jsxRuntime.jsx(oP,{plan:i,billingPeriod:r,hasAnnuallyPrice:c,hasMonthlyPrice:l,paywallLocale:a})]}),n?jsxRuntime.jsx(Er,{componentId:`${i.id}_${x}_tier`,tiers:m,tierUnits:g,tiersMode:f==null?void 0:f.tiersMode,handleChange:T,value:b}):null]})})};var lP=y(B2__default.default)`
149
149
  padding: 0px;
150
150
  text-transform: none;
151
151
  margin-left: 0px;
152
- `,lP=y(P)`
152
+ `,cP=y(P)`
153
153
  font-size: 14px;
154
154
  font-weight: 500;
155
- `,cP=y.div`
155
+ `,dP=y.div`
156
156
  width: 100%;
157
157
  gap: 10px;
158
- `,dP=y.div`
158
+ `,uP=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
- `,uP=y.div`
165
+ `,pP=y.div`
166
166
  display: flex;
167
167
  flex-direction: row;
168
168
  flex-wrap: nowrap;
@@ -171,7 +171,7 @@
171
171
  padding: 8px 0px;
172
172
  max-height: 44px;
173
173
  gap: 16px;
174
- `,pP=y(P)`
174
+ `,mP=y(P)`
175
175
  overflow: hidden;
176
176
  font-feature-settings: 'liga' off, 'clig' off;
177
177
  text-overflow: ellipsis;
@@ -180,17 +180,17 @@
180
180
  white-space: nowrap;
181
181
  min-width: 0;
182
182
  flex-shrink: 1;
183
- `,mP=y(mt)`
183
+ `,hP=y(mt)`
184
184
  width: 24px;
185
185
  height: 24px;
186
186
  color: ${({theme:e})=>e.stigg.palette.primary};
187
- `,hP=y.div`
187
+ `,gP=y.div`
188
188
  flex: 1;
189
189
  min-width: 0;
190
- `,gP=y.div`
190
+ `,fP=y.div`
191
191
  margin-top: 16px;
192
192
  display: flex;
193
- `,Nl=4;function Ul({addons:e,paywallLocale:t}){let[o,n]=Ac.useState(false);if(!e||e.length===0)return null;let i=e.filter(s=>{var l;return !((l=s.hiddenFromWidgets)!=null&&l.includes(rh.WidgetType.Paywall))}),r=()=>{n(!o);},a=o?i:i.slice(0,Nl);return a.length===0?null:jsxRuntime.jsxs(cP,{className:"stigg-compatible-addons-container",children:[jsxRuntime.jsx(P,{className:"stigg-compatible-addons-header",color:"secondary",variant:"body1",bold:true,children:t.addonsTitle}),jsxRuntime.jsx(dP,{className:"stigg-compatible-addons-list",children:a.map(s=>jsxRuntime.jsxs(uP,{className:aP__default.default(`stigg-compatible-addon--${s.id}`,"stigg-compatible-addon-item"),children:[jsxRuntime.jsx(mP,{icon:"Add",className:"stigg-compatible-addon-icon"}),jsxRuntime.jsx(hP,{className:"stigg-compatible-addon-content",children:jsxRuntime.jsx(pP,{variant:"body1",color:"primary",className:"stigg-compatible-addon-name",children:s.displayName})})]},s.id))}),i.length>Nl&&jsxRuntime.jsx(gP,{children:jsxRuntime.jsx(sP,{variant:"text",onClick:r,children:jsxRuntime.jsx(lP,{color:"primary.main",children:o?"Show less":`Show ${i.length-Nl} more`})})})]})}var CP="66px",PP=y.div`
193
+ `,Ul=4;function Ol({addons:e,paywallLocale:t}){let[o,n]=Fc.useState(false);if(!e||e.length===0)return null;let i=e.filter(s=>{var l;return !((l=s.hiddenFromWidgets)!=null&&l.includes(ah.WidgetType.Paywall))}),r=()=>{n(!o);},a=o?i:i.slice(0,Ul);return a.length===0?null:jsxRuntime.jsxs(dP,{className:"stigg-compatible-addons-container",children:[jsxRuntime.jsx(P,{className:"stigg-compatible-addons-header",color:"secondary",variant:"body1",bold:true,children:t.addonsTitle}),jsxRuntime.jsx(uP,{className:"stigg-compatible-addons-list",children:a.map(s=>jsxRuntime.jsxs(pP,{className:sP__default.default(`stigg-compatible-addon--${s.id}`,"stigg-compatible-addon-item"),children:[jsxRuntime.jsx(hP,{icon:"Add",className:"stigg-compatible-addon-icon"}),jsxRuntime.jsx(gP,{className:"stigg-compatible-addon-content",children:jsxRuntime.jsx(mP,{variant:"body1",color:"primary",className:"stigg-compatible-addon-name",children:s.displayName})})]},s.id))}),i.length>Ul&&jsxRuntime.jsx(fP,{children:jsxRuntime.jsx(lP,{variant:"text",onClick:r,children:jsxRuntime.jsx(cP,{color:"primary.main",children:o?"Show less":`Show ${i.length-Ul} more`})})})]})}var PP="66px",SP=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 @@
203
203
  align-items: flex-start;
204
204
  justify-content: flex-start;
205
205
  position: relative;
206
- `,SP=y.div`
206
+ `,TP=y.div`
207
207
  margin-top: ${({$planHasEntitlements:e})=>e?"32px":"0px"};
208
- `,TP=y(P)`
208
+ `,kP=y(P)`
209
209
  padding-bottom: 8px;
210
- `,kP=y.div`
210
+ `,wP=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
- `,wP=y(P)`
215
+ `,vP=y(P)`
216
216
  text-align: ${({theme:e})=>e.stigg.layout.descriptionAlignment};
217
217
  min-height: ${({theme:e})=>e.stigg.layout.descriptionMinHeight};
218
- `,vP=y.div`
218
+ `,_P=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
- `,_P=y(P)`
223
+ `,AP=y(P)`
224
224
  margin: 0;
225
225
  padding: 2px 8px;
226
- `,AP=y.div`
226
+ `,MP=y.div`
227
227
  width: 100%;
228
228
  display: flex;
229
229
  flex-direction: column;
230
- align-items: ${({theme:e})=>wr(e.stigg.layout.headerAlignment)};
231
- `,MP=y.div`
230
+ align-items: ${({theme:e})=>vr(e.stigg.layout.headerAlignment)};
231
+ `,IP=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
- `,IP=y(Pr)`
237
+ `,EP=y(Sr)`
238
238
  display: flex;
239
239
  height: 100%;
240
240
  margin-right: 4px;
@@ -242,7 +242,7 @@
242
242
  path {
243
243
  fill: ${({theme:e})=>e.stigg.palette.text.primary};
244
244
  }
245
- `;function EP({text:e="Next",iconsColor:t}){return jsxRuntime.jsx(MP,{children:jsxRuntime.jsxs(Se__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsx(IP,{$iconsColor:t}),jsxRuntime.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===rh.PricingType.Custom,I=null;k?I=jsxRuntime.jsx(EP,{text:"Next plan"}):a&&m.highlightChip&&(I=jsxRuntime.jsx(vP,{className:"stigg-highlight-badge",children:jsxRuntime.jsx(_P,{className:"stigg-highlight-badge-text",color:"white",bold:true,children:m.highlightChip})}));let[F,E]=Ac.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 jsxRuntime.jsxs(PP,{className:aP__default.default(`stigg-${i.id}`,"stigg-plan-offering-container",{"stigg-current-plan":i.isCurrentCustomerPlan}),$isHighlighted:a,$isCurrentPlan:i.isCurrentCustomerPlan,children:[I,jsxRuntime.jsxs(AP,{className:"stigg-header-wrapper",children:[jsxRuntime.jsx(TP,{className:"stigg-plan-header",variant:"h3",children:i.displayName}),c&&jsxRuntime.jsx(wP,{className:"stigg-plan-description",variant:"h6",color:"secondary",children:i.description}),jsxRuntime.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?jsxRuntime.jsx(bm,{isNextPlan:k,customer:n,plan:i,currentSubscription:s,currentSubscriptionOverride:l,billingPeriod:r,isCustomerOnTrial:p,onPlanSelected:B,paywallLocale:m,withTrialLeftRow:o,perUnitQuantityByFeature:F}):jsxRuntime.jsx("div",{style:{height:CP}}),jsxRuntime.jsx(kP,{className:"stigg-plan-header-divider"})]}),jsxRuntime.jsx(lm,{plan:i,billingPeriod:r,paywallLocale:m}),jsxRuntime.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&&jsxRuntime.jsx(Ul,{addons:i.compatibleAddons,paywallLocale:m})})]})}var LP=y.div`
245
+ `;function FP({text:e="Next",iconsColor:t}){return jsxRuntime.jsx(IP,{children:jsxRuntime.jsxs(Se__default.default,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsx(EP,{$iconsColor:t}),jsxRuntime.jsx(P,{color:"primary",variant:"body1",children:e})]})})}function Lm({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===ah.PricingType.Custom,I=null;k?I=jsxRuntime.jsx(FP,{text:"Next plan"}):a&&m.highlightChip&&(I=jsxRuntime.jsx(_P,{className:"stigg-highlight-badge",children:jsxRuntime.jsx(AP,{className:"stigg-highlight-badge-text",color:"white",bold:true,children:m.highlightChip})}));let[F,E]=Fc.useState(Mr({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 jsxRuntime.jsxs(SP,{className:sP__default.default(`stigg-${i.id}`,"stigg-plan-offering-container",{"stigg-current-plan":i.isCurrentCustomerPlan}),$isHighlighted:a,$isCurrentPlan:i.isCurrentCustomerPlan,children:[I,jsxRuntime.jsxs(MP,{className:"stigg-header-wrapper",children:[jsxRuntime.jsx(kP,{className:"stigg-plan-header",variant:"h3",children:i.displayName}),c&&jsxRuntime.jsx(vP,{className:"stigg-plan-description",variant:"h6",color:"secondary",children:i.description}),jsxRuntime.jsx(Em,{showStartingAt:_,withUnitPriceRow:e,withStartingAtRow:f,withTiersRow:t,plan:i,billingPeriod:r,paywallLocale:m,locale:g,hasAnnuallyPrice:u,hasMonthlyPrice:d,setPerUnitQuantityByFeature:E,perUnitQuantityByFeature:F}),M?jsxRuntime.jsx(Cm,{isNextPlan:k,customer:n,plan:i,currentSubscription:s,currentSubscriptionOverride:l,billingPeriod:r,isCustomerOnTrial:p,onPlanSelected:B,paywallLocale:m,withTrialLeftRow:o,perUnitQuantityByFeature:F}):jsxRuntime.jsx("div",{style:{height:PP}}),jsxRuntime.jsx(wP,{className:"stigg-plan-header-divider"})]}),jsxRuntime.jsx(cm,{plan:i,billingPeriod:r,paywallLocale:m}),jsxRuntime.jsx(TP,{$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&&jsxRuntime.jsx(Ol,{addons:i.compatibleAddons,paywallLocale:m})})]})}var BP=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 @@
252
252
  display: flex;
253
253
  align-items: center;
254
254
  justify-content: center;
255
- `,Lm=y(P)`
255
+ `,Bm=y(P)`
256
256
  margin: 0 8px;
257
- `,BP=y(FP__default.default)`
257
+ `,RP=y(LP__default.default)`
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 @@
265
265
  background: ${({theme:e})=>e.stigg.palette.switchHandle} !important;
266
266
  top: 0.5px !important;
267
267
  }
268
- `;function RP({discount:e,disabled:t}){return jsxRuntime.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===rh.BillingPeriod.Monthly;return jsxRuntime.jsxs(LP,{className:"stigg-period-picker-container",children:[jsxRuntime.jsx(Lm,{variant:"h6",className:"stigg-monthly-period-text",color:i?"primary":"disabled",children:"Monthly"}),jsxRuntime.jsx(BP,{className:"stigg-period-switch",uncheckedIcon:false,checkedIcon:false,height:16,width:33,onChange:r=>o(r?rh.BillingPeriod.Annually:rh.BillingPeriod.Monthly),checked:!i,borderRadius:10,handleDiameter:19}),jsxRuntime.jsx(Lm,{variant:"h6",className:"stigg-annual-period-text",color:i?"disabled":"primary",children:"Annual"}),e!==0&&jsxRuntime.jsx(RP,{discount:e,disabled:i})]})}function DP(e,t){if(!_r__default.default(e)&&!_r__default.default(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,rh.BillingPeriod.Monthly),i=Um(o,rh.BillingPeriod.Annually),r=DP(n,i);return r&&(t=Math.max(t,r)),t},0)}var NP=e=>jsxRuntime.jsxs("svg",A(S({width:135,height:16,viewBox:"0 0 135 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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)`
268
+ `;function DP({discount:e,disabled:t}){return jsxRuntime.jsxs(P,{variant:"h6",color:t?"disabled":"primary",className:"stigg-discount-rate-text",children:[e,"% off"]})}function Rm({discountRate:e,selectedBillingPeriod:t,onBillingPeriodChanged:o,availableBillingPeriods:n}){if(n.length<=1)return null;let i=t===ah.BillingPeriod.Monthly;return jsxRuntime.jsxs(BP,{className:"stigg-period-picker-container",children:[jsxRuntime.jsx(Bm,{variant:"h6",className:"stigg-monthly-period-text",color:i?"primary":"disabled",children:"Monthly"}),jsxRuntime.jsx(RP,{className:"stigg-period-switch",uncheckedIcon:false,checkedIcon:false,height:16,width:33,onChange:r=>o(r?ah.BillingPeriod.Annually:ah.BillingPeriod.Monthly),checked:!i,borderRadius:10,handleDiameter:19}),jsxRuntime.jsx(Bm,{variant:"h6",className:"stigg-annual-period-text",color:i?"disabled":"primary",children:"Annual"}),e!==0&&jsxRuntime.jsx(DP,{discount:e,disabled:i})]})}function NP(e,t){if(!Ar__default.default(e)&&!Ar__default.default(t)){let o=t/12;return Math.round((e-o)/e*100)}return null}function Om(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 zm(e){return e.reduce((t,o)=>{let n=Om(o,ah.BillingPeriod.Monthly),i=Om(o,ah.BillingPeriod.Annually),r=NP(n,i);return r&&(t=Math.max(t,r)),t},0)}var UP=e=>jsxRuntime.jsxs("svg",A(S({width:135,height:16,viewBox:"0 0 135 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"}),jsxRuntime.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"})]})),Vm=UP;var $l="stigg-watermark",zP=y(Vm)`
269
269
  * {
270
270
  fill: ${({theme:e})=>e.stigg.palette.text.secondary};
271
271
  }
272
- `,zP=y.div`
272
+ `,VP=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 jsxRuntime.jsx(zP,{$alignSelf:o,$smallScreenAlign:n,className:Vl,style:S({cursor:"pointer"},i),onClick:r,children:jsxRuntime.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!==rh.PricingType.Paid||$l(n,t)).filter(n=>!o||!o({plan:n}))}var WP=y.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 jsxRuntime.jsx(VP,{$alignSelf:o,$smallScreenAlign:n,className:$l,style:S({cursor:"pointer"},i),onClick:r,children:jsxRuntime.jsx(zP,{})})}function Hl(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function Wl(e,t){return e.some(o=>Hl(o,t))}function Hm(e,t,o){return e.filter(n=>n.pricingType!==ah.PricingType.Paid||Hl(n,t)).filter(n=>!o||!o({plan:n}))}var GP=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 @@
283
283
  flex-wrap: wrap;
284
284
  padding: 10px 0;
285
285
  gap: ${({theme:e})=>e.stigg.layout.planMargin};
286
- `,GP=y.div`
286
+ `,jP=y.div`
287
287
  display: flex;
288
288
  flex-direction: column;
289
289
  align-items: center;
@@ -291,17 +291,17 @@
291
291
  & * {
292
292
  box-sizing: border-box;
293
293
  }
294
- `,jP=y.div`
294
+ `,YP=y.div`
295
295
  display: flex;
296
296
  flex-direction: column;
297
297
  align-items: center;
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,rh.BillingPeriod.Monthly),T=Hl(e,rh.BillingPeriod.Annually),k=$m(e,i,u),w=Ac.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===rh.PricingType.Custom,_=Ac.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=Ac.useMemo(()=>k.some(E=>!!Mr(E,i,c,d,b).unit),[i,b,d,c,k]),I=Ac.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 jsxRuntime.jsx(GP,{className:"stigg-paywall-container",children:jsxRuntime.jsxs(jP,{className:"stigg-paywall-layout",children:[jsxRuntime.jsx(Bm,{onBillingPeriodChanged:r,selectedBillingPeriod:i,availableBillingPeriods:a,discountRate:f}),jsxRuntime.jsx(WP,{className:"stigg-paywall-plans-layout",children:k.map(E=>jsxRuntime.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))}),jsxRuntime.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=lodash.countBy(n),r=lodash.uniq(n),a;if(o&&r.includes(o))a=o;else if(t){let s=t.find(l=>l.status===rh.SubscriptionStatus.Active);s&&s.prices.length>0&&(a=s==null?void 0:s.prices[0].billingPeriod);}return a||(a=(i[rh.BillingPeriod.Monthly]||0)>(i[rh.BillingPeriod.Annually]||0)?rh.BillingPeriod.Monthly:rh.BillingPeriod.Annually),{defaultBillingPeriod:a,availableBillingPeriods:r}}function Ym(e){return rd__default.default.utc(e).diff(rd__default.default.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 rh.FontWeight.Normal:return "normal";case rh.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 rh.Alignment.Left:return "left";case rh.Alignment.Center:return "center";case rh.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===rh.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===rh.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===rh.SubscriptionScheduleType.Downgrade),x=m.find(({subscriptionScheduleType:v})=>v===rh.SubscriptionScheduleType.BillingPeriod),b=Hg__default.default(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__default.default(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__default.default(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__default.default.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=Ac.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]=Ac.useState(()=>({stigg:h!=null?h:rh__default.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 Ac.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.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]),Ac.useEffect(()=>{let v=k.stigg;i?v.setCustomerId(i,r,a):v.clearCustomer();},[i,r,a]),Ac.useEffect(()=>{w(v=>A(S({},v),{theme:s}));},[s]),jsxRuntime.jsx(Si.Provider,{value:k,children:jsxRuntime.jsx(ro.SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea",children:m})})};function D(e){let{optional:t}=e||{},o=Ac.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]=Ac.useState(rh.BillingPeriod.Annually),[d,u]=Ac.useState([]),[p,h]=Ac.useState(null),[m,g]=Ac.useState(true);Ac.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__default.default({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===rh.BillingPeriod.Monthly?"Switch to monthly billing":"Switch to annual billing",cancelScheduledUpdate:"Cancel"},price:{startingAtCaption:"Starts at",pricePeriod:o=>o===rh.BillingPeriod.Monthly?"/ month":"/ year",free:o=>({price:`${o==null?void 0:o.symbol}0`}),custom:"Custom",priceNotSet:"Price not set"}},e)}var cS=e=>jsxRuntime.jsx("svg",A(S({width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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`
298
+ `,Gm=({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=zm(e),x=e.some(E=>!!E.description),b=Wl(e,ah.BillingPeriod.Monthly),T=Wl(e,ah.BillingPeriod.Annually),k=Hm(e,i,u),w=Fc.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===ah.PricingType.Custom,_=Fc.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=Fc.useMemo(()=>k.some(E=>!!Ir(E,i,c,d,b).unit),[i,b,d,c,k]),I=Fc.useMemo(()=>!v&&k.some(E=>{let B=Mr({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 jsxRuntime.jsx(jP,{className:"stigg-paywall-container",children:jsxRuntime.jsxs(YP,{className:"stigg-paywall-layout",children:[jsxRuntime.jsx(Rm,{onBillingPeriodChanged:r,selectedBillingPeriod:i,availableBillingPeriods:a,discountRate:f}),jsxRuntime.jsx(GP,{className:"stigg-paywall-plans-layout",children:k.map(E=>jsxRuntime.jsx(Lm,{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))}),jsxRuntime.jsx(Jt,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:g})]})})};var jl=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 jl;function jm(e,t,o){let n=e.flatMap(s=>s.pricePoints).map(s=>s.billingPeriod),i=lodash.countBy(n),r=lodash.uniq(n),a;if(o&&r.includes(o))a=o;else if(t){let s=t.find(l=>l.status===ah.SubscriptionStatus.Active);s&&s.prices.length>0&&(a=s==null?void 0:s.prices[0].billingPeriod);}return a||(a=(i[ah.BillingPeriod.Monthly]||0)>(i[ah.BillingPeriod.Annually]||0)?ah.BillingPeriod.Monthly:ah.BillingPeriod.Annually),{defaultBillingPeriod:a,availableBillingPeriods:r}}function Zm(e){return fc__default.default.utc(e).diff(fc__default.default.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 Rr(e){if(!e)return "normal";switch(e){case ah.FontWeight.Normal:return "normal";case ah.FontWeight.Bold:return "bold";default:return "normal"}}function Si(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:Rr((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:Rr((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:Rr((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:Rr((d=e==null?void 0:e.body)==null?void 0:d.fontWeight)||o.body.fontWeight,semanticElement:o.body.semanticElement}}}function Zl(e){if(e)switch(e){case ah.Alignment.Left:return "left";case ah.Alignment.Center:return "center";case ah.Alignment.Right:return "right";default:return}}function Km(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:Si(n),customCss:o||void 0}}function qm(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:Si(i),layout:{ctaAlignment:Zl(o==null?void 0:o.alignment),headerAlignment:Zl(o==null?void 0:o.alignment),descriptionAlignment:Zl(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:Si(o,Br),customCss:n||void 0}}function JP(e){let t=true,o=(e==null?void 0:e.find(r=>r.status===ah.SubscriptionStatus.InTrial))||null,n=o==null?void 0:o.plan,i=o!=null&&o.trialEndDate?Zm(o.trialEndDate):void 0;return n||(t=false,o=(e==null?void 0:e.find(r=>r.status===ah.SubscriptionStatus.Active))||null,n=o==null?void 0:o.plan),{currentSubscription:o,currentPlan:n,isCustomerOnTrial:t,trialDaysLeft:i}}function oh(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}=JP(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===ah.SubscriptionScheduleType.Downgrade),x=m.find(({subscriptionScheduleType:v})=>v===ah.SubscriptionScheduleType.BillingPeriod),b=Gg__default.default(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:!Ar__default.default(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);Ar__default.default(v)||(b=b.map(_=>A(S({},_),{isLowerThanCurrentPlan:v>_.order})),t&&(b=b.filter(_=>_.order>=v)));}let T=r?qm(r):void 0;return {currentPlan:d,currentSubscription:c,currentSubscriptionOverride:h,isCustomerOnTrial:u,plans:b,paywallConfiguration:T}}var ih="7.26.0";var rh="@stigg/react-sdk";var Ti=Fc__default.default.createContext(null);Ti.displayName="StiggContext";var iS="en-US",rS=({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=rh,clientVersion:x=ih})=>{let b=Fc.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]=Fc.useState(()=>({stigg:h!=null?h:ah__default.default.initialize(A(S({},T),{lazyLoad:true})),locale:l||iS,isInitialized:false,theme:s,refreshData:()=>R(null,null,function*(){w(v=>A(S({},v),{customerPortalUpdatedAt:new Date})),yield k.stigg.refresh();})}));return Fc.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=ah__default.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]),Fc.useEffect(()=>{let v=k.stigg;i?v.setCustomerId(i,r,a):v.clearCustomer();},[i,r,a]),Fc.useEffect(()=>{w(v=>A(S({},v),{theme:s}));},[s]),jsxRuntime.jsx(Ti.Provider,{value:k,children:jsxRuntime.jsx(ro.SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea",children:m})})};function D(e){let{optional:t}=e||{},o=Fc.useContext(Ti);if(!o&&!t)throw new Error("Could not find Stigg context; You need to wrap your app in an <StiggProvider> component.");return o}function lh({productId:e,resourceId:t,showOnlyEligiblePlans:o,billingCountryCode:n,preferredBillingPeriod:i,currentSubscriptionOverrideFn:r}){let{stigg:a,locale:s}=D(),[l,c]=Fc.useState(ah.BillingPeriod.Annually),[d,u]=Fc.useState([]),[p,h]=Fc.useState(null),[m,g]=Fc.useState(true);Fc.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}=jm(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=oh(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 dh(e){return f2__default.default({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===ah.BillingPeriod.Monthly?"Switch to monthly billing":"Switch to annual billing",cancelScheduledUpdate:"Cancel"},price:{startingAtCaption:"Starts at",pricePeriod:o=>o===ah.BillingPeriod.Monthly?"/ month":"/ year",free:o=>({price:`${o==null?void 0:o.symbol}0`}),custom:"Custom",priceNotSet:"Price not set"}},e)}var dS=e=>jsxRuntime.jsx("svg",A(S({width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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"})})),ph=dS;var uS=y.div`
299
299
  display: flex;
300
300
  flex-direction: column;
301
301
  align-items: center;
302
- `,Xl=y(uh)`
302
+ `,Kl=y(ph)`
303
303
  margin-right: 16px;
304
- `,uS=y.div`
304
+ `,pS=y.div`
305
305
  display: flex;
306
306
  flex-direction: column;
307
307
  align-items: flex-start;
@@ -313,25 +313,25 @@
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
- `,pS=y.div`
316
+ `,mS=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
- `,Kl=y.div`
321
+ `,ql=y.div`
322
322
  display: flex;
323
323
  align-items: center;
324
324
  margin-bottom: 12px;
325
- `,mS=y.div`
326
- margin-top: auto;
327
325
  `,hS=y.div`
326
+ margin-top: auto;
327
+ `,gS=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 gS(){return jsxRuntime.jsxs(uS,{children:[jsxRuntime.jsx(ro__default.default,{width:120,borderRadius:4}),jsxRuntime.jsx(ro__default.default,{circle:true,width:40,height:40}),jsxRuntime.jsx(ro__default.default,{style:{marginBottom:33},width:120,borderRadius:4}),jsxRuntime.jsxs(Kl,{children:[jsxRuntime.jsx(Xl,{}),jsxRuntime.jsx(ro__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(Kl,{children:[jsxRuntime.jsx(Xl,{}),jsxRuntime.jsx(ro__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(Kl,{children:[jsxRuntime.jsx(Xl,{}),jsxRuntime.jsx(ro__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsx(mS,{children:jsxRuntime.jsx(ro__default.default,{height:50,borderRadius:4})})]})}function ph({skeletonPlanCount:e=3}){return jsxRuntime.jsxs(dS,{className:"stigg-skeleton-loader-container",children:[jsxRuntime.jsx(hS,{className:"stigg-skeleton-loader-billing-period",children:jsxRuntime.jsx(ro__default.default,{borderRadius:4})}),jsxRuntime.jsx(pS,{className:"stigg-skeleton-loader-plans-container",children:Array.from({length:e}).map((t,o)=>jsxRuntime.jsx(gS,{},o))})]})}var mh=({externalFontUrl:e})=>jsxRuntime.jsx(react.Global,{styles:react.css`
334
+ `;function fS(){return jsxRuntime.jsxs(pS,{children:[jsxRuntime.jsx(ro__default.default,{width:120,borderRadius:4}),jsxRuntime.jsx(ro__default.default,{circle:true,width:40,height:40}),jsxRuntime.jsx(ro__default.default,{style:{marginBottom:33},width:120,borderRadius:4}),jsxRuntime.jsxs(ql,{children:[jsxRuntime.jsx(Kl,{}),jsxRuntime.jsx(ro__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(ql,{children:[jsxRuntime.jsx(Kl,{}),jsxRuntime.jsx(ro__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsxs(ql,{children:[jsxRuntime.jsx(Kl,{}),jsxRuntime.jsx(ro__default.default,{width:120,borderRadius:4})]}),jsxRuntime.jsx(hS,{children:jsxRuntime.jsx(ro__default.default,{height:50,borderRadius:4})})]})}function mh({skeletonPlanCount:e=3}){return jsxRuntime.jsxs(uS,{className:"stigg-skeleton-loader-container",children:[jsxRuntime.jsx(gS,{className:"stigg-skeleton-loader-billing-period",children:jsxRuntime.jsx(ro__default.default,{borderRadius:4})}),jsxRuntime.jsx(mS,{className:"stigg-skeleton-loader-plans-container",children:Array.from({length:e}).map((t,o)=>jsxRuntime.jsx(fS,{},o))})]})}var hh=({externalFontUrl:e})=>jsxRuntime.jsx(react.Global,{styles:react.css`
335
335
  ${e&&`
336
336
  @font-face {
337
337
  font-family: 'custom-font';
@@ -401,11 +401,11 @@
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 wS=y.div`
404
+ `});var vS=y.div`
405
405
  ${({$customCss:e})=>e&&react.css`
406
406
  ${e}
407
407
  `}
408
- `;function Vo(e){let{theme:t}=D(),o=g2__default.default(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=styles.createTheme({palette:n,stigg:o});return jsxRuntime.jsx(styles.ThemeProvider,{theme:{[styles.THEME_ID]:i},children:jsxRuntime.jsx(react.ThemeProvider,{theme:{stigg:o},children:jsxRuntime.jsxs(wS,{$customCss:o.customCss,children:[jsxRuntime.jsx(mh,{externalFontUrl:o.typography.fontFamilyUrl}),e]})})})};var St=Ac__default.default.createContext(null);St.displayName="CustomerPortalContext";var ut=()=>{let e=Ac.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 !!Ac.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?jsxRuntime.jsx(ph,{skeletonPlanCount:h}):jsxRuntime.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:jsxRuntime.jsx(ht,{componentTheme:F,children:U})};function yh({resourceId:e,productId:t}){let{stigg:o,customerPortalUpdatedAt:n}=D(),[i,r]=Ac.useState(false),[a,s]=Ac.useState();return Ac.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__default.default({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 jsxRuntime.jsx(ht,{componentTheme:c,children:jsxRuntime.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__default.default)`
408
+ `;function Vo(e){let{theme:t}=D(),o=f2__default.default(e,t);return dm(o)}var _S=e=>({primary:{main:e.palette.primary}}),ht=({children:e,componentTheme:t})=>{let o=Vo(t),n=_S(o),i=styles.createTheme({palette:n,stigg:o});return jsxRuntime.jsx(styles.ThemeProvider,{theme:{[styles.THEME_ID]:i},children:jsxRuntime.jsx(react.ThemeProvider,{theme:{stigg:o},children:jsxRuntime.jsxs(vS,{$customCss:o.customCss,children:[jsxRuntime.jsx(hh,{externalFontUrl:o.typography.fontFamilyUrl}),e]})})})};var St=Fc__default.default.createContext(null);St.displayName="CustomerPortalContext";var ut=()=>{let e=Fc.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 !!Fc.useContext(e)}var fh=({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}=lh({productId:e,resourceId:t,showOnlyEligiblePlans:n,billingCountryCode:l,preferredBillingPeriod:a,currentSubscriptionOverrideFn:u}),B=dh(i),U=!f||w||g?jsxRuntime.jsx(mh,{skeletonPlanCount:h}):jsxRuntime.jsx(Gm,{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:jsxRuntime.jsx(ht,{componentTheme:F,children:U})};function xh({resourceId:e,productId:t}){let{stigg:o,customerPortalUpdatedAt:n}=D(),[i,r]=Fc.useState(false),[a,s]=Fc.useState();return Fc.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 bh(e){return f2__default.default({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 Ch(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 Nr({children:e,textOverrides:t,theme:o,resourceId:n,productId:i}){let{customerPortalUpdatedAt:r}=D(),{customerPortal:a,isLoading:s,showWatermark:l}=xh({resourceId:n,productId:i}),c=a!=null&&a.configuration?Km(a.configuration):void 0,d=Vo(c),u=Ch(d,o,a==null?void 0:a.configuration),p=bh(t);return jsxRuntime.jsx(ht,{componentTheme:c,children:jsxRuntime.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(B2__default.default)`
409
409
  border-radius: 10px;
410
410
  padding: 8px 16px;
411
411
  text-transform: none;
@@ -414,7 +414,7 @@
414
414
  &:hover {
415
415
  border-color: ${({theme:e})=>e.stigg.palette.outlinedRestingBorder};
416
416
  }
417
- `;var FS=e=>jsxRuntime.jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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`
417
+ `;var LS=e=>jsxRuntime.jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.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"})})),Th=LS;var Ce=y.div`
418
418
  display: flex;
419
419
  align-items: center;
420
420
  justify-content: space-between;
@@ -424,11 +424,11 @@
424
424
  margin-bottom: 32px;
425
425
  }
426
426
  `};
427
- `;function Pe({title:e,className:t,isLoading:o}){let{theme:n}=ut();return o?jsxRuntime.jsx(ro__default.default,{width:120}):jsxRuntime.jsx(P,{className:t,overrideColor:n.sectionTitleColor,variant:"h3",bold:true,children:e})}var BS=y(Sh)`
427
+ `;function Pe({title:e,className:t,isLoading:o}){let{theme:n}=ut();return o?jsxRuntime.jsx(ro__default.default,{width:120}):jsxRuntime.jsx(P,{className:t,overrideColor:n.sectionTitleColor,variant:"h3",bold:true,children:e})}var RS=y(Th)`
428
428
  path {
429
429
  stroke: ${({theme:e})=>e.stigg.palette.primary};
430
430
  }
431
- `;function vh({onManageSubscription:e,hideManageButton:t,textOverrides:o}){return jsxRuntime.jsxs(Ce,{className:"stigg-customer-portal-overview-header",$disableMargin:true,children:[jsxRuntime.jsx(Pe,{title:"Subscription",className:"stigg-overview-title"}),!t&&jsxRuntime.jsxs(ao,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:()=>e({intentionType:"MANAGE_SUBSCRIPTION"}),children:[jsxRuntime.jsx(BS,{className:"stigg-manage-subscription-button-image"}),jsxRuntime.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__default.default(e==null?void 0:e.subscriptions,o=>o.addons);return DS__default.default(t)?null:jsxRuntime.jsx("div",{className:"stigg-addons-list-layout",children:t.map((o,n)=>jsxRuntime.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`
431
+ `;function _h({onManageSubscription:e,hideManageButton:t,textOverrides:o}){return jsxRuntime.jsxs(Ce,{className:"stigg-customer-portal-overview-header",$disableMargin:true,children:[jsxRuntime.jsx(Pe,{title:"Subscription",className:"stigg-overview-title"}),!t&&jsxRuntime.jsxs(ao,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:()=>e({intentionType:"MANAGE_SUBSCRIPTION"}),children:[jsxRuntime.jsx(RS,{className:"stigg-manage-subscription-button-image"}),jsxRuntime.jsx(P,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1",children:o==null?void 0:o.manageSubscription})]})]})}function Ur(){let{customerPortal:e}=ut(),t=DS__default.default(e==null?void 0:e.subscriptions,o=>o.addons);return NS__default.default(t)?null:jsxRuntime.jsx("div",{className:"stigg-addons-list-layout",children:t.map((o,n)=>jsxRuntime.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 Ah=y.div`
432
432
  display: flex;
433
433
  justify-content: space-between;
434
434
  align-items: center;
@@ -439,15 +439,15 @@
439
439
  & > *:first-of-type {
440
440
  max-width: 60%;
441
441
  }
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 jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsx(P,{color:"secondary",children:t.promotionsSubtitle}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsxs(_h,{$borderColor:o.borderColor,children:[jsxRuntime.jsx(P,{variant:"body1",bold:true,children:"Feature"}),jsxRuntime.jsx(P,{variant:"body1",bold:true,children:"Expiration date"})]}),n==null?void 0:n.map((i,r)=>jsxRuntime.jsxs(_h,{$borderColor:o.borderColor,children:[jsxRuntime.jsx(P,{variant:"body1",children:zS(i)}),jsxRuntime.jsx(P,{variant:"body1",color:"disabled",children:i.endDate?rd__default.default.utc(i.endDate).format("MMM Do, YYYY"):"None"})]},`${i.displayName}-${r}`))]})]})}var Ah=y($S__default.default)`
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 zr(){let{customerPortal:e,textOverrides:t,theme:o}=ut(),n=e==null?void 0:e.promotionalEntitlements;return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsx(P,{color:"secondary",children:t.promotionsSubtitle}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[jsxRuntime.jsxs(Ah,{$borderColor:o.borderColor,children:[jsxRuntime.jsx(P,{variant:"body1",bold:true,children:"Feature"}),jsxRuntime.jsx(P,{variant:"body1",bold:true,children:"Expiration date"})]}),n==null?void 0:n.map((i,r)=>jsxRuntime.jsxs(Ah,{$borderColor:o.borderColor,children:[jsxRuntime.jsx(P,{variant:"body1",children:VS(i)}),jsxRuntime.jsx(P,{variant:"body1",color:"disabled",children:i.endDate?fc__default.default.utc(i.endDate).format("MMM Do, YYYY"):"None"})]},`${i.displayName}-${r}`))]})]})}var Mh=y(HS__default.default)`
443
443
  .MuiTabs-indicator {
444
444
  background-color: #001e6c;
445
445
  }
446
- `,Mh=y.div`
446
+ `,Ih=y.div`
447
447
  width: 100%;
448
448
  flex: 1;
449
449
  margin-top: 16px;
450
- `,Ih=y(Na__default.default)`
450
+ `,Eh=y(Ua__default.default)`
451
451
  margin-top: 16px;
452
452
  max-height: ${({$maxHeight:e})=>e};
453
453
  overflow-y: auto;
@@ -460,28 +460,28 @@
460
460
  margin-bottom: 16px;
461
461
  row-gap: 16px;
462
462
  background-color: ${({$backgroundColor:e})=>e};
463
- `;function Fh(e){let a=e,{children:t,value:o,index:n,maxHeight:i}=a,r=ot(a,["children","value","index","maxHeight"]);return jsxRuntime.jsx("div",A(S({role:"tabpanel",hidden:o!==n},r),{children:o===n&&jsxRuntime.jsx(Ih,{$maxHeight:i,children:t})}))}function Lh({isSelected:e,label:t,icon:o}){let n=e?"primary":"secondary";return jsxRuntime.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[jsxRuntime.jsx(mt,{icon:o,svgStrokeColor:n}),jsxRuntime.jsx(P,{variant:"h6",bold:e,color:n,children:t})]})}function Bh({customerPortal:e,hiddenSections:t,textOverrides:o,theme:n}){let i=RS__default.default(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]=Ac.useState(a?1:2),d=(p,h)=>{c(h);};return a||s?jsxRuntime.jsxs(Mh,{children:[jsxRuntime.jsx(Na__default.default,{sx:{borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(Ah,{value:l,onChange:d,children:[a?jsxRuntime.jsx(Eh__default.default,{sx:{textTransform:"none"},value:1,label:jsxRuntime.jsx(Lh,{isSelected:l===1,label:o.addonsTabTitle,icon:"Addons"})}):null,s?jsxRuntime.jsx(Eh__default.default,{sx:{textTransform:"none"},value:2,label:jsxRuntime.jsx(Lh,{isSelected:l===2,label:o.promotionsTabTitle,icon:"Promotions"})}):null]})}),jsxRuntime.jsx(Fh,{value:l,index:1,maxHeight:n.tabMaxHeight,children:jsxRuntime.jsx(Nr,{})}),jsxRuntime.jsx(Fh,{value:l,index:2,maxHeight:n.tabMaxHeight,children:jsxRuntime.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 material.useMediaQuery(ec(e))}var YS=y.div`
463
+ `;function Lh(e){let a=e,{children:t,value:o,index:n,maxHeight:i}=a,r=ot(a,["children","value","index","maxHeight"]);return jsxRuntime.jsx("div",A(S({role:"tabpanel",hidden:o!==n},r),{children:o===n&&jsxRuntime.jsx(Eh,{$maxHeight:i,children:t})}))}function Bh({isSelected:e,label:t,icon:o}){let n=e?"primary":"secondary";return jsxRuntime.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[jsxRuntime.jsx(mt,{icon:o,svgStrokeColor:n}),jsxRuntime.jsx(P,{variant:"h6",bold:e,color:n,children:t})]})}function Rh({customerPortal:e,hiddenSections:t,textOverrides:o,theme:n}){let i=DS__default.default(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]=Fc.useState(a?1:2),d=(p,h)=>{c(h);};return a||s?jsxRuntime.jsxs(Ih,{children:[jsxRuntime.jsx(Ua__default.default,{sx:{borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(Mh,{value:l,onChange:d,children:[a?jsxRuntime.jsx(Fh__default.default,{sx:{textTransform:"none"},value:1,label:jsxRuntime.jsx(Bh,{isSelected:l===1,label:o.addonsTabTitle,icon:"Addons"})}):null,s?jsxRuntime.jsx(Fh__default.default,{sx:{textTransform:"none"},value:2,label:jsxRuntime.jsx(Bh,{isSelected:l===2,label:o.promotionsTabTitle,icon:"Promotions"})}):null]})}),jsxRuntime.jsx(Lh,{value:l,index:1,maxHeight:n.tabMaxHeight,children:jsxRuntime.jsx(Ur,{})}),jsxRuntime.jsx(Lh,{value:l,index:2,maxHeight:n.tabMaxHeight,children:jsxRuntime.jsx(zr,{})})]}):null}var Dh={xs:320,sm:640,md:768,lg:1024,xl:1280,xxl:1536},oc=e=>`(min-width: ${Dh[e]}px)`,wt=Object.keys(Dh).reduce((e,t)=>A(S({},e),{[t]:`@media ${oc(t)}`}),{});function Dt(e){return material.useMediaQuery(oc(e))}var ZS=y.div`
464
464
  display: flex;
465
465
  justify-content: space-between;
466
466
  flex-wrap: wrap;
467
- `,ZS=y.div`
467
+ `,XS=y.div`
468
468
  display: flex;
469
469
  flex-direction: column;
470
470
  gap: 32px;
471
- `;function Nh(){let e=Dt("md");return jsxRuntime.jsxs(YS,{className:"stigg-subscription-overview-skeleton-layout",children:[jsxRuntime.jsxs(ZS,{children:[jsxRuntime.jsx(ro__default.default,{width:120}),jsxRuntime.jsx(ro__default.default,{width:120})]}),jsxRuntime.jsx(ro__default.default,{width:e?295:260,height:193})]})}function KS({scheduleUpdate:e}){let{targetPackage:t}=e;return jsxRuntime.jsxs(Se__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsxs(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Downgrade to the ",jsxRuntime.jsx("b",{children:t==null?void 0:t.displayName})," plan"]})})]})}function qS({scheduleUpdate:e}){let{scheduleVariables:t}=e,{billingPeriod:o}=t,n=o===rh.BillingPeriod.Monthly?"annually":"monthly",i=o===rh.BillingPeriod.Monthly?"monthly":"annually";return jsxRuntime.jsxs(Se__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsxs(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Change from an ",n," to a ",jsxRuntime.jsx("b",{children:i})," billing cycle"]})})]})}function QS({subscription:e,scheduleUpdate:t}){let{scheduleVariables:o}=t,{newUnitAmount:n,featureId:i}=o,a=lodash.compact(e.prices.map(({feature:d})=>d)).find(d=>d.id===i);if(!a)return null;let{featureUnits:s,featureUnitsPlural:l}=a;return jsxRuntime.jsxs(Se__default.default,{container:true,alignItems:"flex-start",flexWrap:"nowrap",children:[jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsxs(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Reduce the ",jsxRuntime.jsx("b",{children:s})," quantity to ",n," ",n===1?s:l]})})]})}function Oh({scheduleUpdate:e,subscription:t}){switch(e.subscriptionScheduleType){case rh.SubscriptionScheduleType.Downgrade:return jsxRuntime.jsx(KS,{scheduleUpdate:e});case rh.SubscriptionScheduleType.BillingPeriod:return jsxRuntime.jsx(qS,{scheduleUpdate:e});case rh.SubscriptionScheduleType.UnitAmount:return jsxRuntime.jsx(QS,{scheduleUpdate:e,subscription:t});default:return null}}var nT=y(Na__default.default)`
471
+ `;function Uh(){let e=Dt("md");return jsxRuntime.jsxs(ZS,{className:"stigg-subscription-overview-skeleton-layout",children:[jsxRuntime.jsxs(XS,{children:[jsxRuntime.jsx(ro__default.default,{width:120}),jsxRuntime.jsx(ro__default.default,{width:120})]}),jsxRuntime.jsx(ro__default.default,{width:e?295:260,height:193})]})}function qS({scheduleUpdate:e}){let{targetPackage:t}=e;return jsxRuntime.jsxs(Se__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsxs(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Downgrade to the ",jsxRuntime.jsx("b",{children:t==null?void 0:t.displayName})," plan"]})})]})}function QS({scheduleUpdate:e}){let{scheduleVariables:t}=e,{billingPeriod:o}=t,n=o===ah.BillingPeriod.Monthly?"annually":"monthly",i=o===ah.BillingPeriod.Monthly?"monthly":"annually";return jsxRuntime.jsxs(Se__default.default,{container:true,alignItems:"center",children:[jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsxs(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Change from an ",n," to a ",jsxRuntime.jsx("b",{children:i})," billing cycle"]})})]})}function JS({subscription:e,scheduleUpdate:t}){let{scheduleVariables:o}=t,{newUnitAmount:n,featureId:i}=o,a=lodash.compact(e.prices.map(({feature:d})=>d)).find(d=>d.id===i);if(!a)return null;let{featureUnits:s,featureUnitsPlural:l}=a;return jsxRuntime.jsxs(Se__default.default,{container:true,alignItems:"flex-start",flexWrap:"nowrap",children:[jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(reactFeather.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsxs(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:["Reduce the ",jsxRuntime.jsx("b",{children:s})," quantity to ",n," ",n===1?s:l]})})]})}function zh({scheduleUpdate:e,subscription:t}){switch(e.subscriptionScheduleType){case ah.SubscriptionScheduleType.Downgrade:return jsxRuntime.jsx(qS,{scheduleUpdate:e});case ah.SubscriptionScheduleType.BillingPeriod:return jsxRuntime.jsx(QS,{scheduleUpdate:e});case ah.SubscriptionScheduleType.UnitAmount:return jsxRuntime.jsx(JS,{scheduleUpdate:e,subscription:t});default:return null}}var iT=y(Ua__default.default)`
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
- `,iT=y(P2__default.default)`
477
+ `,rT=y(S2__default.default)`
478
478
  margin-left: 4px;
479
- `,rT=y(Sr)`
479
+ `,aT=y(Tr)`
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 aT({subscription:e}){let{scheduledUpdates:t}=e;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Se__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:"The following updates will take effect in the next billing cycle:"})})}),jsxRuntime.jsx(Se__default.default,{children:(t||[]).map(o=>jsxRuntime.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 jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Se__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(P,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary",children:n})})}),i&&jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.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=react.useTheme(),[r,a]=Ac.useState(false),{scheduledUpdates:s}=e;if(!s||s.length===0)return null;let l=s.length===1;return jsxRuntime.jsx(nT,{$borderColor:o.borderColor,className:"stigg-scheduled-updates-alert-container",children:jsxRuntime.jsxs(Se__default.default,{container:true,alignItems:l?"center":"flex-start",gap:2,children:[jsxRuntime.jsx(Se__default.default,{item:true,display:"flex",children:jsxRuntime.jsx(mt,{icon:"ScheduleBox",svgPathColor:o.iconsColor,svgRectColor:o.iconsBackgroundColor})}),jsxRuntime.jsx(Se__default.default,{item:true,flex:1,children:l?jsxRuntime.jsx(sT,{subscription:e}):jsxRuntime.jsx(aT,{subscription:e})}),!!t&&jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsxs(ao,{variant:"outlined",onClick:()=>{a(true),Promise.resolve(t(e)).finally(()=>a(false));},children:[r?jsxRuntime.jsx(iT,{loading:true,size:16,color:i.stigg.palette.text.disabled}):jsxRuntime.jsx(rT,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),jsxRuntime.jsx(P,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button",children:n})]})})]})})}var Te=y.div`
484
+ `;function sT({subscription:e}){let{scheduledUpdates:t}=e;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Se__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(P,{className:"stigg-scheduled-updates-description",variant:"body1",children:"The following updates will take effect in the next billing cycle:"})})}),jsxRuntime.jsx(Se__default.default,{children:(t||[]).map(o=>jsxRuntime.jsx(zh,{scheduleUpdate:o,subscription:e},o.subscriptionScheduleType))})]})}function lT({subscription:e}){let{scheduledUpdates:t}=e,[o]=t||[],{line1:n,line2:i}=_r({scheduledUpdate:o,subscriptionPrices:e.prices,billingPeriodRange:e.billingPeriodRange,options:{postfix:"at the end of the current billing period"}});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Se__default.default,{container:true,alignItems:"center",justifyContent:"space-between",gap:1,children:jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(P,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary",children:n})})}),i&&jsxRuntime.jsx(Se__default.default,{children:jsxRuntime.jsx(P,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary",children:i})})]})}function Vh({subscription:e,onCancelScheduledUpdates:t,theme:o,cancelScheduledUpdatesButtonTitle:n}){let i=react.useTheme(),[r,a]=Fc.useState(false),{scheduledUpdates:s}=e;if(!s||s.length===0)return null;let l=s.length===1;return jsxRuntime.jsx(iT,{$borderColor:o.borderColor,className:"stigg-scheduled-updates-alert-container",children:jsxRuntime.jsxs(Se__default.default,{container:true,alignItems:l?"center":"flex-start",gap:2,children:[jsxRuntime.jsx(Se__default.default,{item:true,display:"flex",children:jsxRuntime.jsx(mt,{icon:"ScheduleBox",svgPathColor:o.iconsColor,svgRectColor:o.iconsBackgroundColor})}),jsxRuntime.jsx(Se__default.default,{item:true,flex:1,children:l?jsxRuntime.jsx(lT,{subscription:e}):jsxRuntime.jsx(sT,{subscription:e})}),!!t&&jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsxs(ao,{variant:"outlined",onClick:()=>{a(true),Promise.resolve(t(e)).finally(()=>a(false));},children:[r?jsxRuntime.jsx(rT,{loading:true,size:16,color:i.stigg.palette.text.disabled}):jsxRuntime.jsx(aT,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),jsxRuntime.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 @@
499
499
  ${wt.lg} {
500
500
  padding: 64px;
501
501
  }
502
- `;function Hh({billingPeriod:e,rangeEnd:t,amount:o,currency:n}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P,{variant:"h6",children:"Next estimated bill"}),jsxRuntime.jsx(P,{variant:"h1",children:at({amount:o,currency:n,maximumFractionDigits:2})}),jsxRuntime.jsxs(P,{as:"div",variant:"body1",color:"secondary",children:["Billed ",e===rh.BillingPeriod.Monthly?"monthly":"annually"," on"," ",jsxRuntime.jsx(P,{variant:"body1",as:"span",color:"primary",children:rd__default.default.utc(t).format("MMM Do, YYYY")})]}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:"* Additional tax rates may apply"})]})}function $r({description:e}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"secondary",children:"No upcoming bill"}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:e})]})}var hT=y.div`
502
+ `;function Wh({billingPeriod:e,rangeEnd:t,amount:o,currency:n}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P,{variant:"h6",children:"Next estimated bill"}),jsxRuntime.jsx(P,{variant:"h1",children:at({amount:o,currency:n,maximumFractionDigits:2})}),jsxRuntime.jsxs(P,{as:"div",variant:"body1",color:"secondary",children:["Billed ",e===ah.BillingPeriod.Monthly?"monthly":"annually"," on"," ",jsxRuntime.jsx(P,{variant:"body1",as:"span",color:"primary",children:fc__default.default.utc(t).format("MMM Do, YYYY")})]}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:"* Additional tax rates may apply"})]})}function Hr({description:e}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"secondary",children:"No upcoming bill"}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:e})]})}var gT=y.div`
503
503
  display: flex;
504
504
  flex-direction: column;
505
505
  align-items: left;
506
506
  gap: 8px;
507
- `,gT=y(L2__default.default)`
507
+ `,fT=y(B2__default.default)`
508
508
  width: fit-content;
509
509
  &.MuiButton-root {
510
510
  padding: 0;
@@ -512,7 +512,7 @@
512
512
  background: none;
513
513
  }
514
514
  }
515
- `;function Gh({onContactSupport:e,label:t,linkLabel:o}){let n=jsxRuntime.jsx(P,{color:e?"primary.main":"secondary",children:o});return jsxRuntime.jsxs(hT,{className:"stigg-contact-support-layout",children:[jsxRuntime.jsx(P,{className:"stigg-contact-support-label",color:"secondary",children:t}),e?jsxRuntime.jsx(gT,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:e,children:n}):n]})}var CT=y.div`
515
+ `;function jh({onContactSupport:e,label:t,linkLabel:o}){let n=jsxRuntime.jsx(P,{color:e?"primary.main":"secondary",children:o});return jsxRuntime.jsxs(gT,{className:"stigg-contact-support-layout",children:[jsxRuntime.jsx(P,{className:"stigg-contact-support-label",color:"secondary",children:t}),e?jsxRuntime.jsx(fT,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:e,children:n}):n]})}var PT=y.div`
516
516
  max-height: 278px;
517
517
  display: flex;
518
518
  flex-direction: column;
@@ -521,7 +521,7 @@
521
521
  border: ${({$borderColor:e})=>`1px solid ${e}`};
522
522
  padding: 32px;
523
523
  gap: 16px;
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!==rh.BillingModel.UsageBased))!=null?c:true,s=(d=e.scheduledUpdates)==null?void 0:d.find(({subscriptionScheduleType:g,targetPackage:f})=>g===rh.SubscriptionScheduleType.Downgrade&&(f==null?void 0:f.pricingType)===rh.PricingType.Free);if(i===rh.PricingType.Free)r=jsxRuntime.jsx($r,{description:"You're on a free plan, so you don\u2019t have any upcoming charges"});else if(i===rh.PricingType.Paid)if(s&&a)r=jsxRuntime.jsx($r,{description:"Your plan will be downgraded to a free plan, so you don\u2019t have any upcoming charges"});else if(e.status===rh.SubscriptionStatus.InTrial)r=jsxRuntime.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=jsxRuntime.jsx(Hh,{billingPeriod:g,rangeEnd:f,amount:x.amount,currency:x.currency}));}else i===rh.PricingType.Custom&&(r=jsxRuntime.jsx(Gh,{onContactSupport:n,label:o.contactSupportTitle,linkLabel:o.contactSupportLink}));return jsxRuntime.jsx(CT,{className:"stigg-subscription-total-price-layout",$borderColor:t.borderColor,children:r})}var PT=e=>jsxRuntime.jsxs("svg",A(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.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"}),jsxRuntime.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 jsxRuntime.jsx(TT__default.default,A(S({arrow:true,placement:o},n),{classes:{popper:t,tooltip:"stigg-tooltip",arrow:"stigg-tooltip-arrow"},children:jsxRuntime.jsx("div",{children:e})}))})(({theme:e,$padding:t=8,$maxWidth:o=300})=>({[`& .${TT.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},[`& .${TT.tooltipClasses.arrow}`]:{color:e.stigg.palette.white}}));var _T=y(P)`
524
+ `;function Yh({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!==ah.BillingModel.UsageBased))!=null?c:true,s=(d=e.scheduledUpdates)==null?void 0:d.find(({subscriptionScheduleType:g,targetPackage:f})=>g===ah.SubscriptionScheduleType.Downgrade&&(f==null?void 0:f.pricingType)===ah.PricingType.Free);if(i===ah.PricingType.Free)r=jsxRuntime.jsx(Hr,{description:"You're on a free plan, so you don\u2019t have any upcoming charges"});else if(i===ah.PricingType.Paid)if(s&&a)r=jsxRuntime.jsx(Hr,{description:"Your plan will be downgraded to a free plan, so you don\u2019t have any upcoming charges"});else if(e.status===ah.SubscriptionStatus.InTrial)r=jsxRuntime.jsx(Hr,{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=jsxRuntime.jsx(Wh,{billingPeriod:g,rangeEnd:f,amount:x.amount,currency:x.currency}));}else i===ah.PricingType.Custom&&(r=jsxRuntime.jsx(jh,{onContactSupport:n,label:o.contactSupportTitle,linkLabel:o.contactSupportLink}));return jsxRuntime.jsx(PT,{className:"stigg-subscription-total-price-layout",$borderColor:t.borderColor,children:r})}var ST=e=>jsxRuntime.jsxs("svg",A(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[jsxRuntime.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"}),jsxRuntime.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"})]})),Xh=ST;var Be=y(i=>{var r=i,{children:e,className:t,placement:o="top"}=r,n=ot(r,["children","className","placement"]);return jsxRuntime.jsx(kT__default.default,A(S({arrow:true,placement:o},n),{classes:{popper:t,tooltip:"stigg-tooltip",arrow:"stigg-tooltip-arrow"},children:jsxRuntime.jsx("div",{children:e})}))})(({theme:e,$padding:t=8,$maxWidth:o=300})=>({[`& .${kT.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},[`& .${kT.tooltipClasses.arrow}`]:{color:e.stigg.palette.white}}));var AT=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 @@
535
535
  ${({$bold:e})=>e&&react.css`
536
536
  font-weight: bold;
537
537
  `}
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]=Ac.useState(false),m=Ac.useRef(null),g=jsxRuntime.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});Ac.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 jsxRuntime.jsx("span",{children:p||f?jsxRuntime.jsx(Be,{placement:s,leaveDelay:e,title:jsxRuntime.jsx(P,{variant:"body1",children:t}),children:g}):g})};var IT=y.div`
538
+ `;function Jh(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]=Fc.useState(false),m=Fc.useRef(null),g=jsxRuntime.jsx(AT,{ref:m,variant:o,color:n,$maxLines:i,$wordBreak:r,$bold:a,className:l,$display:c,style:d,"data-testid":u,children:t});Fc.useEffect(()=>{if(m!=null&&m.current){let x=Jh(m.current);h(x);}},[m]);let f=(m==null?void 0:m.current)&&Jh(m.current);return jsxRuntime.jsx("span",{children:p||f?jsxRuntime.jsx(Be,{placement:s,leaveDelay:e,title:jsxRuntime.jsx(P,{variant:"body1",children:t}),children:g}):g})};var ET=y.div`
539
539
  width: 100%;
540
540
  display: flex;
541
541
  align-items: center;
@@ -544,48 +544,48 @@
544
544
  border-radius: 10px;
545
545
  padding: 8px 16px;
546
546
  margin-top: 16px;
547
- `,ET=y(MT__default.default)`
547
+ `,FT=y(IT__default.default)`
548
548
  text-decoration-color: white;
549
549
  color: white;
550
550
  cursor: pointer;
551
- `;function tg({subscription:e,includePlanName:t,onManageSubscription:o}){return (e==null?void 0:e.status)!==rh.SubscriptionStatus.InTrial?null:jsxRuntime.jsxs(IT,{className:"stigg-subscription-trial-badge",children:[jsxRuntime.jsx(Zh,{className:"stigg-subscription-trial-badge-image"}),jsxRuntime.jsx("div",{style:{flex:1,marginRight:4},children:jsxRuntime.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`]})}),jsxRuntime.jsx(ET,{className:"stigg-subscription-trial-upgrade-button",onClick:()=>o({intentionType:"UPGRADE_TRIAL_PLAN"}),children:jsxRuntime.jsx(P,{color:"white",children:"Upgrade plan"})})]})}function og({mainSubscription:e,trialSubscription:t,onManageSubscription:o,theme:n}){return jsxRuntime.jsxs("div",{className:"stigg-subscription-view-layout",children:[jsxRuntime.jsxs(P,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:n.planNameColor,style:{marginTop:8},children:[e.planName," plan"]}),jsxRuntime.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__default.default.utc(e.usagePeriodEnd).diff(rd__default.default.utc(),o);switch(e.resetPeriod){case rh.EntitlementResetPeriod.Month:return `Resets monthly - in ${t("days")} days`;case rh.EntitlementResetPeriod.Week:return `Resets weekly - in ${t("days")} days`;case rh.EntitlementResetPeriod.Day:return `Resets daily - in ${t("hours")} hours`;case rh.EntitlementResetPeriod.Hour:return `Resets hourly - in ${t("minutes")} minutes`;default:return null}}var RT=y(LT__default.default)`
551
+ `;function eg({subscription:e,includePlanName:t,onManageSubscription:o}){return (e==null?void 0:e.status)!==ah.SubscriptionStatus.InTrial?null:jsxRuntime.jsxs(ET,{className:"stigg-subscription-trial-badge",children:[jsxRuntime.jsx(Xh,{className:"stigg-subscription-trial-badge-image"}),jsxRuntime.jsx("div",{style:{flex:1,marginRight:4},children:jsxRuntime.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`]})}),jsxRuntime.jsx(FT,{className:"stigg-subscription-trial-upgrade-button",onClick:()=>o({intentionType:"UPGRADE_TRIAL_PLAN"}),children:jsxRuntime.jsx(P,{color:"white",children:"Upgrade plan"})})]})}function ng({mainSubscription:e,trialSubscription:t,onManageSubscription:o,theme:n}){return jsxRuntime.jsxs("div",{className:"stigg-subscription-view-layout",children:[jsxRuntime.jsxs(P,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:n.planNameColor,style:{marginTop:8},children:[e.planName," plan"]}),jsxRuntime.jsx(eg,{subscription:t,includePlanName:(t==null?void 0:t.planName)!==e.planName,onManageSubscription:o})]})}var lc=70;function so(e,t){return t===0?0:Math.min(Math.floor(e/t*100),100)}function rg(e){let t;return e<lc?t="standard":e<100?t="warning":t="error",t}function ag(e){if(!e.resetPeriod||!e.usagePeriodEnd)return null;let t=o=>fc__default.default.utc(e.usagePeriodEnd).diff(fc__default.default.utc(),o);switch(e.resetPeriod){case ah.EntitlementResetPeriod.Month:return `Resets monthly - in ${t("days")} days`;case ah.EntitlementResetPeriod.Week:return `Resets weekly - in ${t("days")} days`;case ah.EntitlementResetPeriod.Day:return `Resets daily - in ${t("hours")} hours`;case ah.EntitlementResetPeriod.Hour:return `Resets hourly - in ${t("minutes")} minutes`;default:return null}}var DT=y(BT__default.default)`
552
552
  height: 4px;
553
553
  background-color: ${({theme:e})=>Do__default.default(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
- `;function Yr({currentUsage:e,usageLimit:t,classNamePrefix:o="stigg-usage-progress-bar"}){let n=so(e,t),i=ig(n);return jsxRuntime.jsx(RT,{$progressStatus:i,className:`${o} ${o}-${i}`,variant:"determinate",value:n})}var OT=y(gg__default.default)`
558
+ `;function Zr({currentUsage:e,usageLimit:t,classNamePrefix:o="stigg-usage-progress-bar"}){let n=so(e,t),i=rg(n);return jsxRuntime.jsx(DT,{$progressStatus:i,className:`${o} ${o}-${i}`,variant:"determinate",value:n})}var zT=y(fg__default.default)`
559
559
  border-style: dotted;
560
560
  border-bottom-width: 2px;
561
561
  border-color: ${({theme:e})=>Do__default.default(e.stigg.palette.outlinedRestingBorder).alpha(.4).string()};
562
- `;function Zr({entitlement:e}){return e.hasUnlimitedUsage?jsxRuntime.jsx(OT,{}):jsxRuntime.jsx(Yr,{currentUsage:e.currentUsage||0,usageLimit:e.usageLimit,classNamePrefix:"stigg-feature-usage-progress-bar"})}var sg=y(L2__default.default)`
562
+ `;function Xr({entitlement:e}){return e.hasUnlimitedUsage?jsxRuntime.jsx(zT,{}):jsxRuntime.jsx(Zr,{currentUsage:e.currentUsage||0,usageLimit:e.usageLimit,classNamePrefix:"stigg-feature-usage-progress-bar"})}var lg=y(B2__default.default)`
563
563
  text-transform: none;
564
564
  padding: 0;
565
565
  white-space: nowrap;
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?jsxRuntime.jsx(sg,{variant:"text",onClick:()=>n(t,e),children:jsxRuntime.jsx(P,{color:"primary.main",children:"Buy more"})}):null:r&&o?jsxRuntime.jsx(sg,{variant:"text",onClick:()=>o({intentionType:"UPGRADE_PLAN"}),children:jsxRuntime.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 jsxRuntime.jsxs("div",{className:`stigg-charge-list-item stigg-charge-list-item-${n.feature.refId}`,style:{display:"flex",flexDirection:"column",gap:12},children:[jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[jsxRuntime.jsxs("div",{style:{display:"flex",gap:12},children:[jsxRuntime.jsx(ue,{variant:"body1",color:"primary",children:i.displayName}),!r&&jsxRuntime.jsxs(ue,{variant:"body1",color:"secondary",children:[at({amount:e,currency:t})," per ",o?`${o} `:"",o?i.featureUnitsPlural:i.featureUnits]})]}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:12},children:[jsxRuntime.jsx(Kr,{featureEntitlement:n,feature:i,canBuyMore:true,onBuyMore:a,onManageSubscription:s,canUpgradeSubscription:l,hasCustomSubscription:c}),jsxRuntime.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()}`})]})]}),jsxRuntime.jsx(Zr,{entitlement:n})]})}function dg({subscription:e,entitlements:t,onBuyMore:o,onManageSubscription:n,hasCustomSubscription:i,canUpgradeSubscription:r}){let a=lodash.keyBy(t,"feature.refId"),s=e.prices.filter(({feature:l,price:c})=>!!l&&a[l.refId]&&!!c);return s.length?jsxRuntime.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:jsxRuntime.jsx(lg,{featureEntitlement:p,feature:p.feature,amount:c.amount,blockSize:d,currency:c.currency,hideChargePrice:u===rh.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=Ac.useMemo(()=>p?p.filter(kn):[],[p]),g=u==null?void 0:u.find(({status:T})=>T===rh.SubscriptionStatus.Active),f=u==null?void 0:u.find(({status:T})=>T===rh.SubscriptionStatus.InTrial),x=(g==null?void 0:g.pricingType)===rh.PricingType.Custom,b=g||f;return jsxRuntime.jsxs(Te,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:c.backgroundColor,$borderColor:c.borderColor,children:[!d&&g&&g.scheduledUpdates&&jsxRuntime.jsx(zh,{theme:c,subscription:g,onCancelScheduledUpdates:o,cancelScheduledUpdatesButtonTitle:r}),d||!b?jsxRuntime.jsx(Nh,{}):jsxRuntime.jsxs("div",{className:"stigg-overview-layout",style:{display:"flex",alignItems:"flex-start",gap:64,flexWrap:"wrap"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[jsxRuntime.jsx(vh,{onManageSubscription:e,hideManageButton:x,textOverrides:l}),jsxRuntime.jsx(og,{mainSubscription:b,trialSubscription:f,theme:c,onManageSubscription:e}),g&&m.length>0&&jsxRuntime.jsx(dg,{subscription:g,entitlements:m,onBuyMore:t,onManageSubscription:e,canUpgradeSubscription:!!h,hasCustomSubscription:x}),jsxRuntime.jsx(Bh,{customerPortal:a,hiddenSections:i,textOverrides:l,theme:c})]}),jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24},children:jsxRuntime.jsx(jh,{subscription:b,theme:c,onContactSupport:n,textOverrides:l})})]})]})}var GT=y.div`
566
+ `;function qr({featureEntitlement:e,feature:t,onManageSubscription:o,onBuyMore:n,canBuyMore:i,canUpgradeSubscription:r,hasCustomSubscription:a}){return a||e.hasUnlimitedUsage||so(e.currentUsage||0,e.usageLimit)<lc?null:i?n?jsxRuntime.jsx(lg,{variant:"text",onClick:()=>n(t,e),children:jsxRuntime.jsx(P,{color:"primary.main",children:"Buy more"})}):null:r&&o?jsxRuntime.jsx(lg,{variant:"text",onClick:()=>o({intentionType:"UPGRADE_PLAN"}),children:jsxRuntime.jsx(P,{color:"primary.main",children:"Upgrade"})}):null}function cg({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 jsxRuntime.jsxs("div",{className:`stigg-charge-list-item stigg-charge-list-item-${n.feature.refId}`,style:{display:"flex",flexDirection:"column",gap:12},children:[jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[jsxRuntime.jsxs("div",{style:{display:"flex",gap:12},children:[jsxRuntime.jsx(ue,{variant:"body1",color:"primary",children:i.displayName}),!r&&jsxRuntime.jsxs(ue,{variant:"body1",color:"secondary",children:[at({amount:e,currency:t})," per ",o?`${o} `:"",o?i.featureUnitsPlural:i.featureUnits]})]}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:12},children:[jsxRuntime.jsx(qr,{featureEntitlement:n,feature:i,canBuyMore:true,onBuyMore:a,onManageSubscription:s,canUpgradeSubscription:l,hasCustomSubscription:c}),jsxRuntime.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()}`})]})]}),jsxRuntime.jsx(Xr,{entitlement:n})]})}function ug({subscription:e,entitlements:t,onBuyMore:o,onManageSubscription:n,hasCustomSubscription:i,canUpgradeSubscription:r}){let a=lodash.keyBy(t,"feature.refId"),s=e.prices.filter(({feature:l,price:c})=>!!l&&a[l.refId]&&!!c);return s.length?jsxRuntime.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:jsxRuntime.jsx(cg,{featureEntitlement:p,feature:p.feature,amount:c.amount,blockSize:d,currency:c.currency,hideChargePrice:u===ah.BillingModel.PerUnit,onBuyMore:o,onManageSubscription:n,canUpgradeSubscription:r,hasCustomSubscription:i},l.refId)})}):null}function kn(e){return e.__typename==="FeatureEntitlement"}function Jr(e){return e.__typename==="CreditEntitlement"}function ta({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=Fc.useMemo(()=>p?p.filter(kn):[],[p]),g=u==null?void 0:u.find(({status:T})=>T===ah.SubscriptionStatus.Active),f=u==null?void 0:u.find(({status:T})=>T===ah.SubscriptionStatus.InTrial),x=(g==null?void 0:g.pricingType)===ah.PricingType.Custom,b=g||f;return jsxRuntime.jsxs(Te,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:c.backgroundColor,$borderColor:c.borderColor,children:[!d&&g&&g.scheduledUpdates&&jsxRuntime.jsx(Vh,{theme:c,subscription:g,onCancelScheduledUpdates:o,cancelScheduledUpdatesButtonTitle:r}),d||!b?jsxRuntime.jsx(Uh,{}):jsxRuntime.jsxs("div",{className:"stigg-overview-layout",style:{display:"flex",alignItems:"flex-start",gap:64,flexWrap:"wrap"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[jsxRuntime.jsx(_h,{onManageSubscription:e,hideManageButton:x,textOverrides:l}),jsxRuntime.jsx(ng,{mainSubscription:b,trialSubscription:f,theme:c,onManageSubscription:e}),g&&m.length>0&&jsxRuntime.jsx(ug,{subscription:g,entitlements:m,onBuyMore:t,onManageSubscription:e,canUpgradeSubscription:!!h,hasCustomSubscription:x}),jsxRuntime.jsx(Rh,{customerPortal:a,hiddenSections:i,textOverrides:l,theme:c})]}),jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24},children:jsxRuntime.jsx(Yh,{subscription:b,theme:c,onContactSupport:n,textOverrides:l})})]})]})}var jT=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 mg({showWatermark:e}){return jsxRuntime.jsx(GT,{className:"stigg-customer-portal-header-layout",children:jsxRuntime.jsx(Jt,{source:"customer_portal",showWatermark:e})})}var YT=y(P)`
572
+ `;function hg({showWatermark:e}){return jsxRuntime.jsx(jT,{className:"stigg-customer-portal-header-layout",children:jsxRuntime.jsx(Jt,{source:"customer_portal",showWatermark:e})})}var ZT=y(P)`
573
573
  text-transform: none;
574
- `,ZT=y(reactFeather.ExternalLink)`
574
+ `,XT=y(reactFeather.ExternalLink)`
575
575
  color: ${({theme:e})=>e.stigg.palette.primary};
576
- `;function ta({text:e,url:t,className:o}){return jsxRuntime.jsx(ao,{className:o,variant:"outlined",startIcon:jsxRuntime.jsx(ZT,{size:20,strokeWidth:2.5}),onClick:()=>{window.open(t,"_blank");},children:jsxRuntime.jsx(YT,{color:"primary.main",children:e})})}var ea=y.div`
576
+ `;function ea({text:e,url:t,className:o}){return jsxRuntime.jsx(ao,{className:o,variant:"outlined",startIcon:jsxRuntime.jsx(XT,{size:20,strokeWidth:2.5}),onClick:()=>{window.open(t,"_blank");},children:jsxRuntime.jsx(ZT,{color:"primary.main",children:e})})}var oa=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
- `,XT=y.div`
582
+ `,KT=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 uc({title:e,rows:t}){return jsxRuntime.jsxs(ea,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"secondary",bold:true,children:e}),t.map(({classNamePrefix:o,label:n,value:i,labelTypographyProps:r,valueTypographyProps:a})=>jsxRuntime.jsxs(XT,{children:[jsxRuntime.jsx(P,A(S({className:`${o}-label`,variant:"body1",color:"secondary",style:{width:80}},r),{children:n})),jsxRuntime.jsx(P,A(S({className:`${o}-text`,variant:"body1",color:"secondary"},a),{children:i}))]},n))]})}function oa(){return jsxRuntime.jsx(ro__default.default,{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(jsxRuntime.jsxs(ea,{children:[jsxRuntime.jsx(ro__default.default,{width:220,height:12}),jsxRuntime.jsx(ro__default.default,{width:220,height:12}),jsxRuntime.jsx(ro__default.default,{width:220,height:12})]},"information-loading-data-top"),jsxRuntime.jsx(gg__default.default,{orientation:"vertical",style:{minHeight:93,display:i?"block":"none"}},"information-loading-data-divider"),jsxRuntime.jsxs(ea,{children:[jsxRuntime.jsx(ro__default.default,{width:220,height:12}),jsxRuntime.jsx(ro__default.default,{width:220,height:12}),jsxRuntime.jsx(ro__default.default,{width:220,height:12})]},"information-loading-data-bottom")):(s.push(jsxRuntime.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(jsxRuntime.jsx(gg__default.default,{orientation:"vertical",style:{minHeight:93,display:i?"block":"none"}},"information-billing-data-divider")),s.unshift(jsxRuntime.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:`${lodash.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?jsxRuntime.jsx(oa,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(ta,{url:e.billingPortalUrl,text:o.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return jsxRuntime.jsxs(Te,{className:"stigg-payment-details-section-layout",$backgroundColor:n.backgroundColor,$borderColor:n.borderColor,children:[jsxRuntime.jsxs(Ce,{className:"stigg-payment-details-section-header",children:[jsxRuntime.jsx(Pe,{isLoading:a,className:"stigg-payment-details-section-title",title:"Payment details"}),l]}),jsxRuntime.jsx("div",{style:{display:"flex",alignItems:"stretch",gap:i?64:32,flexWrap:"wrap"},children:s})]})}var yg=y(Te)`
588
+ `;function pc({title:e,rows:t}){return jsxRuntime.jsxs(oa,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"secondary",bold:true,children:e}),t.map(({classNamePrefix:o,label:n,value:i,labelTypographyProps:r,valueTypographyProps:a})=>jsxRuntime.jsxs(KT,{children:[jsxRuntime.jsx(P,A(S({className:`${o}-label`,variant:"body1",color:"secondary",style:{width:80}},r),{children:n})),jsxRuntime.jsx(P,A(S({className:`${o}-text`,variant:"body1",color:"secondary"},a),{children:i}))]},n))]})}function na(){return jsxRuntime.jsx(ro__default.default,{width:220,height:42})}var yg="-";function ra(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:n}=ut(),i=Dt("md"),{billingInformation:r}=e||{},a=!r||t,s=[];if(a?s.push(jsxRuntime.jsxs(oa,{children:[jsxRuntime.jsx(ro__default.default,{width:220,height:12}),jsxRuntime.jsx(ro__default.default,{width:220,height:12}),jsxRuntime.jsx(ro__default.default,{width:220,height:12})]},"information-loading-data-top"),jsxRuntime.jsx(fg__default.default,{orientation:"vertical",style:{minHeight:93,display:i?"block":"none"}},"information-loading-data-divider"),jsxRuntime.jsxs(oa,{children:[jsxRuntime.jsx(ro__default.default,{width:220,height:12}),jsxRuntime.jsx(ro__default.default,{width:220,height:12}),jsxRuntime.jsx(ro__default.default,{width:220,height:12})]},"information-loading-data-bottom")):(s.push(jsxRuntime.jsx(pc,{title:"Billed to",rows:[{classNamePrefix:"stigg-customer-name",label:"Name",value:(r==null?void 0:r.name)||yg,valueTypographyProps:r!=null&&r.name?{}:{color:"disabled"}},{classNamePrefix:"stigg-customer-email",label:"Email",value:(r==null?void 0:r.email)||yg,valueTypographyProps:r!=null&&r.email?{}:{color:"disabled"}}]},"information-billing-data-billed-to")),r!=null&&r.defaultPaymentMethodId&&r.defaultPaymentMethodLast4Digits&&r.defaultPaymentExpirationMonth&&r.defaultPaymentExpirationYear&&(s.unshift(jsxRuntime.jsx(fg__default.default,{orientation:"vertical",style:{minHeight:93,display:i?"block":"none"}},"information-billing-data-divider")),s.unshift(jsxRuntime.jsx(pc,{title:"Payment method",rows:[{classNamePrefix:"stigg-credit-card",label:"Card",value:`Ending in ${r.defaultPaymentMethodLast4Digits}`},{classNamePrefix:"stigg-credit-card-expiration",label:"Expires",value:`${lodash.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?jsxRuntime.jsx(na,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(ea,{url:e.billingPortalUrl,text:o.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return jsxRuntime.jsxs(Te,{className:"stigg-payment-details-section-layout",$backgroundColor:n.backgroundColor,$borderColor:n.borderColor,children:[jsxRuntime.jsxs(Ce,{className:"stigg-payment-details-section-header",children:[jsxRuntime.jsx(Pe,{isLoading:a,className:"stigg-payment-details-section-title",title:"Payment details"}),l]}),jsxRuntime.jsx("div",{style:{display:"flex",alignItems:"stretch",gap:i?64:32,flexWrap:"wrap"},children:s})]})}var xg=y(Te)`
589
589
  position: relative;
590
590
 
591
591
  .stigg-paywall-layout {
@@ -607,10 +607,10 @@
607
607
  margin-right: auto;
608
608
  }
609
609
 
610
- .${Vl} {
610
+ .${$l} {
611
611
  display: none;
612
612
  }
613
- `;var pc=Ac.forwardRef(({paywallComponent:e,theme:t,title:o,isLoading:n},i)=>e?jsxRuntime.jsxs(yg,{className:"stigg-customer-portal-paywall-section",ref:i,$backgroundColor:t.backgroundColor,$borderColor:t.borderColor,children:[jsxRuntime.jsx(Ce,{className:"stigg-customer-portal-paywall-header",children:jsxRuntime.jsx(Pe,{isLoading:n,className:"stigg-customer-portal-paywall-section-title",title:o})}),e]}):null);pc.displayName="CustomerPortalPaywall";var bg=y.div`
613
+ `;var mc=Fc.forwardRef(({paywallComponent:e,theme:t,title:o,isLoading:n},i)=>e?jsxRuntime.jsxs(xg,{className:"stigg-customer-portal-paywall-section",ref:i,$backgroundColor:t.backgroundColor,$borderColor:t.borderColor,children:[jsxRuntime.jsx(Ce,{className:"stigg-customer-portal-paywall-header",children:jsxRuntime.jsx(Pe,{isLoading:n,className:"stigg-customer-portal-paywall-section-title",title:o})}),e]}):null);mc.displayName="CustomerPortalPaywall";var Cg=y.div`
614
614
  width: 100%;
615
615
  display: flex;
616
616
  flex-direction: column;
@@ -619,13 +619,13 @@
619
619
  & * {
620
620
  box-sizing: border-box;
621
621
  }
622
- `,Cg=y.div`
622
+ `,Pg=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
- `;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)===rh.MeterType.Fluctuating||((o=e.feature)==null?void 0:o.meterType)===rh.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__default.default((b=t==null?void 0:t.prices)!=null?b:[],"feature.refId"),l=Sg__default.default(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)===rh.PricingType.Custom;return {subscriptionPriceByFeature:s,filteredFeatureEntitlements:g,filteredCreditEntitlements:f,hasCustomSubscription:x}}function Ag({filterEntitlements:e,filterPackageEntitlements:t}){let[o,n]=Ac.useState(false),i=Dt("md"),{customerPortal:r,isLoading:a}=ut(),s=Ac.useMemo(()=>{var _;let w=r==null?void 0:r.entitlementsV2,v=(_=r==null?void 0:r.subscriptions)==null?void 0:_.find(M=>M.status===rh.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__default.default(e);return n===mc__default.default(t||"")||n===mc__default.default(o||"")?e:`${e} (${o})`}function Mg(e){return vi(e.displayName,e.featureUnits,e.featureUnitsPlural)}var ra=y.div`
628
+ `;var kg=6;function vg({featureEntitlements:e,creditEntitlements:t,showAll:o}){let n=e.length+t.length,i=o?n:Math.min(n,kg),r=e.slice(0,i),a=i-r.length,s=t.slice(0,Math.max(0,a)),l=n>kg;return {entitlementsToShow:r,creditsToShow:s,totalItemsCount:n,showMoreVisible:l}}function nk(e){var t,o;return ((t=e.feature)==null?void 0:t.meterType)===ah.MeterType.Fluctuating||((o=e.feature)==null?void 0:o.meterType)===ah.MeterType.Incremental}function _g(e,t){return t?e>2?4:6:12}function wg(e){let t=[],o=[];for(let n of e)kn(n)?t.push(n):Jr(n)&&o.push(n);return {feature:t,credit:o}}function Ag({packageEntitlements:e,activeSubscription:t,filterEntitlements:o,filterPackageEntitlements:n}){var b,T;let{feature:i,credit:r}=wg(e!=null?e:[]),a=i.filter(nk),s=Tg__default.default((b=t==null?void 0:t.prices)!=null?b:[],"feature.refId"),l=Tg__default.default(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}=wg(m),x=(t==null?void 0:t.pricingType)===ah.PricingType.Custom;return {subscriptionPriceByFeature:s,filteredFeatureEntitlements:g,filteredCreditEntitlements:f,hasCustomSubscription:x}}function Mg({filterEntitlements:e,filterPackageEntitlements:t}){let[o,n]=Fc.useState(false),i=Dt("md"),{customerPortal:r,isLoading:a}=ut(),s=Fc.useMemo(()=>{var _;let w=r==null?void 0:r.entitlementsV2,v=(_=r==null?void 0:r.subscriptions)==null?void 0:_.find(M=>M.status===ah.SubscriptionStatus.Active);return Ag({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}=vg({featureEntitlements:c,creditEntitlements:d,showAll:o}),b=_g(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 vn(e,t,o){if(!t&&!o)return e;let n=hc__default.default(e);return n===hc__default.default(t||"")||n===hc__default.default(o||"")?e:`${e} (${o})`}function Ig(e){return vn(e.displayName,e.featureUnits,e.featureUnitsPlural)}function Eg(e){var t,o,n;return vn((t=e.currency)==null?void 0:t.displayName,(o=e.currency)==null?void 0:o.unitSingular,(n=e.currency)==null?void 0:n.unitPlural)}var aa=y.div`
629
629
  display: flex;
630
630
  flex-direction: column;
631
631
  padding: 24px;
@@ -635,12 +635,12 @@
635
635
  height: 100%;
636
636
 
637
637
  ${({theme:e,$highlight:t})=>t&&`background-color: ${e.stigg.palette.backgroundSection}`};
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?jsxRuntime.jsxs(ra,{$highlight:!!t,$borderColor:a.borderColor,children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[jsxRuntime.jsx(ue,{variant:"body1",children:e.feature&&Mg(e.feature)}),t&&jsxRuntime.jsx(Be,{title:jsxRuntime.jsx(P,{variant:"body1",children:t.billingModel===sdk.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage"}),children:jsxRuntime.jsx(mt,{icon:"DollarCoin",svgStrokeColor:a.iconsColor})})]}),jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[jsxRuntime.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)}%)`]}),jsxRuntime.jsx(Kr,{featureEntitlement:e,feature:e.feature,onBuyMore:n,canBuyMore:!!t,onManageSubscription:o,canUpgradeSubscription:r,hasCustomSubscription:i})]}),jsxRuntime.jsx(Zr,{entitlement:e}),!e.hasUnlimitedUsage&&!Ig__default.default(e.usageLimit)&&!Ig__default.default(e.currentUsage)&&e.resetPeriod&&e.usagePeriodEnd?jsxRuntime.jsx(P,{color:"secondary",children:rg(e)}):null,e.hasUnlimitedUsage&&jsxRuntime.jsx(P,{color:"secondary",children:"In current billing period"})]}):null}function hc({currentUsage:e,usageLimit:t}){return jsxRuntime.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 jsxRuntime.jsxs(ra,{$highlight:false,$borderColor:t.borderColor,className:"stigg-credit-usage-container",children:[jsxRuntime.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:jsxRuntime.jsx(ue,{variant:"body1",className:"stigg-credit-usage-title",children:s})}),jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:jsxRuntime.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,"%)"]})}),jsxRuntime.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 jsxRuntime.jsxs(Se__default.default,{container:true,spacing:4,children:[e.filter(l=>!!l.feature).map(l=>{let c=l.feature;return jsxRuntime.jsx(Se__default.default,{className:`stigg-entitlement-usage-${c.refId}`,item:true,xs:n,children:jsxRuntime.jsx(Eg,{entitlement:l,subscriptionPrice:o[c.refId],onManageSubscription:i,onBuyMore:r,hasCustomSubscription:a,canUpgradeSubscription:s})},c.refId)}),t.map(l=>jsxRuntime.jsx(Se__default.default,{className:`stigg-credit-usage-${l.currency.currencyId}`,item:true,xs:n,children:jsxRuntime.jsx(la,{creditEntitlement:l})},l.currency.currencyId))]})}var Rg=y.div`
638
+ `;function Lg({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?jsxRuntime.jsxs(aa,{$highlight:!!t,$borderColor:a.borderColor,children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[jsxRuntime.jsx(ue,{variant:"body1",children:e.feature&&Ig(e.feature)}),t&&jsxRuntime.jsx(Be,{title:jsxRuntime.jsx(P,{variant:"body1",children:t.billingModel===sdk.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage"}),children:jsxRuntime.jsx(mt,{icon:"DollarCoin",svgStrokeColor:a.iconsColor})})]}),jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[jsxRuntime.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)}%)`]}),jsxRuntime.jsx(qr,{featureEntitlement:e,feature:e.feature,onBuyMore:n,canBuyMore:!!t,onManageSubscription:o,canUpgradeSubscription:r,hasCustomSubscription:i})]}),jsxRuntime.jsx(Xr,{entitlement:e}),!e.hasUnlimitedUsage&&!Fg__default.default(e.usageLimit)&&!Fg__default.default(e.currentUsage)&&e.resetPeriod&&e.usagePeriodEnd?jsxRuntime.jsx(P,{color:"secondary",children:ag(e)}):null,e.hasUnlimitedUsage&&jsxRuntime.jsx(P,{color:"secondary",children:"In current billing period"})]}):null}function gc({currentUsage:e,usageLimit:t}){return jsxRuntime.jsx(Zr,{currentUsage:e,usageLimit:t,classNamePrefix:"stigg-credit-usage-progress-bar"})}function yc(e){return fc__default.default(e).format("MMM D, YYYY h:mmA")}function xc(e){return fc__default.default(e).format("MMM D, YYYY")}function ck(e){return fc__default.default(e).fromNow()}function la(e){let{usagePeriodEnd:t,formatter:o}=e;return !t||t.getTime()<=Date.now()?null:`Resets ${o?o(t):ck(t)}.`}function ca({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=Eg(e),l=la({usagePeriodEnd:e.usagePeriodEnd?new Date(e.usagePeriodEnd):void 0});return jsxRuntime.jsxs(aa,{$highlight:false,$borderColor:t.borderColor,className:"stigg-credit-usage-container",children:[jsxRuntime.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:jsxRuntime.jsx(ue,{variant:"body1",className:"stigg-credit-usage-title",children:s})}),jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:jsxRuntime.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,"%)"]})}),jsxRuntime.jsx(gc,{currentUsage:n!=null?n:0,usageLimit:i!=null?i:0}),l&&jsxRuntime.jsx(P,{color:"secondary",children:l})]})}function Rg({featureEntitlements:e,creditEntitlements:t,subscriptionPriceByFeature:o,gridSizeXs:n,onManageSubscription:i,onBuyMore:r,hasCustomSubscription:a,canUpgradeSubscription:s}){return jsxRuntime.jsxs(Se__default.default,{container:true,spacing:4,children:[e.filter(l=>!!l.feature).map(l=>{let c=l.feature;return jsxRuntime.jsx(Se__default.default,{className:`stigg-entitlement-usage-${c.refId}`,item:true,xs:n,children:jsxRuntime.jsx(Lg,{entitlement:l,subscriptionPrice:o[c.refId],onManageSubscription:i,onBuyMore:r,hasCustomSubscription:a,canUpgradeSubscription:s})},c.refId)}),t.map(l=>jsxRuntime.jsx(Se__default.default,{className:`stigg-credit-usage-${l.currency.currencyId}`,item:true,xs:n,children:jsxRuntime.jsx(ca,{creditEntitlement:l})},l.currency.currencyId))]})}var Ng=y.div`
639
639
  margin-top: 32px;
640
- `;function Dg(){let e=Dt("md");return jsxRuntime.jsx(Se__default.default,{container:true,spacing:4,className:"stigg-subscription-usage-skeleton-layout",sx:{flexWrap:"wrap"},children:lodash.range(6).map(t=>jsxRuntime.jsx(Se__default.default,{item:true,xs:e?4:12,children:jsxRuntime.jsx(ro__default.default,{width:280,height:120})},t))})}function Ng({showAll:e,onToggle:t}){return jsxRuntime.jsx(Rg,{children:jsxRuntime.jsx(ao,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:e?jsxRuntime.jsx(reactFeather.Minus,{}):jsxRuntime.jsx(reactFeather.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:jsxRuntime.jsxs(Te,{className:"stigg-subscription-usage-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:[jsxRuntime.jsx(Ce,{children:jsxRuntime.jsx(Pe,{title:i.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:a})}),a?jsxRuntime.jsx(Dg,{}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Lg,{featureEntitlements:s,creditEntitlements:l,subscriptionPriceByFeature:c,gridSizeXs:d,onManageSubscription:e,onBuyMore:t,hasCustomSubscription:u,canUpgradeSubscription:p}),f&&jsxRuntime.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=Ac.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 jsxRuntime.jsxs(bg,{className:"stigg-customer-portal-layout",children:[jsxRuntime.jsx(mg,{showWatermark:p}),jsxRuntime.jsxs(Cg,{className:"stigg-customer-portal-sections",children:[jsxRuntime.jsx(Jr,{onCancelScheduledUpdates:i,onBuyMore:t,onManageSubscription:m,onContactSupport:r,hiddenSections:s,cancelScheduledUpdatesButtonTitle:c.cancelScheduledUpdatesButtonTitle}),g&&jsxRuntime.jsx(ua,{onManageSubscription:m,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:n}),jsxRuntime.jsx(pc,{ref:h,paywallComponent:a,theme:d,title:c.paywallSectionTitle,isLoading:!l||u}),f&&jsxRuntime.jsx(ia,{}),x&&jsxRuntime.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 jsxRuntime.jsx(Dr,{textOverrides:e,theme:t,resourceId:o,productId:n,children:jsxRuntime.jsx(zg,S({},i))})}function pa(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:n}=ut(),i=!e||t,r=i?jsxRuntime.jsx(oa,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(ta,{url:e.billingPortalUrl,text:o.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return !i&&!(e!=null&&e.billingPortalUrl)?null:jsxRuntime.jsx(Te,{className:"stigg-invoices-section-layout",$backgroundColor:n.backgroundColor,$borderColor:n.borderColor,children:jsxRuntime.jsxs(Ce,{className:"stigg-invoices-section-header",children:[jsxRuntime.jsx(Pe,{isLoading:i,className:"stigg-invoices-section-title",title:o.invoicesTitle}),r]})})}var Wg=e=>Hg__default.default(e,"displayName"),yc=e=>Hg__default.default(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(rh.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)||rh.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__default.default(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__default.default(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]=Ac.useState(true),[s,l]=Ac.useState();return Ac.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===sdk.BillingPeriod.Monthly)),bc=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Annually)),Jg=e=>xc(e)&&bc(e);var of=(e,t,o)=>e===sdk.BillingPeriod.Monthly&&t||e===sdk.BillingPeriod.Annually&&o?e:null,nf=({pricingModel:e})=>e===rh.BillingModel.PerUnit;function Ik(e,t,o){var r;if(!t)return [];let n=Sg__default.default(e,"featureId"),i=Sg__default.default(ef__default.default((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__default.default(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)||sdk.BillingPeriod.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?sdk.BillingPeriod.Annually:sdk.BillingPeriod.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__default.default(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:Ac.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]=Ac.useState(null),[n,i]=Ac.useState(null),[r,a]=Ac.useState(false),{previewSubscriptionAction:s}=Pc({onMockCheckoutPreview:e});return Ac.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 Ac.useCallback(t=>e(o=>{o.paymentStep.useNewPaymentMethod=t;}),[e])}function Xk(){let[,e]=j();return Ac.useCallback(t=>e(o=>{o.paymentStep.errorMessage=t;}),[e])}function Kk(){let[,e]=j();return Ac.useCallback(t=>e(o=>{o.paymentStep.billingAddress=t;}),[e])}function qk(){let[{paymentStep:e}]=j();return e}function Qk(){let[,e]=j();return Ac.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__default.default({changePlan:"Change",billingPeriodsTitle:"Billing cycle",addAddonText:"Add",addonBillingPeriodNotAvailableText:({planBillingPeriod:o})=>o===rh.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===rh.DiscountType.Percentage?i=`${o.value}% off`:i=`${at({amount:o.value,currency:n})}`;let r="";switch(o.durationType){case rh.DiscountDurationType.Once:{r=" once";break}case rh.DiscountDurationType.Repeating:{r=`${o.type===rh.DiscountType.Fixed?" per month":""} for ${o.durationInMonths} months`;break}case rh.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__default.default(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__default.default.createContext(null);kc.displayName="CheckoutContext";var j=()=>{let e=Ac.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]=Ac.useState(t);Ac.useEffect(()=>{n(t);},[t]);let i=Ac.useCallback(s=>n(l=>immer.produce(l,c=>s(c))),[n]),[r,a]=Ac.useMemo(()=>[o,i],[i,o]);return jsxRuntime.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=Ac.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 jsxRuntime.jsx(ht,{componentTheme:g,children:jsxRuntime.jsx(lw,{initialState:x,children:e})},p==null?void 0:p.plan.id)}var ff="920px",xf=y.div`
640
+ `;function Ug(){let e=Dt("md");return jsxRuntime.jsx(Se__default.default,{container:true,spacing:4,className:"stigg-subscription-usage-skeleton-layout",sx:{flexWrap:"wrap"},children:lodash.range(6).map(t=>jsxRuntime.jsx(Se__default.default,{item:true,xs:e?4:12,children:jsxRuntime.jsx(ro__default.default,{width:280,height:120})},t))})}function Og({showAll:e,onToggle:t}){return jsxRuntime.jsx(Ng,{children:jsxRuntime.jsx(ao,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:e?jsxRuntime.jsx(reactFeather.Minus,{}):jsxRuntime.jsx(reactFeather.Plus,{}),onClick:t,children:e?"Show less":"Show more"})})}function pa({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}=Mg({filterEntitlements:o,filterPackageEntitlements:n});return g?null:jsxRuntime.jsxs(Te,{className:"stigg-subscription-usage-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor,children:[jsxRuntime.jsx(Ce,{children:jsxRuntime.jsx(Pe,{title:i.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:a})}),a?jsxRuntime.jsx(Ug,{}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Rg,{featureEntitlements:s,creditEntitlements:l,subscriptionPriceByFeature:c,gridSizeXs:d,onManageSubscription:e,onBuyMore:t,hasCustomSubscription:u,canUpgradeSubscription:p}),f&&jsxRuntime.jsx(Og,{showAll:h,onToggle:m})]})]})}function $g({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=Fc.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 jsxRuntime.jsxs(Cg,{className:"stigg-customer-portal-layout",children:[jsxRuntime.jsx(hg,{showWatermark:p}),jsxRuntime.jsxs(Pg,{className:"stigg-customer-portal-sections",children:[jsxRuntime.jsx(ta,{onCancelScheduledUpdates:i,onBuyMore:t,onManageSubscription:m,onContactSupport:r,hiddenSections:s,cancelScheduledUpdatesButtonTitle:c.cancelScheduledUpdatesButtonTitle}),g&&jsxRuntime.jsx(pa,{onManageSubscription:m,onBuyMore:t,filterEntitlements:o,filterPackageEntitlements:n}),jsxRuntime.jsx(mc,{ref:h,paywallComponent:a,theme:d,title:c.paywallSectionTitle,isLoading:!l||u}),f&&jsxRuntime.jsx(ra,{}),x&&jsxRuntime.jsx(ma,{})]})]})}function Wg(r){var a=r,{textOverrides:e,theme:t,resourceId:o,productId:n}=a,i=ot(a,["textOverrides","theme","resourceId","productId"]);return jsxRuntime.jsx(Nr,{textOverrides:e,theme:t,resourceId:o,productId:n,children:jsxRuntime.jsx($g,S({},i))})}function ma(){let{customerPortal:e,isLoading:t,textOverrides:o,theme:n}=ut(),i=!e||t,r=i?jsxRuntime.jsx(na,{}):e!=null&&e.billingPortalUrl?jsxRuntime.jsx(ea,{url:e.billingPortalUrl,text:o.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return !i&&!(e!=null&&e.billingPortalUrl)?null:jsxRuntime.jsx(Te,{className:"stigg-invoices-section-layout",$backgroundColor:n.backgroundColor,$borderColor:n.borderColor,children:jsxRuntime.jsxs(Ce,{className:"stigg-invoices-section-header",children:[jsxRuntime.jsx(Pe,{isLoading:i,className:"stigg-invoices-section-title",title:o.invoicesTitle}),r]})})}var jg=e=>Gg__default.default(e,"displayName"),Pc=e=>Gg__default.default(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(ah.WidgetType.Checkout))&&!t}function bk(e,t){return e.pricePoints.some(o=>o.billingPeriod===t)}function Yg({addon:e,currency:t,billingCountryCode:o}){return A(S({},e),{pricePoints:e.pricePoints.filter(n=>n.currency===t&&(o?n.billingCountryCode===o:true))})}function Zg({addons:e,billingCountryCode:t,currency:o}){return (e==null?void 0:e.map(n=>Yg({addon:n,currency:o,billingCountryCode:t})))||[]}function Xg({addons:e,billingPeriod:t,billingCountryCode:o,currency:n}){var i;return ((i=e==null?void 0:e.filter(r=>bk(r.addon,t)))==null?void 0:i.map(r=>A(S({},r),{addon:Yg({addon:r.addon,currency:n,billingCountryCode:o})})))||[]}function Kg({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)||ah.Currency.Usd,a=Zg({addons:t==null?void 0:t.compatibleAddons,billingCountryCode:o,currency:r}),s=jg(a.filter(u=>!$o(u))),l=Xg({addons:e==null?void 0:e.addons,billingPeriod:n,billingCountryCode:o,currency:r});return l!=null&&l.length&&(a!=null&&a.length)&&(i=Pc(l.filter(u=>a.some(p=>p.id===u.addon.id)))),{addons:i,initialAddons:Ck__default.default(i),availableAddons:s}}function Tk(){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=Pc(n.addonsStep.addons);})}function kk(){let[,e]=j();return t=>e(o=>{let n=o.addonsStep.addons.find(i=>i.addon.id===t);n&&$o(n.addon)||Pk__default.default(o.addonsStep.addons,i=>i.addon.id===t);})}function wk(){let[{addonsStep:e}]=j();return e}function qg(){let e=wk();return A(S({},e),{setAddon:Tk(),removeAddon:kk()})}function vk(){let[{checkout:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n}]=j();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n}}function _k(){let[,e]=j();return t=>e(o=>{o.widgetState.readOnly=t;})}function Ak(){let[,e]=j();return t=>e(o=>{o.widgetState.isValid=t;})}function Mk(){let[,e]=j();return t=>e(o=>{o.checkoutSuccess=t;})}function Y(){let{checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n}=vk();return {checkoutState:e,widgetState:t,checkoutLocalization:o,checkoutSuccess:n,setWidgetReadOnly:_k(),setIsValid:Ak(),setCheckoutSuccess:Mk()}}function Jg({planId:e,resourceId:t,billingCountryCode:o,onMockCheckoutState:n}){let{stigg:i}=D(),[r,a]=Fc.useState(true),[s,l]=Fc.useState();return Fc.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 ga=(e,t)=>e.minUnitQuantity&&t<e.minUnitQuantity?e.minUnitQuantity:e.maxUnitQuantity&&t>e.maxUnitQuantity?e.maxUnitQuantity:t;var Sc=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Monthly)),Tc=e=>!!(e!=null&&e.pricePoints.some(t=>t.billingPeriod===sdk.BillingPeriod.Annually)),ef=e=>Sc(e)&&Tc(e);var rf=(e,t,o)=>e===sdk.BillingPeriod.Monthly&&t||e===sdk.BillingPeriod.Annually&&o?e:null,af=({pricingModel:e})=>e===ah.BillingModel.PerUnit;function Fk(e,t,o){var r;if(!t)return [];let n=Tg__default.default(e,"featureId"),i=Tg__default.default(nf__default.default((r=o==null?void 0:o.prices)==null?void 0:r.map(a=>{let{feature:s}=a;return !s||!af(a)?null:{featureId:s.featureId,quantity:s.unitQuantity||null}})),"featureId");return nf__default.default(t==null?void 0:t.map(a=>{var d,u,p;let s=(d=a.feature)==null?void 0:d.featureId;if(!s||!af(a))return null;let l,c=((u=n[s])==null?void 0:u.quantity)||((p=i[s])==null?void 0:p.quantity);return l=ga(a,c||1),a.isTieredPrice&&!fi(a.tiers)&&(l=Il(a.tiers,l).upTo),{featureId:s,quantity:l}}))}function Lk({plan:e,activeSubscription:t,preferredBillingPeriod:o}){var a,s;let n=Sc(e),i=Tc(e);if(o){let l=rf(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)||sdk.BillingPeriod.Monthly;if(t!=null&&t.prices&&(t==null?void 0:t.prices.length)>0){let l=rf(t==null?void 0:t.prices[0].billingPeriod,n,i);if(l)return l}return i?sdk.BillingPeriod.Annually:sdk.BillingPeriod.Monthly}function sf({preferredBillingPeriod:e,plan:t,activeSubscription:o,billingCountryCode:n,preconfiguredBillableFeatures:i}){let r=Lk({plan:t,activeSubscription:o,preferredBillingPeriod:e}),a=t==null?void 0:t.pricePoints.filter(l=>l.billingPeriod===r),s=Fk(i,a,o);return {billingPeriod:r,billableFeatures:s,billingCountryCode:n}}function Bk(){let[{planStep:e}]=j();return e}function Rk(){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 Dk(){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=Bk();return A(S({},e),{setBillingPeriod:Dk(),setBillableFeature:Rk()})}var cf=[{key:"PLAN",label:"Plan"},{key:"ADDONS",label:"Add-ons"},{key:"PAYMENT",label:"Payment details"}],lf={activeStep:0,completedSteps:[],steps:cf,isDisabled:false},Uk=(e,t,o,n)=>{if(ef(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 df({isLoading:e,skipCheckoutSteps:t,plan:o,availableAddons:n,availableCharges:i,preferredBillingPeriod:r,preconfiguredBillableFeatures:a}){if(e||!o)return lf;let s=[];return t.includes("PLAN")&&Uk(o,i,a,r)&&s.push("PLAN"),((n==null?void 0:n.length)===0||t.includes("ADDONS"))&&s.push("ADDONS"),A(S({},lf),{steps:cf.filter(l=>!s.includes(l.key))})}function Ok(){let[{progressBar:e}]=j();return e}function zk(){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 Vk(){let[,e]=j();return t=>e(({progressBar:o})=>{o.completedSteps.push(t);})}function $k(e){return e.completedSteps.length>=e.steps.length-1}function Hk(){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 Wk(){let[,e]=j();return t=>e(({progressBar:o})=>{o.isDisabled=!!t;})}function ke(){let e=Ok();return {currentStep:e.steps[e.activeStep],progressBarState:e,isLastStep:e.activeStep===e.steps.length-1,isCheckoutComplete:$k(e),setActiveStep:zk(),markStepAsCompleted:Vk(),goNext:Hk(),setIsDisabled:Wk()}}function An(){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 fa({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 Zk=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:NS__default.default(a)?void 0:a},fa({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}}),wc=({onMockCheckoutPreview:e}={})=>{let{stigg:t}=D(),o=An(),[{resourceId:n}]=j(),{checkoutState:i,widgetState:r}=Y(),{plan:a,customer:s}=i||{};return {previewSubscriptionAction:Fc.useCallback((...d)=>R(null,[...d],function*({promotionCode:c}={}){return r.isValid?Zk({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])}},Xk=500,uf=({onMockCheckoutPreview:e}={})=>{let[t,o]=Fc.useState(null),[n,i]=Fc.useState(null),[r,a]=Fc.useState(false),{previewSubscriptionAction:s}=wc({onMockCheckoutPreview:e});return Fc.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();},Xk);return ()=>{clearTimeout(c);}},[s]),{subscriptionPreview:t,isFetchingSubscriptionPreview:r,errorMessage:n}};function pf({customer:e,taxPercentage:t,taxId:o}){return {useNewPaymentMethod:!(e!=null&&e.paymentMethodDetails),taxPercentage:t,taxId:o}}function Kk(){let[,e]=j();return Fc.useCallback(t=>e(o=>{o.paymentStep.useNewPaymentMethod=t;}),[e])}function qk(){let[,e]=j();return Fc.useCallback(t=>e(o=>{o.paymentStep.errorMessage=t;}),[e])}function Qk(){let[,e]=j();return Fc.useCallback(t=>e(o=>{o.paymentStep.billingAddress=t;}),[e])}function Jk(){let[{paymentStep:e}]=j();return e}function tw(){let[,e]=j();return Fc.useCallback(t=>e(o=>{o.paymentStep.taxId=t;}),[e])}function vt(){let e=Jk();return A(S({},e),{setUseNewPaymentMethod:Kk(),setErrorMessage:qk(),setBillingAddress:Qk(),setTaxId:tw()})}function hf(e){return f2__default.default({changePlan:"Change",billingPeriodsTitle:"Billing cycle",addAddonText:"Add",addonBillingPeriodNotAvailableText:({planBillingPeriod:o})=>o===ah.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===ah.DiscountType.Percentage?i=`${o.value}% off`:i=`${at({amount:o.value,currency:n})}`;let r="";switch(o.durationType){case ah.DiscountDurationType.Once:{r=" once";break}case ah.DiscountDurationType.Repeating:{r=`${o.type===ah.DiscountType.Fixed?" per month":""} for ${o.durationInMonths} months`;break}case ah.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 ${fc__default.default(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 Ii={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 gf(e,t,o){let{palette:n}=e||{};return {primary:(t==null?void 0:t.primary)||(n==null?void 0:n.primary)||Ii.primary,textColor:(t==null?void 0:t.textColor)||(n==null?void 0:n.text.primary)||Ii.textColor,backgroundColor:(t==null?void 0:t.backgroundColor)||(n==null?void 0:n.backgroundPaper)||Ii.backgroundColor,borderColor:(t==null?void 0:t.borderColor)||(n==null?void 0:n.outlinedBorder)||Ii.borderColor,summaryBackgroundColor:(t==null?void 0:t.summaryBackgroundColor)||(n==null?void 0:n.backgroundHighlight)||Ii.summaryBackgroundColor,paymentInputBackgroundColor:t==null?void 0:t.paymentInputBackgroundColor,paymentInputBorderColor:t==null?void 0:t.paymentInputBorderColor,paymentInputBorderRadius:t==null?void 0:t.paymentInputBorderRadius}}var Ac=Fc__default.default.createContext(null);Ac.displayName="CheckoutContext";var j=()=>{let e=Fc.useContext(Ac);if(!e)throw new Error("Could not find Checkout context; You need to wrap your checkout components in an <CheckoutProvider> component.");return e},dw=({children:e,initialState:t})=>{let[o,n]=Fc.useState(t);Fc.useEffect(()=>{n(t);},[t]);let i=Fc.useCallback(s=>n(l=>immer.produce(l,c=>s(c))),[n]),[r,a]=Fc.useMemo(()=>[o,i],[i,o]);return jsxRuntime.jsx(Ac.Provider,{value:[r,a],children:e})};function yf({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}=Jg({resourceId:r,planId:a,billingCountryCode:s,onMockCheckoutState:c}),g=p!=null&&p.configuration?Qm(p.configuration):{typography:Si(null,Br)},f=Vo(g),x=Fc.useMemo(()=>{var F,E;let T=gf(f,o,p==null?void 0:p.configuration),k=hf(t),w=sf({preferredBillingPeriod:n,plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingCountryCode:s,preconfiguredBillableFeatures:i!=null?i:[]}),v=Kg({plan:p==null?void 0:p.plan,activeSubscription:p==null?void 0:p.activeSubscription,billingPeriod:w.billingPeriod}),_=pf({customer:p==null?void 0:p.customer,taxPercentage:(F=l==null?void 0:l.taxDetails)==null?void 0:F.taxPercentage}),M=df({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 jsxRuntime.jsx(ht,{componentTheme:g,children:jsxRuntime.jsx(dw,{initialState:x,children:e})},p==null?void 0:p.plan.id)}var xf="920px",Cf=y.div`
641
641
  margin: auto;
642
642
  min-height: 760px;
643
- max-width: ${ff};
643
+ max-width: ${xf};
644
644
  display: flex;
645
645
  position: relative;
646
646
  flex-direction: column;
@@ -657,9 +657,9 @@
657
657
  ${wt.md} {
658
658
  padding: 32px;
659
659
  border-radius: 10px;
660
- width: ${ff};
660
+ width: ${xf};
661
661
  }
662
- `,bf=y(Na__default.default)`
662
+ `,Pf=y(Ua__default.default)`
663
663
  display: flex;
664
664
  align-items: flex-start;
665
665
  gap: 32px;
@@ -670,7 +670,7 @@
670
670
  ${wt.md} {
671
671
  flex-direction: row;
672
672
  }
673
- `,Cf=y(Na__default.default)`
673
+ `,Sf=y(Ua__default.default)`
674
674
  display: flex;
675
675
  flex-direction: column;
676
676
  gap: 0;
@@ -680,18 +680,18 @@
680
680
  ${wt.md} {
681
681
  width: auto;
682
682
  }
683
- `;var Sf=y(LT__default.default)(({theme:e,$disabled:t})=>({[`&.${LT.linearProgressClasses.root}`]:{borderRadius:e.stigg.border.radius,backgroundColor:e.stigg.palette.outlinedBorder},[`& .${LT.linearProgressClasses.bar}`]:{backgroundColor:t?e.stigg.palette.primaryLight:e.stigg.palette.primary}})),Tf=y(L2__default.default)({[`&.${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=Ac.useRef(),{readOnly:a,isLoadingCheckoutData:s}=n,{activeStep:l,completedSteps:c,steps:d}=e||{},u=(l+1)*100/d.length,[p,h]=Ac__default.default.useState(o);return Ac.useEffect(()=>{i||r.current&&o!==p&&r.current.scrollIntoView({behavior:"smooth"}),h(o);},[o,i,p,h]),e.steps.length===1?null:jsxRuntime.jsxs(Na__default.default,{className:"stigg-checkout-progress-container",sx:{width:"100%",mb:3},ref:r,children:[jsxRuntime.jsx(Sf,{variant:"determinate",value:u,$disabled:a}),jsxRuntime.jsx(Se__default.default,{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 jsxRuntime.jsx(Se__default.default,{item:true,display:"flex",flexDirection:"row",flex:i?1:"auto",justifyContent:"flex-start",children:s?jsxRuntime.jsx(dt,{width:120,height:20,style:{marginTop:8}}):jsxRuntime.jsx(Tf,{onClick:()=>t(f),fullWidth:true,disabled:b,children:jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",flexDirection:"row",alignItems:"center",gap:1,children:[jsxRuntime.jsx(fw__default.default,{icon:jsxRuntime.jsx(kf,{icon:x?b?"OutlinedCheckedCircleDisabled":"OutlinedCheckedCircle":"OutlinedCircle",$disabled:b,$shouldFill:x})}),jsxRuntime.jsx(P,{variant:"h6",color:b?"primary.main.light":"primary.main",children:g})]})})},m)})})]})};var bw=[rh.BillingModel.FlatFee,rh.BillingModel.PerUnit,rh.BillingModel.UsageBased],Cw=e=>Hg__default.default(e,[t=>bw.indexOf(t.pricingModel),t=>{var o;return (o=t.feature)==null?void 0:o.displayName}]),ya=e=>Ac.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=>jsxRuntime.jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"plus",children:[jsxRuntime.jsx("path",{id:"Shape",d:"M10 4.16666V15.8333",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{id:"Shape_2",d:"M4.16699 10H15.8337",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),xa=Tw;var ww=y(xa)`
683
+ `;var kf=y(BT__default.default)(({theme:e,$disabled:t})=>({[`&.${BT.linearProgressClasses.root}`]:{borderRadius:e.stigg.border.radius,backgroundColor:e.stigg.palette.outlinedBorder},[`& .${BT.linearProgressClasses.bar}`]:{backgroundColor:t?e.stigg.palette.primaryLight:e.stigg.palette.primary}})),wf=y(B2__default.default)({[`&.${B2.buttonClasses.root}`]:{textTransform:"none",lineHeight:"inherit",justifyContent:"flex-start",padding:"8px 4px"}}),vf=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 Af=()=>{let{progressBarState:e,setActiveStep:t,currentStep:o}=ke(),{widgetState:n}=Y(),i=Dt("md"),r=Fc.useRef(),{readOnly:a,isLoadingCheckoutData:s}=n,{activeStep:l,completedSteps:c,steps:d}=e||{},u=(l+1)*100/d.length,[p,h]=Fc__default.default.useState(o);return Fc.useEffect(()=>{i||r.current&&o!==p&&r.current.scrollIntoView({behavior:"smooth"}),h(o);},[o,i,p,h]),e.steps.length===1?null:jsxRuntime.jsxs(Ua__default.default,{className:"stigg-checkout-progress-container",sx:{width:"100%",mb:3},ref:r,children:[jsxRuntime.jsx(kf,{variant:"determinate",value:u,$disabled:a}),jsxRuntime.jsx(Se__default.default,{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 jsxRuntime.jsx(Se__default.default,{item:true,display:"flex",flexDirection:"row",flex:i?1:"auto",justifyContent:"flex-start",children:s?jsxRuntime.jsx(dt,{width:120,height:20,style:{marginTop:8}}):jsxRuntime.jsx(wf,{onClick:()=>t(f),fullWidth:true,disabled:b,children:jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",flexDirection:"row",alignItems:"center",gap:1,children:[jsxRuntime.jsx(xw__default.default,{icon:jsxRuntime.jsx(vf,{icon:x?b?"OutlinedCheckedCircleDisabled":"OutlinedCheckedCircle":"OutlinedCircle",$disabled:b,$shouldFill:x})}),jsxRuntime.jsx(P,{variant:"h6",color:b?"primary.main.light":"primary.main",children:g})]})})},m)})})]})};var Pw=[ah.BillingModel.FlatFee,ah.BillingModel.PerUnit,ah.BillingModel.UsageBased],Sw=e=>Gg__default.default(e,[t=>Pw.indexOf(t.pricingModel),t=>{var o;return (o=t.feature)==null?void 0:o.displayName}]),xa=e=>Fc.useMemo(()=>Sw(e),[e]);function Tw(){let[{promotionCode:e}]=j();return e}function kw(){let[,e]=j();return t=>e(o=>{o.promotionCode=t;})}function Mn(){return {promotionCode:Tw(),setPromotionCode:kw()}}var ww=e=>jsxRuntime.jsx("svg",A(S({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"plus",children:[jsxRuntime.jsx("path",{id:"Shape",d:"M10 4.16666V15.8333",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{id:"Shape_2",d:"M4.16699 10H15.8337",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]})})),ba=ww;var _w=y(ba)`
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
- `,Af=({onAddClick:e,checkoutLocalization:t,disabled:o})=>jsxRuntime.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:[jsxRuntime.jsx(ww,{$disabled:o,className:"stigg-checkout-summary-add-coupon-code-button-icon"}),jsxRuntime.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)`
688
+ `,If=({onAddClick:e,checkoutLocalization:t,disabled:o})=>jsxRuntime.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:[jsxRuntime.jsx(_w,{$disabled:o,className:"stigg-checkout-summary-add-coupon-code-button-icon"}),jsxRuntime.jsx(P,{className:"stigg-checkout-change-plan-button-text",color:o?"disabled":"primary.main",style:{lineHeight:"24px"},variant:"h3",children:t.summary.addCouponCodeText})]});var Fw=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
- `,Mf=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{setPromotionCode:n}=An(),[i,r]=Ac.useState(false),[a,s]=Ac__default.default.useState(""),[l,c]=Ac__default.default.useState(false),[d,u]=Ac__default.default.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?jsxRuntime.jsxs(Se__default.default,{children:[jsxRuntime.jsx(P,{variant:"body1",color:d?"error":e?"disabled":"primary.main",children:t.summary.couponCodeTitle}),jsxRuntime.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:jsxRuntime.jsx(Iw,{variant:"contained",disabled:e,onClick:()=>{h();},children:l?jsxRuntime.jsx(Aw__default.default,{size:18,sx:{color:"white"}}):jsxRuntime.jsx(mt,{style:{display:"flex"},icon:"ArrowForward"})})}}),!!d&&jsxRuntime.jsx(P,{variant:"body1",color:"error",children:d})]}):jsxRuntime.jsx(Af,{disabled:e,onAddClick:()=>r(true),checkoutLocalization:t})};var Fw=y(Se__default.default)`
694
+ `,Ef=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{setPromotionCode:n}=Mn(),[i,r]=Fc.useState(false),[a,s]=Fc__default.default.useState(""),[l,c]=Fc__default.default.useState(false),[d,u]=Fc__default.default.useState(""),{previewSubscriptionAction:p}=wc({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?jsxRuntime.jsxs(Se__default.default,{children:[jsxRuntime.jsx(P,{variant:"body1",color:d?"error":e?"disabled":"primary.main",children:t.summary.couponCodeTitle}),jsxRuntime.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:jsxRuntime.jsx(Fw,{variant:"contained",disabled:e,onClick:()=>{h();},children:l?jsxRuntime.jsx(Iw__default.default,{size:18,sx:{color:"white"}}):jsxRuntime.jsx(mt,{style:{display:"flex"},icon:"ArrowForward"})})}}),!!d&&jsxRuntime.jsx(P,{variant:"body1",color:"error",children:d})]}):jsxRuntime.jsx(If,{disabled:e,onAddClick:()=>r(true),checkoutLocalization:t})};var Bw=y(Se__default.default)`
695
695
  width: auto;
696
696
  display: inline-flex;
697
697
  align-items: center;
@@ -700,7 +700,7 @@
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
- `,If=y(mt)`
703
+ `,Ff=y(mt)`
704
704
  display: flex;
705
705
 
706
706
  g {
@@ -710,9 +710,9 @@
710
710
  path {
711
711
  fill: ${({theme:e,$shouldFill:t})=>t?e.stigg.palette.primary:void 0};
712
712
  }
713
- `,Ff=({promotionCode:e,onClearPromotionCode:t})=>jsxRuntime.jsxs(Fw,{container:true,children:[jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[jsxRuntime.jsx(If,{icon:"Coupon"}),jsxRuntime.jsx(P,{variant:"body1",color:"primary.main",lineHeight:"auto",children:e})]}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsx(kt,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:t,children:jsxRuntime.jsx(If,{icon:"Close",$shouldFill:true})})})]});var Lw=y.div`
713
+ `,Bf=({promotionCode:e,onClearPromotionCode:t})=>jsxRuntime.jsxs(Bw,{container:true,children:[jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[jsxRuntime.jsx(Ff,{icon:"Coupon"}),jsxRuntime.jsx(P,{variant:"body1",color:"primary.main",lineHeight:"auto",children:e})]}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsx(kt,{variant:"text",sx:{minWidth:"unset",padding:0},onClick:t,children:jsxRuntime.jsx(Ff,{icon:"Close",$shouldFill:true})})})]});var Rw=y.div`
714
714
  margin: 16px 0;
715
- `,Lf=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{promotionCode:n,setPromotionCode:i}=An();return jsxRuntime.jsx(Lw,{children:n?jsxRuntime.jsx(Ff,{promotionCode:n,onClearPromotionCode:()=>{i("");}}):jsxRuntime.jsx(Mf,{disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})})};var Bf=({label:e,checked:t,onChange:o,onClick:n,value:i,disabled:r,dataTestId:a})=>jsxRuntime.jsx(material.FormControlLabel,{onClick:n,value:i,control:jsxRuntime.jsx(material.Checkbox,{checked:t,onChange:o,disabled:r,"data-testid":a}),label:lodash.isString(e)?jsxRuntime.jsx(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:e}):e});var Fc=[{country:"Albania",countryCode:"AL",taxIdType:"al_tin",FlagComponent:C__namespace.AL,example:"J12345678N"},{country:"Andorra",countryCode:"AD",taxIdType:"ad_nrt",FlagComponent:C__namespace.AD,example:"A-123456-Z"},{country:"Angola",countryCode:"AO",taxIdType:"ao_tin",FlagComponent:C__namespace.AO,example:"5123456789"},{country:"Argentina",countryCode:"AR",taxIdType:"ar_cuit",FlagComponent:C__namespace.AR,example:"12-3456789-01"},{country:"Armenia",countryCode:"AM",taxIdType:"am_tin",FlagComponent:C__namespace.AM,example:"02538904"},{country:"Aruba",countryCode:"AW",taxIdType:"aw_tin",FlagComponent:C__namespace.AW,example:"12345678"},{country:"Australia",countryCode:"AU",taxIdType:"au_abn",FlagComponent:C__namespace.AU,example:"12345678912"},{country:"Australia",countryCode:"AU",taxIdType:"au_arn",FlagComponent:C__namespace.AU,example:"123456789123"},{country:"Austria",countryCode:"AT",taxIdType:"eu_vat",FlagComponent:C__namespace.AT,example:"ATU12345678"},{country:"Azerbaijan",countryCode:"AZ",taxIdType:"az_tin",FlagComponent:C__namespace.AZ,example:"0123456789"},{country:"Bahamas",countryCode:"BS",taxIdType:"bs_tin",FlagComponent:C__namespace.BS,example:"123.456.789"},{country:"Bahrain",countryCode:"BH",taxIdType:"bh_vat",FlagComponent:C__namespace.BH,example:"123456789012345"},{country:"Bangladesh",countryCode:"BD",taxIdType:"bd_bin",FlagComponent:C__namespace.BD,example:"123456789-0123"},{country:"Barbados",countryCode:"BB",taxIdType:"bb_tin",FlagComponent:C__namespace.BB,example:"1123456789012"},{country:"Belarus",countryCode:"BY",taxIdType:"by_tin",FlagComponent:C__namespace.BY,example:"123456789"},{country:"Belgium",countryCode:"BE",taxIdType:"eu_vat",FlagComponent:C__namespace.BE,example:"BE0123456789"},{country:"Benin",countryCode:"BJ",taxIdType:"bj_ifu",FlagComponent:C__namespace.BJ,example:"1234567890123"},{country:"Bolivia",countryCode:"BO",taxIdType:"bo_tin",FlagComponent:C__namespace.BO,example:"123456789"},{country:"Bosnia & Herzegovina",countryCode:"BA",taxIdType:"ba_tin",FlagComponent:C__namespace.BA,example:"123456789012"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cnpj",FlagComponent:C__namespace.BR,example:"01.234.456/5432-10"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cpf",FlagComponent:C__namespace.BR,example:"123.456.789-87"},{country:"Bulgaria",countryCode:"BG",taxIdType:"bg_uic",FlagComponent:C__namespace.BG,example:"123456789"},{country:"Bulgaria",countryCode:"BG",taxIdType:"eu_vat",FlagComponent:C__namespace.BG,example:"BG0123456789"},{country:"Burkina Faso",countryCode:"BF",taxIdType:"bf_ifu",FlagComponent:C__namespace.BF,example:"12345678A"},{country:"Cambodia",countryCode:"KH",taxIdType:"kh_tin",FlagComponent:C__namespace.KH,example:"1001-123456789"},{country:"Cameroon",countryCode:"CM",taxIdType:"cm_niu",FlagComponent:C__namespace.CM,example:"M123456789000L"},{country:"Canada",countryCode:"CA",taxIdType:"ca_bn",FlagComponent:C__namespace.CA,example:"123456789"},{country:"Canada",countryCode:"CA",taxIdType:"ca_gst_hst",FlagComponent:C__namespace.CA,example:"123456789RT0002"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_bc",FlagComponent:C__namespace.CA,example:"PST-1234-5678"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_mb",FlagComponent:C__namespace.CA,example:"123456-7"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_sk",FlagComponent:C__namespace.CA,example:"1234567"},{country:"Canada",countryCode:"CA",taxIdType:"ca_qst",FlagComponent:C__namespace.CA,example:"1234567890TQ1234"},{country:"Cape Verde",countryCode:"CV",taxIdType:"cv_nif",FlagComponent:C__namespace.CV,example:"213456789"},{country:"Chile",countryCode:"CL",taxIdType:"cl_tin",FlagComponent:C__namespace.CL,example:"12.345.678-K"},{country:"China",countryCode:"CN",taxIdType:"cn_tin",FlagComponent:C__namespace.CN,example:"123456789012345678"},{country:"Colombia",countryCode:"CO",taxIdType:"co_nit",FlagComponent:C__namespace.CO,example:"123.456.789-0"},{country:"Congo - Kinshasa",countryCode:"CD",taxIdType:"cd_nif",FlagComponent:C__namespace.CD,example:"A0123456M"},{country:"Costa Rica",countryCode:"CR",taxIdType:"cr_tin",FlagComponent:C__namespace.CR,example:"1-234-567890"},{country:"Croatia",countryCode:"HR",taxIdType:"eu_vat",FlagComponent:C__namespace.HR,example:"HR12345678912"},{country:"Croatia",countryCode:"HR",taxIdType:"hr_oib",FlagComponent:C__namespace.HR,example:"12345678901"},{country:"Cyprus",countryCode:"CY",taxIdType:"eu_vat",FlagComponent:C__namespace.CY,example:"CY12345678Z"},{country:"Czech Republic",countryCode:"CZ",taxIdType:"eu_vat",FlagComponent:C__namespace.CZ,example:"CZ1234567890"},{country:"Denmark",countryCode:"DK",taxIdType:"eu_vat",FlagComponent:C__namespace.DK,example:"DK12345678"},{country:"Dominican Republic",countryCode:"DO",taxIdType:"do_rcn",FlagComponent:C__namespace.DO,example:"123-4567890-1"},{country:"Ecuador",countryCode:"EC",taxIdType:"ec_ruc",FlagComponent:C__namespace.EC,example:"1234567890001"},{country:"Egypt",countryCode:"EG",taxIdType:"eg_tin",FlagComponent:C__namespace.EG,example:"123456789"},{country:"El Salvador",countryCode:"SV",taxIdType:"sv_nit",FlagComponent:C__namespace.SV,example:"1234-567890-123-4"},{country:"Estonia",countryCode:"EE",taxIdType:"eu_vat",FlagComponent:C__namespace.EE,example:"EE123456789"},{country:"Ethiopia",countryCode:"ET",taxIdType:"et_tin",FlagComponent:C__namespace.ET,example:"1234567890"},{country:"EU",countryCode:"EU",taxIdType:"eu_oss_vat",FlagComponent:C__namespace.EU,example:"EU123456789"},{country:"Finland",countryCode:"FI",taxIdType:"eu_vat",FlagComponent:C__namespace.FI,example:"FI12345678"},{country:"France",countryCode:"FR",taxIdType:"eu_vat",FlagComponent:C__namespace.FR,example:"FRAB123456789"},{country:"Georgia",countryCode:"GE",taxIdType:"ge_vat",FlagComponent:C__namespace.GE,example:"123456789"},{country:"Germany",countryCode:"DE",taxIdType:"de_stn",FlagComponent:C__namespace.DE,example:"1234567890"},{country:"Germany",countryCode:"DE",taxIdType:"eu_vat",FlagComponent:C__namespace.DE,example:"DE123456789"},{country:"Greece",countryCode:"GR",taxIdType:"eu_vat",FlagComponent:C__namespace.GR,example:"EL123456789"},{country:"Guinea",countryCode:"GN",taxIdType:"gn_nif",FlagComponent:C__namespace.GN,example:"123456789"},{country:"Hong Kong",countryCode:"HK",taxIdType:"hk_br",FlagComponent:C__namespace.HK,example:"12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"eu_vat",FlagComponent:C__namespace.HU,example:"HU12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"hu_tin",FlagComponent:C__namespace.HU,example:"12345678-1-23"},{country:"Iceland",countryCode:"IS",taxIdType:"is_vat",FlagComponent:C__namespace.IS,example:"123456"},{country:"India",countryCode:"IN",taxIdType:"in_gst",FlagComponent:C__namespace.IN,example:"12ABCDE3456FGZH"},{country:"Indonesia",countryCode:"ID",taxIdType:"id_npwp",FlagComponent:C__namespace.ID,example:"012.345.678.9-012.345"},{country:"Ireland",countryCode:"IE",taxIdType:"eu_vat",FlagComponent:C__namespace.IE,example:"IE1234567AB"},{country:"Israel",countryCode:"IL",taxIdType:"il_vat",FlagComponent:C__namespace.IL,example:"000012345"},{country:"Italy",countryCode:"IT",taxIdType:"eu_vat",FlagComponent:C__namespace.IT,example:"IT12345678912"},{country:"Japan",countryCode:"JP",taxIdType:"jp_cn",FlagComponent:C__namespace.JP,example:"1234567891234"},{country:"Japan",countryCode:"JP",taxIdType:"jp_rn",FlagComponent:C__namespace.JP,example:"12345"},{country:"Japan",countryCode:"JP",taxIdType:"jp_trn",FlagComponent:C__namespace.JP,example:"T1234567891234"},{country:"Kazakhstan",countryCode:"KZ",taxIdType:"kz_bin",FlagComponent:C__namespace.KZ,example:"123456789012"},{country:"Kenya",countryCode:"KE",taxIdType:"ke_pin",FlagComponent:C__namespace.KE,example:"P000111111A"},{country:"Kyrgyzstan",countryCode:"KG",taxIdType:"kg_tin",FlagComponent:C__namespace.KG,example:"12345678901234"},{country:"Laos",countryCode:"LA",taxIdType:"la_tin",FlagComponent:C__namespace.LA,example:"123456789-000"},{country:"Latvia",countryCode:"LV",taxIdType:"eu_vat",FlagComponent:C__namespace.LV,example:"LV12345678912"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_uid",FlagComponent:C__namespace.LI,example:"CHE123456789"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_vat",FlagComponent:C__namespace.LI,example:"12345"},{country:"Lithuania",countryCode:"LT",taxIdType:"eu_vat",FlagComponent:C__namespace.LT,example:"LT123456789123"},{country:"Luxembourg",countryCode:"LU",taxIdType:"eu_vat",FlagComponent:C__namespace.LU,example:"LU12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_frp",FlagComponent:C__namespace.MY,example:"12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_itn",FlagComponent:C__namespace.MY,example:"C 1234567890"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_sst",FlagComponent:C__namespace.MY,example:"A12-3456-78912345"},{country:"Malta",countryCode:"MT",taxIdType:"eu_vat",FlagComponent:C__namespace.MT,example:"MT12345678"},{country:"Mauritania",countryCode:"MR",taxIdType:"mr_nif",FlagComponent:C__namespace.MR,example:"12345678"},{country:"Mexico",countryCode:"MX",taxIdType:"mx_rfc",FlagComponent:C__namespace.MX,example:"ABC010203AB9"},{country:"Moldova",countryCode:"MD",taxIdType:"md_vat",FlagComponent:C__namespace.MD,example:"1234567"},{country:"Montenegro",countryCode:"ME",taxIdType:"me_pib",FlagComponent:C__namespace.ME,example:"12345678"},{country:"Morocco",countryCode:"MA",taxIdType:"ma_vat",FlagComponent:C__namespace.MA,example:"12345678"},{country:"Nepal",countryCode:"NP",taxIdType:"np_pan",FlagComponent:C__namespace.NP,example:"123456789"},{country:"Netherlands",countryCode:"NL",taxIdType:"eu_vat",FlagComponent:C__namespace.NL,example:"NL123456789B12"},{country:"New Zealand",countryCode:"NZ",taxIdType:"nz_gst",FlagComponent:C__namespace.NZ,example:"123456789"},{country:"Nigeria",countryCode:"NG",taxIdType:"ng_tin",FlagComponent:C__namespace.NG,example:"12345678-0001"},{country:"North Macedonia",countryCode:"MK",taxIdType:"mk_vat",FlagComponent:C__namespace.MK,example:"MK1234567890123"},{country:"Norway",countryCode:"NO",taxIdType:"no_vat",FlagComponent:C__namespace.NO,example:"123456789MVA"},{country:"Norway",countryCode:"NO",taxIdType:"no_voec",FlagComponent:C__namespace.NO,example:"1234567"},{country:"Oman",countryCode:"OM",taxIdType:"om_vat",FlagComponent:C__namespace.OM,example:"OM1234567890"},{country:"Peru",countryCode:"PE",taxIdType:"pe_ruc",FlagComponent:C__namespace.PE,example:"12345678901"},{country:"Philippines",countryCode:"PH",taxIdType:"ph_tin",FlagComponent:C__namespace.PH,example:"123456789012"},{country:"Poland",countryCode:"PL",taxIdType:"eu_vat",FlagComponent:C__namespace.PL,example:"PL1234567890"},{country:"Portugal",countryCode:"PT",taxIdType:"eu_vat",FlagComponent:C__namespace.PT,example:"PT123456789"},{country:"Romania",countryCode:"RO",taxIdType:"eu_vat",FlagComponent:C__namespace.RO,example:"RO1234567891"},{country:"Romania",countryCode:"RO",taxIdType:"ro_tin",FlagComponent:C__namespace.RO,example:"1234567890123"},{country:"Russia",countryCode:"RU",taxIdType:"ru_inn",FlagComponent:C__namespace.RU,example:"1234567891"},{country:"Russia",countryCode:"RU",taxIdType:"ru_kpp",FlagComponent:C__namespace.RU,example:"123456789"},{country:"Saudi Arabia",countryCode:"SA",taxIdType:"sa_vat",FlagComponent:C__namespace.SA,example:"123456789012345"},{country:"Senegal",countryCode:"SN",taxIdType:"sn_ninea",FlagComponent:C__namespace.SN,example:"12345672A2"},{country:"Serbia",countryCode:"RS",taxIdType:"rs_pib",FlagComponent:C__namespace.RS,example:"123456789"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_gst",FlagComponent:C__namespace.SG,example:"M12345678X"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_uen",FlagComponent:C__namespace.SG,example:"123456789F"},{country:"Slovakia",countryCode:"SK",taxIdType:"eu_vat",FlagComponent:C__namespace.SK,example:"SK1234567891"},{country:"Slovenia",countryCode:"SI",taxIdType:"eu_vat",FlagComponent:C__namespace.SI,example:"SI12345678"},{country:"Slovenia",countryCode:"SI",taxIdType:"si_tin",FlagComponent:C__namespace.SI,example:"12345678"},{country:"South Africa",countryCode:"ZA",taxIdType:"za_vat",FlagComponent:C__namespace.ZA,example:"4123456789"},{country:"South Korea",countryCode:"KR",taxIdType:"kr_brn",FlagComponent:C__namespace.KR,example:"123-45-67890"},{country:"Spain",countryCode:"ES",taxIdType:"es_cif",FlagComponent:C__namespace.ES,example:"A12345678"},{country:"Spain",countryCode:"ES",taxIdType:"eu_vat",FlagComponent:C__namespace.ES,example:"ESA1234567Z"},{country:"Suriname",countryCode:"SR",taxIdType:"sr_fin",FlagComponent:C__namespace.SR,example:"1234567890"},{country:"Sweden",countryCode:"SE",taxIdType:"eu_vat",FlagComponent:C__namespace.SE,example:"SE123456789123"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_uid",FlagComponent:C__namespace.CH,example:"CHE-123.456.789 HR"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_vat",FlagComponent:C__namespace.CH,example:"CHE-123.456.789 MWST"},{country:"Taiwan",countryCode:"TW",taxIdType:"tw_vat",FlagComponent:C__namespace.TW,example:"12345678"},{country:"Tajikistan",countryCode:"TJ",taxIdType:"tj_tin",FlagComponent:C__namespace.TJ,example:"123456789"},{country:"Tanzania",countryCode:"TZ",taxIdType:"tz_vat",FlagComponent:C__namespace.TZ,example:"12345678A"},{country:"Thailand",countryCode:"TH",taxIdType:"th_vat",FlagComponent:C__namespace.TH,example:"1234567891234"},{country:"Turkey",countryCode:"TR",taxIdType:"tr_tin",FlagComponent:C__namespace.TR,example:"0123456789"},{country:"Uganda",countryCode:"UG",taxIdType:"ug_tin",FlagComponent:C__namespace.UG,example:"1014751879"},{country:"Ukraine",countryCode:"UA",taxIdType:"ua_vat",FlagComponent:C__namespace.UA,example:"123456789"},{country:"United Arab Emirates",countryCode:"AE",taxIdType:"ae_trn",FlagComponent:C__namespace.AE,example:"123456789012345"},{country:"United Kingdom",countryCode:"GB",taxIdType:"eu_vat",FlagComponent:C__namespace.GB,example:"XI123456789"},{country:"United Kingdom",countryCode:"GB",taxIdType:"gb_vat",FlagComponent:C__namespace.GB,example:"GB123456789"},{country:"United States",countryCode:"US",taxIdType:"us_ein",FlagComponent:C__namespace.US,example:"12-3456789"},{country:"Uruguay",countryCode:"UY",taxIdType:"uy_ruc",FlagComponent:C__namespace.UY,example:"123456789012"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_tin",FlagComponent:C__namespace.UZ,example:"123456789"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_vat",FlagComponent:C__namespace.UZ,example:"123456789012"},{country:"Venezuela",countryCode:"VE",taxIdType:"ve_rif",FlagComponent:C__namespace.VE,example:"A-12345678-9"},{country:"Vietnam",countryCode:"VN",taxIdType:"vn_tin",FlagComponent:C__namespace.VN,example:"1234567890"},{country:"Zambia",countryCode:"ZM",taxIdType:"zm_tin",FlagComponent:C__namespace.ZM,example:"1004751879"},{country:"Zimbabwe",countryCode:"ZW",taxIdType:"zw_tin",FlagComponent:C__namespace.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(material.Autocomplete)(()=>({"& .MuiAutocomplete-input":{padding:"0 !important"}})),Sa=y(P)({});Sa.defaultProps={variant:"body1",color:"secondary"};function Nf(){let[e,t]=Ac.useState(false),{billingAddress:o,taxId:n,setTaxId:i}=vt(),[r,a]=Ac.useState(Pa),[s,l]=Ac.useState(false),c=Ac.useCallback((m,g,f)=>{i({type:g,value:f}),a(m);},[i,a]);Ac.useEffect(()=>{l(false);},[o==null?void 0:o.country]),Ac.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=Ac.useMemo(()=>Array.from(Lc.keys()),[]),p=Ac.useMemo(()=>u.find(m=>m===r)||null,[u,r]),h=Ac.useMemo(()=>{let m=Mn(r);return (m==null?void 0:m.example)||"Add your VAT/GST or local tax ID."},[r]);return Ac.useEffect(()=>(e||(l(false),c(Pa,ba,"")),()=>{c(Pa,ba,"");}),[e,c]),jsxRuntime.jsxs(Se__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(Se__default.default,{flexDirection:"row",container:true,gap:2,children:jsxRuntime.jsx(Bf,{checked:e,onChange:()=>t(m=>!m),label:jsxRuntime.jsx(Sa,{children:"I'm purchasing as a business"})})}),jsxRuntime.jsx(material.Collapse,{in:e,children:jsxRuntime.jsxs(Se__default.default,{container:true,spacing:0,sx:{width:"100%"},children:[jsxRuntime.jsxs(Se__default.default,{item:true,xs:6,children:[jsxRuntime.jsx(Sa,{children:"Tax ID Type"}),jsxRuntime.jsx(Hw,{fullWidth:true,options:u,value:p,onChange:(m,g)=>d(g),renderInput:m=>jsxRuntime.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 Ac.createElement(material.MenuItem,A(S({},m),{key:g}),jsxRuntime.jsxs(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:[T&&jsxRuntime.jsx(T,{width:15,style:{marginRight:"5px",borderRadius:"8%"}}),lodash.startCase(b)," - ",lodash.upperCase(x)]}))},getOptionLabel:m=>{let g=Mn(m);return g?`${lodash.startCase(g.country)} - ${lodash.upperCase(g.taxIdType)}`:m},ListboxProps:{sx:{maxHeight:200}}})]}),jsxRuntime.jsxs(Se__default.default,{item:true,xs:6,paddingLeft:"12px",children:[jsxRuntime.jsx(Sa,{children:"Tax ID"}),jsxRuntime.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=Ac.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 jsxRuntime.jsxs(Se__default.default,{flexDirection:"column",container:true,gap:3,padding:"16px",sx:{pointerEvents:d?"none":void 0},children:[jsxRuntime.jsxs(Se__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(P,{variant:"h6",children:i.newPaymentMethodBillingAddressTitle}),jsxRuntime.jsx(reactStripeJs.AddressElement,{onChange:h,options:{mode:"billing",fields:{phone:u?"always":"auto"},defaultValues:S({},(l==null?void 0:l.name)&&{name:l.name})}})]}),jsxRuntime.jsxs(Se__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(P,{variant:"h6",children:i.newPaymentMethodCardTitle}),jsxRuntime.jsx(reactStripeJs.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&&jsxRuntime.jsx(Nf,{})]})}function Of(){let[e,t]=Ac.useState(null),{checkoutState:o}=Y(),{billingIntegration:n,setupSecret:i}=o||{};return Ac.useEffect(()=>{if(n){let{billingIdentifier:r,credentials:a}=n;if(r!==rh.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({},rh.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({},rh.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({},rh.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({},rh.ENUM_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function Ut({func:e}){let[t,o]=Ac.useState(true),[n,i]=Ac.useState(null),[r,a]=Ac.useState(null),s=Ac.useRef(false);return Ac.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=Ac.useCallback(()=>o?o.getActiveSubscriptions(e):Promise.resolve([]),[e,o]),{data:i,error:r,isLoading:a}=Ut({func:n});return Ac.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=Ac.useCallback(()=>o?o.getPaywall(e):Promise.resolve(null),[e,o]),{data:i,error:r,isLoading:a}=Ut({func:n});return Ac.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=Ac.useCallback(()=>o?o.getCustomerPortal(e):Promise.resolve(null),[e,o]),{data:i,error:r,isLoading:a}=Ut({func:n});return Ac.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=[rh.PaymentCollection.Failed,rh.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===rh.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__default.default)`
715
+ `,Rf=({disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})=>{let{promotionCode:n,setPromotionCode:i}=Mn();return jsxRuntime.jsx(Rw,{children:n?jsxRuntime.jsx(Bf,{promotionCode:n,onClearPromotionCode:()=>{i("");}}):jsxRuntime.jsx(Ef,{disabled:e,checkoutLocalization:t,onMockCheckoutPreview:o})})};var Df=({label:e,checked:t,onChange:o,onClick:n,value:i,disabled:r,dataTestId:a})=>jsxRuntime.jsx(material.FormControlLabel,{onClick:n,value:i,control:jsxRuntime.jsx(material.Checkbox,{checked:t,onChange:o,disabled:r,"data-testid":a}),label:lodash.isString(e)?jsxRuntime.jsx(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:e}):e});var Dc=[{country:"Albania",countryCode:"AL",taxIdType:"al_tin",FlagComponent:C__namespace.AL,example:"J12345678N"},{country:"Andorra",countryCode:"AD",taxIdType:"ad_nrt",FlagComponent:C__namespace.AD,example:"A-123456-Z"},{country:"Angola",countryCode:"AO",taxIdType:"ao_tin",FlagComponent:C__namespace.AO,example:"5123456789"},{country:"Argentina",countryCode:"AR",taxIdType:"ar_cuit",FlagComponent:C__namespace.AR,example:"12-3456789-01"},{country:"Armenia",countryCode:"AM",taxIdType:"am_tin",FlagComponent:C__namespace.AM,example:"02538904"},{country:"Aruba",countryCode:"AW",taxIdType:"aw_tin",FlagComponent:C__namespace.AW,example:"12345678"},{country:"Australia",countryCode:"AU",taxIdType:"au_abn",FlagComponent:C__namespace.AU,example:"12345678912"},{country:"Australia",countryCode:"AU",taxIdType:"au_arn",FlagComponent:C__namespace.AU,example:"123456789123"},{country:"Austria",countryCode:"AT",taxIdType:"eu_vat",FlagComponent:C__namespace.AT,example:"ATU12345678"},{country:"Azerbaijan",countryCode:"AZ",taxIdType:"az_tin",FlagComponent:C__namespace.AZ,example:"0123456789"},{country:"Bahamas",countryCode:"BS",taxIdType:"bs_tin",FlagComponent:C__namespace.BS,example:"123.456.789"},{country:"Bahrain",countryCode:"BH",taxIdType:"bh_vat",FlagComponent:C__namespace.BH,example:"123456789012345"},{country:"Bangladesh",countryCode:"BD",taxIdType:"bd_bin",FlagComponent:C__namespace.BD,example:"123456789-0123"},{country:"Barbados",countryCode:"BB",taxIdType:"bb_tin",FlagComponent:C__namespace.BB,example:"1123456789012"},{country:"Belarus",countryCode:"BY",taxIdType:"by_tin",FlagComponent:C__namespace.BY,example:"123456789"},{country:"Belgium",countryCode:"BE",taxIdType:"eu_vat",FlagComponent:C__namespace.BE,example:"BE0123456789"},{country:"Benin",countryCode:"BJ",taxIdType:"bj_ifu",FlagComponent:C__namespace.BJ,example:"1234567890123"},{country:"Bolivia",countryCode:"BO",taxIdType:"bo_tin",FlagComponent:C__namespace.BO,example:"123456789"},{country:"Bosnia & Herzegovina",countryCode:"BA",taxIdType:"ba_tin",FlagComponent:C__namespace.BA,example:"123456789012"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cnpj",FlagComponent:C__namespace.BR,example:"01.234.456/5432-10"},{country:"Brazil",countryCode:"BR",taxIdType:"br_cpf",FlagComponent:C__namespace.BR,example:"123.456.789-87"},{country:"Bulgaria",countryCode:"BG",taxIdType:"bg_uic",FlagComponent:C__namespace.BG,example:"123456789"},{country:"Bulgaria",countryCode:"BG",taxIdType:"eu_vat",FlagComponent:C__namespace.BG,example:"BG0123456789"},{country:"Burkina Faso",countryCode:"BF",taxIdType:"bf_ifu",FlagComponent:C__namespace.BF,example:"12345678A"},{country:"Cambodia",countryCode:"KH",taxIdType:"kh_tin",FlagComponent:C__namespace.KH,example:"1001-123456789"},{country:"Cameroon",countryCode:"CM",taxIdType:"cm_niu",FlagComponent:C__namespace.CM,example:"M123456789000L"},{country:"Canada",countryCode:"CA",taxIdType:"ca_bn",FlagComponent:C__namespace.CA,example:"123456789"},{country:"Canada",countryCode:"CA",taxIdType:"ca_gst_hst",FlagComponent:C__namespace.CA,example:"123456789RT0002"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_bc",FlagComponent:C__namespace.CA,example:"PST-1234-5678"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_mb",FlagComponent:C__namespace.CA,example:"123456-7"},{country:"Canada",countryCode:"CA",taxIdType:"ca_pst_sk",FlagComponent:C__namespace.CA,example:"1234567"},{country:"Canada",countryCode:"CA",taxIdType:"ca_qst",FlagComponent:C__namespace.CA,example:"1234567890TQ1234"},{country:"Cape Verde",countryCode:"CV",taxIdType:"cv_nif",FlagComponent:C__namespace.CV,example:"213456789"},{country:"Chile",countryCode:"CL",taxIdType:"cl_tin",FlagComponent:C__namespace.CL,example:"12.345.678-K"},{country:"China",countryCode:"CN",taxIdType:"cn_tin",FlagComponent:C__namespace.CN,example:"123456789012345678"},{country:"Colombia",countryCode:"CO",taxIdType:"co_nit",FlagComponent:C__namespace.CO,example:"123.456.789-0"},{country:"Congo - Kinshasa",countryCode:"CD",taxIdType:"cd_nif",FlagComponent:C__namespace.CD,example:"A0123456M"},{country:"Costa Rica",countryCode:"CR",taxIdType:"cr_tin",FlagComponent:C__namespace.CR,example:"1-234-567890"},{country:"Croatia",countryCode:"HR",taxIdType:"eu_vat",FlagComponent:C__namespace.HR,example:"HR12345678912"},{country:"Croatia",countryCode:"HR",taxIdType:"hr_oib",FlagComponent:C__namespace.HR,example:"12345678901"},{country:"Cyprus",countryCode:"CY",taxIdType:"eu_vat",FlagComponent:C__namespace.CY,example:"CY12345678Z"},{country:"Czech Republic",countryCode:"CZ",taxIdType:"eu_vat",FlagComponent:C__namespace.CZ,example:"CZ1234567890"},{country:"Denmark",countryCode:"DK",taxIdType:"eu_vat",FlagComponent:C__namespace.DK,example:"DK12345678"},{country:"Dominican Republic",countryCode:"DO",taxIdType:"do_rcn",FlagComponent:C__namespace.DO,example:"123-4567890-1"},{country:"Ecuador",countryCode:"EC",taxIdType:"ec_ruc",FlagComponent:C__namespace.EC,example:"1234567890001"},{country:"Egypt",countryCode:"EG",taxIdType:"eg_tin",FlagComponent:C__namespace.EG,example:"123456789"},{country:"El Salvador",countryCode:"SV",taxIdType:"sv_nit",FlagComponent:C__namespace.SV,example:"1234-567890-123-4"},{country:"Estonia",countryCode:"EE",taxIdType:"eu_vat",FlagComponent:C__namespace.EE,example:"EE123456789"},{country:"Ethiopia",countryCode:"ET",taxIdType:"et_tin",FlagComponent:C__namespace.ET,example:"1234567890"},{country:"EU",countryCode:"EU",taxIdType:"eu_oss_vat",FlagComponent:C__namespace.EU,example:"EU123456789"},{country:"Finland",countryCode:"FI",taxIdType:"eu_vat",FlagComponent:C__namespace.FI,example:"FI12345678"},{country:"France",countryCode:"FR",taxIdType:"eu_vat",FlagComponent:C__namespace.FR,example:"FRAB123456789"},{country:"Georgia",countryCode:"GE",taxIdType:"ge_vat",FlagComponent:C__namespace.GE,example:"123456789"},{country:"Germany",countryCode:"DE",taxIdType:"de_stn",FlagComponent:C__namespace.DE,example:"1234567890"},{country:"Germany",countryCode:"DE",taxIdType:"eu_vat",FlagComponent:C__namespace.DE,example:"DE123456789"},{country:"Greece",countryCode:"GR",taxIdType:"eu_vat",FlagComponent:C__namespace.GR,example:"EL123456789"},{country:"Guinea",countryCode:"GN",taxIdType:"gn_nif",FlagComponent:C__namespace.GN,example:"123456789"},{country:"Hong Kong",countryCode:"HK",taxIdType:"hk_br",FlagComponent:C__namespace.HK,example:"12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"eu_vat",FlagComponent:C__namespace.HU,example:"HU12345678"},{country:"Hungary",countryCode:"HU",taxIdType:"hu_tin",FlagComponent:C__namespace.HU,example:"12345678-1-23"},{country:"Iceland",countryCode:"IS",taxIdType:"is_vat",FlagComponent:C__namespace.IS,example:"123456"},{country:"India",countryCode:"IN",taxIdType:"in_gst",FlagComponent:C__namespace.IN,example:"12ABCDE3456FGZH"},{country:"Indonesia",countryCode:"ID",taxIdType:"id_npwp",FlagComponent:C__namespace.ID,example:"012.345.678.9-012.345"},{country:"Ireland",countryCode:"IE",taxIdType:"eu_vat",FlagComponent:C__namespace.IE,example:"IE1234567AB"},{country:"Israel",countryCode:"IL",taxIdType:"il_vat",FlagComponent:C__namespace.IL,example:"000012345"},{country:"Italy",countryCode:"IT",taxIdType:"eu_vat",FlagComponent:C__namespace.IT,example:"IT12345678912"},{country:"Japan",countryCode:"JP",taxIdType:"jp_cn",FlagComponent:C__namespace.JP,example:"1234567891234"},{country:"Japan",countryCode:"JP",taxIdType:"jp_rn",FlagComponent:C__namespace.JP,example:"12345"},{country:"Japan",countryCode:"JP",taxIdType:"jp_trn",FlagComponent:C__namespace.JP,example:"T1234567891234"},{country:"Kazakhstan",countryCode:"KZ",taxIdType:"kz_bin",FlagComponent:C__namespace.KZ,example:"123456789012"},{country:"Kenya",countryCode:"KE",taxIdType:"ke_pin",FlagComponent:C__namespace.KE,example:"P000111111A"},{country:"Kyrgyzstan",countryCode:"KG",taxIdType:"kg_tin",FlagComponent:C__namespace.KG,example:"12345678901234"},{country:"Laos",countryCode:"LA",taxIdType:"la_tin",FlagComponent:C__namespace.LA,example:"123456789-000"},{country:"Latvia",countryCode:"LV",taxIdType:"eu_vat",FlagComponent:C__namespace.LV,example:"LV12345678912"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_uid",FlagComponent:C__namespace.LI,example:"CHE123456789"},{country:"Liechtenstein",countryCode:"LI",taxIdType:"li_vat",FlagComponent:C__namespace.LI,example:"12345"},{country:"Lithuania",countryCode:"LT",taxIdType:"eu_vat",FlagComponent:C__namespace.LT,example:"LT123456789123"},{country:"Luxembourg",countryCode:"LU",taxIdType:"eu_vat",FlagComponent:C__namespace.LU,example:"LU12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_frp",FlagComponent:C__namespace.MY,example:"12345678"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_itn",FlagComponent:C__namespace.MY,example:"C 1234567890"},{country:"Malaysia",countryCode:"MY",taxIdType:"my_sst",FlagComponent:C__namespace.MY,example:"A12-3456-78912345"},{country:"Malta",countryCode:"MT",taxIdType:"eu_vat",FlagComponent:C__namespace.MT,example:"MT12345678"},{country:"Mauritania",countryCode:"MR",taxIdType:"mr_nif",FlagComponent:C__namespace.MR,example:"12345678"},{country:"Mexico",countryCode:"MX",taxIdType:"mx_rfc",FlagComponent:C__namespace.MX,example:"ABC010203AB9"},{country:"Moldova",countryCode:"MD",taxIdType:"md_vat",FlagComponent:C__namespace.MD,example:"1234567"},{country:"Montenegro",countryCode:"ME",taxIdType:"me_pib",FlagComponent:C__namespace.ME,example:"12345678"},{country:"Morocco",countryCode:"MA",taxIdType:"ma_vat",FlagComponent:C__namespace.MA,example:"12345678"},{country:"Nepal",countryCode:"NP",taxIdType:"np_pan",FlagComponent:C__namespace.NP,example:"123456789"},{country:"Netherlands",countryCode:"NL",taxIdType:"eu_vat",FlagComponent:C__namespace.NL,example:"NL123456789B12"},{country:"New Zealand",countryCode:"NZ",taxIdType:"nz_gst",FlagComponent:C__namespace.NZ,example:"123456789"},{country:"Nigeria",countryCode:"NG",taxIdType:"ng_tin",FlagComponent:C__namespace.NG,example:"12345678-0001"},{country:"North Macedonia",countryCode:"MK",taxIdType:"mk_vat",FlagComponent:C__namespace.MK,example:"MK1234567890123"},{country:"Norway",countryCode:"NO",taxIdType:"no_vat",FlagComponent:C__namespace.NO,example:"123456789MVA"},{country:"Norway",countryCode:"NO",taxIdType:"no_voec",FlagComponent:C__namespace.NO,example:"1234567"},{country:"Oman",countryCode:"OM",taxIdType:"om_vat",FlagComponent:C__namespace.OM,example:"OM1234567890"},{country:"Peru",countryCode:"PE",taxIdType:"pe_ruc",FlagComponent:C__namespace.PE,example:"12345678901"},{country:"Philippines",countryCode:"PH",taxIdType:"ph_tin",FlagComponent:C__namespace.PH,example:"123456789012"},{country:"Poland",countryCode:"PL",taxIdType:"eu_vat",FlagComponent:C__namespace.PL,example:"PL1234567890"},{country:"Portugal",countryCode:"PT",taxIdType:"eu_vat",FlagComponent:C__namespace.PT,example:"PT123456789"},{country:"Romania",countryCode:"RO",taxIdType:"eu_vat",FlagComponent:C__namespace.RO,example:"RO1234567891"},{country:"Romania",countryCode:"RO",taxIdType:"ro_tin",FlagComponent:C__namespace.RO,example:"1234567890123"},{country:"Russia",countryCode:"RU",taxIdType:"ru_inn",FlagComponent:C__namespace.RU,example:"1234567891"},{country:"Russia",countryCode:"RU",taxIdType:"ru_kpp",FlagComponent:C__namespace.RU,example:"123456789"},{country:"Saudi Arabia",countryCode:"SA",taxIdType:"sa_vat",FlagComponent:C__namespace.SA,example:"123456789012345"},{country:"Senegal",countryCode:"SN",taxIdType:"sn_ninea",FlagComponent:C__namespace.SN,example:"12345672A2"},{country:"Serbia",countryCode:"RS",taxIdType:"rs_pib",FlagComponent:C__namespace.RS,example:"123456789"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_gst",FlagComponent:C__namespace.SG,example:"M12345678X"},{country:"Singapore",countryCode:"SG",taxIdType:"sg_uen",FlagComponent:C__namespace.SG,example:"123456789F"},{country:"Slovakia",countryCode:"SK",taxIdType:"eu_vat",FlagComponent:C__namespace.SK,example:"SK1234567891"},{country:"Slovenia",countryCode:"SI",taxIdType:"eu_vat",FlagComponent:C__namespace.SI,example:"SI12345678"},{country:"Slovenia",countryCode:"SI",taxIdType:"si_tin",FlagComponent:C__namespace.SI,example:"12345678"},{country:"South Africa",countryCode:"ZA",taxIdType:"za_vat",FlagComponent:C__namespace.ZA,example:"4123456789"},{country:"South Korea",countryCode:"KR",taxIdType:"kr_brn",FlagComponent:C__namespace.KR,example:"123-45-67890"},{country:"Spain",countryCode:"ES",taxIdType:"es_cif",FlagComponent:C__namespace.ES,example:"A12345678"},{country:"Spain",countryCode:"ES",taxIdType:"eu_vat",FlagComponent:C__namespace.ES,example:"ESA1234567Z"},{country:"Suriname",countryCode:"SR",taxIdType:"sr_fin",FlagComponent:C__namespace.SR,example:"1234567890"},{country:"Sweden",countryCode:"SE",taxIdType:"eu_vat",FlagComponent:C__namespace.SE,example:"SE123456789123"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_uid",FlagComponent:C__namespace.CH,example:"CHE-123.456.789 HR"},{country:"Switzerland",countryCode:"CH",taxIdType:"ch_vat",FlagComponent:C__namespace.CH,example:"CHE-123.456.789 MWST"},{country:"Taiwan",countryCode:"TW",taxIdType:"tw_vat",FlagComponent:C__namespace.TW,example:"12345678"},{country:"Tajikistan",countryCode:"TJ",taxIdType:"tj_tin",FlagComponent:C__namespace.TJ,example:"123456789"},{country:"Tanzania",countryCode:"TZ",taxIdType:"tz_vat",FlagComponent:C__namespace.TZ,example:"12345678A"},{country:"Thailand",countryCode:"TH",taxIdType:"th_vat",FlagComponent:C__namespace.TH,example:"1234567891234"},{country:"Turkey",countryCode:"TR",taxIdType:"tr_tin",FlagComponent:C__namespace.TR,example:"0123456789"},{country:"Uganda",countryCode:"UG",taxIdType:"ug_tin",FlagComponent:C__namespace.UG,example:"1014751879"},{country:"Ukraine",countryCode:"UA",taxIdType:"ua_vat",FlagComponent:C__namespace.UA,example:"123456789"},{country:"United Arab Emirates",countryCode:"AE",taxIdType:"ae_trn",FlagComponent:C__namespace.AE,example:"123456789012345"},{country:"United Kingdom",countryCode:"GB",taxIdType:"eu_vat",FlagComponent:C__namespace.GB,example:"XI123456789"},{country:"United Kingdom",countryCode:"GB",taxIdType:"gb_vat",FlagComponent:C__namespace.GB,example:"GB123456789"},{country:"United States",countryCode:"US",taxIdType:"us_ein",FlagComponent:C__namespace.US,example:"12-3456789"},{country:"Uruguay",countryCode:"UY",taxIdType:"uy_ruc",FlagComponent:C__namespace.UY,example:"123456789012"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_tin",FlagComponent:C__namespace.UZ,example:"123456789"},{country:"Uzbekistan",countryCode:"UZ",taxIdType:"uz_vat",FlagComponent:C__namespace.UZ,example:"123456789012"},{country:"Venezuela",countryCode:"VE",taxIdType:"ve_rif",FlagComponent:C__namespace.VE,example:"A-12345678-9"},{country:"Vietnam",countryCode:"VN",taxIdType:"vn_tin",FlagComponent:C__namespace.VN,example:"1234567890"},{country:"Zambia",countryCode:"ZM",taxIdType:"zm_tin",FlagComponent:C__namespace.ZM,example:"1004751879"},{country:"Zimbabwe",countryCode:"ZW",taxIdType:"zw_tin",FlagComponent:C__namespace.ZW,example:"1234567890"}],Ow="United States",zw=" # ",Ca="us_ein",Pa=(e,t)=>`${e}${zw}${t}`,Nc=new Map(Dc.map(e=>[Pa(e.taxIdType,e.country),e])),In=e=>Nc.get(e),Sa=Pa(Ca,Ow);var Uc=y(Rt)(()=>({"& .MuiOutlinedInput-root":{borderRadius:"5px",padding:"12px",fieldset:{borderColor:"#e6e6e6"}},"& .MuiInputBase-input":{borderRadius:"5px",fontSize:"16px",padding:"0 0"}}));var Gw=y(material.Autocomplete)(()=>({"& .MuiAutocomplete-input":{padding:"0 !important"}})),Ta=y(P)({});Ta.defaultProps={variant:"body1",color:"secondary"};function Of(){let[e,t]=Fc.useState(false),{billingAddress:o,taxId:n,setTaxId:i}=vt(),[r,a]=Fc.useState(Sa),[s,l]=Fc.useState(false),c=Fc.useCallback((m,g,f)=>{i({type:g,value:f}),a(m);},[i,a]);Fc.useEffect(()=>{l(false);},[o==null?void 0:o.country]),Fc.useEffect(()=>{if(!(o!=null&&o.country)||s||!e)return;let m=Dc.find(g=>g.countryCode===o.country);m&&c(Pa(m.taxIdType,m.country),m.taxIdType,"");},[o,e,s,c]);let d=m=>{if(!m)return;let g=In(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=Fc.useMemo(()=>Array.from(Nc.keys()),[]),p=Fc.useMemo(()=>u.find(m=>m===r)||null,[u,r]),h=Fc.useMemo(()=>{let m=In(r);return (m==null?void 0:m.example)||"Add your VAT/GST or local tax ID."},[r]);return Fc.useEffect(()=>(e||(l(false),c(Sa,Ca,"")),()=>{c(Sa,Ca,"");}),[e,c]),jsxRuntime.jsxs(Se__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(Se__default.default,{flexDirection:"row",container:true,gap:2,children:jsxRuntime.jsx(Df,{checked:e,onChange:()=>t(m=>!m),label:jsxRuntime.jsx(Ta,{children:"I'm purchasing as a business"})})}),jsxRuntime.jsx(material.Collapse,{in:e,children:jsxRuntime.jsxs(Se__default.default,{container:true,spacing:0,sx:{width:"100%"},children:[jsxRuntime.jsxs(Se__default.default,{item:true,xs:6,children:[jsxRuntime.jsx(Ta,{children:"Tax ID Type"}),jsxRuntime.jsx(Gw,{fullWidth:true,options:u,value:p,onChange:(m,g)=>d(g),renderInput:m=>jsxRuntime.jsx(Uc,A(S({},m),{id:"id-type",InputProps:m.InputProps})),renderOption:(m,g)=>{let f=In(g);if(!f)return null;let{taxIdType:x,country:b,FlagComponent:T}=f;return Fc.createElement(material.MenuItem,A(S({},m),{key:g}),jsxRuntime.jsxs(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:[T&&jsxRuntime.jsx(T,{width:15,style:{marginRight:"5px",borderRadius:"8%"}}),lodash.startCase(b)," - ",lodash.upperCase(x)]}))},getOptionLabel:m=>{let g=In(m);return g?`${lodash.startCase(g.country)} - ${lodash.upperCase(g.taxIdType)}`:m},ListboxProps:{sx:{maxHeight:200}}})]}),jsxRuntime.jsxs(Se__default.default,{item:true,xs:6,paddingLeft:"12px",children:[jsxRuntime.jsx(Ta,{children:"Tax ID"}),jsxRuntime.jsx(Uc,{id:"tax-id-value",placeholder:h,type:"text",fullWidth:true,value:(n==null?void 0:n.value)||"",onChange:m=>{let g=In(r);g&&c(r,g.taxIdType,m.target.value);}})]})]})})]})}function zf({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=Fc.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 jsxRuntime.jsxs(Se__default.default,{flexDirection:"column",container:true,gap:3,padding:"16px",sx:{pointerEvents:d?"none":void 0},children:[jsxRuntime.jsxs(Se__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(P,{variant:"h6",children:i.newPaymentMethodBillingAddressTitle}),jsxRuntime.jsx(reactStripeJs.AddressElement,{onChange:h,options:{mode:"billing",fields:{phone:u?"always":"auto"},defaultValues:S({},(l==null?void 0:l.name)&&{name:l.name})}})]}),jsxRuntime.jsxs(Se__default.default,{flexDirection:"column",container:true,gap:2,children:[jsxRuntime.jsx(P,{variant:"h6",children:i.newPaymentMethodCardTitle}),jsxRuntime.jsx(reactStripeJs.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&&jsxRuntime.jsx(Of,{})]})}function Vf(){let[e,t]=Fc.useState(null),{checkoutState:o}=Y(),{billingIntegration:n,setupSecret:i}=o||{};return Fc.useEffect(()=>{if(n){let{billingIdentifier:r,credentials:a}=n;if(r!==ah.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 ka(e){var n;let t=D({optional:true}),o=t==null?void 0:t.stigg;return o?o.getBooleanEntitlement(e):S(S({},ah.BOOLEAN_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.getNumericEntitlement(e):S(S({},ah.NUMERIC_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.getMeteredEntitlement(e):S(S({},ah.METERED_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function _a(e){var n;let t=D({optional:true}),o=t==null?void 0:t.stigg;return o?o.getEnumEntitlement(e):S(S({},ah.ENUM_DEFAULT_FALLBACK_ENTITLEMENT),(n=e.options)==null?void 0:n.fallback)}function Ut({func:e}){let[t,o]=Fc.useState(true),[n,i]=Fc.useState(null),[r,a]=Fc.useState(null),s=Fc.useRef(false);return Fc.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 $f(e){let t=D({optional:true}),o=t==null?void 0:t.stigg,n=Fc.useCallback(()=>o?o.getActiveSubscriptions(e):Promise.resolve([]),[e,o]),{data:i,error:r,isLoading:a}=Ut({func:n});return Fc.useMemo(()=>({activeSubscriptions:i,isLoading:a,error:r}),[i,r,a])}function Hf(e){let t=D({optional:true}),o=t==null?void 0:t.stigg,n=Fc.useCallback(()=>o?o.getPaywall(e):Promise.resolve(null),[e,o]),{data:i,error:r,isLoading:a}=Ut({func:n});return Fc.useMemo(()=>({paywall:i,isLoading:a,error:r}),[i,r,a])}function Wf(e){let t=D({optional:true}),o=t==null?void 0:t.stigg,n=Fc.useCallback(()=>o?o.getCustomerPortal(e):Promise.resolve(null),[e,o]),{data:i,error:r,isLoading:a}=Ut({func:n});return Fc.useMemo(()=>({customerPortal:i,isLoading:a,error:r}),[i,r,a])}function Aa(){let e=An(),[{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},fa({taxIds:e.taxId?[e.taxId]:void 0}))}var u3=[ah.PaymentCollection.Failed,ah.PaymentCollection.Processing];function p3(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 jc(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===ah.PaymentCollection.ActionRequired){let{error:l}=yield t.handleNextAction({clientSecret:i});if(l)return {errorMessage:l.message||""}}else if(r&&u3.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 m3(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 Gf(n){return R(this,arguments,function*({stripe:e,elements:t,setupIntentClientSecret:o}){if(!e||!t||!o)return {success:false};let i=yield p3({elements:t});if(!i.success)return {success:false,errorMessage:i.errorMessage};let{newPaymentMethodId:r,setupErrorMessage:a}=yield m3({stripe:e,elements:t,clientSecret:o});return a||!r?{success:false,errorMessage:a}:{success:true,paymentMethodId:r}})}var jf={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 Ma=5e3,b3=y(Ua__default.default)`
716
716
  @keyframes blurFade {
717
717
  0% {
718
718
  background-color: ${({theme:e})=>Do__default.default(e.stigg.palette.backgroundPaper).alpha(0).toString()};
@@ -743,7 +743,7 @@
743
743
  & path {
744
744
  stroke: ${({theme:e})=>e.stigg.palette.primary};
745
745
  }
746
- `,x3=y(P)`
746
+ `,C3=y(P)`
747
747
  @keyframes fadeIn {
748
748
  0% {
749
749
  opacity: 0;
@@ -758,7 +758,7 @@
758
758
 
759
759
  align-self: center;
760
760
  animation: fadeIn 5s ease-in forwards;
761
- `;function jf({checkoutLocalization:e}){let t=Ac.useRef();return Ac.useEffect(()=>{t.current&&t.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});},[]),jsxRuntime.jsxs(y3,{className:"stigg-checkout-success-container",ref:t,children:[jsxRuntime.jsx(f3__default.default,{options:{animationData:Wf,loop:false,autoplay:true},width:350,height:"auto",style:{display:"flex",justifyContent:"center"}}),jsxRuntime.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=reactStripeJs.useStripe(),m=reactStripeJs.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]=Ac.useState(false),{checkoutState:r}=Y(),{billingIntegration:a}=r||{},s=Ac.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=Ac.useCallback(()=>{try{Zf()||Xf(),i(!0);}catch(d){t("Failed to initialize Zuora");}},[i,t]);return Ac.useEffect(()=>{if(a){let{billingIdentifier:d}=a;d===rh.BillingVendorIdentifier.Zuora&&l();}},[a,l]),{isZuoraIntegration:(a==null?void 0:a.billingIdentifier)===rh.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:Ac.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?jsxRuntime.jsx(dt,{width:t,height:o}):jsxRuntime.jsx(jsxRuntime.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 jsxRuntime.jsx(P,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-remaining-credits",children:jsxRuntime.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 jsxRuntime.jsx(P,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-scheduled-updates",children:jsxRuntime.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 jsxRuntime.jsx(P,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-next-billing",children:jsxRuntime.jsx(pe,{isLoading:n,width:"100%",children:s})})};function ty(e){return jsxRuntime.jsxs(material.Box,{className:"stigg-checkout-summary-captions",children:[jsxRuntime.jsx(M3,S({},e)),jsxRuntime.jsx(I3,S({},e)),e.plan&&jsxRuntime.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(rh.BillingPeriod.Monthly),c=o===rh.BillingModel.PerUnit,d=r||1,u=n===rh.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===rh.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__default.default(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:jsxRuntime.jsx(jsxRuntime.Fragment,{children:r.map(({unitQuantity:a,amount:s},l)=>jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{style:{alignItems:"flex-start"},children:[jsxRuntime.jsx(P,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:D3(o,l)}),jsxRuntime.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(reactFeather.ChevronRight)`
761
+ `;function Zf({checkoutLocalization:e}){let t=Fc.useRef();return Fc.useEffect(()=>{t.current&&t.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});},[]),jsxRuntime.jsxs(b3,{className:"stigg-checkout-success-container",ref:t,children:[jsxRuntime.jsx(x3__default.default,{options:{animationData:jf,loop:false,autoplay:true},width:350,height:"auto",style:{display:"flex",justifyContent:"center"}}),jsxRuntime.jsx(C3,{variant:"h1",color:"primary.main",children:e.summary.checkoutSuccessText})]})}var k3=e=>new Promise(t=>setTimeout(t,e));function Xf({isMocked:e=false,onCheckout:t,onCheckoutCompleted:o,onSuccess:n,disableSuccessAnimation:i}){let{stigg:r}=D(),{useNewPaymentMethod:a}=vt(),s=Aa(),{checkoutState:l,widgetState:c,setWidgetReadOnly:d}=Y(),{setupSecret:u,customer:p}=l||{},h=reactStripeJs.useStripe(),m=reactStripeJs.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 Gf({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 jc({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 jc({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 k3(Ma))),yield o({success:x,error:b}),{results:_,success:!b,errorMessage:b}}),isLoading:!!(c!=null&&c.readOnly)}}function Kf(){return !!window.Zuora}function qf(){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 Qf(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 En(){let{stigg:e}=D(),{setErrorMessage:t}=vt(),{billingCountryCode:o}=te(),[n,i]=Fc.useState(false),{checkoutState:r}=Y(),{billingIntegration:a}=r||{},s=Fc.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=Fc.useCallback(()=>{try{Kf()||qf(),i(!0);}catch(d){t("Failed to initialize Zuora");}},[i,t]);return Fc.useEffect(()=>{if(a){let{billingIdentifier:d}=a;d===ah.BillingVendorIdentifier.Zuora&&l();}},[a,l]),{isZuoraIntegration:(a==null?void 0:a.billingIdentifier)===ah.BillingVendorIdentifier.Zuora,isInitialized:n,createPaymentSession:s}}var A3=e=>new Promise(t=>setTimeout(t,e));function Ia({onCheckout:e,onCheckoutCompleted:t,onSuccess:o,disableSuccessAnimation:n}){let{stigg:i}=D(),r=Aa(),{checkoutState:a,setWidgetReadOnly:s,setCheckoutSuccess:l}=Y(),{setErrorMessage:c}=vt();return {handleZuoraSubmit:Fc.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 A3(Ma)))):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?jsxRuntime.jsx(dt,{width:t,height:o}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:n});var E3=({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 jsxRuntime.jsx(P,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-remaining-credits",children:jsxRuntime.jsx(pe,{isLoading:t,width:"100%",children:o.summary.creditsForUnusedTimeText({credits:r})})})},F3=({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 jsxRuntime.jsx(P,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-scheduled-updates",children:jsxRuntime.jsx(pe,{isLoading:o,width:"100%",children:r})})},L3=({subscriptionPreview:e,activeSubscription:t,plan:o,isFetchingSubscriptionPreview:n,billingPeriod:i,checkoutLocalization:r})=>{let{promotionCode:a}=Mn();if(!e)return null;let s=r.nextBillingCaption({plan:o,subscriptionPreview:e,billingPeriod:i,activeSubscription:t,promotionCode:a});return jsxRuntime.jsx(P,{variant:"body1",style:{marginTop:14},className:"stigg-checkout-summary-captions-next-billing",children:jsxRuntime.jsx(pe,{isLoading:n,width:"100%",children:s})})};function oy(e){return jsxRuntime.jsxs(material.Box,{className:"stigg-checkout-summary-captions",children:[jsxRuntime.jsx(E3,S({},e)),jsxRuntime.jsx(F3,S({},e)),e.plan&&jsxRuntime.jsx(L3,S({},e))]})}function Zc({quantity:e,totalAmount:t,pricingModel:o,billingPeriod:n,currency:i,blockSize:r,priceAmount:a,availableBillingPeriods:s}){let l=s==null?void 0:s.has(ah.BillingPeriod.Monthly),c=o===ah.BillingModel.PerUnit,d=r||1,u=n===ah.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 iy(e){let{totalAmount:t,quantity:o,tiersMode:n,tiers:i,currency:r}=e;if(fm(i)||n===ah.TiersMode.Graduated&&!ym(i,o)){let a=at({amount:t,currency:r,minimumFractionDigits:2});return `${ft(o)} for ${a}`}return Zc(e)}function U3(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 Ar__default.default(n)?`${ft(r)} and above`:`Next ${ft(r)} to ${ft(n)}`}function ry({price:e,unitQuantity:t}){let o=e.tiers||[],{checkoutState:n}=Y(),i=n==null?void 0:n.plan,{breakdown:r}=El(o,t);return r.length===1?null:jsxRuntime.jsx(jsxRuntime.Fragment,{children:r.map(({unitQuantity:a,amount:s},l)=>jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{style:{alignItems:"flex-start"},children:[jsxRuntime.jsx(P,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:U3(o,l)}),jsxRuntime.jsx(P,{variant:"body1",color:"tertiary",style:{whiteSpace:"nowrap"},children:Zc({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 ay=y(reactFeather.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;
@@ -767,7 +767,7 @@
767
767
  & + & {
768
768
  margin-top: 16px;
769
769
  }
770
- `,Z3=y.div`
770
+ `,K3=y.div`
771
771
  margin-top: 16px;
772
772
  margin-left: 16px;
773
773
  `,me=y.div`
@@ -780,28 +780,28 @@
780
780
  align-items: center;
781
781
  justify-content: space-between;
782
782
  }
783
- `,X3=({checkoutLocalization:e})=>{let t=jsxRuntime.jsx(P,{variant:"body1",children:e.summary.payAsYouGoTooltipText});return jsxRuntime.jsx(Be,{placement:"left",title:t,children:jsxRuntime.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]=Ac.useState(false),c=()=>l(g=>!g),d=n.pricingModel===rh.BillingModel.UsageBased,u=n.isTieredPrice?Cn(n,o):(n.amount||0)*Math.ceil(o/(n.blockSize||1)),p;n.tiersMode===rh.TiersMode.Graduated&&!!n.tiers&&!DS__default.default(n.tiers)&&!_r__default.default(n.tiers[0].upTo)&&o>n.tiers[0].upTo&&(p=jsxRuntime.jsx(ny,{price:n,unitQuantity:o}));let m=jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:t});return p&&(m=jsxRuntime.jsx(MT__default.default,{onClick:c,underline:"none",style:{cursor:"pointer"},children:m})),jsxRuntime.jsxs(ve,{className:"stigg-checkout-summary-base-charges-container",children:[jsxRuntime.jsxs(me,{style:{alignItems:"flex-start"},children:[jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",gap:.5,style:{whiteSpace:a?"nowrap":"break-spaces"},children:[m,p&&jsxRuntime.jsx(material.IconButton,{onClick:c,sx:{padding:0},children:jsxRuntime.jsx(iy,{$isOpen:s,$size:16})})]}),jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[d&&jsxRuntime.jsx(X3,{checkoutLocalization:e}),jsxRuntime.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&&jsxRuntime.jsx(Y3__default.default,{in:s,children:jsxRuntime.jsx(Z3,{children:p})})]})},ry=({label:e})=>jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{style:{alignItems:"flex-end"},children:[jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:e})}),jsxRuntime.jsx(Se__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:jsxRuntime.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:jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:o.summary.discountText({discountDetails:a,currency:n.total.currency})}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:t?jsxRuntime.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:jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:o.summary.appliedCreditsTitle}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:jsxRuntime.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:jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:n.summary.taxTitle({taxDetails:t})}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:jsxRuntime.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__default.default)`
783
+ `,q3=({checkoutLocalization:e})=>{let t=jsxRuntime.jsx(P,{variant:"body1",children:e.summary.payAsYouGoTooltipText});return jsxRuntime.jsx(Be,{placement:"left",title:t,children:jsxRuntime.jsx(mt,{icon:"PayAsYouGoCharge",style:{display:"flex"}})})},La=({checkoutLocalization:e,label:t,quantity:o,price:n})=>{let{checkoutState:i}=Y(),r=i==null?void 0:i.plan,a=Dt("lg"),[s,l]=Fc.useState(false),c=()=>l(g=>!g),d=n.pricingModel===ah.BillingModel.UsageBased,u=n.isTieredPrice?Cn(n,o):(n.amount||0)*Math.ceil(o/(n.blockSize||1)),p;n.tiersMode===ah.TiersMode.Graduated&&!!n.tiers&&!NS__default.default(n.tiers)&&!Ar__default.default(n.tiers[0].upTo)&&o>n.tiers[0].upTo&&(p=jsxRuntime.jsx(ry,{price:n,unitQuantity:o}));let m=jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:t});return p&&(m=jsxRuntime.jsx(IT__default.default,{onClick:c,underline:"none",style:{cursor:"pointer"},children:m})),jsxRuntime.jsxs(ve,{className:"stigg-checkout-summary-base-charges-container",children:[jsxRuntime.jsxs(me,{style:{alignItems:"flex-start"},children:[jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",gap:.5,style:{whiteSpace:a?"nowrap":"break-spaces"},children:[m,p&&jsxRuntime.jsx(material.IconButton,{onClick:c,sx:{padding:0},children:jsxRuntime.jsx(ay,{$isOpen:s,$size:16})})]}),jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:[d&&jsxRuntime.jsx(q3,{checkoutLocalization:e}),jsxRuntime.jsxs(P,{variant:"body1",color:"secondary",style:{whiteSpace:a?"nowrap":"break-spaces"},children:[iy({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&&jsxRuntime.jsx(X3__default.default,{in:s,children:jsxRuntime.jsx(K3,{children:p})})]})},sy=({label:e})=>jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{style:{alignItems:"flex-end"},children:[jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:e})}),jsxRuntime.jsx(Se__default.default,{item:true,display:"flex",gap:1,alignItems:"center",children:jsxRuntime.jsx(P,{variant:"body1",color:"secondary",style:{wordBreak:"break-word"},children:"Free"})})]})}),ly=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:n,recurringInvoice:i}=e,{discount:r,discountDetails:a}=i||{};return !r||!a?null:jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:o.summary.discountText({discountDetails:a,currency:n.total.currency})}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:t?jsxRuntime.jsx(dt,{width:50,height:16}):at({amount:r.amount,currency:r.currency,minimumFractionDigits:2})})]})})},cy=({subscriptionPreview:e,isFetchingSubscriptionPreview:t,checkoutLocalization:o})=>{let{immediateInvoice:n}=e||{},{credits:i}=n||{};return !i||!i.used||i.used.amount<=0?null:jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:o.summary.appliedCreditsTitle}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(pe,{isLoading:t,children:at({amount:-1*i.used.amount,currency:i.used.currency,minimumFractionDigits:2})})})]})})},dy=({tax:e,taxDetails:t,isFetchingSubscriptionPreview:o,checkoutLocalization:n})=>!t||!e||(e==null?void 0:e.amount)<=0?null:jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:n.summary.taxTitle({taxDetails:t})}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(pe,{isLoading:o,children:at({amount:e==null?void 0:e.amount,currency:e==null?void 0:e.currency,minimumFractionDigits:2})})})]})});var qc=y(Ua__default.default)`
784
784
  width: 100%;
785
785
  max-width: 470px;
786
786
  flex: 1.5;
787
- `,La=y(e5__default.default)`
787
+ `,Ba=y(n5__default.default)`
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
- `;La.defaultProps={elevation:0};var n5=y(P)`
794
+ `;Ba.defaultProps={elevation:0};var r5=y(P)`
795
795
  margin-bottom: 16px;
796
796
  font-weight: 500;
797
- `,En=y(gg__default.default)`
797
+ `,Fn=y(fg__default.default)`
798
798
  margin: 16px 0;
799
- `,dy=y(P)`
799
+ `,py=y(P)`
800
800
  margin-bottom: 8px;
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]=Ac.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__default.default(T,q=>q.pricingModel===rh.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===rh.BillingModel.UsageBased),Lo=gn&&!v&&w.every(q=>q.pricingModel===rh.BillingModel.UsageBased),Ju=typeof m.summary.baseChargeText=="function"?m.summary.baseChargeText({billingPeriod:p.billingPeriod}):m.summary.baseChargeText,tp=Ac.useMemo(()=>{var q,ce;return (ce=(q=p.addons)==null?void 0:q.filter(Gt=>!$o(Gt.addon)))!=null?ce:[]},[p.addons]),ep=Ac.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 jsxRuntime.jsx(Fa,{checkoutLocalization:m,label:q.addon.displayName,quantity:Gt,price:ce},q.addon.id)}),[tp,p.billingPeriod,m]);return jsxRuntime.jsxs(Yc,{className:"stigg-checkout-summary-container",children:[jsxRuntime.jsxs(La,{children:[jsxRuntime.jsx(n5,{variant:"h3",children:m.summary.title}),jsxRuntime.jsxs(Se__default.default,{className:"stigg-checkout-summary-plan-title-container",display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:m.summary.planName({plan:x})}),jsxRuntime.jsx(En,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),v&&jsxRuntime.jsx(Fa,{checkoutLocalization:m,label:Ju,quantity:1,price:v}),!v&&i?jsxRuntime.jsx(ry,{label:Ju}):null,jsxRuntime.jsx(Se__default.default,{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 jsxRuntime.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&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Se__default.default,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:m.summary.addonsSectionTitle}),jsxRuntime.jsx(En,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),ep]}),!Fo&&jsxRuntime.jsx(En,{className:"stigg-checkout-summary-divider"}),Fo&&jsxRuntime.jsxs(Se__default.default,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:m.summary.discountsSectionTitle}),jsxRuntime.jsx(En,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),Fe&&jsxRuntime.jsx(Lf,{disabled:J||E,checkoutLocalization:m,onMockCheckoutPreview:r}),Je&&F&&jsxRuntime.jsx(ay,{subscriptionPreview:F,isFetchingSubscriptionPreview:E,checkoutLocalization:m}),Fo&&jsxRuntime.jsx(En,{className:"stigg-checkout-summary-divider"}),jsxRuntime.jsx(ly,{tax:bt==null?void 0:bt.tax,taxDetails:bt==null?void 0:bt.taxDetails,isFetchingSubscriptionPreview:E,checkoutLocalization:m}),i?null:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(me,{style:{marginTop:16},children:jsxRuntime.jsxs(Se__default.default,{display:"flex",flexDirection:"column",container:true,children:[jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",justifyContent:"space-between",children:[jsxRuntime.jsx(P,{variant:"h6",children:m.summary.totalText}),jsxRuntime.jsx(P,{variant:"h6",children:jsxRuntime.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}))]})})]}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:m.summary.totalBillingPeriodText({billingPeriod:p.billingPeriod})})})]})}),jsxRuntime.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?jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:m.summary.proratedTotalDueText}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:jsxRuntime.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,jsxRuntime.jsx(sy,{subscriptionPreview:F,isFetchingSubscriptionPreview:E,checkoutLocalization:m}),jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(dy,{variant:"h6",children:m.summary.totalDueText}),jsxRuntime.jsx(dy,{variant:"h6",children:jsxRuntime.jsx(pe,{isLoading:E,children:at(A(S({amount:0},tt==null?void 0:tt.total),{minimumFractionDigits:2}))})})]})}),jsxRuntime.jsx(ty,{plan:x,activeSubscription:b,subscriptionPreview:F,isFetchingSubscriptionPreview:E,checkoutLocalization:m,billingPeriod:p.billingPeriod}),(!_||!M||M&&!d)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.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:jsxRuntime.jsx(P,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"},children:I?jsxRuntime.jsx(mt,{icon:"Check",style:{display:"contents"}}):J||E?jsxRuntime.jsx(Aw__default.default,{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&&jsxRuntime.jsx(o5__default.default,{severity:"error",sx:{alignItems:"center",marginTop:"12px"},children:jsxRuntime.jsx(P,{overrideColor:"inherit",children:B})})]})]}),jsxRuntime.jsx(Jt,{source:"checkout",showWatermark:a,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!n&&I&&jsxRuntime.jsx(jf,{checkoutLocalization:m})]})};var py=({showWatermark:e})=>jsxRuntime.jsxs(Yc,{children:[jsxRuntime.jsxs(La,{children:[jsxRuntime.jsxs(Oo,{$flexDirection:"column",$gap:24,children:[jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsx(dt,{width:120,height:20})]}),jsxRuntime.jsxs(Oo,{$flexDirection:"column",$gap:24,marginTop:5,children:[jsxRuntime.jsx(dt,{height:20}),jsxRuntime.jsx(dt,{height:20}),jsxRuntime.jsx(dt,{height:20})]}),jsxRuntime.jsx(yi,{flex:1,marginTop:5,children:jsxRuntime.jsx(dt,{height:34})})]}),jsxRuntime.jsx(Jt,{source:"checkout",showWatermark:e,style:{marginTop:8,display:"flex",justifyContent:"center"}})]});var hy=y(Se__default.default)`
801
+ `;function a5({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 my=({onCheckout:e,onCheckoutCompleted:t,disablePromotionCode:o,disableSuccessAnimation:n,isFreeDowngrade:i,onMockCheckoutPreview:r,showWatermark:a})=>{var np,ip,rp,ap;let[s,l]=Fc.useState(false),{setErrorMessage:c,useNewPaymentMethod:d}=vt(),u=ke(),p=An(),{checkoutState:h,checkoutLocalization:m,checkoutSuccess:g,widgetState:f}=Y(),{plan:x,activeSubscription:b}=h||{},T=xa(((np=x==null?void 0:x.pricePoints)==null?void 0:np.filter(q=>q.billingPeriod===p.billingPeriod))||[]),[k,w]=J3__default.default(T,q=>q.pricingModel===ah.BillingModel.FlatFee),v=k[0],_=i||u.isCheckoutComplete&&u.isLastStep,{isZuoraIntegration:M}=En(),I=s||g,{subscriptionPreview:F,isFetchingSubscriptionPreview:E,errorMessage:B}=uf({onMockCheckoutPreview:r}),{handleSubmit:O,isLoading:U}=Xf({isMocked:!!r,disableSuccessAnimation:n,onCheckout:e,onCheckoutCompleted:t,onSuccess:()=>{l(true),u.markStepAsCompleted(u.progressBarState.activeStep);}}),{handleZuoraSubmit:L}=Ia({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===ah.BillingModel.UsageBased),Lo=gn&&!v&&w.every(q=>q.pricingModel===ah.BillingModel.UsageBased),tp=typeof m.summary.baseChargeText=="function"?m.summary.baseChargeText({billingPeriod:p.billingPeriod}):m.summary.baseChargeText,ep=Fc.useMemo(()=>{var q,ce;return (ce=(q=p.addons)==null?void 0:q.filter(Gt=>!$o(Gt.addon)))!=null?ce:[]},[p.addons]),op=Fc.useMemo(()=>ep.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 jsxRuntime.jsx(La,{checkoutLocalization:m,label:q.addon.displayName,quantity:Gt,price:ce},q.addon.id)}),[ep,p.billingPeriod,m]);return jsxRuntime.jsxs(qc,{className:"stigg-checkout-summary-container",children:[jsxRuntime.jsxs(Ba,{children:[jsxRuntime.jsx(r5,{variant:"h3",children:m.summary.title}),jsxRuntime.jsxs(Se__default.default,{className:"stigg-checkout-summary-plan-title-container",display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:m.summary.planName({plan:x})}),jsxRuntime.jsx(Fn,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),v&&jsxRuntime.jsx(La,{checkoutLocalization:m,label:tp,quantity:1,price:v}),!v&&i?jsxRuntime.jsx(sy,{label:tp}):null,jsxRuntime.jsx(Se__default.default,{item:true,className:"stigg-checkout-summary-usage-charges-container",children:w.map((q,ce)=>{var fn,sp,lp,cp,dp;let Gt=(fn=p.billableFeatures)==null?void 0:fn.find(pC=>{var up;return pC.featureId===((up=q.feature)==null?void 0:up.featureId)});return jsxRuntime.jsx(La,{checkoutLocalization:m,label:vn(((lp=q.feature)==null?void 0:lp.displayName)||"",(cp=q.feature)==null?void 0:cp.units,(dp=q.feature)==null?void 0:dp.unitsPlural),quantity:(Gt==null?void 0:Gt.quantity)||1,price:q},((sp=q.feature)==null?void 0:sp.featureId)||`usage-charge-${ce}`)})}),op.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Se__default.default,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:m.summary.addonsSectionTitle}),jsxRuntime.jsx(Fn,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),op]}),!Fo&&jsxRuntime.jsx(Fn,{className:"stigg-checkout-summary-divider"}),Fo&&jsxRuntime.jsxs(Se__default.default,{display:"flex",flexDirection:"row",alignItems:"center",marginY:2,children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",style:{paddingRight:"8px"},children:m.summary.discountsSectionTitle}),jsxRuntime.jsx(Fn,{className:"stigg-checkout-summary-divider",sx:{flex:1,margin:"0 !important"}})]}),Fe&&jsxRuntime.jsx(Rf,{disabled:J||E,checkoutLocalization:m,onMockCheckoutPreview:r}),Je&&F&&jsxRuntime.jsx(ly,{subscriptionPreview:F,isFetchingSubscriptionPreview:E,checkoutLocalization:m}),Fo&&jsxRuntime.jsx(Fn,{className:"stigg-checkout-summary-divider"}),jsxRuntime.jsx(dy,{tax:bt==null?void 0:bt.tax,taxDetails:bt==null?void 0:bt.taxDetails,isFetchingSubscriptionPreview:E,checkoutLocalization:m}),i?null:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(me,{style:{marginTop:16},children:jsxRuntime.jsxs(Se__default.default,{display:"flex",flexDirection:"column",container:true,children:[jsxRuntime.jsxs(Se__default.default,{item:true,display:"flex",justifyContent:"space-between",children:[jsxRuntime.jsx(P,{variant:"h6",children:m.summary.totalText}),jsxRuntime.jsx(P,{variant:"h6",children:jsxRuntime.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}))]})})]}),jsxRuntime.jsx(Se__default.default,{item:true,children:jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:m.summary.totalBillingPeriodText({billingPeriod:p.billingPeriod})})})]})}),jsxRuntime.jsx(Fn,{className:"stigg-checkout-summary-divider"})]}),(ip=tt==null?void 0:tt.proration)!=null&&ip.hasProrations&&(tt!=null&&tt.subTotal)&&(tt==null?void 0:tt.subTotal.amount)>0?jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:m.summary.proratedTotalDueText}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:jsxRuntime.jsx(pe,{isLoading:E,children:at({amount:Number(((rp=tt==null?void 0:tt.subTotal)==null?void 0:rp.amount)||0)+Number(((ap=tt==null?void 0:tt.tax)==null?void 0:ap.amount)||0),currency:tt==null?void 0:tt.subTotal.currency,minimumFractionDigits:2})})})]})}):null,jsxRuntime.jsx(cy,{subscriptionPreview:F,isFetchingSubscriptionPreview:E,checkoutLocalization:m}),jsxRuntime.jsx(ve,{children:jsxRuntime.jsxs(me,{children:[jsxRuntime.jsx(py,{variant:"h6",children:m.summary.totalDueText}),jsxRuntime.jsx(py,{variant:"h6",children:jsxRuntime.jsx(pe,{isLoading:E,children:at(A(S({amount:0},tt==null?void 0:tt.total),{minimumFractionDigits:2}))})})]})}),jsxRuntime.jsx(oy,{plan:x,activeSubscription:b,subscriptionPreview:F,isFetchingSubscriptionPreview:E,checkoutLocalization:m,billingPeriod:p.billingPeriod}),(!_||!M||M&&!d)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.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:jsxRuntime.jsx(P,{className:"stigg-checkout-summary-cta-button-text",variant:"h3",color:"white",style:{display:"flex"},children:I?jsxRuntime.jsx(mt,{icon:"Check",style:{display:"contents"}}):J||E?jsxRuntime.jsx(Iw__default.default,{size:20,sx:{color:"white"}}):a5({isLastStep:_,checkoutHasChanges:Eo,isFreeDowngrade:i,checkoutLocalization:m,isPlanUpdate:!!b&&(b==null?void 0:b.plan.id)===(x==null?void 0:x.id)})})}),B&&jsxRuntime.jsx(i5__default.default,{severity:"error",sx:{alignItems:"center",marginTop:"12px"},children:jsxRuntime.jsx(P,{overrideColor:"inherit",children:B})})]})]}),jsxRuntime.jsx(Jt,{source:"checkout",showWatermark:a,style:{marginTop:8,display:"flex",justifyContent:"center"}}),!n&&I&&jsxRuntime.jsx(Zf,{checkoutLocalization:m})]})};var hy=({showWatermark:e})=>jsxRuntime.jsxs(qc,{children:[jsxRuntime.jsxs(Ba,{children:[jsxRuntime.jsxs(Oo,{$flexDirection:"column",$gap:24,children:[jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsx(dt,{width:120,height:20}),jsxRuntime.jsx(dt,{width:120,height:20})]}),jsxRuntime.jsxs(Oo,{$flexDirection:"column",$gap:24,marginTop:5,children:[jsxRuntime.jsx(dt,{height:20}),jsxRuntime.jsx(dt,{height:20}),jsxRuntime.jsx(dt,{height:20})]}),jsxRuntime.jsx(xi,{flex:1,marginTop:5,children:jsxRuntime.jsx(dt,{height:34})})]}),jsxRuntime.jsx(Jt,{source:"checkout",showWatermark:e,style:{marginTop:8,display:"flex",justifyContent:"center"}})]});var fy=y(Se__default.default)`
802
802
  width: 100%;
803
803
  gap: 8px;
804
- `,gy=y(Se__default.default)`
804
+ `,yy=y(Se__default.default)`
805
805
  display: flex;
806
806
  flex-direction: column;
807
807
  gap: 16px;
@@ -816,51 +816,51 @@
816
816
  padding-top: 16px;
817
817
  padding-bottom: 16px;
818
818
  }
819
- `,fy=y(kt)`
819
+ `,xy=y(kt)`
820
820
  min-width: unset;
821
821
  width: 41px;
822
822
  height: 41px;
823
823
  padding: 0;
824
- `;var a5=material.styled(material.Grid)`
824
+ `;var l5=material.styled(material.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 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 jsxRuntime.jsxs(a5,{item:true,sx:{gap:"16px"},container:!c,children:[o&&jsxRuntime.jsx(kt,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:s,children:jsxRuntime.jsx(P,{color:"primary.main",variant:"body1",children:"Undo"})}),d&&jsxRuntime.jsxs(material.Grid,{sx:{display:"flex",width:"100%",justifyContent:"flex-end"},children:[u&&jsxRuntime.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()}),jsxRuntime.jsx(fy,{color:"error",onClick:l,children:jsxRuntime.jsx(mt,{icon:"Trash",style:{display:"flex",padding:"8px"}})})]}),!d&&jsxRuntime.jsx(kt,{sx:{paddingX:"22px",paddingY:"8px"},onClick:()=>a(1),disabled:!i,children:jsxRuntime.jsx(P,{color:i?"primary.main":"disabled",variant:"body1",children:r.addAddonText})})]})}var c5=y(material.Grid)`
830
+ `;function Py({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 jsxRuntime.jsxs(l5,{item:true,sx:{gap:"16px"},container:!c,children:[o&&jsxRuntime.jsx(kt,{variant:"text",size:"small",sx:{padding:"8px",minWidth:"unset"},onClick:s,children:jsxRuntime.jsx(P,{color:"primary.main",variant:"body1",children:"Undo"})}),d&&jsxRuntime.jsxs(material.Grid,{sx:{display:"flex",width:"100%",justifyContent:"flex-end"},children:[u&&jsxRuntime.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()}),jsxRuntime.jsx(xy,{color:"error",onClick:l,children:jsxRuntime.jsx(mt,{icon:"Trash",style:{display:"flex",padding:"8px"}})})]}),!d&&jsxRuntime.jsx(kt,{sx:{paddingX:"22px",paddingY:"8px"},onClick:()=>a(1),disabled:!i,children:jsxRuntime.jsx(P,{color:i?"primary.main":"disabled",variant:"body1",children:r.addAddonText})})]})}var u5=y(material.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 Cy({addon:e,billingPeriod:t,checkoutLocalization:o}){let n=e.pricePoints.find(i=>i.billingPeriod===t);return jsxRuntime.jsxs(c5,{item:true,children:[jsxRuntime.jsx(P,{variant:"h6",lineHeight:"24px",children:e.displayName}),n?jsxRuntime.jsx(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:`${at({amount:n.amount,currency:n.currency,minimumFractionDigits:2})}/${t===rh.BillingPeriod.Annually?"year":"month"}`}):jsxRuntime.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]=Ac.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 jsxRuntime.jsxs(gy,{children:[jsxRuntime.jsx(Cy,{addon:e,billingPeriod:t,checkoutLocalization:a}),jsxRuntime.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]=Ac.useState((s==null?void 0:s.reduce((p,h)=>(p[h.id]=true,p),{}))||{});return Ac.useEffect(()=>{let p=Object.values(d).some(h=>!h);i(p),o(!p);},[d,i,o]),jsxRuntime.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 jsxRuntime.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__default.default)`
836
+ `;function Sy({addon:e,billingPeriod:t,checkoutLocalization:o}){let n=e.pricePoints.find(i=>i.billingPeriod===t);return jsxRuntime.jsxs(u5,{item:true,children:[jsxRuntime.jsx(P,{variant:"h6",lineHeight:"24px",children:e.displayName}),n?jsxRuntime.jsx(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:`${at({amount:n.amount,currency:n.currency,minimumFractionDigits:2})}/${t===ah.BillingPeriod.Annually?"year":"month"}`}):jsxRuntime.jsx(P,{variant:"body1",lineHeight:"20px",color:"secondary",children:o.addonBillingPeriodNotAvailableText({planBillingPeriod:t})})]})}function h5({addon:e,billingPeriod:t,addonState:o,initialAddonState:n,setAddon:i,removeAddon:r,checkoutLocalization:a,onAddonsValidationChange:s,onAddonChange:l}){let[c,d]=Fc.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 jsxRuntime.jsxs(yy,{children:[jsxRuntime.jsx(Sy,{addon:e,billingPeriod:t,checkoutLocalization:a}),jsxRuntime.jsx(Py,{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 ky({onAddonChange:e}){let{checkoutLocalization:t,setIsValid:o}=Y(),{billingPeriod:n}=te(),{setIsDisabled:i}=ke(),{initialAddons:r,addons:a,availableAddons:s,setAddon:l,removeAddon:c}=qg(),[d,u]=Fc.useState((s==null?void 0:s.reduce((p,h)=>(p[h.id]=true,p),{}))||{});return Fc.useEffect(()=>{let p=Object.values(d).some(h=>!h);i(p),o(!p);},[d,i,o]),jsxRuntime.jsx(fy,{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 jsxRuntime.jsx(h5,{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 td=y(Se__default.default)`
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
- `,Ty=y(Kc)`
842
+ `,wy=y(td)`
843
843
  flex-direction: column;
844
844
  align-items: unset;
845
845
  ${({$hideBorders:e})=>e&&react.css`
846
846
  border: none;
847
847
  padding: 0;
848
848
  `}
849
- `,ky=y(Se__default.default)`
849
+ `,vy=y(Se__default.default)`
850
850
  display: flex;
851
851
  align-items: center;
852
852
  flex: 1;
853
853
  gap: 12px;
854
- `,wy=y(Se__default.default)`
854
+ `,_y=y(Se__default.default)`
855
855
  display: flex;
856
856
  flex-direction: column;
857
- `;var P5=y(Na__default.default)`
857
+ `;var T5=y(Ua__default.default)`
858
858
  position: relative;
859
859
  max-width: 500px;
860
- `,S5=y(Na__default.default)`
860
+ `,k5=y(Ua__default.default)`
861
861
  opacity: ${({$showLoading:e})=>e?.6:1};
862
862
  pointer-events: ${({$showLoading:e})=>e?"none":"auto"};
863
- `,T5=y(Na__default.default)`
863
+ `,w5=y(Ua__default.default)`
864
864
  position: absolute;
865
865
  top: 40px;
866
866
  left: 0;
@@ -872,18 +872,18 @@
872
872
  justify-content: center;
873
873
  border-radius: 4px;
874
874
  z-index: 10;
875
- `,k5=y(Na__default.default)`
875
+ `,v5=y(Ua__default.default)`
876
876
  display: flex;
877
877
  flex-direction: column;
878
878
  align-items: center;
879
879
  gap: 12px;
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=Ac.useRef(false),[u,p]=Ac__default.default.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)||rh.Currency.Usd,{publishableKey:m}=s==null?void 0:s.billingIntegration.billingCredentials,g=Ac.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 Ac.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?jsxRuntime.jsxs(P5,{children:[jsxRuntime.jsx(S5,{id:"zuora_payment",$showLoading:l.readOnly||u}),(l.readOnly||u)&&jsxRuntime.jsx(T5,{children:jsxRuntime.jsx(k5,{children:jsxRuntime.jsx(Aw__default.default,{size:28})})})]}):null}function Ay({checked:e,text:t,subtitle:o,readOnly:n}){return jsxRuntime.jsxs(ky,{children:[jsxRuntime.jsx(_5__default.default,{checked:e,disabled:n}),jsxRuntime.jsxs(wy,{container:true,children:[jsxRuntime.jsx(Se__default.default,{item:true,children:t}),o&&jsxRuntime.jsx(Se__default.default,{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 jsxRuntime.jsx(Kc,{item:true,onClick:n,$disabled:o,children:jsxRuntime.jsx(Ay,{checked:e,readOnly:o,text:jsxRuntime.jsx(P,{variant:"h6",children:`Card ending in ${i}`}),subtitle:!!r&&!!a&&jsxRuntime.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 jsxRuntime.jsxs(Ty,{item:true,$hideBorders:!e,onClick:o,$disabled:n,children:[e&&jsxRuntime.jsx(Ay,{checked:t,readOnly:n,text:jsxRuntime.jsx(P,{variant:"h6",children:i.newPaymentMethodText})}),jsxRuntime.jsx(Y3__default.default,{in:t,children:d?jsxRuntime.jsx(vy,{onCheckout:l,onCheckoutCompleted:c}):jsxRuntime.jsx(Uf,{onBillingAddressChange:r,collectPhoneNumber:a,collectTaxId:s})})]})}var I5=y(Se__default.default)`
880
+ `;function Ay({onCheckout:e,onCheckoutCompleted:t}){var f,x,b;let{isZuoraIntegration:o,isInitialized:n,createPaymentSession:i}=En(),{setErrorMessage:r}=vt(),{billingCountryCode:a}=te(),{checkoutState:s,widgetState:l}=Y(),{handleZuoraSubmit:c}=Ia({onCheckout:e,onCheckoutCompleted:t}),d=Fc.useRef(false),[u,p]=Fc__default.default.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)||ah.Currency.Usd,{publishableKey:m}=s==null?void 0:s.billingIntegration.billingCredentials,g=Fc.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 Fc.useEffect(()=>(R(null,null,function*(){if(!(!n||d.current)){p(true),r(void 0);try{d.current=!0;let k=window.Zuora(m),w=Qf(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?jsxRuntime.jsxs(T5,{children:[jsxRuntime.jsx(k5,{id:"zuora_payment",$showLoading:l.readOnly||u}),(l.readOnly||u)&&jsxRuntime.jsx(w5,{children:jsxRuntime.jsx(v5,{children:jsxRuntime.jsx(Iw__default.default,{size:28})})})]}):null}function Iy({checked:e,text:t,subtitle:o,readOnly:n}){return jsxRuntime.jsxs(vy,{children:[jsxRuntime.jsx(M5__default.default,{checked:e,disabled:n}),jsxRuntime.jsxs(_y,{container:true,children:[jsxRuntime.jsx(Se__default.default,{item:true,children:t}),o&&jsxRuntime.jsx(Se__default.default,{item:true,children:o})]})]})}function Ey({checked:e,paymentMethodDetails:t,readOnly:o,onSelect:n}){if(!t)return null;let{last4Digits:i,expirationMonth:r,expirationYear:a}=t;return jsxRuntime.jsx(td,{item:true,onClick:n,$disabled:o,children:jsxRuntime.jsx(Iy,{checked:e,readOnly:o,text:jsxRuntime.jsx(P,{variant:"h6",children:`Card ending in ${i}`}),subtitle:!!r&&!!a&&jsxRuntime.jsx(P,{variant:"body1",children:`Expires ${r.toString().padStart(2,"0")}/${a}`})})})}function Fy({hasExistingPaymentMethod:e,checked:t,onSelect:o,readOnly:n,checkoutLocalization:i,onBillingAddressChange:r,collectPhoneNumber:a,collectTaxId:s,onCheckout:l,onCheckoutCompleted:c}){let{isZuoraIntegration:d}=En();return jsxRuntime.jsxs(wy,{item:true,$hideBorders:!e,onClick:o,$disabled:n,children:[e&&jsxRuntime.jsx(Iy,{checked:t,readOnly:n,text:jsxRuntime.jsx(P,{variant:"h6",children:i.newPaymentMethodText})}),jsxRuntime.jsx(X3__default.default,{in:t,children:d?jsxRuntime.jsx(Ay,{onCheckout:l,onCheckoutCompleted:c}):jsxRuntime.jsx(zf,{onBillingAddressChange:r,collectPhoneNumber:a,collectTaxId:s})})]})}var F5=y(Se__default.default)`
881
881
  display: flex;
882
882
  flex-direction: column;
883
883
  gap: 24px;
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 jsxRuntime.jsxs(I5,{container:true,children:[!!c&&jsxRuntime.jsx(o5__default.default,{severity:"error",sx:{alignItems:"center"},children:jsxRuntime.jsx(P,{overrideColor:"inherit",children:c})}),jsxRuntime.jsx(My,{readOnly:p,checked:!d,paymentMethodDetails:l==null?void 0:l.paymentMethodDetails,onSelect:()=>h(false)}),jsxRuntime.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})=>jsxRuntime.jsx(L2__default.default,{className:"stigg-checkout-change-plan-button",sx:{textTransform:"none"},variant:"text",size:o,onClick:e,children:jsxRuntime.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 jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Na__default.default,{sx:{marginBottom:"16px"},children:[jsxRuntime.jsx(P,{variant:"body1",color:"disabled",style:{opacity:.6,marginBottom:"8px"},children:"Selected plan"}),jsxRuntime.jsxs(Na__default.default,{sx:{display:"flex",justifyContent:"space-between"},children:[jsxRuntime.jsx(P,{variant:"h1",children:i==null?void 0:i.displayName}),e&&t&&jsxRuntime.jsx(Oa,{onClick:()=>{t({currentPlan:i});},checkoutLocalization:n,size:"medium"})]})]}),jsxRuntime.jsx(gg__default.default,{className:"stigg-checkout-plan-header-divider"})]})}function Jc(e){switch(e){case rh.BillingPeriod.Annually:return "Annual";case rh.BillingPeriod.Monthly:return "Monthly";default:return ""}}var Ny=y(Na__default.default)`
884
+ `;function Ly({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 jsxRuntime.jsxs(F5,{container:true,children:[!!c&&jsxRuntime.jsx(i5__default.default,{severity:"error",sx:{alignItems:"center"},children:jsxRuntime.jsx(P,{overrideColor:"inherit",children:c})}),jsxRuntime.jsx(Ey,{readOnly:p,checked:!d,paymentMethodDetails:l==null?void 0:l.paymentMethodDetails,onSelect:()=>h(false)}),jsxRuntime.jsx(Fy,{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 za=({onClick:e,checkoutLocalization:t,size:o})=>jsxRuntime.jsx(B2__default.default,{className:"stigg-checkout-change-plan-button",sx:{textTransform:"none"},variant:"text",size:o,onClick:e,children:jsxRuntime.jsx(P,{className:"stigg-checkout-change-plan-button-text",color:"primary.main",variant:"h3",style:{lineHeight:"24px"},children:t.changePlan})});function Dy({allowChangePlan:e=false,onChangePlan:t}){let{checkoutState:o,checkoutLocalization:n}=Y(),{plan:i}=o||{};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Ua__default.default,{sx:{marginBottom:"16px"},children:[jsxRuntime.jsx(P,{variant:"body1",color:"disabled",style:{opacity:.6,marginBottom:"8px"},children:"Selected plan"}),jsxRuntime.jsxs(Ua__default.default,{sx:{display:"flex",justifyContent:"space-between"},children:[jsxRuntime.jsx(P,{variant:"h1",children:i==null?void 0:i.displayName}),e&&t&&jsxRuntime.jsx(za,{onClick:()=>{t({currentPlan:i});},checkoutLocalization:n,size:"medium"})]})]}),jsxRuntime.jsx(fg__default.default,{className:"stigg-checkout-plan-header-divider"})]})}function nd(e){switch(e){case ah.BillingPeriod.Annually:return "Annual";case ah.BillingPeriod.Monthly:return "Monthly";default:return ""}}var Oy=y(Ua__default.default)`
885
885
  margin: 16px 0;
886
- `,Uy=y.button`
886
+ `,zy=y.button`
887
887
  cursor: ${({$disabled:e,$isOnlyBillingPeriod:t})=>e||t?"default":"pointer"};
888
888
  flex: 1;
889
889
  display: flex;
@@ -903,7 +903,7 @@
903
903
  background: none;
904
904
  }
905
905
  }
906
- `,Oy=y(Na__default.default)`
906
+ `,Vy=y(Ua__default.default)`
907
907
  display: flex;
908
908
  gap: 16px;
909
909
  margin-top: 16px;
@@ -911,11 +911,11 @@
911
911
  display: flex;
912
912
  align-items: baseline;
913
913
  gap: 8px;
914
- `;y(R5__default.default)`
914
+ `;y(N5__default.default)`
915
915
  & .MuiChip-label {
916
916
  font-size: 12px;
917
917
  }
918
- `;var zy=({billingPeriod:e,isOnlyBillingPeriod:t})=>{let{billingPeriod:o,setBillingPeriod:n}=te(),i=o===e;return jsxRuntime.jsxs(Uy,{onClick:()=>n(e),$isActive:i,$isOnlyBillingPeriod:t,children:[jsxRuntime.jsx(_5__default.default,{checked:i,onChange:()=>n(e),value:e,disabled:t,inputProps:{"aria-label":Jc(e)},sx:{padding:0,marginRight:"8px"}}),jsxRuntime.jsx(Na__default.default,{children:jsxRuntime.jsx(P,{variant:"h3",color:"primary",children:Jc(e)})})]})};function Vy({plan:e,checkoutLocalization:t}){let[o,n]=lodash.partition(e==null?void 0:e.pricePoints,r=>r.billingPeriod===rh.BillingPeriod.Monthly),i=!!(o!=null&&o.length)&&!!(n!=null&&n.length);return i?jsxRuntime.jsxs(Ny,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",children:t.billingPeriodsTitle}),jsxRuntime.jsxs(Oy,{children:[!!(o!=null&&o.length)&&jsxRuntime.jsx(zy,{billingPeriod:rh.BillingPeriod.Monthly,isOnlyBillingPeriod:!i},rh.BillingPeriod.Monthly),!!(n!=null&&n.length)&&jsxRuntime.jsx(zy,{billingPeriod:rh.BillingPeriod.Annually,isOnlyBillingPeriod:!i},rh.BillingPeriod.Annually)]})]}):null}var H5=y.div`
918
+ `;var $y=({billingPeriod:e,isOnlyBillingPeriod:t})=>{let{billingPeriod:o,setBillingPeriod:n}=te(),i=o===e;return jsxRuntime.jsxs(zy,{onClick:()=>n(e),$isActive:i,$isOnlyBillingPeriod:t,children:[jsxRuntime.jsx(M5__default.default,{checked:i,onChange:()=>n(e),value:e,disabled:t,inputProps:{"aria-label":nd(e)},sx:{padding:0,marginRight:"8px"}}),jsxRuntime.jsx(Ua__default.default,{children:jsxRuntime.jsx(P,{variant:"h3",color:"primary",children:nd(e)})})]})};function Hy({plan:e,checkoutLocalization:t}){let[o,n]=lodash.partition(e==null?void 0:e.pricePoints,r=>r.billingPeriod===ah.BillingPeriod.Monthly),i=!!(o!=null&&o.length)&&!!(n!=null&&n.length);return i?jsxRuntime.jsxs(Oy,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",children:t.billingPeriodsTitle}),jsxRuntime.jsxs(Vy,{children:[!!(o!=null&&o.length)&&jsxRuntime.jsx($y,{billingPeriod:ah.BillingPeriod.Monthly,isOnlyBillingPeriod:!i},ah.BillingPeriod.Monthly),!!(n!=null&&n.length)&&jsxRuntime.jsx($y,{billingPeriod:ah.BillingPeriod.Annually,isOnlyBillingPeriod:!i},ah.BillingPeriod.Annually)]})]}):null}var G5=y.div`
919
919
  display: flex;
920
920
  min-height: 60px;
921
921
  margin-top: 16px;
@@ -926,39 +926,39 @@
926
926
  align-items: flex-start;
927
927
  justify-content: space-between;
928
928
  }
929
- `,W5=y(Na__default.default)`
929
+ `,j5=y(Ua__default.default)`
930
930
  display: flex;
931
931
  flex-direction: column;
932
932
  justify-content: center;
933
933
  width: 100%;
934
934
  height: 42px;
935
- `,G5=y(P)`
935
+ `,Y5=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
- `,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]=Ac.useState(void 0),s=(m=e.feature)==null?void 0:m.featureId,l=!s,c=e.pricingModel===rh.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=jsxRuntime.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=jsxRuntime.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 jsxRuntime.jsxs(H5,{children:[jsxRuntime.jsxs(W5,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",lineHeight:"24px",children:d}),u&&jsxRuntime.jsx(P,{variant:"body1",color:"secondary",lineHeight:"20px",children:br(e.minUnitQuantity,e.maxUnitQuantity,(T=e.feature)==null?void 0:T.unitsPlural)})]}),jsxRuntime.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]=Ac.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 Ac.useEffect(()=>{let u=Object.values(l).some(p=>!p);r(u),a(!u);},[l,r,a]),jsxRuntime.jsx(jsxRuntime.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 jsxRuntime.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__default.default)`
941
+ `,Z5=(e,t)=>{let{minUnitQuantity:o,maxUnitQuantity:n}=e;return !t||t<(o||1)?`Minimum ${o||1}`:n&&t>n?`Maximum ${n}`:""};function X5({charge:e,setBillableFeature:t,billableFeature:o,onValidationChange:n,onBillableFeatureChange:i}){var m,g,f,x,b,T;let[r,a]=Fc.useState(void 0),s=(m=e.feature)==null?void 0:m.featureId,l=!s,c=e.pricingModel===ah.BillingModel.UsageBased,d=l?"Base charge":vn(((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(Z5(e,_!=null?_:void 0)),t(s,_!=null?_:null);return}let M=ga(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=jsxRuntime.jsx(Er,{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=jsxRuntime.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 jsxRuntime.jsxs(G5,{children:[jsxRuntime.jsxs(j5,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",lineHeight:"24px",children:d}),u&&jsxRuntime.jsx(P,{variant:"body1",color:"secondary",lineHeight:"20px",children:Cr(e.minUnitQuantity,e.maxUnitQuantity,(T=e.feature)==null?void 0:T.unitsPlural)})]}),jsxRuntime.jsx(Y5,{variant:"h6",color:"primary",children:h})]})}function jy({plan:e,billingPeriod:t,onBillableFeatureChange:o}){var d;let{billableFeatures:n,setBillableFeature:i}=te(),{setIsDisabled:r}=ke(),{setIsValid:a}=Y(),s=xa(((d=e==null?void 0:e.pricePoints)==null?void 0:d.filter(u=>u.billingPeriod===t))||[]),[l,c]=Fc.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 Fc.useEffect(()=>{let u=Object.values(l).some(p=>!p);r(u),a(!u);},[l,r,a]),jsxRuntime.jsx(jsxRuntime.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 jsxRuntime.jsx(X5,{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 Yy=y(Ua__default.default)`
942
942
  width: 100%;
943
- `;var Yy=({onChangePlan:e,onBillableFeatureChange:t})=>{let{checkoutState:o,checkoutLocalization:n}=Y(),{plan:i}=o||{},{billingPeriod:r}=te();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(By,{allowChangePlan:true,onChangePlan:e}),jsxRuntime.jsxs(Gy,{children:[jsxRuntime.jsx(Vy,{plan:i,checkoutLocalization:n}),jsxRuntime.jsx(Wy,{plan:i,billingPeriod:r,onBillableFeatureChange:t})]})]})};var q5=e=>jsxRuntime.jsx("svg",A(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"arrow-right",children:[jsxRuntime.jsx("path",{id:"Shape",d:"M2.66699 8H13.3337",stroke:"#7586B0",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.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)`
943
+ `;var Xy=({onChangePlan:e,onBillableFeatureChange:t})=>{let{checkoutState:o,checkoutLocalization:n}=Y(),{plan:i}=o||{},{billingPeriod:r}=te();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Dy,{allowChangePlan:true,onChangePlan:e}),jsxRuntime.jsxs(Yy,{children:[jsxRuntime.jsx(Hy,{plan:i,checkoutLocalization:n}),jsxRuntime.jsx(jy,{plan:i,billingPeriod:r,onBillableFeatureChange:t})]})]})};var J5=e=>jsxRuntime.jsx("svg",A(S({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:jsxRuntime.jsxs("g",{id:"arrow-right",children:[jsxRuntime.jsx("path",{id:"Shape",d:"M2.66699 8H13.3337",stroke:"#7586B0",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{id:"Shape_2",d:"M9.33301 4L13.333 8L9.33301 12",stroke:"#7586B0",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})})),Ky=J5;var qy=y(Ky)`
944
944
  path {
945
945
  stroke: ${({theme:e})=>e.stigg.palette.text.secondary};
946
946
  }
947
- `;var tv=y(Na__default.default)`
947
+ `;var ov=y(Ua__default.default)`
948
948
  display: flex;
949
- `,ev=y(o5__default.default)`
949
+ `,nv=y(i5__default.default)`
950
950
  margin-bottom: 16px;
951
- `,ov=y(Na__default.default)`
951
+ `,iv=y(Ua__default.default)`
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
- `,Ky=({headerText:e,planName:t,priceText:o})=>jsxRuntime.jsxs(ov,{className:"stigg-checkout-downgrade-to-free-container",children:[jsxRuntime.jsx(P,{className:"stigg-checkout-downgrade-to-free-text-header",style:{opacity:.8},variant:"caption",color:"disabled",children:e}),jsxRuntime.jsx(P,{className:"stigg-checkout-downgrade-to-free-plan-name",bold:true,variant:"h3",color:"primary",children:t}),jsxRuntime.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=jsxRuntime.jsx(Oa,{onClick:()=>{i({currentPlan:o});},checkoutLocalization:e,size:"small"}));let a=t.prices.length>0?t.prices[0].billingPeriod:void 0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ev,{action:r,className:"stigg-checkout-downgrade-to-free-alert",severity:"info",children:jsxRuntime.jsx(P,{as:"span",color:"secondary",children:e.downgradeToFree.alertText({plan:t.plan})})}),jsxRuntime.jsxs(tv,{className:"stigg-checkout-downgrade-to-free-plans-container",children:[jsxRuntime.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})}),jsxRuntime.jsx(Xy,{className:"stigg-checkout-downgrade-to-free-arrow",style:{margin:"auto 16px",minWidth:"16px"}}),jsxRuntime.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:jsxRuntime.jsx(Yy,{onChangePlan:o,onBillableFeatureChange:n})};case "ADDONS":return {content:jsxRuntime.jsx(Sy,{onAddonChange:i})};case "PAYMENT":return {content:jsxRuntime.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===rh.PricingType.Free&&!!v&&v.pricingType!==rh.PricingType.Free,{content:M}=av(x,{onBillingAddressChange:n,onChangePlan:o,onBillableFeatureChange:i,onAddonChange:r,collectPhoneNumber:a,collectTaxId:s,onCheckout:e,onCheckoutCompleted:t}),I=jsxRuntime.jsx(jsxRuntime.Fragment,{children:_?jsxRuntime.jsx(Qy,{freePlan:w,activeSubscription:v,allowChangePlan:true,checkoutLocalization:k,onChangePlan:o}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:M})}),F=Ac.useMemo(()=>p?{clientSecret:p}:{mode:"setup",currency:"usd"},[p]);return jsxRuntime.jsx(reactStripeJs.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:jsxRuntime.jsxs(xf,{className:"stigg-checkout-layout",children:[!_&&jsxRuntime.jsx(vf,{}),jsxRuntime.jsxs(bf,{children:[jsxRuntime.jsx(Cf,{children:b?jsxRuntime.jsx(wm,{}):I}),b?jsxRuntime.jsx(py,{showWatermark:f}):jsxRuntime.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 jsxRuntime.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:jsxRuntime.jsx(o1,S({},u))})};function cv(e){return Ac.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]=Ac.useState("IN_PROGRESS"),[a,s]=Ac.useState(false),l=cv("checkoutCompleted");return Ac.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:jsxRuntime.jsx(jsxRuntime.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:jsxRuntime.jsx(jsxRuntime.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:jsxRuntime.jsx(jsxRuntime.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:jsxRuntime.jsx(jsxRuntime.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=Ac.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 Ac.useMemo(()=>({balance:r,isLoading:s,error:a}),[r,a,s])}var Ln=y.div`
956
+ `,Qy=({headerText:e,planName:t,priceText:o})=>jsxRuntime.jsxs(iv,{className:"stigg-checkout-downgrade-to-free-container",children:[jsxRuntime.jsx(P,{className:"stigg-checkout-downgrade-to-free-text-header",style:{opacity:.8},variant:"caption",color:"disabled",children:e}),jsxRuntime.jsx(P,{className:"stigg-checkout-downgrade-to-free-plan-name",bold:true,variant:"h3",color:"primary",children:t}),jsxRuntime.jsx(P,{className:"stigg-checkout-downgrade-to-free-price-text",color:"secondary",children:o})]}),t1=({checkoutLocalization:e,activeSubscription:t,freePlan:o,allowChangePlan:n=false,onChangePlan:i})=>{let r;n&&i&&(r=jsxRuntime.jsx(za,{onClick:()=>{i({currentPlan:o});},checkoutLocalization:e,size:"small"}));let a=t.prices.length>0?t.prices[0].billingPeriod:void 0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(nv,{action:r,className:"stigg-checkout-downgrade-to-free-alert",severity:"info",children:jsxRuntime.jsx(P,{as:"span",color:"secondary",children:e.downgradeToFree.alertText({plan:t.plan})})}),jsxRuntime.jsxs(ov,{className:"stigg-checkout-downgrade-to-free-plans-container",children:[jsxRuntime.jsx(Qy,{headerText:e.downgradeToFree.paidPlanHeader({plan:t.plan}),planName:e.downgradeToFree.paidPlanName({plan:t.plan}),priceText:e.downgradeToFree.paidPlanPriceText({plan:t.plan,billingPeriod:a})}),jsxRuntime.jsx(qy,{className:"stigg-checkout-downgrade-to-free-arrow",style:{margin:"auto 16px",minWidth:"16px"}}),jsxRuntime.jsx(Qy,{headerText:e.downgradeToFree.freePlanHeader({plan:o}),planName:e.downgradeToFree.freePlanName({plan:o}),priceText:e.downgradeToFree.freePlanPriceText({plan:o})})]})]})};var lv=(e,{onBillingAddressChange:t,onChangePlan:o,onBillableFeatureChange:n,onAddonChange:i,collectPhoneNumber:r,collectTaxId:a,onCheckout:s,onCheckoutCompleted:l})=>{switch(e.key){case "PLAN":return {content:jsxRuntime.jsx(Xy,{onChangePlan:o,onBillableFeatureChange:n})};case "ADDONS":return {content:jsxRuntime.jsx(ky,{onAddonChange:i})};case "PAYMENT":return {content:jsxRuntime.jsx(Ly,{onBillingAddressChange:t,collectPhoneNumber:r,collectTaxId:a,onCheckout:s,onCheckoutCompleted:l})};default:return {content:null}}};function i1({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}=Vf(),[{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===ah.PricingType.Free&&!!v&&v.pricingType!==ah.PricingType.Free,{content:M}=lv(x,{onBillingAddressChange:n,onChangePlan:o,onBillableFeatureChange:i,onAddonChange:r,collectPhoneNumber:a,collectTaxId:s,onCheckout:e,onCheckoutCompleted:t}),I=jsxRuntime.jsx(jsxRuntime.Fragment,{children:_?jsxRuntime.jsx(t1,{freePlan:w,activeSubscription:v,allowChangePlan:true,checkoutLocalization:k,onChangePlan:o}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:M})}),F=Fc.useMemo(()=>p?{clientSecret:p}:{mode:"setup",currency:"usd"},[p]);return jsxRuntime.jsx(reactStripeJs.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:jsxRuntime.jsxs(Cf,{className:"stigg-checkout-layout",children:[!_&&jsxRuntime.jsx(Af,{}),jsxRuntime.jsxs(Pf,{children:[jsxRuntime.jsx(Sf,{children:b?jsxRuntime.jsx(vm,{}):I}),b?jsxRuntime.jsx(hy,{showWatermark:f}):jsxRuntime.jsx(my,{disablePromotionCode:l,disableSuccessAnimation:c,onCheckout:e,onCheckoutCompleted:t,isFreeDowngrade:_,onMockCheckoutPreview:d,showWatermark:f})]})]})},p)}var a1=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 jsxRuntime.jsx(yf,{textOverrides:e,theme:t,resourceId:o,planId:n,preferredBillingPeriod:i,billingCountryCode:r,billableFeatures:a,billingInformation:s,onMockCheckoutState:l,skipCheckoutSteps:c,onBeforeStepChange:d,children:jsxRuntime.jsx(i1,S({},u))})};function uv(e){return Fc.useMemo(()=>{let t=new URLSearchParams(window.location.search);return t.get(e)},[e,window.location.search])}var ld=(n=>(n.IN_PROGRESS="IN_PROGRESS",n.SUCCEEDED="SUCCEEDED",n.FAILED="FAILED",n))(ld||{}),l1=({onProvisionStart:e,onProvisionSucceeded:t,onProvisionFailed:o}={})=>{let{stigg:n}=D(),[i,r]=Fc.useState("IN_PROGRESS"),[a,s]=Fc.useState(false),l=uv("checkoutCompleted");return Fc.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 pv(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=ka(o);return r?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function gv(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=wa(o);return r?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function xv(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=va(o);return r?t:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e!=null?e:null})}function Pv(n){var i=n,{noAccessComponent:e,children:t}=i,o=ot(i,["noAccessComponent","children"]);let{hasAccess:r}=_a(o);return r?t:jsxRuntime.jsx(jsxRuntime.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=Fc.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 Fc.useMemo(()=>({balance:r,isLoading:s,error:a}),[r,a,s])}var Bn=y.div`
957
957
  display: flex;
958
958
  align-items: center;
959
959
  justify-content: space-between;
960
960
  width: 100%;
961
- `;var Bn=y.button`
961
+ `;var Rn=y.button`
962
962
  display: flex;
963
963
  align-items: center;
964
964
  gap: 4px;
@@ -984,27 +984,27 @@
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 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__default.default(e).format("MMM D, YYYY h:mmA")}function sd(e){return rd__default.default(e).format("MMM D, YYYY")}function kv(e){return rd__default.default(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?jsxRuntime.jsx(P,{variant:"caption",color:"secondary",className:o,children:n}):null}var _v=y.div`
987
+ `;var mo=(e,t)=>e?ft(e,{maximumFractionDigits:t!=null?t:void 0}):0,$a=(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(" ")},Ha=(e,t)=>t===0?0:Math.min(e/t*100,100);function Wa({usagePeriodEnd:e,formatResetPeriod:t,className:o}){let n=la({usagePeriodEnd:e,formatter:t});return n?jsxRuntime.jsx(P,{variant:"caption",color:"secondary",className:o,children:n}):null}var Av=y.div`
988
988
  display: flex;
989
989
  flex-direction: column;
990
990
  gap: 4px;
991
- `,Av=y.div`
991
+ `,Mv=y.div`
992
992
  display: flex;
993
993
  flex-direction: row;
994
994
  gap: 4px;
995
995
  align-items: baseline;
996
- `;function c1({balance:e,isLoading:t,error:o,decimalPlaces:n=null,showUnits:i=true,showSymbol:r=false}){if(o)return jsxRuntime.jsx(P,{variant:"body1",color:"error",className:"stigg-credit-balance-value-error",children:o.message||"Failed to load balance"});if(t)return jsxRuntime.jsx(ro__default.default,{width:120,height:24,className:"stigg-credit-balance-value-loading"});if(e){let a=Va(e,i,r);return jsxRuntime.jsxs(_v,{children:[jsxRuntime.jsxs(Av,{children:[jsxRuntime.jsx(P,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-balance-value-amount",children:mo(e.currentBalance,n)}),jsxRuntime.jsx(P,{variant:"caption",color:"secondary",className:"stigg-credit-balance-value-suffix",children:a})]}),jsxRuntime.jsx(Ha,{usagePeriodEnd:e.usagePeriodEnd,className:"stigg-credit-balance-reset-period"})]})}return jsxRuntime.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)`
996
+ `;function d1({balance:e,isLoading:t,error:o,decimalPlaces:n=null,showUnits:i=true,showSymbol:r=false}){if(o)return jsxRuntime.jsx(P,{variant:"body1",color:"error",className:"stigg-credit-balance-value-error",children:o.message||"Failed to load balance"});if(t)return jsxRuntime.jsx(ro__default.default,{width:120,height:24,className:"stigg-credit-balance-value-loading"});if(e){let a=$a(e,i,r);return jsxRuntime.jsxs(Av,{children:[jsxRuntime.jsxs(Mv,{children:[jsxRuntime.jsx(P,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-balance-value-amount",children:mo(e.currentBalance,n)}),jsxRuntime.jsx(P,{variant:"caption",color:"secondary",className:"stigg-credit-balance-value-suffix",children:a})]}),jsxRuntime.jsx(Wa,{usagePeriodEnd:e.usagePeriodEnd,className:"stigg-credit-balance-reset-period"})]})}return jsxRuntime.jsx(P,{variant:"body1",color:"disabled",className:"stigg-credit-balance-value-no-balance",children:"No balance data available"})}var u1={title:"Credit balance",addCredits:"Add credits"},Ga={title:"Credit utilization",remaining:"Remaining",addCredits:"Add credits"},p1={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"},m1={title:"Usage",totalSpend:"Total spend"},h1={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 ja=y(ba)`
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 Mv=y.div`
1002
+ `;var Iv=y.div`
1003
1003
  display: flex;
1004
1004
  flex-direction: column;
1005
1005
  gap: 8px;
1006
1006
  width: 100%;
1007
- `,Iv=y.div`
1007
+ `,Ev=y.div`
1008
1008
  display: flex;
1009
1009
  flex-direction: column;
1010
1010
  gap: 8px;
@@ -1012,12 +1012,12 @@
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 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=jsxRuntime.jsx(Mv,{className:"stigg-credit-balance-container",children:jsxRuntime.jsxs(Iv,{className:"stigg-credit-balance-card",children:[jsxRuntime.jsxs(Ln,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:p}),r&&c&&!u&&jsxRuntime.jsxs(Bn,{type:"button",onClick:()=>r(c),className:"stigg-credit-balance-add-credits-button",children:[jsxRuntime.jsx(Ga,{className:"stigg-credit-balance-add-credits-icon"}),h]})]}),jsxRuntime.jsx(c1,{balance:c,isLoading:d,error:u,decimalPlaces:o,showUnits:n,showSymbol:i})]})});return a?m:jsxRuntime.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(`
1015
+ `;function g1({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({},u1),t),m=jsxRuntime.jsx(Iv,{className:"stigg-credit-balance-container",children:jsxRuntime.jsxs(Ev,{className:"stigg-credit-balance-card",children:[jsxRuntime.jsxs(Bn,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:p}),r&&c&&!u&&jsxRuntime.jsxs(Rn,{type:"button",onClick:()=>r(c),className:"stigg-credit-balance-add-credits-button",children:[jsxRuntime.jsx(ja,{className:"stigg-credit-balance-add-credits-icon"}),h]})]}),jsxRuntime.jsx(d1,{balance:c,isLoading:d,error:u,decimalPlaces:o,showUnits:n,showSymbol:i})]})});return a?m:jsxRuntime.jsx(ht,{componentTheme:l,children:m})}function he(){}var fd=(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 yd=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:e/t,ts=(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 Vn(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 Oi(e){if(Z(e))return e.map(Oi);if(z(e)){let t=Object.create(null),o=Object.keys(e),n=o.length,i=0;for(;i<n;++i)t[o[i]]=Oi(e[o[i]]);return t}return e}function M1(e){return ["__proto__","prototype","constructor"].indexOf(e)===-1}function I1(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]=Oi(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||I1;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:E1})}function E1(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]=Oi(i));}var f1={"":e=>e,x:e=>e.x,y:e=>e.y};function Ae(e,t){return (f1[t]||(f1[t]=Fv(t)))(e)}function Fv(e){let t=F1(e);return o=>{for(let n of t){if(n==="")break;o=o&&o[n];}return o}}function F1(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 Vi(e){return e.charAt(0).toUpperCase()+e.slice(1)}var st=e=>typeof e!="undefined",Tt=e=>typeof e=="function",es=(e,t)=>{if(e.size!==t.size)return false;for(let o of e)if(!t.has(o))return false;return true};function xd(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}var G=Math.PI,Q=2*G,L1=Q+G,zi=Number.POSITIVE_INFINITY,$i=G/180,et=G/2,ie=G/4,Un=G*2/3,zt=Math.log10,re=Math.sign;function os(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 bd(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 ns(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 is(e){if(!lt(e))return;let t=1,o=0;for(;Math.round(e*t)/t!==e;)t*=10,o++;return o}function rs(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 B1(e,t){return (e-t+L1)%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 Pd(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 Hi(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)=>Hi(e,o,n?i=>e[i][t]<=o:i=>e[i][t]<o),Sd=(e,t,o)=>Hi(e,o,n=>e[n][t]>=o);function Td(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 R1=["push","pop","shift","splice","unshift"];function kd(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:true,enumerable:false,value:{listeners:[t]}}),R1.forEach(o=>{let n="_onData"+Vi(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 as(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)&&(R1.forEach(r=>{delete e[r];}),delete e._chartjs);}function ss(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 ls=(function(){return typeof window=="undefined"?function(e){return e()}:window.requestAnimationFrame})();function cs(e,t,o){let n=o||(a=>Array.prototype.slice.call(a)),i=false,r=[];return function(...a){r=n(a),i||(i=true,ls.call(window,()=>{i=false,e.apply(t,r);}));}}function wd(e,t){let o;return function(...n){return t?(clearTimeout(o),o=setTimeout(e,t,n)):e.apply(this,n),t}}var Wi=e=>e==="start"?"left":e==="end"?"right":"center",Pt=(e,t,o)=>e==="start"?t:e==="end"?o:(t+o)/2,vd=(e,t,o,n)=>e===(n?"left":"right")?o:e==="center"?(t+o)/2:t;function ds(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 us(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 Ya=e=>e===0||e===1,y1=(e,t,o)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Q/o)),x1=(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=>Ya(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=>Ya(e)?e:y1(e,.075,.3),easeOutElastic:e=>Ya(e)?e:x1(e,.075,.3),easeInOutElastic(e){return Ya(e)?e:e<.5?.5*y1(e*2,.1125,.45):.5+.5*x1(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 Gi(e){return e+.5|0}var ho=(e,t,o)=>Math.max(Math.min(e,o),t);function Ni(e){return ho(Gi(e*2.55),0,255)}function go(e){return ho(Gi(e*255),0,255)}function Ue(e){return ho(Gi(e/2.55)/100,0,1)}function b1(e){return ho(Gi(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},md=[..."0123456789ABCDEF"],Lv=e=>md[e&15],Bv=e=>md[(e&240)>>4]+md[e&15],Za=e=>(e&240)>>4===(e&15),Rv=e=>Za(e.r)&&Za(e.g)&&Za(e.b)&&Za(e.a);function Dv(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 Nv=(e,t)=>e<255?t(e):"";function Uv(e){var t=Rv(e)?Lv:Bv;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Nv(e.a,t):void 0}var Ov=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function D1(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 zv(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 Vv(e,t,o){let n=D1(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 $v(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 _d(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=$v(o,n,i,d,r),l=l*60+.5),[l|0,c||0,s]}function Ad(e,t,o,n){return (Array.isArray(t)?e(t[0],t[1],t[2]):e(t,o,n)).map(go)}function Md(e,t,o){return Ad(D1,e,t,o)}function Hv(e,t,o){return Ad(Vv,e,t,o)}function Wv(e,t,o){return Ad(zv,e,t,o)}function N1(e){return (e%360+360)%360}function Gv(e){let t=Ov.exec(e),o=255,n;if(!t)return;t[5]!==n&&(o=t[6]?Ni(+t[5]):go(+t[5]));let i=N1(+t[2]),r=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?n=Hv(i,r,a):t[1]==="hsv"?n=Wv(i,r,a):n=Md(i,r,a),{r:n[0],g:n[1],b:n[2],a:o}}function jv(e,t){var o=_d(e);o[0]=N1(o[0]+t),o=Md(o),e.r=o[0],e.g=o[1],e.b=o[2];}function Yv(e){if(!e)return;let t=_d(e),o=t[0],n=b1(t[1]),i=b1(t[2]);return e.a<255?`hsla(${o}, ${n}%, ${i}%, ${Ue(e.a)})`:`hsl(${o}, ${n}%, ${i}%)`}var C1={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"},P1={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 Zv(){let e={},t=Object.keys(P1),o=Object.keys(C1),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,C1[r]);r=parseInt(P1[a],16),e[s]=[r>>16&255,r>>8&255,r&255];}return e}var Xa;function Xv(e){Xa||(Xa=Zv(),Xa.transparent=[0,0,0,0]);let t=Xa[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Kv=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function qv(e){let t=Kv.exec(e),o=255,n,i,r;if(t){if(t[7]!==n){let a=+t[7];o=t[8]?Ni(a):ho(a*255,0,255);}return n=+t[1],i=+t[3],r=+t[5],n=255&(t[2]?Ni(n):ho(n,0,255)),i=255&(t[4]?Ni(i):ho(i,0,255)),r=255&(t[6]?Ni(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 dd=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Nn=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Jv(e,t,o){let n=Nn(Ue(e.r)),i=Nn(Ue(e.g)),r=Nn(Ue(e.b));return {r:go(dd(n+o*(Nn(Ue(t.r))-n))),g:go(dd(i+o*(Nn(Ue(t.g))-i))),b:go(dd(r+o*(Nn(Ue(t.b))-r))),a:e.a+o*(t.a-e.a)}}function Ka(e,t,o){if(e){let n=_d(e);n[t]=Math.max(0,Math.min(n[t]+n[t]*o,t===0?360:1)),n=Md(n),e.r=n[0],e.g=n[1],e.b=n[2];}}function U1(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=go(e[3]))):(t=U1(e,{r:0,g:0,b:0,a:1}),t.a=go(t.a)),t}function t6(e){return e.charAt(0)==="r"?qv(e):Gv(e)}var hd=class e{constructor(t){if(t instanceof e)return t;let o=typeof t,n;o==="object"?n=S1(t):o==="string"&&(n=Dv(t)||Xv(t)||t6(t)),this._rgb=n,this._valid=!!n;}get valid(){return this._valid}get rgb(){var t=U1(this._rgb);return t&&(t.a=Ue(t.a)),t}set rgb(t){this._rgb=S1(t);}rgbString(){return this._valid?Qv(this._rgb):void 0}hexString(){return this._valid?Uv(this._rgb):void 0}hslString(){return this._valid?Yv(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=Jv(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=Gi(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 Ka(this._rgb,2,t),this}darken(t){return Ka(this._rgb,2,-t),this}saturate(t){return Ka(this._rgb,1,t),this}desaturate(t){return Ka(this._rgb,1,-t),this}rotate(t){return jv(this._rgb,t),this}};function O1(e){return new hd(e)}function Id(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return false}function tn(e){return Id(e)?e:O1(e)}function Qa(e){return Id(e)?e:O1(e).saturate(.5).darken(.1).hexString()}var yo=Object.create(null),ps=Object.create(null);function Ui(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 ud(e,t,o){return typeof t=="string"?Xt(Ui(e,t),o):Xt(Ui(e,""),t)}var gd=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 ud(this,t,o)}get(t){return Ui(this,t)}describe(t,o){return ud(ps,t,o)}override(t,o){return ud(yo,t,o)}route(t,o,n,i){let r=Ui(this,t),a=Ui(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 gd({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:false,_indexable:false}});function z1(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 Ed(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 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 ms(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore();}function ji(e,t,o,n){hs(e,t,o,n,null);}function hs(e,t,o,n,i){let r,a,s,l,c,d,u=t.pointStyle,p=t.rotation,h=t.radius,m=(p||0)*$i;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+=Un,e.lineTo(o+Math.sin(m)*h,n-Math.cos(m)*h),m+=Un,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 Fd(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 Ld(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,e6(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),o6(e,o,n,c,r),n+=i.lineHeight;e.restore();}function e6(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 o6(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 n6=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),i6=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function V1(e,t){let o=(""+e).match(n6);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 r6=e=>+e||0;function Yi(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]=r6(r(a));return o}function gs(e){return Yi(e,{top:"y",right:"x",bottom:"y",left:"x"})}function fe(e){return Yi(e,["topLeft","topRight","bottomLeft","bottomRight"])}function pt(e){let t=gs(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(i6)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");let i={family:N(e.family,t.family),lineHeight:V1(N(e.lineHeight,t.lineHeight),o),size:o,style:n,weight:N(e.weight,t.weight),string:""};return i.string=z1(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 Bd(e,t,o){let{min:n,max:i}=e,r=ts(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 Zi(e,t=[""],o=e,n,i=()=>e[0]){st(n)||(n=W1("_fallback",e));let r={[Symbol.toStringTag]:"Object",_cacheable:true,_scopes:e,_rootScopes:o,_fallback:n,_getTarget:i,override:a=>Zi([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,()=>m6(s,t,e,a))},getOwnPropertyDescriptor(a,s){return Reflect.getOwnPropertyDescriptor(a._scopes[0],s)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,s){return k1(a).includes(s)},ownKeys(a){return k1(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:fs(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 $1(r,a,()=>s6(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 fs(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 a6=(e,t)=>e?e+Vi(t):t,Rd=(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 s6(e,t,o){let{_proxy:n,_context:i,_subProxy:r,_descriptors:a}=e,s=n[t];return Tt(s)&&a.isScriptable(t)&&(s=l6(t,s,e,o)),Z(s)&&s.length&&(s=c6(t,s,e,a.isIndexable)),Rd(t,s)&&(s=fo(s,i,r&&r[t],a)),s}function l6(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),Rd(e,t)&&(t=Dd(i._scopes,i,e,t)),t}function c6(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=Dd(c,i,e,d);t.push(fo(u,r,a&&a[e],s));}}return t}function H1(e,t,o){return Tt(e)?e(t,o):e}var d6=(e,t)=>e===true?t:typeof e=="string"?Ae(t,e):void 0;function u6(e,t,o,n,i){for(let r of t){let a=d6(o,r);if(a){e.add(a);let s=H1(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 Dd(e,t,o,n){let i=t._rootScopes,r=H1(t._fallback,o,n),a=[...e,...i],s=new Set;s.add(n);let l=T1(s,a,o,r||o,n);return l===null||st(r)&&r!==o&&(l=T1(s,a,r,l,n),l===null)?false:Zi(Array.from(s),[""],i,r,()=>p6(t,o,n))}function T1(e,t,o,n,i){for(;o;)o=u6(e,t,o,n,i);return o}function p6(e,t,o){let n=e._getTarget();t in n||(n[t]={});let i=n[t];return Z(i)&&z(o)?o:i}function m6(e,t,o,n){let i;for(let r of t)if(i=W1(a6(r,e),o),st(i))return Rd(e,i)?Dd(o,n,e,i):i}function W1(e,t){for(let o of t){if(!o)continue;let n=o[e];if(st(n))return n}}function k1(e){let t=e._keys;return t||(t=e._keys=h6(e._scopes)),t}function h6(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 ys(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 g6=Number.EPSILON||1e-14,zn=(e,t)=>t<e.length&&!e[t].skip&&e[t],G1=e=>e==="x"?"y":"x";function j1(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 f6(e,t,o){let n=e.length,i,r,a,s,l,c=zn(e,0);for(let d=0;d<n-1;++d)if(l=c,c=zn(e,d+1),!(!l||!c)){if(qo(t[d],0,g6)){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 y6(e,t,o="x"){let n=G1(o),i=e.length,r,a,s,l=zn(e,0);for(let c=0;c<i;++c){if(a=s,s=l,l=zn(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 Y1(e,t="x"){let o=G1(t),n=e.length,i=Array(n).fill(0),r=Array(n),a,s,l,c=zn(e,0);for(a=0;a<n;++a)if(s=l,l=c,c=zn(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];}f6(e,i,r),y6(e,r,t);}function qa(e,t,o){return Math.max(Math.min(e,o),t)}function x6(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=qa(i.cp1x,t.left,t.right),i.cp1y=qa(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=qa(i.cp2x,t.left,t.right),i.cp2y=qa(i.cp2y,t.top,t.bottom)));}function Nd(e,t,o,n,i){let r,a,s,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Y1(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=j1(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&&x6(e,o);}function xs(){return typeof window!="undefined"&&typeof document!="undefined"}function Xi(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ja(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 bs=e=>window.getComputedStyle(e,null);function Z1(e,t){return bs(e).getPropertyValue(t)}var b6=["top","right","bottom","left"];function Zo(e,t,o){let n={};o=o?"-"+o:"";for(let i=0;i<4;i++){let r=b6[i];n[r]=parseFloat(e[t+"-"+r+o])||0;}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}var C6=(e,t,o)=>(e>0||t>0)&&(!o||!o.shadowRoot);function P6(e,t){let o=e.touches,n=o&&o.length?o[0]:e,{offsetX:i,offsetY:r}=n,a=false,s,l;if(C6(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=bs(o),r=i.boxSizing==="border-box",a=Zo(i,"padding"),s=Zo(i,"border","width"),{x:l,y:c,box:d}=P6(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 S6(e,t,o){let n,i;if(t===void 0||o===void 0){let r=Xi(e);if(!r)t=e.clientWidth,o=e.clientHeight;else {let a=r.getBoundingClientRect(),s=bs(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=Ja(s.maxWidth,r,"clientWidth"),i=Ja(s.maxHeight,r,"clientHeight");}}return {width:t,height:o,maxWidth:n||zi,maxHeight:i||zi}}var pd=e=>Math.round(e*10)/10;function Ud(e,t,o,n){let i=bs(e),r=Zo(i,"margin"),a=Ja(i.maxWidth,e,"clientWidth")||zi,s=Ja(i.maxHeight,e,"clientHeight")||zi,l=S6(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=pd(Math.min(c,a,l.maxWidth)),d=pd(Math.min(d,s,l.maxHeight)),c&&!d&&(d=pd(c/2)),{width:c,height:d}}function Cs(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 Od=(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=Z1(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 zd(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 Vd(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 w1=new Map;function T6(e,t){t=t||{};let o=e+JSON.stringify(t),n=w1.get(o);return n||(n=new Intl.NumberFormat(e,t),w1.set(o,n)),n}function en(e,t,o){return T6(t,o).format(e)}var k6=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}}},w6=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?k6(t,o):w6()}function Ss(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 Ts(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]));}function X1(e){return e==="angle"?{between:Jo,compare:B1,normalize:Ft}:{between:ge,compare:(t,o)=>t-o,normalize:t=>t}}function v1({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 v6(e,t,o){let{property:n,start:i,end:r}=o,{between:a,normalize:s}=X1(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 ks(e,t,o){if(!o)return [e];let{property:n,start:i,end:r}=o,a=t.length,{compare:s,between:l,normalize:c}=X1(n),{start:d,end:u,loop:p,style:h}=v6(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(v1({start:f,end:M,loop:p,count:a,style:h})),f=null),I=M,T=x));return f!==null&&m.push(v1({start:f,end:u,loop:p,count:a,style:h})),m}function ws(e,t){let o=[],n=e.segments;for(let i=0;i<n.length;i++){let r=ks(n[i],e.points,t);r.length&&o.push(...r);}return o}function _6(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 A6(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 $d(e,t){let o=e.points,n=e.options.spanGaps,i=o.length;if(!i)return [];let r=!!e._loop,{start:a,end:s}=_6(o,i,r,n);if(n===true)return _1(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 _1(e,A6(o,a,l,c),o,t)}function _1(e,t,o,n){return !n||!n.setContext||!o?t:M6(e,t,o,n)}function M6(e,t,o,n){let i=e._chart.getContext(),r=A1(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=A1(n.setContext(Me(i,{type:"segment",p0:g,p1:x,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:a}))),I6(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 A1(e){return {backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function I6(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=ls.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,K1="transparent",E6={boolean(e,t,o){return o>.5?t:e},color(e,t,o){let n=tn(e||K1),i=n.valid&&tn(t||K1);return i&&i.valid?i.mix(n,o).hexString():t},number(e,t,o){return e+(t-e)*o}},Jd=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||E6[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]();}},F6=["x","y","borderWidth","radius","tension"],L6=["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 B6=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:L6},numbers:{type:"number",properties:F6}});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 Wn=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 B6)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=D6(t,n);if(!i)return [];let r=this._createAnimations(i,n);return n.$shared&&R6(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 Jd(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 R6(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 D6(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 q1(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 N6(e,t,o){if(o===false)return false;let n=q1(e,o),i=q1(t,o);return {top:i.end,right:n.end,bottom:i.start,left:n.start}}function U6(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 z0(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 O6(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 J1(e,t){let o=e&&e.options.stacked;return o||o===void 0&&t.stack!==void 0}function z6(e,t,o){return `${e.id}.${t.id}.${o.stack||o.type}`}function V6(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 $6(e,t,o){let n=e[t]||(e[t]={});return n[o]||(n[o]={})}function t0(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 e0(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=z6(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]=$6(i,d,g),p[s]=f,p._top=t0(p,a,true,n.type),p._bottom=t0(p,a,false,n.type);}}function Hd(e,t){let o=e.scales;return Object.keys(o).filter(n=>o[n].axis===t).shift()}function H6(e,t){return Me(e,{active:false,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function W6(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 Ki(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 Wd=e=>e==="reset"||e==="none",o0=(e,t)=>t?e:Object.assign({},e),G6=(e,t,o)=>e&&!t.hidden&&t._stacked&&{keys:z0(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=J1(t.vScale,t),this.addElements();}updateIndex(t){this.index!==t&&Ki(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,Hd(t,"x")),a=o.yAxisID=N(n.yAxisID,Hd(t,"y")),s=o.rAxisID=N(n.rAxisID,Hd(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&&as(this._data,this),t._stacked&&Ki(t);}_dataCheck(){let t=this.getDataset(),o=t.data||(t.data=[]),n=this._data;if(z(o))this._data=O6(o);else if(n!==o){if(n){as(n,this);let i=this._cachedMeta;Ki(i),i._parsed=[];}o&&Object.isExtensible(o)&&kd(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=J1(o.vScale,o),o.stack!==n.stack&&(i=true,Ki(o),o.stack=n.stack),this._resyncElements(t),(i||r!==o._stacked)&&e0(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&&e0(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:z0(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=G6(o,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=V6(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=U6(N(this.options.clip,N6(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=W6(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=H6(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 o0(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(o0(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 Wn(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||Wd(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){Wd(i)?Object.assign(t,n):this._resolveAnimations(o,i).update(t,n);}updateSharedOptions(t,o,n){t&&!Wd(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&&Ki(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 j6(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=ss(n.sort((i,r)=>i-r));}return e._cache.$bar}function Y6(e){let t=e.iScale,o=j6(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 Z6(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 X6(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 K6(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)?K6(e,t,o,n):t[o.axis]=o.parse(e,n),t}function n0(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 Gd(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function q6(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 J6(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[i0(d,a,s,l)]=true,i=c)),r[i0(i,a,s,l)]=true,e.borderSkipped=r;}function i0(e,t,o,n){return n?(e=t_(e,t,o),e=r0(e,o,t)):e=r0(e,t,o),e}function t_(e,t,o){return e===t?o:e===o?t:e}function r0(e,t,o){return e==="start"?t:e==="end"?o:e}function e_(e,{inflateAmount:t},o){e.inflateAmount=t==="auto"?o===1?.33:0:t;}var nn=class extends qt{parsePrimitiveData(t,o,n,i){return n0(t,o,n,i)}parseArrayData(t,o,n,i){return n0(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(V0(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=Gd(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||Gd(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;J6(b,T,x,a),e_(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||Y6(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=Gd(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=q6(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"?X6(t,o,i,c):Z6(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 Gn=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}};Gn.id="bubble";Gn.defaults={datasetElementType:false,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Gn.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return ""}}}}};function o_(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(yd(this.options.cutout,s),1),c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:m,offsetY:g}=o_(u,d,l),f=(n.width-a)/p,x=(n.height-a)/h,b=Math.max(Math.min(f,x)/2,0),T=ts(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 jn=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}=ds(o,i,a);this._drawStart=s,this._drawCount=l,us(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();}};jn.id="line";jn.defaults={datasetElementType:"line",dataElementType:"point",showLine:true,spanGaps:false};jn.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var Yn=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 ys.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}};Yn.id="polarArea";Yn.defaults={dataElementType:"arc",animation:{animateRotate:true,animateScale:true},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Yn.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 nr=class extends To{};nr.id="pie";nr.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var Zn=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 ys.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);}}};Zn.id="radar";Zn.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:true,elements:{line:{fill:"start"}}};Zn.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=n_(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 n_(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 zs={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:zs.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 i_(e,t){let o=e.options.ticks,n=o.maxTicksLimit||r_(e),i=o.major.enabled?s_(t):[],r=i.length,a=i[0],s=i[r-1],l=[];if(r>n)return l_(t,l,i,r/n),l;let c=a_(i,t,n);if(r>0){let d,u,p=r>1?Math.round((s-a)/(r-1)):null;for(vs(t,l,c,W(p)?0:a-p,a),d=0,u=r-1;d<u;d++)vs(t,l,c,i[d],i[d+1]);return vs(t,l,c,s,W(p)?t.length:s+p),l}return vs(t,l,c),l}function r_(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 a_(e,t,o){let n=c_(e),i=t.length/o;if(!n)return Math.max(i,1);let r=bd(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 s_(e){let t=[],o,n;for(o=0,n=e.length;o<n;o++)e[o].major&&t.push(o);return t}function l_(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 vs(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 c_(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 d_=e=>e==="left"?"right":e==="right"?"left":e,a0=(e,t,o)=>t==="top"||t==="left"?e[t]+o:e[t]-o;function s0(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 u_(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 p_(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 qi(e){return e.drawTicks?e.tickLength:0}function l0(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 m_(e,t){return Me(e,{scale:t,type:"scale"})}function h_(e,t,o){return Me(e,{tick:o,index:t,type:"tick"})}function g_(e,t,o){let n=Wi(e);return (o&&t!=="right"||!o&&t==="right")&&(n=d_(n)),n}function f_(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=a0(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=a0(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=Bd(this,r,i),this._dataLimitsCached=true),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=s<this.ticks.length;this._convertTicksToLabels(l?s0(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=i_(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-qi(t.grid)-o.padding-l0(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=l0(i,o.options.font);if(s?(t.width=this.maxWidth,t.height=qi(r)+l):(t.height=this.maxHeight,t.width=qi(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=s0(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=On(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=On(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);}p_(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 Pd(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=h_(this.getContext(),t,n))}return this.$context||(this.$context=m_(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=qi(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=u_(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=qi(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}=f_(this,l,o,s);He(t,n.text,0,0,r,{color:n.color,maxWidth:u,rotation:p,textAlign:g_(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}},Hn=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;b_(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,y_(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 y_(e,t,o){let n=Xt(Object.create(null),[o?H.get(o):{},H.get(t),e.defaults]);H.set(t,n),e.defaultRoutes&&x_(t,e.defaultRoutes),e.descriptors&&H.describe(t,e.descriptors);}function x_(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 b_(e){return "id"in e&&"defaults"in e}var tu=class{constructor(){this.controllers=new Hn(qt,"datasets",true),this.elements=new Hn(xt,"elements"),this.plugins=new Hn(Object,"plugins"),this.scales=new Hn(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=Vi(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 tu,Xn=class extends qt{update(t){let o=this._cachedMeta,{data:n=[]}=o,i=this.chart._animationsDisabled,{start:r,count:a}=ds(o,n,i);if(this._drawStart=r,this._drawCount=a,us(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}};Xn.id="scatter";Xn.defaults={datasetElementType:false,dataElementType:"point",showLine:false,fill:false};Xn.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 ir=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()}};ir.override=function(e){Object.assign(ir.prototype,e);};var C_={_date:ir};function P_(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?Sd: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 sr(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}=P_(r[s],t,a,i);for(let h=u;h<=p;++h){let m=d[h];m.skip||n(m,c,h);}}}function S_(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 jd(e,t,o,n,i){let r=[];return !i&&!e.isPointInArea(t)||sr(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}=rs(a,{x:t.x,y:t.y});Jo(u,c,d)&&i.push({element:a,datasetIndex:s,index:l});}return sr(e,o,t,r),i}function k_(e,t,o,n,i,r){let a=[],s=S_(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 sr(e,o,t,c),a}function Yd(e,t,o,n,i,r){return !r&&!e.isPointInArea(t)?[]:o==="r"&&!n?T_(e,t,o,i):k_(e,t,o,n,i,r)}function c0(e,t,o,n,i){let r=[],a=o==="x"?"inXRange":"inYRange",s=false;return sr(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 w_={modes:{index(e,t,o,n){let i=Ge(t,e),r=o.axis||"x",a=o.includeInvisible||false,s=o.intersect?jd(e,i,r,n,a):Yd(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?jd(e,i,r,n,a):Yd(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 jd(e,i,r,n,a)},nearest(e,t,o,n){let i=Ge(t,e),r=o.axis||"xy",a=o.includeInvisible||false;return Yd(e,i,r,o.intersect,n,a)},x(e,t,o,n){let i=Ge(t,e);return c0(e,i,"x",o.intersect,n)},y(e,t,o,n){let i=Ge(t,e);return c0(e,i,"y",o.intersect,n)}}},H0=["left","top","right","bottom"];function Qi(e,t){return e.filter(o=>o.pos===t)}function d0(e,t){return e.filter(o=>H0.indexOf(o.pos)===-1&&o.box.axis===t)}function Ji(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 v_(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 __(e){let t={};for(let o of e){let{stack:n,pos:i,stackWeight:r}=o;if(!n||!H0.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 A_(e,t){let o=__(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 M_(e){let t=v_(e),o=Ji(t.filter(c=>c.box.fullSize),true),n=Ji(Qi(t,"left"),true),i=Ji(Qi(t,"right")),r=Ji(Qi(t,"top"),true),a=Ji(Qi(t,"bottom")),s=d0(t,"x"),l=d0(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 u0(e,t,o,n){return Math.max(e[o],t[o])+Math.max(e[n],t[n])}function W0(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 I_(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&&W0(a,r.getPadding());let s=Math.max(0,t.outerWidth-u0(a,e,"left","right")),l=Math.max(0,t.outerHeight-u0(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 E_(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 F_(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 er(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,F_(s.horizontal,t));let{same:u,other:p}=I_(t,o,s,n);c|=u&&i.length,d=d||p,l.fullSize||i.push(s);}return c&&er(i,t,o,n)||d}function _s(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 p0(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?_s(l,i.left,a,o.outerWidth-i.right-i.left,p):_s(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?_s(l,r,i.top,p,o.outerHeight-i.bottom-i.top):_s(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=M_(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);W0(p,pt(n));let h=Object.assign({maxPadding:p,w:r,h:a,x:i.left,y:i.top},i),m=A_(l.concat(c),u);er(s.fullSize,h,u,m),er(l,h,u,m),er(c,h,u,m)&&er(l,h,u,m),E_(h),p0(s.leftAndTop,h,u,m),h.x+=h.w,h.y+=h.h,p0(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});});}},Fs=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){}},eu=class extends Fs{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=false;}},Es="$chartjs",L_={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},m0=e=>e===null||e==="";function B_(e,t){let o=e.style,n=e.getAttribute("height"),i=e.getAttribute("width");if(e[Es]={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",m0(i)){let r=Ps(e,"width");r!==void 0&&(e.width=r);}if(m0(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 G0=Od?{passive:true}:false;function R_(e,t,o){e.addEventListener(t,o,G0);}function D_(e,t,o){e.canvas.removeEventListener(t,o,G0);}function N_(e,t){let o=L_[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 Ls(e,t){for(let o of e)if(o===t||o.contains(t))return true}function U_(e,t,o){let n=e.canvas,i=new MutationObserver(r=>{let a=false;for(let s of r)a=a||Ls(s.addedNodes,n),a=a&&!Ls(s.removedNodes,n);a&&o();});return i.observe(document,{childList:true,subtree:true}),i}function O_(e,t,o){let n=e.canvas,i=new MutationObserver(r=>{let a=false;for(let s of r)a=a||Ls(s.removedNodes,n),a=a&&!Ls(s.addedNodes,n);a&&o();});return i.observe(document,{childList:true,subtree:true}),i}var rr=new Map,h0=0;function j0(){let e=window.devicePixelRatio;e!==h0&&(h0=e,rr.forEach((t,o)=>{o.currentDevicePixelRatio!==e&&t();}));}function z_(e,t){rr.size||window.addEventListener("resize",j0),rr.set(e,t);}function V_(e){rr.delete(e),rr.size||window.removeEventListener("resize",j0);}function $_(e,t,o){let n=e.canvas,i=n&&Xi(n);if(!i)return;let r=cs((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),z_(e,r),a}function Zd(e,t,o){o&&o.disconnect(),t==="resize"&&V_(e);}function H_(e,t,o){let n=e.canvas,i=cs(r=>{e.ctx!==null&&o(N_(r,e));},e,r=>{let a=r[0];return [a,a.offsetX,a.offsetY]});return R_(n,t,i),i}var ou=class extends Fs{acquireContext(t,o){let n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(B_(t,o),n):null}releaseContext(t){let o=t.canvas;if(!o[Es])return false;let n=o[Es].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[Es],true}addEventListener(t,o,n){this.removeEventListener(t,o);let i=t.$proxies||(t.$proxies={}),a={attach:U_,detach:O_,resize:$_}[o]||H_;i[o]=a(t,o,n);}removeEventListener(t,o){let n=t.$proxies||(t.$proxies={}),i=n[o];if(!i)return;(({attach:Zd,detach:Zd,resize:Zd})[o]||D_)(t,o,i),n[o]=void 0;}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,o,n,i){return Ud(t,o,n,i)}isAttached(t){let o=Xi(t);return !!(o&&o.isConnected)}};function W_(e){return !xs()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?eu:ou}var nu=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=G_(n);return i===false&&!o?[]:Y_(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 G_(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 j_(e,t){return !t&&e===false?null:e===true?{}:e}function Y_(e,{plugins:t,localIds:o},n,i){let r=[],a=e.getContext();for(let s of t){let l=s.id,c=j_(n[l],i);c!==null&&r.push({plugin:s,options:Z_(e.config,{plugin:s,local:o[l]},c,a)});}return r}function Z_(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 iu(e,t){let o=H.datasets[e]||{};return ((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||o.indexAxis||"x"}function X_(e,t){let o=e;return e==="_index_"?o=t:e==="_value_"&&(o=t==="x"?"y":"x"),o}function K_(e,t){return e===t?"_index_":"_value_"}function q_(e){if(e==="top"||e==="bottom")return "x";if(e==="left"||e==="right")return "y"}function ru(e,t){return e==="x"||e==="y"?e:t.axis||q_(t.position)||e.charAt(0).toLowerCase()}function Q_(e,t){let o=yo[e.type]||{scales:{}},n=t.scales||{},i=iu(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=ru(s,l),d=K_(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||iu(l,t),u=(yo[l]||{}).scales||{};Object.keys(u).forEach(p=>{let h=X_(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 Y0(e){let t=e.options||(e.options={});t.plugins=N(t.plugins,{}),t.scales=Q_(e,t);}function Z0(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function J_(e){return e=e||{},e.data=Z0(e.data),Y0(e),e}var g0=new Map,X0=new Set;function As(e,t){let o=g0.get(e);return o||(o=t(),g0.set(e,o),X0.add(o)),o}var tr=(e,t,o)=>{let n=Ae(t,o);n!==void 0&&e.add(n);},au=class{constructor(t){this._config=J_(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=Z0(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(),Y0(t);}clearCache(){this._scopeCache.clear(),this._resolverCache.clear();}datasetScopeKeys(t){return As(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,o){return As(`${t}.transition.${o}`,()=>[[`datasets.${t}.transitions.${o}`,`transitions.${o}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,o){return As(`${t}-${o}`,()=>[[`datasets.${t}.elements.${o}`,`datasets.${t}`,`elements.${o}`,""]])}pluginScopeKeys(t){let o=t.id,n=this.type;return As(`${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=>tr(l,t,u))),d.forEach(u=>tr(l,i,u)),d.forEach(u=>tr(l,yo[r]||{},u)),d.forEach(u=>tr(l,H,u)),d.forEach(u=>tr(l,ps,u));});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),X0.has(o)&&a.set(o,c),c}chartOptionScopes(){let{options:t,type:o}=this;return [t,yo[o]||{},H.datasets[o]||{},{type:o},H,ps]}resolveNamedOptions(t,o,n,i=[""]){let r={$shared:true},{resolver:a,subPrefixes:s}=f0(this._resolverCache,t,i),l=a;if(e4(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}=f0(this._resolverCache,t,n);return z(o)?fo(r,o,void 0,i):r}};function f0(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:Zi(t,o),subPrefixes:o.filter(s=>!s.toLowerCase().includes("hover"))},n.set(i,r)),r}var t4=e=>z(e)&&Object.getOwnPropertyNames(e).reduce((t,o)=>t||Tt(e[o]),false);function e4(e,t){let{isScriptable:o,isIndexable:n}=fs(e);for(let i of t){let r=o(i),a=n(i),s=(a||r)&&e[i];if(r&&(Tt(s)||t4(s))||a&&Z(s))return true}return false}var o4="3.9.1",n4=["top","bottom","left","right","chartArea"];function y0(e,t){return e==="top"||e==="bottom"||n4.indexOf(e)===-1&&t==="x"}function x0(e,t){return function(o,n){return o[e]===n[e]?o[t]-n[t]:o[e]-n[e]}}function b0(e){let t=e.chart,o=t.options.animation;t.notifyPlugins("afterRender"),X(o&&o.onComplete,[e],t);}function i4(e){let t=e.chart,o=t.options.animation;X(o&&o.onProgress,[e],t);}function K0(e){return xs()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Bs={},q0=e=>{let t=K0(e);return Object.values(Bs).filter(o=>o.canvas===t).pop()};function r4(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 a4(e,t,o,n){return !o||e.type==="mouseout"?null:n?t:e}var Lt=class{constructor(t,o){let n=this.config=new au(o),i=K0(t),r=q0(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||W_(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=fd(),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 nu,this.$proxies={},this._hiddenIndices={},this.attached=false,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=wd(u=>this.update(u),a.resizeDelay||0),this._dataChanges=[],Bs[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}je.listen(this,"complete",b0),je.listen(this,"progress",i4),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():Cs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ms(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,Cs(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=ru(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=ru(l,s),d=N(s.type,a.dtype);(s.position===void 0||y0(s.position,c)!==y0(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(x0("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||iu(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(x0("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);(!es(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;r4(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(!es(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(),b0({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=w_.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(),ms(t,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Bs[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}});!Vn(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=xd(t),c=a4(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=!Vn(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)}},C0=()=>K(Lt.instances,e=>e._plugins.invalidate()),Po=true;Object.defineProperties(Lt,{defaults:{enumerable:Po,value:H},instances:{enumerable:Po,value:Bs},overrides:{enumerable:Po,value:yo},registry:{enumerable:Po,value:Ee},version:{enumerable:Po,value:o4},getChart:{enumerable:Po,value:q0},register:{enumerable:Po,value:(...e)=>{Ee.add(...e),C0();}},unregister:{enumerable:Po,value:(...e)=>{Ee.remove(...e),C0();}}});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 s4(e){return Yi(e,["outerStart","outerEnd","innerStart","innerEnd"])}function l4(e,t,o,n){let i=s4(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 su(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}=l4(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=$n(M,F,a,s);e.arc(J.x,J.y,k,F,b+et);}let L=$n(B,b,a,s);if(e.lineTo(L.x,L.y),v>0){let J=$n(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=$n(E,O,a,s);e.arc(J.x,J.y,w,O+Math.PI,x-et);}let V=$n(_,x,a,s);if(e.lineTo(V.x,V.y),T>0){let J=$n(_,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 c4(e,t,o,n,i){let{fullCircles:r,startAngle:a,circumference:s}=t,l=t.endAngle;if(r){su(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 su(e,t,o,n,l,i),e.fill(),l}function d4(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 u4(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&&d4(e,t,c),c&&Q0(e,t,i),su(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}=rs(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=c4(t,this,s,r,a);u4(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 J0(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 p4(e,t,o){e.lineTo(o.x,o.y);}function m4(e){return e.stepped?Fd:e.tension||e.cubicInterpolationMode==="monotone"?Ld:p4}function tx(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 h4(e,t,o,n){let{points:i,options:r}=t,{count:a,start:s,loop:l,ilen:c}=tx(i,o,n),d=m4(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 g4(e,t,o,n){let i=t.points,{count:r,start:a,ilen:s}=tx(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 lu(e){let t=e.options,o=t.borderDash&&t.borderDash.length;return !e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!o?g4:h4}function f4(e){return e.stepped?zd:e.tension||e.cubicInterpolationMode==="monotone"?Vd:Oe}function y4(e,t,o,n){let i=t._path;i||(i=t._path=new Path2D,t.path(i,o,n)&&i.closePath()),J0(e,t.options),e.stroke(i);}function x4(e,t,o,n){let{segments:i,options:r}=t,a=lu(t);for(let s of i)J0(e,r,s.style),e.beginPath(),a(e,t,s,{start:o,end:o+n-1})&&e.closePath(),e.stroke();}var b4=typeof Path2D=="function";function C4(e,t,o,n){b4&&!t.options.segment?y4(e,t,o,n):x4(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;Nd(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=$d(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=ws(this,{property:o,start:i,end:i});if(!a.length)return;let s=[],l=f4(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 lu(this)(t,this,o,n)}path(t,o,n){let i=this.segments,r=lu(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(),C4(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 P0(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 P0(this,t,"x",o)}inYRange(t,o){return P0(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,ji(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 ex(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 P4(e,t,o){let n=e.options.borderWidth,i=e.borderSkipped,r=gs(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 S4(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=ex(e),o=t.right-t.left,n=t.bottom-t.top,i=P4(e,o/2,n/2),r=S4(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 Xd(e,t,o,n){let i=t===null,r=o===null,s=e&&!(i&&r)&&ex(e,n);return s&&(i||ge(t,s.left,s.right))&&(r||ge(o,s.top,s.bottom))}function k4(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function w4(e,t){e.rect(t.x,t.y,t.w,t.h);}function Kd(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=k4(a.radius)?We:w4;t.save(),(a.w!==r.w||a.h!==r.h)&&(t.beginPath(),s(t,Kd(a,o,r)),t.clip(),s(t,Kd(r,-o,a)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),s(t,Kd(r,o)),t.fillStyle=i,t.fill(),t.restore();}inRange(t,o,n){return Xd(this,t,o,n)}inXRange(t,o){return Xd(this,t,null,o)}inYRange(t,o){return Xd(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 v4(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=uu(l,c,i);let d=cu(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=ws(t,d);for(let p of u){let h=cu(o,r[p.start],r[p.end],p.loop),m=ks(s,i,h);for(let g of m)a.push({source:g,target:p,start:{[o]:S0(d,h,"start",Math.max)},end:{[o]:S0(d,h,"end",Math.min)}});}}return a}function cu(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 _4(e,t){let{x:o=null,y:n=null}=e||{},i=t.points,r=[];return t.segments.forEach(({start:a,end:s})=>{s=uu(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 uu(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 ox(e,t){let o=[],n=false;return Z(e)?(n=true,o=e):o=_4(e,t),o.length?new ye({points:o,options:{tension:0},_loop:n,_fullLoop:n}):null}function T0(e){return e&&e.fill!==false}function A4(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 M4(e,t,o){let n=L4(e);if(z(n))return isNaN(n.value)?false:n;let i=parseFloat(n);return lt(i)&&Math.floor(i)===i?I4(n[0],t,i,o):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function I4(e,t,o,n){return (e==="-"||e==="+")&&(o=t+o),o===t||o<0||o>=n?false:o}function E4(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 F4(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 L4(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 B4(e){let{scale:t,index:o,line:n}=e,i=[],r=n.segments,a=n.points,s=R4(t,o);s.push(ox({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++)D4(i,a[d],s);}return new ye({points:i,options:{}})}function R4(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 D4(e,t,o){let n=[];for(let i=0;i<o.length;i++){let r=o[i],{first:a,last:s,point:l}=N4(r,t,"x");if(!(!l||a&&s)){if(a)n.unshift(l);else if(e.push(l),!s)break}}e.push(...n);}function N4(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 Rs=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 U4(e){let{chart:t,fill:o,line:n}=e;if(lt(o))return O4(t,o);if(o==="stack")return B4(e);if(o==="shape")return true;let i=z4(e);return i instanceof Rs?i:ox(i,n)}function O4(e,t){let o=e.getDatasetMeta(t);return o&&e.isDatasetVisible(t)?o.dataset:null}function z4(e){return (e.scale||{}).getPointPositionForValue?$4(e):V4(e)}function V4(e){let{scale:t={},fill:o}=e,n=E4(o,t);if(lt(n)){let i=t.isHorizontal();return {x:i?n:null,y:i?null:n}}return null}function $4(e){let{scale:t,fill:o}=e,n=t.options,i=t.getLabels().length,r=n.reverse?t.max:t.min,a=F4(o,t,r),s=[];if(n.grid.circular){let l=t.getPointPositionForValue(0,r);return new Rs({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 qd(e,t,o){let n=U4(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),H4(e,{line:i,target:n,above:d,below:u,area:o,scale:r,axis:a}),bo(e));}function H4(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&&(k0(e,n,a.top),w0(e,{line:o,target:n,color:i,scale:s,property:l}),e.restore(),e.save(),k0(e,n,a.bottom)),w0(e,{line:o,target:n,color:r,scale:s,property:l}),e.restore();}function k0(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[uu(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 w0(e,t){let{line:o,target:n,property:i,color:r,scale:a}=t,s=v4(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,W4(e,a,h&&cu(i,d,u)),e.beginPath();let m=!!o.pathSegment(e,l),g;if(h){m?e.closePath():v0(e,n,u,i);let f=!!n.pathSegment(e,c,{move:m,reverse:true});g=m&&f,g||v0(e,n,d,i);}e.closePath(),e.fill(g?"evenodd":"nonzero"),e.restore();}}function W4(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 v0(e,t,o,n){let i=t.interpolate(o,n);i&&e.lineTo(i.x,i.y);}var nx={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:M4(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=A4(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&&qd(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;T0(r)&&qd(e.ctx,r,e.chartArea);}},beforeDatasetDraw(e,t,o){let n=t.meta.$filler;!T0(n)||o.drawTime!=="beforeDatasetDraw"||qd(e.ctx,n,e.chartArea);},defaults:{propagate:true,drawTime:"beforeDatasetDraw"}},_0=(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)}},G4=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,Ds=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}=_0(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}=_0(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;hs(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},Ss(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=vd(F,B+g+h,k?B+E:this.right,t.rtl),T(l.x(B),O,_),k?m.x+=E+u:m.y+=v;}),Ts(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(Wi(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(!j4(t.type,o))return;let n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let i=this._hoveredItem,r=G4(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 j4(e,t){return !!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var ix={id:"legend",_element:Ds,start(e,t,o){let n=e.legend=new Ds({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)}}},Ns=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:Wi(o.align),textBaseline:"middle",translation:[a,s]});}};function Y4(e,t){let o=new Ns({ctx:e.ctx,options:t,chart:e});ae.configure(e,o,t),ae.addBox(e,o),e.titleBlock=o;}var rx={id:"title",_element:Ns,start(e,t,o){Y4(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 or={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 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=Ac.useRef(null),m=Ac.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 Ac.useEffect(()=>{!i&&m.current&&l&&T9(m.current,l);},[i,l]),Ac.useEffect(()=>{!i&&m.current&&hb(m.current.config.data,s.labels);},[i,s.labels]),Ac.useEffect(()=>{!i&&m.current&&s.datasets&&gb(m.current.config.data,s.datasets,r);},[i,s.datasets]),Ac.useEffect(()=>{m.current&&(i?(f(),setTimeout(g)):m.current.update(u));},[i,l,s.labels,s.datasets,u]),Ac.useEffect(()=>{m.current&&(f(),setTimeout(g));},[a]),Ac.useEffect(()=>(g(),()=>f()),[]),Ac__default.default.createElement("canvas",Object.assign({ref:h,role:"img",height:o,width:n},p),d)}var v9=Ac.forwardRef(w9);function _9(e,t){return Lt.register(t),Ac.forwardRef((o,n)=>Ac__default.default.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=Ac.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 Ac.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 rh.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 rh.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 rh.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 rh.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 rh.CreditUsageTimeRange.LastDay:return o.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});case rh.CreditUsageTimeRange.LastYear:return e.toLocaleDateString("en-US",{month:"short",year:"2-digit"});case rh.CreditUsageTimeRange.LastWeek:case rh.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]=Ac.useState(0),[i,r]=Ac.useState(0),[a,s]=Ac.useState(false),[l,c]=Ac.useState(),d=Ac.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(material.Box)`
1017
+ `):e}function Z4(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 A0(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 X4(e,t){let{y:o,height:n}=t;return o<n/2?"top":o>e.height-n/2?"bottom":"center"}function K4(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 q4(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"),K4(c,e,t,o)&&(c="center"),c}function M0(e,t,o){let n=o.yAlign||t.yAlign||X4(e,o);return {xAlign:o.xAlign||t.xAlign||q4(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 J4(e,t,o){let{y:n,height:i}=e;return t==="top"?n+=o:t==="bottom"?n-=i+o:n-=i/2,n}function I0(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=J4(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 Ms(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 E0(e){return Ie([],Ye(e))}function t8(e,t,o){return Me(e,{tooltip:t,tooltipItems:o,type:"tooltip"})}function F0(e,t){let o=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return o?e.override(o):e}var ar=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 Wn(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=t8(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 E0(o.callbacks.beforeBody.apply(this,[t]))}getBody(t,o){let{callbacks:n}=o,i=[];return K(t,r=>{let a={before:[],lines:[],after:[]},s=F0(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 E0(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(Z4(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=F0(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=or[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=A0(this,n),c=Object.assign({},s,l),d=M0(this.chart,n,c),u=I0(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=Ms(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=Ms(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,ji(t,f,x,b),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,ji(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=Ms(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=Ms(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=or[t.position].call(this,this._active,this._eventPosition);if(!a)return;let s=this._size=A0(this,t),l=Object.assign({},a,this._size),c=M0(o,t,l),d=I0(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),Ss(t,o.textDirection),r.y+=a.top,this.drawTitle(r,t,o),this.drawBody(r,t,o),this.drawFooter(r,t,o),Ts(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=!Vn(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||!Vn(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=or[r.position].call(this,t,o);return a!==false&&(n!==a.x||i!==a.y)}};ar.positioners=or;var ax={id:"tooltip",_element:ar,positioners:or,afterInit(e,t,o){o&&(e.tooltip=new ar({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 e8=(e,t,o,n)=>(typeof t=="string"?(o=e.push(t)-1,n.unshift({index:o,label:t})):isNaN(t)&&(o=null),o);function o8(e,t,o,n){let i=e.indexOf(t);if(i===-1)return e8(e,t,o,n);let r=e.lastIndexOf(t);return i!==r?o:i}var n8=(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:o8(n,t,N(o,t),this._addedLabels),n8(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 i8(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=os((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=os(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&&Cd((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(is(w),is(_));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,L0(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,L0(s,k,e))?o[o.length-1].value=s:o.push({value:s}):(!b||M===s)&&o.push({value:M}),o}function L0(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 Kn=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=i8(i,r);return t.bounds==="ticks"&&ns(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)}},qn=class extends Kn{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}};qn.id="linear";qn.defaults={ticks:{callback:zs.formatters.numeric}};function B0(e){return e/Math.pow(10,Math.floor(zt(e)))===1}function r8(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: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=Ot(e.max,r);return i.push({value:c,major:B0(r)}),i}var Us=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=Kn.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=r8(o,this);return t.bounds==="ticks"&&ns(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)}};Us.id="logarithmic";Us.defaults={ticks:{callback:zs.formatters.logarithmic,major:{enabled:true}}};function du(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 a8(e,t,o){return o=Z(o)?o:[o],{w:Ed(e,t.string,o),h:o.length*t.lineHeight}}function R0(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 s8(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=a8(e.ctx,u,e._pointLabels[l]);n[l]=p;let h=Ft(e.getIndexAngle(l)+s),m=Math.round(Qo(h)),g=R0(m,d.x,p.w,0,180),f=R0(m,d.y,p.h,90,270);l8(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=c8(e,n,i);}function l8(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 c8(e,t,o){let n=[],i=e._pointLabels.length,r=e.options,a=du(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=p8(d.y,p.h,u),m=d8(u),g=u8(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 d8(e){return e===0||e===180?"center":e<180?"left":"right"}function u8(e,t,o){return o==="right"?e-=t:o==="center"&&(e-=t/2),e}function p8(e,t,o){return o===90||o===270?e-=t/2:(o>270||o<90)&&(e-=t),e}function m8(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 sx(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 h8(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(),sx(e,o,r,n),i.closePath(),i.stroke(),i.restore());}function g8(e,t,o){return Me(e,{label:o,index:t,type:"pointLabel"})}var Qn=class extends Kn{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(du(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/du(this.options))}generateTickLabels(t){Kn.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?s8(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 g8(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(),sx(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&&m8(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));h8(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:zs.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 Vs={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(Vs);function f8(e,t){return e-t}function D0(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 N0(e,t,o,n){let i=Vt.length;for(let r=Vt.indexOf(e);r<i-1;++r){let a=Vs[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 y8(e,t,o,n,i){for(let r=Vt.length-1;r>=Vt.indexOf(o);r--){let a=Vt[r];if(Vs[a].common&&e._adapter.diff(i,n,a)>=t-1)return a}return Vt[o?Vt.indexOf(o):0]}function x8(e){for(let t=Vt.indexOf(e)+1,o=Vt.length;t<o;++t)if(Vs[Vt[t]].common)return Vt[t]}function U0(e,t,o){if(!o)e[t]=true;else if(o.length){let{lo:n,hi:i}=Hi(o,t),r=o[n]>=t?o[n]:o[i];e[r]=true;}}function b8(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 O0(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:b8(e,n,i,o)}var Jn=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 C_._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:D0(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=Td(i,r,a);return this._unit=o.unit||(n.autoSkip?N0(o.minUnit,this.min,this.max,this._getLabelCapacity(r)):y8(this,s.length,o.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:x8(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),O0(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||N0(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++)U0(d,p,m);return (p===n||i.bounds==="ticks"||h===1)&&U0(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,O0(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(D0(this,i[o]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ss(t.sort(f8))}};Jn.id="time";Jn.defaults={bounds:"data",adapters:{},time:{parser:false,unit:false,round:false,isoWeekday:false,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:false}}};function Is(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 Os=class extends Jn{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=Is(o,this.min),this._tableRange=Is(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 (Is(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let o=this._offsets,n=this.getDecimalForPixel(t)/o.factor-o.end;return Is(this._table,n*this._tableRange+this._minPos,true)}};Os.id="timeseries";Os.defaults=Jn.defaults;var lx=(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})(),cr={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*lx)/lx}};function pu(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 C8(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 P8=0,dx=1,ux=2,px=4,mx=8;function $s(e,t,o){var n=P8;return e<o.left?n|=dx:e>o.right&&(n|=ux),t<o.top?n|=mx:t>o.bottom&&(n|=px),n}function S8(e,t){for(var o=e.x0,n=e.y0,i=e.x1,r=e.y1,a=$s(o,n,t),s=$s(i,r,t),l,c,d;!(!(a|s)||a&s);)l=a||s,l&mx?(c=o+(i-o)*(t.top-n)/(r-n),d=t.top):l&px?(c=o+(i-o)*(t.bottom-n)/(r-n),d=t.bottom):l&ux?(d=n+(r-n)*(t.right-o)/(i-o),c=t.right):l&dx&&(d=n+(r-n)*(t.left-o)/(i-o),c=t.left),l===a?(o=c,n=d,a=$s(o,n,t)):(i=c,r=d,s=$s(i,r,t));return {x0:o,x1:i,y0:n,y1:r}}function Hs(e,t){var o=t.anchor,n=e,i,r;return t.clamp&&(n=S8(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),C8(i,r,e.vx,e.vy,t.align)}var Ws={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 Hs({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=pu(e,t.origin),n=o.x*e.options.radius,i=o.y*e.options.radius;return Hs({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=pu(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)),Hs({x0:n,y0:i+a,x1:n+r,y1:i,vx:o.x,vy:o.y},t)},fallback:function(e,t){var o=pu(e,t.origin);return Hs({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=cr.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 k8(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 w8(e){return e instanceof Ze?Ws.arc:e instanceof Xe?Ws.point:e instanceof Ke?Ws.bar:Ws.fallback}function v8(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 _8(e,t,o){var n=o.backgroundColor,i=o.borderColor,r=o.borderWidth;!n&&(!i||!r)||(e.beginPath(),v8(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 A8(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 M8(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 I8(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=A8(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)M8(e,t[p],{stroked:u,filled:a,w:o.w,x:o.x,y:o.y+o.h*p});}var hx=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(hx.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:k8(i._el,n),padding:pt(rt([o.padding,4],n,r)),positioner:w8(i._el),rotation:rt([o.rotation,0],n,r)*(Math.PI/180),size:cr.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)?[]:cr.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=cr.bound(0,i.opacity,1),n.translate(qe(t.x),qe(t.y)),n.rotate(i.rotation),_8(n,r.frame,i),I8(n,i.lines,r.text,i),n.restore());}});var E8=Number.MIN_SAFE_INTEGER||-9007199254740991,F8=Number.MAX_SAFE_INTEGER||9007199254740991;function lr(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 cx(e,t){var o=F8,n=E8,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 Gs(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 gx=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0};};Xt(gx.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=lr(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=[Gs(t[0],t[1]),Gs(t[0],t[3])],i,r,a;for(this._rotation!==e._rotation&&n.push(Gs(o[0],o[1]),Gs(o[0],o[3])),i=0;i<n.length;++i)if(r=cx(t,n[i]),a=cx(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 [lr({x:t.x,y:t.y},n,o),lr({x:t.x+t.w,y:t.y},n,o),lr({x:t.x+t.w,y:t.y+t.h},n,o),lr({x:t.x,y:t.y+t.h},n,o)]}});function fx(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 L8(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 B8(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=fx(s,n.model(),r),i._box.update(a,r,n.rotation()));return L8(e,function(l,c){var d=l._hidable,u=c._hidable;d&&u||u?c._visible=false:d&&(l._visible=false);})}var dr={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 gx,_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&&B8(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=fx(i._el,i.model(),a),r._box.update(s,a,i.rotation()),i.draw(e,s));}},R8=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},D8={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:R8,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",yx="$default";function N8(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||yx]=c;}),delete l.listeners,s},{}),{labels:i,listeners:n})}function mu(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 U8(e,t,o,n,i){var r,a;!o&&!n||(o?n?o!==n&&(a=r=true):a=true:r=true,a&&mu(e,t.leave,o,i),r&&mu(e,t.enter,n,i));}function O8(e,t){var o=e[$t],n=o._listeners,i,r;if(!(!n.enter&&!n.leave)){if(t.type==="mousemove")r=dr.lookup(o._labels,t);else if(t.type!=="mouseout")return;i=o._hovered,o._hovered=r,U8(e,n,i,r,t);}}function z8(e,t){var o=e[$t],n=o._listeners.click,i=n&&dr.lookup(o._labels,t);i&&mu(e,n,i,t);}var xx={id:"datalabels",defaults:D8,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=N8(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 hx(g,d,x,u),b.$groups={_set:n,_key:f||yx},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=dr.prepare(e[$t]._datasets);},afterDatasetsDraw:function(e){dr.draw(e,e[$t]._labels);},beforeEvent:function(e,t){if(e[$t]._listened){var o=t.event;switch(o.type){case "mousemove":case "mouseout":O8(e,o);break;case "click":z8(e,o);break}}},afterEvent:function(e){var t=e[$t],o=t._actives,n=t._actives=e.getActiveElements(),i=cr.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)&&(dr.update(t._labels),e.render()),delete t._dirty;}};var bx={modes:{point(e,t){return Ys(e,t,{intersect:true})},nearest(e,t,o){return H8(e,t,o)},x(e,t,o){return Ys(e,t,{intersect:o.intersect,axis:"x"})},y(e,t,o){return Ys(e,t,{intersect:o.intersect,axis:"y"})}}};function Su(e,t,o){return (bx.modes[o.mode]||bx.modes.nearest)(e,t,o)}function V8(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 $8(e,t,o){return o==="x"?{x:e.x,y:t.y}:o==="y"?{x:t.x,y:e.y}:t}function Ys(e,t,o){return e.visibleElements.filter(n=>o.intersect?n.inRange(t.x,t.y):V8(n,t,o.axis))}function H8(e,t,o){let n=Number.POSITIVE_INFINITY;return Ys(e,t,o).reduce((i,r)=>{let a=r.getCenterPoint(),s=$8(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 W8=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,sn=.001,Xs=(e,t,o)=>Math.min(o,Math.max(t,e));function G8(e,t,o){for(let n of Object.keys(e))e[n]=Xs(e[n],t,o);return e}function j8(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 Ux(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 ni(e,t){let{centerX:o,centerY:n}=e.getProps(["centerX","centerY"],t);return {x:o,y:n}}function Y8(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(W8(s,a)){if(n)throw new Error(`${e} v${o} is not supported. v${t} or newer is required.`);return false}}return true}var Ox=e=>typeof e=="string"&&e.endsWith("%"),zx=e=>parseFloat(e)/100,Vx=e=>Xs(zx(e),0,1);function Tu(e,t){return t==="start"?0:t==="end"?e:Ox(t)?Vx(t)*e:e/2}function vo(e,t,o=true){return typeof t=="number"?t:Ox(t)?(o?Vx(t):zx(t))*e:e}function Z8(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 ku(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 $x(e){return e&&(st(e.xValue)||st(e.yValue))}function pr(e,t,o,n=false){let i=o.init;if(i){if(i===true)return Wx(t,n)}else return;return X8(t,n,X(i,[{chart:e,properties:t,options:o}]))}function Hx(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 Wx({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 X8(e,t,o){if(o===true)return Wx(e,t);if(z(o))return o}var hu=new Map,K8=e=>isNaN(e)||e<=0,q8=e=>e.reduce(function(t,o){return t+=o.string,t},"");function Ks(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function wu(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 ii(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY;}function vu(e,t){let o=t.content;if(Ks(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()+q8(i)+r+(e._measureText?"-spriting":"");return hu.has(s)||hu.set(s,o7(e,a,i,r)),hu.get(s)}function Gx(e,t,o){let{x:n,y:i,width:r,height:a}=t;e.save(),ii(e,o);let s=_o(e,o);e.fillStyle=o.backgroundColor,e.beginPath(),We(e,{x:n,y:i,w:r,h:a,radius:G8(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(Ks(n)){e.save(),e.globalAlpha=r7(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=Z8(t,o),d=t.y+o.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=o.textAlign,J8(e,o)&&n7(e,{x:c,y:d},i,a),i7(e,{x:c,y:d},i,{fonts:a,colors:l}),e.restore();}function J8(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,true}function t7(e,t,o,n){let{radius:i,options:r}=t,a=r.pointStyle,s=r.rotation,l=(s||0)*$i;if(Ks(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}K8(i)||e7(e,{x:o,y:n,radius:i,rotation:s,style:a,rad:l});}function e7(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+=Un,e.lineTo(t+Math.sin(a)*n,o-Math.cos(a)*n),a+=Un,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 o7(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 n7(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 i7(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 r7(e,t){let o=Kt(e)?e:t;return Kt(o)?Xs(o,0,1):1}var Cx={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 ti(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 jx(e,t){if(e){let o=e.options.reverse,n=ti(e,t.min,o?t.end:t.start),i=ti(e,t.max,o?t.start:t.end);return {start:n,end:i}}}function Yx(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=ti(i,t.xValue,i.left+i.width/2)),r&&(s=ti(r,t.yValue,r.top+r.height/2)),{x:a,y:s}}function _u(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=Px(n,{min:t.xMin,max:t.xMax,start:r,end:a});r=c.start,a=c.end;let d=Px(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 Zx(e,t){if(!$x(t)){let o=_u(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 s7(e,t)}function a7(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?l7(i,r,t):c7(o,r,t),r}function Xx(e,t,o){let n=_u(e,t);return n.initProperties=pr(e,n,t,o),n.elements=[{type:"label",optionScope:"label",properties:p7(e,n,t),initProperties:n.initProperties}],n}function s7(e,t){let o=Yx(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 Px(e,t){let o=jx(e,t)||t;return {start:Math.min(o.start,o.end),end:Math.max(o.start,o.end)}}function l7(e,t,o){let n=ti(e,o.value,NaN),i=ti(e,o.endValue,n);e.isHorizontal()?(t.x=n,t.x2=i):(t.y=n,t.y2=i);}function c7(e,t,o){for(let n of Object.keys(Cx)){let i=e[ln(e,o,n)];if(i){let{min:r,max:a,start:s,end:l,startProp:c,endProp:d}=Cx[n],u=jx(i,{min:o[r],max:o[a],start:i[s],end:i[l]});t[c]=u.start,t[d]=u.end;}}}function d7({properties:e,options:t},o,n,i){let{x:r,x2:a,width:s}=e;return Kx({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 u7({properties:e,options:t},o,n,i){let{y:r,y2:a,height:s}=e;return Kx({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 Kx(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+Tu(c,r)}function p7(e,t,o){let n=o.label;n.backgroundColor="transparent",n.callout.display=false;let i=ku(n.position),r=pt(n.padding),a=vu(e.ctx,n),s=d7({properties:t,options:o},a,i,r),l=u7({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 gu=["enter","leave"],Au=gu.concat("click");function m7(e,t,o){t.listened=Hx(o,Au,t.listeners),t.moveListened=false,t._getElements=Su,gu.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||gu.forEach(i=>{Tt(n[i])&&(t.listened=true,t.moveListened=true);});});}function h7(e,t,o){if(e.listened)switch(t.type){case "mousemove":case "mouseout":return g7(e,t,o);case "click":return f7(e,t,o)}}function g7(e,t,o){if(!e.moveListened)return;let n;t.type==="mousemove"?n=Su(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=qx(a.options[o]||e.listeners[o],a,t)||r);return r}function f7(e,t,o){let n=e.listeners,i=Su(e,t,o.interaction),r;for(let a of i)r=qx(a.options.click||n.click,a,t)||r;return r}function qx(e,t,o){return X(e,[t.$context,o])===true}var Zs=["afterDraw","beforeDraw"];function y7(e,t,o){let n=t.visibleElements;t.hooked=Hx(o,Zs,t.hooks),t.hooked||n.forEach(i=>{t.hooked||Zs.forEach(r=>{Tt(i.options[r])&&(t.hooked=true);});});}function Tx(e,t,o){if(e.hooked){let n=t.options[o]||e.hooks[o];return X(n,[t.$context])}}function x7(e,t,o){let n=T7(e.scales,t,o),i=kx(t,n,"min","suggestedMin");i=kx(t,n,"max","suggestedMax")||i,i&&Tt(t.handleTickRangeOptions)&&t.handleTickRangeOptions();}function b7(e,t){for(let o of e)P7(o,t);}function kx(e,t,o,n){if(lt(t[o])&&!C7(e.options,o,n)){let i=e[o]!==t[o];return e[o]=t[o],i}}function C7(e,t,o){return st(e[t])||st(e[o])}function P7(e,t){for(let o of ["scaleID","xScaleID","yScaleID"]){let n=ln(t,e,o);n&&!t[n]&&S7(e,o)&&console.warn(`No scale found with id '${n}' for annotation '${e.id}'`);}}function S7(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:N(t.min,Number.NEGATIVE_INFINITY),max:N(t.max,Number.POSITIVE_INFINITY)};for(let s of o)s.scaleID===i?wx(s,t,["value","endValue"],a):ln(e,s,r)===i&&wx(s,t,[n+"Min",n+"Max",n+"Value"],a);return a}function wx(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 Ux({x:r,y:a},this.getProps(["x","y","x2","y2"],i),n,this.options.borderWidth)}getCenterPoint(t){return ni(this,t)}draw(t){t.save(),wu(t,this.getCenterPoint(),this.options.rotation),Gx(t,this,this.options),t.restore();}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,o){return Xx(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 Ux({x:r,y:a},this.getProps(["x","y","x2","y2"],i),n,this.options.borderWidth)}getCenterPoint(t){return ni(this,t)}draw(t){let o=this.options,n=!st(this._visible)||this._visible;!o.display||!o.content||!n||(t.save(),wu(t,this.getCenterPoint(),this.rotation),w7(t,this),Gx(t,this,o),Q8(t,F7(this),o),t.restore());}resolveElementProperties(t,o){let n;if($x(o))n=Yx(t,o);else {let{centerX:s,centerY:l}=_u(t,o);n={x:s,y:l};}let i=pt(o.padding),r=vu(t.ctx,o),a=k7(n,r,o,i);return A(S({initProperties:pr(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 k7(e,t,o,n){let i=t.width+n.width+o.borderWidth,r=t.height+n.height+o.borderWidth,a=ku(o.position,"center"),s=vx(e.x,i,o.xAdjust,a.x),l=vx(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 vx(e,t,o=0,n){return e-Tu(t,n)+o}function w7(e,t){let{pointX:o,pointY:n,options:i}=t,r=i.callout,a=r&&r.display&&I7(t,r);if(!a||L7(t,r,a))return;if(e.save(),e.beginPath(),!_o(e,r))return e.restore();let{separatorStart:l,separatorEnd:c}=v7(t,a),{sideStart:d,sideEnd:u}=A7(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 v7(e,t){let{x:o,y:n,x2:i,y2:r}=e,a=_7(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 _7(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 A7(e,t,o){let{y:n,width:i,height:r,options:a}=e,s=a.callout.start,l=M7(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 M7(e,t){let o=t.side;return e==="left"||e==="top"?-o:o}function I7(e,t){let o=t.position;return Qx.includes(o)?o:E7(e,t)}function E7(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 F7({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 L7(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 Mu=(e,t,o)=>({x:e.x+o*(t.x-e.x),y:e.y+o*(t.y-e.y)}),fu=(e,t,o)=>Mu(t,o,Math.abs((e-t.y)/(o.y-t.y))).x,_x=(e,t,o)=>Mu(t,o,Math.abs((e-t.x)/(o.x-t.x))).y,ur=e=>e*e,B7=(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},Ax=(e,t,o,n)=>(1-n)*(1-n)*e+2*(1-n)*n*t+n*n*o,yu=(e,t,o,n)=>({x:Ax(e.x,t.x,o.x,n),y:Ax(e.y,t.y,o.y,n)}),Mx=(e,t,o,n)=>2*(1-n)*(t-e)+2*n*(o-t),Ix=(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,h=l.isPointInStroke(s,u,p)||xu(this,a,i);return l.restore(),h}let c=ur(r);return U7(this,a,c,i)||xu(this,a,i)}return R7(this,{mouseX:t,mouseY:o},n,{hBorderWidth:r,useFinalPosition:i})}getCenterPoint(t){return ni(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();ii(t,s);let l=Math.sqrt(Math.pow(i-o,2)+Math.pow(r-n,2));if(s.curve&&a)return j7(t,this,a,l),t.restore();let{startOpts:c,endOpts:d,startAdjust:u,endAdjust:p}=Jx(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(),bu(t,0,u,c),bu(t,l,-p,d),t.restore();}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,o){let n=a7(t,o),{x:i,y:r,x2:a,y2:s}=n,l=D7(n,t.chartArea),c=l?N7({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=pr(t,c,o),o.curve){let u={x:c.x,y:c.y},p={x:c.x2,y:c.y2};c.cp=G7(c,o,Ve(u,p));}let d=O7(t,c,o.label);return d._visible=l,c.elements=[{type:"label",optionScope:"label",properties:d,initProperties:c.initProperties}],c}};dn.id="lineAnnotation";var Ex={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({},Ex),fill:false,length:12,start:Object.assign({},Ex),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 R7(e,{mouseX:t,mouseY:o},n,{hBorderWidth:i,useFinalPosition:r}){let a=B7(t,o,e.getProps(["x","y","x2","y2"],r),n);return a.value>=a.start-i&&a.value<=a.end+i||xu(e,{mouseX:t,mouseY:o},r,n)}function D7({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 Fx({x:e,y:t},o,{top:n,right:i,bottom:r,left:a}){return e<a&&(t=_x(a,{x:e,y:t},o),e=a),e>i&&(t=_x(i,{x:e,y:t},o),e=i),t<n&&(e=fu(n,{x:e,y:t},o),t=n),t>r&&(e=fu(r,{x:e,y:t},o),t=r),{x:e,y:t}}function N7(e,t,o){let{x:n,y:i}=Fx(e,t,o),{x:r,y:a}=Fx(t,e,o);return {x:n,y:i,x2:r,y2:a,width:Math.abs(r-n),height:Math.abs(a-i)}}function U7(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=ur(c)+ur(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),ur(t-h)+ur(o-m)<=n}function xu(e,{mouseX:t,mouseY:o},n,i){let r=e.label;return r.options.display&&r.inRange(t,o,i,n)}function O7(e,t,o){let n=o.borderWidth,i=pt(o.padding),r=vu(e.ctx,o),a=r.width+i.width+n,s=r.height+i.height+n;return V7(t,o,{width:a,height:s,padding:i},e.chartArea)}function z7(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 V7(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"?z7(e):gt(t.rotation),p=$7(i,r,u),h=H7(e,t,{labelSize:p,padding:a},n),m=e.cp?yu(c,e.cp,d,h):Mu(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=Bx(m.x,g)+s,b=Bx(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 $7(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 H7(e,t,o,n){let i,r=W7(e,n);return t.position==="start"?i=Lx({w:e.x2-e.x,h:e.y2-e.y},o,t,r):t.position==="end"?i=1-Lx({w:e.x-e.x2,h:e.y-e.y2},o,t,r):i=Tu(1,t.position),i}function Lx(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 Xs(Math.max(l,c),0,.25)}function W7(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 Jx(e){let t=e.options,o=t.arrowHeads&&t.arrowHeads.start,n=t.arrowHeads&&t.arrowHeads.end;return {startOpts:o,endOpts:n,startAdjust:Rx(e,o),endAdjust:Rx(e,n)}}function Rx(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(fu(0,r,{x:0,y:i}))}function bu(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(),ii(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 G7(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=ku(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 Dx(e,{x:t,y:o},{angle:n,adjust:i},r){!r||!r.display||(e.save(),e.translate(t,o),e.rotate(n),bu(e,0,-i,r),e.restore());}function j7(e,t,o,n){let{x:i,y:r,x2:a,y2:s,options:l}=t,{startOpts:c,endOpts:d,startAdjust:u,endAdjust:p}=Jx(t),h={x:i,y:r},m={x:a,y:s},g=Ix(h,o,m,0),f=Ix(h,o,m,1)-G,x=yu(h,o,m,u/n),b=yu(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,Dx(e,x,{angle:g,adjust:u},c),Dx(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 Y7({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 ni(this,t)}draw(t){let{width:o,height:n,centerX:i,centerY:r,options:a}=this;t.save(),wu(t,this.getCenterPoint(),a.rotation),ii(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 Xx(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 Y7(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 ei=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 j8({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 ni(this,t)}draw(t){let o=this.options,n=o.borderWidth;if(o.radius<.1)return;t.save(),t.fillStyle=o.backgroundColor,ii(t,o);let i=_o(t,o);t7(t,this,this.centerX,this.centerY),i&&!Ks(o.pointStyle)&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore(),o.borderWidth=n;}resolveElementProperties(t,o){let n=Zx(t,o);return n.initProperties=pr(t,n,o,true),n}};ei.id="pointAnnotation";ei.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};ei.defaultRoutes={borderColor:"color",backgroundColor:"color"};var oi=class extends xt{inRange(t,o,n,i){if(n!=="x"&&n!=="y")return this.options.radius>=.1&&this.elements.length>1&&X7(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 ni(this,t)}draw(t){let{elements:o,options:n}=this;t.save(),t.beginPath(),t.fillStyle=n.backgroundColor,ii(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=Zx(t,o),{sides:i,rotation:r}=o,a=[],s=2*G/i,l=r*$i;for(let c=0;c<i;c++,l+=s){let d=Z7(n,o,l);d.initProperties=pr(t,n,o),a.push(d);}return n.elements=a,n}};oi.id="polygonAnnotation";oi.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};oi.defaultRoutes={borderColor:"color",backgroundColor:"color"};function Z7({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 X7(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:ei,polygon:oi};Object.keys(wo).forEach(e=>{H.describe(`elements.${wo[e].id}`,{_fallback:"plugins.annotation.common"});});var K7={update:Object.assign},q7=Au.concat(Zs),Nx=(e,t)=>z(t)?Pu(e,t):e,Cu=e=>e==="color"||e==="font";function Iu(e="line"){return wo[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function Q7(e,t,o,n){let i=t9(e,o.animations,n),r=t.annotations,a=n9(t.elements,r);for(let s=0;s<r.length;s++){let l=r[s],c=tb(a,s,l.type),d=l.setContext(o9(e,c,l)),u=c.resolveElementProperties(e,d);u.skip=J7(u),"elements"in u&&(e9(c,u.elements,d,i),delete u.elements),st(c.x)||Object.assign(c,u),Object.assign(c,u.initProperties),u.options=eb(d),i.update(c,u);}}function J7(e){return isNaN(e.x)||isNaN(e.y)}function t9(e,t,o){return o==="reset"||o==="none"||o==="resize"?K7:new Wn(e,t)}function e9(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=tb(i,r,a.type,a.initProperties),c=o[a.optionScope].override(a);s.options=eb(c),n.update(l,s);}}function tb(e,t,o,n){let i=wo[Iu(o)],r=e[t];return (!r||!(r instanceof i))&&(r=e[t]=new i,Object.assign(r,n)),r}function eb(e){let t=wo[Iu(e.type)],o={};o.id=e.id,o.type=e.type,o.drawTime=e.drawTime,Object.assign(o,Pu(e,t.defaults),Pu(e,t.defaultRoutes));for(let n of q7)o[n]=e[n];return o}function Pu(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=>Nx(a,i)):o[n]=Nx(r,i);}return o}function o9(e,t,o){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,id:o.id,type:"annotation"}))}function n9(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 i9="2.2.1",ko=new Map,r9=Au.concat(Zs),ob={id:"annotation",version:i9,beforeRegister(){Y8("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),b7(i,e.scales);},afterDataLimits(e,t){let o=ko.get(e);x7(e,t.scale,o.annotations.filter(n=>n.display&&n.adjustScaleRange));},afterUpdate(e,t,o){let n=ko.get(e);m7(e,n,o),Q7(e,n,o,t.mode),n.visibleElements=n.elements.filter(i=>!i.skip&&i.options.display),y7(e,n,o);},beforeDatasetsDraw(e,t,o){js(e,"beforeDatasetsDraw",o.clip);},afterDatasetsDraw(e,t,o){js(e,"afterDatasetsDraw",o.clip);},beforeDraw(e,t,o){js(e,"beforeDraw",o.clip);},afterDraw(e,t,o){js(e,"afterDraw",o.clip);},beforeEvent(e,t,o){let n=ko.get(e);h7(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=>!r9.includes(e)&&e!=="init",annotations:{_allKeys:false,_fallback:(e,t)=>`elements.${wo[Iu(t.type)].id}`},interaction:{_fallback:true},common:{label:{_indexable:Cu,_fallback:true},_indexable:Cu}},additionalOptionScopes:[""]};function js(e,t,o){let{ctx:n,chartArea:i}=e,r=ko.get(e);o&&xo(n,i);let a=a9(r.visibleElements,t).sort((s,l)=>s.element.options.z-l.element.options.z);for(let s of a)s9(n,i,r,s);o&&bo(n);}function a9(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 s9(e,t,o,n){let i=n.element;n.main?(Tx(o,i,"beforeDraw"),i.draw(e,t),Tx(o,i,"afterDraw")):i.draw(e,t);}var Fu=Lt.version,l9=Fu?(e,t)=>e.parse(t):(e,t)=>t;function c9(e,t){let o=Kt(t)?parseFloat(t):l9(e,t);return e.getPixelForValue(o)}var nb=e=>e&&e.right>e.left&&e.bottom>e.top;function ib(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 rb(e,t){t.forEach(function(o){e.addColorStop(o.stop,o.color.rgbString());});}function ab(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 sb(e,t){if(e.type==="radialLinear"){let r=e.getDistanceFromCenterForValue(t);return {pixel:r,stop:r/e.drawingArea}}let o=e.options.reverse,n=c9(e,t),i=e.getDecimalForPixel(n);return {pixel:n,stop:o?1-i:i}}var Eu=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,ri=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function d9(e,t,o){let n=t.color.rgb,i=ri(n.r/255),r=ri(n.g/255),a=ri(n.b/255),s=o.color.rgb,l=ri(s.r/255),c=ri(s.g/255),d=ri(s.b/255);return tn({r:Math.round(Eu(i+e*(l-i))*255),g:Math.round(Eu(r+e*(c-r))*255),b:Math.round(Eu(a+e*(d-a))*255),a:n.a+e*Math.abs(s.a-n.a)})}function u9(e,t,o,n){let i=ab(e,t,o);if(!i||!i.stopColors.length)return;let{stop:r}=sb(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?d9(r,a,s):a}var lb=[{key:"backgroundColor",legendItemKey:"fillStyle"},{key:"borderColor",legendItemKey:"strokeStyle"}],p9=(e,t)=>t.labels&&t.labels.font&&st(t.labels.font.size)?t.labels.font.size:e.options.font.size;function m9(e,t,o,n,i){let r=ab(e,o,n.datasetIndex);if(!r||!r.stopColors.length)return;let a=ib(t,r.axis,i);rb(a,r.stopColors),n[o.legendItemKey]=a;}function h9(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 g9(e,t,o,n){let i=e.legend.legendHitBoxes[o.datasetIndex],r=h9(i,n);nb(r)&&lb.forEach(function(a){m9(t,e.ctx,a,o,r);});}function f9(e,t,o,n){for(let i of e.legend.legendItems)lb.forEach(function(r){let a=o.data[i.index],s=u9(t,r,n,a);s&&s.valid&&(i[r.legendItemKey]=s.rgbString());});}function y9(e,t){let o=e.legend,n=o.options,i=n.labels.boxHeight?n.labels.boxHeight:p9(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?g9(e,t,l,{boxWidth:r,boxHeight:i}):f9(e,t,a[s],s);}}var qs=new Map,x9=Fu?(e,t)=>e[t+"Scale"]:(e,t)=>e.controller["_"+t+"Scale"];function b9(e,t,o){for(let n of Object.keys(t)){let{pixel:i,stop:r}=sb(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 C9(e,t,o,n){t[o]=n,e.dataset&&(e.dataset.options?e.dataset.options[o]=n:e.dataset[o]=n);}function P9(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 S9(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=x9(a,c);if(!u){console.warn(`Scale not found for '${c}'-axis in datasets[${i}] of chart id ${e.id}, skipping.`);continue}let p=P9(t,a,s,i),h={datasetIndex:i,axis:c,scale:u,stopColors:[]};p.push(h);let m=ib(r,c,u);b9(u,d,h.stopColors),h.stopColors.length&&(rb(m,h.stopColors),C9(a,n,s,m));}}var cb={id:"gradient",beforeInit(e){let t={};t.options=new Map,qs.set(e,t);},beforeDatasetsUpdate(e){let t=e.chartArea;if(!nb(t))return;let o=qs.get(e),n=e.data.datasets;for(let i=0;i<n.length;i++){let r=n[i],a=r.gradient;a&&S9(e,o,a,r,i);}},afterUpdate(e){let t=qs.get(e);e.legend&&e.legend.options.display!==false&&Fu&&y9(e,t);},destroy(e){qs.delete(e);}};var T9=[an,qn,Ke,rx,ax,ix,xx,Xe,ye,nx,Ze,ob,cb];Lt.register(...T9);var hb="label";function ub(e,t){typeof e=="function"?e(t):e&&(e.current=t);}function k9(e,t){Object.assign(e.options,t);}function gb(e,t){e.labels=t;}function fb(e,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:hb,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 w9(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hb,o={labels:[],datasets:[]};return gb(o,e.labels),fb(o,e.datasets,t),o}function v9(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=Fc.useRef(null),m=Fc.useRef(),g=()=>{h.current&&(m.current=new Lt(h.current,{type:a,data:w9(s,r),options:l&&S({},l),plugins:c}),ub(t,m.current));},f=()=>{ub(t,null),m.current&&(m.current.destroy(),m.current=null);};return Fc.useEffect(()=>{!i&&m.current&&l&&k9(m.current,l);},[i,l]),Fc.useEffect(()=>{!i&&m.current&&gb(m.current.config.data,s.labels);},[i,s.labels]),Fc.useEffect(()=>{!i&&m.current&&s.datasets&&fb(m.current.config.data,s.datasets,r);},[i,s.datasets]),Fc.useEffect(()=>{m.current&&(i?(f(),setTimeout(g)):m.current.update(u));},[i,l,s.labels,s.datasets,u]),Fc.useEffect(()=>{m.current&&(f(),setTimeout(g));},[a]),Fc.useEffect(()=>(g(),()=>f()),[]),Fc__default.default.createElement("canvas",Object.assign({ref:h,role:"img",height:o,width:n},p),d)}var _9=Fc.forwardRef(v9);function A9(e,t){return Lt.register(t),Fc.forwardRef((o,n)=>Fc__default.default.createElement(_9,Object.assign({},o,{ref:n,type:e})))}var yb=A9("bar",nn);function Qs(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=Fc.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 Fc.useMemo(()=>({creditUsage:r,isLoading:s,error:a}),[r,a,s])}var xb={id:"redrawBeforeFirstDrawPlugin",beforeDraw(e){e.$rendered||(e.$rendered=true,e.update("none"));}};var Lu=(e,t=1)=>{let o=Math.round(t*255).toString(16).padStart(2,"0");return `${e}${o}`};var Bu=e=>e.palette.text.secondary,Ru=e=>e.palette.outlinedBorder,Du=e=>({family:e.typography.fontFamily,size:parseInt(e.typography.body.fontSize)});function Nu(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 E9(e){let t=[],o=new Date;switch(e){case ah.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 ah.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 ah.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 ah.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 F9(e,t){let o=new Date(e);switch(o.setMinutes(0,0,0),t){case ah.CreditUsageTimeRange.LastDay:return o.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});case ah.CreditUsageTimeRange.LastYear:return e.toLocaleDateString("en-US",{month:"short",year:"2-digit"});case ah.CreditUsageTimeRange.LastWeek:case ah.CreditUsageTimeRange.LastMonth:default:return e.toLocaleDateString("en-US",{month:"short",day:"2-digit"})}}function L9(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:Bu(e),font:Du(e),maxRotation:45,maxTicksLimit:15},grid:{color:Ru(e),drawOnChartArea:false,drawTicks:false}},y:{type:"linear",stacked:true,beginAtZero:true,ticks:{color:Bu(e),font:Du(e),callback:o=>ft(Number(o))},grid:{color:Lu(Ru(e),.5),drawOnChartArea:true,drawTicks:false,borderDash:[5,5]}}}}}function bb(e,t,o,n){let i=E9(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=F9(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=Nu(c);return {label:d,data:p,backgroundColor:Lu(h,.8),borderColor:h,borderWidth:1}}).reverse(),a={labels:i,datasets:r},s=L9(t,o);return {data:a,options:s}}var O9=300;function Pb(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 z9(e,t){let o=e.canvas.offsetTop+t.caretY,n=e.canvas.offsetLeft+t.caretX;return {top:o,left:n}}function Sb(e,t=z9){let[o,n]=Fc.useState(0),[i,r]=Fc.useState(0),[a,s]=Fc.useState(false),[l,c]=Fc.useState(),d=Fc.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 V9=y(material.Box)`
1019
1019
  position: absolute;
1020
- `,V9=y.div`
1020
+ `,$9=y.div`
1021
1021
  position: absolute;
1022
1022
  background-color: white;
1023
1023
  border-radius: 8px;
@@ -1042,21 +1042,21 @@
1042
1042
  transform: translateY(-50%);
1043
1043
  filter: drop-shadow(2px 0 2px rgba(0, 0, 0, 0.1));
1044
1044
  }
1045
- `,Sb=({children:e,tooltipInfo:{positionTop:t,positionLeft:o,payload:n,isOpen:i},$padding:r})=>{let[a,s]=Ac.useState(false),[l,c]=Ac.useState(false),d=Ac.useRef(N9__default.default(()=>c(false),U9));return Ac.useEffect(()=>{n&&(a||i)?(d.current.cancel(),c(true)):d.current();},[n,a,i]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(z9,{style:{top:t,left:o}}),jsxRuntime.jsx(V9,{$isOpen:l,$padding:r,style:{top:t,left:o-140},onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),children:e})]})};var G9=y.div`
1045
+ `,Tb=({children:e,tooltipInfo:{positionTop:t,positionLeft:o,payload:n,isOpen:i},$padding:r})=>{let[a,s]=Fc.useState(false),[l,c]=Fc.useState(false),d=Fc.useRef(U9__default.default(()=>c(false),O9));return Fc.useEffect(()=>{n&&(a||i)?(d.current.cancel(),c(true)):d.current();},[n,a,i]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(V9,{style:{top:t,left:o}}),jsxRuntime.jsx($9,{$isOpen:l,$padding:r,style:{top:t,left:o-140},onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),children:e})]})};var j9=y.div`
1046
1046
  width: 3px;
1047
1047
  margin-right: 15px;
1048
- `;function kb({tooltipInfo:e}){if(!e.payload)return jsxRuntime.jsx(jsxRuntime.Fragment,{});let{featureName:t,usage:o,date:n,color:i}=e.payload;return jsxRuntime.jsx(Sb,{tooltipInfo:e,placement:"top",$padding:16,children:jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:8},className:"stigg-credit-usage-chart-tooltip",children:[jsxRuntime.jsx(G9,{style:{backgroundColor:i,marginTop:2}}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:n}),jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:t}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},children:[jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:ft(o)}),jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:"Credits"})]})]})]})})}function wb(){let e=Ac.useCallback(t=>{if(lodash.isEmpty(t.dataPoints)||lodash.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`
1048
+ `;function wb({tooltipInfo:e}){if(!e.payload)return jsxRuntime.jsx(jsxRuntime.Fragment,{});let{featureName:t,usage:o,date:n,color:i}=e.payload;return jsxRuntime.jsx(Tb,{tooltipInfo:e,placement:"top",$padding:16,children:jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:8},className:"stigg-credit-usage-chart-tooltip",children:[jsxRuntime.jsx(j9,{style:{backgroundColor:i,marginTop:2}}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:n}),jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:t}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},children:[jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:ft(o)}),jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:"Credits"})]})]})]})})}function vb(){let e=Fc.useCallback(t=>{if(lodash.isEmpty(t.dataPoints)||lodash.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,Pb)}var Z9=y.div`
1049
1049
  padding: 8px;
1050
1050
  margin: 0 12px;
1051
- `,Z9=y.div`
1051
+ `,X9=y.div`
1052
1052
  display: flex;
1053
1053
  align-items: center;
1054
- `,X9=y.div`
1054
+ `,K9=y.div`
1055
1055
  flex: 1;
1056
1056
  position: relative;
1057
1057
  align-items: center;
1058
1058
  display: flex;
1059
- `,K9=y.div`
1059
+ `,q9=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 @@
1066
1066
  align-items: center;
1067
1067
  justify-content: space-between;
1068
1068
  padding: 0 8px;
1069
- `,q9=y.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
- `,Q9=y.div`
1076
+ `,J9=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 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 jsxRuntime.jsxs(Y9,{className:"stigg-credit-usage-chart-legend",children:[jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx(P,{style:{marginBottom:12},variant:"body1",color:"secondary",className:"stigg-credit-usage-chart-legend-title",children:"Top sources"}),jsxRuntime.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})]}),jsxRuntime.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 jsxRuntime.jsx(Z9,{className:`stigg-credit-usage-chart-legend-item stigg-credit-usage-chart-legend-item-${a.featureId}`,children:jsxRuntime.jsx(X9,{className:"stigg-credit-usage-chart-legend-bar-container",children:jsxRuntime.jsxs(K9,{$width:s,$minContentWidth:l,children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[jsxRuntime.jsx(q9,{$color:a.color}),jsxRuntime.jsx(Q9,{className:"stigg-credit-usage-chart-legend-feature-name",children:jsxRuntime.jsx(P,{variant:"body1",color:"primary",className:"stigg-credit-usage-chart-legend-feature-name-text",children:a.featureName})})]}),jsxRuntime.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`
1082
+ `;function _b({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=Nu(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 jsxRuntime.jsxs(Z9,{className:"stigg-credit-usage-chart-legend",children:[jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx(P,{style:{marginBottom:12},variant:"body1",color:"secondary",className:"stigg-credit-usage-chart-legend-title",children:"Top sources"}),jsxRuntime.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})]}),jsxRuntime.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 jsxRuntime.jsx(X9,{className:`stigg-credit-usage-chart-legend-item stigg-credit-usage-chart-legend-item-${a.featureId}`,children:jsxRuntime.jsx(K9,{className:"stigg-credit-usage-chart-legend-bar-container",children:jsxRuntime.jsxs(q9,{$width:s,$minContentWidth:l,children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[jsxRuntime.jsx(Q9,{$color:a.color}),jsxRuntime.jsx(J9,{className:"stigg-credit-usage-chart-legend-feature-name",children:jsxRuntime.jsx(P,{variant:"body1",color:"primary",className:"stigg-credit-usage-chart-legend-feature-name-text",children:a.featureName})})]}),jsxRuntime.jsx(P,{variant:"caption",color:"primary",bold:true,className:"stigg-credit-usage-chart-legend-value",children:ft(a.totalCredits)})]})})},a.featureId)})})]})}var tA=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
- `,tA=y(mt)`
1088
+ `,eA=y(mt)`
1089
1089
  svg {
1090
1090
  width: 32px;
1091
1091
  height: 32px;
1092
1092
  }
1093
- `;function Ab(){return jsxRuntime.jsxs(J9,{className:"stigg-credit-usage-chart-empty-state",children:[jsxRuntime.jsx(tA,{icon:"PayAsYouGoCharge",style:{display:"flex"}}),jsxRuntime.jsx(P,{variant:"body1",color:"primary",bold:true,children:"No Usage Recorded"})]})}var oA=y.div`
1093
+ `;function Mb(){return jsxRuntime.jsxs(tA,{className:"stigg-credit-usage-chart-empty-state",children:[jsxRuntime.jsx(eA,{icon:"PayAsYouGoCharge",style:{display:"flex"}}),jsxRuntime.jsx(P,{variant:"body1",color:"primary",bold:true,children:"No Usage Recorded"})]})}var nA=y.div`
1094
1094
  display: flex;
1095
1095
  justify-content: center;
1096
1096
  align-items: center;
1097
1097
  height: 100%;
1098
- `;function Ib(){return jsxRuntime.jsx(oA,{className:"stigg-credit-usage-chart-error-state",children:jsxRuntime.jsx(P,{variant:"body1",color:"error",children:"Failed to load credit usage"})})}var Eb=[{value:rh.CreditUsageTimeRange.LastDay,label:"Last 24 Hours"},{value:rh.CreditUsageTimeRange.LastWeek,label:"Last 7 Days"},{value:rh.CreditUsageTimeRange.LastMonth,label:"Last 30 Days"},{value:rh.CreditUsageTimeRange.LastYear,label:"Last 12 Months"}],aA=y(material.Select)`
1098
+ `;function Eb(){return jsxRuntime.jsx(nA,{className:"stigg-credit-usage-chart-error-state",children:jsxRuntime.jsx(P,{variant:"body1",color:"error",children:"Failed to load credit usage"})})}var Fb=[{value:ah.CreditUsageTimeRange.LastDay,label:"Last 24 Hours"},{value:ah.CreditUsageTimeRange.LastWeek,label:"Last 7 Days"},{value:ah.CreditUsageTimeRange.LastMonth,label:"Last 30 Days"},{value:ah.CreditUsageTimeRange.LastYear,label:"Last 12 Months"}],sA=y(material.Select)`
1099
1099
  border-radius: 10px;
1100
1100
  height: 38px;
1101
1101
  min-width: 150px;
@@ -1103,7 +1103,7 @@
1103
1103
  &:hover .MuiOutlinedInput-notchedOutline {
1104
1104
  border-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
1105
1105
  }
1106
- `,sA=y(material.OutlinedInput)`
1106
+ `,lA=y(material.OutlinedInput)`
1107
1107
  & .MuiInputBase-input {
1108
1108
  padding: 10px 12px;
1109
1109
  }
@@ -1111,11 +1111,11 @@
1111
1111
  &.Mui-focused .MuiOutlinedInput-notchedOutline {
1112
1112
  border-color: ${({theme:e})=>e.stigg.palette.primary} !important;
1113
1113
  }
1114
- `;function Fb({isLoading:e,totalCredits:t,selectedTimeRange:o,setSelectedTimeRange:n,error:i,localization:r,currencyUnit:a}){return jsxRuntime.jsxs("div",{className:"stigg-credit-usage-chart-header",style:{display:"flex",flexDirection:"row",marginBottom:16,justifyContent:"space-between"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:8,alignItems:"center"},children:[jsxRuntime.jsx(P,{variant:"h3",color:"primary",className:"stigg-credit-usage-chart-title",children:r.title}),e?jsxRuntime.jsx(dt,{width:100,height:24}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"secondary",className:"stigg-credit-usage-chart-total",children:"|"}),jsxRuntime.jsxs(P,{variant:"h6",color:"secondary",className:"stigg-credit-usage-chart-total",children:[r.totalSpend,": ",ft(t||0)," ",a||""]})]})]}),!e&&!i&&jsxRuntime.jsx(aA,{className:"stigg-credit-usage-chart-time-range-select",value:o,input:jsxRuntime.jsx(sA,{}),onChange:s=>n(s.target.value),renderValue:s=>{var l;return jsxRuntime.jsxs(P,{variant:"body1",color:"primary",children:[((l=Eb.find(c=>c.value===s))==null?void 0:l.label)||""," "]})},children:Eb.map(s=>jsxRuntime.jsx(material.MenuItem,{value:s.value,children:jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:s.label})},s.value))})]})}var uA=y.div`
1114
+ `;function Lb({isLoading:e,totalCredits:t,selectedTimeRange:o,setSelectedTimeRange:n,error:i,localization:r,currencyUnit:a}){return jsxRuntime.jsxs("div",{className:"stigg-credit-usage-chart-header",style:{display:"flex",flexDirection:"row",marginBottom:16,justifyContent:"space-between"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:8,alignItems:"center"},children:[jsxRuntime.jsx(P,{variant:"h3",color:"primary",className:"stigg-credit-usage-chart-title",children:r.title}),e?jsxRuntime.jsx(dt,{width:100,height:24}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"secondary",className:"stigg-credit-usage-chart-total",children:"|"}),jsxRuntime.jsxs(P,{variant:"h6",color:"secondary",className:"stigg-credit-usage-chart-total",children:[r.totalSpend,": ",ft(t||0)," ",a||""]})]})]}),!e&&!i&&jsxRuntime.jsx(sA,{className:"stigg-credit-usage-chart-time-range-select",value:o,input:jsxRuntime.jsx(lA,{}),onChange:s=>n(s.target.value),renderValue:s=>{var l;return jsxRuntime.jsxs(P,{variant:"body1",color:"primary",children:[((l=Fb.find(c=>c.value===s))==null?void 0:l.label)||""," "]})},children:Fb.map(s=>jsxRuntime.jsx(material.MenuItem,{value:s.value,children:jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:s.label})},s.value))})]})}var pA=y.div`
1115
1115
  display: flex;
1116
1116
  flex-direction: column;
1117
1117
  gap: 8px;
1118
- `,pA=y.div`
1118
+ `,mA=y.div`
1119
1119
  align-items: center;
1120
1120
  justify-content: center;
1121
1121
  min-height: 480px;
@@ -1126,44 +1126,44 @@
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
- `,mA=y(ro__default.default)`
1129
+ `,hA=y(ro__default.default)`
1130
1130
  border-radius: 4px;
1131
1131
  height: 400px;
1132
1132
  width: 100%;
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]=Ac.useState(t),{creditUsage:c,isLoading:d,error:u}=qs({currencyId:e,timeRange:s}),{tooltipInfo:p,tooltipHandler:h}=wb(),{data:m,options:g}=Ac.useMemo(()=>xb(c||null,n,h,s),[c,n,h,s]),f=Ac.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 jsxRuntime.jsx(ht,{componentTheme:n,children:jsxRuntime.jsxs(uA,{className:"stigg-credit-usage-chart-container",children:[jsxRuntime.jsx(pA,{className:"stigg-credit-usage-chart-card",children:jsxRuntime.jsxs("div",{style:{width:"100%"},children:[jsxRuntime.jsx(Fb,{isLoading:d,totalCredits:f,selectedTimeRange:s,setSelectedTimeRange:l,error:u,localization:a,currencyUnit:x}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[jsxRuntime.jsx("div",{style:{height:"400px",position:"relative"},children:d?jsxRuntime.jsx(mA,{className:"stigg-credit-usage-chart-skeleton"}):u?jsxRuntime.jsx(Ib,{}):(c==null?void 0:c.series.length)===0?jsxRuntime.jsx(Ab,{}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(kb,{tooltipInfo:p}),jsxRuntime.jsx(fb,{className:"stigg-credit-usage-chart-bar",data:m!=null?m:{labels:[],datasets:[]},options:g!=null?g:{},plugins:[yb]})]})}),!d&&jsxRuntime.jsx(vb,{creditUsageData:c})]})]})}),jsxRuntime.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`
1133
+ `;function Rb({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({},m1),o),[s,l]=Fc.useState(t),{creditUsage:c,isLoading:d,error:u}=Qs({currencyId:e,timeRange:s}),{tooltipInfo:p,tooltipHandler:h}=vb(),{data:m,options:g}=Fc.useMemo(()=>bb(c||null,n,h,s),[c,n,h,s]),f=Fc.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 jsxRuntime.jsx(ht,{componentTheme:n,children:jsxRuntime.jsxs(pA,{className:"stigg-credit-usage-chart-container",children:[jsxRuntime.jsx(mA,{className:"stigg-credit-usage-chart-card",children:jsxRuntime.jsxs("div",{style:{width:"100%"},children:[jsxRuntime.jsx(Lb,{isLoading:d,totalCredits:f,selectedTimeRange:s,setSelectedTimeRange:l,error:u,localization:a,currencyUnit:x}),jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[jsxRuntime.jsx("div",{style:{height:"400px",position:"relative"},children:d?jsxRuntime.jsx(hA,{className:"stigg-credit-usage-chart-skeleton"}):u?jsxRuntime.jsx(Eb,{}):(c==null?void 0:c.series.length)===0?jsxRuntime.jsx(Mb,{}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(wb,{tooltipInfo:p}),jsxRuntime.jsx(yb,{className:"stigg-credit-usage-chart-bar",data:m!=null?m:{labels:[],datasets:[]},options:g!=null?g:{},plugins:[xb]})]})}),!d&&jsxRuntime.jsx(_b,{creditUsageData:c})]})]})}),jsxRuntime.jsx(Jt,{source:"credit_usage_chart",align:"end",smallScreenAlign:"end",style:{marginTop:0},showWatermark:r==null?void 0:r.getShowWatermark()})]})})}var fA=(e,t,o)=>o==="primary"?t.palette.primary:e>=100?t.palette.progress.high:e>=75?t.palette.progress.medium:t.palette.progress.low,yA=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
- `,yA=y.div`
1139
+ `,xA=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})=>gA(t,e.stigg,o)};
1142
+ background-color: ${({theme:e,percentage:t,variant:o})=>fA(t,e.stigg,o)};
1143
1143
  border-radius: 4px;
1144
1144
  transition: width 0.3s ease-in-out;
1145
- `;function el({percentage:e,className:t,variant:o="utilization"}){return jsxRuntime.jsx(fA,{className:t,children:jsxRuntime.jsx(yA,{percentage:e,variant:o})})}var bA=y.div`
1145
+ `;function ol({percentage:e,className:t,variant:o="utilization"}){return jsxRuntime.jsx(yA,{className:t,children:jsxRuntime.jsx(xA,{percentage:e,variant:o})})}var CA=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
- `,CA=y.div`
1151
+ `,PA=y.div`
1152
1152
  display: flex;
1153
1153
  flex-direction: row;
1154
1154
  gap: 4px;
1155
1155
  align-items: baseline;
1156
- `,PA=y.div`
1156
+ `,SA=y.div`
1157
1157
  display: flex;
1158
1158
  flex-direction: row;
1159
1159
  gap: 4px;
1160
1160
  align-items: baseline;
1161
- `,SA=({totalConsumed:e,totalGranted:t})=>{let o=$a(e!=null?e:0,t!=null?t:0);return jsxRuntime.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 jsxRuntime.jsx(P,{variant:"body1",color:"error",className:"stigg-credit-utilization-value-error",children:o.message||"Failed to load balance"});if(t)return jsxRuntime.jsx(ro__default.default,{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 jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(bA,{children:[jsxRuntime.jsxs(CA,{children:[jsxRuntime.jsx(P,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-utilization-usage",children:mo(l,n)}),jsxRuntime.jsx(P,{variant:"h3",color:"primary",className:"stigg-credit-utilization-separator",children:"/"}),jsxRuntime.jsx(P,{variant:"h3",color:"primary",className:"stigg-credit-utilization-total",children:mo(c,n)}),jsxRuntime.jsx(P,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-suffix",children:d})]}),jsxRuntime.jsxs(PA,{children:[jsxRuntime.jsx(P,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-remaining-label",children:a}),jsxRuntime.jsx(P,{variant:"caption",color:"primary",bold:true,className:"stigg-credit-utilization-remaining-value",children:mo(s,n)})]})]}),jsxRuntime.jsx(SA,{totalConsumed:e.totalConsumed,totalGranted:e.totalGranted}),jsxRuntime.jsx(Ha,{usagePeriodEnd:e.usagePeriodEnd,className:"stigg-credit-utilization-reset-period"})]})}return jsxRuntime.jsx(P,{variant:"body1",color:"disabled",className:"stigg-credit-utilization-value-no-balance",children:"No balance data available"})}var kA=y.div`
1161
+ `,TA=({totalConsumed:e,totalGranted:t})=>{let o=Ha(e!=null?e:0,t!=null?t:0);return jsxRuntime.jsx(ol,{percentage:o,className:"stigg-credit-utilization-progress"})};function Nb({balance:e,isLoading:t,error:o,decimalPlaces:n=null,showUnits:i=true,showSymbol:r=false,remainingLabel:a=Ga.remaining}){if(o)return jsxRuntime.jsx(P,{variant:"body1",color:"error",className:"stigg-credit-utilization-value-error",children:o.message||"Failed to load balance"});if(t)return jsxRuntime.jsx(ro__default.default,{width:280,height:24,className:"stigg-credit-utilization-value-loading"});if(e){let{currentBalance:s,totalConsumed:l,totalGranted:c}=e,d=$a(e,i,r);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(CA,{children:[jsxRuntime.jsxs(PA,{children:[jsxRuntime.jsx(P,{variant:"h3",color:"primary",bold:true,className:"stigg-credit-utilization-usage",children:mo(l,n)}),jsxRuntime.jsx(P,{variant:"h3",color:"primary",className:"stigg-credit-utilization-separator",children:"/"}),jsxRuntime.jsx(P,{variant:"h3",color:"primary",className:"stigg-credit-utilization-total",children:mo(c,n)}),jsxRuntime.jsx(P,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-suffix",children:d})]}),jsxRuntime.jsxs(SA,{children:[jsxRuntime.jsx(P,{variant:"caption",color:"secondary",className:"stigg-credit-utilization-remaining-label",children:a}),jsxRuntime.jsx(P,{variant:"caption",color:"primary",bold:true,className:"stigg-credit-utilization-remaining-value",children:mo(s,n)})]})]}),jsxRuntime.jsx(TA,{totalConsumed:e.totalConsumed,totalGranted:e.totalGranted}),jsxRuntime.jsx(Wa,{usagePeriodEnd:e.usagePeriodEnd,className:"stigg-credit-utilization-reset-period"})]})}return jsxRuntime.jsx(P,{variant:"body1",color:"disabled",className:"stigg-credit-utilization-value-no-balance",children:"No balance data available"})}var wA=y.div`
1162
1162
  display: flex;
1163
1163
  flex-direction: column;
1164
1164
  gap: 8px;
1165
1165
  width: 100%;
1166
- `,wA=y.div`
1166
+ `,vA=y.div`
1167
1167
  display: flex;
1168
1168
  flex-direction: column;
1169
1169
  gap: 16px;
@@ -1172,7 +1172,7 @@
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 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=jsxRuntime.jsx(kA,{className:"stigg-credit-utilization-container",children:jsxRuntime.jsxs(wA,{className:"stigg-credit-utilization-card",children:[jsxRuntime.jsxs(Ln,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",className:"stigg-credit-utilization-title",children:p}),r&&c&&!u&&jsxRuntime.jsxs(Bn,{type:"button",onClick:()=>r(c),className:"stigg-credit-utilization-add-credits-button",children:[jsxRuntime.jsx(Ga,{className:"stigg-credit-utilization-add-credits-icon"}),m]})]}),jsxRuntime.jsx(Db,{balance:c,isLoading:d,error:u,decimalPlaces:o,showUnits:n,showSymbol:i,remainingLabel:h})]})});return a?g:jsxRuntime.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=Ac.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 Ac.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 jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:e}).map((n,i)=>jsxRuntime.jsx(material.TableRow,{children:t.map(r=>jsxRuntime.jsx(si,{$alignment:r.alignment,$width:r.width,$maxWidth:r.maxWidth,$minWidth:r.minWidth,$isLastRow:i===e-1,$hideLastRowBorder:o,children:jsxRuntime.jsx(ro__default.default,{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 jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map((i,r)=>jsxRuntime.jsx(Vu,{$clickable:!!o,onClick:()=>o&&o(i),children:t.map(a=>jsxRuntime.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:jsxRuntime.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"?jsxRuntime.jsx(P,{variant:"body1",color:"error",className:t,children:e||"An error occurred"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}function sl({message:e,className:t}){return e===void 0||typeof e=="string"?jsxRuntime.jsx(P,{variant:"body1",color:"secondary",className:t,children:e||"No data available"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}var VA=y(material.TableContainer)`
1175
+ `;function Ub({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({},Ga),t),g=jsxRuntime.jsx(wA,{className:"stigg-credit-utilization-container",children:jsxRuntime.jsxs(vA,{className:"stigg-credit-utilization-card",children:[jsxRuntime.jsxs(Bn,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",className:"stigg-credit-utilization-title",children:p}),r&&c&&!u&&jsxRuntime.jsxs(Rn,{type:"button",onClick:()=>r(c),className:"stigg-credit-utilization-add-credits-button",children:[jsxRuntime.jsx(ja,{className:"stigg-credit-utilization-add-credits-icon"}),m]})]}),jsxRuntime.jsx(Nb,{balance:c,isLoading:d,error:u,decimalPlaces:o,showUnits:n,showSymbol:i,remainingLabel:h})]})});return a?g:jsxRuntime.jsx(ht,{componentTheme:l,children:g})}function il(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=Fc.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 Fc.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 zu({skeletonRows:e,visibleHeadCells:t,hideLastRowBorder:o}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:e}).map((n,i)=>jsxRuntime.jsx(material.TableRow,{children:t.map(r=>jsxRuntime.jsx(li,{$alignment:r.alignment,$width:r.width,$maxWidth:r.maxWidth,$minWidth:r.minWidth,$isLastRow:i===e-1,$hideLastRowBorder:o,children:jsxRuntime.jsx(ro__default.default,{width:r.width?parseInt(r.width.replace("px",""))-40:100,height:20})},String(r.id)))},i))})}function Vu({data:e,visibleHeadCells:t,onRowClick:o,hideLastRowBorder:n}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map((i,r)=>jsxRuntime.jsx($u,{$clickable:!!o,onClick:()=>o&&o(i),children:t.map(a=>jsxRuntime.jsx(li,{$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:jsxRuntime.jsx(Hu,{$alignment:a.alignment,children:a.render(i)})},String(a.id)))},r))})}function sl({errorMessage:e,className:t}){return e===void 0||typeof e=="string"?jsxRuntime.jsx(P,{variant:"body1",color:"error",className:t,children:e||"An error occurred"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}function ll({message:e,className:t}){return e===void 0||typeof e=="string"?jsxRuntime.jsx(P,{variant:"body1",color:"secondary",className:t,children:e||"No data available"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}var $A=y(material.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 @@
1185
1185
  align-items: center;
1186
1186
  justify-content: center;
1187
1187
  `}
1188
- `,$A=y(material.Table)`
1188
+ `,HA=y(material.Table)`
1189
1189
  min-width: 600px;
1190
1190
  table-layout: auto;
1191
1191
  width: 100%;
1192
- `,HA=y(material.Divider)`
1192
+ `,WA=y(material.Divider)`
1193
1193
  border-color: ${({theme:e})=>e.stigg.palette.outlinedBorder};
1194
- `,si=y(material.TableCell)`
1194
+ `,li=y(material.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 @@
1204
1204
  ${({$minWidth:e})=>e&&`min-width: ${e};`}
1205
1205
 
1206
1206
  ${({$isLastRow:e,$hideLastRowBorder:t})=>e&&t&&"border-bottom: none;"}
1207
- `,WA=y(si)`
1207
+ `,GA=y(li)`
1208
1208
  background-color: transparent;
1209
- `,Vu=y(material.TableRow)`
1209
+ `,$u=y(material.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
- `,$u=y.div`
1216
+ `,Hu=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
- `,GA=y(material.TablePagination)`
1221
+ `,jA=y(material.TablePagination)`
1222
1222
  color: ${({theme:e})=>e.stigg.palette.text.secondary};
1223
- `;function jA({visibleHeadCells:e}){return jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:e.map(t=>jsxRuntime.jsx(WA,{$alignment:t.alignment,$width:t.width,$maxWidth:t.maxWidth,$minWidth:t.minWidth,children:jsxRuntime.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 jsxRuntime.jsx(VA,{className:s,$hasMinHeight:g,children:n?jsxRuntime.jsx(al,{errorMessage:r,className:`${s}-error`}):!o&&e.length===0?jsxRuntime.jsx(sl,{message:i,className:`${s}-empty`}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs($A,{children:[jsxRuntime.jsx(jA,{visibleHeadCells:m}),jsxRuntime.jsx(material.TableBody,{children:o?jsxRuntime.jsx(Ou,{skeletonRows:l,visibleHeadCells:m,hideLastRowBorder:c}):jsxRuntime.jsx(zu,{data:e,visibleHeadCells:m,onRowClick:a,hideLastRowBorder:c})})]}),!!(e!=null&&e.length)&&h&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(HA,{}),jsxRuntime.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(material.Chip)`
1223
+ `;function YA({visibleHeadCells:e}){return jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:e.map(t=>jsxRuntime.jsx(GA,{$alignment:t.alignment,$width:t.width,$maxWidth:t.maxWidth,$minWidth:t.minWidth,children:jsxRuntime.jsx(P,{variant:"caption",children:t.label})},String(t.id)))})})}function cl({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 jsxRuntime.jsx($A,{className:s,$hasMinHeight:g,children:n?jsxRuntime.jsx(sl,{errorMessage:r,className:`${s}-error`}):!o&&e.length===0?jsxRuntime.jsx(ll,{message:i,className:`${s}-empty`}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(HA,{children:[jsxRuntime.jsx(YA,{visibleHeadCells:m}),jsxRuntime.jsx(material.TableBody,{children:o?jsxRuntime.jsx(zu,{skeletonRows:l,visibleHeadCells:m,hideLastRowBorder:c}):jsxRuntime.jsx(Vu,{data:e,visibleHeadCells:m,onRowClick:a,hideLastRowBorder:c})})]}),!!(e!=null&&e.length)&&h&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(WA,{}),jsxRuntime.jsx(jA,{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 XA=y(material.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 jsxRuntime.jsx(ZA,S({label:t,size:n,$variant:e,className:o},i))}function $b(e){let t=rd__default.default(),o=rd__default.default(e.effectiveAt),n=e.expireAt?rd__default.default(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 rh.CreditGrantType.Promotional:return "Promotional";case rh.CreditGrantType.Paid:return "Top-up";case rh.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})=>jsxRuntime.jsx(P,{variant:"body1",className:"stigg-credit-grants-effective-date",children:ad(u)})},{id:"grantType",label:n.grantType,width:"205px",render:u=>jsxRuntime.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=lodash.capitalize(u),h=ju(u);return jsxRuntime.jsx(hr,{label:p,variant:h,className:"stigg-credit-grants-status-chip"})}},{id:"amount",label:n.balance,width:"205px",render:u=>jsxRuntime.jsx(P,{variant:"body1",className:"stigg-credit-grants-balance",children:Hb(u,i)})},{id:"expireAt",label:n.expiryDate,width:"205px",render:({expireAt:u})=>jsxRuntime.jsx(P,{variant:"body1",className:"stigg-credit-grants-expiry-date",children:u?sd(u):"-"})}];return jsxRuntime.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]=Ac.useState(0),[r,a]=Ac.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`
1230
+ `;function gr(r){var a=r,{variant:e,label:t,className:o,size:n="small"}=a,i=ot(a,["variant","label","className","size"]);return jsxRuntime.jsx(XA,S({label:t,size:n,$variant:e,className:o},i))}function Hb(e){let t=fc__default.default(),o=fc__default.default(e.effectiveAt),n=e.expireAt?fc__default.default(e.expireAt):null;return o.isAfter(t)?"SCHEDULED":n&&n.isBefore(t)?"EXPIRED":"AVAILABLE"}function Wb(e,t){return console.log("decimalPlaces",t),`${mo(e.consumedAmount,t)} / ${e.amount}`}var Yu=e=>{switch(e){case "AVAILABLE":return "success";case "SCHEDULED":return "warning";case "EXPIRED":return "error";default:return "neutral"}},Gb=e=>{if(e.automaticRechargeConfigurationId)return "Automatic recharge";switch(e.grantType){case ah.CreditGrantType.Promotional:return "Promotional";case ah.CreditGrantType.Paid:return "Top-up";case ah.CreditGrantType.Recurring:return "Recurring";default:return "Unknown"}};function jb({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:Hb(u)})),d=[{id:"effectiveAt",label:n.receivedAt,width:"205px",render:({effectiveAt:u})=>jsxRuntime.jsx(P,{variant:"body1",className:"stigg-credit-grants-effective-date",children:yc(u)})},{id:"grantType",label:n.grantType,width:"205px",render:u=>jsxRuntime.jsx(P,{variant:"body1",className:"stigg-credit-grants-grant-type",children:Gb(u)})},{id:"status",label:n.status,width:"205px",render:({status:u})=>{let p=lodash.capitalize(u),h=Yu(u);return jsxRuntime.jsx(gr,{label:p,variant:h,className:"stigg-credit-grants-status-chip"})}},{id:"amount",label:n.balance,width:"205px",render:u=>jsxRuntime.jsx(P,{variant:"body1",className:"stigg-credit-grants-balance",children:Wb(u,i)})},{id:"expireAt",label:n.expiryDate,width:"205px",render:({expireAt:u})=>jsxRuntime.jsx(P,{variant:"body1",className:"stigg-credit-grants-expiry-date",children:u?xc(u):"-"})}];return jsxRuntime.jsx(cl,{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 Zb=(e,t,o)=>{let[n,i]=Fc.useState(0),[r,a]=Fc.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 tM=10,eM=y.div`
1231
1231
  display: flex;
1232
1232
  flex-direction: column;
1233
1233
  gap: 8px;
1234
- `,eM=y.div`
1234
+ `,oM=y.div`
1235
1235
  display: flex;
1236
1236
  flex-direction: column;
1237
1237
  gap: 16px;
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]=Ac.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 jsxRuntime.jsx(ht,{componentTheme:a,children:jsxRuntime.jsxs(tM,{className:"stigg-credit-grants-container",children:[jsxRuntime.jsx(eM,{className:"stigg-credit-grants-card",children:jsxRuntime.jsx(Gb,{creditGrants:d,isLoading:u,error:p,localization:s,decimalPlaces:o,pageSize:n,pageNum:g,totalCount:m,onPageChange:f})}),jsxRuntime.jsx(Jt,{source:"grant_list",align:"end",smallScreenAlign:"end",style:{marginTop:0},showWatermark:r==null?void 0:r.getShowWatermark()})]})})}var Xb=y.div`
1238
+ `;function Xb({currencyId:e,localization:t,decimalPlaces:o,pageSize:n=tM}){let i=D({optional:true}),r=i==null?void 0:i.stigg,a=i==null?void 0:i.theme,s=S(S({},p1),t),[l,c]=Fc.useState({first:n}),{creditGrants:d,isLoading:u,error:p,paging:h,totalCount:m}=il({currencyId:e,pageSize:n,paging:l}),{pageNumber:g,pageChangeFunc:f}=Zb(h,c,n);return jsxRuntime.jsx(ht,{componentTheme:a,children:jsxRuntime.jsxs(eM,{className:"stigg-credit-grants-container",children:[jsxRuntime.jsx(oM,{className:"stigg-credit-grants-card",children:jsxRuntime.jsx(jb,{creditGrants:d,isLoading:u,error:p,localization:s,decimalPlaces:o,pageSize:n,pageNum:g,totalCount:m,onPageChange:f})}),jsxRuntime.jsx(Jt,{source:"grant_list",align:"end",smallScreenAlign:"end",style:{marginTop:0},showWatermark:r==null?void 0:r.getShowWatermark()})]})})}var Kb=y.div`
1239
1239
  display: flex;
1240
1240
  flex-direction: column;
1241
1241
  gap: 16px;
@@ -1244,16 +1244,16 @@
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 Kb=y.div`
1247
+ `;var qb=y.div`
1248
1248
  display: flex;
1249
1249
  align-items: center;
1250
1250
  gap: 4px;
1251
- `;var Yu=y.div`
1251
+ `;var Zu=y.div`
1252
1252
  display: flex;
1253
1253
  flex-direction: column;
1254
1254
  gap: 4px;
1255
1255
  width: 100%;
1256
- `;var qb=y.div`
1256
+ `;var Qb=y.div`
1257
1257
  display: flex;
1258
1258
  align-items: center;
1259
1259
  justify-content: center;
@@ -1261,26 +1261,26 @@
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 dl(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=Ac.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=Ac.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)`
1264
+ `;function ul(e){let t=D(),o=t==null?void 0:t.stigg,n=t==null?void 0:t.updatedAt,i=Fc.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 Jb({customerId:e,currencyId:t}){let{config:o,isLoading:n,error:i}=ul({customerId:e,currencyId:t}),r=Fc.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?Ha(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 tC=y(Kb)`
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
- `,tC=y.div`
1268
+ `,eC=y.div`
1269
1269
  display: flex;
1270
1270
  align-items: center;
1271
1271
  justify-content: flex-start;
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?jsxRuntime.jsx(Jb,{className:`stigg-auto-recharge-status stigg-auto-recharge-status-error ${r||""}`,children:jsxRuntime.jsx(P,{variant:"body1",color:"error",children:m.message||"Failed to load auto-recharge status"})}):jsxRuntime.jsxs(Jb,{className:`stigg-auto-recharge-status ${r||""}`,children:[jsxRuntime.jsxs(Ln,{children:[jsxRuntime.jsxs(Kb,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",className:"stigg-auto-recharge-title",children:g.title}),!h&&p&&jsxRuntime.jsx(hr,{variant:"success",label:g.activeLabel,className:"stigg-auto-recharge-status-chip",size:"small"})]}),h?jsxRuntime.jsx(ro__default.default,{width:70,height:38,borderRadius:10}):jsxRuntime.jsx(Bn,{type:"button",onClick:i,className:"stigg-auto-recharge-manage-button","aria-label":`${g.manageButton} auto-recharge settings`,children:g.manageButton})]}),h?jsxRuntime.jsxs(Yu,{children:[jsxRuntime.jsx(ro__default.default,{width:"100%",height:20}),jsxRuntime.jsx(ro__default.default,{width:"100%",height:8,borderRadius:0}),jsxRuntime.jsx(tC,{children:jsxRuntime.jsx(ro__default.default,{width:200,height:16})})]}):p?jsxRuntime.jsxs(Yu,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"primary",className:"stigg-auto-recharge-description",children:f}),jsxRuntime.jsx(el,{percentage:u,variant:"primary",className:"stigg-auto-recharge-progress"}),jsxRuntime.jsx(tC,{children:jsxRuntime.jsx(P,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-spend",children:d>0?x:g.unlimitedSpendLimit})})]}):jsxRuntime.jsx(qb,{className:"stigg-auto-recharge-empty",children:jsxRuntime.jsx(P,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-empty-text",children:g.emptyStateMessage})})]})}var rM=y.div`
1272
+ `;function oC(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 nC({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}=Jb({customerId:e,currencyId:t}),g=S(S({},h1),a&&Object.fromEntries(Object.entries(a).filter(([b,T])=>T!==void 0))),f=oC(g.descriptionTemplate,{target:di(l),unit:o,threshold:di(s)}),x=oC(g.spendTemplate,{currency:n,current:di(c),limit:di(d)});return m?jsxRuntime.jsx(tC,{className:`stigg-auto-recharge-status stigg-auto-recharge-status-error ${r||""}`,children:jsxRuntime.jsx(P,{variant:"body1",color:"error",children:m.message||"Failed to load auto-recharge status"})}):jsxRuntime.jsxs(tC,{className:`stigg-auto-recharge-status ${r||""}`,children:[jsxRuntime.jsxs(Bn,{children:[jsxRuntime.jsxs(qb,{children:[jsxRuntime.jsx(P,{variant:"h6",color:"primary",className:"stigg-auto-recharge-title",children:g.title}),!h&&p&&jsxRuntime.jsx(gr,{variant:"success",label:g.activeLabel,className:"stigg-auto-recharge-status-chip",size:"small"})]}),h?jsxRuntime.jsx(ro__default.default,{width:70,height:38,borderRadius:10}):jsxRuntime.jsx(Rn,{type:"button",onClick:i,className:"stigg-auto-recharge-manage-button","aria-label":`${g.manageButton} auto-recharge settings`,children:g.manageButton})]}),h?jsxRuntime.jsxs(Zu,{children:[jsxRuntime.jsx(ro__default.default,{width:"100%",height:20}),jsxRuntime.jsx(ro__default.default,{width:"100%",height:8,borderRadius:0}),jsxRuntime.jsx(eC,{children:jsxRuntime.jsx(ro__default.default,{width:200,height:16})})]}):p?jsxRuntime.jsxs(Zu,{children:[jsxRuntime.jsx(P,{variant:"body1",color:"primary",className:"stigg-auto-recharge-description",children:f}),jsxRuntime.jsx(ol,{percentage:u,variant:"primary",className:"stigg-auto-recharge-progress"}),jsxRuntime.jsx(eC,{children:jsxRuntime.jsx(P,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-spend",children:d>0?x:g.unlimitedSpendLimit})})]}):jsxRuntime.jsx(Qb,{className:"stigg-auto-recharge-empty",children:jsxRuntime.jsx(P,{variant:"caption",color:"tertiary",className:"stigg-auto-recharge-empty-text",children:g.emptyStateMessage})})]})}var aM=y.div`
1273
1273
  display: flex;
1274
1274
  flex-direction: column;
1275
1275
  gap: 8px;
1276
1276
  width: 100%;
1277
- `;function nC(e){let t=jt(St),o=D({optional:true}),n=o==null?void 0:o.theme,i=jsxRuntime.jsx(rM,{className:"stigg-auto-recharge-status-container",children:jsxRuntime.jsx(oC,S({},e))});return t?i:jsxRuntime.jsx(ht,{componentTheme:n,children:i})}function iC(e){return g2__default.default({},{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]=Ac.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]=Ac.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]=Ac.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`
1277
+ `;function iC(e){let t=jt(St),o=D({optional:true}),n=o==null?void 0:o.theme,i=jsxRuntime.jsx(aM,{className:"stigg-auto-recharge-status-container",children:jsxRuntime.jsx(nC,S({},e))});return t?i:jsxRuntime.jsx(ht,{componentTheme:n,children:i})}function rC(e){return f2__default.default({},{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 ml({initialData:e,poolSize:t,localization:o}){var f,x,b,T,k,w,v,_,M,I,F,E,B,O;let[n,i]=Fc.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]=Fc.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]=Fc.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 yr=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
- `,yr=y.div`
1283
+ `,xr=y.div`
1284
1284
  display: flex;
1285
1285
  flex-direction: column;
1286
1286
  gap: 8px;
@@ -1289,15 +1289,15 @@
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
- `,Ku=y(reactFeather.Info)`
1292
+ `,qu=y(reactFeather.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
- `,qu=y(material.Alert)`
1297
+ `,Qu=y(material.Alert)`
1298
1298
  font-family: custom-font, 'DM Sans', sans-serif;
1299
1299
  align-items: center;
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=Ac.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}),_=Ac.useMemo(()=>g.enabled?Object.keys(f).length>0:false,[f,g.enabled]),M=Ac.useCallback(()=>{if(w()&&c){let O=v();c(S({customerId:e,currencyId:t},O));}},[w,c,v,e,t]),I=jsxRuntime.jsx(fr,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsxs(yr,{className:"stigg-automatic-recharge-form-card",children:[jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsx(P,{variant:"h3",color:"primary",className:"stigg-automatic-recharge-form-title",children:m.title}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",className:"stigg-automatic-recharge-form-subtitle",children:m.enableLabel})]}),jsxRuntime.jsx(material.Box,{display:"flex",flexDirection:"column",gap:1,children:jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:g.enabled,onChange:x,disabled:s}),label:jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:m.enableDescription}),className:"stigg-automatic-recharge-form-enable-checkbox"})}),jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-threshold-field",children:[jsxRuntime.jsxs(material.Box,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsxs(P,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(material.Box,{component:"span",fontWeight:"bold",children:m.thresholdFieldPrefix})," ",m.thresholdFieldSuffix]}),jsxRuntime.jsx(Be,{title:m.thresholdTooltip,children:jsxRuntime.jsx(Ku,{})})]}),jsxRuntime.jsx(reactNumberFormat.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?jsxRuntime.jsx(P,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:n}):void 0},className:"stigg-automatic-recharge-form-threshold-input"})]}),jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-target-field",children:[jsxRuntime.jsxs(material.Box,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsxs(P,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(material.Box,{component:"span",fontWeight:"bold",children:m.targetFieldPrefix})," ",m.targetFieldSuffix]}),jsxRuntime.jsx(Be,{title:m.targetBalanceTooltip,children:jsxRuntime.jsx(Ku,{})})]}),jsxRuntime.jsx(reactNumberFormat.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?jsxRuntime.jsx(P,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:n}):void 0},className:"stigg-automatic-recharge-form-target-input"})]}),jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-spend-limit-field",children:[jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsxs(P,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(material.Box,{component:"span",fontWeight:"bold",children:m.spendLimitFieldPrefix})," ",m.spendLimitFieldSuffix]}),jsxRuntime.jsx(P,{variant:"caption",color:"secondary",style:{fontSize:"12px"},children:m.spendLimitHelpText})]}),jsxRuntime.jsx(reactNumberFormat.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:jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:"$"}),endAdornment:jsxRuntime.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&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r!==void 0&&r<=parseFloat(g.thresholdAmount)&&jsxRuntime.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)&&jsxRuntime.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&&jsxRuntime.jsxs(material.Box,{display:"flex",justifyContent:"flex-end",gap:1,pt:2,className:"stigg-automatic-recharge-form-actions",children:[d&&jsxRuntime.jsx(kt,{variant:"outlined",onClick:d,className:"stigg-automatic-recharge-form-cancel-button",children:m.cancelButton}),c&&jsxRuntime.jsx(kt,{variant:"contained",onClick:M,disabled:_,className:"stigg-automatic-recharge-form-save-button",children:m.saveButton})]})]})});return u?I:jsxRuntime.jsx(ht,{componentTheme:h,children:I})}function sC(){let e=D(),t=e==null?void 0:e.stigg,[o,n]=Ac.useState(false),[i,r]=Ac.useState(null);return {updateConfig:Ac.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:rh.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=Ac.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=jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(ro__default.default,{width:300,height:24,style:{marginBottom:"16px"}}),jsxRuntime.jsx(ro__default.default,{width:400,height:200})]});return l?F:jsxRuntime.jsx(ht,{componentTheme:d,children:F})}if(h){let F=jsxRuntime.jsx(fr,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(yr,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(P,{variant:"body1",color:"error",children:h.message||"Failed to load automatic recharge configuration"})})});return l?F:jsxRuntime.jsx(ht,{componentTheme:d,children:F})}if(f){let F=jsxRuntime.jsx(fr,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(yr,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(P,{variant:"body1",color:"error",children:f.message||"Failed to load credit balance"})})});return l?F:jsxRuntime.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",_=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[T&&jsxRuntime.jsx(P,{variant:"body1",color:"error",style:{marginBottom:"16px"},children:T.message||"Failed to save automatic recharge configuration"}),jsxRuntime.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?_:jsxRuntime.jsx(ht,{componentTheme:d,children:_})}/*! Bundled license information:
1300
+ `;function hl({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=Fc.useMemo(()=>rC(l),[l]),{formData:g,errors:f,handleEnabledChange:x,handleFieldChange:b,handleFieldBlur:T,getFieldError:k,validate:w,getFormValues:v}=ml({initialData:o,poolSize:i,localization:m}),_=Fc.useMemo(()=>g.enabled?Object.keys(f).length>0:false,[f,g.enabled]),M=Fc.useCallback(()=>{if(w()&&c){let O=v();c(S({customerId:e,currencyId:t},O));}},[w,c,v,e,t]),I=jsxRuntime.jsx(yr,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsxs(xr,{className:"stigg-automatic-recharge-form-card",children:[jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsx(P,{variant:"h3",color:"primary",className:"stigg-automatic-recharge-form-title",children:m.title}),jsxRuntime.jsx(P,{variant:"body1",color:"secondary",className:"stigg-automatic-recharge-form-subtitle",children:m.enableLabel})]}),jsxRuntime.jsx(material.Box,{display:"flex",flexDirection:"column",gap:1,children:jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:g.enabled,onChange:x,disabled:s}),label:jsxRuntime.jsx(P,{variant:"body1",color:"primary",children:m.enableDescription}),className:"stigg-automatic-recharge-form-enable-checkbox"})}),jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-threshold-field",children:[jsxRuntime.jsxs(material.Box,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsxs(P,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(material.Box,{component:"span",fontWeight:"bold",children:m.thresholdFieldPrefix})," ",m.thresholdFieldSuffix]}),jsxRuntime.jsx(Be,{title:m.thresholdTooltip,children:jsxRuntime.jsx(qu,{})})]}),jsxRuntime.jsx(reactNumberFormat.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?jsxRuntime.jsx(P,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:n}):void 0},className:"stigg-automatic-recharge-form-threshold-input"})]}),jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-target-field",children:[jsxRuntime.jsxs(material.Box,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntime.jsxs(P,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(material.Box,{component:"span",fontWeight:"bold",children:m.targetFieldPrefix})," ",m.targetFieldSuffix]}),jsxRuntime.jsx(Be,{title:m.targetBalanceTooltip,children:jsxRuntime.jsx(qu,{})})]}),jsxRuntime.jsx(reactNumberFormat.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?jsxRuntime.jsx(P,{variant:"body1",color:"secondary",style:{whiteSpace:"nowrap"},children:n}):void 0},className:"stigg-automatic-recharge-form-target-input"})]}),jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:1,className:"stigg-automatic-recharge-form-spend-limit-field",children:[jsxRuntime.jsxs(material.Box,{display:"flex",flexDirection:"column",gap:.5,children:[jsxRuntime.jsxs(P,{variant:"body1",color:"primary",children:[jsxRuntime.jsx(material.Box,{component:"span",fontWeight:"bold",children:m.spendLimitFieldPrefix})," ",m.spendLimitFieldSuffix]}),jsxRuntime.jsx(P,{variant:"caption",color:"secondary",style:{fontSize:"12px"},children:m.spendLimitHelpText})]}),jsxRuntime.jsx(reactNumberFormat.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:jsxRuntime.jsx(P,{variant:"body1",color:"secondary",children:"$"}),endAdornment:jsxRuntime.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&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r!==void 0&&r<=parseFloat(g.thresholdAmount)&&jsxRuntime.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)&&jsxRuntime.jsx(Qu,{severity:"warning",className:"stigg-automatic-recharge-form-spend-limit-warning",children:m.spendLimitTooLowWarning.replace("{{currentSpend}}",gl(a)).replace("{{spendLimit}}",gl(parseFloat(g.maxSpendLimit)))})]}),!s&&jsxRuntime.jsxs(material.Box,{display:"flex",justifyContent:"flex-end",gap:1,pt:2,className:"stigg-automatic-recharge-form-actions",children:[d&&jsxRuntime.jsx(kt,{variant:"outlined",onClick:d,className:"stigg-automatic-recharge-form-cancel-button",children:m.cancelButton}),c&&jsxRuntime.jsx(kt,{variant:"contained",onClick:M,disabled:_,className:"stigg-automatic-recharge-form-save-button",children:m.saveButton})]})]})});return u?I:jsxRuntime.jsx(ht,{componentTheme:h,children:I})}function lC(){let e=D(),t=e==null?void 0:e.stigg,[o,n]=Fc.useState(false),[i,r]=Fc.useState(null);return {updateConfig:Fc.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:ah.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 uC({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}=ul({customerId:e,currencyId:t}),{balance:m,isLoading:g,error:f}=po({currencyId:t}),{updateConfig:x,isLoading:b,error:T}=lC(),k=Fc.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=jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(ro__default.default,{width:300,height:24,style:{marginBottom:"16px"}}),jsxRuntime.jsx(ro__default.default,{width:400,height:200})]});return l?F:jsxRuntime.jsx(ht,{componentTheme:d,children:F})}if(h){let F=jsxRuntime.jsx(yr,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(xr,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(P,{variant:"body1",color:"error",children:h.message||"Failed to load automatic recharge configuration"})})});return l?F:jsxRuntime.jsx(ht,{componentTheme:d,children:F})}if(f){let F=jsxRuntime.jsx(yr,{className:"stigg-automatic-recharge-form-container",children:jsxRuntime.jsx(xr,{className:"stigg-automatic-recharge-form-card",children:jsxRuntime.jsx(P,{variant:"body1",color:"error",children:f.message||"Failed to load credit balance"})})});return l?F:jsxRuntime.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",_=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[T&&jsxRuntime.jsx(P,{variant:"body1",color:"error",style:{marginBottom:"16px"},children:T.message||"Failed to save automatic recharge configuration"}),jsxRuntime.jsx(hl,{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?_:jsxRuntime.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
- */exports.AddonsList=Nr;exports.AutoRechargeStatus=nC;exports.AutomaticRechargeConfig=dC;exports.AutomaticRechargeConfigForm=ml;exports.BooleanEntitlementGuard=dv;exports.Checkout=i1;exports.CreditBalance=h1;exports.CreditGrants=Zb;exports.CreditUsageChart=Bb;exports.CreditUtilization=Nb;exports.CustomerPortal=$g;exports.CustomerPortalProvider=Dr;exports.CustomerUsageData=ua;exports.EmptyState=sl;exports.EnumEntitlementGuard=bv;exports.ErrorState=al;exports.GenericTable=ll;exports.InvoicesSection=pa;exports.MeteredEntitlementGuard=fv;exports.NumericEntitlementGuard=mv;exports.PaymentDetailsSection=ia;exports.Paywall=gh;exports.Promotions=Or;exports.ProvisionStatus=id;exports.StatusChip=hr;exports.StiggContext=Si;exports.StiggProvider=iS;exports.SubscribeIntentionType=kl;exports.SubscriptionsOverview=Jr;exports.formatDateOnly=sd;exports.formatDateTime=ad;exports.isCreditEntitlement=Qr;exports.isFeatureEntitlement=kn;exports.mapCreditGrantStatusToVariant=ju;exports.useActiveSubscriptions=zf;exports.useAutomaticRechargeForm=pl;exports.useBooleanEntitlement=Ta;exports.useCreditBalance=po;exports.useCreditGrants=nl;exports.useCreditUsage=qs;exports.useCustomerPortal=$f;exports.useEnumEntitlement=va;exports.useMeteredEntitlement=wa;exports.useNumericEntitlement=ka;exports.usePaywall=Vf;exports.useStiggContext=D;exports.useWaitForCheckoutCompleted=a1;exports.validateAutomaticRechargeForm=Io;Object.keys(rh).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return rh[k]}})});
1343
+ */exports.AddonsList=Ur;exports.AutoRechargeStatus=iC;exports.AutomaticRechargeConfig=uC;exports.AutomaticRechargeConfigForm=hl;exports.BooleanEntitlementGuard=pv;exports.Checkout=a1;exports.CreditBalance=g1;exports.CreditGrants=Xb;exports.CreditUsageChart=Rb;exports.CreditUtilization=Ub;exports.CustomerPortal=Wg;exports.CustomerPortalProvider=Nr;exports.CustomerUsageData=pa;exports.EmptyState=ll;exports.EnumEntitlementGuard=Pv;exports.ErrorState=sl;exports.GenericTable=cl;exports.InvoicesSection=ma;exports.MeteredEntitlementGuard=xv;exports.NumericEntitlementGuard=gv;exports.PaymentDetailsSection=ra;exports.Paywall=fh;exports.Promotions=zr;exports.ProvisionStatus=ld;exports.StatusChip=gr;exports.StiggContext=Ti;exports.StiggProvider=rS;exports.SubscribeIntentionType=wl;exports.SubscriptionsOverview=ta;exports.formatDateOnly=xc;exports.formatDateTime=yc;exports.isCreditEntitlement=Jr;exports.isFeatureEntitlement=kn;exports.mapCreditGrantStatusToVariant=Yu;exports.useActiveSubscriptions=$f;exports.useAutomaticRechargeForm=ml;exports.useBooleanEntitlement=ka;exports.useCreditBalance=po;exports.useCreditGrants=il;exports.useCreditUsage=Qs;exports.useCustomerPortal=Wf;exports.useEnumEntitlement=_a;exports.useMeteredEntitlement=va;exports.useNumericEntitlement=wa;exports.usePaywall=Hf;exports.useStiggContext=D;exports.useWaitForCheckoutCompleted=l1;exports.validateAutomaticRechargeForm=Io;Object.keys(ah).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return ah[k]}})});