Uname:Linux webm009.cluster131.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64

403WebShell
403Webshell
Server IP : 146.59.209.152  /  Your IP : 216.73.216.152
Web Server : Apache
System : Linux webm009.cluster131.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User : monpetu ( 144298)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/monpetu/www/ipprint/wp-content/plugins/woocommerce-payments/dist/chunks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/monpetu/www/ipprint/wp-content/plugins/woocommerce-payments/dist/chunks/wcpay-documents.js
"use strict";(globalThis.webpackChunkwoocommerce_payments=globalThis.webpackChunkwoocommerce_payments||[]).push([[48],{8053(e,t,o){o.d(t,{A:()=>n});var s=o(5573),a=o(4848);const n=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})})},2335(e,t,o){o.d(t,{Y:()=>p}),o(1609);var s=o(7723),a=o(612),n=o(5837),r=o(8358),c=o(6427),m=o(2461),i=o(4848);const d={documents:(0,s.__)("document","woocommerce-payments"),deposits:(0,s.__)("payout","woocommerce-payments"),disputes:(0,s.__)("dispute","woocommerce-payments"),loans:(0,s.__)("loan","woocommerce-payments"),payments:(0,s.__)("order","woocommerce-payments"),transactions:(0,s.__)("order","woocommerce-payments")},l={documents:(0,s.__)("created","woocommerce-payments"),deposits:(0,s.__)("created","woocommerce-payments"),disputes:(0,s.__)("created","woocommerce-payments"),loans:(0,s.__)("created","woocommerce-payments"),payments:(0,s.__)("placed","woocommerce-payments"),transactions:(0,s.__)("placed","woocommerce-payments")},u=(e,t,o,n)=>{switch(e){case"overview":return o?(0,i.jsx)(i.Fragment,{children:(0,r.A)({mixedString:(0,s.sprintf)((0,s.__)("{{strong}}%1$s is in sandbox mode.{{/strong}} You need to set up a live %1$s account before you can accept real transactions.","woocommerce-payments"),"WooPayments"),components:{strong:(0,i.jsx)("strong",{})}})}):n?(0,i.jsx)(i.Fragment,{children:(0,r.A)({mixedString:(0,s.sprintf)((0,s.__)("{{strong}}%1$s is in test mode{{/strong}} because your store is running in a development or staging environment. To use live mode, switch to a production {{wpEnvLink}}WordPress environment{{/wpEnvLink}} or remove the WCPAY_DEV_MODE constant. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),"WooPayments"),components:{strong:(0,i.jsx)("strong",{}),wpEnvLink:(0,i.jsx)(c.ExternalLink,{href:"https://make.wordpress.org/core/2020/08/27/wordpress-environment-types/"}),learnMoreLink:(0,i.jsx)(c.ExternalLink,{href:"https://woocommerce.com/document/woopayments/testing-and-troubleshooting/sandbox-mode/",onClick:()=>(0,m.yM)("wcpay_overview_test_mode_learn_more_clicked")})}})}):(0,i.jsx)(i.Fragment,{children:(0,r.A)({mixedString:(0,s.sprintf)((0,s.__)("{{strong}}%1$s is in test mode.{{/strong}} All transactions will be simulated. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),"WooPayments"),components:{strong:(0,i.jsx)("strong",{}),learnMoreLink:(0,i.jsx)(c.ExternalLink,{href:"https://woocommerce.com/document/woopayments/testing-and-troubleshooting/sandbox-mode/",onClick:()=>(0,m.yM)("wcpay_overview_test_mode_learn_more_clicked")})}})});case"documents":case"deposits":case"disputes":case"payments":case"loans":case"transactions":return n?(0,i.jsx)(i.Fragment,{children:(0,r.A)({mixedString:(0,s.sprintf)((0,s.__)("Viewing test %1$s. Test mode is active because your store is in a development or staging environment. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),"deposits"===e?"payouts":e),components:{learnMoreLink:(0,i.jsx)(c.ExternalLink,{href:"https://woocommerce.com/document/woopayments/testing-and-troubleshooting/sandbox-mode/"})}})}):t?(0,i.jsx)(i.Fragment,{children:(0,r.A)({mixedString:(0,s.sprintf)((0,s._n)("%1$s was in test mode when this %2$s was %3$s. To view live %2$ss, disable test mode in {{settingsLink}}%1$s settings{{/settingsLink}}.","%1$s was in test mode when these %2$ss were %3$s. To view live %2$ss, disable test mode in {{settingsLink}}%1$s settings{{/settingsLink}}.","deposits"===e?2:1,"woocommerce-payments"),"WooPayments",d[e],l[e]),components:{settingsLink:(0,i.jsx)("a",{href:(0,a.xb)()})}})}):(0,i.jsx)(i.Fragment,{children:(0,r.A)({mixedString:(0,s.sprintf)((0,s.__)("Viewing test %1$s. To view live %1s, disable test mode in {{settingsLink}}%2s settings{{/settingsLink}}.","woocommerce-payments"),"deposits"===e?"payouts":e,"WooPayments"),components:{settingsLink:(0,i.jsx)("a",{href:(0,a.xb)()})}})})}},p=({currentPage:e,actions:t,isDetailsView:o=!1,isTestModeOnboarding:s=!1})=>(0,a.Jo)()?(0,i.jsx)(n.A,{status:"warning",isDismissible:!1,actions:t,children:u(e,o,s,(0,a._t)())}):null},5670(e,t,o){o.d(t,{A:()=>c});var s=o(1609),a=o(4164),n=o(6820),r=o(4848);const c=({className:e,...t})=>{const{isActive:o}=(0,s.useContext)(n.A);return(0,r.jsx)("div",{className:(0,a.A)("task-collapsible-body",e,{"is-active":o}),...t})}},2230(e,t,o){o.d(t,{A:()=>i});var s=o(1609),a=o(4164),n=o(7677),r=o(8351),c=o(6820),m=o(4848);const i=({children:e,title:t,index:o,className:i,visibleDescription:d})=>{const{isCompleted:l,isActive:u}=(0,s.useContext)(c.A);return(0,m.jsxs)("li",{className:(0,a.A)("wcpay-wizard-task",i,{"is-completed":l,"is-active":u}),children:[(0,m.jsx)("div",{className:"wcpay-wizard-task__top-border"}),(0,m.jsxs)("div",{className:"wcpay-wizard-task__headline",tabIndex:-1,children:[(0,m.jsxs)("div",{className:"wcpay-wizard-task__icon-wrapper",children:[(0,m.jsx)("div",{className:"wcpay-wizard-task__icon-text",children:o}),(0,m.jsx)(n.A,{icon:r.A,className:"wcpay-wizard-task__icon-checkmark"})]}),(0,m.jsx)("span",{className:"wcpay-wizard-task__title",children:t})]}),d&&!u&&(0,m.jsx)("span",{className:(0,a.A)("wcpay-wizard-task__visible-description-element","is-muted-color"),children:d}),(0,m.jsx)("div",{className:"wcpay-wizard-task__body",children:e})]})}},7591(e,t,o){o.d(t,{A:()=>r});var s=o(1609),a=o(3508),n=o(4848);const r=({children:e})=>{const t=(0,s.useRef)(!0),o=(0,s.useRef)(null),{activeTask:r}=(0,s.useContext)(a.A);return(0,s.useLayoutEffect)(()=>{if(!0===t.current)return void(t.current=!1);if(!o.current)return;const e=o.current.querySelector(".wcpay-wizard-task.is-active .wcpay-wizard-task__headline");e&&e.focus()},[r]),(0,n.jsx)("div",{ref:o,children:(0,n.jsx)("ul",{children:e})})}},4605(e,t,o){o.d(t,{A:()=>c});var s=o(1609),a=o(3508),n=o(6820),r=o(4848);const c=({children:e,id:t=""})=>{const{activeTask:o,completedTasks:c,setActiveTask:m,setCompletedTasks:i}=(0,s.useContext)(a.A),d=(0,s.useMemo)(()=>({isActive:t===o,setActive:()=>m(t),setCompleted:(e=!0,o="")=>{i(o=>({...o,[t]:e})),o&&m(o)},taskId:t,isCompleted:Boolean(c[t])}),[m,i,o,c,t]);return(0,r.jsx)(n.A.Provider,{value:d,children:e})}},3508(e,t,o){o.d(t,{A:()=>s});const s=(0,o(1609).createContext)({activeTask:"",setActiveTask:()=>null,completedTasks:{},setCompletedTasks:()=>null})},2063(e,t,o){o.d(t,{A:()=>r});var s=o(1609),a=o(3508),n=o(4848);const r=({children:e,defaultActiveTask:t="",defaultCompletedTasks:o={}})=>{const[r,c]=(0,s.useState)(t),[m,i]=(0,s.useState)(o),d=(0,s.useMemo)(()=>({activeTask:r,setActiveTask:c,completedTasks:m,setCompletedTasks:i}),[r,c,m]);return(0,n.jsx)(a.A.Provider,{value:d,children:e})}},2455(e,t,o){o.d(t,{$q:()=>_,A4:()=>s,U9:()=>w,WW:()=>y,_k:()=>a,a9:()=>r,fP:()=>p,j_:()=>u,jb:()=>d,kM:()=>n,oV:()=>g,ox:()=>c,pU:()=>i,tH:()=>l,uM:()=>m});const s="wc/payments/deposits",a="wc/payments/transactions",n="wc/payments/charges",r="wc/payments/timeline",c="wc/payments/disputes",m="wc/payments/settings",i="wc/payments/readers",d="wc/payments/capital",l="wc/payments/documents",u="wc/payments/paymentIntents",p="wc/payments/authorizations",y="wc/payments/files",_="wc/payments/pmPromotions",w="wc/payments/disputeReadiness",g="wc/payments/reports"},5918(e,t,o){o.r(t),o.d(t,{DocumentsPage:()=>he,default:()=>ve});var s={};o.r(s),o.d(s,{updateDocuments:()=>v,updateDocumentsSummary:()=>f,updateErrorForDocuments:()=>x,updateErrorForDocumentsSummary:()=>b});var a={};o.r(a),o.d(a,{formatQueryFilters:()=>N,getDocuments:()=>T,getDocumentsSummary:()=>D});var n={};o.r(n),o.d(n,{getDocuments:()=>M,getDocumentsError:()=>R,getDocumentsSummary:()=>P,getDocumentsSummaryError:()=>$});var r=o(1609),c=o(7583),m=o(7723),i=o(8846),d=o(6476),l=o(6427);const u={vat_invoice:(0,m.__)("Tax Invoice","woocommerce-payments")},p="SET_DOCUMENTS",y="SET_ERROR_FOR_DOCUMENTS",_="SET_DOCUMENTS_SUMMARY",w="SET_ERROR_FOR_DOCUMENTS_SUMMARY";var g=o(6858);const h={summary:{}};function v(e,t){return{type:p,query:e,data:t}}function x(e,t,o){return{type:y,query:e,data:t,error:o}}function f(e,t){return{type:_,query:e,data:t}}function b(e,t,o){return{type:w,query:e,data:t,error:o}}var S=o(6161),k=o(7143),A=o(3832),C=o(3138),j=o(612);const N=e=>({user_email:e.userEmail,match:e.match,date_before:(0,j.x1)(e.dateBefore,!0),date_after:(0,j.x1)(e.dateAfter),date_between:e.dateBetween&&[(0,j.x1)(e.dateBetween[0]),(0,j.x1)(e.dateBetween[1],!0)],type_is:e.typeIs,type_is_not:e.typeIsNot});function*T(e){const t=(0,A.addQueryArgs)(`${C.C}/documents`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...N(e)});try{const o=yield(0,S.apiFetch)({path:t});yield v(e,o.data||[])}catch(t){yield k.controls.dispatch("core/notices","createErrorNotice",(0,m.__)("Error retrieving documents.","woocommerce-payments")),yield x(e,null,t)}}function*D(e){const t=(0,A.addQueryArgs)(`${C.C}/documents/summary`,N(e));try{const o=yield(0,S.apiFetch)({path:t});yield f(e,o)}catch(t){yield b(e,null,t)}}const L=e=>e&&e.documents||{},E=(e,t)=>{const o=(0,g.m)(t);return L(e)[o]||{}},M=(e,t)=>E(e,t).data||[],R=(e,t)=>E(e,t).error||{},B=(e,t)=>{const o=(0,g.m)(t);return L(e).summary[o]||{}},P=(e,t)=>B(e,t).data||{},$=(e,t)=>B(e,t).error||{},I=o(2455).tH,O=(0,k.createReduxStore)(I,{reducer:(0,k.combineReducers)({documents:(e=h,{type:t,query:o={},data:s=[],error:a})=>{const n=(0,g.m)(o);switch(t){case p:return{...e,[n]:{data:s}};case y:return{...e,[n]:{error:a}};case _:return{...e,summary:{...e.summary,[n]:{data:s}}};case w:return{...e,summary:{...e.summary,[n]:{error:a}}}}return e}}),actions:s,selectors:n,resolvers:a,controls:S.controls});(0,k.register)(O);var z=o(6154),U=o.n(z),F=o(7074);const V=Object.entries(u).map(([e,t])=>({label:t,value:e})).filter(function(e){return null!=e}),q=[{label:(0,m.__)("Show","woocommerce-payments"),param:"filter",staticParams:["paged","per_page","orderby","order"],showFilters:()=>!0,filters:[{label:(0,m.__)("All documents","woocommerce-payments"),value:"all"},{label:(0,m.__)("Advanced filters","woocommerce-payments"),value:"advanced"}]}],G=(0,F.P)("wcVersion"),Q=parseFloat(G),W={title:Q<7.8?(0,m.__)("Documents match {{select /}} filters","woocommerce-payments"):(0,m.__)("Documents match <select /> filters","woocommerce-payments"),filters:{date:{labels:{add:(0,m.__)("Date","woocommerce-payments"),remove:(0,m.__)("Remove document date filter","woocommerce-payments"),rule:(0,m.__)("Select a document date filter match","woocommerce-payments"),title:Q<7.8?(0,m.__)("{{title}}Date{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,m.__)("<title>Date</title> <rule /> <filter />","woocommerce-payments"),filter:(0,m.__)("Select a document date","woocommerce-payments")},rules:[{value:"before",label:(0,m.__)("Before","woocommerce-payments")},{value:"after",label:(0,m.__)("After","woocommerce-payments")},{value:"between",label:(0,m.__)("Between","woocommerce-payments")}],input:{component:"Date"}},type:{labels:{add:(0,m.__)("Type","woocommerce-payments"),remove:(0,m.__)("Remove document type filter","woocommerce-payments"),rule:(0,m.__)("Select a document type filter match","woocommerce-payments"),title:Q<7.8?(0,m.__)("{{title}}Type{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,m.__)("<title>Type</title> <rule /> <filter />","woocommerce-payments"),filter:(0,m.__)("Select a document type","woocommerce-payments")},rules:[{value:"is",label:(0,m._x)("Is","document type","woocommerce-payments")},{value:"is_not",label:(0,m._x)("Is not","document type","woocommerce-payments")}],input:{component:"SelectControl",options:V}}}};var H=o(4848);const J=()=>(0,H.jsx)("div",{className:"woocommerce-filters-documents",children:(0,H.jsx)(i.ReportFilters,{filters:q,advancedFilters:W,showDatePicker:!1,path:"/payments/documents",query:(0,d.getQuery)()})});var Y=o(2063),Z=o(4605),X=o(7591),K=o(1455),ee=o.n(K),te=o(5670),oe=o(2230),se=o(6820);const ae=({onCompleted:e,vatNumber:t,placeholderCompanyName:o,placeholderCompanyAddress:s})=>{const{setCompleted:a}=(0,r.useContext)(se.A),[n,c]=(0,r.useState)(null),[i,d]=(0,r.useState)(!1),[u,p]=(0,r.useState)(""),[y,_]=(0,r.useState)("");(0,r.useEffect)(()=>{p(o),_(s)},[o,s]);const w=""===u.trim()||""===y.trim();return(0,H.jsx)(oe.A,{index:2,title:(0,m.__)("Confirm your business details","woocommerce-payments"),children:(0,H.jsxs)(te.A,{children:[(0,H.jsx)(l.TextControl,{className:"wcpay-company-data-task__text-control",label:(0,m.__)("Business name","woocommerce-payments"),value:u,onChange:p,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,H.jsx)(l.TextareaControl,{className:"wcpay-company-data-task__textarea-control",label:(0,m.__)("Address","woocommerce-payments"),value:y,onChange:_,__nextHasNoMarginBottom:!0}),(0,H.jsx)(l.Button,{variant:"primary",disabled:w||i,isBusy:i,onClick:async()=>{try{d(!0);const o={name:u,address:y};null!==t&&(o.vat_number=t);const s=await ee()({path:"/wc/v3/payments/vat",method:"POST",data:o});d(!1),a(!0,"vat-submitted"),e(s.vat_number,s.name,s.address)}catch(e){d(!1),c(e.message)}},__next40pxDefaultSize:!0,children:(0,m.__)("Confirm","woocommerce-payments")}),n&&(0,H.jsx)(l.Notice,{status:"error",isDismissible:!1,className:"vat-number-error",children:n})]})})},ne=()=>{switch(wcpaySettings.accountStatus.country){case"AU":return(0,m.__)("ABN","woocommerce-payments");case"JP":return(0,m.__)("Corporate Number","woocommerce-payments");case"NZ":return(0,m.__)("IRD Number","woocommerce-payments");case"SG":return(0,m.__)("UEN or GST Registration Number","woocommerce-payments");default:return(0,m.__)("VAT Number","woocommerce-payments")}},re=()=>{switch(wcpaySettings.accountStatus.country){case"AU":return(0,m.__)("By inputting your ABN number you confirm that you are going to account for the GST.","woocommerce-payments");case"JP":return(0,m.__)("","woocommerce-payments");case"NO":return(0,m.__)("By inputting your VAT number you confirm you are a Norway VAT registered business and that you are going to account for the VAT.","woocommerce-payments");case"NZ":return(0,m.__)("By inputting your IRD number you confirm that you are going to account for the GST.","woocommerce-payments");case"SG":return(0,m.__)("By providing your UEN or GST number you confirm you are a Singapore GST registered business and you are going to account for the GST.","woocommerce-payments");default:return(0,m.__)("If your sales exceed the VAT threshold for your country, you're required to register for a VAT Number.","woocommerce-payments")}},ce=()=>{switch(wcpaySettings.accountStatus.country){case"AU":return(0,m.__)("11-digit number, for example 12 345 678 901.","woocommerce-payments");case"JP":return(0,m.__)("13-digit number, for example 1234567890123.","woocommerce-payments");case"NZ":return(0,m.__)("8-digit or 9-digit number, for example 99-999-999 or 999-999-999.","woocommerce-payments");case"SG":return(0,m.__)("Enter your UEN (e.g., 200312345A) or GST Registration Number (e.g., M91234567X).","woocommerce-payments");default:return(0,m.__)("8 to 12 digits with your country code prefix, for example DE 123456789.","woocommerce-payments")}},me=({onCompleted:e})=>{const{setCompleted:t}=(0,r.useContext)(se.A),[o,s]=(0,r.useState)(null),[a,n]=(0,r.useState)(!1),[c,i]=(0,r.useState)(!1),[d,u]=(0,r.useState)(""),p=(()=>{switch(wcpaySettings.accountStatus.country){case"AU":case"JP":case"NZ":case"SG":return"";case"GR":return"EL ";case"CH":return"CHE ";default:return`${wcpaySettings.accountStatus.country} `}})(),y=c&&d.trimEnd()===p.trimEnd();return(0,r.useEffect)(()=>{c&&""===d&&u(p),c||""===d||u("")},[c,d,p]),(0,H.jsxs)(oe.A,{index:1,title:(0,m.sprintf)((0,m.__)("Set your %1$s","woocommerce-payments"),ne()),children:[(0,H.jsx)("p",{className:"wcpay-wizard-task__description-element",children:(0,m.__)("The information you provide here will be used for all of your account's tax documents.","woocommerce-payments")}),(0,H.jsxs)(te.A,{children:[(0,H.jsx)(l.CheckboxControl,{className:"wcpay-vat-number-task__checkbox",checked:c,onChange:i,label:(0,m.sprintf)((0,m.__)("I have a valid %1$s","woocommerce-payments"),ne()),help:re(),__nextHasNoMarginBottom:!0}),c&&(0,H.jsx)(l.TextControl,{className:"wcpay-vat-number-task__text-control",label:ne(),help:ce(),value:d,onChange:e=>{const t=p.trim();e.trim().startsWith(t)?u(e):u(t)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),o&&(0,H.jsx)(l.Notice,{status:"error",isDismissible:!1,className:"vat-number-error",children:o}),(0,H.jsx)(l.Button,{variant:"primary",disabled:y||a,isBusy:a,onClick:async()=>{const o=c?d.replace(p,""):null;let a="",r="";s("");try{if(null!==o){n(!0);const e=await ee()({path:`/wc/v3/payments/vat/${encodeURI(o)}`});n(!1),a=e.name??"",r=e.address??""}t(!0,"company-data"),e(o,a,r)}catch(e){n(!1),s((e=>{const t=ne();switch(e.code){case"wcpay_invalid_tax_number":return(0,m.sprintf)((0,m.__)("The provided %s failed validation.","woocommerce-payments"),t);case"wcpay_unsupported_tax_docs_country":return(0,m.__)("Your account's country is not supported for tax ID validation.","woocommerce-payments");default:return e.message}})(e))}},__next40pxDefaultSize:!0,children:(0,m.__)("Continue","woocommerce-payments")})]})]})},ie=({onCompleted:e})=>{const[t,o]=(0,r.useState)(null),[s,a]=(0,r.useState)(""),[n,c]=(0,r.useState)("");return(0,H.jsx)(Y.A,{defaultActiveTask:"vat-number",children:(0,H.jsxs)(X.A,{children:[(0,H.jsx)(Z.A,{id:"vat-number",children:(0,H.jsx)(me,{onCompleted:(e,t,s)=>{o(e),a(t),c(s)}})}),(0,H.jsx)(Z.A,{id:"company-data",children:(0,H.jsx)(ae,{onCompleted:(t,o,s)=>{e(t,o,s)},vatNumber:t,placeholderCompanyName:s,placeholderCompanyAddress:n})})]})})},de=({isModalOpen:e,setModalOpen:t,onCompleted:o})=>e?(0,H.jsx)(l.Modal,{title:(0,m.__)("Set your tax details","woocommerce-payments"),onRequestClose:()=>t(!1),children:(0,H.jsx)(ie,{onCompleted:o})}):null;var le=o(7564),ue=o(2421);const pe=e=>"vat_invoice"===e.type?e.period_from&&e.period_to?(0,m.sprintf)((0,m.__)("Tax invoice for %s to %s","woocommerce-payments"),(0,le._)(e.period_from),(0,le._)(e.period_to)):(0,m.__)("Tax invoice without proper period dates","woocommerce-payments"):(0,m.__)("Unknown document type","woocommerce-payments"),ye=()=>{const{documents:e,isLoading:t}=(({paged:e,per_page:t,orderby:o,order:s,match:a,date_before:n,date_after:r,date_between:c,type_is:m,type_is_not:i})=>(0,k.useSelect)(d=>{const{getDocuments:l,getDocumentsError:u,isResolving:p}=d(I),y={paged:Number.isNaN(parseInt(e??"",10))?"1":e,perPage:Number.isNaN(parseInt(t??"",10))?"25":t,orderby:o||"date",order:s||"desc",match:a,dateBefore:n,dateAfter:r,dateBetween:c&&c.sort((e,t)=>U()(e).diff(U()(t))),typeIs:m,typeIsNot:i};return{documents:l(y),documentsError:u(y),isLoading:p("getDocuments",[y])}},[e,t,o,s,a,n,r,JSON.stringify(c),m,i]))((0,d.getQuery)()),{documentsSummary:o,isLoading:s}=(({match:e,date_before:t,date_after:o,date_between:s,type_is:a,type_is_not:n})=>(0,k.useSelect)(r=>{const{getDocumentsSummary:c,isResolving:m}=r(I),i={match:e,dateBefore:t,dateAfter:o,dateBetween:s,typeIs:a,typeIsNot:n};return{documentsSummary:c(i),isLoading:m("getDocumentsSummary",[i])}},[e,t,o,JSON.stringify(s),a,n]))((0,d.getQuery)()),[a,n]=(0,r.useState)(!1),[p,y]=(0,r.useState)(null),_=(0,r.useCallback)((e,t,o=!0)=>{const s=(0,j.tT)(e);((e,t,o)=>(y({documentId:e,type:t,newTab:o}),!("vat_invoice"===t&&!wcpaySettings.accountStatus.hasSubmittedVatData&&(n(!0),1))))(e,t,o)&&window.open(s,o?"_blank":"_self")},[]),{document_id:w,document_type:g}=(0,d.getQuery)();(0,r.useEffect)(()=>{w&&g&&_(w,g,!1)},[w,g,_]);const h=[{key:"date",label:(0,m.__)("Date","woocommerce-payments"),screenReaderLabel:(0,m.__)("Date and time","woocommerce-payments"),required:!0,isLeftAligned:!0,defaultOrder:"desc",cellClassName:"date",isSortable:!0,defaultSort:!0},{key:"type",label:(0,m.__)("Type","woocommerce-payments"),screenReaderLabel:(0,m.__)("Type","woocommerce-payments"),required:!0,isLeftAligned:!0},{key:"description",label:(0,m.__)("Description","woocommerce-payments"),screenReaderLabel:(0,m.__)("Description","woocommerce-payments")},{key:"download",label:(0,m.__)("Download","woocommerce-payments"),screenReaderLabel:(0,m.__)("Download","woocommerce-payments"),isLeftAligned:!1,isNumeric:!0}].filter(Boolean),{columnsToDisplay:v,onColumnsChange:x}=(0,ue.L)("wc_payments_documents_hidden_columns",h),f=o.count||0,b=e.map(e=>{const t=u[e.type]??(0,m.__)("Unknown document type","woocommerce-payments"),o={date:{value:e.date,display:(0,le._)(e.date)},type:{value:t,display:t},description:{value:pe(e),display:pe(e)},download:{value:(0,j.tT)(e.document_id),display:(0,H.jsx)(l.Button,{className:"documents-list__download-button",variant:"link",onClick:()=>_(e.document_id,e.type),__next40pxDefaultSize:!0,children:(0,m.__)("Download","woocommerce-payments")})}};return v.map(({key:e})=>o[e]||{display:null})}),S=(0,m.__)("Documents","woocommerce-payments");let A;return void 0!==o.count&&!1===s&&(A=[{label:(0,m._n)("document","documents",o.count,"woocommerce-payments"),value:`${o.count}`}]),(0,H.jsxs)(c.A,{children:[(0,H.jsx)(J,{}),(0,H.jsx)(i.TableCard,{className:"documents-list woocommerce-report-table",title:S,isLoading:t,rowsPerPage:parseInt((0,d.getQuery)().per_page??"",10)||25,totalRows:f,headers:v,rows:b,summary:A,query:(0,d.getQuery)(),onQueryChange:d.onQueryChange,onColumnsChange:x,actions:[]}),(0,H.jsx)(de,{isModalOpen:a,setModalOpen:n,onCompleted:()=>{n(!1),wcpaySettings.accountStatus.hasSubmittedVatData=!0,p&&_(p.documentId,p.type,p.newTab)}})]})};var _e=o(2335),we=o(9199),ge=o(252);const he=()=>(0,H.jsxs)(c.A,{children:[(0,H.jsx)(_e.Y,{currentPage:"documents"}),(0,H.jsx)(ye,{}),(0,H.jsx)(we.A,{children:(0,H.jsx)(ge.A,{})})]}),ve=he},2421(e,t,o){o.d(t,{L:()=>n});var s=o(1609),a=o(314);const n=(e,t)=>{const{updateUserPreferences:o,...n}=(0,a.useUserPreferences)(),r=n[e]??"";return{onColumnsChange:s=>{const a=t.map(e=>e.key).filter(e=>!s.includes(e));e&&o({[e]:a})},columnsToDisplay:(0,s.useMemo)(()=>Array.isArray(r)?t.map(e=>({...e,visible:!r.includes(e.key)})):t,[t,r])}}},6858(e,t,o){o.d(t,{m:()=>s});const s=e=>JSON.stringify(e,Object.keys(e).sort())}}]);

Youez - 2016 - github.com/yon3zu
LinuXploit