1"use strict";(self.webpackChunkchc_online_banking_app=self.webpackChunkchc_online_banking_app||[]).push([[326],{65326:function(e,n,t){t.r(n),t.d(n,{default:function(){return mn}});var a=t(34706),i=t(79730),s=t(17485),r=t(1413),c=t(6187),o=t.n(c),d=t(54134),l=t(162),u=t(91538),m=t(50030),h=t(3270),f=t(92824),g=t(45298),y=t(18037),x=t(10161),p=function(e){return(0,x.jsx)(y.c.Option,(0,r.Z)((0,r.Z)({},e),{},{innerProps:Object.assign({},e.innerProps,{"aria-label":"Select frequency ".concat(e.data.key)}),children:e.children}))},v=t(12274),b=t(7018),Z=t(52475),j=function(e){(0,b.F)("".concat(e.data.key),e.data,e.selectOption);var n=e.getStyles("option",e),t=(0,r.Z)({},n);return(0,x.jsx)("div",(0,r.Z)((0,r.Z)({ref:e.innerRef},(0,Z.P)(e)),{},{"aria-label":"".concat(e.data.key),role:"option","aria-selected":e.isSelected,id:"".concat(e.data.key),style:t,children:e.children}))},N=(0,r.Z)((0,r.Z)({},g.vi),{},{control:function(e,n){var t=(0,g.vL)(e,n);return(0,r.Z)((0,r.Z)({},t),{},{backgroundColor:f.Z.whiteColor})}}),C=function(e){return e.key},_=function(e){return e.key},I=function(e){var n=e.value,t=e.onChange,a=e.options,i=e.disabled,s=(0,v.Z)().isMobile;return(0,x.jsxs)("div",{className:"FrequencySelect",children:[(0,x.jsx)("div",{className:"FrequencySelect__label",children:"Frequency"}),(0,x.jsx)(g.ZP,{className:"FrequencySelect__select",styles:N,name:"collectionAddress",placeholder:"Select frequency",onChange:t,options:a,value:n,getOptionLabel:C,getOptionValue:_,isSearchable:!1,isDisabled:i,testId:"payment-frequency-select",tabIndex:2,"aria-label":"Frequency",components:{Option:s?j:p}})]})},A=t(46952),P=t(73722),S=t(32734),k=t(54729),w=t(70885),O=t(63553),E=t(11016),T=t(74293),R=t(60070),D={header:"Number of payments",body:(0,x.jsx)("p",{children:'If the standing order is for a limited period of time, choose "Number of payments" and insert the necessary figure (between 2 and 999). Alternatively, choose "No end date" and the payment will continue until you cancel it.'})},B=function(e){var n=e.bizEvent;return(0,x.jsx)("div",{className:"NumberOfPaymentsInfo",children:(0,x.jsx)(R.Z,{testId:"so-show-repeats-info-button",modalContent:D,name:"Number of payments info",tabIndex:2,id:"number-of-payments-info",bizEvent:n,ariaLabel:"Number of payments information"})})},F=function(e){var n=e.bizEvent,t=(0,s.v9)(O.iv),i=(0,s.v9)(O.BJ),r=(0,a.useState)(i),c=(0,w.Z)(r,2),o=c[0],u=c[1],m=(0,s.v9)(O.A3),h=(0,s.v9)(O.JV),f=function(e){o||u(!0),d.ZP.setNoEndDate(e)};return(0,a.useEffect)((function(){u(i)}),[i]),(0,x.jsxs)("fieldset",{className:"NumberOfPaymentsSection",children:[(0,x.jsxs)("div",{className:"NumberOfPaymentsSection__number-of-payments","data-testid":"so-number-of-payments-radio-button",children:[(0,x.jsx)(E.Z,{onChange:function(){return f(!1)},checked:!m,disabled:t,className:"NumberOfPaymentsSection__radio",testId:"so-hidden-number-of-payments-radio-button",tabIndex:2,children:"Number of payments"}),(0,x.jsxs)("div",{className:"NumberOfPaymentsSection__input",children:[(0,x.jsx)("div",{children:(0,x.jsx)(T.Z,{onChange:d.ZP.setRepeat,value:h,disabled:m||t,max:l.bG.MAX,min:l.bG.MIN,testId:"so-number-of-payments-input",tabIndex:2,ariaLabel:"Number of payments",maxLength:3})}),(0,x.jsx)(B,{bizEvent:n})]})]}),(0,x.jsx)("div",{className:"NumberOfPaymentsSection__no-end-date","data-testid":"so-no-end-date-radio-button",children:(0,x.jsx)(E.Z,{onChange:function(){return f(!0)},checked:m,className:"NumberOfPaymentsSection__radio",disabled:t,testId:"so-hidden-end-date-radio-button",tabIndex:2,children:"No end date"})})]})},M=t(21239),L=t(20330),G=t(5505),U={header:"",body:(0,x.jsx)(x.Fragment,{})},Y={header:"Charges and Cut-Off Times",body:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("p",{children:(0,x.jsx)("strong",{children:"Standing orders"})}),(0,x.jsx)("p",{children:"New and amended standing orders received after 4pm (UK time), or on a non-working day, will normally be processed on the following working day."}),(0,x.jsx)("p",{children:"Cancellations of standing orders received after 6pm (UK time), or on a non-working day, will normally be processed on the following working day."}),(0,x.jsx)("p",{children:"There is no charge for standing orders made online."})]})},H=t(84819),q=t(1566),W=t(56039),z=t(37925),V=t(27768),K=t(20608),X=t(27366),J=t(44780),Q=t(1249),$=t(65640),ee=t(61574),ne=function(){K.Z.hideModal(),d.ZP.preview()},te=function(){K.Z.hideModal(),d.ZP.resetCopCheck()},ae=function(){K.Z.hideModal(),ie()},ie=function(){K.Z.showModal({body:(0,x.jsx)(Q.Z,{onContinue:ne,onEdit:te}),isClosable:!1,size:"medium"})},se=function(){return(0,s.v9)(O.M5)},re=t(8132),ce=function(e){var n=e.limitsErrorMessage,t=(0,s.v9)(O.$o),a=(0,s.v9)(O.lx),i=(0,s.v9)(O.Bg),r=(0,s.v9)(O.XJ),c=(0,s.v9)(O.Fx),o=(0,s.v9)(O.Bv),u=(0,s.v9)(O.JD),h=(0,s.v9)(O.XR),f=(0,s.v9)(O.lR)===re.gb.FETCHING_ACCOUNT_LOOKUP,g=se();return(0,x.jsxs)("div",{className:"NewBeneficiaryForm","data-testid":"new-beneficiary-form",children:[(0,x.jsx)(z.Z,{onChange:d.ZP.setAccountType,accountType:a,disabled:u}),(0,x.jsx)(V.Z,{accountType:a,onBlur:function(){t.accountNumber&&t.sortCode&&!h&&d.ZP.fetchAccountLookup(t)},targetAccount:t,onChangeAccount:d.ZP.setTargetAccount,errorProps:Ne,bankDetail
1s:r,loadingBankDetails:f,disabled:u}),a&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(H.Z,{}),(0,x.jsx)(q.ZP,{amountValue:i,onAmountChange:d.ZP.setAmount,disabled:!t.accountNumber||!t.sortCode,currency:m.hi,amountInputTestId:"so-amount-input",decimalInputTestId:"so-amount-input-decimal",customError:n,hasCheckIcon:!1,hasWarning:g}),(0,x.jsx)(W.Z,{inputId:"so-beneficiary-reference-input",value:c,disabled:!r||u,errorMessages:je,placeholder:"Optional",label:"Beneficiary reference",onChange:d.ZP.setReference,maxLength:l.ii.MAX_SHORTCUT,required:o,hasCheckIcon:!1})]})]})},oe=t(80087),de=t(7269),le=t(39190),ue=t(78525),me=t(61560),he=t(54622),fe=function(e){var n=e.limitsErrorMessage,t=(0,s.v9)(O.Bg),a=(0,s.v9)(O.Fx),i=(0,s.v9)(O.XJ),c=(0,s.v9)(O.$o),o=(0,me._F)((0,s.v9)(O.jR)),h=(0,s.v9)(O.iv),f=(0,s.v9)(O.lx),g=(0,s.v9)(O.BJ),y=(0,s.v9)(O.JD),p=(0,s.v9)(O.lR)===re.gb.FETCHING_ACCOUNT_LOOKUP,v=(0,me.e$)({arrangementId:null===o||void 0===o?void 0:o.id,beneficiaryType:oe.td.TPP,pageKey:u.Z.STANDING_ORDER_PAYMENT}),b=se();return(0,x.jsxs)("div",{className:"ExistingBeneficiaryForm","data-testid":"existing-beneficiary-form",children:[(0,x.jsx)(ue.ZP,(0,r.Z)({inputValue:c.name,onInputChange:function(e){d.ZP.setTargetAccount((0,r.Z)((0,r.Z)({},c),{},{name:e}))},disabled:!o||h||y||p,value:c.arrangementId?c:null,onChange:function(e){if(e){var n=(0,he.HM)(e);d.ZP.setTargetAccount(n),n.accountNumber&&n.sortCode&&d.ZP.fetchAccountLookup(n)}},options:v,onClear:d.ZP.resetTargetAccount,shouldNotClearValueOnMenuOpen:!0,openMenuOnClick:!0},Ne)),(c.arrangementId||g)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"ExistingBeneficiaryForm__details","data-testid":"account-details",children:[f&&(0,x.jsxs)("div",{className:"ExistingBeneficiaryForm__details-row","data-testid":"account-type",children:[(0,x.jsx)("div",{className:"ExistingBeneficiaryForm__details-label",children:"Account type"}),(0,x.jsxs)("span",{children:[f," account"]})]}),c&&(0,x.jsxs)("div",{className:"ExistingBeneficiaryForm__details-row",children:[(0,x.jsx)("div",{className:"ExistingBeneficiaryForm__details-label",children:"Account details"}),(0,x.jsx)(de.Z,{targetBankAccount:c})]}),i&&(0,x.jsx)(le.Z,{bankDetails:i,label:"Bank details",loadingBankDetails:p})]}),(0,x.jsx)(H.Z,{}),(0,x.jsx)(q.ZP,{amountValue:t,onAmountChange:d.ZP.setAmount,disabled:!i,currency:m.hi,amountInputTestId:"so-amount-input",decimalInputTestId:"so-amount-input-decimal",customError:n,hasCheckIcon:!1,hasWarning:b}),(0,x.jsx)(W.Z,{inputId:"so-beneficiary-reference-input",value:a,disabled:!i||y,errorMessages:je,placeholder:"Optional",label:"Beneficiary reference",onChange:d.ZP.setReference,maxLength:l.ii.MAX_SHORTCUT,hasCheckIcon:!1})]})]})},ge=t(36406),ye=t(62960),xe=t(47877),pe=t(19044),ve=t(72040),be=t(90391),Ze=t(50620),je={MAX_LENGTH:"We can only send 18 characters in a standing order",PATTERN:"You used restricted symbols in reference"},Ne={errorMessages:{MAX_LENGTH:"We can only send 30 characters in a standing order"},pattern:l.sG.PATTERN_SHORTCUT,maxLength:l.sG.MAX_SHORTCUT},Ce=function(){(0,pe.t)(u.Z.STANDING_ORDER_PAYMENT),(0,xe.R)({title:"Standing orders",srOnlyContent:"Fill out the form to create standing order"},[]);var e=(0,a.useRef)(null),n=(0,me._F)((0,s.v9)(O.jR)),t=(0,s.v9)(O.Bg),i=(0,s.v9)(O.$o),c=(0,s.v9)(O.Nb),l=(0,s.v9)(O.Yy),f=(0,s.v9)(O.ok),g=(0,s.v9)(O.UT),y=(0,s.v9)(O.iv),p=(0,s.v9)(O.BJ),v=(0,s.v9)(O.wA),b=(0,s.v9)(O.X3),Z=(0,s.v9)(O.Tj),j=(0,s.v9)(O.UA),N=((0,a.useEffect)((function(){d.ZP.fetchFrequencies()}),[]),(0,s.v9)(O.aF)),C=(0,me.e3)({action:oe.d1.STANDING_ORDER,pageKey:u.Z.STANDING_ORDER_PAYMENT}),_=a.useMemo((function(){return(0,Ze.VK)({plusWorkingDays:1}).toDate()}),[]);(0,a.useEffect)((function(){l||d.ZP.setProcessingDate(_)}),[_,l]);var w=(0,s.v9)(ge.Qc(ve.QH));(0,a.useEffect)((function(){p&&d.ZP.fetchAccountLookup(i)}),[p]),(0,a.useEffect)((function(){d.ZP.fetchProfilingId()}),[]),(0,ye.s)({paymentType:ve.QH,processingDate:l,pageKey:u.Z.STANDING_ORDER_PAYMENT,paymentId:f});var T=function(){var e=t&&w&&((0,be.vW)({amount:t,limits:w})||(0,be.m_)({amount:t,limits:w}))||null;return e?(0,be.Nk)(e)?m.R2:"The amount entered is greater than the limit for this type of transaction. Please reduce the amount":null},D=(0,s.v9)(O.ms(T())),B={action:"click",category:"standingOrder",section:Z?"newBeneficiary":"existingBeneficiary"},H=(0,r.Z)((0,r.Z)({},B),{}
1,{type:"com.web.payExistingBeneficiaryRadio"}),q=(0,r.Z)((0,r.Z)({},B),{},{type:"com.web.payNewBeneficiaryRadio"}),W=(0,r.Z)((0,r.Z)({},B),{},{type:"com.web.chargesAndCutOffTimes"}),z=(0,r.Z)((0,r.Z)({},B),{},{type:"com.web.updateBeneficiary"}),V=(0,r.Z)((0,r.Z)({},B),{},{type:"com.web.numberOfPaymentsInfo"});return(0,x.jsxs)("div",{className:"StandingOrderForm","data-testid":"widget-chc-so",role:"form",children:[(0,x.jsx)(h.Z,{leftChild:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(P.Z,{value:n,disabled:y,onChange:d.ZP.setSourceAccount,options:C,testId:"source-account-select"}),(0,x.jsxs)("fieldset",{className:"StandingOrderForm__beneficiary-type",children:[(0,x.jsx)("legend",{className:"StandingOrderForm__beneficiary-type-label",children:"Select a beneficiary type"}),(0,x.jsx)(E.Z,{checked:!!(f?i.arrangementId:!1===Z),name:"existing-beneficiary",onChange:function(){d.ZP.setIsNewBeneficiary(!1)},disabled:!n,testId:"existing-beneficiary",tabIndex:1,bizEvent:H,children:"Pay an existing beneficiary"}),(0,x.jsx)(E.Z,{checked:!!(f?!i.arrangementId:!0===Z),name:"new-beneficiary",onChange:function(){d.ZP.setIsNewBeneficiary(!0)},disabled:!n,testId:"new-beneficiary",tabIndex:1,bizEvent:q,children:"Pay new beneficiary"})]}),!0===Z&&(0,x.jsx)(ce,{limitsErrorMessage:T()}),!1===Z&&(0,x.jsx)(fe,{limitsErrorMessage:T()})]}),rightChild:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(A.Z,{children:[(0,x.jsx)(I,{onChange:function(e){return d.ZP.setFrequency(e)},options:N,disabled:y,value:c,"data-testid":"payment-frequency-select"}),(0,x.jsx)(k.Z,{onChange:d.ZP.setProcessingDate,value:l,disabled:y,label:y?"Next payment date":"First payment date",minDate:_,excludeDates:[],isNormalFontWeight:!0,isRowView:!0}),v?(0,x.jsx)(k.Z,{onChange:d.ZP.setProcessingDate,value:b,disabled:y,label:(0,x.jsxs)(x.Fragment,{children:["Final payment",(0,x.jsx)(R.Z,{modalContent:U,disabled:y,id:"final-payment-date-info"})]}),minDate:_,excludeDates:[],isNormalFontWeight:!0,isRowView:!0}):(0,x.jsx)(F,{bizEvent:V})]}),(0,x.jsx)(S.Z,{content:Y,bizEvent:W})]})}),(0,x.jsx)(M.Z,{leftChild:(0,x.jsx)(G.Z,{tabIndex:2,value:g,isExisting:!!i.arrangementId||p,onChange:function(e){d.ZP.setSaveTargetAccount(e),(0,he.Gd)(function(e){return(0,r.Z)((0,r.Z)({},B),{},{type:e?"com.web.saveBeneficiaryCheckboxTrue":"com.web.saveBeneficiaryCheckboxFalse"})}(e))},testId:"so-save-beneficiary-checkbox",bizEvent:z}),rightChild:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(L.Z,{variant:"secondary",onClick:function(){d.ZP.resetPaymentOrder(),d.ZP.resetAccountLookup(),e.current&&e.current.markAsUntouched()},testId:"so-clear-button",tabIndex:2,children:"Clear"}),(0,x.jsx)(L.Z,{variant:"primary",disabled:!D||!!T()||o()(l).isBefore(_,"day"),testId:"so-review-button-web-view",onClick:function(){j?d.ZP.copCheck():d.ZP.preview()},tabIndex:2,margin:!0,children:p?"Update standing order":"Review standing order"})]})})]})},_e=t(12466),Ie=t(56884),Ae=t(94535),Pe=t(13876),Se=t(44278),ke=t(71615),we=function(e){var n=e.paymentOrder,t=e.sourceAccount,a=(0,s.v9)(O.BJ),i=(0,s.v9)(O.By),r=(0,s.v9)(O.wo),c=(0,s.v9)(O.vF),o=se();return(0,x.jsxs)(Se.Z,{testId:"payment-review-details",children:[(0,x.jsxs)(Se._,{title:"From",testId:"payment-source-account",childrenTestId:"payment-details-from-account",children:[(0,x.jsx)("span",{"data-testid":"payment-details-from-name",children:t.alias}),(0,x.jsx)(Ae.Z,{account:t})]}),(0,x.jsxs)(Se._,{title:"To",testId:"payment-target-account",childrenTestId:"payment-details-to-account",children:[(0,x.jsx)("span",{"data-testid":"payment-details-to-name",children:n.targetBankAccount.name}),(0,x.jsxs)("div",{className:"TargetAccountNumber",children:[(0,x.jsx)("span",{"data-testid":"account-number",children:n.targetBankAccount.accountNumber}),(0,x.jsx)("span",{children:"\xa0\xa0|\xa0\xa0"}),(0,x.jsx)("span",{"data-testid":"sort-code",children:(0,Ie.IY)(n.targetBankAccount.sortCode)})]}),(0,x.jsx)(ke.Z,{copCheck:i,hasTechnicalError:r,useCopRecommendation:c})]}),(0,x.jsx)(Se._,{title:"Amount",testId:"payment-amount",children:(0,x.jsx)(Pe.Z,{value:n.paymentDetails.amount,currency:n.paymentDetails.currency,hasWarning:o})}),(0,x.jsx)(Se._,{title:"Reference",testId:"payment-reference",children:n.paymentDetails.reference}),n.paymentFrequency&&(0,x.jsx)(Se._,{title:"Frequency",testId:"payment-frequency",children:n.paymentFrequency.key}),n.paymentDetails.processingDate&&(0,x.jsx)(Se._,{title:a?"Next payment date":"First payment date",testId:"payment-first-date",children:(0,_e.p6)(n.paymentDetails.processingDate)}),!a&&(0,x.jsx)(Se._,{title:"Repeats",testId:"payment-repeats",children:n.repeat||"No end date"})]})},Oe=t(46002),Ee=t(59238),Te=t(79950),Re=t(79610),De=function(){var e=(0,s.v9)(O.ri),n=(0,s.v9)(O.GZ),t=(0,me._F)((0,s.v9)(O.jR)),a=(0,s.v9)(O.O1),i=(0,s.v9)(O.tN),r=(0,s.v9)(O.Cw),c=(0,s.v9)(O.bA),o=(0,s.v9)(O.lH);return t?(0,x.jsxs)("div",{className:"StandingOrderReview","data-testid":"so-review-details",children:[(0,x.jsx)("h2",{className:"sr-only",children:"Review standing order"}),(0,x.jsx)(h.Z,{isReviewPayment:!0,leftChild:(0,x.jsx)(we,{paymentOrder:n||e,sourceAccount:t}),rightChild:(0,x.jsxs)(x.Fragment,{children:[a&&(0,x.jsx)(Oe.Z,{value:i,onChange:d.ZP.setVascoSignature,modalContent:Ee.Z}),o&&(0,x.jsx)(Te._L,{}),c&&(0,x.jsx)(Te.kx,{})]})}),(0,x.jsx)(M.Z,{leftChild:(0,x.jsx)(Re.Z,{isExisting:!!e.targetArrangementId,saved:e.targetBankAccount.save}),rightChild:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(L.Z,{variant:"secondary",onClick:d.ZP.navigateToStandingOrderForm,testId:"payment-edit-button",children:"Edit"}),(0,x.jsx)(L.Z,{variant:"primary",testId:"payment-submit-button-web-view",disabled:!r,onClick:d.ZP.submit,margin:!0,children:"Submit standing order"})]})})]}):null},Be=t(45251),Fe=t(26836),Me=t(97424),Le=t(30665),Ge=t(28431),Ue=t(23089),Ye=t(82759),He=t(46404),qe=t(93107),We=t(23588),ze=t(17996),Ve=t(76027),Ke=t(10345),Xe=t(1658),Je=t(58562),Qe=t(62806),$e=t(63922),en=t(52
1666),nn=t(74689),tn=t(4225),an=t(5067),sn=function(e){var n=e.standingOrder,t=e.onAuditHistoryButtonClick,a=e.onEditButtonClick,i=e.onCancelButtonClick,r=n.targetBankAccount,c=n.sourceBankAccount,o=n.finalPaymentDetails,d=o.processingDate,l=o.amount,u=o.currency,m=n.status,h=n.paymentDetails.reference,f=n.paymentFrequency.key,g=n.id,y=n.nextPaymentDetails,p=y.processingDate,v=y.amount,b=y.currency,Z=m!==ve.p4.ACTIVE,j=(0,s.v9)($e.Gg),N=(0,an.Lf)(j,Qe.Yg.CHC_STANDINGORDER_EDIT);return(0,x.jsx)(tn.wc,{className:"StandingOrderList__row",children:(0,x.jsxs)(en.Z,{isCollapsible:!0,hasIcon:!0,id:"standing-order-".concat(g),header:(0,x.jsxs)(tn.wc,{withoutBorder:!0,testId:"standing-order-list-row-main",children:[(0,x.jsx)(tn.uY,{isBold:!0,className:"StandingOrderList__name",children:r.name}),(0,x.jsx)(tn.uY,{className:"StandingOrderList__reference",children:h}),(0,x.jsx)(tn.uY,{children:f}),(0,x.jsx)(tn.uY,{children:(0,_e.p6)(p)}),(0,x.jsx)(tn.uY,{align:"right",children:(0,x.jsx)(Pe.Z,{value:v,currency:b,testId:"account"})})]}),children:[(0,x.jsxs)(tn.wc,{className:"StandingOrderList__details",withoutBorder:!0,children:[(0,x.jsxs)(tn.uY,{className:"StandingOrderList__details-account-number",children:[(0,x.jsx)("div",{children:"Beneficiary details:"}),(0,x.jsx)(nn.Z,{bankAccount:r,isNameHidden:!0,testIdModifier:"to"})]}),(0,x.jsxs)(tn.uY,{className:"StandingOrderList__details-from-account",children:[(0,x.jsx)("div",{children:"From:"}),(0,x.jsx)("div",{children:"Current account"}),(0,x.jsx)(nn.Z,{bankAccount:c,isNameHidden:!0,testIdModifier:"from"})]}),(0,x.jsxs)(tn.uY,{children:[(0,x.jsx)("div",{children:"Currency:"}),(0,x.jsx)("div",{children:b})]}),(0,x.jsxs)(tn.uY,{children:[(0,x.jsx)("div",{children:"Final payment date:"}),d&&(0,_e.p6)(d)]}),(0,x.jsxs)(tn.uY,{align:"right",children:[(0,x.jsx)("div",{children:"Final payment amount:"}),(0,x.jsx)("div",{children:(0,x.jsx)(Pe.Z,{value:l,currency:u})})]})]}),(0,x.jsxs)("div",{className:"StandingOrderList__buttons",children:[(0,x.jsx)(L.Z,{onClick:t(g),testId:"so-audit-history-button",variant:"secondary",id:"so-audit-history-button-".concat(g),children:"Audit history"}),(0,x.jsx)(L.Z,{onClick:i(g),testId:"so-list-cancel-button-web-view",disabled:Z,variant:"secondary",id:"so-list-cancel-button-".concat(g),children:"Cancel"}),N&&(0,x.jsx)(L.Z,{onClick:a(n),disabled:Z,testId:"so-list-edit-button-web-view",variant:"secondary",children:"Edit"})]})]})})},rn=t(36714),cn=t(12553),on=t(64214),dn=t(77417),ln=function(){(0,pe.t)(u.Z.STANDING_ORDER),(0,a.useEffect)((function(){Ge.Z.setTopbar({title:rn.Z.payments.subNav.standingOrders.title,rightChild:(0,x.jsx)("div",{className:"StandingOrderList__create-button",children:(0,x.jsxs)(L.Z,{onClick:d.ZP.create,variant:"link",testId:"so-create-new-button-web-view",children:[(0,x.jsx)(qe.Z,{icon:Me.r8p})," ",(0,x.jsx)("span",{style:{marginLeft:"5px"},children:"Create a new standing order"})]})}),srOnlyContent:"View and manage your standing orders"}),d.ZP.reset()}),[]);var e,n=(0,cn.h)(u.Z.STANDING_ORDER),t=(0,s.v9)(O.lR),i=(0,s.v9)(O.CI),c=(0,me.e3)({action:oe.d1.STANDING_ORDER,pageKey:u.Z.STANDING_ORDER}),o=(0,He.B)(c),l=(0,on.M)({accountFilterOptions:o}),m=l.accountIds,h=l.searchQuery,f=m.length?m[0]:void 0,g=(e=(0,r.Z)((0,r.Z)({},n),{},{sourceAccount:f,search:h}),(0,a.useEffect)((function(){d.ZP.fetchStandingOrders(e)}),[e.f,e.l]),(0,a.useEffect)((function(){return d.ZP.resetStandingOrders}),[]),(0,s.v9)(O.Hc)),y=(0,dn.T)({itemCount:(null===g||void 0===g?void 0:g.length)||0,pageKey:u.Z.STANDING_ORDER}),p=y.hasNextPage,v=y.loadMore,b=y.hasMaxItems,Z=(0,Le.Z)({loading:t===re.gb.FETCHING_STANDING_ORDERS,hasNextPage:p,onLoadMore:v}),j=(0,w.Z)(Z,2),N=j[0],C=j[1].rootRef,_=function(e){return function(){d.ZP.cancel(e),K.Z.hideModal()}},I=function(e){return function(){Ue.Z.fetch({paymentId:e},u.Z.STANDING_ORDER),K.Z.showModal({header:"Audit history",body:(0,x.jsx)(Ke.Z,{})})}},A=function(e){return function(){d.ZP.edit(e)}},P=function(e){return function(){K.Z.showModal({header:"Are you sure you want to cancel this standing order?",icon:Me.RLE,size:"small",body:"To stop a payment going out on the current or next working day, please contact the bank.",isCancelModal:!0,footer:(0,x.jsx)(Xe.Z,{onDeclineClick:K.Z.hideModal,onAcceptClick:_(e),buttonLabels:{left:"No",right:"Yes"}})})}};return(0,x.jsx)("div",{className:"StandingOrderList",children:(0,x.jsxs)(Je.Z,{children:[(0,x.jsx)("div",{className:"widget-info","data-testid":"widget-info",children:(0,x.jsxs)("p",{children:["A standing order is a regularly occurring transfer or payment of a fixed amount to a UK bank account."," ",(0,x.jsx)(Fe.rU,{to:rn.Z.payments.subNav.directDebits.path,"data-testid":"widget-info-link",tabIndex:1,className:"StandingOrderList__link",children:"What is a direct debit?"})]})}),(0,x.jsx)(Ve.Z,{onSearch:function(){d.ZP.resetStandingOrders(),1===n.f?d.ZP.fetchStandingOrders((0,r.Z)((0,r.Z)({},n),{},{sourceAccount:f,search:h})):Ye.Z.resetPagination(u.Z.STANDING_ORDER)},accountFilterName:"account",placeholder:"Search standing orders",hasClear:!0}),null!==g&&void 0!==g&&g.length||t===re.gb.FETCHING_STANDING_ORDERS?(0,x.jsxs)("div",{className:"StandingOrderList__scroll",ref:C,children:[(0,x.jsxs)(tn.aV,{className:"StandingOrderList__list",children:[(0,x.jsxs)(tn.Bu,{className:"StandingOrderList__sticky",children:[(0,x.jsx)(tn.uY,{className:"StandingOrderList__name",children:"Beneficiary name"}),(0,x.jsx)(tn.uY,{className:"StandingOrderList__reference",children:"Reference"}),(0,x.jsx)(tn.uY,{children:"Frequency"}),(0,x.jsx)(tn.uY,{children:"Next payment date"}),(0,x.jsx)(tn.uY,{align:"right",className:"StandingOrderList__amount",children:"Amount"})]}),g.map((function(e){return(0,x.jsx)(sn,{standingOrder:e,onAuditHistoryButtonClick:I,onEditButtonClick:A,onCancelButtonClick:P},e.id)}))]}),(t===re.gb.FETCHING_STANDING_ORDERS||p)&&(0,x.jsx)("div",{ref:N,children:(0,x.jsx)(ze.Z,{})}),t!==re.gb.FETCHING_STANDING_ORDERS&&!p&&(0,x.jsxs)("span",{className:"StandingOrderList__no-more-data",children:["There are no more standing orders to view.",b&&" If you would like to view older standing orders, please use the search bar."]})]}):(0,x.jsx)(We.Z,{content:i})]})})}
1,un=t(14230),mn=function(){var e=(0,i.$B)();!function(){var e=(0,s.v9)(O.wo),n=function(){K.Z.hideModal(),d.ZP.copCheck()};(0,a.useEffect)((function(){e&&K.Z.showModal({body:(0,x.jsx)(X.Z,{onDecline:ae,onRetry:n}),isClosable:!1,size:"medium"})}),[e])}(),function(){var e=(0,s.v9)(O.By),n=(0,s.v9)(O.dp),t=(0,s.v9)(O.B$);(0,a.useEffect)((function(){e&&!e.matched&&n&&K.Z.showModal({body:(0,x.jsx)(J.Z,{onEdit:te,onDecline:ae,isUseEnteredDetailsAllowed:t,reasonCode:e.reasonCode}),isClosable:!1,size:"medium"})}),[e,n,t])}(),function(){var e=(0,s.v9)(O.By),n=(0,s.v9)(O.$o),t=(0,s.v9)(O.Uw),i=function(){switch(K.Z.hideModal(),null===e||void 0===e?void 0:e.reasonCode){case"MBAM":d.ZP.setSuggestedName();break;case"BANM":d.ZP.setAccountType($.Qm.BUSINESS);break;case"PANM":d.ZP.setAccountType($.Qm.PERSONAL);break;case"BAMM":d.ZP.setAccountType($.Qm.BUSINESS),d.ZP.setSuggestedName();break;case"PAMM":d.ZP.setAccountType($.Qm.PERSONAL),d.ZP.setSuggestedName()}d.ZP.copCheck(!0)};(0,a.useEffect)((function(){e&&!e.matched&&t&&K.Z.showModal({body:(0,x.jsx)(ee.Z,{onUseDetailsEntered:ae,onUseSuggestedDetails:i,onUseEditDetails:te,copCheck:e,enteredName:n.name,hasMaxLengthError:!!e.matchedName&&e.matchedName.length>l.sG.MAX_SHORTCUT}),isScrollable:!1,size:"medium",isClosable:!1})}),[e,t])}(),(0,a.useEffect)((function(){return function(){return d.ZP.reset()}}),[]);var n=(0,s.v9)(O.$5);return(0,x.jsxs)(i.rs,{children:[(0,x.jsx)(i.AW,{path:"".concat(e.path,"/create"),children:(0,x.jsx)(Ce,{})}),(0,x.jsx)(i.AW,{path:"".concat(e.path,"/reason"),children:(0,x.jsx)(un.Z,{onContinue:d.ZP.previewReason,onBack:d.ZP.navigateToStandingOrderForm})}),(0,x.jsx)(i.AW,{path:"".concat(e.path,"/review"),children:(0,x.jsx)(De,{})}),(0,x.jsx)(i.AW,{path:"".concat(e.path,"/confirmation"),children:n&&(0,x.jsx)(Be.Z,{submitResponseCode:n.code,onSendAnotherButtonClick:d.ZP.navigateToNewStandingOrderForm,isStandingOrder:!0})}),(0,x.jsx)(i.AW,{path:e.path,children:(0,x.jsx)(ln,{})})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.