1"use strict";(self.webpackChunklegal_hints=self.webpackChunklegal_hints||[]).push([[5843],{5843:(T,_,c)=>{c.r(_),c.d(_,{BuyPackagePage:()=>F});var d=c(10467),n=c(54438),p=c(60177),o=c(75281),P=c(32025),g=c(68018),u=c(99811),m=c(97646),C=c(33587),l=c(58515);const M=(e,i)=>i.id;function O(e,i){1&e&&(n.j41(0,"div",4),n.nrm(1,"ion-spinner",6),n.j41(2,"p"),n.EFF(3),n.nI1(4,"translate"),n.k0s()()),2&e&&(n.R7$(3),n.JRh(n.bMT(4,1,"payment.loading")))}function k(e,i){if(1&e&&(n.j41(0,"div",17),n.EFF(1),n.nI1(2,"translate"),n.k0s()),2&e){const t=n.XpG(3);n.R7$(),n.SpI(" ",n.bMT(2,1,t.package.description)," ")}}function h(e,i){if(1&e&&(n.j41(0,"ion-card",7)(1,"ion-card-header")(2,"ion-card-title"),n.EFF(3),n.nI1(4,"translate"),n.k0s()(),n.j41(5,"ion-card-content")(6,"div",13)(7,"div",14)(8,"span",15),n.EFF(9),n.nI1(10,"translate"),n.k0s(),n.j41(11,"span",16),n.EFF(12),n.k0s()(),n.j41(13,"div",14)(14,"span",15),n.EFF(15),n.nI1(16,"translate"),n.k0s(),n.j41(17,"span",16),n.EFF(18),n.k0s()(),n.DNE(19,k,3,3,"div",17),n.k0s()()()),2&e){const t=n.XpG(2);n.R7$(3),n.JRh(n.bMT(4,6,t.package.name)),n.R7$(6),n.SpI("",n.bMT(10,8,"payment.credits"),":"),n.R7$(3),n.JRh(t.package.credit),n.R7$(3),n.SpI("",n.bMT(16,10,"payment.price"),":"),n.R7$(3),n.SpI("",t.package.price," RON"),n.R7$(),n.vxM(t.package.description?19:-1)}}function y(e,i){1&e&&(n.j41(0,"ion-card",9)(1,"ion-card-content")(2,"p"),n.EFF(3),n.nI1(4,"translate"),n.k0s()()()),2&e&&(n.R7$(3),n.JRh(n.bMT(4,1,"payment.no_cards_available")))}function f(e,i){1&e&&n.nrm(0,"ion-icon",21)}function v(e,i){if(1&e){const t=n.RV6();n.j41(0,"ion-item",19),n.bIt("click",function(){const r=n.eBV(t).$implicit,s=n.XpG(3);return n.Njj(s.selectCard(r))}),n.nrm(1,"ion-icon",20),n.j41(2,"ion-label")(3,"h3"),n.EFF(4),n.k0s(),n.j41(5,"p"),n.EFF(6),n.k0s()(),n.DNE(7,f,1,0,"ion-icon",21),n.k0s()}if(2&e){const t=i.$implicit,a=n.XpG(3);n.AVh("selected",(null==a.selectedCard?null:a.selectedCard.id)===t.id),n.Y8G("button",!0),n.R7$(),n.Y8G("color",(null==a.selectedCard?null:a.selectedCard.id)===t.id?"primary":"medium"),n.R7$(3),n.SpI("**** **** **** ",t.last4||"****",""),n.R7$(2),n.E5c("",t.brand||"Card"," - ",t.expiryMonth,"/",t.expiryYear,""),n.R7$(),n.vxM((null==a.selectedCard?null:a.selectedCard.id)===t.id?7:-1)}}function E(e,i){if(1&e&&(n.j41(0,"ion-list"),n.Z7z(1,v,8,9,"ion-item",18,M),n.k0s()),2&e){const t=n.XpG(2);n.R7$(),n.Dyx(t.cards)}}function b(e,i){1&e&&n.nrm(0,"ion-spinner",6)}function x(e,i){1&e&&(n.EFF(0),n.nI1(1,"translate")),2&e&&n.SpI(" ",n.bMT(1,1,"payment.proceed_to_payment")," ")}function R(e,i){if(1&e){const t=n.RV6();n.j41(0,"div",5),n.DNE(1,h,20,12,"ion-card",7),n.j41(2,"div",8)(3,"h3"),n.EFF(4),n.nI1(5,"translate"),n.k0s(),n.DNE(6,y,5,3,"ion-card",9)(7,E,3,0,"ion-list"),n.k0s(),n.j41(8,"div",10)(9,"
1ion-button",11),n.bIt("click",function(){n.eBV(t);const r=n.XpG();return n.Njj(r.proceedWithPayment())}),n.DNE(10,b,1,0,"ion-spinner",6)(11,x,2,3),n.k0s(),n.j41(12,"ion-button",12),n.bIt("click",function(){n.eBV(t);const r=n.XpG();return n.Njj(r.closeWindow())}),n.EFF(13),n.nI1(14,"translate"),n.k0s()()()}if(2&e){const t=n.XpG();n.R7$(),n.vxM(t.package?1:-1),n.R7$(3),n.JRh(n.bMT(5,6,"payment.select_payment_method")),n.R7$(2),n.vxM(0===t.cards.length?6:7),n.R7$(3),n.Y8G("disabled",!t.selectedCard||t.isProcessing),n.R7$(),n.vxM(t.isProcessing?10:11),n.R7$(3),n.SpI(" ",n.bMT(14,8,"payment.cancel")," ")}}let F=(()=>{class e{route=(0,n.WQX)(P.nX);paymentService=(0,n.WQX)(u.W);toastService=(0,n.WQX)(m.f);logger=(0,n.WQX)(C.g);packageId=null;package=null;cards=[];selectedCard=null;isLoading=!0;isProcessing=!1;ngOnInit(){this.packageId=this.route.snapshot.paramMap.get("packageId"),this.loadData()}loadData(){var t=this;return(0,d.A)(function*(){try{const[a,r]=yield Promise.all([t.paymentService.requestPackages().toPromise(),t.paymentService.getCards().toPromise()]);t.package=a?.find(s=>s.id===t.packageId)||null,t.cards=r||[],1===t.cards.length&&(t.selectedCard=t.cards[0]),t.isLoading=!1}catch(a){t.logger.error("Failed to load payment data",a),t.toastService.presentWarningToast("Failed to load payment information"),t.isLoading=!1}})()}selectCard(t){this.selectedCard=t}proceedWithPayment(){var t=this;return(0,d.A)(function*(){if(t.selectedCard&&t.packageId){t.isProcessing=!0;try{const a=(0,l.f)(l.o.paymentFinished),r=(0,l.f)(l.o.paymentFailed),s=yield t.paymentService.sellPackageWithUrls(t.packageId,t.selectedCard.id,a,r).toPromise();if(!s)throw new Error("Failed to get payment URL");window.location.href=s}catch(a){t.logger.error("Failed to process payment",a),t.toastService.presentWarningToast("Failed to process payment"),t.isProcessing=!1}}else t.toastService.presentWarningToast("Please select a card")})()}closeWindow(){window.close()}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=n.VBU({type:e,selectors:[["app-buy-package"]],standalone:!0,features:[n.aNF],decls:11,vars:4,consts:[["slot","end"],[3,"click"],["slot","icon-only","name","close"],[1,"ion-padding"],[1,"loading-container"],[1,"purchase-container"],["name","crescent"],[1,"package-card"],[1,"cards-section"],[1,"no-cards"],[1,"action-buttons"],["expand","block",3,"click","disabled"],["expand","block","fill","outline",3,"click"],[1,"package-details"],[1,"detail-row"],[1,"label"],[1,"value"],[1,"description"],[3,"button","selected"],[3,"click","button"],["slot","start","name","card-outline",3,"color"],["slot","end","name","checkmark-circle","color","primary"]],template:function(a,r){1&a&&(n.j41(0,"ion-header")(1,"ion-toolbar")(2,"ion-title"),n.EFF(3),n.nI1(4,"translate"),n.k0s(),n.j41(5,"ion-buttons",0)(6,"ion-button",1),n.bIt("click",function(){return r.closeWindow()}),n.nrm(7,"ion-icon",2),n.k0s()()()(),n.j41(8,"ion-content",3),n.DNE(9,O,5,3,"div",4)(10,R,15,10,"div",5),n.k0s()),2&a&&(n.R7$(3),n.JRh(n.bMT(4,2,"payment.confirm_purchase")),n.R7$(6),n.vxM(r.isLoading?9:10))},dependencies:[o.bv,o.Jm,o.QW,o.b_,o.I9,o.ME,o.tN,o.W9,o.eU,o.iq,o.uz,o.he,o.nf,o.w2,o.BC,o.ai,p.MD,g.h,g.D9],styles:[".loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;height:50vh}.loading-container[_ngcontent-%COMP%] ion-spinner[_ngcontent-%COMP%]{margin-bottom:1rem}.purchase-container[_ngcontent-%COMP%]{max-width:600px;margin:0 auto}.purchase-container[_ngcontent-%COMP%] .package-card[_ngcontent-%COMP%]{margin-bottom:2rem}.purchase-container[_ngcontent-%COMP%] .package-card[_ngcontent-%COMP%] ion-card-header[_ngcontent-%COMP%]{background:linear-gradient(135deg,#3b1751,#dc809f);color:#fff}.purchase-container[_ngcontent-%COMP%] .package-card[_ngcontent-%COMP%] ion-card-header[_ngcontent-%COMP%] ion-card-title[_ngcontent-%COMP%]{color:#fff}.purchase-container[_ngcontent-%COMP%] .package-card[_ngcontent-%COMP%] .package-details[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:.5rem}.purchase-container[_ngcontent-%COMP%] .package-card[_ngcontent-%COMP%] .package-details[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-weight:500;color:var(--text-gray-common)}.purchase-container[_ngcontent-%COMP%] .package-card[_ngcontent-%COMP%] .package-details[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{font-weight:600;color:var(--text-title-color-secondary)}.purchase-container[_ngcontent-%COMP%] .package-card[_ngcontent-%COMP%] .package-details[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--ion-color-light);color:var(--text-gray-common)}.purchase-container[_ngcontent-%COMP%] .cards-section[_ngcontent-%COMP%]{margin-bottom:2rem}.purchase-container[_ngcontent-%COMP%] .cards-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem;color:var(--text-title-color-secondary)}.purchase-container[_ngcontent-%COMP%] .cards-section[_ngcontent-%COMP%] ion-list[_ngcontent-%COMP%]{border-radius:8px;overflow:hidden}.purchase-container[_ngcontent-%COMP%] .cards-section[_ngcontent-%COMP%] ion-list[_ngcontent-%COMP%] ion-item[_ngcontent-%COMP%]{--padding-start: 16px;--padding-end: 16px}.purchase-container[_ngcontent-%COMP%] .cards-section[_ngcontent-%COMP%] ion-list[_ngcontent-%COMP%] ion-item.selected[_ngcontent-%COMP%]{--background: var(--ion-color-primary-tint)}.purchase-container[_ngcontent-%COMP%] .cards-section[_ngcontent-%COMP%] .no-cards[_ngcontent-%COMP%]{text-align:center}.purchase-container[_ngcontent-%COMP%] .cards-section[_ngcontent-%COMP%] .no-cards[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:var(--text-gray-common)}.purchase-container[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] ion-button[_ngcontent-%COMP%]{margin-bottom:.5rem}.purchase-container[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%] ion-button[_ngcontent-%COMP%]:last-child{margin-bottom:0}"]})}return e})()}}]);
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.