| 1 |
(()=>{"use strict";var e={20:(e,t,r)=>{var s=r(609),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,c=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,r){var s,i={},l=null,p=null;for(s in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(p=t.ref),t)n.call(t,s)&&!a.hasOwnProperty(s)&&(i[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===i[s]&&(i[s]=t[s]);return{$$typeof:o,type:e,key:l,ref:p,props:i,_owner:c.current}}t.Fragment=i,t.jsx=l,t.jsxs=l},609:e=>{e.exports=window.React},848:(e,t,r)=>{e.exports=r(20)}},t={};const r=window.wc.blocksCheckout,s=window.wc.blocksComponents,o=window.wp.plugins,i=window.wp.i18n,n=window.wc.priceFormat;var c=function r(s){var o=t[s];if(void 0!==o)return o.exports;var i=t[s]={exports:{}};return e[s](i,i.exports,r),i.exports}(848);(0,r.registerCheckoutFilters)("sdevs-subscription",{cartItemPrice:(e,t,r,s)=>{const{sdevs_subscription:o}=t,{cartItem:i}=r,{totals:n}=i;return void 0===n?e:"0"===n.line_total?"<price/> Due Today":o.type?`<price/> / ${o.time&&o.time>1?" "+o.time+"-":""}${o.type}`:e},subtotalPriceFormat:(e,t,r,s)=>{const{sdevs_subscription:o}=t;return o&&o.type?`<price/> every ${o.time&&o.time>1?" "+o.time+"-":""}${o.type}`:e}});const a=({cart:e,extensions:t})=>{if(0===Object.keys(t).length)return;const{cartTotals:o}=e,{sdevs_subscription:a}=t,l=(0,n.getCurrencyFromPriceResponse)(o);return 0!==a.length?(0,c.jsx)(r.TotalsItem,{className:"wc-block-components-totals-footer-item",label:(0,i.__)("Recurring totals","sdevs_subscrpt"),description:(0,c.jsx)("div",{style:{display:"grid"},children:a.map((e=>(0,c.jsxs)("div",{style:{margin:"20px 0",float:"right"},children:[(0,c.jsxs)("div",{style:{fontSize:"18px"},children:[(0,c.jsx)(s.FormattedMonetaryAmount,{currency:l,value:parseInt(e.price,10)})," ","/"," ",e.time&&e.time>1?e.time+"-"+e.type+" ":e.type]}),(0,c.jsx)("small",{children:e.description}),"yes"===e.can_user_cancel&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("br",{}),(0,c.jsxs)("small",{children:["You can cancel subscription at any time!"," "]})]})]})))})}):void 0};(0,o.registerPlugin)("sdevs-subscription",{render:()=>(0,c.jsx)(r.ExperimentalOrderMeta,{children:(0,c.jsx)(a,{})}),scope:"woocommerce-checkout"})})(); |