File: /home/beaupptk/birthkumar.shop/wp-content/plugins/woocommerce-payments/dist/multi-currency.js
/*! For license information please see multi-currency.js.LICENSE.txt */
(()=>{var e={5955:(e,t,r)=>{"use strict";t.A=function(e){var t=e.size,r=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,a),d=["gridicon","gridicons-checkmark",i,!1,!1,!1].filter(Boolean).join(" ");return n.default.createElement("svg",s({className:d,height:r,width:r,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),n.default.createElement("g",null,n.default.createElement("path",{d:"M9 19.414l-6.707-6.707 1.414-1.414L9 16.586 20.293 5.293l1.414 1.414z"})))};var o,n=(o=r(1609))&&o.__esModule?o:{default:o},a=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)}},9387:(e,t,r)=>{"use strict";t.A=function(e){var t=e.size,r=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,a),d=["gridicon","gridicons-cross-circle",i,!1,!1,!1].filter(Boolean).join(" ");return n.default.createElement("svg",s({className:d,height:r,width:r,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),n.default.createElement("g",null,n.default.createElement("path",{d:"M19.1 4.9C15.2 1 8.8 1 4.9 4.9S1 15.2 4.9 19.1s10.2 3.9 14.1 0 4-10.3.1-14.2zm-4.3 11.3L12 13.4l-2.8 2.8-1.4-1.4 2.8-2.8-2.8-2.8 1.4-1.4 2.8 2.8 2.8-2.8 1.4 1.4-2.8 2.8 2.8 2.8-1.4 1.4z"})))};var o,n=(o=r(1609))&&o.__esModule?o:{default:o},a=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)}},4275:(e,t,r)=>{"use strict";t.A=function(e){var t=e.size,r=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,a),d=["gridicon","gridicons-info-outline",i,!!function(e){return 0==e%18}(r)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return n.default.createElement("svg",s({className:d,height:r,width:r,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),n.default.createElement("g",null,n.default.createElement("path",{d:"M13 9h-2V7h2v2zm0 2h-2v6h2v-6zm-1-7c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8m0-2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2z"})))};var o,n=(o=r(1609))&&o.__esModule?o:{default:o},a=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)}},9031:(e,t,r)=>{"use strict";t.A=function(e){var t=e.size,r=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,a),d=["gridicon","gridicons-notice-outline",i,!!function(e){return 0==e%18}(r)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return n.default.createElement("svg",s({className:d,height:r,width:r,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),n.default.createElement("g",null,n.default.createElement("path",{d:"M12 4c4.411 0 8 3.589 8 8s-3.589 8-8 8-8-3.589-8-8 3.589-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))};var o,n=(o=r(1609))&&o.__esModule?o:{default:o},a=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)}},5338:(e,t,r)=>{"use strict";var o=r(5795);t.H=o.createRoot,o.hydrateRoot},1020:(e,t,r)=>{"use strict";var o=r(1609),n=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(e,t,r){var o,a={},d=null,u=null;for(o in void 0!==r&&(d=""+r),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,o)&&!c.hasOwnProperty(o)&&(a[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===a[o]&&(a[o]=t[o]);return{$$typeof:n,type:e,key:d,ref:u,props:a,_owner:i.current}}t.Fragment=a,t.jsx=d,t.jsxs=d},4848:(e,t,r)=>{"use strict";e.exports=r(1020)},1609:e=>{"use strict";e.exports=window.React},5795:e=>{"use strict";e.exports=window.ReactDOM}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var n=o.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=o[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),r.p=window.wcpayAssets.url,(()=>{"use strict";var e={};r.r(e),r.d(e,{getAllDepositsOverviews:()=>Re,getAllDepositsOverviewsError:()=>be,getDeposit:()=>Te,getDepositQueryError:()=>Ae,getDeposits:()=>Oe,getDepositsCount:()=>Ie,getDepositsSummary:()=>Ce,getDepositsSummaryError:()=>Pe,getInstantDeposit:()=>xe});var t={};r.r(t),r.d(t,{submitInstantDeposit:()=>Ge,updateAllDepositsOverviews:()=>ze,updateDeposit:()=>Le,updateDeposits:()=>Be,updateDepositsCount:()=>Ye,updateDepositsSummary:()=>Ve,updateErrorForAllDepositsOverviews:()=>$e,updateErrorForDepositQuery:()=>qe,updateErrorForDepositsSummary:()=>He,updateInstantDeposit:()=>We});var o={};r.r(o),r.d(o,{getAllDepositsOverviews:()=>Ze,getDeposit:()=>Qe,getDeposits:()=>et,getDepositsSummary:()=>tt,getPayoutsCSVRequestURL:()=>Xe,payoutsDownloadEndpoint:()=>Ke});var n={};r.r(n),r.d(n,{getFraudOutcomeTransactions:()=>mt,getFraudOutcomeTransactionsError:()=>pt,getFraudOutcomeTransactionsSummary:()=>yt,getFraudOutcomeTransactionsSummaryError:()=>ht,getTransactions:()=>st,getTransactionsError:()=>it,getTransactionsSummary:()=>dt,getTransactionsSummaryError:()=>ut});var a={};r.r(a),r.d(a,{updateErrorForFraudOutcomeTransactions:()=>Tt,updateErrorForFraudOutcomeTransactionsSummary:()=>bt,updateErrorForTransactions:()=>St,updateErrorForTransactionsSummary:()=>ft,updateFraudOutcomeTransactions:()=>wt,updateFraudOutcomeTransactionsSummary:()=>Rt,updateTransactions:()=>gt,updateTransactionsSummary:()=>Et});var s={};r.r(s),r.d(s,{formatQueryFilters:()=>vt,getFraudOutcomeTransactions:()=>Ct,getFraudOutcomeTransactionsExport:()=>xt,getFraudOutcomeTransactionsSummary:()=>Pt,getTransactions:()=>Ot,getTransactionsCSVRequestURL:()=>At,getTransactionsSummary:()=>Nt,transactionsDownloadEndpoint:()=>It});var i={};r.r(i),r.d(i,{getCharge:()=>Dt,getChargeError:()=>Mt,getChargeFromOrder:()=>Ft,getChargeFromOrderError:()=>Ut});var c={};r.r(c),r.d(c,{updateCharge:()=>kt,updateErrorForCharge:()=>Lt});var d={};r.r(d),r.d(d,{getCharge:()=>zt,getChargeFromOrder:()=>$t});var u={};r.r(u),r.d(u,{getTimeline:()=>Yt,getTimelineError:()=>qt});var l={};r.r(l),r.d(l,{updateErrorForTimeline:()=>Ht,updateTimeline:()=>Vt});var m={};r.r(m),r.d(m,{getTimeline:()=>Wt});var p={};r.r(p),r.d(p,{getCachedDispute:()=>Xt,getDispute:()=>Jt,getDisputeError:()=>Kt,getDisputes:()=>er,getDisputesSummary:()=>tr});var _={};r.r(_),r.d(_,{refundCharge:()=>sr,updateErrorForPaymentIntent:()=>ar,updatePaymentIntent:()=>nr});var y={};r.r(y),r.d(y,{getPaymentIntent:()=>ir});var h={};r.r(h),r.d(h,{acceptDispute:()=>mr,updateDispute:()=>cr,updateDisputes:()=>ur,updateDisputesSummary:()=>lr,updateErrorForDispute:()=>dr});var g={};r.r(g),r.d(g,{disputesDownloadEndpoint:()=>Er,getDispute:()=>wr,getDisputes:()=>Tr,getDisputesCSVRequestURL:()=>fr,getDisputesSummary:()=>Rr});var S={};r.r(S),r.d(S,{getAccountBusinessSupportEmail:()=>zr,getAccountBusinessSupportPhone:()=>$r,getAccountDomesticCurrency:()=>Br,getAccountStatementDescriptor:()=>Ur,getAccountStatementDescriptorKana:()=>Lr,getAccountStatementDescriptorKanji:()=>kr,getAdvancedFraudProtectionSettings:()=>To,getAvailablePaymentMethodIds:()=>jr,getCompletedWaitingPeriod:()=>Wr,getCurrentProtectionLevel:()=>wo,getDepositDelayDays:()=>Hr,getDepositRestrictions:()=>Qr,getDepositScheduleInterval:()=>Yr,getDepositScheduleMonthlyAnchor:()=>Vr,getDepositScheduleWeeklyAnchor:()=>qr,getDepositStatus:()=>Gr,getDuplicatedPaymentMethodIds:()=>Cr,getEnabledPaymentMethodIds:()=>xr,getIsAppleGooglePayInPaymentMethodsOptionsEnabled:()=>to,getIsCardPresentEligible:()=>mo,getIsDebugLogEnabled:()=>ro,getIsDevModeEnabled:()=>Xr,getIsManualCaptureEnabled:()=>Zr,getIsMultiCurrencyEnabled:()=>oo,getIsPaymentRequestEnabled:()=>eo,getIsSavedCardsEnabled:()=>uo,getIsStripeBillingEnabled:()=>bo,getIsStripeBillingMigrationInProgress:()=>vo,getIsSubscriptionsPluginActive:()=>yo,getIsTestModeEnabled:()=>Jr,getIsTestModeOnboarding:()=>Kr,getIsWCPayEnabled:()=>Pr,getIsWCPaySubscriptionsEligible:()=>_o,getIsWCPaySubscriptionsEnabled:()=>po,getIsWooPayEnabled:()=>ho,getIsWooPayGlobalThemeSupportEnabled:()=>go,getPaymentMethodStatuses:()=>Dr,getPaymentRequestButtonBorderRadius:()=>co,getPaymentRequestButtonSize:()=>so,getPaymentRequestButtonTheme:()=>io,getPaymentRequestButtonType:()=>ao,getPaymentRequestLocations:()=>no,getSavingError:()=>lo,getSettings:()=>Nr,getShowWooPayIncompatibilityNotice:()=>Ro,getStripeBillingMigratedCount:()=>Io,getStripeBillingSubscriptionCount:()=>Oo,getWooPayCustomMessage:()=>So,getWooPayLocations:()=>fo,getWooPayStoreLogo:()=>Eo,isDirty:()=>Fr,isSavingSettings:()=>Mr});var E={};r.r(E),r.d(E,{saveOption:()=>hn,saveSettings:()=>nn,submitStripeBillingSubscriptionMigration:()=>yn,updateAccountBusinessSupportEmail:()=>Xo,updateAccountBusinessSupportPhone:()=>en,updateAccountStatementDescriptor:()=>Zo,updateAccountStatementDescriptorKana:()=>Ko,updateAccountStatementDescriptorKanji:()=>Jo,updateAdvancedFraudProtectionSettings:()=>pn,updateDepositScheduleInterval:()=>tn,updateDepositScheduleMonthlyAnchor:()=>on,updateDepositScheduleWeeklyAnchor:()=>rn,updateEnabledPaymentMethodIds:()=>$o,updateIsAppleGooglePayInPaymentMethodsOptionsEnabled:()=>zo,updateIsCardPresentEligible:()=>xo,updateIsDebugLogEnabled:()=>Wo,updateIsManualCaptureEnabled:()=>Vo,updateIsMultiCurrencyEnabled:()=>Go,updateIsPaymentRequestEnabled:()=>Lo,updateIsSavedCardsEnabled:()=>Po,updateIsSavingSettings:()=>Bo,updateIsStripeBillingEnabled:()=>_n,updateIsTestModeEnabled:()=>Ho,updateIsWCPayEnabled:()=>ko,updateIsWCPaySubscriptionsEnabled:()=>Qo,updateIsWooPayEnabled:()=>sn,updateIsWooPayGlobalThemeSupportEnabled:()=>cn,updatePaymentRequestButtonBorderRadius:()=>Fo,updatePaymentRequestButtonSize:()=>Do,updatePaymentRequestButtonTheme:()=>Mo,updatePaymentRequestButtonType:()=>jo,updatePaymentRequestLocations:()=>an,updateProtectionLevel:()=>mn,updateSelectedPaymentMethod:()=>Yo,updateSettings:()=>Uo,updateUnselectedPaymentMethod:()=>qo,updateWooPayCustomMessage:()=>dn,updateWooPayLocations:()=>ln,updateWooPayStoreLogo:()=>un});var f={};r.r(f),r.d(f,{getSettings:()=>gn});var w={};r.r(w),r.d(w,{getCardReaderStats:()=>En,getCardReaderStatsError:()=>fn,getCardReaders:()=>wn});var T={};r.r(T),r.d(T,{updateCardReaderStats:()=>Tn,updateCardReaders:()=>Rn,updateErrorForCardReaderStats:()=>bn,updateErrorForCardReaders:()=>vn});var R={};r.r(R),r.d(R,{getCardReaderStats:()=>On,getCardReaders:()=>In});var b={};r.r(b),r.d(b,{getActiveLoanSummary:()=>xn,getActiveLoanSummaryError:()=>jn,getLoans:()=>Dn,getLoansError:()=>Mn});var v={};r.r(v),r.d(v,{updateActiveLoanSummary:()=>Fn,updateErrorForActiveLoanSummary:()=>Un,updateErrorForLoans:()=>Ln,updateLoans:()=>kn});var O={};r.r(O),r.d(O,{getActiveLoanSummary:()=>zn,getLoans:()=>$n});var I={};r.r(I),r.d(I,{getDocuments:()=>Hn,getDocumentsError:()=>Wn,getDocumentsSummary:()=>Qn,getDocumentsSummaryError:()=>Zn});var A={};r.r(A),r.d(A,{updateDocuments:()=>Jn,updateDocumentsSummary:()=>Xn,updateErrorForDocuments:()=>Kn,updateErrorForDocumentsSummary:()=>ea});var N={};r.r(N),r.d(N,{formatQueryFilters:()=>ta,getDocuments:()=>ra,getDocumentsSummary:()=>oa});var C={};r.r(C),r.d(C,{getPaymentIntent:()=>aa,getPaymentIntentError:()=>sa});var P={};r.r(P),r.d(P,{getAuthorization:()=>ma,getAuthorizations:()=>la,getAuthorizationsError:()=>pa,getAuthorizationsSummary:()=>ya,getAuthorizationsSummaryError:()=>ha,getIsRequesting:()=>ga});var x={};r.r(x),r.d(x,{setIsRequestingAuthorization:()=>Ra,submitCancelAuthorization:()=>va,submitCaptureAuthorization:()=>ba,updateAuthorization:()=>wa,updateAuthorizations:()=>Ea,updateAuthorizationsSummary:()=>Ta,updateErrorForAuthorizations:()=>fa,updateErrorForAuthorizationsSummary:()=>Oa});var j={};r.r(j),r.d(j,{getAuthorization:()=>Aa,getAuthorizations:()=>Ia,getAuthorizationsSummary:()=>Na});var D={};r.r(D),r.d(D,{getFile:()=>ja,getFileError:()=>Da});var M={};r.r(M),r.d(M,{updateErrorForFiles:()=>Fa,updateFiles:()=>Ma});var F={};r.r(F),r.d(F,{getFile:()=>Ua});var U={};r.r(U),r.d(U,{getPmPromotions:()=>za,getPmPromotionsError:()=>$a});var k={};r.r(k),r.d(k,{activatePmPromotion:()=>Va,dismissPmPromotion:()=>Ha,updateErrorForPmPromotions:()=>qa,updatePmPromotions:()=>Ya});var L={};r.r(L),r.d(L,{getPmPromotions:()=>Ga});var z={};r.r(z),r.d(z,{getAvailableCurrencies:()=>ts,getCurrencies:()=>es,getCurrencySettings:()=>ns,getDefaultCurrency:()=>os,getEnabledCurrencies:()=>rs,getStoreSettings:()=>as});var $={};r.r($),r.d($,{saveOption:()=>ys,submitCurrencySettings:()=>ps,submitEnabledCurrenciesUpdate:()=>ms,submitStoreSettingsUpdate:()=>_s,updateAvailableCurrencies:()=>is,updateCurrencies:()=>ss,updateCurrencySettings:()=>us,updateDefaultCurrency:()=>ds,updateEnabledCurrencies:()=>cs,updateStoreSettings:()=>ls});var B={};r.r(B),r.d(B,{getCurrencies:()=>hs,getCurrencySettings:()=>gs,getStoreSettings:()=>Ss});var Y=r(1609),q=r.n(Y),V=r(5338);(0,Y.createContext)({isActive:!1,setActive:()=>null,isCompleted:!1,setCompleted:()=>null,taskId:""}),(0,Y.createContext)({activeTask:"",setActiveTask:()=>null,completedTasks:{},setCompletedTasks:()=>null});var H=r(4848);const W=window.wp.components;function G(e){var t,r,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=G(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}const Q=function(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=G(e))&&(o&&(o+=" "),o+=t);return o},Z=window.wp.primitives;const J=e=>{var{children:t,actions:r,className:o}=e,n=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(e,["children","actions","className"]);return q().createElement(W.Modal,Object.assign({className:Q("wcpay-confirmation-modal",o)},n),t,q().createElement(Z.HorizontalRule,{className:"wcpay-confirmation-modal__separator"}),q().createElement("div",{className:"wcpay-confirmation-modal__footer"},r))},K=window.wp.i18n;r(5955),r(9031),r(4275),Y.Component;const X=({isLoading:e,display:t,placeholder:r,value:o,children:n})=>e?q().createElement("span",{className:t?`is-loadable-placeholder is-${t}`:"is-loadable-placeholder","aria-busy":"true"},void 0===r?n||o:r):q().createElement(q().Fragment,null,n||o),ee=e=>{const t=q().createElement("p",{style:{lineHeight:e.numLines}},"Block placeholder");return q().createElement(X,Object.assign({},e,{placeholder:t,display:"block"}))},te=({Icon:e,label:t})=>e?(0,H.jsxs)("span",{className:Q("woocommerce-payments__payment-method-icon"),children:[(0,H.jsx)(e,{}),t&&(0,H.jsx)("span",{className:"woocommerce-payments__payment-method-icon__label",children:t})]}):null,re=({children:e})=>(0,H.jsx)("div",{className:"wcpay-settings-layout",children:e}),oe=({description:e=()=>null,children:t,className:r,id:o})=>q().createElement("div",{className:Q("settings-section",r),id:o},q().createElement("div",{className:"settings-section__details"},q().createElement(e,null)),q().createElement("div",{className:"settings-section__controls"},t)),ne=window.wp.domReady;var ae=r.n(ne);const se=(e,t={})=>{var r;if(window.wcpaySettings){Object.assign(t,{is_test_mode:wcpaySettings.testMode,jetpack_connected:wcpaySettings.isJetpackConnected,wcpay_version:wcpaySettings.version,woo_country_code:wcpaySettings.connect.country,hosting_provider:null===(r=wcpaySettings.trackingInfo)||void 0===r?void 0:r.hosting_provider});for(const e in t)void 0===t[e]&&delete t[e]}ae()((()=>{var r,o;(null!==(o=null===(r=null===wc||void 0===wc?void 0:wc.tracks)||void 0===r?void 0:r.recordEvent)&&void 0!==o?o:wcTracks.recordEvent)(e,t)}))},ie=((0,Y.createContext)(window.wcpaySettings),window.wc.currency);var ce=r.n(ie);const de=window.lodash,ue=((0,K.__)("Australian dollar","woocommerce-payments"),(0,K.__)("Canadian dollar","woocommerce-payments"),(0,K.__)("Swiss franc","woocommerce-payments"),(0,K.__)("Danish krone","woocommerce-payments"),(0,K.__)("Euro","woocommerce-payments"),(0,K.__)("Pound sterling","woocommerce-payments"),(0,K.__)("Norwegian krone","woocommerce-payments"),(0,K.__)("New Zealand dollar","woocommerce-payments"),(0,K.__)("Swedish krona","woocommerce-payments"),(0,K.__)("United States (US) dollar","woocommerce-payments"),e=>wcpaySettings.zeroDecimalCurrencies.includes(e.toLowerCase())),le=(e,t="USD",r=null,o=!1)=>{const n=ue(t);n||(e/=100);const a=e<0,s=a?-1*e:e,i=a?"-":"",c=o?(e=>{const t=e.toUpperCase(),{currencyData:r,connect:{country:o="US"}}=wcpaySettings;if(r[o]?.code===t)return ce()(r[o]);const n=(0,de.find)(r,{code:t});if(n){const{defaultLocale:e={}}=n;return e.hasOwnProperty("decimalSeparator")&&e.hasOwnProperty("thousandSeparator")&&e.hasOwnProperty("symbolPosition")&&(n.decimalSeparator=e.decimalSeparator,n.thousandSeparator=e.thousandSeparator,n.symbolPosition=e.symbolPosition),ce()(n)}return null})(t):((e,t=null)=>{const{currencyData:r,connect:{country:o="US"}}=wcpaySettings,n=(0,de.find)(r,{code:e.toUpperCase()});if(n){if(null!==t&&t.toUpperCase()!==e.toUpperCase()||r[o]){const e=t?(0,de.find)(r,{code:t.toUpperCase()}):r[o];e&&(n.decimalSeparator=e.decimalSeparator,n.thousandSeparator=e.thousandSeparator,n.symbolPosition=e.symbolPosition)}return ce()(n)}return null})(t,r);if(null===c)return i+me(s,t,n);try{return i+("function"==typeof c.formatAmount?pe(c.formatAmount(s)):pe(c.formatCurrency(s)))}catch(e){return i+pe(me(s,t,n))}};function me(e,t,r){try{return e.toLocaleString(void 0,{style:"currency",currency:t,currencyDisplay:"narrowSymbol",dummy:r})}catch(o){return(0,K.sprintf)(r?"%s %i":"%s %.2f",t.toUpperCase(),e)}}function pe(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}const _e=window.wp.data,ye=window.wp.dataControls,he="/wc/v3/payments",ge="wc/payments",Se={SET_DEPOSIT:"SET_DEPOSIT",SET_DEPOSITS:"SET_DEPOSITS",SET_DEPOSITS_COUNT:"SET_DEPOSITS_COUNT",SET_ERROR_FOR_DEPOSIT_QUERY:"SET_ERROR_FOR_DEPOSIT_QUERY",SET_DEPOSITS_SUMMARY:"SET_DEPOSITS_SUMMARY",SET_ERROR_FOR_DEPOSITS_SUMMARY:"SET_ERROR_FOR_DEPOSITS_SUMMARY",SET_INSTANT_DEPOSIT:"SET_INSTANT_DEPOSIT",SET_ALL_DEPOSITS_OVERVIEWS:"SET_ALL_DEPOSITS_OVERVIEWS",SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:"SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS"},Ee=e=>JSON.stringify(e,Object.keys(e).sort()),fe={byId:{},queries:{},count:0,instant:{}},we=e=>e&&e.deposits||{},Te=(e,t)=>(we(e).byId||{})[t],Re=e=>{const t=we(e).overviews||{};if(!t.data)return{account:null,currencies:[]};const{deposit:r,balance:o,account:n}=t.data,a={lastPaid:r.last_paid,pending:o.pending,available:o.available,instant:o.instant},s={};for(const[e,t]of Object.entries(a))t?.forEach((t=>{const{currency:r}=t;s[r]||(s[r]={currency:r,lastPaid:void 0,pending:void 0,available:void 0,instant:void 0}),s[r][e]=t}));const i=Object.values(s);return{account:n,currencies:[...i.filter((e=>n.default_currency===e.currency)),...i.filter((e=>n.default_currency!==e.currency))]}},be=e=>(we(e).overviews||{}).error,ve=(e,t)=>{const r=Ee(t);return(we(e).queries||{})[r]||{}},Oe=(e,t)=>(ve(e,t).data||[]).map(Te.bind(void 0,e)),Ie=e=>we(e).count,Ae=(e,t)=>ve(e,t).error||{},Ne=(e,t)=>{const r=Ee(t);return(we(e).summary||{})[r]||{}},Ce=(e,t)=>Ne(e,t).data||{},Pe=(e,t)=>Ne(e,t).error||{},xe=e=>(we(e).instant||{}).data,je=window.wp.url,De=window.moment;var Me=r.n(De);const Fe=window.wp.date,Ue=(window.wc.number,e=>(0,je.addQueryArgs)("admin.php",e)),ke=(e,t=!1)=>{const r=t?Me()(e).endOf("day").utc().toISOString():Me()(e).startOf("day").utc().toISOString();return e&&(0,Fe.dateI18n)("Y-m-d H:i:s",r,!0)};function Le(e){return{type:Se.SET_DEPOSIT,data:e}}function ze(e){return{type:Se.SET_ALL_DEPOSITS_OVERVIEWS,data:e}}function $e(e,t){return{type:Se.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS,error:t}}function Be(e,t){return{type:Se.SET_DEPOSITS,query:e,data:t}}function Ye(e){return{type:Se.SET_DEPOSITS_COUNT,data:e}}function qe(e,t,r){return{type:Se.SET_ERROR_FOR_DEPOSIT_QUERY,query:e,data:t,error:r}}function Ve(e,t){return{type:Se.SET_DEPOSITS_SUMMARY,query:e,data:t}}function He(e,t,r){return{type:Se.SET_ERROR_FOR_DEPOSITS_SUMMARY,query:e,data:t,error:r}}function We(e){return{type:Se.SET_INSTANT_DEPOSIT,data:e}}function*Ge(e){try{yield(0,_e.dispatch)(ge).startResolution("getInstantDeposit",[e]);const t=yield(0,ye.apiFetch)({path:"/wc/v3/payments/deposits",method:"POST",data:{type:"instant",currency:e}});yield We(t),yield(0,_e.dispatch)(ge).invalidateResolutionForStoreSelector("getDeposits"),yield(0,_e.dispatch)(ge).invalidateResolutionForStoreSelector("getAllDepositsOverviews"),yield(0,_e.dispatch)("core/notices").createSuccessNotice((0,K.sprintf)((0,K.__)("Instant payout for %s in transit.","woocommerce-payments"),le(t.amount)),{actions:[{label:(0,K.__)("View details","woocommerce-payments"),url:Ue({page:"wc-admin",path:"/payments/payouts/details",id:t.id})}]})}catch{yield(0,_e.dispatch)("core/notices").createErrorNotice((0,K.__)("Error creating instant payout.","woocommerce-payments"))}finally{yield(0,_e.dispatch)(ge).finishResolution("getInstantDeposit",[e])}}function*Qe(e){if(/\W/.test(e))return;const t=(0,je.addQueryArgs)(`${he}/deposits/${e}`);try{const e=yield(0,ye.apiFetch)({path:t});yield Le(e)}catch(e){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving payout.","woocommerce-payments"))}}function*Ze(){const e=(0,je.addQueryArgs)(`${he}/deposits/overview-all`);try{const t=yield(0,ye.apiFetch)({path:e});yield ze(t)}catch(e){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving all payouts' overviews.","woocommerce-payments")),yield $e()}}const Je=e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:ke(e.dateBefore,!0),date_after:ke(e.dateAfter),date_between:e.dateBetween&&[ke(e.dateBetween[0]),ke(e.dateBetween[1],!0)],status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale}),Ke=`${he}/deposits/download`;function Xe(e){return(0,je.addQueryArgs)(Ke,Je(e))}function*et(e){const t=(0,je.addQueryArgs)(`${he}/deposits`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...Je(e)});try{const r=yield(0,ye.apiFetch)({path:t})||{};yield Be(e,r.data),yield Ye(r.total_count);for(const e in r.data)yield _e.controls.dispatch(ge,"finishResolution","getDeposit",[r.data[e].id])}catch(t){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving payouts.","woocommerce-payments")),yield qe(e,null,t)}}function*tt(e){const t=(0,je.addQueryArgs)(`${he}/deposits/summary`,Je(e));try{const r=yield(0,ye.apiFetch)({path:t});yield Ve(e,r)}catch(t){yield He(e,null,t)}}const rt={SET_TRANSACTIONS:"SET_TRANSACTIONS",SET_ERROR_FOR_TRANSACTIONS:"SET_ERROR_FOR_TRANSACTIONS",SET_TRANSACTIONS_SUMMARY:"SET_TRANSACTIONS_SUMMARY",SET_ERROR_FOR_TRANSACTIONS_SUMMARY:"SET_ERROR_FOR_TRANSACTIONS_SUMMARY",SET_FRAUD_OUTCOME_TRANSACTIONS:"SET_FRAUD_OUTCOME_TRANSACTIONS",SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS:"SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS",SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:"SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY",SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:"SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY"},ot={summary:{},fraudProtection:{review:{summary:{}},block:{summary:{}}}},nt=e=>e&&e.transactions||{},at=(e,t)=>{const r=Ee(t);return nt(e)[r]||{}},st=(e,t)=>at(e,t).data||[],it=(e,t)=>at(e,t).error||{},ct=(e,t)=>{const r=Ee(t);return nt(e).summary[r]||{}},dt=(e,t)=>ct(e,t).data||{},ut=(e,t)=>ct(e,t).error||{},lt=(e,t,r)=>{const o=Ee(r);return nt(e).fraudProtection?.[t]?.[o]||{}},mt=(e,t,r)=>lt(e,t,r).data||[],pt=(e,t,r)=>lt(e,t,r).error||{},_t=(e,t,r)=>{const o=Ee(r);return nt(e).fraudProtection?.[t]?.summary[o]||{}},yt=(e,t,r)=>_t(e,t,r).data||{},ht=(e,t,r)=>_t(e,t,r).error||{};function gt(e,t){return{type:rt.SET_TRANSACTIONS,query:e,data:t}}function St(e,t,r){return{type:rt.SET_ERROR_FOR_TRANSACTIONS,query:e,data:t,error:r}}function Et(e,t){return{type:rt.SET_TRANSACTIONS_SUMMARY,query:e,data:t}}function ft(e,t,r){return{type:rt.SET_ERROR_FOR_TRANSACTIONS_SUMMARY,query:e,data:t,error:r}}function wt(e,t,r){return{type:rt.SET_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:r}}function Tt(e,t,r){return{type:rt.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:null,error:r}}function Rt(e,t,r){return{type:rt.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:r}}function bt(e,t,r){return{type:rt.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:null,error:r}}const vt=e=>({user_email:e.userEmail,match:e.match,date_before:ke(e.dateBefore,!0),date_after:ke(e.dateAfter),date_between:e.dateBetween&&[ke(e.dateBetween[0]),ke(e.dateBetween[1],!0)],type_is:e.typeIs,type_is_not:e.typeIsNot,type_is_in:e.typeIsIn,source_device_is:e.sourceDeviceIs,source_device_is_not:e.sourceDeviceIsNot,channel_is:e.channelIs,channel_is_not:e.channelIsNot,customer_country_is:e.customerCountryIs,customer_country_is_not:e.customerCountryIsNot,risk_level_is:e.riskLevelIs,risk_level_is_not:e.riskLevelIsNot,store_currency_is:e.storeCurrencyIs,loan_id_is:e.loanIdIs,deposit_id:e.depositId,customer_currency_is:e.customerCurrencyIs,customer_currency_is_not:e.customerCurrencyIsNot,source_is:e.sourceIs,source_is_not:e.sourceIsNot,search:e.search,user_timezone:Me()(new Date).format("Z"),locale:e.locale});function*Ot(e){const t=(0,je.addQueryArgs)(`${he}/transactions`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...vt(e)});try{const r=yield(0,ye.apiFetch)({path:t});yield gt(e,r.data||[])}catch(t){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving transactions.","woocommerce-payments")),yield St(e,null,t)}}const It=`${he}/transactions/download`;function At(e){return(0,je.addQueryArgs)(It,vt(e))}function*Nt(e){const t=(0,je.addQueryArgs)(`${he}/transactions/summary`,vt(e));try{const r=yield(0,ye.apiFetch)({path:t});yield Et(e,r)}catch(t){yield ft(e,null,t)}}function*Ct(e,t){const r=(0,je.addQueryArgs)(`${he}/transactions/fraud-outcomes`,{status:e,page:t.paged,sort:t.orderby,pagesize:t.perPage,direction:t.order,additional_status:t.additionalStatus,...vt(t)});try{const o=yield(0,ye.apiFetch)({path:r});yield wt(e,t,o.data||[])}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield wt(e,t,[]));yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving transactions.","woocommerce-payments")),yield Tt(e,t,r)}}function*Pt(e,t){const r=(0,je.addQueryArgs)(`${he}/transactions/fraud-outcomes/summary`,{status:e,additional_status:t.additionalStatus}),o={count:0,total:0};try{const n=yield(0,ye.apiFetch)({path:r});yield Rt(e,t,n||o)}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield Rt(e,t,o));yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving on review transactions.","woocommerce-payments")),yield bt(e,t,r)}}function xt(e,t){return(0,je.addQueryArgs)(`${he}/transactions/fraud-outcomes/download`,{status:e,sort:t.orderby,direction:t.order,additional_status:t.additionalStatus,...vt(t)})}const jt={SET_CHARGE:"SET_CHARGE",SET_ERROR_FOR_CHARGE:"SET_ERROR_FOR_CHARGE"},Dt=(e,t)=>e.charges[t]&&e.charges[t].data?e.charges[t].data:{},Mt=(e,t)=>e.charges[t]&&e.charges[t].error?e.charges[t].error:{},Ft=(e,t)=>Dt(e,t),Ut=(e,t)=>Mt(e,t);function kt(e,t){return{type:jt.SET_CHARGE,id:e,data:t}}function Lt(e,t,r){return{type:jt.SET_ERROR_FOR_CHARGE,id:e,data:t,error:r}}function*zt(e){try{const t=yield(0,ye.apiFetch)({path:`${he}/charges/${e}`});yield kt(e,t)}catch(t){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving transaction.","woocommerce-payments")),yield Lt(e,null,t)}}function*$t(e){try{const t=yield(0,ye.apiFetch)({path:`${he}/charges/order/${e}`});yield kt(e,t)}catch(t){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving transaction.","woocommerce-payments")),yield Lt(e,null,t)}}const Bt={SET_TIMELINE:"SET_TIMELINE",SET_ERROR_FOR_TIMELINE:"SET_ERROR_FOR_TIMELINE"},Yt=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].data?e.timeline[t].data:{},qt=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].error?e.timeline[t].error:{};function Vt(e,t){return{id:e,type:Bt.SET_TIMELINE,data:t}}function Ht(e,t){return{id:e,type:Bt.SET_ERROR_FOR_TIMELINE,error:t}}function*Wt(e){try{const t=yield(0,ye.apiFetch)({path:`${he}/timeline/${e}`});yield Vt(e,t.data)}catch(t){yield Ht(e,t)}}const Gt={SET_DISPUTE:"SET_DISPUTE",SET_ERROR_FOR_DISPUTE:"SET_ERROR_FOR_DISPUTE",SET_DISPUTES:"SET_DISPUTES",SET_DISPUTES_SUMMARY:"SET_DISPUTES_SUMMARY"},Qt={byId:{},queries:{},summary:{},cached:{}},Zt=e=>e&&e.disputes||{},Jt=(e,t)=>(Zt(e).byId||{})[t],Kt=(e,t)=>{const r=Zt(e).byId||{};return r[t]?.error},Xt=(e,t)=>(Zt(e).cached||{})[t],er=(e,t)=>{const r=((e,t)=>{const r=Ee(t);return(Zt(e).queries||{})[r]||{}})(e,t).data||[];return r.map(Xt.bind(void 0,e))},tr=(e,t)=>((e,t)=>{const r=Ee(t);return(Zt(e).summary||{})[r]||{}})(e,t).data||{};var rr;!function(e){e.SET_PAYMENT_INTENT="SET_PAYMENT_INTENT",e.SET_ERROR_FOR_PAYMENT_INTENT="SET_ERROR_FOR_PAYMENT_INTENT"}(rr||(rr={}));const or=rr;function nr(e,t){return{type:or.SET_PAYMENT_INTENT,id:e,data:t}}function ar(e,t){return{type:or.SET_ERROR_FOR_PAYMENT_INTENT,id:e,error:t}}function*sr(e,t){var r;const o=e.payment_intent;try{yield(0,ye.apiFetch)({path:"/wc/v3/payments/refund/",method:"post",data:{charge_id:e.id,amount:e.amount,reason:t,order_id:null===(r=null==e?void 0:e.order)||void 0===r?void 0:r.id}}),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getTimeline"),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield _e.controls.dispatch("core/notices","createSuccessNotice",(0,K.sprintf)((0,K.__)("Refunded payment #%s.","woocommerce-payments"),o))}catch(e){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.sprintf)((0,K.__)("There has been an error refunding the payment #%s. Please try again later.","woocommerce-payments"),o))}}function*ir(e){try{const t=yield(0,ye.apiFetch)({path:`${he}/payment_intents/${e}`});yield nr(e,t)}catch(t){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving transaction.","woocommerce-payments")),yield ar(e,t)}}function cr(e){return{type:Gt.SET_DISPUTE,data:e}}function dr(e,t,r){return{type:Gt.SET_ERROR_FOR_DISPUTE,id:e,data:t,error:r}}function ur(e,t){return{type:Gt.SET_DISPUTES,query:e,data:t}}function lr(e,t){return{type:Gt.SET_DISPUTES_SUMMARY,query:e,data:t}}function*mr(e){const{id:t,payment_intent:r}=e;try{yield _e.controls.dispatch(ge,"startResolution","getDispute",[t]);const e=yield(0,ye.apiFetch)({path:`${he}/disputes/${t}/close`,method:"post"});yield cr(e),yield ir(r),yield _e.controls.dispatch(ge,"finishResolution","getDispute",[t]);const o=e.order?(0,K.sprintf)((0,K.__)("You have accepted the dispute for order #%s.","woocommerce-payments"),e.order.number):(0,K.__)("You have accepted the dispute.","woocommerce-payments");yield _e.controls.dispatch("core/notices","createSuccessNotice",o)}catch(e){const r=(0,K.__)("There has been an error accepting the dispute. Please try again later.","woocommerce-payments");yield _e.controls.dispatch("core/notices","createErrorNotice",r),yield _e.controls.dispatch(ge,"finishResolution","getDispute",[t])}}const pr=window.wc.wcSettings,_r=((0,K.__)("Bank cannot process","woocommerce-payments"),(0,K.__)("Check returned","woocommerce-payments"),(0,K.__)("Credit not processed","woocommerce-payments"),(0,K.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,K.__)("If your customer was not refunded appropriately, you will need to accept the dispute, or resolve the issue with your customer. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,K.__)("The customer claims that the purchased product was returned or the transaction was otherwise canceled, but you have not yet provided a refund or credit.","woocommerce-payments"),(0,K.__)("Demonstrate that you have refunded your customer through other means or that your customer is not entitled to a refund. You cannot issue a refund while a payment is being disputed. If you believe that your customer was entitled a refund that you did not provide, you can accept the dispute.","woocommerce-payments"),(0,K.__)("You should first get in touch with your customer. If you understand what their complaint is, there is a chance for you to explain the misunderstanding or to make it right. If you’re able to resolve the issue with your customer, you can ask that they withdraw the dispute.","woocommerce-payments"),(0,K.__)("If the cardholder agrees to withdraw the dispute, you should still submit evidence for the dispute using the forms on the next screen. In addition to the following evidence, your submission should include correspondence with the cardholder saying they would withdraw the dispute and a written statement from their card issuer confirming that the dispute has been withdrawn.","woocommerce-payments"),(0,K.__)("The cardholder claims a credit was not processed.","woocommerce-payments"),(0,K.__)("Customer initiated","woocommerce-payments"),(0,K.__)("Debit not authorized","woocommerce-payments"),(0,K.__)("Duplicate","woocommerce-payments"),(0,K.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,K.__)("If there were duplicate payments, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,K.__)("The customer claims they were charged multiple times for the same product or service.","woocommerce-payments"),(0,K.__)("Demonstrate that each payment was for a separate product or service.","woocommerce-payments"),(0,K.__)("Determine if your customer was incorrectly charged multiple times.","woocommerce-payments"),(0,K.__)("If they were not, collect any and all information documenting that each payment was made separately, such as copies of receipts. If the receipts don’t include the items purchased, be sure to include an itemized list. Each receipt should clearly indicate that the payments are for separate purchases of items or services. If you’ve been able to get in touch with the customer you should be sure to address any concerns they had in your evidence.","woocommerce-payments"),(0,K.__)("If there have been two or more separate payments, you should get in touch with your customer. If you understand what their complaint is, there is a chance for you to explain the misunderstanding or to make it right. If you’re able to resolve the issue with your customer, you can ask that they withdraw the dispute.","woocommerce-payments"),(0,K.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,K.__)("The cardholder claims this is a duplicate transaction.","woocommerce-payments"),(0,K.__)("Transaction unauthorized","woocommerce-payments"),(0,K.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,K.__)("If you believe the payment was actually made using a stolen credit card, you will need to accept the dispute. The credit card networks place liability for accepting unauthorized transactions with you, the business.","woocommerce-payments"),(0,K.__)("This is the most common reason for a dispute, and happens when a cardholder claims that they didn’t authorize the payment. This can happen if the card was lost or stolen and used to make an unauthorized transaction. It can also happen if the cardholder doesn’t recognize the payment as it appears on the billing statement from their card issuer.","woocommerce-payments"),(0,K.__)("Provide adequate payment and order details so that a legitimate customer recognizes it, or proves to the card issuer that their cardholder authorized the transaction.","woocommerce-payments"),(0,K.__)("Try to get in touch with your customer. Sometimes people forget about payments they make or don’t recognize the way they appear on their card statement. If this is the case, ask them to contact their card issuer and let them know they no longer dispute the transaction.","woocommerce-payments"),(0,K.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,K.__)("It may be more efficient—and provide a better customer experience—to accept an accidental dispute and charge the customer again, if appropriate. Even when a dispute is withdrawn, it usually takes approximately 75 days to be finalized. Remember, it doesn’t matter to the card networks whether you win or lose a dispute; what matters is how many disputes a business receives, regardless of how many disputes are won.","woocommerce-payments"),(0,K.__)("The cardholder claims this is an unauthorized transaction.","woocommerce-payments"),(0,K.__)("General","woocommerce-payments"),(0,K.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,K.__)("This is an uncategorized dispute, so you should contact the customer for additional details to find out why the payment was disputed.","woocommerce-payments"),(0,K.__)("Incorrect account details","woocommerce-payments"),(0,K.__)("Insufficient funds","woocommerce-payments"),(0,K.__)("Product not received","woocommerce-payments"),(0,K.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,K.__)("If you can not prove the customer received their product or service, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,K.__)("The customer claims they did not receive the products or services purchased.","woocommerce-payments"),(0,K.__)("Prove that the customer received a physical product or offline service, or made use of a digital product or online service. This must have occurred prior to the date the dispute was initiated.","woocommerce-payments"),(0,K.__)("First, get in touch with your customer. Understanding why they filed the dispute will be important for helping make sure your customer gets the product and will give you critical information to prevent this from happening to others.","woocommerce-payments"),(0,K.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,K.__)("The cardholder claims they did not receive the product.","woocommerce-payments"),(0,K.__)("Product unacceptable","woocommerce-payments"),(0,K.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,K.__)("If you can not prove the customer received their product or service as described, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,K.__)("The product or service was received but was defective, damaged, or not as described.","woocommerce-payments"),(0,K.__)("Demonstrate that the product or service was delivered as described at the time of purchase.","woocommerce-payments"),(0,K.__)("If the product or service is as described, provide specific information (invoice, contract, etc.) to refute the cardholder’s claims. Quality disputes are where the customer does not agree with the condition of merchandise or service received (e.g., a car repair situation or quality of a hotel room). There may be instances where you will need to obtain a neutral third-party opinion to help corroborate your claim against the cardholder. Provide as much specific information and documentation as possible to refute the cardholder’s claims. It is recommended that you address each point that the cardholder has made.","woocommerce-payments"),(0,K.__)("If the customer has not yet returned the product or canceled the service, provide specific information to that effect. You should double-check your incoming shipping records to verify that you have not received a return before you respond. If you have processed a credit or reversal for this transaction, provide evidence of this which includes the amount and date processed.","woocommerce-payments"),(0,K.__)("For products that have been repaired or replaced, provide evidence that the cardholder agreed to a repair or replacement, it has been received by the customer, and the repair or replacement has not since been disputed.","woocommerce-payments"),(0,K.__)("If your customer made no attempt to return the product or cancel the service, or if you provided a replacement product or service, make sure to note that as well.","woocommerce-payments"),(0,K.__)("If the customer withdraws their dispute you should still submit evidence using the forms on the next screen. Be sure to provide a letter or email from the cardholder stating that they are no longer in dispute.","woocommerce-payments"),(0,K.__)("The cardholder claims the product was unacceptable.","woocommerce-payments"),(0,K.__)("Subscription canceled","woocommerce-payments"),(0,K.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,K.__)("If you can not prove the customer’s subscription was canceled, and or they did not follow your cancellation policy, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,K.__)("The customer claims that you continued to charge them after a subscription was canceled.","woocommerce-payments"),(0,K.__)("Prove that the subscription was still active and that the customer was aware of, and did not follow, your cancellation procedure.","woocommerce-payments"),(0,K.__)("First, get in touch with your customer. If you understand what they believe happened, there is a chance for you to explain the misunderstanding or to make it right. ","woocommerce-payments"),(0,K.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,K.__)("Otherwise, use the forms on the next screen to submit evidence that the subscription was still active and that the customer was aware of, and did not follow, your cancellation procedure.","woocommerce-payments"),(0,K.__)("The cardholder claims a subscription was canceled.","woocommerce-payments"),(0,K.__)("Unrecognized","woocommerce-payments"),(0,K.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,K.__)("If you can not prove the customer’s subscription was canceled, and or they did not follow your cancellation policy, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,K.__)("The customer doesn’t recognize the payment appearing on their card statement.","woocommerce-payments"),(0,K.__)("Get your customer to withdraw the dispute by helping them identify the payment. Otherwise, challenge the dispute with appropriate evidence that proves the purchase was legitimate. ","woocommerce-payments"),(0,K.__)("First, try to get in touch with your customer. Sometimes people forget about payments they make or don’t recognize the way they appear on their card statement. If this is the case, ask them to contact their card issuer and let them know they no longer dispute the transaction. Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,K.__)("It may be more efficient—and provide a better customer experience—to accept an accidental dispute and charge the customer again, if appropriate. Even when a dispute is withdrawn, it usually takes approximately 75 days to be finalized. Remember, it doesn’t matter to the card networks whether you win or lose a dispute; what matters is how many disputes a business receives, regardless of how many disputes are won.","woocommerce-payments"),(0,K.__)("Non-compliant","woocommerce-payments"),(0,K.__)("Your customer’s bank claims this payment violates Visa’s rules.","woocommerce-payments"),(0,K.__)("The customer’s bank claims this transaction doesn’t conform to Visa’s network rules.","woocommerce-payments"),{warning_needs_response:(0,K.__)("Inquiry: Response needed","woocommerce-payments"),warning_under_review:(0,K.__)("Inquiry: Under review","woocommerce-payments"),warning_closed:(0,K.__)("Inquiry: Closed","woocommerce-payments"),needs_response:(0,K.__)("Response needed","woocommerce-payments"),under_review:(0,K.__)("Under review","woocommerce-payments"),charge_refunded:(0,K.__)("Charge refunded","woocommerce-payments"),won:(0,K.__)("Won","woocommerce-payments"),lost:(0,K.__)("Lost","woocommerce-payments")}),yr=(Object.entries(_r).map((([e,t])=>({label:t,value:e}))).filter((function(e){return null!=e})),["needs_response","warning_needs_response"]),hr=((0,K.__)("Dispute currency","woocommerce-payments"),(0,K.__)("All currencies","woocommerce-payments"),(0,K.__)("Show","woocommerce-payments"),(0,K.__)("Needs response","woocommerce-payments"),(0,K.__)("All disputes","woocommerce-payments"),(0,K.__)("Advanced filters","woocommerce-payments"),(0,pr.getSetting)("wcVersion")),gr=parseFloat(hr),Sr=(gr<7.8?(0,K.__)("Disputes match {{select /}} filters","woocommerce-payments"):(0,K.__)("Disputes match <select /> filters","woocommerce-payments"),(0,K.__)("Disputed on date","woocommerce-payments"),(0,K.__)("Remove dispute date filter","woocommerce-payments"),(0,K.__)("Select a dispute date filter match","woocommerce-payments"),gr<7.8?(0,K.__)("{{title}}Date{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,K.__)("<title>Date</title> <rule /> <filter />","woocommerce-payments"),(0,K.__)("Select a dispute date","woocommerce-payments"),(0,K.__)("Before","woocommerce-payments"),(0,K.__)("After","woocommerce-payments"),(0,K.__)("Between","woocommerce-payments"),(0,K.__)("Status","woocommerce-payments"),(0,K.__)("Remove dispute status filter","woocommerce-payments"),(0,K.__)("Select a dispute status filter match","woocommerce-payments"),gr<7.8?(0,K.__)("{{title}}Status{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,K.__)("<title>Status</title> <rule /> <filter />","woocommerce-payments"),(0,K.__)("Select a dispute status","woocommerce-payments"),(0,K._x)("Is","dispute status","woocommerce-payments"),(0,K._x)("Is not","dispute status","woocommerce-payments"),e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:ke(e.dateBefore,!0),date_after:ke(e.dateAfter),date_between:e.dateBetween&&[ke(e.dateBetween[0]),ke(e.dateBetween[1],!0)],search:"awaiting_response"===e.filter?yr:e.search,status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale})),Er=`${he}/disputes/download`;function fr(e){return(0,je.addQueryArgs)(Er,Sr(e))}function*wr(e){const t=(0,je.addQueryArgs)(`${he}/disputes/${e}`);try{const e=yield(0,ye.apiFetch)({path:t});yield cr(e)}catch(t){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving dispute.","woocommerce-payments")),yield dr(e,void 0,t)}}function*Tr(e){const t=(0,je.addQueryArgs)(`${he}/disputes`,{page:e.paged,pagesize:e.perPage,sort:(0,de.snakeCase)(e.orderBy),direction:e.order,...Sr(e)});try{const r=yield(0,ye.apiFetch)({path:t})||{};yield ur(e,r.data)}catch(e){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving disputes.","woocommerce-payments"))}}function*Rr(e){const t=(0,je.addQueryArgs)(`${he}/disputes/summary`,{page:e.paged,pagesize:e.perPage,...Sr(e)});try{const r=yield(0,ye.apiFetch)({path:t});yield lr(e,r)}catch(e){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving the summary of disputes.","woocommerce-payments"))}}const br={SET_SETTINGS:"SET_SETTINGS",SET_SETTINGS_VALUES:"SET_SETTINGS_VALUES",SET_IS_SAVING_SETTINGS:"SET_IS_SAVING_SETTINGS",SET_SELECTED_PAYMENT_METHOD:"SET_SELECTED_PAYMENT_METHOD",SET_UNSELECTED_PAYMENT_METHOD:"SET_UNSELECTED_PAYMENT_METHOD"},vr={isDirty:!1,isSaving:!1,savingError:null,data:{}},Or={},Ir=[],Ar=e=>e&&e.settings||Or,Nr=e=>Ar(e).data||Or,Cr=e=>Nr(e).duplicated_payment_method_ids||Or,Pr=e=>Nr(e).is_wcpay_enabled||!1,xr=e=>Nr(e).enabled_payment_method_ids||Ir,jr=e=>Nr(e).available_payment_method_ids||Ir,Dr=e=>Nr(e).payment_method_statuses||Or,Mr=e=>Ar(e).isSaving||!1,Fr=e=>Ar(e).isDirty||!1,Ur=e=>Nr(e).account_statement_descriptor||"",kr=e=>Nr(e).account_statement_descriptor_kanji||"",Lr=e=>Nr(e).account_statement_descriptor_kana||"",zr=e=>Nr(e).account_business_support_email||"",$r=e=>Nr(e).account_business_support_phone||"",Br=e=>Nr(e).account_domestic_currency||"",Yr=e=>Nr(e).deposit_schedule_interval||"",qr=e=>Nr(e).deposit_schedule_weekly_anchor||"",Vr=e=>Nr(e).deposit_schedule_monthly_anchor||"",Hr=e=>Nr(e).deposit_delay_days||"7",Wr=e=>Nr(e).deposit_completed_waiting_period||!1,Gr=e=>Nr(e).deposit_status||"",Qr=e=>Nr(e).deposit_restrictions||"",Zr=e=>Nr(e).is_manual_capture_enabled||!1,Jr=e=>Nr(e).is_test_mode_enabled||!1,Kr=e=>Nr(e).is_test_mode_onboarding||!1,Xr=e=>Nr(e).is_dev_mode_enabled||!1,eo=e=>Nr(e).is_payment_request_enabled||!1,to=e=>Nr(e).is_apple_google_pay_in_payment_methods_options_enabled||!1,ro=e=>Nr(e).is_debug_log_enabled||!1,oo=e=>Nr(e).is_multi_currency_enabled||!1,no=e=>Nr(e).payment_request_enabled_locations||Ir,ao=e=>Nr(e).payment_request_button_type||"",so=e=>Nr(e).payment_request_button_size||"",io=e=>Nr(e).payment_request_button_theme||"",co=e=>{const t=Nr(e)?.payment_request_button_border_radius;return 0===t||"0"===t||t?t:"undefined"==typeof wcpaySettings?4:parseInt(window?.wcpaySettings?.defaultExpressCheckoutBorderRadius||4,10)},uo=e=>Nr(e).is_saved_cards_enabled||!1,lo=e=>Ar(e).savingError,mo=e=>Nr(e).is_card_present_eligible||!1,po=e=>Nr(e).is_wcpay_subscriptions_enabled||!1,_o=e=>Nr(e).is_wcpay_subscriptions_eligible||!1,yo=e=>Nr(e).is_subscriptions_plugin_active||!1,ho=e=>Nr(e).is_woopay_enabled||!1,go=e=>Nr(e).is_woopay_global_theme_support_enabled||!1,So=e=>Nr(e).woopay_custom_message||"",Eo=e=>Nr(e).woopay_store_logo||"",fo=e=>Nr(e).woopay_enabled_locations||Ir,wo=e=>Nr(e).current_protection_level||"basic",To=e=>Nr(e).advanced_fraud_protection_settings||Ir,Ro=e=>Nr(e).show_woopay_incompatibility_notice||!1,bo=e=>Nr(e).is_stripe_billing_enabled||!1,vo=e=>Nr(e).is_migrating_stripe_billing||!1,Oo=e=>Nr(e).stripe_billing_subscription_count||0,Io=e=>Nr(e).stripe_billing_migrated_count||0,Ao=window.wp.apiFetch;var No=r.n(Ao);function Co(e){return{type:br.SET_SETTINGS_VALUES,payload:e}}function Po(e){return Co({is_saved_cards_enabled:e})}function xo(e){return Co({is_card_present_eligible:e})}function jo(e){return Co({payment_request_button_type:e})}function Do(e){return Co({payment_request_button_size:e})}function Mo(e){return Co({payment_request_button_theme:e})}function Fo(e){return Co({payment_request_button_border_radius:e})}function Uo(e){return{type:br.SET_SETTINGS,data:e}}function ko(e){return Co({is_wcpay_enabled:e})}function Lo(e){return Co({is_payment_request_enabled:e})}function zo(e){return Co({is_apple_google_pay_in_payment_methods_options_enabled:e})}function $o(e){return Co({enabled_payment_method_ids:[...e]})}function Bo(e,t){return{type:br.SET_IS_SAVING_SETTINGS,isSaving:e,error:t}}function Yo(e){return{type:br.SET_SELECTED_PAYMENT_METHOD,id:e}}function qo(e){return{type:br.SET_UNSELECTED_PAYMENT_METHOD,id:e}}function Vo(e){return Co({is_manual_capture_enabled:e})}function Ho(e){return Co({is_test_mode_enabled:e})}function Wo(e){return Co({is_debug_log_enabled:e})}function Go(e){return Co({is_multi_currency_enabled:e})}function Qo(e){return Co({is_wcpay_subscriptions_enabled:e})}function Zo(e){return Co({account_statement_descriptor:e})}function Jo(e){return Co({account_statement_descriptor_kanji:e})}function Ko(e){return Co({account_statement_descriptor_kana:e})}function Xo(e){return Co({account_business_support_email:e})}function en(e){return Co({account_business_support_phone:e})}function tn(e){return Co({deposit_schedule_interval:e})}function rn(e){return Co({deposit_schedule_weekly_anchor:e})}function on(e){return Co({deposit_schedule_monthly_anchor:""===e?null:parseInt(e,10)})}function*nn(){let e=null;try{const e=(0,_e.select)(ge).getSettings();yield Bo(!0,null);const t=yield(0,ye.apiFetch)({path:`${he}/settings`,method:"post",data:e});yield Co({payment_method_statuses:t.data.payment_method_statuses}),yield(0,_e.dispatch)("core/notices").createSuccessNotice((0,K.__)("Settings saved.","woocommerce-payments"))}catch(t){e=t,yield(0,_e.dispatch)("core/notices").createErrorNotice((0,K.__)("Error saving settings.","woocommerce-payments")),e.server_error&&(yield(0,_e.dispatch)("core/notices").createErrorNotice(e.server_error))}finally{yield Bo(!1,e)}return null===e}function an(e){return Co({payment_request_enabled_locations:[...e]})}function sn(e){return Co({is_woopay_enabled:e})}function cn(e){return Co({is_woopay_global_theme_support_enabled:e})}function dn(e){return Co({woopay_custom_message:e})}function un(e){return Co({woopay_store_logo:e})}function ln(e){return Co({woopay_enabled_locations:[...e]})}function mn(e){return Co({current_protection_level:e})}function pn(e){return Co({advanced_fraud_protection_settings:e})}function _n(e){return Co({is_stripe_billing_enabled:e})}function*yn(){try{yield(0,_e.dispatch)(ge).startResolution("scheduleStripeBillingMigration"),yield(0,ye.apiFetch)({path:`${he}/settings/schedule-stripe-billing-migration`,method:"post"})}catch(e){yield(0,_e.dispatch)("core/notices").createErrorNotice((0,K.__)("Error starting the Stripe Billing migration.","woocommerce-payments"))}yield(0,_e.dispatch)(ge).finishResolution("scheduleStripeBillingMigration")}function hn(e,t){No()({path:`${he}/settings/${e}`,method:"post",data:{value:t}}).catch((()=>{(0,_e.dispatch)("core/notices").createErrorNotice((0,K.__)("Error saving option","woocommerce-payments"))}))}function*gn(){const e=`${he}/settings`;try{const t=yield(0,ye.apiFetch)({path:e});yield Uo(t)}catch(e){yield(0,_e.dispatch)("core/notices").createErrorNotice((0,K.__)("Error retrieving settings.","woocommerce-payments"))}}const Sn={SET_CARD_READER_STATS:"SET_CARD_READER_STATS",SET_ERROR_FOR_CARD_READER_STATS:"SET_ERROR_FOR_CARD_READER_STATS",SET_READERS:"SET_READERS",SET_ERROR_FOR_CARD_READERS:"SET_ERROR_FOR_CARD_READERS"},En=(e,t)=>e.readers[t]&&e.readers[t].data?e.readers[t].data:{},fn=(e,t)=>e.readers[t]&&e.readers[t].error?e.readers[t].error:{},wn=e=>e.readers&&e.readers.list?e.readers.list:{};function Tn(e,t){return{type:Sn.SET_CARD_READER_STATS,id:e,data:t}}function Rn(e,t){return{type:Sn.SET_READERS,query:e,data:t}}function bn(e,t,r){return{type:Sn.SET_CARD_ERROR_FOR_READER_STATS,id:e,data:t,error:r}}function vn(e,t){return{type:Sn.SET_CARD_ERROR_FOR_READERS,data:e,error:t}}function*On(e,t){try{const r=yield(0,ye.apiFetch)({path:`${he}/readers/charges/${t}`});yield Tn(e,r)}catch(t){yield bn(e,null,t)}}function*In(e){const t=(0,je.addQueryArgs)(`${he}/readers`,{limit:e.limit});try{const r=yield(0,ye.apiFetch)({path:t})||{};yield Rn(e,r)}catch(e){yield vn(null,e)}}var An;!function(e){e.SET_ACTIVE_LOAN_SUMMARY="SET_ACTIVE_LOAN_SUMMARY",e.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY="SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY",e.SET_LOANS="SET_LOANS",e.SET_ERROR_FOR_LOANS="SET_ERROR_FOR_LOANS"}(An||(An={}));const Nn=An,Cn={},Pn=e=>e&&e.capital||{},xn=e=>Pn(e).summary,jn=e=>Pn(e).summaryError,Dn=e=>Pn(e).loans||[],Mn=e=>Pn(e).loansError;function Fn(e){return{type:Nn.SET_ACTIVE_LOAN_SUMMARY,data:e}}function Un(e){return{type:Nn.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY,error:e}}function kn(e){return{type:Nn.SET_LOANS,data:e.data}}function Ln(e){return{type:Nn.SET_ERROR_FOR_LOANS,error:e}}function*zn(){const e=`${he}/capital/active_loan_summary`;try{const t=yield(0,ye.apiFetch)({path:e});yield Fn(t)}catch(e){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield Un(e)}}function*$n(){const e=`${he}/capital/loans`;try{const t=yield(0,ye.apiFetch)({path:e});yield kn(t)}catch(e){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield Ln(e)}}const Bn={SET_DOCUMENTS:"SET_DOCUMENTS",SET_ERROR_FOR_DOCUMENTS:"SET_ERROR_FOR_DOCUMENTS",SET_DOCUMENTS_SUMMARY:"SET_DOCUMENTS_SUMMARY",SET_ERROR_FOR_DOCUMENTS_SUMMARY:"SET_ERROR_FOR_DOCUMENTS_SUMMARY"},Yn={summary:{}},qn=e=>e&&e.documents||{},Vn=(e,t)=>{const r=Ee(t);return qn(e)[r]||{}},Hn=(e,t)=>Vn(e,t).data||[],Wn=(e,t)=>Vn(e,t).error||{},Gn=(e,t)=>{const r=Ee(t);return qn(e).summary[r]||{}},Qn=(e,t)=>Gn(e,t).data||{},Zn=(e,t)=>Gn(e,t).error||{};function Jn(e,t){return{type:Bn.SET_DOCUMENTS,query:e,data:t}}function Kn(e,t,r){return{type:Bn.SET_ERROR_FOR_DOCUMENTS,query:e,data:t,error:r}}function Xn(e,t){return{type:Bn.SET_DOCUMENTS_SUMMARY,query:e,data:t}}function ea(e,t,r){return{type:Bn.SET_ERROR_FOR_DOCUMENTS_SUMMARY,query:e,data:t,error:r}}const ta=e=>({user_email:e.userEmail,match:e.match,date_before:ke(e.dateBefore,!0),date_after:ke(e.dateAfter),date_between:e.dateBetween&&[ke(e.dateBetween[0]),ke(e.dateBetween[1],!0)],type_is:e.typeIs,type_is_not:e.typeIsNot});function*ra(e){const t=(0,je.addQueryArgs)(`${he}/documents`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...ta(e)});try{const r=yield(0,ye.apiFetch)({path:t});yield Jn(e,r.data||[])}catch(t){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving documents.","woocommerce-payments")),yield Kn(e,null,t)}}function*oa(e){const t=(0,je.addQueryArgs)(`${he}/documents/summary`,ta(e));try{const r=yield(0,ye.apiFetch)({path:t});yield Xn(e,r)}catch(t){yield ea(e,null,t)}}const na={},aa=({paymentIntents:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.data)||{}},sa=({paymentIntents:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.error)||{}},ia={SET_AUTHORIZATIONS:"SET_AUTHORIZATIONS",SET_AUTHORIZATION:"SET_AUTHORIZATION",SET_ERROR_FOR_AUTHORIZATIONS:"SET_ERROR_FOR_AUTHORIZATIONS",SET_AUTHORIZATIONS_SUMMARY:"SET_AUTHORIZATIONS_SUMMARY",SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY:"SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY",SET_IS_REQUESTING_AUTHORIZATION:"SET_IS_REQUESTING_AUTHORIZATION"},ca={summary:{},byId:{},isRequesting:!1},da=e=>e&&e.authorizations||{},ua=(e,t)=>{const r=Ee(t);return da(e)[r]||{}},la=(e,t)=>ua(e,t).data||[],ma=(e,t)=>(da(e).byId||{})[t],pa=(e,t)=>ua(e,t).error||{},_a=(e,t)=>{const r=Ee(t);return da(e).summary[r]||{}},ya=(e,t)=>_a(e,t).data||{},ha=(e,t)=>_a(e,t).error||{},ga=e=>da(e).isRequesting,Sa=e=>{var t;const r={wcpay_missing_order:(0,K.__)("The order could not be found.","woocommerce-payments"),wcpay_refunded_order_uncapturable:(0,K.__)("Payment cannot be processed for partially or fully refunded orders.","woocommerce-payments"),wcpay_intent_order_mismatch:(0,K.__)("The payment cannot be processed due to a mismatch with order details.","woocommerce-payments"),wcpay_payment_uncapturable:(0,K.__)("This payment cannot be processed in its current state.","woocommerce-payments"),wcpay_capture_error:e=>{var t;return"amount_too_small"===(null===(t=e.data)||void 0===t?void 0:t.error_type)?(e=>{var t,r,o,n;if(!(null===(r=null===(t=e.data)||void 0===t?void 0:t.extra_details)||void 0===r?void 0:r.minimum_amount)||!(null===(n=null===(o=e.data)||void 0===o?void 0:o.extra_details)||void 0===n?void 0:n.minimum_amount_currency))return(0,K.__)("The payment amount is too small to be processed.","woocommerce-payments");const a=e.data.extra_details.minimum_amount_currency,s=le(e.data.extra_details.minimum_amount,a);return(0,K.sprintf)((0,K.__)("The minimum amount that can be processed is %1$s %2$s.","woocommerce-payments"),s,a.toUpperCase())})(e):(0,K.__)("The payment capture failed to complete.","woocommerce-payments")},wcpay_cancel_error:(0,K.__)("The payment cancellation failed to complete.","woocommerce-payments"),wcpay_server_error:(0,K.__)("An unexpected error occurred. Please try again later.","woocommerce-payments")},o=r[null!==(t=e.code)&&void 0!==t?t:""];return"function"==typeof o?o(e):null!=o?o:(0,K.__)("Unable to process the payment. Please try again later.","woocommerce-payments")};function Ea(e,t){return{type:ia.SET_AUTHORIZATIONS,data:t,query:e}}function fa(e,t){return{type:ia.SET_ERROR_FOR_AUTHORIZATIONS,query:e,error:t}}function wa(e){return{type:ia.SET_AUTHORIZATION,data:e}}function Ta(e,t){return{type:ia.SET_AUTHORIZATIONS_SUMMARY,data:t,query:e}}function Ra(e){return{type:ia.SET_IS_REQUESTING_AUTHORIZATION,data:e}}function*ba(e,t){try{yield _e.controls.dispatch(ge,"startResolution","getAuthorization",[e]),yield _e.controls.dispatch(ge,"setIsRequestingAuthorization",!0);const r=yield(0,ye.apiFetch)({path:`/wc/v3/payments/orders/${t}/capture_authorization`,method:"post",data:{payment_intent_id:e}}),o={payment_intent_id:r.id,captured:"succeeded"===r.status};yield wa(o),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getAuthorizations"),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getAuthorizationsSummary"),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactions"),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactionsSummary"),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getTimeline"),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getTransactions"),yield _e.controls.dispatch("core/notices","createSuccessNotice",(0,K.sprintf)((0,K.__)("Payment for order #%s captured successfully.","woocommerce-payments"),t))}catch(e){const r=(0,K.sprintf)((0,K.__)("There has been an error capturing the payment for order #%s.","woocommerce-payments"),t),o=Sa(e);yield _e.controls.dispatch("core/notices","createErrorNotice",`${r} ${o}`)}finally{yield _e.controls.dispatch(ge,"finishResolution","getAuthorization",[e]),yield _e.controls.dispatch(ge,"setIsRequestingAuthorization",!1)}}function*va(e,t){try{yield _e.controls.dispatch(ge,"startResolution","getAuthorization",[e]),yield _e.controls.dispatch(ge,"setIsRequestingAuthorization",!0);const r=yield(0,ye.apiFetch)({path:`/wc/v3/payments/orders/${t}/cancel_authorization`,method:"post",data:{payment_intent_id:e}}),o={payment_intent_id:r.id,captured:"succeeded"===r.status};yield wa(o),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getAuthorizations"),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getAuthorizationsSummary"),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactions"),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactionsSummary"),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getTimeline"),yield _e.controls.dispatch(ge,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield _e.controls.dispatch("core/notices","createSuccessNotice",(0,K.sprintf)((0,K.__)("Payment for order #%s canceled successfully.","woocommerce-payments"),t))}catch(e){const r=(0,K.sprintf)((0,K.__)("There has been an error canceling the payment for order #%s.","woocommerce-payments"),t),o=Sa(e);yield _e.controls.dispatch("core/notices","createErrorNotice",`${r} ${o}`)}finally{yield _e.controls.dispatch(ge,"finishResolution","getAuthorization",[e]),yield _e.controls.dispatch(ge,"setIsRequestingAuthorization",!1)}}function Oa(e,t){return{type:ia.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY,query:e,error:t}}function*Ia(e){var t;let{paged:r=1,per_page:o=25,orderby:n="created",order:a="asc"}=e;"capture_by"===n&&(n="created");const s=(0,je.addQueryArgs)(`${he}/authorizations`,{page:r,pagesize:o,sort:n,direction:a});try{const r=yield(0,ye.apiFetch)({path:s});yield Ea(e,null!==(t=r.data)&&void 0!==t?t:[])}catch(t){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield fa(e,t)}}function*Aa(e){try{if(e){const t=yield(0,ye.apiFetch)({path:`${he}/authorizations/${e}`}),{is_captured:r,payment_intent_id:o,created:n}=t;yield wa({payment_intent_id:o,captured:r,created:n})}}catch(e){"authorization_missing"!==e.code&&(yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving authorization.","woocommerce-payments")))}}function*Na(e){const t=(0,je.addQueryArgs)(`${he}/authorizations/summary`,{pagesize:e.per_page,sort:e.orderby,direction:e.order,page:e.paged});try{const r=yield(0,ye.apiFetch)({path:t});yield Ta(e,null!=r?r:[])}catch(t){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield Oa(e,t)}}var Ca;!function(e){e.SET_FILE="SET_FILE",e.SET_ERROR_FOR_FILES="SET_ERROR_FOR_FILES"}(Ca||(Ca={}));const Pa=Ca,xa={},ja=({files:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.data)||{}},Da=({files:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.error)||{}};function Ma(e,t){return{type:Pa.SET_FILE,id:e,data:t}}function Fa(e,t){return{type:Pa.SET_ERROR_FOR_FILES,id:e,error:t}}function*Ua(e){try{const t=yield(0,ye.apiFetch)({path:`${he}/file/${e}/details`});yield Ma(e,t)}catch(t){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving file.","woocommerce-payments")),yield Fa(e,t)}}var ka;!function(e){e.SET_PM_PROMOTIONS="SET_PM_PROMOTIONS",e.SET_ERROR_FOR_PM_PROMOTIONS="SET_ERROR_FOR_PM_PROMOTIONS"}(ka||(ka={}));const La={pmPromotions:void 0,pmPromotionsError:void 0},za=e=>{var t,r;return null!==(r=null===(t=e.pmPromotions)||void 0===t?void 0:t.pmPromotions)&&void 0!==r?r:[]},$a=e=>{var t;return null===(t=e.pmPromotions)||void 0===t?void 0:t.pmPromotionsError};function Ba(e){return function(e){return"object"==typeof e&&null!==e&&"code"in e&&"string"==typeof e.code}(e)?e:{code:"unknown_error"}}function Ya(e){return{type:ka.SET_PM_PROMOTIONS,data:e}}function qa(e){return{type:ka.SET_ERROR_FOR_PM_PROMOTIONS,error:e}}function*Va(e){const t=`${he}/pm-promotions/${e}/activate`;try{yield(0,ye.apiFetch)({path:t,method:"POST"}),yield _e.controls.dispatch("core/notices","createSuccessNotice",(0,K.__)("Promotion activated successfully!","woocommerce-payments")),yield _e.controls.dispatch("wc/payments","invalidateResolution","getPmPromotions",[])}catch(e){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error activating promotion. Please try again.","woocommerce-payments")),yield _e.controls.dispatch("wc/payments","updateErrorForPmPromotions",Ba(e))}}function*Ha(e){const t=`${he}/pm-promotions/${e}/dismiss`;try{yield(0,ye.apiFetch)({path:t,method:"POST"}),yield _e.controls.dispatch("core/notices","createSuccessNotice",(0,K.__)("Promotion dismissed.","woocommerce-payments")),yield _e.controls.dispatch("wc/payments","invalidateResolution","getPmPromotions",[])}catch(e){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error dismissing promotion. Please try again.","woocommerce-payments")),yield _e.controls.dispatch("wc/payments","updateErrorForPmPromotions",Ba(e))}}function Wa(e){if("object"!=typeof e||null===e)return!1;const t=e;return"string"==typeof t.id&&"string"==typeof t.promo_id&&"string"==typeof t.payment_method&&"string"==typeof t.payment_method_title&&"string"==typeof t.type&&("spotlight"===t.type||"badge"===t.type)&&"string"==typeof t.title&&"string"==typeof t.description&&"string"==typeof t.cta_label&&"string"==typeof t.tc_url&&"string"==typeof t.tc_label}function*Ga(){const e=`${he}/pm-promotions`;try{const t=yield(0,ye.apiFetch)({path:e});if(r=t,!Array.isArray(r)||!r.every(Wa))throw new Error("Invalid promotions data received from API");yield _e.controls.dispatch("wc/payments","updatePmPromotions",t)}catch(e){yield _e.controls.dispatch("core/notices","createErrorNotice",(0,K.__)("Error retrieving promotions. Please try again later.","woocommerce-payments")),yield _e.controls.dispatch("wc/payments","updateErrorForPmPromotions",(t=e,function(e){return"object"==typeof e&&null!==e&&"code"in e}(t)?t:{code:"unknown_error"}))}var t,r}(0,_e.registerStore)(ge,{reducer:(0,_e.combineReducers)({deposits:(e=fe,{type:t,query:r={},data:o=[],error:n})=>{const a=Ee(r);switch(t){case Se.SET_DEPOSIT:return{...e,byId:{...e.byId,[o.id]:o}};case Se.SET_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,data:o}};case Se.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,error:n}};case Se.SET_DEPOSITS:return{...e,byId:{...e.byId,...(0,de.keyBy)(o,"id")},queries:{...e.queries,[a]:{data:(0,de.map)(o,"id")}}};case Se.SET_DEPOSITS_COUNT:return{...e,count:o};case Se.SET_ERROR_FOR_DEPOSIT_QUERY:return{...e,queries:{...e.queries,[a]:{error:n}}};case Se.SET_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[a]:{data:o}}};case Se.SET_ERROR_FOR_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[a]:{error:n}}};case Se.SET_INSTANT_DEPOSIT:return{...e,instant:{...e.instant,data:o}}}return e},transactions:(e=ot,{type:t,query:r={},data:o=[],error:n,status:a})=>{const s=Ee(r);switch(t){case rt.SET_TRANSACTIONS:return{...e,[s]:{data:o}};case rt.SET_ERROR_FOR_TRANSACTIONS:return{...e,[s]:{error:n}};case rt.SET_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[s]:{data:o}}};case rt.SET_ERROR_FOR_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[s]:{error:n}}};case rt.SET_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},[s]:{data:o}}}};case rt.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},[s]:{error:n}}}};case rt.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},summary:{...e.fraudProtection?.[a]?.summary||{},[s]:{data:o}}}}};case rt.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},summary:{...e.fraudProtection?.[a]?.summary||{},[s]:{error:n}}}}}}return e},charges:(e={},{type:t,id:r,data:o,error:n})=>{switch(t){case jt.SET_CHARGE:e={...e,[r]:{...e[r],data:o}};break;case jt.SET_ERROR_FOR_CHARGE:e={...e,[r]:{...e[r],error:n}}}return e},timeline:(e={},{type:t,id:r,data:o,error:n})=>{switch(t){case Bt.SET_TIMELINE:e={...e,[r]:{data:o}};break;case Bt.SET_ERROR_FOR_TIMELINE:e={...e,[r]:{...e[r],error:n}}}return e},disputes:(e=Qt,{type:t,query:r={},data:o=[],id:n,error:a})=>{const s=Ee(r);switch(t){case Gt.SET_DISPUTE:return{...e,byId:{...e.byId,[o.id]:o}};case Gt.SET_ERROR_FOR_DISPUTE:e={...e,byId:{...e.byId,[n]:{error:a}}};break;case Gt.SET_DISPUTES:return{...e,cached:{...e.cached,...(0,de.keyBy)(o,"dispute_id")},queries:{...e.queries,[s]:{data:(0,de.map)(o,"dispute_id")}}};case Gt.SET_DISPUTES_SUMMARY:return{...e,summary:{...e.summary,[s]:{data:o}}}}return e},settings:(e=vr,{type:t,...r})=>{switch(t){case br.SET_SETTINGS:return{...e,data:r.data,isDirty:!1};case br.SET_SETTINGS_VALUES:return{...e,savingError:null,isDirty:!0,data:{...e.data,...r.payload}};case br.SET_IS_SAVING_SETTINGS:return{...e,isDirty:!(!r.isSaving&&!r.error)&&e.isDirty,isSaving:r.isSaving,savingError:r.error};case br.SET_SELECTED_PAYMENT_METHOD:return{...e,isDirty:!0,data:{...e.data,enabled_payment_method_ids:e.data.enabled_payment_method_ids.concat(r.id)}};case br.SET_UNSELECTED_PAYMENT_METHOD:return{...e,isDirty:!0,data:{...e.data,enabled_payment_method_ids:e.data.enabled_payment_method_ids.filter((e=>e!==r.id))}}}return e},readers:(e={},{type:t,id:r,data:o,error:n})=>{switch(t){case Sn.SET_CARD_READER_STATS:e={...e,[r]:{...e[r],data:o}};break;case Sn.SET_ERROR_FOR_CARD_READER_STATS:e={...e,[r]:{...e[r],error:n}};break;case Sn.SET_READERS:e={...e,list:o}}return e},capital:(e=Cn,t)=>{switch(t.type){case Nn.SET_ACTIVE_LOAN_SUMMARY:return Object.assign(Object.assign({},e),{summary:t.data,summaryError:void 0});case Nn.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY:return Object.assign(Object.assign({},e),{summary:void 0,summaryError:t.error});case Nn.SET_LOANS:return Object.assign(Object.assign({},e),{loans:t.data,loansError:void 0});case Nn.SET_ERROR_FOR_LOANS:return Object.assign(Object.assign({},e),{loans:void 0,loansError:t.error})}return e},documents:(e=Yn,{type:t,query:r={},data:o=[],error:n})=>{const a=Ee(r);switch(t){case Bn.SET_DOCUMENTS:return{...e,[a]:{data:o}};case Bn.SET_ERROR_FOR_DOCUMENTS:return{...e,[a]:{error:n}};case Bn.SET_DOCUMENTS_SUMMARY:return{...e,summary:{...e.summary,[a]:{data:o}}};case Bn.SET_ERROR_FOR_DOCUMENTS_SUMMARY:return{...e,summary:{...e.summary,[a]:{error:n}}}}return e},paymentIntents:(e=na,t)=>{const{type:r,id:o}=t;switch(r){case or.SET_PAYMENT_INTENT:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{data:t.data})});case or.SET_ERROR_FOR_PAYMENT_INTENT:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{error:t.error})});default:return e}},authorizations:(e=ca,t)=>{switch(t.type){case ia.SET_AUTHORIZATION:{const{data:r}=t;return Object.assign(Object.assign({},e),{byId:Object.assign(Object.assign({},e.byId),{[r.payment_intent_id]:Object.assign(Object.assign({},e.byId[r.payment_intent_id]),r)})})}case ia.SET_AUTHORIZATIONS:{const{data:r,query:o}=t;return Object.assign(Object.assign({},e),{[Ee(o)]:{data:r}})}case ia.SET_ERROR_FOR_AUTHORIZATIONS:{const{error:r,query:o}=t;return Object.assign(Object.assign({},e),{[Ee(o)]:{error:r}})}case ia.SET_AUTHORIZATIONS_SUMMARY:{const{data:r,query:o}=t;return Object.assign(Object.assign({},e),{summary:Object.assign(Object.assign({},e.summary),{[Ee(o)]:{data:r||{}}})})}case ia.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY:{const{query:r,error:o}=t;return Object.assign(Object.assign({},e),{summary:Object.assign(Object.assign({},e.summary),{[Ee(r)]:{error:o||""}})})}case ia.SET_IS_REQUESTING_AUTHORIZATION:{const{data:r}=t;return Object.assign(Object.assign({},e),{isRequesting:r})}}return e},files:(e=xa,t)=>{const{type:r,id:o}=t;switch(r){case Pa.SET_FILE:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{data:t.data})});case Pa.SET_ERROR_FOR_FILES:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{error:t.error})});default:return e}},pmPromotions:(e=La,t)=>{switch(t.type){case ka.SET_PM_PROMOTIONS:return Object.assign(Object.assign({},e),{pmPromotions:t.data,pmPromotionsError:void 0});case ka.SET_ERROR_FOR_PM_PROMOTIONS:return Object.assign(Object.assign({},e),{pmPromotions:void 0,pmPromotionsError:t.error})}return e}}),actions:{...t,...a,...c,...l,...h,...E,...T,...v,...A,..._,...x,...M,...k},controls:ye.controls,selectors:{...e,...n,...i,...u,...p,...S,...w,...b,...I,...C,...P,...D,...U},resolvers:{...o,...s,...d,...m,...g,...f,...R,...O,...N,...y,...j,...F,...L}});const Qa="/wc/v3/payments",Za="wc/payments/multi-currency",Ja={SET_CURRENCIES:"SET_CURRENCIES",SET_AVAILABLE_CURRENCIES:"SET_AVAILABLE_CURRENCIES",SET_ENABLED_CURRENCIES:"SET_ENABLED_CURRENCIES",SET_DEFAULT_CURRENCY:"SET_DEFAULT_CURRENCY",SET_CURRENCY_SETTINGS:"SET_CURRENCY_SETTINGS",SET_STORE_SETTINGS:"SET_STORE_SETTINGS"},Ka={},Xa=e=>e&&e||{},es=e=>Xa(e).currencies||{},ts=e=>es(e).available||{},rs=e=>es(e).enabled||{},os=e=>es(e).default||{},ns=e=>Xa(e).currency_settings||{},as=e=>Xa(e).settings||{};function ss(e){return{type:Ja.SET_CURRENCIES,data:e}}function is(e){return{type:Ja.SET_AVAILABLE_CURRENCIES,data:e}}function cs(e){return{type:Ja.SET_ENABLED_CURRENCIES,data:e}}function ds(e){return{type:Ja.SET_DEFAULT_CURRENCY,data:e}}function us(e,t){return{type:Ja.SET_CURRENCY_SETTINGS,data:{code:e,data:t}}}function ls(e){return{type:Ja.SET_STORE_SETTINGS,data:e}}function*ms(e){const t=Object.keys((0,_e.select)(Za).getEnabledCurrencies()),r=e.filter((e=>!t.includes(e))),o=t.filter((t=>!e.includes(t)));try{const t=yield(0,ye.apiFetch)({path:`${Qa}/multi-currency/update-enabled-currencies`,method:"POST",data:{enabled:e}});yield ss(t),yield(0,_e.dispatch)("core/notices").createSuccessNotice((0,K.__)("Enabled currencies updated.","woocommerce-payments")),se("wcpay_multi_currency_enabled_currencies_updated",{added_currencies:r,removed_currencies:o})}catch(e){yield(0,_e.dispatch)("core/notices").createErrorNotice((0,K.__)("Error updating enabled currencies.","woocommerce-payments"))}}function*ps(e,t){try{const r=yield(0,ye.apiFetch)({path:`${Qa}/multi-currency/currencies/${e}`,method:"POST",data:t});yield us(e,r),yield(0,_e.dispatch)("core/notices").createSuccessNotice((0,K.__)("Currency settings updated.","woocommerce-payments"))}catch(e){yield(0,_e.dispatch)("core/notices").createErrorNotice((0,K.__)("Error updating currency settings.","woocommerce-payments"))}}function*_s(e,t,r=!1){try{const o=yield(0,ye.apiFetch)({path:`${Qa}/multi-currency/update-settings`,method:"POST",data:{wcpay_multi_currency_enable_auto_currency:e?"yes":"no",wcpay_multi_currency_enable_storefront_switcher:t?"yes":"no"}});if(yield ls(o),r)return;yield(0,_e.dispatch)("core/notices").createSuccessNotice((0,K.__)("Store settings saved.","woocommerce-payments"))}catch(e){yield(0,_e.dispatch)("core/notices").createErrorNotice((0,K.__)("Error saving store settings.","woocommerce-payments"))}}function ys(e,t){No()({path:`${Qa}/settings/${e}`,method:"post",data:{value:t}}).catch((()=>{(0,_e.dispatch)("core/notices").createErrorNotice((0,K.__)("Error saving option","woocommerce-payments"))}))}function*hs(){const e=`${Qa}/multi-currency/currencies`;try{const t=yield(0,ye.apiFetch)({path:e});yield ss(t)}catch(e){yield(0,_e.dispatch)("core/notices").createErrorNotice((0,K.__)("Error retrieving currencies.","woocommerce-payments"))}}function*gs(e){const t=`${Qa}/multi-currency/currencies/${e}`;try{const r=yield(0,ye.apiFetch)({path:t});yield us(e,r)}catch(e){yield(0,_e.dispatch)("core/notices").createErrorNotice((0,K.__)("Error retrieving single currency settings.","woocommerce-payments"))}}function*Ss(){const e=`${Qa}/multi-currency/get-settings`;try{const t=yield(0,ye.apiFetch)({path:e});yield ls(t)}catch(e){yield(0,_e.dispatch)("core/notices").createErrorNotice((0,K.__)("Error retrieving store settings.","woocommerce-payments"))}}const Es=()=>(0,_e.useSelect)((e=>{const{getCurrencies:t,isResolving:r}=e(Za);return{currencies:t(),isLoading:r("getCurrencies",[])}}),[]),fs=()=>{const e=(0,_e.useSelect)((e=>{const{getEnabledCurrencies:t}=e(Za);return t()})),{submitEnabledCurrenciesUpdate:t}=(0,_e.useDispatch)(Za);return{enabledCurrencies:e,submitEnabledCurrenciesUpdate:t}},ws=()=>{const{storeSettings:e,isLoading:t}=(0,_e.useSelect)((e=>{const{getStoreSettings:t,isResolving:r}=e(Za);return{storeSettings:t(),isLoading:r("getStoreSettings",[])}})),{submitStoreSettingsUpdate:r}=(0,_e.useDispatch)(Za);return{storeSettings:e,isLoading:t,submitStoreSettingsUpdate:r}},Ts=()=>(0,_e.useSelect)((e=>{const{getDefaultCurrency:t}=e(Za);return t()}));(0,_e.registerStore)(Za,{reducer:(e=Ka,{type:t,data:r=[]})=>{switch(t){case Ja.SET_CURRENCIES:return{...e,currencies:r,available:r.available,enabled:r.enabled,default:r.default};case Ja.SET_AVAILABLE_CURRENCIES:return{...e,currencies:{...e,available:r.available},available:r.available};case Ja.SET_ENABLED_CURRENCIES:return{...e,currencies:{...e,enabled:r.enabled},enabled:r.enabled};case Ja.SET_DEFAULT_CURRENCY:return{...e,currencies:{...e,default:r.default},default:r.default};case Ja.SET_CURRENCY_SETTINGS:return{...e,currency_settings:{...e.currency_settings,[r.code]:r.data}};case Ja.SET_STORE_SETTINGS:return{...e,settings:{enable_auto_currency:r.wcpay_multi_currency_enable_auto_currency,enable_storefront_switcher:r.wcpay_multi_currency_enable_storefront_switcher,site_theme:r.site_theme,date_format:r.date_format,time_format:r.time_format,store_url:r.store_url}}}return e},actions:{...$},controls:ye.controls,selectors:{...z},resolvers:{...B}});const Rs=({isPreviewModalOpen:e,setPreviewModalOpen:t,isStorefrontSwitcherEnabledValue:r,isAutomaticSwitchEnabledValue:o})=>{const{storeSettings:n}=ws();return e&&(0,H.jsx)(W.Modal,{title:(0,K.__)("Preview","woocommerce-payments"),isDismissible:!0,className:"multi-currency-store-settings-preview-modal",shouldCloseOnClickOutside:!1,onRequestClose:()=>{t(!1)},children:(0,H.jsx)("iframe",{title:(0,K.__)("Preview","woocommerce-payments"),className:"multi-currency-store-settings-preview-iframe",src:"/"+n.store_url+"?is_mc_onboarding_simulation=1&enable_storefront_switcher="+r+"&enable_auto_currency="+o})})},bs=window.wp.element,vs=({children:e})=>(0,H.jsx)("ul",{children:e});function Os(e){return e.startsWith("{{/")?{type:"componentClose",value:e.replace(/\W/g,"")}:e.endsWith("/}}")?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.startsWith("{{")?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}function Is(e,t){let r,o,n=[];for(let a=0;a<e.length;a++){const s=e[a];if("string"!==s.type){if(void 0===t[s.value])throw new Error(`Invalid interpolation, missing component node: \`${s.value}\``);if("object"!=typeof t[s.value])throw new Error(`Invalid interpolation, component node must be a ReactElement or null: \`${s.value}\``);if("componentClose"===s.type)throw new Error(`Missing opening component token: \`${s.value}\``);if("componentOpen"===s.type){r=t[s.value],o=a;break}n.push(t[s.value])}else n.push(s.value)}if(r){const a=function(e,t){const r=t[e];let o=0;for(let n=e+1;n<t.length;n++){const e=t[n];if(e.value===r.value){if("componentOpen"===e.type){o++;continue}if("componentClose"===e.type){if(0===o)return n;o--}}}throw new Error("Missing closing component token `"+r.value+"`")}(o,e),s=Is(e.slice(o+1,a),t),i=(0,Y.cloneElement)(r,{},s);if(n.push(i),a<e.length-1){const r=Is(e.slice(a+1),t);n=n.concat(r)}}return n=n.filter(Boolean),0===n.length?null:1===n.length?n[0]:(0,Y.createElement)(Y.Fragment,null,...n)}function As(e){const{mixedString:t,components:r,throwErrors:o}=e;if(!r)return t;if("object"!=typeof r){if(o)throw new Error(`Interpolation Error: unable to process \`${t}\` because components is not an object`);return t}const n=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(Os)}(t);try{return Is(n,r)}catch(e){if(o)throw new Error(`Interpolation Error: unable to process \`${t}\` because of error \`${e.message}\``);return t}}const Ns=({onChange:e,checked:t=!1,currency:{flag:r,symbol:o,code:n,name:a},testId:s=null})=>{const i=(0,bs.useCallback)((t=>{e(n,t)}),[n,e]);return(0,H.jsx)("li",{className:"enabled-currency-checkbox","data-testid":s,children:(0,H.jsx)(W.CheckboxControl,{code:n,checked:t,onChange:i,label:As({mixedString:"{{flag /}} {{name /}} {{code /}}",components:{flag:(0,H.jsx)("span",{className:"enabled-currency-checkbox__flag",children:""!==r?r:(0,H.jsx)("div",{className:"enabled-currency-checkbox__flag-text",children:(0,H.jsx)("span",{children:n})})}),name:(0,H.jsx)("span",{children:a}),code:(0,H.jsxs)("span",{className:"enabled-currency-checkbox__code",children:["(",o,o!==n&&" "+n,")"]})}}),__nextHasNoMarginBottom:!0})})},Cs=((0,K.__)("any","woocommerce-payments"),(0,K.__)("one","woocommerce-payments"),(0,K.__)("two","woocommerce-payments"),(0,K.__)("three","woocommerce-payments"),(0,K.__)("four","woocommerce-payments"),(0,K.__)("five","woocommerce-payments"),(0,K.__)("six","woocommerce-payments"),(0,K.__)("seven","woocommerce-payments"),(0,K.__)("eight","woocommerce-payments"),(0,K.__)("nine","woocommerce-payments"),({className:e,children:t})=>(0,H.jsx)("ul",{className:e,children:t}));var Ps=r(9387);const xs=({symbol:e})=>(0,H.jsx)("div",{className:"currency-delete-illustration__wrapper",children:(0,H.jsxs)("div",{className:"currency-delete-illustration__illustrations",children:[e,(0,H.jsx)(Ps.A,{className:"currency-delete-illustration__currency-cross-icon"})]})}),js=r.p+"../assets/images/payment-methods/jcb.svg?ver=3351f2584f4a62ad094d",Ds=r.p+"../assets/images/cards/visa.svg?ver=f10d76e13a47cb867cca",Ms=r.p+"../assets/images/cards/mastercard.svg?ver=d21057587f14a719da45",Fs=r.p+"../assets/images/cards/amex.svg?ver=9035aad80e3ae7ac653c",Us=r.p+"../assets/images/payment-methods/woo.svg?ver=86a2411c2b2a56f57bc5",ks=r.p+"../assets/images/payment-methods/woo-short.svg?ver=e7eb126add68e8fde2b6",Ls=r.p+"../assets/images/cards/apple-pay.svg?ver=126e07a26632bc8a9c21",zs=r.p+"../assets/images/cards/google-pay.svg?ver=30aba48019e36097a19d",$s=r.p+"../assets/images/cards/diners.svg?ver=62451ea54fcf12af5e0d",Bs=r.p+"../assets/images/cards/discover.svg?ver=a19341de516c258e11fe",Ys=r.p+"../assets/images/cards/cb.svg?ver=375fa3d816484fa4b53c",qs=r.p+"../assets/images/cards/unionpay.svg?ver=e60ed9d9db08315ff5c9",Vs=r.p+"../assets/images/payment-methods/link.svg?ver=2af3c660d8ddc95442bb",Hs=r.p+"../assets/images/payment-methods/amazon-pay.svg?ver=25b9c686eee6a24ee6ff";const Ws=(e,t,r=!0)=>o=>{var{className:n}=o,a=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(o,["className"]);return q().createElement("img",Object.assign({className:Q("payment-method__icon",r?"":"no-border",n),src:e,alt:t},a))},Gs=(Ws(Hs,(0,K.__)("Amazon Pay","woocommerce-payments")),Ws(Fs,(0,K.__)("American Express","woocommerce-payments")),Ws(Ls,(0,K.__)("Apple Pay","woocommerce-payments")),Ws(Ys,(0,K.__)("Cartes Bancaires","woocommerce-payments")),Ws($s,(0,K.__)("Diners Club","woocommerce-payments")),Ws(Bs,(0,K.__)("Discover","woocommerce-payments")),Ws(zs,(0,K.__)("Google Pay","woocommerce-payments")),Ws(js,(0,K.__)("JCB","woocommerce-payments")));if(Ws(Vs,(0,K.__)("Link","woocommerce-payments")),Ws(Ms,(0,K.__)("Mastercard","woocommerce-payments")),Ws(qs,(0,K.__)("UnionPay","woocommerce-payments")),Ws(Ds,(0,K.__)("Visa","woocommerce-payments")),Ws(Us,(0,K.__)("WooPay","woocommerce-payments"),!1),Ws(ks,(0,K.__)("WooPay","woocommerce-payments"),!1),"undefined"==typeof wooPaymentsPaymentMethodDefinitions)throw new Error("wooPaymentsPaymentMethodDefinitions is undefined");const Qs=Object.keys(wooPaymentsPaymentMethodDefinitions).reduce(((e,t)=>(e[t]=Object.assign(Object.assign({},wooPaymentsPaymentMethodDefinitions[t]),{icon:({className:e})=>q().createElement("img",{src:wooPaymentsPaymentMethodDefinitions[t].settings_icon_url,alt:wooPaymentsPaymentMethodDefinitions[t].label,className:Q("payment-method__icon",e)})}),e)),{jcb:{id:"jcb",label:(0,K.__)("JCB","woocommerce-payments"),description:(0,K.__)("Let your customers pay with JCB, the only international payment brand based in Japan.","woocommerce-payments"),icon:Gs,currencies:["JPY"],stripe_key:"jcb_payments",allows_manual_capture:!1,allows_pay_later:!1,accepts_only_domestic_payment:!1,settings_icon_url:""}}),Zs=({code:e,label:t,symbol:r,onClick:o,className:n})=>{const[a,s]=(0,bs.useState)(!1),i=window.multiCurrencyPaymentMethodsMap,c=i&&i[e]&&Object.keys(i[e]).length>0,d=c?Object.keys(i[e]):[],u=(0,bs.useCallback)((()=>{c?s(!0):o(e)}),[s,c,o,e]),l=(0,bs.useCallback)((()=>{s(!1),o(e)}),[o,s,e]),m=(0,bs.useCallback)((()=>{s(!1)}),[s]);return(0,H.jsxs)(H.Fragment,{children:[a&&(0,H.jsxs)(J,{title:(0,K.sprintf)((0,K.__)("Remove %1$s","woocommerce-payments"),t),onRequestClose:m,className:"enabled-currency-delete-modal",actions:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(W.Button,{onClick:l,isPrimary:!0,isDestructive:!0,children:(0,K.__)("Remove","woocommerce-payments")}),(0,H.jsx)(W.Button,{onClick:m,isSecondary:!0,children:(0,K.__)("Cancel","woocommerce-payments")})]}),children:[(0,H.jsx)(xs,{symbol:r}),(0,H.jsx)("p",{children:As({mixedString:(0,K.sprintf)((0,K.__)("Are you sure you want to remove {{strong}}%s (%s){{/strong}}? Your customers will no longer be able to pay in this currency and use payment methods listed below.","woocommerce-payments"),t,e===r?e:[e,r].join(" ")),components:{strong:(0,H.jsx)("strong",{})}})}),(0,H.jsx)("ul",{children:d.map((e=>(0,H.jsx)("li",{children:(0,H.jsx)(te,{Icon:Qs[e].icon,label:Qs[e].label})},e)))}),(0,H.jsx)("p",{children:(0,K.sprintf)((0,K.__)("You can add %s (%s) again at any time in Multi-Currency settings.","woocommerce-payments"),t,e===r?e:[e,r].join(" "))})]}),(0,H.jsx)(W.Button,{isLink:!0,"aria-label":(0,K.sprintf)((0,K.__)("Remove %1$s as an enabled currency","woocommerce-payments"),t),className:n,onClick:u,__next40pxDefaultSize:!0,children:(0,H.jsx)(W.Icon,{icon:"trash"})})]})},Js=(0,Y.createContext)(),Ks=({currency:{code:e,flag:t,id:r,is_default:o,name:n,symbol:a,rate:s},onDeleteClick:i})=>{const{code:c,is_zero_decimal:d}=Ts(),{setCurrencyCodeToShowSettingsFor:u}=(0,Y.useContext)(Js);return(0,H.jsxs)("li",{className:Q("enabled-currency",r),children:[(0,H.jsxs)("div",{className:"enabled-currency__container",children:[(0,H.jsx)("div",{className:"enabled-currency__flag",children:""!==t?t:(0,H.jsx)("div",{className:"enabled-currency__flag-text",children:(0,H.jsx)("span",{children:e})})}),(0,H.jsx)("div",{className:"enabled-currency__label",children:n}),(0,H.jsxs)("div",{className:"enabled-currency__code",children:["(",a+(a===e?"":` ${e}`),")"]})]}),(0,H.jsx)("div",{className:"enabled-currency__rate",children:(()=>{const t=d?Number.parseFloat(1e3*s).toFixed(2):Number.parseFloat(s).toFixed(2);return o?(0,K.__)("Default currency","woocommerce-payments"):d?`1,000 ${c} → ${t} ${e}`:`1 ${c} → ${t} ${e}`})()}),(0,H.jsxs)("div",{className:"enabled-currency__actions",children:[!o&&(0,H.jsx)(W.Button,{isLink:!0,onClick:()=>{u(e)},"aria-label":(0,K.sprintf)((0,K.__)("Edit %1$s","woocommerce-payments"),n),className:"enabled-currency__action edit",__next40pxDefaultSize:!0,children:(0,K.__)("manage","woocommerce-payments")}),i&&(0,H.jsx)(Zs,{className:"enabled-currency__action delete",onClick:i,label:n,code:e,symbol:a})]})]})},Xs=({isLoading:e})=>(0,H.jsxs)("li",{className:Q("enabled-currency-placeholder","enabled-currency"),children:[(0,H.jsxs)("div",{className:"enabled-currency__container",children:[(0,H.jsx)("div",{className:"enabled-currency__flag",children:(0,H.jsx)(ee,{isLoading:e,numLines:1,children:(0,H.jsx)("div",{className:"enabled-currency__flag-text"})})}),(0,H.jsx)("div",{className:"enabled-currency__label",children:(0,H.jsx)(ee,{isLoading:e,numLines:1})}),(0,H.jsx)("div",{className:"enabled-currency__code",children:(0,H.jsx)(ee,{isLoading:e,numLines:1})})]}),(0,H.jsx)("div",{className:"enabled-currency__rate",children:(0,H.jsx)(ee,{isLoading:e,numLines:1})}),(0,H.jsx)("div",{className:"enabled-currency__actions",children:(0,H.jsx)(ee,{isLoading:e,numLines:1})})]}),ei=({className:e})=>{const t=(0,_e.useSelect)((e=>{const{getAvailableCurrencies:t}=e(Za);return t()})),r=Object.keys(t),o=(0,bs.useRef)(null),{enabledCurrencies:n,submitEnabledCurrenciesUpdate:a}=fs(),s=Object.keys(n),i=Ts().code;r.splice(r.indexOf(i),1);const[c,d]=(0,bs.useState)(""),[u,l]=(0,bs.useState)({}),m=c?r.filter((e=>{const{symbol:r,name:o}=t[e];return`${r} ${e} ${o}`.toLocaleLowerCase().indexOf(c.toLocaleLowerCase())>-1})):r,p=(0,bs.useCallback)((()=>{l(r.reduce(((e,t)=>(e[t]=s.includes(t),e)),{}))}),[s,r]);(0,bs.useEffect)((()=>{p()}),[JSON.stringify(r),JSON.stringify(s)]);const _=(e,t)=>{l((r=>({...r,[e]:t})))},[y,h]=(0,bs.useState)(!1),[g,S]=(0,bs.useState)(!1),E=(0,bs.useCallback)((()=>{h(!0)}),[h]),f=(0,bs.useCallback)((()=>{h(!1),S(!1),d(""),p()}),[h,p]);return(0,bs.useEffect)((()=>{y&&o&&!1===g&&S(o.current.offsetWidth)}),[JSON.stringify(m),y]),(0,H.jsxs)(H.Fragment,{children:[y&&(0,H.jsxs)(J,{title:(0,K.__)("Add enabled currencies","woocommerce-payments"),onRequestClose:f,className:"add-enabled-currencies-modal",actions:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(W.Button,{isSecondary:!0,onClick:f,__next40pxDefaultSize:!0,children:(0,K.__)("Cancel","woocommerce-payments")}),(0,H.jsx)(W.Button,{isPrimary:!0,onClick:()=>{h(!1),S(!1),d("");const e=Object.entries(u).filter((([,e])=>e)).map((([e])=>e));e.push(i),e.sort(),a(e)},__next40pxDefaultSize:!0,children:(0,K.__)("Update selected","woocommerce-payments")})]}),children:[(0,H.jsx)("div",{className:"add-enabled-currencies-modal__search",children:(0,H.jsx)(W.SearchControl,{__nextHasNoMarginBottom:!0,value:c,onChange:d,placeholder:(0,K.__)("Search currencies","woocommerce-payments")})}),(0,H.jsx)("h3",{children:c?(0,K.sprintf)((0,K.__)("Search results (%1$d currencies)","woocommerce-payments"),m.length):(0,K.__)("All currencies","woocommerce-payments")}),(0,H.jsx)("div",{className:"add-enabled-currencies-modal__content",ref:o,style:{width:g||"auto"},children:(0,H.jsx)(vs,{children:m.map((e=>(0,H.jsx)(Ns,{checked:u[e],onChange:_,currency:t[e]},t[e].id)))})})]}),(0,H.jsx)(W.Button,{variant:"secondary",className:e,onClick:E,"data-testid":"enabled-currencies-add-button",__next40pxDefaultSize:!0,children:(0,K.__)("Add/remove currencies","woocommerce-payments")})]})},ti=()=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("h2",{children:(0,K.__)("Enabled currencies","woocommerce-payments")}),(0,H.jsx)("p",{children:(0,bs.createInterpolateElement)((0,K.__)("Accept payments in multiple currencies. Prices are converted based on exchange rates and rounding rules. <learnMoreLink>Learn more</learnMoreLink>","woocommerce-payments"),{learnMoreLink:(0,H.jsx)(W.ExternalLink,{href:"https://woocommerce.com/document/woopayments/currencies/multi-currency-setup/#enabled-currencies"})})})]}),ri=()=>{const{isLoading:e}=Es(),{enabledCurrencies:t,submitEnabledCurrenciesUpdate:r}=fs(),o="wcpay-multi-currency",n=e=>{const o=Object.keys(t);o.splice(o.indexOf(e),1),r(o)},a=t?Object.keys(t):[];return(0,H.jsx)(oe,{description:ti,className:"multi-currency-settings-enabled-currencies-section",children:(0,H.jsxs)(W.Card,{className:`${o}__enabled-currencies`,children:[(0,H.jsxs)(W.CardBody,{className:`${o}__enabled-currencies-header`,children:[(0,H.jsx)("div",{children:(0,K.__)("Name","woocommerce-payments")}),(0,H.jsx)("div",{children:(0,K.__)("Exchange rate","woocommerce-payments")}),(0,H.jsx)("div",{})]}),(0,H.jsx)(W.CardDivider,{}),(0,H.jsx)(W.CardBody,{size:null,children:(0,H.jsxs)(Cs,{className:"enabled-currencies-list",children:[!e&&t&&a.map((e=>(0,H.jsx)(Ks,{currency:t[e],onDeleteClick:t[e].is_default?void 0:n},t[e].id))),e&&[1,2,3,4,5].map((e=>(0,H.jsx)(Xs,{isLoading:1},"loadable-placeholder-"+e)))]})}),(0,H.jsx)(W.CardDivider,{}),(0,H.jsx)(W.CardBody,{className:`${o}__available-currencies-container`,children:t&&(0,H.jsx)(ei,{className:`${o}__available-currencies-modal`})})]})})},oi=()=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("h2",{children:(0,K.__)("Store settings","woocommerce-payments")}),(0,H.jsx)("p",{children:(0,bs.createInterpolateElement)((0,K.__)("Store settings allow your customers to choose which currency they would like to use when shopping at your store. <learnMoreLink>Learn more</learnMoreLink>","woocommerce-payments"),{learnMoreLink:(0,H.jsx)(W.ExternalLink,{href:"https://woocommerce.com/document/woopayments/currencies/multi-currency-setup/#store-settings"})})})]}),ni=()=>{const{storeSettings:e,isLoading:t,submitStoreSettingsUpdate:r}=ws(),[o,n]=(0,Y.useState)(!1),[a,s]=(0,Y.useState)(!1),[i,c]=(0,Y.useState)(!1),[d,u]=(0,Y.useState)(!1),[l,m]=(0,Y.useState)(!1);return(0,Y.useEffect)((()=>{Object.keys(e).length&&(c(e.enable_storefront_switcher),s(e.enable_auto_currency))}),[s,c,e]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(oe,{description:oi,className:"multi-currency-settings-store-settings-section",children:(0,H.jsx)(ee,{isLoading:t,numLines:10,children:(0,H.jsxs)(W.Card,{className:"multi-currency-settings__wrapper",children:[(0,H.jsxs)(W.CardBody,{className:"wcpay-card-body",children:[(0,H.jsx)(W.CheckboxControl,{checked:a,onChange:e=>{s(e),m(!0)},"data-testid":"enable_auto_currency",label:(0,K.__)("Automatically switch customers to their local currency if it has been enabled","woocommerce-payments"),help:(0,bs.createInterpolateElement)((0,K.__)("Customers will be notified via store alert banner. <previewLink>Preview</previewLink>","woocommerce-payments"),{previewLink:(0,H.jsx)(W.Button,{isLink:!0,onClick:()=>{u(!0)},__next40pxDefaultSize:!0})}),__nextHasNoMarginBottom:!0}),"Storefront"===e.site_theme?(0,H.jsx)(W.CheckboxControl,{checked:i,onChange:e=>{c(e),m(!0)},"data-testid":"enable_storefront_switcher",label:(0,K.__)("Add a currency switcher to the Storefront theme on breadcrumb section.","woocommerce-payments"),help:(0,bs.createInterpolateElement)((0,K.sprintf)((0,K.__)("A currency switcher is also available in your widgets. <linkToWidgets>Configure now</linkToWidgets>","woocommerce-payments"),"widgets.php"),{linkToWidgets:(0,H.jsx)("a",{href:"widgets.php"})}),__nextHasNoMarginBottom:!0}):null]}),(0,H.jsx)(Rs,{isPreviewModalOpen:d,setPreviewModalOpen:u,isStorefrontSwitcherEnabledValue:!1,isAutomaticSwitchEnabledValue:!0})]})})}),(0,H.jsx)(oe,{className:"multi-currency-settings-save-settings-section",children:(0,H.jsx)(W.Button,{isPrimary:!0,isBusy:o,disabled:o||!l,onClick:()=>{n(!0),r(a,i),n(!1),m(!1)},__next40pxDefaultSize:!0,children:(0,K.__)("Save changes","woocommerce-payments")})})]})},ai=()=>(0,H.jsx)("div",{className:"multi-currency-settings",children:(0,H.jsxs)(re,{children:[(0,H.jsx)(ri,{}),(0,H.jsx)(ni,{})]})}),si=window.wc.components,ii=({storeCurrency:e,targetCurrency:t,currencyRate:r=null,roundingValue:o,charmValue:n})=>{const[a,s]=(0,Y.useState)(20),i=(0,Y.useMemo)((()=>{const e=parseFloat(a.toString().replace(/,/g,"."))*parseFloat(r||t.rate),s=(parseFloat(o)?Math.ceil(e/parseFloat(o))*parseFloat(o):e)+parseFloat(n);return isNaN(s)?(0,K.__)("Please enter a valid number","woocommerce-payments"):le(ue(t.code)?s:100*s,t.code,null,!0)}),[a,n,r,o,t]);return(0,H.jsx)(W.Card,{className:"single-currency-settings-preview-wrapper",children:(0,H.jsxs)(W.CardBody,{className:"wcpay-card-body",children:[(0,H.jsx)("div",{children:"left"===e.symbol_position?(0,H.jsx)(si.TextControlWithAffixes,{label:e.name,prefix:e.symbol,"data-testid":"store_currency_value",value:a.toString(),onChange:s}):(0,H.jsx)(si.TextControlWithAffixes,{label:e.name,suffix:e.symbol,"data-testid":"store_currency_value",value:a.toString(),onChange:s})}),(0,H.jsx)("div",{children:(0,H.jsx)(si.TextControlWithAffixes,{"data-testid":"calculated_value",label:t&&t.name,value:i,onChange:()=>null,disabled:!0})})]})})},ci={0:(0,K.__)("None","woocommerce-payments"),.25:"0.25","0.50":"0.50","1.00":"1.00 (recommended)","5.00":"5.00","10.00":"10.00"},di={1:"1",10:"10",25:"25",50:"50",100:"100 (recommended)",500:"500",1e3:"1000"},ui={"0.00":(0,K.__)("None","woocommerce-payments"),"-0.01":"-0.01","-0.05":"-0.05"},li={"0.00":(0,K.__)("None","woocommerce-payments"),"-1":"-1","-5":"-5","-10":"-10","-20":"-20","-25":"-25","-50":"-50","-100":"-100"},mi=()=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("h2",{children:(0,K.__)("Currency settings","woocommerce-payments")}),(0,H.jsx)("p",{children:(0,K.__)("Choose between automatic or manual exchange rates and modify formatting rules to refine the display of your prices.","woocommerce-payments")})]}),pi=()=>{var e,t;const{currencyCodeToShowSettingsFor:r,setCurrencyCodeToShowSettingsFor:o}=(0,Y.useContext)(Js),[n,a]=(0,Y.useState)(!1),{currencies:s}=Es(),{enabledCurrencies:i}=fs(),{storeSettings:c}=ws(),{currencySettings:d,isLoading:u,submitCurrencySettings:l}=(e=>{const{currencySettings:t,isLoading:r}=(0,_e.useSelect)((t=>{const{getCurrencySettings:r,isResolving:o}=t(Za);return{currencySettings:r(e),isLoading:o("getCurrencySettings",[e])}})),{submitCurrencySettings:o}=(0,_e.dispatch)(Za);return{currencySettings:t,isLoading:r,submitCurrencySettings:o}})(r),m=s.default?s.default:{},p=s.available?s.available[r]:{},_=p.is_zero_decimal?di:ci,y=p.is_zero_decimal?li:ui,h="automatic",g=p?.is_zero_decimal?"100":"1.00",S="0.00",[E,f]=(0,Y.useState)(h),[w,T]=(0,Y.useState)(0),[R,b]=(0,Y.useState)(g),[v,O]=(0,Y.useState)(S),[I,A]=(0,Y.useState)(!1);(0,Y.useEffect)((()=>{var e;d[r]&&(f(d[r].exchange_rate_type||h),T(d[r].manual_rate||0),b(null!==(e=d[r].price_rounding)&&void 0!==e?e:g),O(d[r].price_charm||S))}),[d,r,g]);const N=null!==(e=c.date_format)&&void 0!==e?e:"M j, Y",C=null!==(t=c.time_format)&&void 0!==t?t:"g:iA",P=p?(0,Fe.dateI18n)(`${N} ${C}`,Me().unix(p.last_updated).toISOString()):"";return(0,H.jsx)("div",{className:"single-currency-settings",children:(0,H.jsxs)(re,{children:[(0,H.jsxs)("h2",{className:"single-currency-settings-breadcrumb",children:[(0,H.jsx)(W.Button,{isLink:!0,onClick:()=>o(null),__next40pxDefaultSize:!0,children:(0,K.__)("Enabled currencies","woocommerce-payments")})," ","> ",p.name," (",p.code,")"," ",p.flag]}),(0,H.jsx)(oe,{description:mi,children:(0,H.jsx)(ee,{isLoading:u,numLines:33,children:(0,H.jsx)(W.Card,{className:"single-currency-settings-currency-settings",children:(0,H.jsxs)(W.CardBody,{className:"wcpay-card-body",children:[(0,H.jsx)("h4",{children:(0,K.__)("Exchange rate","woocommerce-payments")}),(0,H.jsx)("fieldset",{children:(0,H.jsxs)("ul",{children:[(0,H.jsx)("li",{children:(0,H.jsx)(W.RadioControl,{onChange:e=>{f(e),a(!0),"manual"===e&&T(w||p.rate)},options:[{description:p.last_updated?(0,K.sprintf)((0,K.__)("Current rate: 1 %s = %s %s (Last updated: %s)","woocommerce-payments"),m.code,p.rate,p.code,P):(0,K.__)("Error - Unable to fetch automatic rate for this currency","woocommerce-payments"),label:(0,K.__)("Fetch rates automatically","woocommerce-payments"),value:"automatic"},{description:(0,K.__)("Enter your fixed rate of exchange","woocommerce-payments"),label:(0,K.__)("Manual","woocommerce-payments"),value:"manual"}],selected:E})}),"manual"===E&&(0,H.jsx)("li",{children:(0,H.jsx)(W.TextControl,{"data-testid":"manual_rate_input",label:(0,K.__)("Manual Rate","woocommerce-payments"),help:(0,K.__)("Enter the manual rate you would like to use. Must be a positive number.","woocommerce-payments"),value:w||p.rate,onChange:e=>{T(e.replace(/,/g,".")),a(!0)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})})]})}),(0,H.jsx)("h4",{children:(0,K.__)("Formatting rules","woocommerce-payments")}),(0,H.jsx)("fieldset",{children:(0,H.jsxs)("ul",{children:[(0,H.jsx)("li",{children:(0,H.jsx)(W.SelectControl,{"data-testid":"price_rounding",label:(0,K.__)("Price rounding","woocommerce-payments"),help:As({mixedString:(0,K.sprintf)((0,K.__)("Make your %s prices consistent by rounding them up after they're converted. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),p.code),components:{learnMoreLink:(0,H.jsx)(W.ExternalLink,{href:"https://woocommerce.com/document/woopayments/currencies/multi-currency-setup/#price-rounding"})}}),value:parseFloat(R),onChange:e=>{b(e),a(!0)},options:Object.keys(_).map((e=>({value:parseFloat(e),label:_[e]}))),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})}),(0,H.jsx)("li",{children:(0,H.jsx)(W.SelectControl,{"data-testid":"price_charm",label:(0,K.__)("Charm pricing","woocommerce-payments"),help:As({mixedString:(0,K.sprintf)((0,K.__)("Reduce the converted price for a specific amount. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),p.code),components:{learnMoreLink:(0,H.jsx)(W.ExternalLink,{href:"https://woocommerce.com/document/woopayments/currencies/multi-currency-setup/#charm-pricing"})}}),value:parseFloat(v),onChange:e=>{O(e),a(!0)},options:Object.keys(y).map((e=>({value:parseFloat(e),label:y[e]}))),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})})]})})]})})})}),(0,H.jsx)(oe,{description:()=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("h2",{children:(0,K.__)("Preview","woocommerce-payments")}),(0,H.jsx)("p",{children:u?"":(0,K.sprintf)((0,K.__)("Enter a price in your default currency (%s) to see it converted to %s using the exchange rate and formatting rules above.","woocommerce-payments"),m.name,p.name)})]}),children:(0,H.jsx)(ee,{isLoading:u,numLines:8,children:(0,H.jsx)(ii,{className:"single-currency-settings-currency-preview",storeCurrency:m,targetCurrency:p,currencyRate:"manual"===E?w:null,roundingValue:R,charmValue:v})})}),(0,H.jsx)(oe,{className:"single-currency-settings-save-settings-section",children:(0,H.jsx)(W.Button,{isPrimary:!0,isBusy:I,disabled:I||!n,onClick:()=>{A(!0),l(p.code,{exchange_rate_type:E,manual_rate:w,price_rounding:R,price_charm:v}),isNaN(w)||(i[p.code].rate=Number(w)),A(!1),a(!1)},__next40pxDefaultSize:!0,children:(0,K.__)("Save changes","woocommerce-payments")})})]})})},_i=()=>{const[e,t]=(0,Y.useState)(null);return(0,H.jsx)(Js.Provider,{value:{currencyCodeToShowSettingsFor:e,setCurrencyCodeToShowSettingsFor:t},children:e?(0,H.jsx)(pi,{}):(0,H.jsx)(ai,{})})},yi=document.querySelector("#wcpay_multi_currency_settings_container");(0,V.H)(yi).render((0,H.jsx)(_i,{}))})()})();