PageSourceSearch

https://hou.la/chunk-S2HPJLZM.js

js hou.la collected 2026-09-25 03:32:50 UTC 14,761 bytes, 1 lines download raw bytes

1import{a as W}from"./chunk-GIIMJHN6.js";import{a as q,b as K}from"./chunk-XSIE453C.js";import{f as F}from"./chunk-B3QJM2RM.js";import"./chunk-M6OZBIKI.js";import"./chunk-XQLXGKEK.js";import"./chunk-IXD6ECVB.js";import"./chunk-RRCBQ55K.js";import"./chunk-DQRROS2B.js";import"./chunk-EONF3GVN.js";import"./chunk-5LMG4TVJ.js";import"./chunk-Z2TVBXTG.js";import{a as X}from"./chunk-QIOURN4K.js";import"./chunk-KYVCMV2E.js";import"./chunk-HWZZ5RQT.js";import"./chunk-ZNR7QNVV.js";import"./chunk-WGAXTYG2.js";import"./chunk-U3Z5BGA7.js";import{a as $,b as J}from"./chunk-M6YDMVQ7.js";import{a as Y}from"./chunk-EB6TJ75L.js";import"./chunk-QI7CEGT6.js";import"./chunk-6ND7557V.js";import"./chunk-FOJCKIWO.js";import{b as z}from"./chunk-3AIY57KH.js";import"./chunk-AB6CKZTE.js";import"./chunk-K5O3OQFW.js";import"./chunk-2DRXLVRR.js";import{d as j,e as U}from"./chunk-RQJZECR4.js";import"./chunk-G3G5OK6Q.js";import"./chunk-AERMLNF3.js";import"./chunk-QHMYZ6SM.js";import"./chunk-PJPLTBJX.js";import"./chunk-DLIVM562.js";import"./chunk-CV2ZWZQE.js";import"./chunk-H4HD3LNW.js";import"./chunk-AQEWHUN5.js";import{c as L,d as V,e as D}from"./chunk-YQZAETCE.js";import{s as H}from"./chunk-EO42E46J.js";import"./chunk-3QVSKJ3X.js";import{G as k,I as G}from"./chunk-ERUCNOOT.js";import{$b as y,Gc as B,Hc as R,Jb as g,Kb as N,Lb as P,Mb as w,Nb as O,Qb as m,Qc as s,Rc as p,Sc as C,Tb as b,Ub as E,Vb as o,Wb as a,Xb as S,db as n,fc as M,gc as d,ib as f,la as x,ma as h,sb as I,tc as r,uc as T,vc as l,wc as A,yb as u}from"./chunk-DBE7WQEG.js";import{g as v}from"./chunk-W7GRJBO5.js";var Z=()=>({width:"50px",height:"50px"}),ee=t=>["/studio/shop/orders",t],te=(t,i)=>i.orderId,ne=(t,i)=>i.id;function ie(t,i){t&1&&(o(0,"div",0),S(1,"p-progressSpinner",2),a()),t&2&&(n(),w(B(2,Z)))}function ae(t,i){if(t&1){let e=y();o(0,"p-button",11),s(1,"translate"),M("onClick",function(){x(e);let _=d(2);return h(_.openDashboard())}),a()}if(t&2){let e=d(2);g("label",p(1,3,"MANAGER.SHOP_PAYMENTS.BTN_DASHBOARD"))("outlined",!0)("loading",e.stripeDashboardLoading)}}function oe(t,i){t&1&&(r(0),s(1,"translate")),t&2&&l(" ",p(1,1,"MANAGER.SHOP_PAYMENTS.SHIPPING_DEBT_EXPLAIN")," ")}function re(t,i){t&1&&(r(0),s(1,"translate")),t&2&&l(" ",p(1,1,"MANAGER.SHOP_PAYMENTS.SHIPPING_OK_EXPLAIN")," ")}function se(t,i){t&1&&(o(0,"div",29),S(1,"i",31),r(2),s(3,"translate"),a()),t&2&&(n(2),l(" ",p(3,1,"MANAGER.SHOP_PAYMENTS.SHIPPING_BLOCKED")," "))}function le(t,i){if(t&1&&(o(0,"tr")(1,"td")(2,"a",33),r(3),a()(),o(4,"td",16),r(5),s(6,"number"),a(),o(7,"td",16),r(8),s(9,"number"),a(),o(10,"td",16),r(11),s(12,"number"),a()()),t&2){let e=i.$implicit;n(2),g("routerLink",R(15,ee,e.orderId)),n(),l("#",e.orderId.substring(0,8).toUpperCase(),""),n(2),l(" ",C(6,6,e.shippingChargedCents/100,"1.2-2")," \u20AC "),n(3),l(" ",C(9,9,e.shippingRealCostCents/100,"1.2-2")," \u20AC "),n(3),A(" ",e.adjustmentCents>0?"+":"","",C(12,12,e.adjustmentCents/100,"1.2-2")," \u20AC ")}}function ce(t,i){if(t&1&&(o(0,"div",30)(1,"table",32)(2,"thead")(3,"tr")(4,"th"),r(5),s(6,"translate"),a(),o(7,"th",16),r(8),s(9,"translate"),a(),o(10,"th",16),r(11),s(12,"translate"),a(),o(13,"th",16),r(14),s(15,"translate"),a()()(),o(16,"tbody"),b(17,le,13,17,"tr",null,te),a()()()),t&2){let e=d(4);n(5),l(" ",p(6,4,"MANAGER.SHOP_PAYMENTS.SHIPPING_ADJ_ORDER")," "),n(3),l(" ",p(9,6,"MANAGER.SHOP_PAYMENTS.SHIPPING_ADJ_CHARGED")," "),n(3),l(" ",p(12,8,"MANAGER.SHOP_PAYMENTS.SHIPPING_ADJ_REAL")," "),n(3),l(" ",p(15,10,"MANAGER.SHOP_PAYMENTS.SHIPPING_ADJ_GAP")," "),n(3),E(e.shippingBalance.recentAdjustments)}}function pe(t,i){if(t&1&&(o(0,"div",3)(1,"div",24),S(2,"i",25),o(3,"span",26),r(4),s(5,"translate"),a()(),o(6,"div",27),r(7),s(8,"number"),a(),o(9,"div",28),u(10,oe,2,3)(11,re,2,3),a(),u(12,se,4,3,"div",29)(13,ce,19,12,"div",30),a()),t&2){let e=d(3);n(2),N("color",e.shippingBalance.balanceCents<0?"#f59e0b":"#22c55e"),n(2),l(" ",p(5,9,"MANAGER.SHOP_PAYMENTS.SHIPPING_BALANCE")," "),n(2),P("negative",e.shippingBalance.balanceCents<0),n(),l(" ",C(8,11,e.shippingBalanceEur,"1.2-2")," \u20AC "),n(3),m(e.shippingBalance.balanceCents<0?10:11),n(2),m(e.shippingBalance.isBlocked?12:-1),n(),m(e.shippingBalance.recentAdjustments.length?13:-1)}}function de(t,i){t&1&&(o(0,"div",23),r(1),s(2,"translate"),a()),t&2&&(n(),l(" ",p(2,1,"MANAGER.SHOP_PAYMENTS.NO_TRANSACTIONS")," "))}function me(t,i){if(t&1&&(r(0),s(1,"translate")),t&2){let e=d().$implicit;A(" ",p(1,2,"MANAGER.SHOP_PAYMENTS.TX_ORDER")," #",e.orderShortId," \xB7 ")}}function _e(t,i){if(t&1&&r(0),t&2){let e=d().$implicit;
1l(" ",e.description," \xB7 ")}}function ue(t,i){if(t&1&&(o(0,"div",35)(1,"div",37),S(2,"i"),a(),o(3,"div",7)(4,"div",38),r(5),a(),o(6,"div",39),u(7,me,2,4)(8,_e,1,1),r(9),a()(),o(10,"div",40),r(11),a()()),t&2){let e=i.$implicit,c=d(4);n(),P("positive",e.amount>=0)("negative",e.amount<0),n(),O(c.getTransactionIcon(e.type)),n(3),l(" ",c.getTransactionTypeLabel(e.type)," "),n(2),m(e.orderShortId?7:e.description?8:-1),n(2),l(" ",c.formatDate(e.created)," "),n(),P("positive",e.amount>=0)("negative",e.amount<0),n(),A(" ",e.amount>=0?"+":"-","",c.formatAmount(e.amount,e.currency)," ")}}function ge(t,i){if(t&1){let e=y();o(0,"div",36)(1,"p-button",41),s(2,"translate"),M("onClick",function(){x(e);let _=d(4);return h(_.loadMore())}),a()()}if(t&2){let e=d(4);n(),g("label",p(2,3,"MANAGER.SHOP_PAYMENTS.LOAD_MORE"))("outlined",!0)("loading",e.loadMoreLoading)}}function Se(t,i){if(t&1&&(o(0,"div",34),b(1,ue,12,15,"div",35,ne),a(),u(3,ge,3,5,"div",36)),t&2){let e=d(3);n(),E(e.transactions),n(2),m(e.hasMoreTransactions?3:-1)}}function Ce(t,i){if(t&1){let e=y();o(0,"div",3)(1,"div",12)(2,"div")(3,"div",13),r(4),s(5,"translate"),a(),o(6,"div",14),r(7),s(8,"number"),o(9,"span",15),r(10),a()()(),o(11,"div",16)(12,"div",13),r(13),s(14,"translate"),a(),o(15,"div",17),r(16),s(17,"number"),o(18,"span",15),r(19),a()()()(),o(20,"p-button",18),s(21,"translate"),M("onClick",function(){x(e);let _=d(2);return h(_.requestPayout())}),a()(),u(22,pe,14,14,"div",3),o(23,"div",19)(24,"div",20)(25,"h3",21),r(26),s(27,"translate"),a(),o(28,"p-button",22),s(29,"translate"),M("onClick",function(){x(e);let _=d(2);return h(_.openDashboard())}),a()(),u(30,de,3,3,"div",23)(31,Se,4,1),a()}if(t&2){let e=d(2);n(4),l(" ",p(5,14,"MANAGER.SHOP_PAYMENTS.AVAILABLE")," "),n(3),l(" ",C(8,16,e.availableAmount,"1.2-2")," "),n(3),T(e.currency),n(3),l(" ",p(14,19,"MANAGER.SHOP_PAYMENTS.PENDING")," "),n(3),l(" ",C(17,21,e.pendingAmount,"1.2-2")," "),n(3),T(e.currency),n(),g("label",p(21,24,"MANAGER.SHOP_PAYMENTS.BTN_PAYOUT"))("loading",e.payoutLoading)("disabled",e.availableAmount<=0),n(2),m(e.shippingBalance?22:-1),n(4),l(" ",p(27,26,"MANAGER.SHOP_PAYMENTS.TRANSACTIONS_TITLE")," "),n(2),g("label",p(29,28,"MANAGER.SHOP_PAYMENTS.VIEW_ALL_STRIPE"))("text",!0),n(2),m(e.transactions.length===0?30:31)}}function ve(t,i){if(t&1&&(o(0,"div",1)(1,"div",3)(2,"div",4)(3,"div",5),S(4,"i",6),a(),o(5,"div",7)(6,"div",8),r(7,"Stripe"),a(),S(8,"p-tag",9),s(9,"translate"),a(),u(10,ae,2,5,"p-button",10),a()(),u(11,Ce,32,30),a()),t&2){let e=d();n(3),P("active",e.isConnected),n(5),g("value",p(9,7,"MANAGER.SHOP_PAYMENTS.STATUS_"+e.stripeStatus.toUpperCase()))("severity",e.statusSeverity)("rounded",!0),n(2),m(e.isConnected?10:-1),n(),m(e.isConnected?11:-1)}}var Q=class t{constructor(i,e,c,_){this.shopService=i;this.toastService=e;this.confirmService=c;this.translate=_}loading=!0;stripeStatus="not_connected";balance=null;transactions=[];hasMoreTransactions=!1;shippingBalance=null;stripeDashboardLoading=!1;payoutLoading=!1;loadMoreLoading=!1;ngOnInit(){this.load()}get isConnected(){return this.stripeStatus==="active"}get availableAmount(){return(this.balance?.available?.[0]?.amount??0)/100}get pendingAmount(){return(this.balance?.pending?.[0]?.amount??0)/100}get currency(){return this.balance?.available?.[0]?.currency?.toUpperCase()??"EUR"}get shippingBalanceEur(){return(this.shippingBalance?.balanceCents??0)/100}get statusSeverity(){switch(this.stripeStatus){case"active":return"success";case"onboarding":case"restricted":return"warn";default:return"secondary"}}load(){return v(this,null,function*(){this.loading=!0;try{let i=yield this.shopService.getStripeConnectStatus();if(this.stripeStatus=i.status,this.isConnected){let[e,c,_]=yield Promise.all([this.shopService.getStripeBalance(),this.shopService.getStripeTransactions(20),this.shopService.getShippingBalance().catch(()=>null)]);this.balance=e,this.transactions=c.data,this.hasMoreTransactions=c.hasMore,this.shippingBalance=_}}catch{}finally{this.loading=!1}})}openDashboard(){return v(this,null,function*(){this.stripeDashboardLoading=!0;try{let i=yield this.shopService.getStripeDashboardLink();window.open(i.url,"_blank")}catch{this.toastService.error(this.translate.instant("MANAGER.SHOP_PAYMENTS.ERROR_DASHBOARD"))}finally{this.stripeDashboardLoading=!1}})}requestPayout(){return v(this,null,function*(){if(yield this.confirmService.confirm({header:this.translate.instant("MANAGER.SHOP_PAYMENTS.PAYOUT_CONFIRM_TITLE"),message:this.translate.instant("MANAGER.SHOP_PAYMENTS.PAYOUT_CONFIRM_MSG"),severity:"info",acceptLabel:this.translate.instant("MANAGER.SHOP_PAYMENTS.PAYOUT_CONFIRM_BTN"),rejectLabel:this.translate.instant("COMMON.CANCEL")})){this.payoutLoading=!0;try{let e=yield this.shopService.createStripePayout(),c=(e.amount/100).toFixed(2);this.toastService.success(this.translate.instant("MANAGER.SHOP_PAYMENTS.PAYOUT_SUCCESS",{amount:`${c} ${e.currency.toUpperCase()}`})),yield this.load()}catch{this.toastService.error(this.translate.instant("MANAGER.SHOP_PAYMENTS.PAYOUT_ERROR"))}finally{this.payoutLoading=!1}}})}loadMore(){return v(this,null,function*(){if(!(!this.hasMoreTransactions||this.loadMoreLoading)){this.loadMoreLoading=!0;try{let i=this.transactions[this.transactions.length-1]?.id,e=yield this.shopService.getStripeTransactions(20,i);this.transactions=[...this.transactions,...e.data],this.hasMoreTransactions=e.hasMore}catch{}finally{this.loadMoreLoading=!1}}})}
1formatAmount(i,e){let c=Math.abs(i)/100;return new Intl.NumberFormat("fr-FR",{style:"currency",currency:e.toUpperCase()}).format(c)}formatDate(i){return new Date(i*1e3).toLocaleDateString("fr-FR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})}getTransactionTypeLabel(i){let e=`MANAGER.SHOP_PAYMENTS.TX_${i.toUpperCase()}`,c=this.translate.instant(e);return c!==e?c:i}getTransactionIcon(i){switch(i){case"transfer":case"payment":case"charge":return"pi pi-arrow-down";case"refund":case"payment_refund":return"pi pi-arrow-up";case"payout":return"pi pi-building";case"adjustment":return"pi pi-sliders-h";default:return"pi pi-arrows-h"}}static \u0275fac=function(e){return new(e||t)(f(W),f(Y),f(X),f(L))};static \u0275cmp=I({type:t,selectors:[["app-view-manager-shop-payments"]],decls:2,vars:1,consts:[[1,"d-flex","justify-content-center","py-5"],[1,"payments-page"],["strokeWidth","4"],[1,"payments-card","mb-4"],[1,"d-flex","align-items-center","gap-3"],[1,"connector-icon"],[1,"pi","pi-credit-card"],[1,"flex-grow-1"],[1,"connector-name"],[3,"value","severity","rounded"],["icon","pi pi-external-link","severity","secondary","size","small",3,"label","outlined","loading"],["icon","pi pi-external-link","severity","secondary","size","small",3,"onClick","label","outlined","loading"],[1,"d-flex","align-items-start","justify-content-between","mb-3"],[1,"card-label"],[1,"balance-amount"],[1,"balance-currency"],[1,"text-end"],[1,"pending-amount"],["icon","pi pi-send","severity","primary","size","small","styleClass","w-100",3,"onClick","label","loading","disabled"],[1,"payments-card"],[1,"d-flex","align-items-center","justify-content-between","mb-3"],[1,"section-title","mb-0"],["icon","pi pi-external-link","severity","secondary","size","small",3,"onClick","label","text"],[1,"text-center","py-4","text-muted"],[1,"d-flex","align-items-center","gap-2","mb-2"],[1,"pi","pi-truck"],[1,"card-label","mb-0"],[1,"shipping-amount"],[1,"card-desc","mt-2"],[1,"shipping-blocked","mt-3"],[1,"table-responsive","mt-3"],[1,"pi","pi-exclamation-triangle","me-2"],[1,"table","table-sm","align-middle","mb-0"],[3,"routerLink"],[1,"transactions-list"],[1,"transaction-row"],[1,"text-center","mt-3"],[1,"tx-icon"],[1,"tx-type"],[1,"tx-date"],[1,"tx-amount"],["severity","secondary","size","small",3,"onClick","label","outlined","loading"]],template:function(e,c){e&1&&u(0,ie,2,3,"div",0)(1,ve,12,9,"div",1),e&2&&m(c.loading?0:1)},dependencies:[G,k,H,D,V,U,j,J,$,z,F,K,q],styles:[".payments-page[_ngcontent-%COMP%]{max-width:800px}.payments-card[_ngcontent-%COMP%]{background:var(--surface-card);border:1px solid var(--surface-border);border-radius:12px;padding:1.5rem}.connector-icon[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;background:var(--surface-ground);display:flex;align-items:center;justify-content:center;font-size:1.25rem;color:var(--text-color-secondary)}.connector-icon.active[_ngcontent-%COMP%]{background:#22c55e1a;color:#22c55e}.connector-name[_ngcontent-%COMP%]{font-size:1.1rem;font-weight:600;margin-bottom:.25rem}.card-label[_ngcontent-%COMP%]{font-size:.8rem;color:var(--text-color-secondary);text-transform:uppercase;letter-spacing:.5px;margin-bottom:.25rem}.card-desc[_ngcontent-%COMP%]{font-size:.85rem;color:var(--text-color-secondary)}.balance-amount[_ngcontent-%COMP%]{font-size:2rem;font-weight:700;color:var(--text-color)}.pending-amount[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:500;color:var(--text-color-secondary)}.balance-currency[_ngcontent-%COMP%]{font-size:.85rem;font-weight:400;color:var(--text-color-secondary)}.shipping-amount[_ngcontent-%COMP%]{font-size:1.5rem;font-weight:700;color:#22c55e}.shipping-amount.negative[_ngcontent-%COMP%]{color:#f59e0b}.shipping-blocked[_ngcontent-%COMP%]{background:#ef44441a;color:#ef4444;border-radius:8px;padding:.75rem 1rem;font-size:.85rem}.section-title[_ngcontent-%COMP%]{font-size:1.1rem;font-weight:600}.transactions-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.transaction-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;padding:.75rem;border-radius:8px;background:var(--surface-ground)}.tx-icon[_ngcontent-%COMP%]{width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:.85rem}.tx-icon.positive[_ngcontent-%COMP%]{background:#22c55e1a;color:#22c55e}.tx-icon.negative[_ngcontent-%COMP%]{background:#ef44441a;color:#ef4444}.tx-type[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500}.tx-date[_ngcontent-%COMP%]{font-size:.75rem;color:var(--text-color-secondary)}
1.tx-amount[_ngcontent-%COMP%]{font-size:.95rem;font-weight:600}.tx-amount.positive[_ngcontent-%COMP%]{color:#22c55e}.tx-amount.negative[_ngcontent-%COMP%]{color:#ef4444}"]})};export{Q as ViewManagerShopPaymentsComponent};

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.