@stigg/react-sdk 3.0.0-beta.9 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/paywall/PlanEntitlements.d.ts +3 -1
- package/dist/react-sdk.cjs.development.js +20 -14
- package/dist/react-sdk.cjs.development.js.map +1 -1
- package/dist/react-sdk.cjs.production.min.js +1 -1
- package/dist/react-sdk.cjs.production.min.js.map +1 -1
- package/dist/react-sdk.esm.js +20 -14
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/paywall/PlanEntitlements.tsx +11 -3
- package/src/components/paywall/PlanOffering.tsx +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@stigg/js-client-sdk"),n=e(t),r=require("react"),i=e(r),a=e(require("@emotion/styled/base")),l=e(require("currency-symbol-map")),o=require("styled-typography"),c=require("@emotion/react"),s=require("react-feather"),u=e(require("color")),d=e(require("lodash/merge")),p=e(require("react-spinners/ClipLoader")),g=e(require("moment")),m=e(require("lodash/isNil")),h=require("lodash"),f=e(require("classnames")),v=require("@mui/material"),y=e(require("react-switch")),b=require("react-loading-skeleton"),x=e(b),w=e(require("lodash/sortBy")),E=require("@mui/material/styles"),P=require("styled-components"),C=e(P),S=e(require("@mui/material/Button")),U=e(require("lodash/flatMap")),k=e(require("@mui/material/Box")),M=e(require("@mui/material/Tab")),N=e(require("lodash/isEmpty")),T=e(require("@mui/material/Tabs")),B=e(require("@mui/material/LinearProgress")),L=e(require("lodash/isUndefined")),A=e(require("lodash/lowerCase"));function F(e,t,n,r,i,a,l){try{var o=e[a](l),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}function O(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function l(e){F(a,r,i,l,o,"next",e)}function o(e){F(a,r,i,l,o,"throw",e)}l(void 0)}))}}function j(){return(j=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function I(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function D(e,t){return t||(t=e.slice(0)),e.raw=t,e}var R,_=function(e){var n=e.amount,r=e.currency,i=e.locale,a=e.maximumFractionDigits,o=void 0===a?5:a,c=(void 0===r?t.Currency.Usd:r).toString(),s=l(c),u=new Intl.NumberFormat(i,j({maximumFractionDigits:o,minimumFractionDigits:0,style:"currency",currency:c},s?{currencyDisplay:"code"}:{})).format(n||0);return s&&(u=u.replace(c,s)),u.replace(/\s/g,"")};function W(){return(W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var H=function(e){return r.createElement("svg",W({width:15,height:11,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R||(R=r.createElement("path",{d:"M5.59 7.99 2.125 4.525A1 1 0 1 0 .71 5.94l4.88 4.88 8.705-8.705a.997.997 0 0 0-1.41-1.41L5.59 7.99Z",fill:"#B2BBD3"})))},Z=["children","span","style","fontWeight","variant","color","overrideColor","bold"];function $(e,t){switch(t){case"white":return"white";case"primary.main":return e.stigg.palette.primary;case"warning":return e.stigg.palette.warning;case"error":return e.stigg.palette.error;default:return e.stigg.palette.text[t]}}var q=a(o.Text,{target:"ewjez2x0"})("margin:0;",(function(e){return e.$span&&"display: inline"}),";");function G(e){switch(e){case"bold":return o.FontWeight.Bold;case"normal":default:return o.FontWeight.Normal}}function z(e,t){var n=e.stigg.typography;switch(t){case"h1":return G(n.h1.fontWeight);case"h3":return G(n.h2.fontWeight);case"h6":return G(n.h3.fontWeight);case"body1":return G(n.body.fontWeight);case"caption":return G(n.caption.fontWeight);default:return o.FontWeight.Normal}}var V=r.forwardRef((function(e,t){var n=e.children,r=e.span,a=e.style,l=e.fontWeight,s=e.variant,u=void 0===s?"body1":s,d=e.color,p=void 0===d?"primary":d,g=e.overrideColor,m=e.bold,h=I(e,Z),f=c.useTheme(),v=function(e){switch(e){case"h1":return 1;case"h3":return 2;case"h6":return 3;case"body1":return 4;case"caption":return 5;default:return 3}}(u),y="typography-level-"+v;return i.createElement(q,Object.assign({ref:t},h,{className:e.className?e.className+" "+y:y,style:a,level:v,color:g||$(f,p),fontWeight:null!=l?l:m?o.FontWeight.Bold:z(f,u),$span:r}),n)})),Y=["displayNameOverride"],Q=a(V,{target:"e1mddeqb2"})({name:"ti75j2",styles:"margin:0"}),K=a("div",{target:"e1mddeqb1"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),X=a(H,{target:"e1mddeqb0"})("margin-right:16px;flex-shrink:0;*{fill:",(function(e){return e.theme.stigg.palette.text.disabled}),";}");function J(e){var n=e.displayNameOverride,r=function(e){var n=e.hasUnlimitedUsage,r=e.feature,i=e.resetPeriod,a=e.usageLimit,l=e.minUnitQuantity,o=e.maxUnitQuantity,c=e.isCustom,s=l||o,u=i&&a?""+function(e){if(!e)return"";switch(e){case t.EntitlementResetPeriod.Day:return"per day";case t.EntitlementResetPeriod.Hour:return"per hour";case t.EntitlementResetPeriod.Week:return"per week";case t.EntitlementResetPeriod.Month:return"per month"}}(i):"";if(n)return"Unlimited "+(null==r?void 0:r.unitsPlural);if(c)return"Custom "+(null==r?void 0:r.unitsPlural);if(a){var d=1===a?null==r?void 0:r.units:null==r?void 0:r.unitsPlural;return function(e){return e.toLocaleString("en-US",{maximumFractionDigits:0})}(a)+" "+d+" "+u}return s?function(e,t,n){return e&&1!==e||!t?e&&e>1&&t?e+"-"+t+" "+n:e&&e>1?"Minimum "+e+" "+n:"":"Up to "+t+" "+n}(l,o,null==r?void 0:r.unitsPlural):null==r?void 0:r.displayName}(I(e,Y));return i.createElement(K,{className:"stigg-entitlement-row-container"},i.createElement(X,{className:"stigg-entitlement-row-icon"}),i.createElement(Q,{className:"stigg-entitlement-name",variant:"h6",color:"secondary"},n||r))}var ee,te=a("div",{target:"e1yz7zcg0"})({name:"1k68p29",styles:"display:flex;flex-direction:column;gap:16px;margin-top:33px;margin-bottom:60px"});function ne(e){var n=e.plan,r=e.paywallLocale,a=n.pricePoints,l=null==a?void 0:a.map((function(e){var t;return(null==e?void 0:e.minUnitQuantity)&&(null==e?void 0:e.minUnitQuantity)>1||(null==e?void 0:e.maxUnitQuantity)?i.createElement(J,{key:"priceUnitEntitlement-"+(null==e||null==(t=e.feature)?void 0:t.displayName),feature:null==e?void 0:e.feature,minUnitQuantity:null==e?void 0:e.minUnitQuantity,maxUnitQuantity:null==e?void 0:e.maxUnitQuantity}):null}));return i.createElement(te,{className:"stigg-plan-entitlements-container"},i.createElement(V,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:!0},function(e,t){if(t.entitlementsTitle)return t.entitlementsTitle(e);var n=e.displayName+" includes";return e.basePlan&&(n="Everything in "+e.basePlan.displayName+", plus:"),n}(n,r)),l,n.entitlements.filter((function(e){return!(e.hiddenFromWidgets||[]).includes(t.WidgetType.Paywall)})).map((function(e){var t;return i.createElement(J,{key:null==(t=e.feature)?void 0:t.id,displayNameOverride:e.displayNameOverride,feature:e.feature,resetPeriod:e.resetPeriod,hasUnlimitedUsage:e.hasUnlimitedUsage,usageLimit:e.usageLimit,isCustom:e.isCustom})})))}(ee=exports.SubscribeIntentionType||(exports.SubscribeIntentionType={})).START_TRIAL="START_TRIAL",ee.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",ee.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",ee.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",ee.UPGRADE_PLAN="UPGRADE_PLAN",ee.DOWNGRADE_PLAN="DOWNGRADE_PLAN",ee.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES";var re,ie=function(e){return{left:"flex-start",center:"center",right:"flex-end"}[e]};function ae(){return(ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var le,oe=function(e){return r.createElement("svg",ae({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re||(re=r.createElement("path",{d:"M10.833 2.5a7.5 7.5 0 0 0-7.5 7.5h-2.5l3.242 3.242.058.116L7.5 10H5a5.829 5.829 0 0 1 5.833-5.833A5.83 5.83 0 0 1 16.667 10a5.83 5.83 0 0 1-5.834 5.833 5.786 5.786 0 0 1-4.116-1.716L5.533 15.3a7.462 7.462 0 0 0 5.3 2.2 7.5 7.5 0 0 0 0-15ZM10 6.667v4.166l3.567 2.117.6-1.008-2.917-1.734V6.667H10Z",fill:"#6678A7"})))},ce=function(e){return g.utc(e).format("MMM Do, yyyy")};function se(e){var n=e.scheduledUpdate,r=e.subscriptionPrices,a=e.billingPeriodRange,l=e.options,o=void 0===l?{}:l;if(!n)return{};var c=o.withDate,s=o.postfix,u=void 0===s?"":s;switch(n.subscriptionScheduleType){case t.SubscriptionScheduleType.Downgrade:var d,p=c;return m(p)&&null!=a&&a.end&&(p=!g(n.scheduledExecutionTime).isSame(null==a?void 0:a.end,"day")),{line1:i.createElement(i.Fragment,null,"Your subscription will be downgraded to the ",i.createElement("b",null,null==(d=n.targetPackage)?void 0:d.displayName," plan")," ",p?i.createElement(i.Fragment,null,"on ",ce(n.scheduledExecutionTime)):u),line2:"Until then you still have access to your current plan"};case t.SubscriptionScheduleType.BillingPeriod:var f;return{line1:i.createElement(i.Fragment,null,"Your billing cycle will change to ",i.createElement("b",null,null==(f=n.scheduleVariables.billingPeriod)?void 0:f.toLocaleLowerCase())," ",c?i.createElement(i.Fragment,null,"on ",ce(n.scheduledExecutionTime)):u)};case t.SubscriptionScheduleType.UnitAmount:var v=n.scheduleVariables,y=h.compact(h.map(r,"feature")).find((function(e){return e.id===v.featureId}))||{},b=y.featureUnits,x=1===v.newUnitAmount?b:y.featureUnitsPlural;return{line1:i.createElement(i.Fragment,null,"Your subscription will be updated to ",i.createElement("b",null,v.newUnitAmount)," ",x," ",c?i.createElement(i.Fragment,null,"on ",ce(n.scheduledExecutionTime)):u),line2:"Until then you still have access to your current "+b+" count"};default:return{}}}var ue,de=a(p,{target:"e199qof96"})({name:"1a2afmv",styles:"margin-left:10px"}),pe=a("button",{target:"e199qof95"})("cursor:",(function(e){return e.$disabled?"default":"pointer"}),";padding:8px 12px;background-color:inherit;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedRestingBorder}),";border-radius:4px;display:flex;align-items:center;justify-content:center;width:fit-content;height:43px;min-width:120px;",(function(e){return e.$disabled&&c.css(le||(le=D(["\n opacity: 0.5;\n "])))})," &:hover{background-color:",(function(e){return e.$disabled?"inherit":e.theme.stigg.palette.outlinedHoverBackground}),";}"),ge=a(s.ArrowRight,{target:"e199qof94"})("color:",(function(e){return e.theme.stigg.palette.primary}),";margin-left:6px;"),me=a(oe,{target:"e199qof93"})("margin-left:6px;color:",(function(e){return e.theme.stigg.palette.primary}),";path{fill:",(function(e){return e.theme.stigg.palette.primary}),";}"),he=a(V,{target:"e199qof92"})({name:"h05omw",styles:"margin:0;font-size:15px"}),fe=a(V,{target:"e199qof91"})({name:"pam8ra",styles:"margin:0;padding:16px 0"}),ve=a("div",{target:"e199qof90"})("display:flex;flex-direction:column;margin-top:auto;align-self:",(function(e){return ie(e.theme.stigg.layout.ctaAlignment)}),";");function ye(e){var n=e.isNextPlan,a=e.customer,l=e.plan,o=e.billingPeriod,s=e.isCustomerOnTrial,u=e.onPlanSelected,d=e.paywallLocale,p=c.useTheme(),g=r.useState(!1),m=g[0],f=g[1],v=d.planCTAButton,y=v.currentPlan,b=v.custom,x=v.downgrade,w=v.startTrial,E=v.upgrade,P=v.startNew,C=v.switchToBillingPeriod,S=v.cancelScheduledUpdate,U=h.isFunction(x)?x(l):x,k=h.isFunction(E)?E(l):E,M={title:a?l.isLowerThanCurrentPlan?U:k:P,disabled:!1,icon:i.createElement(ge,null),intentionType:l.isLowerThanCurrentPlan?exports.SubscribeIntentionType.DOWNGRADE_PLAN:s?exports.SubscribeIntentionType.UPGRADE_TRIAL_TO_PAID:exports.SubscribeIntentionType.UPGRADE_PLAN},N=l.pricingType===t.PricingType.Custom,T=se({scheduledUpdate:l.scheduledUpdate,options:{withDate:!0}}).line1;!l.isTriable||l.isCurrentCustomerPlan||s?l.isCurrentCustomerPlan&&!s?o===l.currentCustomerPlanBillingPeriod||l.pricingType&&[t.PricingType.Free,t.PricingType.Custom].includes(l.pricingType)?(M.title=y,M.disabled=!0,M.icon=null):(M.title=C(o),M.intentionType=exports.SubscribeIntentionType.CHANGE_BILLING_PERIOD):N&&(M.title=b,M.intentionType=exports.SubscribeIntentionType.REQUEST_CUSTOM_PLAN_ACCESS):(M.title=w(l),M.intentionType=exports.SubscribeIntentionType.START_TRIAL),n&&l.scheduledUpdate&&(M.disabled=!1,M.title=S,M.intentionType=exports.SubscribeIntentionType.CANCEL_SCHEDULED_UPDATES,M.icon=i.createElement(me,null));var B=m||M.disabled;return i.createElement(i.Fragment,null,n&&T&&i.createElement(V,{color:"secondary",variant:"body1",style:{marginBottom:24},className:"stigg-paywall-schedule-update-text"},T),i.createElement(ve,{className:"stigg-paywall-plan-button-layout"},l.isCurrentCustomerPlan&&l.trialDaysLeft&&i.createElement(fe,{className:"stigg-trial-days-left-text",variant:"h6",color:"secondary"},i.createElement("b",null,l.trialDaysLeft," days")," left on your free trial"),i.createElement(pe,{className:"stigg-paywall-plan-button","data-testid":"paywall-card-cta-"+l.displayName,disabled:B,$disabled:B,onClick:function(){f(!0),Promise.resolve(u(M.intentionType)).finally((function(){return f(!1)}))}},i.createElement(he,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main"},M.title),m?i.createElement(de,{color:p.stigg.palette.text.disabled,loading:!0,size:16}):M.icon)))}function be(){return(be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var xe=function(e){return r.createElement("svg",be({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ue||(ue=r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.954 1.034A1 1 0 0 1 6.3 2.287a5.666 5.666 0 1 0 7.367 5.406 1 1 0 0 1 2 0c0 .23-.01.458-.03.684.01.072.012.147.006.223l-.004.049a1 1 0 0 1-.078.312A7.668 7.668 0 1 1 5.7.38a1 1 0 0 1 1.254.654Zm.614.239A1 1 0 0 1 8.648.36l.05.004a1 1 0 1 1-.182 1.992l-.037-.003a1 1 0 0 1-.911-1.081Zm4.85 1.636a1 1 0 0 1 1.41.11l.064.076a1 1 0 1 1-1.537 1.28 4.154 4.154 0 0 0-.047-.056 1 1 0 0 1 .11-1.41ZM9 5.334a1 1 0 0 0-2 0V8a1 1 0 0 0 1 1h2.667a1 1 0 1 0 0-2H9V5.334Z",fill:"#7586B0"})))},we=a("div",{target:"eacdu8d11"})("position:relative;background-color:",(function(e){var t=e.theme;return e.$isCurrentPlan?t.stigg.palette.backgroundHighlight:t.stigg.palette.backgroundPaper}),";border:",(function(e){var t=e.theme;return e.$isHighlighted?"3px solid "+t.stigg.palette.primary:"1px solid "+t.stigg.palette.outlinedBorder}),";border-radius:10px;padding:",(function(e){return e.theme.stigg.layout.planPadding}),";display:flex;min-width:",(function(e){return e.theme.stigg.layout.planMinWidth}),";max-width:",(function(e){return e.theme.stigg.layout.planMaxWidth}),";flex-direction:column;align-items:flex-start;justify-content:flex-start;position:relative;"),Ee=a(V,{target:"eacdu8d10"})({name:"1u53ekv",styles:"padding-bottom:16px"}),Pe=a(V,{target:"eacdu8d9"})({name:"1sdjnkx",styles:"word-break:break-word"}),Ce=a(V,{target:"eacdu8d8"})({name:"1bmnxg7",styles:"white-space:nowrap"}),Se=a(V,{target:"eacdu8d7"})({name:"1hizjpa",styles:"white-space:normal"});function Ue(e){var n=function(e,n,r,i,a){switch(e.pricingType){case t.PricingType.Free:return"function"==typeof r.price.free?r.price.free(e.paywallCurrency):r.price.free;case t.PricingType.Custom:return{price:r.price.custom};case t.PricingType.Paid:var l,o=e.pricePoints.filter((function(e){return e.billingPeriod===n})),c=null==(l=e.paywallCalculatedPricePoints)?void 0:l.find((function(e){return e.billingPeriod===n}));if(!(null!=o&&o.length||c))return{price:r.price.priceNotSet};var s={planPrices:o,paywallCalculatedPrice:c,selectedBillingPeriod:n};return r.price.paid?r.price.paid(j({},s,{plan:e})):function(e){var n=e.planPrices,r=e.shouldShowMonthlyPriceAmount,i=e.paywallCalculatedPrice||n[0],a=i.amount,l=1===n.length,o=_({amount:e.selectedBillingPeriod===t.BillingPeriod.Annually&&r?a/12:a,currency:i.currency,locale:e.locale});if(l){var c,s=n[0];if(s.pricingModel===t.BillingModel.PerUnit){var u,d=(null==(u=s.feature)?void 0:u.units)||"";return{price:o,unit:r?"per "+d+" / month":"per "+d+" / year"}}if(s.pricingModel===t.BillingModel.UsageBased)return{price:o,unit:"/ "+((null==(c=s.feature)?void 0:c.units)||"")}}return{price:o,unit:r?"/ month":"/ year"}}(j({},s,{locale:i,shouldShowMonthlyPriceAmount:a}));default:return{price:""}}}(e.plan,e.billingPeriod,e.paywallLocale,e.locale,e.shouldShowMonthlyPriceAmount),r=n.unit;return i.createElement(Pe,{className:"stigg-price-text"},i.createElement(i.Fragment,null,i.createElement(Se,{span:!0,variant:"h1"},n.price),r&&i.createElement(Ce,{span:!0,variant:"h6"}," ",r)))}function ke(e){var t=e.billingPeriod,n=e.hasMonthlyPrice,r=e.hasAnnuallyPrice,a="";return e.plan.pricePoints.find((function(e){return e.billingPeriod===t}))&&n&&r&&(a="billed "+t.toLowerCase()),i.createElement(V,{className:"stigg-price-billing-period-text",variant:"body1",color:"disabled"},a)}var Me=a("div",{target:"eacdu8d6"})("margin-top:",(function(e){return e.$withMargin?"30px":"0"}),";height:2px;width:50px;background-color:",(function(e){return e.theme.stigg.palette.primary}),";"),Ne=a(V,{target:"eacdu8d5"})("text-align:",(function(e){return e.theme.stigg.layout.descriptionAlignment}),";min-height:",(function(e){return e.theme.stigg.layout.descriptionMinHeight}),";margin-top:16px;"),Te=a("div",{target:"eacdu8d4"})("background-color:",(function(e){return e.theme.stigg.palette.primary}),";border-radius:40px;position:absolute;top:-12px;"),Be=a(V,{target:"eacdu8d3"})({name:"a8c38r",styles:"margin:0;padding:2px 8px"}),Le=a("div",{target:"eacdu8d2"})("width:100%;display:flex;flex-direction:column;align-items:",(function(e){return ie(e.theme.stigg.layout.headerAlignment)}),";"),Ae=a("div",{target:"eacdu8d1"})("position:absolute;top:0;background-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";border-radius:0px 0px 10px 10px;padding:3px 12px;"),Fe=a(xe,{target:"eacdu8d0"})("display:flex;height:100%;margin-right:4;path{fill:",(function(e){return e.theme.stigg.palette.text.primary}),";}");function Oe(e){var t=e.text,n=void 0===t?"Next":t;return i.createElement(Ae,null,i.createElement(v.Grid,{display:"flex",alignItems:"center",gap:1},i.createElement(Fe,{$iconsColor:e.iconsColor}),i.createElement(V,{color:"primary",variant:"body1"},n)))}function je(e){var t,n=e.customer,r=e.plan,a=e.billingPeriod,l=e.isHighlighted,o=e.currentSubscription,c=e.shouldShowDescriptionSection,s=e.hasMonthlyPrice,u=e.hasAnnuallyPrice,d=e.isCustomerOnTrial,p=e.onPlanSelected,g=e.paywallLocale,m=e.locale,h=e.withStartingAtRow,v=r.isNextPlan&&r.isNextPlan(a),y=r.pricePoints.filter((function(e){return e.billingPeriod===a})),b=null==(t=r.paywallCalculatedPricePoints)?void 0:t.find((function(e){return e.billingPeriod===a})),x=y.length>1&&!(null==b||!b.additionalChargesMayApply),w=null;return v?w=i.createElement(Oe,{text:"Next plan"}):l&&g.highlightChip&&(w=i.createElement(Te,{className:"stigg-highlight-badge"},i.createElement(Be,{className:"stigg-highlight-badge-text",color:"white",bold:!0},g.highlightChip))),i.createElement(we,{className:f("stigg-plan-offering-container",{"stigg-current-plan":r.isCurrentCustomerPlan}),$isHighlighted:l,$isCurrentPlan:r.isCurrentCustomerPlan},w,i.createElement(Le,{className:"stigg-header-wrapper"},i.createElement(Ee,{className:"stigg-plan-header",variant:"h3"},r.displayName),h&&i.createElement(V,{className:"stigg-starting-at-text",variant:"body1",color:"secondary"},x?g.price.startingAtCaption:""),i.createElement(Ue,{plan:r,billingPeriod:a,paywallLocale:g,locale:m,shouldShowMonthlyPriceAmount:s}),i.createElement(ke,{plan:r,billingPeriod:a,hasAnnuallyPrice:u,hasMonthlyPrice:s}),c&&i.createElement(Ne,{className:"stigg-plan-description",variant:"h6",color:"secondary"},r.description),i.createElement(Me,{className:"stigg-plan-header-divider",$withMargin:!c})),i.createElement(ne,{plan:r,paywallLocale:g}),i.createElement(ye,{isNextPlan:v,customer:n,plan:r,currentSubscription:o,billingPeriod:a,isCustomerOnTrial:d,onPlanSelected:p,paywallLocale:g}))}var Ie,De=a("div",{target:"esqa6i42"})("height:40px;padding:0 20px;margin-bottom:",(function(e){return e.theme.stigg.layout.switchBottomSpacing}),";border-radius:10px;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";background-color:",(function(e){return e.theme.stigg.palette.backgroundPaper}),";display:flex;align-items:center;justify-content:center;"),Re=a(V,{target:"esqa6i41"})({name:"zvmrfm",styles:"margin:0 8px"}),_e=a(y,{target:"esqa6i40"})("& .react-switch-bg{border:",(function(e){return"1px solid "+e.theme.stigg.palette.switchBorder}),";background:",(function(e){return e.theme.stigg.palette.switchFill}),"!important;}& .react-switch-handle{box-shadow:",(function(e){return e.theme.stigg.shadows.light}),";background:",(function(e){return e.theme.stigg.palette.switchHandle}),"!important;top:0.5px!important;}");function We(e){return i.createElement(V,{variant:"h6",color:e.disabled?"disabled":"primary",className:"stigg-discount-rate-text"},e.discount,"% off")}function He(e){var n=e.discountRate,r=e.onBillingPeriodChanged;if(e.availableBillingPeriods.length<=1)return null;var a=e.selectedBillingPeriod===t.BillingPeriod.Monthly;return i.createElement(De,{className:"stigg-period-picker-container"},i.createElement(Re,{variant:"h6",className:"stigg-monthly-period-text",color:a?"primary":"disabled"},"Monthly"),i.createElement(_e,{className:"stigg-period-switch",uncheckedIcon:!1,checkedIcon:!1,height:16,width:33,onChange:function(e){return r(e?t.BillingPeriod.Annually:t.BillingPeriod.Monthly)},checked:!a,borderRadius:10,handleDiameter:19}),i.createElement(Re,{variant:"h6",className:"stigg-annual-period-text",color:a?"disabled":"primary"},"Annual"),i.createElement(We,{discount:n,disabled:a}))}function Ze(){return(Ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var $e=a((function(e){return r.createElement("svg",Ze({width:135,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Ie||(Ie=r.createElement("path",{d:"M.099 3.43v9.558h1.057V9.527h2.81c1.983 0 3.323-1.275 3.323-3.049 0-1.773-1.34-3.048-3.324-3.048H.1Zm1.057 5.127v-4.15h2.889c1.289 0 2.143.855 2.143 2.071 0 1.217-.854 2.079-2.143 2.079h-2.89ZM11.779 13.162c2.129 0 3.873-1.622 3.873-3.78 0-2.165-1.715-3.758-3.844-3.758-2.158 0-3.874 1.622-3.874 3.787 0 2.158 1.687 3.75 3.845 3.75Zm.014-.934c-1.556 0-2.773-1.202-2.773-2.832 0-1.629 1.216-2.83 2.773-2.83 1.528 0 2.773 1.201 2.773 2.83 0 1.63-1.245 2.832-2.773 2.832ZM19.905 12.988l1.572-6.046h.029l1.556 6.046h1.34l2.194-7.183h-1.18l-1.622 6.104h-.03l-1.549-6.104h-1.433l-1.55 6.104h-.029l-1.65-6.104h-1.195l2.208 7.183h1.34ZM34.983 9.425c0-2.121-1.578-3.8-3.83-3.8-2.1 0-3.845 1.556-3.845 3.786 0 2.143 1.6 3.75 3.874 3.75 1.586 0 2.875-.767 3.497-1.969l-.897-.485c-.413.898-1.412 1.528-2.585 1.528-1.673 0-2.694-1.246-2.795-2.513h6.567c.014-.13.014-.18.014-.297ZM31.14 6.551c1.404 0 2.527.948 2.715 2.259h-5.423a2.745 2.745 0 0 1 2.708-2.26ZM39.592 5.682c-1.028 0-1.774.521-2.1 1.253l-.101-1.13h-.905v7.183h1.057V8.564c0-1.115.615-1.789 1.774-1.789h.68V5.682h-.405ZM48.249 9.425c0-2.121-1.579-3.8-3.83-3.8-2.1 0-3.845 1.556-3.845 3.786 0 2.143 1.6 3.75 3.873 3.75 1.586 0 2.875-.767 3.497-1.969l-.897-.485c-.413.898-1.412 1.528-2.585 1.528-1.673 0-2.694-1.246-2.795-2.513h6.567c.015-.13.015-.18.015-.297Zm-3.845-2.874c1.404 0 2.527.948 2.715 2.259h-5.423a2.745 2.745 0 0 1 2.708-2.26ZM55.846 7.029c-.63-.89-1.644-1.398-2.831-1.398-2.093 0-3.773 1.586-3.773 3.765 0 2.18 1.651 3.766 3.744 3.766 1.195 0 2.23-.522 2.867-1.42l.145 1.246h.905V2.56l-1.057.116V7.03Zm-2.817 5.199c-1.498 0-2.7-1.188-2.7-2.832 0-1.643 1.202-2.83 2.7-2.83a2.787 2.787 0 0 1 2.817 2.83 2.787 2.787 0 0 1-2.817 2.832ZM65.731 5.631c-1.194 0-2.222.514-2.86 1.412V2.561l-1.057.116v10.31h.905l.145-1.237c.63.898 1.644 1.412 2.838 1.412 2.093 0 3.773-1.586 3.773-3.766 0-2.179-1.651-3.765-3.744-3.765Zm-.043 6.597a2.787 2.787 0 0 1-2.817-2.832 2.787 2.787 0 0 1 2.817-2.83c1.499 0 2.7 1.187 2.7 2.83 0 1.644-1.201 2.832-2.7 2.832ZM76.219 5.805v4.113c0 1.412-.905 2.266-2.172 2.266-1.26 0-1.97-.738-1.97-2.07V5.804H71.02v4.468c0 1.694 1.115 2.824 2.744 2.824 1.079 0 1.926-.42 2.455-1.116v.913c0 1.267-.956 2.186-2.346 2.186-1.123 0-2.05-.6-2.288-1.65l-.927.477C71.1 15.16 72.308 16 73.858 16c1.955 0 3.418-1.405 3.418-3.208V5.805h-1.057ZM108.672 10.487c0 1.42-1.261 2.3-3.181 2.3-1.027 0-1.857-.184-2.651-.578.074-.449.142-.99.16-1.618.738.43 1.575.64 2.381.64.959 0 1.458-.221 1.458-.689.018-.461-.339-.67-1.772-.947-1.661-.332-2.399-1.021-2.399-2.24 0-1.377 1.261-2.27 3.18-2.27.849 0 1.692.16 2.338.437l-.32 1.544a4.803 4.803 0 0 0-2.018-.43c-.898 0-1.341.221-1.341.658 0 .381.308.541 1.71.83 1.79.382 2.461 1.07 2.461 2.35l-.006.013Zm4.207.609c-.719 0-1.298-.382-1.298-1.39V6.887h1.827l.339-1.63h-2.166v-2.32a9.976 9.976 0 0 1-1.9.345l-.019 6.748c0 1.84 1.101 2.769 2.75 2.769.375 0 .701-.037.978-.105l.363-1.729c-.228.08-.517.136-.874.136v-.006Zm2.086 1.593h1.919V5.258h-1.919v7.43Zm.965-10.47c-.621-.006-1.101.45-1.107 1.052 0 .621.455 1.089 1.071 1.095.621 0 1.082-.437 1.095-1.04.012-.62-.443-1.095-1.052-1.107h-.007Zm10.126 3.039v6.268c0 2.369-1.6 3.999-4.3 3.999-.972 0-2.042-.216-2.762-.628.498-.51.837-.953 1.052-1.273.486.166.996.252 1.519.252 1.71 0 2.578-.947 2.578-2.14v-.24c-.609.7-1.489 1.138-2.541 1.138-2.018 0-3.537-1.501-3.537-3.728 0-2.227 1.661-3.808 3.691-3.808 1.052 0 1.968.381 2.577 1.101l.062-.947h1.667l-.006.006Zm-1.901 3.648c0-1.181-.861-2.08-2.048-2.08-1.188 0-2.061.899-2.061 2.08 0 1.18.861 2.048 2.061 2.048 1.199 0 2.048-.898 2.048-2.048Zm10.839-3.648v6.268c0 2.369-1.6 3.999-4.3 3.999-.972 0-2.042-.216-2.762-.628.498-.51.837-.953 1.052-1.273.486.166.996.252 1.519.252 1.71 0 2.578-.947 2.578-2.14v-.24c-.609.7-1.489 1.138-2.541 1.138-2.017 0-3.537-1.501-3.537-3.728 0-2.227 1.661-3.808 3.691-3.808 1.052 0 1.968.381 2.577 1.101l.062-.947H135l-.006.006Zm-1.901 3.648c0-1.181-.861-2.08-2.048-2.08-1.188 0-2.061.899-2.061 2.08 0 1.18.861 2.048 2.061 2.048 1.199 0 2.048-.898 2.048-2.048ZM95.71 14.982c-.075.037-1.483.659-3.975.542A14.827 14.827 0 0 1 88.512 15l4.312-5.007c.77.197 1.76.381 2.885.436 2.492.123 3.9-.504 3.974-.541l-3.974 5.1v-.007Zm-6.441-9.62c-.708-2.393-.431-3.907-.413-3.987l-4.01 5.07c-.013.08-.29 1.592.412 3.985a14.98 14.98 0 0 0 1.273 3.008l3.845-5.37a15.042 15.042 0 0 1-1.107-2.7v-.006Zm9.996.529a14.561 14.561 0 0 0-1.815-3.882l-3.568 4.546.67 3.217c.4.056.794.092 1.194.117.203.006.406.012.603.012 1.931 0 3.008-.455 3.125-.51l.277-.123c.024-.665-.019-1.84-.48-3.384l-.006.007Zm-2.24-4.208A14.43 14.43 0 0 0 92.83.834c-1.605-.08-2.756.154-3.395.338l-.056.296c-.012.061-.258 1.494.4 3.74.11.381.246.756.394 1.132l3.285-.111 3.574-4.54-.006-.006Z",fill:"#001E6C"})))}),{target:"ee5i8qp1"})("*{fill:",(function(e){return e.theme.stigg.palette.text.secondary}),";}"),qe=a("div",{target:"ee5i8qp0"})("align-self:",(function(e){return e.$alignSelf||"unset"}),";@media (max-width: 1040px){align-self:center;}");function Ge(e){var t=e.source,n=e.style;return e.showWatermark?i.createElement(qe,{$alignSelf:e.align,className:"stigg-watermark",style:j({cursor:"pointer"},void 0===n?{}:n),onClick:function(){var e=window.location.hostname.replace("www.","");window.open("https://www.stigg.io/?utm_source="+e+"&utm_medium=referral&utm_campaign="+t,"_blank")}},i.createElement($e,null)):null}function ze(e,t){return e.some((function(e){return Ve(e,t)}))}function Ve(e,t){return e.pricePoints.some((function(e){return e.billingPeriod===t}))}var Ye,Qe=a("div",{target:"e19kubi82"})("color:",(function(e){return e.theme.stigg.palette.text.primary}),";display:flex;align-items:stretch;justify-content:center;flex-wrap:wrap;padding:10px 0;gap:",(function(e){return e.theme.stigg.layout.planMargin}),";"),Ke=a("div",{target:"e19kubi81"})({name:"1rdsyw8",styles:"display:flex;flex-direction:column;align-items:center;& *{box-sizing:border-box;}"}),Xe=a("div",{target:"e19kubi80"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),Je=function(e){var n=e.plans,a=e.customer,l=e.currentSubscription,o=e.highlightedPlanId,c=e.selectedBillingPeriod,s=e.onBillingPeriodChanged,u=e.availableBillingPeriods,d=e.isCustomerOnTrial,p=e.onPlanSelected,g=e.paywallLocale,h=e.locale,f=rt().stigg,v=function(e){return e.reduce((function(e,n){var r,i,a,l,o,c,s,u,d;null!=(r=n.paywallCalculatedPricePoints)&&r.length?(i=null==(l=n.paywallCalculatedPricePoints)||null==(o=l.find((function(e){return e.billingPeriod===t.BillingPeriod.Monthly})))?void 0:o.amount,a=null==(c=n.paywallCalculatedPricePoints)||null==(s=c.find((function(e){return e.billingPeriod===t.BillingPeriod.Annually})))?void 0:s.amount):(i=null==(u=n.pricePoints.find((function(e){return e.billingPeriod===t.BillingPeriod.Monthly})))?void 0:u.amount,a=null==(d=n.pricePoints.find((function(e){return e.billingPeriod===t.BillingPeriod.Annually})))?void 0:d.amount);var p,g,h=(g=a,m(p=i)||m(g)?null:Math.round((p-g/12)/p*100));return h&&(e=Math.max(e,h)),e}),0)}(n),y=n.some((function(e){return!!e.description})),b=ze(n,t.BillingPeriod.Monthly),x=ze(n,t.BillingPeriod.Annually),w=function(e,n){return e.filter((function(e){return e.pricingType!==t.PricingType.Paid||Ve(e,n)}))}(n,c),E=r.useCallback((function(e,t){return p({plan:e,customer:a,subscription:l,intentionType:t,selectedBillingPeriod:c})}),[a,c]),P=w.some((function(e){var t,n=e.pricePoints.filter((function(e){return e.billingPeriod===c})),r=null==(t=e.paywallCalculatedPricePoints)?void 0:t.find((function(e){return e.billingPeriod===c}));return n.length>1&&!(null==r||!r.additionalChargesMayApply)}));return i.createElement(Ke,{className:"stigg-paywall-container"},i.createElement(Xe,{className:"stigg-paywall-layout"},i.createElement(He,{onBillingPeriodChanged:s,selectedBillingPeriod:c,availableBillingPeriods:u,discountRate:v}),i.createElement(Qe,{className:"stigg-paywall-plans-layout"},w.map((function(e){return i.createElement(je,{key:e.id,shouldShowDescriptionSection:y,hasMonthlyPrice:b,hasAnnuallyPrice:x,plan:e,withStartingAtRow:P,currentSubscription:l,billingPeriod:c,isHighlighted:e.id===o,isCustomerOnTrial:d,onPlanSelected:function(t){return E(e,t)},paywallLocale:g,locale:h,customer:a})}))),i.createElement(Ge,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:f.isWidgetWatermarkEnabled})))},et=(function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=Object.create((t&&t.prototype instanceof d?t:d).prototype),a=new P(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return{value:void 0,done:!0}}for(n.method=i,n.arg=a;;){var l=n.delegate;if(l){var o=x(l,n);if(o){if(o===u)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function d(){}function p(){}function g(){}var m={};o(m,i,(function(){return this}));var h=Object.getPrototypeOf,f=h&&h(h(C([])));f&&f!==t&&n.call(f,i)&&(m=f);var v=g.prototype=d.prototype=Object.create(m);function y(e){["next","throw","return"].forEach((function(t){o(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(i,a){function l(){return new t((function(r,l){!function r(i,a,l,o){var c=s(e[i],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,l,o)}),(function(e){r("throw",e,l,o)})):t.resolve(d).then((function(e){u.value=e,l(u)}),(function(e){return r("throw",e,l,o)}))}o(c.arg)}(i,a,r,l)}))}return r=r?r.then(l,l):l()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function C(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=g,o(v,"constructor",g),o(g,"constructor",p),p.displayName=o(g,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,o(e,l,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},y(b.prototype),o(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var l=new b(c(t,n,r,i),a);return e.isGeneratorFunction(n)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},y(v),o(v,l,"Generator"),o(v,i,(function(){return this})),o(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=C,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return l.type="throw",l.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var o=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(o&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(o){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var l=a?a.completion:{};return l.type=e,l.arg=t,a?(this.method="next",this.next=a.finallyLoc,u):this.complete(l)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(Ye={exports:{}}),Ye.exports),tt=new(function(){function e(){}var t=e.prototype;return t.error=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];console.error(e,t||{},r)},t.log=function(e,t){console.log(e,t||{})},t.debug=function(e,t){console.debug(e,t||{})},e}()),nt=i.createContext(null);nt.displayName="StiggContext";var rt=function(){var e=r.useContext(nt);if(!e)throw new Error("Could not find Stigg context; You need to wrap your app in an <StiggProvider> component.");return e};function it(e,n){var r=e.flatMap((function(e){return e.pricePoints})).map((function(e){return e.billingPeriod})),i=h.countBy(r),a=h.uniq(r);return{defaultBillingPeriod:n&&a.includes(n)?n:(i[t.BillingPeriod.Monthly]||0)>(i[t.BillingPeriod.Annually]||0)?t.BillingPeriod.Monthly:t.BillingPeriod.Annually,availableBillingPeriods:a}}function at(e,t){if(void 0===t&&(t="px"),e)return""+e+t}function lt(e,n){if(!n)return e;switch(n){case t.FontWeight.Normal:return"normal";case t.FontWeight.Bold:return"bold";default:return"normal"}}function ot(e){var t,n,r,i,a,l,o,c,s=e.typography;return{fontFamilyUrl:(null==s?void 0:s.fontFamily)||void 0,h1:{fontSize:at(null==s||null==(t=s.h1)?void 0:t.fontSize),fontWeight:lt("bold",null==s||null==(n=s.h1)?void 0:n.fontWeight)},h2:{fontSize:at(null==s||null==(r=s.h2)?void 0:r.fontSize),fontWeight:lt("normal",null==s||null==(i=s.h2)?void 0:i.fontWeight)},h3:{fontSize:at(null==s||null==(a=s.h3)?void 0:a.fontSize),fontWeight:lt("normal",null==s||null==(l=s.h3)?void 0:l.fontWeight)},body:{fontSize:at(null==s||null==(o=s.body)?void 0:o.fontSize),fontWeight:lt("normal",null==s||null==(c=s.body)?void 0:c.fontWeight)}}}function ct(e){if(e)switch(e){case t.Alignment.Left:return"left";case t.Alignment.Center:return"center";case t.Alignment.Right:return"right"}}var st,ut=a("div",{target:"e1f7khji6"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),dt=a(H,{target:"e1f7khji5"})({name:"o7nnmj",styles:"margin-right:16px"}),pt=a("div",{target:"e1f7khji4"})("display:flex;flex-direction:column;align-items:flex-start;gap:20px;border-radius:10px;padding:",(function(e){return e.theme.stigg.layout.planPadding}),";background-color:",(function(e){return e.theme.stigg.palette.backgroundPaper}),";min-width:",(function(e){return e.theme.stigg.layout.planMinWidth}),";max-width:",(function(e){return e.theme.stigg.layout.planMaxWidth}),";min-height:450px;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";"),gt=a("div",{target:"e1f7khji3"})("display:flex;gap:",(function(e){return e.theme.stigg.layout.planMargin}),";flex-wrap:wrap;justify-content:center;"),mt=a("div",{target:"e1f7khji2"})({name:"k8xojc",styles:"display:flex;align-items:center;margin-bottom:12px"}),ht=a("div",{target:"e1f7khji1"})({name:"xdvdnl",styles:"margin-top:auto"}),ft=a("div",{target:"e1f7khji0"})("width:150px;margin-bottom:",(function(e){return e.theme.stigg.layout.switchBottomSpacing}),";padding:12px 12px;border-radius:10px;background-color:white;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";");function vt(){return i.createElement(pt,null,i.createElement(x,{width:120,borderRadius:4}),i.createElement(x,{circle:!0,width:40,height:40}),i.createElement(x,{style:{marginBottom:33},width:120,borderRadius:4}),i.createElement(mt,null,i.createElement(dt,null),i.createElement(x,{width:120,borderRadius:4})),i.createElement(mt,null,i.createElement(dt,null),i.createElement(x,{width:120,borderRadius:4})),i.createElement(mt,null,i.createElement(dt,null),i.createElement(x,{width:120,borderRadius:4})),i.createElement(ht,null,i.createElement(x,{height:50,borderRadius:4})))}function yt(){return i.createElement(ut,{className:"stigg-skeleton-loader-container"},i.createElement(ft,{className:"stigg-skeleton-loader-billing-period"},i.createElement(x,{borderRadius:4})),i.createElement(gt,{className:"stigg-skeleton-loader-plans-container"},i.createElement(vt,null),i.createElement(vt,null),i.createElement(vt,null)))}var bt,xt=function(e){var t=e.externalFontUrl;return i.createElement(c.Global,{styles:c.css(st||(st=D(["\n ","\n\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZ2IHTWEBlwu8Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZOIHTWEBlw.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriAWCrCBamC3YU-CnE6Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriAWCrCBimC3YU-Ck.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriASitCBamC3YU-CnE6Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriASitCBimC3YU-Ck.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n "])),t&&"\n @font-face {\n font-family: 'custom-font';\n font-style: normal;\n font-weight: normal;\n src: local('custom-font'), url("+t+") format('woff');\n }\n ")})},wt=a("div",{target:"emcdfp60"})((function(e){var t=e.customCss;return t&&c.css(bt||(bt=D(["\n ","\n "])),t)}),";");function Et(e){var t,n,r,i,a,l,o,c=rt(),s=h.merge(e,c.theme);return a=u((null==(t=s)||null==(n=t.palette)?void 0:n.primary)||"#327EEE"),l=u((null==t||null==(r=t.palette)||null==(i=r.text)?void 0:i.primary)||"#001E6C"),o={palette:{primary:a.hex(),backgroundPaper:"#FFFFFF",backgroundHighlight:"#F5F6F9",backgroundSection:a.alpha(.1).toString(),outlinedBorder:"#C4CBDD",outlinedRestingBorder:a.alpha(.5).toString(),outlinedHoverBackground:a.lightness(95).hex(),switchBorder:a.lighten(.1).hex(),switchFill:a.lighten(.5).hex(),switchHandle:a.hex(),warning:"#ed6c02",error:"#f44336",white:"#FFFFFF",text:{primary:l.hex(),secondary:l.alpha(.75).toString(),disabled:l.alpha(.5).toString()}},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"},h2:{fontSize:"24px",fontWeight:"normal"},h3:{fontSize:"16px",fontWeight:"normal"},body:{fontSize:"14px",fontWeight:"normal"},caption:{fontSize:"12px",fontWeight:"normal"}},customCss:""},d(o,t)}function Pt(e){var t=e.typography,n=Number(t.body.fontSize.replace("px",""))/14;return{pxToRem:function(e){return e/16*n+"rem"},bodyFontFamily:t.fontFamily,headingFontFamily:t.fontFamily,fontSizes:[t.h1.fontSize,t.h2.fontSize,t.h3.fontSize,t.body.fontSize,"12px","10px"]}}var Ct=function(e){var t=e.children,n=Et(e.componentTheme);return i.createElement(E.ThemeProvider,{theme:E.createTheme({stigg:n})},i.createElement(c.ThemeProvider,{theme:{stigg:n}},i.createElement(wt,{customCss:n.customCss},i.createElement(xt,{externalFontUrl:n.typography.fontFamilyUrl}),i.createElement(P.ThemeProvider,{theme:{typography:Pt(n)}},t))))},St=i.createContext(null);St.displayName="CustomerPortalContext";var Ut=function(){var e=r.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 kt(e){var t,n,a,l,o,c,s,u=e.children,p=e.textOverrides,g=e.theme,m=e.resourceId,h=e.productId,f=rt().customerPortalUpdatedAt,v=function(e){var t=e.resourceId,n=e.productId,i=rt(),a=i.stigg,l=i.customerPortalUpdatedAt,o=r.useState(!1),c=o[0],s=o[1],u=r.useState(),d=u[0],p=u[1];return r.useEffect((function(){!function(){var e=O(et.mark((function e(){return et.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.isCustomerLoaded){e.next=15;break}return e.prev=1,s(!0),e.next=5,a.getCustomerPortal({resourceId:t,productId:n});case 5:p(e.sent),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),tt.error("Failed to load customer portal "+(null==e.t0?void 0:e.t0.message),e.t0);case 12:return e.prev=12,s(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[1,9,12,15]])})));return function(){return e.apply(this,arguments)}}()()}),[a,a.isCustomerLoaded,l,t]),{customerPortal:d,isLoading:c}}({resourceId:m,productId:h}),y=v.customerPortal,b=v.isLoading,x=null!=y&&y.configuration?function(e){var t=e.palette;return{palette:{primary:(null==t?void 0:t.primary)||void 0,backgroundPaper:(null==t?void 0:t.paywallBackgroundColor)||void 0,outlinedBorder:(null==t?void 0:t.borderColor)||void 0,backgroundHighlight:(null==t?void 0:t.currentPlanBackground)||void 0,text:{primary:(null==t?void 0:t.textColor)||void 0}},typography:ot(e)}}(y.configuration):void 0,w=(t=Et(x),a=null==y?void 0:y.configuration,{sectionTitleColor:(null==(n=g)?void 0:n.sectionTitleColor)||t.palette.text.secondary,planNameColor:(null==n?void 0:n.planNameColor)||t.palette.text.primary,backgroundColor:(null==n?void 0:n.backgroundColor)||(null==a||null==(l=a.palette)?void 0:l.backgroundColor)||"white",borderColor:(null==n?void 0:n.borderColor)||(null==a||null==(o=a.palette)?void 0:o.borderColor)||"rgba(0, 30, 108, 0.15)",listItemBackgroundColor:(null==n?void 0:n.backgroundColor)||(null==a||null==(c=a.palette)?void 0:c.backgroundColor)||"white",tabMaxHeight:(null==n?void 0:n.tabMaxHeight)||"380px",iconsColor:(null==n?void 0:n.iconsColor)||(null==a||null==(s=a.palette)?void 0:s.iconsColor)||void 0,iconsBackgroundColor:null==n?void 0:n.iconsBackgroundColor}),E=d({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 update"},p);return i.createElement(Ct,{componentTheme:x},i.createElement(St.Provider,{key:null==f?void 0:f.toString(),value:{customerPortal:y,isLoading:b,textOverrides:E,theme:w,resourceId:m}},u))}var Mt,Nt=a(S,{target:"emvioms0"})("border-radius:10px;padding:8px 16px;text-transform:none;&,&:hover{border-color:",(function(e){return e.theme.stigg.palette.outlinedRestingBorder}),";}");function Tt(){return(Tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Bt=function(e){return r.createElement("svg",Tt({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Mt||(Mt=r.createElement("path",{clipRule:"evenodd",d:"M13.333 2.5 17.5 6.667 6.667 17.5H2.5v-4.167L13.333 2.5v0Z",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},Lt=a("div",{target:"ewz8krb0"})("display:flex;align-items:center;justify-content:space-between;",(function(e){return!e.$disableMargin&&"\n &:not(:last-child) {\n margin-bottom: 32px;\n }\n "}),";");function At(e){var t=e.title,n=e.className,r=e.isLoading,a=Ut().theme;return r?i.createElement(x,{width:120}):i.createElement(V,{className:n,overrideColor:a.sectionTitleColor,variant:"h3",bold:!0},t)}var Ft=a(Bt,{target:"e1fjw26b0"})("path{stroke:",(function(e){return e.theme.stigg.palette.primary}),";}");function Ot(e){var t=e.onManageSubscription,n=e.hideManageButton,r=e.textOverrides;return i.createElement(Lt,{className:"stigg-customer-portal-overview-header",$disableMargin:!0},i.createElement(At,{title:"Subscription",className:"stigg-overview-title"}),!n&&i.createElement(Nt,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:t},i.createElement(Ft,{className:"stigg-manage-subscription-button-image"}),i.createElement(V,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1"},null==r?void 0:r.manageSubscription)))}function jt(){var e=Ut().customerPortal,t=U(null==e?void 0:e.subscriptions,(function(e){return e.addons}));return N(t)?null:i.createElement("div",{className:"stigg-addons-list-layout"},t.map((function(e,n){return i.createElement(V,{key:e.addonId,span:!0,className:"stigg-addon-list-item-text",variant:"body1"},e.quantity>1&&e.quantity+" X ",e.displayName,n===t.length-1?"":", ")})))}var It=a("div",{target:"e1g6q2f50"})("display:flex;justify-content:space-between;align-items:center;gap:64px;border-bottom:",(function(e){return"1px solid "+e.$borderColor}),";padding:16px 0;&>*:first-child{max-width:60%;}");function Dt(){var e=Ut(),t=e.customerPortal,n=e.theme,r=null==t?void 0:t.promotionalEntitlements;return i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(V,{color:"secondary"},e.textOverrides.promotionsSubtitle),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(It,{$borderColor:n.borderColor},i.createElement(V,{variant:"body1",bold:!0},"Feature"),i.createElement(V,{variant:"body1",bold:!0},"Expiration date")),null==r?void 0:r.map((function(e){return i.createElement(It,{$borderColor:n.borderColor},i.createElement(V,{variant:"body1"},function(e){var t,n=e.displayName;return e.hasUnlimitedUsage?"Unlimited "+n:e.usageLimit?n+" x "+(null==(t=e.usageLimit)?void 0:t.toLocaleString()):n}(e)),i.createElement(V,{variant:"body1",color:"disabled"},e.endDate?g.utc(e.endDate).format("MMM Do, YYYY"):"None"))}))))}var Rt,_t,Wt,Ht,Zt,$t,qt,Gt,zt,Vt,Yt,Qt,Kt,Xt,Jt,en,tn,nn,rn,an,ln,on,cn,sn=a(T,{target:"exlfw3j3"})({name:"jlwfj4",styles:".MuiTabs-indicator{background-color:#001e6c;}"}),un=a("div",{target:"exlfw3j2"})({name:"1dqkbz0",styles:"width:100%;flex:1;margin-top:16px"}),dn=a(k,{target:"exlfw3j1"})("margin-top:16px;max-height:",(function(e){return e.$maxHeight}),";overflow-y:auto;");function pn(){return(pn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function gn(){return(gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function mn(){return(mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function hn(){return(hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function fn(){return(fn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function vn(){return(vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function yn(){return(yn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function bn(){return(bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function xn(){return(xn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var wn,En,Pn,Cn={RenewSubscription:function(e){return r.createElement("svg",pn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Rt||(Rt=r.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),_t||(_t=r.createElement("path",{clipRule:"evenodd",d:"M9 12a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H11a2 2 0 0 1-2-2V12Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Wt||(Wt=r.createElement("path",{d:"M22 8v4M14 8v4M9 16h18",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},BillingInfoCustomer:function(e){return r.createElement("svg",gn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Ht||(Ht=r.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Zt||(Zt=r.createElement("path",{d:"M26 27v-2a4 4 0 0 0-4-4h-8a4 4 0 0 0-4 4v2",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),$t||($t=r.createElement("path",{clipRule:"evenodd",d:"M18 17a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},CreditCard:function(e){return r.createElement("svg",mn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),qt||(qt=r.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Gt||(Gt=r.createElement("path",{d:"M26 10H10c-1.11 0-1.99.89-1.99 2L8 24c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V12c0-1.11-.89-2-2-2Zm0 14H10v-6h16v6Zm0-10H10v-2h16v2Z",fill:"#7586B0"})))},ScheduleBox:function(e){return r.createElement("svg",hn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),zt||(zt=r.createElement("rect",{width:36,height:36,rx:10,fill:"url(#schedule-box_svg__a)"})),Vt||(Vt=r.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Yt||(Yt=r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.954 7.7a1 1 0 0 1-.654 1.254 8.998 8.998 0 0 0-1.543 16.523A9 9 0 0 0 27 17.54a1 1 0 1 1 2 0c0 .357-.017.713-.052 1.066.018.089.024.182.017.278l-.004.047a.997.997 0 0 1-.101.361A11 11 0 1 1 14.7 7.046a1 1 0 0 1 1.254.654Zm1.896.252a1 1 0 0 1 1.08-.912l.048.004a1 1 0 1 1-.178 1.992l-.038-.003a1 1 0 0 1-.912-1.081ZM22.858 9.2a1 1 0 0 1 1.391-.254l.078.054a1 1 0 1 1-1.152 1.635 8.98 8.98 0 0 0-.063-.044 1 1 0 0 1-.254-1.391Zm3.748 3.609a1 1 0 0 1 1.332.473l.04.085a1 1 0 1 1-1.813.844l-.014-.031-.019-.039a1 1 0 0 1 .474-1.332ZM19 14a1 1 0 1 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 1 0 0-2h-3v-3Z",fill:"#7586B0"})),Qt||(Qt=r.createElement("defs",null,r.createElement("linearGradient",{id:"schedule-box_svg__a",x1:35.02,y1:1.224,x2:0,y2:36,gradientUnits:"userSpaceOnUse"}))))},ScheduleClock:function(e){return r.createElement("svg",fn({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Kt||(Kt=r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.954 1.7A1 1 0 0 1 9.3 2.954a8.998 8.998 0 0 0-5.615 12.03A9 9 0 0 0 21 11.54a1 1 0 1 1 2 0c0 .357-.017.713-.052 1.066.018.089.024.182.017.278l-.004.047a.997.997 0 0 1-.101.361A11 11 0 1 1 8.7 1.046a1 1 0 0 1 1.254.654Zm1.896.252a1 1 0 0 1 1.08-.912l.048.004a1 1 0 1 1-.178 1.992l-.039-.003a1 1 0 0 1-.911-1.081ZM16.858 3.2a1 1 0 0 1 1.391-.254l.078.054a1 1 0 1 1-1.152 1.635 9.7 9.7 0 0 0-.063-.044 1 1 0 0 1-.254-1.391Zm3.748 3.608a1 1 0 0 1 1.332.474l.04.085a1 1 0 1 1-1.813.844l-.014-.031-.019-.039a1 1 0 0 1 .474-1.333ZM13 8a1 1 0 1 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 1 0 0-2h-3V8Z",fill:"#7586B0"})))},Restore:oe,MiniSchedule:xe,DollarCoin:function(e){return r.createElement("svg",vn({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Xt||(Xt=r.createElement("g",{clipPath:"url(#dollar-coin_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M10.334 19.286A9.286 9.286 0 1 0 1.048 10a9.286 9.286 0 0 0 9.286 9.286Z"}),r.createElement("path",{d:"M12.765 7.46a1.903 1.903 0 0 0-1.796-1.27H9.494a1.7 1.7 0 0 0-.363 3.362l2.245.49a1.905 1.905 0 0 1-.407 3.768h-1.27c-.83 0-1.535-.53-1.797-1.27M10.334 6.19V4.287M10.334 15.714V13.81"}))),Jt||(Jt=r.createElement("defs",null,r.createElement("clipPath",{id:"dollar-coin_svg__a"},r.createElement("path",{fill:"#fff",transform:"translate(.333)",d:"M0 0h20v20H0z"})))))},Promotions:function(e){return r.createElement("svg",yn({width:24,height:25,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),en||(en=r.createElement("g",{clipPath:"url(#promotions_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M21.429 5.325H2.57c-.946 0-1.714.767-1.714 1.714v3.429c0 .947.768 1.714 1.714 1.714H21.43c.946 0 1.714-.768 1.714-1.714V7.039c0-.947-.768-1.714-1.714-1.714ZM21.429 12.182v9.429a1.714 1.714 0 0 1-1.715 1.714H4.286a1.714 1.714 0 0 1-1.714-1.714v-9.429M12 5.325v18M17.143 1.04 12 5.324 6.857 1.039"}))),tn||(tn=r.createElement("defs",null,r.createElement("clipPath",{id:"promotions_svg__a"},r.createElement("path",{fill:"#fff",transform:"translate(0 .182)",d:"M0 0h24v24H0z"})))))},Addons:function(e){return r.createElement("svg",bn({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),nn||(nn=r.createElement("g",{clipPath:"url(#addons_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M12 6.857v10.286M6.857 12h10.286M18 .857H6A5.143 5.143 0 0 0 .857 6v12A5.143 5.143 0 0 0 6 23.143h12A5.143 5.143 0 0 0 23.143 18V6A5.143 5.143 0 0 0 18 .857Z"}))),rn||(rn=r.createElement("defs",null,r.createElement("clipPath",{id:"addons_svg__a"},r.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))))},ContactSupport:function(e){return r.createElement("svg",xn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),an||(an=r.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),ln||(ln=r.createElement("path",{d:"M27 18.22C27 12.73 22.74 9 18 9c-4.69 0-9 3.65-9 9.28-.6.34-1 .98-1 1.72v2c0 1.1.9 2 2 2h1v-6.1c0-3.87 3.13-7 7-7s7 3.13 7 7V25h-8v2h8c1.1 0 2-.9 2-2v-1.22c.59-.31 1-.92 1-1.64v-2.3c0-.7-.41-1.31-1-1.62Z",fill:"#7586B0"})),on||(on=r.createElement("path",{d:"M15 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM21 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fill:"#7586B0"})),cn||(cn=r.createElement("path",{d:"M24 17.03A6.04 6.04 0 0 0 18.05 12c-3.03 0-6.29 2.51-6.03 6.45a8.075 8.075 0 0 0 4.86-5.89c1.31 2.63 4 4.44 7.12 4.47Z",fill:"#7586B0"})))}},Sn=function(e,t){switch(e){case"primary":return t.stigg.palette.text.primary;case"secondary":return t.stigg.palette.text.secondary;default:return e}},Un=a("div",{target:"e1ds7xyn0"})((function(e){var t=e.$pathColor;return t&&c.css(wn||(wn=D(["\n path {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$rectColor;return t&&c.css(En||(En=D(["\n svg rect {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$strokeColor;return t&&c.css(Pn||(Pn=D(["\n g {\n stroke: ",";\n }\n "])),t)}),";");function kn(e){var t=e.className,n=e.style,r=e.svgPathColor,a=e.svgRectColor,l=e.svgStrokeColor,o=Cn[e.icon],s=c.useTheme();return i.createElement(Un,{className:t,style:n,$pathColor:Sn(r,s),$rectColor:Sn(a,s),$strokeColor:Sn(l,s)},i.createElement(o,null))}var Mn=["children","value","index","maxHeight"];function Nn(e){var t=e.children,n=e.value,r=e.index,a=e.maxHeight,l=I(e,Mn);return i.createElement("div",Object.assign({role:"tabpanel",hidden:n!==r},l),n===r&&i.createElement(dn,{$maxHeight:a},t))}function Tn(e){var t=e.isSelected,n=e.label,r=t?"primary":"secondary";return i.createElement("div",{style:{display:"flex",gap:8,alignItems:"center"}},i.createElement(kn,{icon:e.icon,svgStrokeColor:r}),i.createElement(V,{variant:"h6",bold:t,fontWeight:o.FontWeight.Medium,color:r},n))}function Bn(e){var t=e.customerPortal,n=e.hiddenSections,a=e.textOverrides,l=e.theme,o=function(e){return null==n?void 0:n.some((function(t){return t===e}))},c=U(t.subscriptions,(function(e){return e.addons})).length>0&&!o("addons"),s=t.promotionalEntitlements.length>0&&!o("promotionalEntitlements"),u=r.useState(c?1:2),d=u[0],p=u[1];return c||s?i.createElement(un,null,i.createElement(k,{sx:{borderBottom:1,borderColor:"divider"}},i.createElement(sn,{value:d,onChange:function(e,t){p(t)}},c?i.createElement(M,{sx:{textTransform:"none"},value:1,label:i.createElement(Tn,{isSelected:1===d,label:a.addonsTabTitle,icon:"Addons"})}):null,s?i.createElement(M,{sx:{textTransform:"none"},value:2,label:i.createElement(Tn,{isSelected:2===d,label:a.promotionsTabTitle,icon:"Promotions"})}):null)),i.createElement(Nn,{value:d,index:1,maxHeight:l.tabMaxHeight},i.createElement(jt,null)),i.createElement(Nn,{value:d,index:2,maxHeight:l.tabMaxHeight},i.createElement(Dt,null))):null}var Ln=a("div",{target:"ejq3grd1"})({name:"1eoy87d",styles:"display:flex;justify-content:space-between"}),An=a("div",{target:"ejq3grd0"})({name:"43cxha",styles:"display:flex;flex-direction:column;gap:32px"});function Fn(){return i.createElement(Ln,{className:"stigg-subscription-overview-skeleton-layout"},i.createElement(An,null,i.createElement(x,{width:120}),i.createElement(x,{width:120})),i.createElement(x,{width:295,height:193}))}function On(e){var t=e.scheduleUpdate.targetPackage;return i.createElement(v.Grid,{container:!0,alignItems:"center"},i.createElement(v.Grid,null,i.createElement(s.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),i.createElement(v.Grid,{item:!0},i.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"Downgrade to the ",i.createElement("b",null,null==t?void 0:t.displayName)," plan")))}function jn(e){var n=e.scheduleUpdate.scheduleVariables.billingPeriod,r=n===t.BillingPeriod.Monthly?"annually":"monthly",a=n===t.BillingPeriod.Monthly?"monthly":"annually";return i.createElement(v.Grid,{container:!0,alignItems:"center"},i.createElement(v.Grid,null,i.createElement(s.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),i.createElement(v.Grid,{item:!0},i.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"Change from an ",r," to a ",i.createElement("b",null,a)," billing cycle")))}function In(e){var t=e.scheduleUpdate.scheduleVariables,n=t.newUnitAmount,r=t.featureId,a=h.compact(h.map(e.subscription.prices,"feature")).find((function(e){return e.id===r}));if(!a)return null;var l=a.featureUnits,o=1===n?l:a.featureUnitsPlural;return i.createElement(v.Grid,{container:!0,alignItems:"flex-start",flexWrap:"nowrap"},i.createElement(v.Grid,null,i.createElement(s.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),i.createElement(v.Grid,{item:!0},i.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"Reduce the ",i.createElement("b",null,l)," quantity to ",n," ",o)))}function Dn(e){var n=e.scheduleUpdate,r=e.subscription;switch(n.subscriptionScheduleType){case t.SubscriptionScheduleType.Downgrade:return i.createElement(On,{scheduleUpdate:n});case t.SubscriptionScheduleType.BillingPeriod:return i.createElement(jn,{scheduleUpdate:n});case t.SubscriptionScheduleType.UnitAmount:return i.createElement(In,{scheduleUpdate:n,subscription:r});default:return null}}var Rn=a(v.Box,{target:"eju957a2"})("border-bottom:",(function(e){return"1px solid "+e.$borderColor}),";border-top-left-radius:10px;border-top-right-radius:10px;margin:-64px -64px 64px -64px;padding:24px 32px;"),_n=a(p,{target:"eju957a1"})({name:"158icaa",styles:"margin-left:4px"}),Wn=a(oe,{target:"eju957a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";path{fill:",(function(e){return e.theme.stigg.palette.primary}),";}");function Hn(e){var t=e.subscription,n=t.scheduledUpdates;return i.createElement(i.Fragment,null,i.createElement(v.Grid,{container:!0,alignItems:"center",justifyContent:"space-between",gap:1},i.createElement(v.Grid,null,i.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"The following updates will take effect in the next billing cycle:"))),i.createElement(v.Grid,null,(n||[]).map((function(e){return i.createElement(Dn,{key:e.subscriptionScheduleType,scheduleUpdate:e,subscription:t})}))))}function Zn(e){var t=e.subscription,n=se({scheduledUpdate:(t.scheduledUpdates||[])[0],subscriptionPrices:t.prices,billingPeriodRange:t.billingPeriodRange,options:{postfix:"at the end of the current billing period"}}),r=n.line2;return i.createElement(i.Fragment,null,i.createElement(v.Grid,{container:!0,alignItems:"center",justifyContent:"space-between",gap:1},i.createElement(v.Grid,null,i.createElement(V,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary"},n.line1))),r&&i.createElement(v.Grid,null,i.createElement(V,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary"},r)))}function $n(e){var t=e.subscription,n=e.onCancelScheduledUpdates,a=e.theme,l=e.cancelScheduledUpdatesButtonTitle,o=c.useTheme(),s=r.useState(!1),u=s[0],d=s[1],p=t.scheduledUpdates;if(!p||0===p.length)return null;var g=1===p.length;return i.createElement(Rn,{$borderColor:a.borderColor,className:"stigg-scheduled-updates-alert-container"},i.createElement(v.Grid,{container:!0,alignItems:g?"center":"flex-start",gap:2},i.createElement(v.Grid,{item:!0,display:"flex"},i.createElement(kn,{icon:"ScheduleBox",svgPathColor:a.iconsColor,svgRectColor:a.iconsBackgroundColor})),i.createElement(v.Grid,{item:!0,flex:1},i.createElement(g?Zn:Hn,{subscription:t})),!!n&&i.createElement(v.Grid,{item:!0},i.createElement(Nt,{variant:"outlined",onClick:function(){d(!0),Promise.resolve(n(t)).finally((function(){return d(!1)}))}},u?i.createElement(_n,{loading:!0,size:16,color:o.stigg.palette.text.disabled}):i.createElement(Wn,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),i.createElement(V,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button"},l)))))}var qn=a("div",{target:"e1kw2z1l0"})("width:100%;display:flex;flex-direction:column;border-radius:10px;background-color:",(function(e){return e.$backgroundColor}),";border:",(function(e){return"1px solid "+e.$borderColor}),";padding:64px;");function Gn(e){var n=e.billingPeriod,r=e.rangeEnd,a=e.amount,l=e.currency;return i.createElement(i.Fragment,null,i.createElement(V,{variant:"h6"},"Next estimated bill"),i.createElement(V,{variant:"h1"},_({amount:a,currency:l,maximumFractionDigits:2})),i.createElement(V,{variant:"body1",color:"secondary"},"Billed ",n===t.BillingPeriod.Monthly?"monthly":"annually"," on"," ",i.createElement(V,{variant:"body1",span:!0,color:"primary"},g.utc(r).format("MMM Do, YYYY"))),i.createElement(V,{variant:"body1",color:"secondary"},"* Additional tax rates may apply"))}function zn(e){var t=e.description;return i.createElement(i.Fragment,null,i.createElement(V,{variant:"h6",color:"secondary"},"No upcoming bill"),i.createElement(V,{variant:"body1",color:"secondary"},t))}var Vn=a("div",{target:"e1ftdtst1"})({name:"1nocm2b",styles:"display:flex;flex-direction:column;align-items:left;gap:8px"}),Yn=a(S,{target:"e1ftdtst0"})({name:"1l28f5r",styles:"width:fit-content;&.MuiButton-root{padding:0;&:hover{background:none;}}"});function Qn(e){var t=e.onContactSupport,n=e.label,r=i.createElement(V,{color:t?"primary.main":"secondary"},e.linkLabel);return i.createElement(Vn,{className:"stigg-contact-support-layout"},i.createElement(V,{className:"stigg-contact-support-label",color:"secondary"},n),t?i.createElement(Yn,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:t},r):r)}var Kn,Xn,Jn=a("div",{target:"e1u4onrr0"})("max-height:278px;display:flex;flex-direction:column;border-radius:10px;background-color:",(function(e){return e.theme.stigg.palette.backgroundSection}),";border:",(function(e){return"1px solid "+e.$borderColor}),";padding:32px;gap:16px;");function er(e){var n,r,a,l,o=e.subscription,c=e.theme,s=e.textOverrides,u=e.onContactSupport,d=o.pricingType,p=null==(n=null==(r=o.prices)?void 0:r.every((function(e){return e.billingModel!==t.BillingModel.UsageBased})))||n,g=null==(a=o.scheduledUpdates)?void 0:a.find((function(e){var n=e.targetPackage;return e.subscriptionScheduleType===t.SubscriptionScheduleType.Downgrade&&(null==n?void 0:n.pricingType)===t.PricingType.Free}));if(d===t.PricingType.Free)l=i.createElement(zn,{description:"You're on a free plan, so you don’t have any upcoming charges"});else if(d===t.PricingType.Paid)if(g&&p)l=i.createElement(zn,{description:"Your plan will be downgraded to a free plan, so you don’t have any upcoming charges"});else if(o.status===t.SubscriptionStatus.InTrial)l=i.createElement(zn,{description:"You’re on a free trial of the "+o.planName+" plan, so you don’t have any upcoming charges"});else{var m,h,f,v,y=null==(m=o.prices)||null==(h=m[0])?void 0:h.billingPeriod,b=null==(f=o.billingPeriodRange)?void 0:f.end,x=null==(v=o.totalPrice)?void 0:v.total;y&&b&&x&&(l=i.createElement(Gn,{billingPeriod:y,rangeEnd:b,amount:x.amount,currency:x.currency}))}else d===t.PricingType.Custom&&(l=i.createElement(Qn,{onContactSupport:u,label:s.contactSupportTitle,linkLabel:s.contactSupportLink}));return i.createElement(Jn,{className:"stigg-subscription-total-price-layout",$borderColor:c.borderColor},l)}function tr(){return(tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var nr,rr,ir,ar=function(e){return r.createElement("svg",tr({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Kn||(Kn=r.createElement("path",{d:"M12.947 13.6h-1.013l.001-2.824a.522.522 0 0 0-.18-.392L8.622 7.918l3.134-2.465a.497.497 0 0 0 .18-.392V2.4h1.012c.278 0 .49-.212.49-.49a.481.481 0 0 0-.49-.49H3.053a.481.481 0 0 0-.49.49c0 .278.213.49.49.49h1.013l-.001 2.661c0 .147.065.294.18.392l3.117 2.465-3.117 2.466a.497.497 0 0 0-.18.392V13.6H3.054a.481.481 0 0 0-.49.49c0 .277.213.49.49.49h9.894c.277 0 .49-.213.49-.49a.481.481 0 0 0-.49-.49ZM5.045 2.4h5.91v2.416L8 7.167l-2.955-2.35V2.4Zm0 8.62L8 8.67l2.955 2.334v2.58h-5.91V11.02Z",fill:"#fff"})),Xn||(Xn=r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.053 1.254h9.894c.37 0 .657.287.657.656 0 .37-.287.657-.657.657h-.845L12.1 5.06c0 .214-.088.39-.238.519l-.005.004L8.89 7.918l2.974 2.34c.152.13.238.323.238.518l-.001 2.657h.846c.37 0 .657.287.657.657 0 .37-.288.657-.657.657H3.053a.648.648 0 0 1-.657-.657c0-.37.287-.657.657-.657h.846v-2.657c0-.214.087-.39.237-.519l.005-.004 2.953-2.335L4.136 5.58a.688.688 0 0 1-.238-.519V2.567h-.845a.648.648 0 0 1-.657-.656c0-.37.287-.657.657-.657Zm9.894.333H3.053a.315.315 0 0 0-.323.324c0 .185.138.323.323.323h1.18l-.001 2.827c0 .099.043.198.119.264l3.28 2.593-3.28 2.594a.33.33 0 0 0-.119.264v2.99H3.053a.315.315 0 0 0-.323.324c0 .185.138.323.323.323h9.894a.315.315 0 0 0 .323-.323.315.315 0 0 0-.323-.323h-1.18l.001-2.991a.355.355 0 0 0-.119-.264L8.351 7.918l3.298-2.593a.33.33 0 0 0 .119-.264V2.233h1.18a.315.315 0 0 0 .323-.323.315.315 0 0 0-.324-.323Zm-8.069.646h6.244v2.664L8 7.38 4.878 4.897V2.233Zm.334.334v2.169L8 6.955l2.788-2.22V2.568H5.212ZM8 8.457l3.122 2.467v2.827H4.878v-2.81L8 8.456Zm0 .425-2.788 2.219v2.316h5.576v-2.332L8 8.882Z",fill:"#fff"})))},lr=["children","className","placement"],or=a((function(e){var t=e.children,n=e.className,r=e.placement,a=void 0===r?"top":r,l=I(e,lr);return i.createElement(v.Tooltip,Object.assign({arrow:!0,placement:a},l,{classes:{popper:n,tooltip:"stigg-tooltip",arrow:"stigg-tooltip-arrow"}}),i.createElement("div",null,t))}),{target:"enddsuj0"})((function(e){var t,n=e.theme,r=e.$padding,i=e.$maxWidth;return(t={})["& ."+v.tooltipClasses.tooltip]={backgroundColor:n.stigg.palette.white,maxWidth:void 0===i?300:i,boxShadow:n.stigg.shadows.popover,padding:void 0===r?8:r,borderRadius:n.stigg.border.radius,color:n.stigg.palette.text.primary},t["& ."+v.tooltipClasses.arrow]={color:n.stigg.palette.white},t}),""),cr=C(V)(nr||(nr=D(["\n display: ",";\n -webkit-line-clamp: ",";\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: normal;\n ","\n\n ","\n"])),(function(e){return e.$display}),(function(e){return e.$maxLines}),(function(e){return e.$wordBreak&&P.css(rr||(rr=D(["\n word-break: break-word;\n "])))}),(function(e){return e.$bold&&P.css(ir||(ir=D(["\n font-weight: bold;\n "])))}));function sr(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var ur=function(e){var t=e.leaveDelay,n=e.children,a=e.variant,l=e.color,o=e.maxLines,c=void 0===o?1:o,s=e.wordBreak,u=e.bold,d=e.tooltipPlacement,p=void 0===d?"top":d,g=e.className,m=e.display,h=void 0===m?"-webkit-box":m,f=e.style,v=e["data-testid"],y=r.useState(!1),b=y[0],x=y[1],w=r.useRef(null),E=i.createElement(cr,{ref:w,variant:a,color:l,$maxLines:c,$wordBreak:s,$bold:u,className:g,$display:h,style:f,"data-testid":v},n);r.useEffect((function(){if(null!=w&&w.current){var e=sr(w.current);x(e)}}),[w]);var P=(null==w?void 0:w.current)&&sr(w.current);return i.createElement("span",null,b||P?i.createElement(or,{placement:p,leaveDelay:t,title:i.createElement(V,{variant:"body1"},n)},E):E)},dr=a("div",{target:"el5iwyw1"})("width:100%;display:flex;align-items:center;gap:4px;background-color:",(function(e){return e.theme.stigg.palette.warning}),";border-radius:10px;padding:8px 16px;margin-top:16px;"),pr=a(v.Link,{target:"el5iwyw0"})({name:"69ka7t",styles:"text-decoration-color:white;color:white;cursor:pointer"});function gr(e){var n=e.subscription,r=e.includePlanName,a=e.onManageSubscription;return(null==n?void 0:n.status)!==t.SubscriptionStatus.InTrial?null:i.createElement(dr,{className:"stigg-subscription-trial-badge"},i.createElement(ar,{className:"stigg-subscription-trial-badge-image"}),i.createElement("div",{style:{flex:1,marginRight:4}},i.createElement(ur,{variant:"body1",className:"stigg-subscription-trial-badge-text",color:"white"},n.trialRemainingDays+" days remaining in trial",r&&" of the "+n.planName+" plan")),i.createElement(pr,{className:"stigg-subscription-trial-upgrade-button",onClick:a},i.createElement(V,{color:"white"},"Upgrade plan")))}function mr(e){var t=e.mainSubscription,n=e.trialSubscription,r=e.onManageSubscription;return i.createElement("div",{className:"stigg-subscription-view-layout"},i.createElement(V,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:e.theme.planNameColor,style:{marginTop:8}},t.planName," plan"),i.createElement(gr,{subscription:n,includePlanName:(null==n?void 0:n.planName)!==t.planName,onManageSubscription:r}))}function hr(e,t){return Math.min(Math.floor(e/t*100),100)}var fr,vr=a(B,{target:"e1cbsoof1"})("height:4px;background-color:",(function(e){return u(e.theme.stigg.palette.primary).alpha(.4).string()}),";span{background-color:",(function(e){var t=e.theme;switch(e.$progressStatus){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}}),";}"),yr=a(v.Divider,{target:"e1cbsoof0"})("border-style:dotted;border-bottom-width:2px;border-color:",(function(e){return u(e.theme.stigg.palette.outlinedRestingBorder).alpha(.4).string()}),";");function br(e){var t=e.entitlement;if(t.hasUnlimitedUsage)return i.createElement(yr,null);var n,r=hr(t.currentUsage||0,t.usageLimit),a=(n=r)<70?"standard":n<100?"warning":"error";return i.createElement(vr,{$progressStatus:a,className:"stigg-feature-usage-progress-bar-"+a.toString(),variant:"determinate",value:r})}var xr=C(S)(fr||(fr=D(["\n text-transform: none;\n padding: 0;\n white-space: nowrap;\n"])));function wr(e){var t=e.entitlement,n=e.feature,r=e.onManageSubscription,a=e.onBuyMore,l=e.canBuyMore,o=e.canUpgradeSubscription;return e.hasCustomSubscription||t.hasUnlimitedUsage||hr(t.currentUsage||0,t.usageLimit)<70?null:l?a?i.createElement(xr,{variant:"text",onClick:function(){return a(n,t)}},i.createElement(V,{color:"primary.main"},"Buy more")):null:o&&r?i.createElement(xr,{variant:"text",onClick:r},i.createElement(V,{color:"primary.main"},"Upgrade")):null}function Er(e){var t,n,r,a=e.amount,l=e.currency,o=e.entitlement,c=e.feature,s=e.hideChargePrice,u=e.onBuyMore,d=e.onManageSubscription,p=e.canUpgradeSubscription,g=e.hasCustomSubscription;return i.createElement("div",{className:"stigg-charge-list-item",style:{display:"flex",flexDirection:"column",gap:12}},i.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:12}},i.createElement("div",{style:{display:"flex",gap:12}},i.createElement(ur,{variant:"body1",color:"primary"},c.displayName),!s&&i.createElement(ur,{variant:"body1",color:"secondary"},_({amount:a,currency:l})," per ",c.featureUnits)),i.createElement("div",{style:{display:"flex",gap:12}},i.createElement(wr,{entitlement:o,feature:c,canBuyMore:!0,onBuyMore:u,onManageSubscription:d,canUpgradeSubscription:p,hasCustomSubscription:g}),i.createElement(V,{variant:"body1",color:"primary",style:{whiteSpace:"nowrap"}},o.hasUnlimitedUsage?null==(t=o.currentUsage)?void 0:t.toLocaleString():(null==(n=o.currentUsage)?void 0:n.toLocaleString())+" of "+(null==(r=o.usageLimit)?void 0:r.toLocaleString())))),i.createElement(br,{entitlement:o}))}function Pr(e){var n=e.subscription,r=e.onBuyMore,a=e.onManageSubscription,l=e.hasCustomSubscription,o=e.canUpgradeSubscription,c=h.keyBy(e.entitlements,"feature.refId"),s=n.prices.filter((function(e){var t=e.feature;return!!t&&c[t.refId]&&!!e.price}));return s.length?i.createElement("div",{className:"stigg-charge-list",style:{display:"flex",flexDirection:"column",gap:16,marginTop:32}},s.map((function(e){var n=e.feature,s=e.price;if(!n||!s)return null;var u=c[n.refId];return u&&u.feature?i.createElement(Er,{key:n.refId,entitlement:u,feature:u.feature,amount:s.amount,currency:s.currency,hideChargePrice:e.billingModel===t.BillingModel.PerUnit,onBuyMore:r,onManageSubscription:a,canUpgradeSubscription:o,hasCustomSubscription:l}):null}))):null}function Cr(e){var n=e.onManageSubscription,r=e.onBuyMore,a=e.onCancelScheduledUpdates,l=e.onContactSupport,o=e.hiddenSections,c=e.cancelScheduledUpdatesButtonTitle,s=Ut(),u=s.customerPortal,d=s.textOverrides,p=s.theme,g=s.isLoading||!u,m=u||{},h=m.subscriptions,f=m.entitlements,v=m.canUpgradeSubscription,y=null==h?void 0:h.find((function(e){return e.status===t.SubscriptionStatus.Active})),b=null==h?void 0:h.find((function(e){return e.status===t.SubscriptionStatus.InTrial})),x=(null==y?void 0:y.pricingType)===t.PricingType.Custom,w=y||b;return i.createElement(qn,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:p.backgroundColor,$borderColor:p.borderColor},!g&&y&&y.scheduledUpdates&&i.createElement($n,{theme:p,subscription:y,onCancelScheduledUpdates:a,cancelScheduledUpdatesButtonTitle:c}),g||!w?i.createElement(Fn,null):i.createElement("div",{className:"stigg-overview-layout",style:{display:"flex",alignItems:"flex-start",gap:64}},i.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1}},i.createElement(Ot,{onManageSubscription:n,hideManageButton:x,textOverrides:d}),i.createElement(mr,{mainSubscription:w,trialSubscription:b,theme:p,onManageSubscription:n}),y&&f&&i.createElement(Pr,{subscription:y,entitlements:f,onBuyMore:r,onManageSubscription:n,canUpgradeSubscription:!!v,hasCustomSubscription:x}),i.createElement(Bn,{customerPortal:u,hiddenSections:o,textOverrides:d,theme:p})),i.createElement("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24}},i.createElement(er,{subscription:w,theme:p,onContactSupport:l,textOverrides:d}))))}var Sr=a("div",{target:"e2lw8x70"})({name:"7wpci2",styles:"display:flex;width:100%;align-items:flex-end;justify-content:flex-end;margin-bottom:24px"});function Ur(e){return i.createElement(Sr,{className:"stigg-customer-portal-header-layout"},i.createElement(Ge,{source:"customer_portal",showWatermark:e.showWatermark}))}var kr=a(V,{target:"eb0pe7a1"})({name:"kxbue8",styles:"text-transform:none"}),Mr=a(s.ExternalLink,{target:"eb0pe7a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";");function Nr(e){var t=e.text,n=e.url;return i.createElement(Nt,{className:e.className,variant:"outlined",startIcon:i.createElement(Mr,{size:20,strokeWidth:2.5}),onClick:function(){window.open(n,"_blank")}},i.createElement(kr,{color:"primary.main"},t))}var Tr,Br=a("div",{target:"e12mjvl51"})({name:"1hidw77",styles:"display:flex;flex-direction:column;align-items:flex-start;gap:16px;flex:1 0 0"}),Lr=a("div",{target:"e12mjvl50"})({name:"j9hhqa",styles:"display:flex;align-items:flex-start;gap:16px;align-self:stretch"});function Ar(e){var t=e.rows;return i.createElement(Br,null,i.createElement(V,{variant:"h6",color:"secondary",fontWeight:o.FontWeight.Medium},e.title),t.map((function(e){var t=e.classNamePrefix,n=e.label,r=e.value,a=e.valueTypographyProps;return i.createElement(Lr,{key:n},i.createElement(V,Object.assign({className:t+"-label",variant:"body1",color:"secondary",style:{width:80}},e.labelTypographyProps),n),i.createElement(V,Object.assign({className:t+"-text",variant:"body1",color:"secondary"},a),r))})))}function Fr(){return i.createElement(x,{width:220,height:42})}function Or(){var e=Ut(),t=e.customerPortal,n=e.textOverrides,r=e.theme,a=(t||{}).billingInformation,l=!a||e.isLoading,o=[];if(l?o.push.apply(o,[i.createElement(Br,null,i.createElement(x,{width:220,height:12}),i.createElement(x,{width:220,height:12}),i.createElement(x,{width:220,height:12})),i.createElement(v.Divider,{orientation:"vertical",style:{minHeight:93}}),i.createElement(Br,null,i.createElement(x,{width:220,height:12}),i.createElement(x,{width:220,height:12}),i.createElement(x,{width:220,height:12}))]):(o.push(i.createElement(Ar,{title:"Billed to",rows:[{classNamePrefix:"stigg-customer-name",label:"Name",value:(null==a?void 0:a.name)||"-",valueTypographyProps:null!=a&&a.name?{}:{color:"disabled"}},{classNamePrefix:"stigg-customer-email",label:"Email",value:(null==a?void 0:a.email)||"-",valueTypographyProps:null!=a&&a.email?{}:{color:"disabled"}}]})),null!=a&&a.defaultPaymentMethodId&&a.defaultPaymentMethodLast4Digits&&a.defaultPaymentExpirationMonth&&a.defaultPaymentExpirationYear&&(o.unshift(i.createElement(v.Divider,{orientation:"vertical",style:{minHeight:93}})),o.unshift(i.createElement(Ar,{title:"Payment method",rows:[{classNamePrefix:"stigg-credit-card",label:"Card",value:"Ending in "+a.defaultPaymentMethodLast4Digits},{classNamePrefix:"stigg-credit-card-expiration",label:"Expires",value:h.padStart(a.defaultPaymentExpirationMonth.toString(),2,"0")+"/"+a.defaultPaymentExpirationYear}]})))),!(l||null!=a&&a.name||null!=a&&a.email||null!=a&&a.defaultPaymentMethodId))return null;var c=l?i.createElement(Fr,null):null!=t&&t.billingPortalUrl?i.createElement(Nr,{url:t.billingPortalUrl,text:n.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return i.createElement(qn,{className:"stigg-payment-details-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},i.createElement(Lt,{className:"stigg-payment-details-section-header"},i.createElement(At,{isLoading:l,className:"stigg-payment-details-section-title",title:"Payment details"}),c),i.createElement("div",{style:{display:"flex",alignItems:"stretch",gap:64}},o))}var jr=a(qn,{target:"eqpkdww0"})("position:relative;.stigg-paywall-layout{width:100%;}.stigg-paywall-plans-layout{flex-wrap:nowrap;width:100%;overflow-x:auto;justify-content:unset;padding:0;}.stigg-paywall-plans-layout .stigg-plan-offering-container:first-of-type{margin-left:auto;}.stigg-paywall-plans-layout .stigg-plan-offering-container:last-child{margin-right:auto;}",(function(e){return e.$hideButtons&&c.css(Tr||(Tr=D(["\n .stigg-paywall-plan-button:not([disabled]) {\n display: none;\n }\n "])))})," .","stigg-watermark","{display:none;}"),Ir=i.forwardRef((function(e,t){var n=e.paywallComponent,r=e.theme;return n?i.createElement(jr,{className:"stigg-customer-portal-paywall-section",ref:t,$hideButtons:e.hidePaywallButtons,$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},i.createElement(Lt,{className:"stigg-customer-portal-paywall-header"},i.createElement(At,{isLoading:e.isLoading,className:"stigg-customer-portal-paywall-section-title",title:e.title})),n):null})),Dr=a("div",{target:"e1gjjeod1"})({name:"6xtw2",styles:"width:100%;display:flex;flex-direction:column;align-items:center;& *{box-sizing:border-box;}"}),Rr=a("div",{target:"e1gjjeod0"})({name:"1c31jfu",styles:"width:100%;display:flex;flex-direction:column;align-items:center;row-gap:24px"}),_r=a("div",{target:"eqqveb80"})("display:flex;flex-direction:column;padding:24px;border:",(function(e){return"1px solid "+e.$borderColor}),";border-radius:10px;row-gap:16px;height:100%;",(function(e){return e.$highlight&&"background-color: "+e.theme.stigg.palette.backgroundSection}),";");function Wr(e){var n,r,a,l,o,c=e.entitlement,s=e.subscriptionPrice,u=e.onManageSubscription,d=e.onBuyMore,p=e.hasCustomSubscription,m=e.canUpgradeSubscription,h=Ut().theme,f=!c.hasUnlimitedUsage&&c.currentUsage>c.usageLimit;return c.feature?i.createElement(_r,{$highlight:!!s,$borderColor:h.borderColor},i.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16}},i.createElement(ur,{variant:"body1"},c.feature&&((o=A((l=c.feature).displayName))===A(l.featureUnits||"")||o===A(l.featureUnitsPlural||"")?l.displayName:l.displayName+" ("+l.featureUnitsPlural+")")),s&&i.createElement(or,{title:i.createElement(V,{variant:"body1"},s.billingModel===t.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage")},i.createElement(kn,{icon:"DollarCoin",svgStrokeColor:h.iconsColor}))),i.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8}},i.createElement(ur,{variant:"body1",color:f?"error":"primary","data-testid":"usage-data-"+(null==(n=c.feature)?void 0:n.refId)},null==(r=c.currentUsage)?void 0:r.toLocaleString(),!c.hasUnlimitedUsage&&" / "+(null==(a=c.usageLimit)?void 0:a.toLocaleString())+" ("+hr(c.currentUsage||0,c.usageLimit)+"%)"),i.createElement(wr,{entitlement:c,feature:c.feature,onBuyMore:d,canBuyMore:!!s,onManageSubscription:u,canUpgradeSubscription:m,hasCustomSubscription:p})),i.createElement(br,{entitlement:c}),c.hasUnlimitedUsage||L(c.usageLimit)||L(c.currentUsage)||!c.resetPeriod||!c.nextResetDate?null:i.createElement(V,{color:"secondary"},function(e){if(!e.resetPeriod||!e.nextResetDate)return null;var t=function(t){return g.utc(e.nextResetDate).diff(g.utc(),t)};switch(e.resetPeriod){case"MONTH":return"Resets monthly - in "+t("days")+" days";case"WEEK":return"Resets weekly - in "+t("days")+" days";case"DAY":return"Resets daily - in "+t("hours")+" hours";case"HOUR":return"Resets hourly - in "+t("minutes")+" minutes";default:return null}}(c)),c.hasUnlimitedUsage&&i.createElement(V,{color:"secondary"},"In current billing period")):null}var Hr=a("div",{target:"eoaojje0"})({name:"3hgi0y",styles:"margin-top:32px"});function Zr(){return i.createElement(v.Grid,{container:!0,spacing:4,className:"stigg-subscription-usage-skeleton-layout"},h.range(6).map((function(e){return i.createElement(v.Grid,{key:e,item:!0,xs:4},i.createElement(x,{width:280,height:120}))})))}function $r(e){var n=e.onManageSubscription,r=e.onBuyMore,a=i.useState(!1),l=a[0],o=a[1],c=Ut(),u=c.customerPortal,d=c.textOverrides,p=c.theme,g=c.isLoading||!u,m=u||{},f=m.entitlements,y=m.subscriptions,b=null==f?void 0:f.filter((function(e){var n,r;return(null==(n=e.feature)?void 0:n.meterType)===t.MeterType.Fluctuating||(null==(r=e.feature)?void 0:r.meterType)===t.MeterType.Incremental})),x=null==y?void 0:y.find((function(e){return e.status===t.SubscriptionStatus.Active})),w=(null==x?void 0:x.pricingType)===t.PricingType.Custom,E=!(null==u||!u.canUpgradeSubscription),P=h.keyBy(null==x?void 0:x.prices,"feature.refId"),C=h.keyBy(b,"feature.refId"),S=h.compact(null==x?void 0:x.prices.map((function(e){return e.feature&&C[e.feature.refId]}))),U=h.compact(null==b?void 0:b.filter((function(e){return!P[e.feature.refId]}))),k=[].concat(S,U),M=k.length>2?4:6,N=l?k:k.slice(0,6);return g||null!=b&&b.length?i.createElement(qn,{className:"stigg-subscription-usage-layout",$backgroundColor:p.backgroundColor,$borderColor:p.borderColor},i.createElement(Lt,null,i.createElement(At,{title:d.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:g})),g?i.createElement(Zr,null):i.createElement(i.Fragment,null,i.createElement(v.Grid,{container:!0,spacing:4},N.map((function(e){return i.createElement(v.Grid,{item:!0,xs:M},i.createElement(Wr,{key:e.feature.refId,subscriptionPrice:P[e.feature.refId],entitlement:e,onManageSubscription:n,onBuyMore:r,hasCustomSubscription:w,canUpgradeSubscription:E}))}))),k.length>6&&i.createElement(Hr,null,i.createElement(Nt,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:i.createElement(l?s.Minus:s.Plus,null),onClick:function(){return o((function(e){return!e}))}},l?"Show less":"Show more")))):null}function qr(e){var n=e.onManageSubscription,a=e.onBuyMore,l=e.onCancelScheduledUpdates,o=e.onContactSupport,c=e.paywallComponent,s=e.hiddenSections,u=rt().stigg,d=Ut(),p=d.customerPortal,g=d.textOverrides,m=d.theme,h=d.isLoading,f=r.useRef(null),v=function(){var e;n?n():null==f||null==(e=f.current)||e.scrollIntoView({behavior:"smooth"})},y=null==p?void 0:p.subscriptions.some((function(e){return e.pricingType===t.PricingType.Custom})),b=!(null!=s&&s.some((function(e){return"usage"===e}))),x=!(null!=s&&s.some((function(e){return"paymentDetails"===e||"billingInformation"===e}))),w=!(null!=s&&s.some((function(e){return"invoices"===e||"billingInformation"===e})));return i.createElement(Dr,{className:"stigg-customer-portal-layout"},i.createElement(Ur,{showWatermark:u.isWidgetWatermarkEnabled&&!!p}),i.createElement(Rr,{className:"stigg-customer-portal-sections"},i.createElement(Cr,{onCancelScheduledUpdates:l,onBuyMore:a,onManageSubscription:v,onContactSupport:o,hiddenSections:s,cancelScheduledUpdatesButtonTitle:g.cancelScheduledUpdatesButtonTitle}),b&&i.createElement($r,{onManageSubscription:v,onBuyMore:a}),i.createElement(Ir,{ref:f,paywallComponent:c,hidePaywallButtons:!!y,theme:m,title:g.paywallSectionTitle,isLoading:!p||h}),x&&i.createElement(Or,null),w&&i.createElement(Vr,null)))}var Gr,zr=["textOverrides","theme","resourceId","productId"];function Vr(){var e=Ut(),t=e.customerPortal,n=e.textOverrides,r=e.theme,a=!t||e.isLoading,l=a?i.createElement(Fr,null):null!=t&&t.billingPortalUrl?i.createElement(Nr,{url:t.billingPortalUrl,text:n.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return a||null!=t&&t.billingPortalUrl?i.createElement(qn,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},i.createElement(Lt,{className:"stigg-invoices-section-header"},i.createElement(At,{isLoading:a,className:"stigg-invoices-section-title",title:n.invoicesTitle}),l)):null}(Gr=exports.ProvisionStatus||(exports.ProvisionStatus={})).IN_PROGRESS="IN_PROGRESS",Gr.SUCCEEDED="SUCCEEDED",Gr.FAILED="FAILED",Object.keys(t).forEach((function(e){"default"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})})),exports.AddonsList=jt,exports.CustomerPortal=function(e){var t=e.textOverrides,n=e.theme,r=e.resourceId,a=e.productId,l=I(e,zr);return i.createElement(kt,{textOverrides:t,theme:n,resourceId:r,productId:a},i.createElement(qr,Object.assign({},l)))},exports.CustomerPortalProvider=kt,exports.CustomerUsageData=$r,exports.InvoicesSection=Vr,exports.PaymentDetailsSection=Or,exports.Paywall=function(e){var n=e.productId,a=e.resourceId,l=e.highlightedPlanId,o=e.showOnlyEligiblePlans,c=e.textOverrides,s=e.onPlanSelected,u=e.preferredBillingPeriod,p=e.onBillingPeriodChange,h=e.billingCountryCode,f=!!r.useContext(St),v=!1;if(f){var y=Ut();v=y.isLoading,a=y.resourceId}var b=function(e){var n=e.productId,i=e.resourceId,a=e.showOnlyEligiblePlans,l=e.billingCountryCode,o=e.preferredBillingPeriod,c=rt(),s=c.stigg,u=c.locale,d=r.useState(t.BillingPeriod.Annually),p=d[0],h=d[1],f=r.useState([]),v=f[0],y=f[1],b=r.useState(null),x=b[0],E=b[1],P=r.useState(!0),C=P[0],S=P[1];r.useEffect((function(){!function(){var e=O(et.mark((function e(){var t,r,a,c;return et.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,S(!0),e.next=4,s.waitForInitialization();case 4:return e.next=6,s.getPaywall({productId:n,resourceId:i,billingCountryCode:l});case 6:r=it((t=e.sent).plans,o),a=r.availableBillingPeriods,c=r.defaultBillingPeriod,E(t),y(a),h(c),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(0),tt.error("Failed to load paywall "+(null==e.t0?void 0:e.t0.message),e.t0);case 16:return e.prev=16,S(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[0,13,16,19]])})));return function(){return e.apply(this,arguments)}}()()}),[s,n,s.isCustomerLoaded,l,i]);var U=function(e,n){var r,i=e||{},a=i.plans,l=i.currency,o=i.configuration,c=i.customer,s=i.paywallCalculatedPricePoints,u=function(e){var n,r,i,a=!0,l=(null==e?void 0:e.find((function(e){return e.status===t.SubscriptionStatus.InTrial})))||null,o=null==(n=l)?void 0:n.plan,c=null!=(r=l)&&r.trialEndDate?g.utc(l.trialEndDate).diff(g.utc(),"days",!1)+1:void 0;return o||(a=!1,o=null==(i=l=(null==e?void 0:e.find((function(e){return e.status===t.SubscriptionStatus.Active})))||null)?void 0:i.plan),{currentSubscription:l,currentPlan:o,isCustomerOnTrial:a,trialDaysLeft:c}}(i.activeSubscriptions),d=u.currentSubscription,p=u.currentPlan,h=u.isCustomerOnTrial,f=u.trialDaysLeft,v=(null==d?void 0:d.scheduledUpdates)||[],y=null==d||null==(r=d.price)?void 0:r.billingPeriod,b=v.find((function(e){return e.subscriptionScheduleType===t.SubscriptionScheduleType.Downgrade})),x=v.find((function(e){return e.subscriptionScheduleType===t.SubscriptionScheduleType.BillingPeriod})),E=w(a,(function(e){return e.order})).map((function(e){var t,n=null==c||null==(t=c.eligibleForTrial)?void 0:t.find((function(t){return t.productId===e.product.id})),r=e.id===(null==p?void 0:p.id);return j({},e,{paywallCalculatedPricePoints:null==s?void 0:s.filter((function(t){return t.planId===e.id})),isTriable:!m(e.defaultTrialConfig)&&(!n||n.eligible),isCurrentCustomerPlan:r,currentCustomerPlanBillingPeriod:y,isUpcomingPlan:!1,trialDaysLeft:f,isNextPlan:function(t){var n,i=null==b?void 0:b.scheduleVariables,a=null==x?void 0:x.scheduleVariables,l=e.pricePoints.some((function(e){return e.billingPeriod===t}));return b?(null==(n=b.targetPackage)?void 0:n.refId)===e.id&&(!l||i.billingPeriod===t):!(!x||!r)&&a.billingPeriod===t},paywallCurrency:l,scheduledUpdate:b||x})}));if(a&&p){var P,C=p&&(null==a||null==(P=a.find((function(e){return e.id===(null==p?void 0:p.id)})))?void 0:P.order);m(C)||(E=E.map((function(e){return j({},e,{isLowerThanCurrentPlan:C>e.order})})),n&&(E=E.filter((function(e){return e.order>C}))))}var S=o?function(e){var t=e.palette,n=e.layout;return{customCss:e.customCss||void 0,palette:{primary:(null==t?void 0:t.primary)||void 0,backgroundPaper:(null==t?void 0:t.backgroundColor)||void 0,outlinedBorder:(null==t?void 0:t.borderColor)||void 0,backgroundHighlight:(null==t?void 0:t.currentPlanBackground)||void 0,text:{primary:(null==t?void 0:t.textColor)||void 0}},typography:ot(e),layout:{ctaAlignment:ct(null==n?void 0:n.alignment),headerAlignment:ct(null==n?void 0:n.alignment),descriptionAlignment:ct(null==n?void 0:n.alignment),planMaxWidth:at(null==n?void 0:n.planWidth),planMinWidth:at(null==n?void 0:n.planWidth),planMargin:at(null==n?void 0:n.planMargin),planPadding:at(null==n?void 0:n.planPadding)}}}(o):void 0;return{currentPlan:p,currentSubscription:d,isCustomerOnTrial:h,plans:E,paywallConfiguration:S}}(x,a);return j({customer:(null==x?void 0:x.customer)||null,isLoading:C,selectedBillingPeriod:p,setSelectedBillingPeriod:h,availableBillingPeriods:v,locale:u,configuration:U.paywallConfiguration},U)}({productId:n,resourceId:a,showOnlyEligiblePlans:o,billingCountryCode:h,preferredBillingPeriod:u}),x=b.plans,E=b.customer,P=b.currentSubscription,C=b.isCustomerOnTrial,S=b.isLoading,U=b.selectedBillingPeriod,k=b.setSelectedBillingPeriod,M=b.availableBillingPeriods,N=b.locale,T=b.configuration,B=d({highlightChip:"Recommended",planCTAButton:{upgrade:"Upgrade",downgrade:"Downgrade",startTrial:function(e){var t;return"Start "+(null==(t=e.defaultTrialConfig)?void 0:t.duration)+" day trial"},custom:"Contact us",currentPlan:"Current plan",startNew:"Get started",switchToBillingPeriod:function(e){return"Switch to "+e.toLocaleLowerCase()},cancelScheduledUpdate:"Cancel update"},price:{startingAtCaption:"Starts at",free:function(e){return{price:(null==e?void 0:e.symbol)+"0"}},custom:"Custom",priceNotSet:"Price not set"}},c),L=!x||S||v?i.createElement(yt,null):i.createElement(Je,{plans:x,customer:E,currentSubscription:P,selectedBillingPeriod:U,onBillingPeriodChanged:function(e){k(e),p&&p(e)},availableBillingPeriods:M,highlightedPlanId:l,isLoading:S,isCustomerOnTrial:C,onPlanSelected:s,paywallLocale:B,locale:N});return f?L:i.createElement(Ct,{componentTheme:T},L)},exports.Promotions=Dt,exports.StiggContext=nt,exports.StiggProvider=function(e){var t=e.apiKey,a=e.baseUri,l=e.baseEdgeUri,o=e.enableEdge,c=e.customerId,s=e.customerToken,u=e.resourceId,d=e.theme,p=e.locale,g=e.useEntitlementPolling,m=e.entitlementPollingInterval,h=e.entitlementsFallback,f=e.stiggClient,v=e.children,y=r.useRef(t),x={apiKey:t,customerId:c,customerToken:s,resourceId:u,baseUri:a,baseEdgeUri:l,enableEdge:o,entitlementsFallback:h,useEntitlementPolling:g,entitlementPollingInterval:m},w=r.useState((function(){return{stigg:null!=f?f:n.initialize(j({},x,{lazyLoad:!0})),locale:p||"en-US",isInitialized:!1,theme:d,refreshData:(e=O(et.mark((function e(){return et.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return P((function(e){return j({},e,{customerPortalUpdatedAt:new Date})})),e.next=3,E.stigg.refresh();case 3:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})};var e})),E=w[0],P=w[1];return r.useEffect((function(){var e=!0,r=function(t){e&&P(t)},i=function(){return r((function(e){return j({},e,{updatedAt:new Date})}))},a=function(e){return r((function(t){return t.stigg&&t.stigg.removeListener("entitlementsUpdated",i),e.addListener("entitlementsUpdated",i),j({},t,{stigg:e,isInitialized:!0,updatedAt:new Date})}))};return function(){var e=O(et.mark((function e(){var i;return et.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=E.stigg,t!==y.current&&(tt.log("Updating stigg client",{apiKey:t}),y.current=t,i=n.initialize(j({},x)),r((function(e){return j({},e,{isInitialized:!1,updatedAt:new Date})}))),e.next=4,i.waitForInitialization();case 4:a(i);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()(),function(){e=!1,E.stigg.removeListener("entitlementsUpdated",i),E.stigg.clearCustomer()}}),[t]),r.useEffect((function(){var e=E.stigg;c?e.setCustomerId(c,s,u):e.clearCustomer()}),[c,s,u]),r.useEffect((function(){P((function(e){return j({},e,{theme:d})}))}),[d]),i.createElement(nt.Provider,{value:E},i.createElement(b.SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea"},v))},exports.SubscriptionsOverview=Cr,exports.useStiggContext=rt,exports.useWaitForCheckoutCompleted=function(e){var t,n=void 0===e?{}:e,i=n.onProvisionStart,a=n.onProvisionSucceeded,l=n.onProvisionFailed,o=rt().stigg,c=r.useState(exports.ProvisionStatus.IN_PROGRESS),s=c[0],u=c[1],d=r.useState(!1),p=d[0],g=d[1],m=r.useMemo((function(){var e=new URLSearchParams(window.location.search);return t?e.get(t):e}),[t="checkoutCompleted",window.location.search]);return r.useEffect((function(){!function(){var e=O(et.mark((function e(){var t;return et.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m&&"false"!==m.toLowerCase()&&!p){e.next=2;break}return e.abrupt("return");case 2:return g(!0),i&&i(),e.prev=4,e.next=7,o.waitForCheckoutCompleted();case 7:t=e.sent,u(exports.ProvisionStatus.SUCCEEDED),a&&a(t),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(4),console.error("Failed to wait for checkout to complete",e.t0),u(exports.ProvisionStatus.FAILED),l&&l(e.t0);case 17:return e.prev=17,g(!1),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,12,17,20]])})));return function(){return e.apply(this,arguments)}}()()}),[o,m]),{isAwaitingCheckout:p,provisionStatus:s}};
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@stigg/js-client-sdk"),n=e(t),r=require("react"),i=e(r),a=e(require("@emotion/styled/base")),l=e(require("currency-symbol-map")),o=require("styled-typography"),c=require("@emotion/react"),s=require("react-feather"),u=e(require("color")),d=e(require("lodash/merge")),g=e(require("react-spinners/ClipLoader")),p=e(require("moment")),m=e(require("lodash/isNil")),h=require("lodash"),f=e(require("classnames")),v=require("@mui/material"),y=e(require("react-switch")),b=require("react-loading-skeleton"),x=e(b),w=e(require("lodash/sortBy")),E=require("@mui/material/styles"),P=require("styled-components"),C=e(P),S=e(require("@mui/material/Button")),U=e(require("lodash/flatMap")),k=e(require("@mui/material/Box")),M=e(require("@mui/material/Tab")),N=e(require("lodash/isEmpty")),T=e(require("@mui/material/Tabs")),B=e(require("@mui/material/LinearProgress")),L=e(require("lodash/isUndefined")),A=e(require("lodash/lowerCase"));function F(e,t,n,r,i,a,l){try{var o=e[a](l),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}function O(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function l(e){F(a,r,i,l,o,"next",e)}function o(e){F(a,r,i,l,o,"throw",e)}l(void 0)}))}}function j(){return(j=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function I(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function D(e,t){return t||(t=e.slice(0)),e.raw=t,e}var R,_=function(e){var n=e.amount,r=e.currency,i=e.locale,a=e.maximumFractionDigits,o=void 0===a?5:a,c=(void 0===r?t.Currency.Usd:r).toString(),s=l(c),u=new Intl.NumberFormat(i,j({maximumFractionDigits:o,minimumFractionDigits:0,style:"currency",currency:c},s?{currencyDisplay:"code"}:{})).format(n||0);return s&&(u=u.replace(c,s)),u.replace(/\s/g,"")};function W(){return(W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var H=function(e){return r.createElement("svg",W({width:15,height:11,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),R||(R=r.createElement("path",{d:"M5.59 7.99 2.125 4.525A1 1 0 1 0 .71 5.94l4.88 4.88 8.705-8.705a.997.997 0 0 0-1.41-1.41L5.59 7.99Z",fill:"#B2BBD3"})))},Z=["children","span","style","fontWeight","variant","color","overrideColor","bold"];function $(e,t){switch(t){case"white":return"white";case"primary.main":return e.stigg.palette.primary;case"warning":return e.stigg.palette.warning;case"error":return e.stigg.palette.error;default:return e.stigg.palette.text[t]}}var q=a(o.Text,{target:"ewjez2x0"})("margin:0;",(function(e){return e.$span&&"display: inline"}),";");function G(e){switch(e){case"bold":return o.FontWeight.Bold;case"normal":default:return o.FontWeight.Normal}}function z(e,t){var n=e.stigg.typography;switch(t){case"h1":return G(n.h1.fontWeight);case"h3":return G(n.h2.fontWeight);case"h6":return G(n.h3.fontWeight);case"body1":return G(n.body.fontWeight);case"caption":return G(n.caption.fontWeight);default:return o.FontWeight.Normal}}var V=r.forwardRef((function(e,t){var n=e.children,r=e.span,a=e.style,l=e.fontWeight,s=e.variant,u=void 0===s?"body1":s,d=e.color,g=void 0===d?"primary":d,p=e.overrideColor,m=e.bold,h=I(e,Z),f=c.useTheme(),v=function(e){switch(e){case"h1":return 1;case"h3":return 2;case"h6":return 3;case"body1":return 4;case"caption":return 5;default:return 3}}(u),y="typography-level-"+v;return i.createElement(q,Object.assign({ref:t},h,{className:e.className?e.className+" "+y:y,style:a,level:v,color:p||$(f,g),fontWeight:null!=l?l:m?o.FontWeight.Bold:z(f,u),$span:r}),n)})),Y=["displayNameOverride"],Q=a(V,{target:"e1mddeqb2"})({name:"ti75j2",styles:"margin:0"}),K=a("div",{target:"e1mddeqb1"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),X=a(H,{target:"e1mddeqb0"})("margin-right:16px;flex-shrink:0;*{fill:",(function(e){return e.theme.stigg.palette.text.disabled}),";}");function J(e){var n=e.displayNameOverride,r=function(e){var n=e.hasUnlimitedUsage,r=e.feature,i=e.resetPeriod,a=e.usageLimit,l=e.minUnitQuantity,o=e.maxUnitQuantity,c=e.isCustom,s=l||o,u=i&&a?""+function(e){if(!e)return"";switch(e){case t.EntitlementResetPeriod.Day:return"per day";case t.EntitlementResetPeriod.Hour:return"per hour";case t.EntitlementResetPeriod.Week:return"per week";case t.EntitlementResetPeriod.Month:return"per month"}}(i):"";if(n)return"Unlimited "+(null==r?void 0:r.unitsPlural);if(c)return"Custom "+(null==r?void 0:r.unitsPlural);if(a){var d=1===a?null==r?void 0:r.units:null==r?void 0:r.unitsPlural;return function(e){return e.toLocaleString("en-US",{maximumFractionDigits:0})}(a)+" "+d+" "+u}return s?function(e,t,n){return e&&1!==e||!t?e&&e>1&&t?e+"-"+t+" "+n:e&&e>1?"Minimum "+e+" "+n:"":"Up to "+t+" "+n}(l,o,null==r?void 0:r.unitsPlural):null==r?void 0:r.displayName}(I(e,Y));return i.createElement(K,{className:"stigg-entitlement-row-container"},i.createElement(X,{className:"stigg-entitlement-row-icon"}),i.createElement(Q,{className:"stigg-entitlement-name",variant:"h6",color:"secondary"},n||r))}var ee,te=a("div",{target:"e1yz7zcg0"})({name:"1k68p29",styles:"display:flex;flex-direction:column;gap:16px;margin-top:33px;margin-bottom:60px"});function ne(e){var n,r=e.plan,a=e.billingPeriod,l=e.paywallLocale,o=null==(n=r.pricePoints)?void 0:n.filter((function(e){return e.billingPeriod===a})),c=null==o?void 0:o.map((function(e){var t;return(null==e?void 0:e.minUnitQuantity)&&(null==e?void 0:e.minUnitQuantity)>1||(null==e?void 0:e.maxUnitQuantity)?i.createElement(J,{key:"priceUnitEntitlement-"+(null==e||null==(t=e.feature)?void 0:t.displayName),feature:null==e?void 0:e.feature,minUnitQuantity:null==e?void 0:e.minUnitQuantity,maxUnitQuantity:null==e?void 0:e.maxUnitQuantity}):null}));return i.createElement(te,{className:"stigg-plan-entitlements-container"},i.createElement(V,{className:"stigg-plan-entitlements-title",color:"secondary",variant:"h6",bold:!0},function(e,t){if(t.entitlementsTitle)return t.entitlementsTitle(e);var n=e.displayName+" includes";return e.basePlan&&(n="Everything in "+e.basePlan.displayName+", plus:"),n}(r,l)),c,r.entitlements.filter((function(e){return!(e.hiddenFromWidgets||[]).includes(t.WidgetType.Paywall)})).map((function(e){var t;return i.createElement(J,{key:null==(t=e.feature)?void 0:t.id,displayNameOverride:e.displayNameOverride,feature:e.feature,resetPeriod:e.resetPeriod,hasUnlimitedUsage:e.hasUnlimitedUsage,usageLimit:e.usageLimit,isCustom:e.isCustom})})))}(ee=exports.SubscribeIntentionType||(exports.SubscribeIntentionType={})).START_TRIAL="START_TRIAL",ee.UPGRADE_TRIAL_TO_PAID="UPGRADE_TRIAL_TO_PAID",ee.REQUEST_CUSTOM_PLAN_ACCESS="REQUEST_CUSTOM_PLAN_ACCESS",ee.CHANGE_BILLING_PERIOD="CHANGE_BILLING_PERIOD",ee.UPGRADE_PLAN="UPGRADE_PLAN",ee.DOWNGRADE_PLAN="DOWNGRADE_PLAN",ee.CANCEL_SCHEDULED_UPDATES="CANCEL_SCHEDULED_UPDATES";var re,ie=function(e){return{left:"flex-start",center:"center",right:"flex-end"}[e]};function ae(){return(ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var le,oe=function(e){return r.createElement("svg",ae({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re||(re=r.createElement("path",{d:"M10.833 2.5a7.5 7.5 0 0 0-7.5 7.5h-2.5l3.242 3.242.058.116L7.5 10H5a5.829 5.829 0 0 1 5.833-5.833A5.83 5.83 0 0 1 16.667 10a5.83 5.83 0 0 1-5.834 5.833 5.786 5.786 0 0 1-4.116-1.716L5.533 15.3a7.462 7.462 0 0 0 5.3 2.2 7.5 7.5 0 0 0 0-15ZM10 6.667v4.166l3.567 2.117.6-1.008-2.917-1.734V6.667H10Z",fill:"#6678A7"})))},ce=function(e){return p.utc(e).format("MMM Do, yyyy")};function se(e){var n=e.scheduledUpdate,r=e.subscriptionPrices,a=e.billingPeriodRange,l=e.options,o=void 0===l?{}:l;if(!n)return{};var c=o.withDate,s=o.postfix,u=void 0===s?"":s;switch(n.subscriptionScheduleType){case t.SubscriptionScheduleType.Downgrade:var d,g=c;return m(g)&&null!=a&&a.end&&(g=!p(n.scheduledExecutionTime).isSame(null==a?void 0:a.end,"day")),{line1:i.createElement(i.Fragment,null,"Your subscription will be downgraded to the ",i.createElement("b",null,null==(d=n.targetPackage)?void 0:d.displayName," plan")," ",g?i.createElement(i.Fragment,null,"on ",ce(n.scheduledExecutionTime)):u),line2:"Until then you still have access to your current plan"};case t.SubscriptionScheduleType.BillingPeriod:var f;return{line1:i.createElement(i.Fragment,null,"Your billing cycle will change to ",i.createElement("b",null,null==(f=n.scheduleVariables.billingPeriod)?void 0:f.toLocaleLowerCase())," ",c?i.createElement(i.Fragment,null,"on ",ce(n.scheduledExecutionTime)):u)};case t.SubscriptionScheduleType.UnitAmount:var v=n.scheduleVariables,y=h.compact(h.map(r,"feature")).find((function(e){return e.id===v.featureId}))||{},b=y.featureUnits,x=1===v.newUnitAmount?b:y.featureUnitsPlural;return{line1:i.createElement(i.Fragment,null,"Your subscription will be updated to ",i.createElement("b",null,v.newUnitAmount)," ",x," ",c?i.createElement(i.Fragment,null,"on ",ce(n.scheduledExecutionTime)):u),line2:"Until then you still have access to your current "+b+" count"};default:return{}}}var ue,de=a(g,{target:"e199qof96"})({name:"1a2afmv",styles:"margin-left:10px"}),ge=a("button",{target:"e199qof95"})("cursor:",(function(e){return e.$disabled?"default":"pointer"}),";padding:8px 12px;background-color:inherit;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedRestingBorder}),";border-radius:4px;display:flex;align-items:center;justify-content:center;width:fit-content;height:43px;min-width:120px;",(function(e){return e.$disabled&&c.css(le||(le=D(["\n opacity: 0.5;\n "])))})," &:hover{background-color:",(function(e){return e.$disabled?"inherit":e.theme.stigg.palette.outlinedHoverBackground}),";}"),pe=a(s.ArrowRight,{target:"e199qof94"})("color:",(function(e){return e.theme.stigg.palette.primary}),";margin-left:6px;"),me=a(oe,{target:"e199qof93"})("margin-left:6px;color:",(function(e){return e.theme.stigg.palette.primary}),";path{fill:",(function(e){return e.theme.stigg.palette.primary}),";}"),he=a(V,{target:"e199qof92"})({name:"h05omw",styles:"margin:0;font-size:15px"}),fe=a(V,{target:"e199qof91"})({name:"pam8ra",styles:"margin:0;padding:16px 0"}),ve=a("div",{target:"e199qof90"})("display:flex;flex-direction:column;margin-top:auto;align-self:",(function(e){return ie(e.theme.stigg.layout.ctaAlignment)}),";");function ye(e){var n=e.isNextPlan,a=e.customer,l=e.plan,o=e.billingPeriod,s=e.isCustomerOnTrial,u=e.onPlanSelected,d=e.paywallLocale,g=c.useTheme(),p=r.useState(!1),m=p[0],f=p[1],v=d.planCTAButton,y=v.currentPlan,b=v.custom,x=v.downgrade,w=v.startTrial,E=v.upgrade,P=v.startNew,C=v.switchToBillingPeriod,S=v.cancelScheduledUpdate,U=h.isFunction(x)?x(l):x,k=h.isFunction(E)?E(l):E,M={title:a?l.isLowerThanCurrentPlan?U:k:P,disabled:!1,icon:i.createElement(pe,null),intentionType:l.isLowerThanCurrentPlan?exports.SubscribeIntentionType.DOWNGRADE_PLAN:s?exports.SubscribeIntentionType.UPGRADE_TRIAL_TO_PAID:exports.SubscribeIntentionType.UPGRADE_PLAN},N=l.pricingType===t.PricingType.Custom,T=se({scheduledUpdate:l.scheduledUpdate,options:{withDate:!0}}).line1;!l.isTriable||l.isCurrentCustomerPlan||s?l.isCurrentCustomerPlan&&!s?o===l.currentCustomerPlanBillingPeriod||l.pricingType&&[t.PricingType.Free,t.PricingType.Custom].includes(l.pricingType)?(M.title=y,M.disabled=!0,M.icon=null):(M.title=C(o),M.intentionType=exports.SubscribeIntentionType.CHANGE_BILLING_PERIOD):N&&(M.title=b,M.intentionType=exports.SubscribeIntentionType.REQUEST_CUSTOM_PLAN_ACCESS):(M.title=w(l),M.intentionType=exports.SubscribeIntentionType.START_TRIAL),n&&l.scheduledUpdate&&(M.disabled=!1,M.title=S,M.intentionType=exports.SubscribeIntentionType.CANCEL_SCHEDULED_UPDATES,M.icon=i.createElement(me,null));var B=m||M.disabled;return i.createElement(i.Fragment,null,n&&T&&i.createElement(V,{color:"secondary",variant:"body1",style:{marginBottom:24},className:"stigg-paywall-schedule-update-text"},T),i.createElement(ve,{className:"stigg-paywall-plan-button-layout"},l.isCurrentCustomerPlan&&l.trialDaysLeft&&i.createElement(fe,{className:"stigg-trial-days-left-text",variant:"h6",color:"secondary"},i.createElement("b",null,l.trialDaysLeft," days")," left on your free trial"),i.createElement(ge,{className:"stigg-paywall-plan-button","data-testid":"paywall-card-cta-"+l.displayName,disabled:B,$disabled:B,onClick:function(){f(!0),Promise.resolve(u(M.intentionType)).finally((function(){return f(!1)}))}},i.createElement(he,{className:"stigg-paywall-plan-button-text",variant:"h6",color:"primary.main"},M.title),m?i.createElement(de,{color:g.stigg.palette.text.disabled,loading:!0,size:16}):M.icon)))}function be(){return(be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var xe=function(e){return r.createElement("svg",be({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ue||(ue=r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.954 1.034A1 1 0 0 1 6.3 2.287a5.666 5.666 0 1 0 7.367 5.406 1 1 0 0 1 2 0c0 .23-.01.458-.03.684.01.072.012.147.006.223l-.004.049a1 1 0 0 1-.078.312A7.668 7.668 0 1 1 5.7.38a1 1 0 0 1 1.254.654Zm.614.239A1 1 0 0 1 8.648.36l.05.004a1 1 0 1 1-.182 1.992l-.037-.003a1 1 0 0 1-.911-1.081Zm4.85 1.636a1 1 0 0 1 1.41.11l.064.076a1 1 0 1 1-1.537 1.28 4.154 4.154 0 0 0-.047-.056 1 1 0 0 1 .11-1.41ZM9 5.334a1 1 0 0 0-2 0V8a1 1 0 0 0 1 1h2.667a1 1 0 1 0 0-2H9V5.334Z",fill:"#7586B0"})))},we=a("div",{target:"eacdu8d11"})("position:relative;background-color:",(function(e){var t=e.theme;return e.$isCurrentPlan?t.stigg.palette.backgroundHighlight:t.stigg.palette.backgroundPaper}),";border:",(function(e){var t=e.theme;return e.$isHighlighted?"3px solid "+t.stigg.palette.primary:"1px solid "+t.stigg.palette.outlinedBorder}),";border-radius:10px;padding:",(function(e){return e.theme.stigg.layout.planPadding}),";display:flex;min-width:",(function(e){return e.theme.stigg.layout.planMinWidth}),";max-width:",(function(e){return e.theme.stigg.layout.planMaxWidth}),";flex-direction:column;align-items:flex-start;justify-content:flex-start;position:relative;"),Ee=a(V,{target:"eacdu8d10"})({name:"1u53ekv",styles:"padding-bottom:16px"}),Pe=a(V,{target:"eacdu8d9"})({name:"1sdjnkx",styles:"word-break:break-word"}),Ce=a(V,{target:"eacdu8d8"})({name:"1bmnxg7",styles:"white-space:nowrap"}),Se=a(V,{target:"eacdu8d7"})({name:"1hizjpa",styles:"white-space:normal"});function Ue(e){var n=function(e,n,r,i,a){switch(e.pricingType){case t.PricingType.Free:return"function"==typeof r.price.free?r.price.free(e.paywallCurrency):r.price.free;case t.PricingType.Custom:return{price:r.price.custom};case t.PricingType.Paid:var l,o=e.pricePoints.filter((function(e){return e.billingPeriod===n})),c=null==(l=e.paywallCalculatedPricePoints)?void 0:l.find((function(e){return e.billingPeriod===n}));if(!(null!=o&&o.length||c))return{price:r.price.priceNotSet};var s={planPrices:o,paywallCalculatedPrice:c,selectedBillingPeriod:n};return r.price.paid?r.price.paid(j({},s,{plan:e})):function(e){var n=e.planPrices,r=e.shouldShowMonthlyPriceAmount,i=e.paywallCalculatedPrice||n[0],a=i.amount,l=1===n.length,o=_({amount:e.selectedBillingPeriod===t.BillingPeriod.Annually&&r?a/12:a,currency:i.currency,locale:e.locale});if(l){var c,s=n[0];if(s.pricingModel===t.BillingModel.PerUnit){var u,d=(null==(u=s.feature)?void 0:u.units)||"";return{price:o,unit:r?"per "+d+" / month":"per "+d+" / year"}}if(s.pricingModel===t.BillingModel.UsageBased)return{price:o,unit:"/ "+((null==(c=s.feature)?void 0:c.units)||"")}}return{price:o,unit:r?"/ month":"/ year"}}(j({},s,{locale:i,shouldShowMonthlyPriceAmount:a}));default:return{price:""}}}(e.plan,e.billingPeriod,e.paywallLocale,e.locale,e.shouldShowMonthlyPriceAmount),r=n.unit;return i.createElement(Pe,{className:"stigg-price-text"},i.createElement(i.Fragment,null,i.createElement(Se,{span:!0,variant:"h1"},n.price),r&&i.createElement(Ce,{span:!0,variant:"h6"}," ",r)))}function ke(e){var t=e.billingPeriod,n=e.hasMonthlyPrice,r=e.hasAnnuallyPrice,a="";return e.plan.pricePoints.find((function(e){return e.billingPeriod===t}))&&n&&r&&(a="billed "+t.toLowerCase()),i.createElement(V,{className:"stigg-price-billing-period-text",variant:"body1",color:"disabled"},a)}var Me=a("div",{target:"eacdu8d6"})("margin-top:",(function(e){return e.$withMargin?"30px":"0"}),";height:2px;width:50px;background-color:",(function(e){return e.theme.stigg.palette.primary}),";"),Ne=a(V,{target:"eacdu8d5"})("text-align:",(function(e){return e.theme.stigg.layout.descriptionAlignment}),";min-height:",(function(e){return e.theme.stigg.layout.descriptionMinHeight}),";margin-top:16px;"),Te=a("div",{target:"eacdu8d4"})("background-color:",(function(e){return e.theme.stigg.palette.primary}),";border-radius:40px;position:absolute;top:-12px;"),Be=a(V,{target:"eacdu8d3"})({name:"a8c38r",styles:"margin:0;padding:2px 8px"}),Le=a("div",{target:"eacdu8d2"})("width:100%;display:flex;flex-direction:column;align-items:",(function(e){return ie(e.theme.stigg.layout.headerAlignment)}),";"),Ae=a("div",{target:"eacdu8d1"})("position:absolute;top:0;background-color:",(function(e){return e.theme.stigg.palette.outlinedBorder}),";border-radius:0px 0px 10px 10px;padding:3px 12px;"),Fe=a(xe,{target:"eacdu8d0"})("display:flex;height:100%;margin-right:4;path{fill:",(function(e){return e.theme.stigg.palette.text.primary}),";}");function Oe(e){var t=e.text,n=void 0===t?"Next":t;return i.createElement(Ae,null,i.createElement(v.Grid,{display:"flex",alignItems:"center",gap:1},i.createElement(Fe,{$iconsColor:e.iconsColor}),i.createElement(V,{color:"primary",variant:"body1"},n)))}function je(e){var t,n=e.customer,r=e.plan,a=e.billingPeriod,l=e.isHighlighted,o=e.currentSubscription,c=e.shouldShowDescriptionSection,s=e.hasMonthlyPrice,u=e.hasAnnuallyPrice,d=e.isCustomerOnTrial,g=e.onPlanSelected,p=e.paywallLocale,m=e.locale,h=e.withStartingAtRow,v=r.isNextPlan&&r.isNextPlan(a),y=r.pricePoints.filter((function(e){return e.billingPeriod===a})),b=null==(t=r.paywallCalculatedPricePoints)?void 0:t.find((function(e){return e.billingPeriod===a})),x=y.length>1&&!(null==b||!b.additionalChargesMayApply),w=null;return v?w=i.createElement(Oe,{text:"Next plan"}):l&&p.highlightChip&&(w=i.createElement(Te,{className:"stigg-highlight-badge"},i.createElement(Be,{className:"stigg-highlight-badge-text",color:"white",bold:!0},p.highlightChip))),i.createElement(we,{className:f("stigg-plan-offering-container",{"stigg-current-plan":r.isCurrentCustomerPlan}),$isHighlighted:l,$isCurrentPlan:r.isCurrentCustomerPlan},w,i.createElement(Le,{className:"stigg-header-wrapper"},i.createElement(Ee,{className:"stigg-plan-header",variant:"h3"},r.displayName),h&&i.createElement(V,{className:"stigg-starting-at-text",variant:"body1",color:"secondary"},x?p.price.startingAtCaption:""),i.createElement(Ue,{plan:r,billingPeriod:a,paywallLocale:p,locale:m,shouldShowMonthlyPriceAmount:s}),i.createElement(ke,{plan:r,billingPeriod:a,hasAnnuallyPrice:u,hasMonthlyPrice:s}),c&&i.createElement(Ne,{className:"stigg-plan-description",variant:"h6",color:"secondary"},r.description),i.createElement(Me,{className:"stigg-plan-header-divider",$withMargin:!c})),i.createElement(ne,{plan:r,billingPeriod:a,paywallLocale:p}),i.createElement(ye,{isNextPlan:v,customer:n,plan:r,currentSubscription:o,billingPeriod:a,isCustomerOnTrial:d,onPlanSelected:g,paywallLocale:p}))}var Ie,De=a("div",{target:"esqa6i42"})("height:40px;padding:0 20px;margin-bottom:",(function(e){return e.theme.stigg.layout.switchBottomSpacing}),";border-radius:10px;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";background-color:",(function(e){return e.theme.stigg.palette.backgroundPaper}),";display:flex;align-items:center;justify-content:center;"),Re=a(V,{target:"esqa6i41"})({name:"zvmrfm",styles:"margin:0 8px"}),_e=a(y,{target:"esqa6i40"})("& .react-switch-bg{border:",(function(e){return"1px solid "+e.theme.stigg.palette.switchBorder}),";background:",(function(e){return e.theme.stigg.palette.switchFill}),"!important;}& .react-switch-handle{box-shadow:",(function(e){return e.theme.stigg.shadows.light}),";background:",(function(e){return e.theme.stigg.palette.switchHandle}),"!important;top:0.5px!important;}");function We(e){return i.createElement(V,{variant:"h6",color:e.disabled?"disabled":"primary",className:"stigg-discount-rate-text"},e.discount,"% off")}function He(e){var n=e.discountRate,r=e.onBillingPeriodChanged;if(e.availableBillingPeriods.length<=1)return null;var a=e.selectedBillingPeriod===t.BillingPeriod.Monthly;return i.createElement(De,{className:"stigg-period-picker-container"},i.createElement(Re,{variant:"h6",className:"stigg-monthly-period-text",color:a?"primary":"disabled"},"Monthly"),i.createElement(_e,{className:"stigg-period-switch",uncheckedIcon:!1,checkedIcon:!1,height:16,width:33,onChange:function(e){return r(e?t.BillingPeriod.Annually:t.BillingPeriod.Monthly)},checked:!a,borderRadius:10,handleDiameter:19}),i.createElement(Re,{variant:"h6",className:"stigg-annual-period-text",color:a?"disabled":"primary"},"Annual"),i.createElement(We,{discount:n,disabled:a}))}function Ze(){return(Ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var $e=a((function(e){return r.createElement("svg",Ze({width:135,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Ie||(Ie=r.createElement("path",{d:"M.099 3.43v9.558h1.057V9.527h2.81c1.983 0 3.323-1.275 3.323-3.049 0-1.773-1.34-3.048-3.324-3.048H.1Zm1.057 5.127v-4.15h2.889c1.289 0 2.143.855 2.143 2.071 0 1.217-.854 2.079-2.143 2.079h-2.89ZM11.779 13.162c2.129 0 3.873-1.622 3.873-3.78 0-2.165-1.715-3.758-3.844-3.758-2.158 0-3.874 1.622-3.874 3.787 0 2.158 1.687 3.75 3.845 3.75Zm.014-.934c-1.556 0-2.773-1.202-2.773-2.832 0-1.629 1.216-2.83 2.773-2.83 1.528 0 2.773 1.201 2.773 2.83 0 1.63-1.245 2.832-2.773 2.832ZM19.905 12.988l1.572-6.046h.029l1.556 6.046h1.34l2.194-7.183h-1.18l-1.622 6.104h-.03l-1.549-6.104h-1.433l-1.55 6.104h-.029l-1.65-6.104h-1.195l2.208 7.183h1.34ZM34.983 9.425c0-2.121-1.578-3.8-3.83-3.8-2.1 0-3.845 1.556-3.845 3.786 0 2.143 1.6 3.75 3.874 3.75 1.586 0 2.875-.767 3.497-1.969l-.897-.485c-.413.898-1.412 1.528-2.585 1.528-1.673 0-2.694-1.246-2.795-2.513h6.567c.014-.13.014-.18.014-.297ZM31.14 6.551c1.404 0 2.527.948 2.715 2.259h-5.423a2.745 2.745 0 0 1 2.708-2.26ZM39.592 5.682c-1.028 0-1.774.521-2.1 1.253l-.101-1.13h-.905v7.183h1.057V8.564c0-1.115.615-1.789 1.774-1.789h.68V5.682h-.405ZM48.249 9.425c0-2.121-1.579-3.8-3.83-3.8-2.1 0-3.845 1.556-3.845 3.786 0 2.143 1.6 3.75 3.873 3.75 1.586 0 2.875-.767 3.497-1.969l-.897-.485c-.413.898-1.412 1.528-2.585 1.528-1.673 0-2.694-1.246-2.795-2.513h6.567c.015-.13.015-.18.015-.297Zm-3.845-2.874c1.404 0 2.527.948 2.715 2.259h-5.423a2.745 2.745 0 0 1 2.708-2.26ZM55.846 7.029c-.63-.89-1.644-1.398-2.831-1.398-2.093 0-3.773 1.586-3.773 3.765 0 2.18 1.651 3.766 3.744 3.766 1.195 0 2.23-.522 2.867-1.42l.145 1.246h.905V2.56l-1.057.116V7.03Zm-2.817 5.199c-1.498 0-2.7-1.188-2.7-2.832 0-1.643 1.202-2.83 2.7-2.83a2.787 2.787 0 0 1 2.817 2.83 2.787 2.787 0 0 1-2.817 2.832ZM65.731 5.631c-1.194 0-2.222.514-2.86 1.412V2.561l-1.057.116v10.31h.905l.145-1.237c.63.898 1.644 1.412 2.838 1.412 2.093 0 3.773-1.586 3.773-3.766 0-2.179-1.651-3.765-3.744-3.765Zm-.043 6.597a2.787 2.787 0 0 1-2.817-2.832 2.787 2.787 0 0 1 2.817-2.83c1.499 0 2.7 1.187 2.7 2.83 0 1.644-1.201 2.832-2.7 2.832ZM76.219 5.805v4.113c0 1.412-.905 2.266-2.172 2.266-1.26 0-1.97-.738-1.97-2.07V5.804H71.02v4.468c0 1.694 1.115 2.824 2.744 2.824 1.079 0 1.926-.42 2.455-1.116v.913c0 1.267-.956 2.186-2.346 2.186-1.123 0-2.05-.6-2.288-1.65l-.927.477C71.1 15.16 72.308 16 73.858 16c1.955 0 3.418-1.405 3.418-3.208V5.805h-1.057ZM108.672 10.487c0 1.42-1.261 2.3-3.181 2.3-1.027 0-1.857-.184-2.651-.578.074-.449.142-.99.16-1.618.738.43 1.575.64 2.381.64.959 0 1.458-.221 1.458-.689.018-.461-.339-.67-1.772-.947-1.661-.332-2.399-1.021-2.399-2.24 0-1.377 1.261-2.27 3.18-2.27.849 0 1.692.16 2.338.437l-.32 1.544a4.803 4.803 0 0 0-2.018-.43c-.898 0-1.341.221-1.341.658 0 .381.308.541 1.71.83 1.79.382 2.461 1.07 2.461 2.35l-.006.013Zm4.207.609c-.719 0-1.298-.382-1.298-1.39V6.887h1.827l.339-1.63h-2.166v-2.32a9.976 9.976 0 0 1-1.9.345l-.019 6.748c0 1.84 1.101 2.769 2.75 2.769.375 0 .701-.037.978-.105l.363-1.729c-.228.08-.517.136-.874.136v-.006Zm2.086 1.593h1.919V5.258h-1.919v7.43Zm.965-10.47c-.621-.006-1.101.45-1.107 1.052 0 .621.455 1.089 1.071 1.095.621 0 1.082-.437 1.095-1.04.012-.62-.443-1.095-1.052-1.107h-.007Zm10.126 3.039v6.268c0 2.369-1.6 3.999-4.3 3.999-.972 0-2.042-.216-2.762-.628.498-.51.837-.953 1.052-1.273.486.166.996.252 1.519.252 1.71 0 2.578-.947 2.578-2.14v-.24c-.609.7-1.489 1.138-2.541 1.138-2.018 0-3.537-1.501-3.537-3.728 0-2.227 1.661-3.808 3.691-3.808 1.052 0 1.968.381 2.577 1.101l.062-.947h1.667l-.006.006Zm-1.901 3.648c0-1.181-.861-2.08-2.048-2.08-1.188 0-2.061.899-2.061 2.08 0 1.18.861 2.048 2.061 2.048 1.199 0 2.048-.898 2.048-2.048Zm10.839-3.648v6.268c0 2.369-1.6 3.999-4.3 3.999-.972 0-2.042-.216-2.762-.628.498-.51.837-.953 1.052-1.273.486.166.996.252 1.519.252 1.71 0 2.578-.947 2.578-2.14v-.24c-.609.7-1.489 1.138-2.541 1.138-2.017 0-3.537-1.501-3.537-3.728 0-2.227 1.661-3.808 3.691-3.808 1.052 0 1.968.381 2.577 1.101l.062-.947H135l-.006.006Zm-1.901 3.648c0-1.181-.861-2.08-2.048-2.08-1.188 0-2.061.899-2.061 2.08 0 1.18.861 2.048 2.061 2.048 1.199 0 2.048-.898 2.048-2.048ZM95.71 14.982c-.075.037-1.483.659-3.975.542A14.827 14.827 0 0 1 88.512 15l4.312-5.007c.77.197 1.76.381 2.885.436 2.492.123 3.9-.504 3.974-.541l-3.974 5.1v-.007Zm-6.441-9.62c-.708-2.393-.431-3.907-.413-3.987l-4.01 5.07c-.013.08-.29 1.592.412 3.985a14.98 14.98 0 0 0 1.273 3.008l3.845-5.37a15.042 15.042 0 0 1-1.107-2.7v-.006Zm9.996.529a14.561 14.561 0 0 0-1.815-3.882l-3.568 4.546.67 3.217c.4.056.794.092 1.194.117.203.006.406.012.603.012 1.931 0 3.008-.455 3.125-.51l.277-.123c.024-.665-.019-1.84-.48-3.384l-.006.007Zm-2.24-4.208A14.43 14.43 0 0 0 92.83.834c-1.605-.08-2.756.154-3.395.338l-.056.296c-.012.061-.258 1.494.4 3.74.11.381.246.756.394 1.132l3.285-.111 3.574-4.54-.006-.006Z",fill:"#001E6C"})))}),{target:"ee5i8qp1"})("*{fill:",(function(e){return e.theme.stigg.palette.text.secondary}),";}"),qe=a("div",{target:"ee5i8qp0"})("align-self:",(function(e){return e.$alignSelf||"unset"}),";@media (max-width: 1040px){align-self:center;}");function Ge(e){var t=e.source,n=e.style;return e.showWatermark?i.createElement(qe,{$alignSelf:e.align,className:"stigg-watermark",style:j({cursor:"pointer"},void 0===n?{}:n),onClick:function(){var e=window.location.hostname.replace("www.","");window.open("https://www.stigg.io/?utm_source="+e+"&utm_medium=referral&utm_campaign="+t,"_blank")}},i.createElement($e,null)):null}function ze(e,t){return e.some((function(e){return Ve(e,t)}))}function Ve(e,t){return e.pricePoints.some((function(e){return e.billingPeriod===t}))}var Ye,Qe=a("div",{target:"e19kubi82"})("color:",(function(e){return e.theme.stigg.palette.text.primary}),";display:flex;align-items:stretch;justify-content:center;flex-wrap:wrap;padding:10px 0;gap:",(function(e){return e.theme.stigg.layout.planMargin}),";"),Ke=a("div",{target:"e19kubi81"})({name:"1rdsyw8",styles:"display:flex;flex-direction:column;align-items:center;& *{box-sizing:border-box;}"}),Xe=a("div",{target:"e19kubi80"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),Je=function(e){var n=e.plans,a=e.customer,l=e.currentSubscription,o=e.highlightedPlanId,c=e.selectedBillingPeriod,s=e.onBillingPeriodChanged,u=e.availableBillingPeriods,d=e.isCustomerOnTrial,g=e.onPlanSelected,p=e.paywallLocale,h=e.locale,f=rt().stigg,v=function(e){return e.reduce((function(e,n){var r,i,a,l,o,c,s,u,d;null!=(r=n.paywallCalculatedPricePoints)&&r.length?(i=null==(l=n.paywallCalculatedPricePoints)||null==(o=l.find((function(e){return e.billingPeriod===t.BillingPeriod.Monthly})))?void 0:o.amount,a=null==(c=n.paywallCalculatedPricePoints)||null==(s=c.find((function(e){return e.billingPeriod===t.BillingPeriod.Annually})))?void 0:s.amount):(i=null==(u=n.pricePoints.find((function(e){return e.billingPeriod===t.BillingPeriod.Monthly})))?void 0:u.amount,a=null==(d=n.pricePoints.find((function(e){return e.billingPeriod===t.BillingPeriod.Annually})))?void 0:d.amount);var g,p,h=(p=a,m(g=i)||m(p)?null:Math.round((g-p/12)/g*100));return h&&(e=Math.max(e,h)),e}),0)}(n),y=n.some((function(e){return!!e.description})),b=ze(n,t.BillingPeriod.Monthly),x=ze(n,t.BillingPeriod.Annually),w=function(e,n){return e.filter((function(e){return e.pricingType!==t.PricingType.Paid||Ve(e,n)}))}(n,c),E=r.useCallback((function(e,t){return g({plan:e,customer:a,subscription:l,intentionType:t,selectedBillingPeriod:c})}),[a,c]),P=w.some((function(e){var t,n=e.pricePoints.filter((function(e){return e.billingPeriod===c})),r=null==(t=e.paywallCalculatedPricePoints)?void 0:t.find((function(e){return e.billingPeriod===c}));return n.length>1&&!(null==r||!r.additionalChargesMayApply)}));return i.createElement(Ke,{className:"stigg-paywall-container"},i.createElement(Xe,{className:"stigg-paywall-layout"},i.createElement(He,{onBillingPeriodChanged:s,selectedBillingPeriod:c,availableBillingPeriods:u,discountRate:v}),i.createElement(Qe,{className:"stigg-paywall-plans-layout"},w.map((function(e){return i.createElement(je,{key:e.id,shouldShowDescriptionSection:y,hasMonthlyPrice:b,hasAnnuallyPrice:x,plan:e,withStartingAtRow:P,currentSubscription:l,billingPeriod:c,isHighlighted:e.id===o,isCustomerOnTrial:d,onPlanSelected:function(t){return E(e,t)},paywallLocale:p,locale:h,customer:a})}))),i.createElement(Ge,{source:"paywall",align:"end",style:{marginTop:16},showWatermark:f.isWidgetWatermarkEnabled})))},et=(function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=Object.create((t&&t.prototype instanceof d?t:d).prototype),a=new P(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return{value:void 0,done:!0}}for(n.method=i,n.arg=a;;){var l=n.delegate;if(l){var o=x(l,n);if(o){if(o===u)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function d(){}function g(){}function p(){}var m={};o(m,i,(function(){return this}));var h=Object.getPrototypeOf,f=h&&h(h(C([])));f&&f!==t&&n.call(f,i)&&(m=f);var v=p.prototype=d.prototype=Object.create(m);function y(e){["next","throw","return"].forEach((function(t){o(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(i,a){function l(){return new t((function(r,l){!function r(i,a,l,o){var c=s(e[i],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,l,o)}),(function(e){r("throw",e,l,o)})):t.resolve(d).then((function(e){u.value=e,l(u)}),(function(e){return r("throw",e,l,o)}))}o(c.arg)}(i,a,r,l)}))}return r=r?r.then(l,l):l()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function C(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:S}}function S(){return{value:void 0,done:!0}}return g.prototype=p,o(v,"constructor",p),o(p,"constructor",g),g.displayName=o(p,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,o(e,l,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},y(b.prototype),o(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var l=new b(c(t,n,r,i),a);return e.isGeneratorFunction(n)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},y(v),o(v,l,"Generator"),o(v,i,(function(){return this})),o(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=C,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return l.type="throw",l.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var o=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(o&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(o){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var l=a?a.completion:{};return l.type=e,l.arg=t,a?(this.method="next",this.next=a.finallyLoc,u):this.complete(l)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(Ye={exports:{}}),Ye.exports),tt=new(function(){function e(){}var t=e.prototype;return t.error=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];console.error(e,t||{},r)},t.log=function(e,t){console.log(e,t||{})},t.debug=function(e,t){console.debug(e,t||{})},e}()),nt=i.createContext(null);nt.displayName="StiggContext";var rt=function(){var e=r.useContext(nt);if(!e)throw new Error("Could not find Stigg context; You need to wrap your app in an <StiggProvider> component.");return e};function it(e,n){var r=e.flatMap((function(e){return e.pricePoints})).map((function(e){return e.billingPeriod})),i=h.countBy(r),a=h.uniq(r);return{defaultBillingPeriod:n&&a.includes(n)?n:(i[t.BillingPeriod.Monthly]||0)>(i[t.BillingPeriod.Annually]||0)?t.BillingPeriod.Monthly:t.BillingPeriod.Annually,availableBillingPeriods:a}}function at(e,t){if(void 0===t&&(t="px"),e)return""+e+t}function lt(e,n){if(!n)return e;switch(n){case t.FontWeight.Normal:return"normal";case t.FontWeight.Bold:return"bold";default:return"normal"}}function ot(e){var t,n,r,i,a,l,o,c,s=e.typography;return{fontFamilyUrl:(null==s?void 0:s.fontFamily)||void 0,h1:{fontSize:at(null==s||null==(t=s.h1)?void 0:t.fontSize),fontWeight:lt("bold",null==s||null==(n=s.h1)?void 0:n.fontWeight)},h2:{fontSize:at(null==s||null==(r=s.h2)?void 0:r.fontSize),fontWeight:lt("normal",null==s||null==(i=s.h2)?void 0:i.fontWeight)},h3:{fontSize:at(null==s||null==(a=s.h3)?void 0:a.fontSize),fontWeight:lt("normal",null==s||null==(l=s.h3)?void 0:l.fontWeight)},body:{fontSize:at(null==s||null==(o=s.body)?void 0:o.fontSize),fontWeight:lt("normal",null==s||null==(c=s.body)?void 0:c.fontWeight)}}}function ct(e){if(e)switch(e){case t.Alignment.Left:return"left";case t.Alignment.Center:return"center";case t.Alignment.Right:return"right"}}var st,ut=a("div",{target:"e1f7khji6"})({name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}),dt=a(H,{target:"e1f7khji5"})({name:"o7nnmj",styles:"margin-right:16px"}),gt=a("div",{target:"e1f7khji4"})("display:flex;flex-direction:column;align-items:flex-start;gap:20px;border-radius:10px;padding:",(function(e){return e.theme.stigg.layout.planPadding}),";background-color:",(function(e){return e.theme.stigg.palette.backgroundPaper}),";min-width:",(function(e){return e.theme.stigg.layout.planMinWidth}),";max-width:",(function(e){return e.theme.stigg.layout.planMaxWidth}),";min-height:450px;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";"),pt=a("div",{target:"e1f7khji3"})("display:flex;gap:",(function(e){return e.theme.stigg.layout.planMargin}),";flex-wrap:wrap;justify-content:center;"),mt=a("div",{target:"e1f7khji2"})({name:"k8xojc",styles:"display:flex;align-items:center;margin-bottom:12px"}),ht=a("div",{target:"e1f7khji1"})({name:"xdvdnl",styles:"margin-top:auto"}),ft=a("div",{target:"e1f7khji0"})("width:150px;margin-bottom:",(function(e){return e.theme.stigg.layout.switchBottomSpacing}),";padding:12px 12px;border-radius:10px;background-color:white;border:",(function(e){return"1px solid "+e.theme.stigg.palette.outlinedBorder}),";");function vt(){return i.createElement(gt,null,i.createElement(x,{width:120,borderRadius:4}),i.createElement(x,{circle:!0,width:40,height:40}),i.createElement(x,{style:{marginBottom:33},width:120,borderRadius:4}),i.createElement(mt,null,i.createElement(dt,null),i.createElement(x,{width:120,borderRadius:4})),i.createElement(mt,null,i.createElement(dt,null),i.createElement(x,{width:120,borderRadius:4})),i.createElement(mt,null,i.createElement(dt,null),i.createElement(x,{width:120,borderRadius:4})),i.createElement(ht,null,i.createElement(x,{height:50,borderRadius:4})))}function yt(){return i.createElement(ut,{className:"stigg-skeleton-loader-container"},i.createElement(ft,{className:"stigg-skeleton-loader-billing-period"},i.createElement(x,{borderRadius:4})),i.createElement(pt,{className:"stigg-skeleton-loader-plans-container"},i.createElement(vt,null),i.createElement(vt,null),i.createElement(vt,null)))}var bt,xt=function(e){var t=e.externalFontUrl;return i.createElement(c.Global,{styles:c.css(st||(st=D(["\n ","\n\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZ2IHTWEBlwu8Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Hp2ywxg089UriCZOIHTWEBlw.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriAWCrCBamC3YU-CnE6Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriAWCrCBimC3YU-Ck.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin-ext */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriASitCBamC3YU-CnE6Q.woff2) format('woff2');\n unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'DM Sans';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/dmsans/v11/rP2Cp2ywxg089UriASitCBimC3YU-Ck.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074,\n U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n "])),t&&"\n @font-face {\n font-family: 'custom-font';\n font-style: normal;\n font-weight: normal;\n src: local('custom-font'), url("+t+") format('woff');\n }\n ")})},wt=a("div",{target:"emcdfp60"})((function(e){var t=e.customCss;return t&&c.css(bt||(bt=D(["\n ","\n "])),t)}),";");function Et(e){var t,n,r,i,a,l,o,c=rt(),s=h.merge(e,c.theme);return a=u((null==(t=s)||null==(n=t.palette)?void 0:n.primary)||"#327EEE"),l=u((null==t||null==(r=t.palette)||null==(i=r.text)?void 0:i.primary)||"#001E6C"),o={palette:{primary:a.hex(),backgroundPaper:"#FFFFFF",backgroundHighlight:"#F5F6F9",backgroundSection:a.alpha(.1).toString(),outlinedBorder:"#C4CBDD",outlinedRestingBorder:a.alpha(.5).toString(),outlinedHoverBackground:a.lightness(95).hex(),switchBorder:a.lighten(.1).hex(),switchFill:a.lighten(.5).hex(),switchHandle:a.hex(),warning:"#ed6c02",error:"#f44336",white:"#FFFFFF",text:{primary:l.hex(),secondary:l.alpha(.75).toString(),disabled:l.alpha(.5).toString()}},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"},h2:{fontSize:"24px",fontWeight:"normal"},h3:{fontSize:"16px",fontWeight:"normal"},body:{fontSize:"14px",fontWeight:"normal"},caption:{fontSize:"12px",fontWeight:"normal"}},customCss:""},d(o,t)}function Pt(e){var t=e.typography,n=Number(t.body.fontSize.replace("px",""))/14;return{pxToRem:function(e){return e/16*n+"rem"},bodyFontFamily:t.fontFamily,headingFontFamily:t.fontFamily,fontSizes:[t.h1.fontSize,t.h2.fontSize,t.h3.fontSize,t.body.fontSize,"12px","10px"]}}var Ct=function(e){var t=e.children,n=Et(e.componentTheme);return i.createElement(E.ThemeProvider,{theme:E.createTheme({stigg:n})},i.createElement(c.ThemeProvider,{theme:{stigg:n}},i.createElement(wt,{customCss:n.customCss},i.createElement(xt,{externalFontUrl:n.typography.fontFamilyUrl}),i.createElement(P.ThemeProvider,{theme:{typography:Pt(n)}},t))))},St=i.createContext(null);St.displayName="CustomerPortalContext";var Ut=function(){var e=r.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 kt(e){var t,n,a,l,o,c,s,u=e.children,g=e.textOverrides,p=e.theme,m=e.resourceId,h=e.productId,f=rt().customerPortalUpdatedAt,v=function(e){var t=e.resourceId,n=e.productId,i=rt(),a=i.stigg,l=i.customerPortalUpdatedAt,o=r.useState(!1),c=o[0],s=o[1],u=r.useState(),d=u[0],g=u[1];return r.useEffect((function(){!function(){var e=O(et.mark((function e(){return et.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.isCustomerLoaded){e.next=15;break}return e.prev=1,s(!0),e.next=5,a.getCustomerPortal({resourceId:t,productId:n});case 5:g(e.sent),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),tt.error("Failed to load customer portal "+(null==e.t0?void 0:e.t0.message),e.t0);case 12:return e.prev=12,s(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[1,9,12,15]])})));return function(){return e.apply(this,arguments)}}()()}),[a,a.isCustomerLoaded,l,t]),{customerPortal:d,isLoading:c}}({resourceId:m,productId:h}),y=v.customerPortal,b=v.isLoading,x=null!=y&&y.configuration?function(e){var t=e.palette;return{palette:{primary:(null==t?void 0:t.primary)||void 0,backgroundPaper:(null==t?void 0:t.paywallBackgroundColor)||void 0,outlinedBorder:(null==t?void 0:t.borderColor)||void 0,backgroundHighlight:(null==t?void 0:t.currentPlanBackground)||void 0,text:{primary:(null==t?void 0:t.textColor)||void 0}},typography:ot(e)}}(y.configuration):void 0,w=(t=Et(x),a=null==y?void 0:y.configuration,{sectionTitleColor:(null==(n=p)?void 0:n.sectionTitleColor)||t.palette.text.secondary,planNameColor:(null==n?void 0:n.planNameColor)||t.palette.text.primary,backgroundColor:(null==n?void 0:n.backgroundColor)||(null==a||null==(l=a.palette)?void 0:l.backgroundColor)||"white",borderColor:(null==n?void 0:n.borderColor)||(null==a||null==(o=a.palette)?void 0:o.borderColor)||"rgba(0, 30, 108, 0.15)",listItemBackgroundColor:(null==n?void 0:n.backgroundColor)||(null==a||null==(c=a.palette)?void 0:c.backgroundColor)||"white",tabMaxHeight:(null==n?void 0:n.tabMaxHeight)||"380px",iconsColor:(null==n?void 0:n.iconsColor)||(null==a||null==(s=a.palette)?void 0:s.iconsColor)||void 0,iconsBackgroundColor:null==n?void 0:n.iconsBackgroundColor}),E=d({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 update"},g);return i.createElement(Ct,{componentTheme:x},i.createElement(St.Provider,{key:null==f?void 0:f.toString(),value:{customerPortal:y,isLoading:b,textOverrides:E,theme:w,resourceId:m}},u))}var Mt,Nt=a(S,{target:"emvioms0"})("border-radius:10px;padding:8px 16px;text-transform:none;&,&:hover{border-color:",(function(e){return e.theme.stigg.palette.outlinedRestingBorder}),";}");function Tt(){return(Tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Bt=function(e){return r.createElement("svg",Tt({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Mt||(Mt=r.createElement("path",{clipRule:"evenodd",d:"M13.333 2.5 17.5 6.667 6.667 17.5H2.5v-4.167L13.333 2.5v0Z",stroke:"#327EEE",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},Lt=a("div",{target:"ewz8krb0"})("display:flex;align-items:center;justify-content:space-between;",(function(e){return!e.$disableMargin&&"\n &:not(:last-child) {\n margin-bottom: 32px;\n }\n "}),";");function At(e){var t=e.title,n=e.className,r=e.isLoading,a=Ut().theme;return r?i.createElement(x,{width:120}):i.createElement(V,{className:n,overrideColor:a.sectionTitleColor,variant:"h3",bold:!0},t)}var Ft=a(Bt,{target:"e1fjw26b0"})("path{stroke:",(function(e){return e.theme.stigg.palette.primary}),";}");function Ot(e){var t=e.onManageSubscription,n=e.hideManageButton,r=e.textOverrides;return i.createElement(Lt,{className:"stigg-customer-portal-overview-header",$disableMargin:!0},i.createElement(At,{title:"Subscription",className:"stigg-overview-title"}),!n&&i.createElement(Nt,{className:"stigg-manage-subscription-button",variant:"outlined",onClick:t},i.createElement(Ft,{className:"stigg-manage-subscription-button-image"}),i.createElement(V,{className:"stigg-manage-subscription-button-text",color:"primary.main",style:{marginLeft:"8px"},variant:"body1"},null==r?void 0:r.manageSubscription)))}function jt(){var e=Ut().customerPortal,t=U(null==e?void 0:e.subscriptions,(function(e){return e.addons}));return N(t)?null:i.createElement("div",{className:"stigg-addons-list-layout"},t.map((function(e,n){return i.createElement(V,{key:e.addonId,span:!0,className:"stigg-addon-list-item-text",variant:"body1"},e.quantity>1&&e.quantity+" X ",e.displayName,n===t.length-1?"":", ")})))}var It=a("div",{target:"e1g6q2f50"})("display:flex;justify-content:space-between;align-items:center;gap:64px;border-bottom:",(function(e){return"1px solid "+e.$borderColor}),";padding:16px 0;&>*:first-child{max-width:60%;}");function Dt(){var e=Ut(),t=e.customerPortal,n=e.theme,r=null==t?void 0:t.promotionalEntitlements;return i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(V,{color:"secondary"},e.textOverrides.promotionsSubtitle),i.createElement("div",{style:{display:"flex",flexDirection:"column"}},i.createElement(It,{$borderColor:n.borderColor},i.createElement(V,{variant:"body1",bold:!0},"Feature"),i.createElement(V,{variant:"body1",bold:!0},"Expiration date")),null==r?void 0:r.map((function(e){return i.createElement(It,{$borderColor:n.borderColor},i.createElement(V,{variant:"body1"},function(e){var t,n=e.displayName;return e.hasUnlimitedUsage?"Unlimited "+n:e.usageLimit?n+" x "+(null==(t=e.usageLimit)?void 0:t.toLocaleString()):n}(e)),i.createElement(V,{variant:"body1",color:"disabled"},e.endDate?p.utc(e.endDate).format("MMM Do, YYYY"):"None"))}))))}var Rt,_t,Wt,Ht,Zt,$t,qt,Gt,zt,Vt,Yt,Qt,Kt,Xt,Jt,en,tn,nn,rn,an,ln,on,cn,sn=a(T,{target:"exlfw3j3"})({name:"jlwfj4",styles:".MuiTabs-indicator{background-color:#001e6c;}"}),un=a("div",{target:"exlfw3j2"})({name:"1dqkbz0",styles:"width:100%;flex:1;margin-top:16px"}),dn=a(k,{target:"exlfw3j1"})("margin-top:16px;max-height:",(function(e){return e.$maxHeight}),";overflow-y:auto;");function gn(){return(gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function pn(){return(pn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function mn(){return(mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function hn(){return(hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function fn(){return(fn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function vn(){return(vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function yn(){return(yn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function bn(){return(bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function xn(){return(xn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var wn,En,Pn,Cn={RenewSubscription:function(e){return r.createElement("svg",gn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Rt||(Rt=r.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),_t||(_t=r.createElement("path",{clipRule:"evenodd",d:"M9 12a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H11a2 2 0 0 1-2-2V12Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Wt||(Wt=r.createElement("path",{d:"M22 8v4M14 8v4M9 16h18",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},BillingInfoCustomer:function(e){return r.createElement("svg",pn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Ht||(Ht=r.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Zt||(Zt=r.createElement("path",{d:"M26 27v-2a4 4 0 0 0-4-4h-8a4 4 0 0 0-4 4v2",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),$t||($t=r.createElement("path",{clipRule:"evenodd",d:"M18 17a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z",stroke:"#7586B0",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},CreditCard:function(e){return r.createElement("svg",mn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),qt||(qt=r.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Gt||(Gt=r.createElement("path",{d:"M26 10H10c-1.11 0-1.99.89-1.99 2L8 24c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V12c0-1.11-.89-2-2-2Zm0 14H10v-6h16v6Zm0-10H10v-2h16v2Z",fill:"#7586B0"})))},ScheduleBox:function(e){return r.createElement("svg",hn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),zt||(zt=r.createElement("rect",{width:36,height:36,rx:10,fill:"url(#schedule-box_svg__a)"})),Vt||(Vt=r.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),Yt||(Yt=r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.954 7.7a1 1 0 0 1-.654 1.254 8.998 8.998 0 0 0-1.543 16.523A9 9 0 0 0 27 17.54a1 1 0 1 1 2 0c0 .357-.017.713-.052 1.066.018.089.024.182.017.278l-.004.047a.997.997 0 0 1-.101.361A11 11 0 1 1 14.7 7.046a1 1 0 0 1 1.254.654Zm1.896.252a1 1 0 0 1 1.08-.912l.048.004a1 1 0 1 1-.178 1.992l-.038-.003a1 1 0 0 1-.912-1.081ZM22.858 9.2a1 1 0 0 1 1.391-.254l.078.054a1 1 0 1 1-1.152 1.635 8.98 8.98 0 0 0-.063-.044 1 1 0 0 1-.254-1.391Zm3.748 3.609a1 1 0 0 1 1.332.473l.04.085a1 1 0 1 1-1.813.844l-.014-.031-.019-.039a1 1 0 0 1 .474-1.332ZM19 14a1 1 0 1 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 1 0 0-2h-3v-3Z",fill:"#7586B0"})),Qt||(Qt=r.createElement("defs",null,r.createElement("linearGradient",{id:"schedule-box_svg__a",x1:35.02,y1:1.224,x2:0,y2:36,gradientUnits:"userSpaceOnUse"}))))},ScheduleClock:function(e){return r.createElement("svg",fn({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Kt||(Kt=r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.954 1.7A1 1 0 0 1 9.3 2.954a8.998 8.998 0 0 0-5.615 12.03A9 9 0 0 0 21 11.54a1 1 0 1 1 2 0c0 .357-.017.713-.052 1.066.018.089.024.182.017.278l-.004.047a.997.997 0 0 1-.101.361A11 11 0 1 1 8.7 1.046a1 1 0 0 1 1.254.654Zm1.896.252a1 1 0 0 1 1.08-.912l.048.004a1 1 0 1 1-.178 1.992l-.039-.003a1 1 0 0 1-.911-1.081ZM16.858 3.2a1 1 0 0 1 1.391-.254l.078.054a1 1 0 1 1-1.152 1.635 9.7 9.7 0 0 0-.063-.044 1 1 0 0 1-.254-1.391Zm3.748 3.608a1 1 0 0 1 1.332.474l.04.085a1 1 0 1 1-1.813.844l-.014-.031-.019-.039a1 1 0 0 1 .474-1.333ZM13 8a1 1 0 1 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 1 0 0-2h-3V8Z",fill:"#7586B0"})))},Restore:oe,MiniSchedule:xe,DollarCoin:function(e){return r.createElement("svg",vn({width:21,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Xt||(Xt=r.createElement("g",{clipPath:"url(#dollar-coin_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M10.334 19.286A9.286 9.286 0 1 0 1.048 10a9.286 9.286 0 0 0 9.286 9.286Z"}),r.createElement("path",{d:"M12.765 7.46a1.903 1.903 0 0 0-1.796-1.27H9.494a1.7 1.7 0 0 0-.363 3.362l2.245.49a1.905 1.905 0 0 1-.407 3.768h-1.27c-.83 0-1.535-.53-1.797-1.27M10.334 6.19V4.287M10.334 15.714V13.81"}))),Jt||(Jt=r.createElement("defs",null,r.createElement("clipPath",{id:"dollar-coin_svg__a"},r.createElement("path",{fill:"#fff",transform:"translate(.333)",d:"M0 0h20v20H0z"})))))},Promotions:function(e){return r.createElement("svg",yn({width:24,height:25,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),en||(en=r.createElement("g",{clipPath:"url(#promotions_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M21.429 5.325H2.57c-.946 0-1.714.767-1.714 1.714v3.429c0 .947.768 1.714 1.714 1.714H21.43c.946 0 1.714-.768 1.714-1.714V7.039c0-.947-.768-1.714-1.714-1.714ZM21.429 12.182v9.429a1.714 1.714 0 0 1-1.715 1.714H4.286a1.714 1.714 0 0 1-1.714-1.714v-9.429M12 5.325v18M17.143 1.04 12 5.324 6.857 1.039"}))),tn||(tn=r.createElement("defs",null,r.createElement("clipPath",{id:"promotions_svg__a"},r.createElement("path",{fill:"#fff",transform:"translate(0 .182)",d:"M0 0h24v24H0z"})))))},Addons:function(e){return r.createElement("svg",bn({width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),nn||(nn=r.createElement("g",{clipPath:"url(#addons_svg__a)",stroke:"#7586B0",strokeWidth:1.714,strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M12 6.857v10.286M6.857 12h10.286M18 .857H6A5.143 5.143 0 0 0 .857 6v12A5.143 5.143 0 0 0 6 23.143h12A5.143 5.143 0 0 0 23.143 18V6A5.143 5.143 0 0 0 18 .857Z"}))),rn||(rn=r.createElement("defs",null,r.createElement("clipPath",{id:"addons_svg__a"},r.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))))},ContactSupport:function(e){return r.createElement("svg",xn({width:36,height:36,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),an||(an=r.createElement("rect",{width:36,height:36,rx:10,fill:"#F5F6F9"})),ln||(ln=r.createElement("path",{d:"M27 18.22C27 12.73 22.74 9 18 9c-4.69 0-9 3.65-9 9.28-.6.34-1 .98-1 1.72v2c0 1.1.9 2 2 2h1v-6.1c0-3.87 3.13-7 7-7s7 3.13 7 7V25h-8v2h8c1.1 0 2-.9 2-2v-1.22c.59-.31 1-.92 1-1.64v-2.3c0-.7-.41-1.31-1-1.62Z",fill:"#7586B0"})),on||(on=r.createElement("path",{d:"M15 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM21 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fill:"#7586B0"})),cn||(cn=r.createElement("path",{d:"M24 17.03A6.04 6.04 0 0 0 18.05 12c-3.03 0-6.29 2.51-6.03 6.45a8.075 8.075 0 0 0 4.86-5.89c1.31 2.63 4 4.44 7.12 4.47Z",fill:"#7586B0"})))}},Sn=function(e,t){switch(e){case"primary":return t.stigg.palette.text.primary;case"secondary":return t.stigg.palette.text.secondary;default:return e}},Un=a("div",{target:"e1ds7xyn0"})((function(e){var t=e.$pathColor;return t&&c.css(wn||(wn=D(["\n path {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$rectColor;return t&&c.css(En||(En=D(["\n svg rect {\n fill: ",";\n }\n "])),t)})," ",(function(e){var t=e.$strokeColor;return t&&c.css(Pn||(Pn=D(["\n g {\n stroke: ",";\n }\n "])),t)}),";");function kn(e){var t=e.className,n=e.style,r=e.svgPathColor,a=e.svgRectColor,l=e.svgStrokeColor,o=Cn[e.icon],s=c.useTheme();return i.createElement(Un,{className:t,style:n,$pathColor:Sn(r,s),$rectColor:Sn(a,s),$strokeColor:Sn(l,s)},i.createElement(o,null))}var Mn=["children","value","index","maxHeight"];function Nn(e){var t=e.children,n=e.value,r=e.index,a=e.maxHeight,l=I(e,Mn);return i.createElement("div",Object.assign({role:"tabpanel",hidden:n!==r},l),n===r&&i.createElement(dn,{$maxHeight:a},t))}function Tn(e){var t=e.isSelected,n=e.label,r=t?"primary":"secondary";return i.createElement("div",{style:{display:"flex",gap:8,alignItems:"center"}},i.createElement(kn,{icon:e.icon,svgStrokeColor:r}),i.createElement(V,{variant:"h6",bold:t,fontWeight:o.FontWeight.Medium,color:r},n))}function Bn(e){var t=e.customerPortal,n=e.hiddenSections,a=e.textOverrides,l=e.theme,o=function(e){return null==n?void 0:n.some((function(t){return t===e}))},c=U(t.subscriptions,(function(e){return e.addons})).length>0&&!o("addons"),s=t.promotionalEntitlements.length>0&&!o("promotionalEntitlements"),u=r.useState(c?1:2),d=u[0],g=u[1];return c||s?i.createElement(un,null,i.createElement(k,{sx:{borderBottom:1,borderColor:"divider"}},i.createElement(sn,{value:d,onChange:function(e,t){g(t)}},c?i.createElement(M,{sx:{textTransform:"none"},value:1,label:i.createElement(Tn,{isSelected:1===d,label:a.addonsTabTitle,icon:"Addons"})}):null,s?i.createElement(M,{sx:{textTransform:"none"},value:2,label:i.createElement(Tn,{isSelected:2===d,label:a.promotionsTabTitle,icon:"Promotions"})}):null)),i.createElement(Nn,{value:d,index:1,maxHeight:l.tabMaxHeight},i.createElement(jt,null)),i.createElement(Nn,{value:d,index:2,maxHeight:l.tabMaxHeight},i.createElement(Dt,null))):null}var Ln=a("div",{target:"ejq3grd1"})({name:"1eoy87d",styles:"display:flex;justify-content:space-between"}),An=a("div",{target:"ejq3grd0"})({name:"43cxha",styles:"display:flex;flex-direction:column;gap:32px"});function Fn(){return i.createElement(Ln,{className:"stigg-subscription-overview-skeleton-layout"},i.createElement(An,null,i.createElement(x,{width:120}),i.createElement(x,{width:120})),i.createElement(x,{width:295,height:193}))}function On(e){var t=e.scheduleUpdate.targetPackage;return i.createElement(v.Grid,{container:!0,alignItems:"center"},i.createElement(v.Grid,null,i.createElement(s.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),i.createElement(v.Grid,{item:!0},i.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"Downgrade to the ",i.createElement("b",null,null==t?void 0:t.displayName)," plan")))}function jn(e){var n=e.scheduleUpdate.scheduleVariables.billingPeriod,r=n===t.BillingPeriod.Monthly?"annually":"monthly",a=n===t.BillingPeriod.Monthly?"monthly":"annually";return i.createElement(v.Grid,{container:!0,alignItems:"center"},i.createElement(v.Grid,null,i.createElement(s.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),i.createElement(v.Grid,{item:!0},i.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"Change from an ",r," to a ",i.createElement("b",null,a)," billing cycle")))}function In(e){var t=e.scheduleUpdate.scheduleVariables,n=t.newUnitAmount,r=t.featureId,a=h.compact(h.map(e.subscription.prices,"feature")).find((function(e){return e.id===r}));if(!a)return null;var l=a.featureUnits,o=1===n?l:a.featureUnitsPlural;return i.createElement(v.Grid,{container:!0,alignItems:"flex-start",flexWrap:"nowrap"},i.createElement(v.Grid,null,i.createElement(s.ArrowDown,{color:"#D94052",height:20,className:"stigg-scheduled-updates-arrow-down"})),i.createElement(v.Grid,{item:!0},i.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"Reduce the ",i.createElement("b",null,l)," quantity to ",n," ",o)))}function Dn(e){var n=e.scheduleUpdate,r=e.subscription;switch(n.subscriptionScheduleType){case t.SubscriptionScheduleType.Downgrade:return i.createElement(On,{scheduleUpdate:n});case t.SubscriptionScheduleType.BillingPeriod:return i.createElement(jn,{scheduleUpdate:n});case t.SubscriptionScheduleType.UnitAmount:return i.createElement(In,{scheduleUpdate:n,subscription:r});default:return null}}var Rn=a(v.Box,{target:"eju957a2"})("border-bottom:",(function(e){return"1px solid "+e.$borderColor}),";border-top-left-radius:10px;border-top-right-radius:10px;margin:-64px -64px 64px -64px;padding:24px 32px;"),_n=a(g,{target:"eju957a1"})({name:"158icaa",styles:"margin-left:4px"}),Wn=a(oe,{target:"eju957a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";path{fill:",(function(e){return e.theme.stigg.palette.primary}),";}");function Hn(e){var t=e.subscription,n=t.scheduledUpdates;return i.createElement(i.Fragment,null,i.createElement(v.Grid,{container:!0,alignItems:"center",justifyContent:"space-between",gap:1},i.createElement(v.Grid,null,i.createElement(V,{className:"stigg-scheduled-updates-description",variant:"body1"},"The following updates will take effect in the next billing cycle:"))),i.createElement(v.Grid,null,(n||[]).map((function(e){return i.createElement(Dn,{key:e.subscriptionScheduleType,scheduleUpdate:e,subscription:t})}))))}function Zn(e){var t=e.subscription,n=se({scheduledUpdate:(t.scheduledUpdates||[])[0],subscriptionPrices:t.prices,billingPeriodRange:t.billingPeriodRange,options:{postfix:"at the end of the current billing period"}}),r=n.line2;return i.createElement(i.Fragment,null,i.createElement(v.Grid,{container:!0,alignItems:"center",justifyContent:"space-between",gap:1},i.createElement(v.Grid,null,i.createElement(V,{className:"stigg-scheduled-updates-title",variant:"body1",color:"primary"},n.line1))),r&&i.createElement(v.Grid,null,i.createElement(V,{className:"stigg-scheduled-updates-subtitle",variant:"body1",color:"secondary"},r)))}function $n(e){var t=e.subscription,n=e.onCancelScheduledUpdates,a=e.theme,l=e.cancelScheduledUpdatesButtonTitle,o=c.useTheme(),s=r.useState(!1),u=s[0],d=s[1],g=t.scheduledUpdates;if(!g||0===g.length)return null;var p=1===g.length;return i.createElement(Rn,{$borderColor:a.borderColor,className:"stigg-scheduled-updates-alert-container"},i.createElement(v.Grid,{container:!0,alignItems:p?"center":"flex-start",gap:2},i.createElement(v.Grid,{item:!0,display:"flex"},i.createElement(kn,{icon:"ScheduleBox",svgPathColor:a.iconsColor,svgRectColor:a.iconsBackgroundColor})),i.createElement(v.Grid,{item:!0,flex:1},i.createElement(p?Zn:Hn,{subscription:t})),!!n&&i.createElement(v.Grid,{item:!0},i.createElement(Nt,{variant:"outlined",onClick:function(){d(!0),Promise.resolve(n(t)).finally((function(){return d(!1)}))}},u?i.createElement(_n,{loading:!0,size:16,color:o.stigg.palette.text.disabled}):i.createElement(Wn,{style:{display:"flex",marginRight:4},className:"stigg-scheduled-updates-cancel-update-button-icon"}),i.createElement(V,{variant:"body1",color:"primary.main",className:"stigg-scheduled-updates-cancel-update-button"},l)))))}var qn=a("div",{target:"e1kw2z1l0"})("width:100%;display:flex;flex-direction:column;border-radius:10px;background-color:",(function(e){return e.$backgroundColor}),";border:",(function(e){return"1px solid "+e.$borderColor}),";padding:64px;");function Gn(e){var n=e.billingPeriod,r=e.rangeEnd,a=e.amount,l=e.currency;return i.createElement(i.Fragment,null,i.createElement(V,{variant:"h6"},"Next estimated bill"),i.createElement(V,{variant:"h1"},_({amount:a,currency:l,maximumFractionDigits:2})),i.createElement(V,{variant:"body1",color:"secondary"},"Billed ",n===t.BillingPeriod.Monthly?"monthly":"annually"," on"," ",i.createElement(V,{variant:"body1",span:!0,color:"primary"},p.utc(r).format("MMM Do, YYYY"))),i.createElement(V,{variant:"body1",color:"secondary"},"* Additional tax rates may apply"))}function zn(e){var t=e.description;return i.createElement(i.Fragment,null,i.createElement(V,{variant:"h6",color:"secondary"},"No upcoming bill"),i.createElement(V,{variant:"body1",color:"secondary"},t))}var Vn=a("div",{target:"e1ftdtst1"})({name:"1nocm2b",styles:"display:flex;flex-direction:column;align-items:left;gap:8px"}),Yn=a(S,{target:"e1ftdtst0"})({name:"1l28f5r",styles:"width:fit-content;&.MuiButton-root{padding:0;&:hover{background:none;}}"});function Qn(e){var t=e.onContactSupport,n=e.label,r=i.createElement(V,{color:t?"primary.main":"secondary"},e.linkLabel);return i.createElement(Vn,{className:"stigg-contact-support-layout"},i.createElement(V,{className:"stigg-contact-support-label",color:"secondary"},n),t?i.createElement(Yn,{className:"stigg-contact-support-button",style:{textTransform:"none"},variant:"text",onClick:t},r):r)}var Kn,Xn,Jn=a("div",{target:"e1u4onrr0"})("max-height:278px;display:flex;flex-direction:column;border-radius:10px;background-color:",(function(e){return e.theme.stigg.palette.backgroundSection}),";border:",(function(e){return"1px solid "+e.$borderColor}),";padding:32px;gap:16px;");function er(e){var n,r,a,l,o=e.subscription,c=e.theme,s=e.textOverrides,u=e.onContactSupport,d=o.pricingType,g=null==(n=null==(r=o.prices)?void 0:r.every((function(e){return e.billingModel!==t.BillingModel.UsageBased})))||n,p=null==(a=o.scheduledUpdates)?void 0:a.find((function(e){var n=e.targetPackage;return e.subscriptionScheduleType===t.SubscriptionScheduleType.Downgrade&&(null==n?void 0:n.pricingType)===t.PricingType.Free}));if(d===t.PricingType.Free)l=i.createElement(zn,{description:"You're on a free plan, so you don’t have any upcoming charges"});else if(d===t.PricingType.Paid)if(p&&g)l=i.createElement(zn,{description:"Your plan will be downgraded to a free plan, so you don’t have any upcoming charges"});else if(o.status===t.SubscriptionStatus.InTrial)l=i.createElement(zn,{description:"You’re on a free trial of the "+o.planName+" plan, so you don’t have any upcoming charges"});else{var m,h,f,v,y=null==(m=o.prices)||null==(h=m[0])?void 0:h.billingPeriod,b=null==(f=o.billingPeriodRange)?void 0:f.end,x=null==(v=o.totalPrice)?void 0:v.total;y&&b&&x&&(l=i.createElement(Gn,{billingPeriod:y,rangeEnd:b,amount:x.amount,currency:x.currency}))}else d===t.PricingType.Custom&&(l=i.createElement(Qn,{onContactSupport:u,label:s.contactSupportTitle,linkLabel:s.contactSupportLink}));return i.createElement(Jn,{className:"stigg-subscription-total-price-layout",$borderColor:c.borderColor},l)}function tr(){return(tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var nr,rr,ir,ar=function(e){return r.createElement("svg",tr({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Kn||(Kn=r.createElement("path",{d:"M12.947 13.6h-1.013l.001-2.824a.522.522 0 0 0-.18-.392L8.622 7.918l3.134-2.465a.497.497 0 0 0 .18-.392V2.4h1.012c.278 0 .49-.212.49-.49a.481.481 0 0 0-.49-.49H3.053a.481.481 0 0 0-.49.49c0 .278.213.49.49.49h1.013l-.001 2.661c0 .147.065.294.18.392l3.117 2.465-3.117 2.466a.497.497 0 0 0-.18.392V13.6H3.054a.481.481 0 0 0-.49.49c0 .277.213.49.49.49h9.894c.277 0 .49-.213.49-.49a.481.481 0 0 0-.49-.49ZM5.045 2.4h5.91v2.416L8 7.167l-2.955-2.35V2.4Zm0 8.62L8 8.67l2.955 2.334v2.58h-5.91V11.02Z",fill:"#fff"})),Xn||(Xn=r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.053 1.254h9.894c.37 0 .657.287.657.656 0 .37-.287.657-.657.657h-.845L12.1 5.06c0 .214-.088.39-.238.519l-.005.004L8.89 7.918l2.974 2.34c.152.13.238.323.238.518l-.001 2.657h.846c.37 0 .657.287.657.657 0 .37-.288.657-.657.657H3.053a.648.648 0 0 1-.657-.657c0-.37.287-.657.657-.657h.846v-2.657c0-.214.087-.39.237-.519l.005-.004 2.953-2.335L4.136 5.58a.688.688 0 0 1-.238-.519V2.567h-.845a.648.648 0 0 1-.657-.656c0-.37.287-.657.657-.657Zm9.894.333H3.053a.315.315 0 0 0-.323.324c0 .185.138.323.323.323h1.18l-.001 2.827c0 .099.043.198.119.264l3.28 2.593-3.28 2.594a.33.33 0 0 0-.119.264v2.99H3.053a.315.315 0 0 0-.323.324c0 .185.138.323.323.323h9.894a.315.315 0 0 0 .323-.323.315.315 0 0 0-.323-.323h-1.18l.001-2.991a.355.355 0 0 0-.119-.264L8.351 7.918l3.298-2.593a.33.33 0 0 0 .119-.264V2.233h1.18a.315.315 0 0 0 .323-.323.315.315 0 0 0-.324-.323Zm-8.069.646h6.244v2.664L8 7.38 4.878 4.897V2.233Zm.334.334v2.169L8 6.955l2.788-2.22V2.568H5.212ZM8 8.457l3.122 2.467v2.827H4.878v-2.81L8 8.456Zm0 .425-2.788 2.219v2.316h5.576v-2.332L8 8.882Z",fill:"#fff"})))},lr=["children","className","placement"],or=a((function(e){var t=e.children,n=e.className,r=e.placement,a=void 0===r?"top":r,l=I(e,lr);return i.createElement(v.Tooltip,Object.assign({arrow:!0,placement:a},l,{classes:{popper:n,tooltip:"stigg-tooltip",arrow:"stigg-tooltip-arrow"}}),i.createElement("div",null,t))}),{target:"enddsuj0"})((function(e){var t,n=e.theme,r=e.$padding,i=e.$maxWidth;return(t={})["& ."+v.tooltipClasses.tooltip]={backgroundColor:n.stigg.palette.white,maxWidth:void 0===i?300:i,boxShadow:n.stigg.shadows.popover,padding:void 0===r?8:r,borderRadius:n.stigg.border.radius,color:n.stigg.palette.text.primary},t["& ."+v.tooltipClasses.arrow]={color:n.stigg.palette.white},t}),""),cr=C(V)(nr||(nr=D(["\n display: ",";\n -webkit-line-clamp: ",";\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: normal;\n ","\n\n ","\n"])),(function(e){return e.$display}),(function(e){return e.$maxLines}),(function(e){return e.$wordBreak&&P.css(rr||(rr=D(["\n word-break: break-word;\n "])))}),(function(e){return e.$bold&&P.css(ir||(ir=D(["\n font-weight: bold;\n "])))}));function sr(e){return e&&(e.clientHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)}var ur=function(e){var t=e.leaveDelay,n=e.children,a=e.variant,l=e.color,o=e.maxLines,c=void 0===o?1:o,s=e.wordBreak,u=e.bold,d=e.tooltipPlacement,g=void 0===d?"top":d,p=e.className,m=e.display,h=void 0===m?"-webkit-box":m,f=e.style,v=e["data-testid"],y=r.useState(!1),b=y[0],x=y[1],w=r.useRef(null),E=i.createElement(cr,{ref:w,variant:a,color:l,$maxLines:c,$wordBreak:s,$bold:u,className:p,$display:h,style:f,"data-testid":v},n);r.useEffect((function(){if(null!=w&&w.current){var e=sr(w.current);x(e)}}),[w]);var P=(null==w?void 0:w.current)&&sr(w.current);return i.createElement("span",null,b||P?i.createElement(or,{placement:g,leaveDelay:t,title:i.createElement(V,{variant:"body1"},n)},E):E)},dr=a("div",{target:"el5iwyw1"})("width:100%;display:flex;align-items:center;gap:4px;background-color:",(function(e){return e.theme.stigg.palette.warning}),";border-radius:10px;padding:8px 16px;margin-top:16px;"),gr=a(v.Link,{target:"el5iwyw0"})({name:"69ka7t",styles:"text-decoration-color:white;color:white;cursor:pointer"});function pr(e){var n=e.subscription,r=e.includePlanName,a=e.onManageSubscription;return(null==n?void 0:n.status)!==t.SubscriptionStatus.InTrial?null:i.createElement(dr,{className:"stigg-subscription-trial-badge"},i.createElement(ar,{className:"stigg-subscription-trial-badge-image"}),i.createElement("div",{style:{flex:1,marginRight:4}},i.createElement(ur,{variant:"body1",className:"stigg-subscription-trial-badge-text",color:"white"},n.trialRemainingDays+" days remaining in trial",r&&" of the "+n.planName+" plan")),i.createElement(gr,{className:"stigg-subscription-trial-upgrade-button",onClick:a},i.createElement(V,{color:"white"},"Upgrade plan")))}function mr(e){var t=e.mainSubscription,n=e.trialSubscription,r=e.onManageSubscription;return i.createElement("div",{className:"stigg-subscription-view-layout"},i.createElement(V,{className:"stigg-subscription-plan-name",variant:"h1",overrideColor:e.theme.planNameColor,style:{marginTop:8}},t.planName," plan"),i.createElement(pr,{subscription:n,includePlanName:(null==n?void 0:n.planName)!==t.planName,onManageSubscription:r}))}function hr(e,t){return Math.min(Math.floor(e/t*100),100)}var fr,vr=a(B,{target:"e1cbsoof1"})("height:4px;background-color:",(function(e){return u(e.theme.stigg.palette.primary).alpha(.4).string()}),";span{background-color:",(function(e){var t=e.theme;switch(e.$progressStatus){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}}),";}"),yr=a(v.Divider,{target:"e1cbsoof0"})("border-style:dotted;border-bottom-width:2px;border-color:",(function(e){return u(e.theme.stigg.palette.outlinedRestingBorder).alpha(.4).string()}),";");function br(e){var t=e.entitlement;if(t.hasUnlimitedUsage)return i.createElement(yr,null);var n,r=hr(t.currentUsage||0,t.usageLimit),a=(n=r)<70?"standard":n<100?"warning":"error";return i.createElement(vr,{$progressStatus:a,className:"stigg-feature-usage-progress-bar-"+a.toString(),variant:"determinate",value:r})}var xr=C(S)(fr||(fr=D(["\n text-transform: none;\n padding: 0;\n white-space: nowrap;\n"])));function wr(e){var t=e.entitlement,n=e.feature,r=e.onManageSubscription,a=e.onBuyMore,l=e.canBuyMore,o=e.canUpgradeSubscription;return e.hasCustomSubscription||t.hasUnlimitedUsage||hr(t.currentUsage||0,t.usageLimit)<70?null:l?a?i.createElement(xr,{variant:"text",onClick:function(){return a(n,t)}},i.createElement(V,{color:"primary.main"},"Buy more")):null:o&&r?i.createElement(xr,{variant:"text",onClick:r},i.createElement(V,{color:"primary.main"},"Upgrade")):null}function Er(e){var t,n,r,a=e.amount,l=e.currency,o=e.entitlement,c=e.feature,s=e.hideChargePrice,u=e.onBuyMore,d=e.onManageSubscription,g=e.canUpgradeSubscription,p=e.hasCustomSubscription;return i.createElement("div",{className:"stigg-charge-list-item",style:{display:"flex",flexDirection:"column",gap:12}},i.createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:12}},i.createElement("div",{style:{display:"flex",gap:12}},i.createElement(ur,{variant:"body1",color:"primary"},c.displayName),!s&&i.createElement(ur,{variant:"body1",color:"secondary"},_({amount:a,currency:l})," per ",c.featureUnits)),i.createElement("div",{style:{display:"flex",gap:12}},i.createElement(wr,{entitlement:o,feature:c,canBuyMore:!0,onBuyMore:u,onManageSubscription:d,canUpgradeSubscription:g,hasCustomSubscription:p}),i.createElement(V,{variant:"body1",color:"primary",style:{whiteSpace:"nowrap"}},o.hasUnlimitedUsage?null==(t=o.currentUsage)?void 0:t.toLocaleString():(null==(n=o.currentUsage)?void 0:n.toLocaleString())+" of "+(null==(r=o.usageLimit)?void 0:r.toLocaleString())))),i.createElement(br,{entitlement:o}))}function Pr(e){var n=e.subscription,r=e.onBuyMore,a=e.onManageSubscription,l=e.hasCustomSubscription,o=e.canUpgradeSubscription,c=h.keyBy(e.entitlements,"feature.refId"),s=n.prices.filter((function(e){var t=e.feature;return!!t&&c[t.refId]&&!!e.price}));return s.length?i.createElement("div",{className:"stigg-charge-list",style:{display:"flex",flexDirection:"column",gap:16,marginTop:32}},s.map((function(e){var n=e.feature,s=e.price;if(!n||!s)return null;var u=c[n.refId];return u&&u.feature?i.createElement(Er,{key:n.refId,entitlement:u,feature:u.feature,amount:s.amount,currency:s.currency,hideChargePrice:e.billingModel===t.BillingModel.PerUnit,onBuyMore:r,onManageSubscription:a,canUpgradeSubscription:o,hasCustomSubscription:l}):null}))):null}function Cr(e){var n=e.onManageSubscription,r=e.onBuyMore,a=e.onCancelScheduledUpdates,l=e.onContactSupport,o=e.hiddenSections,c=e.cancelScheduledUpdatesButtonTitle,s=Ut(),u=s.customerPortal,d=s.textOverrides,g=s.theme,p=s.isLoading||!u,m=u||{},h=m.subscriptions,f=m.entitlements,v=m.canUpgradeSubscription,y=null==h?void 0:h.find((function(e){return e.status===t.SubscriptionStatus.Active})),b=null==h?void 0:h.find((function(e){return e.status===t.SubscriptionStatus.InTrial})),x=(null==y?void 0:y.pricingType)===t.PricingType.Custom,w=y||b;return i.createElement(qn,{className:"stigg-customer-portal-subscriptions-overview",$backgroundColor:g.backgroundColor,$borderColor:g.borderColor},!p&&y&&y.scheduledUpdates&&i.createElement($n,{theme:g,subscription:y,onCancelScheduledUpdates:a,cancelScheduledUpdatesButtonTitle:c}),p||!w?i.createElement(Fn,null):i.createElement("div",{className:"stigg-overview-layout",style:{display:"flex",alignItems:"flex-start",gap:64}},i.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1}},i.createElement(Ot,{onManageSubscription:n,hideManageButton:x,textOverrides:d}),i.createElement(mr,{mainSubscription:w,trialSubscription:b,theme:g,onManageSubscription:n}),y&&f&&i.createElement(Pr,{subscription:y,entitlements:f,onBuyMore:r,onManageSubscription:n,canUpgradeSubscription:!!v,hasCustomSubscription:x}),i.createElement(Bn,{customerPortal:u,hiddenSections:o,textOverrides:d,theme:g})),i.createElement("div",{style:{display:"flex",flexDirection:"column",width:319,gap:24}},i.createElement(er,{subscription:w,theme:g,onContactSupport:l,textOverrides:d}))))}var Sr=a("div",{target:"e2lw8x70"})({name:"7wpci2",styles:"display:flex;width:100%;align-items:flex-end;justify-content:flex-end;margin-bottom:24px"});function Ur(e){return i.createElement(Sr,{className:"stigg-customer-portal-header-layout"},i.createElement(Ge,{source:"customer_portal",showWatermark:e.showWatermark}))}var kr=a(V,{target:"eb0pe7a1"})({name:"kxbue8",styles:"text-transform:none"}),Mr=a(s.ExternalLink,{target:"eb0pe7a0"})("color:",(function(e){return e.theme.stigg.palette.primary}),";");function Nr(e){var t=e.text,n=e.url;return i.createElement(Nt,{className:e.className,variant:"outlined",startIcon:i.createElement(Mr,{size:20,strokeWidth:2.5}),onClick:function(){window.open(n,"_blank")}},i.createElement(kr,{color:"primary.main"},t))}var Tr,Br=a("div",{target:"e12mjvl51"})({name:"1hidw77",styles:"display:flex;flex-direction:column;align-items:flex-start;gap:16px;flex:1 0 0"}),Lr=a("div",{target:"e12mjvl50"})({name:"j9hhqa",styles:"display:flex;align-items:flex-start;gap:16px;align-self:stretch"});function Ar(e){var t=e.rows;return i.createElement(Br,null,i.createElement(V,{variant:"h6",color:"secondary",fontWeight:o.FontWeight.Medium},e.title),t.map((function(e){var t=e.classNamePrefix,n=e.label,r=e.value,a=e.valueTypographyProps;return i.createElement(Lr,{key:n},i.createElement(V,Object.assign({className:t+"-label",variant:"body1",color:"secondary",style:{width:80}},e.labelTypographyProps),n),i.createElement(V,Object.assign({className:t+"-text",variant:"body1",color:"secondary"},a),r))})))}function Fr(){return i.createElement(x,{width:220,height:42})}function Or(){var e=Ut(),t=e.customerPortal,n=e.textOverrides,r=e.theme,a=(t||{}).billingInformation,l=!a||e.isLoading,o=[];if(l?o.push.apply(o,[i.createElement(Br,null,i.createElement(x,{width:220,height:12}),i.createElement(x,{width:220,height:12}),i.createElement(x,{width:220,height:12})),i.createElement(v.Divider,{orientation:"vertical",style:{minHeight:93}}),i.createElement(Br,null,i.createElement(x,{width:220,height:12}),i.createElement(x,{width:220,height:12}),i.createElement(x,{width:220,height:12}))]):(o.push(i.createElement(Ar,{title:"Billed to",rows:[{classNamePrefix:"stigg-customer-name",label:"Name",value:(null==a?void 0:a.name)||"-",valueTypographyProps:null!=a&&a.name?{}:{color:"disabled"}},{classNamePrefix:"stigg-customer-email",label:"Email",value:(null==a?void 0:a.email)||"-",valueTypographyProps:null!=a&&a.email?{}:{color:"disabled"}}]})),null!=a&&a.defaultPaymentMethodId&&a.defaultPaymentMethodLast4Digits&&a.defaultPaymentExpirationMonth&&a.defaultPaymentExpirationYear&&(o.unshift(i.createElement(v.Divider,{orientation:"vertical",style:{minHeight:93}})),o.unshift(i.createElement(Ar,{title:"Payment method",rows:[{classNamePrefix:"stigg-credit-card",label:"Card",value:"Ending in "+a.defaultPaymentMethodLast4Digits},{classNamePrefix:"stigg-credit-card-expiration",label:"Expires",value:h.padStart(a.defaultPaymentExpirationMonth.toString(),2,"0")+"/"+a.defaultPaymentExpirationYear}]})))),!(l||null!=a&&a.name||null!=a&&a.email||null!=a&&a.defaultPaymentMethodId))return null;var c=l?i.createElement(Fr,null):null!=t&&t.billingPortalUrl?i.createElement(Nr,{url:t.billingPortalUrl,text:n.editPaymentDetails,className:"stigg-edit-payment-details-button"}):null;return i.createElement(qn,{className:"stigg-payment-details-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},i.createElement(Lt,{className:"stigg-payment-details-section-header"},i.createElement(At,{isLoading:l,className:"stigg-payment-details-section-title",title:"Payment details"}),c),i.createElement("div",{style:{display:"flex",alignItems:"stretch",gap:64}},o))}var jr=a(qn,{target:"eqpkdww0"})("position:relative;.stigg-paywall-layout{width:100%;}.stigg-paywall-plans-layout{flex-wrap:nowrap;width:100%;overflow-x:auto;justify-content:unset;padding:0;}.stigg-paywall-plans-layout .stigg-plan-offering-container:first-of-type{margin-left:auto;}.stigg-paywall-plans-layout .stigg-plan-offering-container:last-child{margin-right:auto;}",(function(e){return e.$hideButtons&&c.css(Tr||(Tr=D(["\n .stigg-paywall-plan-button:not([disabled]) {\n display: none;\n }\n "])))})," .","stigg-watermark","{display:none;}"),Ir=i.forwardRef((function(e,t){var n=e.paywallComponent,r=e.theme;return n?i.createElement(jr,{className:"stigg-customer-portal-paywall-section",ref:t,$hideButtons:e.hidePaywallButtons,$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},i.createElement(Lt,{className:"stigg-customer-portal-paywall-header"},i.createElement(At,{isLoading:e.isLoading,className:"stigg-customer-portal-paywall-section-title",title:e.title})),n):null})),Dr=a("div",{target:"e1gjjeod1"})({name:"6xtw2",styles:"width:100%;display:flex;flex-direction:column;align-items:center;& *{box-sizing:border-box;}"}),Rr=a("div",{target:"e1gjjeod0"})({name:"1c31jfu",styles:"width:100%;display:flex;flex-direction:column;align-items:center;row-gap:24px"}),_r=a("div",{target:"eqqveb80"})("display:flex;flex-direction:column;padding:24px;border:",(function(e){return"1px solid "+e.$borderColor}),";border-radius:10px;row-gap:16px;height:100%;",(function(e){return e.$highlight&&"background-color: "+e.theme.stigg.palette.backgroundSection}),";");function Wr(e){var n,r,a,l,o,c=e.entitlement,s=e.subscriptionPrice,u=e.onManageSubscription,d=e.onBuyMore,g=e.hasCustomSubscription,m=e.canUpgradeSubscription,h=Ut().theme,f=!c.hasUnlimitedUsage&&c.currentUsage>c.usageLimit;return c.feature?i.createElement(_r,{$highlight:!!s,$borderColor:h.borderColor},i.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16}},i.createElement(ur,{variant:"body1"},c.feature&&((o=A((l=c.feature).displayName))===A(l.featureUnits||"")||o===A(l.featureUnitsPlural||"")?l.displayName:l.displayName+" ("+l.featureUnitsPlural+")")),s&&i.createElement(or,{title:i.createElement(V,{variant:"body1"},s.billingModel===t.BillingModel.PerUnit?"Billed for committed usage":"Billed for actual usage")},i.createElement(kn,{icon:"DollarCoin",svgStrokeColor:h.iconsColor}))),i.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8}},i.createElement(ur,{variant:"body1",color:f?"error":"primary","data-testid":"usage-data-"+(null==(n=c.feature)?void 0:n.refId)},null==(r=c.currentUsage)?void 0:r.toLocaleString(),!c.hasUnlimitedUsage&&" / "+(null==(a=c.usageLimit)?void 0:a.toLocaleString())+" ("+hr(c.currentUsage||0,c.usageLimit)+"%)"),i.createElement(wr,{entitlement:c,feature:c.feature,onBuyMore:d,canBuyMore:!!s,onManageSubscription:u,canUpgradeSubscription:m,hasCustomSubscription:g})),i.createElement(br,{entitlement:c}),c.hasUnlimitedUsage||L(c.usageLimit)||L(c.currentUsage)||!c.resetPeriod||!c.nextResetDate?null:i.createElement(V,{color:"secondary"},function(e){if(!e.resetPeriod||!e.nextResetDate)return null;var t=function(t){return p.utc(e.nextResetDate).diff(p.utc(),t)};switch(e.resetPeriod){case"MONTH":return"Resets monthly - in "+t("days")+" days";case"WEEK":return"Resets weekly - in "+t("days")+" days";case"DAY":return"Resets daily - in "+t("hours")+" hours";case"HOUR":return"Resets hourly - in "+t("minutes")+" minutes";default:return null}}(c)),c.hasUnlimitedUsage&&i.createElement(V,{color:"secondary"},"In current billing period")):null}var Hr=a("div",{target:"eoaojje0"})({name:"3hgi0y",styles:"margin-top:32px"});function Zr(){return i.createElement(v.Grid,{container:!0,spacing:4,className:"stigg-subscription-usage-skeleton-layout"},h.range(6).map((function(e){return i.createElement(v.Grid,{key:e,item:!0,xs:4},i.createElement(x,{width:280,height:120}))})))}function $r(e){var n=e.onManageSubscription,r=e.onBuyMore,a=i.useState(!1),l=a[0],o=a[1],c=Ut(),u=c.customerPortal,d=c.textOverrides,g=c.theme,p=c.isLoading||!u,m=u||{},f=m.entitlements,y=m.subscriptions,b=null==f?void 0:f.filter((function(e){var n,r;return(null==(n=e.feature)?void 0:n.meterType)===t.MeterType.Fluctuating||(null==(r=e.feature)?void 0:r.meterType)===t.MeterType.Incremental})),x=null==y?void 0:y.find((function(e){return e.status===t.SubscriptionStatus.Active})),w=(null==x?void 0:x.pricingType)===t.PricingType.Custom,E=!(null==u||!u.canUpgradeSubscription),P=h.keyBy(null==x?void 0:x.prices,"feature.refId"),C=h.keyBy(b,"feature.refId"),S=h.compact(null==x?void 0:x.prices.map((function(e){return e.feature&&C[e.feature.refId]}))),U=h.compact(null==b?void 0:b.filter((function(e){return!P[e.feature.refId]}))),k=[].concat(S,U),M=k.length>2?4:6,N=l?k:k.slice(0,6);return p||null!=b&&b.length?i.createElement(qn,{className:"stigg-subscription-usage-layout",$backgroundColor:g.backgroundColor,$borderColor:g.borderColor},i.createElement(Lt,null,i.createElement(At,{title:d.usageTabTitle,className:"stigg-customer-portal-usage-section-title",isLoading:p})),p?i.createElement(Zr,null):i.createElement(i.Fragment,null,i.createElement(v.Grid,{container:!0,spacing:4},N.map((function(e){return i.createElement(v.Grid,{item:!0,xs:M},i.createElement(Wr,{key:e.feature.refId,subscriptionPrice:P[e.feature.refId],entitlement:e,onManageSubscription:n,onBuyMore:r,hasCustomSubscription:w,canUpgradeSubscription:E}))}))),k.length>6&&i.createElement(Hr,null,i.createElement(Nt,{className:"stigg-usage-toggle-many-button",variant:"text",startIcon:i.createElement(l?s.Minus:s.Plus,null),onClick:function(){return o((function(e){return!e}))}},l?"Show less":"Show more")))):null}function qr(e){var n=e.onManageSubscription,a=e.onBuyMore,l=e.onCancelScheduledUpdates,o=e.onContactSupport,c=e.paywallComponent,s=e.hiddenSections,u=rt().stigg,d=Ut(),g=d.customerPortal,p=d.textOverrides,m=d.theme,h=d.isLoading,f=r.useRef(null),v=function(){var e;n?n():null==f||null==(e=f.current)||e.scrollIntoView({behavior:"smooth"})},y=null==g?void 0:g.subscriptions.some((function(e){return e.pricingType===t.PricingType.Custom})),b=!(null!=s&&s.some((function(e){return"usage"===e}))),x=!(null!=s&&s.some((function(e){return"paymentDetails"===e||"billingInformation"===e}))),w=!(null!=s&&s.some((function(e){return"invoices"===e||"billingInformation"===e})));return i.createElement(Dr,{className:"stigg-customer-portal-layout"},i.createElement(Ur,{showWatermark:u.isWidgetWatermarkEnabled&&!!g}),i.createElement(Rr,{className:"stigg-customer-portal-sections"},i.createElement(Cr,{onCancelScheduledUpdates:l,onBuyMore:a,onManageSubscription:v,onContactSupport:o,hiddenSections:s,cancelScheduledUpdatesButtonTitle:p.cancelScheduledUpdatesButtonTitle}),b&&i.createElement($r,{onManageSubscription:v,onBuyMore:a}),i.createElement(Ir,{ref:f,paywallComponent:c,hidePaywallButtons:!!y,theme:m,title:p.paywallSectionTitle,isLoading:!g||h}),x&&i.createElement(Or,null),w&&i.createElement(Vr,null)))}var Gr,zr=["textOverrides","theme","resourceId","productId"];function Vr(){var e=Ut(),t=e.customerPortal,n=e.textOverrides,r=e.theme,a=!t||e.isLoading,l=a?i.createElement(Fr,null):null!=t&&t.billingPortalUrl?i.createElement(Nr,{url:t.billingPortalUrl,text:n.viewInvoiceHistory,className:"stigg-view-invoice-history-button"}):null;return a||null!=t&&t.billingPortalUrl?i.createElement(qn,{className:"stigg-invoices-section-layout",$backgroundColor:r.backgroundColor,$borderColor:r.borderColor},i.createElement(Lt,{className:"stigg-invoices-section-header"},i.createElement(At,{isLoading:a,className:"stigg-invoices-section-title",title:n.invoicesTitle}),l)):null}(Gr=exports.ProvisionStatus||(exports.ProvisionStatus={})).IN_PROGRESS="IN_PROGRESS",Gr.SUCCEEDED="SUCCEEDED",Gr.FAILED="FAILED",Object.keys(t).forEach((function(e){"default"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})})),exports.AddonsList=jt,exports.CustomerPortal=function(e){var t=e.textOverrides,n=e.theme,r=e.resourceId,a=e.productId,l=I(e,zr);return i.createElement(kt,{textOverrides:t,theme:n,resourceId:r,productId:a},i.createElement(qr,Object.assign({},l)))},exports.CustomerPortalProvider=kt,exports.CustomerUsageData=$r,exports.InvoicesSection=Vr,exports.PaymentDetailsSection=Or,exports.Paywall=function(e){var n=e.productId,a=e.resourceId,l=e.highlightedPlanId,o=e.showOnlyEligiblePlans,c=e.textOverrides,s=e.onPlanSelected,u=e.preferredBillingPeriod,g=e.onBillingPeriodChange,h=e.billingCountryCode,f=!!r.useContext(St),v=!1;if(f){var y=Ut();v=y.isLoading,a=y.resourceId}var b=function(e){var n=e.productId,i=e.resourceId,a=e.showOnlyEligiblePlans,l=e.billingCountryCode,o=e.preferredBillingPeriod,c=rt(),s=c.stigg,u=c.locale,d=r.useState(t.BillingPeriod.Annually),g=d[0],h=d[1],f=r.useState([]),v=f[0],y=f[1],b=r.useState(null),x=b[0],E=b[1],P=r.useState(!0),C=P[0],S=P[1];r.useEffect((function(){!function(){var e=O(et.mark((function e(){var t,r,a,c;return et.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,S(!0),e.next=4,s.waitForInitialization();case 4:return e.next=6,s.getPaywall({productId:n,resourceId:i,billingCountryCode:l});case 6:r=it((t=e.sent).plans,o),a=r.availableBillingPeriods,c=r.defaultBillingPeriod,E(t),y(a),h(c),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(0),tt.error("Failed to load paywall "+(null==e.t0?void 0:e.t0.message),e.t0);case 16:return e.prev=16,S(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[0,13,16,19]])})));return function(){return e.apply(this,arguments)}}()()}),[s,n,s.isCustomerLoaded,l,i]);var U=function(e,n){var r,i=e||{},a=i.plans,l=i.currency,o=i.configuration,c=i.customer,s=i.paywallCalculatedPricePoints,u=function(e){var n,r,i,a=!0,l=(null==e?void 0:e.find((function(e){return e.status===t.SubscriptionStatus.InTrial})))||null,o=null==(n=l)?void 0:n.plan,c=null!=(r=l)&&r.trialEndDate?p.utc(l.trialEndDate).diff(p.utc(),"days",!1)+1:void 0;return o||(a=!1,o=null==(i=l=(null==e?void 0:e.find((function(e){return e.status===t.SubscriptionStatus.Active})))||null)?void 0:i.plan),{currentSubscription:l,currentPlan:o,isCustomerOnTrial:a,trialDaysLeft:c}}(i.activeSubscriptions),d=u.currentSubscription,g=u.currentPlan,h=u.isCustomerOnTrial,f=u.trialDaysLeft,v=(null==d?void 0:d.scheduledUpdates)||[],y=null==d||null==(r=d.price)?void 0:r.billingPeriod,b=v.find((function(e){return e.subscriptionScheduleType===t.SubscriptionScheduleType.Downgrade})),x=v.find((function(e){return e.subscriptionScheduleType===t.SubscriptionScheduleType.BillingPeriod})),E=w(a,(function(e){return e.order})).map((function(e){var t,n=null==c||null==(t=c.eligibleForTrial)?void 0:t.find((function(t){return t.productId===e.product.id})),r=e.id===(null==g?void 0:g.id);return j({},e,{paywallCalculatedPricePoints:null==s?void 0:s.filter((function(t){return t.planId===e.id})),isTriable:!m(e.defaultTrialConfig)&&(!n||n.eligible),isCurrentCustomerPlan:r,currentCustomerPlanBillingPeriod:y,isUpcomingPlan:!1,trialDaysLeft:f,isNextPlan:function(t){var n,i=null==b?void 0:b.scheduleVariables,a=null==x?void 0:x.scheduleVariables,l=e.pricePoints.some((function(e){return e.billingPeriod===t}));return b?(null==(n=b.targetPackage)?void 0:n.refId)===e.id&&(!l||i.billingPeriod===t):!(!x||!r)&&a.billingPeriod===t},paywallCurrency:l,scheduledUpdate:b||x})}));if(a&&g){var P,C=g&&(null==a||null==(P=a.find((function(e){return e.id===(null==g?void 0:g.id)})))?void 0:P.order);m(C)||(E=E.map((function(e){return j({},e,{isLowerThanCurrentPlan:C>e.order})})),n&&(E=E.filter((function(e){return e.order>C}))))}var S=o?function(e){var t=e.palette,n=e.layout;return{customCss:e.customCss||void 0,palette:{primary:(null==t?void 0:t.primary)||void 0,backgroundPaper:(null==t?void 0:t.backgroundColor)||void 0,outlinedBorder:(null==t?void 0:t.borderColor)||void 0,backgroundHighlight:(null==t?void 0:t.currentPlanBackground)||void 0,text:{primary:(null==t?void 0:t.textColor)||void 0}},typography:ot(e),layout:{ctaAlignment:ct(null==n?void 0:n.alignment),headerAlignment:ct(null==n?void 0:n.alignment),descriptionAlignment:ct(null==n?void 0:n.alignment),planMaxWidth:at(null==n?void 0:n.planWidth),planMinWidth:at(null==n?void 0:n.planWidth),planMargin:at(null==n?void 0:n.planMargin),planPadding:at(null==n?void 0:n.planPadding)}}}(o):void 0;return{currentPlan:g,currentSubscription:d,isCustomerOnTrial:h,plans:E,paywallConfiguration:S}}(x,a);return j({customer:(null==x?void 0:x.customer)||null,isLoading:C,selectedBillingPeriod:g,setSelectedBillingPeriod:h,availableBillingPeriods:v,locale:u,configuration:U.paywallConfiguration},U)}({productId:n,resourceId:a,showOnlyEligiblePlans:o,billingCountryCode:h,preferredBillingPeriod:u}),x=b.plans,E=b.customer,P=b.currentSubscription,C=b.isCustomerOnTrial,S=b.isLoading,U=b.selectedBillingPeriod,k=b.setSelectedBillingPeriod,M=b.availableBillingPeriods,N=b.locale,T=b.configuration,B=d({highlightChip:"Recommended",planCTAButton:{upgrade:"Upgrade",downgrade:"Downgrade",startTrial:function(e){var t;return"Start "+(null==(t=e.defaultTrialConfig)?void 0:t.duration)+" day trial"},custom:"Contact us",currentPlan:"Current plan",startNew:"Get started",switchToBillingPeriod:function(e){return"Switch to "+e.toLocaleLowerCase()},cancelScheduledUpdate:"Cancel update"},price:{startingAtCaption:"Starts at",free:function(e){return{price:(null==e?void 0:e.symbol)+"0"}},custom:"Custom",priceNotSet:"Price not set"}},c),L=!x||S||v?i.createElement(yt,null):i.createElement(Je,{plans:x,customer:E,currentSubscription:P,selectedBillingPeriod:U,onBillingPeriodChanged:function(e){k(e),g&&g(e)},availableBillingPeriods:M,highlightedPlanId:l,isLoading:S,isCustomerOnTrial:C,onPlanSelected:s,paywallLocale:B,locale:N});return f?L:i.createElement(Ct,{componentTheme:T},L)},exports.Promotions=Dt,exports.StiggContext=nt,exports.StiggProvider=function(e){var t=e.apiKey,a=e.baseUri,l=e.baseEdgeUri,o=e.enableEdge,c=e.customerId,s=e.customerToken,u=e.resourceId,d=e.theme,g=e.locale,p=e.useEntitlementPolling,m=e.entitlementPollingInterval,h=e.entitlementsFallback,f=e.stiggClient,v=e.children,y=r.useRef(t),x={apiKey:t,customerId:c,customerToken:s,resourceId:u,baseUri:a,baseEdgeUri:l,enableEdge:o,entitlementsFallback:h,useEntitlementPolling:p,entitlementPollingInterval:m},w=r.useState((function(){return{stigg:null!=f?f:n.initialize(j({},x,{lazyLoad:!0})),locale:g||"en-US",isInitialized:!1,theme:d,refreshData:(e=O(et.mark((function e(){return et.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return P((function(e){return j({},e,{customerPortalUpdatedAt:new Date})})),e.next=3,E.stigg.refresh();case 3:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})};var e})),E=w[0],P=w[1];return r.useEffect((function(){var e=!0,r=function(t){e&&P(t)},i=function(){return r((function(e){return j({},e,{updatedAt:new Date})}))},a=function(e){return r((function(t){return t.stigg&&t.stigg.removeListener("entitlementsUpdated",i),e.addListener("entitlementsUpdated",i),j({},t,{stigg:e,isInitialized:!0,updatedAt:new Date})}))};return function(){var e=O(et.mark((function e(){var i;return et.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=E.stigg,t!==y.current&&(tt.log("Updating stigg client",{apiKey:t}),y.current=t,i=n.initialize(j({},x)),r((function(e){return j({},e,{isInitialized:!1,updatedAt:new Date})}))),e.next=4,i.waitForInitialization();case 4:a(i);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()(),function(){e=!1,E.stigg.removeListener("entitlementsUpdated",i),E.stigg.clearCustomer()}}),[t]),r.useEffect((function(){var e=E.stigg;c?e.setCustomerId(c,s,u):e.clearCustomer()}),[c,s,u]),r.useEffect((function(){P((function(e){return j({},e,{theme:d})}))}),[d]),i.createElement(nt.Provider,{value:E},i.createElement(b.SkeletonTheme,{baseColor:"#F5F6F9",highlightColor:"#e5e6ea"},v))},exports.SubscriptionsOverview=Cr,exports.useStiggContext=rt,exports.useWaitForCheckoutCompleted=function(e){var t,n=void 0===e?{}:e,i=n.onProvisionStart,a=n.onProvisionSucceeded,l=n.onProvisionFailed,o=rt().stigg,c=r.useState(exports.ProvisionStatus.IN_PROGRESS),s=c[0],u=c[1],d=r.useState(!1),g=d[0],p=d[1],m=r.useMemo((function(){var e=new URLSearchParams(window.location.search);return t?e.get(t):e}),[t="checkoutCompleted",window.location.search]);return r.useEffect((function(){!function(){var e=O(et.mark((function e(){var t;return et.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m&&"false"!==m.toLowerCase()&&!g){e.next=2;break}return e.abrupt("return");case 2:return p(!0),i&&i(),e.prev=4,e.next=7,o.waitForCheckoutCompleted();case 7:t=e.sent,u(exports.ProvisionStatus.SUCCEEDED),a&&a(t),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(4),console.error("Failed to wait for checkout to complete",e.t0),u(exports.ProvisionStatus.FAILED),l&&l(e.t0);case 17:return e.prev=17,p(!1),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,12,17,20]])})));return function(){return e.apply(this,arguments)}}()()}),[o,m]),{isAwaitingCheckout:g,provisionStatus:s}};
|
|
2
2
|
//# sourceMappingURL=react-sdk.cjs.production.min.js.map
|