1import{a as N,b as X}from"./chunk-ACNGSPPG.js";import{a as Q,c as H}from"./chunk-2YZYSDYS.js";import"./chunk-FJU2PDM3.js";import"./chunk-IJPJ42CU.js";import"./chunk-ONLIA56S.js";import"./chunk-YZDYBO2T.js";import{a as L}from"./chunk-2UNKUHYI.js";import"./chunk-UAIJ6X4S.js";import"./chunk-NLRWUJW6.js";import{a as j}from"./chunk-2H3NM7IF.js";import{a as G}from"./chunk-4NYL3MTV.js";import{a as B}from"./chunk-OG3REYV4.js";import"./chunk-PUBM7CQ3.js";import"./chunk-QF5HLS3Q.js";import"./chunk-7V7DAUPP.js";import{p as P,u as V}from"./chunk-OYWHHPTD.js";import"./chunk-XDRSKTVV.js";import"./chunk-BXP7M62U.js";import"./chunk-D6QXS2B6.js";import{j as S}from"./chunk-RZM75C6V.js";import{l as O,m as M}from"./chunk-BYVB43HZ.js";import{Bc as x,Fa as m,Ga as u,Gc as _,Jc as l,Nc as A,Ob as T,Oc as b,Pc as w,Tc as F,Ub as f,Vc as v,Yc as g,Zc as E,_c as C,rc as p,sc as s,tc as a,uc as k,vb as d,xa as h}from"./chunk-RLFCBRIJ.js";import{a as D,b as I,k as y}from"./chunk-VJTDQWBS.js";var q=["scrollContainer"],U=["tabItems"];function W(i,r){if(i&1){let e=x();s(0,"div",8),k(1,"markji-icon",9),s(2,"div"),g(3,"\u63A8\u8350\u724C\u7EC4\u52A0\u8F7D\u5931\u8D25"),a(),s(4,"div",10),_("click",function(){m(e);let t=l();return t.isError=!1,u(t.clickSecondaryTitle(t.chosenCategories.secondaryIndex))}),g(5,"\u70B9\u51FB\u91CD\u8BD5"),a()()}}function J(i,r){i&1&&(s(0,"div",11),k(1,"markji-icon",12),s(2,"div"),g(3,"\u63A8\u8350\u724C\u7EC4\u52A0\u8F7D\u4E2D..."),a()())}function R(i,r){if(i&1){let e=x();s(0,"div",18,2),_("click",function(){let t=m(e).index,o=l(2);return u(o.clickFirstTitle(t))}),g(2),a()}if(i&2){let e=r.$implicit,n=r.index,t=l(2);v("active-title",t.chosenCategories.firstIndex===n),d(2),C(" ",e.title," ")}}function K(i,r){if(i&1){let e=x();s(0,"div",18),_("click",function(){let t=m(e).index,o=l(2);return u(o.clickSecondaryTitle(t))}),g(1),a()}if(i&2){let e=r.$implicit,n=r.index,t=l(2);v("active-title",t.chosenCategories.secondaryIndex===n),d(),C(" ",e.title," ")}}function Y(i,r){if(i&1&&k(0,"app-featured-deck-item",23),i&2){let e=r.$implicit;p("deck",e)}}function z(i,r){if(i&1&&(s(0,"div",24),g(1),a()),i&2){let e=l(3);d(),C(" ",e.deckTotal===e.decks.length?"\u5DF2\u7ECF\u5230\u5E95\u5566\uFF5E":"\u724C\u7EC4\u52A0\u8F7D\u4E2D..."," ")}}function $(i,r){if(i&1&&(s(0,"div",20),f(1,Y,1,1,"app-featured-deck-item",21)(2,z,2,1,"div",22),a()),i&2){let e=l(2);d(),p("ngForOf",e.decks),d(),p("ngIf",e.deckTotal>e.SIZE)}}function ee(i,r){if(i&1){let e=x();s(0,"div",13)(1,"div",14,0),f(3,R,3,3,"div",15),a(),s(4,"div",16,1),_("scroll",function(){m(e);let t=F(5),o=l();return u(o.loadMoreDecks(t))}),s(6,"div",17)(7,"div",18),_("click",function(){m(e);let t=l();return u(t.clickSecondaryTitle(-1))}),g(8,"\u5168\u90E8"),a(),f(9,K,2,3,"div",15),a(),f(10,$,3,2,"div",19),a()()}if(i&2){let e=l();v("container-with-header",e.header.isHeaderVisible),d(3),p("ngForOf",e.topics),d(4),v("active-title",e.chosenCategories.secondaryIndex===-1),d(2),p("ngForOf",e.topics[e.chosenCategories.firstIndex].categories),d(),p("ngIf",!e.isError&&(!e.isDecksLoading||e.deckTotal))}}function te(i,r){if(i&1&&(s(0,"h2",25),g(1),a()),i&2){let e=l();d(),E(e.topicTitle)}}function ie(i,r){if(i&1){let e=x();s(0,"button",26),_("click",function(){m(e);let t=l();return u(t.navigation.openApp())}),g(1,"\u6253\u5F00 APP"),a()}}var ne="iVBORw0K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=class r{constructor(){this.title=h(S),this.bridge=h(G),this.pages=h(L),this.header=h(B),this.navigation=h(N),this.topicTitle="",this.SIZE=30,this.isConfigLoading=!0,this.isDecksLoading=!0,this.topics=[],this.chosenCategories={firstIndex:0,secondaryIndex:-1},this.decks=[],this.deckTotal=0,this.isError=!1}ngOnInit(){this.bridge.isInBridgeEnv&&(this.header.hideHeader(),this.setNavButton()),this.getFeaturedTopics()}setNavButton(){return y(this,null,function*(){yield this.bridge.getUserAccessToken(),this.bridge.setNavButtons({buttons:[{id:"search",icon:ne,text_color:"text",folded:!1}],click_listener:n=>{n==="search"&&(location.href="/mobile/featured-decks/search?__open_mode=2")}}).then()})}getFeaturedTopics(){this.isConfigLoading=!0,this.pages.getFeaturedTopics().subscribe(n=>{this.topicTitle=n.data.title,this.title.setTitle(this.topicTitle);let t=n.data.topics,o=P(t,"parent_id");this.topics=t.filter(c=>!c.parent_id).sort((c,Z)=>c.order-Z.order).map(c=>I(D({},c),{categories:V(o[c.id],"order")})),this.isConfigLoading=!1,this.getDecksByCategory()})}getDecksByCategory(n=!1){return y(this,null,function*(){this.isDecksLoading=!0;let{firstIndex:t,secondaryIndex:o}=this.chosenCategories;try{let c=yield this.pages.getFeaturedDecks({topic_id:o===-1?this.topics[t].id:this.topics[t].categories[o].id,limit:this.SIZE,offset:this.decks.length}).toPromise();n&&(this.decks=[]),this.isDecksLoading=!1,this.decks.push(...c.data.decks),this.deckTotal=c.data.total}catch(c){console.error(c),this.isError=!0}})}loadMoreDecks(n){this.isDecksLoading||this.deckTotal===this.decks.length||Math.ceil(n.scrollTop+n.clientHeight)<n.scrollHeight||this.getDecksByCategory()}clickFirstTitle(n){this.chosenCategories.firstIndex=n,this.checkAndScroll(n),this.clickSecondaryTitle(-1)}checkAndScroll(n){if(!this.scrollContainer||!this.tabItems)return;let t=this.scrollContainer.nativeElement,o=this.tabItems.toArray()[n].nativeElement,c=o.offsetLeft-t.clientWidth/2+o.offsetWidth/2;t.scrollTo({left:c,behavior:"smooth"})}clickSecondaryTitle(n){this.decks=[],this.deckTotal=0,this.chosenCategories.secondaryIndex=n,this.getDecksByCategory(!0)}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=T({type:r,selectors:[["app-featured-decks"]],viewQuery:function(t,o){if(t&1&&(A(q,5),A(U,5)),t&2){let c;b(c=w())&&(o.scrollContainer=c.first),b(c=w())&&(o.tabItems=c)}},decls:5,vars:3,consts:[["scrollContainer",""],["main",""],["tabItems",""],["class","error-box loading-box",4,"ngIf"],["class","loading-box",4,"ngIf"],["class","featured-decks-container",3,"container-with-header",4,"ngIf"],["appHeaderContent","","contentPosition","center"],["appHeaderContent","","contentPosition","right"],[1,"error-box","loading-box"],["name","error"],[1,"retry-btn",3,"click"],[1,"loading-box"],["name","history-loading"],[1,"featured-decks-container"],[1,"first-titles"],[3,"active-title","click",4,"ngFor","ngForOf"],[1,"main",3,"scroll"],[1,"secondary-titles"],[3,"click"],["class","deck-list",4,"ngIf"],[1,"deck-list"],[3,"deck",4,"ngFor","ngForOf"],["class","loading-deck-tip",4,"ngIf"],[3,"deck"],[1,"loading-deck-tip"],[1,"absolute-center-title"],[1,"header-link-button",3,"click"]],template:function(t,o){t&1&&f(0,W,6,0,"div",3)(1,J,4,0,"div",4)(2,ee,11,7,"div",5)(3,te,2,1,"ng-template",6)(4,ie,2,0,"ng-template",7),t&2&&(p("ngIf",o.isError),d(),p("ngIf",!o.isError&&(o.isConfigLoading||o.isDecksLoading&&!o.deckTotal)),d(),p("ngIf",!o.isConfigLoading))},dependencies:[M,j,O,H,Q,X],styles:['.featured-decks-container[_ngcontent-%COMP%]{width:100%;height:100%;background:var(--color-body-background)}.container-with-header[_ngcontent-%COMP%]{padding-top:var(--header-height)}.main[_ngcontent-%COMP%]{position:relative;height:calc(100% - 48px);overflow-y:scroll}.first-titles[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;overflow-x:scroll;padding:0 16px}.first-titles[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.first-titles[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:48px;margin:0 10px;white-space:nowrap;font-size:16px;line-height:48px}.active-title[_ngcontent-%COMP%]{color:var(--color-theme);text-shadow:0 0 .4px var(--color-theme),0 0 .4px var(--color-theme)}.first-titles[_ngcontent-%COMP%] .active-title[_ngcontent-%COMP%]{position:relative}.first-titles[_ngcontent-%COMP%] .active-title[_ngcontent-%COMP%]:after{position:absolute;
1left:5px;bottom:8px;display:inline-block;content:"";width:calc(100% - 10px);height:3px;background:var(--color-theme);border-radius:1.5px}.secondary-titles[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:12px 4px;padding:12px 16px;border-top:.5px solid var(--color-divider);border-bottom:.5px solid var(--color-divider)}.secondary-titles[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:28px;padding:0 10px;border-radius:8px;white-space:nowrap;font-size:15px;line-height:28px}.secondary-titles[_ngcontent-%COMP%] .active-title[_ngcontent-%COMP%]{background:var(--core-color-100)}.deck-list[_ngcontent-%COMP%]{padding-left:16px;padding-bottom:34px}.loading-deck-tip[_ngcontent-%COMP%]{height:40px;line-height:40px;text-align:center;font-size:11px;color:var(--color-secondary-text)}.loading-box[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;background:var(--color-body-background);display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0 auto;color:var(--color-disabled-text2)}.loading-box[_ngcontent-%COMP%] markji-icon[_ngcontent-%COMP%]{width:56px;height:56px;margin-top:4px}.error-box[_ngcontent-%COMP%]{margin-top:-50px}.retry-btn[_ngcontent-%COMP%]{position:relative;z-index:99;margin-top:16px;padding:6px 12px;background:var(--color-body-background-2);color:var(--color-theme);font-size:12px;font-weight:600;border:0}']});let i=r;return i})();export{ke as FeaturedDecksComponent}; 2//# sourceMappingURL=chunk-3EY32BJX.js.map
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.