Plugin Directory

Changeset 2791699


Ignore:
Timestamp:
09/29/2022 07:06:11 AM (3 years ago)
Author:
themesgrove
Message:

Update to version 2.7.2 from GitHub

Location:
smartpay
Files:
22 edited
1 copied

Legend:

Unmodified
Added
Removed
  • smartpay/tags/2.7.2/app/Modules/Payment/Payment.php

    r2789849 r2791699  
    175175
    176176                $additional_amount = $product->extra['additional_charge'] ?? 0;
     177                if (empty($product->extra['additional_charge'])) {
     178                    $additional_amount = 0;
     179                }
    177180                $total_billing_cycle = $product->extra['total_billing_cycle'] ?? 0;
     181                if (empty($product->extra['total_billing_cycle'])) {
     182                    $total_billing_cycle = 0;
     183                }
    178184
    179185                $payment_default_data = [
     
    182188                    'total_amount'  => $_data['smartpay_product_price'],
    183189                    'billing_type'   => $_data['smartpay_product_billing_type'],
    184                     'additional_info' => [
    185                         'additional_charge' => $additional_amount,
    186                         'total_billing_cycle' => $total_billing_cycle,
    187                     ]
    188190                ];
     191
     192                if ($_data['smartpay_product_billing_type'] == \SmartPay\Models\Payment::BILLING_TYPE_SUBSCRIPTION) {
     193                    $payment_default_data['additional_info'] =  [
     194                        'additional_charge' => $additional_amount,
     195                        'total_billing_cycle' => $total_billing_cycle,
     196                    ];
     197                }
    189198
    190199                return smartpay_get_additional_payment_data($payment_default_data);
     
    213222                    ];
    214223
    215                 if ( !filter_var($_data['smartpay_is_custom_amount'], FILTER_VALIDATE_BOOLEAN) ) {
    216                     $payment_data['additional_info']  = [
    217                         'additional_charge' => $additional_amount,
    218                         'total_billing_cycle' => $total_billing_cycle,
    219                     ];
    220                 }
     224                if ($_data['smartpay_form_billing_type'] == \SmartPay\Models\Payment::BILLING_TYPE_SUBSCRIPTION) {
     225                    if ( !filter_var($_data['smartpay_is_custom_amount'], FILTER_VALIDATE_BOOLEAN) ) {
     226                        $payment_data['additional_info']  = [
     227                            'additional_charge' => $additional_amount,
     228                            'total_billing_cycle' => $total_billing_cycle,
     229                        ];
     230                    }
     231                }
     232
    221233                return $payment_data;
    222234
  • smartpay/tags/2.7.2/public/js/app.js

    r2789849 r2791699  
    1 (()=>{var t,e={757:(t,e,r)=>{t.exports=r(666)},974:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(141),a=r(192);function o(t){var e=(0,n.Z)(t);return function(t){return(0,a.Z)(e,t)}}},192:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var n={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,r){if(t)throw e;return r}};function a(t,e){var r,a,o,i,s,c,u=[];for(r=0;r<t.length;r++){if(s=t[r],i=n[s]){for(a=i.length,o=Array(a);a--;)o[a]=u.pop();try{c=i.apply(null,o)}catch(t){return t}}else c=e.hasOwnProperty(s)?e[s]:+s;u.push(c)}return u[0]}},680:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var n=r(974);function a(t){var e=(0,n.Z)(t);return function(t){return+e({n:t})}}},141:(t,e,r)=>{"use strict";var n,a,o,i;function s(t){for(var e,r,s,c,u=[],l=[];e=t.match(i);){for(r=e[0],(s=t.substr(0,e.index).trim())&&u.push(s);c=l.pop();){if(o[r]){if(o[r][0]===c){r=o[r][1]||r;break}}else if(a.indexOf(c)>=0||n[c]<n[r]){l.push(c);break}u.push(c)}o[r]||l.push(r),t=t.substr(e.index+r.length)}return(t=t.trim())&&u.push(t),u.concat(l.reverse())}r.d(e,{Z:()=>s}),n={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},a=["(","?"],o={")":["("],":":["?","?:"]},i=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/},247:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(103),a=r(755);const o=function(t,e){return function(r,o,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;const c=t[e];if(!(0,a.Z)(r))return;if(!(0,n.Z)(o))return;if("function"!=typeof i)return void console.error("The hook callback must be a function.");if("number"!=typeof s)return void console.error("If specified, the hook priority must be a number.");const u={callback:i,priority:s,namespace:o};if(c[r]){const t=c[r].handlers;let e;for(e=t.length;e>0&&!(s>=t[e-1].priority);e--);e===t.length?t[e]=u:t.splice(e,0,u),c.__current.forEach((t=>{t.name===r&&t.currentIndex>=e&&t.currentIndex++}))}else c[r]={handlers:[u],runs:0};"hookAdded"!==r&&t.doAction("hookAdded",r,o,i,s)}}},992:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){return function(){var r,n;const a=t[e];return null!==(r=null===(n=a.__current[a.__current.length-1])||void 0===n?void 0:n.name)&&void 0!==r?r:null}}},972:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var n=r(755);const a=function(t,e){return function(r){const a=t[e];if((0,n.Z)(r))return a[r]&&a[r].runs?a[r].runs:0}}},786:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){return function(r){const n=t[e];return void 0===r?void 0!==n.__current[0]:!!n.__current[0]&&r===n.__current[0].name}}},642:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){return function(r,n){const a=t[e];return void 0!==n?r in a&&a[r].handlers.some((t=>t.namespace===n)):r in a}}},19:(t,e,r)=>{"use strict";r.d(e,{Z:()=>p});var n=r(247),a=r(99),o=r(642),i=r(424),s=r(992),c=r(786),u=r(972);class l{constructor(){this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=(0,n.Z)(this,"actions"),this.addFilter=(0,n.Z)(this,"filters"),this.removeAction=(0,a.Z)(this,"actions"),this.removeFilter=(0,a.Z)(this,"filters"),this.hasAction=(0,o.Z)(this,"actions"),this.hasFilter=(0,o.Z)(this,"filters"),this.removeAllActions=(0,a.Z)(this,"actions",!0),this.removeAllFilters=(0,a.Z)(this,"filters",!0),this.doAction=(0,i.Z)(this,"actions"),this.applyFilters=(0,i.Z)(this,"filters",!0),this.currentAction=(0,s.Z)(this,"actions"),this.currentFilter=(0,s.Z)(this,"filters"),this.doingAction=(0,c.Z)(this,"actions"),this.doingFilter=(0,c.Z)(this,"filters"),this.didAction=(0,u.Z)(this,"actions"),this.didFilter=(0,u.Z)(this,"filters")}}const p=function(){return new l}},99:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(103),a=r(755);const o=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(o,i){const s=t[e];if(!(0,a.Z)(o))return;if(!r&&!(0,n.Z)(i))return;if(!s[o])return 0;let c=0;if(r)c=s[o].handlers.length,s[o]={runs:s[o].runs,handlers:[]};else{const t=s[o].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===i&&(t.splice(e,1),c++,s.__current.forEach((t=>{t.name===o&&t.currentIndex>=e&&t.currentIndex--})))}return"hookRemoved"!==o&&t.doAction("hookRemoved",o,i),c}}},424:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n){const a=t[e];a[n]||(a[n]={handlers:[],runs:0}),a[n].runs++;const o=a[n].handlers;for(var i=arguments.length,s=new Array(i>1?i-1:0),c=1;c<i;c++)s[c-1]=arguments[c];if(!o||!o.length)return r?s[0]:void 0;const u={name:n,currentIndex:0};for(a.__current.push(u);u.currentIndex<o.length;){const t=o[u.currentIndex].callback.apply(null,s);r&&(s[0]=t),u.currentIndex++}return a.__current.pop(),r?s[0]:void 0}}},957:(t,e,r)=>{"use strict";r.d(e,{JQ:()=>n});const n=(0,r(19).Z)(),{addAction:a,addFilter:o,removeAction:i,removeFilter:s,hasAction:c,hasFilter:u,removeAllActions:l,removeAllFilters:p,doAction:d,applyFilters:f,currentAction:m,currentFilter:y,doingAction:h,doingFilter:v,didAction:g,didFilter:_,actions:b,filters:w}=n},755:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}},103:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}},16:(t,e,r)=>{"use strict";r.d(e,{o:()=>i});var n=r(22);const a={plural_forms:t=>1===t?0:1},o=/^i18n\.(n?gettext|has_translation)(_|$)/,i=(t,e,r)=>{const i=new n.Z({}),s=new Set,c=()=>{s.forEach((t=>t()))},u=function(t){var e;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";i.data[r]={...i.data[r],...t},i.data[r][""]={...a,...null===(e=i.data[r])||void 0===e?void 0:e[""]},delete i.pluralForms[r]},l=(t,e)=>{u(t,e),c()},p=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;return i.data[t]||u(void 0,t),i.dcnpgettext(t,e,r,n,a)},d=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return t},f=(t,e,n)=>{let a=p(n,e,t);return r?(a=r.applyFilters("i18n.gettext_with_context",a,t,e,n),r.applyFilters("i18n.gettext_with_context_"+d(n),a,t,e,n)):a};if(t&&l(t,e),r){const t=t=>{o.test(t)&&c()};r.addAction("hookAdded","core/i18n",t),r.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return i.data[t]},setLocaleData:l,addLocaleData:function(t){var e;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";i.data[r]={...i.data[r],...t,"":{...a,...null===(e=i.data[r])||void 0===e?void 0:e[""],...null==t?void 0:t[""]}},delete i.pluralForms[r],c()},resetLocaleData:(t,e)=>{i.data={},i.pluralForms={},l(t,e)},subscribe:t=>(s.add(t),()=>s.delete(t)),__:(t,e)=>{let n=p(e,void 0,t);return r?(n=r.applyFilters("i18n.gettext",n,t,e),r.applyFilters("i18n.gettext_"+d(e),n,t,e)):n},_x:f,_n:(t,e,n,a)=>{let o=p(a,void 0,t,e,n);return r?(o=r.applyFilters("i18n.ngettext",o,t,e,n,a),r.applyFilters("i18n.ngettext_"+d(a),o,t,e,n,a)):o},_nx:(t,e,n,a,o)=>{let i=p(o,a,t,e,n);return r?(i=r.applyFilters("i18n.ngettext_with_context",i,t,e,n,a,o),r.applyFilters("i18n.ngettext_with_context_"+d(o),i,t,e,n,a,o)):i},isRTL:()=>"rtl"===f("ltr","text direction"),hasTranslation:(t,e,n)=>{var a,o;const s=e?e+""+t:t;let c=!(null===(a=i.data)||void 0===a||null===(o=a[null!=n?n:"default"])||void 0===o||!o[s]);return r&&(c=r.applyFilters("i18n.has_translation",c,t,e,n),c=r.applyFilters("i18n.has_translation_"+d(n),c,t,e,n)),c}}}},836:(t,e,r)=>{"use strict";r.d(e,{__:()=>i});var n=r(16),a=r(957);const o=(0,n.o)(void 0,void 0,a.JQ);o.getLocaleData.bind(o),o.setLocaleData.bind(o),o.resetLocaleData.bind(o),o.subscribe.bind(o);const i=o.__.bind(o);o._x.bind(o),o._n.bind(o),o._nx.bind(o),o.isRTL.bind(o),o.hasTranslation.bind(o)},304:(t,e,r)=>{"use strict";r.d(e,{__:()=>n.__});r(917),r(16);var n=r(836)},917:(t,e,r)=>{"use strict";var n=r(588),a=r.n(n);r(975);a()(console.error)},359:(t,e,r)=>{"use strict";r(39),r(869);function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){if(null==t)return{};var r,n,a=function(t,e){if(null==t)return{};var r,n,a={},o=Object.keys(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||(a[r]=t[r]);return a}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}var o=r(588),i=r.n(o);r(975),i()(console.error);var s=r(22);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l={"":{plural_forms:function(t){return 1===t?0:1}}},p=/^i18n\.(n?gettext|has_translation)(_|$)/;const d=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};const f=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};const m=function(t,e){return function(r,n,a){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=t[e];if(f(r)&&d(n))if("function"==typeof a)if("number"==typeof o){var s={callback:a,priority:o,namespace:n};if(i[r]){var c,u=i[r].handlers;for(c=u.length;c>0&&!(o>=u[c-1].priority);c--);c===u.length?u[c]=s:u.splice(c,0,s),i.__current.forEach((function(t){t.name===r&&t.currentIndex>=c&&t.currentIndex++}))}else i[r]={handlers:[s],runs:0};"hookAdded"!==r&&t.doAction("hookAdded",r,n,a,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};const y=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n,a){var o=t[e];if(f(n)&&(r||d(a))){if(!o[n])return 0;var i=0;if(r)i=o[n].handlers.length,o[n]={runs:o[n].runs,handlers:[]};else for(var s=o[n].handlers,c=function(t){s[t].namespace===a&&(s.splice(t,1),i++,o.__current.forEach((function(e){e.name===n&&e.currentIndex>=t&&e.currentIndex--})))},u=s.length-1;u>=0;u--)c(u);return"hookRemoved"!==n&&t.doAction("hookRemoved",n,a),i}}};const h=function(t,e){return function(r,n){var a=t[e];return void 0!==n?r in a&&a[r].handlers.some((function(t){return t.namespace===n})):r in a}};const v=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n){var a=t[e];a[n]||(a[n]={handlers:[],runs:0}),a[n].runs++;var o=a[n].handlers;for(var i=arguments.length,s=new Array(i>1?i-1:0),c=1;c<i;c++)s[c-1]=arguments[c];if(!o||!o.length)return r?s[0]:void 0;var u={name:n,currentIndex:0};for(a.__current.push(u);u.currentIndex<o.length;){var l=o[u.currentIndex],p=l.callback.apply(null,s);r&&(s[0]=p),u.currentIndex++}return a.__current.pop(),r?s[0]:void 0}};const g=function(t,e){return function(){var r,n,a=t[e];return null!==(r=null===(n=a.__current[a.__current.length-1])||void 0===n?void 0:n.name)&&void 0!==r?r:null}};const _=function(t,e){return function(r){var n=t[e];return void 0===r?void 0!==n.__current[0]:!!n.__current[0]&&r===n.__current[0].name}};const b=function(t,e){return function(r){var n=t[e];if(f(r))return n[r]&&n[r].runs?n[r].runs:0}};var w=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=m(this,"actions"),this.addFilter=m(this,"filters"),this.removeAction=y(this,"actions"),this.removeFilter=y(this,"filters"),this.hasAction=h(this,"actions"),this.hasFilter=h(this,"filters"),this.removeAllActions=y(this,"actions",!0),this.removeAllFilters=y(this,"filters",!0),this.doAction=v(this,"actions"),this.applyFilters=v(this,"filters",!0),this.currentAction=g(this,"actions"),this.currentFilter=g(this,"filters"),this.doingAction=_(this,"actions"),this.doingFilter=_(this,"filters"),this.didAction=b(this,"actions"),this.didFilter=b(this,"filters")};var O=function(){return new w}(),j=(O.addAction,O.addFilter,O.removeAction,O.removeFilter,O.hasAction,O.hasFilter,O.removeAllActions,O.removeAllFilters,O.doAction,O.applyFilters,O.currentAction,O.currentFilter,O.doingAction,O.doingFilter,O.didAction,O.didFilter,O.actions,O.filters,function(t,e,r){var n=new s.Z({}),a=new Set,o=function(){a.forEach((function(t){return t()}))},i=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";n.data[e]=u(u(u({},l),n.data[e]),t),n.data[e][""]=u(u({},l[""]),n.data[e][""])},c=function(t,e){i(t,e),o()},d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return n.data[t]||i(void 0,t),n.dcnpgettext(t,e,r,a,o)},f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return t},m=function(t,e,n){var a=d(n,e,t);return r?(a=r.applyFilters("i18n.gettext_with_context",a,t,e,n),r.applyFilters("i18n.gettext_with_context_"+f(n),a,t,e,n)):a};if(t&&c(t,e),r){var y=function(t){p.test(t)&&o()};r.addAction("hookAdded","core/i18n",y),r.addAction("hookRemoved","core/i18n",y)}return{getLocaleData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return n.data[t]},setLocaleData:c,resetLocaleData:function(t,e){n.data={},n.pluralForms={},c(t,e)},subscribe:function(t){return a.add(t),function(){return a.delete(t)}},__:function(t,e){var n=d(e,void 0,t);return r?(n=r.applyFilters("i18n.gettext",n,t,e),r.applyFilters("i18n.gettext_"+f(e),n,t,e)):n},_x:m,_n:function(t,e,n,a){var o=d(a,void 0,t,e,n);return r?(o=r.applyFilters("i18n.ngettext",o,t,e,n,a),r.applyFilters("i18n.ngettext_"+f(a),o,t,e,n,a)):o},_nx:function(t,e,n,a,o){var i=d(o,a,t,e,n);return r?(i=r.applyFilters("i18n.ngettext_with_context",i,t,e,n,a,o),r.applyFilters("i18n.ngettext_with_context_"+f(o),i,t,e,n,a,o)):i},isRTL:function(){return"rtl"===m("ltr","text direction")},hasTranslation:function(t,e,a){var o,i,s=e?e+""+t:t,c=!(null===(o=n.data)||void 0===o||null===(i=o[null!=a?a:"default"])||void 0===i||!i[s]);return r&&(c=r.applyFilters("i18n.has_translation",c,t,e,a),c=r.applyFilters("i18n.has_translation_"+f(a),c,t,e,a)),c}}}(void 0,void 0,O));j.getLocaleData.bind(j),j.setLocaleData.bind(j),j.resetLocaleData.bind(j),j.subscribe.bind(j);var x=j.__.bind(j);j._x.bind(j),j._n.bind(j),j._nx.bind(j),j.isRTL.bind(j),j.hasTranslation.bind(j);function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const T=function(t){var e=function t(e,r){var n=e.headers,a=void 0===n?{}:n;for(var o in a)if("x-wp-nonce"===o.toLowerCase()&&a[o]===t.nonce)return r(e);return r(P(P({},e),{},{headers:P(P({},a),{},{"X-WP-Nonce":t.nonce})}))};return e.nonce=t,e};function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const E=function(t,e){var r,n,a=t.path;return"string"==typeof t.namespace&&"string"==typeof t.endpoint&&(r=t.namespace.replace(/^\/|\/$/g,""),a=(n=t.endpoint.replace(/^\//,""))?r+"/"+n:r),delete t.namespace,delete t.endpoint,e(S(S({},t),{},{path:a}))};function D(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function F(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?D(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const L=function(t){return function(e,r){return E(e,(function(e){var n,a=e.url,o=e.path;return"string"==typeof o&&(n=t,-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(o=o.replace("?","&")),a=n+o),r(F(F({},e),{},{url:a}))}))}};function I(t){var e=t.split("?"),r=e[1],n=e[0];return r?n+"?"+r.split("&").map((function(t){return t.split("=")})).sort((function(t,e){return t[0].localeCompare(e[0])})).map((function(t){return t.join("=")})).join("&"):n}const Z=function(t){var e=Object.keys(t).reduce((function(e,r){return e[I(r)]=t[r],e}),{});return function(t,r){var n=t.parse,a=void 0===n||n;if("string"==typeof t.path){var o=t.method||"GET",i=I(t.path);if("GET"===o&&e[i]){var s=e[i];return delete e[i],Promise.resolve(a?s.body:new window.Response(JSON.stringify(s.body),{status:200,statusText:"OK",headers:s.headers}))}if("OPTIONS"===o&&e[o]&&e[o][i])return Promise.resolve(e[o][i])}return r(t)}};function C(t,e,r,n,a,o,i){try{var s=t[o](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,a)}var N=r(757),M=r.n(N);function $(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function U(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return $(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function q(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?R(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function W(t){return(function(t){var e;try{e=new URL(t,"http://example.com").search.substring(1)}catch(t){}if(e)return e}(t)||"").replace(/\+/g,"%20").split("&").reduce((function(t,e){var r=U(e.split("=").filter(Boolean).map(decodeURIComponent),2),n=r[0],a=r[1],o=void 0===a?"":a;n&&function(t,e,r){for(var n=e.length,a=n-1,o=0;o<n;o++){var i=e[o];!i&&Array.isArray(t)&&(i=t.length.toString());var s=!isNaN(Number(e[o+1]));t[i]=o===a?r:t[i]||(s?[]:{}),Array.isArray(t[i])&&!s&&(t[i]=q({},t[i])),t=t[i]}}(t,n.replace(/\]/g,"").split("["),o);return t}),{})}function z(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Q(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Q(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return i=t.done,t},e:function(t){s=!0,o=t},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw o}}}}function Q(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function G(t){for(var e,r="",n=Object.entries(t);e=n.shift();){var a=U(e,2),o=a[0],i=a[1];if(Array.isArray(i)||i&&i.constructor===Object){var s,c=z(Object.entries(i).reverse());try{for(c.s();!(s=c.n()).done;){var u=U(s.value,2),l=u[0],p=u[1];n.unshift(["".concat(o,"[").concat(l,"]"),p])}}catch(t){c.e(t)}finally{c.f()}}else void 0!==i&&(null===i&&(i=""),r+="&"+[o,i].map(encodeURIComponent).join("="))}return r.substr(1)}function J(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;if(!e||!Object.keys(e).length)return t;var r=t,n=t.indexOf("?");return-1!==n&&(e=Object.assign(W(t),e),r=r.substr(0,n)),r+"?"+G(e)}function Y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function H(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Y(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var V=function(t){return t.json?t.json():Promise.reject(t)},X=function(t){return function(t){if(!t)return{};var e=t.match(/<([^>]+)>; rel="next"/);return e?{next:e[1]}:{}}(t.headers.get("link")).next},B=function(t){var e=!!t.path&&-1!==t.path.indexOf("per_page=-1"),r=!!t.url&&-1!==t.url.indexOf("per_page=-1");return e||r};const K=function(){var t,e=(t=M().mark((function t(e,r){var n,o,i,s,c,u;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1!==e.parse){t.next=2;break}return t.abrupt("return",r(e));case 2:if(B(e)){t.next=4;break}return t.abrupt("return",r(e));case 4:return t.next=6,_t(H(H({},(l=e,p={per_page:100},d=void 0,f=void 0,d=l.path,f=l.url,H(H({},a(l,["path","url"])),{},{url:f&&J(f,p),path:d&&J(d,p)}))),{},{parse:!1}));case 6:return n=t.sent,t.next=9,V(n);case 9:if(o=t.sent,Array.isArray(o)){t.next=12;break}return t.abrupt("return",o);case 12:if(i=X(n)){t.next=15;break}return t.abrupt("return",o);case 15:s=[].concat(o);case 16:if(!i){t.next=27;break}return t.next=19,_t(H(H({},e),{},{path:void 0,url:i,parse:!1}));case 19:return c=t.sent,t.next=22,V(c);case 22:u=t.sent,s=s.concat(u),i=X(c),t.next=16;break;case 27:return t.abrupt("return",s);case 28:case"end":return t.stop()}var l,p,d,f}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){C(o,n,a,i,s,"next",t)}function s(t){C(o,n,a,i,s,"throw",t)}i(void 0)}))});return function(t,r){return e.apply(this,arguments)}}();function tt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function et(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?tt(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var rt=new Set(["PATCH","PUT","DELETE"]);function nt(t,e){return void 0!==function(t,e){return W(t)[e]}(t,e)}var at=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e?204===t.status?null:t.json?t.json():Promise.reject(t):t},ot=function(t){var e={code:"invalid_json",message:x("The response is not a valid JSON response.")};if(!t||!t.json)throw e;return t.json().catch((function(){throw e}))},it=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(at(t,e)).catch((function(t){return st(t,e)}))};function st(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)throw t;return ot(t).then((function(t){var e={code:"unknown_error",message:x("An unknown error occurred.")};throw t||e}))}function ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ut(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ct(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ct(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const lt=function(t,e){if(!(t.path&&-1!==t.path.indexOf("/wp/v2/media")||t.url&&-1!==t.url.indexOf("/wp/v2/media")))return e(t);var r=0,n=function t(n){return r++,e({path:"/wp/v2/media/".concat(n,"/post-process"),method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((function(){return r<5?t(n):(e({path:"/wp/v2/media/".concat(n,"?force=true"),method:"DELETE"}),Promise.reject())}))};return e(ut(ut({},t),{},{parse:!1})).catch((function(e){var r=e.headers.get("x-wp-upload-attachment-id");return e.status>=500&&e.status<600&&r?n(r).catch((function(){return!1!==t.parse?Promise.reject({code:"post_process",message:x("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(e)})):st(e,t.parse)})).then((function(e){return it(e,t.parse)}))};function pt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var ft={Accept:"application/json, */*;q=0.1"},mt={credentials:"include"},yt=[function(t,e){return"string"!=typeof t.url||nt(t.url,"_locale")||(t.url=J(t.url,{_locale:"user"})),"string"!=typeof t.path||nt(t.path,"_locale")||(t.path=J(t.path,{_locale:"user"})),e(t)},E,function(t,e){var r=t.method,n=void 0===r?"GET":r;return rt.has(n.toUpperCase())&&(t=et(et({},t),{},{headers:et(et({},t.headers),{},{"X-HTTP-Method-Override":n,"Content-Type":"application/json"}),method:"POST"})),e(t)},K];var ht=function(t){if(t.status>=200&&t.status<300)return t;throw t},vt=function(t){var e=t.url,r=t.path,n=t.data,o=t.parse,i=void 0===o||o,s=a(t,["url","path","data","parse"]),c=t.body,u=t.headers;return u=dt(dt({},ft),u),n&&(c=JSON.stringify(n),u["Content-Type"]="application/json"),window.fetch(e||r||window.location.href,dt(dt(dt({},mt),s),{},{body:c,headers:u})).then((function(t){return Promise.resolve(t).then(ht).catch((function(t){return st(t,i)})).then((function(t){return it(t,i)}))}),(function(){throw{code:"fetch_error",message:x("You are probably offline.")}}))};function gt(t){return yt.reduceRight((function(t,e){return function(r){return e(r,t)}}),vt)(t).catch((function(e){return"rest_cookie_invalid_nonce"!==e.code?Promise.reject(e):window.fetch(gt.nonceEndpoint).then(ht).then((function(t){return t.text()})).then((function(e){return gt.nonceMiddleware.nonce=e,gt(t)}))}))}gt.use=function(t){yt.unshift(t)},gt.setFetchHandler=function(t){vt=t},gt.createNonceMiddleware=T,gt.createPreloadingMiddleware=Z,gt.createRootURLMiddleware=L,gt.fetchAllMiddleware=K,gt.mediaUploadMiddleware=lt;const _t=gt;function bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return wt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wt(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Ot;jQuery(document.body).on("click",".customer-dashboard button[type=submit]",(function(t){t.preventDefault();var e=jQuery(this).parents("form"),r={first_name:e.find("input[name=first_name]").val()||null,last_name:e.find("input[name=last_name]").val()||null,email:e.find("input[name=email]").val()||null,password:e.find("input[name=password]").val()||null,password_confirm:e.find("input[name=password_confirm]").val()||null},n=e.find("input[name=customer_id]").val()||0;n&&_t({path:"".concat(smartpay.restUrl,"/v1/public/customers/").concat(n),method:"PUT",headers:{"X-WP-Nonce":smartpay.apiNonce},body:JSON.stringify(r)}).then((function(t){e.find("#form-response").append('<div class="alert alert-success text-center mb-4">Profile updated</div>')})).catch((function(t){e.find("form-response").append('<div class="alert alert-danger text-center mb-4">'.concat(t.message,"</div>"))}))})),(Ot=jQuery).fn.serializeJSON=function(){if(this.length<1)return!1;var t={},e=t,r=':input[type!="checkbox"][type!="radio"], input:checked',n=function(){if(!this.disabled){var r=this.name.replace(/\[([^\]]+)?\]/g,",$1").split(","),n=r.length-1,a=Ot(this);if(r[0]){for(var o=0;o<n;o++)e=e[r[o]]=e[r[o]]||(""===r[o+1]||"0"===r[o+1]?[]:{});void 0!==e.length?e.push(a.val()):e[r[n]]=a.val(),e=t}}};return this.filter(r).each(n),this.find(r).each(n),t},jQuery((function(t){window.SmartPayFormValidator=function(t,e){var r=this,n=this;this.data=t,this.rules=e,n.validate=function(){return Object.entries(r.rules).reduce((function(t,e){var n=bt(e,2),a=n[0],o=n[1],i=[];if(o.required){var s=r.validateRequiredMessage(r.data[a]);s&&i.push(s)}if(o.requiredWhen){var c=r.validateRequiredWhenMessage(r.data[a],o.requiredWhen);c&&i.push(c)}if(o.email){var u=r.validateEmailMessage(r.data[a]);u&&i.push(u)}if(o.length){var l=r.validateLengthMessage(r.data[a],o.length);l&&i.push(l)}if(o.value){var p=r.validateValueMessage(r.data[a],o.value);p&&i.push(p)}return i.length&&(t[a]=i),t}),{})},n.validateLengthMessage=function(t,e){if(null!=t){if(Array.isArray(e)){if(t.length>=e[0]&&t.length<=e[1])return;return"must be between ".concat(e[0]," to ").concat(e[1]," character")}if(!(t.length>=e))return"must be ".concat(e," or more characters")}},n.validateRequiredMessage=function(t){if(!t)return"is required"},n.validateRequiredWhenMessage=function(t,e){var r=bt(e,2),a=r[0],o=r[1];if(a&&n.data[a]===o)return n.validateRequiredMessage(t)},n.validateEmailMessage=function(t){if(!/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(t))return"is not a valid email"},n.validateValueMessage=function(t,e){if(t!==e)return"must be same as ".concat(e)}},window.JSUcfirst=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}}))},869:(t,e,r)=>{function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var c=r(400).SUBSCRIPTION;jQuery((function(t){var e,r;t(document.body).on("click",".smartpay-form-shortcode .form-amounts .form-plan-card",(function(e){t(e.currentTarget).parents(".form-amounts").find(".plan-amount").removeClass("selected"),t(e.currentTarget).addClass("selected");var r=t(e.currentTarget).find('input[name="_form_amount"]'),n=t(e.currentTarget).find('input[name="_form_billing_type"]');if(c===n.val())var a=t(e.currentTarget).find('input[name="_form_billing_period"]'),o=t(e.currentTarget).find('input[name="_form_amount_key"]');t(e.currentTarget).parents(".form-amounts").find(".form--custom-amount").val(r.val()),t(e.currentTarget).parents(".form-amounts").find('input[name="smartpay_form_billing_type"]').val(n.val()),c===n.val()&&(t(e.currentTarget).parents(".form-amounts").find('input[name="smartpay_form_billing_period"]').val(a.val()),t("#smartpay-payment-form").find('input[name="smartpay_selected_amount_key"]').val(o.val())),t("#smartpay_is_custom_payment").val("false")})),t(document.body).on("click",".smartpay-form-shortcode .gateways .gateway",(function(e){t(e.currentTarget).parents(".gateways").find(".gateway").removeClass("selected"),t(e.currentTarget).addClass("selected")})),t(document.body).on("focus",".smartpay-form-shortcode .form-amounts .form--custom-amount",(function(e){t(e.currentTarget).parents(".form-amounts").find(".plan-amount").removeClass("selected"),t(e.currentTarget).addClass("selected"),t(e.currentTarget).parents(".form-amounts").find('.plan-amount input[type="radio"]:checked').prop("checked",!1),t("#smartpay_is_custom_payment").val("true")})),t(document.body).on("click",".smartpay-form-shortcode button.smartpay-form-pay-now",(function(e){e.preventDefault(),$parentWrapper=t(e.currentTarget).parents(".smartpay-payment");var r,a=t(e.currentTarget).text(),o=function(t){var e=t.find("#smartpay-payment-form").serializeJSON();return i({smartpay_action:"smartpay_process_payment",smartpay_payment_type:"form_payment",smartpay_process_payment:e.smartpay_process_payment,smartpay_gateway:e.smartpay_gateway,smartpay_first_name:e.smartpay_form.name.first_name,smartpay_last_name:e.smartpay_form.name.last_name,smartpay_email:e.smartpay_form.email,smartpay_payment_mobile:e.smartpay_payment_mobile,smartpay_form_id:e.smartpay_form_id,smartpay_amount:e.smartpay_form_amount,smartpay_amount_key:e.smartpay_selected_amount_key,smartpay_form_data:e.smartpay_form,smartpay_is_custom_amount:e.smartpay_is_custom_payment,smartpay_form_billing_type:e.smartpay_form_billing_type},c===e.smartpay_form_billing_type&&{smartpay_form_billing_period:e.smartpay_form_billing_period})}($parentWrapper),s=(r=new SmartPayFormValidator(o,{smartpay_action:{required:!0,value:"smartpay_process_payment"},smartpay_process_payment:{required:!0},smartpay_gateway:{required:!0},smartpay_first_name:{required:!0},smartpay_last_name:{required:!0},smartpay_email:{required:!0,email:!0},smartpay_payment_mobile:{requiredWhen:["smartpay_gateway","toyyibpay"]},smartpay_payment_type:{required:!0}}).validate(),{valid:Object.values(r).every((function(t){return 0===t.length})),errors:r});$parentWrapper.find("input").removeClass("is-invalid"),$parentWrapper.find("#form-response").hide(),s.valid?(t(e.currentTarget).text("Processing...").attr("disabled",!0),jQuery.post(smartpay.ajaxUrl,{action:"smartpay_process_payment",data:o},(function(r){r?$parentWrapper.find("#payment-response").html(r).show():($parentWrapper.find("#payment-response").html('<p class="text-danger">Something wrong! Please try again later.</p>').show(),console.error("Something wrong!")),setTimeout((function(){t(e.currentTarget).text(a).attr("disabled",!1)}),500)}))):(!function(t,e){var r=t.parents(".smartpay-payment"),a=[];if(Object.entries(e.errors).forEach((function(t){var e=n(t,2),o=e[0],i=e[1];r.find('input[name="'+o+'"]').addClass("is-invalid");var s=JSUcfirst(o.split("_").slice(1).join(" "));a.push('\n                <div class="alert alert-danger">\n                    <p class="m-0 form-error-text">'.concat(s," ").concat(i[0],"</p>\n                </div>"))})),!a.length)return;t.html(a),t.show()}($parentWrapper.find(".smartpay-message-info"),s),$parentWrapper.find("#first_name").focus())})),t(document.body).on("click",".smartpay-form-shortcode button.open-form-modal",(function(e){e.preventDefault();var r=t(e.currentTarget).parents(".smartpay-form-shortcode").find(".form-modal");setTimeout((function(){r.modal("show"),t(".modal-backdrop").last().appendTo(t(e.currentTarget).closest(".smartpay"))}),500)})),t(".smartpay-coupon-form-toggle .smartpayshowcoupon").on("click",(function(e){t(this).parents(".smartpay-coupon-form-toggle").addClass("d-none"),t(".smartpay-coupon-form").removeClass("d-none"),e.preventDefault()})),t(".smartpay-coupon-form").on("submit",(function(n){var a=t(this).find("input[name=coupon_code]").val(),o=t(this).parents(".smartpay_form_builder_wrapper").find("#smartpay-payment-form input[name=smartpay_form_id]").val();t.ajax({method:"POST",url:smartpay.ajaxUrl,data:{action:"smartpay_coupon",couponCode:a,formId:o}}).done((function(n){if(n.success){t(".smartpay-message-info").append('<div class="alert alert-success">'.concat(n.data.message,"</div>")),e=n.data.couponData,r=n.data.currency,t("#smartpay-payment-form").addClass("coupon-applied"),t("#smartpay-payment-form").find(".form--fixed-amount").each((function(){var r=t(this).find("input[name=_form_amount]").attr("id");t(this).find("input[name=_form_amount]").val(e[r].discountAmount)}));var a=t("#smartpay-payment-form .form-amounts").find(".form--fixed-amount.selected input[name=_form_amount]").attr("id");t("#smartpay-payment-form input[name=smartpay_form_amount]").val(e[a].discountAmount),t(".discount-amounts-container").removeClass("d-none"),t(".discount-amounts-container").find(".subtotal-amount-value").html("".concat(r).concat(e[a].mainAmount)),t(".discount-amounts-container").find(".coupon-amount-name").html(n.data.couponCode),t(".discount-amounts-container").find(".coupon-amount-value").html("-".concat(r).concat(e[a].couponAmount)),t(".discount-amounts-container").find(".total-amount-value").html("".concat(r).concat(e[a].discountAmount))}n.success||t(".smartpay-message-info").append('<div class="alert alert-danger">'.concat(n.data.message,"</div>"))})),n.preventDefault()})),t(".smartpay-form-shortcode .form-amounts .form--fixed-amount").on("click",(function(){if(t("#smartpay-payment-form").hasClass("coupon-applied")){var n=t(this).find("input[name=_form_amount]").attr("id");t(".discount-amounts-container").find(".subtotal-amount-value").html("".concat(r).concat(e[n].mainAmount)),t(".discount-amounts-container").find(".coupon-amount-value").html("-".concat(r).concat(e[n].couponAmount)),t(".discount-amounts-container").find(".total-amount-value").html("".concat(r).concat(e[n].discountAmount))}})),t(".smartpay-coupon-form-close").on("click",(function(e){t(".smartpay-coupon-form").addClass("d-none"),t(".smartpay-coupon-form-toggle").removeClass("d-none"),e.preventDefault()}))}))},39:()=>{function t(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}(t,r)||function(t,r){if(!t)return;if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}jQuery((function(e){function r(t){t.find(".step-1").show(),t.find(".step-2").hide(),e(".back-to-first-step").hide()}function n(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={smartpay_action:"smartpay_process_payment",smartpay_process_payment:t.find('input[name="smartpay_process_payment"]').val()||null,smartpay_gateway:t.find('input[name="smartpay_gateway"]:checked').val()||null,smartpay_first_name:t.find('input[name="smartpay_first_name"]').val()||null,smartpay_last_name:t.find('input[name="smartpay_last_name"]').val()||null,smartpay_email:t.find('input[name="smartpay_email"]').val()||null,smartpay_payment_type:t.find('input[name="smartpay_payment_type"]').val()||null,smartpay_payment_mobile:t.find('input[name="smartpay_payment_mobile"]').val()||null};if("product_purchase"===n.smartpay_payment_type)n.smartpay_product_id=t.find('input[name="smartpay_product_id"]').val()||null,n.smartpay_product_price=t.find('input[name="smartpay_product_price"]').val()||null,n.smartpay_product_billing_type=t.find('input[name="smartpay_product_billing_type"]').val()||null,"Subscription"===n.smartpay_product_billing_type&&(n.smartpay_product_billing_period=t.find('input[name="smartpay_product_billing_period"]').val());else{n.smartpay_form_id=t.find('input[name="smartpay_form_id"]').val()||null,n.smartpay_amount=t.find('input[name="smartpay_form_amount"]').val()||null;var a={};t.find('.smartpay_form_builder_wrapper > form input[name^="smartpay_"]').length&&t.find('.smartpay_form_builder_wrapper > form input[name^="smartpay_"]').each((function(t,r){a[e(r).attr("name")]=e(r).val()})),n.smartpay_form_extra_data=a||{}}return r?n.index||null:n}e(document.body).on("click",".smartpay-product-shortcode .product-variations .variation",(function(t){e(t.currentTarget).parent().find(".variation").removeClass("selected"),e(t.currentTarget).addClass("selected");var r=e(t.currentTarget).find(".sale-price").data("price");e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_price"]').val(r);var n=e(t.currentTarget).find('input[name="_product_billing_type"]');if(e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_billing_type"]').val(n.val()),"Subscription"===n.val()){var a=e(t.currentTarget).find('input[name="_product_billing_period"]');e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_billing_period"]').val(a.val());var o=e(t.currentTarget).find('input[name="_product_additional_charge"]');e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_additional_charge"]').val(o.val())}var i=e(t.currentTarget).find('input[name="_smartpay_product_id"]');e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_id"]').val(i.val())})),e(document).ready((function(){var t=document.querySelector("#mobile-field");if(t){var r=e("input[name='smartpay_gateway']:checked").val(),n='<div class="form-group"><input type="number" placeholder="Mobile No" class="form-control" name="smartpay_payment_mobile"  id="smartpay_payment_mobile" required /></div>';"toyyibpay"===r&&(t.innerHTML=n),jQuery('input[name="smartpay_gateway"]').toArray().forEach((function(e){e.addEventListener("change",(function(){"toyyibpay"===e.value?t.innerHTML=n:t.innerHTML=""}))}))}})),e(document.body).on("click",".smartpay-product-shortcode button.open-product-modal",(function(t){t.preventDefault();var r=e(t.currentTarget).parents(".smartpay-product-shortcode").find(".product-modal");setTimeout((function(){r.modal("show"),e(".modal-backdrop").last().appendTo(e(t.currentTarget).closest(".smartpay"))}),500)})),e(document.body).on("click",".smartpay-payment button.open-payment-form",(function(t){t.preventDefault(),$parentWrapper=e(t.currentTarget).parents(".smartpay-payment");var a=$parentWrapper.find(".payment-modal"),o=n($parentWrapper),i=jQuery('input[name="smartpay_product_billing_type"]').val(),s=jQuery('input[name="smartpay_selected_currency_symbol"]').val(),c=e("#smartpay_additional_amount_id"),u=e("#smartpay_product_billing_type_id");if("Subscription"===i){var l=jQuery('input[name="smartpay_product_billing_period"]').val(),p='<div class="justify-content-center mb-2 mt-2">\n                    <p class="text-center text-muted font-weight-light">\n                        Enter your info to begin your\n                        <strong><span class="product_billing_type">'.concat(l,"</span></strong> subscription. You can cancel anytime.\n                    </p>\n                </div>");u.html(p);var d=e("input[name='smartpay_product_additional_charge']").val(),f='<div class="text-primary font-weight-bold text-center"><p>\n                        Additional charge '.concat(s+d,"  will be applied to the subscription.\n                    </p>\n                </div>");c&&c.html(f)}else{u.html('<div class="justify-content-center mb-2 mt-2">\n                <p class="text-center text-muted">Provide your information to complete your purchase.</p></div>'),c&&c.html("")}var m=0;"form_payment"===o.smartpay_payment_type?m=e("#smartpay_currency_symbol").data("value")+o.smartpay_amount:m=o.smartpay_product_price;a.find(".amount").html(s+m),r(a);var y=e(t.currentTarget).text();e(t.currentTarget).text("Processing...").attr("disabled","disabled"),setTimeout((function(){a.modal("show"),o.smartpay_first_name&&a.find('input[name="smartpay_first_name"]').val(o.smartpay_first_name),o.smartpay_last_name&&a.find('input[name="smartpay_last_name"]').val(o.smartpay_last_name),o.smartpay_email&&a.find('input[name="smartpay_email"]').val(o.smartpay_email),e(".modal-backdrop").last().appendTo(e(t.currentTarget).closest(".smartpay-payment")),e(t.currentTarget).text(y).removeAttr("disabled")}),500)})),e(document.body).on("click",".smartpay-payment button.back-to-first-step",(function(t){t.preventDefault(),r(e(t.currentTarget).parents(".smartpay-payment").find(".payment-modal"))})),e(document.body).on("click",".smartpay-payment button.smartpay-pay-now",(function(r){r.preventDefault(),$parentWrapper=e(r.currentTarget).parents(".smartpay-payment");var a=e(r.currentTarget).text(),o=e(r.currentTarget).parents(".step-1"),i=e(r.currentTarget).parents(".modal-content").children(".step-2");e(r.currentTarget).text("Processing...").attr("disabled","disabled"),$parentWrapper.find(".modal-loading").css("display","flex");var s=n($parentWrapper),c=function(t){var e=new SmartPayFormValidator(t,{smartpay_action:{required:!0,value:"smartpay_process_payment"},smartpay_process_payment:{required:!0},smartpay_gateway:{required:!0},smartpay_first_name:{required:!0},smartpay_last_name:{required:!0},smartpay_payment_mobile:{requiredWhen:["smartpay_gateway","toyyibpay"]},smartpay_email:{required:!0,email:!0},smartpay_payment_type:{required:!0}}).validate();return{valid:Object.values(e).every((function(t){return 0===t.length})),errors:e}}(s);if($parentWrapper.find("input").removeClass("is-invalid"),o.find(".payment-modal--errors").hide(),c.valid){var u={action:"smartpay_process_payment",data:s};jQuery.post(smartpay.ajaxUrl,u,(function(t){i.css("display","flex"),e(".back-to-first-step").show(),o.hide(),setTimeout((function(){t?i.find(".dynamic-content").html(t):i.find(".dynamic-content").html('<p class="text-danger">Something wrong!</p>'),$parentWrapper.find(".modal-loading").css("display","none")}),300)}))}else!function(e,r){var n=e.parents(".smartpay-payment"),a=[];if(Object.entries(r.errors).forEach((function(e){var r=t(e,2),o=r[0],i=r[1];n.find('input[name="'+o+'"]').addClass("is-invalid");var s=JSUcfirst(o.split("_").slice(1).join(" "));a.push('\n                <div class="alert alert-danger">\n                    <p class="m-0 form-error-text">'.concat(s," ").concat(i[0],"</p>\n                </div>"))})),!a.length)return;e.show(),e.html(a)}(o.find(".payment-modal--errors"),c),setTimeout((function(){$parentWrapper.find(".modal-loading").css("display","none")}),300);e(r.currentTarget).text(a).removeAttr("disabled")})),e(document.body).on("click",".smartpay-payment button.modal-close",(function(t){e(t.currentTarget).parents(".smartpay-payment").find(".payment-modal").modal("hide")})),e(document.body).on("show.bs.modal",".payment-modal",(function(t){document.body.style.overflow="hidden"})),e(document.body).on("hidden.bs.modal",".payment-modal",(function(t){document.body.style.overflow="auto"})),e(".smartpay-product-coupon-form-toggle .smartpayshowcoupon").on("click",(function(){return e(".smartpay-product-coupon-form").toggleClass("d-none"),!1})),e(".smartpay-product-coupon-form").on("submit",(function(t){var r=e(this).find("input[name=coupon_code]").val(),n=e(this).parents(".smartpay-product-shortcode").find("input[name=smartpay_product_id]").val(),a=e(this).parents(".smartpay-product-shortcode").find("input[name=smartpay_product_price]").val();e.ajax({method:"POST",url:smartpay.ajaxUrl,data:{action:"smartpay_product_coupon",couponCode:r,productID:n,productPrice:a}}).done((function(t){if(t.success){var r=e(".discount-amounts-container"),n=e(".payment-modal--errors");e(".payment-modal--errors .alert").hide(),n.append('<div class="alert alert-success">'.concat(t.data.message,"</div>")),n.show(),$couponData=t.data.couponData,$currency=t.data.currency,r.find(".subtotal-amount-value").html("".concat($currency).concat($couponData.mainAmount)),r.find(".coupon-amount-name").html(t.data.couponCode),r.find(".coupon-amount-value").html("-".concat($currency).concat($couponData.couponAmount)),r.find(".total-amount-value").html("".concat($currency).concat($couponData.discountAmount)),r.find("input[name=smartpay_product_price]").val("".concat($couponData.discountAmount)),r.find(".payment-modal--title").html("".concat($couponData.discountAmount)),r.removeClass("d-none")}if(!t.success){var a=e(".payment-modal--errors");e(".payment-modal--errors .alert").hide(),a.append('<div class="alert alert-danger">'.concat(t.data.message,"</div>")),a.show()}})),t.preventDefault()}))}))},400:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ONE_TIME:()=>a,PAYMENT_STATUS_ABANDONED:()=>l,PAYMENT_STATUS_COMPLETED:()=>s,PAYMENT_STATUS_FAILED:()=>u,PAYMENT_STATUS_PENDING:()=>i,PAYMENT_STATUS_PROCESSING:()=>d,PAYMENT_STATUS_REFUNDED:()=>c,PAYMENT_STATUS_REVOKED:()=>p,SUBSCRIPTION:()=>o,productDefaultData:()=>f,variationDefaultData:()=>m});var n=r(304),a="One Time",o="Subscription",i="Pending",s="Completed",c="Refunded",u="Failed",l="Abandoned",p="Revoked",d="Processing",f={title:"",covers:[],description:"",variations:[],base_price:"",sale_price:"",files:[],settings:{payButtonLabel:(0,n.__)("Pay Now","smartpay"),label:(0,n.__)("Just Label checking","smartpay"),externalLink:{allowExternalLink:!1,label:(0,n.__)("Link Label","smartpay"),link:""}},extra:{}},m={title:"",description:"",base_price:"",sale_price:"",files:[],key:"",extra:{billing_type:a}}},470:()=>{},347:()=>{},737:()=>{},588:t=>{t.exports=function(t,e){var r,n,a=0;function o(){var o,i,s=r,c=arguments.length;t:for(;s;){if(s.args.length===arguments.length){for(i=0;i<c;i++)if(s.args[i]!==arguments[i]){s=s.next;continue t}return s!==r&&(s===n&&(n=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=r,s.prev=null,r.prev=s,r=s),s.val}s=s.next}for(o=new Array(c),i=0;i<c;i++)o[i]=arguments[i];return s={args:o,val:t.apply(null,o)},r?(r.prev=s,s.next=r):n=s,a===e.maxSize?(n=n.prev).next=null:a++,r=s,s.val}return e=e||{},o.clear=function(){r=null,n=null,a=0},o}},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof h?e:h,o=Object.create(a.prototype),i=new k(n||[]);return o._invoke=function(t,e,r){var n=p;return function(a,o){if(n===f)throw new Error("Generator is already running");if(n===m){if("throw"===a)throw o;return E()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var s=A(i,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===p)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var c=l(t,e,r);if("normal"===c.type){if(n=r.done?m:d,c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=m,r.method="throw",r.arg=c.arg)}}}(t,r,i),o}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",f="executing",m="completed",y={};function h(){}function v(){}function g(){}var _={};c(_,o,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(S([])));w&&w!==r&&n.call(w,o)&&(_=w);var O=g.prototype=h.prototype=Object.create(_);function j(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(a,o,i,s){var c=l(t[a],t,o);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==typeof p&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,i,s)}),(function(t){r("throw",t,i,s)})):e.resolve(p).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,s)}))}s(c.arg)}var a;this._invoke=function(t,n){function o(){return new e((function(e,a){r(t,n,e,a)}))}return a=a?a.then(o,o):o()}}function A(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,A(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var a=l(n,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var o=a.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function S(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(n.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:E}}function E(){return{value:e,done:!0}}return v.prototype=g,c(O,"constructor",g),c(g,"constructor",v),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(O),t},t.awrap=function(t){return{__await:t}},j(x.prototype),c(x.prototype,i,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,a,o){void 0===o&&(o=Promise);var i=new x(u(e,r,n,a),o);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},j(O),c(O,s,"Generator"),c(O,o,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function a(n,a){return s.type="throw",s.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;T(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:S(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},975:(t,e,r)=>{var n;!function(){"use strict";var a={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(t){return s(u(t),arguments)}function i(t,e){return o.apply(null,[t].concat(e||[]))}function s(t,e){var r,n,i,s,c,u,l,p,d,f=1,m=t.length,y="";for(n=0;n<m;n++)if("string"==typeof t[n])y+=t[n];else if("object"==typeof t[n]){if((s=t[n]).keys)for(r=e[f],i=0;i<s.keys.length;i++){if(null==r)throw new Error(o('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[i],s.keys[i-1]));r=r[s.keys[i]]}else r=s.param_no?e[s.param_no]:e[f++];if(a.not_type.test(s.type)&&a.not_primitive.test(s.type)&&r instanceof Function&&(r=r()),a.numeric_arg.test(s.type)&&"number"!=typeof r&&isNaN(r))throw new TypeError(o("[sprintf] expecting number but found %T",r));switch(a.number.test(s.type)&&(p=r>=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}a.json.test(s.type)?y+=r:(!a.number.test(s.type)||p&&!s.sign?d="":(d=p?"+":"-",r=r.toString().replace(a.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",l=s.width-(d+r).length,c=s.width&&l>0?u.repeat(l):"",y+=s.align?d+r+c:"0"===u?d+c+r:c+d+r)}return y}var c=Object.create(null);function u(t){if(c[t])return c[t];for(var e,r=t,n=[],o=0;r;){if(null!==(e=a.text.exec(r)))n.push(e[0]);else if(null!==(e=a.modulo.exec(r)))n.push("%");else{if(null===(e=a.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var i=[],s=e[2],u=[];if(null===(u=a.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(i.push(u[1]);""!==(s=s.substring(u[0].length));)if(null!==(u=a.key_access.exec(s)))i.push(u[1]);else{if(null===(u=a.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");i.push(u[1])}e[2]=i}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return c[t]=n}o,i,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=i,void 0===(n=function(){return{sprintf:o,vsprintf:i}}.call(e,r,e,t))||(t.exports=n))}()},22:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(680),a={contextDelimiter:"",onMissingKey:null};function o(t,e){var r;for(r in this.data=t,this.pluralForms={},this.options={},a)this.options[r]=void 0!==e&&r in e?e[r]:a[r]}o.prototype.getPluralForm=function(t,e){var r,a,o,i=this.pluralForms[t];return i||("function"!=typeof(o=(r=this.data[t][""])["Plural-Forms"]||r["plural-forms"]||r.plural_forms)&&(a=function(t){var e,r,n;for(e=t.split(";"),r=0;r<e.length;r++)if(0===(n=e[r].trim()).indexOf("plural="))return n.substr(7)}(r["Plural-Forms"]||r["plural-forms"]||r.plural_forms),o=(0,n.Z)(a)),i=this.pluralForms[t]=o),i(e)},o.prototype.dcnpgettext=function(t,e,r,n,a){var o,i,s;return o=void 0===a?0:this.getPluralForm(t,a),i=r,e&&(i=e+this.options.contextDelimiter+r),(s=this.data[t][i])&&s[o]?s[o]:(this.options.onMissingKey&&this.options.onMissingKey(r,t),0===o?r:n)}}},r={};function n(t){var a=r[t];if(void 0!==a)return a.exports;var o=r[t]={exports:{}};return e[t](o,o.exports,n),o.exports}n.m=e,t=[],n.O=(e,r,a,o)=>{if(!r){var i=1/0;for(l=0;l<t.length;l++){for(var[r,a,o]=t[l],s=!0,c=0;c<r.length;c++)(!1&o||i>=o)&&Object.keys(n.O).every((t=>n.O[t](r[c])))?r.splice(c--,1):(s=!1,o<i&&(i=o));if(s){t.splice(l--,1);var u=a();void 0!==u&&(e=u)}}return e}o=o||0;for(var l=t.length;l>0&&t[l-1][2]>o;l--)t[l]=t[l-1];t[l]=[r,a,o]},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={177:0,47:0,122:0,879:0};n.O.j=e=>0===t[e];var e=(e,r)=>{var a,o,[i,s,c]=r,u=0;if(i.some((e=>0!==t[e]))){for(a in s)n.o(s,a)&&(n.m[a]=s[a]);if(c)var l=c(n)}for(e&&e(r);u<i.length;u++)o=i[u],n.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return n.O(l)},r=self.webpackChunkwp_smartpay=self.webpackChunkwp_smartpay||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})(),n.O(void 0,[47,122,879],(()=>n(359))),n.O(void 0,[47,122,879],(()=>n(470))),n.O(void 0,[47,122,879],(()=>n(347)));var a=n.O(void 0,[47,122,879],(()=>n(737)));a=n.O(a)})();
     1(()=>{var t,e={757:(t,e,r)=>{t.exports=r(666)},974:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(141),a=r(192);function o(t){var e=(0,n.Z)(t);return function(t){return(0,a.Z)(e,t)}}},192:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var n={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,r){if(t)throw e;return r}};function a(t,e){var r,a,o,i,s,c,u=[];for(r=0;r<t.length;r++){if(s=t[r],i=n[s]){for(a=i.length,o=Array(a);a--;)o[a]=u.pop();try{c=i.apply(null,o)}catch(t){return t}}else c=e.hasOwnProperty(s)?e[s]:+s;u.push(c)}return u[0]}},680:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var n=r(974);function a(t){var e=(0,n.Z)(t);return function(t){return+e({n:t})}}},141:(t,e,r)=>{"use strict";var n,a,o,i;function s(t){for(var e,r,s,c,u=[],l=[];e=t.match(i);){for(r=e[0],(s=t.substr(0,e.index).trim())&&u.push(s);c=l.pop();){if(o[r]){if(o[r][0]===c){r=o[r][1]||r;break}}else if(a.indexOf(c)>=0||n[c]<n[r]){l.push(c);break}u.push(c)}o[r]||l.push(r),t=t.substr(e.index+r.length)}return(t=t.trim())&&u.push(t),u.concat(l.reverse())}r.d(e,{Z:()=>s}),n={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},a=["(","?"],o={")":["("],":":["?","?:"]},i=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/},247:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(103),a=r(755);const o=function(t,e){return function(r,o,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;const c=t[e];if(!(0,a.Z)(r))return;if(!(0,n.Z)(o))return;if("function"!=typeof i)return void console.error("The hook callback must be a function.");if("number"!=typeof s)return void console.error("If specified, the hook priority must be a number.");const u={callback:i,priority:s,namespace:o};if(c[r]){const t=c[r].handlers;let e;for(e=t.length;e>0&&!(s>=t[e-1].priority);e--);e===t.length?t[e]=u:t.splice(e,0,u),c.__current.forEach((t=>{t.name===r&&t.currentIndex>=e&&t.currentIndex++}))}else c[r]={handlers:[u],runs:0};"hookAdded"!==r&&t.doAction("hookAdded",r,o,i,s)}}},992:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){return function(){var r,n;const a=t[e];return null!==(r=null===(n=a.__current[a.__current.length-1])||void 0===n?void 0:n.name)&&void 0!==r?r:null}}},972:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var n=r(755);const a=function(t,e){return function(r){const a=t[e];if((0,n.Z)(r))return a[r]&&a[r].runs?a[r].runs:0}}},786:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){return function(r){const n=t[e];return void 0===r?void 0!==n.__current[0]:!!n.__current[0]&&r===n.__current[0].name}}},642:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){return function(r,n){const a=t[e];return void 0!==n?r in a&&a[r].handlers.some((t=>t.namespace===n)):r in a}}},19:(t,e,r)=>{"use strict";r.d(e,{Z:()=>p});var n=r(247),a=r(99),o=r(642),i=r(424),s=r(992),c=r(786),u=r(972);class l{constructor(){this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=(0,n.Z)(this,"actions"),this.addFilter=(0,n.Z)(this,"filters"),this.removeAction=(0,a.Z)(this,"actions"),this.removeFilter=(0,a.Z)(this,"filters"),this.hasAction=(0,o.Z)(this,"actions"),this.hasFilter=(0,o.Z)(this,"filters"),this.removeAllActions=(0,a.Z)(this,"actions",!0),this.removeAllFilters=(0,a.Z)(this,"filters",!0),this.doAction=(0,i.Z)(this,"actions"),this.applyFilters=(0,i.Z)(this,"filters",!0),this.currentAction=(0,s.Z)(this,"actions"),this.currentFilter=(0,s.Z)(this,"filters"),this.doingAction=(0,c.Z)(this,"actions"),this.doingFilter=(0,c.Z)(this,"filters"),this.didAction=(0,u.Z)(this,"actions"),this.didFilter=(0,u.Z)(this,"filters")}}const p=function(){return new l}},99:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(103),a=r(755);const o=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(o,i){const s=t[e];if(!(0,a.Z)(o))return;if(!r&&!(0,n.Z)(i))return;if(!s[o])return 0;let c=0;if(r)c=s[o].handlers.length,s[o]={runs:s[o].runs,handlers:[]};else{const t=s[o].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===i&&(t.splice(e,1),c++,s.__current.forEach((t=>{t.name===o&&t.currentIndex>=e&&t.currentIndex--})))}return"hookRemoved"!==o&&t.doAction("hookRemoved",o,i),c}}},424:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n){const a=t[e];a[n]||(a[n]={handlers:[],runs:0}),a[n].runs++;const o=a[n].handlers;for(var i=arguments.length,s=new Array(i>1?i-1:0),c=1;c<i;c++)s[c-1]=arguments[c];if(!o||!o.length)return r?s[0]:void 0;const u={name:n,currentIndex:0};for(a.__current.push(u);u.currentIndex<o.length;){const t=o[u.currentIndex].callback.apply(null,s);r&&(s[0]=t),u.currentIndex++}return a.__current.pop(),r?s[0]:void 0}}},957:(t,e,r)=>{"use strict";r.d(e,{JQ:()=>n});const n=(0,r(19).Z)(),{addAction:a,addFilter:o,removeAction:i,removeFilter:s,hasAction:c,hasFilter:u,removeAllActions:l,removeAllFilters:p,doAction:d,applyFilters:f,currentAction:m,currentFilter:y,doingAction:h,doingFilter:v,didAction:g,didFilter:_,actions:b,filters:w}=n},755:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}},103:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}},16:(t,e,r)=>{"use strict";r.d(e,{o:()=>i});var n=r(22);const a={plural_forms:t=>1===t?0:1},o=/^i18n\.(n?gettext|has_translation)(_|$)/,i=(t,e,r)=>{const i=new n.Z({}),s=new Set,c=()=>{s.forEach((t=>t()))},u=function(t){var e;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";i.data[r]={...i.data[r],...t},i.data[r][""]={...a,...null===(e=i.data[r])||void 0===e?void 0:e[""]},delete i.pluralForms[r]},l=(t,e)=>{u(t,e),c()},p=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;return i.data[t]||u(void 0,t),i.dcnpgettext(t,e,r,n,a)},d=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return t},f=(t,e,n)=>{let a=p(n,e,t);return r?(a=r.applyFilters("i18n.gettext_with_context",a,t,e,n),r.applyFilters("i18n.gettext_with_context_"+d(n),a,t,e,n)):a};if(t&&l(t,e),r){const t=t=>{o.test(t)&&c()};r.addAction("hookAdded","core/i18n",t),r.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return i.data[t]},setLocaleData:l,addLocaleData:function(t){var e;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";i.data[r]={...i.data[r],...t,"":{...a,...null===(e=i.data[r])||void 0===e?void 0:e[""],...null==t?void 0:t[""]}},delete i.pluralForms[r],c()},resetLocaleData:(t,e)=>{i.data={},i.pluralForms={},l(t,e)},subscribe:t=>(s.add(t),()=>s.delete(t)),__:(t,e)=>{let n=p(e,void 0,t);return r?(n=r.applyFilters("i18n.gettext",n,t,e),r.applyFilters("i18n.gettext_"+d(e),n,t,e)):n},_x:f,_n:(t,e,n,a)=>{let o=p(a,void 0,t,e,n);return r?(o=r.applyFilters("i18n.ngettext",o,t,e,n,a),r.applyFilters("i18n.ngettext_"+d(a),o,t,e,n,a)):o},_nx:(t,e,n,a,o)=>{let i=p(o,a,t,e,n);return r?(i=r.applyFilters("i18n.ngettext_with_context",i,t,e,n,a,o),r.applyFilters("i18n.ngettext_with_context_"+d(o),i,t,e,n,a,o)):i},isRTL:()=>"rtl"===f("ltr","text direction"),hasTranslation:(t,e,n)=>{var a,o;const s=e?e+""+t:t;let c=!(null===(a=i.data)||void 0===a||null===(o=a[null!=n?n:"default"])||void 0===o||!o[s]);return r&&(c=r.applyFilters("i18n.has_translation",c,t,e,n),c=r.applyFilters("i18n.has_translation_"+d(n),c,t,e,n)),c}}}},836:(t,e,r)=>{"use strict";r.d(e,{__:()=>i});var n=r(16),a=r(957);const o=(0,n.o)(void 0,void 0,a.JQ);o.getLocaleData.bind(o),o.setLocaleData.bind(o),o.resetLocaleData.bind(o),o.subscribe.bind(o);const i=o.__.bind(o);o._x.bind(o),o._n.bind(o),o._nx.bind(o),o.isRTL.bind(o),o.hasTranslation.bind(o)},304:(t,e,r)=>{"use strict";r.d(e,{__:()=>n.__});r(917),r(16);var n=r(836)},917:(t,e,r)=>{"use strict";var n=r(588),a=r.n(n);r(975);a()(console.error)},359:(t,e,r)=>{"use strict";r(39),r(869);function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){if(null==t)return{};var r,n,a=function(t,e){if(null==t)return{};var r,n,a={},o=Object.keys(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||(a[r]=t[r]);return a}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}var o=r(588),i=r.n(o);r(975),i()(console.error);var s=r(22);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l={"":{plural_forms:function(t){return 1===t?0:1}}},p=/^i18n\.(n?gettext|has_translation)(_|$)/;const d=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};const f=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};const m=function(t,e){return function(r,n,a){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=t[e];if(f(r)&&d(n))if("function"==typeof a)if("number"==typeof o){var s={callback:a,priority:o,namespace:n};if(i[r]){var c,u=i[r].handlers;for(c=u.length;c>0&&!(o>=u[c-1].priority);c--);c===u.length?u[c]=s:u.splice(c,0,s),i.__current.forEach((function(t){t.name===r&&t.currentIndex>=c&&t.currentIndex++}))}else i[r]={handlers:[s],runs:0};"hookAdded"!==r&&t.doAction("hookAdded",r,n,a,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};const y=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n,a){var o=t[e];if(f(n)&&(r||d(a))){if(!o[n])return 0;var i=0;if(r)i=o[n].handlers.length,o[n]={runs:o[n].runs,handlers:[]};else for(var s=o[n].handlers,c=function(t){s[t].namespace===a&&(s.splice(t,1),i++,o.__current.forEach((function(e){e.name===n&&e.currentIndex>=t&&e.currentIndex--})))},u=s.length-1;u>=0;u--)c(u);return"hookRemoved"!==n&&t.doAction("hookRemoved",n,a),i}}};const h=function(t,e){return function(r,n){var a=t[e];return void 0!==n?r in a&&a[r].handlers.some((function(t){return t.namespace===n})):r in a}};const v=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n){var a=t[e];a[n]||(a[n]={handlers:[],runs:0}),a[n].runs++;var o=a[n].handlers;for(var i=arguments.length,s=new Array(i>1?i-1:0),c=1;c<i;c++)s[c-1]=arguments[c];if(!o||!o.length)return r?s[0]:void 0;var u={name:n,currentIndex:0};for(a.__current.push(u);u.currentIndex<o.length;){var l=o[u.currentIndex],p=l.callback.apply(null,s);r&&(s[0]=p),u.currentIndex++}return a.__current.pop(),r?s[0]:void 0}};const g=function(t,e){return function(){var r,n,a=t[e];return null!==(r=null===(n=a.__current[a.__current.length-1])||void 0===n?void 0:n.name)&&void 0!==r?r:null}};const _=function(t,e){return function(r){var n=t[e];return void 0===r?void 0!==n.__current[0]:!!n.__current[0]&&r===n.__current[0].name}};const b=function(t,e){return function(r){var n=t[e];if(f(r))return n[r]&&n[r].runs?n[r].runs:0}};var w=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=m(this,"actions"),this.addFilter=m(this,"filters"),this.removeAction=y(this,"actions"),this.removeFilter=y(this,"filters"),this.hasAction=h(this,"actions"),this.hasFilter=h(this,"filters"),this.removeAllActions=y(this,"actions",!0),this.removeAllFilters=y(this,"filters",!0),this.doAction=v(this,"actions"),this.applyFilters=v(this,"filters",!0),this.currentAction=g(this,"actions"),this.currentFilter=g(this,"filters"),this.doingAction=_(this,"actions"),this.doingFilter=_(this,"filters"),this.didAction=b(this,"actions"),this.didFilter=b(this,"filters")};var O=function(){return new w}(),j=(O.addAction,O.addFilter,O.removeAction,O.removeFilter,O.hasAction,O.hasFilter,O.removeAllActions,O.removeAllFilters,O.doAction,O.applyFilters,O.currentAction,O.currentFilter,O.doingAction,O.doingFilter,O.didAction,O.didFilter,O.actions,O.filters,function(t,e,r){var n=new s.Z({}),a=new Set,o=function(){a.forEach((function(t){return t()}))},i=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";n.data[e]=u(u(u({},l),n.data[e]),t),n.data[e][""]=u(u({},l[""]),n.data[e][""])},c=function(t,e){i(t,e),o()},d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return n.data[t]||i(void 0,t),n.dcnpgettext(t,e,r,a,o)},f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return t},m=function(t,e,n){var a=d(n,e,t);return r?(a=r.applyFilters("i18n.gettext_with_context",a,t,e,n),r.applyFilters("i18n.gettext_with_context_"+f(n),a,t,e,n)):a};if(t&&c(t,e),r){var y=function(t){p.test(t)&&o()};r.addAction("hookAdded","core/i18n",y),r.addAction("hookRemoved","core/i18n",y)}return{getLocaleData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return n.data[t]},setLocaleData:c,resetLocaleData:function(t,e){n.data={},n.pluralForms={},c(t,e)},subscribe:function(t){return a.add(t),function(){return a.delete(t)}},__:function(t,e){var n=d(e,void 0,t);return r?(n=r.applyFilters("i18n.gettext",n,t,e),r.applyFilters("i18n.gettext_"+f(e),n,t,e)):n},_x:m,_n:function(t,e,n,a){var o=d(a,void 0,t,e,n);return r?(o=r.applyFilters("i18n.ngettext",o,t,e,n,a),r.applyFilters("i18n.ngettext_"+f(a),o,t,e,n,a)):o},_nx:function(t,e,n,a,o){var i=d(o,a,t,e,n);return r?(i=r.applyFilters("i18n.ngettext_with_context",i,t,e,n,a,o),r.applyFilters("i18n.ngettext_with_context_"+f(o),i,t,e,n,a,o)):i},isRTL:function(){return"rtl"===m("ltr","text direction")},hasTranslation:function(t,e,a){var o,i,s=e?e+""+t:t,c=!(null===(o=n.data)||void 0===o||null===(i=o[null!=a?a:"default"])||void 0===i||!i[s]);return r&&(c=r.applyFilters("i18n.has_translation",c,t,e,a),c=r.applyFilters("i18n.has_translation_"+f(a),c,t,e,a)),c}}}(void 0,void 0,O));j.getLocaleData.bind(j),j.setLocaleData.bind(j),j.resetLocaleData.bind(j),j.subscribe.bind(j);var x=j.__.bind(j);j._x.bind(j),j._n.bind(j),j._nx.bind(j),j.isRTL.bind(j),j.hasTranslation.bind(j);function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const T=function(t){var e=function t(e,r){var n=e.headers,a=void 0===n?{}:n;for(var o in a)if("x-wp-nonce"===o.toLowerCase()&&a[o]===t.nonce)return r(e);return r(P(P({},e),{},{headers:P(P({},a),{},{"X-WP-Nonce":t.nonce})}))};return e.nonce=t,e};function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const E=function(t,e){var r,n,a=t.path;return"string"==typeof t.namespace&&"string"==typeof t.endpoint&&(r=t.namespace.replace(/^\/|\/$/g,""),a=(n=t.endpoint.replace(/^\//,""))?r+"/"+n:r),delete t.namespace,delete t.endpoint,e(S(S({},t),{},{path:a}))};function D(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function F(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?D(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const L=function(t){return function(e,r){return E(e,(function(e){var n,a=e.url,o=e.path;return"string"==typeof o&&(n=t,-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(o=o.replace("?","&")),a=n+o),r(F(F({},e),{},{url:a}))}))}};function I(t){var e=t.split("?"),r=e[1],n=e[0];return r?n+"?"+r.split("&").map((function(t){return t.split("=")})).sort((function(t,e){return t[0].localeCompare(e[0])})).map((function(t){return t.join("=")})).join("&"):n}const Z=function(t){var e=Object.keys(t).reduce((function(e,r){return e[I(r)]=t[r],e}),{});return function(t,r){var n=t.parse,a=void 0===n||n;if("string"==typeof t.path){var o=t.method||"GET",i=I(t.path);if("GET"===o&&e[i]){var s=e[i];return delete e[i],Promise.resolve(a?s.body:new window.Response(JSON.stringify(s.body),{status:200,statusText:"OK",headers:s.headers}))}if("OPTIONS"===o&&e[o]&&e[o][i])return Promise.resolve(e[o][i])}return r(t)}};function C(t,e,r,n,a,o,i){try{var s=t[o](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,a)}var N=r(757),M=r.n(N);function $(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function U(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return $(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function q(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?R(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function W(t){return(function(t){var e;try{e=new URL(t,"http://example.com").search.substring(1)}catch(t){}if(e)return e}(t)||"").replace(/\+/g,"%20").split("&").reduce((function(t,e){var r=U(e.split("=").filter(Boolean).map(decodeURIComponent),2),n=r[0],a=r[1],o=void 0===a?"":a;n&&function(t,e,r){for(var n=e.length,a=n-1,o=0;o<n;o++){var i=e[o];!i&&Array.isArray(t)&&(i=t.length.toString());var s=!isNaN(Number(e[o+1]));t[i]=o===a?r:t[i]||(s?[]:{}),Array.isArray(t[i])&&!s&&(t[i]=q({},t[i])),t=t[i]}}(t,n.replace(/\]/g,"").split("["),o);return t}),{})}function z(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Q(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Q(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return i=t.done,t},e:function(t){s=!0,o=t},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw o}}}}function Q(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function G(t){for(var e,r="",n=Object.entries(t);e=n.shift();){var a=U(e,2),o=a[0],i=a[1];if(Array.isArray(i)||i&&i.constructor===Object){var s,c=z(Object.entries(i).reverse());try{for(c.s();!(s=c.n()).done;){var u=U(s.value,2),l=u[0],p=u[1];n.unshift(["".concat(o,"[").concat(l,"]"),p])}}catch(t){c.e(t)}finally{c.f()}}else void 0!==i&&(null===i&&(i=""),r+="&"+[o,i].map(encodeURIComponent).join("="))}return r.substr(1)}function J(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;if(!e||!Object.keys(e).length)return t;var r=t,n=t.indexOf("?");return-1!==n&&(e=Object.assign(W(t),e),r=r.substr(0,n)),r+"?"+G(e)}function Y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function H(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Y(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var V=function(t){return t.json?t.json():Promise.reject(t)},X=function(t){return function(t){if(!t)return{};var e=t.match(/<([^>]+)>; rel="next"/);return e?{next:e[1]}:{}}(t.headers.get("link")).next},B=function(t){var e=!!t.path&&-1!==t.path.indexOf("per_page=-1"),r=!!t.url&&-1!==t.url.indexOf("per_page=-1");return e||r};const K=function(){var t,e=(t=M().mark((function t(e,r){var n,o,i,s,c,u;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1!==e.parse){t.next=2;break}return t.abrupt("return",r(e));case 2:if(B(e)){t.next=4;break}return t.abrupt("return",r(e));case 4:return t.next=6,_t(H(H({},(l=e,p={per_page:100},d=void 0,f=void 0,d=l.path,f=l.url,H(H({},a(l,["path","url"])),{},{url:f&&J(f,p),path:d&&J(d,p)}))),{},{parse:!1}));case 6:return n=t.sent,t.next=9,V(n);case 9:if(o=t.sent,Array.isArray(o)){t.next=12;break}return t.abrupt("return",o);case 12:if(i=X(n)){t.next=15;break}return t.abrupt("return",o);case 15:s=[].concat(o);case 16:if(!i){t.next=27;break}return t.next=19,_t(H(H({},e),{},{path:void 0,url:i,parse:!1}));case 19:return c=t.sent,t.next=22,V(c);case 22:u=t.sent,s=s.concat(u),i=X(c),t.next=16;break;case 27:return t.abrupt("return",s);case 28:case"end":return t.stop()}var l,p,d,f}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){C(o,n,a,i,s,"next",t)}function s(t){C(o,n,a,i,s,"throw",t)}i(void 0)}))});return function(t,r){return e.apply(this,arguments)}}();function tt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function et(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?tt(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var rt=new Set(["PATCH","PUT","DELETE"]);function nt(t,e){return void 0!==function(t,e){return W(t)[e]}(t,e)}var at=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e?204===t.status?null:t.json?t.json():Promise.reject(t):t},ot=function(t){var e={code:"invalid_json",message:x("The response is not a valid JSON response.")};if(!t||!t.json)throw e;return t.json().catch((function(){throw e}))},it=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(at(t,e)).catch((function(t){return st(t,e)}))};function st(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)throw t;return ot(t).then((function(t){var e={code:"unknown_error",message:x("An unknown error occurred.")};throw t||e}))}function ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ut(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ct(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ct(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const lt=function(t,e){if(!(t.path&&-1!==t.path.indexOf("/wp/v2/media")||t.url&&-1!==t.url.indexOf("/wp/v2/media")))return e(t);var r=0,n=function t(n){return r++,e({path:"/wp/v2/media/".concat(n,"/post-process"),method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((function(){return r<5?t(n):(e({path:"/wp/v2/media/".concat(n,"?force=true"),method:"DELETE"}),Promise.reject())}))};return e(ut(ut({},t),{},{parse:!1})).catch((function(e){var r=e.headers.get("x-wp-upload-attachment-id");return e.status>=500&&e.status<600&&r?n(r).catch((function(){return!1!==t.parse?Promise.reject({code:"post_process",message:x("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(e)})):st(e,t.parse)})).then((function(e){return it(e,t.parse)}))};function pt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var ft={Accept:"application/json, */*;q=0.1"},mt={credentials:"include"},yt=[function(t,e){return"string"!=typeof t.url||nt(t.url,"_locale")||(t.url=J(t.url,{_locale:"user"})),"string"!=typeof t.path||nt(t.path,"_locale")||(t.path=J(t.path,{_locale:"user"})),e(t)},E,function(t,e){var r=t.method,n=void 0===r?"GET":r;return rt.has(n.toUpperCase())&&(t=et(et({},t),{},{headers:et(et({},t.headers),{},{"X-HTTP-Method-Override":n,"Content-Type":"application/json"}),method:"POST"})),e(t)},K];var ht=function(t){if(t.status>=200&&t.status<300)return t;throw t},vt=function(t){var e=t.url,r=t.path,n=t.data,o=t.parse,i=void 0===o||o,s=a(t,["url","path","data","parse"]),c=t.body,u=t.headers;return u=dt(dt({},ft),u),n&&(c=JSON.stringify(n),u["Content-Type"]="application/json"),window.fetch(e||r||window.location.href,dt(dt(dt({},mt),s),{},{body:c,headers:u})).then((function(t){return Promise.resolve(t).then(ht).catch((function(t){return st(t,i)})).then((function(t){return it(t,i)}))}),(function(){throw{code:"fetch_error",message:x("You are probably offline.")}}))};function gt(t){return yt.reduceRight((function(t,e){return function(r){return e(r,t)}}),vt)(t).catch((function(e){return"rest_cookie_invalid_nonce"!==e.code?Promise.reject(e):window.fetch(gt.nonceEndpoint).then(ht).then((function(t){return t.text()})).then((function(e){return gt.nonceMiddleware.nonce=e,gt(t)}))}))}gt.use=function(t){yt.unshift(t)},gt.setFetchHandler=function(t){vt=t},gt.createNonceMiddleware=T,gt.createPreloadingMiddleware=Z,gt.createRootURLMiddleware=L,gt.fetchAllMiddleware=K,gt.mediaUploadMiddleware=lt;const _t=gt;function bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return wt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wt(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Ot;jQuery(document.body).on("click",".customer-dashboard button[type=submit]",(function(t){t.preventDefault();var e=jQuery(this).parents("form"),r={first_name:e.find("input[name=first_name]").val()||null,last_name:e.find("input[name=last_name]").val()||null,email:e.find("input[name=email]").val()||null,password:e.find("input[name=password]").val()||null,password_confirm:e.find("input[name=password_confirm]").val()||null},n=e.find("input[name=customer_id]").val()||0;n&&_t({path:"".concat(smartpay.restUrl,"/v1/public/customers/").concat(n),method:"PUT",headers:{"X-WP-Nonce":smartpay.apiNonce},body:JSON.stringify(r)}).then((function(t){e.find("#form-response").append('<div class="alert alert-success text-center mb-4">Profile updated</div>')})).catch((function(t){e.find("form-response").append('<div class="alert alert-danger text-center mb-4">'.concat(t.message,"</div>"))}))})),(Ot=jQuery).fn.serializeJSON=function(){if(this.length<1)return!1;var t={},e=t,r=':input[type!="checkbox"][type!="radio"], input:checked',n=function(){if(!this.disabled){var r=this.name.replace(/\[([^\]]+)?\]/g,",$1").split(","),n=r.length-1,a=Ot(this);if(r[0]){for(var o=0;o<n;o++)e=e[r[o]]=e[r[o]]||(""===r[o+1]||"0"===r[o+1]?[]:{});void 0!==e.length?e.push(a.val()):e[r[n]]=a.val(),e=t}}};return this.filter(r).each(n),this.find(r).each(n),t},jQuery((function(t){window.SmartPayFormValidator=function(t,e){var r=this,n=this;this.data=t,this.rules=e,n.validate=function(){return Object.entries(r.rules).reduce((function(t,e){var n=bt(e,2),a=n[0],o=n[1],i=[];if(o.required){var s=r.validateRequiredMessage(r.data[a]);s&&i.push(s)}if(o.requiredWhen){var c=r.validateRequiredWhenMessage(r.data[a],o.requiredWhen);c&&i.push(c)}if(o.email){var u=r.validateEmailMessage(r.data[a]);u&&i.push(u)}if(o.length){var l=r.validateLengthMessage(r.data[a],o.length);l&&i.push(l)}if(o.value){var p=r.validateValueMessage(r.data[a],o.value);p&&i.push(p)}return i.length&&(t[a]=i),t}),{})},n.validateLengthMessage=function(t,e){if(null!=t){if(Array.isArray(e)){if(t.length>=e[0]&&t.length<=e[1])return;return"must be between ".concat(e[0]," to ").concat(e[1]," character")}if(!(t.length>=e))return"must be ".concat(e," or more characters")}},n.validateRequiredMessage=function(t){if(!t)return"is required"},n.validateRequiredWhenMessage=function(t,e){var r=bt(e,2),a=r[0],o=r[1];if(a&&n.data[a]===o)return n.validateRequiredMessage(t)},n.validateEmailMessage=function(t){if(!/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(t))return"is not a valid email"},n.validateValueMessage=function(t,e){if(t!==e)return"must be same as ".concat(e)}},window.JSUcfirst=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}}))},869:(t,e,r)=>{function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var c=r(400).SUBSCRIPTION;jQuery((function(t){var e,r;t(document.body).on("click",".smartpay-form-shortcode .form-amounts .form-plan-card",(function(e){t(e.currentTarget).parents(".form-amounts").find(".plan-amount").removeClass("selected"),t(e.currentTarget).addClass("selected");var r=t(e.currentTarget).find('input[name="_form_amount"]'),n=t(e.currentTarget).find('input[name="_form_billing_type"]');if(c===n.val())var a=t(e.currentTarget).find('input[name="_form_billing_period"]'),o=t(e.currentTarget).find('input[name="_form_amount_key"]');t(e.currentTarget).parents(".form-amounts").find(".form--custom-amount").val(r.val()),t(e.currentTarget).parents(".form-amounts").find('input[name="smartpay_form_billing_type"]').val(n.val()),c===n.val()&&(t(e.currentTarget).parents(".form-amounts").find('input[name="smartpay_form_billing_period"]').val(a.val()),t("#smartpay-payment-form").find('input[name="smartpay_selected_amount_key"]').val(o.val())),t("#smartpay_is_custom_payment").val("false")})),t(document.body).on("click",".smartpay-form-shortcode .gateways .gateway",(function(e){t(e.currentTarget).parents(".gateways").find(".gateway").removeClass("selected"),t(e.currentTarget).addClass("selected")})),t(document.body).on("focus",".smartpay-form-shortcode .form-amounts .form--custom-amount",(function(e){t(e.currentTarget).parents(".form-amounts").find(".plan-amount").removeClass("selected"),t(e.currentTarget).addClass("selected"),t(e.currentTarget).parents(".form-amounts").find('.plan-amount input[type="radio"]:checked').prop("checked",!1),t("#smartpay_is_custom_payment").val("true")})),t(document.body).on("click",".smartpay-form-shortcode button.smartpay-form-pay-now",(function(e){e.preventDefault(),$parentWrapper=t(e.currentTarget).parents(".smartpay-payment");var r,a=t(e.currentTarget).text(),o=function(t){var e=t.find("#smartpay-payment-form").serializeJSON();return i({smartpay_action:"smartpay_process_payment",smartpay_payment_type:"form_payment",smartpay_process_payment:e.smartpay_process_payment,smartpay_gateway:e.smartpay_gateway,smartpay_first_name:e.smartpay_form.name.first_name,smartpay_last_name:e.smartpay_form.name.last_name,smartpay_email:e.smartpay_form.email,smartpay_payment_mobile:e.smartpay_payment_mobile,smartpay_form_id:e.smartpay_form_id,smartpay_amount:e.smartpay_form_amount,smartpay_amount_key:e.smartpay_selected_amount_key,smartpay_form_data:e.smartpay_form,smartpay_is_custom_amount:e.smartpay_is_custom_payment,smartpay_form_billing_type:e.smartpay_form_billing_type},c===e.smartpay_form_billing_type&&{smartpay_form_billing_period:e.smartpay_form_billing_period})}($parentWrapper),s=(r=new SmartPayFormValidator(o,{smartpay_action:{required:!0,value:"smartpay_process_payment"},smartpay_process_payment:{required:!0},smartpay_gateway:{required:!0},smartpay_first_name:{required:!0},smartpay_last_name:{required:!0},smartpay_email:{required:!0,email:!0},smartpay_payment_mobile:{requiredWhen:["smartpay_gateway","toyyibpay"]},smartpay_payment_type:{required:!0}}).validate(),{valid:Object.values(r).every((function(t){return 0===t.length})),errors:r});$parentWrapper.find("input").removeClass("is-invalid"),$parentWrapper.find("#form-response").hide(),s.valid?(t(e.currentTarget).text("Processing...").attr("disabled",!0),jQuery.post(smartpay.ajaxUrl,{action:"smartpay_process_payment",data:o},(function(r){r?$parentWrapper.find("#payment-response").html(r).show():($parentWrapper.find("#payment-response").html('<p class="text-danger">Something wrong! Please try again later.</p>').show(),console.error("Something wrong!")),setTimeout((function(){t(e.currentTarget).text(a).attr("disabled",!1)}),500)}))):(!function(t,e){var r=t.parents(".smartpay-payment"),a=[];if(Object.entries(e.errors).forEach((function(t){var e=n(t,2),o=e[0],i=e[1];r.find('input[name="'+o+'"]').addClass("is-invalid");var s=JSUcfirst(o.split("_").slice(1).join(" "));a.push('\n                <div class="alert alert-danger">\n                    <p class="m-0 form-error-text">'.concat(s," ").concat(i[0],"</p>\n                </div>"))})),!a.length)return;t.html(a),t.show()}($parentWrapper.find(".smartpay-message-info"),s),$parentWrapper.find("#first_name").focus())})),t(document.body).on("click",".smartpay-form-shortcode button.open-form-modal",(function(e){e.preventDefault();var r=t(e.currentTarget).parents(".smartpay-form-shortcode").find(".form-modal");setTimeout((function(){r.modal("show"),t(".modal-backdrop").last().appendTo(t(e.currentTarget).closest(".smartpay"))}),500)})),t(".smartpay-coupon-form-toggle .smartpayshowcoupon").on("click",(function(e){t(this).parents(".smartpay-coupon-form-toggle").addClass("d-none"),t(".smartpay-coupon-form").removeClass("d-none"),e.preventDefault()})),t(".smartpay-coupon-form").on("submit",(function(n){var a=t(this).find("input[name=coupon_code]").val(),o=t(this).parents(".smartpay_form_builder_wrapper").find("#smartpay-payment-form input[name=smartpay_form_id]").val();t.ajax({method:"POST",url:smartpay.ajaxUrl,data:{action:"smartpay_coupon",couponCode:a,formId:o}}).done((function(n){if(n.success){t(".smartpay-message-info").append('<div class="alert alert-success">'.concat(n.data.message,"</div>")),e=n.data.couponData,r=n.data.currency,t("#smartpay-payment-form").addClass("coupon-applied"),t("#smartpay-payment-form").find(".form--fixed-amount").each((function(){var r=t(this).find("input[name=_form_amount]").attr("id");t(this).find("input[name=_form_amount]").val(e[r].discountAmount)}));var a=t("#smartpay-payment-form .form-amounts").find(".form--fixed-amount.selected input[name=_form_amount]").attr("id");t("#smartpay-payment-form input[name=smartpay_form_amount]").val(e[a].discountAmount),t(".discount-amounts-container").removeClass("d-none"),t(".discount-amounts-container").find(".subtotal-amount-value").html("".concat(r).concat(e[a].mainAmount)),t(".discount-amounts-container").find(".coupon-amount-name").html(n.data.couponCode),t(".discount-amounts-container").find(".coupon-amount-value").html("-".concat(r).concat(e[a].couponAmount)),t(".discount-amounts-container").find(".total-amount-value").html("".concat(r).concat(e[a].discountAmount))}n.success||t(".smartpay-message-info").append('<div class="alert alert-danger">'.concat(n.data.message,"</div>"))})),n.preventDefault()})),t(".smartpay-form-shortcode .form-amounts .form--fixed-amount").on("click",(function(){if(t("#smartpay-payment-form").hasClass("coupon-applied")){var n=t(this).find("input[name=_form_amount]").attr("id");t(".discount-amounts-container").find(".subtotal-amount-value").html("".concat(r).concat(e[n].mainAmount)),t(".discount-amounts-container").find(".coupon-amount-value").html("-".concat(r).concat(e[n].couponAmount)),t(".discount-amounts-container").find(".total-amount-value").html("".concat(r).concat(e[n].discountAmount))}})),t(".smartpay-coupon-form-close").on("click",(function(e){t(".smartpay-coupon-form").addClass("d-none"),t(".smartpay-coupon-form-toggle").removeClass("d-none"),e.preventDefault()}))}))},39:()=>{function t(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}(t,r)||function(t,r){if(!t)return;if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}jQuery((function(e){function r(t){t.find(".step-1").show(),t.find(".step-2").hide(),e(".back-to-first-step").hide()}function n(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={smartpay_action:"smartpay_process_payment",smartpay_process_payment:t.find('input[name="smartpay_process_payment"]').val()||null,smartpay_gateway:t.find('input[name="smartpay_gateway"]:checked').val()||null,smartpay_first_name:t.find('input[name="smartpay_first_name"]').val()||null,smartpay_last_name:t.find('input[name="smartpay_last_name"]').val()||null,smartpay_email:t.find('input[name="smartpay_email"]').val()||null,smartpay_payment_type:t.find('input[name="smartpay_payment_type"]').val()||null,smartpay_payment_mobile:t.find('input[name="smartpay_payment_mobile"]').val()||null};if("product_purchase"===n.smartpay_payment_type)n.smartpay_product_id=t.find('input[name="smartpay_product_id"]').val()||null,n.smartpay_product_price=t.find('input[name="smartpay_product_price"]').val()||null,n.smartpay_product_billing_type=t.find('input[name="smartpay_product_billing_type"]').val()||null,"Subscription"===n.smartpay_product_billing_type&&(n.smartpay_product_billing_period=t.find('input[name="smartpay_product_billing_period"]').val());else{n.smartpay_form_id=t.find('input[name="smartpay_form_id"]').val()||null,n.smartpay_amount=t.find('input[name="smartpay_form_amount"]').val()||null;var a={};t.find('.smartpay_form_builder_wrapper > form input[name^="smartpay_"]').length&&t.find('.smartpay_form_builder_wrapper > form input[name^="smartpay_"]').each((function(t,r){a[e(r).attr("name")]=e(r).val()})),n.smartpay_form_extra_data=a||{}}return r?n.index||null:n}e(document.body).on("click",".smartpay-product-shortcode .product-variations .variation",(function(t){e(t.currentTarget).parent().find(".variation").removeClass("selected"),e(t.currentTarget).addClass("selected");var r=e(t.currentTarget).find(".sale-price").data("price");e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_price"]').val(r);var n=e(t.currentTarget).find('input[name="_product_billing_type"]');if(e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_billing_type"]').val(n.val()),"Subscription"===n.val()){var a=e(t.currentTarget).find('input[name="_product_billing_period"]');e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_billing_period"]').val(a.val());var o=e(t.currentTarget).find('input[name="_product_additional_charge"]');e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_additional_charge"]').val(o.val())}var i=e(t.currentTarget).find('input[name="_smartpay_product_id"]');e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_id"]').val(i.val())})),e(document).ready((function(){var t=document.querySelector("#mobile-field");if(t){var r=e("input[name='smartpay_gateway']:checked").val(),n='<div class="form-group"><input type="number" placeholder="Mobile No" class="form-control" name="smartpay_payment_mobile"  id="smartpay_payment_mobile" required /></div>';"toyyibpay"===r&&(t.innerHTML=n),jQuery('input[name="smartpay_gateway"]').toArray().forEach((function(e){e.addEventListener("change",(function(){"toyyibpay"===e.value?t.innerHTML=n:t.innerHTML=""}))}))}})),e(document.body).on("click",".smartpay-product-shortcode button.open-product-modal",(function(t){t.preventDefault();var r=e(t.currentTarget).parents(".smartpay-product-shortcode").find(".product-modal");setTimeout((function(){r.modal("show"),e(".modal-backdrop").last().appendTo(e(t.currentTarget).closest(".smartpay"))}),500)})),e(document.body).on("click",".smartpay-payment button.open-payment-form",(function(t){t.preventDefault(),$parentWrapper=e(t.currentTarget).parents(".smartpay-payment");var a=$parentWrapper.find(".payment-modal"),o=n($parentWrapper),i=jQuery('input[name="smartpay_product_billing_type"]').val(),s=jQuery('input[name="smartpay_selected_currency_symbol"]').val(),c=e("#smartpay_additional_amount_id"),u=e("#smartpay_product_billing_type_id");if("Subscription"===i){var l=jQuery('input[name="smartpay_product_billing_period"]').val(),p='<div class="justify-content-center mb-2 mt-2">\n                    <p class="text-center text-muted font-weight-light">\n                        Enter your info to begin your\n                        <strong><span class="product_billing_type">'.concat(l,"</span></strong> subscription. You can cancel anytime.\n                    </p>\n                </div>");u.html(p);var d=e("input[name='smartpay_product_additional_charge']").val(),f='<div class="text-primary font-weight-bold text-center"><p>\n                        Additional charge '.concat(s+d,"  will be applied to the subscription.\n                    </p>\n                </div>");c&&d>0&&c.html(f)}else{u.html('<div class="justify-content-center mb-2 mt-2">\n                <p class="text-center text-muted">Provide your information to complete your purchase.</p></div>'),c&&c.html("")}var m=0;"form_payment"===o.smartpay_payment_type?m=e("#smartpay_currency_symbol").data("value")+o.smartpay_amount:m=o.smartpay_product_price;a.find(".amount").html(s+m),r(a);var y=e(t.currentTarget).text();e(t.currentTarget).text("Processing...").attr("disabled","disabled"),setTimeout((function(){a.modal("show"),o.smartpay_first_name&&a.find('input[name="smartpay_first_name"]').val(o.smartpay_first_name),o.smartpay_last_name&&a.find('input[name="smartpay_last_name"]').val(o.smartpay_last_name),o.smartpay_email&&a.find('input[name="smartpay_email"]').val(o.smartpay_email),e(".modal-backdrop").last().appendTo(e(t.currentTarget).closest(".smartpay-payment")),e(t.currentTarget).text(y).removeAttr("disabled")}),500)})),e(document.body).on("click",".smartpay-payment button.back-to-first-step",(function(t){t.preventDefault(),r(e(t.currentTarget).parents(".smartpay-payment").find(".payment-modal"))})),e(document.body).on("click",".smartpay-payment button.smartpay-pay-now",(function(r){r.preventDefault(),$parentWrapper=e(r.currentTarget).parents(".smartpay-payment");var a=e(r.currentTarget).text(),o=e(r.currentTarget).parents(".step-1"),i=e(r.currentTarget).parents(".modal-content").children(".step-2");e(r.currentTarget).text("Processing...").attr("disabled","disabled"),$parentWrapper.find(".modal-loading").css("display","flex");var s=n($parentWrapper),c=function(t){var e=new SmartPayFormValidator(t,{smartpay_action:{required:!0,value:"smartpay_process_payment"},smartpay_process_payment:{required:!0},smartpay_gateway:{required:!0},smartpay_first_name:{required:!0},smartpay_last_name:{required:!0},smartpay_payment_mobile:{requiredWhen:["smartpay_gateway","toyyibpay"]},smartpay_email:{required:!0,email:!0},smartpay_payment_type:{required:!0}}).validate();return{valid:Object.values(e).every((function(t){return 0===t.length})),errors:e}}(s);if($parentWrapper.find("input").removeClass("is-invalid"),o.find(".payment-modal--errors").hide(),c.valid){var u={action:"smartpay_process_payment",data:s};jQuery.post(smartpay.ajaxUrl,u,(function(t){i.css("display","flex"),e(".back-to-first-step").show(),o.hide(),setTimeout((function(){t?i.find(".dynamic-content").html(t):i.find(".dynamic-content").html('<p class="text-danger">Something wrong!</p>'),$parentWrapper.find(".modal-loading").css("display","none")}),300)}))}else!function(e,r){var n=e.parents(".smartpay-payment"),a=[];if(Object.entries(r.errors).forEach((function(e){var r=t(e,2),o=r[0],i=r[1];n.find('input[name="'+o+'"]').addClass("is-invalid");var s=JSUcfirst(o.split("_").slice(1).join(" "));a.push('\n                <div class="alert alert-danger">\n                    <p class="m-0 form-error-text">'.concat(s," ").concat(i[0],"</p>\n                </div>"))})),!a.length)return;e.show(),e.html(a)}(o.find(".payment-modal--errors"),c),setTimeout((function(){$parentWrapper.find(".modal-loading").css("display","none")}),300);e(r.currentTarget).text(a).removeAttr("disabled")})),e(document.body).on("click",".smartpay-payment button.modal-close",(function(t){e(t.currentTarget).parents(".smartpay-payment").find(".payment-modal").modal("hide")})),e(document.body).on("show.bs.modal",".payment-modal",(function(t){document.body.style.overflow="hidden"})),e(document.body).on("hidden.bs.modal",".payment-modal",(function(t){document.body.style.overflow="auto"})),e(".smartpay-product-coupon-form-toggle .smartpayshowcoupon").on("click",(function(){return e(".smartpay-product-coupon-form").toggleClass("d-none"),!1})),e(".smartpay-product-coupon-form").on("submit",(function(t){var r=e(this).find("input[name=coupon_code]").val(),n=e(this).parents(".smartpay-product-shortcode").find("input[name=smartpay_product_id]").val(),a=e(this).parents(".smartpay-product-shortcode").find("input[name=smartpay_product_price]").val();e.ajax({method:"POST",url:smartpay.ajaxUrl,data:{action:"smartpay_product_coupon",couponCode:r,productID:n,productPrice:a}}).done((function(t){if(t.success){var r=e(".discount-amounts-container"),n=e(".payment-modal--errors");e(".payment-modal--errors .alert").hide(),n.append('<div class="alert alert-success">'.concat(t.data.message,"</div>")),n.show(),$couponData=t.data.couponData,$currency=t.data.currency,r.find(".subtotal-amount-value").html("".concat($currency).concat($couponData.mainAmount)),r.find(".coupon-amount-name").html(t.data.couponCode),r.find(".coupon-amount-value").html("-".concat($currency).concat($couponData.couponAmount)),r.find(".total-amount-value").html("".concat($currency).concat($couponData.discountAmount)),r.find("input[name=smartpay_product_price]").val("".concat($couponData.discountAmount)),r.find(".payment-modal--title").html("".concat($couponData.discountAmount)),r.removeClass("d-none")}if(!t.success){var a=e(".payment-modal--errors");e(".payment-modal--errors .alert").hide(),a.append('<div class="alert alert-danger">'.concat(t.data.message,"</div>")),a.show()}})),t.preventDefault()}))}))},400:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ONE_TIME:()=>a,PAYMENT_STATUS_ABANDONED:()=>l,PAYMENT_STATUS_COMPLETED:()=>s,PAYMENT_STATUS_FAILED:()=>u,PAYMENT_STATUS_PENDING:()=>i,PAYMENT_STATUS_PROCESSING:()=>d,PAYMENT_STATUS_REFUNDED:()=>c,PAYMENT_STATUS_REVOKED:()=>p,SUBSCRIPTION:()=>o,productDefaultData:()=>f,variationDefaultData:()=>m});var n=r(304),a="One Time",o="Subscription",i="Pending",s="Completed",c="Refunded",u="Failed",l="Abandoned",p="Revoked",d="Processing",f={title:"",covers:[],description:"",variations:[],base_price:"",sale_price:"",files:[],settings:{payButtonLabel:(0,n.__)("Pay Now","smartpay"),label:(0,n.__)("Just Label checking","smartpay"),externalLink:{allowExternalLink:!1,label:(0,n.__)("Link Label","smartpay"),link:""}},extra:{}},m={title:"",description:"",base_price:"",sale_price:"",files:[],key:"",extra:{billing_type:a}}},470:()=>{},347:()=>{},737:()=>{},588:t=>{t.exports=function(t,e){var r,n,a=0;function o(){var o,i,s=r,c=arguments.length;t:for(;s;){if(s.args.length===arguments.length){for(i=0;i<c;i++)if(s.args[i]!==arguments[i]){s=s.next;continue t}return s!==r&&(s===n&&(n=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=r,s.prev=null,r.prev=s,r=s),s.val}s=s.next}for(o=new Array(c),i=0;i<c;i++)o[i]=arguments[i];return s={args:o,val:t.apply(null,o)},r?(r.prev=s,s.next=r):n=s,a===e.maxSize?(n=n.prev).next=null:a++,r=s,s.val}return e=e||{},o.clear=function(){r=null,n=null,a=0},o}},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof h?e:h,o=Object.create(a.prototype),i=new k(n||[]);return o._invoke=function(t,e,r){var n=p;return function(a,o){if(n===f)throw new Error("Generator is already running");if(n===m){if("throw"===a)throw o;return E()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var s=A(i,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===p)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var c=l(t,e,r);if("normal"===c.type){if(n=r.done?m:d,c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=m,r.method="throw",r.arg=c.arg)}}}(t,r,i),o}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",f="executing",m="completed",y={};function h(){}function v(){}function g(){}var _={};c(_,o,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(S([])));w&&w!==r&&n.call(w,o)&&(_=w);var O=g.prototype=h.prototype=Object.create(_);function j(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(a,o,i,s){var c=l(t[a],t,o);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==typeof p&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,i,s)}),(function(t){r("throw",t,i,s)})):e.resolve(p).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,s)}))}s(c.arg)}var a;this._invoke=function(t,n){function o(){return new e((function(e,a){r(t,n,e,a)}))}return a=a?a.then(o,o):o()}}function A(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,A(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var a=l(n,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var o=a.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function S(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(n.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:E}}function E(){return{value:e,done:!0}}return v.prototype=g,c(O,"constructor",g),c(g,"constructor",v),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(O),t},t.awrap=function(t){return{__await:t}},j(x.prototype),c(x.prototype,i,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,a,o){void 0===o&&(o=Promise);var i=new x(u(e,r,n,a),o);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},j(O),c(O,s,"Generator"),c(O,o,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function a(n,a){return s.type="throw",s.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;T(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:S(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},975:(t,e,r)=>{var n;!function(){"use strict";var a={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(t){return s(u(t),arguments)}function i(t,e){return o.apply(null,[t].concat(e||[]))}function s(t,e){var r,n,i,s,c,u,l,p,d,f=1,m=t.length,y="";for(n=0;n<m;n++)if("string"==typeof t[n])y+=t[n];else if("object"==typeof t[n]){if((s=t[n]).keys)for(r=e[f],i=0;i<s.keys.length;i++){if(null==r)throw new Error(o('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[i],s.keys[i-1]));r=r[s.keys[i]]}else r=s.param_no?e[s.param_no]:e[f++];if(a.not_type.test(s.type)&&a.not_primitive.test(s.type)&&r instanceof Function&&(r=r()),a.numeric_arg.test(s.type)&&"number"!=typeof r&&isNaN(r))throw new TypeError(o("[sprintf] expecting number but found %T",r));switch(a.number.test(s.type)&&(p=r>=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}a.json.test(s.type)?y+=r:(!a.number.test(s.type)||p&&!s.sign?d="":(d=p?"+":"-",r=r.toString().replace(a.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",l=s.width-(d+r).length,c=s.width&&l>0?u.repeat(l):"",y+=s.align?d+r+c:"0"===u?d+c+r:c+d+r)}return y}var c=Object.create(null);function u(t){if(c[t])return c[t];for(var e,r=t,n=[],o=0;r;){if(null!==(e=a.text.exec(r)))n.push(e[0]);else if(null!==(e=a.modulo.exec(r)))n.push("%");else{if(null===(e=a.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var i=[],s=e[2],u=[];if(null===(u=a.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(i.push(u[1]);""!==(s=s.substring(u[0].length));)if(null!==(u=a.key_access.exec(s)))i.push(u[1]);else{if(null===(u=a.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");i.push(u[1])}e[2]=i}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return c[t]=n}o,i,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=i,void 0===(n=function(){return{sprintf:o,vsprintf:i}}.call(e,r,e,t))||(t.exports=n))}()},22:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(680),a={contextDelimiter:"",onMissingKey:null};function o(t,e){var r;for(r in this.data=t,this.pluralForms={},this.options={},a)this.options[r]=void 0!==e&&r in e?e[r]:a[r]}o.prototype.getPluralForm=function(t,e){var r,a,o,i=this.pluralForms[t];return i||("function"!=typeof(o=(r=this.data[t][""])["Plural-Forms"]||r["plural-forms"]||r.plural_forms)&&(a=function(t){var e,r,n;for(e=t.split(";"),r=0;r<e.length;r++)if(0===(n=e[r].trim()).indexOf("plural="))return n.substr(7)}(r["Plural-Forms"]||r["plural-forms"]||r.plural_forms),o=(0,n.Z)(a)),i=this.pluralForms[t]=o),i(e)},o.prototype.dcnpgettext=function(t,e,r,n,a){var o,i,s;return o=void 0===a?0:this.getPluralForm(t,a),i=r,e&&(i=e+this.options.contextDelimiter+r),(s=this.data[t][i])&&s[o]?s[o]:(this.options.onMissingKey&&this.options.onMissingKey(r,t),0===o?r:n)}}},r={};function n(t){var a=r[t];if(void 0!==a)return a.exports;var o=r[t]={exports:{}};return e[t](o,o.exports,n),o.exports}n.m=e,t=[],n.O=(e,r,a,o)=>{if(!r){var i=1/0;for(l=0;l<t.length;l++){for(var[r,a,o]=t[l],s=!0,c=0;c<r.length;c++)(!1&o||i>=o)&&Object.keys(n.O).every((t=>n.O[t](r[c])))?r.splice(c--,1):(s=!1,o<i&&(i=o));if(s){t.splice(l--,1);var u=a();void 0!==u&&(e=u)}}return e}o=o||0;for(var l=t.length;l>0&&t[l-1][2]>o;l--)t[l]=t[l-1];t[l]=[r,a,o]},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={177:0,47:0,122:0,879:0};n.O.j=e=>0===t[e];var e=(e,r)=>{var a,o,[i,s,c]=r,u=0;if(i.some((e=>0!==t[e]))){for(a in s)n.o(s,a)&&(n.m[a]=s[a]);if(c)var l=c(n)}for(e&&e(r);u<i.length;u++)o=i[u],n.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return n.O(l)},r=self.webpackChunkwp_smartpay=self.webpackChunkwp_smartpay||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})(),n.O(void 0,[47,122,879],(()=>n(359))),n.O(void 0,[47,122,879],(()=>n(470))),n.O(void 0,[47,122,879],(()=>n(347)));var a=n.O(void 0,[47,122,879],(()=>n(737)));a=n.O(a)})();
  • smartpay/tags/2.7.2/readme.txt

    r2789849 r2791699  
    55Tested up to: 6.0.2
    66Requires PHP: 7.4.0
    7 Stable Tag: 2.7.1
     7Stable Tag: 2.7.2
    88License: GNU Version 2 or later
    99
     
    123123
    124124== Changelog ==
     125= [2.7.2] =
     126* New - Add subscription info on the payment receipt page
     127* Fix - Billing type was not updated for one time on the form page
     128* Fix - Additional charge info was shown if no charges were added
     129* Fix - Payment was not processed if the additional charge and billing cycle are empty
     130
     131
    125132= [2.7.1] =
    126133* New - Additional charge for recurring payments
  • smartpay/tags/2.7.2/resources/views/shortcodes/payment_receipt.php

    r2726552 r2791699  
    1 <?php use SmartPay\Modules\Frontend\Utilities\Downloader;
     1<?php
     2
     3use SmartPay\Modules\Frontend\Utilities\Downloader;
     4
     5$additional_charge = $payment->data['additional_info']['additional_charge'] ?? 0;
     6$total_count = $payment->data['additional_info']['total_billing_cycle'] ?? 0;
     7
    28if ($payment) : ?>
    39
    4     <?php do_action('smartpay_before_payment_receipt', $payment); ?>
     10    <?php do_action('smartpay_before_payment_receipt', $payment); ?>
    511
    612    <table>
    7         <?php do_action('smartpay_before_payment_receipt_data', $payment); ?>
     13        <?php do_action('smartpay_before_payment_receipt_data', $payment); ?>
    814
    915        <tr>
     
    1622            <td>
    1723                <a href="<?php echo smartpay_get_payment_product_or_form_name($payment->id)['preview'];?>" target="_blank">
    18                     <?php echo esc_html(smartpay_get_payment_product_or_form_name($payment->id)['name']); ?>
     24                    <?php echo esc_html(smartpay_get_payment_product_or_form_name($payment->id)['name']); ?>
    1925                </a>
    2026            </td>
    21 <!--            <td>--><?php //echo esc_html(smartpay_get_payment_product_or_form_name($payment->id)); ?><!--</td>-->
     27            <!--            <td>--><?php //echo esc_html(smartpay_get_payment_product_or_form_name($payment->id)); ?><!--</td>-->
    2228        </tr>
    2329
     
    3339            <td><?php _e('Payment amount:', 'smartpay') ?></td>
    3440            <td>
    35                 <?php
    36                 echo smartpay_amount_format($payment->amount);
    37                 //                    if ($payment->amount <= 0){
    38                 //                        //FIXME: remove constant with accessor or from gateway label
    39                 //                        echo 'Free';
    40                 //                    }else {
    41                 //                        echo smartpay_amount_format($payment->amount);
    42                 //                    }
    43                 ?>
     41                <?php
     42                echo smartpay_amount_format($payment->amount);
     43                ?>
    4444            </td>
    4545        </tr>
     46
     47        <?php if ($payment->data['additional_info'] &&  ($additional_charge > 0 || $total_count > 0)): ?>
     48            <tr>
     49                <td><?php _e('Subscription Info:', 'smartpay') ?></td>
     50                <td>
     51                    <?php
     52                    if ($additional_charge > 0) {
     53                        echo ('Additional charge '. smartpay_amount_format($additional_charge). ', ');
     54                    }
     55                    if ($total_count > 0) {
     56                        echo ('  Will be billed '.$total_count .' times.');
     57                    }
     58                    ?>
     59                </td>
     60            </tr>
     61        <?php endif; ?>
     62
    4663        <tr>
    4764            <td><?php _e('Payment gateway:', 'smartpay') ?></td>
    4865            <td>
    49                 <?php
    50                 if (smartpay_payment_gateways()[$payment->gateway]['checkout_label'] == 'Free'){
    51                     echo 'Free Purchase';
    52                 }else{
    53                     echo smartpay_payment_gateways()[$payment->gateway]['checkout_label'] ?? ucfirst($payment->gateway);
    54                 }
    55                 ?>
     66                <?php
     67                if (smartpay_payment_gateways()[$payment->gateway]['checkout_label'] == 'Free'){
     68                    echo 'Free Purchase';
     69                }else{
     70                    echo smartpay_payment_gateways()[$payment->gateway]['checkout_label'] ?? ucfirst($payment->gateway);
     71                }
     72                ?>
    5673            </td>
    5774        </tr>
     
    6178        </tr>
    6279
    63         <?php if (strtolower($payment->status) == \SmartPay\Models\Payment::COMPLETED): ?>
    64             <?php if ($payment->type == 'Product Purchase'): ?>
    65                 <?php $product = \SmartPay\Models\Product::find(intval($payment['data']['product_id'])) ?? null;
    66                 $external_link = $product['settings']['externalLink'];
    67                 ?>
    68                 <?php if ($product && $external_link && $external_link['allowExternalLink']): ?>
     80        <?php if (strtolower($payment->status) == \SmartPay\Models\Payment::COMPLETED): ?>
     81            <?php if ($payment->type == 'Product Purchase'): ?>
     82                <?php $product = \SmartPay\Models\Product::find(intval($payment['data']['product_id'])) ?? null;
     83                $external_link = $product['settings']['externalLink'];
     84                ?>
     85                <?php if ($product && $external_link && $external_link['allowExternalLink']): ?>
    6986                    <tr>
    7087                        <td><?php _e('Resource', 'smartpay') ?></td>
    7188                        <td>
    7289                            <a href="<?php echo $product['settings']['externalLink']['link']; ?>" target="_blank">
    73                                 <?php echo $product['settings']['externalLink']['label'] ?>
     90                                <?php echo $product['settings']['externalLink']['label'] ?>
    7491                            </a>
    7592                        </td>
    7693                    </tr>
    77                 <?php endif; ?>
     94                <?php endif; ?>
    7895
    79             <?php else: ?>
    80                 <?php $form = \SmartPay\Models\Form::find(intval($payment['data']['form_id'])) ?? null;
    81                 $external_link = $form['settings']['externalLink'];
    82                 ?>
    83                 <?php if ($form && $external_link && $external_link['allowExternalLink']): ?>
     96            <?php else: ?>
     97                <?php $form = \SmartPay\Models\Form::find(intval($payment['data']['form_id'])) ?? null;
     98                $external_link = $form['settings']['externalLink'];
     99                ?>
     100                <?php if ($form && $external_link && $external_link['allowExternalLink']): ?>
    84101                    <tr>
    85102                        <td><?php _e('Resource', 'smartpay') ?></td>
    86103                        <td>
    87104                            <a href="<?php echo $form['settings']['externalLink']['link']; ?>" target="_blank">
    88                                 <?php echo $form['settings']['externalLink']['label'] ?>
     105                                <?php echo $form['settings']['externalLink']['label'] ?>
    89106                            </a>
    90107                        </td>
    91108                    </tr>
    92                 <?php endif; ?>
    93             <?php endif; ?>
    94         <?php endif; ?>
     109                <?php endif; ?>
     110            <?php endif; ?>
     111        <?php endif; ?>
    95112
    96113
    97         <?php do_action('smartpay_before_payment_receipt_data', $payment); ?>
     114        <?php do_action('smartpay_before_payment_receipt_data', $payment); ?>
    98115
    99116    </table>
    100117
    101     <?php do_action('smartpay_after_payment_receipt', $payment); ?>
     118    <?php do_action('smartpay_after_payment_receipt', $payment); ?>
    102119
    103     <?php do_action('smartpay_payment_' . $payment->gateway . '_receipt', $payment); ?>
     120    <?php do_action('smartpay_payment_' . $payment->gateway . '_receipt', $payment); ?>
    104121
    105     <?php $productId = $payment->data['product_id'] ?? 0; ?>
    106     <?php $product = \SmartPay\Models\Product::with(['parent'])->find($productId); ?>
    107     <?php if (strtolower($payment->status) == \SmartPay\Models\Payment::COMPLETED): ?>
    108         <?php if ($product && count($product->files) > 0): ?>
     122    <?php $productId = $payment->data['product_id'] ?? 0; ?>
     123    <?php $product = \SmartPay\Models\Product::with(['parent'])->find($productId); ?>
     124    <?php if (strtolower($payment->status) == \SmartPay\Models\Payment::COMPLETED): ?>
     125        <?php if ($product && count($product->files) > 0): ?>
    109126            <!--    Do staff for download files-->
    110127            <h3><?php echo __( 'Files', 'smartpay' ); ?></h3>
     
    115132                </thead>
    116133                <tbody>
    117                 <?php foreach ($product->files as $file) { ?>
     134                <?php foreach ($product->files as $file) { ?>
    118135                    <tr>
    119136                        <td width="70%">
    120                             <?php echo $file['name']; ?>
     137                            <?php echo $file['name']; ?>
    121138                        </td>
    122139                        <td>
     
    124141                        </td>
    125142                    </tr>
    126                 <?php } ?>
     143                <?php } ?>
    127144                </tbody>
    128145            </table>
    129         <?php endif; ?>
    130     <?php endif; ?>
     146        <?php endif; ?>
     147    <?php endif; ?>
    131148<?php
    132149
  • smartpay/tags/2.7.2/resources/views/shortcodes/shared/form_details.php

    r2789849 r2791699  
    1616                        <div class="form-amounts">
    1717                            <div class="form-plan-grid ">
    18                                 <?php foreach ( $form->amounts as $index => $amount ) : ?>
    19                                     <?php $billingType = $amount['billing_type'] ?? \SmartPay\Models\Payment::BILLING_TYPE_ONE_TIME; ?>
     18                                <?php foreach ( $form->amounts as $index => $amount ) : ?>
     19                                    <?php $billingType = $amount['billing_type'] ?? \SmartPay\Models\Payment::BILLING_TYPE_ONE_TIME; ?>
    2020
    21                                     <?php if ( $billingType == \SmartPay\Models\Payment::BILLING_TYPE_ONE_TIME ): ?>
     21                                    <?php if ( $billingType == \SmartPay\Models\Payment::BILLING_TYPE_ONE_TIME ): ?>
    2222                                        <label class="form-plan-card plan-amount <?php echo 0 === $index ? 'selected' : '' ?>">
    2323                                            <input type="radio" name="_form_amount" id="_form_amount_<?php echo
    24                                             $amount['key']; ?>" class="radio" value="<?php echo
    25                                             $amount['amount']; ?>" <?php echo 0 === $index ? 'checked' : '' ?> />
     24                                            $amount['key']; ?>" class="radio" value="<?php echo
     25                                            $amount['amount']; ?>" <?php echo 0 === $index ? 'checked' : '' ?> />
    2626                                            <span class="plan-details" aria-hidden="true">
    2727                                        <span class="plan-type">
     
    3131                                            <?php echo smartpay_amount_format( $amount['amount'] ); ?>
    3232                                        </span>
     33                                                <input type="hidden" name="_form_billing_type" id="_form_billing_type_<?php echo $amount['key']; ?>" value="<?php echo $billingType; ?>">
    3334                                        </label>
    34                                     <?php endif; ?>
     35                                    <?php endif; ?>
    3536
    36                                     <?php if ( \SmartPay\Models\Payment::BILLING_TYPE_SUBSCRIPTION === $billingType ) : ?>
     37                                    <?php if ( \SmartPay\Models\Payment::BILLING_TYPE_SUBSCRIPTION === $billingType ) : ?>
    3738
    3839                                        <label class="form-plan-card plan-amount <?php echo 0 === $index ? 'selected' : '' ?>">
     
    4041                                                   value="<?php echo $amount['key'] ?? ''; ?>">
    4142                                            <input type="radio" name="_form_amount" id="_form_amount_<?php echo
    42                                             $amount['key']; ?><?php echo
    43                                             $amount['key']; ?>" class="radio" value="<?php echo
    44                                             $amount['amount']; ?>" <?php echo 0 === $index ? 'checked' : '' ?> />
     43                                            $amount['key']; ?><?php echo
     44                                            $amount['key']; ?>" class="radio" value="<?php echo
     45                                            $amount['amount']; ?>" <?php echo 0 === $index ? 'checked' : '' ?> />
    4546                                            <span class="plan-details" aria-hidden="true">
    4647                                        <span class="plan-type">
     
    5556                                            <?php endif; ?>
    5657
    57                                                 <?php if ( isset( $amount['additional_charge'] ) && $amount['additional_charge'] > 0 ): ?>
     58                                                <?php if ( isset( $amount['additional_charge'] ) && $amount['additional_charge'] > 0 ): ?>
    5859                                                    <span class="plan-additional-info"> Additional Charge <?php echo $amount['additional_charge'] . smartpay_get_currency_symbol(); ?></span>
    59                                                 <?php endif; ?>
     60                                                <?php endif; ?>
    6061                                        </span>
    6162                                            <input type="hidden" name="_form_billing_type" id="_form_billing_type_<?php echo $amount['key']; ?>" value="<?php echo $billingType; ?>">
     
    6566                                                   value="<?php echo $amount['billing_period']; ?>">
    6667                                        </label>
    67                                     <?php endif; ?>
    68                                 <?php endforeach; ?>
     68                                    <?php endif; ?>
     69                                <?php endforeach; ?>
    6970                            </div>
    7071
  • smartpay/tags/2.7.2/resources/views/shortcodes/shared/product_details.php

    r2789849 r2791699  
    3636                                            <li class="list-group-item variation price <?php echo 0 == $index ? 'selected' : ''; ?>">
    3737                                                <input type="hidden" name="_product_additional_charge"
    38                                                        value="<?php echo $variation->extra['additional_charge'] ?? '' ?>">
     38                                                       value="<?php echo $variation->extra['additional_charge'] ?? 0 ?>">
    3939                                                <label for="<?php echo "product_variation_{$variation->id}"; ?>" class="d-block m-0">
    4040                                                    <input type="hidden" name="_smartpay_product_id" id="<?php echo "product_variation_{$variation->id}"; ?>" value="<?php echo esc_attr($variation->id); ?>" <?php echo 0 == $index ? 'checked' : ''; ?>>
  • smartpay/tags/2.7.2/smartpay.php

    r2791141 r2791699  
    66 * Plugin URI:  https://wpsmartpay.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
    77 * Tags: download manager, digital product, donation, ecommerce, paddle, stripe, paypal, document manager, file manager, download protection, recurring payment, donations, donation plugin, wordpress donation plugin, wp donation, fundraising, fundraiser, crowdfunding, wordpress donations, gutenberg, gutenberg donations, nonprofit, paypal donations, paypal donate, stripe donations, stripe donate, authorize.net, authorize.net donations, bkash, bkash payment,
    8  * Version:     2.7.1
     8 * Version:     2.7.2
    99 * Author:      WPSmartPay
    1010 * Author URI:  https://wpsmartpay.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
     
    2828defined('ABSPATH') || exit;
    2929
    30 define('SMARTPAY_VERSION', '2.7.1');
     30define('SMARTPAY_VERSION', '2.7.2');
    3131define('SMARTPAY_PLUGIN_FILE', __FILE__);
    3232define('SMARTPAY_PLUGIN_ASSETS', plugins_url('public', __FILE__));
  • smartpay/tags/2.7.2/vendor/autoload.php

    r2791141 r2791699  
    1010require_once __DIR__ . '/composer/autoload_real.php';
    1111
    12 return ComposerAutoloaderInit28d163601e5e15ca167a7a8308d74631::getLoader();
     12return ComposerAutoloaderInit98d000388e7c589af69ab4822a884f05::getLoader();
  • smartpay/tags/2.7.2/vendor/composer/autoload_real.php

    r2791141 r2791699  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit28d163601e5e15ca167a7a8308d74631
     5class ComposerAutoloaderInit98d000388e7c589af69ab4822a884f05
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit28d163601e5e15ca167a7a8308d74631', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit98d000388e7c589af69ab4822a884f05', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit28d163601e5e15ca167a7a8308d74631', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit98d000388e7c589af69ab4822a884f05', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInit28d163601e5e15ca167a7a8308d74631::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit98d000388e7c589af69ab4822a884f05::getInitializer($loader));
    3333
    3434        $loader->register(true);
    3535
    36         $includeFiles = \Composer\Autoload\ComposerStaticInit28d163601e5e15ca167a7a8308d74631::$files;
     36        $includeFiles = \Composer\Autoload\ComposerStaticInit98d000388e7c589af69ab4822a884f05::$files;
    3737        foreach ($includeFiles as $fileIdentifier => $file) {
    38             composerRequire28d163601e5e15ca167a7a8308d74631($fileIdentifier, $file);
     38            composerRequire98d000388e7c589af69ab4822a884f05($fileIdentifier, $file);
    3939        }
    4040
     
    4848 * @return void
    4949 */
    50 function composerRequire28d163601e5e15ca167a7a8308d74631($fileIdentifier, $file)
     50function composerRequire98d000388e7c589af69ab4822a884f05($fileIdentifier, $file)
    5151{
    5252    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • smartpay/tags/2.7.2/vendor/composer/autoload_static.php

    r2791141 r2791699  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit28d163601e5e15ca167a7a8308d74631
     7class ComposerStaticInit98d000388e7c589af69ab4822a884f05
    88{
    99    public static $files = array (
     
    111111    {
    112112        return \Closure::bind(function () use ($loader) {
    113             $loader->prefixLengthsPsr4 = ComposerStaticInit28d163601e5e15ca167a7a8308d74631::$prefixLengthsPsr4;
    114             $loader->prefixDirsPsr4 = ComposerStaticInit28d163601e5e15ca167a7a8308d74631::$prefixDirsPsr4;
    115             $loader->classMap = ComposerStaticInit28d163601e5e15ca167a7a8308d74631::$classMap;
     113            $loader->prefixLengthsPsr4 = ComposerStaticInit98d000388e7c589af69ab4822a884f05::$prefixLengthsPsr4;
     114            $loader->prefixDirsPsr4 = ComposerStaticInit98d000388e7c589af69ab4822a884f05::$prefixDirsPsr4;
     115            $loader->classMap = ComposerStaticInit98d000388e7c589af69ab4822a884f05::$classMap;
    116116
    117117        }, null, ClassLoader::class);
  • smartpay/tags/2.7.2/vendor/composer/installed.php

    r2791141 r2791699  
    22    'root' => array(
    33        'name' => 'wp-smartpay/core',
    4         'pretty_version' => 'v2.7.1.1',
    5         'version' => '2.7.1.1',
    6         'reference' => '5c6d129dc08c7cc170549a0b18155c8c2c158b06',
     4        'pretty_version' => 'v2.7.2',
     5        'version' => '2.7.2.0',
     6        'reference' => 'a63c3b799c3287821a63e312fac39e80d2e8b55a',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    108108        ),
    109109        'wp-smartpay/core' => array(
    110             'pretty_version' => 'v2.7.1.1',
    111             'version' => '2.7.1.1',
    112             'reference' => '5c6d129dc08c7cc170549a0b18155c8c2c158b06',
     110            'pretty_version' => 'v2.7.2',
     111            'version' => '2.7.2.0',
     112            'reference' => 'a63c3b799c3287821a63e312fac39e80d2e8b55a',
    113113            'type' => 'library',
    114114            'install_path' => __DIR__ . '/../../',
  • smartpay/trunk/app/Modules/Payment/Payment.php

    r2789849 r2791699  
    175175
    176176                $additional_amount = $product->extra['additional_charge'] ?? 0;
     177                if (empty($product->extra['additional_charge'])) {
     178                    $additional_amount = 0;
     179                }
    177180                $total_billing_cycle = $product->extra['total_billing_cycle'] ?? 0;
     181                if (empty($product->extra['total_billing_cycle'])) {
     182                    $total_billing_cycle = 0;
     183                }
    178184
    179185                $payment_default_data = [
     
    182188                    'total_amount'  => $_data['smartpay_product_price'],
    183189                    'billing_type'   => $_data['smartpay_product_billing_type'],
    184                     'additional_info' => [
    185                         'additional_charge' => $additional_amount,
    186                         'total_billing_cycle' => $total_billing_cycle,
    187                     ]
    188190                ];
     191
     192                if ($_data['smartpay_product_billing_type'] == \SmartPay\Models\Payment::BILLING_TYPE_SUBSCRIPTION) {
     193                    $payment_default_data['additional_info'] =  [
     194                        'additional_charge' => $additional_amount,
     195                        'total_billing_cycle' => $total_billing_cycle,
     196                    ];
     197                }
    189198
    190199                return smartpay_get_additional_payment_data($payment_default_data);
     
    213222                    ];
    214223
    215                 if ( !filter_var($_data['smartpay_is_custom_amount'], FILTER_VALIDATE_BOOLEAN) ) {
    216                     $payment_data['additional_info']  = [
    217                         'additional_charge' => $additional_amount,
    218                         'total_billing_cycle' => $total_billing_cycle,
    219                     ];
    220                 }
     224                if ($_data['smartpay_form_billing_type'] == \SmartPay\Models\Payment::BILLING_TYPE_SUBSCRIPTION) {
     225                    if ( !filter_var($_data['smartpay_is_custom_amount'], FILTER_VALIDATE_BOOLEAN) ) {
     226                        $payment_data['additional_info']  = [
     227                            'additional_charge' => $additional_amount,
     228                            'total_billing_cycle' => $total_billing_cycle,
     229                        ];
     230                    }
     231                }
     232
    221233                return $payment_data;
    222234
  • smartpay/trunk/public/js/app.js

    r2789849 r2791699  
    1 (()=>{var t,e={757:(t,e,r)=>{t.exports=r(666)},974:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(141),a=r(192);function o(t){var e=(0,n.Z)(t);return function(t){return(0,a.Z)(e,t)}}},192:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var n={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,r){if(t)throw e;return r}};function a(t,e){var r,a,o,i,s,c,u=[];for(r=0;r<t.length;r++){if(s=t[r],i=n[s]){for(a=i.length,o=Array(a);a--;)o[a]=u.pop();try{c=i.apply(null,o)}catch(t){return t}}else c=e.hasOwnProperty(s)?e[s]:+s;u.push(c)}return u[0]}},680:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var n=r(974);function a(t){var e=(0,n.Z)(t);return function(t){return+e({n:t})}}},141:(t,e,r)=>{"use strict";var n,a,o,i;function s(t){for(var e,r,s,c,u=[],l=[];e=t.match(i);){for(r=e[0],(s=t.substr(0,e.index).trim())&&u.push(s);c=l.pop();){if(o[r]){if(o[r][0]===c){r=o[r][1]||r;break}}else if(a.indexOf(c)>=0||n[c]<n[r]){l.push(c);break}u.push(c)}o[r]||l.push(r),t=t.substr(e.index+r.length)}return(t=t.trim())&&u.push(t),u.concat(l.reverse())}r.d(e,{Z:()=>s}),n={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},a=["(","?"],o={")":["("],":":["?","?:"]},i=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/},247:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(103),a=r(755);const o=function(t,e){return function(r,o,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;const c=t[e];if(!(0,a.Z)(r))return;if(!(0,n.Z)(o))return;if("function"!=typeof i)return void console.error("The hook callback must be a function.");if("number"!=typeof s)return void console.error("If specified, the hook priority must be a number.");const u={callback:i,priority:s,namespace:o};if(c[r]){const t=c[r].handlers;let e;for(e=t.length;e>0&&!(s>=t[e-1].priority);e--);e===t.length?t[e]=u:t.splice(e,0,u),c.__current.forEach((t=>{t.name===r&&t.currentIndex>=e&&t.currentIndex++}))}else c[r]={handlers:[u],runs:0};"hookAdded"!==r&&t.doAction("hookAdded",r,o,i,s)}}},992:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){return function(){var r,n;const a=t[e];return null!==(r=null===(n=a.__current[a.__current.length-1])||void 0===n?void 0:n.name)&&void 0!==r?r:null}}},972:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var n=r(755);const a=function(t,e){return function(r){const a=t[e];if((0,n.Z)(r))return a[r]&&a[r].runs?a[r].runs:0}}},786:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){return function(r){const n=t[e];return void 0===r?void 0!==n.__current[0]:!!n.__current[0]&&r===n.__current[0].name}}},642:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){return function(r,n){const a=t[e];return void 0!==n?r in a&&a[r].handlers.some((t=>t.namespace===n)):r in a}}},19:(t,e,r)=>{"use strict";r.d(e,{Z:()=>p});var n=r(247),a=r(99),o=r(642),i=r(424),s=r(992),c=r(786),u=r(972);class l{constructor(){this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=(0,n.Z)(this,"actions"),this.addFilter=(0,n.Z)(this,"filters"),this.removeAction=(0,a.Z)(this,"actions"),this.removeFilter=(0,a.Z)(this,"filters"),this.hasAction=(0,o.Z)(this,"actions"),this.hasFilter=(0,o.Z)(this,"filters"),this.removeAllActions=(0,a.Z)(this,"actions",!0),this.removeAllFilters=(0,a.Z)(this,"filters",!0),this.doAction=(0,i.Z)(this,"actions"),this.applyFilters=(0,i.Z)(this,"filters",!0),this.currentAction=(0,s.Z)(this,"actions"),this.currentFilter=(0,s.Z)(this,"filters"),this.doingAction=(0,c.Z)(this,"actions"),this.doingFilter=(0,c.Z)(this,"filters"),this.didAction=(0,u.Z)(this,"actions"),this.didFilter=(0,u.Z)(this,"filters")}}const p=function(){return new l}},99:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(103),a=r(755);const o=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(o,i){const s=t[e];if(!(0,a.Z)(o))return;if(!r&&!(0,n.Z)(i))return;if(!s[o])return 0;let c=0;if(r)c=s[o].handlers.length,s[o]={runs:s[o].runs,handlers:[]};else{const t=s[o].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===i&&(t.splice(e,1),c++,s.__current.forEach((t=>{t.name===o&&t.currentIndex>=e&&t.currentIndex--})))}return"hookRemoved"!==o&&t.doAction("hookRemoved",o,i),c}}},424:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n){const a=t[e];a[n]||(a[n]={handlers:[],runs:0}),a[n].runs++;const o=a[n].handlers;for(var i=arguments.length,s=new Array(i>1?i-1:0),c=1;c<i;c++)s[c-1]=arguments[c];if(!o||!o.length)return r?s[0]:void 0;const u={name:n,currentIndex:0};for(a.__current.push(u);u.currentIndex<o.length;){const t=o[u.currentIndex].callback.apply(null,s);r&&(s[0]=t),u.currentIndex++}return a.__current.pop(),r?s[0]:void 0}}},957:(t,e,r)=>{"use strict";r.d(e,{JQ:()=>n});const n=(0,r(19).Z)(),{addAction:a,addFilter:o,removeAction:i,removeFilter:s,hasAction:c,hasFilter:u,removeAllActions:l,removeAllFilters:p,doAction:d,applyFilters:f,currentAction:m,currentFilter:y,doingAction:h,doingFilter:v,didAction:g,didFilter:_,actions:b,filters:w}=n},755:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}},103:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}},16:(t,e,r)=>{"use strict";r.d(e,{o:()=>i});var n=r(22);const a={plural_forms:t=>1===t?0:1},o=/^i18n\.(n?gettext|has_translation)(_|$)/,i=(t,e,r)=>{const i=new n.Z({}),s=new Set,c=()=>{s.forEach((t=>t()))},u=function(t){var e;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";i.data[r]={...i.data[r],...t},i.data[r][""]={...a,...null===(e=i.data[r])||void 0===e?void 0:e[""]},delete i.pluralForms[r]},l=(t,e)=>{u(t,e),c()},p=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;return i.data[t]||u(void 0,t),i.dcnpgettext(t,e,r,n,a)},d=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return t},f=(t,e,n)=>{let a=p(n,e,t);return r?(a=r.applyFilters("i18n.gettext_with_context",a,t,e,n),r.applyFilters("i18n.gettext_with_context_"+d(n),a,t,e,n)):a};if(t&&l(t,e),r){const t=t=>{o.test(t)&&c()};r.addAction("hookAdded","core/i18n",t),r.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return i.data[t]},setLocaleData:l,addLocaleData:function(t){var e;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";i.data[r]={...i.data[r],...t,"":{...a,...null===(e=i.data[r])||void 0===e?void 0:e[""],...null==t?void 0:t[""]}},delete i.pluralForms[r],c()},resetLocaleData:(t,e)=>{i.data={},i.pluralForms={},l(t,e)},subscribe:t=>(s.add(t),()=>s.delete(t)),__:(t,e)=>{let n=p(e,void 0,t);return r?(n=r.applyFilters("i18n.gettext",n,t,e),r.applyFilters("i18n.gettext_"+d(e),n,t,e)):n},_x:f,_n:(t,e,n,a)=>{let o=p(a,void 0,t,e,n);return r?(o=r.applyFilters("i18n.ngettext",o,t,e,n,a),r.applyFilters("i18n.ngettext_"+d(a),o,t,e,n,a)):o},_nx:(t,e,n,a,o)=>{let i=p(o,a,t,e,n);return r?(i=r.applyFilters("i18n.ngettext_with_context",i,t,e,n,a,o),r.applyFilters("i18n.ngettext_with_context_"+d(o),i,t,e,n,a,o)):i},isRTL:()=>"rtl"===f("ltr","text direction"),hasTranslation:(t,e,n)=>{var a,o;const s=e?e+""+t:t;let c=!(null===(a=i.data)||void 0===a||null===(o=a[null!=n?n:"default"])||void 0===o||!o[s]);return r&&(c=r.applyFilters("i18n.has_translation",c,t,e,n),c=r.applyFilters("i18n.has_translation_"+d(n),c,t,e,n)),c}}}},836:(t,e,r)=>{"use strict";r.d(e,{__:()=>i});var n=r(16),a=r(957);const o=(0,n.o)(void 0,void 0,a.JQ);o.getLocaleData.bind(o),o.setLocaleData.bind(o),o.resetLocaleData.bind(o),o.subscribe.bind(o);const i=o.__.bind(o);o._x.bind(o),o._n.bind(o),o._nx.bind(o),o.isRTL.bind(o),o.hasTranslation.bind(o)},304:(t,e,r)=>{"use strict";r.d(e,{__:()=>n.__});r(917),r(16);var n=r(836)},917:(t,e,r)=>{"use strict";var n=r(588),a=r.n(n);r(975);a()(console.error)},359:(t,e,r)=>{"use strict";r(39),r(869);function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){if(null==t)return{};var r,n,a=function(t,e){if(null==t)return{};var r,n,a={},o=Object.keys(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||(a[r]=t[r]);return a}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}var o=r(588),i=r.n(o);r(975),i()(console.error);var s=r(22);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l={"":{plural_forms:function(t){return 1===t?0:1}}},p=/^i18n\.(n?gettext|has_translation)(_|$)/;const d=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};const f=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};const m=function(t,e){return function(r,n,a){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=t[e];if(f(r)&&d(n))if("function"==typeof a)if("number"==typeof o){var s={callback:a,priority:o,namespace:n};if(i[r]){var c,u=i[r].handlers;for(c=u.length;c>0&&!(o>=u[c-1].priority);c--);c===u.length?u[c]=s:u.splice(c,0,s),i.__current.forEach((function(t){t.name===r&&t.currentIndex>=c&&t.currentIndex++}))}else i[r]={handlers:[s],runs:0};"hookAdded"!==r&&t.doAction("hookAdded",r,n,a,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};const y=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n,a){var o=t[e];if(f(n)&&(r||d(a))){if(!o[n])return 0;var i=0;if(r)i=o[n].handlers.length,o[n]={runs:o[n].runs,handlers:[]};else for(var s=o[n].handlers,c=function(t){s[t].namespace===a&&(s.splice(t,1),i++,o.__current.forEach((function(e){e.name===n&&e.currentIndex>=t&&e.currentIndex--})))},u=s.length-1;u>=0;u--)c(u);return"hookRemoved"!==n&&t.doAction("hookRemoved",n,a),i}}};const h=function(t,e){return function(r,n){var a=t[e];return void 0!==n?r in a&&a[r].handlers.some((function(t){return t.namespace===n})):r in a}};const v=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n){var a=t[e];a[n]||(a[n]={handlers:[],runs:0}),a[n].runs++;var o=a[n].handlers;for(var i=arguments.length,s=new Array(i>1?i-1:0),c=1;c<i;c++)s[c-1]=arguments[c];if(!o||!o.length)return r?s[0]:void 0;var u={name:n,currentIndex:0};for(a.__current.push(u);u.currentIndex<o.length;){var l=o[u.currentIndex],p=l.callback.apply(null,s);r&&(s[0]=p),u.currentIndex++}return a.__current.pop(),r?s[0]:void 0}};const g=function(t,e){return function(){var r,n,a=t[e];return null!==(r=null===(n=a.__current[a.__current.length-1])||void 0===n?void 0:n.name)&&void 0!==r?r:null}};const _=function(t,e){return function(r){var n=t[e];return void 0===r?void 0!==n.__current[0]:!!n.__current[0]&&r===n.__current[0].name}};const b=function(t,e){return function(r){var n=t[e];if(f(r))return n[r]&&n[r].runs?n[r].runs:0}};var w=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=m(this,"actions"),this.addFilter=m(this,"filters"),this.removeAction=y(this,"actions"),this.removeFilter=y(this,"filters"),this.hasAction=h(this,"actions"),this.hasFilter=h(this,"filters"),this.removeAllActions=y(this,"actions",!0),this.removeAllFilters=y(this,"filters",!0),this.doAction=v(this,"actions"),this.applyFilters=v(this,"filters",!0),this.currentAction=g(this,"actions"),this.currentFilter=g(this,"filters"),this.doingAction=_(this,"actions"),this.doingFilter=_(this,"filters"),this.didAction=b(this,"actions"),this.didFilter=b(this,"filters")};var O=function(){return new w}(),j=(O.addAction,O.addFilter,O.removeAction,O.removeFilter,O.hasAction,O.hasFilter,O.removeAllActions,O.removeAllFilters,O.doAction,O.applyFilters,O.currentAction,O.currentFilter,O.doingAction,O.doingFilter,O.didAction,O.didFilter,O.actions,O.filters,function(t,e,r){var n=new s.Z({}),a=new Set,o=function(){a.forEach((function(t){return t()}))},i=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";n.data[e]=u(u(u({},l),n.data[e]),t),n.data[e][""]=u(u({},l[""]),n.data[e][""])},c=function(t,e){i(t,e),o()},d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return n.data[t]||i(void 0,t),n.dcnpgettext(t,e,r,a,o)},f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return t},m=function(t,e,n){var a=d(n,e,t);return r?(a=r.applyFilters("i18n.gettext_with_context",a,t,e,n),r.applyFilters("i18n.gettext_with_context_"+f(n),a,t,e,n)):a};if(t&&c(t,e),r){var y=function(t){p.test(t)&&o()};r.addAction("hookAdded","core/i18n",y),r.addAction("hookRemoved","core/i18n",y)}return{getLocaleData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return n.data[t]},setLocaleData:c,resetLocaleData:function(t,e){n.data={},n.pluralForms={},c(t,e)},subscribe:function(t){return a.add(t),function(){return a.delete(t)}},__:function(t,e){var n=d(e,void 0,t);return r?(n=r.applyFilters("i18n.gettext",n,t,e),r.applyFilters("i18n.gettext_"+f(e),n,t,e)):n},_x:m,_n:function(t,e,n,a){var o=d(a,void 0,t,e,n);return r?(o=r.applyFilters("i18n.ngettext",o,t,e,n,a),r.applyFilters("i18n.ngettext_"+f(a),o,t,e,n,a)):o},_nx:function(t,e,n,a,o){var i=d(o,a,t,e,n);return r?(i=r.applyFilters("i18n.ngettext_with_context",i,t,e,n,a,o),r.applyFilters("i18n.ngettext_with_context_"+f(o),i,t,e,n,a,o)):i},isRTL:function(){return"rtl"===m("ltr","text direction")},hasTranslation:function(t,e,a){var o,i,s=e?e+""+t:t,c=!(null===(o=n.data)||void 0===o||null===(i=o[null!=a?a:"default"])||void 0===i||!i[s]);return r&&(c=r.applyFilters("i18n.has_translation",c,t,e,a),c=r.applyFilters("i18n.has_translation_"+f(a),c,t,e,a)),c}}}(void 0,void 0,O));j.getLocaleData.bind(j),j.setLocaleData.bind(j),j.resetLocaleData.bind(j),j.subscribe.bind(j);var x=j.__.bind(j);j._x.bind(j),j._n.bind(j),j._nx.bind(j),j.isRTL.bind(j),j.hasTranslation.bind(j);function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const T=function(t){var e=function t(e,r){var n=e.headers,a=void 0===n?{}:n;for(var o in a)if("x-wp-nonce"===o.toLowerCase()&&a[o]===t.nonce)return r(e);return r(P(P({},e),{},{headers:P(P({},a),{},{"X-WP-Nonce":t.nonce})}))};return e.nonce=t,e};function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const E=function(t,e){var r,n,a=t.path;return"string"==typeof t.namespace&&"string"==typeof t.endpoint&&(r=t.namespace.replace(/^\/|\/$/g,""),a=(n=t.endpoint.replace(/^\//,""))?r+"/"+n:r),delete t.namespace,delete t.endpoint,e(S(S({},t),{},{path:a}))};function D(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function F(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?D(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const L=function(t){return function(e,r){return E(e,(function(e){var n,a=e.url,o=e.path;return"string"==typeof o&&(n=t,-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(o=o.replace("?","&")),a=n+o),r(F(F({},e),{},{url:a}))}))}};function I(t){var e=t.split("?"),r=e[1],n=e[0];return r?n+"?"+r.split("&").map((function(t){return t.split("=")})).sort((function(t,e){return t[0].localeCompare(e[0])})).map((function(t){return t.join("=")})).join("&"):n}const Z=function(t){var e=Object.keys(t).reduce((function(e,r){return e[I(r)]=t[r],e}),{});return function(t,r){var n=t.parse,a=void 0===n||n;if("string"==typeof t.path){var o=t.method||"GET",i=I(t.path);if("GET"===o&&e[i]){var s=e[i];return delete e[i],Promise.resolve(a?s.body:new window.Response(JSON.stringify(s.body),{status:200,statusText:"OK",headers:s.headers}))}if("OPTIONS"===o&&e[o]&&e[o][i])return Promise.resolve(e[o][i])}return r(t)}};function C(t,e,r,n,a,o,i){try{var s=t[o](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,a)}var N=r(757),M=r.n(N);function $(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function U(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return $(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function q(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?R(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function W(t){return(function(t){var e;try{e=new URL(t,"http://example.com").search.substring(1)}catch(t){}if(e)return e}(t)||"").replace(/\+/g,"%20").split("&").reduce((function(t,e){var r=U(e.split("=").filter(Boolean).map(decodeURIComponent),2),n=r[0],a=r[1],o=void 0===a?"":a;n&&function(t,e,r){for(var n=e.length,a=n-1,o=0;o<n;o++){var i=e[o];!i&&Array.isArray(t)&&(i=t.length.toString());var s=!isNaN(Number(e[o+1]));t[i]=o===a?r:t[i]||(s?[]:{}),Array.isArray(t[i])&&!s&&(t[i]=q({},t[i])),t=t[i]}}(t,n.replace(/\]/g,"").split("["),o);return t}),{})}function z(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Q(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Q(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return i=t.done,t},e:function(t){s=!0,o=t},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw o}}}}function Q(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function G(t){for(var e,r="",n=Object.entries(t);e=n.shift();){var a=U(e,2),o=a[0],i=a[1];if(Array.isArray(i)||i&&i.constructor===Object){var s,c=z(Object.entries(i).reverse());try{for(c.s();!(s=c.n()).done;){var u=U(s.value,2),l=u[0],p=u[1];n.unshift(["".concat(o,"[").concat(l,"]"),p])}}catch(t){c.e(t)}finally{c.f()}}else void 0!==i&&(null===i&&(i=""),r+="&"+[o,i].map(encodeURIComponent).join("="))}return r.substr(1)}function J(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;if(!e||!Object.keys(e).length)return t;var r=t,n=t.indexOf("?");return-1!==n&&(e=Object.assign(W(t),e),r=r.substr(0,n)),r+"?"+G(e)}function Y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function H(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Y(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var V=function(t){return t.json?t.json():Promise.reject(t)},X=function(t){return function(t){if(!t)return{};var e=t.match(/<([^>]+)>; rel="next"/);return e?{next:e[1]}:{}}(t.headers.get("link")).next},B=function(t){var e=!!t.path&&-1!==t.path.indexOf("per_page=-1"),r=!!t.url&&-1!==t.url.indexOf("per_page=-1");return e||r};const K=function(){var t,e=(t=M().mark((function t(e,r){var n,o,i,s,c,u;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1!==e.parse){t.next=2;break}return t.abrupt("return",r(e));case 2:if(B(e)){t.next=4;break}return t.abrupt("return",r(e));case 4:return t.next=6,_t(H(H({},(l=e,p={per_page:100},d=void 0,f=void 0,d=l.path,f=l.url,H(H({},a(l,["path","url"])),{},{url:f&&J(f,p),path:d&&J(d,p)}))),{},{parse:!1}));case 6:return n=t.sent,t.next=9,V(n);case 9:if(o=t.sent,Array.isArray(o)){t.next=12;break}return t.abrupt("return",o);case 12:if(i=X(n)){t.next=15;break}return t.abrupt("return",o);case 15:s=[].concat(o);case 16:if(!i){t.next=27;break}return t.next=19,_t(H(H({},e),{},{path:void 0,url:i,parse:!1}));case 19:return c=t.sent,t.next=22,V(c);case 22:u=t.sent,s=s.concat(u),i=X(c),t.next=16;break;case 27:return t.abrupt("return",s);case 28:case"end":return t.stop()}var l,p,d,f}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){C(o,n,a,i,s,"next",t)}function s(t){C(o,n,a,i,s,"throw",t)}i(void 0)}))});return function(t,r){return e.apply(this,arguments)}}();function tt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function et(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?tt(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var rt=new Set(["PATCH","PUT","DELETE"]);function nt(t,e){return void 0!==function(t,e){return W(t)[e]}(t,e)}var at=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e?204===t.status?null:t.json?t.json():Promise.reject(t):t},ot=function(t){var e={code:"invalid_json",message:x("The response is not a valid JSON response.")};if(!t||!t.json)throw e;return t.json().catch((function(){throw e}))},it=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(at(t,e)).catch((function(t){return st(t,e)}))};function st(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)throw t;return ot(t).then((function(t){var e={code:"unknown_error",message:x("An unknown error occurred.")};throw t||e}))}function ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ut(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ct(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ct(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const lt=function(t,e){if(!(t.path&&-1!==t.path.indexOf("/wp/v2/media")||t.url&&-1!==t.url.indexOf("/wp/v2/media")))return e(t);var r=0,n=function t(n){return r++,e({path:"/wp/v2/media/".concat(n,"/post-process"),method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((function(){return r<5?t(n):(e({path:"/wp/v2/media/".concat(n,"?force=true"),method:"DELETE"}),Promise.reject())}))};return e(ut(ut({},t),{},{parse:!1})).catch((function(e){var r=e.headers.get("x-wp-upload-attachment-id");return e.status>=500&&e.status<600&&r?n(r).catch((function(){return!1!==t.parse?Promise.reject({code:"post_process",message:x("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(e)})):st(e,t.parse)})).then((function(e){return it(e,t.parse)}))};function pt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var ft={Accept:"application/json, */*;q=0.1"},mt={credentials:"include"},yt=[function(t,e){return"string"!=typeof t.url||nt(t.url,"_locale")||(t.url=J(t.url,{_locale:"user"})),"string"!=typeof t.path||nt(t.path,"_locale")||(t.path=J(t.path,{_locale:"user"})),e(t)},E,function(t,e){var r=t.method,n=void 0===r?"GET":r;return rt.has(n.toUpperCase())&&(t=et(et({},t),{},{headers:et(et({},t.headers),{},{"X-HTTP-Method-Override":n,"Content-Type":"application/json"}),method:"POST"})),e(t)},K];var ht=function(t){if(t.status>=200&&t.status<300)return t;throw t},vt=function(t){var e=t.url,r=t.path,n=t.data,o=t.parse,i=void 0===o||o,s=a(t,["url","path","data","parse"]),c=t.body,u=t.headers;return u=dt(dt({},ft),u),n&&(c=JSON.stringify(n),u["Content-Type"]="application/json"),window.fetch(e||r||window.location.href,dt(dt(dt({},mt),s),{},{body:c,headers:u})).then((function(t){return Promise.resolve(t).then(ht).catch((function(t){return st(t,i)})).then((function(t){return it(t,i)}))}),(function(){throw{code:"fetch_error",message:x("You are probably offline.")}}))};function gt(t){return yt.reduceRight((function(t,e){return function(r){return e(r,t)}}),vt)(t).catch((function(e){return"rest_cookie_invalid_nonce"!==e.code?Promise.reject(e):window.fetch(gt.nonceEndpoint).then(ht).then((function(t){return t.text()})).then((function(e){return gt.nonceMiddleware.nonce=e,gt(t)}))}))}gt.use=function(t){yt.unshift(t)},gt.setFetchHandler=function(t){vt=t},gt.createNonceMiddleware=T,gt.createPreloadingMiddleware=Z,gt.createRootURLMiddleware=L,gt.fetchAllMiddleware=K,gt.mediaUploadMiddleware=lt;const _t=gt;function bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return wt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wt(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Ot;jQuery(document.body).on("click",".customer-dashboard button[type=submit]",(function(t){t.preventDefault();var e=jQuery(this).parents("form"),r={first_name:e.find("input[name=first_name]").val()||null,last_name:e.find("input[name=last_name]").val()||null,email:e.find("input[name=email]").val()||null,password:e.find("input[name=password]").val()||null,password_confirm:e.find("input[name=password_confirm]").val()||null},n=e.find("input[name=customer_id]").val()||0;n&&_t({path:"".concat(smartpay.restUrl,"/v1/public/customers/").concat(n),method:"PUT",headers:{"X-WP-Nonce":smartpay.apiNonce},body:JSON.stringify(r)}).then((function(t){e.find("#form-response").append('<div class="alert alert-success text-center mb-4">Profile updated</div>')})).catch((function(t){e.find("form-response").append('<div class="alert alert-danger text-center mb-4">'.concat(t.message,"</div>"))}))})),(Ot=jQuery).fn.serializeJSON=function(){if(this.length<1)return!1;var t={},e=t,r=':input[type!="checkbox"][type!="radio"], input:checked',n=function(){if(!this.disabled){var r=this.name.replace(/\[([^\]]+)?\]/g,",$1").split(","),n=r.length-1,a=Ot(this);if(r[0]){for(var o=0;o<n;o++)e=e[r[o]]=e[r[o]]||(""===r[o+1]||"0"===r[o+1]?[]:{});void 0!==e.length?e.push(a.val()):e[r[n]]=a.val(),e=t}}};return this.filter(r).each(n),this.find(r).each(n),t},jQuery((function(t){window.SmartPayFormValidator=function(t,e){var r=this,n=this;this.data=t,this.rules=e,n.validate=function(){return Object.entries(r.rules).reduce((function(t,e){var n=bt(e,2),a=n[0],o=n[1],i=[];if(o.required){var s=r.validateRequiredMessage(r.data[a]);s&&i.push(s)}if(o.requiredWhen){var c=r.validateRequiredWhenMessage(r.data[a],o.requiredWhen);c&&i.push(c)}if(o.email){var u=r.validateEmailMessage(r.data[a]);u&&i.push(u)}if(o.length){var l=r.validateLengthMessage(r.data[a],o.length);l&&i.push(l)}if(o.value){var p=r.validateValueMessage(r.data[a],o.value);p&&i.push(p)}return i.length&&(t[a]=i),t}),{})},n.validateLengthMessage=function(t,e){if(null!=t){if(Array.isArray(e)){if(t.length>=e[0]&&t.length<=e[1])return;return"must be between ".concat(e[0]," to ").concat(e[1]," character")}if(!(t.length>=e))return"must be ".concat(e," or more characters")}},n.validateRequiredMessage=function(t){if(!t)return"is required"},n.validateRequiredWhenMessage=function(t,e){var r=bt(e,2),a=r[0],o=r[1];if(a&&n.data[a]===o)return n.validateRequiredMessage(t)},n.validateEmailMessage=function(t){if(!/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(t))return"is not a valid email"},n.validateValueMessage=function(t,e){if(t!==e)return"must be same as ".concat(e)}},window.JSUcfirst=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}}))},869:(t,e,r)=>{function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var c=r(400).SUBSCRIPTION;jQuery((function(t){var e,r;t(document.body).on("click",".smartpay-form-shortcode .form-amounts .form-plan-card",(function(e){t(e.currentTarget).parents(".form-amounts").find(".plan-amount").removeClass("selected"),t(e.currentTarget).addClass("selected");var r=t(e.currentTarget).find('input[name="_form_amount"]'),n=t(e.currentTarget).find('input[name="_form_billing_type"]');if(c===n.val())var a=t(e.currentTarget).find('input[name="_form_billing_period"]'),o=t(e.currentTarget).find('input[name="_form_amount_key"]');t(e.currentTarget).parents(".form-amounts").find(".form--custom-amount").val(r.val()),t(e.currentTarget).parents(".form-amounts").find('input[name="smartpay_form_billing_type"]').val(n.val()),c===n.val()&&(t(e.currentTarget).parents(".form-amounts").find('input[name="smartpay_form_billing_period"]').val(a.val()),t("#smartpay-payment-form").find('input[name="smartpay_selected_amount_key"]').val(o.val())),t("#smartpay_is_custom_payment").val("false")})),t(document.body).on("click",".smartpay-form-shortcode .gateways .gateway",(function(e){t(e.currentTarget).parents(".gateways").find(".gateway").removeClass("selected"),t(e.currentTarget).addClass("selected")})),t(document.body).on("focus",".smartpay-form-shortcode .form-amounts .form--custom-amount",(function(e){t(e.currentTarget).parents(".form-amounts").find(".plan-amount").removeClass("selected"),t(e.currentTarget).addClass("selected"),t(e.currentTarget).parents(".form-amounts").find('.plan-amount input[type="radio"]:checked').prop("checked",!1),t("#smartpay_is_custom_payment").val("true")})),t(document.body).on("click",".smartpay-form-shortcode button.smartpay-form-pay-now",(function(e){e.preventDefault(),$parentWrapper=t(e.currentTarget).parents(".smartpay-payment");var r,a=t(e.currentTarget).text(),o=function(t){var e=t.find("#smartpay-payment-form").serializeJSON();return i({smartpay_action:"smartpay_process_payment",smartpay_payment_type:"form_payment",smartpay_process_payment:e.smartpay_process_payment,smartpay_gateway:e.smartpay_gateway,smartpay_first_name:e.smartpay_form.name.first_name,smartpay_last_name:e.smartpay_form.name.last_name,smartpay_email:e.smartpay_form.email,smartpay_payment_mobile:e.smartpay_payment_mobile,smartpay_form_id:e.smartpay_form_id,smartpay_amount:e.smartpay_form_amount,smartpay_amount_key:e.smartpay_selected_amount_key,smartpay_form_data:e.smartpay_form,smartpay_is_custom_amount:e.smartpay_is_custom_payment,smartpay_form_billing_type:e.smartpay_form_billing_type},c===e.smartpay_form_billing_type&&{smartpay_form_billing_period:e.smartpay_form_billing_period})}($parentWrapper),s=(r=new SmartPayFormValidator(o,{smartpay_action:{required:!0,value:"smartpay_process_payment"},smartpay_process_payment:{required:!0},smartpay_gateway:{required:!0},smartpay_first_name:{required:!0},smartpay_last_name:{required:!0},smartpay_email:{required:!0,email:!0},smartpay_payment_mobile:{requiredWhen:["smartpay_gateway","toyyibpay"]},smartpay_payment_type:{required:!0}}).validate(),{valid:Object.values(r).every((function(t){return 0===t.length})),errors:r});$parentWrapper.find("input").removeClass("is-invalid"),$parentWrapper.find("#form-response").hide(),s.valid?(t(e.currentTarget).text("Processing...").attr("disabled",!0),jQuery.post(smartpay.ajaxUrl,{action:"smartpay_process_payment",data:o},(function(r){r?$parentWrapper.find("#payment-response").html(r).show():($parentWrapper.find("#payment-response").html('<p class="text-danger">Something wrong! Please try again later.</p>').show(),console.error("Something wrong!")),setTimeout((function(){t(e.currentTarget).text(a).attr("disabled",!1)}),500)}))):(!function(t,e){var r=t.parents(".smartpay-payment"),a=[];if(Object.entries(e.errors).forEach((function(t){var e=n(t,2),o=e[0],i=e[1];r.find('input[name="'+o+'"]').addClass("is-invalid");var s=JSUcfirst(o.split("_").slice(1).join(" "));a.push('\n                <div class="alert alert-danger">\n                    <p class="m-0 form-error-text">'.concat(s," ").concat(i[0],"</p>\n                </div>"))})),!a.length)return;t.html(a),t.show()}($parentWrapper.find(".smartpay-message-info"),s),$parentWrapper.find("#first_name").focus())})),t(document.body).on("click",".smartpay-form-shortcode button.open-form-modal",(function(e){e.preventDefault();var r=t(e.currentTarget).parents(".smartpay-form-shortcode").find(".form-modal");setTimeout((function(){r.modal("show"),t(".modal-backdrop").last().appendTo(t(e.currentTarget).closest(".smartpay"))}),500)})),t(".smartpay-coupon-form-toggle .smartpayshowcoupon").on("click",(function(e){t(this).parents(".smartpay-coupon-form-toggle").addClass("d-none"),t(".smartpay-coupon-form").removeClass("d-none"),e.preventDefault()})),t(".smartpay-coupon-form").on("submit",(function(n){var a=t(this).find("input[name=coupon_code]").val(),o=t(this).parents(".smartpay_form_builder_wrapper").find("#smartpay-payment-form input[name=smartpay_form_id]").val();t.ajax({method:"POST",url:smartpay.ajaxUrl,data:{action:"smartpay_coupon",couponCode:a,formId:o}}).done((function(n){if(n.success){t(".smartpay-message-info").append('<div class="alert alert-success">'.concat(n.data.message,"</div>")),e=n.data.couponData,r=n.data.currency,t("#smartpay-payment-form").addClass("coupon-applied"),t("#smartpay-payment-form").find(".form--fixed-amount").each((function(){var r=t(this).find("input[name=_form_amount]").attr("id");t(this).find("input[name=_form_amount]").val(e[r].discountAmount)}));var a=t("#smartpay-payment-form .form-amounts").find(".form--fixed-amount.selected input[name=_form_amount]").attr("id");t("#smartpay-payment-form input[name=smartpay_form_amount]").val(e[a].discountAmount),t(".discount-amounts-container").removeClass("d-none"),t(".discount-amounts-container").find(".subtotal-amount-value").html("".concat(r).concat(e[a].mainAmount)),t(".discount-amounts-container").find(".coupon-amount-name").html(n.data.couponCode),t(".discount-amounts-container").find(".coupon-amount-value").html("-".concat(r).concat(e[a].couponAmount)),t(".discount-amounts-container").find(".total-amount-value").html("".concat(r).concat(e[a].discountAmount))}n.success||t(".smartpay-message-info").append('<div class="alert alert-danger">'.concat(n.data.message,"</div>"))})),n.preventDefault()})),t(".smartpay-form-shortcode .form-amounts .form--fixed-amount").on("click",(function(){if(t("#smartpay-payment-form").hasClass("coupon-applied")){var n=t(this).find("input[name=_form_amount]").attr("id");t(".discount-amounts-container").find(".subtotal-amount-value").html("".concat(r).concat(e[n].mainAmount)),t(".discount-amounts-container").find(".coupon-amount-value").html("-".concat(r).concat(e[n].couponAmount)),t(".discount-amounts-container").find(".total-amount-value").html("".concat(r).concat(e[n].discountAmount))}})),t(".smartpay-coupon-form-close").on("click",(function(e){t(".smartpay-coupon-form").addClass("d-none"),t(".smartpay-coupon-form-toggle").removeClass("d-none"),e.preventDefault()}))}))},39:()=>{function t(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}(t,r)||function(t,r){if(!t)return;if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}jQuery((function(e){function r(t){t.find(".step-1").show(),t.find(".step-2").hide(),e(".back-to-first-step").hide()}function n(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={smartpay_action:"smartpay_process_payment",smartpay_process_payment:t.find('input[name="smartpay_process_payment"]').val()||null,smartpay_gateway:t.find('input[name="smartpay_gateway"]:checked').val()||null,smartpay_first_name:t.find('input[name="smartpay_first_name"]').val()||null,smartpay_last_name:t.find('input[name="smartpay_last_name"]').val()||null,smartpay_email:t.find('input[name="smartpay_email"]').val()||null,smartpay_payment_type:t.find('input[name="smartpay_payment_type"]').val()||null,smartpay_payment_mobile:t.find('input[name="smartpay_payment_mobile"]').val()||null};if("product_purchase"===n.smartpay_payment_type)n.smartpay_product_id=t.find('input[name="smartpay_product_id"]').val()||null,n.smartpay_product_price=t.find('input[name="smartpay_product_price"]').val()||null,n.smartpay_product_billing_type=t.find('input[name="smartpay_product_billing_type"]').val()||null,"Subscription"===n.smartpay_product_billing_type&&(n.smartpay_product_billing_period=t.find('input[name="smartpay_product_billing_period"]').val());else{n.smartpay_form_id=t.find('input[name="smartpay_form_id"]').val()||null,n.smartpay_amount=t.find('input[name="smartpay_form_amount"]').val()||null;var a={};t.find('.smartpay_form_builder_wrapper > form input[name^="smartpay_"]').length&&t.find('.smartpay_form_builder_wrapper > form input[name^="smartpay_"]').each((function(t,r){a[e(r).attr("name")]=e(r).val()})),n.smartpay_form_extra_data=a||{}}return r?n.index||null:n}e(document.body).on("click",".smartpay-product-shortcode .product-variations .variation",(function(t){e(t.currentTarget).parent().find(".variation").removeClass("selected"),e(t.currentTarget).addClass("selected");var r=e(t.currentTarget).find(".sale-price").data("price");e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_price"]').val(r);var n=e(t.currentTarget).find('input[name="_product_billing_type"]');if(e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_billing_type"]').val(n.val()),"Subscription"===n.val()){var a=e(t.currentTarget).find('input[name="_product_billing_period"]');e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_billing_period"]').val(a.val());var o=e(t.currentTarget).find('input[name="_product_additional_charge"]');e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_additional_charge"]').val(o.val())}var i=e(t.currentTarget).find('input[name="_smartpay_product_id"]');e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_id"]').val(i.val())})),e(document).ready((function(){var t=document.querySelector("#mobile-field");if(t){var r=e("input[name='smartpay_gateway']:checked").val(),n='<div class="form-group"><input type="number" placeholder="Mobile No" class="form-control" name="smartpay_payment_mobile"  id="smartpay_payment_mobile" required /></div>';"toyyibpay"===r&&(t.innerHTML=n),jQuery('input[name="smartpay_gateway"]').toArray().forEach((function(e){e.addEventListener("change",(function(){"toyyibpay"===e.value?t.innerHTML=n:t.innerHTML=""}))}))}})),e(document.body).on("click",".smartpay-product-shortcode button.open-product-modal",(function(t){t.preventDefault();var r=e(t.currentTarget).parents(".smartpay-product-shortcode").find(".product-modal");setTimeout((function(){r.modal("show"),e(".modal-backdrop").last().appendTo(e(t.currentTarget).closest(".smartpay"))}),500)})),e(document.body).on("click",".smartpay-payment button.open-payment-form",(function(t){t.preventDefault(),$parentWrapper=e(t.currentTarget).parents(".smartpay-payment");var a=$parentWrapper.find(".payment-modal"),o=n($parentWrapper),i=jQuery('input[name="smartpay_product_billing_type"]').val(),s=jQuery('input[name="smartpay_selected_currency_symbol"]').val(),c=e("#smartpay_additional_amount_id"),u=e("#smartpay_product_billing_type_id");if("Subscription"===i){var l=jQuery('input[name="smartpay_product_billing_period"]').val(),p='<div class="justify-content-center mb-2 mt-2">\n                    <p class="text-center text-muted font-weight-light">\n                        Enter your info to begin your\n                        <strong><span class="product_billing_type">'.concat(l,"</span></strong> subscription. You can cancel anytime.\n                    </p>\n                </div>");u.html(p);var d=e("input[name='smartpay_product_additional_charge']").val(),f='<div class="text-primary font-weight-bold text-center"><p>\n                        Additional charge '.concat(s+d,"  will be applied to the subscription.\n                    </p>\n                </div>");c&&c.html(f)}else{u.html('<div class="justify-content-center mb-2 mt-2">\n                <p class="text-center text-muted">Provide your information to complete your purchase.</p></div>'),c&&c.html("")}var m=0;"form_payment"===o.smartpay_payment_type?m=e("#smartpay_currency_symbol").data("value")+o.smartpay_amount:m=o.smartpay_product_price;a.find(".amount").html(s+m),r(a);var y=e(t.currentTarget).text();e(t.currentTarget).text("Processing...").attr("disabled","disabled"),setTimeout((function(){a.modal("show"),o.smartpay_first_name&&a.find('input[name="smartpay_first_name"]').val(o.smartpay_first_name),o.smartpay_last_name&&a.find('input[name="smartpay_last_name"]').val(o.smartpay_last_name),o.smartpay_email&&a.find('input[name="smartpay_email"]').val(o.smartpay_email),e(".modal-backdrop").last().appendTo(e(t.currentTarget).closest(".smartpay-payment")),e(t.currentTarget).text(y).removeAttr("disabled")}),500)})),e(document.body).on("click",".smartpay-payment button.back-to-first-step",(function(t){t.preventDefault(),r(e(t.currentTarget).parents(".smartpay-payment").find(".payment-modal"))})),e(document.body).on("click",".smartpay-payment button.smartpay-pay-now",(function(r){r.preventDefault(),$parentWrapper=e(r.currentTarget).parents(".smartpay-payment");var a=e(r.currentTarget).text(),o=e(r.currentTarget).parents(".step-1"),i=e(r.currentTarget).parents(".modal-content").children(".step-2");e(r.currentTarget).text("Processing...").attr("disabled","disabled"),$parentWrapper.find(".modal-loading").css("display","flex");var s=n($parentWrapper),c=function(t){var e=new SmartPayFormValidator(t,{smartpay_action:{required:!0,value:"smartpay_process_payment"},smartpay_process_payment:{required:!0},smartpay_gateway:{required:!0},smartpay_first_name:{required:!0},smartpay_last_name:{required:!0},smartpay_payment_mobile:{requiredWhen:["smartpay_gateway","toyyibpay"]},smartpay_email:{required:!0,email:!0},smartpay_payment_type:{required:!0}}).validate();return{valid:Object.values(e).every((function(t){return 0===t.length})),errors:e}}(s);if($parentWrapper.find("input").removeClass("is-invalid"),o.find(".payment-modal--errors").hide(),c.valid){var u={action:"smartpay_process_payment",data:s};jQuery.post(smartpay.ajaxUrl,u,(function(t){i.css("display","flex"),e(".back-to-first-step").show(),o.hide(),setTimeout((function(){t?i.find(".dynamic-content").html(t):i.find(".dynamic-content").html('<p class="text-danger">Something wrong!</p>'),$parentWrapper.find(".modal-loading").css("display","none")}),300)}))}else!function(e,r){var n=e.parents(".smartpay-payment"),a=[];if(Object.entries(r.errors).forEach((function(e){var r=t(e,2),o=r[0],i=r[1];n.find('input[name="'+o+'"]').addClass("is-invalid");var s=JSUcfirst(o.split("_").slice(1).join(" "));a.push('\n                <div class="alert alert-danger">\n                    <p class="m-0 form-error-text">'.concat(s," ").concat(i[0],"</p>\n                </div>"))})),!a.length)return;e.show(),e.html(a)}(o.find(".payment-modal--errors"),c),setTimeout((function(){$parentWrapper.find(".modal-loading").css("display","none")}),300);e(r.currentTarget).text(a).removeAttr("disabled")})),e(document.body).on("click",".smartpay-payment button.modal-close",(function(t){e(t.currentTarget).parents(".smartpay-payment").find(".payment-modal").modal("hide")})),e(document.body).on("show.bs.modal",".payment-modal",(function(t){document.body.style.overflow="hidden"})),e(document.body).on("hidden.bs.modal",".payment-modal",(function(t){document.body.style.overflow="auto"})),e(".smartpay-product-coupon-form-toggle .smartpayshowcoupon").on("click",(function(){return e(".smartpay-product-coupon-form").toggleClass("d-none"),!1})),e(".smartpay-product-coupon-form").on("submit",(function(t){var r=e(this).find("input[name=coupon_code]").val(),n=e(this).parents(".smartpay-product-shortcode").find("input[name=smartpay_product_id]").val(),a=e(this).parents(".smartpay-product-shortcode").find("input[name=smartpay_product_price]").val();e.ajax({method:"POST",url:smartpay.ajaxUrl,data:{action:"smartpay_product_coupon",couponCode:r,productID:n,productPrice:a}}).done((function(t){if(t.success){var r=e(".discount-amounts-container"),n=e(".payment-modal--errors");e(".payment-modal--errors .alert").hide(),n.append('<div class="alert alert-success">'.concat(t.data.message,"</div>")),n.show(),$couponData=t.data.couponData,$currency=t.data.currency,r.find(".subtotal-amount-value").html("".concat($currency).concat($couponData.mainAmount)),r.find(".coupon-amount-name").html(t.data.couponCode),r.find(".coupon-amount-value").html("-".concat($currency).concat($couponData.couponAmount)),r.find(".total-amount-value").html("".concat($currency).concat($couponData.discountAmount)),r.find("input[name=smartpay_product_price]").val("".concat($couponData.discountAmount)),r.find(".payment-modal--title").html("".concat($couponData.discountAmount)),r.removeClass("d-none")}if(!t.success){var a=e(".payment-modal--errors");e(".payment-modal--errors .alert").hide(),a.append('<div class="alert alert-danger">'.concat(t.data.message,"</div>")),a.show()}})),t.preventDefault()}))}))},400:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ONE_TIME:()=>a,PAYMENT_STATUS_ABANDONED:()=>l,PAYMENT_STATUS_COMPLETED:()=>s,PAYMENT_STATUS_FAILED:()=>u,PAYMENT_STATUS_PENDING:()=>i,PAYMENT_STATUS_PROCESSING:()=>d,PAYMENT_STATUS_REFUNDED:()=>c,PAYMENT_STATUS_REVOKED:()=>p,SUBSCRIPTION:()=>o,productDefaultData:()=>f,variationDefaultData:()=>m});var n=r(304),a="One Time",o="Subscription",i="Pending",s="Completed",c="Refunded",u="Failed",l="Abandoned",p="Revoked",d="Processing",f={title:"",covers:[],description:"",variations:[],base_price:"",sale_price:"",files:[],settings:{payButtonLabel:(0,n.__)("Pay Now","smartpay"),label:(0,n.__)("Just Label checking","smartpay"),externalLink:{allowExternalLink:!1,label:(0,n.__)("Link Label","smartpay"),link:""}},extra:{}},m={title:"",description:"",base_price:"",sale_price:"",files:[],key:"",extra:{billing_type:a}}},470:()=>{},347:()=>{},737:()=>{},588:t=>{t.exports=function(t,e){var r,n,a=0;function o(){var o,i,s=r,c=arguments.length;t:for(;s;){if(s.args.length===arguments.length){for(i=0;i<c;i++)if(s.args[i]!==arguments[i]){s=s.next;continue t}return s!==r&&(s===n&&(n=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=r,s.prev=null,r.prev=s,r=s),s.val}s=s.next}for(o=new Array(c),i=0;i<c;i++)o[i]=arguments[i];return s={args:o,val:t.apply(null,o)},r?(r.prev=s,s.next=r):n=s,a===e.maxSize?(n=n.prev).next=null:a++,r=s,s.val}return e=e||{},o.clear=function(){r=null,n=null,a=0},o}},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof h?e:h,o=Object.create(a.prototype),i=new k(n||[]);return o._invoke=function(t,e,r){var n=p;return function(a,o){if(n===f)throw new Error("Generator is already running");if(n===m){if("throw"===a)throw o;return E()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var s=A(i,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===p)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var c=l(t,e,r);if("normal"===c.type){if(n=r.done?m:d,c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=m,r.method="throw",r.arg=c.arg)}}}(t,r,i),o}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",f="executing",m="completed",y={};function h(){}function v(){}function g(){}var _={};c(_,o,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(S([])));w&&w!==r&&n.call(w,o)&&(_=w);var O=g.prototype=h.prototype=Object.create(_);function j(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(a,o,i,s){var c=l(t[a],t,o);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==typeof p&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,i,s)}),(function(t){r("throw",t,i,s)})):e.resolve(p).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,s)}))}s(c.arg)}var a;this._invoke=function(t,n){function o(){return new e((function(e,a){r(t,n,e,a)}))}return a=a?a.then(o,o):o()}}function A(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,A(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var a=l(n,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var o=a.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function S(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(n.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:E}}function E(){return{value:e,done:!0}}return v.prototype=g,c(O,"constructor",g),c(g,"constructor",v),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(O),t},t.awrap=function(t){return{__await:t}},j(x.prototype),c(x.prototype,i,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,a,o){void 0===o&&(o=Promise);var i=new x(u(e,r,n,a),o);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},j(O),c(O,s,"Generator"),c(O,o,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function a(n,a){return s.type="throw",s.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;T(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:S(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},975:(t,e,r)=>{var n;!function(){"use strict";var a={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(t){return s(u(t),arguments)}function i(t,e){return o.apply(null,[t].concat(e||[]))}function s(t,e){var r,n,i,s,c,u,l,p,d,f=1,m=t.length,y="";for(n=0;n<m;n++)if("string"==typeof t[n])y+=t[n];else if("object"==typeof t[n]){if((s=t[n]).keys)for(r=e[f],i=0;i<s.keys.length;i++){if(null==r)throw new Error(o('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[i],s.keys[i-1]));r=r[s.keys[i]]}else r=s.param_no?e[s.param_no]:e[f++];if(a.not_type.test(s.type)&&a.not_primitive.test(s.type)&&r instanceof Function&&(r=r()),a.numeric_arg.test(s.type)&&"number"!=typeof r&&isNaN(r))throw new TypeError(o("[sprintf] expecting number but found %T",r));switch(a.number.test(s.type)&&(p=r>=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}a.json.test(s.type)?y+=r:(!a.number.test(s.type)||p&&!s.sign?d="":(d=p?"+":"-",r=r.toString().replace(a.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",l=s.width-(d+r).length,c=s.width&&l>0?u.repeat(l):"",y+=s.align?d+r+c:"0"===u?d+c+r:c+d+r)}return y}var c=Object.create(null);function u(t){if(c[t])return c[t];for(var e,r=t,n=[],o=0;r;){if(null!==(e=a.text.exec(r)))n.push(e[0]);else if(null!==(e=a.modulo.exec(r)))n.push("%");else{if(null===(e=a.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var i=[],s=e[2],u=[];if(null===(u=a.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(i.push(u[1]);""!==(s=s.substring(u[0].length));)if(null!==(u=a.key_access.exec(s)))i.push(u[1]);else{if(null===(u=a.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");i.push(u[1])}e[2]=i}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return c[t]=n}o,i,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=i,void 0===(n=function(){return{sprintf:o,vsprintf:i}}.call(e,r,e,t))||(t.exports=n))}()},22:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(680),a={contextDelimiter:"",onMissingKey:null};function o(t,e){var r;for(r in this.data=t,this.pluralForms={},this.options={},a)this.options[r]=void 0!==e&&r in e?e[r]:a[r]}o.prototype.getPluralForm=function(t,e){var r,a,o,i=this.pluralForms[t];return i||("function"!=typeof(o=(r=this.data[t][""])["Plural-Forms"]||r["plural-forms"]||r.plural_forms)&&(a=function(t){var e,r,n;for(e=t.split(";"),r=0;r<e.length;r++)if(0===(n=e[r].trim()).indexOf("plural="))return n.substr(7)}(r["Plural-Forms"]||r["plural-forms"]||r.plural_forms),o=(0,n.Z)(a)),i=this.pluralForms[t]=o),i(e)},o.prototype.dcnpgettext=function(t,e,r,n,a){var o,i,s;return o=void 0===a?0:this.getPluralForm(t,a),i=r,e&&(i=e+this.options.contextDelimiter+r),(s=this.data[t][i])&&s[o]?s[o]:(this.options.onMissingKey&&this.options.onMissingKey(r,t),0===o?r:n)}}},r={};function n(t){var a=r[t];if(void 0!==a)return a.exports;var o=r[t]={exports:{}};return e[t](o,o.exports,n),o.exports}n.m=e,t=[],n.O=(e,r,a,o)=>{if(!r){var i=1/0;for(l=0;l<t.length;l++){for(var[r,a,o]=t[l],s=!0,c=0;c<r.length;c++)(!1&o||i>=o)&&Object.keys(n.O).every((t=>n.O[t](r[c])))?r.splice(c--,1):(s=!1,o<i&&(i=o));if(s){t.splice(l--,1);var u=a();void 0!==u&&(e=u)}}return e}o=o||0;for(var l=t.length;l>0&&t[l-1][2]>o;l--)t[l]=t[l-1];t[l]=[r,a,o]},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={177:0,47:0,122:0,879:0};n.O.j=e=>0===t[e];var e=(e,r)=>{var a,o,[i,s,c]=r,u=0;if(i.some((e=>0!==t[e]))){for(a in s)n.o(s,a)&&(n.m[a]=s[a]);if(c)var l=c(n)}for(e&&e(r);u<i.length;u++)o=i[u],n.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return n.O(l)},r=self.webpackChunkwp_smartpay=self.webpackChunkwp_smartpay||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})(),n.O(void 0,[47,122,879],(()=>n(359))),n.O(void 0,[47,122,879],(()=>n(470))),n.O(void 0,[47,122,879],(()=>n(347)));var a=n.O(void 0,[47,122,879],(()=>n(737)));a=n.O(a)})();
     1(()=>{var t,e={757:(t,e,r)=>{t.exports=r(666)},974:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(141),a=r(192);function o(t){var e=(0,n.Z)(t);return function(t){return(0,a.Z)(e,t)}}},192:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var n={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,r){if(t)throw e;return r}};function a(t,e){var r,a,o,i,s,c,u=[];for(r=0;r<t.length;r++){if(s=t[r],i=n[s]){for(a=i.length,o=Array(a);a--;)o[a]=u.pop();try{c=i.apply(null,o)}catch(t){return t}}else c=e.hasOwnProperty(s)?e[s]:+s;u.push(c)}return u[0]}},680:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var n=r(974);function a(t){var e=(0,n.Z)(t);return function(t){return+e({n:t})}}},141:(t,e,r)=>{"use strict";var n,a,o,i;function s(t){for(var e,r,s,c,u=[],l=[];e=t.match(i);){for(r=e[0],(s=t.substr(0,e.index).trim())&&u.push(s);c=l.pop();){if(o[r]){if(o[r][0]===c){r=o[r][1]||r;break}}else if(a.indexOf(c)>=0||n[c]<n[r]){l.push(c);break}u.push(c)}o[r]||l.push(r),t=t.substr(e.index+r.length)}return(t=t.trim())&&u.push(t),u.concat(l.reverse())}r.d(e,{Z:()=>s}),n={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},a=["(","?"],o={")":["("],":":["?","?:"]},i=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/},247:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(103),a=r(755);const o=function(t,e){return function(r,o,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;const c=t[e];if(!(0,a.Z)(r))return;if(!(0,n.Z)(o))return;if("function"!=typeof i)return void console.error("The hook callback must be a function.");if("number"!=typeof s)return void console.error("If specified, the hook priority must be a number.");const u={callback:i,priority:s,namespace:o};if(c[r]){const t=c[r].handlers;let e;for(e=t.length;e>0&&!(s>=t[e-1].priority);e--);e===t.length?t[e]=u:t.splice(e,0,u),c.__current.forEach((t=>{t.name===r&&t.currentIndex>=e&&t.currentIndex++}))}else c[r]={handlers:[u],runs:0};"hookAdded"!==r&&t.doAction("hookAdded",r,o,i,s)}}},992:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){return function(){var r,n;const a=t[e];return null!==(r=null===(n=a.__current[a.__current.length-1])||void 0===n?void 0:n.name)&&void 0!==r?r:null}}},972:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var n=r(755);const a=function(t,e){return function(r){const a=t[e];if((0,n.Z)(r))return a[r]&&a[r].runs?a[r].runs:0}}},786:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){return function(r){const n=t[e];return void 0===r?void 0!==n.__current[0]:!!n.__current[0]&&r===n.__current[0].name}}},642:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){return function(r,n){const a=t[e];return void 0!==n?r in a&&a[r].handlers.some((t=>t.namespace===n)):r in a}}},19:(t,e,r)=>{"use strict";r.d(e,{Z:()=>p});var n=r(247),a=r(99),o=r(642),i=r(424),s=r(992),c=r(786),u=r(972);class l{constructor(){this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=(0,n.Z)(this,"actions"),this.addFilter=(0,n.Z)(this,"filters"),this.removeAction=(0,a.Z)(this,"actions"),this.removeFilter=(0,a.Z)(this,"filters"),this.hasAction=(0,o.Z)(this,"actions"),this.hasFilter=(0,o.Z)(this,"filters"),this.removeAllActions=(0,a.Z)(this,"actions",!0),this.removeAllFilters=(0,a.Z)(this,"filters",!0),this.doAction=(0,i.Z)(this,"actions"),this.applyFilters=(0,i.Z)(this,"filters",!0),this.currentAction=(0,s.Z)(this,"actions"),this.currentFilter=(0,s.Z)(this,"filters"),this.doingAction=(0,c.Z)(this,"actions"),this.doingFilter=(0,c.Z)(this,"filters"),this.didAction=(0,u.Z)(this,"actions"),this.didFilter=(0,u.Z)(this,"filters")}}const p=function(){return new l}},99:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(103),a=r(755);const o=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(o,i){const s=t[e];if(!(0,a.Z)(o))return;if(!r&&!(0,n.Z)(i))return;if(!s[o])return 0;let c=0;if(r)c=s[o].handlers.length,s[o]={runs:s[o].runs,handlers:[]};else{const t=s[o].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===i&&(t.splice(e,1),c++,s.__current.forEach((t=>{t.name===o&&t.currentIndex>=e&&t.currentIndex--})))}return"hookRemoved"!==o&&t.doAction("hookRemoved",o,i),c}}},424:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n){const a=t[e];a[n]||(a[n]={handlers:[],runs:0}),a[n].runs++;const o=a[n].handlers;for(var i=arguments.length,s=new Array(i>1?i-1:0),c=1;c<i;c++)s[c-1]=arguments[c];if(!o||!o.length)return r?s[0]:void 0;const u={name:n,currentIndex:0};for(a.__current.push(u);u.currentIndex<o.length;){const t=o[u.currentIndex].callback.apply(null,s);r&&(s[0]=t),u.currentIndex++}return a.__current.pop(),r?s[0]:void 0}}},957:(t,e,r)=>{"use strict";r.d(e,{JQ:()=>n});const n=(0,r(19).Z)(),{addAction:a,addFilter:o,removeAction:i,removeFilter:s,hasAction:c,hasFilter:u,removeAllActions:l,removeAllFilters:p,doAction:d,applyFilters:f,currentAction:m,currentFilter:y,doingAction:h,doingFilter:v,didAction:g,didFilter:_,actions:b,filters:w}=n},755:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}},103:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}},16:(t,e,r)=>{"use strict";r.d(e,{o:()=>i});var n=r(22);const a={plural_forms:t=>1===t?0:1},o=/^i18n\.(n?gettext|has_translation)(_|$)/,i=(t,e,r)=>{const i=new n.Z({}),s=new Set,c=()=>{s.forEach((t=>t()))},u=function(t){var e;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";i.data[r]={...i.data[r],...t},i.data[r][""]={...a,...null===(e=i.data[r])||void 0===e?void 0:e[""]},delete i.pluralForms[r]},l=(t,e)=>{u(t,e),c()},p=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;return i.data[t]||u(void 0,t),i.dcnpgettext(t,e,r,n,a)},d=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return t},f=(t,e,n)=>{let a=p(n,e,t);return r?(a=r.applyFilters("i18n.gettext_with_context",a,t,e,n),r.applyFilters("i18n.gettext_with_context_"+d(n),a,t,e,n)):a};if(t&&l(t,e),r){const t=t=>{o.test(t)&&c()};r.addAction("hookAdded","core/i18n",t),r.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return i.data[t]},setLocaleData:l,addLocaleData:function(t){var e;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";i.data[r]={...i.data[r],...t,"":{...a,...null===(e=i.data[r])||void 0===e?void 0:e[""],...null==t?void 0:t[""]}},delete i.pluralForms[r],c()},resetLocaleData:(t,e)=>{i.data={},i.pluralForms={},l(t,e)},subscribe:t=>(s.add(t),()=>s.delete(t)),__:(t,e)=>{let n=p(e,void 0,t);return r?(n=r.applyFilters("i18n.gettext",n,t,e),r.applyFilters("i18n.gettext_"+d(e),n,t,e)):n},_x:f,_n:(t,e,n,a)=>{let o=p(a,void 0,t,e,n);return r?(o=r.applyFilters("i18n.ngettext",o,t,e,n,a),r.applyFilters("i18n.ngettext_"+d(a),o,t,e,n,a)):o},_nx:(t,e,n,a,o)=>{let i=p(o,a,t,e,n);return r?(i=r.applyFilters("i18n.ngettext_with_context",i,t,e,n,a,o),r.applyFilters("i18n.ngettext_with_context_"+d(o),i,t,e,n,a,o)):i},isRTL:()=>"rtl"===f("ltr","text direction"),hasTranslation:(t,e,n)=>{var a,o;const s=e?e+""+t:t;let c=!(null===(a=i.data)||void 0===a||null===(o=a[null!=n?n:"default"])||void 0===o||!o[s]);return r&&(c=r.applyFilters("i18n.has_translation",c,t,e,n),c=r.applyFilters("i18n.has_translation_"+d(n),c,t,e,n)),c}}}},836:(t,e,r)=>{"use strict";r.d(e,{__:()=>i});var n=r(16),a=r(957);const o=(0,n.o)(void 0,void 0,a.JQ);o.getLocaleData.bind(o),o.setLocaleData.bind(o),o.resetLocaleData.bind(o),o.subscribe.bind(o);const i=o.__.bind(o);o._x.bind(o),o._n.bind(o),o._nx.bind(o),o.isRTL.bind(o),o.hasTranslation.bind(o)},304:(t,e,r)=>{"use strict";r.d(e,{__:()=>n.__});r(917),r(16);var n=r(836)},917:(t,e,r)=>{"use strict";var n=r(588),a=r.n(n);r(975);a()(console.error)},359:(t,e,r)=>{"use strict";r(39),r(869);function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){if(null==t)return{};var r,n,a=function(t,e){if(null==t)return{};var r,n,a={},o=Object.keys(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||(a[r]=t[r]);return a}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}var o=r(588),i=r.n(o);r(975),i()(console.error);var s=r(22);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l={"":{plural_forms:function(t){return 1===t?0:1}}},p=/^i18n\.(n?gettext|has_translation)(_|$)/;const d=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};const f=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};const m=function(t,e){return function(r,n,a){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=t[e];if(f(r)&&d(n))if("function"==typeof a)if("number"==typeof o){var s={callback:a,priority:o,namespace:n};if(i[r]){var c,u=i[r].handlers;for(c=u.length;c>0&&!(o>=u[c-1].priority);c--);c===u.length?u[c]=s:u.splice(c,0,s),i.__current.forEach((function(t){t.name===r&&t.currentIndex>=c&&t.currentIndex++}))}else i[r]={handlers:[s],runs:0};"hookAdded"!==r&&t.doAction("hookAdded",r,n,a,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};const y=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n,a){var o=t[e];if(f(n)&&(r||d(a))){if(!o[n])return 0;var i=0;if(r)i=o[n].handlers.length,o[n]={runs:o[n].runs,handlers:[]};else for(var s=o[n].handlers,c=function(t){s[t].namespace===a&&(s.splice(t,1),i++,o.__current.forEach((function(e){e.name===n&&e.currentIndex>=t&&e.currentIndex--})))},u=s.length-1;u>=0;u--)c(u);return"hookRemoved"!==n&&t.doAction("hookRemoved",n,a),i}}};const h=function(t,e){return function(r,n){var a=t[e];return void 0!==n?r in a&&a[r].handlers.some((function(t){return t.namespace===n})):r in a}};const v=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n){var a=t[e];a[n]||(a[n]={handlers:[],runs:0}),a[n].runs++;var o=a[n].handlers;for(var i=arguments.length,s=new Array(i>1?i-1:0),c=1;c<i;c++)s[c-1]=arguments[c];if(!o||!o.length)return r?s[0]:void 0;var u={name:n,currentIndex:0};for(a.__current.push(u);u.currentIndex<o.length;){var l=o[u.currentIndex],p=l.callback.apply(null,s);r&&(s[0]=p),u.currentIndex++}return a.__current.pop(),r?s[0]:void 0}};const g=function(t,e){return function(){var r,n,a=t[e];return null!==(r=null===(n=a.__current[a.__current.length-1])||void 0===n?void 0:n.name)&&void 0!==r?r:null}};const _=function(t,e){return function(r){var n=t[e];return void 0===r?void 0!==n.__current[0]:!!n.__current[0]&&r===n.__current[0].name}};const b=function(t,e){return function(r){var n=t[e];if(f(r))return n[r]&&n[r].runs?n[r].runs:0}};var w=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=m(this,"actions"),this.addFilter=m(this,"filters"),this.removeAction=y(this,"actions"),this.removeFilter=y(this,"filters"),this.hasAction=h(this,"actions"),this.hasFilter=h(this,"filters"),this.removeAllActions=y(this,"actions",!0),this.removeAllFilters=y(this,"filters",!0),this.doAction=v(this,"actions"),this.applyFilters=v(this,"filters",!0),this.currentAction=g(this,"actions"),this.currentFilter=g(this,"filters"),this.doingAction=_(this,"actions"),this.doingFilter=_(this,"filters"),this.didAction=b(this,"actions"),this.didFilter=b(this,"filters")};var O=function(){return new w}(),j=(O.addAction,O.addFilter,O.removeAction,O.removeFilter,O.hasAction,O.hasFilter,O.removeAllActions,O.removeAllFilters,O.doAction,O.applyFilters,O.currentAction,O.currentFilter,O.doingAction,O.doingFilter,O.didAction,O.didFilter,O.actions,O.filters,function(t,e,r){var n=new s.Z({}),a=new Set,o=function(){a.forEach((function(t){return t()}))},i=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";n.data[e]=u(u(u({},l),n.data[e]),t),n.data[e][""]=u(u({},l[""]),n.data[e][""])},c=function(t,e){i(t,e),o()},d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return n.data[t]||i(void 0,t),n.dcnpgettext(t,e,r,a,o)},f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return t},m=function(t,e,n){var a=d(n,e,t);return r?(a=r.applyFilters("i18n.gettext_with_context",a,t,e,n),r.applyFilters("i18n.gettext_with_context_"+f(n),a,t,e,n)):a};if(t&&c(t,e),r){var y=function(t){p.test(t)&&o()};r.addAction("hookAdded","core/i18n",y),r.addAction("hookRemoved","core/i18n",y)}return{getLocaleData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return n.data[t]},setLocaleData:c,resetLocaleData:function(t,e){n.data={},n.pluralForms={},c(t,e)},subscribe:function(t){return a.add(t),function(){return a.delete(t)}},__:function(t,e){var n=d(e,void 0,t);return r?(n=r.applyFilters("i18n.gettext",n,t,e),r.applyFilters("i18n.gettext_"+f(e),n,t,e)):n},_x:m,_n:function(t,e,n,a){var o=d(a,void 0,t,e,n);return r?(o=r.applyFilters("i18n.ngettext",o,t,e,n,a),r.applyFilters("i18n.ngettext_"+f(a),o,t,e,n,a)):o},_nx:function(t,e,n,a,o){var i=d(o,a,t,e,n);return r?(i=r.applyFilters("i18n.ngettext_with_context",i,t,e,n,a,o),r.applyFilters("i18n.ngettext_with_context_"+f(o),i,t,e,n,a,o)):i},isRTL:function(){return"rtl"===m("ltr","text direction")},hasTranslation:function(t,e,a){var o,i,s=e?e+""+t:t,c=!(null===(o=n.data)||void 0===o||null===(i=o[null!=a?a:"default"])||void 0===i||!i[s]);return r&&(c=r.applyFilters("i18n.has_translation",c,t,e,a),c=r.applyFilters("i18n.has_translation_"+f(a),c,t,e,a)),c}}}(void 0,void 0,O));j.getLocaleData.bind(j),j.setLocaleData.bind(j),j.resetLocaleData.bind(j),j.subscribe.bind(j);var x=j.__.bind(j);j._x.bind(j),j._n.bind(j),j._nx.bind(j),j.isRTL.bind(j),j.hasTranslation.bind(j);function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const T=function(t){var e=function t(e,r){var n=e.headers,a=void 0===n?{}:n;for(var o in a)if("x-wp-nonce"===o.toLowerCase()&&a[o]===t.nonce)return r(e);return r(P(P({},e),{},{headers:P(P({},a),{},{"X-WP-Nonce":t.nonce})}))};return e.nonce=t,e};function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const E=function(t,e){var r,n,a=t.path;return"string"==typeof t.namespace&&"string"==typeof t.endpoint&&(r=t.namespace.replace(/^\/|\/$/g,""),a=(n=t.endpoint.replace(/^\//,""))?r+"/"+n:r),delete t.namespace,delete t.endpoint,e(S(S({},t),{},{path:a}))};function D(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function F(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?D(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const L=function(t){return function(e,r){return E(e,(function(e){var n,a=e.url,o=e.path;return"string"==typeof o&&(n=t,-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(o=o.replace("?","&")),a=n+o),r(F(F({},e),{},{url:a}))}))}};function I(t){var e=t.split("?"),r=e[1],n=e[0];return r?n+"?"+r.split("&").map((function(t){return t.split("=")})).sort((function(t,e){return t[0].localeCompare(e[0])})).map((function(t){return t.join("=")})).join("&"):n}const Z=function(t){var e=Object.keys(t).reduce((function(e,r){return e[I(r)]=t[r],e}),{});return function(t,r){var n=t.parse,a=void 0===n||n;if("string"==typeof t.path){var o=t.method||"GET",i=I(t.path);if("GET"===o&&e[i]){var s=e[i];return delete e[i],Promise.resolve(a?s.body:new window.Response(JSON.stringify(s.body),{status:200,statusText:"OK",headers:s.headers}))}if("OPTIONS"===o&&e[o]&&e[o][i])return Promise.resolve(e[o][i])}return r(t)}};function C(t,e,r,n,a,o,i){try{var s=t[o](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,a)}var N=r(757),M=r.n(N);function $(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function U(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return $(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function q(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?R(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function W(t){return(function(t){var e;try{e=new URL(t,"http://example.com").search.substring(1)}catch(t){}if(e)return e}(t)||"").replace(/\+/g,"%20").split("&").reduce((function(t,e){var r=U(e.split("=").filter(Boolean).map(decodeURIComponent),2),n=r[0],a=r[1],o=void 0===a?"":a;n&&function(t,e,r){for(var n=e.length,a=n-1,o=0;o<n;o++){var i=e[o];!i&&Array.isArray(t)&&(i=t.length.toString());var s=!isNaN(Number(e[o+1]));t[i]=o===a?r:t[i]||(s?[]:{}),Array.isArray(t[i])&&!s&&(t[i]=q({},t[i])),t=t[i]}}(t,n.replace(/\]/g,"").split("["),o);return t}),{})}function z(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Q(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Q(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return i=t.done,t},e:function(t){s=!0,o=t},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw o}}}}function Q(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function G(t){for(var e,r="",n=Object.entries(t);e=n.shift();){var a=U(e,2),o=a[0],i=a[1];if(Array.isArray(i)||i&&i.constructor===Object){var s,c=z(Object.entries(i).reverse());try{for(c.s();!(s=c.n()).done;){var u=U(s.value,2),l=u[0],p=u[1];n.unshift(["".concat(o,"[").concat(l,"]"),p])}}catch(t){c.e(t)}finally{c.f()}}else void 0!==i&&(null===i&&(i=""),r+="&"+[o,i].map(encodeURIComponent).join("="))}return r.substr(1)}function J(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;if(!e||!Object.keys(e).length)return t;var r=t,n=t.indexOf("?");return-1!==n&&(e=Object.assign(W(t),e),r=r.substr(0,n)),r+"?"+G(e)}function Y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function H(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Y(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var V=function(t){return t.json?t.json():Promise.reject(t)},X=function(t){return function(t){if(!t)return{};var e=t.match(/<([^>]+)>; rel="next"/);return e?{next:e[1]}:{}}(t.headers.get("link")).next},B=function(t){var e=!!t.path&&-1!==t.path.indexOf("per_page=-1"),r=!!t.url&&-1!==t.url.indexOf("per_page=-1");return e||r};const K=function(){var t,e=(t=M().mark((function t(e,r){var n,o,i,s,c,u;return M().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1!==e.parse){t.next=2;break}return t.abrupt("return",r(e));case 2:if(B(e)){t.next=4;break}return t.abrupt("return",r(e));case 4:return t.next=6,_t(H(H({},(l=e,p={per_page:100},d=void 0,f=void 0,d=l.path,f=l.url,H(H({},a(l,["path","url"])),{},{url:f&&J(f,p),path:d&&J(d,p)}))),{},{parse:!1}));case 6:return n=t.sent,t.next=9,V(n);case 9:if(o=t.sent,Array.isArray(o)){t.next=12;break}return t.abrupt("return",o);case 12:if(i=X(n)){t.next=15;break}return t.abrupt("return",o);case 15:s=[].concat(o);case 16:if(!i){t.next=27;break}return t.next=19,_t(H(H({},e),{},{path:void 0,url:i,parse:!1}));case 19:return c=t.sent,t.next=22,V(c);case 22:u=t.sent,s=s.concat(u),i=X(c),t.next=16;break;case 27:return t.abrupt("return",s);case 28:case"end":return t.stop()}var l,p,d,f}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){C(o,n,a,i,s,"next",t)}function s(t){C(o,n,a,i,s,"throw",t)}i(void 0)}))});return function(t,r){return e.apply(this,arguments)}}();function tt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function et(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?tt(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var rt=new Set(["PATCH","PUT","DELETE"]);function nt(t,e){return void 0!==function(t,e){return W(t)[e]}(t,e)}var at=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e?204===t.status?null:t.json?t.json():Promise.reject(t):t},ot=function(t){var e={code:"invalid_json",message:x("The response is not a valid JSON response.")};if(!t||!t.json)throw e;return t.json().catch((function(){throw e}))},it=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(at(t,e)).catch((function(t){return st(t,e)}))};function st(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)throw t;return ot(t).then((function(t){var e={code:"unknown_error",message:x("An unknown error occurred.")};throw t||e}))}function ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ut(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ct(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ct(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const lt=function(t,e){if(!(t.path&&-1!==t.path.indexOf("/wp/v2/media")||t.url&&-1!==t.url.indexOf("/wp/v2/media")))return e(t);var r=0,n=function t(n){return r++,e({path:"/wp/v2/media/".concat(n,"/post-process"),method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((function(){return r<5?t(n):(e({path:"/wp/v2/media/".concat(n,"?force=true"),method:"DELETE"}),Promise.reject())}))};return e(ut(ut({},t),{},{parse:!1})).catch((function(e){var r=e.headers.get("x-wp-upload-attachment-id");return e.status>=500&&e.status<600&&r?n(r).catch((function(){return!1!==t.parse?Promise.reject({code:"post_process",message:x("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(e)})):st(e,t.parse)})).then((function(e){return it(e,t.parse)}))};function pt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var ft={Accept:"application/json, */*;q=0.1"},mt={credentials:"include"},yt=[function(t,e){return"string"!=typeof t.url||nt(t.url,"_locale")||(t.url=J(t.url,{_locale:"user"})),"string"!=typeof t.path||nt(t.path,"_locale")||(t.path=J(t.path,{_locale:"user"})),e(t)},E,function(t,e){var r=t.method,n=void 0===r?"GET":r;return rt.has(n.toUpperCase())&&(t=et(et({},t),{},{headers:et(et({},t.headers),{},{"X-HTTP-Method-Override":n,"Content-Type":"application/json"}),method:"POST"})),e(t)},K];var ht=function(t){if(t.status>=200&&t.status<300)return t;throw t},vt=function(t){var e=t.url,r=t.path,n=t.data,o=t.parse,i=void 0===o||o,s=a(t,["url","path","data","parse"]),c=t.body,u=t.headers;return u=dt(dt({},ft),u),n&&(c=JSON.stringify(n),u["Content-Type"]="application/json"),window.fetch(e||r||window.location.href,dt(dt(dt({},mt),s),{},{body:c,headers:u})).then((function(t){return Promise.resolve(t).then(ht).catch((function(t){return st(t,i)})).then((function(t){return it(t,i)}))}),(function(){throw{code:"fetch_error",message:x("You are probably offline.")}}))};function gt(t){return yt.reduceRight((function(t,e){return function(r){return e(r,t)}}),vt)(t).catch((function(e){return"rest_cookie_invalid_nonce"!==e.code?Promise.reject(e):window.fetch(gt.nonceEndpoint).then(ht).then((function(t){return t.text()})).then((function(e){return gt.nonceMiddleware.nonce=e,gt(t)}))}))}gt.use=function(t){yt.unshift(t)},gt.setFetchHandler=function(t){vt=t},gt.createNonceMiddleware=T,gt.createPreloadingMiddleware=Z,gt.createRootURLMiddleware=L,gt.fetchAllMiddleware=K,gt.mediaUploadMiddleware=lt;const _t=gt;function bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return wt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wt(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Ot;jQuery(document.body).on("click",".customer-dashboard button[type=submit]",(function(t){t.preventDefault();var e=jQuery(this).parents("form"),r={first_name:e.find("input[name=first_name]").val()||null,last_name:e.find("input[name=last_name]").val()||null,email:e.find("input[name=email]").val()||null,password:e.find("input[name=password]").val()||null,password_confirm:e.find("input[name=password_confirm]").val()||null},n=e.find("input[name=customer_id]").val()||0;n&&_t({path:"".concat(smartpay.restUrl,"/v1/public/customers/").concat(n),method:"PUT",headers:{"X-WP-Nonce":smartpay.apiNonce},body:JSON.stringify(r)}).then((function(t){e.find("#form-response").append('<div class="alert alert-success text-center mb-4">Profile updated</div>')})).catch((function(t){e.find("form-response").append('<div class="alert alert-danger text-center mb-4">'.concat(t.message,"</div>"))}))})),(Ot=jQuery).fn.serializeJSON=function(){if(this.length<1)return!1;var t={},e=t,r=':input[type!="checkbox"][type!="radio"], input:checked',n=function(){if(!this.disabled){var r=this.name.replace(/\[([^\]]+)?\]/g,",$1").split(","),n=r.length-1,a=Ot(this);if(r[0]){for(var o=0;o<n;o++)e=e[r[o]]=e[r[o]]||(""===r[o+1]||"0"===r[o+1]?[]:{});void 0!==e.length?e.push(a.val()):e[r[n]]=a.val(),e=t}}};return this.filter(r).each(n),this.find(r).each(n),t},jQuery((function(t){window.SmartPayFormValidator=function(t,e){var r=this,n=this;this.data=t,this.rules=e,n.validate=function(){return Object.entries(r.rules).reduce((function(t,e){var n=bt(e,2),a=n[0],o=n[1],i=[];if(o.required){var s=r.validateRequiredMessage(r.data[a]);s&&i.push(s)}if(o.requiredWhen){var c=r.validateRequiredWhenMessage(r.data[a],o.requiredWhen);c&&i.push(c)}if(o.email){var u=r.validateEmailMessage(r.data[a]);u&&i.push(u)}if(o.length){var l=r.validateLengthMessage(r.data[a],o.length);l&&i.push(l)}if(o.value){var p=r.validateValueMessage(r.data[a],o.value);p&&i.push(p)}return i.length&&(t[a]=i),t}),{})},n.validateLengthMessage=function(t,e){if(null!=t){if(Array.isArray(e)){if(t.length>=e[0]&&t.length<=e[1])return;return"must be between ".concat(e[0]," to ").concat(e[1]," character")}if(!(t.length>=e))return"must be ".concat(e," or more characters")}},n.validateRequiredMessage=function(t){if(!t)return"is required"},n.validateRequiredWhenMessage=function(t,e){var r=bt(e,2),a=r[0],o=r[1];if(a&&n.data[a]===o)return n.validateRequiredMessage(t)},n.validateEmailMessage=function(t){if(!/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(t))return"is not a valid email"},n.validateValueMessage=function(t,e){if(t!==e)return"must be same as ".concat(e)}},window.JSUcfirst=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}}))},869:(t,e,r)=>{function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var c=r(400).SUBSCRIPTION;jQuery((function(t){var e,r;t(document.body).on("click",".smartpay-form-shortcode .form-amounts .form-plan-card",(function(e){t(e.currentTarget).parents(".form-amounts").find(".plan-amount").removeClass("selected"),t(e.currentTarget).addClass("selected");var r=t(e.currentTarget).find('input[name="_form_amount"]'),n=t(e.currentTarget).find('input[name="_form_billing_type"]');if(c===n.val())var a=t(e.currentTarget).find('input[name="_form_billing_period"]'),o=t(e.currentTarget).find('input[name="_form_amount_key"]');t(e.currentTarget).parents(".form-amounts").find(".form--custom-amount").val(r.val()),t(e.currentTarget).parents(".form-amounts").find('input[name="smartpay_form_billing_type"]').val(n.val()),c===n.val()&&(t(e.currentTarget).parents(".form-amounts").find('input[name="smartpay_form_billing_period"]').val(a.val()),t("#smartpay-payment-form").find('input[name="smartpay_selected_amount_key"]').val(o.val())),t("#smartpay_is_custom_payment").val("false")})),t(document.body).on("click",".smartpay-form-shortcode .gateways .gateway",(function(e){t(e.currentTarget).parents(".gateways").find(".gateway").removeClass("selected"),t(e.currentTarget).addClass("selected")})),t(document.body).on("focus",".smartpay-form-shortcode .form-amounts .form--custom-amount",(function(e){t(e.currentTarget).parents(".form-amounts").find(".plan-amount").removeClass("selected"),t(e.currentTarget).addClass("selected"),t(e.currentTarget).parents(".form-amounts").find('.plan-amount input[type="radio"]:checked').prop("checked",!1),t("#smartpay_is_custom_payment").val("true")})),t(document.body).on("click",".smartpay-form-shortcode button.smartpay-form-pay-now",(function(e){e.preventDefault(),$parentWrapper=t(e.currentTarget).parents(".smartpay-payment");var r,a=t(e.currentTarget).text(),o=function(t){var e=t.find("#smartpay-payment-form").serializeJSON();return i({smartpay_action:"smartpay_process_payment",smartpay_payment_type:"form_payment",smartpay_process_payment:e.smartpay_process_payment,smartpay_gateway:e.smartpay_gateway,smartpay_first_name:e.smartpay_form.name.first_name,smartpay_last_name:e.smartpay_form.name.last_name,smartpay_email:e.smartpay_form.email,smartpay_payment_mobile:e.smartpay_payment_mobile,smartpay_form_id:e.smartpay_form_id,smartpay_amount:e.smartpay_form_amount,smartpay_amount_key:e.smartpay_selected_amount_key,smartpay_form_data:e.smartpay_form,smartpay_is_custom_amount:e.smartpay_is_custom_payment,smartpay_form_billing_type:e.smartpay_form_billing_type},c===e.smartpay_form_billing_type&&{smartpay_form_billing_period:e.smartpay_form_billing_period})}($parentWrapper),s=(r=new SmartPayFormValidator(o,{smartpay_action:{required:!0,value:"smartpay_process_payment"},smartpay_process_payment:{required:!0},smartpay_gateway:{required:!0},smartpay_first_name:{required:!0},smartpay_last_name:{required:!0},smartpay_email:{required:!0,email:!0},smartpay_payment_mobile:{requiredWhen:["smartpay_gateway","toyyibpay"]},smartpay_payment_type:{required:!0}}).validate(),{valid:Object.values(r).every((function(t){return 0===t.length})),errors:r});$parentWrapper.find("input").removeClass("is-invalid"),$parentWrapper.find("#form-response").hide(),s.valid?(t(e.currentTarget).text("Processing...").attr("disabled",!0),jQuery.post(smartpay.ajaxUrl,{action:"smartpay_process_payment",data:o},(function(r){r?$parentWrapper.find("#payment-response").html(r).show():($parentWrapper.find("#payment-response").html('<p class="text-danger">Something wrong! Please try again later.</p>').show(),console.error("Something wrong!")),setTimeout((function(){t(e.currentTarget).text(a).attr("disabled",!1)}),500)}))):(!function(t,e){var r=t.parents(".smartpay-payment"),a=[];if(Object.entries(e.errors).forEach((function(t){var e=n(t,2),o=e[0],i=e[1];r.find('input[name="'+o+'"]').addClass("is-invalid");var s=JSUcfirst(o.split("_").slice(1).join(" "));a.push('\n                <div class="alert alert-danger">\n                    <p class="m-0 form-error-text">'.concat(s," ").concat(i[0],"</p>\n                </div>"))})),!a.length)return;t.html(a),t.show()}($parentWrapper.find(".smartpay-message-info"),s),$parentWrapper.find("#first_name").focus())})),t(document.body).on("click",".smartpay-form-shortcode button.open-form-modal",(function(e){e.preventDefault();var r=t(e.currentTarget).parents(".smartpay-form-shortcode").find(".form-modal");setTimeout((function(){r.modal("show"),t(".modal-backdrop").last().appendTo(t(e.currentTarget).closest(".smartpay"))}),500)})),t(".smartpay-coupon-form-toggle .smartpayshowcoupon").on("click",(function(e){t(this).parents(".smartpay-coupon-form-toggle").addClass("d-none"),t(".smartpay-coupon-form").removeClass("d-none"),e.preventDefault()})),t(".smartpay-coupon-form").on("submit",(function(n){var a=t(this).find("input[name=coupon_code]").val(),o=t(this).parents(".smartpay_form_builder_wrapper").find("#smartpay-payment-form input[name=smartpay_form_id]").val();t.ajax({method:"POST",url:smartpay.ajaxUrl,data:{action:"smartpay_coupon",couponCode:a,formId:o}}).done((function(n){if(n.success){t(".smartpay-message-info").append('<div class="alert alert-success">'.concat(n.data.message,"</div>")),e=n.data.couponData,r=n.data.currency,t("#smartpay-payment-form").addClass("coupon-applied"),t("#smartpay-payment-form").find(".form--fixed-amount").each((function(){var r=t(this).find("input[name=_form_amount]").attr("id");t(this).find("input[name=_form_amount]").val(e[r].discountAmount)}));var a=t("#smartpay-payment-form .form-amounts").find(".form--fixed-amount.selected input[name=_form_amount]").attr("id");t("#smartpay-payment-form input[name=smartpay_form_amount]").val(e[a].discountAmount),t(".discount-amounts-container").removeClass("d-none"),t(".discount-amounts-container").find(".subtotal-amount-value").html("".concat(r).concat(e[a].mainAmount)),t(".discount-amounts-container").find(".coupon-amount-name").html(n.data.couponCode),t(".discount-amounts-container").find(".coupon-amount-value").html("-".concat(r).concat(e[a].couponAmount)),t(".discount-amounts-container").find(".total-amount-value").html("".concat(r).concat(e[a].discountAmount))}n.success||t(".smartpay-message-info").append('<div class="alert alert-danger">'.concat(n.data.message,"</div>"))})),n.preventDefault()})),t(".smartpay-form-shortcode .form-amounts .form--fixed-amount").on("click",(function(){if(t("#smartpay-payment-form").hasClass("coupon-applied")){var n=t(this).find("input[name=_form_amount]").attr("id");t(".discount-amounts-container").find(".subtotal-amount-value").html("".concat(r).concat(e[n].mainAmount)),t(".discount-amounts-container").find(".coupon-amount-value").html("-".concat(r).concat(e[n].couponAmount)),t(".discount-amounts-container").find(".total-amount-value").html("".concat(r).concat(e[n].discountAmount))}})),t(".smartpay-coupon-form-close").on("click",(function(e){t(".smartpay-coupon-form").addClass("d-none"),t(".smartpay-coupon-form-toggle").removeClass("d-none"),e.preventDefault()}))}))},39:()=>{function t(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){s=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}(t,r)||function(t,r){if(!t)return;if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}jQuery((function(e){function r(t){t.find(".step-1").show(),t.find(".step-2").hide(),e(".back-to-first-step").hide()}function n(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={smartpay_action:"smartpay_process_payment",smartpay_process_payment:t.find('input[name="smartpay_process_payment"]').val()||null,smartpay_gateway:t.find('input[name="smartpay_gateway"]:checked').val()||null,smartpay_first_name:t.find('input[name="smartpay_first_name"]').val()||null,smartpay_last_name:t.find('input[name="smartpay_last_name"]').val()||null,smartpay_email:t.find('input[name="smartpay_email"]').val()||null,smartpay_payment_type:t.find('input[name="smartpay_payment_type"]').val()||null,smartpay_payment_mobile:t.find('input[name="smartpay_payment_mobile"]').val()||null};if("product_purchase"===n.smartpay_payment_type)n.smartpay_product_id=t.find('input[name="smartpay_product_id"]').val()||null,n.smartpay_product_price=t.find('input[name="smartpay_product_price"]').val()||null,n.smartpay_product_billing_type=t.find('input[name="smartpay_product_billing_type"]').val()||null,"Subscription"===n.smartpay_product_billing_type&&(n.smartpay_product_billing_period=t.find('input[name="smartpay_product_billing_period"]').val());else{n.smartpay_form_id=t.find('input[name="smartpay_form_id"]').val()||null,n.smartpay_amount=t.find('input[name="smartpay_form_amount"]').val()||null;var a={};t.find('.smartpay_form_builder_wrapper > form input[name^="smartpay_"]').length&&t.find('.smartpay_form_builder_wrapper > form input[name^="smartpay_"]').each((function(t,r){a[e(r).attr("name")]=e(r).val()})),n.smartpay_form_extra_data=a||{}}return r?n.index||null:n}e(document.body).on("click",".smartpay-product-shortcode .product-variations .variation",(function(t){e(t.currentTarget).parent().find(".variation").removeClass("selected"),e(t.currentTarget).addClass("selected");var r=e(t.currentTarget).find(".sale-price").data("price");e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_price"]').val(r);var n=e(t.currentTarget).find('input[name="_product_billing_type"]');if(e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_billing_type"]').val(n.val()),"Subscription"===n.val()){var a=e(t.currentTarget).find('input[name="_product_billing_period"]');e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_billing_period"]').val(a.val());var o=e(t.currentTarget).find('input[name="_product_additional_charge"]');e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_additional_charge"]').val(o.val())}var i=e(t.currentTarget).find('input[name="_smartpay_product_id"]');e(t.currentTarget).parents(".smartpay-product-shortcode").find('input[name="smartpay_product_id"]').val(i.val())})),e(document).ready((function(){var t=document.querySelector("#mobile-field");if(t){var r=e("input[name='smartpay_gateway']:checked").val(),n='<div class="form-group"><input type="number" placeholder="Mobile No" class="form-control" name="smartpay_payment_mobile"  id="smartpay_payment_mobile" required /></div>';"toyyibpay"===r&&(t.innerHTML=n),jQuery('input[name="smartpay_gateway"]').toArray().forEach((function(e){e.addEventListener("change",(function(){"toyyibpay"===e.value?t.innerHTML=n:t.innerHTML=""}))}))}})),e(document.body).on("click",".smartpay-product-shortcode button.open-product-modal",(function(t){t.preventDefault();var r=e(t.currentTarget).parents(".smartpay-product-shortcode").find(".product-modal");setTimeout((function(){r.modal("show"),e(".modal-backdrop").last().appendTo(e(t.currentTarget).closest(".smartpay"))}),500)})),e(document.body).on("click",".smartpay-payment button.open-payment-form",(function(t){t.preventDefault(),$parentWrapper=e(t.currentTarget).parents(".smartpay-payment");var a=$parentWrapper.find(".payment-modal"),o=n($parentWrapper),i=jQuery('input[name="smartpay_product_billing_type"]').val(),s=jQuery('input[name="smartpay_selected_currency_symbol"]').val(),c=e("#smartpay_additional_amount_id"),u=e("#smartpay_product_billing_type_id");if("Subscription"===i){var l=jQuery('input[name="smartpay_product_billing_period"]').val(),p='<div class="justify-content-center mb-2 mt-2">\n                    <p class="text-center text-muted font-weight-light">\n                        Enter your info to begin your\n                        <strong><span class="product_billing_type">'.concat(l,"</span></strong> subscription. You can cancel anytime.\n                    </p>\n                </div>");u.html(p);var d=e("input[name='smartpay_product_additional_charge']").val(),f='<div class="text-primary font-weight-bold text-center"><p>\n                        Additional charge '.concat(s+d,"  will be applied to the subscription.\n                    </p>\n                </div>");c&&d>0&&c.html(f)}else{u.html('<div class="justify-content-center mb-2 mt-2">\n                <p class="text-center text-muted">Provide your information to complete your purchase.</p></div>'),c&&c.html("")}var m=0;"form_payment"===o.smartpay_payment_type?m=e("#smartpay_currency_symbol").data("value")+o.smartpay_amount:m=o.smartpay_product_price;a.find(".amount").html(s+m),r(a);var y=e(t.currentTarget).text();e(t.currentTarget).text("Processing...").attr("disabled","disabled"),setTimeout((function(){a.modal("show"),o.smartpay_first_name&&a.find('input[name="smartpay_first_name"]').val(o.smartpay_first_name),o.smartpay_last_name&&a.find('input[name="smartpay_last_name"]').val(o.smartpay_last_name),o.smartpay_email&&a.find('input[name="smartpay_email"]').val(o.smartpay_email),e(".modal-backdrop").last().appendTo(e(t.currentTarget).closest(".smartpay-payment")),e(t.currentTarget).text(y).removeAttr("disabled")}),500)})),e(document.body).on("click",".smartpay-payment button.back-to-first-step",(function(t){t.preventDefault(),r(e(t.currentTarget).parents(".smartpay-payment").find(".payment-modal"))})),e(document.body).on("click",".smartpay-payment button.smartpay-pay-now",(function(r){r.preventDefault(),$parentWrapper=e(r.currentTarget).parents(".smartpay-payment");var a=e(r.currentTarget).text(),o=e(r.currentTarget).parents(".step-1"),i=e(r.currentTarget).parents(".modal-content").children(".step-2");e(r.currentTarget).text("Processing...").attr("disabled","disabled"),$parentWrapper.find(".modal-loading").css("display","flex");var s=n($parentWrapper),c=function(t){var e=new SmartPayFormValidator(t,{smartpay_action:{required:!0,value:"smartpay_process_payment"},smartpay_process_payment:{required:!0},smartpay_gateway:{required:!0},smartpay_first_name:{required:!0},smartpay_last_name:{required:!0},smartpay_payment_mobile:{requiredWhen:["smartpay_gateway","toyyibpay"]},smartpay_email:{required:!0,email:!0},smartpay_payment_type:{required:!0}}).validate();return{valid:Object.values(e).every((function(t){return 0===t.length})),errors:e}}(s);if($parentWrapper.find("input").removeClass("is-invalid"),o.find(".payment-modal--errors").hide(),c.valid){var u={action:"smartpay_process_payment",data:s};jQuery.post(smartpay.ajaxUrl,u,(function(t){i.css("display","flex"),e(".back-to-first-step").show(),o.hide(),setTimeout((function(){t?i.find(".dynamic-content").html(t):i.find(".dynamic-content").html('<p class="text-danger">Something wrong!</p>'),$parentWrapper.find(".modal-loading").css("display","none")}),300)}))}else!function(e,r){var n=e.parents(".smartpay-payment"),a=[];if(Object.entries(r.errors).forEach((function(e){var r=t(e,2),o=r[0],i=r[1];n.find('input[name="'+o+'"]').addClass("is-invalid");var s=JSUcfirst(o.split("_").slice(1).join(" "));a.push('\n                <div class="alert alert-danger">\n                    <p class="m-0 form-error-text">'.concat(s," ").concat(i[0],"</p>\n                </div>"))})),!a.length)return;e.show(),e.html(a)}(o.find(".payment-modal--errors"),c),setTimeout((function(){$parentWrapper.find(".modal-loading").css("display","none")}),300);e(r.currentTarget).text(a).removeAttr("disabled")})),e(document.body).on("click",".smartpay-payment button.modal-close",(function(t){e(t.currentTarget).parents(".smartpay-payment").find(".payment-modal").modal("hide")})),e(document.body).on("show.bs.modal",".payment-modal",(function(t){document.body.style.overflow="hidden"})),e(document.body).on("hidden.bs.modal",".payment-modal",(function(t){document.body.style.overflow="auto"})),e(".smartpay-product-coupon-form-toggle .smartpayshowcoupon").on("click",(function(){return e(".smartpay-product-coupon-form").toggleClass("d-none"),!1})),e(".smartpay-product-coupon-form").on("submit",(function(t){var r=e(this).find("input[name=coupon_code]").val(),n=e(this).parents(".smartpay-product-shortcode").find("input[name=smartpay_product_id]").val(),a=e(this).parents(".smartpay-product-shortcode").find("input[name=smartpay_product_price]").val();e.ajax({method:"POST",url:smartpay.ajaxUrl,data:{action:"smartpay_product_coupon",couponCode:r,productID:n,productPrice:a}}).done((function(t){if(t.success){var r=e(".discount-amounts-container"),n=e(".payment-modal--errors");e(".payment-modal--errors .alert").hide(),n.append('<div class="alert alert-success">'.concat(t.data.message,"</div>")),n.show(),$couponData=t.data.couponData,$currency=t.data.currency,r.find(".subtotal-amount-value").html("".concat($currency).concat($couponData.mainAmount)),r.find(".coupon-amount-name").html(t.data.couponCode),r.find(".coupon-amount-value").html("-".concat($currency).concat($couponData.couponAmount)),r.find(".total-amount-value").html("".concat($currency).concat($couponData.discountAmount)),r.find("input[name=smartpay_product_price]").val("".concat($couponData.discountAmount)),r.find(".payment-modal--title").html("".concat($couponData.discountAmount)),r.removeClass("d-none")}if(!t.success){var a=e(".payment-modal--errors");e(".payment-modal--errors .alert").hide(),a.append('<div class="alert alert-danger">'.concat(t.data.message,"</div>")),a.show()}})),t.preventDefault()}))}))},400:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ONE_TIME:()=>a,PAYMENT_STATUS_ABANDONED:()=>l,PAYMENT_STATUS_COMPLETED:()=>s,PAYMENT_STATUS_FAILED:()=>u,PAYMENT_STATUS_PENDING:()=>i,PAYMENT_STATUS_PROCESSING:()=>d,PAYMENT_STATUS_REFUNDED:()=>c,PAYMENT_STATUS_REVOKED:()=>p,SUBSCRIPTION:()=>o,productDefaultData:()=>f,variationDefaultData:()=>m});var n=r(304),a="One Time",o="Subscription",i="Pending",s="Completed",c="Refunded",u="Failed",l="Abandoned",p="Revoked",d="Processing",f={title:"",covers:[],description:"",variations:[],base_price:"",sale_price:"",files:[],settings:{payButtonLabel:(0,n.__)("Pay Now","smartpay"),label:(0,n.__)("Just Label checking","smartpay"),externalLink:{allowExternalLink:!1,label:(0,n.__)("Link Label","smartpay"),link:""}},extra:{}},m={title:"",description:"",base_price:"",sale_price:"",files:[],key:"",extra:{billing_type:a}}},470:()=>{},347:()=>{},737:()=>{},588:t=>{t.exports=function(t,e){var r,n,a=0;function o(){var o,i,s=r,c=arguments.length;t:for(;s;){if(s.args.length===arguments.length){for(i=0;i<c;i++)if(s.args[i]!==arguments[i]){s=s.next;continue t}return s!==r&&(s===n&&(n=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=r,s.prev=null,r.prev=s,r=s),s.val}s=s.next}for(o=new Array(c),i=0;i<c;i++)o[i]=arguments[i];return s={args:o,val:t.apply(null,o)},r?(r.prev=s,s.next=r):n=s,a===e.maxSize?(n=n.prev).next=null:a++,r=s,s.val}return e=e||{},o.clear=function(){r=null,n=null,a=0},o}},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof h?e:h,o=Object.create(a.prototype),i=new k(n||[]);return o._invoke=function(t,e,r){var n=p;return function(a,o){if(n===f)throw new Error("Generator is already running");if(n===m){if("throw"===a)throw o;return E()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var s=A(i,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===p)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var c=l(t,e,r);if("normal"===c.type){if(n=r.done?m:d,c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=m,r.method="throw",r.arg=c.arg)}}}(t,r,i),o}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",f="executing",m="completed",y={};function h(){}function v(){}function g(){}var _={};c(_,o,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(S([])));w&&w!==r&&n.call(w,o)&&(_=w);var O=g.prototype=h.prototype=Object.create(_);function j(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(a,o,i,s){var c=l(t[a],t,o);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==typeof p&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,i,s)}),(function(t){r("throw",t,i,s)})):e.resolve(p).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,s)}))}s(c.arg)}var a;this._invoke=function(t,n){function o(){return new e((function(e,a){r(t,n,e,a)}))}return a=a?a.then(o,o):o()}}function A(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,A(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var a=l(n,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var o=a.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function S(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(n.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:E}}function E(){return{value:e,done:!0}}return v.prototype=g,c(O,"constructor",g),c(g,"constructor",v),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,s,"GeneratorFunction")),t.prototype=Object.create(O),t},t.awrap=function(t){return{__await:t}},j(x.prototype),c(x.prototype,i,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,a,o){void 0===o&&(o=Promise);var i=new x(u(e,r,n,a),o);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},j(O),c(O,s,"Generator"),c(O,o,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function a(n,a){return s.type="throw",s.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;T(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:S(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},975:(t,e,r)=>{var n;!function(){"use strict";var a={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(t){return s(u(t),arguments)}function i(t,e){return o.apply(null,[t].concat(e||[]))}function s(t,e){var r,n,i,s,c,u,l,p,d,f=1,m=t.length,y="";for(n=0;n<m;n++)if("string"==typeof t[n])y+=t[n];else if("object"==typeof t[n]){if((s=t[n]).keys)for(r=e[f],i=0;i<s.keys.length;i++){if(null==r)throw new Error(o('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[i],s.keys[i-1]));r=r[s.keys[i]]}else r=s.param_no?e[s.param_no]:e[f++];if(a.not_type.test(s.type)&&a.not_primitive.test(s.type)&&r instanceof Function&&(r=r()),a.numeric_arg.test(s.type)&&"number"!=typeof r&&isNaN(r))throw new TypeError(o("[sprintf] expecting number but found %T",r));switch(a.number.test(s.type)&&(p=r>=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}a.json.test(s.type)?y+=r:(!a.number.test(s.type)||p&&!s.sign?d="":(d=p?"+":"-",r=r.toString().replace(a.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",l=s.width-(d+r).length,c=s.width&&l>0?u.repeat(l):"",y+=s.align?d+r+c:"0"===u?d+c+r:c+d+r)}return y}var c=Object.create(null);function u(t){if(c[t])return c[t];for(var e,r=t,n=[],o=0;r;){if(null!==(e=a.text.exec(r)))n.push(e[0]);else if(null!==(e=a.modulo.exec(r)))n.push("%");else{if(null===(e=a.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var i=[],s=e[2],u=[];if(null===(u=a.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(i.push(u[1]);""!==(s=s.substring(u[0].length));)if(null!==(u=a.key_access.exec(s)))i.push(u[1]);else{if(null===(u=a.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");i.push(u[1])}e[2]=i}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return c[t]=n}o,i,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=i,void 0===(n=function(){return{sprintf:o,vsprintf:i}}.call(e,r,e,t))||(t.exports=n))}()},22:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(680),a={contextDelimiter:"",onMissingKey:null};function o(t,e){var r;for(r in this.data=t,this.pluralForms={},this.options={},a)this.options[r]=void 0!==e&&r in e?e[r]:a[r]}o.prototype.getPluralForm=function(t,e){var r,a,o,i=this.pluralForms[t];return i||("function"!=typeof(o=(r=this.data[t][""])["Plural-Forms"]||r["plural-forms"]||r.plural_forms)&&(a=function(t){var e,r,n;for(e=t.split(";"),r=0;r<e.length;r++)if(0===(n=e[r].trim()).indexOf("plural="))return n.substr(7)}(r["Plural-Forms"]||r["plural-forms"]||r.plural_forms),o=(0,n.Z)(a)),i=this.pluralForms[t]=o),i(e)},o.prototype.dcnpgettext=function(t,e,r,n,a){var o,i,s;return o=void 0===a?0:this.getPluralForm(t,a),i=r,e&&(i=e+this.options.contextDelimiter+r),(s=this.data[t][i])&&s[o]?s[o]:(this.options.onMissingKey&&this.options.onMissingKey(r,t),0===o?r:n)}}},r={};function n(t){var a=r[t];if(void 0!==a)return a.exports;var o=r[t]={exports:{}};return e[t](o,o.exports,n),o.exports}n.m=e,t=[],n.O=(e,r,a,o)=>{if(!r){var i=1/0;for(l=0;l<t.length;l++){for(var[r,a,o]=t[l],s=!0,c=0;c<r.length;c++)(!1&o||i>=o)&&Object.keys(n.O).every((t=>n.O[t](r[c])))?r.splice(c--,1):(s=!1,o<i&&(i=o));if(s){t.splice(l--,1);var u=a();void 0!==u&&(e=u)}}return e}o=o||0;for(var l=t.length;l>0&&t[l-1][2]>o;l--)t[l]=t[l-1];t[l]=[r,a,o]},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={177:0,47:0,122:0,879:0};n.O.j=e=>0===t[e];var e=(e,r)=>{var a,o,[i,s,c]=r,u=0;if(i.some((e=>0!==t[e]))){for(a in s)n.o(s,a)&&(n.m[a]=s[a]);if(c)var l=c(n)}for(e&&e(r);u<i.length;u++)o=i[u],n.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return n.O(l)},r=self.webpackChunkwp_smartpay=self.webpackChunkwp_smartpay||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})(),n.O(void 0,[47,122,879],(()=>n(359))),n.O(void 0,[47,122,879],(()=>n(470))),n.O(void 0,[47,122,879],(()=>n(347)));var a=n.O(void 0,[47,122,879],(()=>n(737)));a=n.O(a)})();
  • smartpay/trunk/readme.txt

    r2789849 r2791699  
    55Tested up to: 6.0.2
    66Requires PHP: 7.4.0
    7 Stable Tag: 2.7.1
     7Stable Tag: 2.7.2
    88License: GNU Version 2 or later
    99
     
    123123
    124124== Changelog ==
     125= [2.7.2] =
     126* New - Add subscription info on the payment receipt page
     127* Fix - Billing type was not updated for one time on the form page
     128* Fix - Additional charge info was shown if no charges were added
     129* Fix - Payment was not processed if the additional charge and billing cycle are empty
     130
     131
    125132= [2.7.1] =
    126133* New - Additional charge for recurring payments
  • smartpay/trunk/resources/views/shortcodes/payment_receipt.php

    r2726552 r2791699  
    1 <?php use SmartPay\Modules\Frontend\Utilities\Downloader;
     1<?php
     2
     3use SmartPay\Modules\Frontend\Utilities\Downloader;
     4
     5$additional_charge = $payment->data['additional_info']['additional_charge'] ?? 0;
     6$total_count = $payment->data['additional_info']['total_billing_cycle'] ?? 0;
     7
    28if ($payment) : ?>
    39
    4     <?php do_action('smartpay_before_payment_receipt', $payment); ?>
     10    <?php do_action('smartpay_before_payment_receipt', $payment); ?>
    511
    612    <table>
    7         <?php do_action('smartpay_before_payment_receipt_data', $payment); ?>
     13        <?php do_action('smartpay_before_payment_receipt_data', $payment); ?>
    814
    915        <tr>
     
    1622            <td>
    1723                <a href="<?php echo smartpay_get_payment_product_or_form_name($payment->id)['preview'];?>" target="_blank">
    18                     <?php echo esc_html(smartpay_get_payment_product_or_form_name($payment->id)['name']); ?>
     24                    <?php echo esc_html(smartpay_get_payment_product_or_form_name($payment->id)['name']); ?>
    1925                </a>
    2026            </td>
    21 <!--            <td>--><?php //echo esc_html(smartpay_get_payment_product_or_form_name($payment->id)); ?><!--</td>-->
     27            <!--            <td>--><?php //echo esc_html(smartpay_get_payment_product_or_form_name($payment->id)); ?><!--</td>-->
    2228        </tr>
    2329
     
    3339            <td><?php _e('Payment amount:', 'smartpay') ?></td>
    3440            <td>
    35                 <?php
    36                 echo smartpay_amount_format($payment->amount);
    37                 //                    if ($payment->amount <= 0){
    38                 //                        //FIXME: remove constant with accessor or from gateway label
    39                 //                        echo 'Free';
    40                 //                    }else {
    41                 //                        echo smartpay_amount_format($payment->amount);
    42                 //                    }
    43                 ?>
     41                <?php
     42                echo smartpay_amount_format($payment->amount);
     43                ?>
    4444            </td>
    4545        </tr>
     46
     47        <?php if ($payment->data['additional_info'] &&  ($additional_charge > 0 || $total_count > 0)): ?>
     48            <tr>
     49                <td><?php _e('Subscription Info:', 'smartpay') ?></td>
     50                <td>
     51                    <?php
     52                    if ($additional_charge > 0) {
     53                        echo ('Additional charge '. smartpay_amount_format($additional_charge). ', ');
     54                    }
     55                    if ($total_count > 0) {
     56                        echo ('  Will be billed '.$total_count .' times.');
     57                    }
     58                    ?>
     59                </td>
     60            </tr>
     61        <?php endif; ?>
     62
    4663        <tr>
    4764            <td><?php _e('Payment gateway:', 'smartpay') ?></td>
    4865            <td>
    49                 <?php
    50                 if (smartpay_payment_gateways()[$payment->gateway]['checkout_label'] == 'Free'){
    51                     echo 'Free Purchase';
    52                 }else{
    53                     echo smartpay_payment_gateways()[$payment->gateway]['checkout_label'] ?? ucfirst($payment->gateway);
    54                 }
    55                 ?>
     66                <?php
     67                if (smartpay_payment_gateways()[$payment->gateway]['checkout_label'] == 'Free'){
     68                    echo 'Free Purchase';
     69                }else{
     70                    echo smartpay_payment_gateways()[$payment->gateway]['checkout_label'] ?? ucfirst($payment->gateway);
     71                }
     72                ?>
    5673            </td>
    5774        </tr>
     
    6178        </tr>
    6279
    63         <?php if (strtolower($payment->status) == \SmartPay\Models\Payment::COMPLETED): ?>
    64             <?php if ($payment->type == 'Product Purchase'): ?>
    65                 <?php $product = \SmartPay\Models\Product::find(intval($payment['data']['product_id'])) ?? null;
    66                 $external_link = $product['settings']['externalLink'];
    67                 ?>
    68                 <?php if ($product && $external_link && $external_link['allowExternalLink']): ?>
     80        <?php if (strtolower($payment->status) == \SmartPay\Models\Payment::COMPLETED): ?>
     81            <?php if ($payment->type == 'Product Purchase'): ?>
     82                <?php $product = \SmartPay\Models\Product::find(intval($payment['data']['product_id'])) ?? null;
     83                $external_link = $product['settings']['externalLink'];
     84                ?>
     85                <?php if ($product && $external_link && $external_link['allowExternalLink']): ?>
    6986                    <tr>
    7087                        <td><?php _e('Resource', 'smartpay') ?></td>
    7188                        <td>
    7289                            <a href="<?php echo $product['settings']['externalLink']['link']; ?>" target="_blank">
    73                                 <?php echo $product['settings']['externalLink']['label'] ?>
     90                                <?php echo $product['settings']['externalLink']['label'] ?>
    7491                            </a>
    7592                        </td>
    7693                    </tr>
    77                 <?php endif; ?>
     94                <?php endif; ?>
    7895
    79             <?php else: ?>
    80                 <?php $form = \SmartPay\Models\Form::find(intval($payment['data']['form_id'])) ?? null;
    81                 $external_link = $form['settings']['externalLink'];
    82                 ?>
    83                 <?php if ($form && $external_link && $external_link['allowExternalLink']): ?>
     96            <?php else: ?>
     97                <?php $form = \SmartPay\Models\Form::find(intval($payment['data']['form_id'])) ?? null;
     98                $external_link = $form['settings']['externalLink'];
     99                ?>
     100                <?php if ($form && $external_link && $external_link['allowExternalLink']): ?>
    84101                    <tr>
    85102                        <td><?php _e('Resource', 'smartpay') ?></td>
    86103                        <td>
    87104                            <a href="<?php echo $form['settings']['externalLink']['link']; ?>" target="_blank">
    88                                 <?php echo $form['settings']['externalLink']['label'] ?>
     105                                <?php echo $form['settings']['externalLink']['label'] ?>
    89106                            </a>
    90107                        </td>
    91108                    </tr>
    92                 <?php endif; ?>
    93             <?php endif; ?>
    94         <?php endif; ?>
     109                <?php endif; ?>
     110            <?php endif; ?>
     111        <?php endif; ?>
    95112
    96113
    97         <?php do_action('smartpay_before_payment_receipt_data', $payment); ?>
     114        <?php do_action('smartpay_before_payment_receipt_data', $payment); ?>
    98115
    99116    </table>
    100117
    101     <?php do_action('smartpay_after_payment_receipt', $payment); ?>
     118    <?php do_action('smartpay_after_payment_receipt', $payment); ?>
    102119
    103     <?php do_action('smartpay_payment_' . $payment->gateway . '_receipt', $payment); ?>
     120    <?php do_action('smartpay_payment_' . $payment->gateway . '_receipt', $payment); ?>
    104121
    105     <?php $productId = $payment->data['product_id'] ?? 0; ?>
    106     <?php $product = \SmartPay\Models\Product::with(['parent'])->find($productId); ?>
    107     <?php if (strtolower($payment->status) == \SmartPay\Models\Payment::COMPLETED): ?>
    108         <?php if ($product && count($product->files) > 0): ?>
     122    <?php $productId = $payment->data['product_id'] ?? 0; ?>
     123    <?php $product = \SmartPay\Models\Product::with(['parent'])->find($productId); ?>
     124    <?php if (strtolower($payment->status) == \SmartPay\Models\Payment::COMPLETED): ?>
     125        <?php if ($product && count($product->files) > 0): ?>
    109126            <!--    Do staff for download files-->
    110127            <h3><?php echo __( 'Files', 'smartpay' ); ?></h3>
     
    115132                </thead>
    116133                <tbody>
    117                 <?php foreach ($product->files as $file) { ?>
     134                <?php foreach ($product->files as $file) { ?>
    118135                    <tr>
    119136                        <td width="70%">
    120                             <?php echo $file['name']; ?>
     137                            <?php echo $file['name']; ?>
    121138                        </td>
    122139                        <td>
     
    124141                        </td>
    125142                    </tr>
    126                 <?php } ?>
     143                <?php } ?>
    127144                </tbody>
    128145            </table>
    129         <?php endif; ?>
    130     <?php endif; ?>
     146        <?php endif; ?>
     147    <?php endif; ?>
    131148<?php
    132149
  • smartpay/trunk/resources/views/shortcodes/shared/form_details.php

    r2789849 r2791699  
    1616                        <div class="form-amounts">
    1717                            <div class="form-plan-grid ">
    18                                 <?php foreach ( $form->amounts as $index => $amount ) : ?>
    19                                     <?php $billingType = $amount['billing_type'] ?? \SmartPay\Models\Payment::BILLING_TYPE_ONE_TIME; ?>
     18                                <?php foreach ( $form->amounts as $index => $amount ) : ?>
     19                                    <?php $billingType = $amount['billing_type'] ?? \SmartPay\Models\Payment::BILLING_TYPE_ONE_TIME; ?>
    2020
    21                                     <?php if ( $billingType == \SmartPay\Models\Payment::BILLING_TYPE_ONE_TIME ): ?>
     21                                    <?php if ( $billingType == \SmartPay\Models\Payment::BILLING_TYPE_ONE_TIME ): ?>
    2222                                        <label class="form-plan-card plan-amount <?php echo 0 === $index ? 'selected' : '' ?>">
    2323                                            <input type="radio" name="_form_amount" id="_form_amount_<?php echo
    24                                             $amount['key']; ?>" class="radio" value="<?php echo
    25                                             $amount['amount']; ?>" <?php echo 0 === $index ? 'checked' : '' ?> />
     24                                            $amount['key']; ?>" class="radio" value="<?php echo
     25                                            $amount['amount']; ?>" <?php echo 0 === $index ? 'checked' : '' ?> />
    2626                                            <span class="plan-details" aria-hidden="true">
    2727                                        <span class="plan-type">
     
    3131                                            <?php echo smartpay_amount_format( $amount['amount'] ); ?>
    3232                                        </span>
     33                                                <input type="hidden" name="_form_billing_type" id="_form_billing_type_<?php echo $amount['key']; ?>" value="<?php echo $billingType; ?>">
    3334                                        </label>
    34                                     <?php endif; ?>
     35                                    <?php endif; ?>
    3536
    36                                     <?php if ( \SmartPay\Models\Payment::BILLING_TYPE_SUBSCRIPTION === $billingType ) : ?>
     37                                    <?php if ( \SmartPay\Models\Payment::BILLING_TYPE_SUBSCRIPTION === $billingType ) : ?>
    3738
    3839                                        <label class="form-plan-card plan-amount <?php echo 0 === $index ? 'selected' : '' ?>">
     
    4041                                                   value="<?php echo $amount['key'] ?? ''; ?>">
    4142                                            <input type="radio" name="_form_amount" id="_form_amount_<?php echo
    42                                             $amount['key']; ?><?php echo
    43                                             $amount['key']; ?>" class="radio" value="<?php echo
    44                                             $amount['amount']; ?>" <?php echo 0 === $index ? 'checked' : '' ?> />
     43                                            $amount['key']; ?><?php echo
     44                                            $amount['key']; ?>" class="radio" value="<?php echo
     45                                            $amount['amount']; ?>" <?php echo 0 === $index ? 'checked' : '' ?> />
    4546                                            <span class="plan-details" aria-hidden="true">
    4647                                        <span class="plan-type">
     
    5556                                            <?php endif; ?>
    5657
    57                                                 <?php if ( isset( $amount['additional_charge'] ) && $amount['additional_charge'] > 0 ): ?>
     58                                                <?php if ( isset( $amount['additional_charge'] ) && $amount['additional_charge'] > 0 ): ?>
    5859                                                    <span class="plan-additional-info"> Additional Charge <?php echo $amount['additional_charge'] . smartpay_get_currency_symbol(); ?></span>
    59                                                 <?php endif; ?>
     60                                                <?php endif; ?>
    6061                                        </span>
    6162                                            <input type="hidden" name="_form_billing_type" id="_form_billing_type_<?php echo $amount['key']; ?>" value="<?php echo $billingType; ?>">
     
    6566                                                   value="<?php echo $amount['billing_period']; ?>">
    6667                                        </label>
    67                                     <?php endif; ?>
    68                                 <?php endforeach; ?>
     68                                    <?php endif; ?>
     69                                <?php endforeach; ?>
    6970                            </div>
    7071
  • smartpay/trunk/resources/views/shortcodes/shared/product_details.php

    r2789849 r2791699  
    3636                                            <li class="list-group-item variation price <?php echo 0 == $index ? 'selected' : ''; ?>">
    3737                                                <input type="hidden" name="_product_additional_charge"
    38                                                        value="<?php echo $variation->extra['additional_charge'] ?? '' ?>">
     38                                                       value="<?php echo $variation->extra['additional_charge'] ?? 0 ?>">
    3939                                                <label for="<?php echo "product_variation_{$variation->id}"; ?>" class="d-block m-0">
    4040                                                    <input type="hidden" name="_smartpay_product_id" id="<?php echo "product_variation_{$variation->id}"; ?>" value="<?php echo esc_attr($variation->id); ?>" <?php echo 0 == $index ? 'checked' : ''; ?>>
  • smartpay/trunk/smartpay.php

    r2791141 r2791699  
    66 * Plugin URI:  https://wpsmartpay.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
    77 * Tags: download manager, digital product, donation, ecommerce, paddle, stripe, paypal, document manager, file manager, download protection, recurring payment, donations, donation plugin, wordpress donation plugin, wp donation, fundraising, fundraiser, crowdfunding, wordpress donations, gutenberg, gutenberg donations, nonprofit, paypal donations, paypal donate, stripe donations, stripe donate, authorize.net, authorize.net donations, bkash, bkash payment,
    8  * Version:     2.7.1
     8 * Version:     2.7.2
    99 * Author:      WPSmartPay
    1010 * Author URI:  https://wpsmartpay.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
     
    2828defined('ABSPATH') || exit;
    2929
    30 define('SMARTPAY_VERSION', '2.7.1');
     30define('SMARTPAY_VERSION', '2.7.2');
    3131define('SMARTPAY_PLUGIN_FILE', __FILE__);
    3232define('SMARTPAY_PLUGIN_ASSETS', plugins_url('public', __FILE__));
  • smartpay/trunk/vendor/autoload.php

    r2791141 r2791699  
    1010require_once __DIR__ . '/composer/autoload_real.php';
    1111
    12 return ComposerAutoloaderInit28d163601e5e15ca167a7a8308d74631::getLoader();
     12return ComposerAutoloaderInit98d000388e7c589af69ab4822a884f05::getLoader();
  • smartpay/trunk/vendor/composer/autoload_real.php

    r2791141 r2791699  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit28d163601e5e15ca167a7a8308d74631
     5class ComposerAutoloaderInit98d000388e7c589af69ab4822a884f05
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit28d163601e5e15ca167a7a8308d74631', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit98d000388e7c589af69ab4822a884f05', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit28d163601e5e15ca167a7a8308d74631', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit98d000388e7c589af69ab4822a884f05', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInit28d163601e5e15ca167a7a8308d74631::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit98d000388e7c589af69ab4822a884f05::getInitializer($loader));
    3333
    3434        $loader->register(true);
    3535
    36         $includeFiles = \Composer\Autoload\ComposerStaticInit28d163601e5e15ca167a7a8308d74631::$files;
     36        $includeFiles = \Composer\Autoload\ComposerStaticInit98d000388e7c589af69ab4822a884f05::$files;
    3737        foreach ($includeFiles as $fileIdentifier => $file) {
    38             composerRequire28d163601e5e15ca167a7a8308d74631($fileIdentifier, $file);
     38            composerRequire98d000388e7c589af69ab4822a884f05($fileIdentifier, $file);
    3939        }
    4040
     
    4848 * @return void
    4949 */
    50 function composerRequire28d163601e5e15ca167a7a8308d74631($fileIdentifier, $file)
     50function composerRequire98d000388e7c589af69ab4822a884f05($fileIdentifier, $file)
    5151{
    5252    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • smartpay/trunk/vendor/composer/autoload_static.php

    r2791141 r2791699  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit28d163601e5e15ca167a7a8308d74631
     7class ComposerStaticInit98d000388e7c589af69ab4822a884f05
    88{
    99    public static $files = array (
     
    111111    {
    112112        return \Closure::bind(function () use ($loader) {
    113             $loader->prefixLengthsPsr4 = ComposerStaticInit28d163601e5e15ca167a7a8308d74631::$prefixLengthsPsr4;
    114             $loader->prefixDirsPsr4 = ComposerStaticInit28d163601e5e15ca167a7a8308d74631::$prefixDirsPsr4;
    115             $loader->classMap = ComposerStaticInit28d163601e5e15ca167a7a8308d74631::$classMap;
     113            $loader->prefixLengthsPsr4 = ComposerStaticInit98d000388e7c589af69ab4822a884f05::$prefixLengthsPsr4;
     114            $loader->prefixDirsPsr4 = ComposerStaticInit98d000388e7c589af69ab4822a884f05::$prefixDirsPsr4;
     115            $loader->classMap = ComposerStaticInit98d000388e7c589af69ab4822a884f05::$classMap;
    116116
    117117        }, null, ClassLoader::class);
  • smartpay/trunk/vendor/composer/installed.php

    r2791141 r2791699  
    22    'root' => array(
    33        'name' => 'wp-smartpay/core',
    4         'pretty_version' => 'v2.7.1.1',
    5         'version' => '2.7.1.1',
    6         'reference' => '5c6d129dc08c7cc170549a0b18155c8c2c158b06',
     4        'pretty_version' => 'v2.7.2',
     5        'version' => '2.7.2.0',
     6        'reference' => 'a63c3b799c3287821a63e312fac39e80d2e8b55a',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    108108        ),
    109109        'wp-smartpay/core' => array(
    110             'pretty_version' => 'v2.7.1.1',
    111             'version' => '2.7.1.1',
    112             'reference' => '5c6d129dc08c7cc170549a0b18155c8c2c158b06',
     110            'pretty_version' => 'v2.7.2',
     111            'version' => '2.7.2.0',
     112            'reference' => 'a63c3b799c3287821a63e312fac39e80d2e8b55a',
    113113            'type' => 'library',
    114114            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.