Файловый менеджер - Редактировать - /home/harasnat/www/labour/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:()=>fe,getAllDepositsOverviewsError:()=>we,getDeposit:()=>Ee,getDepositQueryError:()=>ve,getDeposits:()=>Re,getDepositsCount:()=>be,getDepositsSummary:()=>Ae,getDepositsSummaryError:()=>Ie,getInstantDeposit:()=>Ne});var t={};r.r(t),r.d(t,{submitInstantDeposit:()=>He,updateAllDepositsOverviews:()=>Ue,updateDeposit:()=>Pe,updateDeposits:()=>ke,updateDepositsCount:()=>ze,updateDepositsSummary:()=>Ye,updateErrorForAllDepositsOverviews:()=>Le,updateErrorForDepositQuery:()=>Be,updateErrorForDepositsSummary:()=>$e,updateInstantDeposit:()=>qe});var o={};r.r(o),r.d(o,{getAllDepositsOverviews:()=>We,getDeposit:()=>Ve,getDeposits:()=>Je,getDepositsSummary:()=>Ke,getPayoutsCSVRequestURL:()=>Ze,payoutsDownloadEndpoint:()=>Qe});var n={};r.r(n),r.d(n,{getFraudOutcomeTransactions:()=>dt,getFraudOutcomeTransactionsError:()=>ut,getFraudOutcomeTransactionsSummary:()=>mt,getFraudOutcomeTransactionsSummaryError:()=>pt,getTransactions:()=>ot,getTransactionsError:()=>nt,getTransactionsSummary:()=>st,getTransactionsSummaryError:()=>it});var a={};r.r(a),r.d(a,{updateErrorForFraudOutcomeTransactions:()=>Et,updateErrorForFraudOutcomeTransactionsSummary:()=>wt,updateErrorForTransactions:()=>yt,updateErrorForTransactionsSummary:()=>St,updateFraudOutcomeTransactions:()=>gt,updateFraudOutcomeTransactionsSummary:()=>ft,updateTransactions:()=>_t,updateTransactionsSummary:()=>ht});var s={};r.r(s),r.d(s,{formatQueryFilters:()=>Tt,getFraudOutcomeTransactions:()=>At,getFraudOutcomeTransactionsExport:()=>Nt,getFraudOutcomeTransactionsSummary:()=>It,getTransactions:()=>Rt,getTransactionsCSVRequestURL:()=>vt,getTransactionsSummary:()=>Ot,transactionsDownloadEndpoint:()=>bt});var i={};r.r(i),r.d(i,{getCharge:()=>xt,getChargeError:()=>jt,getChargeFromOrder:()=>Dt,getChargeFromOrderError:()=>Ft});var c={};r.r(c),r.d(c,{updateCharge:()=>Mt,updateErrorForCharge:()=>Pt});var d={};r.r(d),r.d(d,{getCharge:()=>Ut,getChargeFromOrder:()=>Lt});var u={};r.r(u),r.d(u,{getTimeline:()=>zt,getTimelineError:()=>Bt});var l={};r.r(l),r.d(l,{updateErrorForTimeline:()=>$t,updateTimeline:()=>Yt});var m={};r.r(m),r.d(m,{getTimeline:()=>qt});var p={};r.r(p),r.d(p,{getCachedDispute:()=>Zt,getDispute:()=>Gt,getDisputeError:()=>Qt,getDisputes:()=>Jt,getDisputesSummary:()=>Kt});var _={};r.r(_),r.d(_,{refundCharge:()=>or,updateErrorForPaymentIntent:()=>rr,updatePaymentIntent:()=>tr});var y={};r.r(y),r.d(y,{getPaymentIntent:()=>nr});var h={};r.r(h),r.d(h,{acceptDispute:()=>dr,updateDispute:()=>ar,updateDisputes:()=>ir,updateDisputesSummary:()=>cr,updateErrorForDispute:()=>sr});var S={};r.r(S),r.d(S,{disputesDownloadEndpoint:()=>hr,getDispute:()=>gr,getDisputes:()=>Er,getDisputesCSVRequestURL:()=>Sr,getDisputesSummary:()=>fr});var g={};r.r(g),r.d(g,{getAccountBusinessSupportEmail:()=>Ur,getAccountBusinessSupportPhone:()=>Lr,getAccountDomesticCurrency:()=>kr,getAccountStatementDescriptor:()=>Fr,getAccountStatementDescriptorKana:()=>Pr,getAccountStatementDescriptorKanji:()=>Mr,getAdvancedFraudProtectionSettings:()=>go,getAvailablePaymentMethodIds:()=>Cr,getCompletedWaitingPeriod:()=>qr,getCurrentProtectionLevel:()=>So,getDepositDelayDays:()=>$r,getDepositRestrictions:()=>Vr,getDepositScheduleInterval:()=>zr,getDepositScheduleMonthlyAnchor:()=>Yr,getDepositScheduleWeeklyAnchor:()=>Br,getDepositStatus:()=>Hr,getDuplicatedPaymentMethodIds:()=>Ar,getEnabledPaymentMethodIds:()=>Nr,getIsCardPresentEligible:()=>io,getIsDebugLogEnabled:()=>Kr,getIsDevModeEnabled:()=>Zr,getIsManualCaptureEnabled:()=>Wr,getIsMultiCurrencyEnabled:()=>Xr,getIsPaymentRequestEnabled:()=>Jr,getIsSavedCardsEnabled:()=>ao,getIsStripeBillingEnabled:()=>fo,getIsStripeBillingMigrationInProgress:()=>wo,getIsSubscriptionsPluginActive:()=>lo,getIsTestModeEnabled:()=>Gr,getIsTestModeOnboarding:()=>Qr,getIsWCPayEnabled:()=>Ir,getIsWCPaySubscriptionsEligible:()=>uo,getIsWCPaySubscriptionsEnabled:()=>co,getIsWooPayEnabled:()=>mo,getIsWooPayGlobalThemeSupportEnabled:()=>po,getPaymentMethodStatuses:()=>xr,getPaymentRequestButtonBorderRadius:()=>no,getPaymentRequestButtonSize:()=>ro,getPaymentRequestButtonTheme:()=>oo,getPaymentRequestButtonType:()=>to,getPaymentRequestLocations:()=>eo,getSavingError:()=>so,getSettings:()=>Or,getShowWooPayIncompatibilityNotice:()=>Eo,getStripeBillingMigratedCount:()=>Ro,getStripeBillingSubscriptionCount:()=>To,getWooPayCustomMessage:()=>_o,getWooPayLocations:()=>ho,getWooPayStoreLogo:()=>yo,isDirty:()=>Dr,isSavingSettings:()=>jr});var E={};r.r(E),r.d(E,{saveOption:()=>ln,saveSettings:()=>Xo,submitStripeBillingSubscriptionMigration:()=>un,updateAccountBusinessSupportEmail:()=>Go,updateAccountBusinessSupportPhone:()=>Qo,updateAccountStatementDescriptor:()=>Ho,updateAccountStatementDescriptorKana:()=>Wo,updateAccountStatementDescriptorKanji:()=>Vo,updateAdvancedFraudProtectionSettings:()=>cn,updateDepositScheduleInterval:()=>Zo,updateDepositScheduleMonthlyAnchor:()=>Ko,updateDepositScheduleWeeklyAnchor:()=>Jo,updateEnabledPaymentMethodIds:()=>Po,updateIsCardPresentEligible:()=>Io,updateIsDebugLogEnabled:()=>Yo,updateIsManualCaptureEnabled:()=>zo,updateIsMultiCurrencyEnabled:()=>$o,updateIsPaymentRequestEnabled:()=>Mo,updateIsSavedCardsEnabled:()=>Ao,updateIsSavingSettings:()=>Uo,updateIsStripeBillingEnabled:()=>dn,updateIsTestModeEnabled:()=>Bo,updateIsWCPayEnabled:()=>Fo,updateIsWCPaySubscriptionsEnabled:()=>qo,updateIsWooPayEnabled:()=>tn,updateIsWooPayGlobalThemeSupportEnabled:()=>rn,updatePaymentRequestButtonBorderRadius:()=>jo,updatePaymentRequestButtonSize:()=>Co,updatePaymentRequestButtonTheme:()=>xo,updatePaymentRequestButtonType:()=>No,updatePaymentRequestLocations:()=>en,updateProtectionLevel:()=>sn,updateSelectedPaymentMethod:()=>Lo,updateSettings:()=>Do,updateUnselectedPaymentMethod:()=>ko,updateWooPayCustomMessage:()=>on,updateWooPayLocations:()=>an,updateWooPayStoreLogo:()=>nn});var f={};r.r(f),r.d(f,{getSettings:()=>mn});var w={};r.r(w),r.d(w,{getCardReaderStats:()=>_n,getCardReaderStatsError:()=>yn,getCardReaders:()=>hn});var T={};r.r(T),r.d(T,{updateCardReaderStats:()=>Sn,updateCardReaders:()=>gn,updateErrorForCardReaderStats:()=>En,updateErrorForCardReaders:()=>fn});var R={};r.r(R),r.d(R,{getCardReaderStats:()=>wn,getCardReaders:()=>Tn});var b={};r.r(b),r.d(b,{getActiveLoanSummary:()=>An,getActiveLoanSummaryError:()=>In,getLoans:()=>Nn,getLoansError:()=>Cn});var v={};r.r(v),r.d(v,{updateActiveLoanSummary:()=>xn,updateErrorForActiveLoanSummary:()=>jn,updateErrorForLoans:()=>Fn,updateLoans:()=>Dn});var O={};r.r(O),r.d(O,{getActiveLoanSummary:()=>Mn,getLoans:()=>Pn});var A={};r.r(A),r.d(A,{getDocuments:()=>Bn,getDocumentsError:()=>Yn,getDocumentsSummary:()=>qn,getDocumentsSummaryError:()=>Hn});var I={};r.r(I),r.d(I,{updateDocuments:()=>Vn,updateDocumentsSummary:()=>Gn,updateErrorForDocuments:()=>Wn,updateErrorForDocumentsSummary:()=>Qn});var N={};r.r(N),r.d(N,{formatQueryFilters:()=>Zn,getDocuments:()=>Jn,getDocumentsSummary:()=>Kn});var C={};r.r(C),r.d(C,{getPaymentIntent:()=>ea,getPaymentIntentError:()=>ta});var x={};r.r(x),r.d(x,{getAuthorization:()=>ia,getAuthorizations:()=>sa,getAuthorizationsError:()=>ca,getAuthorizationsSummary:()=>ua,getAuthorizationsSummaryError:()=>la,getIsRequesting:()=>ma});var j={};r.r(j),r.d(j,{setIsRequestingAuthorization:()=>ga,submitCancelAuthorization:()=>fa,submitCaptureAuthorization:()=>Ea,updateAuthorization:()=>ha,updateAuthorizations:()=>_a,updateAuthorizationsSummary:()=>Sa,updateErrorForAuthorizations:()=>ya,updateErrorForAuthorizationsSummary:()=>wa});var D={};r.r(D),r.d(D,{getAuthorization:()=>Ra,getAuthorizations:()=>Ta,getAuthorizationsSummary:()=>ba});var F={};r.r(F),r.d(F,{getFile:()=>Ia,getFileError:()=>Na});var M={};r.r(M),r.d(M,{updateErrorForFiles:()=>xa,updateFiles:()=>Ca});var P={};r.r(P),r.d(P,{getFile:()=>ja});var U={};r.r(U),r.d(U,{getAvailableCurrencies:()=>ka,getCurrencies:()=>La,getCurrencySettings:()=>Ya,getDefaultCurrency:()=>Ba,getEnabledCurrencies:()=>za,getStoreSettings:()=>$a});var L={};r.r(L),r.d(L,{saveOption:()=>Xa,submitCurrencySettings:()=>Ja,submitEnabledCurrenciesUpdate:()=>Za,submitStoreSettingsUpdate:()=>Ka,updateAvailableCurrencies:()=>Ha,updateCurrencies:()=>qa,updateCurrencySettings:()=>Ga,updateDefaultCurrency:()=>Wa,updateEnabledCurrencies:()=>Va,updateStoreSettings:()=>Qa});var k={};r.r(k),r.d(k,{getCurrencies:()=>es,getCurrencySettings:()=>ts,getStoreSettings:()=>rs});var z=r(1609),B=r.n(z),Y=r(5338);(0,z.createContext)({isActive:!1,setActive:()=>null,isCompleted:!1,setCompleted:()=>null,taskId:""}),(0,z.createContext)({activeTask:"",setActiveTask:()=>null,completedTasks:{},setCompletedTasks:()=>null});var $=r(4848);const q=window.wp.components;function H(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=H(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}const V=function(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=H(e))&&(o&&(o+=" "),o+=t);return o},W=window.wp.primitives;const G=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 B().createElement(q.Modal,Object.assign({className:V("wcpay-confirmation-modal",o)},n),t,B().createElement(W.HorizontalRule,{className:"wcpay-confirmation-modal__separator"}),B().createElement("div",{className:"wcpay-confirmation-modal__footer"},r))},Q=window.wp.i18n;r(5955),r(9031),r(4275),z.Component;const Z=({isLoading:e,display:t,placeholder:r,value:o,children:n})=>e?B().createElement("span",{className:t?`is-loadable-placeholder is-${t}`:"is-loadable-placeholder","aria-busy":"true"},void 0===r?n||o:r):B().createElement(B().Fragment,null,n||o),J=e=>{const t=B().createElement("p",{style:{lineHeight:e.numLines}},"Block placeholder");return B().createElement(Z,Object.assign({},e,{placeholder:t,display:"block"}))},K=({Icon:e,label:t})=>e?(0,$.jsxs)("span",{className:V("woocommerce-payments__payment-method-icon"),children:[(0,$.jsx)(e,{}),t&&(0,$.jsx)("span",{className:"woocommerce-payments__payment-method-icon__label",children:t})]}):null,X=({children:e})=>(0,$.jsx)("div",{className:"wcpay-settings-layout",children:e}),ee=({description:e=()=>null,children:t,className:r,id:o})=>B().createElement("div",{className:V("settings-section",r),id:o},B().createElement("div",{className:"settings-section__details"},B().createElement(e,null)),B().createElement("div",{className:"settings-section__controls"},t)),te=window.wp.domReady;var re=r.n(te);const oe=(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]}re()((()=>{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)}))},ne=((0,z.createContext)(window.wcpaySettings),window.wc.currency);var ae=r.n(ne);const se=window.lodash,ie=((0,Q.__)("Australian dollar","woocommerce-payments"),(0,Q.__)("Canadian dollar","woocommerce-payments"),(0,Q.__)("Swiss franc","woocommerce-payments"),(0,Q.__)("Danish krone","woocommerce-payments"),(0,Q.__)("Euro","woocommerce-payments"),(0,Q.__)("Pound sterling","woocommerce-payments"),(0,Q.__)("Norwegian krone","woocommerce-payments"),(0,Q.__)("New Zealand dollar","woocommerce-payments"),(0,Q.__)("Swedish krona","woocommerce-payments"),(0,Q.__)("United States (US) dollar","woocommerce-payments"),e=>wcpaySettings.zeroDecimalCurrencies.includes(e.toLowerCase())),ce=(e,t="USD",r=null,o=!1)=>{const n=ie(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 ae()(r[o]);const n=(0,se.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),ae()(n)}return null})(t):((e,t=null)=>{const{currencyData:r,connect:{country:o="US"}}=wcpaySettings,n=(0,se.find)(r,{code:e.toUpperCase()});if(n){if(null!==t&&t.toUpperCase()!==e.toUpperCase()||r[o]){const e=t?(0,se.find)(r,{code:t.toUpperCase()}):r[o];e&&(n.decimalSeparator=e.decimalSeparator,n.thousandSeparator=e.thousandSeparator,n.symbolPosition=e.symbolPosition)}return ae()(n)}return null})(t,r);if(null===c)return i+de(s,t,n);try{return i+("function"==typeof c.formatAmount?ue(c.formatAmount(s)):ue(c.formatCurrency(s)))}catch(e){return i+ue(de(s,t,n))}};function de(e,t,r){try{return e.toLocaleString(void 0,{style:"currency",currency:t,currencyDisplay:"narrowSymbol",dummy:r})}catch(o){return(0,Q.sprintf)(r?"%s %i":"%s %.2f",t.toUpperCase(),e)}}function ue(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}const le=window.wp.data,me=window.wp.dataControls,pe="/wc/v3/payments",_e="wc/payments",ye={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"},he=e=>JSON.stringify(e,Object.keys(e).sort()),Se={byId:{},queries:{},count:0,instant:{}},ge=e=>e&&e.deposits||{},Ee=(e,t)=>(ge(e).byId||{})[t],fe=e=>{const t=ge(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))]}},we=e=>(ge(e).overviews||{}).error,Te=(e,t)=>{const r=he(t);return(ge(e).queries||{})[r]||{}},Re=(e,t)=>(Te(e,t).data||[]).map(Ee.bind(void 0,e)),be=e=>ge(e).count,ve=(e,t)=>Te(e,t).error||{},Oe=(e,t)=>{const r=he(t);return(ge(e).summary||{})[r]||{}},Ae=(e,t)=>Oe(e,t).data||{},Ie=(e,t)=>Oe(e,t).error||{},Ne=e=>(ge(e).instant||{}).data,Ce=window.wp.url,xe=window.moment;var je=r.n(xe);const De=window.wp.date,Fe=(window.wc.number,e=>(0,Ce.addQueryArgs)("admin.php",e)),Me=(e,t=!1)=>{const r=t?je()(e).endOf("day").utc().toISOString():je()(e).startOf("day").utc().toISOString();return e&&(0,De.dateI18n)("Y-m-d H:i:s",r,!0)};function Pe(e){return{type:ye.SET_DEPOSIT,data:e}}function Ue(e){return{type:ye.SET_ALL_DEPOSITS_OVERVIEWS,data:e}}function Le(e,t){return{type:ye.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS,error:t}}function ke(e,t){return{type:ye.SET_DEPOSITS,query:e,data:t}}function ze(e){return{type:ye.SET_DEPOSITS_COUNT,data:e}}function Be(e,t,r){return{type:ye.SET_ERROR_FOR_DEPOSIT_QUERY,query:e,data:t,error:r}}function Ye(e,t){return{type:ye.SET_DEPOSITS_SUMMARY,query:e,data:t}}function $e(e,t,r){return{type:ye.SET_ERROR_FOR_DEPOSITS_SUMMARY,query:e,data:t,error:r}}function qe(e){return{type:ye.SET_INSTANT_DEPOSIT,data:e}}function*He(e){try{yield(0,le.dispatch)(_e).startResolution("getInstantDeposit",[e]);const t=yield(0,me.apiFetch)({path:"/wc/v3/payments/deposits",method:"POST",data:{type:"instant",currency:e}});yield qe(t),yield(0,le.dispatch)(_e).invalidateResolutionForStoreSelector("getDeposits"),yield(0,le.dispatch)(_e).invalidateResolutionForStoreSelector("getAllDepositsOverviews"),yield(0,le.dispatch)("core/notices").createSuccessNotice((0,Q.sprintf)((0,Q.__)("Instant payout for %s in transit.","woocommerce-payments"),ce(t.amount)),{actions:[{label:(0,Q.__)("View details","woocommerce-payments"),url:Fe({page:"wc-admin",path:"/payments/payouts/details",id:t.id})}]})}catch{yield(0,le.dispatch)("core/notices").createErrorNotice((0,Q.__)("Error creating instant payout.","woocommerce-payments"))}finally{yield(0,le.dispatch)(_e).finishResolution("getInstantDeposit",[e])}}function*Ve(e){if(/\W/.test(e))return;const t=(0,Ce.addQueryArgs)(`${pe}/deposits/${e}`);try{const e=yield(0,me.apiFetch)({path:t});yield Pe(e)}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving payout.","woocommerce-payments"))}}function*We(){const e=(0,Ce.addQueryArgs)(`${pe}/deposits/overview-all`);try{const t=yield(0,me.apiFetch)({path:e});yield Ue(t)}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving all payouts' overviews.","woocommerce-payments")),yield Le()}}const Ge=e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:Me(e.dateBefore,!0),date_after:Me(e.dateAfter),date_between:e.dateBetween&&[Me(e.dateBetween[0]),Me(e.dateBetween[1],!0)],status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale}),Qe=`${pe}/deposits/download`;function Ze(e){return(0,Ce.addQueryArgs)(Qe,Ge(e))}function*Je(e){const t=(0,Ce.addQueryArgs)(`${pe}/deposits`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...Ge(e)});try{const r=yield(0,me.apiFetch)({path:t})||{};yield ke(e,r.data),yield ze(r.total_count);for(const e in r.data)yield le.controls.dispatch(_e,"finishResolution","getDeposit",[r.data[e].id])}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving payouts.","woocommerce-payments")),yield Be(e,null,t)}}function*Ke(e){const t=(0,Ce.addQueryArgs)(`${pe}/deposits/summary`,Ge(e));try{const r=yield(0,me.apiFetch)({path:t});yield Ye(e,r)}catch(t){yield $e(e,null,t)}}const Xe={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"},et={summary:{},fraudProtection:{review:{summary:{}},block:{summary:{}}}},tt=e=>e&&e.transactions||{},rt=(e,t)=>{const r=he(t);return tt(e)[r]||{}},ot=(e,t)=>rt(e,t).data||[],nt=(e,t)=>rt(e,t).error||{},at=(e,t)=>{const r=he(t);return tt(e).summary[r]||{}},st=(e,t)=>at(e,t).data||{},it=(e,t)=>at(e,t).error||{},ct=(e,t,r)=>{const o=he(r);return tt(e).fraudProtection?.[t]?.[o]||{}},dt=(e,t,r)=>ct(e,t,r).data||[],ut=(e,t,r)=>ct(e,t,r).error||{},lt=(e,t,r)=>{const o=he(r);return tt(e).fraudProtection?.[t]?.summary[o]||{}},mt=(e,t,r)=>lt(e,t,r).data||{},pt=(e,t,r)=>lt(e,t,r).error||{};function _t(e,t){return{type:Xe.SET_TRANSACTIONS,query:e,data:t}}function yt(e,t,r){return{type:Xe.SET_ERROR_FOR_TRANSACTIONS,query:e,data:t,error:r}}function ht(e,t){return{type:Xe.SET_TRANSACTIONS_SUMMARY,query:e,data:t}}function St(e,t,r){return{type:Xe.SET_ERROR_FOR_TRANSACTIONS_SUMMARY,query:e,data:t,error:r}}function gt(e,t,r){return{type:Xe.SET_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:r}}function Et(e,t,r){return{type:Xe.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:null,error:r}}function ft(e,t,r){return{type:Xe.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:r}}function wt(e,t,r){return{type:Xe.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:null,error:r}}const Tt=e=>({user_email:e.userEmail,match:e.match,date_before:Me(e.dateBefore,!0),date_after:Me(e.dateAfter),date_between:e.dateBetween&&[Me(e.dateBetween[0]),Me(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:je()(new Date).format("Z"),locale:e.locale});function*Rt(e){const t=(0,Ce.addQueryArgs)(`${pe}/transactions`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...Tt(e)});try{const r=yield(0,me.apiFetch)({path:t});yield _t(e,r.data||[])}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving transactions.","woocommerce-payments")),yield yt(e,null,t)}}const bt=`${pe}/transactions/download`;function vt(e){return(0,Ce.addQueryArgs)(bt,Tt(e))}function*Ot(e){const t=(0,Ce.addQueryArgs)(`${pe}/transactions/summary`,Tt(e));try{const r=yield(0,me.apiFetch)({path:t});yield ht(e,r)}catch(t){yield St(e,null,t)}}function*At(e,t){const r=(0,Ce.addQueryArgs)(`${pe}/transactions/fraud-outcomes`,{status:e,page:t.paged,sort:t.orderby,pagesize:t.perPage,direction:t.order,additional_status:t.additionalStatus,...Tt(t)});try{const o=yield(0,me.apiFetch)({path:r});yield gt(e,t,o.data||[])}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield gt(e,t,[]));yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving transactions.","woocommerce-payments")),yield Et(e,t,r)}}function*It(e,t){const r=(0,Ce.addQueryArgs)(`${pe}/transactions/fraud-outcomes/summary`,{status:e,additional_status:t.additionalStatus}),o={count:0,total:0};try{const n=yield(0,me.apiFetch)({path:r});yield ft(e,t,n||o)}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield ft(e,t,o));yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving on review transactions.","woocommerce-payments")),yield wt(e,t,r)}}function Nt(e,t){return(0,Ce.addQueryArgs)(`${pe}/transactions/fraud-outcomes/download`,{status:e,sort:t.orderby,direction:t.order,additional_status:t.additionalStatus,...Tt(t)})}const Ct={SET_CHARGE:"SET_CHARGE",SET_ERROR_FOR_CHARGE:"SET_ERROR_FOR_CHARGE"},xt=(e,t)=>e.charges[t]&&e.charges[t].data?e.charges[t].data:{},jt=(e,t)=>e.charges[t]&&e.charges[t].error?e.charges[t].error:{},Dt=(e,t)=>xt(e,t),Ft=(e,t)=>jt(e,t);function Mt(e,t){return{type:Ct.SET_CHARGE,id:e,data:t}}function Pt(e,t,r){return{type:Ct.SET_ERROR_FOR_CHARGE,id:e,data:t,error:r}}function*Ut(e){try{const t=yield(0,me.apiFetch)({path:`${pe}/charges/${e}`});yield Mt(e,t)}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving transaction.","woocommerce-payments")),yield Pt(e,null,t)}}function*Lt(e){try{const t=yield(0,me.apiFetch)({path:`${pe}/charges/order/${e}`});yield Mt(e,t)}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving transaction.","woocommerce-payments")),yield Pt(e,null,t)}}const kt={SET_TIMELINE:"SET_TIMELINE",SET_ERROR_FOR_TIMELINE:"SET_ERROR_FOR_TIMELINE"},zt=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].data?e.timeline[t].data:{},Bt=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].error?e.timeline[t].error:{};function Yt(e,t){return{id:e,type:kt.SET_TIMELINE,data:t}}function $t(e,t){return{id:e,type:kt.SET_ERROR_FOR_TIMELINE,error:t}}function*qt(e){try{const t=yield(0,me.apiFetch)({path:`${pe}/timeline/${e}`});yield Yt(e,t.data)}catch(t){yield $t(e,t)}}const Ht={SET_DISPUTE:"SET_DISPUTE",SET_ERROR_FOR_DISPUTE:"SET_ERROR_FOR_DISPUTE",SET_DISPUTES:"SET_DISPUTES",SET_DISPUTES_SUMMARY:"SET_DISPUTES_SUMMARY"},Vt={byId:{},queries:{},summary:{},cached:{}},Wt=e=>e&&e.disputes||{},Gt=(e,t)=>(Wt(e).byId||{})[t],Qt=(e,t)=>{const r=Wt(e).byId||{};return r[t]?.error},Zt=(e,t)=>(Wt(e).cached||{})[t],Jt=(e,t)=>{const r=((e,t)=>{const r=he(t);return(Wt(e).queries||{})[r]||{}})(e,t).data||[];return r.map(Zt.bind(void 0,e))},Kt=(e,t)=>((e,t)=>{const r=he(t);return(Wt(e).summary||{})[r]||{}})(e,t).data||{};var Xt;!function(e){e.SET_PAYMENT_INTENT="SET_PAYMENT_INTENT",e.SET_ERROR_FOR_PAYMENT_INTENT="SET_ERROR_FOR_PAYMENT_INTENT"}(Xt||(Xt={}));const er=Xt;function tr(e,t){return{type:er.SET_PAYMENT_INTENT,id:e,data:t}}function rr(e,t){return{type:er.SET_ERROR_FOR_PAYMENT_INTENT,id:e,error:t}}function*or(e,t){var r;const o=e.payment_intent;try{yield(0,me.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 le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getTimeline"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield le.controls.dispatch("core/notices","createSuccessNotice",(0,Q.sprintf)((0,Q.__)("Refunded payment #%s.","woocommerce-payments"),o))}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.sprintf)((0,Q.__)("There has been an error refunding the payment #%s. Please try again later.","woocommerce-payments"),o))}}function*nr(e){try{const t=yield(0,me.apiFetch)({path:`${pe}/payment_intents/${e}`});yield tr(e,t)}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving transaction.","woocommerce-payments")),yield rr(e,t)}}function ar(e){return{type:Ht.SET_DISPUTE,data:e}}function sr(e,t,r){return{type:Ht.SET_ERROR_FOR_DISPUTE,id:e,data:t,error:r}}function ir(e,t){return{type:Ht.SET_DISPUTES,query:e,data:t}}function cr(e,t){return{type:Ht.SET_DISPUTES_SUMMARY,query:e,data:t}}function*dr(e){const{id:t,payment_intent:r}=e;try{yield le.controls.dispatch(_e,"startResolution","getDispute",[t]);const e=yield(0,me.apiFetch)({path:`${pe}/disputes/${t}/close`,method:"post"});yield ar(e),yield nr(r),yield le.controls.dispatch(_e,"finishResolution","getDispute",[t]);const o=e.order?(0,Q.sprintf)((0,Q.__)("You have accepted the dispute for order #%s.","woocommerce-payments"),e.order.number):(0,Q.__)("You have accepted the dispute.","woocommerce-payments");yield le.controls.dispatch("core/notices","createSuccessNotice",o)}catch(e){const r=(0,Q.__)("There has been an error accepting the dispute. Please try again later.","woocommerce-payments");yield le.controls.dispatch("core/notices","createErrorNotice",r),yield le.controls.dispatch(_e,"finishResolution","getDispute",[t])}}const ur=window.wc.wcSettings,lr=((0,Q.__)("Bank cannot process","woocommerce-payments"),(0,Q.__)("Check returned","woocommerce-payments"),(0,Q.__)("Credit not processed","woocommerce-payments"),(0,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("The cardholder claims a credit was not processed.","woocommerce-payments"),(0,Q.__)("Customer initiated","woocommerce-payments"),(0,Q.__)("Debit not authorized","woocommerce-payments"),(0,Q.__)("Duplicate","woocommerce-payments"),(0,Q.__)("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,Q.__)("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,Q.__)("The customer claims they were charged multiple times for the same product or service.","woocommerce-payments"),(0,Q.__)("Demonstrate that each payment was for a separate product or service.","woocommerce-payments"),(0,Q.__)("Determine if your customer was incorrectly charged multiple times.","woocommerce-payments"),(0,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("The cardholder claims this is a duplicate transaction.","woocommerce-payments"),(0,Q.__)("Transaction unauthorized","woocommerce-payments"),(0,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("The cardholder claims this is an unauthorized transaction.","woocommerce-payments"),(0,Q.__)("General","woocommerce-payments"),(0,Q.__)("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,Q.__)("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,Q.__)("Incorrect account details","woocommerce-payments"),(0,Q.__)("Insufficient funds","woocommerce-payments"),(0,Q.__)("Product not received","woocommerce-payments"),(0,Q.__)("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,Q.__)("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,Q.__)("The customer claims they did not receive the products or services purchased.","woocommerce-payments"),(0,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("The cardholder claims they did not receive the product.","woocommerce-payments"),(0,Q.__)("Product unacceptable","woocommerce-payments"),(0,Q.__)("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,Q.__)("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,Q.__)("The product or service was received but was defective, damaged, or not as described.","woocommerce-payments"),(0,Q.__)("Demonstrate that the product or service was delivered as described at the time of purchase.","woocommerce-payments"),(0,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("The cardholder claims the product was unacceptable.","woocommerce-payments"),(0,Q.__)("Subscription canceled","woocommerce-payments"),(0,Q.__)("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,Q.__)("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,Q.__)("The customer claims that you continued to charge them after a subscription was canceled.","woocommerce-payments"),(0,Q.__)("Prove that the subscription was still active and that the customer was aware of, and did not follow, your cancellation procedure.","woocommerce-payments"),(0,Q.__)("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,Q.__)("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,Q.__)("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,Q.__)("The cardholder claims a subscription was canceled.","woocommerce-payments"),(0,Q.__)("Unrecognized","woocommerce-payments"),(0,Q.__)("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,Q.__)("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,Q.__)("The customer doesn’t recognize the payment appearing on their card statement.","woocommerce-payments"),(0,Q.__)("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,Q.__)("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,Q.__)("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"),{warning_needs_response:(0,Q.__)("Inquiry: Response needed","woocommerce-payments"),warning_under_review:(0,Q.__)("Inquiry: Under review","woocommerce-payments"),warning_closed:(0,Q.__)("Inquiry: Closed","woocommerce-payments"),needs_response:(0,Q.__)("Response needed","woocommerce-payments"),under_review:(0,Q.__)("Under review","woocommerce-payments"),charge_refunded:(0,Q.__)("Charge refunded","woocommerce-payments"),won:(0,Q.__)("Won","woocommerce-payments"),lost:(0,Q.__)("Lost","woocommerce-payments")}),mr=(Object.entries(lr).map((([e,t])=>({label:t,value:e}))).filter((function(e){return null!=e})),["needs_response","warning_needs_response"]),pr=((0,Q.__)("Dispute currency","woocommerce-payments"),(0,Q.__)("All currencies","woocommerce-payments"),(0,Q.__)("Show","woocommerce-payments"),(0,Q.__)("Needs response","woocommerce-payments"),(0,Q.__)("All disputes","woocommerce-payments"),(0,Q.__)("Advanced filters","woocommerce-payments"),(0,ur.getSetting)("wcVersion")),_r=parseFloat(pr),yr=(_r<7.8?(0,Q.__)("Disputes match {{select /}} filters","woocommerce-payments"):(0,Q.__)("Disputes match <select /> filters","woocommerce-payments"),(0,Q.__)("Disputed on date","woocommerce-payments"),(0,Q.__)("Remove dispute date filter","woocommerce-payments"),(0,Q.__)("Select a dispute date filter match","woocommerce-payments"),_r<7.8?(0,Q.__)("{{title}}Date{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,Q.__)("<title>Date</title> <rule /> <filter />","woocommerce-payments"),(0,Q.__)("Select a dispute date","woocommerce-payments"),(0,Q.__)("Before","woocommerce-payments"),(0,Q.__)("After","woocommerce-payments"),(0,Q.__)("Between","woocommerce-payments"),(0,Q.__)("Status","woocommerce-payments"),(0,Q.__)("Remove dispute status filter","woocommerce-payments"),(0,Q.__)("Select a dispute status filter match","woocommerce-payments"),_r<7.8?(0,Q.__)("{{title}}Status{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,Q.__)("<title>Status</title> <rule /> <filter />","woocommerce-payments"),(0,Q.__)("Select a dispute status","woocommerce-payments"),(0,Q._x)("Is","dispute status","woocommerce-payments"),(0,Q._x)("Is not","dispute status","woocommerce-payments"),e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:Me(e.dateBefore,!0),date_after:Me(e.dateAfter),date_between:e.dateBetween&&[Me(e.dateBetween[0]),Me(e.dateBetween[1],!0)],search:"awaiting_response"===e.filter?mr:e.search,status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale})),hr=`${pe}/disputes/download`;function Sr(e){return(0,Ce.addQueryArgs)(hr,yr(e))}function*gr(e){const t=(0,Ce.addQueryArgs)(`${pe}/disputes/${e}`);try{const e=yield(0,me.apiFetch)({path:t});yield ar(e)}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving dispute.","woocommerce-payments")),yield sr(e,void 0,t)}}function*Er(e){const t=(0,Ce.addQueryArgs)(`${pe}/disputes`,{page:e.paged,pagesize:e.perPage,sort:(0,se.snakeCase)(e.orderBy),direction:e.order,...yr(e)});try{const r=yield(0,me.apiFetch)({path:t})||{};yield ir(e,r.data)}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving disputes.","woocommerce-payments"))}}function*fr(e){const t=(0,Ce.addQueryArgs)(`${pe}/disputes/summary`,{page:e.paged,pagesize:e.perPage,...yr(e)});try{const r=yield(0,me.apiFetch)({path:t});yield cr(e,r)}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving the summary of disputes.","woocommerce-payments"))}}const wr={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"},Tr={isDirty:!1,isSaving:!1,savingError:null,data:{}},Rr={},br=[],vr=e=>e&&e.settings||Rr,Or=e=>vr(e).data||Rr,Ar=e=>Or(e).duplicated_payment_method_ids||Rr,Ir=e=>Or(e).is_wcpay_enabled||!1,Nr=e=>Or(e).enabled_payment_method_ids||br,Cr=e=>Or(e).available_payment_method_ids||br,xr=e=>Or(e).payment_method_statuses||Rr,jr=e=>vr(e).isSaving||!1,Dr=e=>vr(e).isDirty||!1,Fr=e=>Or(e).account_statement_descriptor||"",Mr=e=>Or(e).account_statement_descriptor_kanji||"",Pr=e=>Or(e).account_statement_descriptor_kana||"",Ur=e=>Or(e).account_business_support_email||"",Lr=e=>Or(e).account_business_support_phone||"",kr=e=>Or(e).account_domestic_currency||"",zr=e=>Or(e).deposit_schedule_interval||"",Br=e=>Or(e).deposit_schedule_weekly_anchor||"",Yr=e=>Or(e).deposit_schedule_monthly_anchor||"",$r=e=>Or(e).deposit_delay_days||"7",qr=e=>Or(e).deposit_completed_waiting_period||!1,Hr=e=>Or(e).deposit_status||"",Vr=e=>Or(e).deposit_restrictions||"",Wr=e=>Or(e).is_manual_capture_enabled||!1,Gr=e=>Or(e).is_test_mode_enabled||!1,Qr=e=>Or(e).is_test_mode_onboarding||!1,Zr=e=>Or(e).is_dev_mode_enabled||!1,Jr=e=>Or(e).is_payment_request_enabled||!1,Kr=e=>Or(e).is_debug_log_enabled||!1,Xr=e=>Or(e).is_multi_currency_enabled||!1,eo=e=>Or(e).payment_request_enabled_locations||br,to=e=>Or(e).payment_request_button_type||"",ro=e=>Or(e).payment_request_button_size||"",oo=e=>Or(e).payment_request_button_theme||"",no=e=>{const t=Or(e)?.payment_request_button_border_radius;return 0===t||"0"===t||t?t:"undefined"==typeof wcpaySettings?4:parseInt(window?.wcpaySettings?.defaultExpressCheckoutBorderRadius||4,10)},ao=e=>Or(e).is_saved_cards_enabled||!1,so=e=>vr(e).savingError,io=e=>Or(e).is_card_present_eligible||!1,co=e=>Or(e).is_wcpay_subscriptions_enabled||!1,uo=e=>Or(e).is_wcpay_subscriptions_eligible||!1,lo=e=>Or(e).is_subscriptions_plugin_active||!1,mo=e=>Or(e).is_woopay_enabled||!1,po=e=>Or(e).is_woopay_global_theme_support_enabled||!1,_o=e=>Or(e).woopay_custom_message||"",yo=e=>Or(e).woopay_store_logo||"",ho=e=>Or(e).woopay_enabled_locations||br,So=e=>Or(e).current_protection_level||"basic",go=e=>Or(e).advanced_fraud_protection_settings||br,Eo=e=>Or(e).show_woopay_incompatibility_notice||!1,fo=e=>Or(e).is_stripe_billing_enabled||!1,wo=e=>Or(e).is_migrating_stripe_billing||!1,To=e=>Or(e).stripe_billing_subscription_count||0,Ro=e=>Or(e).stripe_billing_migrated_count||0,bo=window.wp.apiFetch;var vo=r.n(bo);function Oo(e){return{type:wr.SET_SETTINGS_VALUES,payload:e}}function Ao(e){return Oo({is_saved_cards_enabled:e})}function Io(e){return Oo({is_card_present_eligible:e})}function No(e){return Oo({payment_request_button_type:e})}function Co(e){return Oo({payment_request_button_size:e})}function xo(e){return Oo({payment_request_button_theme:e})}function jo(e){return Oo({payment_request_button_border_radius:e})}function Do(e){return{type:wr.SET_SETTINGS,data:e}}function Fo(e){return Oo({is_wcpay_enabled:e})}function Mo(e){return Oo({is_payment_request_enabled:e})}function Po(e){return Oo({enabled_payment_method_ids:[...e]})}function Uo(e,t){return{type:wr.SET_IS_SAVING_SETTINGS,isSaving:e,error:t}}function Lo(e){return{type:wr.SET_SELECTED_PAYMENT_METHOD,id:e}}function ko(e){return{type:wr.SET_UNSELECTED_PAYMENT_METHOD,id:e}}function zo(e){return Oo({is_manual_capture_enabled:e})}function Bo(e){return Oo({is_test_mode_enabled:e})}function Yo(e){return Oo({is_debug_log_enabled:e})}function $o(e){return Oo({is_multi_currency_enabled:e})}function qo(e){return Oo({is_wcpay_subscriptions_enabled:e})}function Ho(e){return Oo({account_statement_descriptor:e})}function Vo(e){return Oo({account_statement_descriptor_kanji:e})}function Wo(e){return Oo({account_statement_descriptor_kana:e})}function Go(e){return Oo({account_business_support_email:e})}function Qo(e){return Oo({account_business_support_phone:e})}function Zo(e){return Oo({deposit_schedule_interval:e})}function Jo(e){return Oo({deposit_schedule_weekly_anchor:e})}function Ko(e){return Oo({deposit_schedule_monthly_anchor:""===e?null:parseInt(e,10)})}function*Xo(){let e=null;try{const e=(0,le.select)(_e).getSettings();yield Uo(!0,null);const t=yield(0,me.apiFetch)({path:`${pe}/settings`,method:"post",data:e});yield Oo({payment_method_statuses:t.data.payment_method_statuses}),yield(0,le.dispatch)("core/notices").createSuccessNotice((0,Q.__)("Settings saved.","woocommerce-payments"))}catch(t){e=t,yield(0,le.dispatch)("core/notices").createErrorNotice((0,Q.__)("Error saving settings.","woocommerce-payments")),e.server_error&&(yield(0,le.dispatch)("core/notices").createErrorNotice(e.server_error))}finally{yield Uo(!1,e)}return null===e}function en(e){return Oo({payment_request_enabled_locations:[...e]})}function tn(e){return Oo({is_woopay_enabled:e})}function rn(e){return Oo({is_woopay_global_theme_support_enabled:e})}function on(e){return Oo({woopay_custom_message:e})}function nn(e){return Oo({woopay_store_logo:e})}function an(e){return Oo({woopay_enabled_locations:[...e]})}function sn(e){return Oo({current_protection_level:e})}function cn(e){return Oo({advanced_fraud_protection_settings:e})}function dn(e){return Oo({is_stripe_billing_enabled:e})}function*un(){try{yield(0,le.dispatch)(_e).startResolution("scheduleStripeBillingMigration"),yield(0,me.apiFetch)({path:`${pe}/settings/schedule-stripe-billing-migration`,method:"post"})}catch(e){yield(0,le.dispatch)("core/notices").createErrorNotice((0,Q.__)("Error starting the Stripe Billing migration.","woocommerce-payments"))}yield(0,le.dispatch)(_e).finishResolution("scheduleStripeBillingMigration")}function ln(e,t){vo()({path:`${pe}/settings/${e}`,method:"post",data:{value:t}}).catch((()=>{(0,le.dispatch)("core/notices").createErrorNotice((0,Q.__)("Error saving option","woocommerce-payments"))}))}function*mn(){const e=`${pe}/settings`;try{const t=yield(0,me.apiFetch)({path:e});yield Do(t)}catch(e){yield(0,le.dispatch)("core/notices").createErrorNotice((0,Q.__)("Error retrieving settings.","woocommerce-payments"))}}const pn={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"},_n=(e,t)=>e.readers[t]&&e.readers[t].data?e.readers[t].data:{},yn=(e,t)=>e.readers[t]&&e.readers[t].error?e.readers[t].error:{},hn=e=>e.readers&&e.readers.list?e.readers.list:{};function Sn(e,t){return{type:pn.SET_CARD_READER_STATS,id:e,data:t}}function gn(e,t){return{type:pn.SET_READERS,query:e,data:t}}function En(e,t,r){return{type:pn.SET_CARD_ERROR_FOR_READER_STATS,id:e,data:t,error:r}}function fn(e,t){return{type:pn.SET_CARD_ERROR_FOR_READERS,data:e,error:t}}function*wn(e,t){try{const r=yield(0,me.apiFetch)({path:`${pe}/readers/charges/${t}`});yield Sn(e,r)}catch(t){yield En(e,null,t)}}function*Tn(e){const t=(0,Ce.addQueryArgs)(`${pe}/readers`,{limit:e.limit});try{const r=yield(0,me.apiFetch)({path:t})||{};yield gn(e,r)}catch(e){yield fn(null,e)}}var Rn;!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"}(Rn||(Rn={}));const bn=Rn,vn={},On=e=>e&&e.capital||{},An=e=>On(e).summary,In=e=>On(e).summaryError,Nn=e=>On(e).loans||[],Cn=e=>On(e).loansError;function xn(e){return{type:bn.SET_ACTIVE_LOAN_SUMMARY,data:e}}function jn(e){return{type:bn.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY,error:e}}function Dn(e){return{type:bn.SET_LOANS,data:e.data}}function Fn(e){return{type:bn.SET_ERROR_FOR_LOANS,error:e}}function*Mn(){const e=`${pe}/capital/active_loan_summary`;try{const t=yield(0,me.apiFetch)({path:e});yield xn(t)}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield jn(e)}}function*Pn(){const e=`${pe}/capital/loans`;try{const t=yield(0,me.apiFetch)({path:e});yield Dn(t)}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield Fn(e)}}const Un={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"},Ln={summary:{}},kn=e=>e&&e.documents||{},zn=(e,t)=>{const r=he(t);return kn(e)[r]||{}},Bn=(e,t)=>zn(e,t).data||[],Yn=(e,t)=>zn(e,t).error||{},$n=(e,t)=>{const r=he(t);return kn(e).summary[r]||{}},qn=(e,t)=>$n(e,t).data||{},Hn=(e,t)=>$n(e,t).error||{};function Vn(e,t){return{type:Un.SET_DOCUMENTS,query:e,data:t}}function Wn(e,t,r){return{type:Un.SET_ERROR_FOR_DOCUMENTS,query:e,data:t,error:r}}function Gn(e,t){return{type:Un.SET_DOCUMENTS_SUMMARY,query:e,data:t}}function Qn(e,t,r){return{type:Un.SET_ERROR_FOR_DOCUMENTS_SUMMARY,query:e,data:t,error:r}}const Zn=e=>({user_email:e.userEmail,match:e.match,date_before:Me(e.dateBefore,!0),date_after:Me(e.dateAfter),date_between:e.dateBetween&&[Me(e.dateBetween[0]),Me(e.dateBetween[1],!0)],type_is:e.typeIs,type_is_not:e.typeIsNot});function*Jn(e){const t=(0,Ce.addQueryArgs)(`${pe}/documents`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...Zn(e)});try{const r=yield(0,me.apiFetch)({path:t});yield Vn(e,r.data||[])}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving documents.","woocommerce-payments")),yield Wn(e,null,t)}}function*Kn(e){const t=(0,Ce.addQueryArgs)(`${pe}/documents/summary`,Zn(e));try{const r=yield(0,me.apiFetch)({path:t});yield Gn(e,r)}catch(t){yield Qn(e,null,t)}}const Xn={},ea=({paymentIntents:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.data)||{}},ta=({paymentIntents:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.error)||{}},ra={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"},oa={summary:{},byId:{},isRequesting:!1},na=e=>e&&e.authorizations||{},aa=(e,t)=>{const r=he(t);return na(e)[r]||{}},sa=(e,t)=>aa(e,t).data||[],ia=(e,t)=>(na(e).byId||{})[t],ca=(e,t)=>aa(e,t).error||{},da=(e,t)=>{const r=he(t);return na(e).summary[r]||{}},ua=(e,t)=>da(e,t).data||{},la=(e,t)=>da(e,t).error||{},ma=e=>na(e).isRequesting,pa=e=>{var t;const r={wcpay_missing_order:(0,Q.__)("The order could not be found.","woocommerce-payments"),wcpay_refunded_order_uncapturable:(0,Q.__)("Payment cannot be processed for partially or fully refunded orders.","woocommerce-payments"),wcpay_intent_order_mismatch:(0,Q.__)("The payment cannot be processed due to a mismatch with order details.","woocommerce-payments"),wcpay_payment_uncapturable:(0,Q.__)("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,Q.__)("The payment amount is too small to be processed.","woocommerce-payments");const a=e.data.extra_details.minimum_amount_currency,s=ce(e.data.extra_details.minimum_amount,a);return(0,Q.sprintf)((0,Q.__)("The minimum amount that can be processed is %1$s %2$s.","woocommerce-payments"),s,a.toUpperCase())})(e):(0,Q.__)("The payment capture failed to complete.","woocommerce-payments")},wcpay_cancel_error:(0,Q.__)("The payment cancellation failed to complete.","woocommerce-payments"),wcpay_server_error:(0,Q.__)("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,Q.__)("Unable to process the payment. Please try again later.","woocommerce-payments")};function _a(e,t){return{type:ra.SET_AUTHORIZATIONS,data:t,query:e}}function ya(e,t){return{type:ra.SET_ERROR_FOR_AUTHORIZATIONS,query:e,error:t}}function ha(e){return{type:ra.SET_AUTHORIZATION,data:e}}function Sa(e,t){return{type:ra.SET_AUTHORIZATIONS_SUMMARY,data:t,query:e}}function ga(e){return{type:ra.SET_IS_REQUESTING_AUTHORIZATION,data:e}}function*Ea(e,t){try{yield le.controls.dispatch(_e,"startResolution","getAuthorization",[e]),yield le.controls.dispatch(_e,"setIsRequestingAuthorization",!0);const r=yield(0,me.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 ha(o),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getAuthorizations"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getAuthorizationsSummary"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactions"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactionsSummary"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getTimeline"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getTransactions"),yield le.controls.dispatch("core/notices","createSuccessNotice",(0,Q.sprintf)((0,Q.__)("Payment for order #%s captured successfully.","woocommerce-payments"),t))}catch(e){const r=(0,Q.sprintf)((0,Q.__)("There has been an error capturing the payment for order #%s.","woocommerce-payments"),t),o=pa(e);yield le.controls.dispatch("core/notices","createErrorNotice",`${r} ${o}`)}finally{yield le.controls.dispatch(_e,"finishResolution","getAuthorization",[e]),yield le.controls.dispatch(_e,"setIsRequestingAuthorization",!1)}}function*fa(e,t){try{yield le.controls.dispatch(_e,"startResolution","getAuthorization",[e]),yield le.controls.dispatch(_e,"setIsRequestingAuthorization",!0);const r=yield(0,me.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 ha(o),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getAuthorizations"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getAuthorizationsSummary"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactions"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactionsSummary"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getTimeline"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield le.controls.dispatch("core/notices","createSuccessNotice",(0,Q.sprintf)((0,Q.__)("Payment for order #%s canceled successfully.","woocommerce-payments"),t))}catch(e){const r=(0,Q.sprintf)((0,Q.__)("There has been an error canceling the payment for order #%s.","woocommerce-payments"),t),o=pa(e);yield le.controls.dispatch("core/notices","createErrorNotice",`${r} ${o}`)}finally{yield le.controls.dispatch(_e,"finishResolution","getAuthorization",[e]),yield le.controls.dispatch(_e,"setIsRequestingAuthorization",!1)}}function wa(e,t){return{type:ra.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY,query:e,error:t}}function*Ta(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,Ce.addQueryArgs)(`${pe}/authorizations`,{page:r,pagesize:o,sort:n,direction:a});try{const r=yield(0,me.apiFetch)({path:s});yield _a(e,null!==(t=r.data)&&void 0!==t?t:[])}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield ya(e,t)}}function*Ra(e){try{if(e){const t=yield(0,me.apiFetch)({path:`${pe}/authorizations/${e}`}),{is_captured:r,payment_intent_id:o,created:n}=t;yield ha({payment_intent_id:o,captured:r,created:n})}}catch(e){"authorization_missing"!==e.code&&(yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving authorization.","woocommerce-payments")))}}function*ba(e){const t=(0,Ce.addQueryArgs)(`${pe}/authorizations/summary`,{pagesize:e.per_page,sort:e.orderby,direction:e.order,page:e.paged});try{const r=yield(0,me.apiFetch)({path:t});yield Sa(e,null!=r?r:[])}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield wa(e,t)}}var va;!function(e){e.SET_FILE="SET_FILE",e.SET_ERROR_FOR_FILES="SET_ERROR_FOR_FILES"}(va||(va={}));const Oa=va,Aa={},Ia=({files:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.data)||{}},Na=({files:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.error)||{}};function Ca(e,t){return{type:Oa.SET_FILE,id:e,data:t}}function xa(e,t){return{type:Oa.SET_ERROR_FOR_FILES,id:e,error:t}}function*ja(e){try{const t=yield(0,me.apiFetch)({path:`${pe}/file/${e}/details`});yield Ca(e,t)}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,Q.__)("Error retrieving file.","woocommerce-payments")),yield xa(e,t)}}(0,le.registerStore)(_e,{reducer:(0,le.combineReducers)({deposits:(e=Se,{type:t,query:r={},data:o=[],error:n})=>{const a=he(r);switch(t){case ye.SET_DEPOSIT:return{...e,byId:{...e.byId,[o.id]:o}};case ye.SET_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,data:o}};case ye.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,error:n}};case ye.SET_DEPOSITS:return{...e,byId:{...e.byId,...(0,se.keyBy)(o,"id")},queries:{...e.queries,[a]:{data:(0,se.map)(o,"id")}}};case ye.SET_DEPOSITS_COUNT:return{...e,count:o};case ye.SET_ERROR_FOR_DEPOSIT_QUERY:return{...e,queries:{...e.queries,[a]:{error:n}}};case ye.SET_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[a]:{data:o}}};case ye.SET_ERROR_FOR_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[a]:{error:n}}};case ye.SET_INSTANT_DEPOSIT:return{...e,instant:{...e.instant,data:o}}}return e},transactions:(e=et,{type:t,query:r={},data:o=[],error:n,status:a})=>{const s=he(r);switch(t){case Xe.SET_TRANSACTIONS:return{...e,[s]:{data:o}};case Xe.SET_ERROR_FOR_TRANSACTIONS:return{...e,[s]:{error:n}};case Xe.SET_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[s]:{data:o}}};case Xe.SET_ERROR_FOR_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[s]:{error:n}}};case Xe.SET_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},[s]:{data:o}}}};case Xe.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},[s]:{error:n}}}};case Xe.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},summary:{...e.fraudProtection?.[a]?.summary||{},[s]:{data:o}}}}};case Xe.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 Ct.SET_CHARGE:e={...e,[r]:{...e[r],data:o}};break;case Ct.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 kt.SET_TIMELINE:e={...e,[r]:{data:o}};break;case kt.SET_ERROR_FOR_TIMELINE:e={...e,[r]:{...e[r],error:n}}}return e},disputes:(e=Vt,{type:t,query:r={},data:o=[],id:n,error:a})=>{const s=he(r);switch(t){case Ht.SET_DISPUTE:return{...e,byId:{...e.byId,[o.id]:o}};case Ht.SET_ERROR_FOR_DISPUTE:e={...e,byId:{...e.byId,[n]:{error:a}}};break;case Ht.SET_DISPUTES:return{...e,cached:{...e.cached,...(0,se.keyBy)(o,"dispute_id")},queries:{...e.queries,[s]:{data:(0,se.map)(o,"dispute_id")}}};case Ht.SET_DISPUTES_SUMMARY:return{...e,summary:{...e.summary,[s]:{data:o}}}}return e},settings:(e=Tr,{type:t,...r})=>{switch(t){case wr.SET_SETTINGS:return{...e,data:r.data,isDirty:!1};case wr.SET_SETTINGS_VALUES:return{...e,savingError:null,isDirty:!0,data:{...e.data,...r.payload}};case wr.SET_IS_SAVING_SETTINGS:return{...e,isDirty:!(!r.isSaving&&!r.error)&&e.isDirty,isSaving:r.isSaving,savingError:r.error};case wr.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 wr.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 pn.SET_CARD_READER_STATS:e={...e,[r]:{...e[r],data:o}};break;case pn.SET_ERROR_FOR_CARD_READER_STATS:e={...e,[r]:{...e[r],error:n}};break;case pn.SET_READERS:e={...e,list:o}}return e},capital:(e=vn,t)=>{switch(t.type){case bn.SET_ACTIVE_LOAN_SUMMARY:return Object.assign(Object.assign({},e),{summary:t.data,summaryError:void 0});case bn.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY:return Object.assign(Object.assign({},e),{summary:void 0,summaryError:t.error});case bn.SET_LOANS:return Object.assign(Object.assign({},e),{loans:t.data,loansError:void 0});case bn.SET_ERROR_FOR_LOANS:return Object.assign(Object.assign({},e),{loans:void 0,loansError:t.error})}return e},documents:(e=Ln,{type:t,query:r={},data:o=[],error:n})=>{const a=he(r);switch(t){case Un.SET_DOCUMENTS:return{...e,[a]:{data:o}};case Un.SET_ERROR_FOR_DOCUMENTS:return{...e,[a]:{error:n}};case Un.SET_DOCUMENTS_SUMMARY:return{...e,summary:{...e.summary,[a]:{data:o}}};case Un.SET_ERROR_FOR_DOCUMENTS_SUMMARY:return{...e,summary:{...e.summary,[a]:{error:n}}}}return e},paymentIntents:(e=Xn,t)=>{const{type:r,id:o}=t;switch(r){case er.SET_PAYMENT_INTENT:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{data:t.data})});case er.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=oa,t)=>{switch(t.type){case ra.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 ra.SET_AUTHORIZATIONS:{const{data:r,query:o}=t;return Object.assign(Object.assign({},e),{[he(o)]:{data:r}})}case ra.SET_ERROR_FOR_AUTHORIZATIONS:{const{error:r,query:o}=t;return Object.assign(Object.assign({},e),{[he(o)]:{error:r}})}case ra.SET_AUTHORIZATIONS_SUMMARY:{const{data:r,query:o}=t;return Object.assign(Object.assign({},e),{summary:Object.assign(Object.assign({},e.summary),{[he(o)]:{data:r||{}}})})}case ra.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY:{const{query:r,error:o}=t;return Object.assign(Object.assign({},e),{summary:Object.assign(Object.assign({},e.summary),{[he(r)]:{error:o||""}})})}case ra.SET_IS_REQUESTING_AUTHORIZATION:{const{data:r}=t;return Object.assign(Object.assign({},e),{isRequesting:r})}}return e},files:(e=Aa,t)=>{const{type:r,id:o}=t;switch(r){case Oa.SET_FILE:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{data:t.data})});case Oa.SET_ERROR_FOR_FILES:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{error:t.error})});default:return e}}}),actions:{...t,...a,...c,...l,...h,...E,...T,...v,...I,..._,...j,...M},controls:me.controls,selectors:{...e,...n,...i,...u,...p,...g,...w,...b,...A,...C,...x,...F},resolvers:{...o,...s,...d,...m,...S,...f,...R,...O,...N,...y,...D,...P}});const Da="/wc/v3/payments",Fa="wc/payments/multi-currency",Ma={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"},Pa={},Ua=e=>e&&e||{},La=e=>Ua(e).currencies||{},ka=e=>La(e).available||{},za=e=>La(e).enabled||{},Ba=e=>La(e).default||{},Ya=e=>Ua(e).currency_settings||{},$a=e=>Ua(e).settings||{};function qa(e){return{type:Ma.SET_CURRENCIES,data:e}}function Ha(e){return{type:Ma.SET_AVAILABLE_CURRENCIES,data:e}}function Va(e){return{type:Ma.SET_ENABLED_CURRENCIES,data:e}}function Wa(e){return{type:Ma.SET_DEFAULT_CURRENCY,data:e}}function Ga(e,t){return{type:Ma.SET_CURRENCY_SETTINGS,data:{code:e,data:t}}}function Qa(e){return{type:Ma.SET_STORE_SETTINGS,data:e}}function*Za(e){const t=Object.keys((0,le.select)(Fa).getEnabledCurrencies()),r=e.filter((e=>!t.includes(e))),o=t.filter((t=>!e.includes(t)));try{const t=yield(0,me.apiFetch)({path:`${Da}/multi-currency/update-enabled-currencies`,method:"POST",data:{enabled:e}});yield qa(t),yield(0,le.dispatch)("core/notices").createSuccessNotice((0,Q.__)("Enabled currencies updated.","woocommerce-payments")),oe("wcpay_multi_currency_enabled_currencies_updated",{added_currencies:r,removed_currencies:o})}catch(e){yield(0,le.dispatch)("core/notices").createErrorNotice((0,Q.__)("Error updating enabled currencies.","woocommerce-payments"))}}function*Ja(e,t){try{const r=yield(0,me.apiFetch)({path:`${Da}/multi-currency/currencies/${e}`,method:"POST",data:t});yield Ga(e,r),yield(0,le.dispatch)("core/notices").createSuccessNotice((0,Q.__)("Currency settings updated.","woocommerce-payments"))}catch(e){yield(0,le.dispatch)("core/notices").createErrorNotice((0,Q.__)("Error updating currency settings.","woocommerce-payments"))}}function*Ka(e,t,r=!1){try{const o=yield(0,me.apiFetch)({path:`${Da}/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 Qa(o),r)return;yield(0,le.dispatch)("core/notices").createSuccessNotice((0,Q.__)("Store settings saved.","woocommerce-payments"))}catch(e){yield(0,le.dispatch)("core/notices").createErrorNotice((0,Q.__)("Error saving store settings.","woocommerce-payments"))}}function Xa(e,t){vo()({path:`${Da}/settings/${e}`,method:"post",data:{value:t}}).catch((()=>{(0,le.dispatch)("core/notices").createErrorNotice((0,Q.__)("Error saving option","woocommerce-payments"))}))}function*es(){const e=`${Da}/multi-currency/currencies`;try{const t=yield(0,me.apiFetch)({path:e});yield qa(t)}catch(e){yield(0,le.dispatch)("core/notices").createErrorNotice((0,Q.__)("Error retrieving currencies.","woocommerce-payments"))}}function*ts(e){const t=`${Da}/multi-currency/currencies/${e}`;try{const r=yield(0,me.apiFetch)({path:t});yield Ga(e,r)}catch(e){yield(0,le.dispatch)("core/notices").createErrorNotice((0,Q.__)("Error retrieving single currency settings.","woocommerce-payments"))}}function*rs(){const e=`${Da}/multi-currency/get-settings`;try{const t=yield(0,me.apiFetch)({path:e});yield Qa(t)}catch(e){yield(0,le.dispatch)("core/notices").createErrorNotice((0,Q.__)("Error retrieving store settings.","woocommerce-payments"))}}const os=()=>(0,le.useSelect)((e=>{const{getCurrencies:t,isResolving:r}=e(Fa);return{currencies:t(),isLoading:r("getCurrencies",[])}}),[]),ns=()=>{const e=(0,le.useSelect)((e=>{const{getEnabledCurrencies:t}=e(Fa);return t()})),{submitEnabledCurrenciesUpdate:t}=(0,le.useDispatch)(Fa);return{enabledCurrencies:e,submitEnabledCurrenciesUpdate:t}},as=()=>{const{storeSettings:e,isLoading:t}=(0,le.useSelect)((e=>{const{getStoreSettings:t,isResolving:r}=e(Fa);return{storeSettings:t(),isLoading:r("getStoreSettings",[])}})),{submitStoreSettingsUpdate:r}=(0,le.useDispatch)(Fa);return{storeSettings:e,isLoading:t,submitStoreSettingsUpdate:r}},ss=()=>(0,le.useSelect)((e=>{const{getDefaultCurrency:t}=e(Fa);return t()}));(0,le.registerStore)(Fa,{reducer:(e=Pa,{type:t,data:r=[]})=>{switch(t){case Ma.SET_CURRENCIES:return{...e,currencies:r,available:r.available,enabled:r.enabled,default:r.default};case Ma.SET_AVAILABLE_CURRENCIES:return{...e,currencies:{...e,available:r.available},available:r.available};case Ma.SET_ENABLED_CURRENCIES:return{...e,currencies:{...e,enabled:r.enabled},enabled:r.enabled};case Ma.SET_DEFAULT_CURRENCY:return{...e,currencies:{...e,default:r.default},default:r.default};case Ma.SET_CURRENCY_SETTINGS:return{...e,currency_settings:{...e.currency_settings,[r.code]:r.data}};case Ma.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:{...L},controls:me.controls,selectors:{...U},resolvers:{...k}});const is=({isPreviewModalOpen:e,setPreviewModalOpen:t,isStorefrontSwitcherEnabledValue:r,isAutomaticSwitchEnabledValue:o})=>{const{storeSettings:n}=as();return e&&(0,$.jsx)(q.Modal,{title:(0,Q.__)("Preview","woocommerce-payments"),isDismissible:!0,className:"multi-currency-store-settings-preview-modal",shouldCloseOnClickOutside:!1,onRequestClose:()=>{t(!1)},children:(0,$.jsx)("iframe",{title:(0,Q.__)("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})})},cs=window.wp.element,ds=({children:e})=>(0,$.jsx)("ul",{children:e});function us(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 ls(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=ls(e.slice(o+1,a),t),i=(0,z.cloneElement)(r,{},s);if(n.push(i),a<e.length-1){const r=ls(e.slice(a+1),t);n=n.concat(r)}}return n=n.filter(Boolean),0===n.length?null:1===n.length?n[0]:(0,z.createElement)(z.Fragment,null,...n)}function ms(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(us)}(t);try{return ls(n,r)}catch(e){if(o)throw new Error(`Interpolation Error: unable to process \`${t}\` because of error \`${e.message}\``);return t}}const ps=({onChange:e,checked:t=!1,currency:{flag:r,symbol:o,code:n,name:a},testId:s=null})=>{const i=(0,cs.useCallback)((t=>{e(n,t)}),[n,e]);return(0,$.jsx)("li",{className:"enabled-currency-checkbox","data-testid":s,children:(0,$.jsx)(q.CheckboxControl,{code:n,checked:t,onChange:i,label:ms({mixedString:"{{flag /}} {{name /}} {{code /}}",components:{flag:(0,$.jsx)("span",{className:"enabled-currency-checkbox__flag",children:""!==r?r:(0,$.jsx)("div",{className:"enabled-currency-checkbox__flag-text",children:(0,$.jsx)("span",{children:n})})}),name:(0,$.jsx)("span",{children:a}),code:(0,$.jsxs)("span",{className:"enabled-currency-checkbox__code",children:["(",o,o!==n&&" "+n,")"]})}}),__nextHasNoMarginBottom:!0})})},_s=((0,Q.__)("any","woocommerce-payments"),(0,Q.__)("one","woocommerce-payments"),(0,Q.__)("two","woocommerce-payments"),(0,Q.__)("three","woocommerce-payments"),(0,Q.__)("four","woocommerce-payments"),(0,Q.__)("five","woocommerce-payments"),(0,Q.__)("six","woocommerce-payments"),(0,Q.__)("seven","woocommerce-payments"),(0,Q.__)("eight","woocommerce-payments"),(0,Q.__)("nine","woocommerce-payments"),({className:e,children:t})=>(0,$.jsx)("ul",{className:e,children:t}));var ys=r(9387);const hs=({symbol:e})=>(0,$.jsx)("div",{className:"currency-delete-illustration__wrapper",children:(0,$.jsxs)("div",{className:"currency-delete-illustration__illustrations",children:[e,(0,$.jsx)(ys.A,{className:"currency-delete-illustration__currency-cross-icon"})]})}),Ss=r.p+"../assets/images/payment-methods/jcb.svg?ver=3351f2584f4a62ad094d",gs=r.p+"../assets/images/cards/visa.svg?ver=f10d76e13a47cb867cca",Es=r.p+"../assets/images/cards/mastercard.svg?ver=d21057587f14a719da45",fs=r.p+"../assets/images/cards/amex.svg?ver=9035aad80e3ae7ac653c",ws=r.p+"../assets/images/payment-methods/woo.svg?ver=86a2411c2b2a56f57bc5",Ts=r.p+"../assets/images/payment-methods/woo-short.svg?ver=e7eb126add68e8fde2b6",Rs=r.p+"../assets/images/cards/apple-pay.svg?ver=126e07a26632bc8a9c21",bs=r.p+"../assets/images/cards/google-pay.svg?ver=30aba48019e36097a19d",vs=r.p+"../assets/images/cards/diners.svg?ver=62451ea54fcf12af5e0d",Os=r.p+"../assets/images/cards/discover.svg?ver=a19341de516c258e11fe",As=r.p+"../assets/images/cards/cb.svg?ver=375fa3d816484fa4b53c",Is=r.p+"../assets/images/cards/unionpay.svg?ver=e60ed9d9db08315ff5c9",Ns=r.p+"../assets/images/payment-methods/link.svg?ver=2af3c660d8ddc95442bb";const Cs=(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 B().createElement("img",Object.assign({className:V("payment-method__icon",r?"":"no-border",n),src:e,alt:t},a))},xs=(Cs(fs,(0,Q.__)("American Express","woocommerce-payments")),Cs(Rs,(0,Q.__)("Apple Pay","woocommerce-payments")),Cs(As,(0,Q.__)("Cartes Bancaires","woocommerce-payments")),Cs(vs,(0,Q.__)("Diners Club","woocommerce-payments")),Cs(Os,(0,Q.__)("Discover","woocommerce-payments")),Cs(bs,(0,Q.__)("Google Pay","woocommerce-payments")),Cs(Ss,(0,Q.__)("JCB","woocommerce-payments")));if(Cs(Ns,(0,Q.__)("Link","woocommerce-payments")),Cs(Es,(0,Q.__)("Mastercard","woocommerce-payments")),Cs(Is,(0,Q.__)("UnionPay","woocommerce-payments")),Cs(gs,(0,Q.__)("Visa","woocommerce-payments")),Cs(ws,(0,Q.__)("WooPay","woocommerce-payments"),!1),Cs(Ts,(0,Q.__)("WooPay","woocommerce-payments"),!1),"undefined"==typeof wooPaymentsPaymentMethodDefinitions)throw new Error("wooPaymentsPaymentMethodDefinitions is undefined");const js=Object.keys(wooPaymentsPaymentMethodDefinitions).reduce(((e,t)=>(e[t]=Object.assign(Object.assign({},wooPaymentsPaymentMethodDefinitions[t]),{icon:({className:e})=>B().createElement("img",{src:wooPaymentsPaymentMethodDefinitions[t].settings_icon_url,alt:wooPaymentsPaymentMethodDefinitions[t].label,className:V("payment-method__icon",e)})}),e)),{jcb:{id:"jcb",label:(0,Q.__)("JCB","woocommerce-payments"),description:(0,Q.__)("Let your customers pay with JCB, the only international payment brand based in Japan.","woocommerce-payments"),icon:xs,currencies:["JPY"],stripe_key:"jcb_payments",allows_manual_capture:!1,allows_pay_later:!1,accepts_only_domestic_payment:!1,settings_icon_url:""}}),Ds=({code:e,label:t,symbol:r,onClick:o,className:n})=>{const[a,s]=(0,cs.useState)(!1),i=window.multiCurrencyPaymentMethodsMap,c=i&&i[e]&&Object.keys(i[e]).length>0,d=c?Object.keys(i[e]):[],u=(0,cs.useCallback)((()=>{c?s(!0):o(e)}),[s,c,o,e]),l=(0,cs.useCallback)((()=>{s(!1),o(e)}),[o,s,e]),m=(0,cs.useCallback)((()=>{s(!1)}),[s]);return(0,$.jsxs)($.Fragment,{children:[a&&(0,$.jsxs)(G,{title:(0,Q.sprintf)((0,Q.__)("Remove %1$s","woocommerce-payments"),t),onRequestClose:m,className:"enabled-currency-delete-modal",actions:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(q.Button,{onClick:l,isPrimary:!0,isDestructive:!0,children:(0,Q.__)("Remove","woocommerce-payments")}),(0,$.jsx)(q.Button,{onClick:m,isSecondary:!0,children:(0,Q.__)("Cancel","woocommerce-payments")})]}),children:[(0,$.jsx)(hs,{symbol:r}),(0,$.jsx)("p",{children:ms({mixedString:(0,Q.sprintf)((0,Q.__)("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,$.jsx)("strong",{})}})}),(0,$.jsx)("ul",{children:d.map((e=>(0,$.jsx)("li",{children:(0,$.jsx)(K,{Icon:js[e].icon,label:js[e].label})},e)))}),(0,$.jsx)("p",{children:(0,Q.sprintf)((0,Q.__)("You can add %s (%s) again at any time in Multi-Currency settings.","woocommerce-payments"),t,e===r?e:[e,r].join(" "))})]}),(0,$.jsx)(q.Button,{isLink:!0,"aria-label":(0,Q.sprintf)((0,Q.__)("Remove %1$s as an enabled currency","woocommerce-payments"),t),className:n,onClick:u,__next40pxDefaultSize:!0,children:(0,$.jsx)(q.Icon,{icon:"trash"})})]})},Fs=(0,z.createContext)(),Ms=({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}=ss(),{setCurrencyCodeToShowSettingsFor:u}=(0,z.useContext)(Fs);return(0,$.jsxs)("li",{className:V("enabled-currency",r),children:[(0,$.jsxs)("div",{className:"enabled-currency__container",children:[(0,$.jsx)("div",{className:"enabled-currency__flag",children:""!==t?t:(0,$.jsx)("div",{className:"enabled-currency__flag-text",children:(0,$.jsx)("span",{children:e})})}),(0,$.jsx)("div",{className:"enabled-currency__label",children:n}),(0,$.jsxs)("div",{className:"enabled-currency__code",children:["(",a+(a===e?"":` ${e}`),")"]})]}),(0,$.jsx)("div",{className:"enabled-currency__rate",children:(()=>{const t=d?Number.parseFloat(1e3*s).toFixed(2):Number.parseFloat(s).toFixed(2);return o?(0,Q.__)("Default currency","woocommerce-payments"):d?`1,000 ${c} → ${t} ${e}`:`1 ${c} → ${t} ${e}`})()}),(0,$.jsxs)("div",{className:"enabled-currency__actions",children:[!o&&(0,$.jsx)(q.Button,{isLink:!0,onClick:()=>{u(e)},"aria-label":(0,Q.sprintf)((0,Q.__)("Edit %1$s","woocommerce-payments"),n),className:"enabled-currency__action edit",__next40pxDefaultSize:!0,children:(0,Q.__)("manage","woocommerce-payments")}),i&&(0,$.jsx)(Ds,{className:"enabled-currency__action delete",onClick:i,label:n,code:e,symbol:a})]})]})},Ps=({isLoading:e})=>(0,$.jsxs)("li",{className:V("enabled-currency-placeholder","enabled-currency"),children:[(0,$.jsxs)("div",{className:"enabled-currency__container",children:[(0,$.jsx)("div",{className:"enabled-currency__flag",children:(0,$.jsx)(J,{isLoading:e,numLines:1,children:(0,$.jsx)("div",{className:"enabled-currency__flag-text"})})}),(0,$.jsx)("div",{className:"enabled-currency__label",children:(0,$.jsx)(J,{isLoading:e,numLines:1})}),(0,$.jsx)("div",{className:"enabled-currency__code",children:(0,$.jsx)(J,{isLoading:e,numLines:1})})]}),(0,$.jsx)("div",{className:"enabled-currency__rate",children:(0,$.jsx)(J,{isLoading:e,numLines:1})}),(0,$.jsx)("div",{className:"enabled-currency__actions",children:(0,$.jsx)(J,{isLoading:e,numLines:1})})]}),Us=({className:e})=>{const t=(0,le.useSelect)((e=>{const{getAvailableCurrencies:t}=e(Fa);return t()})),r=Object.keys(t),o=(0,cs.useRef)(null),{enabledCurrencies:n,submitEnabledCurrenciesUpdate:a}=ns(),s=Object.keys(n),i=ss().code;r.splice(r.indexOf(i),1);const[c,d]=(0,cs.useState)(""),[u,l]=(0,cs.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,cs.useCallback)((()=>{l(r.reduce(((e,t)=>(e[t]=s.includes(t),e)),{}))}),[s,r]);(0,cs.useEffect)((()=>{p()}),[JSON.stringify(r),JSON.stringify(s)]);const _=(e,t)=>{l((r=>({...r,[e]:t})))},[y,h]=(0,cs.useState)(!1),[S,g]=(0,cs.useState)(!1),E=(0,cs.useCallback)((()=>{h(!0)}),[h]),f=(0,cs.useCallback)((()=>{h(!1),g(!1),d(""),p()}),[h,p]);return(0,cs.useEffect)((()=>{y&&o&&!1===S&&g(o.current.offsetWidth)}),[JSON.stringify(m),y]),(0,$.jsxs)($.Fragment,{children:[y&&(0,$.jsxs)(G,{title:(0,Q.__)("Add enabled currencies","woocommerce-payments"),onRequestClose:f,className:"add-enabled-currencies-modal",actions:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(q.Button,{isSecondary:!0,onClick:f,__next40pxDefaultSize:!0,children:(0,Q.__)("Cancel","woocommerce-payments")}),(0,$.jsx)(q.Button,{isPrimary:!0,onClick:()=>{h(!1),g(!1),d("");const e=Object.entries(u).filter((([,e])=>e)).map((([e])=>e));e.push(i),e.sort(),a(e)},__next40pxDefaultSize:!0,children:(0,Q.__)("Update selected","woocommerce-payments")})]}),children:[(0,$.jsx)("div",{className:"add-enabled-currencies-modal__search",children:(0,$.jsx)(q.SearchControl,{__nextHasNoMarginBottom:!0,value:c,onChange:d,placeholder:(0,Q.__)("Search currencies","woocommerce-payments")})}),(0,$.jsx)("h3",{children:c?(0,Q.sprintf)((0,Q.__)("Search results (%1$d currencies)","woocommerce-payments"),m.length):(0,Q.__)("All currencies","woocommerce-payments")}),(0,$.jsx)("div",{className:"add-enabled-currencies-modal__content",ref:o,style:{width:S||"auto"},children:(0,$.jsx)(ds,{children:m.map((e=>(0,$.jsx)(ps,{checked:u[e],onChange:_,currency:t[e]},t[e].id)))})})]}),(0,$.jsx)(q.Button,{variant:"secondary",className:e,onClick:E,"data-testid":"enabled-currencies-add-button",__next40pxDefaultSize:!0,children:(0,Q.__)("Add/remove currencies","woocommerce-payments")})]})},Ls=()=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("h2",{children:(0,Q.__)("Enabled currencies","woocommerce-payments")}),(0,$.jsx)("p",{children:(0,cs.createInterpolateElement)((0,Q.__)("Accept payments in multiple currencies. Prices are converted based on exchange rates and rounding rules. <learnMoreLink>Learn more</learnMoreLink>","woocommerce-payments"),{learnMoreLink:(0,$.jsx)(q.ExternalLink,{href:"https://woocommerce.com/document/woopayments/currencies/multi-currency-setup/#enabled-currencies"})})})]}),ks=()=>{const{isLoading:e}=os(),{enabledCurrencies:t,submitEnabledCurrenciesUpdate:r}=ns(),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,$.jsx)(ee,{description:Ls,className:"multi-currency-settings-enabled-currencies-section",children:(0,$.jsxs)(q.Card,{className:`${o}__enabled-currencies`,children:[(0,$.jsxs)(q.CardBody,{className:`${o}__enabled-currencies-header`,children:[(0,$.jsx)("div",{children:(0,Q.__)("Name","woocommerce-payments")}),(0,$.jsx)("div",{children:(0,Q.__)("Exchange rate","woocommerce-payments")}),(0,$.jsx)("div",{})]}),(0,$.jsx)(q.CardDivider,{}),(0,$.jsx)(q.CardBody,{size:null,children:(0,$.jsxs)(_s,{className:"enabled-currencies-list",children:[!e&&t&&a.map((e=>(0,$.jsx)(Ms,{currency:t[e],onDeleteClick:t[e].is_default?void 0:n},t[e].id))),e&&[1,2,3,4,5].map((e=>(0,$.jsx)(Ps,{isLoading:1},"loadable-placeholder-"+e)))]})}),(0,$.jsx)(q.CardDivider,{}),(0,$.jsx)(q.CardBody,{className:`${o}__available-currencies-container`,children:t&&(0,$.jsx)(Us,{className:`${o}__available-currencies-modal`})})]})})},zs=()=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("h2",{children:(0,Q.__)("Store settings","woocommerce-payments")}),(0,$.jsx)("p",{children:(0,cs.createInterpolateElement)((0,Q.__)("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,$.jsx)(q.ExternalLink,{href:"https://woocommerce.com/document/woopayments/currencies/multi-currency-setup/#store-settings"})})})]}),Bs=()=>{const{storeSettings:e,isLoading:t,submitStoreSettingsUpdate:r}=as(),[o,n]=(0,z.useState)(!1),[a,s]=(0,z.useState)(!1),[i,c]=(0,z.useState)(!1),[d,u]=(0,z.useState)(!1),[l,m]=(0,z.useState)(!1);return(0,z.useEffect)((()=>{Object.keys(e).length&&(c(e.enable_storefront_switcher),s(e.enable_auto_currency))}),[s,c,e]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ee,{description:zs,className:"multi-currency-settings-store-settings-section",children:(0,$.jsx)(J,{isLoading:t,numLines:10,children:(0,$.jsxs)(q.Card,{className:"multi-currency-settings__wrapper",children:[(0,$.jsxs)(q.CardBody,{className:"wcpay-card-body",children:[(0,$.jsx)(q.CheckboxControl,{checked:a,onChange:e=>{s(e),m(!0)},"data-testid":"enable_auto_currency",label:(0,Q.__)("Automatically switch customers to their local currency if it has been enabled","woocommerce-payments"),help:(0,cs.createInterpolateElement)((0,Q.__)("Customers will be notified via store alert banner. <previewLink>Preview</previewLink>","woocommerce-payments"),{previewLink:(0,$.jsx)(q.Button,{isLink:!0,onClick:()=>{u(!0)},__next40pxDefaultSize:!0})}),__nextHasNoMarginBottom:!0}),"Storefront"===e.site_theme?(0,$.jsx)(q.CheckboxControl,{checked:i,onChange:e=>{c(e),m(!0)},"data-testid":"enable_storefront_switcher",label:(0,Q.__)("Add a currency switcher to the Storefront theme on breadcrumb section.","woocommerce-payments"),help:(0,cs.createInterpolateElement)((0,Q.sprintf)((0,Q.__)("A currency switcher is also available in your widgets. <linkToWidgets>Configure now</linkToWidgets>","woocommerce-payments"),"widgets.php"),{linkToWidgets:(0,$.jsx)("a",{href:"widgets.php"})}),__nextHasNoMarginBottom:!0}):null]}),(0,$.jsx)(is,{isPreviewModalOpen:d,setPreviewModalOpen:u,isStorefrontSwitcherEnabledValue:!1,isAutomaticSwitchEnabledValue:!0})]})})}),(0,$.jsx)(ee,{className:"multi-currency-settings-save-settings-section",children:(0,$.jsx)(q.Button,{isPrimary:!0,isBusy:o,disabled:o||!l,onClick:()=>{n(!0),r(a,i),n(!1),m(!1)},__next40pxDefaultSize:!0,children:(0,Q.__)("Save changes","woocommerce-payments")})})]})},Ys=()=>(0,$.jsx)("div",{className:"multi-currency-settings",children:(0,$.jsxs)(X,{children:[(0,$.jsx)(ks,{}),(0,$.jsx)(Bs,{})]})}),$s=window.wc.components,qs=({storeCurrency:e,targetCurrency:t,currencyRate:r=null,roundingValue:o,charmValue:n})=>{const[a,s]=(0,z.useState)(20),i=(0,z.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,Q.__)("Please enter a valid number","woocommerce-payments"):ce(ie(t.code)?s:100*s,t.code,null,!0)}),[a,n,r,o,t]);return(0,$.jsx)(q.Card,{className:"single-currency-settings-preview-wrapper",children:(0,$.jsxs)(q.CardBody,{className:"wcpay-card-body",children:[(0,$.jsx)("div",{children:"left"===e.symbol_position?(0,$.jsx)($s.TextControlWithAffixes,{label:e.name,prefix:e.symbol,"data-testid":"store_currency_value",value:a.toString(),onChange:s}):(0,$.jsx)($s.TextControlWithAffixes,{label:e.name,suffix:e.symbol,"data-testid":"store_currency_value",value:a.toString(),onChange:s})}),(0,$.jsx)("div",{children:(0,$.jsx)($s.TextControlWithAffixes,{"data-testid":"calculated_value",label:t&&t.name,value:i,onChange:()=>null,disabled:!0})})]})})},Hs={0:(0,Q.__)("None","woocommerce-payments"),.25:"0.25","0.50":"0.50","1.00":"1.00 (recommended)","5.00":"5.00","10.00":"10.00"},Vs={1:"1",10:"10",25:"25",50:"50",100:"100 (recommended)",500:"500",1e3:"1000"},Ws={"0.00":(0,Q.__)("None","woocommerce-payments"),"-0.01":"-0.01","-0.05":"-0.05"},Gs={"0.00":(0,Q.__)("None","woocommerce-payments"),"-1":"-1","-5":"-5","-10":"-10","-20":"-20","-25":"-25","-50":"-50","-100":"-100"},Qs=()=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("h2",{children:(0,Q.__)("Currency settings","woocommerce-payments")}),(0,$.jsx)("p",{children:(0,Q.__)("Choose between automatic or manual exchange rates and modify formatting rules to refine the display of your prices.","woocommerce-payments")})]}),Zs=()=>{var e,t;const{currencyCodeToShowSettingsFor:r,setCurrencyCodeToShowSettingsFor:o}=(0,z.useContext)(Fs),[n,a]=(0,z.useState)(!1),{currencies:s}=os(),{enabledCurrencies:i}=ns(),{storeSettings:c}=as(),{currencySettings:d,isLoading:u,submitCurrencySettings:l}=(e=>{const{currencySettings:t,isLoading:r}=(0,le.useSelect)((t=>{const{getCurrencySettings:r,isResolving:o}=t(Fa);return{currencySettings:r(e),isLoading:o("getCurrencySettings",[e])}})),{submitCurrencySettings:o}=(0,le.dispatch)(Fa);return{currencySettings:t,isLoading:r,submitCurrencySettings:o}})(r),m=s.default?s.default:{},p=s.available?s.available[r]:{},_=p.is_zero_decimal?Vs:Hs,y=p.is_zero_decimal?Gs:Ws,h="automatic",S=p?.is_zero_decimal?"100":"1.00",g="0.00",[E,f]=(0,z.useState)(h),[w,T]=(0,z.useState)(0),[R,b]=(0,z.useState)(S),[v,O]=(0,z.useState)(g),[A,I]=(0,z.useState)(!1);(0,z.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:S),O(d[r].price_charm||g))}),[d,r,S]);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",x=p?(0,De.dateI18n)(`${N} ${C}`,je().unix(p.last_updated).toISOString()):"";return(0,$.jsx)("div",{className:"single-currency-settings",children:(0,$.jsxs)(X,{children:[(0,$.jsxs)("h2",{className:"single-currency-settings-breadcrumb",children:[(0,$.jsx)(q.Button,{isLink:!0,onClick:()=>o(null),__next40pxDefaultSize:!0,children:(0,Q.__)("Enabled currencies","woocommerce-payments")})," ","> ",p.name," (",p.code,")"," ",p.flag]}),(0,$.jsx)(ee,{description:Qs,children:(0,$.jsx)(J,{isLoading:u,numLines:33,children:(0,$.jsx)(q.Card,{className:"single-currency-settings-currency-settings",children:(0,$.jsxs)(q.CardBody,{className:"wcpay-card-body",children:[(0,$.jsx)("h4",{children:(0,Q.__)("Exchange rate","woocommerce-payments")}),(0,$.jsx)("fieldset",{children:(0,$.jsxs)("ul",{children:[(0,$.jsx)("li",{children:(0,$.jsx)(q.RadioControl,{onChange:e=>{f(e),a(!0),"manual"===e&&T(w||p.rate)},options:[{description:p.last_updated?(0,Q.sprintf)((0,Q.__)("Current rate: 1 %s = %s %s (Last updated: %s)","woocommerce-payments"),m.code,p.rate,p.code,x):(0,Q.__)("Error - Unable to fetch automatic rate for this currency","woocommerce-payments"),label:(0,Q.__)("Fetch rates automatically","woocommerce-payments"),value:"automatic"},{description:(0,Q.__)("Enter your fixed rate of exchange","woocommerce-payments"),label:(0,Q.__)("Manual","woocommerce-payments"),value:"manual"}],selected:E})}),"manual"===E&&(0,$.jsx)("li",{children:(0,$.jsx)(q.TextControl,{"data-testid":"manual_rate_input",label:(0,Q.__)("Manual Rate","woocommerce-payments"),help:(0,Q.__)("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,$.jsx)("h4",{children:(0,Q.__)("Formatting rules","woocommerce-payments")}),(0,$.jsx)("fieldset",{children:(0,$.jsxs)("ul",{children:[(0,$.jsx)("li",{children:(0,$.jsx)(q.SelectControl,{"data-testid":"price_rounding",label:(0,Q.__)("Price rounding","woocommerce-payments"),help:ms({mixedString:(0,Q.sprintf)((0,Q.__)("Make your %s prices consistent by rounding them up after they're converted. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),p.code),components:{learnMoreLink:(0,$.jsx)(q.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,$.jsx)("li",{children:(0,$.jsx)(q.SelectControl,{"data-testid":"price_charm",label:(0,Q.__)("Charm pricing","woocommerce-payments"),help:ms({mixedString:(0,Q.sprintf)((0,Q.__)("Reduce the converted price for a specific amount. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),p.code),components:{learnMoreLink:(0,$.jsx)(q.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,$.jsx)(ee,{description:()=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("h2",{children:(0,Q.__)("Preview","woocommerce-payments")}),(0,$.jsx)("p",{children:u?"":(0,Q.sprintf)((0,Q.__)("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,$.jsx)(J,{isLoading:u,numLines:8,children:(0,$.jsx)(qs,{className:"single-currency-settings-currency-preview",storeCurrency:m,targetCurrency:p,currencyRate:"manual"===E?w:null,roundingValue:R,charmValue:v})})}),(0,$.jsx)(ee,{className:"single-currency-settings-save-settings-section",children:(0,$.jsx)(q.Button,{isPrimary:!0,isBusy:A,disabled:A||!n,onClick:()=>{I(!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)),I(!1),a(!1)},__next40pxDefaultSize:!0,children:(0,Q.__)("Save changes","woocommerce-payments")})})]})})},Js=()=>{const[e,t]=(0,z.useState)(null);return(0,$.jsx)(Fs.Provider,{value:{currencyCodeToShowSettingsFor:e,setCurrencyCodeToShowSettingsFor:t},children:e?(0,$.jsx)(Zs,{}):(0,$.jsx)(Ys,{})})},Ks=document.querySelector("#wcpay_multi_currency_settings_container");(0,Y.H)(Ks).render((0,$.jsx)(Js,{}))})()})();
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.02 |
proxy
|
phpinfo
|
Настройка