1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="85ec3155-b5d2-5936-b770-51778ffaf214")}catch(e){}}(); 3import{a as G}from"./chunk-FF2E3S7K.js";import{a as E}from"./chunk-G5XLPBRU.js";import{a as fe}from"./chunk-TFXLTXOY.js";import{a as de}from"./chunk-ODSBKAQF.js";import{a as se}from"./chunk-IUVJ2V4L.js";import{a as pe}from"./chunk-2BLGNMFL.js";import{f as me}from"./chunk-36J4VNYX.js";import"./chunk-5KW5LLEO.js";import"./chunk-6LR6GEL3.js";import{a as ce}from"./chunk-VIKOVFXV.js";import"./chunk-XI6AL42F.js";import"./chunk-Q7W3KTVA.js";import"./chunk-R6PLWBMX.js";import"./chunk-MULDP6DY.js";import"./chunk-GLRT253R.js";import"./chunk-RGU4C5LD.js";import"./chunk-LXVW4ISU.js";import"./chunk-TBICCHSJ.js";import"./chunk-KBQMZSAB.js";import"./chunk-ZQ3UACEX.js";import"./chunk-ZV4HIMXA.js";import"./chunk-R62SIVBY.js";import"./chunk-25BL5HKZ.js";import"./chunk-4FC5T6ZK.js";import"./chunk-E57IMVFK.js";import"./chunk-Y4ZE2WQQ.js";import"./chunk-ZPSQYJWN.js";import"./chunk-THBDF75G.js";import{C as le}from"./chunk-RJ2UG3RJ.js";import"./chunk-AB3LHRRD.js";import"./chunk-CI2HCF2F.js";import{h as re}from"./chunk-GXYF7J3H.js";import"./chunk-JHTWTYPN.js";import{a as ae}from"./chunk-B3Z3NAS4.js";import"./chunk-TGFFJGSM.js";import{b as te}from"./chunk-FPZ453VA.js";import"./chunk-EL6WFV23.js";import{b as ie,c as oe}from"./chunk-JSRFQSGR.js";import"./chunk-3EP7OHNH.js";import"./chunk-LWW7BOTF.js";import"./chunk-ERBHIP22.js";import"./chunk-LHPA4E6N.js";import"./chunk-3Y7FMX6W.js";import{a as T,ka as ne}from"./chunk-BBW6WW7Z.js";import{a as Q,b as X}from"./chunk-WLEWPZ6N.js";import{d as q,p as Z,s as ee}from"./chunk-OFQRR3BE.js";import{r as J}from"./chunk-NWCZTZ2F.js";import{l as L,p as Y,s as K}from"./chunk-3BAKG5RY.js";import{Aa as y,Bc as k,Lc as H,Mc as g,Nb as $,Pc as _,Rb as D,Rc as I,Sb as v,T as M,ab as R,bd as O,da as x,fa as P,hc as j,jc as N,kc as W,lc as c,ld as f,mc as a,md as h,nc as p,ob as F,oc as u,p as b,pd as V,rb as A,rd as z,sc as S,tb as l,tc as C,ua as m,vc as U,za as B,zc as w}from"./chunk-5U7LGHIW.js";import"./chunk-ALSDDZFP.js";import{j as t}from"./chunk-EKFLB6J2.js";var ge=()=>({"background-color":"white"});function he(r,s){if(r&1&&(a(0,"div",11)(1,"h1",12),_(2),f(3,"replaceTitle"),a(4,"span",13),_(5),f(6,"number"),p()()()),r&2){let i=k();l(),g("color",i.genreInfo.setting==null?null:i.genreInfo.setting.foregroundColor),l(),I(" ",h(3,6,i.genreInfo==null?null:i.genreInfo.title)," "),l(2),g("color",i.genreInfo.setting==null?null:i.genreInfo.setting.foregroundColor),l(),I(" ",h(6,8,i.totalCount)," \u06A9\u062A\u0627\u0628 ")}}function ve(r,s){if(r&1&&(a(0,"div",14)(1,"h1",15),_(2),f(3,"replaceTitle"),p(),a(4,"p",16),_(5),f(6,"number"),p()()),r&2){let i=k();l(),g("color",i.genreInfo.setting==null?null:i.genreInfo.setting.foregroundColor),l(),I(" ",h(3,6,i.genreInfo==null?null:i.genreInfo.title)," "),l(2),g("color",i.genreInfo.setting==null?null:i.genreInfo.setting.foregroundColor),l(),I("",h(6,8,i.totalCount)," \u06A9\u062A\u0627\u0628")}}function ke(r,s){if(r&1&&(a(0,"div",20),u(1,"app-behkhaan-book-card",21),p()),r&2){let i=s.$implicit;l(),c("_book",i)}}function _e(r,s){if(r&1&&(a(0,"div",2),N(1,ke,2,1,"div",20,j),p()),r&2){let i=k(2);l(),W(i.books)}}function Ie(r,s){r&1&&(S(0),a(1,"div",22)(2,"div",23),u(3,"div")(4,"div")(5,"div")(6,"div"),p()(),C())}function xe(r,s){if(r&1&&(S(0),a(1,"main",17),v(2,_e,3,0,"div",18)(3,Ie,7,0,"ng-container",19),p(),C()),r&2){let i=k();l(2),c("ngIf",i.books&&(i.books==null?null:i.books.length)>0),l(),c("ngIf",i.loadingBooks)}}function we(r,s){r&1&&u(0,"app-skeleton-behkhaan-book-card",24)}var be="loaded_genre",Ze=(()=>{let s=class s extends le{constructor(){super();t(this,"title",m(q));t(this,"router",m(ee));t(this,"seoService",m(pe));t(this,"serverState",m(R));t(this,"genresService",m(de));t(this,"searchService",m(se));t(this,"activatedRoute",m(Z));t(this,"_localRepository",m(J));t(this,"books",[]);t(this,"totalCount");t(this,"routes",X);t(this,"authors",[]);t(this,"genreInfo",new G);t(this,"loading",!0);t(this,"scrolled");t(this,"isPopularGenre");t(this,"loadingBooks");t(this,"hasMoreBooks");t(this,"bookArr");t(this,"genreBooksTermFilter",new ae);t(this,"genreId");t(this,"section");t(this,"replaceTitle",new E);t(this,"imageType",oe);this.genreBooksTermFilter.pgNumber=0,this.genreBooksTermFilter.pgSize=20}ngOnInit(){this.activatedRoute.params.pipe(x(e=>{if(e.id){this.genreId=e.id;let o=[];o.push(e.id),this.bookArr=o}return b(this.serverState.get(be,new te(new G,"","",!0,"")))}),x(e=>!e.hasError&&e.result&&e.result.id==this.genreId?b(e):this.genresService.getGenreById(this.genreId)),x(e=>{var o,n;if(!e.hasError&&e.result){if(this.genreInfo=e.result,(n=(o=this.genreInfo)==null?void 0:o.setting)!=null&&n.backgroundColor)this.isPopularGenre=!0;else{let d=this.utilFunctions.getImages(9,this.genreInfo.id)}this.updateMetaTags()}return this.searchService.suggestByGenreIds(this.bookArr,this.genreBooksTermFilter)}),P(this.unsubscribe$)).subscribe(e=>{var o,n;!e.hasError&&e.result&&(this.books=(o=e.result)==null?void 0:o.items,this.totalCount=e.result.totalCount,this.hasMoreBooks=(n=e.result)==null?void 0:n.hasNextPage),this.loading=!1})}getRowHeight(){let e=window.innerWidth;return e>=768?260.95:e>=576?215.41:98}back(){this.router.navigate([this.routes.home])}onWindowScroll(){var e;if(this._localRepository.IsInBrowser&&this._localRepository.IsInMobile){let o=(e=this.searchService.Repository.getWindow)==null?void 0:e.scrollY,n=this._localRepository.getDocument.getElementById("header");o>120&&(this.scrolled=!0,n.classList.add("scrolled-header")),o<35&&(this.scrolled=!1,n.classList.remove("scrolled-header"))}}loadMoreBooks(){this.hasMoreBooks&&(this.genreBooksTermFilter.pgNumber++,this.loadingBooks=!0,this.searchService.suggestByGenreIds(this.bookArr,this.genreBooksTermFilter).pipe(M(()=>this.loadingBooks=!1)).subscribe(e=>{var o,n;
3e.hasError||!e.result||((o=e.result)==null||o.items.forEach(d=>this.books.push(d)),this.hasMoreBooks=(n=e.result)==null?void 0:n.hasNextPage)}))}updateMetaTags(){let e=this.replaceTitle.transform(this.genreInfo.title),o={robots:"index",canonical:"".concat(T.SiteUrl).concat(Q.Genre.base,"/").concat(this.genreInfo.id),title:e,url:T.SiteUrl+this.router.url,description:"".concat(this.genreInfo.info),image:"".concat(this.environment.ImageUrl,"/genres/").concat(this.genreInfo.id,"/.jpg")};this.seoService.updateTags(o),this.title.setTitle("\u0628\u0647\u062A\u0631\u06CC\u0646 \u06A9\u062A\u0627\u0628\u200C\u0647\u0627\u06CC \u0698\u0627\u0646\u0631 ".concat(e," | \u0628\u0647\u062E\u0648\u0627\u0646"))}};t(s,"\u0275fac",function(o){return new(o||s)}),t(s,"\u0275cmp",$({type:s,selectors:[["app-genre-books"]],hostBindings:function(o,n){o&1&&w("scroll",function(){return n.onWindowScroll()},A)},features:[D],decls:15,vars:20,consts:[["skeletonTemplate",""],["infiniteScroll","",1,"w-full","h-full","overflow-auto","hide-scroll","flex","content-start","flex-wrap",3,"scrolled","infiniteScrollDistance","scrollWindow","infiniteScrollThrottle"],[1,"w-full","flex","flex-wrap"],["id","header",1,"w-full","p-3","flex","flex-wrap","relative",3,"ngStyle"],[1,"w-2/12","flex","items-center"],["mat-icon-button","",1,"flex","justify-center","items-center","cursor-pointer",3,"click"],[1,"icon","chevron-right-regular","text-lg"],["class","w-8/12 flex items-center",4,"ngIf"],["class","w-full px-2 mt-3 flex flex-wrap items-center justify-between",4,"ngIf"],["width","130","height","130","loading","lazy","onerror","this.src='https://storage.behkhaan.ir/assets/images/default/default_genre.svg'",1,"genre-image",3,"src","alt"],[4,"ngIf","ngIfElse"],[1,"w-8/12","flex","items-center"],[1,"w-full","text-base","font-medium","line-clamp-1"],[1,"text-sm","mr-2","text-gray-500"],[1,"w-full","px-2","mt-3","flex","flex-wrap","items-center","justify-between"],["id","genre-title",1,"w-full","text-base","font-medium"],["id","genre-book-count",1,"text-sm","text-gray-500"],[1,"w-full","flex","flex-wrap","my-3"],["class","w-full flex flex-wrap",4,"ngIf"],[4,"ngIf"],[1,"w-full","sm:w-4/12","md:w-3/12","px-3","py-2","border-b","border-gray-100","border-l","dark:border-gray-700","hover:shadow-sm"],[3,"_book"],[1,"w-full","my-5","flex","justify-center","items-center"],[1,"rounded-full","flex","justify-center","items-center"],[1,"w-full"]],template:function(o,n){if(o&1){let d=U();a(0,"section",1),w("scrolled",function(){return B(d),y(n.loadMoreBooks())}),a(1,"article",2)(2,"div",2)(3,"header",3)(4,"div",4)(5,"button",5),w("click",function(){return B(d),y(n.back())}),u(6,"span",6),p()(),v(7,he,7,10,"div",7)(8,ve,7,10,"div",8),u(9,"img",9),f(10,"image"),f(11,"replaceTitle"),p(),v(12,xe,4,2,"ng-container",10),p()()(),v(13,we,1,0,"ng-template",null,0,z)}if(o&2){let d=H(14);c("infiniteScrollDistance",1)("scrollWindow",!1)("infiniteScrollThrottle",1e3),l(3),c("ngStyle",O(19,ge)),l(2),g("color",n.genreInfo.setting==null?null:n.genreInfo.setting.foregroundColor),l(2),c("ngIf",n.scrolled),l(),c("ngIf",!n.scrolled),l(),c("src",V(10,12,n.genreInfo==null?null:n.genreInfo.id,n.imageType.genre,!0,".svg"),F)("alt",h(11,17,n.genreInfo==null?null:n.genreInfo.title)),l(3),c("ngIf",!n.loading)("ngIfElse",d)}},dependencies:[re,L,Y,ne,me,fe,ce,K,ie,E],styles:["[_nghost-%COMP%] {width:100%!important}header[_ngcontent-%COMP%]{height:164px;overflow:hidden}.genre-image[_ngcontent-%COMP%]{width:130px;height:130px;position:absolute;top:16px;left:16px;transform:rotate(-24deg);background-color:transparent}"]}));let r=s;return r})();export{Ze as GenreBooksComponent}; 4 5//# debugId=85ec3155-b5d2-5936-b770-51778ffaf214
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.