"use strict";const store=require("./store-ce062aec.js"),isBusy=()=>["loading","busy","redirecting"].includes(store.state.loading),getExitUrl=()=>{var e,t;return(null===(t=null===(e=null===store.state||void 0===store.state?void 0:store.state.checkout)||void 0===e?void 0:e.metadata)||void 0===t?void 0:t.success_url)||store.state.success_url||null},getUpsellRemainingTime=(e="seconds")=>{var t;const i=null===(t=store.state.checkout)||void 0===t?void 0:t.upsells_expire_at;if(!i)return null;const o=Date.now(),r=Math.floor((1e3*i-o)/1e3);return r<0?0:"seconds"===e?r:"minutes"===e?Math.floor(r/60):"hours"===e?Math.floor(r/60/60):void 0},formatTimeUnit=e=>e<10?`0${e}`:`${e}`,getFormattedRemainingTime=()=>{var e;if(!(null===(e=store.state.checkout)||void 0===e?void 0:e.upsells_expire_at))return"--:--";const t=getUpsellRemainingTime("seconds"),i=Math.floor(t/86400),o=Math.floor(t%86400/3600),r=Math.floor(t%3600/60),s=Math.floor(t%60);return i>0?`${formatTimeUnit(i)}:${formatTimeUnit(o)}:${formatTimeUnit(r)}:${formatTimeUnit(s)}`:o>0?`${formatTimeUnit(o)}:${formatTimeUnit(r)}:${formatTimeUnit(s)}`:`${formatTimeUnit(r)}:${formatTimeUnit(s)}`},isUpsellExpired=()=>{const e=getUpsellRemainingTime();return null!==getUpsellRemainingTime()&&e<=0};exports.getExitUrl=getExitUrl,exports.getFormattedRemainingTime=getFormattedRemainingTime,exports.isBusy=isBusy,exports.isUpsellExpired=isUpsellExpired;