1"use strict";(self.webpackChunkr_life=self.webpackChunkr_life||[]).push([[6917],{6917:(Xe,Z,m)=>{m.r(Z),m.d(Z,{ReadingListModule:()=>ge});var r=m(2881),e=m(1360),S=m(6111),P=m(5965),Lt=m(467),Rt=m(9377),tt=m(5566),x=m(8989),b=m(5976),T=function(s){return s.THIRD_PARTY_CLICK="3rd Party click",s.VIEW_FULL_TEXT_CTA="View full text CTA",s.DOWNLOAD="Download",s.ARTICLE_SHARE="Article share",s.ARTICLE_FEEDBACK="Article feedback",s.BOOKMARK="Bookmark",s.EXPORT_TO_RM="Export to reference manager",s.EXPORT_TO_RM_INTENT="Export to reference manager intent",s.COPY_DOI="Copy DOI",s.OPEN_DOI_LINK="Open DOI Link",s.VIEW_PDF="View PDF",s.ARTICLE_TRANSLATION="Article translation",s.GET_AUDIO="Get audio",s.PLAY_AUDIO="Play audio",s.SYNC_ENABLED="Sync enabled",s.GENERATE_FULL_TEXT_AUDIO="Generate full text audio",s.PLAY_FULL_TEXT_AUDIO="Play full text audio",s.READ_TRANSLATED_TEXT="Read translated text",s.CHECK_INSTITUTE_ACCESS="Check Institute access",s.ARTICLE_CITE="Article cite",s.CHAT_PDF="Chat PDF",s.ARTICLE_TRANSLATE="Article translate",s.DOWNLOAD_REFERENCES="Download references",s.EXPORT_EXCEL="Export Excel",s.SIMILAR_ARTICLES="Similar articles",s.EXPORT_SEARCH_RESULTS="Export search results",s.EXPORT_ASK_RDISCOVERY_RESULTS="Export Ask R Discovery results",s.SAVE_SEARCH="Save search",s.LIST_SAVE_SEARCH="List save search",s.ARTICLE_CLICK_TOP_PAPER="Article click top paper feed",s.ARTICLE_CLICK_OPEN_ACCESS="Article click open access feed",s.ARTICLE_CLICK_PAYWALL="Article click paywall feed",s.ARTICLE_CLICK_JUST_PUBLISHED="Article click just published feed",s.ARTICLE_CLICK_PREPRINT="Article click preprint feed",s.ARTICLE_CLICK_CONFERENCE="Article click conference feed",s.ARTICLE_CLICK_JOURNAL="Article click journal feed",s.ARTICLE_CLICK_ASK_DISCOVERY_REFERENCE="Article click reference ask discovery",s.ARTICLE_CLICK_SEARCH="Article click search",s.ARTICLE_CLICK_REFERENCE="Article click reference",s.ARTICLE_CLICK_CITATION="Article click citation",s.ARTICLE_CLICK_SIMILAR="Article click similar",s.ARTICLE_CLICK_JOURNAL_CARD="Article click journal",s.ARTICLE_CLICK_TOPIC_PAGE="Article click topic page",s.ARTICLE_CLICK_QUESTION_PAGE="Article click question page",s.FOLLOW_READING_LIST="Follow reading list",s.SHARE_READING_LIST="Share reading list",s.FEATURE_FEEDBACK="Feature feedback",s.FEATURE_FEEDBACK_ASK_R_DISCOVERY="Feature feedback Ask R Discovery",s.COPY_TO_CLIPBOARD="Copy to clipboard",s.CHAT_RELATED_QUESTION="Chat related question",s.FEATURE_FEEDBACK_CHAT_PDF="Feature feedback chat PDF",s.ADD_JOURNAL="Add journal",s.ARTICLE_CLICK_PUBLIC_READING_LIST="Article click public reading list",s.GRAPH_NODE_CLICK="Graph node click",s.GRAPH_NODE_CLICK_ARTICLE="Graph node click article",s.GRAPH_FULL_VIEW="Graph full view",s.GRAPH_VIEW_GRAPH="Graph view graph",s.GRAPH_ADD_PARENT="Graph add parent",s.NOTES_START_CLICK="Notes start click",s.NOTES_ADD_NEW="Notes add new",s.NOTES_SIGN_IN="Notes sign in",s.NOTES_SAVED="Notes saved",s.NOTES_LEARN_MORE="Notes learn more",s.ASK_DISCOVERY_SAMPLE_QUESTION="Ask Discovery Sample Question",s.ASK_DISCOVERY_QUESTION_ASKED="Ask Discovery Question Asked",s.LITERATURE_REVIEW_SAMPLE_QUESTION="Literature Review Sample Question",s.LITERATURE_REVIEW_QUESTION_ASKED="Literature Review Question Asked",s.LITERATURE_REVIEW_ADD_COLUMN="Literature Review Add Column",s.LITERATURE_REVIEW_EXPORT="Literature Review Export",s.LITERATURE_REVIEW_FILTER="Literature Review Filter",s.LITERATURE_REVIEW_SORT="Literature Review Sort",s.LITERATURE_REVIEW_LOAD_MORE="Literature Review Load More",s.ASK_DISCOVERY_ASK_QUESTION="Ask Discovery Ask Question",s.ASK_DISCOVERY_INPUT_QUESTION="Ask Discovery Input Question",s.CHAT_PDF_INPUT_QUESTION="Chat PDF Input Question",s.CHAT_PDF_SAMPLE_QUESTION="Chat PDF Sample Question",s.CHAT_PDF_RELATED_QUESTION="Chat PDF Related Question",s.CHAT_PDF_EXPLAIN_TEXT="Chat PDF Explain Text",s.FULL_TEXT="Full text",s.CITE_GENERATION_COPY="Cite generation copy",s.CITE_GENERATION_EXPORT="Cite generation export",s.CITE_GENERATION_NEW_GROUP="Cite generation new group",s.CITE_GENERATION_CITE="Cite generation cite",s}(T||{});let k=(()=>{class s{constructor(a,c,d,f,g,y){this.analyticsService=a,this.platformId=c,this.http=d,this.environment=f,this.authService=g,this.userService=y,this.isBrowser=(0,Rt.UE)(this.platformId),this.trackingTimeKey="goalTrackingDateTime"}isAllowTracking(){if(this.isBrowser){const a=localStorage.getItem(this.trackingTimeKey);if(null===a||this.isGreaterThanTwoHours(new Date(a)))return localStorage.setItem(this.trackingTimeKey,(new Date).toISOString()),!0}return!1}isGreaterThanTwoHours(a){return((new Date).getTime()-a.getTime())/36e5>=2}trackEvent(a){this.isAllowTracking()?(this.analyticsService.reportSyncCall("Goal tracking",{"useful session":!0,"useful activity":a}),this.sendGoalTrackingEventToBackend(a,!0)):this.sendGoalTrackingEventToBackend(a,!1)}sendGoalTrackingEventToBackend(a){var c=this;return(0,Lt.A)(function*(d,f=!1){const g=localStorage.getItem(c.trackingTimeKey),y=c.authService.isUserLoggedIn(c.environment.auth.accessToken);y||(yield c.userService.setGuestTokenCookieForDiscovery(c.environment.cookieGuestToken)),c.http.post(`${c.environment.api.rDiscovery.default}${y?"user":"device"}/user-activity`,{activity:d,activity_meta:{"useful session":f,"useful activity":d},is_goal_tracked:f,time_spent_ms:g?(new Date).getTime()-new Date(g).getTime():0},{headers:{enableDeviceId:"true","X-CLEVERTAP-ID":window?.clevertap?.getCleverTapID()||"","X-DEVICE-PLATFORM":"web",enableGuestToken:y?"false":"true"}}).subscribe({error:()=>{throw new Error("Failed to send goal tracking event to backend")}})}).apply(this,arguments)}static{this.\u0275fac=function(c){return new(c||s)(e.KVO(P.MM),e.KVO(e.Agw),e.KVO(x.Qq),e.KVO("environment"),e.KVO(b.u),e.KVO(tt.DL))}}static{this.\u0275prov=e.jDH({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var V=m(8536);const Tt=s=>({loading:s});function Nt(s,h){1&s&&e.nrm(0,"img",20)}function A(s,h){1&s&&e.nrm(0,"img",21)}function N(s,h){if(1&s){const a=e.RV6();e.j41(0,"li")(1,"div",14)(2,"div",15)(3,"input",16),e.bIt("click",function(d){const f=e.eBV(a).$implicit,g=e.XpG(2);return e.Njj(g.onChangeCheckBox(f,d))}),e.k0s(),e.j41(4,"span",17),e.EFF(5),e.j41(6,"span"),e.EFF(7),e.k0s(),e.DNE(8,Nt,1,0,"img",18)(9,A,1,0,"img",19),e.k0s()()()()}if(2&s){const a=h.$implicit;e.R7$(3),e.Y8G("checked",!!a.checked&&a.checked),e.R7$(2),e.SpI("",a.name," "),e.R7$(2),e.SpI(" (",a.articles_count,")"),e.R7$(),e.Y8G("ngIf",a.is_private),e.R7$(),e.Y8G("ngIf",!a.is_private)}}function G(s,h){1&s&&e.nrm(0,"span",22)}function C(s,h){if(1&s){const a=e.RV6();e.qex(0),e.j41(1,"h3"),e.EFF(2,"Save to list"),e.k0s(),e.j41(3,"button",7),e.bIt("click",function(){e.eBV(a);const d=e.XpG();return e.Njj(d.createNewList())}),e.EFF(4," New List "),e.nrm(5,"img",8),e.k0s(),e.j41(6,"ul",9),e.DNE(7,N,10,5,"li",10),e.k0s(),e.j41(8,"div",11)(9,"button",12),e.bIt("click",function(){e.eBV(a);const d=e.XpG();
1return e.Njj(d.onSubmitForm())}),e.DNE(10,G,1,0,"span",13),e.EFF(11," Done "),e.k0s()(),e.bVm()}if(2&s){const a=e.XpG();e.R7$(7),e.Y8G("ngForOf",null==a.result?null:a.result.reading_lists),e.R7$(2),e.Y8G("disabled",a.buttonLoader||a.isButtonDisabled)("ngClass",e.eq3(4,Tt,a.buttonLoader)),e.R7$(),e.Y8G("ngIf",a.buttonLoader)}}function M(s,h){1&s&&(e.j41(0,"div",23),e.nrm(1,"h3")(2,"p")(3,"div",24)(4,"div",24)(5,"div",25),e.k0s())}let Gt=(()=>{class s{constructor(a,c,d,f){this.readingListService=a,this.discoverySnackbarService=c,this.analyticsService=d,this.goalTrackingService=f,this.loaderState=!0,this.buttonLoader=!1,this.outPutEvent=new e.bkB,this.closePoupEvent=new e.bkB}ngOnInit(){this.readingListService.getReadingList().toPromise().then(a=>{this.result=a.data,this.loaderState=!1,this.result.reading_lists.forEach(c=>c.last_selected?(c.checked=!0,c):(c.checked=!1,c))}),document.body.classList.add("no-scroll")}ngOnDestroy(){document.body.classList.remove("no-scroll")}onChangeCheckBox(a,c){1===this.result.reading_lists.filter(f=>f.checked).length&&a.checked?c.preventDefault():a.checked=!a.checked}onSubmitForm(){this.buttonLoader=!0;const a=this.result.reading_lists.map(d=>{if(d.checked)return d.id}).filter(d=>d),c=this.data?.actionQueryParams??null;this.readingListService.saveArticleOnReadingList(this.data?.id??"",{reading_list_ids:a},c).toPromise().then(d=>{this.buttonLoader=!1,this.fireArticleBookmarkCTEvent("Bookmark",a.length),this.discoverySnackbarService.show(this.data?.snackBar?.text??"Article saved to Library","success",{time:this.data?.snackBar?.duration}),this.readingListService.discoveryLibraryDotState.next(!0),this.goalTrackingService.trackEvent(T.BOOKMARK),this.outPutEvent.emit({status:"success",result:d})}).catch(d=>{this.fireArticleBookmarkCTEvent("Bookmark Failed",a.length),this.discoverySnackbarService.show("Something went wrong!","error",{time:this.data?.snackBar?.duration}),this.buttonLoader=!1,this.outPutEvent.emit({status:"error",result:d})})}createNewList(){this.outPutEvent.emit({type:"create-save",data:{id:this.data?.id,actionQueryParams:this.data?.actionQueryParams,snackBar:this.data?.snackBar}})}fireArticleBookmarkCTEvent(a,c){if(this.data?.CTEventData){const d={...this.data.CTEventData,"Number of reading lists":c};this.analyticsService.reportSyncCall(a,d)}}get isButtonDisabled(){return!(this.result.reading_lists.filter(a=>a.checked)?.length>0)}static{this.\u0275fac=function(c){return new(c||s)(e.rXU(V._),e.rXU(S.Z8),e.rXU(P.MM),e.rXU(k))}}static{this.\u0275cmp=e.VBU({type:s,selectors:[["spectrum-save-list"]],inputs:{data:"data"},outputs:{outPutEvent:"outPutEvent",closePoupEvent:"closePoupEvent"},standalone:!1,decls:10,vars:2,consts:[[1,"modal-wrapper"],[1,"modal-content"],[1,"modal-body"],[1,"close-icon",3,"click"],[1,"icon-wrapper"],[4,"ngIf"],["class","skeleton-loader",4,"ngIf"],[1,"add-btn",3,"click"],["src","https://cdn.researcher.life/discovery/icons/plus-blue.svg","width","12","height","12","alt",""],[1,"list-content"],[4,"ngFor","ngForOf"],[1,"btn-wrapper"],[3,"click","disabled","ngClass"],["class","loader",4,"ngIf"],[1,"check-sec"],[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"click","checked"],[1,"custom-control-label"],["src","https://cdn.researcher.life/rlife/icons/private-list-icon.svg","width","10","height","12","alt","",4,"ngIf"],["src","https://cdn.researcher.life/rlife/icons/public-list-icon.svg","width","12","height","12","alt","",4,"ngIf"],["src","https://cdn.researcher.life/rlife/icons/private-list-icon.svg","width","10","height","12","alt",""],["src","https://cdn.researcher.life/rlife/icons/public-list-icon.svg","width","12","height","12","alt",""],[1,"loader"],[1,"skeleton-loader"],[1,"checkbox"],[1,"cta"]],template:function(c,d){1&c&&(e.j41(0,"div")(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3),e.bIt("click",function(){return d.closePoupEvent.emit(!0)}),e.j41(5,"div",4),e.nrm(6,"span")(7,"span"),e.k0s()(),e.DNE(8,C,12,6,"ng-container",5)(9,M,6,0,"div",6),e.k0s()()()()),2&c&&(e.R7$(8),e.Y8G("ngIf",!d.loaderState),e.R7$(),e.Y8G("ngIf",d.loaderState))},dependencies:[r.YU,r.Sq,r.bT],styles:['.modal-wrapper[_ngcontent-%COMP%]{position:fixed;bottom:0;left:0;width:100%;height:100%;z-index:10000;display:flex;flex-direction:column-reverse}.modal-wrapper[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000000a3;z-index:0}.loader[_ngcontent-%COMP%]{width:18px;height:18px;border-radius:50%;display:inline-block;border-top:2px solid #fff;border-right:2px solid transparent;box-sizing:border-box;animation:_ngcontent-%COMP%_rotation 1s linear infinite;position:absolute}@keyframes _ngcontent-%COMP%_rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (min-width: 768px){.modal-wrapper[_ngcontent-%COMP%]{align-items:center;justify-content:center}}.modal-content[_ngcontent-%COMP%]{z-index:10;width:100%;background-color:#fff;border-top-left-radius:20px;border-top-right-radius:20px}@media (min-width: 768px){.modal-content[_ngcontent-%COMP%]{max-width:600px;max-height:calc(100vh - 180px);overflow:auto;border-radius:20px}}.modal-body[_ngcontent-%COMP%]{padding:30px;position:relative}.modal-body[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:20px;line-height:30px;margin-bottom:35px;color:#1d2747}.modal-body[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%]{border:0;display:inline-flex;align-items:center;justify-content:center;font-size:14px;line-height:20px;font-family:Inter Semibold;cursor:pointer;background:none;padding:0;color:#113dcd}.modal-body[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{margin-left:8px}.modal-body[_ngcontent-%COMP%] .list-content[_ngcontent-%COMP%]{margin-top:20px;margin-bottom:0;padding:0;list-style:none;max-height:264px;overflow:auto}.modal-body[_ngcontent-%COMP%] .list-content[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{padding-top:20px;padding-bottom:20px;border-top:1px solid #f0f2fa;border-bottom:1px solid #f0f2fa}.modal-body[_ngcontent-%COMP%] .list-content[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .check-sec[_ngcontent-%COMP%]{display:flex;align-items:center}.modal-body[_ngcontent-%COMP%] .list-content[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .check-sec[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{margin-right:10px}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%]{margin-top:30px}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{max-width:340px;height:40px;
1display:flex;align-items:center;justify-content:center;background:#113ecd;color:#fff;cursor:pointer;width:100%;border-radius:10px;margin:0 auto;font-family:Inter Semibold;font-size:14px;transition:.3s all ease-in-out;border:0}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%] button.loading[_ngcontent-%COMP%]{color:transparent;opacity:.7;cursor:not-allowed;position:relative}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{box-shadow:0 20px 25px -5px #0000001a,0 10px 10px -5px #0000000a;transition:.3s all ease-in-out}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{background:#c4d0f8;pointer-events:none;cursor:default}.close-icon[_ngcontent-%COMP%]{width:14px;height:14px;position:absolute;right:30px;top:30px;cursor:pointer}.custom-control-label[_ngcontent-%COMP%]{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label[_ngcontent-%COMP%]:before{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;pointer-events:none;content:"";background-color:#fff;border:1px solid #adb5bd;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.custom-control-label[_ngcontent-%COMP%]:after{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:"";background:50%/50% 50% no-repeat}.custom-control[_ngcontent-%COMP%]{position:relative;z-index:1;display:block;min-height:1.5rem;padding-left:1.5rem}.custom-control.custom-checkbox[_ngcontent-%COMP%]{position:relative;padding-left:0}.custom-control.custom-checkbox[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]{position:absolute;left:0;width:100%;height:100%;opacity:0;cursor:pointer;z-index:1}.custom-control.custom-checkbox[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]{padding-left:34px;position:relative;width:100%;display:flex;justify-content:space-between;font-size:16px;line-height:20px;color:#1d2747;align-items:center}.custom-control.custom-checkbox[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-left:5px;margin-right:5px;color:#727ea3}.custom-control.custom-checkbox[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before{width:18px;height:18px;border:1px solid #113ecd;top:2px;left:0;border-radius:4px;background-color:#fff}.custom-control.custom-checkbox[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:after{width:18px;height:18px;border:0px solid #ffffff;top:2px;left:0;border-radius:4px;background:url(https://cdn.researcher.life/rlife/icons/check-white.svg) no-repeat center center #113dcd;background-size:10px;opacity:0}.custom-control.custom-checkbox[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:checked ~ .custom-control-label[_ngcontent-%COMP%]:after{opacity:1}.skeleton-loader[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .skeleton-loader[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .skeleton-loader[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%], .skeleton-loader[_ngcontent-%COMP%] .cta[_ngcontent-%COMP%]{background-color:#f2f2f2;border-radius:4px;height:20px;margin-bottom:10px;position:relative;animation:_ngcontent-%COMP%_shimmer 1s infinite}.skeleton-loader[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{width:110px;height:30px;margin-bottom:35px}.skeleton-loader[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:80px;height:20px;margin-bottom:20px}.skeleton-loader[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%]{height:24px;margin:20px 0;width:50%}.skeleton-loader[_ngcontent-%COMP%] .cta[_ngcontent-%COMP%]{width:100%;max-width:340px;height:40px;margin-left:auto;margin-right:auto;margin-top:30px}@keyframes _ngcontent-%COMP%_shimmer{0%{background-color:#f2f2f2}50%{background-color:#e6e6e6}to{background-color:#f2f2f2}}']})}}return s})();var v=m(9417);const et=s=>({active:s}),B=s=>({loading:s});function nt(s,h){1&s&&(e.j41(0,"span",20),e.EFF(1,"Only 50 allowed"),e.k0s())}function ot(s,h){if(1&s&&(e.j41(0,"span",20),e.EFF(1),e.k0s()),2&s){const a=e.XpG(3);e.R7$(),e.JRh(a.formControl.input.errors.error)}}function it(s,h){if(1&s&&(e.j41(0,"div",18),e.DNE(1,nt,2,0,"span",19)(2,ot,2,1,"span",19),e.k0s()),2&s){const a=e.XpG(2);e.R7$(),e.Y8G("ngIf",a.formControl.input.errors.maxlength),e.R7$(),e.Y8G("ngIf",a.formControl.input.errors.error)}}function rt(s,h){1&s&&(e.j41(0,"span",20),e.EFF(1,"Only 80 allowed"),e.k0s())}function st(s,h){if(1&s&&(e.j41(0,"div",18),e.DNE(1,rt,2,0,"span",19),e.k0s()),2&s){const a=e.XpG(3);e.R7$(),e.Y8G("ngIf",a.formControl.desc.errors.maxlength)}}function at(s,h){if(1&s&&(e.qex(0),e.j41(1,"div",8)(2,"label"),e.EFF(3,"Description "),e.j41(4,"span"),e.EFF(5),e.k0s()(),e.nrm(6,"textarea",21),e.DNE(7,st,2,1,"div",10),e.k0s(),e.bVm()),2&s){let a;const c=e.XpG(2);e.R7$(5),e.SpI(" ",null!==(a=null==c.formControl.desc.value?null:c.formControl.desc.value.length)&&void 0!==a?a:0,"/80"),e.R7$(2),e.Y8G("ngIf",c.formControl.desc.invalid&&(c.formControl.desc.dirty||c.formControl.desc.touched))}}function F(s,h){1&s&&e.nrm(0,"span",25)}function lt(s,h){if(1&s){const a=e.RV6();e.qex(0),e.j41(1,"div",22)(2,"button",23),e.bIt("click",function(){e.eBV(a);const d=e.XpG(2);
1return e.Njj(d.submitForm())}),e.DNE(3,F,1,0,"span",24),e.EFF(4," Create "),e.k0s()(),e.bVm()}if(2&s){const a=e.XpG(2);e.R7$(2),e.Y8G("ngClass",e.eq3(3,B,a.buttonLoader))("disabled",!(null!=a.form&&a.form.valid)||a.buttonLoader),e.R7$(),e.Y8G("ngIf",a.buttonLoader)}}function ct(s,h){1&s&&e.nrm(0,"span",25)}function dt(s,h){if(1&s){const a=e.RV6();e.j41(0,"span",27),e.bIt("click",function(){e.eBV(a);const d=e.XpG(3);return e.Njj(d.deleteList())}),e.nrm(1,"img",28),e.EFF(2," Delete list"),e.k0s()}}function ut(s,h){if(1&s){const a=e.RV6();e.qex(0),e.j41(1,"div",22)(2,"button",23),e.bIt("click",function(){e.eBV(a);const d=e.XpG(2);return e.Njj(d.submitForm())}),e.DNE(3,ct,1,0,"span",24),e.EFF(4," Save & continue "),e.k0s()(),e.DNE(5,dt,3,0,"span",26),e.bVm()}if(2&s){const a=e.XpG(2);e.R7$(2),e.Y8G("ngClass",e.eq3(4,B,a.buttonLoader))("disabled",!(null!=a.form&&a.form.valid)||a.buttonLoader),e.R7$(),e.Y8G("ngIf",a.buttonLoader),e.R7$(2),e.Y8G("ngIf",a.showDelete)}}function Bt(s,h){if(1&s){const a=e.RV6();e.j41(0,"div",7)(1,"h3"),e.EFF(2),e.k0s(),e.j41(3,"div",8)(4,"label"),e.EFF(5,"Name "),e.j41(6,"span"),e.EFF(7),e.k0s()(),e.nrm(8,"input",9),e.k0s(),e.DNE(9,it,3,2,"div",10)(10,at,8,2,"ng-container",11),e.j41(11,"div",12)(12,"div",13),e.EFF(13," Make List Private "),e.j41(14,"span"),e.EFF(15,"(Only you can see this list)"),e.k0s()(),e.j41(16,"div",14)(17,"label",15)(18,"input",16),e.bIt("change",function(){e.eBV(a);const d=e.XpG();return e.Njj(d.openConfirmationPopup())}),e.k0s(),e.nrm(19,"span",17),e.k0s()()(),e.DNE(20,lt,5,5,"ng-container",11)(21,ut,6,6,"ng-container",11),e.k0s()}if(2&s){let a;const c=e.XpG();e.Y8G("formGroup",c.form),e.R7$(2),e.JRh("edit"===c.type?"Edit":"Create New List"),e.R7$(5),e.SpI(" ",null!==(a=null==c.formControl.input.value?null:c.formControl.input.value.length)&&void 0!==a?a:0,"/50"),e.R7$(2),e.Y8G("ngIf",c.formControl.input.invalid&&(c.formControl.input.dirty||c.formControl.input.touched)),e.R7$(),e.Y8G("ngIf","edit"===c.type),e.R7$(7),e.Y8G("ngClass",e.eq3(8,et,c.formControl.isPrivate.value)),e.R7$(3),e.Y8G("ngIf","create"===c.type),e.R7$(),e.Y8G("ngIf","edit"===c.type)}}function ht(s,h){1&s&&(e.j41(0,"div",29),e.nrm(1,"h3")(2,"p",30)(3,"div",31)(4,"p",30)(5,"div",32)(6,"p",33)(7,"div",34)(8,"p",35),e.k0s())}let U=(()=>{class s{constructor(a,c,d){this.readingListService=a,this.discoverySnackbarService=c,this.analyticsService=d,this.type="create",this.showDelete=!0,this.outPutEvent=new e.bkB,this.closePoupEvent=new e.bkB,this.loaderState=!0,this.buttonLoader=!1,this.checkbox={checked:!0}}ngOnInit(){this.form=new v.J3({input:new v.hs("",[v.k0.maxLength(50),v.k0.required]),desc:new v.hs("",v.k0.maxLength(80)),isPrivate:new v.hs(!1)}),document.body.classList.add("no-scroll"),"edit"!==this.type||["delete-list","success-response"].includes(this.data?.type)?(["delete-list","success-response"].includes(this.data?.type)&&this.patchValue(this.data),this.loaderState=!1):this.readingListService.getReadingListById(this.data.id).toPromise().then(a=>{this.loaderState=!1;const{data:c}=a;this.patchValue(c)})}ngOnDestroy(){document.body.classList.remove("no-scroll")}patchValue(a){this.form?.patchValue({input:a.name,desc:a.description,isPrivate:a.is_private})}get formControl(){return this.form?.controls}submitForm(){let a={name:this.form?.controls.input.value,is_private:this.form?.controls.isPrivate.value};if("create"===this.type)return this.buttonLoader=!0,"create-move"===this.data?.type?this.createReadingList(a).then(d=>{this.readingListService.moveMultipleReadingList({from_reading_list_id:this.data.from_reading_list_id,to_reading_list_id:d.data.id,selected_article_ids:this.data.selected_article_ids},this.data.selected_article_ids?.length?"multiple":"all").toPromise().then(f=>{this.buttonLoader=!1,this.discoverySnackbarService.show(this.data?.snackBar?.text??"Moved Successfully","success",{time:this.data?.snackBar?.duration}),this.outPutEvent.emit({type:this.type,status:"success",result:f})})}).catch(({error:d})=>{this.buttonLoader=!1,d?.message?this.form?.controls.input.setErrors({error:d.message}
1):this.outPutEvent.emit({type:this.type,status:"error",result:d})}):this.data?.id?void this.createReadingList(a).then(d=>{this.readingListService.saveArticleOnReadingList(this.data.id,{reading_list_ids:[d.data.id]},this.data?.actionQueryParams??null).toPromise().then(g=>{this.buttonLoader=!1,this.discoverySnackbarService.show(this.data?.snackBar?.text??"Article saved to Library","success",{time:this.data?.snackBar?.duration}),this.readingListService.discoveryLibraryDotState.next(!0),this.outPutEvent.emit({type:this.data.type?this.data.type:this.type,status:"success",result:g})}).catch(g=>{this.buttonLoader=!1,this.discoverySnackbarService.show("Something went wrong!","error",{time:3e3}),this.outPutEvent.emit({type:this.data.type?this.data.type:this.type,status:"error",result:g})})}).catch(({error:d})=>{if(this.buttonLoader=!1,d?.errors&&d.errors?.name)return this.form?.controls.input.setErrors({error:d.errors.name.shift()}),void this.form?.controls.input.markAsTouched({onlySelf:!0});this.outPutEvent.emit({type:this.data.type?this.data.type:this.t
1ype,status:"error",result:d})}):this.createReadingList(a).then(d=>{this.buttonLoader=!1,this.outPutEvent.emit({type:this.type,status:"success",result:d})}).catch(({error:d})=>{if(this.buttonLoader=!1,d?.errors&&d.errors?.name)return this.form?.controls.input.setErrors({error:d.errors.name.shift()}),void this.form?.controls.input.markAsTouched({onlySelf:!0});this.outPutEvent.emit({type:this.type,status:"error",result:d})});this.buttonLoader=!0,a={...a,description:this.form?.controls.desc.value};const c={"Entity Type":"Reading List","Entity Title":a.name,"Entity Id":this.data.id};return this.readingListService.updateReadingList(this.data.id,a).toPromise().then(d=>{this.fireCTEvent("Update",{Success:"true",...c}),this.buttonLoader=!1,this.outPutEvent.emit({type:this.type,status:"success",result:d})}).catch(({error:d})=>{if(this.fireCTEvent("Update",{Success:"false",...c}),this.buttonLoader=!1,d?.errors&&d.errors?.name)return this.form?.controls.input.setErrors({error:d.errors.name.shift()}),void this.form?.controls.input.markAsTouched({onlySelf:!0});this.outPutEvent.emit({type:this.type,status:"error",result:d})})}createReadingList(a){const c={"Entity Type":"Reading List","Entity Title":a.name};return new Promise((d,f)=>{this.readingListService.createReadingList(a).toPromise().then(g=>{this.fireCTEvent("Create",{Success:"true",...c}),d(g)}).catch(g=>{this.fireCTEvent("Create",{Success:"false",...c}),f(g)})})}deleteList(){this.outPutEvent.emit({type:"delete-list",id:this.data.id,name:this.form?.value.input,description:this.form?.value.desc,is_private:this.form?.value.isPrivate})}openConfirmationPopup(){this.form?.value.isPrivate&&this.outPutEvent.emit({type:"success-response",name:this.form?.value.input,description:this.form?.value.desc,id:this.data?.id??null})}fireCTEvent(a="Click to track",c){this.analyticsService.reportSyncCall(a,c)}static{this.\u0275fac=function(c){return new(c||s)(e.rXU(V._),e.rXU(S.Z8),e.rXU(P.MM))}}static{this.\u0275cmp=e.VBU({type:s,selectors:[["spectrum-create-edit-list"]],inputs:{type:"type",data:"data",showDelete:"showDelete"},outputs:{outPutEvent:"outPutEvent",closePoupEvent:"closePoupEvent"},standalone:!1,decls:9,vars:2,consts:[[1,"modal-wrapper"],[1,"modal-content"],[1,"modal-body"],[1,"close-icon",3,"click"],[1,"icon-wrapper"],[3,"formGroup",4,"ngIf"],["class","skeleton-loader",4,"ngIf"],[3,"formGroup"],[1,"form-input"],["value","Create","type","text","formControlName","input"],["class","dc--error",4,"ngIf"],[4,"ngIf"],[1,"private-list"],[1,"text"],[1,"switcher-wrap"],[1,"switch",3,"ngClass"],["type","checkbox","formControlName","isPrivate",3,"change"],[1,"slider"],[1,"dc--error"],["class","help-block",4,"ngIf"],[1,"help-block"],["rows","4","cols","50","placeholder","Add a relevant description","formControlName","desc"],[1,"btn-wrapper"],[3,"click","ngClass","disabled"],["class","loader",4,"ngIf"],[1,"loader"],["class","delete",3,"click",4,"ngIf"],[1,"delete",3,"click"],["src","https://cdn.researcher.life/discovery/icons/delete.svg","width","20","height","20","alt","delete"],[1,"skeleton-loader"],[1,"name"],[1,"input-title"],[1,"input-desp"],[1,"bottom-text"],[1,"cta"],[1,"delete"]],template:function(c,d){1&c&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.bIt("click",function(){return d.closePoupEvent.emit(!0)}),e.j41(4,"div",4),e.nrm(5,"span")(6,"span"),e.k0s()(),e.DNE(7,Bt,22,10,"div",5)(8,ht,9,0,"div",6),e.k0s()()()),2&c&&(e.R7$(7),e.Y8G("ngIf",!d.loaderState),e.R7$(),e.Y8G("ngIf",d.loaderState))},dependencies:[r.YU,r.bT,v.me,v.Zm,v.BC,v.cb,v.j4,v.JD],styles:['.modal-wrapper[_ngcontent-%COMP%]{position:fixed;bottom:0;left:0;width:100%;height:100%;z-index:10000;display:flex;flex-direction:column-reverse;font-family:Inter Regular}.modal-wrapper[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000000a3;z-index:0}@media (min-width: 768px){.modal-wrapper[_ngcontent-%COMP%]{align-items:center;justify-content:center}}.modal-content[_ngcontent-%COMP%]{z-index:10;width:100%;background-color:#fff;border-top-left-radius:.375rem;border-top-right-radius:.375rem}@media (min-width: 768px){.modal-content[_ngcontent-%COMP%]{max-width:600px;max-height:calc(100vh - 180px);overflow:auto;border-radius:.375rem}}.close-icon[_ngcontent-%COMP%]{width:14px;
1height:14px;position:absolute;right:30px;top:30px;cursor:pointer}.modal-body[_ngcontent-%COMP%]{position:relative;padding:30px;color:#1d2747}.modal-body[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:20px;line-height:30px;margin-bottom:20px}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%]{margin-top:30px}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{max-width:340px;height:40px;display:flex;align-items:center;justify-content:center;background:#113ecd;color:#fff;cursor:pointer;width:100%;border-radius:10px;margin:0 auto;font-family:Inter Semibold;font-size:14px;transition:.3s all ease-in-out;border:0}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%] button.loading[_ngcontent-%COMP%]{color:transparent;opacity:.7;cursor:not-allowed;position:relative}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{box-shadow:0 20px 25px -5px #0000001a,0 10px 10px -5px #0000000a;transition:.3s all ease-in-out}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{background:#c4d0f8;pointer-events:none;cursor:default}.loader[_ngcontent-%COMP%]{width:18px;height:18px;border-radius:50%;display:inline-block;border-top:2px solid #fff;border-right:2px solid transparent;box-sizing:border-box;animation:_ngcontent-%COMP%_rotation 1s linear infinite;position:absolute}@keyframes _ngcontent-%COMP%_rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.form-input[_ngcontent-%COMP%]{margin-bottom:20px}.form-input[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;font-size:14px;font-family:Inter Regular;color:#1d2747;line-height:20px;margin-bottom:8px}.form-input[_ngcontent-%COMP%] label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#a7afcc}.form-input[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .form-input[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;display:block;padding:16px 15px 14px;font-size:16px;line-height:20px;background:#f0f2fa;border-radius:10px;color:#1d2747;border:0;font-family:Inter Light}.learn-more-info[_ngcontent-%COMP%]{display:flex;background:#fff3d9;border-radius:8px;padding:11px;font-size:12px;margin-bottom:22px}.learn-more-info[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{margin-left:10px;color:#113ecd}.learn-more-info[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{margin-right:10.5px}.switch[_ngcontent-%COMP%]{position:relative;display:inline-block;width:44px;height:24px}.switch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{opacity:0;width:0;height:0}.slider[_ngcontent-%COMP%]{position:absolute;cursor:pointer;inset:0;background-color:#c4d0f8;transition:.4s;border-radius:34px}.slider[_ngcontent-%COMP%]:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;transition:.4s;border-radius:50%}input[_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]{background-color:#113dcd}input[_ngcontent-%COMP%]:focus + .slider[_ngcontent-%COMP%]{box-shadow:0 0 1px #113dcd}input[_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]:before{transform:translate(20px)}.private-list[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-top:32px}.private-list[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{font-size:14px;color:#1d2747;font-family:Inter Semibold}.private-list[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-left:8px;font-size:12px;color:#49547a;font-family:Inter Light}.dc--error[_ngcontent-%COMP%]{position:relative;top:-10px;font-size:12px;color:red}.delete[_ngcontent-%COMP%]{color:#727ea3;font-size:14px;display:flex;align-items:center;justify-content:center;gap:6px;margin-top:28px;cursor:pointer}.skeleton-loader[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .skeleton-loader[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .skeleton-loader[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{background-color:#f2f2f2;border-radius:4px;height:20px;margin-bottom:10px;position:relative;animation:_ngcontent-%COMP%_shimmer 1s infinite}.skeleton-loader[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{width:50px;height:30px;margin-bottom:20px}.skeleton-loader[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{width:40px}.skeleton-loader[_ngcontent-%COMP%] .input-title[_ngcontent-%COMP%]{height:50px}.skeleton-loader[_ngcontent-%COMP%] .input-desp[_ngcontent-%COMP%]{height:110px;margin-bottom:40px}.skeleton-loader[_ngcontent-%COMP%] .bottom-text[_ngcontent-%COMP%]{width:150px}.skeleton-loader[_ngcontent-%COMP%] .cta[_ngcontent-%COMP%]{height:40px;width:100%;max-width:340px;margin-left:auto;margin-right:auto;margin-top:24px}
1.skeleton-loader[_ngcontent-%COMP%] .delete[_ngcontent-%COMP%]{width:50px;margin-left:auto;margin-right:auto}@keyframes _ngcontent-%COMP%_shimmer{0%{background-color:#f2f2f2}50%{background-color:#e6e6e6}to{background-color:#f2f2f2}}']})}}return s})();function j(s,h){if(1&s&&(e.j41(0,"span",22),e.EFF(1),e.k0s()),2&s){const a=e.XpG().$implicit;e.R7$(),e.SpI("+",a.collaborator_count,"")}}function pt(s,h){1&s&&e.nrm(0,"img",23)}function $(s,h){1&s&&e.nrm(0,"img",24)}function ft(s,h){1&s&&e.nrm(0,"img",25)}function mt(s,h){if(1&s){const a=e.RV6();e.qex(0),e.j41(1,"div",12),e.bIt("click",function(){const d=e.eBV(a).$implicit,f=e.XpG(3);return e.Njj(f.moveToList(d))}),e.nrm(2,"span",13),e.j41(3,"div",14)(4,"h5",15),e.EFF(5),e.k0s(),e.j41(6,"div",16)(7,"p",17),e.EFF(8),e.DNE(9,j,2,1,"span",18),e.k0s(),e.DNE(10,pt,1,0,"img",19)(11,$,1,0,"img",20)(12,ft,1,0,"img",21),e.k0s()()(),e.bVm()}if(2&s){const a=h.$implicit;e.R7$(2),e.Y8G("ngClass",a.is_private?"private-icon":"public-icon"),e.R7$(3),e.JRh(a.name),e.R7$(3),e.SpI(" ",a.created_by," "),e.R7$(),e.Y8G("ngIf",a.collaborator_count),e.R7$(),e.Y8G("ngIf",1===a.collaborator_count),e.R7$(),e.Y8G("ngIf",2===a.collaborator_count),e.R7$(),e.Y8G("ngIf",a.collaborator_count>=3)}}function gt(s,h){if(1&s){const a=e.RV6();e.qex(0),e.j41(1,"p",8),e.bIt("click",function(){e.eBV(a);const d=e.XpG(2);return e.Njj(d.createNewList())}),e.EFF(2," New List "),e.nrm(3,"img",9),e.k0s(),e.j41(4,"div",10),e.DNE(5,mt,13,7,"ng-container",11),e.k0s(),e.bVm()}if(2&s){const a=e.XpG(2);e.R7$(5),e.Y8G("ngForOf",a.result)}}function X(s,h){if(1&s&&(e.j41(0,"p"),e.EFF(1),e.k0s()),2&s){const a=e.XpG(3);e.R7$(),e.E5c(" Moving ",null!=a.data&&a.data.id.length?null==a.data?null:a.data.id.length:"all"," item from ",null==a.currentItem?null:a.currentItem.name," to ",a.selectedItem.name," ")}}function I(s,h){if(1&s&&(e.j41(0,"div",26),e.DNE(1,X,2,3,"p",3),e.nrm(2,"span",27),e.k0s()),2&s){const a=e.XpG(2);e.R7$(),e.Y8G("ngIf",a.currentItem)}}function _t(s,h){if(1&s){const a=e.RV6();e.j41(0,"div")(1,"div",4)(2,"h4"),e.EFF(3," Move to "),e.nrm(4,"img",5),e.k0s(),e.j41(5,"span",6),e.bIt("click",function(){e.eBV(a);const d=e.XpG();return e.Njj(d.closePoupEvent.emit(!0))}),e.EFF(6,"Cancel"),e.k0s()(),e.DNE(7,gt,6,1,"ng-container",3)(8,I,3,1,"div",7),e.k0s()}if(2&s){const a=e.XpG();e.R7$(7),e.Y8G("ngIf",!a.apiLoaderState),e.R7$(),e.Y8G("ngIf",a.apiLoaderState)}}function Ct(s,h){1&s&&e.nrm(0,"div")}let vt=(()=>{class s{constructor(a,c,d){this.readingListService=a,this.discoverySnackbarService=c,this.analyticsService=d,this.loaderState=!0,this.apiLoaderState=!1,this.outPutEvent=new e.bkB,this.closePoupEvent=new e.bkB}ngOnInit(){this.readingListService.getReadingList("all").toPromise().then(a=>{this.result=a.data.reading_lists.filter(c=>c.id!==parseInt(this.data?.from_reading_list_id,10)?c:(this.currentItem=c,null)),this.loaderState=!1}),document.body.classList.add("no-scroll")}ngOnDestroy(){document.body.classList.remove("no-scroll")}createNewList(){this.outPutEvent.emit({type:"create-move",selected_article_ids:this.data?.id,from_reading_list_id:this.data?.from_reading_list_id})}moveToList(a){this.apiLoaderState=!0,this.selectedItem=a,this.readingListService.moveMultipleReadingList({selected_article_ids:this.data?.id??[],from_reading_list_id:this.data.from_reading_list_id??null,to_reading_list_id:a.id},this.data?.id?.length?"multiple":"all").toPromise().then(c=>{this.apiLoaderState=!1,this.fireMoveApiCTEvent(a.id,"true"),this.discoverySnackbarService.show("Moved Successfully","success"),this.outPutEvent.emit({status:"success",result:c})}).catch(c=>{this.apiLoaderState=!1,this.discoverySnackbarService.show("Something went wrong!","error"),this.fireMoveApiCTEvent(a.id,"false"),this.outPutEvent.emit({status:"error",result:c})})}fireMoveApiCTEvent(a,c){this.analyticsService.reportSyncCall("Move",{Success:c,"Entity Type":"Reading List Articles","Selected Items Count":this.data?.id?.length,"Moved from":this.data.from_reading_list_id??null,"Moved to":a})}static{this.\u0275fac=function(c){return new(c||s)(e.rXU(V._),e.rXU(S.Z8),e.rXU(P.MM))}}static{this.\u0275cmp=e.VBU({type:s,selectors:[["spectrum-move-list"]],inputs:{data:"data"},outputs:{outPutEvent:"outPutEvent",closePoupEvent:"closePoupEvent"},standalone:!1,decls:5,vars:2,consts:[[1,"modal-wrapper"],[1,"modal-content"],[1,"modal-body"],[4,"ngIf"],[1,"head"],["src","https://cdn.researcher.life/discovery/icons/move.svg","width","20","height","18","alt","move"],[1,"cancel",3,"click"],["class","loader-wrap",4,"ngIf"],[1,"new-list",3,"click"],["src","https://cdn.researcher.life/discovery/icons/plus-blue.svg","width","12","height","12","alt","add"],[1,"card-wrap"],[4,"ngFor","ngForOf"],[1,"move-card",3,"click"],[1,"icon",3,"ngClass"],[1,"card-info"],[1,"title"],[1,"author-wrap"],[1,"author"],["class","count",4,"ngIf"],["src","https://cdn.researcher.life/discovery/icons/avatar-count-one.svg",4,"ngIf"],["src","https://cdn.researcher.life/discovery/icons/avatar-count-two.svg",4,"ngIf"],["src","https://cdn.researcher.life/discovery/icons/avatar-count-three.svg",4,"ngIf"],[1,"count"],["src","https://cdn.researcher.life/discovery/icons/avatar-count-one.svg"],["src","https://cdn.researcher.life/discovery/icons/avatar-count-two.svg"],["src","https://cdn.researcher.life/discovery/icons/avatar-count-three.svg"],[1,"loader-wrap"],[1,"loader"]],template:function(c,d){1&c&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2),e.DNE(3,_t,9,2,"div",3)(4,Ct,1,0,"div",3),e.k0s()()()),2&c&&(e.R7$(3),e.Y8G("ngIf",!d.loaderState),e.R7$(),e.Y8G("ngIf",d.loaderState))},dependencies:[r.YU,r.Sq,r.bT],styles:['.modal-wrapper[_ngcontent-%COMP%]{position:fixed;bottom:0;left:0;width:100%;height:100%;z-index:10000;display:flex;flex-direction:column-reverse;font-family:Inter Regular}.modal-wrapper[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000000a3;z-index:0}@media (min-width: 768px){.modal-wrapper[_ngcontent-%COMP%]{align-items:center;justify-content:center}}.modal-content[_ngcontent-%COMP%]{z-index:10;width:100%;background-color:#fff;border-top-left-radius:.375rem;border-top-right-radius:.375rem}@media (min-width: 768px){.modal-content[_ngcontent-%COMP%]{max-width:580px;max-height:calc(100vh - 180px);overflow:auto;border-radius:.375rem}}.modal-body[_ngcontent-%COMP%]{position:relative;padding:30px 16px 14px}@media (min-width: 768px){.modal-body[_ngcontent-%COMP%]{padding:30px 30px 14px}}.head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:34px}h4[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;color:#1d2747;font-size:20px;margin:0}.cancel[_ngcontent-%COMP%]{color:#374266;font-size:14px;cursor:pointer}@media (max-width: 767px){.card-wrap[_ngcontent-%COMP%]{max-height:420px;overflow:auto}}.new-list[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;margin-bottom:24px;font-family:Inter Regular;color:#113dcd;cursor:pointer}.new-list[_ngcontent-%COMP%]:hover{color:#465bff}.move-card[_ngcontent-%COMP%]{border-radius:16px;border:1px #dce1f0 solid;padding:16px;margin-bottom:16px;display:flex;align-items:flex-start;gap:16px;cursor:pointer}.icon[_ngcontent-%COMP%]{width:28px;height:28px;background:#e0f1f9;border-radius:100px;flex-shrink:0}.title[_ngcontent-%COMP%]{color:#1d2747;font-size:16px;font-family:Inter Semibold;margin-bottom:8px}.author[_ngcontent-%COMP%]{color:#727ea3;font-size:14px;font-family:Inter Regular;margin:0}.private-icon[_ngcontent-%COMP%]{background-image:url(https://cdn.researcher.life/discovery/icons/locked.svg);background-repeat:no-repeat;background-position:center;background-size:20px}.public-icon[_ngcontent-%COMP%]{background-image:url(https://cdn.researcher.life/discovery/icons/public.svg);background-repeat:no-repeat;background-position:center;background-size:20px}.author-wrap[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.loader-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:25px}.loader-wrap[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:14px;font-family:Inter Medium}.loader[_ngcontent-%COMP%]{width:38px;height:38px;border-radius:50%;display:inline-block;border-top:2px solid #113dcd;border-right:2px solid transparent;box-sizing:border-box;animation:_ngcontent-%COMP%_rotation 1s linear infinite;margin-bottom:20px}@keyframes _ngcontent-%COMP%_rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}']})}}return s})();const _=s=>({loading:s});function E(s,h){1&s&&e.nrm(0,"span",12)}function bt(s,h){if(1&s){const a=e.RV6();e.j41(0,"div",7)(1,"h2"),e.EFF(2,"Are you sure you want to delete this list?"),e.k0s(),e.j41(3,"p"),e.EFF(4,"This will be permanently deleted"),e.k0s(),e.j41(5,"div",8)(6,"a",9),e.bIt("click",function(){e.eBV(a);const d=e.XpG();return e.Njj(d.closePoupEvent.emit(!0))}),e.EFF(7,"Cancel"),e.k0s(),e.j41(8,"button",10),e.bIt("click",function(){e.eBV(a);const d=e.XpG();return e.Njj(d.deleteList())}),e.DNE(9,E,1,0,"span",11),e.EFF(10," Delete "),e.k0s()()()}if(2&s){const a=e.XpG();e.R7$(8),e.Y8G("ngClass",e.eq3(3,_,a.buttonLoader))("disabled",a.buttonLoader),e.R7$(),e.Y8G("ngIf",a.buttonLoader)}}function de(s,h){1&s&&e.nrm(0,"span",12)}function ue(s,h){if(1&s){const a=e.RV6();e.j41(0,"div",13)(1,"h2"),e.EFF(2,"Make List Private"),e.k0s(),e.j41(3,"p"),e.EFF(4,"If others have saved this list it will be removed from their library"),e.k0s(),e.j41(5,"div",8)(6,"a",9),e.bIt("click",function(){e.eBV(a);const d=e.XpG();return e.Njj(d.closePoupEvent.emit(!0))}),e.EFF(7,"Cancel"),e.k0s(),e.j41(8,"button",10),e.bIt("click",function(){e.eBV(a);const d=e.XpG();return e.Njj(d.sharePublicorPrivate(!0))}),e.DNE(9,de,1,0,"span",11),e.EFF(10," Make Private "),e.k0s()()()}if(2&s){const a=e.XpG();e.R7$(8),e.Y8G("ngClass",e.eq3(3,_,a.buttonLoader))("disabled",a.buttonLoader),e.R7$(),e.Y8G("ngIf",a.buttonLoader)}}function yt(s,h){1&s&&e.nrm(0,"span",12)}function Mt(s,h){if(1&s){const a=e.RV6();e.j41(0,"div",14)(1,"h2"),e.EFF(2,"Are you sure you want to delete the selected papers?"),e.k0s(),e.j41(3,"div",8)(4,"a",9),e.bIt("click",function(){e.eBV(a);const d=e.XpG();return e.Njj(d.closePoupEvent.emit(!0))}),e.EFF(5,"Cancel"),e.k0s(),e.j41(6,"button",10),e.bIt("click",function(){e.eBV(a);const d=e.XpG();return e.Njj(d.deleteSelectedPaper())}),e.DNE(7,yt,1,0,"span",11),e.EFF(8," Delete "),e.k0s()()()}if(2&s){const a=e.XpG();e.R7$(6),e.Y8G("ngClass",e.eq3(3,_,a.buttonLoader))("disabled",a.buttonLoader),e.R7$(),e.Y8G("ngIf",a.buttonLoader)}}function H(s,h){if(1&s){const a=e.RV6();e.j41(0,"div",15)(1,"img",16),e.bIt("click",function(){e.eBV(a);const d=e.XpG();return e.Njj(d.closePoupEvent.emit(!0))}),e.k0s(),e.j41(2,"p"),e.EFF(3," Only "),e.nrm(4,"img",17),e.EFF(5," public lists can be shared on social media "),e.k0s(),e.j41(6,"span",18),e.EFF(7,"Make List Public"),e.k0s(),e.j41(8,"label",19)(9,"input",20),e.bIt("change",function(){e.eBV(a);const d=e.XpG();return e.Njj(d.sharePublicorPrivate())}),e.k0s(),e.nrm(10,"span",21),e.k0s()()}}let L=(()=>{class s{constructor(a,c){this.readingListService=a,this.analyticsService=c,this.type="delete-list",this.outPutEvent=ne
1w e.bkB,this.closePoupEvent=new e.bkB,this.buttonLoader=!1}ngOnInit(){"delete-list"===this.type&&this.fireCTEvent("Visibility",{"Element label":"Delete list",Section:"Reading list delete confirmation"}),document.body.classList.add("no-scroll")}ngOnDestroy(){document.body.classList.remove("no-scroll")}deleteList(){const a={"Entity Type":"Reading List","Entity Title":this.data?.name,"Entity Entity Id":this.data?.id};this.buttonLoader=!0,this.readingListService.deleteList(this.data.id).toPromise().then(c=>{this.fireCTEvent("Delete",{Success:"true",...a}),this.buttonLoader=!1,this.outPutEvent.emit({type:this.type,status:"success",result:c})}).catch(c=>{this.fireCTEvent("Delete",{Success:"false",...a}),this.buttonLoader=!1,this.outPutEvent.emit({type:this.type,status:"error",result:c})})}deleteSelectedPaper(){if(this.data?.undo)this.outPutEvent.emit({action:this.data?.undo,...this.data});else{const a={Success:"true","Entity Type":"Reading List Articles","Selected Items Count":this.data.article_ids.length,"Entity Title":this.data.name,"Entity Id":this.data.id};this.buttonLoader=!0,this.readingListService.deleteSelectedPaper(this.data.id,this.data.article_ids,this.data.article_ids.length?"multiple":"all").toPromise().then(c=>{this.fireCTEvent("Delete from reading list",a),this.buttonLoader=!1,this.outPutEvent.emit({type:this.type,status:"success",result:c})}).catch(c=>{this.fireCTEvent("Delete from reading list",{...a,Success:"false"}),this.buttonLoader=!1,this.outPutEvent.emit({type:this.type,status:"error",result:c})})}}sharePublicorPrivate(a=!1){"success-response"!==this.data.type?(this.buttonLoader=!0,this.readingListService.updateReadingList(this.data.id,{name:this.data.name,is_private:a,description:this.data.description}).toPromise().then(c=>{this.buttonLoader=!1,this.outPutEvent.emit({type:this.type,status:"success",result:c})}).catch(c=>{this.buttonLoader=!1,this.outPutEvent.emit({type:this.type,status:"error",result:c})})):this.outPutEvent.emit({type:this.data.type,...this.data})}fireCTEvent(a,c){this.analyticsService.reportSyncCall(a,c)}static{this.\u0275fac=function(c){return new(c||s)(e.rXU(V._),e.rXU(P.MM))}}static{this.\u0275cmp=e.VBU({type:s,selectors:[["spectrum-common-reading-list-popup"]],inputs:{type:"type",data:"data"},outputs:{outPutEvent:"outPutEvent",closePoupEvent:"closePoupEvent"},standalone:!1,decls:7,vars:4,consts:[[1,"modal-wrapper"],[1,"modal-content"],[1,"modal-body"],["class","delete-list",4,"ngIf"],["class","share-private",4,"ngIf"],["class","delete-selected-paper",4,"ngIf"],["class","share-public",4,"ngIf"],[1,"delete-list"],[1,"cta-wrap"],[1,"cancel",3,"click"],[1,"btn-primary",3,"click","ngClass","disabled"],["class","loader",4,"ngIf"],[1,"loader"],[1,"share-private"],[1,"delete-selected-paper"],[1,"share-public"],["src","https://cdn.researcher.life/rlife/icons/close.svg",1,"close",3,"click"],["src","https://cdn.researcher.life/rlife/icons/public-list-icon.svg","width","16","height","16","alt","public"],[1,"public-text"],[1,"switch"],["type","checkbox",3,"change"],[1,"slider"]],template:function(c,d){1&c&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2),e.DNE(3,bt,11,5,"div",3)(4,ue,11,5,"div",4)(5,Mt,9,5,"div",5)(6,H,11,0,"div",6),e.k0s()()()),2&c&&(e.R7$(3),e.Y8G("ngIf","delete-list"===d.type),e.R7$(),e.Y8G("ngIf","share-private"===d.type),e.R7$(),e.Y8G("ngIf","delete-selected-paper"===d.type),e.R7$(),e.Y8G("ngIf","share-public"===d.type))},dependencies:[r.YU,r.bT],styles:['.modal-wrapper[_ngcontent-%COMP%]{position:fixed;bottom:0;left:0;width:100%;height:100%;z-index:10000;display:flex;flex-direction:column-reverse;font-family:Inter Regular}.modal-wrapper[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000000a3;z-index:0}@media (min-width: 768px){.modal-wrapper[_ngcontent-%COMP%]{align-items:center;justify-content:center}}.modal-content[_ngcontent-%COMP%]{z-index:10;width:100%;background-color:#fff;border-top-left-radius:.375rem;border-top-right-radius:.375rem}@media (min-width: 768px){.modal-content[_ngcontent-%COMP%]{max-width:485px;max-height:calc(100vh - 180px);overflow:auto;border-radius:.375rem}
1.share-public-wrapper[_ngcontent-%COMP%] .modal-content[_ngcontent-%COMP%]{max-width:380px}}.modal-body[_ngcontent-%COMP%]{position:relative;padding:25px;text-align:center}h2[_ngcontent-%COMP%]{color:#374266;font-size:18px;font-family:Inter Semibold;max-width:375px;margin:auto auto 15px}p[_ngcontent-%COMP%]{color:#5e698f;font-size:16px;line-height:24px;font-family:Inter Regular;max-width:320px;margin:auto}.share-public[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#49547a;max-width:270px}.share-public[_ngcontent-%COMP%] p[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{display:inline-flex;width:16px;margin-top:-2px;margin-left:2px;margin-right:2px}.share-public[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{position:absolute;right:16px;top:16px;cursor:pointer}.public-text[_ngcontent-%COMP%]{color:#113dcd;font-size:16px;font-family:Inter Semibold;margin:15px auto;display:block}.cta-wrap[_ngcontent-%COMP%]{margin-top:30px;display:flex;align-items:center;justify-content:center;gap:35px}.cancel[_ngcontent-%COMP%]{color:#113dcd;font-size:14px;font-family:Inter Semibold;cursor:pointer}.btn-primary[_ngcontent-%COMP%]{min-width:120px;font-family:Inter Semibold;border-radius:8px;border:0;font-size:14px;padding:10px}.btn-primary.loading[_ngcontent-%COMP%]{color:transparent;opacity:.7;cursor:not-allowed;position:relative}.loader[_ngcontent-%COMP%]{width:18px;height:18px;border-radius:50%;display:inline-block;border-top:2px solid #fff;border-right:2px solid transparent;box-sizing:border-box;animation:_ngcontent-%COMP%_rotation 1s linear infinite;position:absolute;left:calc(50% - 9px)}@keyframes _ngcontent-%COMP%_rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.switch[_ngcontent-%COMP%]{position:relative;display:inline-block;width:44px;height:24px}.switch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{opacity:0;width:0;height:0}.slider[_ngcontent-%COMP%]{position:absolute;cursor:pointer;inset:0;background-color:#c4d0f8;transition:.4s;border-radius:34px}.slider[_ngcontent-%COMP%]:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;transition:.4s;border-radius:50%}input[_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]{background-color:#2196f3}input[_ngcontent-%COMP%]:focus + .slider[_ngcontent-%COMP%]{box-shadow:0 0 1px #2196f3}input[_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]:before{transform:translate(20px)}']})}}return s})();const Ut=s=>({loading:s}),Y=()=>({});function jt(s,h){1&s&&e.nrm(0,"img",22)}function $t(s,h){1&s&&e.nrm(0,"img",23)}function Xt(s,h){if(1&s){const a=e.RV6();e.j41(0,"li")(1,"div",16)(2,"div",17)(3,"input",18),e.bIt("click",function(d){const f=e.eBV(a).$implicit,g=e.XpG(2);return e.Njj(g.onChangeCheckBox(f,d))}),e.k0s(),e.j41(4,"span",19),e.EFF(5),e.j41(6,"span"),e.EFF(7),e.k0s(),e.DNE(8,jt,1,0,"img",20)(9,$t,1,0,"img",21),e.k0s()()()()}if(2&s){const a=h.$implicit;e.R7$(3),e.Y8G("checked",a.checked),e.R7$(2),e.SpI(" ",a.name," "),e.R7$(2),e.SpI("(",a.articles_count,")"),e.R7$(),e.Y8G("ngIf",a.is_private),e.R7$(),e.Y8G("ngIf",!a.is_private)}}function Ht(s,h){1&s&&e.nrm(0,"span",24)}function he(s,h){if(1&s){const a=e.RV6();e.qex(0),e.j41(1,"h3"),e.EFF(2,"Save to list"),e.k0s(),e.j41(3,"button",9),e.bIt("click",function(){e.eBV(a);const d=e.XpG();return e.Njj(d.openCreateList())}),e.EFF(4," New List "),e.nrm(5,"img",10),e.k0s(),e.j41(6,"ul",11),e.DNE(7,Xt,10,5,"li",12),e.k0s(),e.j41(8,"div",13)(9,"button",14),e.bIt("click",function(){e.eBV(a);const d=e.XpG();return e.Njj(d.onSubmitForm())}),e.DNE(10,Ht,1,0,"span",15),e.EFF(11," Done "),e.k0s()(),e.bVm()}if(2&s){const a=e.XpG();e.R7$(7),e.Y8G("ngForOf",null==a.result?null:a.result.reading_lists),e.R7$(2),e.Y8G("disabled",a.buttonLoader||a.isButtonDisabled)("ngClass",e.eq3(4,Ut,a.buttonLoader)),e.R7$(),e.Y8G("ngIf",a.buttonLoader)}}function pe(s,h){1&s&&(e.j41(0,"div",25),e.nrm(1,"h3")(2,"p")(3,"div",26)(4,"div",26)(5,"div",27),e.k0s())}function fe(s,h){if(1&s){const a=e.RV6();e.j41(0,"spectrum-create-edit-list",28),e.bIt("outPutEvent",function(d){e.eBV(a);const f=e.XpG();return e.Njj(f.onCreateListEvent(d))})("closePoupEvent",function(){e.eBV(a);const d=e.XpG();return e.Njj(d.onCreateListClose())}),e.k0s()}2&s&&e.Y8G("type","create")("data",e.lJ4(3,Y))("showDelete",!1)}let me=(()=>{class s{constructor(a,c,d){this.readingListService=a,this.discoverySnackbarService=c,this.goalTrackingService=d,this.articleIds=[],this.closePopup=new e.bkB,this.saveSuccess=new e.bkB,this.loaderState=!0,this.buttonLoader=!1,this.showCreateList=!1}ngOnInit(){document.body.classList.add("no-scroll"),this.fetchReadingLists()}ngOnDestroy(){document.body.classList.remove("no-scroll")}
1fetchReadingLists(){this.readingListService.getReadingList().toPromise().then(a=>{this.result=a.data,this.loaderState=!1,this.result.reading_lists.forEach(c=>{c.checked=!!c.last_selected})})}onChangeCheckBox(a,c){1===this.result.reading_lists.filter(f=>f.checked).length&&a.checked?c.preventDefault():a.checked=!a.checked}get isButtonDisabled(){return!(this.result?.reading_lists?.filter(a=>a.checked)?.length>0)}openCreateList(){this.showCreateList=!0}onCreateListClose(){this.showCreateList=!1}onCreateListEvent(a){if("success"!==a?.status)return;const c=a.result?.data?.id;c&&this.saveToReadingLists([c])}onSubmitForm(){if(this.isButtonDisabled||!this.articleIds.length)return;const a=this.result.reading_lists.filter(c=>c.checked).map(c=>c.id);this.saveToReadingLists(a)}saveToReadingLists(a){this.buttonLoader=!0,this.readingListService.saveMultipleArticlesToReadingList({article_ids:this.articleIds,reading_list_ids:a}).toPromise().then(()=>{this.buttonLoader=!1,this.readingListService.discoveryLibraryDotState.next(!0),this.goalTrackingService.trackEvent(T.BOOKMARK),this.discoverySnackbarService.show(`${this.articleIds.length} paper${this.articleIds.length>1?"s":""} saved to Library`,"success"),this.saveSuccess.emit(this.articleIds),this.closePopup.emit()}).catch(()=>{this.buttonLoader=!1,this.discoverySnackbarService.show("Something went wrong!","error")})}static{this.\u0275fac=function(c){return new(c||s)(e.rXU(V._),e.rXU(S.Z8),e.rXU(k))}}static{this.\u0275cmp=e.VBU({type:s,selectors:[["spectrum-multi-save-list"]],inputs:{articleIds:"articleIds"},outputs:{closePopup:"closePopup",saveSuccess:"saveSuccess"},standalone:!1,decls:11,vars:4,consts:[[3,"hidden"],[1,"modal-wrapper"],[1,"modal-content"],[1,"modal-body"],[1,"close-icon",3,"click"],[1,"icon-wrapper"],[4,"ngIf"],["class","skeleton-loader",4,"ngIf"],[3,"type","data","showDelete","outPutEvent","closePoupEvent",4,"ngIf"],[1,"add-btn",3,"click"],["src","https://cdn.researcher.life/discovery/icons/plus-blue.svg","width","12","height","12","alt",""],[1,"list-content"],[4,"ngFor","ngForOf"],[1,"btn-wrapper"],[3,"click","disabled","ngClass"],["class","loader",4,"ngIf"],[1,"check-sec"],[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"click","checked"],[1,"custom-control-label"],["src","https://cdn.researcher.life/rlife/icons/private-list-icon.svg","width","10","height","12","alt","",4,"ngIf"],["src","https://cdn.researcher.life/rlife/icons/public-list-icon.svg","width","12","height","12","alt","",4,"ngIf"],["src","https://cdn.researcher.life/rlife/icons/private-list-icon.svg","width","10","height","12","alt",""],["src","https://cdn.researcher.life/rlife/icons/public-list-icon.svg","width","12","height","12","alt",""],[1,"loader"],[1,"skeleton-loader"],[1,"checkbox"],[1,"cta"],[3,"outPutEvent","closePoupEvent","type","data","showDelete"]],template:function(c,d){1&c&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),e.bIt("click",function(){return d.closePopup.emit()}),e.j41(5,"div",5),e.nrm(6,"span")(7,"span"),e.k0s()(),e.DNE(8,he,12,6,"ng-container",6)(9,pe,6,0,"div",7),e.k0s()()()(),e.DNE(10,fe,1,4,"spectrum-create-edit-list",8)),2&c&&(e.Y8G("hidden",d.showCreateList),e.R7$(8),e.Y8G("ngIf",!d.loaderState),e.R7$(),e.Y8G("ngIf",d.loaderState),e.R7$(),e.Y8G("ngIf",d.showCreateList))},dependencies:[r.YU,r.Sq,r.bT,U],styles:['.modal-wrapper[_ngcontent-%COMP%]{position:fixed;bottom:0;left:0;width:100%;height:100%;z-index:10000;display:flex;flex-direction:column-reverse}.modal-wrapper[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000000a3;z-index:0}.loader[_ngcontent-%COMP%]{width:18px;height:18px;border-radius:50%;display:inline-block;border-top:2px solid #fff;border-right:2px solid transparent;box-sizing:border-box;animation:_ngcontent-%COMP%_rotation 1s linear infinite;position:absolute}@keyframes _ngcontent-%COMP%_rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (min-width: 768px){.modal-wrapper[_ngcontent-%COMP%]{align-items:center;justify-content:center}}.modal-content[_ngcontent-%COMP%]{z-index:10;width:100%;background-color:#fff;border-top-left-radius:20px;border-top-right-radius:20px}@media (min-width: 768px){.modal-content[_ngcontent-%COMP%]{max-width:600px;max-height:calc(100vh - 180px);overflow:auto;border-radius:20px}}.modal-body[_ngcontent-%COMP%]{padding:30px;position:relative}.modal-body[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:20px;line-height:30px;margin-bottom:35px;color:#1d2747}.modal-body[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%]{border:0;display:inline-flex;align-items:center;justify-content:center;font-size:14px;line-height:20px;font-family:Inter Semibold;cursor:pointer;background:none;padding:0;color:#113dcd}.modal-body[_ngcontent-%COMP%] .add-btn[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{margin-left:8px}.modal-body[_ngcontent-%COMP%] .list-content[_ngcontent-%COMP%]{margin-top:20px;margin-bottom:0;padding:0;list-style:none;max-height:264px;overflow:auto}.modal-body[_ngcontent-%COMP%] .list-content[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{padding-top:20px;padding-bottom:20px;border-top:1px solid #f0f2fa;border-bottom:1px solid #f0f2fa}.modal-body[_ngcontent-%COMP%] .list-content[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .check-sec[_ngcontent-%COMP%]{display:flex;align-items:center}.modal-body[_ngcontent-%COMP%] .list-content[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .check-sec[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{margin-right:10px}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%]{margin-top:30px}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{max-width:340px;height:40px;
1display:flex;align-items:center;justify-content:center;background:#113ecd;color:#fff;cursor:pointer;width:100%;border-radius:10px;margin:0 auto;font-family:Inter Semibold;font-size:14px;transition:.3s all ease-in-out;border:0}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%] button.loading[_ngcontent-%COMP%]{color:transparent;opacity:.7;cursor:not-allowed;position:relative}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{box-shadow:0 20px 25px -5px #0000001a,0 10px 10px -5px #0000000a;transition:.3s all ease-in-out}.modal-body[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{background:#c4d0f8;pointer-events:none;cursor:default}.close-icon[_ngcontent-%COMP%]{width:14px;height:14px;position:absolute;right:30px;top:30px;cursor:pointer}.custom-control-label[_ngcontent-%COMP%]{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label[_ngcontent-%COMP%]:before{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;pointer-events:none;content:"";background-color:#fff;border:1px solid #adb5bd;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.custom-control-label[_ngcontent-%COMP%]:after{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:"";background:50%/50% 50% no-repeat}.custom-control[_ngcontent-%COMP%]{position:relative;z-index:1;display:block;min-height:1.5rem;padding-left:1.5rem}.custom-control.custom-checkbox[_ngcontent-%COMP%]{position:relative;padding-left:0}.custom-control.custom-checkbox[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]{position:absolute;left:0;width:100%;height:100%;opacity:0;cursor:pointer;z-index:1}.custom-control.custom-checkbox[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]{padding-left:34px;position:relative;width:100%;display:flex;justify-content:space-between;font-size:16px;line-height:20px;color:#1d2747;align-items:center}.custom-control.custom-checkbox[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-left:5px;margin-right:5px;color:#727ea3}.custom-control.custom-checkbox[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:before{width:18px;height:18px;border:1px solid #113ecd;top:2px;left:0;border-radius:4px;background-color:#fff}.custom-control.custom-checkbox[_ngcontent-%COMP%] .custom-control-label[_ngcontent-%COMP%]:after{width:18px;height:18px;border:0px solid #ffffff;top:2px;left:0;border-radius:4px;background:url(https://cdn.researcher.life/rlife/icons/check-white.svg) no-repeat center center #113dcd;background-size:10px;opacity:0}.custom-control.custom-checkbox[_ngcontent-%COMP%] .custom-control-input[_ngcontent-%COMP%]:checked ~ .custom-control-label[_ngcontent-%COMP%]:after{opacity:1}.skeleton-loader[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .skeleton-loader[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .skeleton-loader[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%], .skeleton-loader[_ngcontent-%COMP%] .cta[_ngcontent-%COMP%]{background-color:#f2f2f2;border-radius:4px;height:20px;margin-bottom:10px;position:relative;animation:_ngcontent-%COMP%_shimmer 1s infinite}.skeleton-loader[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{width:110px;height:30px;margin-bottom:35px}.skeleton-loader[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:80px;height:20px;margin-bottom:20px}.skeleton-loader[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%]{height:24px;margin:20px 0;width:50%}.skeleton-loader[_ngcontent-%COMP%] .cta[_ngcontent-%COMP%]{width:100%;max-width:340px;height:40px;margin-left:auto;margin-right:auto;margin-top:30px}@keyframes _ngcontent-%COMP%_shimmer{0%{background-color:#f2f2f2}50%{background-color:#e6e6e6}to{background-color:#f2f2f2}}']})}}return s})(),ge=(()=>{class s{resolveCreateEditComponent(){return U}resolveSaveComponent(){return Gt}resolveMoveComponent(){return vt}resolveCommonReadingListPopup(){return L}resolveMultiSaveComponent(){return me}static{this.\u0275fac=function(c){return new(c||s)}}static{this.\u0275mod=e.$C({type:s})}static{this.\u0275inj=e.G2t({imports:[r.MD,v.X1]})}}return s})()},9417:(Xe,Z,m)=>{m.d(Z,{BC:()=>yt,J3:()=>We,JD:()=>re,Q0:()=>oe,X1:()=>Tn,YN:()=>Rn,Zm:()=>k,cb:()=>Mt,hs:()=>rn,j4:()=>J,k0:()=>v,me:()=>A,vS:()=>ne});var r=m(1360),e=m(6048),S=m(6648),P=m(7468),Lt=m(1413),Rt=m(6354);let tt=(()=>{class n{_renderer;_elementRef;onChange=t=>{};onTouched=()=>{};constructor(t,i){this._renderer=t,this._elementRef=i}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}static \u0275fac=function(i){return new(i||n)(r.rXU(r.sFG),r.rXU(r.aKT))};static \u0275dir=r.FsC({type:n})}return n})(),x=(()=>{class n extends tt{static \u0275fac=(()=>{let t;return function(l){return(t||(t=r.xGo(n)))(l||n)}})();static \u0275dir=r.FsC({type:n,features:[r.Vt3]})}return n})();const b=new r.nKC(""),T={provide:b,useExisting:(0,r.Rfq)(()=>k),multi:!0};let k=(()=>{class n extends x{writeValue(t){this.setProperty("checked",t)}static \u0275fac=(()=>{let t;return function(l){return(t||(t=r.xGo(n)))(l||n)}})();static \u0275dir=r.FsC({type:n,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(i,l){1&i&&r.bIt("change",function(p){return l.onChange(p.target.checked)})("blur",function(){return l.onTouched()})},standalone:!1,features:[r.Jv_([T]),r.Vt3]})}return n})();const V={provide:b,useExisting:(0,r.Rfq)(()=>A),multi:!0},Nt=new r.nKC("");let A=(()=>{class n extends tt{_compositionMode;_composing=!1;constructor(t,i,l){super(t,i),this._compositionMode=l,null==this._compositionMode&&(this._compositionMode=!function Tt(){const n=(0,e.rb)()?(0,e.rb)().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}())}writeValue(t){this.setProperty("value",t??"")}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}
1_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}static \u0275fac=function(i){return new(i||n)(r.rXU(r.sFG),r.rXU(r.aKT),r.rXU(Nt,8))};static \u0275dir=r.FsC({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,l){1&i&&r.bIt("input",function(p){return l._handleInput(p.target.value)})("blur",function(){return l.onTouched()})("compositionstart",function(){return l._compositionStart()})("compositionend",function(p){return l._compositionEnd(p.target.value)})},standalone:!1,features:[r.Jv_([V]),r.Vt3]})}return n})();function N(n){return null==n||0===G(n)}function G(n){return null==n?null:Array.isArray(n)||"string"==typeof n?n.length:n instanceof Set?n.size:null}const C=new r.nKC(""),M=new r.nKC(""),Gt=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class v{static min(o){return function et(n){return o=>{if(null==o.value||null==n)return null;const t=parseFloat(o.value);return!isNaN(t)&&t<n?{min:{min:n,actual:o.value}}:null}}(o)}static max(o){return function B(n){return o=>{if(null==o.value||null==n)return null;const t=parseFloat(o.value);return!isNaN(t)&&t>n?{max:{max:n,actual:o.value}}:null}}(o)}static required(o){return function nt(n){return N(n.value)?{required:!0}:null}(o)}static requiredTrue(o){return function ot(n){return!0===n.value?null:{required:!0}}(o)}static email(o){return function it(n){return N(n.value)||Gt.test(n.value)?null:{email:!0}}(o)}static minLength(o){return function rt(n){return o=>{const t=o.value?.length??G(o.value);return null===t||0===t?null:t<n?{minlength:{requiredLength:n,actualLength:t}}:null}}(o)}static maxLength(o){return function st(n){return o=>{const t=o.value?.length??G(o.value);return null!==t&&t>n?{maxlength:{requiredLength:n,actualLength:t}}:null}}(o)}static pattern(o){return function at(n){if(!n)return F;let o,t;return"string"==typeof n?(t="","^"!==n.charAt(0)&&(t+="^"),t+=n,"$"!==n.charAt(n.length-1)&&(t+="$"),o=new RegExp(t)):(t=n.toString(),o=n),i=>{if(N(i.value))return null;const l=i.value;return o.test(l)?null:{pattern:{requiredPattern:t,actualValue:l}}}}(o)}static nullValidator(o){return null}static compose(o){return U(o)}static composeAsync(o){return pt(o)}}function F(n){return null}function lt(n){return null!=n}function ct(n){return(0,r.jNT)(n)?(0,S.H)(n):n}function dt(n){let o={};return n.forEach(t=>{o=null!=t?{...o,...t}:o}),0===Object.keys(o).length?null:o}function ut(n,o){return o.map(t=>t(n))}function ht(n){return n.map(o=>function Bt(n){return!n.validate}(o)?o:t=>o.validate(t))}function U(n){if(!n)return null;const o=n.filter(lt);return 0==o.length?null:function(t){return dt(ut(t,o))}}function j(n){return null!=n?U(ht(n)):null}function pt(n){if(!n)return null;const o=n.filter(lt);return 0==o.length?null:function(t){const i=ut(t,o).map(ct);return(0,P.p)(i).pipe((0,Rt.T)(dt))}}function $(n){return null!=n?pt(ht(n)):null}function ft(n,o){return null===n?[o]:Array.isArray(n)?[...n,o]:[n,o]}function mt(n){return n._rawValidators}function gt(n){return n._rawAsyncValidators}function X(n){return n?Array.isArray(n)?n:[n]:[]}function I(n,o){return Array.isArray(n)?n.includes(o):n===o}function _t(n,o){const t=X(o);return X(n).forEach(l=>{I(t,l)||t.push(l)}),t}function Ct(n,o){return X(o).filter(t=>!I(n,t))}class vt{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(o){this._rawValidators=o||[],this._composedValidatorFn=j(this._rawValidators)}_setAsyncValidators(o){this._rawAsyncValidators=o||[],this._composedAsyncValidatorFn=$(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(o){this._onDestroyCallbacks.push(o)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(o=>o()),this._onDestroyCallbacks=[]}reset(o=void 0){this.control&&this.control.reset(o)}hasError(o,t){return!!this.control&&this.control.hasError(o,t)}getError(o,t){return this.control?this.control.getError(o,t):null}}class _ extends vt{name;get formDirective(){return null}get path(){return null}}class E extends vt{_parent=null;name=null;valueAccessor=null}class bt{_cd;constructor(o){this._cd=o}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}
1get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}}let yt=(()=>{class n extends bt{constructor(t){super(t)}static \u0275fac=function(i){return new(i||n)(r.rXU(E,2))};static \u0275dir=r.FsC({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,l){2&i&&r.AVh("ng-untouched",l.isUntouched)("ng-touched",l.isTouched)("ng-pristine",l.isPristine)("ng-dirty",l.isDirty)("ng-valid",l.isValid)("ng-invalid",l.isInvalid)("ng-pending",l.isPending)},standalone:!1,features:[r.Vt3]})}return n})(),Mt=(()=>{class n extends bt{constructor(t){super(t)}static \u0275fac=function(i){return new(i||n)(r.rXU(_,10))};static \u0275dir=r.FsC({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,l){2&i&&r.AVh("ng-untouched",l.isUntouched)("ng-touched",l.isTouched)("ng-pristine",l.isPristine)("ng-dirty",l.isDirty)("ng-valid",l.isValid)("ng-invalid",l.isInvalid)("ng-pending",l.isPending)("ng-submitted",l.isSubmitted)},standalone:!1,features:[r.Vt3]})}return n})();const f="VALID",g="INVALID",y="PENDING",W="DISABLED";class R{}class _e extends R{value;source;constructor(o,t){super(),this.value=o,this.source=t}}class Yt extends R{pristine;source;constructor(o,t){super(),this.pristine=o,this.source=t}}class Wt extends R{touched;source;constructor(o,t){super(),this.touched=o,this.source=t}}class Et extends R{status;source;constructor(o,t){super(),this.status=o,this.source=t}}class Ce extends R{source;constructor(o){super(),this.source=o}}class ve extends R{source;constructor(o){super(),this.source=o}}function zt(n){return(xt(n)?n.validators:n)||null}function Kt(n,o){return(xt(o)?o.asyncValidators:n)||null}function xt(n){return null!=n&&!Array.isArray(n)&&"object"==typeof n}class qt{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(o,t){this._assignValidators(o),this._assignAsyncValidators(t)}get validator(){return this._composedValidatorFn}set validator(o){this._rawValidators=this._composedValidatorFn=o}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(o){this._rawAsyncValidators=this._composedAsyncValidatorFn=o}get parent(){return this._parent}get status(){return(0,r.O8t)(this.statusReactive)}set status(o){(0,r.O8t)(()=>this.statusReactive.set(o))}_status=(0,r.EWP)(()=>this.statusReactive());statusReactive=(0,r.vPA)(void 0);get valid(){return this.status===f}get invalid(){return this.status===g}get pending(){return this.status==y}get disabled(){return this.status===W}get enabled(){return this.status!==W}errors;get pristine(){return(0,r.O8t)(this.pristineReactive)}set pristine(o){(0,r.O8t)(()=>this.pristineReactive.set(o))}_pristine=(0,r.EWP)(()=>this.pristineReactive());pristineReactive=(0,r.vPA)(!0);get dirty(){return!this.pristine}get touched(){return(0,r.O8t)(this.touchedReactive)}set touched(o){(0,r.O8t)(()=>this.touchedReactive.set(o))}_touched=(0,r.EWP)(()=>this.touchedReactive());touchedReactive=(0,r.vPA)(!1);get untouched(){return!this.touched}_events=new Lt.B;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(o){this._assignValidators(o)}setAsyncValidators(o){this._assignAsyncValidators(o)}addValidators(o){this.setValidators(_t(o,this._rawValidators))}addAsyncValidators(o){this.setAsyncValidators(_t(o,this._rawAsyncValidators))}removeValidators(o){this.setValidators(Ct(o,this._rawValidators))}removeAsyncValidators(o){this.setAsyncValidators(Ct(o,this._rawAsyncValidators))}hasValidator(o){return I(this._rawValidators,o)}hasAsyncValidator(o){return I(this._rawAsyncValidators,o)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(o={}){const t=!1===this.touched;this.touched=!0;const i=o.sourceControl??this;this._parent&&!o.onlySelf&&this._parent.markAsTouched({...o,sourceControl:i}),t&&!1!==o.emitEvent&&this._events.next(new Wt(!0,i))}markAllAsTouched(o={}){this.markAsTouched({onlySelf:!0,emitEvent:o.emitEvent,sourceControl:this}
1),this._forEachChild(t=>t.markAllAsTouched(o))}markAsUntouched(o={}){const t=!0===this.touched;this.touched=!1,this._pendingTouched=!1;const i=o.sourceControl??this;this._forEachChild(l=>{l.markAsUntouched({onlySelf:!0,emitEvent:o.emitEvent,sourceControl:i})}),this._parent&&!o.onlySelf&&this._parent._updateTouched(o,i),t&&!1!==o.emitEvent&&this._events.next(new Wt(!1,i))}markAsDirty(o={}){const t=!0===this.pristine;this.pristine=!1;const i=o.sourceControl??this;this._parent&&!o.onlySelf&&this._parent.markAsDirty({...o,sourceControl:i}),t&&!1!==o.emitEvent&&this._events.next(new Yt(!1,i))}markAsPristine(o={}){const t=!1===this.pristine;this.pristine=!0,this._pendingDirty=!1;const i=o.sourceControl??this;this._forEachChild(l=>{l.markAsPristine({onlySelf:!0,emitEvent:o.emitEvent})}),this._parent&&!o.onlySelf&&this._parent._updatePristine(o,i),t&&!1!==o.emitEvent&&this._events.next(new Yt(!0,i))}markAsPending(o={}){this.status=y;const t=o.sourceControl??this;!1!==o.emitEvent&&(this._events.next(new Et(this.status,t)),this.statusChanges.emit(this.status)),this._parent&&!o.onlySelf&&this._parent.markAsPending({...o,sourceControl:t})}disable(o={}){const t=this._parentMarkedDirty(o.onlySelf);this.status=W,this.errors=null,this._forEachChild(l=>{l.disable({...o,onlySelf:!0})}),this._updateValue();const i=o.sourceControl??this;!1!==o.emitEvent&&(this._events.next(new _e(this.value,i)),this._events.next(new Et(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors({...o,skipPristineCheck:t},this),this._onDisabledChange.forEach(l=>l(!0))}enable(o={}){const t=this._parentMarkedDirty(o.onlySelf);this.status=f,this._forEachChild(i=>{i.enable({...o,onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:o.emitEvent}),this._updateAncestors({...o,skipPristineCheck:t},this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(o,t){this._parent&&!o.onlySelf&&(this._parent.updateValueAndValidity(o),o.skipPristineCheck||this._parent._updatePristine({},t),this._parent._updateTouched({},t))}setParent(o){this._parent=o}getRawValue(){return this.value}updateValueAndValidity(o={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){const i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===f||this.status===y)&&this._runAsyncValidator(i,o.emitEvent)}const t=o.sourceControl??this;!1!==o.emitEvent&&(this._events.next(new _e(this.value,t)),this._events.next(new Et(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!o.onlySelf&&this._parent.updateValueAndValidity({...o,sourceControl:t})}_updateTreeValidity(o={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(o)),this.updateValueAndValidity({onlySelf:!0,emitEvent:o.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?W:f}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(o,t){if(this.asyncValidator){this.status=y,this._hasOwnPendingAsyncValidator={emitEvent:!1!==t};const i=ct(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(l=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(l,{emitEvent:t,shouldHaveEmitted:o})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();const o=this._hasOwnPendingAsyncValidator?.emitEvent??!1;return this._hasOwnPendingAsyncValidator=null,o}return!1}setErrors(o,t={}){this.errors=o,this._updateControlsErrors(!1!==t.emitEvent,this,t.shouldHaveEmitted)}get(o){let t=o;return null==t||(Array.isArray(t)||(t=t.split(".")),0===t.length)?null:t.reduce((i,l)=>i&&i._find(l),this)}getError(o,t){const i=t?this.get(t):this;return i&&i.errors?i.errors[o]:null}hasError(o,t){return!!this.getError(o,t)}get root(){let o=this;for(;o._parent;)o=o._parent;return o}_updateControlsErrors(o,t,i){this.status=this._calculateStatus(),o&&this.statusChanges.emit(this.status),(o||i)&&this._events.next(new Et(this.status,t)),this._parent&&this._parent._updateControlsErrors(o,t,i)}_initObservables(){this.valueChanges=new r.bkB,this.statusChanges=new r.bkB}_calculateStatus(){return this._allControlsDisabled()?W:this.errors?g:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(y)?y:this._anyControlsHaveStatus(g)?g:f}_anyControlsHaveStatus(o){return this._anyControls(t=>t.status===o)}_anyControlsDirty(){return this._anyControls(o=>o.dirty)}_anyControlsTouched(){return this._anyControls(o=>o.touched)}_updatePristine(o,t){const i=!this._anyControlsDirty(),l=this.pristine!==i;this.pristine=i,this._parent&&!o.onlySelf&&this._parent._updatePristine(o,t),l&&this._events.next(new Yt(this.pristine,t))}_updateTouched(o={},t){this.touched=this._anyControlsTouched(),this._events.next(new Wt(this.touched,t)),this._parent&&!o.onlySelf&&this._parent._updateTouched(o,t)}_onDisabledChange=[];_registerOnCollectionChange(o){this._onCollectionChange=o}_setUpdateStrategy(o){xt(o)&&null!=o.updateOn&&(this._updateOn=o.updateOn)}_parentMarkedDirty(o){return!o&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}
1_find(o){return null}_assignValidators(o){this._rawValidators=Array.isArray(o)?o.slice():o,this._composedValidatorFn=function He(n){return Array.isArray(n)?j(n):n||null}(this._rawValidators)}_assignAsyncValidators(o){this._rawAsyncValidators=Array.isArray(o)?o.slice():o,this._composedAsyncValidatorFn=function Ye(n){return Array.isArray(n)?$(n):n||null}(this._rawAsyncValidators)}}const We=class Ot extends qt{constructor(o,t,i){super(zt(t),Kt(i,t)),this.controls=o,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(o,t){return this.controls[o]?this.controls[o]:(this.controls[o]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(o,t,i={}){this.registerControl(o,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(o,t={}){this.controls[o]&&this.controls[o]._registerOnCollectionChange(()=>{}),delete this.controls[o],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(o,t,i={}){this.controls[o]&&this.controls[o]._registerOnCollectionChange(()=>{}),delete this.controls[o],t&&this.registerControl(o,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(o){return this.controls.hasOwnProperty(o)&&this.controls[o].enabled}setValue(o,t={}){(function ye(n,o,t){n._forEachChild((i,l)=>{if(void 0===t[l])throw new r.wOt(1002,"")})})(this,0,o),Object.keys(o).forEach(i=>{(function be(n,o,t){const i=n.controls;if(!(o?Object.keys(i):i).length)throw new r.wOt(1e3,"");if(!i[t])throw new r.wOt(1001,"")})(this,!0,i),this.controls[i].setValue(o[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(o,t={}){null!=o&&(Object.keys(o).forEach(i=>{const l=this.controls[i];l&&l.patchValue(o[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(o={},t={}){this._forEachChild((i,l)=>{i.reset(o?o[l]:null,{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t,this),this._updateTouched(t,this),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(o,t,i)=>(o[i]=t.getRawValue(),o))}_syncPendingControls(){let o=this._reduceChildren(!1,(t,i)=>!!i._syncPendingControls()||t);return o&&this.updateValueAndValidity({onlySelf:!0}),o}_forEachChild(o){Object.keys(this.controls).forEach(t=>{const i=this.controls[t];i&&o(i,t)})}_setUpControls(){this._forEachChild(o=>{o.setParent(this),o._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(o){for(const[t,i]of Object.entries(this.controls))if(this.contains(t)&&o(i))return!0;return!1}_reduceValue(){return this._reduceChildren({},(t,i,l)=>((i.enabled||this.disabled)&&(t[l]=i.value),t))}_reduceChildren(o,t){let i=o;return this._forEachChild((l,u)=>{i=t(i,l,u)}),i}_allControlsDisabled(){for(const o of Object.keys(this.controls))if(this.controls[o].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(o){return this.controls.hasOwnProperty(o)?this.controls[o]:null}},w=new r.nKC("",{providedIn:"root",factory:()=>z}),z="always";function Pt(n,o){return[...o.path,n]}function K(n,o,t=z){Jt(n,o),o.valueAccessor.writeValue(n.value),(n.disabled||"always"===t)&&o.valueAccessor.setDisabledState?.(n.disabled),function qe(n,o){o.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,"change"===n.updateOn&&Me(n,o)})}(n,o),function Qe(n,o){const t=(i,l)=>{o.valueAccessor.writeValue(i),l&&o.viewToModelUpdate(i)};n.registerOnChange(t),o._registerOnDestroy(()=>{n._unregisterOnChange(t)}
1)}(n,o),function Je(n,o){o.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,"blur"===n.updateOn&&n._pendingChange&&Me(n,o),"submit"!==n.updateOn&&n.markAsTouched()})}(n,o),function Ke(n,o){if(o.valueAccessor.setDisabledState){const t=i=>{o.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),o._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}(n,o)}function Vt(n,o,t=!0){const i=()=>{};o.valueAccessor&&(o.valueAccessor.registerOnChange(i),o.valueAccessor.registerOnTouched(i)),Dt(n,o),n&&(o._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function wt(n,o){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(o)})}function Jt(n,o){const t=mt(n);null!==o.validator?n.setValidators(ft(t,o.validator)):"function"==typeof t&&n.setValidators([t]);const i=gt(n);null!==o.asyncValidator?n.setAsyncValidators(ft(i,o.asyncValidator)):"function"==typeof i&&n.setAsyncValidators([i]);const l=()=>n.updateValueAndValidity();wt(o._rawValidators,l),wt(o._rawAsyncValidators,l)}function Dt(n,o){let t=!1;if(null!==n){if(null!==o.validator){const l=mt(n);if(Array.isArray(l)&&l.length>0){const u=l.filter(p=>p!==o.validator);u.length!==l.length&&(t=!0,n.setValidators(u))}}if(null!==o.asyncValidator){const l=gt(n);if(Array.isArray(l)&&l.length>0){const u=l.filter(p=>p!==o.asyncValidator);u.length!==l.length&&(t=!0,n.setAsyncValidators(u))}}}const i=()=>{};return wt(o._rawValidators,i),wt(o._rawAsyncValidators,i),t}function Me(n,o){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),o.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function Zt(n,o){if(!n.hasOwnProperty("model"))return!1;const t=n.model;return!!t.isFirstChange()||!Object.is(o,t.currentValue)}function te(n,o){if(!o)return null;let t,i,l;return Array.isArray(o),o.forEach(u=>{u.constructor===A?t=u:function en(n){return Object.getPrototypeOf(n.constructor)===x}(u)?i=u:l=u}),l||i||t||null}function Oe(n,o){const t=n.indexOf(o);t>-1&&n.splice(t,1)}function Pe(n){return"object"==typeof n&&null!==n&&2===Object.keys(n).length&&"value"in n&&"disabled"in n}Promise.resolve();const ee=class extends qt{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(o=null,t,i){super(zt(t),Kt(i,t)),this._applyFormState(o),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),xt(t)&&(t.nonNullable||t.initialValueIsDefault)&&(this.defaultValue=Pe(o)?o.value:o)}setValue(o,t={}){this.value=this._pendingValue=o,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(i=>i(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(o,t={}){this.setValue(o,t)}reset(o=this.defaultValue,t={}){this._applyFormState(o),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(o){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(o){this._onChange.push(o)}_unregisterOnChange(o){Oe(this._onChange,o)}registerOnDisabledChange(o){this._onDisabledChange.push(o)}_unregisterOnDisabledChange(o){Oe(this._onDisabledChange,o)}_forEachChild(o){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(o){Pe(o)?(this.value=this._pendingValue=o.value,o.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=o}},rn=ee,dn={provide:E,useExisting:(0,r.Rfq)(()=>ne)},Ve=Promise.resolve();let ne=(()=>{class n extends E{_changeDetectorRef;callSetDisabledState;control=new ee;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new r.bkB;constructor(t,i,l,u,p,O){super(),this._changeDetectorRef=p,this.callSetDisabledState=O,this._parent=t,this._setValidators(i),this._setAsyncValidators(l),this.valueAccessor=te(0,u)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){const i=t.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),Zt(t,this.viewModel)&&(this._updateV
1alue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){K(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){Ve.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(t){const i=t.isDisabled.currentValue,l=0!==i&&(0,r.L39)(i);Ve.then(()=>{l&&!this.control.disabled?this.control.disable():!l&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(t){return this._parent?Pt(t,this._parent):[t]}static \u0275fac=function(i){return new(i||n)(r.rXU(_,9),r.rXU(C,10),r.rXU(M,10),r.rXU(b,10),r.rXU(r.gRc,8),r.rXU(w,8))};static \u0275dir=r.FsC({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[r.Jv_([dn]),r.Vt3,r.OA$]})}return n})();const hn={provide:b,useExisting:(0,r.Rfq)(()=>oe),multi:!0};let oe=(()=>{class n extends x{writeValue(t){this.setProperty("value",t??"")}registerOnChange(t){this.onChange=i=>{t(""==i?null:parseFloat(i))}}static \u0275fac=(()=>{let t;return function(l){return(t||(t=r.xGo(n)))(l||n)}})();static \u0275dir=r.FsC({type:n,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(i,l){1&i&&r.bIt("input",function(p){return l.onChange(p.target.value)})("blur",function(){return l.onTouched()})},standalone:!1,features:[r.Jv_([hn]),r.Vt3]})}return n})();const ie=new r.nKC(""),_n={provide:_,useExisting:(0,r.Rfq)(()=>J)};let J=(()=>{class n extends _{callSetDisabledState;get submitted(){return(0,r.O8t)(this._submittedReactive)}set submitted(t){this._submittedReactive.set(t)}_submitted=(0,r.EWP)(()=>this._submittedReactive());_submittedReactive=(0,r.vPA)(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new r.bkB;constructor(t,i,l){super(),this.callSetDisabledState=l,this._setValidators(t),this._setAsyncValidators(i)}ngOnChanges(t){t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(Dt(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const i=this.form.get(t.path);return K(i,t,this.callSetDisabledState),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),i}getControl(t){return this.form.get(t.path)}
1removeControl(t){Vt(t.control||null,t,!1),function nn(n,o){const t=n.indexOf(o);t>-1&&n.splice(t,1)}(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,i){this.form.get(t.path).setValue(i)}onSubmit(t){return this._submittedReactive.set(!0),function xe(n,o){n._syncPendingControls(),o.forEach(t=>{const i=t.control;"submit"===i.updateOn&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}(this.form,this.directives),this.ngSubmit.emit(t),this.form._events.next(new Ce(this.control)),"dialog"===t?.target?.method}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this._submittedReactive.set(!1),this.form._events.next(new ve(this.form))}_updateDomValue(){this.directives.forEach(t=>{const i=t.control,l=this.form.get(t.path);i!==l&&(Vt(i||null,t),(n=>n instanceof ee)(l)&&(K(l,t,this.callSetDisabledState),t.control=l))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const i=this.form.get(t.path);(function Ee(n,o){Jt(n,o)})(i,t),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const i=this.form.get(t.path);i&&function Ze(n,o){return Dt(n,o)}(i,t)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){Jt(this.form,this),this._oldForm&&Dt(this._oldForm,this)}static \u0275fac=function(i){return new(i||n)(r.rXU(C,10),r.rXU(M,10),r.rXU(w,8))};static \u0275dir=r.FsC({type:n,selectors:[["","formGroup",""]],hostBindings:function(i,l){1&i&&r.bIt("submit",function(p){return l.onSubmit(p)})("reset",function(){return l.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[r.Jv_([_n]),r.Vt3,r.OA$]})}return n})();const bn={provide:E,useExisting:(0,r.Rfq)(()=>re)};let re=(()=>{class n extends E{_ngModelWarningConfig;_added=!1;viewModel;control;name=null;set isDisabled(t){}model;update=new r.bkB;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(t,i,l,u,p){super(),this._ngModelWarningConfig=p,this._parent=t,this._setValidators(i),this._setAsyncValidators(l),this.valueAccessor=te(0,u)}ngOnChanges(t){this._added||this._setUpControl(),Zt(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}get path(){return Pt(null==this.name?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_setUpControl(){this.control=this.formDirective.addControl(this),this._added=!0}static \u0275fac=function(i){return new(i||n)(r.rXU(_,13),r.rXU(C,10),r.rXU(M,10),r.rXU(b,10),r.rXU(ie,8))};static \u0275dir=r.FsC({type:n,selectors:[["","formControlName",""]],inputs:{name:[0,"formControlName","name"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},standalone:!1,features:[r.Jv_([bn]),r.Vt3,r.OA$]})}return n})(),$e=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=r.$C({type:n});static \u0275inj=r.G2t({})}return n})(),Rn=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:w,useValue:t.callSetDisabledState??z}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=r.$C({type:n});static \u0275inj=r.G2t({imports:[$e]})}return n})(),Tn=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:ie,useValue:t.warnOnNgModelWithFormControl??"always"},{provide:w,useValue:t.callSetDisabledState??z}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=r.$C({type:n});static \u0275inj=r.G2t({imports:[$e]})}return n})()}}]);
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.