PageSourceSearch

https://nbmedical.com/chunk-PTU2QNNG.js

js nbmedical.com collected 2026-10-02 07:03:28 UTC 6,762 bytes, 1 lines download raw bytes

1import{a as I}from"./chunk-EATVC5XS.js";import{a as Z}from"./chunk-JB47OGZK.js";import{e as Q,m as X}from"./chunk-S33CAPPZ.js";import{a as J}from"./chunk-2K2V3AF7.js";import"./chunk-C6TWE4FZ.js";import"./chunk-Q2YLND27.js";import"./chunk-NU4ZUM7K.js";import"./chunk-NLZC42V6.js";import"./chunk-ZBQW7NJG.js";import"./chunk-ZUSG72XP.js";import"./chunk-HJWJPZ5W.js";import{c as K,d as O,ra as H}from"./chunk-LQY2VBIU.js";import"./chunk-WRBQWUEI.js";import{k as z,n as S,o as R}from"./chunk-LRSFZQSP.js";import{$b as V,Ab as r,Ac as G,Bb as d,Cb as f,D as x,Dc as q,Ec as v,Lb as j,N as D,Na as L,Nb as k,P as y,Pb as u,Ra as n,Z as a,_c as W,ac as s,cc as g,da as B,ea as F,eb as P,f as w,jc as E,oc as T,pa as _,qc as M,rb as N,sb as m,sc as b,sd as Y,tc as C,ub as l,wb as A,xb as $,yb as U,zb as p}from"./chunk-IXJZIWF6.js";import"./chunk-IZQOVDKO.js";import"./chunk-6IZLXKZM.js";var ee=(t,c)=>[t,c];function ne(t,c){if(t&1&&(r(0,"span"),s(1),d()),t&2){let e=u(2);n(),g(" \xA3",e.product().redeemablePrice," ")}}function re(t,c){t&1&&s(0," FREE ")}function de(t,c){if(t&1&&(r(0,"div"),m(1,ne,2,1,"span")(2,re,1,0),d()),t&2){let e=u();n(),l(e.product().redeemablePrice>0?1:2)}}function ce(t,c){t&1&&(r(0,"strong",10),s(1,"ALREADY IN BASKET"),d())}var te=(()=>{class t{constructor(){this.vouchersService=a(I),this.router=a(S),this.voucherId=v(void 0),this.basket=v(void 0),this.product=v(void 0),this.index=v(void 0),this.otherProcessing=v(void 0),this.busyProcessing=q(),this._processing=_(!1)}get processing(){return this._processing()}set processing(e){this._processing.set(e),this.busyProcessing.emit(e)}get baseUrl(){return`/${this.product().productType}s`}get maxPrice(){let e;
1return this.product().variants.forEach(o=>{e===void 0&&(e=o.price),e<o.price&&(e=o.price)}),e}get category(){let e=`${this.product().productType}s`;return e=e[0].toUpperCase()+e.substring(1),e}Redeem(e){this.processing=!0,this.vouchersService.RedeemVoucher(this.voucherId(),e).pipe(x(1)).subscribe(o=>{this.router.navigate(["/added-to-cart",e],{queryParams:{voucherId:this.voucherId()}})})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=P({type:t,selectors:[["nbm-redeem-voucher-card"]],inputs:{voucherId:[1,"voucherId"],basket:[1,"basket"],product:[1,"product"],index:[1,"index"],otherProcessing:[1,"otherProcessing"]},outputs:{busyProcessing:"busyProcessing"},decls:22,vars:30,consts:[[1,"card","shadow","h-100","border-hot-topics-gp-update"],[1,"row","h-100","g-0"],[1,"col-4"],["category","Books",3,"routerLink","nbmProductImpressionClick","index"],[3,"src","alt"],[1,"col-8","h-100","d-flex","flex-column"],[1,"card-body","p-2","text-center"],[1,"d-flex","flex-column","h-100"],[1,"mb-1"],[1,"me-2"],[1,"text-primary"],[1,"flex-fill","d-flex"],[1,"btn","btn-primary",3,"click","disabled","nbmProcessingButton"]],template:function(o,i){o&1&&(r(0,"div",0)(1,"div",1)(2,"div",2)(3,"a",3),f(4,"img",4),b(5,"contentTypeSlug"),d()(),r(6,"div",5)(7,"a",3)(8,"h5"),b(9,"contentTypeSlug"),s(10),d()(),r(11,"div",6)(12,"div",7)(13,"div",8)(14,"del",9),s(15),d(),r(16,"strong",10),m(17,de,3,1,"div")(18,ce,2,0,"strong",10),d()(),f(19,"div",11),r(20,"button",12),k("click",function(){return i.Redeem(i.product().id)}),s(21," REDEEM "),d()()()()()()),o&2&&(N("data-productid",i.product().id),n(3),p("routerLink",M(24,ee,i.baseUrl,i.product().slug))("nbmProductImpressionClick",i.product())("index",i.index()),n(),V(E("card-img border-",C(5,20,i.product())," shadow")),p("src",i.product().image+"?width=200&height=300",L)("alt",i.product().name),n(3),p("routerLink",M(27,ee,i.baseUrl,i.product().slug))("nbmProductImpressionClick",i.product())("index",i.index()),n(),V(E("card-header text-center bg-gradient bg-",C(9,22,i.product())," text-white")),n(2),g(" ",i.product().name," "),n(5),g("\xA3",i.maxPrice),n(2),l(i.basket().contains(i.product().id)?18:17),n(3),p("disabled",i.otherProcessing())("nbmProcessingButton",i.processing))},dependencies:[R,J,Q,Z],encapsulation:2})}}return t})();var ie=()=>["/my-account"];function se(t,c){if(t&1){let e=j();r(0,"div",10)(1,"nbm-redeem-voucher-card",11),k("busyProcessing",function(i){B(e);let h=u(4);return F(h.onProcessingChange(i))}),d()()}if(t&2){let e=c.$implicit,o=c.$index,i=u(4);n(),p("voucherId",i.voucherId())("product",e)("index",o)("basket",i.basket())("otherProcessing",i.processing())}}function ae(t,c){if(t&1&&(r(0,"div",9),$(1,se,2,5,"div",10,A),d()),t&2){let e=u(2);n(),U(e.items)}}function pe(t,c){if(t&1&&(r(0,"div",3)(1,"div",4)(2,"button",5),s(3,"Back"),d()()(),r(4,"div",6)(5,"div",7)(6,"p",8),s(7,"Choose one product below"),d()()(),m(8,ae,3,0,"div",9)),t&2){let e=u(2);n(2),p("disabled",e.processing())("routerLink",T(3,ie)),n(6),l(e.basket()?8:-1)}}function ue(t,c){if(t&1&&(r(0,"div",2)(1,"span",12),s(2),f(3,"br"),r(4,"a",13),s(5,"Go to 'My Account'"),d()()()),t&2){let e=u();n(2),g(" This voucher can't be redeemed - ",e.message," "),n(2),p("routerLink",T(2,ie))}}function me(t,c){t&1&&m(0,pe,9,4)(1,ue,6,3,"div",2),t&2&&l(c.success?0:1)}var Le=(()=>{class t{constructor(){this.basketService=a(H),this.vouchersService=a(I),this.toastService=a(O),this.router=a(S),this.route=a(z),this.gtmService=a(K),this.basket=Y(this.basketService.getUserBasket().pipe(y(e=>this.gtmService.sendEnterCheckout(e)))),this.redeemableProductsResponse$=w,this.voucherId=_(""),this.processing=_(!1),this.addedItem=G(()=>this.basket()?.items.filter(e=>e.productId===this.selectedProductId)[0])}ngOnInit(){this.redeemableProductsResponse$=this.route.params.pipe(y(e=>{this.voucherId.set(e.id)}),D(e=>this.vouchersService.GetRedeemableProductsForVoucher(e.id).pipe(y(o=>{if(o.items.length===1){let i=o.items[0].id;this.vouchersService.RedeemVoucher(this.voucherId(),i).pipe(x(1)).subscribe(h=>{this.router.navigate(["/added-to-cart",i],{queryParams:{voucherId:this.voucherId()}})})}}))))}onProcessingChange(e){this.processing.set(e)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=P({type:t,selectors:[["nbm-redeem-voucher"]],decls:4,vars:4,consts:[["title","Redeem Voucher",3,"fullWidth"],[1,"container"],[1,"row","justify-content-center"],[1,"row","mb-2"],[1,"col-4"],[1,"btn","btn-secondary",3,"disabled","routerLink"],[1,"row","mb-2","justify-content-center"],[1,"col-md-8"],[1,"alert","alert-info","text-center"],[1,"row"],[1,"col-xl-4","col-md-6","mb-3"],[3,"busyProcessing","voucherId","product","index","basket","otherProcessing"],[1,"alert","alert-warning"],[1,"btn","btn-info","mt-2",3,"routerLink"]],template:function(o,i){if(o&1&&(r(0,"nbm-site-page",0)(1,"div",1),m(2,me,2,1),b(3,"async"),d()()),o&2){let h;p("fullWidth",!0),n(2),l((h=C(3,2,i.redeemableProductsResponse$))?2:-1,h)}},dependencies:[R,X,te,W],encapsulation:2})}}return t})();export{Le as RedeemVoucherComponent};

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.