PageSourceSearch

https://www.gungoren.bel.tr/chunk-ZXD7QFFX.js

js gungoren.bel.tr collected 2026-10-02 16:46:07 UTC 28,976 bytes, 1 lines download raw bytes

1import{a as Be}from"./chunk-UN27SJ7S.js";import{a as Ke}from"./chunk-3DYE5KO6.js";import{a as Ne,b as Re,c as k,g as Ve,h as Le,i as ze}from"./chunk-45A23CXN.js";import"./chunk-CWREEBCD.js";import"./chunk-XKA4Q45R.js";import{a as Te}from"./chunk-UIIZZL2P.js";import{a as Ae}from"./chunk-QEQWXGIS.js";import{b as Ee}from"./chunk-H43YXC7J.js";import"./chunk-VPKCAMR3.js";import"./chunk-6WXKCDVV.js";import{Q as Me,R as Fe,S as De,fb as Oe,ma as ke,t as we}from"./chunk-JY5TSAAW.js";import"./chunk-3WI74MCJ.js";import{e as fe}from"./chunk-YNYT3S7A.js";import"./chunk-N4O2A3YU.js";import"./chunk-46H6MEXM.js";import"./chunk-TGFVF5X5.js";import"./chunk-E7TMAZQF.js";import"./chunk-XLQ7CZTK.js";import"./chunk-RBAGZUJP.js";import{a as Ie,b as Ce,c as Pe}from"./chunk-3KGJY2ZJ.js";import{a as be}from"./chunk-RWWBNVY6.js";import"./chunk-RMXKUXWR.js";import"./chunk-N426IARN.js";import"./chunk-3JRAEIYY.js";import{g as U}from"./chunk-WVNYSZW3.js";import"./chunk-7PXMCU6W.js";import{b as Y}from"./chunk-36BHHMA7.js";import"./chunk-O6XML77H.js";import"./chunk-UAN55DTN.js";import"./chunk-FMVMSE3N.js";import"./chunk-M4EDQLQT.js";import"./chunk-4U6SG2DW.js";import"./chunk-LAZPVPFV.js";import"./chunk-P2RPU6DO.js";import"./chunk-SO4FE4DN.js";import"./chunk-RJ3VRYNX.js";import{v as ye,z as _e}from"./chunk-M7MUAZAB.js";import"./chunk-EZP3FQ6P.js";import{p as ge,s as ve}from"./chunk-IHTJUQEE.js";import"./chunk-GHMKFVO3.js";import{a as xe}from"./chunk-L2LJS4KB.js";import"./chunk-YC3E6TOV.js";import"./chunk-FUJQM5ZA.js";import"./chunk-TMJFLP2A.js";import"./chunk-DUYII3AV.js";import{a as Se}from"./chunk-PCJKS5NM.js";import{a as he}from"./chunk-YKUH2L4F.js";import"./chunk-UOMVO7CQ.js";import"./chunk-KSYJRRNV.js";import{b as pe}from"./chunk-4K4CBFXG.js";import"./chunk-RCIZ7YWW.js";import{D as ue,Ea as me}from"./chunk-YZHC7MKB.js";import"./chunk-2PAKQ4OI.js";import"./chunk-O4P646W3.js";import{n as q}from"./chunk-FKK5KKI6.js";import"./chunk-NQ62KS5R.js";import"./chunk-S3LULIGZ.js";import"./chunk-N5GPIPLD.js";import{$b as F,$c as $,Cb as d,Cd as W,D as N,Da as _,Dd as j,Ec as p,Fd as ce,Gc as c,Ja as v,Ka as y,Pc as z,Ta as b,Uc as l,Vb as M,Vc as g,Wc as P,X as R,Xc as re,Zc as K,_c as B,dd as le,gd as se,hc as f,hd as de,ic as h,nc as m,oc as o,pc as a,qc as D,td as Q,uc as G,vc as X,ya as oe,yc as C,yd as I}from"./chunk-523GHJMT.js";import"./chunk-B4NGUIOI.js";import"./chunk-6NKBJIKA.js";import{a as w,b as L}from"./chunk-MNTLUMQB.js";var S=class S{constructor(){this.yokaSdk=_(me)}paymentInvoicePreview$(e){return this.yokaSdk.paymentInvoicePreviewWatch({paymentId:e}).valueChanges.pipe(N(t=>{var n;return(n=t==null?void 0:t.data)==null?void 0:n.paymentInvoicePreview}))}sendInvoice$(e){return this.yokaSdk.sendInvoice({paymentId:e},{update:(t,{data:n})=>{let i=n==null?void 0:n.sendInvoice;i!=null&&i.success&&t.modify({id:t.identify({__typename:"Payment",id:e}),fields:{invoiceStatus:()=>"Invoiced",invoice:()=>i.invoiceNumber?{__typename:"Invoice",id:`invoice:${e}`,number:i.invoiceNumber}:null}})}}).pipe(N(t=>{var n;return(n=t==null?void 0:t.data)==null?void 0:n.sendInvoice}))}markInvoiceAsManuallyInvoiced$(e){return this.yokaSdk.markInvoiceAsManuallyInvoiced({paymentId:e},{update:(t,{data:n})=>{n!=null&&n.markInvoiceAsManuallyInvoiced&&t.modify({id:t.identify({__typename:"Payment",id:e}),fields:{invoiceStatus:()=>"ManuallyInvoiced"}})}}).pipe(N(t=>{var n;return(n=t==null?void 0:t.data)==null?void 0:n.markInvoiceAsManuallyInvoiced}))}resetInvoiceStatus$(e){return this.yokaSdk.resetInvoiceStatus({paymentId:e},{update:(t,{data:n})=>{n!=null&&n.resetInvoiceStatus&&t.modify({id:t.identify({__typename:"Payment",id:e}),fields:{invoiceStatus:()=>"Pending"}})}}).pipe(N(t=>{var n;return(n=t==null?void 0:t.data)==null?void 0:n.resetInvoiceStatus}))}};S.\u0275fac=function(t){return new(t||S)},S.\u0275prov=oe({token:S,factory:S.\u0275fac,providedIn:"root"});var O=S;var We=()=>({size:"m",closeable:!1});function je(r,e){r&1&&(o(0,"span",7),l(1,"Fatura G\xF6nderildi"),a(),o(2,"span",8),l(3,"Sa\u011Flay\u0131c\u0131dan d\xF6nen i\u015Flem detaylar\u0131n\u0131 a\u015Fa\u011F\u0131da inceleyebilirsiniz."),a())}
1function qe(r,e){r&1&&(o(0,"span",7),l(1,"Faturaland\u0131r"),a(),o(2,"span",8),l(3,"G\xF6nderimden \xF6nce fatura detaylar\u0131n\u0131 kontrol edin."),a())}function Ue(r,e){if(r&1&&(o(0,"tui-chip",15),l(1),a()),r&2){let t=c();d(),P("Fatura No: ",t.invoiceNumber)}}function Ye(r,e){if(r&1&&(o(0,"pre"),l(1),a()),r&2){let t=c(4);d(),g(t.providerResponseText())}}function He(r,e){r&1&&(o(0,"tui-accordion",16)(1,"tui-accordion-item",15),l(2," Sa\u011Flay\u0131c\u0131 cevab\u0131 "),F(3,Ye,2,1,"ng-template",17),a()())}function Je(r,e){if(r&1&&(o(0,"div",1)(1,"div",9),D(2,"tui-icon",10),a(),o(3,"div",11)(4,"p",12),l(5,"Fatura i\u015Flemi tamamland\u0131"),a(),o(6,"p",13),l(7),a(),o(8,"div",14)(9,"tui-chip",15),l(10),a(),f(11,Ue,2,1,"tui-chip",15),a()(),f(12,He,4,0,"tui-accordion",16),a()),r&2){let t=e;d(7),g(t.message),d(3),g(t.status),d(),h(t.invoiceNumber?11:-1),d(),h(t.providerResponse?12:-1)}}function Ge(r,e){r&1&&(o(0,"div",2),D(1,"tui-loader"),a())}function Xe(r,e){if(r&1&&(o(0,"div",3)(1,"section",18)(2,"div",19)(3,"span",20),l(4,"Fatura \xF6zeti"),a(),o(5,"p",21),l(6),a(),o(7,"div",22)(8,"tui-chip",15),l(9),a(),o(10,"tui-chip",15),l(11),a(),o(12,"tui-chip",15),l(13),a()()(),o(14,"div",23)(15,"span",24),l(16,"Toplam"),a(),o(17,"strong"),l(18),a(),o(19,"span"),l(20),a()()(),o(21,"section",25)(22,"div",26)(23,"p",27),l(24,"Fatura detaylar\u0131"),a(),o(25,"p",28),l(26,"Sa\u011Flay\u0131c\u0131ya g\xF6nderilecek i\u015Flem \xF6zeti"),a()(),o(27,"div",29)(28,"div",30)(29,"span",31),l(30,"Uygulama"),a(),o(31,"span",32),l(32),a()(),o(33,"div",30)(34,"span",31),l(35,"\u0130\u015Flem No"),a(),o(36,"span",33),l(37),a()(),o(38,"div",30)(39,"span",31),l(40,"KDV"),a(),o(41,"span",32),l(42),a()(),o(43,"div",30)(44,"span",31),l(45,"Vergi Durumu"),a(),o(46,"span",32),l(47),a()()()(),o(48,"section",34)(49,"div",26)(50,"p",27),l(51,"Al\u0131c\u0131 bilgileri"),a(),o(52,"p",28),l(53,"Faturada g\xF6r\xFCnecek ki\u015Fi bilgileri"),a()(),o(54,"div",29)(55,"div",30)(56,"span",31),l(57,"Ad Soyad"),a(),o(58,"span",32),l(59),a()(),o(60,"div",30)(61,"span",31),l(62,"Telefon"),a(),o(63,"span",32),l(64),a()()()()()),r&2){let t=e;d(6),g(t.itemName),d(3),g(t.providerKey),d(2),g(t.profileId),d(2),P("",t.quantity," adet"),d(5),re("",t.amount," ",t.currency),d(2),g(t.taxIncluded?"KDV dahil":"KDV hari\xE7"),d(12),g(t.appName||"-"),d(5),g(t.transactionId),d(5),P("%",t.vatRate),d(5),g(t.taxIncluded?"KDV dahil":"KDV hari\xE7"),d(12),g(t.customerName),d(5),g(t.customerPhone||"-")}}function Ze(r,e){r&1&&(o(0,"div",4),D(1,"tui-icon",35),o(2,"p"),l(3,"Fatura detaylar\u0131 y\xFCklenemedi."),a()())}function et(r,e){if(r&1){let t=C();o(0,"button",36),p("click",function(){v(t);let i=c(2);return y(i.sendInvoice())}),l(1," G\xF6nder "),a()}if(r&2){let t=c(2);m("loading",t.sendLoading())("disabled",t.sendLoading())}}function tt(r,e){if(r&1){let t=C();o(0,"yoka-dialog")(1,"yoka-dialog-header"),f(2,je,4,0)(3,qe,4,0),a(),f(4,Je,13,4,"div",1)(5,Ge,2,0,"div",2)(6,Xe,65,13,"div",3)(7,Ze,4,0,"div",4),o(8,"yoka-dialog-footer")(9,"button",5),p("click",function(){v(t);let i=c();return y(i.close())}),l(10,"Kapat"),a(),f(11,et,2,2,"button",6),a()()}if(r&2){let t,n=c();d(2),h(n.sendResult()?2:3),d(2),h((t=n.sendResult())?4:n.previewResource.isLoading()&&!n.preview()?5:(t=n.preview())?6:n.previewFailed()?7:-1,t),d(7),h(!n.sendResult()&&n.preview()?11:-1)}}var E=class E{constructor(){this.invoiceService=_(O);this.alertService=_(U);this.paymentId=j(null);this.open=ce(!1);this.sent=W();this.sendLoading=b(!1);this.sendResult=b(null);this.previewResource=Y({params:()=>{let e=this.paymentId();if(!(!this.open()||!e))return e},loader:e=>this.invoiceService.paymentInvoicePreview$(e)});this.preview=this.previewResource.value;this.previewFailed=I(()=>this.previewResource.status()==="error");this.providerResponseText=I(()=>{var t;let e=(t=this.sendResult())==null?void 0:t.providerResponse;return e?JSON.stringify(e,null,2):""})}close(){this.sendLoading()||(this.resetState(),this.open.set(!1))}sendInvoice(){let e=this.paymentId();!e||this.sendLoading()||(this.sendLoading.set(!0),this.invoiceService.sendInvoice$(e).pipe(R(1)).subscribe({next:t=>{if(this.sendLoading.set(!1),!(t!=null&&t.success)){this.alertService.alert("Fatura g\xF6nderilemedi",(t==null?void 0:t.message)||"L\xFCtfen tekrar deneyin.","error");return}this.sendResult.set({message:t.message,status:t.status,invoiceNumber:t.invoiceNumber,providerResponse:t.providerResponse}),this.sent.emit()},error:t=>{this.sendLoading.set(!1),this.alertService.alert("Fatura g\xF6nderilemedi",this.resolveErrorMessage(t),"error")}}))}resetState(){this.sendLoading.set(!1),this.sendResult.set(null)}resolveErrorMessage(e){var t,n;if(typeof e=="object"&&e){let i=(n=(t=e.graphQLErrors)==null?void 0:t[0])==null?void 0:n.message;if(i)return i;let s=e.message;if(s)return s}return typeof e=="string"?e:"Bilinmeyen bir hata olu\u015Ftu"}};E.\u0275fac=function(t){return new(t||E)},E.\u0275cmp=M({type:E,selectors:[["admin-finance-payment-invoice-dialog"]],inputs:{paymentId:[1,"paymentId"],open:[1,"open"]},outputs:{open:"openChange",sent:"sent"},decls:1,vars:3,consts:[[3,"tuiDialogChange","tuiDialogOptions","tuiDialog"],[1,"result-state"],[1,"loader-state"],[1,"preview-layout"],[1,"error-state"],["tuiButton","","type","button","appearance","flat","size","s",3,"click"],["size","s","tuiButton","","type","button",3,"loading","disabled"],["yokaDialogTitle",""],["y
1okaDialogSubtitle",""],[1,"result-icon"],["icon","@ph.check-circle"],[1,"result-copy"],[1,"result-title"],[1,"result-message"],[1,"result-chips"],["size","s"],[1,"response-accordion"],["tuiAccordionItemContent",""],[1,"hero-card"],[1,"hero-copy"],[1,"eyebrow"],[1,"hero-title"],[1,"hero-chips"],[1,"hero-amount"],[1,"hero-amount-label"],[1,"detail-card","detail-card--wide"],[1,"detail-card-header"],[1,"detail-card-title"],[1,"detail-card-subtitle"],[1,"detail-list"],[1,"detail-row"],[1,"detail-label"],[1,"detail-value"],[1,"detail-value","mono"],[1,"detail-card"],["icon","@ph.warning-circle"],["size","s","tuiButton","","type","button",3,"click","loading","disabled"]],template:function(t,n){t&1&&(F(0,tt,12,3,"ng-template",0),$("tuiDialogChange",function(s){return B(n.open,s)||(n.open=s),s})),t&2&&(m("tuiDialogOptions",se(2,We)),K("tuiDialog",n.open))},dependencies:[fe,q,Se,Ce,Pe,Ie,we,xe,he,Me,De,Fe],styles:["[_nghost-%COMP%]{display:contents}yoka-dialog[_ngcontent-%COMP%]{font:var(--tui-font-text-s)}.result-state[_ngcontent-%COMP%], .error-state[_ngcontent-%COMP%], .loader-state[_ngcontent-%COMP%], .preview-layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.hero-card[_ngcontent-%COMP%], .detail-card[_ngcontent-%COMP%]{border-radius:1rem;border:1px solid var(--yoka-border-color)}.hero-card[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;padding:1.125rem}.hero-copy[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.625rem;min-width:0}.eyebrow[_ngcontent-%COMP%]{font-size:.75rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--tui-text-secondary)}.hero-title[_ngcontent-%COMP%]{margin:0;font-size:.925rem;font-weight:500;line-height:1.35}.hero-chips[_ngcontent-%COMP%], .result-chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.hero-chips[_ngcontent-%COMP%] > tui-chip[_ngcontent-%COMP%], .result-chips[_ngcontent-%COMP%] > tui-chip[_ngcontent-%COMP%]{text-transform:capitalize}.hero-amount[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-end;gap:.2rem;padding:.875rem 1rem;min-width:11rem;border-radius:.875rem;background:linear-gradient(135deg,#0a54a314,#0a54a305);text-align:right}.hero-amount-label[_ngcontent-%COMP%]{font-size:.75rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--tui-text-02)}.hero-amount[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{font-size:1.25rem;line-height:1.2;color:#0a54a3}.hero-amount[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:last-child{font-size:.8125rem;color:var(--tui-text-02)}.detail-card[_ngcontent-%COMP%]{padding:1rem 1.125rem}.detail-card--wide[_ngcontent-%COMP%]{min-width:0}.detail-card-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;margin-bottom:.875rem}.detail-card-title[_ngcontent-%COMP%]{margin:0;font-size:.95rem;font-weight:700;color:var(--tui-text-01)}.detail-card-subtitle[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;color:var(--tui-text-02)}.detail-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.875rem}.detail-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;padding-bottom:.875rem;border-bottom:1px solid rgba(15,23,42,.08)}.detail-row[_ngcontent-%COMP%]:last-child{padding-bottom:0;border-bottom:0}.detail-label[_ngcontent-%COMP%]{color:var(--tui-text-secondary);font-size:.65rem;text-transform:uppercase;font-weight:700}.detail-value[_ngcontent-%COMP%]{max-width:60%;text-align:right;font-weight:400;word-break:break-word}.detail-value.amount[_ngcontent-%COMP%], .mono[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mono[_ngcontent-%COMP%]{font-size:.75rem}.loader-state[_ngcontent-%COMP%], .error-state[_ngcontent-%COMP%], .result-state[_ngcontent-%COMP%]{align-items:center;text-align:center;padding:1rem 0 .5rem}.result-icon[_ngcontent-%COMP%], .error-state[_ngcontent-%COMP%]   tui-icon[_ngcontent-%COMP%]{display:grid;place-items:center;width:3rem;height:3rem;border-radius:999px;background:#26a5521f;color:#1c8c47;font-size:1.5rem}.result-copy[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:.625rem}.result-title[_ngcontent-%COMP%]{margin:0;font-size:1.125rem;font-weight:700}.result-message[_ngcontent-%COMP%], .error-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0;color:var(--tui-text-02)}.response-accordion[_ngcontent-%COMP%]{width:100%;margin-top:.25rem;text-align:left}pre[_ngcontent-%COMP%]{margin:0;padding:.75rem;border-radius:.75rem;background:var(--tui-base-02);font-size:.8125rem;white-space:pre-wrap;word-break:break-word}@media (max-width: 768px){.hero-card[_ngcontent-%COMP%], .preview-grid[_ngcontent-%COMP%]{grid-template-columns:1fr;flex-direction:column}
1.hero-amount[_ngcontent-%COMP%]{align-items:flex-start;min-width:0;width:100%;text-align:left}.detail-row[_ngcontent-%COMP%]{flex-direction:column;gap:.35rem}.detail-value[_ngcontent-%COMP%]{max-width:100%;text-align:left}}"],changeDetection:0});var H=E;var T=class T{constructor(){this.appService=_(Ee);this.value=j(null);this.apply=W();this.invoiceStatuses=["Pending","Processing","Invoiced","ManuallyInvoiced","Failed"];this.booleanOptions=[!0,!1];this.apps=I(()=>this.appService.adminApps()??[]);this.appIds=I(()=>this.apps().map(e=>e.id));this.schema=Ve([Re("dateRange",{label:"\xD6deme Tarihi",section:"Tarih"}),k("appId",{label:"Uygulama",section:"\u0130\u015Flem",items:()=>this.appIds(),stringify:e=>this.getAppLabel(e)}),k("refunded",{label:"\u0130ade Durumu",section:"\u0130\u015Flem",items:this.booleanOptions,stringify:e=>this.getBooleanLabel(e)}),k("hasInvoice",{label:"Fatura",section:"\u0130\u015Flem",items:this.booleanOptions,stringify:e=>this.getBooleanLabel(e)}),k("invoiceStatus",{label:"Fatura Durumu",section:"\u0130\u015Flem",items:this.invoiceStatuses,stringify:e=>this.getInvoiceStatusLabel(e)}),k("featureKey",{label:"Feature",section:"\u0130\u015Flem",items:({value:e})=>this.getFeatureKeys(e.appId),stringify:e=>this.getFeatureLabel(e),disabled:({value:e})=>this.getFeatureKeys(e.appId).length===0}),Ne("cardQuery",{label:"Kart",section:"Kart",placeholder:"Kart markas\u0131 veya son 4 hane"})],{normalize:e=>{var n;let t=e;return L(w({},t),{featureKey:this.normalizeFeatureKey(t.appId,t.featureKey),cardQuery:((n=t.cardQuery)==null?void 0:n.trim())||null})}})}onApply(e){let t=e;this.apply.emit(Le(this.schema,t)?t:null)}getFeatureLabel(e){let t={academy:"Spor Kurslar\u0131",organization:"Organizasyon","sport-package":"Spor Paketi",workshop:"At\xF6lye",parking:"Otopark"},n=this.apps().flatMap(i=>i.features??[]).find(i=>i.feature.key===e);return e?(n==null?void 0:n.displayName)||(n==null?void 0:n.feature.name)||t[e]||e:"T\xFCm\xFC"}getAppLabel(e){let t=this.apps().find(n=>n.id===e);return(t==null?void 0:t.name)||e||"T\xFCm\xFC"}getBooleanLabel(e){return e===!0?"Evet":e===!1?"Hay\u0131r":"Farketmez"}getInvoiceStatusLabel(e){let t={Pending:"Kuyrukta",Processing:"\u0130\u015Fleniyor",Invoiced:"Faturaland\u0131",ManuallyInvoiced:"Manuel faturaland\u0131",Failed:"Hata"};return e?t[e]:"T\xFCm\xFC"}
1getFeatureKeys(e){let t=this.apps().filter(i=>e?i.id===e:!0),n=new Set;for(let i of t)for(let s of i.features??[])s.isActive&&n.add(s.feature.key);return[...n].sort((i,s)=>this.getFeatureLabel(i).localeCompare(this.getFeatureLabel(s),"tr"))}normalizeFeatureKey(e,t){return t&&this.getFeatureKeys(e).includes(t)?t:null}};T.\u0275fac=function(t){return new(t||T)},T.\u0275cmp=M({type:T,selectors:[["admin-finance-payment-filters"]],inputs:{value:[1,"value"]},outputs:{apply:"apply"},decls:1,vars:2,consts:[[3,"apply","schema","value"]],template:function(t,n){t&1&&(o(0,"admin-filter-builder",0),p("apply",function(s){return n.onApply(s)}),a()),t&2&&m("schema",n.schema)("value",n.value())},dependencies:[ze],styles:["[_nghost-%COMP%]{display:inline-flex}.filters-form[_ngcontent-%COMP%]{width:min(420px,80vw);background-color:var(--tui-background-base);padding:var(--spacer-sm);padding-bottom:0;display:flex;flex-direction:column;gap:1rem}.filters-form[_ngcontent-%COMP%]   .filters-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.filters-form[_ngcontent-%COMP%]   .section-title[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.02em;color:var(--tui-text-02);margin:0}.filters-form[_ngcontent-%COMP%]   .filters-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.75rem}.filters-form[_ngcontent-%COMP%]   .actions[_ngcontent-%COMP%]{position:sticky;bottom:0;z-index:9;padding:var(--spacer-sm);background-color:var(--tui-background-base);margin:0 calc(-1 * var(--spacer-sm));display:flex;justify-content:flex-end;gap:.5rem;border-top:1px solid var(--yoka-border-color)}"],changeDetection:0});var J=T;var nt=r=>({invoiceStatus:r});function it(r,e){if(r&1){let t=C();o(0,"button",15),p("click",function(){v(t);let i=c(3).row,s=c();return y(s.markInvoiceAsManuallyInvoiced(i.id))}),l(1," Manuel faturaland\u0131 olarak i\u015Faretle "),a()}if(r&2){let t=c(3).row,n=c();m("disabled",n.isUpdatingInvoiceStatus(t.id))}}function at(r,e){if(r&1){let t=C();o(0,"button",15),p("click",function(){v(t);let i=c(3).row,s=c();return y(s.resetInvoiceStatus(i.id))}),l(1," Kuyru\u011Fa Al "),a()}if(r&2){let t=c(3).row,n=c();m("disabled",n.isUpdatingInvoiceStatus(t.id))}}function ot(r,e){if(r&1&&(o(0,"tui-data-list",13),f(1,it,2,1,"button",14),f(2,at,2,1,"button",14),a()),r&2){let t=c(2).row;d(),h(t.data!=null&&t.data.canMarkInvoiceAsManuallyInvoiced?1:-1),d(),h(t.data!=null&&t.data.canResetInvoiceStatus?2:-1)}}function rt(r,e){if(r&1){let t=C();o(0,"div",11),p("tuiDropdownOpenChange",function(i){v(t);let s=c().row,u=c();return y(u.onInvoiceStatusDropdownChange(s.id,i))}),o(1,"button",12),l(2),a()(),F(3,ot,3,2,"ng-template",null,2,Q)}if(r&2){let t=z(4),n=c(),i=n.$implicit,s=n.row,u=c();m("tuiDropdown",t)("tuiDropdownOpen",u.isInvoiceStatusDropdownOpen(s.id)),d(),m("tuiChevron",u.isInvoiceStatusDropdownOpen(s.id))("disabled",u.isUpdatingInvoiceStatus(s.id)),d(),P(" ",u.getInvoiceStatusLabel(i)," ")}}function lt(r,e){if(r&1&&(o(0,"span"),l(1),a()),r&2){let t=c().$implicit,n=c();d(),g(n.getInvoiceStatusLabel(t))}}function st(r,e){if(r&1&&f(0,rt,5,5)(1,lt,2,1,"span"),r&2){let t=e.row;h(t.data!=null&&t.data.canMarkInvoiceAsManuallyInvoiced||t.data!=null&&t.data.canResetInvoiceStatus?0:1)}}function dt(r,e){if(r&1){let t=C();o(0,"button",17),p("click",function(){v(t);let i=c().$implicit,s=c();return y(s.openInvoiceDialog(i.id))}),a()}if(r&2){let t=c().$implicit;m("title",le(t.data!=null&&t.data.invoiceDisabled?"\u0130ade edilen \xF6deme faturaland\u0131r\u0131lamaz":"Faturaland\u0131r"))("disabled",t.data==null?null:t.data.invoiceDisabled)}}function ct(r,e){if(r&1&&f(0,dt,1,3,"button",16),r&2){let t=e.$implicit;h(t.data!=null&&t.data.showInvoiceAction?0:-1)}}var A=class A{constructor(){this.paymentService=_(ke);this.invoiceService=_(O);this.exportJobService=_(Ke);this.authParser=_(pe);this.alertService=_(U);this.ExportFeature=ue;this.isSuperAdmin=I(()=>this.authParser.userRole()==="SuperAdmin");this.filters=b(null);this.searchPhrase=b("");this.invoiceDialogOpen=b(!1);this.selectedPaymentId=b(null);this.statusDropdownPaymentId=b(null);this.updatingInvoiceStatusPaymentId=b(null);this.queryParams=I(()=>({first:50,filter:this.buildFilter(),orderBy:[{createdAt:"desc"}]}));this.list=Y({params:()=>this.queryParams(),loader:e=>this.paymentService.payments$(e),fetchMore:(e,t)=>
1this.paymentService.paymentsLoadMore(L(w({},e),{after:t}))});this.rows=I(()=>{var e;return(((e=this.list.value())==null?void 0:e.nodes)??[]).map(t=>this.mapRow(t))})}onSearch(e){this.searchPhrase.set(e.trim())}onFiltersApply(e){this.filters.set(e)}onExport(){this.exportJobService.queueJob(this.paymentService.exportPayments$({filter:this.buildFilter()}),"\xD6deme listesi")}openInvoiceDialog(e){this.selectedPaymentId.set(e),this.invoiceDialogOpen.set(!0)}onInvoiceSent(){}onInvoiceStatusDropdownChange(e,t){this.statusDropdownPaymentId.set(t?e:this.statusDropdownPaymentId()===e?null:this.statusDropdownPaymentId())}markInvoiceAsManuallyInvoiced(e){this.updatingInvoiceStatusPaymentId()||(this.updatingInvoiceStatusPaymentId.set(e),this.invoiceService.markInvoiceAsManuallyInvoiced$(e).pipe(R(1)).subscribe({next:t=>{if(this.updatingInvoiceStatusPaymentId.set(null),!t){this.alertService.alert("Durum g\xFCncellenemedi","\u0130\u015Flem tamamlanamad\u0131.","error");return}this.statusDropdownPaymentId.set(null),this.alertService.alert("Durum g\xFCncellendi","\xD6deme manuel faturaland\u0131 olarak i\u015Faretlendi.","success")},error:t=>{this.updatingInvoiceStatusPaymentId.set(null),this.alertService.alert("Durum g\xFCncellenemedi",this.resolveErrorMessage(t),"error")}}))}resetInvoiceStatus(e){this.updatingInvoiceStatusPaymentId()||(this.updatingInvoiceStatusPaymentId.set(e),this.invoiceService.resetInvoiceStatus$(e).pipe(R(1)).subscribe({next:t=>{if(this.updatingInvoiceStatusPaymentId.set(null),!t){this.alertService.alert("Durum g\xFCncellenemedi","\u0130\u015Flem tamamlanamad\u0131.","error");return}this.statusDropdownPaymentId.set(null),this.alertService.alert("Durum g\xFCncellendi","Fatura durumu Kuyrukta olarak g\xFCncellendi.","success")},error:t=>{this.updatingInvoiceStatusPaymentId.set(null),this.alertService.alert("Durum g\xFCncellenemedi",this.resolveErrorMessage(t),"error")}}))}buildFilter(){var s,u;let e=this.filters(),t=this.searchPhrase(),n=Oe(t),i=[];if((s=e==null?void 0:e.dateRange)!=null&&s[0]||(u=e==null?void 0:e.dateRange)!=null&&u[1]){let[x,V]=e.dateRange;i.push({createdAt:w(w({},x?{gte:x}:{}),V?{lt:this.getNextDayIso(V)}:{})})}if((e==null?void 0:e.refunded)!==null&&(e==null?void 0:e.refunded)!==void 0&&i.push({rebateDate:e.refunded?{not:null}:{equals:null}}),(e==null?void 0:e.hasInvoice)!==null&&(e==null?void 0:e.hasInvoice)!==void 0&&i.push({invoice:e.hasInvoice?{isNot:null}:{is:null}}),e!=null&&e.invoiceStatus&&i.push({invoiceStatus:{equals:e.invoiceStatus}}),e!=null&&e.appId&&i.push({appId:{equals:e.appId}}),e!=null&&e.featureKey&&i.push({featureKey:{equals:e.featureKey}}),e!=null&&e.cardQuery&&i.push({creditCard:{is:{OR:[{cardAssociation:{contains:e.cardQuery}},{lastFour:{contains:e.cardQuery}}]}}}),t){let x=[];x.push({id:{contains:t}}),x.push({sourceId:{contains:t}}),n?x.push({user:{is:{OR:[{firstname:{search:n}},{lastname:{search:n}},{identityNumber:{startsWith:t}},{identityNumber:{endsWith:t}}]}}}):x.push({user:{is:{OR:[{identityNumber:{startsWith:t}},{identityNumber:{endsWith:t}}]}}}),i.push({OR:x})}return i.length?{AND:i}:void 0}mapRow(e){var te,ne,ie,ae;let t=!!e.rebateDate||!!e.rebateAmount,n=e.invoiceStatus,i=!!e.invoice,s=((te=e.invoice)==null?void 0:te.number)||"Yok",u=!i&&!t,x=u&&["Pending","Failed"].includes(n),V=u&&["Failed","ManuallyInvoiced"].includes(n);return{id:e.id,data:{showInvoiceAction:!i&&!["Invoiced","ManuallyInvoiced"].includes(n),invoiceDisabled:t,canMarkInvoiceAsManuallyInvoiced:x,canResetInvoiceStatus:V},columns:[{title:"Ad Soyad",value:this.getFullName(e)},{title:"TCKN",value:this.getIdentityNumber((ne=e.user)==null?void 0:ne.identityNumber)},{title:"Uygulama",value:((ie=e.app)==null?void 0:ie.name)||"-"},{title:"Feature",value:this.getFeatureLabel(e.featureKey,(ae=e.feature)==null?void 0:ae.name)},{title:"Tutar",value:e.amount,type:"money"},{title:"Kart",value:this.getCardLabel(e)},{title:"\u0130\u015Flem Numaras\u0131",value:e.orderId||"-"},{title:"\u0130ade Durumu",value:t,type:"boolean",trueValue:"\u0130ade edildi",falseValue:"Normal"},{title:"Fatura Durumu",value:n,template:"invoiceStatus"},{title:"Fatura",value:s},{title:"\xD6deme Tarihi",value:e.createdAt,type:"datetime"}]}}getInvoiceStatusLabel(e){let t={Pending:"Kuyrukta",Processing:"\u0130\u015Fleniyor",Invoiced:"Faturaland\u0131",ManuallyInvoiced:"Manuel faturaland\u0131",Failed:"Hata"};return e?t[e]:"-"}isInvoiceStatusDropdownOpen(e){return this.statusDropdownPaymentId()===e}isUpdatingInvoiceStatus(e){return this.updatingInvoiceStatusPaymentId()===e}getFullName(e){var t,n;return[(t=e.user)==null?void 0:t.firstname,(n=e.user)==null?void 0:n.lastname].filter(
1Boolean).join(" ")||"-"}getCardLabel(e){var i,s;let t=((i=e.creditCard)==null?void 0:i.cardAssociation)||"",n=(s=e.creditCard)!=null&&s.lastFour?`**** ${e.creditCard.lastFour}`:"";return`${t} ${n}`.trim()||"-"}getIdentityNumber(e){return e?this.isSuperAdmin()?e:e.replace(/(\d{2})(\d{3})(\d{3})(\d{2})/g,"$1******$4"):"-"}getFeatureLabel(e,t){return t||(e?{academy:"Spor Kurslar\u0131",organization:"Organizasyon","sport-package":"Spor Paketi",workshop:"At\xF6lye",parking:"Otopark"}[e]||e:"-")}getNextDayIso(e){let t=new Date(e);return t.setUTCDate(t.getUTCDate()+1),t.toISOString()}resolveErrorMessage(e){var t,n;if(typeof e=="object"&&e){let i=(n=(t=e.graphQLErrors)==null?void 0:t[0])==null?void 0:n.message;if(i)return i;let s=e.message;if(s)return s}return typeof e=="string"?e:"Bilinmeyen bir hata olu\u015Ftu"}};A.\u0275fac=function(t){return new(t||A)},A.\u0275cmp=M({type:A,selectors:[["admin-finance-payments-page"]],decls:15,vars:13,consts:[["invoiceStatusTemplate",""],["invoiceAction",""],["invoiceStatusDropdown",""],[3,"search","newButton","searchPlaceholder"],["slot","filters"],[3,"apply","value"],["slot","actions"],["appearance","secondary","tuiButton","","type","button","size","xs","iconEnd","@ph.download-simple",3,"click"],[3,"feature"],[3,"loadMore","data","editable","actions","templates"],[3,"openChange","sent","paymentId","open"],[3,"tuiDropdownOpenChange","tuiDropdown","tuiDropdownOpen"],["appearance","flat","tuiButton","","tuiChevron","","type","button","size","xs",3,"tuiChevron","disabled"],["size","s"],["tuiOption","","new","","type","button",3,"disabled"],["tuiOption","","new","","type","button",3,"click","disabled"],["appearance","flat","tuiIconButton","","type","button","size","xs","iconStart","@ph.receipt","aria-label","Faturaland\u0131r",3,"disabled","title"],["appearance","flat","tuiIconButton","","type","button","size","xs","iconStart","@ph.receipt","aria-label","Faturaland\u0131r",3,"click","disabled","title"]],template:function(t,n){if(t&1){let i=C();o(0,"admin-toolbar",3),p("search",function(u){return v(i),y(n.onSearch(u))}),G(1,4),o(2,"admin-finance-payment-filters",5),p("apply",function(u){return v(i),y(n.onFiltersApply(u))}),a(),X(),G(3,6),o(4,"span"),l(5),a(),o(6,"button",7),p("click",function(){return v(i),y(n.onExport())}),l(7," D\u0131\u015Fa Aktar "),a(),D(8,"admin-export-history",8),X(),a(),o(9,"admin-table",9),p("loadMore",function(){return v(i),y(n.list.loadMore())}),a(),F(10,st,2,1,"ng-template",null,0,Q)(12,ct,1,1,"ng-template",null,1,Q),o(14,"admin-finance-payment-invoice-dialog",10),$("openChange",function(u){return v(i),B(n.invoiceDialogOpen,u)||(n.invoiceDialogOpen=u),y(u)}),p("sent",function(){return v(i),y(n.onInvoiceSent())}),a()}if(t&2){let i,s=z(11),u=z(13);m("newButton",!1)("searchPlaceholder","Ad soyad veya i\u015Flem no ara"),d(2),m("value",n.filters()),d(3),P("Toplam: ",(i=n.list.value())==null?null:i.totalCount),d(3),m("feature",n.ExportFeature.Payments),d(),m("data",n.rows())("editable",!1)("actions",u)("templates",de(11,nt,s)),d(5),m("paymentId",n.selectedPaymentId()),K("open",n.invoiceDialogOpen)}},dependencies:[Te,Ae,J,H,q,ge,ve,_e,ye,be,Be],encapsulation:2,changeDetection:0});var ee=A;export{ee as default};

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.