ok

Mini Shell

Direktori : /var/softaculous/sitepad/editor/site-data/plugins/kkart-pro/packages/kkart-admin/dist/chunks/
Upload File :
Current File : //var/softaculous/sitepad/editor/site-data/plugins/kkart-pro/packages/kkart-admin/dist/chunks/9.js

(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[9],{776:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var c=n(20);function r(e){var t=Object(c.dispatch)("core/notices").createNotice;e.error_data&&e.errors&&Object.keys(e.errors).length?Object.keys(e.errors).forEach((function(n){t("error",e.errors[n].join(" "))})):e.message&&t(e.code?"error":"success",e.message)}},792:function(e,t,n){"use strict";n.d(t,"b",(function(){return ye})),n.d(t,"a",(function(){return Oe}));var c=n(0),r=n(3),o=n(43),a=n.n(o),i=n(2),s=n(42),l=n.n(s),u=n(36),m=n(77),p=n(35),d=n(38),_=n.n(d),b=n(14),h=n.n(b),f=n(98),y=n.n(f),O=n(17),g=n.n(O),w=n(15),j=n.n(w),k=n(11),C=n.n(k),v=n(18),E=n.n(v),S=n(19),P=n.n(S),x=n(9),A=n.n(x),R=n(5),N=n.n(R),L=n(72),T=n(277),M=n(20);function q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,c=A()(e);if(t){var r=A()(this).constructor;n=Reflect.construct(c,arguments,r)}else n=c.apply(this,arguments);return P()(this,n)}}var U=function(e){E()(n,e);var t=q(n);function n(){var e;g()(this,n);for(var c=arguments.length,o=new Array(c),a=0;a<c;a++)o[a]=arguments[a];return e=t.call.apply(t,[this].concat(o)),N()(C()(e),"getInitialConfigValues",(function(){return{account_name:"",account_number:"",bank_name:"",sort_code:"",iban:"",bic:""}})),N()(C()(e),"validate",(function(e){var t={};return e.account_number||e.iban||(t.account_number=t.iban=Object(r.__)("Please enter an account number or IBAN",'kkart')),t})),N()(C()(e),"updateSettings",function(){var t=y()(h.a.mark((function t(n){var c,o,a,i;return h.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=e.props,o=c.updateOptions,a=c.createNotice,i=c.markConfigured,t.next=3,o({kkart_bacs_settings:{enabled:"yes"},kkart_bacs_accounts:[n]});case 3:t.sent.success?(i("bacs"),a("success",Object(r.__)("Direct bank transfer details added successfully",'kkart'))):a("error",Object(r.__)("There was a problem saving your payment settings",'kkart'));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return j()(n,[{key:"render",value:function(){var e=this.props.isOptionsRequesting;return Object(c.createElement)(m.Form,{initialValues:this.getInitialConfigValues(),onSubmitCallback:this.updateSettings,validate:this.validate},(function(t){var n=t.getInputProps,o=t.handleSubmit;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(m.H,null,Object(r.__)("Add your bank details",'kkart')),Object(c.createElement)("p",null,Object(r.__)("These details are required to receive payments via bank transfer",'kkart')),Object(c.createElement)("div",{className:"kkart-task-payment-method__fields"},Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("Account name",'kkart'),required:!0},n("account_name"))),Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("Account number",'kkart'),required:!0},n("account_number"))),Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("Bank name",'kkart'),required:!0},n("bank_name"))),Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("Sort code",'kkart'),required:!0},n("sort_code"))),Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("IBAN",'kkart'),required:!0},n("iban"))),Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("BIC / Swift",'kkart'),required:!0},n("bic")))),Object(c.createElement)(L.a,{isPrimary:!0,isBusy:e,onClick:o},Object(r.__)("Save",'kkart')))}))}}]),n}(c.Component),D=Object(T.a)(Object(M.withSelect)((function(e){return{isOptionsRequesting:(0,e(p.OPTIONS_STORE_NAME).isOptionsUpdating)()}})),Object(M.withDispatch)((function(e){return{createNotice:e("core/notices").createNotice,updateOptions:e(p.OPTIONS_STORE_NAME).updateOptions}})))(U),I=function(){return Object(c.createElement)("svg",{width:"96",height:"32",viewBox:"0 0 96 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)("rect",{width:"32",height:"32",rx:"16",fill:"#8E9196"}),Object(c.createElement)("mask",{id:"bacs0","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"8",y:"8",width:"16",height:"16"},Object(c.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.875 12.25L16 8.5L23.125 12.25V13.75H8.875V12.25ZM16 10.195L19.9075 12.25H12.0925L16 10.195ZM10.75 15.25H12.25V20.5H10.75V15.25ZM15.25 20.5V15.25H16.75V20.5H15.25ZM23.125 23.5V22H8.875V23.5H23.125ZM19.75 15.25H21.25V20.5H19.75V15.25Z",fill:"white"})),Object(c.createElement)("g",{mask:"url(#bacs0)"},Object(c.createElement)("rect",{x:"7",y:"7",width:"18",height:"18",fill:"white"})),Object(c.createElement)("mask",{id:"bacs1","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"39",y:"10",width:"18",height:"12"},Object(c.createElement)("path",{d:"M39 17L53.17 17L49.59 20.59L51 22L57 16L51 10L49.59 11.41L53.17 15L39 15L39 17Z",fill:"white"})),Object(c.createElement)("g",{mask:"url(#bacs1)"},Object(c.createElement)("rect",{x:"60",y:"28",width:"24",height:"24",transform:"rotate(-180 60 28)",fill:"#8E9196"})),Object(c.createElement)("rect",{x:"64",width:"32",height:"32",rx:"16",fill:"#8E9196"}),Object(c.createElement)("mask",{id:"bacs2","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"72",y:"8",width:"16",height:"16"},Object(c.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M72.875 12.25L80 8.5L87.125 12.25V13.75H72.875V12.25ZM80 10.195L83.9075 12.25H76.0925L80 10.195ZM74.75 15.25H76.25V20.5H74.75V15.25ZM79.25 20.5V15.25H80.75V20.5H79.25ZM87.125 23.5V22H72.875V23.5H87.125ZM83.75 15.25H85.25V20.5H83.75V15.25Z",fill:"white"})),Object(c.createElement)("g",{mask:"url(#bacs2)"},Object(c.createElement)("rect",{x:"71",y:"7",width:"18",height:"18",fill:"white"})))},V=function(){return Object(c.createElement)("svg",{width:"96",height:"32",viewBox:"0 0 96 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)("rect",{width:"32",height:"32",rx:"16",fill:"#8E9196"}),Object(c.createElement)("mask",{id:"cod-mask-0","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"7",y:"10",width:"18",height:"12"},Object(c.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22 13H19.75V10H9.25C8.425 10 7.75 10.675 7.75 11.5V19.75H9.25C9.25 20.995 10.255 22 11.5 22C12.745 22 13.75 20.995 13.75 19.75H18.25C18.25 20.995 19.255 22 20.5 22C21.745 22 22.75 20.995 22.75 19.75H24.25V16L22 13ZM21.625 14.125L23.095 16H19.75V14.125H21.625ZM10.75 19.75C10.75 20.1625 11.0875 20.5 11.5 20.5C11.9125 20.5 12.25 20.1625 12.25 19.75C12.25 19.3375 11.9125 19 11.5 19C11.0875 19 10.75 19.3375 10.75 19.75ZM13.165 18.25C12.7525 17.7925 12.1675 17.5 11.5 17.5C10.8325 17.5 10.2475 17.7925 9.835 18.25H9.25V11.5H18.25V18.25H13.165ZM19.75 19.75C19.75 20.1625 20.0875 20.5 20.5 20.5C20.9125 20.5 21.25 20.1625 21.25 19.75C21.25 19.3375 20.9125 19 20.5 19C20.0875 19 19.75 19.3375 19.75 19.75Z",fill:"white"})),Object(c.createElement)("g",{mask:"url(#cod-mask-0)"},Object(c.createElement)("rect",{x:"7",y:"7",width:"18",height:"18",fill:"white"})),Object(c.createElement)("mask",{id:"cod-mask-1","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"39",y:"10",width:"18",height:"12"},Object(c.createElement)("path",{d:"M39 17L53.17 17L49.59 20.59L51 22L57 16L51 10L49.59 11.41L53.17 15L39 15L39 17Z",fill:"white"})),Object(c.createElement)("g",{mask:"url(#cod-mask-1)"},Object(c.createElement)("rect",{x:"60",y:"28",width:"24",height:"24",transform:"rotate(-180 60 28)",fill:"#8E9196"})),Object(c.createElement)("rect",{x:"64",width:"32",height:"32",rx:"16",fill:"#8E9196"}),Object(c.createElement)("mask",{id:"cod-mask-2","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"76",y:"9",width:"8",height:"14"},Object(c.createElement)("path",{d:"M80.2926 15.175C78.5901 14.7325 78.0426 14.275 78.0426 13.5625C78.0426 12.745 78.8001 12.175 80.0676 12.175C81.4026 12.175 81.8976 12.8125 81.9426 13.75H83.6001C83.5476 12.46 82.7601 11.275 81.1926 10.8925V9.25H78.9426V10.87C77.4876 11.185 76.3176 12.13 76.3176 13.5775C76.3176 15.31 77.7501 16.1725 79.8426 16.675C81.7176 17.125 82.0926 17.785 82.0926 18.4825C82.0926 19 81.7251 19.825 80.0676 19.825C78.5226 19.825 77.9151 19.135 77.8326 18.25H76.1826C76.2726 19.8925 77.5026 20.815 78.9426 21.1225V22.75H81.1926V21.1375C82.6551 20.86 83.8176 20.0125 83.8176 18.475C83.8176 16.345 81.9951 15.6175 80.2926 15.175Z",fill:"white"})),Object(c.createElement)("g",{mask:"url(#cod-mask-2)"},Object(c.createElement)("rect",{x:"71",y:"7",width:"18",height:"18",fill:"white"})))},F=n(776),H=n(32);function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach((function(t){N()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,c=A()(e);if(t){var r=A()(this).constructor;n=Reflect.construct(c,arguments,r)}else n=c.apply(this,arguments);return P()(this,n)}}var Y=function(e){E()(i,e);var t,n,o=W(i);function i(e){var t;return g()(this,i),(t=o.call(this,e)).state={oAuthConnectFailed:!1,connectURL:null,isPending:!1},t.updateSettings=t.updateSettings.bind(C()(t)),t}return j()(i,[{key:"componentDidMount",value:function(){var e=this.props.stripeSettings,t=Object(H.getQuery)();if(t["stripe-connect"]&&"1"===t["stripe-connect"]&&(e.publishable_key&&e.secret_key))return void this.completeMethod();this.requiresManualConfig()||this.fetchOAuthConnectURL()}},{key:"componentDidUpdate",value:function(e){var t=this.props.activePlugins;!e.activePlugins.includes("kkart-gateway-stripe")&&t.includes("kkart-gateway-stripe")&&this.fetchOAuthConnectURL()}},{key:"requiresManualConfig",value:function(){var e=this.props,t=e.activePlugins,n=e.isJetpackConnected,c=this.state.oAuthConnectFailed;return!n||!t.includes("kkart-services")||c}},{key:"completeMethod",value:function(){var e=this.props,t=e.createNotice,n=e.markConfigured;this.setState({isPending:!1}),t("success",Object(r.__)("Stripe connected successfully.",'kkart')),n("stripe")}},{key:"fetchOAuthConnectURL",value:(n=y()(h.a.mark((function e(){var t;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.props.activePlugins.includes("kkart-gateway-stripe")){e.next=3;break}return e.abrupt("return");case 3:return e.prev=3,this.setState({isPending:!0}),e.next=7,a()({path:p.KKARTS_NAMESPACE+"/connect/stripe/oauth/init",method:"POST",data:{returnUrl:Object(u.f)("admin.php?page=kkart-admin&task=payments&method=stripe&stripe-connect=1")}});case 7:if((t=e.sent)&&t.oauthUrl){e.next=11;break}return this.setState({oAuthConnectFailed:!0,isPending:!1}),e.abrupt("return");case 11:this.setState({connectURL:t.oauthUrl,isPending:!1}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(3),this.setState({oAuthConnectFailed:!0,isPending:!1});case 17:case"end":return e.stop()}}),e,this,[[3,14]])}))),function(){return n.apply(this,arguments)})},{key:"renderConnectButton",value:function(){var e=this.state.connectURL;return Object(c.createElement)(L.a,{isPrimary:!0,href:e},Object(r.__)("Connect",'kkart'))}},{key:"updateSettings",value:(t=y()(h.a.mark((function e(t){var n,c,o,a,i,s;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=this.props,o=c.updateOptions,a=c.stripeSettings,i=c.createNotice,s=t.publishable_key.match(/^pk_live_/)?"":"test_",e.next=4,o({kkart_stripe_settings:B(B({},a),{},(n={},N()(n,s+"publishable_key",t.publishable_key),N()(n,s+"secret_key",t.secret_key),N()(n,"testmode","test_"===s?"yes":"no"),N()(n,"enabled","yes"),n))});case 4:e.sent.success?this.completeMethod():i("error",Object(r.__)("There was a problem saving your payment settings",'kkart'));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"getInitialConfigValues",value:function(){return{publishable_key:"",secret_key:""}}},{key:"validateManualConfig",value:function(e){var t={};return null===e.publishable_key.match(/^pk_(live|test)_[a-zA-Z0-9_]+/)&&(t.publishable_key=Object(r.__)('Please enter a valid publishable key (starting with "pk_").','kkart')),null===e.secret_key.match(/^[rs]k_(live|test)_[a-zA-Z0-9_]+/)?t.secret_key=Object(r.__)('Please enter a valid secret key (starting with "sk_" or "rk_").','kkart'):e.secret_key.slice(3,7)!==e.publishable_key.slice(3,7)&&(t.secret_key=Object(r.__)("Please enter a secret key in the same mode as the publishable key.",'kkart')),t}},{key:"renderManualConfig",value:function(){var e=this.props.isOptionsUpdating,t=l()({mixedString:Object(r.__)("Your API details can be obtained from your {{docsLink}}Stripe account{{/docsLink}}. Don’t have a Stripe account? {{registerLink}}Create one.{{/registerLink}}",'kkart'),components:{docsLink:Object(c.createElement)(m.Link,{href:"https://stripe.com/docs/keys",target:"_blank",type:"external"}),registerLink:Object(c.createElement)(m.Link,{href:"https://dashboard.stripe.com/register",target:"_blank",type:"external"})}});return Object(c.createElement)(m.Form,{initialValues:this.getInitialConfigValues(),onSubmitCallback:this.updateSettings,validate:this.validateManualConfig},(function(n){var o=n.getInputProps,a=n.handleSubmit;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("Publishable Key",'kkart'),required:!0},o("publishable_key"))),Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("Secret Key",'kkart'),required:!0},o("secret_key"))),Object(c.createElement)(L.a,{isPrimary:!0,isBusy:e,onClick:a},Object(r.__)("Proceed",'kkart')),Object(c.createElement)("p",null,t))}))}},{key:"getConnectStep",value:function(){var e=this.state,t=e.connectURL,n=e.isPending,c=e.oAuthConnectFailed,o={key:"connect",label:Object(r.__)("Connect your Stripe account",'kkart')};return n?o:B(B({},o),{},!c&&t?{description:Object(r.__)("A Stripe account is required to process payments.",'kkart'),content:this.renderConnectButton()}:{description:Object(r.__)("Connect your store to your Stripe account. Don’t have a Stripe account? Create one.",'kkart'),content:this.renderManualConfig()})}},{key:"render",value:function(){var e=this.props,t=e.installStep,n=e.isOptionsUpdating,r=this.state.isPending;return Object(c.createElement)(m.Stepper,{isVertical:!0,isPending:!t.isComplete||n||r,currentStep:t.isComplete?"connect":"install",steps:[t,this.getConnectStep()]})}}]),i}(c.Component),J=Object(T.a)(Object(M.withSelect)((function(e){var t=e(p.OPTIONS_STORE_NAME),n=t.getOption,c=t.isOptionsUpdating,r=e(p.PLUGINS_STORE_NAME),o=r.getActivePlugins,a=r.isJetpackConnected;return{activePlugins:o(),isJetpackConnected:a(),isOptionsUpdating:c(),stripeSettings:n("kkart_stripe_settings")||[]}})),Object(M.withDispatch)((function(e){return{createNotice:e("core/notices").createNotice,updateOptions:e(p.OPTIONS_STORE_NAME).updateOptions}})))(Y);function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(Object(n),!0).forEach((function(t){N()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,c=A()(e);if(t){var r=A()(this).constructor;n=Reflect.construct(c,arguments,r)}else n=c.apply(this,arguments);return P()(this,n)}}var G=function(e){E()(o,e);var t,n=z(o);function o(e){var t;return g()(this,o),(t=n.call(this,e)).state={isPending:!1},t.connect=t.connect.bind(C()(t)),t}return j()(o,[{key:"componentDidMount",value:function(){var e=this.props,t=e.createNotice,n=e.markConfigured,c=Object(H.getQuery)();c["square-connect"]&&"1"===c["square-connect"]&&(t("success",Object(r.__)("Square connected successfully.",'kkart')),n("square"))}},{key:"connect",value:(t=y()(h.a.mark((function e(){var t,n,c,o,i,s,l,u;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props,n=t.createNotice,c=t.hasCbdIndustry,o=t.options,i=t.updateOptions,this.setState({isPending:!0}),i({kkart_square_credit_card_settings:Q(Q({},o.kkart_square_credit_card_settings),{},{enabled:"yes"})}),s=Object(r.__)("There was an error connecting to Square. Please try again or skip to connect later in store settings.",'kkart'),e.prev=4,l=null,c&&(l=window.open("/","_blank")),e.next=9,a()({path:p.KKART_ADMIN_NAMESPACE+"/plugins/connect-square",method:"POST"});case 9:if((u=e.sent)&&u.connectUrl){e.next=15;break}return this.setState({isPending:!1}),n("error",s),c&&l.close(),e.abrupt("return");case 15:this.setState({isPending:!0}),this.redirect(u.connectUrl,l),e.next=23;break;case 19:e.prev=19,e.t0=e.catch(4),this.setState({isPending:!1}),n("error",s);case 23:case"end":return e.stop()}}),e,this,[[4,19]])}))),function(){return t.apply(this,arguments)})},{key:"redirect",value:function(e,t){t?(t.location.href=e,window.location=Object(u.f)("admin.php?page=kkart-admin")):window.location=e}},{key:"render",value:function(){var e=this.props.installStep,t=this.state.isPending;return Object(c.createElement)(m.Stepper,{isVertical:!0,isPending:!e.isComplete||t,currentStep:e.isComplete?"connect":"install",steps:[e,{key:"connect",label:Object(r.__)("Connect your Square account",'kkart'),description:Object(r.__)("A Square account is required to process payments. You will be redirected to the Square website to create the connection.",'kkart'),content:Object(c.createElement)(c.Fragment,null,Object(c.createElement)(L.a,{isPrimary:!0,isBusy:t,onClick:this.connect},Object(r.__)("Connect",'kkart')))}]})}}]),o}(c.Component),$=Object(T.a)(Object(M.withSelect)((function(e){var t=e(p.OPTIONS_STORE_NAME),n=t.getOption,c=t.isResolving;return{options:n("kkart_square_credit_card_settings"),optionsIsRequesting:c("getOption",["kkart_square_credit_card_settings"])}})),Object(M.withDispatch)((function(e){return{createNotice:e("core/notices").createNotice,updateOptions:e(p.OPTIONS_STORE_NAME).updateOptions}})))(G);function X(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,c=A()(e);if(t){var r=A()(this).constructor;n=Reflect.construct(c,arguments,r)}else n=c.apply(this,arguments);return P()(this,n)}}var ee=function(e){E()(n,e);var t=X(n);function n(){return g()(this,n),t.apply(this,arguments)}return j()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.createNotice,n=e.markConfigured;Object(H.getQuery)()["wcpay-connection-success"]&&(t("success",Object(r.__)("Kkart Payments connected successfully.",'kkart')),n("wcpay"))}},{key:"render",value:function(){return null}}]),n}(c.Component),te=Object(M.withDispatch)((function(e){return{createNotice:e("core/notices").createNotice}}))(ee),ne=function(){return Object(c.createElement)("svg",{width:"100",height:"64",viewBox:"-10 0 120 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.78073 0.5H91.1787C96.3299 0.5 100.5 4.77335 100.5 10.0522V41.8929C100.5 47.1717 96.3299 51.4451 91.1787 51.4451H61.9883L65.9948 61.5L48.3742 51.4451H9.82161C4.67036 51.4451 0.500298 47.1717 0.500298 41.8929V10.0522C0.459415 4.81524 4.62947 0.5 9.78073 0.5Z",fill:"#7F54B3"}),Object(c.createElement)("path",{d:"M5.48791 9.1725C6.06028 8.37648 6.91882 7.95752 8.06354 7.87373C10.1486 7.70615 11.3342 8.71165 11.6204 10.8902C12.8877 19.6464 14.2778 27.0619 15.7495 33.1368L24.7029 15.6663C25.5206 14.0743 26.5426 13.2364 27.7691 13.1526C29.568 13.0269 30.6718 14.2 31.1215 16.6718C32.1436 22.2439 33.4519 26.9781 35.0054 31.0001C36.0684 20.3586 37.8672 12.6917 40.402 7.95753C41.0152 6.78445 41.9146 6.19791 43.1002 6.11412C44.0405 6.03033 44.8991 6.3236 45.6759 6.95203C46.4526 7.58047 46.8615 8.37648 46.9432 9.34008C46.9841 10.0942 46.8615 10.7226 46.5344 11.3511C44.94 14.3676 43.6317 19.4369 42.5688 26.4754C41.5467 33.3044 41.1787 38.6251 41.424 42.4376C41.5058 43.485 41.3423 44.4067 40.9334 45.2027C40.4428 46.1244 39.707 46.6272 38.7666 46.711C37.7037 46.7948 36.5998 46.292 35.5369 45.1608C31.7348 41.1807 28.7094 35.2316 26.5018 27.3133C23.8444 32.6759 21.882 36.6979 20.6146 39.3792C18.2025 44.1134 16.1584 46.5434 14.4413 46.6691C13.3374 46.7529 12.3971 45.7893 11.5795 43.7783C9.49445 38.2899 7.24589 27.6904 4.83379 11.9795C4.71114 10.8902 4.91555 9.92662 5.48791 9.1725Z",fill:"white"}),Object(c.createElement)("path",{d:"M93.3864 15.7499C91.9146 13.1105 89.7478 11.5185 86.8451 10.89C86.0683 10.7225 85.3324 10.6387 84.6374 10.6387C80.7127 10.6387 77.5238 12.7335 75.0299 16.923C72.904 20.4841 71.8411 24.4223 71.8411 28.7376C71.8411 31.9635 72.4952 34.7286 73.8034 37.0329C75.2752 39.6723 77.442 41.2644 80.3447 41.8928C81.1215 42.0604 81.8574 42.1442 82.5524 42.1442C86.518 42.1442 89.7069 40.0494 92.1599 35.8598C94.2858 32.2568 95.3488 28.3186 95.3488 24.0034C95.3488 20.7355 94.6946 18.0123 93.3864 15.7499ZM88.2351 27.355C87.6628 30.1201 86.6407 32.173 85.128 33.5556C83.9424 34.6449 82.8386 35.1057 81.8165 34.8962C80.8353 34.6868 80.0177 33.8069 79.4044 32.173C78.9138 30.8742 78.6685 29.5755 78.6685 28.3605C78.6685 27.3131 78.7503 26.2657 78.9547 25.3021C79.3226 23.5844 80.0177 21.9086 81.1215 20.3166C82.4706 18.2637 83.9015 17.4258 85.3733 17.719C86.3545 17.9285 87.1722 18.8083 87.7854 20.4422C88.276 21.741 88.5213 23.0398 88.5213 24.2547C88.5213 25.344 88.3987 26.3914 88.2351 27.355Z",fill:"white"}),Object(c.createElement)("path",{d:"M67.7528 15.7499C66.281 13.1105 64.0734 11.5185 61.2116 10.89C60.4348 10.7225 59.6989 10.6387 59.0039 10.6387C55.0791 10.6387 51.8903 12.7335 49.3964 16.923C47.2705 20.4841 46.2075 24.4223 46.2075 28.7376C46.2075 31.9635 46.8616 34.7286 48.1699 37.0329C49.6417 39.6723 51.8085 41.2644 54.7112 41.8928C55.488 42.0604 56.2238 42.1442 56.9189 42.1442C60.8845 42.1442 64.0734 40.0494 66.5263 35.8598C68.6523 32.2568 69.7152 28.3186 69.7152 24.0034C69.7152 20.7355 69.0611 18.0123 67.7528 15.7499ZM62.6016 27.355C62.0292 30.1201 61.0071 32.173 59.4945 33.5556C58.3089 34.6449 57.205 35.1057 56.183 34.8962C55.2018 34.6868 54.3841 33.8069 53.7709 32.173C53.2803 30.8742 53.035 29.5755 53.035 28.3605C53.035 27.3131 53.1167 26.2657 53.3212 25.3021C53.6891 23.5844 54.3841 21.9086 55.4879 20.3166C56.8371 18.2637 58.268 17.4258 59.7398 17.719C60.721 17.9285 61.5386 18.8083 62.1519 20.4422C62.6425 21.741 62.8878 23.0398 62.8878 24.2547C62.8878 25.344 62.806 26.3914 62.6016 27.355Z",fill:"white"}))},ce=n(779),re=n(37);function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){N()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ie(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,c=A()(e);if(t){var r=A()(this).constructor;n=Reflect.construct(c,arguments,r)}else n=c.apply(this,arguments);return P()(this,n)}}var se=function(e){E()(i,e);var t,n,o=ie(i);function i(e){var t;return g()(this,i),(t=o.call(this,e)).state={autoConnectFailed:!1,connectURL:"",isPending:!1},t.updateSettings=t.updateSettings.bind(C()(t)),t.validate=t.validate.bind(C()(t)),t}return j()(i,[{key:"componentDidMount",value:function(){var e=this.props,t=e.createNotice,n=e.markConfigured,c=Object(H.getQuery)();if(c["paypal-connect"])return"1"===c["paypal-connect"]?(t("success",Object(r.__)("PayPal connected successfully.",'kkart')),void n("paypal")):void this.setState({autoConnectFailed:!0});this.fetchOAuthConnectURL()}},{key:"componentDidUpdate",value:function(e){var t=this.props.activePlugins;!e.activePlugins.includes("kkart-gateway-paypal-express-checkout")&&t.includes("kkart-gateway-paypal-express-checkout")&&this.fetchOAuthConnectURL()}},{key:"isKkartServicesConnected",value:function(){var e=this.props,t=e.activePlugins,n=e.isJetpackConnected,c=e.wcsTosAccepted;return n&&c&&t.includes("kkart-services")}},{key:"fetchOAuthConnectURL",value:(n=y()(h.a.mark((function e(){var t;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.props.activePlugins.includes("kkart-gateway-paypal-express-checkout")){e.next=3;break}return e.abrupt("return");case 3:return this.setState({isPending:!0}),e.prev=4,e.next=7,a()({path:p.KKART_ADMIN_NAMESPACE+"/plugins/connect-paypal",method:"POST"});case 7:if((t=e.sent)&&t.connectUrl){e.next=11;break}return this.setState({autoConnectFailed:!0,isPending:!1}),e.abrupt("return");case 11:this.setState({connectURL:t.connectUrl,isPending:!1}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),this.setState({autoConnectFailed:!0,isPending:!1});case 17:case"end":return e.stop()}}),e,this,[[4,14]])}))),function(){return n.apply(this,arguments)})},{key:"updateSettings",value:(t=y()(h.a.mark((function e(t){var n,c,o,a,i,s;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.props,c=n.createNotice,o=n.options,a=n.updateOptions,i=n.markConfigured,s=ae(ae({},o.kkart_ppec_paypal_settings),{},{enabled:"yes"}),t.create_account?(s.reroute_requests="yes",s.email=t.account_email):(s.api_username=t.api_username,s.api_password=t.api_password),e.next=5,a({kkart_ppec_paypal_settings:s});case 5:e.sent.success?(c("success",Object(r.__)("PayPal connected successfully.",'kkart')),i("paypal")):c("error",Object(r.__)("There was a problem saving your payment settings.",'kkart'));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"getInitialConfigValues",value:function(){return{api_username:"",api_password:"",create_account:this.isKkartServicesConnected(),account_email:""}}},{key:"validate",value:function(e){var t={};return e.create_account||e.api_username||(t.api_username=Object(r.__)("Please enter your API username",'kkart')),e.create_account||e.api_password||(t.api_password=Object(r.__)("Please enter your API password",'kkart')),this.isKkartServicesConnected()&&e.create_account&&!Object(re.isEmail)(e.account_email)&&(t.account_email=Object(r.__)("Please enter a valid email address",'kkart')),t}},{key:"renderAutomaticConfig",value:function(){var e=this.props.isOptionsUpdating,t=this.state,n=t.autoConnectFailed,o=t.connectURL,a=t.isPending,i=this.isKkartServicesConnected(),s=this.getInitialConfigValues();return Object(c.createElement)(m.Form,{initialValues:s,onSubmitCallback:this.updateSettings,validate:this.validate},(function(t){var s=t.getInputProps,u=t.handleSubmit,p=t.values;return Object(c.createElement)(c.Fragment,null,i&&Object(c.createElement)("div",{className:"kkart-task-payments__paypal-auto-create-account"},Object(c.createElement)(ce.a,_()({label:Object(r.__)("Create a PayPal account for me",'kkart')},s("create_account"))),p.create_account&&Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("Email address",'kkart'),type:"email"},s("account_email")))),!a&&(n||!o)&&(!i||!p.create_account)&&Object(c.createElement)(c.Fragment,null,Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("API Username",'kkart'),required:!0},s("api_username"))),Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("API Password",'kkart'),required:!0},s("api_password"))),Object(c.createElement)(L.a,{onClick:u,isPrimary:!0,isBusy:e},Object(r.__)("Proceed",'kkart')),Object(c.createElement)("p",null,l()({mixedString:Object(r.__)("Your API details can be obtained from your {{link}}PayPal account{{/link}}",'kkart'),components:{link:Object(c.createElement)(m.Link,{href:"https://docs.kkart.com/document/paypal-express-checkout/#section-8",target:"_blank",type:"external"})}}))),i&&p.create_account&&Object(c.createElement)(L.a,{onClick:u,isPrimary:!0,isBusy:e},Object(r.__)("Create account",'kkart')),!n&&o&&(!i||!p.create_account)&&Object(c.createElement)(c.Fragment,null,Object(c.createElement)(L.a,{isPrimary:!0,href:o},Object(r.__)("Connect",'kkart')),Object(c.createElement)("p",null,Object(r.__)("You will be redirected to the PayPal website to create the connection.",'kkart'))))}))}},{key:"getConnectStep",value:function(){return{key:"connect",label:Object(r.__)("Connect your PayPal account",'kkart'),description:Object(r.__)("A PayPal account is required to process payments. Connect your store to your PayPal account.",'kkart'),content:this.renderAutomaticConfig()}}},{key:"render",value:function(){var e=this.props.installStep,t=this.state.isPending;return Object(c.createElement)(m.Stepper,{isVertical:!0,isPending:!e.isComplete||t,currentStep:e.isComplete?"connect":"install",steps:[e,this.getConnectStep()]})}}]),i}(c.Component);se.defaultProps={manualConfig:!1};var le=Object(T.a)(Object(M.withSelect)((function(e){var t=e(p.OPTIONS_STORE_NAME),n=t.getOption,c=t.isOptionsUpdating,r=e(p.PLUGINS_STORE_NAME),o=r.getActivePlugins,a=r.isJetpackConnected,i=n("kkart_ppec_paypal_settings"),s=n("kkart_connect_options");return{activePlugins:o(),isJetpackConnected:a(),isOptionsUpdating:c(),options:i,wcsTosAccepted:s&&s.tos_accepted}})),Object(M.withDispatch)((function(e){return{createNotice:e("core/notices").createNotice,updateOptions:e(p.OPTIONS_STORE_NAME).updateOptions}})))(se);function ue(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,c=A()(e);if(t){var r=A()(this).constructor;n=Reflect.construct(c,arguments,r)}else n=c.apply(this,arguments);return P()(this,n)}}var me=function(e){E()(n,e);var t=ue(n);function n(e){var c;return g()(this,n),(c=t.call(this,e)).continue=c.continue.bind(C()(c)),c}return j()(n,[{key:"continue",value:function(){var e=this.props;(0,e.markConfigured)("checkout"===e.plugin?"klarna-checkout":"klarna-payments")}},{key:"renderConnectStep",value:function(){var e=this.props.plugin,t="checkout"===e?"klarna-checkout":"klarna-payments",n="checkout"===e?"kco":"klarna_payments",o=Object(c.createElement)(m.Link,{href:u.a+"admin.php?page=kkart-settings&tab=checkout&section="+n,target:"_blank",type:"external"}),a=Object(c.createElement)(m.Link,{href:"https://docs.kkart.com/document/"+t+"/#section-3",target:"_blank",type:"external"}),i=l()({mixedString:Object(r.__)("Klarna can be configured under your {{link}}store settings{{/link}}. Figure out {{helpLink}}what you need{{/helpLink}}.",'kkart'),components:{link:o,helpLink:a}});return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("p",null,i),Object(c.createElement)(L.a,{isPrimary:!0,onClick:this.continue},Object(r.__)("Continue",'kkart')))}},{key:"render",value:function(){var e=this.props.installStep;return Object(c.createElement)(m.Stepper,{isVertical:!0,isPending:!e.isComplete,currentStep:e.isComplete?"connect":"install",steps:[e,{key:"connect",label:Object(r.__)("Connect your Klarna account",'kkart'),content:this.renderConnectStep()}]})}}]),n}(c.Component);function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,c=A()(e);if(t){var r=A()(this).constructor;n=Reflect.construct(c,arguments,r)}else n=c.apply(this,arguments);return P()(this,n)}}var de=function(e){E()(n,e);var t=pe(n);function n(){var e;g()(this,n);for(var c=arguments.length,o=new Array(c),a=0;a<c;a++)o[a]=arguments[a];return e=t.call.apply(t,[this].concat(o)),N()(C()(e),"getInitialConfigValues",(function(){return{merchant_id:"",merchant_key:"",pass_phrase:""}})),N()(C()(e),"validate",(function(e){var t={};return e.merchant_id||(t.merchant_id=Object(r.__)("Please enter your merchant ID",'kkart')),e.merchant_key||(t.merchant_key=Object(r.__)("Please enter your merchant key",'kkart')),e.pass_phrase||(t.pass_phrase=Object(r.__)("Please enter your passphrase",'kkart')),t})),N()(C()(e),"updateSettings",function(){var t=y()(h.a.mark((function t(n){var c,o,a,i;return h.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=e.props,o=c.updateOptions,a=c.createNotice,i=c.markConfigured,t.next=3,o({kkart_currency:"ZAR",kkart_payfast_settings:{merchant_id:n.merchant_id,merchant_key:n.merchant_key,pass_phrase:n.pass_phrase,enabled:"yes"}});case 3:t.sent.success?(i("payfast"),a("success",Object(r.__)("PayFast connected successfully",'kkart'))):a("error",Object(r.__)("There was a problem saving your payment settings",'kkart'));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return j()(n,[{key:"renderConnectStep",value:function(){var e=this.props.isOptionsRequesting,t=l()({mixedString:Object(r.__)("Your API details can be obtained from your {{link}}PayFast account{{/link}}",'kkart'),components:{link:Object(c.createElement)(m.Link,{href:"https://www.payfast.co.za/",target:"_blank",type:"external"})}});return Object(c.createElement)(m.Form,{initialValues:this.getInitialConfigValues(),onSubmitCallback:this.updateSettings,validate:this.validate},(function(n){var o=n.getInputProps,a=n.handleSubmit;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("Merchant ID",'kkart'),required:!0},o("merchant_id"))),Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("Merchant Key",'kkart'),required:!0},o("merchant_key"))),Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("Passphrase",'kkart'),required:!0},o("pass_phrase"))),Object(c.createElement)(L.a,{isPrimary:!0,isBusy:e,onClick:a},Object(r.__)("Proceed",'kkart')),Object(c.createElement)("p",null,t))}))}},{key:"render",value:function(){var e=this.props,t=e.installStep,n=e.isOptionsRequesting;return Object(c.createElement)(m.Stepper,{isVertical:!0,isPending:!t.isComplete||n,currentStep:t.isComplete?"connect":"install",steps:[t,{key:"connect",label:Object(r.__)("Connect your PayFast account",'kkart'),content:this.renderConnectStep()}]})}}]),n}(c.Component),_e=Object(T.a)(Object(M.withSelect)((function(e){return{isOptionsRequesting:(0,e(p.OPTIONS_STORE_NAME).isOptionsUpdating)()}})),Object(M.withDispatch)((function(e){return{createNotice:e("core/notices").createNotice,updateOptions:e(p.OPTIONS_STORE_NAME).updateOptions}})))(de);function be(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,c=A()(e);if(t){var r=A()(this).constructor;n=Reflect.construct(c,arguments,r)}else n=c.apply(this,arguments);return P()(this,n)}}var he=function(e){E()(n,e);var t=be(n);function n(){var e;g()(this,n);for(var c=arguments.length,o=new Array(c),a=0;a<c;a++)o[a]=arguments[a];return e=t.call.apply(t,[this].concat(o)),N()(C()(e),"getInitialConfigValues",(function(){return{customer_api:"",customer_password:""}})),N()(C()(e),"validate",(function(e){var t={};return e.customer_api||(t.customer_api=Object(r.__)("Please enter your customer API key ",'kkart')),e.customer_password||(t.customer_password=Object(r.__)("Please enter your customer password",'kkart')),t})),N()(C()(e),"updateSettings",function(){var t=y()(h.a.mark((function t(n){var c,o,a,i;return h.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=e.props,o=c.updateOptions,a=c.createNotice,i=c.markConfigured,t.next=3,o({kkart_eway_settings:{customer_api:n.customer_api,customer_password:n.customer_password,enabled:"yes"}});case 3:t.sent.success?(i("eway"),a("success",Object(r.__)("eWAY connected successfully",'kkart'))):a("error",Object(r.__)("There was a problem saving your payment settings",'kkart'));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return j()(n,[{key:"renderConnectStep",value:function(){var e=this.props.isOptionsRequesting,t=l()({mixedString:Object(r.__)("Your API details can be obtained from your {{link}}eWAY account{{/link}}",'kkart'),components:{link:Object(c.createElement)(m.Link,{href:"https://www.eway.com.au/",target:"_blank",type:"external"})}});return Object(c.createElement)(m.Form,{initialValues:this.getInitialConfigValues(),onSubmitCallback:this.updateSettings,validate:this.validate},(function(n){var o=n.getInputProps,a=n.handleSubmit;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("Customer API Key",'kkart'),required:!0},o("customer_api"))),Object(c.createElement)(m.TextControl,_()({label:Object(r.__)("Customer Password",'kkart'),required:!0},o("customer_password"))),Object(c.createElement)(L.a,{isPrimary:!0,isBusy:e,onClick:a},Object(r.__)("Proceed",'kkart')),Object(c.createElement)("p",null,t))}))}},{key:"render",value:function(){var e=this.props,t=e.installStep,n=e.isOptionsRequesting;return Object(c.createElement)(m.Stepper,{isVertical:!0,isPending:!t.isComplete||n,currentStep:t.isComplete?"connect":"install",steps:[t,{key:"connect",label:Object(r.__)("Connect your eWAY account",'kkart'),content:this.renderConnectStep()}]})}}]),n}(c.Component),fe=Object(T.a)(Object(M.withSelect)((function(e){return{isOptionsRequesting:(0,e(p.OPTIONS_STORE_NAME).isOptionsUpdating)()}})),Object(M.withDispatch)((function(e){return{createNotice:e("core/notices").createNotice,updateOptions:e(p.OPTIONS_STORE_NAME).updateOptions}})))(he);function ye(e,t,n,c){var o=Object(r.__)("There was an error connecting to Kkart Payments. Please try again or connect later in store settings.",'kkart');c(["kkart-payments"]).then((function(){a()({path:p.KKART_ADMIN_NAMESPACE+"/plugins/connect-wcpay",method:"POST"}).then((function(e){window.location=e.connectUrl})).catch((function(){n("error",o),t()}))})).catch((function(e){Object(F.a)(e),t()}))}function Oe(e){var t=e.activePlugins,n=e.countryCode,o=e.createNotice,a=e.installAndActivatePlugins,s=e.onboardingStatus,p=e.options,d=e.profileItems,_=s.stripeSupportedCountries,b=void 0===_?[]:_,h=s.wcPayIsConnected,f=void 0!==h&&h,y=Object(i.some)(d.industry,{slug:"cbd-other-hemp-derived-products"})||!1,O=[];if(window.wcAdminFeatures.wcpay){var g=Object(c.createElement)(m.Link,{href:"https://wordpress.com/tos/",target:"_blank",type:"external"}),w=l()({mixedString:Object(r.__)('By clicking "Set up," you agree to the {{link}}Terms of Service{{/link}}','kkart'),components:{link:g}}),j=Object(c.createElement)(m.Link,{href:"https://docs.kkart.com/document/payments/testing/dev-mode/",target:"_blank",type:"external"}),k=l()({mixedString:Object(r.__)("Setting up a store for a client? {{link}}Start here{{/link}}",'kkart'),components:{link:j}}),C=Object(c.createElement)(m.Link,{href:Object(u.f)("admin.php?page=kkart-settings&tab=checkout&section=kkart_payments"),type:"wp-admin"},Object(r.__)("Settings",'kkart'));O.push({key:"wcpay",title:Object(r.__)("Kkart Payments",'kkart'),content:Object(c.createElement)(c.Fragment,null,Object(r.__)("Accept credit card payments the easy way! No setup fees. No monthly fees. Just 2.9% + $0.30 per transaction on U.S. issued cards. ",'kkart'),f&&C,!f&&Object(c.createElement)("p",null,w),d.setup_client&&Object(c.createElement)("p",null,k)),before:Object(c.createElement)(ne,null),onClick:function(e,t){return ye(0,t,o,a)},visible:["US","PR"].includes(n)&&!y,plugins:["kkart-payments"],container:Object(c.createElement)(te,null),isConfigured:f,isEnabled:p.kkart_kkart_payments_settings&&"yes"===p.kkart_kkart_payments_settings.enabled,optionName:"kkart_kkart_payments_settings"})}var v=p.kkart_stripe_settings&&("no"===p.kkart_stripe_settings.testmode?p.kkart_stripe_settings.publishable_key&&p.kkart_stripe_settings.secret_key:p.kkart_stripe_settings.test_publishable_key&&p.kkart_stripe_settings.test_secret_key);return O.push({key:"stripe",title:Object(r.__)("Credit cards - powered by Stripe",'kkart'),content:Object(c.createElement)(c.Fragment,null,Object(r.__)("Accept debit and credit cards in 135+ currencies, methods such as Alipay, and one-touch checkout with Apple Pay.",'kkart')),before:Object(c.createElement)("img",{src:u.e+"images/stripe.png",alt:""}),visible:b.includes(n)&&!y,plugins:["kkart-gateway-stripe"],container:Object(c.createElement)(J,null),isConfigured:v,isEnabled:p.kkart_stripe_settings&&"yes"===p.kkart_stripe_settings.enabled,optionName:"kkart_stripe_settings"},{key:"paypal",title:Object(r.__)("PayPal Checkout",'kkart'),content:Object(c.createElement)(c.Fragment,null,Object(r.__)("Safe and secure payments using credit cards or your customer's PayPal account.",'kkart')),before:Object(c.createElement)("img",{src:u.e+"images/paypal.png",alt:""}),visible:!y,plugins:["kkart-gateway-paypal-express-checkout"],container:Object(c.createElement)(le,null),isConfigured:p.kkart_ppec_paypal_settings&&(p.kkart_ppec_paypal_settings.reroute_requests&&p.kkart_ppec_paypal_settings.email||p.kkart_ppec_paypal_settings.api_username&&p.kkart_ppec_paypal_settings.api_password),isEnabled:p.kkart_ppec_paypal_settings&&"yes"===p.kkart_ppec_paypal_settings.enabled,optionName:"kkart_ppec_paypal_settings"},{key:"klarna_checkout",title:Object(r.__)("Klarna Checkout",'kkart'),content:Object(r.__)("Choose the payment that you want, pay now, pay later or slice it. No credit card numbers, no passwords, no worries.",'kkart'),before:Object(c.createElement)("img",{src:u.e+"images/klarna-black.png",alt:""}),visible:["SE","FI","NO","NL"].includes(n)&&!y,plugins:["klarna-checkout-for-kkart"],container:Object(c.createElement)(me,{plugin:"checkout"}),isConfigured:t.includes("klarna-checkout-for-kkart"),isEnabled:p.kkart_kco_settings&&"yes"===p.kkart_kco_settings.enabled,optionName:"kkart_kco_settings"},{key:"klarna_payments",title:Object(r.__)("Klarna Payments",'kkart'),content:Object(r.__)("Choose the payment that you want, pay now, pay later or slice it. No credit card numbers, no passwords, no worries.",'kkart'),before:Object(c.createElement)("img",{src:u.e+"images/klarna-black.png",alt:""}),visible:["DK","DE","AT"].includes(n)&&!y,plugins:["klarna-payments-for-kkart"],container:Object(c.createElement)(me,{plugin:"payments"}),isConfigured:t.includes("klarna-payments-for-kkart"),isEnabled:p.kkart_klarna_payments_settings&&"yes"===p.kkart_klarna_payments_settings.enabled,optionName:"kkart_klarna_payments_settings"},{key:"square",title:Object(r.__)("Square",'kkart'),content:Object(c.createElement)(c.Fragment,null,Object(r.__)("Securely accept credit and debit cards with one low rate, no surprise fees (custom rates available). Sell online and in store and track sales and inventory in one place.",'kkart'),y&&Object(c.createElement)("span",{className:"text-style-strong"},Object(r.__)(" Selling CBD products is only supported by Square.",'kkart'))),before:Object(c.createElement)("img",{src:u.e+"images/square-black.png",alt:""}),visible:y&&["US"].includes(n)||["brick-mortar","brick-mortar-other"].includes(d.selling_venues)&&["US","CA","JP","GB","AU"].includes(n),plugins:["kkart-square"],container:Object(c.createElement)($,null),isConfigured:p.kkart_square_refresh_tokens&&p.kkart_square_refresh_tokens.length,isEnabled:p.kkart_square_credit_card_settings&&"yes"===p.kkart_square_credit_card_settings.enabled,optionName:"kkart_square_credit_card_settings",hasCbdIndustry:y},{key:"payfast",title:Object(r.__)("PayFast",'kkart'),content:Object(c.createElement)(c.Fragment,null,Object(r.__)("The PayFast extension for Kkart enables you to accept payments by Credit Card and EFT via one of South Africa’s most popular payment gateways. No setup fees or monthly subscription costs.",'kkart'),Object(c.createElement)("p",null,Object(r.__)("Selecting this extension will configure your store to use South African rands as the selected currency.",'kkart'))),before:Object(c.createElement)("img",{src:u.e+"images/payfast.png",alt:"PayFast logo"}),visible:["ZA"].includes(n)&&!y,plugins:["kkart-payfast-gateway"],container:Object(c.createElement)(_e,null),isConfigured:p.kkart_payfast_settings&&p.kkart_payfast_settings.merchant_id&&p.kkart_payfast_settings.merchant_key&&p.kkart_payfast_settings.pass_phrase,isEnabled:p.kkart_payfast_settings&&"yes"===p.kkart_payfast_settings.enabled,optionName:"kkart_payfast_settings"},{key:"eway",title:Object(r.__)("eWAY",'kkart'),content:Object(c.createElement)(c.Fragment,null,Object(r.__)("The eWAY extension for Kkart allows you to take credit card payments directly on your store without redirecting your customers to a third party site to make payment.",'kkart')),before:Object(c.createElement)("img",{src:u.e+"images/eway-logo.jpg",alt:"eWAY logo"}),visible:["AU","NZ"].includes(n)&&!y,plugins:["kkart-gateway-eway"],container:Object(c.createElement)(fe,null),isConfigured:p.kkart_eway_settings&&p.kkart_eway_settings.customer_api&&p.kkart_eway_settings.customer_password,isEnabled:p.kkart_eway_settings&&"yes"===p.kkart_eway_settings.enabled,optionName:"kkart_eway_settings"},{key:"cod",title:Object(r.__)("Cash on delivery",'kkart'),content:Object(r.__)("Take payments in cash upon delivery.",'kkart'),before:Object(c.createElement)(V,null),visible:!y,isEnabled:p.kkart_cod_settings&&"yes"===p.kkart_cod_settings.enabled,optionName:"kkart_cod_settings"},{key:"bacs",title:Object(r.__)("Direct bank transfer",'kkart'),content:Object(r.__)("Take payments via bank transfer.",'kkart'),before:Object(c.createElement)(I,null),visible:!y,container:Object(c.createElement)(D,null),isConfigured:p.kkart_bacs_accounts&&p.kkart_bacs_accounts.length,isEnabled:p.kkart_bacs_settings&&"yes"===p.kkart_bacs_settings.enabled,optionName:"kkart_bacs_settings"}),Object(i.filter)(O,(function(e){return e.visible}))}}}]);

Zerion Mini Shell 1.0