PageSourceSearch

https://ithraa.io/chunk-Ce1Y3SKP2.js

js ithraa.io collected 2026-09-28 09:05:06 UTC 154,621 bytes, 1 lines download raw bytes

1import{$ as Jp,Ai as sm,Br as jx,Ct as Oy,Fi as t_,Gi as vM,I as Fy,It as Rd,Ji as vy,Jt as U,Kn as bC,Kr as ky,Ln as _t$1,Lr as jl,Mr as iM,Nr as im,Nt as Qd,Or as hM,Pi as tS,Qi as xC,Qn as cS,Qr as mM,Rt as SN,Sn as Y_,Sr as gM,Ti as rM,Ui as uf,Ur as kN,Vr as jy,Wi as uv,Zr as lv,_i as pv,_n as X_,ai as nS,at as K_,br as g,c as A,ct as Ld,dr as eh,ei as ma,en as VN,er as cr,gr as fh,gt as NT,hr as fM,i as $S,li as oM,ln as WS,m as Az,mi as pb,nr as cv,oi as nn$1,p as At,pi as pS,pn as X,q as IS,s as $y,sr as dh,tt as Jy,u as AN,ur as eS,ut as M,vi as q,vr as fv,wr as gb,xn as YS}from"./chunk-B4RSHvLz.js";import{a as jm,o as ls}from"./chunk-CrDHOUi8.js";import{t as L}from"./chunk-DFFegspd.js";import{a as Y,c as ua,n as F,o as na,r as Jo$1,t as $t}from"./chunk-CjWXZC1U.js";import{D as Pn$1,G as co$1,f as Eo$1,m as Ha,pt as zn$1,r as A0}from"./chunk-BOIUNxtB.js";import{i as Ln$1,r as Hn$1,t as $n$1}from"./chunk-G8JMQj-a.js";import{i as wt,n as Mt$1,r as Tt,t as At$1}from"./chunk-Ln4tBdF7.js";import"./chunk-S77gWl-y.js";import{L as vr,S as cr$1,l as Kt,r as En$1}from"./chunk-Co9mkJ3y.js";import{n as Tt$1,t as Pt}from"./chunk-BZgHNwGb.js";import{i as Ht,l as ee,n as Bt,o as T,t as $e,u as jt}from"./chunk-DdnIfqlv.js";import"./chunk-B21bWE_4.js";import{c as Lo$1,i as Ee,o as Ge,s as Io$1,y as ke}from"./chunk-DT0SACXj.js";import"./chunk-a-WusATD.js";import{t as H}from"./chunk-g_ma47Se.js";import{n as ae,r as ge}from"./chunk-BTkZgA-q.js";import{i as oe,n as Me,r as me,t as Ge$1}from"./chunk-D_oXLxG5.js";import{n as I,s as z}from"./chunk-qkx9Nt5q.js";import{n as y,t as u}from"./chunk-Dw_xSLtY.js";import{n as Z,t as J}from"./chunk-CaXJsgQ-.js";import{a as gn$1,i as fn$1,n as He,r as Oe,s as xn$1,t as Fe}from"./chunk-DdJ4aPuV.js";import{$ as Ct,A as P,D as Bt$1,O as Ht$1,Y as Bo$1,at as kt,ct as st,it as jt$1,j as ee$1,k as Lt,nt as $t$1,ot as nt,rt as Le,st as rt}from"./main-MRON3MGX.js";import{t as mt}from"./chunk-CUDQWsIH.js";import{t as I$1}from"./chunk-DnCd7bVx.js";import{n as bt,r as nt$1,t as Dt}from"./chunk-TTxaWXVC.js";import"./chunk-DN10yM_L2.js";import{n as ie,t as Yt}from"./chunk-BC8Ew1v62.js";import{t as Vg}from"./chunk-C8R9qwV82.js";function Ki(o,l){if(o&1){let e=cS();ma(0,`mat-option`,29),$y(`onSelectionChange`,function(t){let r=Jp(e),d=r.$implicit,A=r.$index;return eh(pS().chooseChapter(t,A,d.id))}),Fy(1,`i`,30),ma(2,`span`,31),$S(3),Rd()()}if(o&2){let e=l.$implicit;ky(`value`,e.id),NT(3),Ld(` `,e.label)}}function Xi(o,l){if(o&1){let e=cS();ma(0,`mat-radio-button`,32),$y(`change`,function(t){Jp(e);return eh(pS().radioChange(t))}),ma(1,`p`,15),$S(2),Rd()()}if(o&2){let e=l.$implicit;ky(`value`,e.value),NT(2),cv(e.name)}}function Ji(o,l){o&1&&(ma(0,`div`,25),Fy(1,`img`,33),ma(2,`p`),$S(3,`لا يوجد إثراءات`),Rd()())}function Qi(o,l){o&1&&(ma(0,`div`,26),Fy(1,`mat-spinner`),Rd())}function Yi(o,l){o&1&&Fy(0,`i`,47)}function eo(o,l){o&1&&Fy(0,`i`,48)}function to(o,l){if(o&1&&(Fy(0,`iframe`,52),fM(1,`replace`),fM(2,`replace`),fM(3,`saveVideoUrl`)),o&2){let e=pS(2).$implicit;ky(`src`,hM(3,9,mM(2,5,mM(1,1,e==null?null:e.video_url,`watch?v=`,`embed/`),`.be/`,`be.com/embed/`)),sm)}}function io(o,l){if(o&1&&(ma(0,`audio`,53)(1,`p`),$S(2,`متصفحك لا يدعم تشغيل الملفات الصوتية.`),Rd()()),o&2){let e=pS(2).$implicit;ky(`src`,pS().SERVER_URL+`sound_upload/`+(e==null?null:e.sound_upload))}}function oo(o,l){if(o&1){let e=cS();ma(0,`img`,71),$y(`click`,function(){Jp(e);let t=pS(2).$implicit;return eh(pS().openImageDilog(t==null?null:t.image_upload))}),Rd()}if(o&2){let e=pS(2).$implicit;ky(`src`,pS().SERVER_URL+`image_upload/`+(e==null?null:e.image_upload),im)}}function no(o,l){if(o&1&&(ma(0,`b`,56),$S(1),Rd()),o&2){let e=pS(2).$implicit;NT(),Ld(``,e?.notes_category,` :`)}}function ro(o,l){if(o&1){let e=cS();ma(0,`p`,58)(1,`a`,72),$y(`click`,function(){Jp(e);let t=pS(2).$implicit;return eh(t.showMore=!1)}),$S(2,`المزيد`),Rd()()}}function ao(o,l){if(o&1){let e=cS();ma(0,`a`,72),$y(`click`,function(){Jp(e);let t=pS(2).$implicit;return eh(t.showMore=!0)}),$S(1,`إخفاء`),Rd()}}function so(o,l){if(o&1&&(ma(0,`p`,68),Fy(1,`i`,73),$S(2,` تم اعتماد الإثراء من قبل `),ma(3,`span`,74),$S(4),Rd()()),o&2){let e=pS(2).$implicit;NT(4),cv(e?.copy_owner_name)}}function lo(o,l){if(o&1&&(ma(0,`p`,69)(1,`span`,75),$S(2,`cancel`),Rd(),$S(3,` تم رفض الإثراء من قبل `),ma(4,`span`,74),$S(5),Rd()()),o&2){let e=pS(2).$implicit;NT(5),cv(e?.copy_owner_name)}}function uo(o,l){o&1&&(ma(0,`p`,70),Fy(1,`i`,76),$S(2,` تم إرسال طلب النشر برجاء الانتظار `),Rd())}function co(o,l){if(o&1&&(Fy(0,`hr`,50),ma(1,`div`,51),K_(2,to,4,11,`iframe`,52),K_(3,io,3,1,`audio`,53),K_(4,oo,1,1,`img`,54),Rd(),ma(5,`div`)(6,`p`,55),K_(7,no,2,1,`b`,56),Fy(8,`span`,57),fM(9,`sliceHtml`),fM(10,`safeHtml`),Rd(),K_(11,ro,3,0,`p`,58),ma(12,`p`,58),K_(13,ao,2,0,`a`,59),Rd(),Fy(14,`hr`,60),ma(15,`div`,61)(16,`p`,62),$S(17),Rd(),ma(18,`p`)(19,`span`,63),$S(20),Fy(21,`img`,64),Rd()()(),Fy(22,`hr`,65),ma(23,`div`),Fy(24,`app-dispaly-attachments`,66),Rd(),ma(25,`div`,67),K_(26,so,5,1,`p`,68),K_(27,lo,6,1,`p`,69),K_(28,uo,3,0,`p`,70),Rd()()),o&2){let e=pS().$implicit,i=pS();NT(2),X_(e?.video_url?2:-1),NT(),X_(e?.sound_upload?3:-1),NT(),X_(e?.image_upload?4:-1),NT(3),X_(e?.notes_category?7:-1),NT(),ky(`innerHtml`,e?.showMore==!1?e==null?null:e.text:hM(10,24,mM(9,20,e==null?null:e.text,0,250)),bC),NT(3),X_(e?.showMore==!0?11:-1),NT(2),X_(e.showMore==!1?13:-1),NT(4),Ld(` `,e.ar_created_at,` `),NT(3),Ld(` `,e.likes_count,` `),NT(4),ky(`bookId`,i.data==null?null:i.data.book_id)(`copyId`,e==null?null:e.copy_id)(`edit`,!1)(`attachmentsIds`,e==null?null:e.attachmentsids)(`canDelete`,`fromDb`)(`attachmentsNames`,e==null?null:e.attachmentsnames)(`annotatorId`,e.userId)(`annotation`,e),NT(2),X_(e?.copy_id!=null&&e?.copy_id!=null&&e?.userId!=e?.copy_owner_id&&e.publish_request_state==`1`?26:-1),NT(),X_(e?.copy_id!=null&&e?.copy_id!=null&&e?.userId!=e?.copy_owner_id&&e.publish_request_state==`2`?27:-1),NT(),X_(e?.copy_id!=null&&e?.copy_id!=null&&e?.userId!=e?.copy_owner_id&&e.publish_request_state==`0`?28:-1)}}function po(o,l){if(o&1){let e=cS();ma(0,`div`,27)(1,`mat-accordion`,34)(2,`mat-expansion-panel`,35),$y(`afterExpand`,function(){let t=Jp(e).$implicit;return eh(pS().afterOccordionExpand(t.annotation_id))})(`afterCollapse`,function(){let t=Jp(e).$implicit;return eh(pS().afterOccordionCollapse(t.annotation_id))}),ma(3,`mat-expansion-panel-header`,36,0)(5,`mat-checkbox`,37),$y(`click`,function(t){return t.stopPropagation()}),pv(`ngModelChange`,function(t){let r=Jp(e).$implicit;return WS(r.checked,t)||(r.checked=t),eh(t)}),$y(`ngModelChange`,function(t){let r=Jp(e).$implicit;return eh(pS().updateAllComplete(t,r))}),Rd(),pb(),ma(6,`mat-panel-description`,38)(7,`h3`,39)(8,`div`,40)(9,`p`,41),$S(10),fM(11,`sliceText`),Fy(12,`i`,42)(13,`span`,43),fM(14,`sliceText`),fM(15,`safeHtml`),Fy(16,`i`,44),Rd(),Fy(17,`p`,45),fM(18,`sliceHtml`),fM(19,`safeHtml`),Rd()(),ma(20,`div`,46),K_(21,Yi,1,0,`i`,47),K_(22,eo,1,0,`i`,48),Rd()()(),vy(23,co,29,26,`ng-template`,49),Rd()()()}if(o&2){let e=l.$implicit,i=pS();NT(2),ky(`id`,`annotation`+e.annotation_id),NT(),ky(`collapsedHeight`,`auto`)(`expandedHeight`,`auto`),NT(2),ky(`name`,e.annotation_id),fv(`ngModel`,e.checked),gb(),NT(),ky(`id`,`paneldesc`+e.annotation_id),NT(4),Ld(` `,gM(11,11,e==null?null:e.full_name,150),` `),NT(3),ky(`innerHtml`,i.isOccordionExpand[e?.annotation_id]?e.quote:hM(15,17,gM(14,14,e.quote,150)),bC),NT(4),ky(`innerHtml`,i.isOccordionExpand[e?.annotation_id]?``:hM(19,23,mM(18,19,e.text,0,250)),bC),NT(4),X_(e.public==!1?21:-1),NT(),X_(e.public==!0?22:-1)}}function mo(o,l){if(o&1){let e=cS();ma(0,`button`,77),$y(`click`,function(){Jp(e);return eh(pS().showMore())}),$S(1,` عرض المزيد `),Rd()}if(o&2){let e=pS();ky(`hidden`,e.counter>=e.annotations.length)}}var Mi;var ht;var Ti=(()=>{class o{dialog;dialogRef;dashServ;toastr;epubServ;timeService;breakpointObserver;utilisService;chaptersService;data;authUserId;bookId;startLoading=!0;bookCopyId;SERVER_URL;annotations=[];counter=5;annotationsIds={};sortBy=`1`;allComplete;chapters;book;fixedAnnotations;bookType=`epub`;selectedOption;selectedChapterIndex;selectedType=0;copyTitle;isSmallSreen;allToPublic;allToPrivate;bothTypes=!1;innerWidth;get selectedAnnotationsCount(){return Object.keys(this.annotationsIds).length}types=[{name:`الكل`,value:0},{name:`خاص`,value:1},{name:`عام`,value:2}];task={name:`تحديد الكل `,completed:!0,color:`accent`,id:0};constructor(e,i,t,r,d,A,f,T,W,q){this.dialog=e,this.dialogRef=i,this.dashServ=t,this.toastr=r,this.epubServ=d,this.timeService=A,this.breakpointObserver=f,this.utilisService=T,this.chaptersService=W,this.data=q,this.authUserId=this.data.AuthUserId,this.bookId=this.data.bookId,this.bookCopyId=this.data.bookCopy,this.copyTitle=this.data.copyTitle,this.book=this.epubServ.getBook(this.bookId),Mi=this}isOccordionExpand={};ngOnInit(){this.innerWidth=window.innerWidth,this.SERVER_URL=ua.storage_path,this.dashServ.getBookCopyAnnotations(this.authUserId,this.bookId,this.bookCopyId).subscribe(e=>{if(Array.isArray(e)){this.startLoading=!1,this.fixedAnnotations=ls(e);for(let i of this.fixedAnnotations)i.ar_created_at=this.timeService.handleTimeZoneHours(i.created_at),this.isOccordionExpand[i.annotation_id]=!1,this.utilisService.getLenghtOfTextInHTML(i.text)>250&&(i.showMore=!0);this.annotations=ls(this.fixedAnnotations)}}),this.bookType=this.data.bookType||`epub`,this.bookType===`epub`&&this.book&&this.book.loaded&&this.book.loaded.navigation?this.book.loaded.navigation.then(e=>{this.chapters=e.toc}):this.bookType===`pdf`?this.chaptersService.getBookChapters(+this.bookId).subscribe(e=>{e&&e.length>0?this.chapters=e.map(i=>
1({id:i.toc_id.toString(),label:i.title,href:``,subitems:[]})):this.chapters=[]},e=>{this.chapters=[]}):this.chapters=[],this.isSmallSreen=this.breakpointObserver.isMatched(`(max-width: 600px)`),this.isSmallSreen&&this.dialogRef.updateSize(`95vw`,``)}onResize(e){this.innerWidth=window.innerWidth,this.innerWidth<=600&&this.dialogRef.updateSize(`95vw`,``)}numberOfLastObj=0;recursion(e){if(this.numberOfLastObj++,e.subitems.length>0)for(let i=0;i<e.subitems.length;i++)this.recursion(e.subitems[i]);return this.numberOfLastObj}radioChange(e){this.setAll(!1),this.allComplete=!1;let i=this.selectedType=e.value;this.selectedOption?this.selectedOption==`all`?this.chooseChapter({isUserInput:!0},`all`,`all`):this.chooseChapter({isUserInput:!0},this.selectedChapterIndex,this.selectedOption):i==0?this.annotations=ls(this.fixedAnnotations):i==1?this.annotations=ls(this.fixedAnnotations).filter(t=>t.public==!1):i==2&&(this.annotations=ls(this.fixedAnnotations).filter(t=>t.public==!0))}chooseChapter(e,i,t){if(this.setAll(!1),this.allComplete=!1,e.isUserInput){if(this.sortBy=void 0,i==`all`)this.selectedType?this.selectedType==0?this.annotations=ls(this.fixedAnnotations):this.selectedType==1?this.annotations=ls(this.fixedAnnotations.filter(r=>r.public==!1)):this.selectedType==2&&(this.annotations=ls(this.fixedAnnotations.filter(r=>r.public==!0))):this.annotations=ls(this.fixedAnnotations);else if(this.selectedChapterIndex=i,this.bookType===`epub`){let r=``;new RegExp(/navPoint-/gi).test(t)?r=`navPoint-`:new RegExp(/navPoint/gi).test(t)&&(r=`navPoint`),t=t.replace(new RegExp(r,`igm`),``);let d=this.chapters[i+1]?this.chapters[i+1].id.replace(new RegExp(r,`igm`),``):+t+this.recursion(this.chapters[i]),A=jm(t,d);this.selectedType?this.selectedType==0?this.annotations=ls(this.fixedAnnotations.filter(f=>A.includes(f.tocid))):this.selectedType==1?this.annotations=ls(this.fixedAnnotations.filter(f=>A.includes(f.tocid)&&f.public==!1)):this.selectedType==2&&(this.annotations=ls(this.fixedAnnotations.filter(f=>A.includes(f.tocid)&&f.public==!0))):this.annotations=ls(this.fixedAnnotations.filter(f=>A.includes(f.tocid)))}else if(this.bookType===`pdf`){let r=parseInt(t);this.selectedType?this.selectedType==0?this.annotations=ls(this.fixedAnnotations.filter(d=>d.tocid===r)):this.selectedType==1?this.annotations=ls(this.fixedAnnotations.filter(d=>d.tocid===r&&d.public==!1)):this.selectedType==2&&(this.annotations=ls(this.fixedAnnotations.filter(d=>d.tocid===r&&d.public==!0))):this.annotations=ls(this.fixedAnnotations.filter(d=>d.tocid===r))}}this.allComplete=this.annotations.every(r=>r.checked==!0)}setAll(e){e==!1?this.annotations.forEach(i=>{delete this.annotationsIds[i.annotation_id]}):this.annotations.map(i=>{this.annotationsIds[i.annotation_id]=!0}),this.annotations.forEach(i=>{i.checked=e,this.fixedAnnotations.find(t=>t.annotation_id==i.annotation_id).checked=e})}updateAllComplete(e,i){this.fixedAnnotations.find(r=>r.annotation_id==i.annotation_id)&&(this.fixedAnnotations.find(r=>r.annotation_id==i.annotation_id).checked=e),e==!1?delete this.annotationsIds[i.annotation_id]:this.annotationsIds[i.annotation_id]=i.public,this.allToPublic=Object.values(this.annotationsIds).some(r=>r==!0),this.allToPrivate=Object.values(this.annotationsIds).some(r=>r==!1),this.allToPublic==!0&&this.allToPrivate==!0?this.bothTypes=!0:this.bothTypes=!1,this.allComplete=this.annotations.every(r=>r.checked==!0)}saveAnnotationsState(e){Object.keys(this.annotationsIds).length>0?(this.startLoading=!0,this.dashServ.changeAnnotationsState({state:e,annotationsIds:this.annotationsIds,authUserId:this.authUserId,bookId:this.bookId,bookCopyId:this.bookCopyId}).subscribe(i=>{i.count?(this.dashServ.getBookCopyAnnotations(this.authUserId,this.bookId,this.bookCopyId).subscribe(t=>{if(Array.isArray(t)){this.fixedAnnotations=ls(t);for(let r of this.fixedAnnotations)r.ar_created_at=this.timeService.handleTimeZoneHours(r.created_at),this.isOccordionExpand[r.annotation_id]=!1,this.utilisService.getLenghtOfTextInHTML(r.text)>250&&(r.showMore=!0);this.radioChange({value:this.selectedType||0})}}),this.startLoading=!1,this.toastr.success(`\u062A\u0645 \u062A\u062D\u0648\u064A\u0644 (${i.count}) \u0625\u062B\u0631\u0627\u0621 \u0628\u0646\u062C\u0627\u062D`),this.annotationsIds={},this.allComplete=!1):(this.startLoading=!1,this.toastr.error(`حدثت مشكلة أثناء التعديل`))})):this.toastr.error(`لم يتم تحديد أى إثراءات`)}onCheckboxClick(e){e.stopPropagation()}openImageDilog(e){let i=this.SERVER_URL+`image_upload/`+e;this.dialog.open(rt,{data:{imageUrl:i}}).afterClosed().subscribe(r=>{})}filterAnnotations(e,i){e.isUserInput&&(ht=i,this.annotations=this.annotations.sort(this.compare))}compare(e,i){let t,r;Mi.isOccordionExpand[e.annotation_id]=!1,ht==1?(t=e.created_at,r=i.created_at):ht==2?(t=e.likes_count,r=i.likes_count):ht==3&&(e.start_rank==null||e.start_rank==null?(t=Number(i.page_number),r=Number(e.page_number)):(t=Number(i.start_rank),r=Number(e.start_rank)));let d=0;return t<r?d=1:t>r&&(d=-1),d}afterOccordionExpand(e){this.isOccordionExpand[e]=!0,setTimeout(()=>{document.getElementById(`annotation${e}`)?.scrollIntoView({behavior:`smooth`,block:`nearest`})},1)}afterOccordionCollapse(e){this.isOccordionExpand[e]=!1}
1showMore(){this.counter=this.counter+5}static ɵfac=function(i){return new(i||o)(q(ee),q(T),q(Me),q(co$1),q(Vg),q($n$1),q(A0),q(Pn$1),q(ie),q($e))};static ɵcmp=t_({type:o,selectors:[[`app-annotations-state-dialoge`]],hostBindings:function(i,t){i&1&&$y(`resize`,function(d){return t.onResize(d)},xC)},decls:49,vars:18,consts:[[`panelH`,``],[1,`stateDialog`,`xs:w-[94%]`,`md:w-full`],[`dir`,`rtl`,1,`flex`,`flex-row`,`flex-wrap`,`justify-start`],[`mat-dialog-title`,``,1,`headDiv`,`head_1`,`flex`,`flex-row`,`flex-wrap`,`w-full`],[1,`w-full`,`headP`,`text-[#403c58]`,`dark:!text-white`,`text-[16px]`,`mr-1`,`font-semibold`,`p-3`],[`matTooltip`,`إغلاق`,1,`float-left`,`close_icon`,`d-inline-block`,3,`mat-dialog-close`],[1,`headDiv`,`head_2`,`flex`,`flex-row`,`flex-wrap`,`w-full`],[`appearance`,`outline`,1,`ml-3`,`h-5`,`mt-2`,`mr-2`,`w-[70%]`,`sm:w-[22%]`],[1,`dark:!text-white`,2,`font-size`,`13px`],[1,`matselect`,`dark:!text-white`,3,`ngModelChange`,`ngModel`],[`value`,`all`,3,`onSelectionChange`],[3,`value`],[`aria-labelledby`,`example-radio-group-label`,1,`flex`,`flex-col`,`w-[8%]`,`example-radio-group`,3,`ngModelChange`,`ngModel`],[1,`example-radio-button`,3,`value`],[`appearance`,`outline`,1,`flex`,`w-full`,`h-5`,`mt-2`,`sm:w-[20%]`,`ml-3`,`mr-6`,`dark:!text-white`],[1,`dark:!text-white`],[1,`dark:!text-white`,3,`ngModelChange`,`ngModel`],[`value`,`1`,3,`onSelectionChange`],[`value`,`2`,3,`onSelectionChange`],[`value`,`3`,3,`onSelectionChange`],[1,`flex`,`flex-col`,`md:w-[42%]`,`md:mt-0`,`xs:mt-12`,`xs:w-full`,`justify-center`,`gap-[5px]`],[`mat-raised-button`,``,1,`saveBtn`,`bg-[#6c5dcc]`,`text-white`,`mr-1`,3,`click`,`disabled`],[1,`flex`,`flex-row`,`flex-wrap`,`w-full`,`justify-end`,`gap-[15px]`],[2,`margin`,`0px 14px`,`font-size`,`16px`],[`name`,`all`,1,`select`,`dark:!text-white`,3,`ngModelChange`,`click`,`change`,`ngModel`],[`dir`,`rtl`,1,`zero_state`],[1,`flex`,`flex-row`,`flex-wrap`,`w-full`],[1,`flex`,`flex-row`,`flex-wrap`,`w-full`,`mt-3`],[`mat-raised-button`,``,1,`mt-2`,`mb-2`,`p-5`,`MoreBtn`,3,`hidden`],[3,`onSelectionChange`,`value`],[1,`fas`,`fa-sticky-note`,`text-info`],[1,`option_txt`],[1,`example-radio-button`,3,`change`,`value`],[`src`,`./assets/images/svgImages/folder.svg`,`alt`,`لا يوجد إثراء`,1,`inline-block`],[1,`w-[95%]`,`requests_occordion`],[3,`afterExpand`,`afterCollapse`,`id`],[`dir`,`ltr`,1,`h-auto`,3,`collapsedHeight`,`expandedHeight`],[`color`,`gray`,1,`childSelect`,3,`click`,`ngModelChange`,`name`,`ngModel`],[`dir`,`rtl`,1,`occordion_description`,3,`id`],[1,`flex`,`flex-row`,`flex-wrap`,`w-full`,`sm:w-[80%]`,`annotator_name`,`quote`],[1,`flex`,`flex-row`,`flex-wrap`,`justify-center`,`mr-2`,`mt-2`,`mb-2`],[1,`annotator_name`,`w-full`],[1,`quoteIcon`,`fa`,`fa-quote-right`],[1,`dark:!text-black`,3,`innerHtml`],[1,`quoteIcon`,`fa`,`fa-quote-left`],[1,`annotator_quote`,`w-full`,3,`innerHtml`],[1,`flex`,`flex-row`,`flex-wrap`,`justify-end`,`w-[20%]`],[`matTooltipPosition`,`above`,`matTooltip`,`إثراء خاص`,1,`fas`,`fa-user-lock`,`stateIcon`,`stateIconPrivate`],[`matTooltipPosition`,`above`,`matTooltip`,`إثراء عام`,1,`fas`,`fa-users`,`stateIcon`],[`matExpansionPanelContent`,``],[1,`w-full`,`mb-3`,`mt-0`],[1,`w-full`,`flex`,`flex-row`,`flex-wrap`,`justify-center`],[1,`mb-1`,3,`src`],[`controls`,``,1,`mb-2`,`w-full`,`file-preview-sound`,3,`src`],[`alt`,`صورة خاصة بالإثراء`,2,`max-width`,`400px`,`max-height`,`300px`,3,`src`],[`dir`,`rtl`,1,`annotation_desc`,`white_spaces`],[1,`ml-2`],[3,`innerHtml`],[1,`w-full`,`my-2`],[`href`,`javascript:;`,1,`show_more`,`font-weight-bold`,`bg-white`,`py-1`,`px-3`,`rounded-lg`,`border-color-1`,`text-color-1`,`ring-1`,`ring-color-1`],[1,`my-2`],[`dir`,`rtl`,1,`flex`,`flex-row`,`flex-wrap`,`justify-between`,`mb-5`],[`dir`,`rtl`,1,`annotation_date`],[2,`vertical-align`,`bottom`],[`src`,`./assets/images/svgImages/liked.svg`,`alt`,`عدد الإعجابات`,1,`inline-block`,`mr-2`,`w-6`],[1,`w-full`,`mt-0`],[1,`w-full`,3,`bookId`,`copyId`,`edit`,`attachmentsIds`,`canDelete`,`attachmentsNames`,`annotatorId`,`annotation`],[1,`flex`,`flex-row`,`flex-wrap`],[`dir`,`rtl`,1,`w-full`,`publishP`],[`dir`,`rtl`,1,`w-full`,`rejectedP`],[`dir`,`rtl`,1,`w-full`,`pendingP`],[`alt`,`صورة خاصة بالإثراء`,2,`max-width`,`400px`,`max-height`,`300px`,3,`click`,`src`],[`href`,`javascript:;`,1,`show_more`,`font-weight-bold`,`bg-white`,`py-1`,`px-3`,`rounded-lg`,`border-color-1`,`text-color-1`,`ring-1`,`ring-color-1`,3,`click`],[1,`fas`,`fa-check-circle`],[1,`auth-link`],[1,`material-icons`],[1,`fas`,`fa-pause-circle`],[`mat-raised-button`,``,1,`mt-2`,`mb-2`,`p-5`,`MoreBtn`,3,`click`,`hidden`]],template:function(i,t){i&1&&(ma(0,`div`,1)(1,`div`,2)(2,`div`,3)(3,`p`,4),$S(4),ma(5,`button`,5)(6,`mat-icon`),$S(
17,`close`),Rd()()()(),ma(8,`div`,6)(9,`mat-form-field`,7)(10,`mat-label`,8),$S(11,`اختر الفصل `),Rd(),ma(12,`mat-select`,9),pv(`ngModelChange`,function(d){return WS(t.selectedOption,d)||(t.selectedOption=d),d}),ma(13,`mat-option`,10),$y(`onSelectionChange`,function(d){return t.chooseChapter(d,`all`,`all`)}),$S(14,`الكل`),Rd(),tS(15,Ki,4,2,`mat-option`,11,eS),Rd(),pb(),Rd(),ma(17,`mat-radio-group`,12),pv(`ngModelChange`,function(d){return WS(t.selectedType,d)||(t.selectedType=d),d}),tS(18,Xi,3,2,`mat-radio-button`,13,eS),Rd(),pb(),ma(20,`mat-form-field`,14)(21,`mat-label`,15),$S(22,`رتب حسب`),Rd(),ma(23,`mat-select`,16),pv(`ngModelChange`,function(d){return WS(t.sortBy,d)||(t.sortBy=d),d}),ma(24,`mat-option`,17),$y(`onSelectionChange`,function(d){return t.filterAnnotations(d,1)}),$S(25,`الأحدث`),Rd(),ma(26,`mat-option`,18),$y(`onSelectionChange`,function(d){return t.filterAnnotations(d,2)}),$S(27,`الأكثر إعجابا`),Rd(),ma(28,`mat-option`,19),$y(`onSelectionChange`,function(d){return t.filterAnnotations(d,3)}),$S(29,`حسب الورود في الكتاب`),Rd()(),pb(),Rd(),ma(30,`div`,20)(31,`button`,21),$y(`click`,function(){return t.saveAnnotationsState(!0)}),$S(32,` تحويل إلى عام `),Rd(),ma(33,`button`,21),$y(`click`,function(){return t.saveAnnotationsState(!1)}),$S(34,` تحويل إلى خاص `),Rd()(),ma(35,`div`,22)(36,`div`)(37,`p`,23),$S(38),Rd()(),ma(39,`mat-checkbox`,24),pv(`ngModelChange`,function(d){return WS(t.allComplete,d)||(t.allComplete=d),d}),$y(`click`,function(d){return d.stopPropagation()})(`change`,function(d){return t.setAll(d.checked)}),ma(40,`p`,15),$S(41),Rd()(),pb(),Rd()(),K_(42,Ji,4,0,`div`,25),K_(43,Qi,2,0,`div`,26),tS(44,po,24,25,`div`,27,eS),fM(46,`slice`),Fy(47,`br`),K_(48,mo,2,1,`button`,28),Rd()()),i&2&&(NT(4),uv(` إثراءات نسخة (`,t.copyTitle,`) (`,t.annotations.length,`) `),NT(),ky(`mat-dialog-close`,!0),NT(7),fv(`ngModel`,t.selectedOption),gb(),NT(3),nS(t.chapters),NT(2),fv(`ngModel`,t.selectedType),gb(),NT(),nS(t.types),NT(5),fv(`ngModel`,t.sortBy),gb(),NT(8),ky(`disabled`,t.allToPublic==!0&&t.bothTypes==!1||t.selectedAnnotationsCount==0),NT(2),ky(`disabled`,t.allToPrivate==!0&&t.bothTypes==!1||t.selectedAnnotationsCount==0),NT(5),Ld(`عدد الإثراءات المحددة (`,t.selectedAnnotationsCount,`)`),NT(),fv(`ngModel`,t.allComplete),gb(),NT(2),cv(t.task.name),NT(),X_(t.annotations?.length==0&&!t.startLoading?42:-1),NT(),X_(t.startLoading?43:-1),NT(),nS(mM(46,14,t.annotations,0,t.counter)),NT(4),X_(t.annotations.length>5?48:-1))},dependencies:[Lo$1,Eo$1,Ge,Ee,Io$1,ke,Mt$1,wt,vr,cr$1,En$1,Ge$1,me,oe,J,Z,fn$1,xn$1,Oe,Fe,gn$1,He,ge,ae,Ht,Bt,jt,jt$1,$t$1,y,u,st,nt,VN],styles:[`.anno-quote[_ngcontent-%COMP%]{font-size:22px}  .dark .saveBtn:disabled{background-color:#a7a7a7!important;color:#565656!important}.select[_ngcontent-%COMP%]{font-size:14px;margin-left:4%;margin-bottom:6px}  .dark .headDiv .mat-checkbox-frame{border-color:#fff}  .dark .headDiv .mat-radio-outer-circle{border-color:#fff}  .mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:#6c5dcc}  .mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:#6c5dcc}  .mat-mdc-radio-button.mat-accent{--%NS%mat-radio-selected-focus-icon-color: #6c5dcc;--%NS%mat-radio-selected-hover-icon-color: #6c5dcc;--%NS%mat-radio-selected-icon-color: #6c5dcc;--%NS%mat-radio-selected-pressed-icon-color: #6c5dcc}  .mat-mdc-form-field-subscript-wrapper{display:none}.childSelect[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}[_nghost-%COMP%]  .mat-checkbox-checked .mat-checkbox-background, [_nghost-%COMP%]  .mat-checkbox-indeterminate .mat-checkbox-background{background:#6c5dcc!important;border-radius:6px!important}[_nghost-%COMP%]     .mat-mdc-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle{border-color:#6c5dcc!important}[_nghost-%COMP%]  .mat-mdc-radio-button.mat-accent .mat-radio-inner-circle, .mat-radio-button.mat-accent[_ng
1content-%COMP%]   .mat-radio-ripple[_ngcontent-%COMP%]   .mat-ripple-element[_ngcontent-%COMP%]:not(.mat-radio-persistent-ripple)   .mat-radio-button.mat-accent.mat-radio-checked[_ngcontent-%COMP%]   .mat-radio-persistent-ripple[_ngcontent-%COMP%], .mat-radio-button.mat-accent[_ngcontent-%COMP%]:active   .mat-radio-persistent-ripple[_ngcontent-%COMP%]{background-color:#6c5dcc!important}.headDiv[_ngcontent-%COMP%]{position:sticky;z-index:10;background:transparent url("/media/ithraa-navbar-bg-OAUWAFDV.webp") repeat}  .dark .headDiv{background:#000;color:#fff}.head_1[_ngcontent-%COMP%]{top:-24px}.head_2[_ngcontent-%COMP%]{top:80px}  .dark .mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input{color:#fff!important}  .dark .mdc-text-field--%NS%outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__leading,   .dark .mdc-text-field--%NS%outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__notch,   .dark .mdc-text-field--%NS%outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing{border-color:#fff!important}.anno-text[_ngcontent-%COMP%]{font-size:18px;line-height:23px}
1.publishP[_ngcontent-%COMP%]{color:#010e0f;font-weight:700}.publishP[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:18px}.rejectedP[_ngcontent-%COMP%]{color:#ec5f5f;font-weight:700}.rejectedP[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:18px}.pendingP[_ngcontent-%COMP%]{color:#10b1bf;font-weight:700}.pendingP[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:18px}.material-icons[_ngcontent-%COMP%]{vertical-align:bottom}.ann-card[_ngcontent-%COMP%]{width:95%!important;background:#f2feff!important;border:1px solid #f2feff}[_nghost-%COMP%]  .mat-bottom-sheet-container{min-height:40vh;height:40vh}.quote[_ngcontent-%COMP%]{font-size:15px;font-weight:700;color:gray}.message[_ngcontent-%COMP%]{overflow-wrap:anywhere}.quote[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#c5c5c5}.quote-icon[_ngcontent-%COMP%]{font-size:12px;color:gray}.qouteicon[_ngcontent-%COMP%]{color:#848484!important}.replied_annotation_date[_ngcontent-%COMP%]   i.fa-calendar[_ngcontent-%COMP%]{background-color:#398389!important;padding:5px;border-radius:50%;color:#ffffffe8;font-size:16px}.replied_annotation_date[_ngcontent-%COMP%], .reject_hint[_ngcontent-%COMP%], .accept_hint[_ngcontent-%COMP%]{font-size:17px}.annotation_desc[_ngcontent-%COMP%]{color:#565656;font-size:14px;margin-top:13px}.annotation_date[_ngcontent-%COMP%]{font-size:13px;color:#333}.requests_occordion   [_nghost-%COMP%]  .mat-expansion-panel-header-title, .mat-expansion-panel-header-description[_ngcontent-%COMP%]{margin-right:0!important;padding-top:20px}.requests_occordion   [_nghost-%COMP%]  .mat-expansion-indicator{position:absolute!important;left:15px!important}.chat-messages-show-container[_ngcontent-%COMP%]{height:auto;max-height:400px;display:flex;flex-direction:column;overflow:auto}.chat-messages-show-list[_ngcontent-%COMP%]{background:#f3f7e6;list-style-type:none;margin:0;padding:0;border-radius:5px}.chat-messages-create-container[_ngcontent-%COMP%]{height:100px;display:flex;justify-content:center}.chat-messages-create-input[_ngcontent-%COMP%]{padding:12px;margin:29px 30px;flex:2}.notfounddiv[_ngcontent-%COMP%]{text-align:center;font-size:18px;color:#a7a7a7;padding:20px;border-radius:5px;margin-top:10px}.chat-messages-create-button[_ngcontent-%COMP%]{height:50px;margin:auto 40px;width:100px}a.mat-mdc-raised-button[_ngcontent-%COMP%]{padding:0 15px;border-radius:5px;color:#fff;font-size:17px;height:31px}a.mat-mdc-raised-button[_ngcontent-%COMP%]:hover{color:#fff;text-decoration:none}a.remove[_ngcontent-%COMP%]{background-color:#e74e51!important}a.accept[_ngcontent-%COMP%]{background-color:#46d03c!important}.my_message[_ngcontent-%COMP%]{border-radius:6px;background-color:#c1dcc6!important;color:#565656!important;padding:10px;margin:7px 0 7px 31px;overflow-wrap:anywhere}.not_my_message[_ngcontent-%COMP%]{border-radius:6px;margin:7px 31px 7px 0;padding:10px;background-color:bisque;overflow-wrap:anywhere!important}.accepted_request[_ngcontent-%COMP%]{background-color:#d6e6d9!important}.rejected_request[_ngcontent-%COMP%]{background-color:#edd0d1!important}.accept_hint[_ngcontent-%COMP%], .reject_hint[_ngcontent-%COMP%]{width:100%;direction:rtl}.accept_hint[_ngcontent-%COMP%]   .material-icons[_ngcontent-%COMP%]{color:#718b23;vertical-align:middle}.reject_hint[_ngcontent-%COMP%]   .material-icons[_ngcontent-%COMP%]{color:#cc3030;vertical-align:middle}.actions_menu[_ngcontent-%COMP%]{position:absolute;left:1px;top:.6em}.requests_occordion   [_nghost-%COMP%]  .mat-expansion-indicator{position:absolute!important;left:35px!important}.mat-mdc-menu-item[_ngcontent-%COMP%]{color:#929292;font-size:14px}.mat-accordion[_ngcontent-%COMP%]{margin:auto!important}.delete_icon[_ngcontent-%COMP%]{vertical-align:text-top!important}.seen-icon[_ngcontent-%COMP%]{float:left;font-size:11px;color:gray}.search_hint[_ngcontent-%COMP%]{text-align:center;font-size:16px;color:#a7a7a7;padding:10px 0 20px;border-radius:5px;margin-top:10px}.example-radio-button[_ngcontent-%COMP%]{font-size:13px}.annotator_name[_ngcontent-%COMP%]{color:#2a4d67;font-weight:700;margin:0 0 0 5px;position:relative;bottom:2px;font-size:12px}.annotator_quote[_ngcontent-%COMP%]{color:#2a4d67;font-weight:700;margin:0 0 5px 5px;bottom:2px;font-size:12px;position:relative;top:7px}.quoteIcon[_ngcontent-%COMP%]{color:#c5c5c4;font-size:8px;margin:0 3px}.requests_occordion   [_nghost-%COMP%]  .mat-expansion-panel-header{height:auto!important;direction:rtl}.auth-link[_ngcontent-%COMP%]{color:#87cefa;cursor:pointer}.MoreBtn[_ngcontent-%COMP%]{width:95%;margin:8px auto!important;color:#fff;font-size:14px;background-color:#6c5dcc;cursor:pointer;outline:none!important}.toggleIcon[_ngcontent-%COMP%]{position:relative;top:11px;left:-3%;color:transparent;font-size:21px;z-index:1000;width:25px}.stateIcon[_ngcontent-%COMP%]{position:relative;top:5px;z-index:0;font-size:23px;color:#4f9197}.stateIconPrivate[_ngcontent-%COMP%]{color:#ac6660}[_nghost-%COMP%]  .mat-select-panel mat-option.mat-mdc-option{height:unset!important}[_nghost-%COMP%]  .mat-mdc-form-field-subscript-wrapper{display:none}  .dark .mat-mdc-form-field-appearance-outline .mat-mdc-form-field-outline{color:#fff!important}  .mat-mdc-checkbox.mat-mdc-checkbox-checked .mdc-checkbox__background, .mdc-checkbox__ripple[_ngcontent-%COMP%]{background-color:#6c5dcc!important;border-color:#6c5dcc!important}[_nghost-%COMP%]  .mat-option-text.mat-option-text{white-space:normal!important}@media(max-width:600px){.headDiv[_ngcontent-%COMP%]{position:static}}.mat-form-field-appearance-outline[_ngcontent-%COMP%]   .mat-form-field-outline[_ngcontent-%COMP%]{color:#fff}`],changeDetection:1})}return o}
1)();var St=jx(L());var Li=jx(Hn$1());function ho(o,l){o&1&&(ma(0,`div`,5),Fy(1,`mat-spinner`,6),Rd())}function go(o,l){if(o&1){let e=cS();ma(0,`div`,8)(1,`button`,12),$y(`click`,function(){Jp(e);return eh(pS(2).logSelectedChapters())}),$S(2,` تصدير الإثراءات `),Rd()()}if(o&2){let e=pS(2);NT(),ky(`disabled`,!e.isAtLeastOneChapterSelected)}}function _o(o,l){if(o&1){let e=cS();ma(0,`div`,9),Fy(1,`img`,13),ma(2,`p`),$S(3,`لا يمكن تحديد الأبواب لهذا الكتاب لذلك سيتم تصدير كل إثراءات النسخة`),Rd(),ma(4,`button`,14),$y(`click`,function(){Jp(e);return eh(pS(2).exportAnnotationsForWholeCopy())}),$S(5,` تصدير كل إثراءات النسخة `),Rd()()}}function fo(o,l){o&1&&(ma(0,`div`,9),Fy(1,`img`,13),ma(2,`p`),$S(3,`لا توجد إثراءات في هذه النسخه`),Rd()())}function Co(o,l){if(o&1){let e=cS();ma(0,`div`,15)(1,`mat-checkbox`,18),pv(`ngModelChange`,function(t){let r=Jp(e).$implicit;return WS(r.checked,t)||(r.checked=t),eh(t)}),$y(`ngModelChange`,function(){Jp(e);return eh(pS(3).updateSelectAll())}),Rd(),pb(),ma(2,`span`,17),$S(3),Rd()()}if(o&2){let e=l.$implicit;NT(),ky(`name`,e.toc_id),fv(`ngModel`,e.checked),gb(),NT(2),cv(e.chapter_title)}}function bo(o,l){if(o&1){let e=cS();ma(0,`div`,11)(1,`div`,15)(2,`mat-checkbox`,16),pv(`ngModelChange`,function(t){Jp(e);let r=pS(2);return WS(r.allComplete,t)||(r.allComplete=t),eh(t)}),$y(`change`,function(){Jp(e);return eh(pS(2).selectAllChapters())}),ma(3,`span`,17),$S(4,`الكل`),Rd()(),pb(),Rd(),tS(5,Co,4,3,`div`,15,eS),Rd()}if(o&2){let e=pS(2);NT(2),fv(`ngModel`,e.allComplete),gb(),NT(3),nS(e.copyChapters)}}function xo(o,l){if(o&1&&(ma(0,`div`,7),K_(1,go,3,1,`div`,8),Rd(),K_(2,_o,6,0,`div`,9),K_(3,fo,4,0,`div`,9),ma(4,`div`,10),K_(5,bo,7,1,`div`,11),Rd()),o&2){let e=pS();NT(),X_(e.chaptersCount>0?1:-1),NT(),X_(e.chaptersCount==0&&e.userAnnotationsCount>0&&e.bookType===`pdf`?2:-1),NT(),X_(e.userAnnotationsCount==0?3:-1),NT(2),X_(e.chaptersCount>0?5:-1)}}var _t=(()=>{class o{dashboardService;dialogRef;data;bookCopyId;copyTitle;authUserId;bookId;copyChapters;chapterIds={};toc_id=[];isLoading=!0;isAtLeastOneChapterSelected=!1;chaptersCount=0;allComplete=!1;userAnnotationsCount=0;bookType=``;constructor(e,i,t){this.dashboardService=e,this.dialogRef=i,this.data=t,this.authUserId=this.data.AuthUserId,this.bookId=this.data.bookId,this.bookCopyId=this.data.bookCopy,this.copyTitle=this.data.copyTitle,this.bookType=this.data.bookType,this.userAnnotationsCount=this.data.annotaionsCount}ngOnInit(){this.dashboardService.getChapterCopies(this.bookId,this.bookCopyId,this.authUserId).subscribe({next:e=>{e&&e.length>0&&e[0]?.chapter_title!=null&&(this.copyChapters=e,this.chaptersCount=e.length,this.copyChapters=this.copyChapters.map(i=>X(U({},i),{checked:!1}))),this.isLoading=!1},error:()=>{this.copyChapters=[],this.chaptersCount=0,this.allComplete=!1,this.isAtLeastOneChapterSelected=!1,this.isLoading=!1}})}selectAllChapters(){(this.copyChapters||[]).forEach(e=>e.checked=this.allComplete),this.updateSelectAll()}updateSelectAll(){this.allComplete=(this.copyChapters||[]).every(e=>e.checked),this.isAtLeastOneChapterSelected=(this.copyChapters||[]).some(e=>e.checked)}logSelectedChapters(){let e=(this.copyChapters||[]).filter(i=>i.checked);this.toc_id=e.map(i=>i.toc_id),this.dialogRef.close({affectedRows:this.toc_id})}exportAnnotationsForWholeCopy(){this.dialogRef.close({affectedRows:`all`})}closeDialog(){this.dialogRef.close({close:!0})}static ɵfac=function(i){return new(i||o)(q(Me),q(T),q($e))};static ɵcmp=t_({type:o,selectors:[[`app-get-excel-dialoge`]],decls:11,vars:4,consts:[[1,`stateDialog`,`xs:w-[94%]`,`md:w-full`],[`dir`,`rtl`,1,`flex`,`flex-row`,`flex-wrap`],[`mat-dialog-title`,``,1,`flex`,`flex-row`,`headDiv`,`w-full`],[1,`w-full`,`text-[#403c58]`,`dark:!text-white`,`text-[16px]`,`mr-1`,`font-semibold`],[`matTooltip`,`إغلاق`,1,`float-left`,`close_icon`,`d-inline-block`,3,`click`,`mat-dialog-close`],[1,`flex`,`w-full`,`justify-center`,`items-center`,`py-10`],[`diameter`,`30`],[`mat-dialog-title`,``,1,`headDiv`,`w-full`,`flex`,`flex-row`,`flex-wrap`],[1,`flex`,`flex-col`,`justify-center`,`items-center`],[`dir`,`rtl`,1,`zero_state`],[1,`flex`,`w-full`,`justify-center`],[1,`w-[95%]`,`flex`,`flex-row`,`flex-wrap`,`mt-3`],[`mat-raised-button`,``,1,`saveBtn`,`bg-[#6c5dcc]`,`w-full`,`sm:w-[30%]`,`py-2`,`rounded-lg`,`text-white`,`mr-1`,3,`click`,`disabled`],[`src`,`./assets/images/svgImages/folder.svg`,`alt`,`لا توجد نسخ`,1,`inline-block`],[`mat-raised-button`,``,1,`saveBtn`,`bg-[#6c5dcc]`,`w-full`,`sm:w-[30%]`,`py-2`,`rounded-lg`,`text-white`,`mr-1`,3,`click`],[1,`w-full`,`mb-2`,`py-5`,`px-2`,`border`,`border-[#e7e7e7]`,`rounded-xl`,`shadow-div-shadow`],[`name`,`all`,1,`text-[14px]`,`ml-2`,3,`ngModelChange`,`change`,`ngModel`],[1,`dark:!text-white`],[3,`ngModelChange`,`name`,`ngModel`]],template:function(i,t){i&1&&(ma(0,`div`,0)(1,`div`,1)(2,`div`,2)(3,`p`,3),$S(4),ma(5,`button`,4),$y(`click`,function(){return t.closeDialog()}
1),ma(6,`mat-icon`),$S(7,`close`),Rd()()()(),K_(8,ho,2,0,`div`,5),K_(9,xo,6,4),Fy(10,`br`),Rd()()),i&2&&(NT(4),Ld(` تصدير إثراءات نسخة (`,t.copyTitle,`) `),NT(),ky(`mat-dialog-close`,!0),NT(3),X_(t.isLoading?8:-1),NT(),X_(t.isLoading?-1:9))},dependencies:[Lo$1,Eo$1,Mt$1,wt,vr,cr$1,En$1,Ge$1,J,Z,fn$1,ge,ae,Ht,Bt,jt],styles:[`.dark .headDiv .mat-checkbox-frame{border-color:#fff}  .dark .headDiv .mat-radio-outer-circle{border-color:#fff}.headDiv[_ngcontent-%COMP%]{position:sticky;z-index:10;background:transparent url("/media/ithraa-navbar-bg-OAUWAFDV.webp") repeat}  .dark .headDiv{background:none;color:#fff}@media(max-width:600px){.headDiv[_ngcontent-%COMP%]{position:static}}  .dark .saveBtn:disabled{background-color:#a7a7a7!important;color:#565656!important}`],changeDetection:1})}return o})();var Ii={recent:`الأحدث إضافة`,oldest:`الأقدم إضافة`,title:`اسم الكتاب`,enriched:`الأكثر إثراءً`,owner:`صاحب النسخة`};var ko=/[ً-ٰـ]/g;var vo={};function Oi(o){if(!o)return``;let l=o.replace(ko,``),e=``;for(let i of l)e+=vo[i]??i;return e.toLowerCase().replace(/\s+/g,` `).trim()}function wo(o,l){let e=Oi(l);if(!e)return!0;let i=Oi([o?.bookTitle,o?.copyName,o?.ownerName,o?.category].filter(Boolean).join(` `));return e.split(` `).every(t=>i.includes(t))}function yo(o,l){let e=t=>new Date(t?.createdAt??0).getTime()||0,i=[...o];switch(l){case`oldest`:return i.sort((t,r)=>e(t)-e(r));case`title`:return i.sort((t,r)=>String(t?.bookTitle??``).localeCompare(String(r?.bookTitle??``),`ar`));case`enriched`:return i.sort((t,r)=>(r?.written??0)-(t?.written??0));case`owner`:return i.sort((t,r)=>String(t?.ownerName??``).localeCompare(String(r?.ownerName??``),`ar`));default:return i.sort((t,r)=>e(r)-e(t))}}var Ne=class{sortKeys;searchTerm=``;sortKey;page=1;pageSize=5;source=[];cache=null;constructor(l){this.sortKeys=l,this.sortKey=l[0]}setCards(l){this.source=l??[]}get sortOptions(){return this.sortKeys.map(l=>({key:l,label:Ii[l]}))}get sortLabel(){return Ii[this.sortKey]}get filtered(){let l=`${this.searchTerm}|${this.sortKey}`;if(this.cache&&this.cache.source===this.source&&this.cache.key===l)return this.cache.rows;let e=yo(this.source.filter(i=>wo(i,this.searchTerm)),this.sortKey);return this.cache={key:l,source:this.source,rows:e},e}get filteredCount(){return this.filtered.length}get totalPages(){return Math.max(1,Math.ceil(this.filteredCount/this.pageSize))}get currentPage(){return Math.min(this.page,this.totalPages)}get pageNumbers(){let l=this.totalPages,e=Math.max(1,Math.min(this.currentPage-2,l-4));return Array.from({length:Math.min(5,l)},(i,t)=>e+t)}get pagedCards(){let l=(this.currentPage-1)*this.pageSize;return this.filtered.slice(l,l+this.pageSize)}get rangeStart(){return this.filteredCount===0?0:(this.currentPage-1)*this.pageSize+1}get rangeEnd(){return Math.min(this.currentPage*this.pageSize,this.filteredCount)}search(l){this.searchTerm=l,this.page=1}clearSearch(){this.search(``)}setSort(l){this.sortKey=l,this.page=1}goToPage(l){let e=Math.max(1,Math.min(l,this.totalPages));return e===this.currentPage?!1:(this.page=e,!0)}};var Bi=o=>({$implicit:o});var Mo=(o,l)=>l.key;var Ao=(o,l)=>l.id;function Eo(o,l){if(o&1){let e=cS();ma(0,`button`,18),$y(`click`,function(){Jp(e);return eh(pS().view.clearSearch())}),dh(),ma(1,`svg`,19),Fy(2,`path`,20),Rd()()}}function Po(o,l){o&1&&(dh(),ma(0,`svg`,4),Fy(1,`circle`,21)(2,`path`,22),Rd())}function To(o,l){if(o&1){let e=cS();ma(0,`button`,23),$y(`click`,function(){let t=Jp(e).$implicit;return eh(pS().view.setSort(t.key))}),ma(1,`span`),$S(2),Rd()()}if(o&2){let e=l.$implicit,i=pS();Oy(`aria-current`,e.key===i.view.sortKey),NT(),Jy(`font-bold`,e.key===i.view.sortKey),NT(),cv(e.label)}}function Io(o,l){if(o&1){let e=cS();ma(0,`button`,27),$y(`click`,function(){Jp(e);return eh(pS(2).view.clearSearch())}),$S(1,` امسح البحث `),Rd()}}function Oo(o,l){if(o&1&&(ma(0,`div`,14)(1,`p`,24),$S(2),Rd(),ma(3,`p`,25),$S(4),Rd(),K_(5,Io,2,0,`button`,26),Rd()),o&2){let e=pS();NT(2),Ld(` `,e.view.searchTerm?e.noResultsTitle:e.emptyTitle,` `),NT(2),Ld(` `,e.view.searchTerm?e.noResultsBody:e.emptyBody,` `),NT(),X_(e.view.searchTerm?5:-1)}}function Bo(o,l){if(o&1&&jy(0,36),o&2){let e=pS().$implicit;ky(`ngTemplateOutlet`,pS().headerActions)(`ngTemplateOutletContext`,oM(2,Bi,e))}}function Do(o,l){if(o&1&&(ma(0,`p`,40)(1,`span`,41)(2,`span`,42),dh(),ma(3,`svg`,43),Fy(4,`path`,44)(5,`path`,45),Rd(),$S(6,` الإثراءات `),Rd(),fh(),ma(7,`span`),$S(8,`المكتوبة`),Rd()(),ma(9,`span`,46),$S(10),Rd()(),ma(11,`p`,40)(12,`span`,41)(13,`span`,42),dh(),ma(14,`svg`,43),Fy(15,`path`,47)(16,`path`,48),Rd(),$S(17,` الإثراءات `),Rd(),fh(),ma(18,`span`),$S(19,`المعتمدة`),Rd()(),ma(20,`span`,46),$S(21),Rd()()),o&2){let e=pS().$implicit;Oy(`aria-label`,`الإثراءات المكتوبة: `+e.written),NT(10),cv(e.written),NT(),Oy(`aria-label`,`الإثراءات المعتمدة: `+e.approved),NT(10),cv(e.approved)}}function Fo(o,l){if(o&1&&(ma(0,`p`,52)(1,`span`,53),$S(2),Rd()()),o&2){let e=pS(2).$implicit;Oy(`aria-label`,`فئة الكتاب: `+e.category),NT(2),Ld(` `,e.category,` `)}}function Lo(o,l){if(o&1&&(ma(0,`p`,49),Fy(1,`img`,50),ma(2,`span`,51),$S(3),Rd()(),K_(4,Fo,3,2,`p`,52)),o&2){let e=pS().$implicit;Oy(`aria-label`,`صاحب النسخة: `+e.ownerName),NT(),ky(`src`,e.ownerAvatar,im),NT(2),Ld(` `,e.ownerName,` `),NT(),X_(e.category?4:-1)}}function Vo(o,l){if(o&1&&(ma(0,`div`,39),jy(1,36),Rd()),o&2){let e=pS().$implicit,i=pS();NT(),ky(`ngTemplateOutlet`,i.actions)(`ngTemplateOutletContext`,oM(2,Bi,e))}}function jo(o,l){if(o&1&&(ma(0,`article`,15)(1,`div`,28)(2,`a`,29),Fy(3,`img`,30),Rd(),ma(4,`div`,31)(5,`div`,32)(6,`div`,33)(7,`h3`,34),$S(8),Rd(),ma(9,`p`,35),$S(10),Rd()(),K_(11,Bo,1,4,`ng-container`,36),Rd(),ma(12,`div`,37)(13,`div`,38),K_(14,Do,22,4)(15,Lo,5,4),Rd(),K_(16,Vo,2,4,`div`,39),Rd()()()()),o&2){let e=l.$implicit,i=pS();NT(2),ky(`routerLink`,e.bookLink),Oy(`aria-label`,`صفحة كتاب `+e.bookTitle),NT(),ky(`src`,e.coverUrl,im),NT(5),Ld(` `,e.bookTitle,` `),NT(2),Ld(` `,e.copyName,` `),NT(),X_(i.headerActions?11:-1),NT(3),X_(e.written!==void 0?14:15),NT(2),X_(i.actions?16:-1)}}function Ro(o,l){if(o&1){let e=cS();ma(0,`button`,60),$y(`click`,function(){let t=Jp(e).$implicit;return eh(pS(2).goToPage(t))}),$S(1),Rd()}if(o&2){let e=l.$implicit,i=pS(2);Jy(`is-current`,e===i.view.currentPage),Oy(`aria-current`,e===i.view.currentPage?`page`:null)(`aria-label`,`الصفحة `+e),NT(),Ld(` `,e,` `)}}function $o(o,l){if(o&1){let e=cS();ma(0,`nav`,16)(1,`button`,54),$y(`click`,function(){Jp(e);let t=pS();return eh(t.goToPage(t.view.currentPage-1))}),dh(),ma(2,`svg`,55),Fy(3,`path`,56),Rd()(),tS(4,Ro,2,5,`button`,57,eS),fh(),ma(6,`button`,58),$y(`click`,function(){Jp(e);let t=pS();return eh(t.goToPage(t.view.currentPage+1))}),dh(),ma(7,`svg`,55),Fy(8,`path`,59),Rd()()()}if(o&2){let e=pS();NT(),ky(`disabled`,e.view.currentPage===1),NT(3),nS(e.view.pageNumbers),NT(2),ky(`disabled`,e.view.currentPage===e.view.totalPages)}}function No(o,l){if(o&1&&(ma(0,`p`,17),$S(1),Rd()),o&2){let e=pS();NT(),lv(` عرض `,e.view.rangeStart,` - `,e.view.rangeEnd,` من `,e.view.filteredCount,` `)}}var Ve=(()=>{class o{cards=[];sortKeys=[`recent`,`oldest`,`title`,`enriched`];actions=null;headerActions=null;searchPlaceholder=`ابحث عن كتاب أو اسم نسخة…`;searchLabel=`ابحث في مكتبتك`;countNoun=`نسخة في مكتبتك`;emptyTitle=`لا نسخ هنا بعد`;emptyBody=``;noResultsTitle=`لا نسخة بهذا الاسم`;noResultsBody=`جرّب اسم كتاب آخر، أو ابحث باسم النسخة التي أنشأتها.`;view=new Ne([`recent`,`oldest`,`title`,`enriched`]);ngOnChanges(e){e.sortKeys&&(this.view=new Ne(this.sortKeys?.length?this.sortKeys:[`title`])),this.view.setCards(this.cards)}goToPage(e){if(!this.view.goToPage(e))return;let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches;document.getElementById(`libraryListTop`)?.scrollIntoView({behavior:i?`auto`:`smooth`,block:`start`})}static ɵfac=function(i){return new(i||o)};static ɵcmp=t_({type:o,selectors:[[`app-library-list`]],inputs:{cards:`cards`,sortKeys:`sortKeys`,actions:`actions`,headerActions:`headerActions`,searchPlaceholder:`searchPlaceholder`,searchLabel:`searchLabel`,countNoun:`countNoun`,emptyTitle:`emptyTitle`,emptyBody:`emptyBody`,noResultsTitle:`noResultsTitle`,noResultsBody:`noResultsBody`},features:[jl],decls:23,vars:11,consts:[[`sortMenu`,`matMenu`],[`dir`,`rtl`],[1,`relative`,`mb-3`],[`type`,`button`,`data-testid`,`search-clear`,`aria-label`,`مسح البحث`,1,`absolute`,`end-2`,`top-1/2`,`grid`,`h-8`,`w-8`,`-translate-y-1/2`,`place-items-center`,`rounded-full`,`text-gray-500`,`focus-visible:ring-2`,`focus-visible:ring-primary-300`,`dark:text-gray-400`],[`viewBox`,`0 0 24 24`,`fill`,`none`,`aria-hidden`,`true`,1,`pointer-events-none`,`absolute`,`end-4`,`top-1/2`,`h-5`,`w-5`,`-translate-y-1/2`,`text-gray-500`],[`type`,`search`,1,`h-12`,`w-full`,`rounded-2xl`,`border`,`border-transparent`,`bg-white`,`pe-12`,`ps-4`,`text-[14px]`,`text-color-15`,`placeholder:text-gray-500`,`focus:border-primary-400`,`focus:outline-none`,`focus-visible:ring-2`,`focus-visible:ring-primary-300`,`dark:bg-dark-200`,`dark:text-white`,3,`ngModelChange`,`placeholder`,`ngModel`],[`id`,`libraryListTop`,1,`mb-3`,`flex`,`scroll-mt-24`,`items-center`,`justify-between`,`gap-3`],[1,`text-[13px]`,`text-gray-700`,`dark:text-gray-400`],[1,`font-bold`,`text-color-15`,`dark:text-white`],[`type`,`button`,1,`flex`,`h-10`,`items-center`,`gap-2`,`rounded-xl`,`border`,`border-primary-300`,`bg-white`,`px-3`,`text-[13px]`,`font-medium`,`text-color-15`,`focus-visible:ring-2`,`focus-visible:ring-primary-300`,`dark:border-dark-300`,`dark:bg-dark-200`,`dark:text-white`,3,`matMenuTriggerFor`],[`viewBox`,`0 0 24 24`,`fill`,`none`,`aria-hidden`,`true`,1,`h-4`,`w-4`],[`d`,`M8 4v16m0 0l-3.5-3.5M8 20l3.5-3.5M16 20V4m0 0l-3.5 3.5M16 4l3.5 3.5`,`stroke`,`currentColor`,`stroke-width`,`1.6`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`xPosition`,`before`],[`mat-menu-item`,``,`type`,`button`,1,`dark:!bg-dark-200`,`dark:text-white`],[1,`rounded-[20px]`,`bg-white`,`p-8`,`text-center`,`dark:bg-dark-200`],[1,`mb-3`,`rounded-[20px]`,`bg-white`,`p-3`,`shadow-[0_2px_10px_rgba(60,58,88,0.06)]`,`dark:bg-dark-200`],[`aria-label`,`صفحات القائمة`,1,`mt-4`,`flex`,`items-center`,`justify-center`,`gap-2`],[`aria-live`,`polite`,1,`mt-3`,`text-center`,`text-[12px]`,`text-gray-700`,`dark:text-gray-400`],[`type`,`button`,`data-testid`,`search-clear`,`aria-label`,`مسح البحث`,1,`absolute`,`end-2`,`top-1/2`,`grid`,`h-8`,`w-8`,`-translate-y-1/2`,`place-items-center`,`rounded-full`,`text-gray-500`,`focus-visible:ring-2`,`focus-visible:ring-primary-300`,`dark:text-gray-400`,3,`click`],[`viewBox`,`0 0 24 24`,`fill`,`none`,`aria-hidden`,`true`,1,`h-5`,`w-5`],[`d`,`M6 6l12 12M18 6L6 18`,`stroke`,`currentColor`,`stroke-width`,`1.8`,`stroke-linecap`,`round`],[`cx`,`11.5`,`cy`,`11.5`,`r`,`7.5`,`stroke`,`currentColor`,`stroke-width`,`1.6`],[`d`,`M17 17L21 21`,`stroke`,`currentColor`,`stroke-width`,`1.6`,`stroke-linecap`,`round`],[`mat-menu-item`,``,`type`,`button`,1,`dark:!bg-dark-200`,`dark:text-white`,3,`click`],[1,`text-[15px]`,`font-bold`,`text-color-15`,`dark:text-white`],[1,`mt-2`,`text-[13px]`,`leading-[1.7]`,`text-gray-700`,`dark:text-gray-400`],[`type`,`button`,1,`mt-4`,`h-10`,`rounded-xl`,`bg-primary-400`,`px-5`,`text-[13px]`,`font-medium`,`text-white`,`focus-visible:ring-2`,`focus-visible:ring-primary-300`],[`type`,`button`,1,`mt-4`,`h-10`,`rounded-xl`,`bg-primary-400`,`px-5`,`text-[13px]`,`font-medium`,`text-white`,`focus-visible:ring-2`,`focus-visible:ring-primary-300`,3,`click`],[1,`flex`,`gap-2.5`],[1,`book-cover-frame`,`shrink-0`,3,`routerLink`],[`alt`,``,1,`book-cover`,`h-[104px]`,`w-[60px]`,`object-cover`,3,`src`],[1,`flex`,`min-w-0`,`flex-1`,`flex-col`],[1,`flex`,`items-start`,`gap-2`],[1,`min-w-0`,`flex-1`],[1,`line-clamp-2`,`text-[16px]`,`font-bold`,`leading-[1.5]`,`text-color-15`,`dark:text-white`],[1,`mt-0.5`,`line-clamp-1`,`text-[12px]`,`text-gray-700`,`dark:text-gray-400`],[3,`ngTemplateOutlet`,`ngTemplateOutletContext`],[1,`mt-auto`,`flex`,`items-center`,`gap-1`,`pt-2`],[1,`flex`,`min-w-0`,`flex-1`,`divide-x`,`divide-x-reverse`,`divide-primary-300`,`rounded-xl`,`border`,`border-primary-300`,`dark:divide-dark-300`,`dark:border-dark-300`],[1,`flex`,`shrink-0`,`gap-[2px]`],[1,`min-w-0`,`flex-1`,`px-0.5`,`py-1`],[`aria-hidden`,`true`,1,`stat-label`],[1,`stat-label-lead`],[`viewBox`,`0 0 24 24`,`fill`,`none`,`aria-hidden`,`true`],[`d`,`M13.26 3.6 5.05 12.29c-.31.33-.61.98-.67 1.43l-.37 3.24c-.13 1.17.71 1.97 1.87 1.77l3.22-.55c.45-.08 1.08-.41 1.39-.75l8.21-8.69c1.42-1.5 2.06-3.21-.15-5.3-2.2-2.07-3.87-1.35-5.29.16Z`,`stroke`,`currentColor`,`stroke-width`,`1.6`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`d`,`M11.89 5.05a6.126 6.126 0 0 0 5.45 5.15`,`stroke`,`currentColor`,`stroke-width`,`1.6`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`aria-hidden`,`true`,1,`stat-value`],[`d`,`M12 22c5.5 0 10-4.5 10-10S17.5 2 12 2 2 6.5 2 12s4.5 10 10 10Z`,`stroke`,`currentColor`,`stroke-width`,`1.6`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`d`,`m7.75 12 2.83 2.83 5.67-5.66`,`stroke`,`currentColor`,`stroke-width`,`1.6`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[1,`flex`,`min-w-0`,`flex-[3]`,`items-center`,`gap-1.5`,`px-1.5`,`py-1`],[`alt`,``,1,`h-5`,`w-5`,`shrink-0`,`rounded-full`,`object-cover`,3,`src`],[`aria-hidden`,`true`,1,`truncate`,`text-[10px]`,`text-color-15`,`dark:text-white`],[1,`flex`,`min-w-0`,`flex-[2]`,`items-center`,`justify-center`,`px-1.5`,`py-1`],[`aria-hidden`,`true`,1,`truncate`,`text-[10px]`,`text-gray-700`,`dark:text-gray-400`],[`type`,`button`,`aria-label`,`الصفحة السابقة`,1,`page-pill`,3,`click`,`disabled`],[`width`,`16`,`height`,`16`,`viewBox`,`0 0 24 24`,`fill`,`none`,`aria-hidden`,`true`],[`d`,`M9 6l6 6-6 6`,`stroke`,`currentColor`,`stroke-width`,`2`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`type`,`button`,1,`page-pill`,3,`is-current`],[`type`,`button`,`aria-label`,`الصفحة التالية`,1,`page-pill`,3,`click`,`disabled`],[`d`,`M15 6l-6 6 6 6`,`stroke`,`currentColor`,`stroke-width`,`2`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`type`,`button`,1,`page-pill`,3,`click`]],template:function(i,t){if(i&1&&(ma(0,`div`,1)(1,`div`,2),K_(2,Eo,3,0,`button`,3)(3,Po,3,0,`:svg:svg`,4),ma(4,`input`,5),$y(`ngModelChange`,function(d){return t.view.search(d)}),Rd(),pb(),Rd(),ma(5,`div`,6)(6,`p`,7)(7,`span`,8),$S(8),Rd(),$S(9),Rd(),ma(10,`button`,9),dh(),ma(11,`svg`,10),Fy(12,`path`,11),Rd(),$S(13,` ترتيب `),Rd(),fh(),ma(14,`mat-menu`,12,0),tS(16,To,3,4,`button`,13,Mo),Rd()(),K_(18,Oo,6,3,`div`,14),t
1S(19,jo,17,8,`article`,15,Ao),K_(21,$o,9,2,`nav`,16),K_(22,No,2,3,`p`,17),Rd()),i&2){let r=IS(15);NT(2),X_(t.view.searchTerm?2:3),NT(2),ky(`placeholder`,t.searchPlaceholder)(`ngModel`,t.view.searchTerm),Oy(`aria-label`,t.searchLabel),gb(),NT(4),cv(t.view.filteredCount),NT(),Ld(` `,t.countNoun,` `),NT(),ky(`matMenuTriggerFor`,r),Oy(`aria-label`,`ترتيب القائمة، الترتيب الحالي: `+t.view.sortLabel),NT(6),nS(t.view.sortOptions),NT(2),X_(t.view.filteredCount===0?18:-1),NT(),nS(t.view.pagedCards),NT(2),X_(t.view.totalPages>1?21:-1),NT(),X_(t.view.filteredCount>0?22:-1)}},dependencies:[na,$t,vr,Kt,cr$1,En$1,Ht$1,Eo$1,P,ee$1,Lt,AN],styles:[`@charset "UTF-8";input[type=search][_ngcontent-%COMP%]::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none}.book-cover-frame[_ngcontent-%COMP%]{position:relative;display:block;border-radius:6px;box-shadow:0 4px 12px #3c3a582e}.book-cover-frame[_ngcontent-%COMP%]:after{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:3px;border-radius:inherit;background:linear-gradient(to left,#0000004d,#0000);pointer-events:none}.book-cover-frame[_ngcontent-%COMP%]:focus-visible{outline:2px solid #6c5dcc;outline-offset:3px}.book-cover[_ngcontent-%COMP%]{display:block;border-radius:6px;background:#f4f4f4}.stat-label[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;font-size:9px;line-height:1.35;color:#868686;text-align:center;white-space:nowrap}.stat-label-lead[_ngcontent-%COMP%]{display:flex;align-items:center;gap:3px}.stat-label[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{width:11px;height:11px;flex-shrink:0}.stat-value[_ngcontent-%COMP%]{display:block;margin-top:1px;font-size:15px;font-weight:700;line-height:1.2;color:#403c58;text-align:center}.dark[_nghost-%COMP%]   .stat-value[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .stat-value[_ngcontent-%COMP%]{color:#fff}.page-pill[_ngcontent-%COMP%]{display:grid;place-items:center;min-width:40px;height:40px;padding:0 10px;border-radius:12px;background:#fff;color:#403c58;font-size:14px;font-weight:600}.page-pill.is-current[_ngcontent-%COMP%]{background:#6c5dcc;color:#fff}.page-pill[_ngcontent-%COMP%]:disabled{opacity:.4}.page-pill[_ngcontent-%COMP%]:focus-visible{outline:2px solid #6c5dcc;outline-offset:2px}.dark[_nghost-%COMP%]   .page-pill[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .page-pill[_ngcontent-%COMP%]{background:#282828;color:#fff}.dark[_nghost-%COMP%]   .page-pill.is-current[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .page-pill.is-current[_ngcontent-%COMP%]{background:#6c5dcc}.dark[_nghost-%COMP%]   .book-cover[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .book-cover[_ngcontent-%COMP%]{background:#3f3f3f}`],changeDetection:1})}return o})();var Uo=o=>({copy:o});var Go=o=>[`/books/`,o];var Wo=(o,l)=>[`/books/Book-pdf/`,o,l];var qo=(o,l)=>[`/books/Books/`,o,l];function Zo(o,l){if(o&1&&(ma(0,`button`,13),dh(),ma(1,`svg`,14),Fy(2,`circle`,15)(3,`circle`,16)(4,`circle`,17),Rd()()),o&2){let e=l.$implicit;pS();ky(`matMenuTriggerFor`,IS(23))(`matMenuTriggerData`,oM(2,Uo,e.source))}}function Ko(o,l){if(o&1){let e=cS();ma(0,`a`,18),dh(),ma(1,`svg`,19),Fy(2,`path`,20)(3,`path`,21),Rd()(),fh(),ma(4,`button`,22),$y(`click`,function(){let t=Jp(e).$implicit;return eh(pS().toggleLike(t.source,t.source.favourite_copy?0:1))}),dh(),ma(5,`svg`,23),Fy(6,`path`,24),Rd()(),fh(),ma(7,`button`,25),$y(`click`,function(){let t=Jp(e).$implicit;return eh(pS().onEditingCopyName(t.source,0))}),dh(),ma(8,`svg`,26),Fy(9,`path`,27)(10,`path`,28),Rd()(),fh(),ma(11,`button`,29),$y(`click`,function(){let t=Jp(e).$implicit;return eh(pS().onArchivingCopy(t.source))}),dh(),ma(12,`svg`,19),Fy(13,`path`,30)(14,`path`,31)(15,`path`,32),Rd()()}if(o&2){let e=l.$implicit;ky(`routerLink`,e.readLink),NT(4),Oy(`aria-pressed`,!!e.source.favourite_copy)(`aria-label`,e.source.favourite_copy?`إزالة النسخة من المفضلة`:`إضافة النسخة إلى المفضلة`),NT(),Jy(`text-primary-400`,e.source.favourite_copy),Oy(`fill`,e.source.favourite_copy?`currentColor`:`none`)}}function Xo(o,l){if(o&1){let e=cS();ma(0,`button`,67),$y(`click`,function(){Jp(e);let t=pS(2).$implicit;return eh(pS().toggleLike(t,1))}),dh(),ma(1,`svg`,68),Fy(2,`path`,69),Rd()()}}function Jo(o,l){if(o&1){let e=cS();ma(0,`button`,70),$y(`click`,function(){Jp(e);let t=pS(2).$implicit;return eh(pS().toggleLike(t,0))}),dh(),ma(1,`svg`,68),Fy(2,`path`,71),Rd()()}}function Qo(o,l){if(o&1){let e=cS();ma(0,`button`,54),$y(`click`,function(){Jp(e);let t=pS(2).$implicit;return eh(pS().toggleAnnotationsState(t.book_id,t.copy_id,t==null?null:t.title,t==null?null:t.book_type))}),dh(),ma(1,`svg`,55),Fy(2,`path`,72)(3,`path`,73)(4,`path`,74)(5,`path`,75),Rd(),$S(6,` تحويل الإثراءات `),Rd()}}function Yo(o,l){if(o&1){let e=cS();ma(0,`button`,66),dh(),ma(1,`svg`,55),Fy(2,`path`,76)(3,`path`,77)(4,`path`,78)(5,`path`,79),Rd(),$S(6,` إمكانية الإثراء `),fh(),ma(7,`mat-button-toggle-group`,80),$y(`ngModelChange`,function(t){Jp(e);let r=pS(2).$implicit;return eh(r.contributable=t)}),ma(8,`mat-button-toggle`,81),$y(`click`,function(){Jp(e);let t=pS(2).$implicit;return eh(pS().onContributingCopy(t))}),ma(9,`span`),$S(10,`أنا فقط`),Rd()(),ma(11,`mat-button-toggle`,81),$y(`click`,function(){Jp(e);let t=pS(2).$implicit;return eh(pS().onContributingCopy(t))}),ma(12,`span`),$S(13,`أنا والآخرون`),Rd()()(),pb(),Rd()}if(o&2){let e=pS(2).$implicit;NT(7),ky(`ngModel`,!e.contributable),gb(),NT(),ky(`value`,!0),NT(3),ky(`value`,!1)}}function en(o,l){if(o&1){let e=cS();ma(0,`button`,65)(1,`mat-slide-toggle`,82),$y(`change`,function(){Jp(e);let t=pS(2).$implicit;return eh(pS().onMakingCopyPublic(t))})(`click`,function(t){return t.stopPropagation()}),Rd(),ma(2,`span`),$S(3),Rd()()}if(o&2){let e=pS(2),i=e.$implicit,t=e.$index;NT(),ky(`id`,`dashIntro11`+t+t)(`matTooltip`,i.ispublic?`تحويل النسخة إلى خاصة`:`تحويل النسخة إلى عامة`)(`checked`,i.ispublic),NT(2),cv(i.ispublic?`نسخة عامة`:`نسخة خاصة`)}}function tn(o,l){if(o&1){let e=cS();ma(0,`tr`,33)(1,`td`,34),Fy(2,`img`,35),Rd(),ma(3,`td`,9),$S(4),Rd(),ma(5,`td`,9),$S(6),Rd(),ma(7,`td`,9),$S(8),Rd(),ma(9,`td`,9)(10,`div`,36)(11,`button`,37),dh(),ma(12,`svg`,38),Fy(13,`path`,39)(14,`path`,40),Rd()(),K_(15,Xo,3,0,`button`,41),K_(16,Jo,3,0,`button`,42),fh(),ma(17,`button`,43),$y(`click`,function(){Jp(e);let t=pS(),r=t.$implicit,d=t.$index;return eh(pS().onEditingCopyName(r,d))}),dh(),ma(18,`svg`,38),Fy(19,`path`,44)(20,`path`,45)(21,`path`,46),Rd()(),fh(),ma(22,`button`,47),$y(`click`,function(){Jp(e);let t=pS().$implicit;return eh(pS().onArchivingCopy(t))}),dh(),ma(23,`svg`,38),Fy(24,`path`,48)(25,`path`,49)(26,`path`,50),Rd()(),fh(),ma(27,`button`,51),dh(),ma(28,`svg`,52),Fy(29,`path`,53),Rd()(),fh(),ma(30,`mat-menu`,11,3)(32,`button`,54),$y(`click`,function(){Jp(e);let t=pS(),r=t.$implicit,d=t.$index;return eh(pS().addCopyDialoge(r,d))}),dh(),ma(33,`svg`,55),Fy(34,`path`,56)(35,`path`,57),Rd(),$S(36,` إضافة نسخة جديدة `),Rd(),fh(),ma(37,`button`,54),$y(`click`,function(){Jp(e);let t=pS().$implicit;return eh(pS().duplicateCopy(t.copy_id))}),dh(),ma(38,`svg`,55),Fy(39,`path`,58)(40,`path`,59),Rd(),$S(41,` تكرار النسخة الحالية `),Rd(),fh(),ma(42,`button`,60),$y(`click`,function(){Jp(e);let t=pS().$implicit;return eh(pS().getExcelFileDialogue(t))}),dh(),ma(43,`svg`,61),Fy(44,`path`,62)(45,`path`,63)(46,`path`,64),Rd(),$S(47,` تصدير الإثراءات `),Rd(),K_(48,Qo,7,0,`button`,65),K_(49,Yo,14,3,`button`,66),K_(50,en,4,4,`button`,65),Rd()()()()}if(o&2){let e=IS(31),i=pS().$implicit,t=pS();NT(),ky(`id`,`book`+i.book_id),NT(),ky(`alt`,YS(i.book_title))(`routerLink`,oM(17,Go,i.book_slug))(`src`,t.getImagePath(i),im)(`matTooltip`,i.book_title),NT(2),cv(i.title),NT(2),cv(i.user_annotations_count),NT(2),cv(i.approved_annotations_count),NT(3),ky(`routerLink`,i.book_type===`pdf`||i.book_type==`pdf`?iM(19,Wo,i.book_id+`-`+i.book_slug,i.copy_id):iM(22,qo,i.book_id,i.copy_id)),NT(4),X_(i.favourite_copy?-1:15),NT(),X_(i.favourite_copy?16:-1),NT(11),ky(`matMenuTriggerFor`,e),NT(15),ky(`disabled`,t.downLoading),NT(6),X_(t.userType===`AuthorizedUser`&&i.archived==!1?48:-1),NT(),X_(t.userType===`AuthorizedUser`&&i.archived==!1?49:-1),NT(),X_(t.userType===`AuthorizedUser`&&i.archived==!1?50:-1)}}function on(o,l){if(o&1&&K_(0,tn,51,25,`tr`,33),o&2){let e=l.$implicit;X_(e.archived==!1?0:-1)}}function nn(o,l){if(o&1){let e=cS();ma(0,`button`,83),$y(`click`,function(){Jp(e);let t=pS().copy;return eh(pS().toggleAnnotationsState(t.book_id,t.copy_id,t==null?null:t.title,t==null?null:t.book_type))}),dh(),ma(1,`svg`,84),Fy(2,`path`,90)(3,`path`,91)(4,`path`,92)(5,`path`,93),Rd(),$S(6,` تحويل الإثراءات `),Rd(),fh(),ma(7,`button`,94),$S(8,` إمكانية الإثراء `),ma(9,`mat-button-toggle-group`,95),$y(`ngModelChange`,function(t){Jp(e);let r=pS().copy;return eh(r.contributable=t)}),ma(10,`mat-button-toggle`,96),$y(`click`,function(){Jp(e);let t=pS().copy;return eh(pS().onContributingCopy(t))}),ma(11,`span`),$S(12,`أنا فقط`),Rd()(),ma(13,`mat-button-toggle`,96),$y(`click`,function(){Jp(e);let t=pS().copy;return eh(pS().onContributingCopy(t))}),ma(14,`span`),$S(15,`أنا والآخرون`),Rd()()(),pb(),Rd(),ma(16,`button`,97)(17,`mat-slide-toggle`,98),$y(`change`,function(){Jp(e);let t=pS().copy;return eh(pS().onMakingCopyPublic(t))})(`click`,function(t){return t.stopPropagation()}),Rd(),ma(18,`span`),$S(19),Rd()()}if(o&2){let e=pS().copy;NT(9),ky(`ngModel`,!e.contributable),gb(),NT(),ky(`value`,!0),NT(3),ky(`value`,!1),NT(4),ky(`checked`,e.ispublic),NT(2),cv(e.ispublic?`نسخة عامة`:`نسخة خاصة`)}}function rn(o,l){if(o&1){let e=cS();ma(0,`button`,83),$y(`click`,function(){let t=Jp(e).copy;return eh(pS().addCopyDialoge(t,0))}),dh(),ma(1,`svg`,84),Fy(2,`path`,85)(3,`path`,86),Rd(),$S(4,` إضافة نسخة جديدة `),Rd(),fh(),ma(5,`button`,83),$y(`click`,function(){let t=Jp(e).copy;return eh(pS().duplicateCopy(t.copy_id))}),dh(),ma(6,`svg`,84),Fy(7,`path`,58)(8,`path`,59),Rd(),$S(9,` تكرار النسخة الحالية `),Rd(),fh(),ma(10,`button`,87),$y(`click`,function(){let t=Jp(e).copy;return eh(pS().getExcelFileDialogue(t))}),dh(),ma(11,`svg`,88),Fy(12,`path`,62)(13,`path`,89)(14,`path`,64),Rd(),$S(15,` تصدير الإثراءات `),Rd(),K_(16,nn,20,5)}if(o&2){let e=l.copy,i=pS();NT(10),ky(`disabled`,i.downLoading),NT(6),X_(i.userType===`AuthorizedUser`&&e.archived==!1?16:-1)}}var Vi=(()=>{class o{dialog;dashboardService;cdr;toastr;userService;timeSevice;ithraaReaderService;utilisService;route;userId;copyIsAdded;userType;userBooks;userCopys;expandedPanel;increaseCopiesNumbers=new At;allCopiesAreArchived=!1;allCopiesAreunArchived=!1;imagePath=``;EXCEL_TYPE=`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8`;
1EXCEL_EXTENSION=`.xlsx`;downLoading;worker;countArchivedBooks=0;archivedBooks=[];favouriteBooks=[];bookType=``;countFavouriteBooks=0;viewVersion=0;cardsCache=null;constructor(e,i,t,r,d,A,f,T,W){this.dialog=e,this.dashboardService=i,this.cdr=t,this.toastr=r,this.userService=d,this.timeSevice=A,this.ithraaReaderService=f,this.utilisService=T,this.route=W,this.userId=this.userService.userPayload?this.userService.userPayload.user_id:null,this.dashboardService.ownloadingExcelAsync.subscribe(q=>{this.downLoading=q})}duplicateCopy(e){this.dashboardService.duplicateCopy(e).subscribe(i=>{i.status==0?this.dashboardService.getBooksCopiedByUser(this.userId).subscribe(t=>{this.userCopys=t.userCopys,this.toastr.success(`تم تكرار النسخة`),this.cdr.detectChanges()}):this.toastr.error(`حدث خطأ أثناء تكرار النسخة`)})}ngAfterViewInit(){this.route.fragment.subscribe(e=>{if(e){let i=document.getElementById(e);i&&i.scrollIntoView({behavior:`smooth`,block:`center`})}}),this.cdr.detectChanges()}ngOnDestroy(){this.dialog.closeAll()}getImagePath(e){return e?`${ua.storage_path}booksImages/${e.book_image}`:``}ngOnInit(){this.dashboardService.getBooksCopiedByUser(this.userId).subscribe(e=>{this.userCopys=e?.userCopys})}get cards(){let e=this.userCopys??[];if(this.cardsCache&&this.cardsCache.source===e&&this.cardsCache.version===this.viewVersion)return this.cardsCache.rows;let i=e.filter(t=>t?.archived===!1).map(t=>({id:t.copy_id,bookTitle:t.book_title,copyName:t.title,coverUrl:this.getImagePath(t),bookLink:[`/books/`,t.book_slug],readLink:t.book_type===`pdf`?[`/books/Book-pdf/`,t.book_id+`-`+t.book_slug,t.copy_id]:[`/books/Books/`,t.book_id,t.copy_id],createdAt:t.created_at,written:t.user_annotations_count,approved:t.approved_annotations_count,source:t}));return this.cardsCache={source:e,version:this.viewVersion,rows:i},i}invalidateView(){this.viewVersion++}addCopyDialoge(e,i){this.dialog.open(Yt,{width:`500px`,data:{bookId:e.id,state:1},panelClass:`my_class`}).afterClosed().subscribe(r=>{r&&r?.data&&r.data?.state==1&&this.dashboardService.getBooksCopiedByUser(this.userId).subscribe(d=>{this.userCopys=d.userCopys,this.increaseCopiesNumbers.emit(`increaseNum`),this.cdr.detectChanges()})})}onArchivingCopy(e){this.dashboardService.updateCopyArchivedStatus(e.copy_id,{archived:!0}).subscribe(i=>{this.dashboardService.getBooksCopiedByUser(this.userId).subscribe(t=>{this.userCopys=t.userCopys,this.countArchivedBooks=0,this.userCopys.forEach(r=>{r.panelOpenState=!1,r.archived==!0&&(this.countArchivedBooks+=1)}),this.dashboardService.asyncCountArchivedBooks.next(this.countArchivedBooks),this.dashboardService.asyncArchivedBooks.next(this.userCopys),this.toastr.success(`تم أرشفة النسخة`),this.cdr.detectChanges(),(t.status==-1||t.status==-2||t.status==-3)&&this.utilisService.logger(t,9)}),(i.status==-2||i.status==-3)&&this.utilisService.logger(i,10)})}onUnArchivingCopy(e){this.dashboardService.updateCopyArchivedStatus(e.copy_id,{archived:!1}).subscribe(i=>{this.dashboardService.getBooksCopiedByUser(this.userId).subscribe(t=>{this.userCopys=t.userCopys,this.countArchivedBooks=0,this.userCopys.forEach(r=>{r.panelOpenState=!1,this.countArchivedBooks=this.countArchivedBooks+r.archivedCopiesCount}),this.dashboardService.asyncCountArchivedBooks.next(this.countArchivedBooks),this.dashboardService.asyncCopiesOfAbook.next(this.userCopys),this.toastr.success(`تم إعادة النسخة`),this.cdr.detectChanges(),(t.status==-1||t.status==-2||t.status==-3)&&this.utilisService.logger(t,11)}),(i.status==-2||i.status==-3)&&this.utilisService.logger(i,12)})}onMakingCopyPublic(e){this.dashboardService.updateCopyPublicStatus(e.copy_id,{public:!e.ispublic}).subscribe(i=>{i.status==0&&this.dashboardService.getBooksCopiedByUser(this.userId).subscribe(t=>{t.status==0&&(this.userCopys=t.userCopys,this.userCopys.forEach(r=>{r.panelOpenState=!1}),e.ispublic||this.toastr.success(`تم تحويل النسخة لنسخة عامة`),e.ispublic&&this.toastr.success(`تم تحويل النسخة لنسخة خاصة`),this.cdr.detectChanges()),t.status==-1&&this.utilisService.logger(t,13),t.status==-2&&this.utilisService.logger(t,14),t.status==-3&&this.utilisService.logger(t,15)}),i.status==-2&&this.utilisService.logger(i,16),i.status==-3&&this.utilisService.logger(i,17)})}onContributingCopy(e){this.dashboardService.updateCopyContributionStatus(e.copy_id,{contributable:!e.contributable}).subscribe(i=>{i.status==0&&this.dashboardService.getBooksCopiedByUser(this.userId).subscribe(t=>{t.status==0&&(this.userCopys=t.userCopys,this.userCopys.forEach(r=>{r.panelOpenState=!1}),e.contributable||this.toastr.success(`تم إتاحة النسخة للمشاركة من قبل المثرين الآخرين`),e.contributable&&this.toastr.success(`تم عدم إتاحة النسخة للمشاركة من قبل المثرين الآخرين`)),(t.status==-1||t.status==-2||t.status==-3)&&this.utilisService.logger(t,18)}
1),(i.status==-2||i.status==-3)&&this.utilisService.logger(i,19)})}onEditingCopyName(e,i){this.dialog.open(mt,{width:`500px`,data:{oldCopyTitle:e.title,copyId:e.copy_id,userId:this.userId,bookId:e.book_id},panelClass:`my_class`}).afterClosed().subscribe(r=>{if(r&&r?.data)e.title=r?.data,this.invalidateView();else return null})}toggleAnnotationsState(e,i,t,r){this.dialog.open(Ti,{width:`65vw`,maxHeight:`80vh`,maxWidth:`100vw`,minHeight:`300px`,hasBackdrop:!1,data:{AuthUserId:this.userId,bookId:e,bookCopy:i,copyTitle:t,bookType:r},panelClass:`my_class`}).afterClosed().subscribe(A=>{})}extractHtmlText(e){let i=e?.replace(/<[^>]+>/g,` `).replace(/\s\s+/g,` `);return i=i?.replace(/&[a-z]*;/g,``),i}trackByFn(e,i){return e}getExcelFileDialogue(e){let i={id:e.book_id,book_slug:e.book_slug,can_annotate:e.can_annotate,name:e.name,title:e.book_title};this.dialog.open(_t,{width:`65vw`,maxHeight:`80vh`,maxWidth:`100vw`,minHeight:`300px`,hasBackdrop:!1,data:{AuthUserId:this.userId,bookId:e.book_id,bookCopy:e.copy_id,copyTitle:e.title,bookType:e.book_type,annotaionsCount:e.user_annotations_count},panelClass:`my_class`}).afterClosed().subscribe(r=>{!r||r.close||this.getExcelFile(e,i,r.affectedRows)})}getExcelFile(e,i,t){let r;t!=`all`?r=t:r=`all`,this.dashboardService.downloadingExcelSub.next(!0),this.dashboardService.getBookCopyExcelAnnotations(this.userId,e.book_id,e.copy_id,!0,r).subscribe({next:d=>_t$1(this,null,function*(){if(!Array.isArray(d)&&d.status==5)return this.dashboardService.downloadingExcelSub.next(!1),this.utilisService.logger(d,20),null;if(d.length>0)if(typeof window.Worker<`u`){this.worker&&this.worker.terminate();let A=new Worker(new URL(`worker-IDCD5RCI.js`,import.meta.url),{type:`module`});this.worker=A;let f=this.ithraaReaderService.apis_url,T=ua.storage_path;A.postMessage({res:d,copyOfUser:e,apis_url:f,book:i,storage_path:T});let W=()=>{A.terminate(),this.worker===A&&(this.worker=null)};A.onmessage=({data:q})=>{(0,St.saveAs)(q.blob,`${q.copyTitle}.xlsx`),this.dashboardService.downloadingExcelSub.next(!1),W()},A.onerror=()=>{this.dashboardService.downloadingExcelSub.next(!1),this.toastr.error(`حدث خطأ أثناء تصدير الإثراءات`,``,{positionClass:`toast-top-left`}),W()}}else{let A=new Li.Workbook,f=A.addWorksheet(`الإثراءات`),T=` \u0625\u062B\u0631\u0627\u0621\u0627\u062A : ${e.title} (${d.length} \u0625\u062B\u0631\u0627\u0621)`,W=`\u0627\u0633\u0645 \u0627\u0644\u0643\u062A\u0627\u0628 :${i.title}`;f.views=[{state:`frozen`,xSplit:0,ySplit:3}];let q=f.addRow([T]);q.font={name:`Comic Sans MS`,family:4,italic:!0,size:20,underline:`none`,bold:!0},f.mergeCells(`A1:H1`),f.getCell(`H1`).style.alignment={vertical:`middle`,horizontal:`center`};let Se=f.addRow([W]);Se.font={name:`Comic Sans MS`,family:4,italic:!0,size:20,underline:`none`,bold:!0},f.mergeCells(`A2:H2`),f.getCell(`H2`).style.alignment={vertical:`middle`,horizontal:`center`};let Me=[`عدد الإعجابات`,`حالة الإثراء(عام/خاص)`,`تصنيف الإثراء`,`مرفق5`,`مرفق4`,`مرفق3`,`مرفق2`,`مرفق1`,`الفيديو`,`الملف الصوتي`,`الصورة`,`نص الإثراء`,`نص الكتاب`,`تاريخ ووقت إنشاء الإثراء`],ve=[`likes_count`,`public`,`category`,`attach5`,`attach4`,`attach3`,`attach2`,`attach1`,`video_url`,`sound_upload`,`image_upload`,`text`,`quote`,`created_at`];f.addRow([]);let le=f.addRow(Me);le.font={name:`Comic Sans MS`,family:4,size:15,underline:`none`,bold:!0},le.height=30,le.eachCell((x,E)=>{x.fill={type:`pattern`,pattern:`solid`,fgColor:{argb:`10b1bf`},bgColor:{argb:`10b1bf`}},x.border={top:{style:`thin`},left:{style:`thin`},bottom:{style:`thin`},right:{style:`thin`}},x.style.alignment={vertical:`middle`,horizontal:`center`}});let je=[],F=(x,E)=>_t$1(this,null,function*(){let I=[];x.public==!0?x.public=`عام`:x.public=`خاص`,x.created_at=this.timeSevice.handleTimeZoneHours(x.created_at);let y=x.image_upload;if(x.attachmentsnames?.forEach((k,O)=>{x[`\u0645\u0631\u0641\u0642${O}`]=k,I[7-O]=k.slice(14,k.length)}
1),delete x.attachmentsnames,Object.keys(x).forEach(k=>{let O=ve.indexOf(k);O>=0&&(x[k]?I[O]=x[k]:I[O]=null)}),y)try{let k=`${ua.storage_path}image_upload/${y}`,O=yield fetch(k);if(!O.ok)throw new Error(`Server responded with status: ${O.status}`);let $=yield O.blob();return new Promise(re=>{let Z=new FileReader;Z.readAsDataURL($),Z.addEventListener(`load`,function(){je.push({index:E,base64:Z.result}),re(I)},!1),Z.onerror=()=>{re(I)}})}catch(k){return I[10]=`الصورة غير متوفرة`,Promise.resolve(I)}else return new Promise(k=>{k(I)})});_t$1(this,null,function*(){return Promise.all(d.map((x,E)=>F(x,E)))}).then(x=>{x.forEach((E,I)=>{E[11]=this.extractHtmlText(E[11])}),f.addRows(x),je.forEach(({index:E,base64:I})=>{try{let y=A.addImage({base64:I,extension:`png`}),k=E+5;f.addImage(y,{tl:{col:10,row:k-1},ext:{width:200,height:140},editAs:`oneCell`})}catch(y){}}),f.columns.forEach((E,I)=>{E.width=I===10?35:30}),f.getRows(1,2).forEach((E,I)=>{E.height=40}),f.getRows(5,d.length).forEach((E,I)=>{let y=E.getCell(11),k=E.getCell(10),O=E.getCell(9);for(let $=0;$<5;$++){let re=E.getCell(8-$);re.value&&(re.value={text:re.value.toString(),hyperlink:`${this.ithraaReaderService.apis_url}attachments_upload/${d[I][`\u0645\u0631\u0641\u0642${$}`]}`})}k.value&&(k.value={text:k.value.toString(),hyperlink:`${this.ithraaReaderService.apis_url}sound_upload/${k.value}`}),O.value&&(O.value={text:O.value.toString(),hyperlink:O.value.toString()}),y.value?(E.height=150,E.eachCell($=>{$.style.alignment={vertical:`middle`,horizontal:`right`}})):E.height=30}),A.xlsx.writeBuffer().then(E=>_t$1(this,null,function*(){e.title.replace(`.`,`_`);let y=new Blob([E],{type:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`});(0,St.saveAs)(y,`${e.title}.xlsx`),this.dashboardService.downloadingExcelSub.next(!1)}))})}else this.dashboardService.downloadingExcelSub.next(!1),this.toastr.warning(`ليس لديك إثراءات على هذه النسخة`)}),error:()=>{this.dashboardService.downloadingExcelSub.next(!1),this.toastr.error(`حدث خطأ أثناء تصدير الإثراءات`,``,{positionClass:`toast-top-left`})}})}toggleLike(e,i){if(i==1){let t={userId:this.userId,bookCopyId:e.copy_id};this.dashboardService.addToFavourites(t).subscribe(r=>{r?(this.dashboardService.getUserFavourites(this.userId).subscribe(d=>{this.dashboardService.asyncCountFavouriteBooks.next(d.length)}),this.toastr.success(`تم إضافة  النسخة  إلى النسخ المفضله`)):this.toastr.error(`فشل في تحديث الحالة`)})}else this.dashboardService.removeFromFavourites(e.copy_id,this.userId).subscribe(t=>{t?(this.dashboardService.getUserFavourites(this.userId).subscribe(r=>{this.dashboardService.asyncCountFavouriteBooks.next(r.length)}),this.toastr.success(`تم إزالة النسخة من النسخ المفضله`)):this.toastr.error(`فشل في تحديث الحالة`)});this.dashboardService.getBooksCopiedByUser(this.userId).subscribe(t=>{this.userCopys=t?.userCopys})}static ɵfac=function(i){return new(i||o)(q(ee),q(Me),q(Qd),q(co$1),q(Ha),q($n$1),q(Ln$1),q(Pn$1),q(Y))};static ɵcmp=t_({type:o,selectors:[[`app-copy-item`]],inputs:{userType:`userType`,userBooks:`userBooks`,userCopys:`userCopys`,expandedPanel:`expandedPanel`},outputs:{increaseCopiesNumbers:`increaseCopiesNumbers`},decls:25,vars:3,consts:[[`copyMenuButton`,``],[`copyActions`,``],[`cardMenu`,`matMenu`],[`menu`,`matMenu`],[1,`md:hidden`],[3,`cards`,`actions`,`headerActions`],[1,`relative`,`hidden`,`overflow-x-auto`,`md:block`],[1,`w-full`,`border-separate`,`border-spacing-y-4`],[1,`bg-white`,`shadow`,`rounded-2xl`,`text-center`,`font-semibold`,`dark:bg-dark-200`,`dark:text-white`],[1,`p-4`],[1,`p-4`,`text-center`],[`xPosition`,`before`],[`matMenuContent`,``],[`type`,`button`,`aria-label`,`إجراءات أخرى على هذه النسخة`,1,`card-action`,`shrink-0`,3,`matMenuTriggerFor`,`matMenuTriggerData`],[`width`,`4`,`height`,`18`,`viewBox`,`0 0 4 18`,`fill`,`currentColor`,`aria-hidden`,`true`],[`cx`,`2`,`cy`,`2`,`r`,`2`],[`cx`,`2`,`cy`,`9`,`r`,`2`],[`cx`,`2`,`cy`,`16`,`r`,`2`],[`aria-label`,`عرض النسخة`,1,`card-action`,3,`routerLink`],[`width`,`20`,`height`,`20`,`viewBox`,`0 0 25 25`,`fill`,`none`,`aria-hidden`,`true`],[`d`,`M16.0799 12.5C16.0799 14.48 14.4799 16.08 12.4999 16.08C10.5199 16.08 8.91992 14.48 8.91992 12.5C8.91992 10.52 10.5199 8.91998 12.4999 8.91998C14.4799 8.91998 16.0799 10.52 16.0799 12.5Z`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`d`,`M12.4998 20.77C16.0298 20.77 19.3198 18.69 21.6098 15.09C22.5098 13.68 22.5098 11.31 21.6098 9.89997C19.3198 6.29997 16.0298 4.21997 12.4998 4.21997C8.96984 4.21997 5.67984 6.29997 3.38984 9.89997C2.48984 11.31 2.48984 13.68 3.38984 15.09C5.67984 18.69 8.96984 20.77 12.4998 20.77Z`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`type`,`button`,1,`card-action`,3,`click`],[`width`,`20`,`height`,`20`,`viewBox`,`0 0 24 24`,`aria-hidden`,`true`],[`d`,`M12.62 20.8101C12.28 20.9301 11.72 20.9301 11.38 20.8101C8.48 19.8201 2 15.6901 2 8.6901C2 5.6001 4.49 3.1001 7.56 3.1001C9.38 3.1001 10.99 3.9801 12 5.3401C13.01 3.9801 14.63 3.1001 16.44 3.1001C19.51 3.1001 22 5.6001 22 8.6901C22 15.6901 15.52 19.8201 12.62 20.8101Z`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`type`,`button`,`aria-label`,`تعديل اسم النسخة`,1,`card-action`,3,`click`],[`viewBox`,`0 0 24 24`,`fill`,`none`,`aria-hidden`,`true`],[`d`,`M13.26 3.6 5.05 12.29c-.31.33-.61.98-.67 1.43l-.37 3.24c-.13 1.17.71 1.97 1.87 1.77l3.22-.55c.45-.08 1.08-.41 1.39-.75l8.21-8.69c1.42-1.5 2.06-3.21-.15-5.3-2.2-2.07-3.87-1.35-5.29.16Z`,`stroke`,`currentColor`,`stroke-width`,`1.6`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`d`,`M11.89 5.05a6.126 6.126 0 0 0 5.45 5.15`,`stroke`,`currentColor`,`stroke-width`,`1.6`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`type`,`button`,`aria-label`,`أرشفة النسخة`,1,`card-action`,3,`click`],[`d`,`M20 10.72V19.5C20 21.5 19.5 22.5 17 22.5H8C5.5 22.5 5 21.5 5 19.5V10.72`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`d`,`M5.5 2.5H19.5C21.5 2.5 22.5 3.5 22.5 5.5V7.5C22.5 9.5 21.5 10.5 19.5 10.5H5.5C3.5 10.5 2.5 9.5 2.5 7.5V5.5C2.5 3.5 3.5 2.5 5.5 2.5Z`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`d`,`M10.6802 14.5H14.3202`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[1,`bg-white`,`shadow`,`rounded-2xl`,`text-center`,`dark:bg-dark-200`,`dark:text-white`],[1,`p-4`,`cursor-pointer`,3,`id`],[1,`shadow-xl`,`border-t`,`border-r`,`border-[#D3D3D3]`,`w-40`,3,`routerLink`,`src`,`alt`,`matTooltip`],[1,`flex`,`flex-wrap`,`gap-2`],[`mat-flat-button`,``,`matTooltip`,`عرض النسخة`,1,`operation-btn`,`group`,`p-2`,`whitespace-nowrap`,`dark:!bg-dark-200`,`dark:hover:!bg-primary-500`,`dark:!text-white`,`hover:!bg-color-1`,`hover:!text-white`,`flex`,`items-center`,`justify-center`,3,`routerLink`],[`width`,`25`,`height`,`25`,`viewBox`,`0 0 25 25`,`fill`,`none`,`xmlns`,`http://www.w3.org/2000/svg`],[`d`,`M16.0799 12.5C16.0799 14.48 14.4799 16.08 12.4999 16.08C10.5199 16.08 8.91992 14.48 8.91992 12.5C8.91992 10.52 10.5199 8.91998 12.4999 8.91998C14.4799 8.91998 16.0799 10.52 16.0799 12.5Z`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`d`,`M12.4998 20.77C16.0298 20.77 19.3198 18.69 21.6098 15.09C22.5098 13.68 22.5098 11.31 21.6098 9.89997C19.3198 6.29997 16.0298 4.21997 12.4998 4.21997C8.96984 4.21997 5.67984 6.29997 3.38984 9.89997C2.48984 11.31 2.48984 13.68 3.38984 15.09C5.67984 18.69 8.96984 20.77 12.4998 20.77Z`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`mat-flat-button`,``,`matTooltip`,`إعجاب`,1,`operation-btn`,`group`,`p-2`,`whitespace-nowrap`,`dark:!bg-dark-200`,`dark:hover:!bg-primary-500`,`dark:!text-white`,`hover:!bg-color-1`,`hover:!text-white`,`flex`,`items-center`,`justify-center`],[`mat-flat-button`,``,`matTooltip`,`إلغاء الإعجاب`,1,`operation-btn`,`group`,`p-2`,`whitespace-nowrap`,`dark:!bg-dark-200`,`dark:hover:!bg-primary-500`,`dark:!text-white`,`hover:!bg-color-1`,`hover:!text-white`,`flex`,`items-center`,`justify-center`],[`mat-flat-button`,``,`matTooltip`,`تعديل النسخة`,1,`operation-btn`,`group`,`p-2`,`whitespace-nowrap`,`dark:!bg-dark-200`,`dark:hover:!bg-primary-500`,`dark:!text-white`,`hover:!bg-color-1`,`hover:!text-white`,`flex`,`items-center`,`justify-center`,3,`click`],[`d`,`M11.5 2.5H9.5C4.5 2.5 2.5 4.5 2.5 9.5V15.5C2.5 20.5 4.5 22.5 9.5 22.5H15.5C20.5 22.5 22.5 20.5 22.5 15.5V13.5`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`d`,`M16.5399 3.52001L8.65988 11.4C8.35988 11.7 8.05988 12.29 7.99988 12.72L7.56988 15.73C7.40988 16.82 8.17988 17.58 9.26988 17.43L12.2799 17C12.6999 16.94 13.2899 16.64 13.5999 16.34L21.4799 8.46001C22.8399 7.10001 23.4799 5.52001 21.4799 3.52001C19.4799 1.52001 17.8999 2.16001 16.5399 3.52001Z`,`stroke-width`,`1.5`,`stroke-miterlimit`,`10`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`d`,`M15.4102 4.65002C16.0802 7.04002 17.9502 8.91002 20.3502 9.59002`,`stroke-width`,`1.5`,`stroke-miterlimit`,`10`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`mat-flat-button`,``,`matTooltip`,`أرشفة النسخة`,1,`operation-btn`,`group`,`p-2`,`whitespace-nowrap`,`dark:!bg-dark-200`,`dark:hover:!bg-primary-500`,`dark:!text-white`,`hover:!bg-color-1`,`hover:!text-white`,`flex`,`items-center`,`justify-center`,3,`click`],[`d`,`M20 10.72V19.5C20 21.5 19.5 22.5 17 22.5H8C5.5 22.5 5 21.5 5 19.5V10.72`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`d`,`M5.5 2.5H19.5C21.5 2.5 22.5 3.5 22.5 5.5V7.5C22.5 9.5 21.5 10.5 19.5 10.5H5.5C3.5 10.5 2.5 9.5 2.5 7.5V5.5C2.5 3.5 3.5 2.5 5.5 2.5Z`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`d`,`M10.6802 14.5H14.3202`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`mat-flat-button`,``,`matTooltip`,`المزيد`,1,`operation-btn`,`group`,`p-2`,`whitespace-nowrap`,`dark:!bg-dark-200`,`dark:hover:!bg-primary-500`,`dark:!text-white`,`hover:!bg-color-1`,`hover:!text-white`,`flex`,`items-center`,`justify-center`,3,`matMenuTriggerFor`],[`width`,`21`,`height`,`21`,`viewBox`,`0 0 21 21`,`fill`,`none`,`xmlns`,`http://www.w3.org/2000/svg`],[`d`,`M10.8524 8.10059C10.5633 8.10059 10.2771 8.15752 10.0101 8.26813C9.74304 8.37874 9.50041 8.54086 9.29603 8.74524C9.09164 8.94963 8.92952 9.19226 8.81891 9.4593C8.7083 9.72634 8.65137 10.0125 8.65137 10.3016C8.65137 10.5906 8.7083 10.8768 8.81891 11.1439C8.92952 11.4109 9.09164 11.6535 9.29603 11.8579C9.50041 12.0623 9.74304 12.2244 10.0101 12.335C10.2771 12.4457 10.5633 12.5026 10.8524 12.5026C11.4361 12.5025 11.9959 12.2704 12.4086 11.8576C12.8212 11.4447 13.053 10.8848 13.0529 10.3011C13.0527 9.71734 12.8207 9.15756 12.4079 8.74489C11.995 8.33222 11.4351 8.10045 10.8514 8.10059H10.8524ZM10.8524 5.50059C11.1413 5.50045 11.4273 5.44342 11.6942 5.33274C11.9611 5.22206 12.2035 5.0599 12.4077 4.85551C12.6119 4.65113 12.7738 4.40853 12.8843 4.14157C12.9947 3.8746 13.0515 3.58849 13.0514 3.29959C13.0512 3.01068 12.9942 2.72462 12.8835 2.45776C12.7728 2.19089 12.6107 1.94844 12.4063 1.74424C12.2019 1.54005 11.9593 1.37811 11.6923 1.26767C11.4254 1.15723 11.1393 1.10045 10.8504 1.10059C10.2669 1.10085 9.70742 1.33289 9.29503 1.74566C8.88263 2.15843 8.6511 2.71811 8.65137 3.30159C8.65163 3.88506 8.88367 4.44454 9.29644 4.85693C9.70921 5.26932 10.2689 5.50085 10.8524 5.50059ZM10.8524 15.1006C10.2686 15.1006 9.70879 15.3325 9.29603 15.7452C8.88326 16.158 8.65137 16.7178 8.65137 17.3016C8.65137 17.8853 8.88326 18.4452 9.29603 18.8579C9.70879 19.2707 10.2686 19.5026 10.8524 19.5026C11.4361 19.5026 11.9959 19.2707 12.4087 18.8579C12.8215 18.4452 13.0534 17.8853 13.0534 17.3016C13.0534 16.7178 12.8215 16.158 12.4087 15.7452C11.9959 15.3325 11.4361 15.1006 10.8524 15.1006Z`,1,`fill-primary-500`,`group-hover:fill-white`],[`mat-menu-item`,``,1,`cursor-pointer`,`dark:!bg-dark-200`,`dark:text-white`,3,`click`],[`width`,`24`,`height`,`24`,`viewBox`,`0 0 24 24`,`fill`,`none`,`xmlns`,`http://www.w3.org/2000/svg`,1,`me-1`],[`d`,`M6 12H18`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M12 18V6`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M16 12.9V17.1C16 20.6 14.6 22 11.1 22H6.9C3.4 22 2 20.6 2 17.1V12.9C2 9.4 3.4 8 6.9 8H11.1C14.6 8 16 9.4 16 12.9Z`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M22 6.9V11.1C22 14.6 20.6 16 17.1 16H16V12.9C16 9.4 14.6 8 11.1 8H8V6.9C8 3.4 9.4 2 12.9 2H17.1C20.6 2 22 3.4 22 6.9Z`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`mat-menu-item`,``,1,`cursor-pointer`,`dark:!bg-dark-200`,`dark:text-white`,3,`click`,`disabled`],[`width`,`25`,`height`,`25`,`viewBox`,`0 0 25 25`,`fill`,`none`,`xmlns`,`http://www.w3.org/2000/svg`,1,`me-1`],[`d`,`M16.94 9.40002C20.54 9.71002 22.01 11.56 22.01 15.61V15.74C22.01 20.21 20.22 22 15.75 22H9.23998C4.76998 22 2.97998 20.21 2.97998 15.74V15.61C2.97998 11.59 4.42998 9.74002 7.96998 9.41002`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M12.5 15.5V4.12`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M15.8499 6.35L12.4999 3L9.1499 6.35`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`mat-menu-item`,``,1,`cursor-pointer`,`dark:!bg-dark-200`,`dark:text-white`],[`mat-menu-item`,``,1,`cursor-pointer`,`dark:!bg-dark-200`,`dark:text-white`,`annotation-toggle`],[`mat-flat-button`,``,`matTooltip`,`إعجاب`,1,`operation-btn`,`group`,`p-2`,`whitespace-nowrap`,`dark:!bg-dark-200`,`dark:hover:!bg-primary-500`,`dark:!text-white`,`hover:!bg-color-1`,`hover:!text-white`,`flex`,`items-center`,`justify-center`,3,`click`],[`width`,`24`,`height`,`24`,`viewBox`,`0 0 24 24`,`fill`,`none`,`xmlns`,`http://www.w3.org/2000/svg`],[`d`,`M12.62 20.8101C12.28 20.9301 11.72 20.9301 11.38 20.8101C8.48 19.8201 2 15.6901 2 8.6901C2 5.6001 4.49 3.1001 7.56 3.1001C9.38 3.1001 10.99 3.9801 12 5.3401C13.01 3.9801 14.63 3.1001 16.44 3.1001C19.51 3.1001 22 5.6001 22 8.6901C22 15.6901 15.52 19.8201 12.62 20.8101Z`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`mat-flat-button`,``,`matTooltip`,`إلغاء الإعجاب`,1,`operation-btn`,`group`,`p-2`,`whitespace-nowrap`,`dark:!bg-dark-200`,`dark:hover:!bg-primary-500`,`dark:!text-white`,`hover:!bg-color-1`,`hover:!text-white`,`flex`,`items-center`,`justify-center`,3,`click`],[`d`,`M12.62 20.8101C12.28 20.9301 11.72 20.9301 11.38 20.8101C8.48 19.8201 2 15.6901 2 8.6901C2 5.6001 4.49 3.1001 7.56 3.1001C9.38 3.1001 10.99 3.9801 12 5.3401C13.01 3.9801 14.63 3.1001 16.44 3.1001C19.51 3.1001 22 5.6001 22 8.6901C22 15.6901 15.52 19.8201 12.62 20.8101Z`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`fill-red-500`,`stroke-red-500`],[`d`,`M3.57996 5.15991H17.42C19.08 5.15991 20.42 6.49991 20.42 8.15991V11.4799`,`stroke-width`,`1.5`,`stroke-miterlimit`,`10`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M6.73996 2L3.57996 5.15997L6.73996 8.32001`,`stroke-width`,`1.5`,`stroke-miterlimit`,`10`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M20.42 18.84H6.57996C4.91996 18.84 3.57996 17.5 3.57996 15.84V12.52`,`stroke-width`,`1.5`,`stroke-miterlimit`,`10`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M17.26 21.
19999L20.42 18.84L17.26 15.6799`,`stroke-width`,`1.5`,`stroke-miterlimit`,`10`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M9.16006 10.87C9.06006 10.86 8.94006 10.86 8.83006 10.87C6.45006 10.79 4.56006 8.84 4.56006 6.44C4.56006 3.99 6.54006 2 9.00006 2C11.4501 2 13.4401 3.99 13.4401 6.44C13.4301 8.84 11.5401 10.79 9.16006 10.87Z`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M16.41 4C18.35 4 19.91 5.57 19.91 7.5C19.91 9.39 18.41 10.93 16.54 11C16.46 10.99 16.37 10.99 16.28 11`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M4.15997 14.56C1.73997 16.18 1.73997 18.82 4.15997 20.43C6.90997 22.27 11.42 22.27 14.17 20.43C16.59 18.81 16.59 16.17 14.17 14.56C11.43 12.73 6.91997 12.73 4.15997 14.56Z`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M18.34 20C19.06 19.85 19.74 19.56 20.3 19.13C21.86 17.96 21.86 16.03 20.3 14.86C19.75 14.44 19.08 14.16 18.37 14`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`id`,`dashIntro10`,`appearance`,`legacy`,`name`,`fontStyle`,`aria-label`,`Font Style`,1,`flex`,`flex-row`,`flex-wrap`,`w-full`,`bg-color-5`,`dark:bg-dark-200`,`h-10`,`mt-2`,`annotation-toggle`,3,`ngModelChange`,`ngModel`],[1,`flex`,`!text-[14px]`,`!dark:text-white`,`!text-color-15`,`h-10`,3,`click`,`value`],[`color`,`primary`,`matTooltipPosition`,`above`,1,`ml-3`,3,`change`,`click`,`id`,`matTooltip`,`checked`],[`mat-menu-item`,``,`type`,`button`,1,`dark:!bg-dark-200`,`dark:text-white`,3,`click`],[`width`,`20`,`height`,`20`,`viewBox`,`0 0 24 24`,`fill`,`none`,`aria-hidden`,`true`,1,`me-1`],[`d`,`M6 12H18`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,1,`stroke-primary-500`],[`d`,`M12 18V6`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,1,`stroke-primary-500`],[`mat-menu-item`,``,`type`,`button`,1,`dark:!bg-dark-200`,`dark:text-white`,3,`click`,`disabled`],[`width`,`20`,`height`,`20`,`viewBox`,`0 0 25 25`,`fill`,`none`,`aria-hidden`,`true`,1,`me-1`],[`d`,`M12.5 15.5V4.12`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,1,`stroke-primary-500`],[`d`,`M3.57996 5.15991H17.42C19.08 5.15991 20.42 6.49991 20.42 8.15991V11.4799`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M6.73996 2L3.57996 5.15997L6.73996 8.32001`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M20.42 18.84H6.57996C4.91996 18.84 3.57996 17.5 3.57996 15.84V12.52`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`d`,`M17.26 21.9999L20.42 18.84L17.26 15.6799`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`],[`mat-menu-item`,``,`type`,`button`,1,`annotation-toggle`,`dark:!bg-dark-200`,`dark:text-white`],[`appearance`,`legacy`,`aria-label`,`من يستطيع الإثراء في هذه النسخة`,1,`mt-2`,`flex`,`h-10`,`w-full`,`flex-row`,`flex-wrap`,`bg-color-5`,`dark:bg-dark-200`,3,`ngModelChange`,`ngModel`],[1,`flex`,`h-10`,`!text-[14px]`,3,`click`,`value`],[`mat-menu-item`,``,`type`,`button`,1,`dark:!bg-dark-200`,`dark:text-white`],[`color`,`primary`,1,`ml-3`,3,`change`,`click`,`checked`]],template:function(i,t){if(i&1&&(ma(0,`section`,4),Fy(1,`app-library-list`,5),Rd(),vy(2,Zo,5,4,`ng-template`,null,0,vM)(4,Ko,16,6,`ng-template`,null,1,vM),ma(6,`div`,6)(7,`table`,7)(8,`thead`,8)(9,`th`,9),$S(10,`الكتاب`),Rd(),ma(11,`th`,9),$S(12,`اسم النسخة`),Rd(),ma(13,`th`,9),$S(14,`الإثراءات المكتوبة`),Rd(),ma(15,`th`,9),$S(16,`الإثراءات المعتمدة`),Rd(),ma(17,`th`,10),$S(18,`الإجراءات`),Rd()(),ma(19,`tbody`),tS(20,on,1,1,null,null,eS),Rd()()(),ma(22,`mat-menu`,11,2),vy(24,rn,17,2,`ng-template`,12),Rd()),i&2){let r=IS(3),d=IS(5);NT(),ky(`cards`,t.cards)(`actions`,d)(`headerActions`,r),NT(19),nS(t.userCopys)}},dependencies:[z,Tt,kt,Le,Tt$1,Pt,H,Ct,na,$t,Dt,bt,nt$1,vr,cr$1,En$1,Ht,Ht$1,P,ee$1,Bt$1,Lt,Ve],styles:[`.card-action[_ngcontent-%COMP%]{position:relative;display:grid;place-items:center;width:26px;height:26px;border-radius:8px;border:1px solid #d1cdef;background:#fff;color:#6154b8;transition:background-color .15s ease}.card-action[_ngcontent-%COMP%]:after{content:"";position:absolute;inset-block:-8px;inset-inline:-1px}.card-action[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{width:16px;height:16px}.card-action[_ngcontent-%COMP%]:active{background:#f0effa}.card-action[_ngcontent-%COMP%]:disabled{opacity:.45}
1.card-action[_ngcontent-%COMP%]:focus-visible{outline:2px solid #6c5dcc;outline-offset:2px}.dark[_nghost-%COMP%]   .card-action[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .card-action[_ngcontent-%COMP%]{background:#282828;border-color:#3f3f3f;color:#fff}.dark[_nghost-%COMP%]   .card-action[_ngcontent-%COMP%]:active, .dark   [_nghost-%COMP%]   .card-action[_ngcontent-%COMP%]:active{background:#3f3f3f}@media(prefers-reduced-motion:reduce){.card-action[_ngcontent-%COMP%]{transition:none}}[_nghost-%COMP%]  .mat-mdc-card{box-shadow:0 15px 10px #3c3a5803!important;border-radius:20px;margin:4px auto!important}[_nghost-%COMP%]  .mat-mdc-card:first-of-type{margin-top:0!important}mat-button-toggle-group[_ngcontent-%COMP%]{box-shadow:none!important;border-radius:10px;border:1px solid #6c5dcc!important}[_nghost-%COMP%]  .mat-button-toggle-checked{background:#6c5dcc!important;color:#fff!important;border-radius:10px!important;font-weight:400;font-size:12px}.four_btns[_ngcontent-%COMP%]{border-radius:10px;border:1px solid #6c5dcc}.four_btns[_ngcontent-%COMP%]:hover{background-color:#6c5dcc!important;color:#fff!important}.btn_show[_ngcontent-%COMP%]:hover   .x[_ngcontent-%COMP%]{filter:brightness(0) invert(1)}[_nghost-%COMP%]     .mat-mdc-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb{background-color:#15c511!important}[_nghost-%COMP%]     .mat-mdc-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar{background-color:#86fc99!important}  .dark .mat-mdc-slide-toggle .mat-slide-toggle-bar{background-color:#a9a9a9!important}  .dark .my_class mat-dialog-container{background:#1d1c1e!important}  .dark .mat-mdc-dialog-container{--%NS%mat-dialog-container-color: black}.mat-mdc-slide-toggle.mat-accent[_ngcontent-%COMP%]{--%NS%mat-slide-toggle-selected-focus-state-layer-color: #15c511;--%NS%mat-slide-toggle-selected-handle-color: #15c511;--%NS%mat-slide-toggle-selected-hover-state-layer-color: #15c511;--%NS%mat-slide-toggle-selected-pressed-state-layer-color: #15c511;--%NS%mat-slide-toggle-selected-focus-handle-color: #12a80f;--%NS%mat-slide-toggle-selected-hover-handle-color: #12a80f;--%NS%mat-slide-toggle-selected-pressed-handle-color: #12a80f;--%NS%mat-slide-toggle-selected-focus-track-color: #86fc99;--%NS%mat-slide-toggle-selected-hover-track-color: #86fc99;--%NS%mat-slide-toggle-selected-pressed-track-color: #86fc99;--%NS%mat-slide-toggle-selected-track-color: #86fc99}.my-element[_ngcontent-%COMP%]{display:none}@media screen and (min-width:767px){.my-element[_ngcontent-%COMP%]{display:block}}.table-header[_ngcontent-%COMP%]{margin-bottom:8px!important}.mdc-button.operation-btn[_ngcontent-%COMP%]{border:1px solid #6154b8!important;min-width:30px!important;max-width:30px!important;height:30px!important}@media screen and (min-width:768px){.mdc-button.operation-btn[_ngcontent-%COMP%]{min-width:40px!important;max-width:40px!important;height:40px!important}}.mat-button-toggle[_ngcontent-%COMP%]{width:50%!important}.mat-button-toggle-checked[_ngcontent-%COMP%]{color:#fff!important;background-color:#3f51b5!important}  button.mat-mdc-menu-item.annotation-toggle{padding:12px 16px!important}`],changeDetection:1})}return o})();var Ri=jx(Hn$1());var $i=jx(L());var Ni=(()=>{class o{timeSevice;dashboardService;ithraaReaderService;apis_url;constructor(e,i,t){this.timeSevice=e,this.dashboardService=i,this.ithraaReaderService=t,this.apis_url=this.ithraaReaderService.apis_url}prepareExcel(e,i,t,r){let d=`  \u0625\u062B\u0631\u0627\u0621\u0627\u062A\u064A : ${i} (${e.length} \u0625\u062B\u0631\u0627\u0621)`,A=`  \u0627\u0633\u0645 \u0627\u0644\u0643\u062A\u0627\u0628 : ${t.bookName}`,f=new Ri.Workbook,T=f.addWorksheet(`الإثراءات`);T.views=[{state:`frozen`,xSplit:0,ySplit:3}];let W=T.addRow([d]);W.font={name:`Comic Sans MS`,family:4,italic:!0,size:20,underline:`none`,bold:!0},T.mergeCells(`A1:H1`),T.getCell(`H1`).style.alignment={vertical:`middle`,horizontal:`center`};let q=T.addRow([A]);q.font={name:`Comic Sans MS`,family:4,italic:!0,size:20,underline:`none`,bold:!0},T.mergeCells(`A2:H2`),T.getCell(`H2`).style.alignment={vertical:`middle`,horizontal:`center`};let Se=[`عدد الإعجابات`,`حالة الإثراء(عام/خاص)`,`تصنيف الإثراء`,`مرفق5`,`مرفق4`,`مرفق3`,`مرفق2`,`مرفق1`,`الفيديو`,`الملف الصوتي`,`الصورة`,`نص الإثراء`,`نص الكتاب`,`تاريخ ووقت إنشاء الإثراء`],Me=[`likes_count`,`public`,`category`,`attach5`,`attach4`,`attach3`,`attach2`,`attach1`,`video_url`,`sound_upload`,`image_upload`,`text`,`quote`,`created_at`];r&&(Se.unshift(`حالة قبول الإثراء`),Me.unshift(`publish_request_state`)),T.addRow([]);let ve=T.addRow(Se);ve.font={name:`Comic Sans MS`,family:4,size:15,underline:`none`,bold:!0},ve.height=30,ve.eachCell((F,v)=>{F.fill={type:`pattern`,pattern:`solid`,fgColor:{argb:`10b1bf`},bgColor:{argb:`10b1bf`}},F.border={top:{style:`thin`},left:{style:`thin`},bottom:{style:`thin`},right:{style:`thin`}},F.style.alignment={vertical:`middle`,horizontal:`center`}});let le=(F,v)=>_t$1(this,null,function*(){let x=[];F?.publish_request_state,F.public==!0?F.public=`عام`:F.public=`خاص`,F.publish_request_state=this.arabize_state(F?.publish_request_state);new Date(F.created_at);F.created_at=this.timeSevice.handleTimeZoneHours(F.created_at);let I=F.image_upload;if(F.attachmentsnames?.forEach((y,k)=>{F[`\u0645\u0631\u0641\u0642${k}`]=y,x[7-k]=y.slice(14,y.length)}
1),delete F.attachmentsnames,Object.keys(F).forEach(y=>{let k=Me.indexOf(y);k>=0&&(F[y]?x[k]=F[y]:x[k]=null)}),I){let y=`${ua.storage_path}image_upload/${I}`,O=yield(yield fetch(y)).blob();return new Promise(($,re)=>{let Z=new FileReader;Z.readAsDataURL(O),Z.addEventListener(`load`,function(){let ft=f.addImage({base64:Z.result,extension:`png`});T.addImage(ft,`L${+v+5}:L${+v+5}`),$(x)},!1),Z.onerror=()=>re(this)})}else return new Promise((y,k)=>{y(x)})});_t$1(this,null,function*(){return Promise.all(e.map((F,v)=>le(F,v)))}).then(F=>{F.forEach((v,x)=>{r?v[12]=ji(v[12]):r||(v[11]=ji(v[11]))}),T.addRows(F),T.getRows(1,2).forEach((v,x)=>{v.height=40}),T.columns.forEach(v=>{v.width=30}),T.getRows(5,e.length).forEach((v,x)=>{let E=v.getCell(12),I=v.getCell(11),y=v.getCell(10);for(let k=0;k<5;k++){let O=v.getCell(8-k);O.value&&(O.value={text:O.value.toString(),hyperlink:`${this.ithraaReaderService.apis_url}attachments_upload/${e[x][`\u0645\u0631\u0641\u0642${k}`]}`})}I.value&&(I.value={text:I.value.toString(),hyperlink:`${this.ithraaReaderService.apis_url}sound_upload/${I.value}`}),y.value&&(y.value={text:y.value.toString(),hyperlink:y.value.toString()}),E.value?(v.height=150,v.eachCell(k=>{k.style.alignment={vertical:`middle`,horizontal:`right`}})):v.height=30}),f.xlsx.writeBuffer().then(v=>_t$1(this,null,function*(){i.replace(`.`,`_`);let E=new Blob([v],{type:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`});(0,$i.saveAs)(E,`${i}.xlsx`),this.dashboardService.downloadingExcelSub.next(!1)}))})}arabize_state(e){let i;switch(e){case 0:i=`في انتظار قبول طلب النشر`;break;case 1:i=`تم قبول طلب النشر`;break;case 2:i=`تم رفض طلب النشر`;break;default:i=`لم يتم إرسال طلب النشر`;break}return i}static ɵfac=function(i){return new(i||o)(M($n$1),M(Me),M(Ln$1))};static ɵprov=A({token:o,factory:o.ɵfac,providedIn:`root`})}return o})();function ji(o){let l=o?.replace(/<[^>]+>/g,` `).replace(/\s\s+/g,` `);return l=l?.replace(/&[a-z]*;/g,` `),l}var sn=o=>[`/books/`,o];var ln=(o,l)=>[`/books/Books`,o,l];var un=(o,l)=>[`/books/Book-pdf`,o,l];var cn=o=>[`/users/page/`,o];function dn(o,l){o&1&&(ma(0,`p`,0),Fy(1,`img`,3),ma(2,`span`),$S(3,`لا توجد نسخ عامة شاركت في إثرائها`),Rd(),Fy(4,`br`)(5,`br`),Rd())}function pn(o,l){o&1&&(ma(0,`p`,1),Fy(1,`img`,4),ma(2,`span`),$S(3,`لا توجد نسخ شاركت في إثرائها`),Rd(),Fy(4,`br`)(5,`br`),Rd())}function mn(o,l){if(o&1){let e=cS();ma(0,`div`,17)(1,`div`,18)(2,`div`,19)(3,`div`,20)(4,`div`,21)(5,`span`,22),$S(6),Rd(),ma(7,`a`,23),$S(8,` عرض النسخة `),dh(),ma(9,`svg`,13),Fy(10,`path`,14),Rd()()(),fh(),ma(11,`div`,24)(12,`a`,25),$y(`click`,function(){let t=Jp(e).$implicit,r=pS().$implicit;return eh(pS(2).getExcelFile(t,r))}),$S(13,` تصدير الإثراءات `),Rd()()(),ma(14,`div`,26)(15,`b`,27),Fy(16,`i`,28),ma(17,`span`,29),$S(18),Rd()()()(),ma(19,`div`,30)(20,`div`,31)(21,`span`,32),Fy(22,`img`,33),$S(23),Rd()(),ma(24,`div`,34)(25,`span`,35),Fy(26,`img`,36),$S(27),Rd()()(),ma(28,`div`,30)(29,`div`,31)(30,`span`,32),Fy(31,`img`,37),$S(32),Rd()(),ma(33,`div`,38)(34,`span`,39),Fy(35,`img`,40),$S(36),Rd()()(),ma(37,`div`,41)(38,`div`,31)(39,`span`,32),Fy(40,`img`,42),$S(41),Rd()(),ma(42,`div`,43)(43,`span`,44),Fy(44,`img`,45),$S(45),Rd()()()()()}if(o&2){let e=l.$implicit,i=pS().$implicit;NT(6),cv(e?.copy_title),NT(),ky(`routerLink`,i.book_type==`epub`?iM(10,ln,e.book_id,e.copy_id):iM(13,un,e.book_id,e.copy_id)),NT(10),ky(`routerLink`,oM(16,cn,e==null?null:e.slug)),NT(),Ld(``,e?.owner_full_name,` `),NT(5),Ld(` جميع ما شاركت به (`,e?.total_annotations,`)`),NT(4),Ld(` إثراءات لم تقبل (`,e?.rejected_annotations_count,`)`),NT(5),Ld(` الإثراءات المنشورة العامة (`,e?.public_accepted_annotations_count,`)`),NT(4),Ld(` إثراءات قيد الموافقة (`,e?.pending_annotations_count,`)`),NT(5),Ld(` الإثراءات المنشورة الخاصة (`,e?.private_accepted_annotations_count,`)`),NT(4),Ld(` إثراءات لم ترسل طلبا لنشرها (`,e?.un_requested_annotations_count,`)`)}}function hn(o,l){if(o&1&&(ma(0,`mat-card`,5)(1,`div`,6)(2,`div`,7)(3,`div`,8),Fy(4,`img`,9),Rd(),ma(5,`div`,10)(6,`p`,11),$S(7),Rd(),ma(8,`a`,12)(9,`span`),$S(10,`عرض تفاصيل الكتاب `),dh(),ma(11,`svg`,13),Fy(12,`path`,14),Rd()(),fh(),Fy(13,`br`),Rd()()(),Fy(14,`mat-divider`,15),ma(15,`div`,16),tS(16,mn,46,18,`div`,17,eS),Rd()()()),o&2){let e=l.$implicit,i=pS(2);NT(4),ky(`src`,i.imagePath+(e==null||e.copies[0]==null?null:e.copies[0].book_image),im)(`alt`,e==null?null:e.bookName),NT(3),Ld(` `,e?.bookName,` `),NT(),ky(`routerLink`,oM(5,sn,e.book_slug)),NT(6),ky(`vertical`,!0),NT(2),nS(e.copies)}}function gn(o,l){if(o&1&&(ma(0,`div`,2),tS(1,hn,18,7,`mat-card`,5,Y_().trackByFn,!0),Rd()),o&2){let e=pS();NT(),nS(e.booksContributedOn)}}var Hi=(()=>{class o{dashboardService;excelServ;usersServ;utilisService;booksContributedOn;copiesContributedOnCount;publicCopiesCount;privateCopiesCount;imagePath=`${ua.storage_path}booksImages/`;worker;userId;constructor(e,i,t,r){this.dashboardService=e,this.excelServ=i,this.usersServ=t,this.utilisService=r,this.userId=this.usersServ.userId}ngOnInit(){}getExcelFile(e,i){this.dashboardService.downloadingExcelSub.next(!0),this.dashboardService.getAnnoOnOthersCopies(e.book_id,e.copy_id,this.userId).subscribe(t=>
1{if(!Array.isArray(t)&&t.status==5)return this.utilisService.logger(t,8),null;t?.length>0&&this.excelServ.prepareExcel(t,e?.copy_title,i,!0)})}trackByFn(e,i){return e}static ɵfac=function(i){return new(i||o)(q(Me),q(Ni),q(Ha),q(Pn$1))};static ɵcmp=t_({type:o,selectors:[[`app-contribution-copies`]],inputs:{booksContributedOn:`booksContributedOn`,copiesContributedOnCount:`copiesContributedOnCount`,publicCopiesCount:`publicCopiesCount`,privateCopiesCount:`privateCopiesCount`},decls:3,vars:3,consts:[[1,`text-[14px]`,`text-center`,`text-not-found-color`,`bg-color-5`,`dark:!bg-dark-200`,`shadow-div-shadow`,`dark:!text-white`,`rounded-3xl`,`p-[10%]`,2,`margin-top`,`17px`],[1,`text-[14px]`,`text-center`,`text-not-found-color`,`bg-color-5`,`shadow-div-shadow`,`dark:!bg-dark-200`,`dark:!text-white`,`rounded-3xl`,`p-[10%]`,2,`margin-top`,`17px`],[1,`flex`,`flex-row`,`flex-wrap`,`justify-center`],[`src`,`./assets/images/svgImages/folder.svg`,`alt`,`لا توجد نسخ عامة`,1,`inline-block`,2,`margin-top`,`-3%`],[`src`,`./assets/images/svgImages/folder.svg`,`alt`,`لا توجد نسخ`,1,`inline-block`,2,`margin-top`,`-3%`],[`dir`,`rtl`,1,`flex`,`w-full`,`p-5`,`m-0`,`bg-color-5`,`dark:!bg-dark-200`,`border-none`],[1,`flex`,`flex-row`,`flex-wrap`,`w-full`],[1,`flex`,`flex-row`,`flex-wrap`,`justify-center`,`w-full`,`sm:w-[30%]`],[1,`bookImageContainer`,`max-h-60`,`flex`,`flex-row`,`w-full`,`sm:w-[40%]`,`justify-center`],[1,`shadow-xl`,`border-t`,`border-r`,`border-[#D3D3D3]`,3,`src`,`alt`],[1,`h-48`,`flex`,`flex-row`,`flex-wrap`,`w-full`,`justify-center`,`sm:w-[60%]`],[1,`font-semibold`,`text-color-15`,`dark:!text-white`,`text-[16px]`,`mt-5`,`mr-2`,`flex`,`flex-row`,`justify-center`,`w-full`],[`id`,`dashIntro16`,1,`btn_show`,`bg-transparent`,`dark:text-white`,`h-10`,`p-2`,`rounded-lg`,`ring-1`,`ring-color-7`,`dark:ring-white`,`hover:ring-0`,`text-color-1`,`font-medium`,`text-[14px]`,`hover:bg-color-1`,`hover:text-white`,3,`routerLink`],[`width`,`14`,`height`,`11`,`viewBox`,`0 0 14 11`,`fill`,`none`,`stroke`,`#6C5DCC`,`xmlns`,`http://www.w3.org/2000/svg`,1,`ms-2`,`inline-block`,`dark:stroke-white`],[`d`,`M5.99034 9.42926L1.90701 5.49176L5.99034 1.55426M12.7959 5.49176L1.90701 5.49176L12.7959 5.49176Z`,`stroke-width`,`2`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[3,`vertical`],[1,`flex`,`flex-row`,`flex-wrap`,`justify-center`,`w-full`,`sm:w-[69%]`],[1,`flex`,`w-full`,`sm:w-[93%]`,`pb-5`],[1,`flex`,`flex-row`,`flex-wrap`,`justify-center`,`w-full`,`bg-color-5`,`dark:!bg-dark-200`,`border`,`border-[#e7e7e7]`,`dark:border-dark-300`,`rounded-3xl`,`shadow-div-shadow`],[1,`flex`,`flex-row`,`flex-wrap`,`mt-2`,`mb-4`,`w-[95%]`],[1,`flex`,`flex-row`,`flex-wrap`,`mt-2`,`w-full`],[1,`flex`,`flex-row`,`flex-wrap`,`w-full`,`sm:w-[80%]`],[`id`,`dashIntro7`,1,`copy_title`,`text-color-15`,`dark:!text-white`,`font-semibold`,`text-[16px]`,`ml-2`,`mt-2`],[`id`,`dashIntro9`,1,`btn_show`,`bg-transparent`,`dark:text-white`,`h-10`,`p-2`,`rounded-lg`,`ring-1`,`ring-color-7`,`dark:ring-white`,`hover:ring-0`,`text-color-1`,`font-medium`,`text-[14px]`,`hover:bg-color-1`,`hover:text-white`,3,`routerLink`],[1,`flex`,`flex-row`,`flex-wrap`,`w-full`,`sm:w-[20%]`,`mt-2`,`md:mt-0`],[`id`,`dashIntro18`,1,`bg-color-1`,`text-center`,`p-4`,`cursor-pointer`,`rounded-lg`,`text-color-6`,`text-[14px]`,`hover:bg-[#6055A3]`,3,`click`],[1,`mt-4`],[1,`d-block`,`font-semibold`,`text-gray-500`,`dark:!text-white`,`text-[16px]`],[1,`fa`,`fa-user`,`ml-1`,`mr-5`,`copy_name`],[1,`owner_name`,2,`cursor`,`pointer`,3,`routerLink`],[1,`flex`,`flex-row`,`flex-wrap`,`w-[95%]`],[1,`flex`,`flex-row`,`flex-wrap`,`bg-color-6`,`dark:bg-[#2E2A40]`,`rounded-lg`,`mb-1`,`w-full`,`sm:w-[48%]`],[1,`font-medium`,`text-[14px]`,`text-color-1`,`dark:text-primary-300`,`mr-3`,`mt-[3%]`],[`src`,`./assets/images/svgImages/confirm_solid.svg`,`alt`,`عدد الإثراءات`,1,`inline-block`,`dark:brightness-150`],[1,`flex`,`flex-row`,`flex-wrap`,`bg-[#ffeaea]`,`dark:bg-[#432A2A]`,`rounded-lg`,`mb-1`,`mr-0`,`lg:mr-2`,`w-full`,`sm:w-[48%]`],[1,`font-medium`,`text-[14px]`,`text-[#f02c2c]`,`dark:text-[#FF8A8A]`,`mr-3`,`mt-[3%]`],[`src`,`./assets/images/svgImages/cancel_solid.svg`,`alt`,`عدد الإثراءات الغير مقبولة`,1,`inline-block`],[`src`,`./assets/images/svgImages/visible_solid.svg`,`alt`,`الإثراءات المنشورة`,1,`inline-block`,`dark:brightness-150`],[1,`flex`,`flex-row`,`flex-wrap`,`bg-[#fff0d7]`,`dark:bg-[#3B2F1C]`,`rounded-lg`,`mb-1`,`mr-0`,`lg:mr-2`,`w-full`,`sm:w-[48%]`],[1,`font-medium`,`text-[14px]`,`text-[#e37e25]`,`dark:text-[#FFC078]`,`mr-3`,`mt-[3%]`],[`src`,`./assets/images/svgImages/pause_solid.svg`,`alt`,`عدد الإثراءات قيد الموافقة`,1,`inline-block`],[1,`mb-4`,`flex`,`flex-row`,`flex-wrap`,`w-[95%]`],[`src`,`./assets/images/svgImages/invisible_solid.svg`,`alt`,`عدد الإثراءات المنشورة الخاصة`,1,`inline-block`,`dark:brightness-150`],[1,`flex`,`flex-row`,`flex-wrap`,`bg-[#eeeeee]`,`dark:bg-[#313135]`,`rounded-lg`,`mb-1`,`mr-0`,`lg:mr-2`,`w-full`,`sm:w-[48%]`],[1,`font-medium`,`text-[14px]`,`text-[#717079]`,`dark:text-[#C0BFC9]`,`mr-3`,`mt-[3%]`],[`src`,`./assets/images/svgImages/stop_solid(2).svg`,`alt`,`إثراءات لم ترسل طلباً لنشرها`,1,`inline-block`,`dark:brightness-150`]],template:function(i,t){i&1&&(K_(0,dn,6,0,`p`,0),K_(1,pn,6,0,`p`,1),K_(2,gn,3,0,`div`,2)),i&2&&(X_(t.publicCopiesCount==0&&t.privateCopiesCount>0?0:-1),NT(),X_(t.publicCopiesCount==0&&t.privateCopiesCount==0?1:-1),NT(),X_(t.publicCopiesCount>0?2:-1))},dependencies:[z,I,Eo$1,Tt,At$1,na,$t],styles:[`@media screen and (max-width:599px){.bookImageContainer[_ngcontent-%COMP%]{max-height:100%;
1width:200px}}[_nghost-%COMP%]  .mat-mdc-card{margin:4px auto!important;box-shadow:0 15px 10px #3c3a5803!important;border-radius:20px}[_nghost-%COMP%]  .mat-mdc-card:first-of-type{margin-top:0!important}.copy_title[_ngcontent-%COMP%]{overflow-wrap:anywhere}.btn_show[_ngcontent-%COMP%]:hover   .x[_ngcontent-%COMP%]{filter:brightness(0) invert(1)}`],changeDetection:1})}return o})();var Mt=jx(L());var zi=jx(Hn$1());var _n=o=>[`/books/`,o];var fn=(o,l)=>[`/books/Book-pdf/`,o,l];var Cn=(o,l)=>[`/books/Books/`,o,l];function bn(o,l){if(o&1){let e=cS();ma(0,`a`,5),dh(),ma(1,`svg`,6),Fy(2,`path`,7)(3,`path`,8),Rd()(),fh(),ma(4,`button`,9),$y(`click`,function(){let t=Jp(e).$implicit;return eh(pS().getExcelFileDialogue(t.source))}),dh(),ma(5,`svg`,6),Fy(6,`path`,10)(7,`path`,11)(8,`path`,12),Rd()(),fh(),ma(9,`button`,13),$y(`click`,function(){let t=Jp(e).$implicit;return eh(pS().onUnArchivingCopy(t.source))}),dh(),ma(10,`svg`,14),Fy(11,`path`,15)(12,`path`,16),Rd()()}if(o&2){let e=l.$implicit,i=pS();ky(`routerLink`,e.readLink),NT(4),ky(`disabled`,i.downLoading)}}function xn(o,l){o&1&&(ma(0,`p`,3),Fy(1,`img`,17),ma(2,`span`),$S(3,`لا توجد نسخ مؤرشفة`),Rd(),Fy(4,`br`)(5,`br`),Rd())}function kn(o,l){if(o&1){let e=cS();ma(0,`tr`,22)(1,`td`,23),Fy(2,`img`,24),Rd(),ma(3,`td`,20),$S(4),Rd(),ma(5,`td`,20),$S(6),Rd(),ma(7,`td`,20),$S(8),Rd(),ma(9,`td`,20)(10,`div`,25)(11,`button`,26),dh(),ma(12,`svg`,27),Fy(13,`path`,28)(14,`path`,29),Rd()(),fh(),ma(15,`button`,30),$y(`click`,function(){Jp(e);let t=pS().$implicit;return eh(pS(2).getExcelFileDialogue(t))}),dh(),ma(16,`svg`,27),Fy(17,`path`,31)(18,`path`,32)(19,`path`,33),Rd()(),fh(),ma(20,`button`,34),$y(`click`,function(){Jp(e);let t=pS().$implicit;return eh(pS(2).onUnArchivingCopy(t))}),dh(),ma(21,`svg`,35),Fy(22,`path`,36)(23,`path`,37),Rd()()()()()}if(o&2){let e=pS().$implicit,i=pS(2);NT(2),ky(`alt`,YS(e.book_title))(`routerLink`,oM(10,_n,e.book_slug))(`src`,i.imagePath+(e==null?null:e.book_image),im)(`matTooltip`,e.book_title),NT(2),cv(e.title),NT(2),cv(e.user_annotations_count),NT(2),cv(e.approved_annotations_count),NT(3),ky(`routerLink`,e.book_type===`pdf`||e.book_type==`pdf`?iM(12,fn,e.book_id+`-`+e.book_slug,e.copy_id):iM(15,Cn,e.book_id,e.copy_id)),NT(4),ky(`disabled`,i.downLoading)}}function vn(o,l){if(o&1&&K_(0,kn,24,18,`tr`,22),o&2){let e=l.$implicit;X_(e.archived==!0?0:-1)}}function wn(o,l){if(o&1&&(ma(0,`div`,4)(1,`table`,18)(2,`thead`,19)(3,`th`,20),$S(4,`الكتاب`),Rd(),ma(5,`th`,20),$S(6,`اسم النسخة`),Rd(),ma(7,`th`,20),$S(8,`الإثراءات المكتوبة`),Rd(),ma(9,`th`,20),$S(10,`الإثراءات المعتمدة`),Rd(),ma(11,`th`,21),$S(12,`الإجراءات`),Rd()(),ma(13,`tbody`),tS(14,vn,1,1,null,null,eS),Rd()()()),o&2){let e=pS();NT(14),nS(e.books)}}var Ui=(()=>{class o{books;countArchivedBooks;imagePath=`${ua.storage_path}booksImages/`;dashboardService=g(Me);toastr=g(co$1);cdr=g(Qd);utilisService=g(Pn$1);userService=g(Ha);userBooks=[];userId;dialog=g(ee);timeSevice=g($n$1);ithraaReaderService=g(Ln$1);downLoading;worker;cardsCache=null;get cards(){let e=this.books??[];if(this.cardsCache&&this.cardsCache.source===e)return this.cardsCache.rows;let i=e.filter(t=>t?.archived===!0).map(t=>({id:t.copy_id,bookTitle:t.book_title,copyName:t.title,coverUrl:this.imagePath+(t?.book_image??``),bookLink:[`/books/`,t.book_slug],readLink:t.book_type===`pdf`?[`/books/Book-pdf/`,t.book_id+`-`+t.book_slug,t.copy_id]:[`/books/Books/`,t.book_id,t.copy_id],createdAt:t.created_at,written:t.user_annotations_count,approved:t.approved_annotations_count,source:t}));return this.cardsCache={source:e,rows:i},i}ngOnInit(){this.dashboardService.ownloadingExcelAsync.subscribe(e=>{this.downLoading=e}),this.userId=this.userService.userPayload?this.userService.userPayload.user_id:null}getExcelFileDialogue(e){let i={id:e.book_id,book_slug:e.book_slug,can_annotate:e.can_annotate,name:e.name,title:e.book_title};this.dialog.open(_t,{width:`65vw`,maxHeight:`80vh`,maxWidth:`100vw`,minHeight:`300px`,hasBackdrop:!1,data:{AuthUserId:this.userId,bookId:e.book_id,bookCopy:e.copy_id,copyTitle:e.title,bookType:e.book_type,annotaionsCount:e.user_annotations_count},panelClass:`my_class`}).afterClosed().subscribe(r=>{r?.affectedRows?(this.getExcelFile(e,i,r.affectedRows),this.toastr.success(`تم تصدير الإثراءات بنجاح`)):r?.sessionExpired?(this.dashboardService.downloadingExcelSub.next(!1),this.utilisService.logger(r,20)):r?.requestError&&(this.dashboardService.downloadingExcelSub.next(!1),this.toastr.error(`حدث خطأ أثناء تصدير الإثراءات`,``,{positionClass:`toast-top-left`}))})}getExcelFile(e,i,t){let r;t&&(r=t),this.dashboardService.downloadingExcelSub.next(!0),this.dashboardService.getBookCopyExcelAnnotations(this.userId,e.book_id,e.copy_id,!0,r).subscribe({next:d=>_t$1(this,null,function*(){if(!Array.isArray(d)&&d.status==5)return this.dashboardService.downloadingExcelSub.next(!1),this.utilisService.logger(d,20),null;if(d.length>0)if(typeof window.Worker<`u`){this.worker&&this.worker.terminate(),this.worker=new Worker(new URL(`worker-IDCD5RCI.js`,import.meta.url),{type:`module`});let A=this.ithraaReaderService.apis_url,f=ua.storage_path;this.worker.postMessage({res:d,copyOfUser:e,apis_url:A,book:i,storage_path:f}),this.worker.onmessage=({data:T})=>{(0,Mt.saveAs)(T.blob,`${T.copyTitle}.xlsx`),this.dashboardService.downloadingExcelSub.next(!1),this.worker.terminate(),this.worker=null},this.worker.onerror=T=>{this.dashboardService.downloadingExcelSub.next(!1),this.toastr.error(`حدث خطأ أثناء تصدير الإثراءات`,``,{positionClass:`toast-top-left`}),this.worker.terminate(),this.worker=null}}else{let A=new zi.Workbook,f=A.addWorksheet(`الإثراءات`),T=` \u0625\u062B\u0631\u0627\u0621\u0627\u062A : ${e.title} (${d.length} \u0625\u062B\u0631\u0627\u0621)`,W=`\u0627\u0633\u0645 \u0627\u0644\u0643\u062A\u0627\u0628 :${i.title}`;f.views=[{state:`frozen`,xSplit:0,ySplit:3}];let q=f.addRow([T]);q.font={name:`Comic Sans MS`,family:4,italic:!0,size:20,underline:`none`,bold:!0},f.mergeCells(`A1:H1`),f.getCell(`H1`).style.alignment={vertical:`middle`,horizontal:`center`};let Se=f.addRow([W]);Se.font={name:`Comic Sans MS`,family:4,italic:!0,size:20,underline:`none`,bold:!0},f.mergeCells(`A2:H2`),f.getCell(`H2`).style.alignment={vertical:`middle`,horizontal:`center`};let Me=[`عدد الإعجابات`,`حالة الإثراء(عام/خاص)`,`تصنيف الإثراء`,`مرفق5`,`مرفق4`,`مرفق3`,`مرفق2`,`مرفق1`,`الفيديو`,`الملف الصوتي`,`الصورة`,`نص الإثراء`,`نص الكتاب`,`تاريخ ووقت إنشاء الإثراء`],ve=[`likes_count`,`public`,`category`,`attach5`,`attach4`,`attach3`,`attach2`,`attach1`,`video_url`,`sound_upload`,`image_upload`,`text`,`quote`,`created_at`];f.addRow([]);let le=f.addRow(Me);le.font={name:`Comic Sans MS`,family:4,size:15,underline:`none`,bold:!0},le.height=30,le.eachCell((v,x)=>{v.fill={type:`pattern`,pattern:`solid`,fgColor:{argb:`10b1bf`},bgColor:{argb:`10b1bf`}},v.border={top:{style:`thin`},left:{style:`thin`},bottom:{style:`thin`},right:{style:`thin`}},v.style.alignment={vertical:`middle`,horizontal:`center`}});let je=(v,x)=>_t$1(this,null,function*(){let E=[];v.public==!0?v.public=`عام`:v.public=`خاص`,v.created_at=this.timeSevice.handleTimeZoneHours(v.created_at);let I=v.image_upload;if(v.attachmentsnames?.forEach((y,k)=>{v[`\u0645\u0631\u0641\u0642${k}`]=y,E[7-k]=y.slice(14,y.length)}),delete v.attachmentsnames,Object.keys(v).forEach(y=>{let k=ve.indexOf(y);k>=0&&(v[y]?E[k]=v[y]:E[k]=null)}),I){let y=`${ua.storage_path}image_upload/${I}`,O=yield(yield fetch(y)).blob();return new Promise(($,re)=>{let Z=new FileReader;Z.readAsDataURL(O),Z.addEventListener(`load`,function(){let ft=A.addImage({base64:Z.result,extension:`png`});f.addImage(ft,`K${+x+5}:K${+x+5}`),$(E)},!1),Z.onerror=()=>re(this)})}else return new Promise((y,k)=>{y(E)})});_t$1(this,null,function*(){return Promise.all(d.map((v,x)=>je(v,x)))}).then(v=>{v.forEach((x,E)=>{x[11]=this.extractHtmlText(x[11])}),f.addRows(v),f.columns.forEach(x=>{x.width=30}),f.getRows(1,2).forEach((x,E)=>{x.height=40}
1),f.getRows(5,d.length).forEach((x,E)=>{let I=x.getCell(11),y=x.getCell(10),k=x.getCell(9);for(let O=0;O<5;O++){let $=x.getCell(8-O);$.value&&($.value={text:$.value.toString(),hyperlink:`${this.ithraaReaderService.apis_url}attachments_upload/${d[E][`\u0645\u0631\u0641\u0642${O}`]}`})}y.value&&(y.value={text:y.value.toString(),hyperlink:`${this.ithraaReaderService.apis_url}sound_upload/${y.value}`}),k.value&&(k.value={text:k.value.toString(),hyperlink:k.value.toString()}),I.value?(x.height=150,x.eachCell(O=>{O.style.alignment={vertical:`middle`,horizontal:`right`}})):x.height=30}),A.xlsx.writeBuffer().then(x=>_t$1(this,null,function*(){e.title.replace(`.`,`_`);let I=new Blob([x],{type:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`});(0,Mt.saveAs)(I,`${e.title}.xlsx`),this.dashboardService.downloadingExcelSub.next(!1)}))})}else this.dashboardService.downloadingExcelSub.next(!1),this.toastr.warning(`ليس لديك إثراءات على هذه النسخة`)}),error:()=>{this.dashboardService.downloadingExcelSub.next(!1),this.toastr.error(`حدث خطأ أثناء تصدير الإثراءات`,``,{positionClass:`toast-top-left`})}})}extractHtmlText(e){let i=e?.replace(/<[^>]+>/g,` `).replace(/\s\s+/g,` `);return i=i?.replace(/&[a-z]*;/g,``),i}onUnArchivingCopy(e){this.dashboardService.updateCopyArchivedStatus(e.copy_id,{archived:!1}).subscribe(i=>{this.dashboardService.getBooksCopiedByUser(this.userId).subscribe(t=>{this.userBooks=t.userCopys,this.countArchivedBooks=0,this.books=this.userBooks.filter(r=>{if(this.countArchivedBooks=this.countArchivedBooks+r.archivedCopiesCount,r.archivedCopiesCount>0&&r.archived===!0)return r}),this.dashboardService.asyncCountArchivedBooks.next(this.countArchivedBooks),this.dashboardService.asyncUnArchivedBooks.next(this.userBooks),this.toastr.success(`تم إعادة النسخة`),window.location.reload(),this.cdr.detectChanges(),(t.status==-1||t.status==-2||t.status==-3)&&this.utilisService.logger(t,11)}),(i.status==-2||i.status==-3)&&this.utilisService.logger(i,12)})}static ɵfac=function(i){return new(i||o)};static ɵcmp=t_({type:o,selectors:[[`app-archived-books`]],inputs:{books:`books`,countArchivedBooks:`countArchivedBooks`},decls:6,vars:4,consts:[[`archivedActions`,``],[1,`md:hidden`],[`countNoun`,`نسخة مؤرشفة`,`searchPlaceholder`,`ابحث في النسخ المؤرشفة…`,`searchLabel`,`ابحث في النسخ المؤرشفة`,`emptyTitle`,`لا نسخ مؤرشفة`,`emptyBody`,`أرشفة النسخة تُخرجها من مكتبتك دون أن تمسّ إثراءاتها، وتعود متى شئت.`,3,`cards`,`actions`],[1,`hidden`,`md:block`,`text-[14px]`,`text-center`,`text-not-found-color`,`bg-color-5`,`dark:!bg-dark-200`,`shadow-div-shadow`,`dark:!text-white`,`rounded-3xl`,`p-[10%]`,2,`margin-top`,`17px`],[1,`relative`,`hidden`,`overflow-x-auto`,`md:block`],[`aria-label`,`عرض النسخة`,1,`card-action`,3,`routerLink`],[`width`,`20`,`height`,`20`,`viewBox`,`0 0 25 25`,`fill`,`none`,`aria-hidden`,`true`],[`d`,`M16.0799 12.5C16.0799 14.48 14.4799 16.08 12.4999 16.08C10.5199 16.08 8.91992 14.48 8.91992 12.5C8.91992 10.52 10.5199 8.91998 12.4999 8.91998C14.4799 8.91998 16.0799 10.52 16.0799 12.5Z`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`d`,`M12.4998 20.77C16.0298 20.77 19.3198 18.69 21.6098 15.09C22.5098 13.68 22.5098 11.31 21.6098 9.89997C19.3198 6.29997 16.0298 4.21997 12.4998 4.21997C8.96984 4.21997 5.67984 6.29997 3.38984 9.89997C2.48984 11.31 2.48984 13.68 3.38984 15.09C5.67984 18.69 8.96984 20.77 12.4998 20.77Z`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`type`,`button`,`aria-label`,`تصدير الإثراءات`,1,`card-action`,3,`click`,`disabled`],[`d`,`M16.94 9.40002C20.54 9.71002 22.01 11.56 22.01 15.61V15.74C22.01 20.21 20.22 22 15.75 22H9.23998C4.76998 22 2.97998 20.21 2.97998 15.74V15.61C2.97998 11.59 4.42998 9.74002 7.96998 9.41002`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`d`,`M12.5 15.5V4.12`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`],[`d`,`M15.8499 6.35L12.4999 3L9.1499 6.35`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`type`,`button`,`aria-label`,`إعادة النسخة إلى مكتبتك`,1,`card-action`,3,`click`],[`width`,`20`,`height`,`20`,`viewBox`,`0 0 24 24`,`fill`,`none`,`aria-hidden`,`true`],[`d`,`M14.55 21.67C18.84 20.54 22 16.64 22 12C22 6.48 17.56 2 12 2C5.33 2 2 7.56 2 7.56M2 7.56V3M2 7.56H4.01H6.44`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`d`,`M2 12C2 17.52 6.48 22 12 22`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,`stroke-dasharray`,`3 3`],[`src`,`./assets/images/svgImages/folder.svg`,`alt`,`لا توجد نسخ مؤرشفة`,1,`inline-block`,2,`margin-top`,`-3%`],[1,`w-full`,`border-separate`,`border-spacing-y-4`],[1,`bg-white`,`shadow`,`rounded-2xl`,`text-center`,`font-semibold`,`dark:bg-dark-200`,`dark:text-white`],[1,`p-4`],[1,`p-4`,`text-center`],[1,`bg-white`,`shadow`,`rounded-2xl`,`text-center`,`dark:bg-dark-200`,`dark:text-white`],[1,`p-4`,`cursor-pointer`],[1,`shadow-xl`,`border-t`,`border-r`,`border-[#D3D3D3]`,`w-40`,3,`routerLink`,`src`,`alt`,`matTooltip`],[1,`flex`,`flex-wrap`,`gap-2`],[`mat-flat-button`,``,`matTooltip`,`عرض النسخة`,1,`operation-btn`,`group`,`p-2`,`whitespace-nowrap`,`dark:!bg-dark-200`,`dark:hover:!bg-primary-500`,`dark:!text-white`,`hover:!bg-color-1`,`hover:!text-white`,`flex`,`items-center`,`justify-center`,3,`routerLink`],[`width`,`25`,`height`,`25`,`viewBox`,`0 0 25 25`,`fill`,`none`,`xmlns`,`http://www.w3.org/2000/svg`],[`d`,`M16.0799 12.5C16.0799 14.48 14.4799 16.08 12.4999 16.08C10.5199 16.08 8.91992 14.48 8.91992 12.5C8.91992 10.52 10.5199 8.91998 12.4999 8.91998C14.4799 8.91998 16.0799 10.52 16.0799 12.5Z`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`d`,`M12.4998 20.77C16.0298 20.77 19.3198 18.69 21.6098 15.09C22.5098 13.68 22.5098 11.31 21.6098 9.89997C19.3198 6.29997 16.0298 4.21997 12.4998 4.21997C8.96984 4.21997 5.67984 6.29997 3.38984 9.89997C2.48984 11.31 2.48984 13.68 3.38984 15.09C5.67984 18.69 8.96984 20.77 12.4998 20.77Z`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`mat-flat-button`,``,`matTooltip`,`تصدير الإثراءات`,1,`operation-btn`,`group`,`p-2`,`whitespace-nowrap`,`dark:!bg-dark-200`,`dark:hover:!bg-primary-500`,`dark:!text-white`,`hover:!bg-color-1`,`hover:!text-white`,`flex`,`items-center`,`justify-center`,`rounded`,3,`click`,`disabled`],[`d`,`M16.94 9.40002C20.54 9.71002 22.01 11.56 22.01 15.61V15.74C22.01 20.21 20.22 22 15.75 22H9.23998C4.76998 22 2.97998 20.21 2.97998 15.74V15.61C2.97998 11.59 4.42998 9.74002 7.96998 9.41002`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`d`,`M12.5 15.5V4.12`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`d`,`M15.8499 6.35L12.4999 3L9.1499 6.35`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`mat-flat-button`,``,`matTooltip`,`إعادة النسخة`,1,`group`,`operation-btn`,`group`,`p-2`,`whitespace-nowrap`,`dark:!bg-dark-200`,`dark:hover:!bg-primary-500`,`!text-primary-500`,`hover:!bg-color-1`,`hover:!text-white`,`flex`,`items-center`,`justify-center`,`rounded`,3,`click`],[`width`,`24`,`height`,`24`,`viewBox`,`0 0 24 24`,`fill`,`none`,`xmlns`,`http://www.w3.org/2000/svg`],[`d`,`M14.55 21.67C18.84 20.54 22 16.64 22 12C22 6.48 17.56 2 12 2C5.33 2 2 7.56 2 7.56M2 7.56V3M2 7.56H4.01H6.44`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`d`,`M2 12C2 17.52 6.48 22 12 22`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,`stroke-dasharray`,`3 3`,1,`stroke-primary-500`,`group-hover:stroke-white`]],template:function(i,t){if(i&1&&(ma(0,`section`,1),Fy(1,`app-library-list`,2),Rd(),vy(2,bn,13,2,`ng-template`,null,0,vM),K_(4,xn,6,0,`p`,3),K_(5,wn,16,0,`div`,4)),i&2){let r=IS(3);NT(),ky(`cards`,t.cards)(`actions`,r),NT(3),X_(t.countArchivedBooks==0?4:-1),NT(),X_(t.countArchivedBooks>0?5:-1)}},dependencies:[na,$t,H,Ct,Ve],styles:[`.card-action[_ngcontent-%COMP%]{position:relative;display:grid;place-items:center;width:26px;height:26px;border-radius:8px;border:1px solid #d1cdef;background:#fff;color:#6154b8;transition:background-color .15s ease}.card-action[_ngcontent-%COMP%]:after{content:"";position:absolute;inset-block:-8px;inset-inline:-1px}.card-action[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{width:16px;height:16px}.card-action[_ngcontent-%COMP%]:active{background:#f0effa}.card-action[_ngcontent-%COMP%]:disabled{opacity:.45}
1.card-action[_ngcontent-%COMP%]:focus-visible{outline:2px solid #6c5dcc;outline-offset:2px}.dark[_nghost-%COMP%]   .card-action[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .card-action[_ngcontent-%COMP%]{background:#282828;border-color:#3f3f3f;color:#fff}.dark[_nghost-%COMP%]   .card-action[_ngcontent-%COMP%]:active, .dark   [_nghost-%COMP%]   .card-action[_ngcontent-%COMP%]:active{background:#3f3f3f}@media(prefers-reduced-motion:reduce){.card-action[_ngcontent-%COMP%]{transition:none}}@media screen and (max-width:599px){.bookImageContainer[_ngcontent-%COMP%]{max-height:100%;width:200px}}[_nghost-%COMP%]  .mat-mdc-card{margin:4px auto!important;box-shadow:0 15px 10px #3c3a5803!important;border-radius:20px}[_nghost-%COMP%]  .mat-mdc-card:first-of-type{margin-top:0!important}.copy_title[_ngcontent-%COMP%]{overflow-wrap:anywhere}.btn_show[_ngcontent-%COMP%]:hover   .x[_ngcontent-%COMP%]{filter:brightness(0) invert(1)}[_nghost-%COMP%]  .mat-button-toggle-checked{background:#6c5dcc!important;color:#fff!important;border-radius:10px!important;font-weight:600}  .dark .my_class mat-dialog-container{background:#1d1c1e!important}[_nghost-%COMP%]  .mat-button-toggle-group{box-shadow:none!important;border-radius:10px!important}mat-button-toggle[_ngcontent-%COMP%]:not(.mat-button-toggle-checked)   .list_cat[_ngcontent-%COMP%]:hover{--%NS%tw-text-opacity: 1;color:rgb(0 0 0 / var(--%NS%tw-text-opacity, 1))}mat-button-toggle[_ngcontent-%COMP%]:not(.mat-button-toggle-checked)   .list_cat[_ngcontent-%COMP%]:hover:is(.dark *){--%NS%tw-text-opacity: 1;color:rgb(255 255 255 / var(--%NS%tw-text-opacity, 1))}.mat-button-toggle-checked[_ngcontent-%COMP%]{background:#6c5dcc;border-radius:10px;color:#fff}a.mat-mdc-unelevated-button[_ngcontent-%COMP%], .show_copies_options[_ngcontent-%COMP%]{padding:0 15px;border-radius:5px;background-color:#626a89c4;color:#fff;font-size:17px;height:31px;transition:all .4s}a.mat-mdc-unelevated-button[_ngcontent-%COMP%]:hover, .show_copies_options[_ngcontent-%COMP%]:hover{background-color:#1cbecccc}.add_group_btn[_ngcontent-%COMP%]{margin-top:25px}.table-header[_ngcontent-%COMP%]{margin-bottom:8px!important}.mdc-button.operation-btn[_ngcontent-%COMP%]{border:1px solid #6154b8!important;min-width:30px!important;max-width:30px!important;height:30px!important}@media screen and (min-width:768px){.mdc-button.operation-btn[_ngcontent-%COMP%]{min-width:40px!important;max-width:40px!important;height:40px!important}}`],changeDetection:1})}return o})();var yn=()=>[`title`,`owner`];var Sn=o=>[`/books/`,o];var Mn=(o,l)=>[`/books/Book-pdf/`,o,l];var An=(o,l)=>[`/books/Books/`,o,l];function En(o,l){if(o&1){let e=cS();ma(0,`a`,5),dh(),ma(1,`svg`,6),Fy(2,`path`,7)(3,`path`,8),Rd()(),fh(),ma(4,`button`,9),$y(`click`,function(){let t=Jp(e).$implicit;return eh(pS().toggleLike(t.source))}),dh(),ma(5,`svg`,10),Fy(6,`path`,11),Rd()()}if(o&2){let e=l.$implicit;ky(`routerLink`,e.readLink)}}function Pn(o,l){o&1&&(ma(0,`p`,3),Fy(1,`img`,12),ma(2,`span`),$S(3,`لا توجد نسخ مفضلة`),Rd(),Fy(4,`br`)(5,`br`),Rd())}function Tn(o,l){if(o&1){let e=cS();ma(0,`tr`,17)(1,`td`,18),Fy(2,`img`,19),Rd(),ma(3,`td`,15),$S(4),Rd(),ma(5,`td`,15),Fy(6,`img`,20),$S(7),Rd(),ma(8,`td`,15),$S(9),Rd(),ma(10,`td`,15)(11,`div`,21)(12,`button`,22),dh(),ma(13,`svg`,23),Fy(14,`path`,24)(15,`path`,25),Rd()(),fh(),ma(16,`button`,26)(17,`img`,27),$y(`click`,function(){let t=Jp(e).$implicit;return eh(pS(2).toggleLike(t))}),Rd()()()()()}if(o&2){let e=l.$implicit,i=pS(2);NT(2),ky(`alt`,YS(e.bookCopy.book.title))(`routerLink`,oM(10,Sn,e.bookCopy.book.slug))(`src`,i.imagePath+(e.bookCopy.book==null?null:e.bookCopy.book.image),im)(`matTooltip`,e.bookCopy.book.title),NT(2),cv(e.bookCopy.title),NT(2),ky(`src`,e.bookCopy?.user.profile_image?i.profilePath+(e.bookCopy==null?null:e.bookCopy.user.profile_image):`./assets/images/avatar.webp`,im),NT(),Ld(` `,e.bookCopy.user.full_name,` `),NT(2),cv(e.bookCopy.book.category.name),NT(3),ky(`routerLink`,e.bookCopy.book.type==`pdf`?iM(12,Mn,e.bookCopy.book.id+`-`+e.bookCopy.book.slug,e.bookCopy.id):iM(15,An,e.bookCopy.book.id,e.bookCopy.id))}}function In(o,l){if(o&1&&(ma(0,`div`,4)(1,`table`,13)(2,`thead`,14)(3,`th`,15),$S(4,`الكتاب`),Rd(),ma(5,`th`,15),$S(6,`اسم النسخة`),Rd(),ma(7,`th`,15),$S(8,`صاحب النسخة`),Rd(),ma(9,`th`,15),$S(10,`فئة الكتاب`),Rd(),ma(11,`th`,16),$S(12,`الإجراءات`),Rd()(),ma(13,`tbody`),tS(14,Tn,18,18,`tr`,17,eS),Rd()()()),o&2){let e=pS();NT(14),nS(e.booksFavourite)}}var Gi=(()=>{class o{toastr;booksFavourite=[];countFavouriteBooks=0;userId=``;imagePath=`${ua.storage_path}booksImages/`;profilePath=`${ua.storage_path}profile_images/`;dashboardService=g(Me);cardsCache=null;get cards(){let e=this.booksFavourite??[];if(this.cardsCache&&this.cardsCache.source===e)return this.cardsCache.rows;let i=e.map(t=>{let r=t?.bookCopy,d=r?.book;return{id:t.book_copy_id??r?.id,bookTitle:d?.title,copyName:r?.title,coverUrl:this.imagePath+(d?.image??``),bookLink:[`/books/`,d?.slug],readLink:d?.type==`pdf`?[`/books/Book-pdf/`,d?.id+`-`+d?.slug,r?.id]:[`/books/Books/`,d?.id,r?.id],ownerName:r?.user?.full_name,ownerAvatar:r?.user?.profile_image?this.profilePath+r.user.profile_image:`./assets/images/avatar.webp`,category:d?.category?.name,source:t}});return this.cardsCache={source:e,rows:i},i}constructor(e){this.toastr=e}ngOnInit(){this.dashboardService.getUserFavourites(this.userId).subscribe(e=>{this.booksFavourite=e,this.countFavouriteBooks=this.booksFavourite.length,this.dashboardService.asyncCountFavouriteBooks.next(this.countFavouriteBooks)})}toggleLike(e){this.dashboardService.removeFromFavourites(e.book_copy_id,this.userId).subscribe(i=>{i?(this.dashboardService.getUserFavourites(this.userId).subscribe(t=>{this.booksFavourite=t,this.countFavouriteBooks=this.booksFavourite.length,this.dashboardService.asyncCountFavouriteBooks.next(this.countFavouriteBooks)}),this.toastr.success(`تم إزالة النسخة من النسخ المفضلة`)):this.toastr.error(`فشل في تحديث الحالة`)})}static ɵfac=function(i){return new(i||o)(q(co$1))};static ɵcmp=t_({type:o,selectors:[[`app-favourite-books`]],inputs:{userId:`userId`},decls:6,vars:6,consts:[[`favouriteActions`,``],[1,`md:hidden`],[`countNoun`,`نسخة مفضلة`,`searchPlaceholder`,`ابحث باسم كتاب أو صاحب نسخة…`,`searchLabel`,`ابحث في النسخ المفضلة`,`emptyTitle`,`لا نسخ مفضلة`,`emptyBody`,`أضف نسخة إلى المفضلة وأنت تقرؤها، لتعود إليها من هنا.`,`noResultsBody`,`جرّب اسم كتاب آخر، أو ابحث باسم صاحب النسخة.`,3,`cards`,`actions`,`sortKeys`],[1,`hidden`,`md:block`,`text-[14px]`,`text-center`,`text-not-found-color`,`bg-color-5`,`dark:!bg-dark-200`,`shadow-div-shadow`,`dark:!text-white`,`rounded-3xl`,`p-[10%]`,2,`margin-top`,`17px`],[1,`relative`,`hidden`,`overflow-x-auto`,`md:block`],[`aria-label`,`عرض النسخة`,1,`card-action`,3,`routerLink`],[`width`,`20`,`height`,`20`,`viewBox`,`0 0 25 25`,`fill`,`none`,`aria-hidden`,`true`],[`d`,`M16.0799 12.5C16.0799 14.48 14.4799 16.08 12.4999 16.08C10.5199 16.08 8.91992 14.48 8.91992 12.5C8.91992 10.52 10.5199 8.91998 12.4999 8.91998C14.4799 8.91998 16.0799 10.52 16.0799 12.5Z`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`d`,`M12.4998 20.77C16.0298 20.77 19.3198 18.69 21.6098 15.09C22.5098 13.68 22.5098 11.31 21.6098 9.89997C19.3198 6.29997 16.0298 4.21997 12.4998 4.21997C8.96984 4.21997 5.67984 6.29997 3.38984 9.89997C2.48984 11.31 2.48984 13.68 3.38984 15.09C5.67984 18.69 8.96984 20.77 12.4998 20.77Z`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`type`,`button`,`aria-pressed`,`true`,`aria-label`,`إزالة النسخة من المفضلة`,1,`card-action`,3,`click`],[`width`,`20`,`height`,`20`,`viewBox`,`0 0 24 24`,`fill`,`currentColor`,`aria-hidden`,`true`,1,`text-primary-400`],[`d`,`M12.62 20.8101C12.28 20.9301 11.72 20.9301 11.38 20.8101C8.48 19.8201 2 15.6901 2 8.6901C2 5.6001 4.49 3.1001 7.56 3.1001C9.38 3.1001 10.99 3.9801 12 5.3401C13.01 3.9801 14.63 3.1001 16.44 3.1001C19.51 3.1001 22 5.6001 22 8.6901C22 15.6901 15.52 19.8201 12.62 20.8101Z`,`stroke`,`currentColor`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`src`,`./assets/images/svgImages/folder.svg`,`alt`,`لا توجد نسخ`,1,`inline-block`,2,`margin-top`,`-3%`],[1,`w-full`,`border-separate`,`border-spacing-y-4`],[1,`bg-white`,`shadow`,`rounded-2xl`,`text-center`,`font-semibold`,`dark:bg-dark-200`,`dark:text-white`],[1,`p-4`],[1,`p-4`,`text-center`],[1,`bg-white`,`shadow`,`rounded-2xl`,`text-center`,`dark:bg-dark-200`,`dark:text-white`],[1,`p-4`,`cursor-pointer`],[1,`shadow-xl`,`border-t`,`border-r`,`border-[#D3D3D3]`,`w-40`,3,`routerLink`,`src`,`alt`,`matTooltip`],[`alt`,`صورة حساب صاحب النسخة`,1,`w-12`,`h-12`,`ml-2`,`rounded-full`,3,`src`],[1,`flex`,`flex-wrap`,`gap-2`],[`mat-flat-button`,``,`matTooltip`,`عرض النسخة`,1,`operation-btn`,`group`,`p-2`,`whitespace-nowrap`,`dark:!bg-dark-200`,`dark:hover:!bg-primary-500`,`dark:!text-white`,`hover:!bg-color-1`,`hover:!text-white`,`flex`,`items-center`,`justify-center`,3,`routerLink`],[`width`,`25`,`height`,`25`,`viewBox`,`0 0 25 25`,`fill`,`none`,`xmlns`,`http://www.w3.org/2000/svg`],[`d`,`M16.0799 12.5C16.0799 14.48 14.4799 16.08 12.4999 16.08C10.5199 16.08 8.91992 14.48 8.91992 12.5C8.91992 10.52 10.5199 8.91998 12.4999 8.91998C14.4799 8.91998 16.0799 10.52 16.0799 12.5Z`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`d`,`M12.4998 20.77C16.0298 20.77 19.3198 18.69 21.6098 15.09C22.5098 13.68 22.5098 11.31 21.6098 9.89997C19.3198 6.29997 16.0298 4.21997 12.4998 4.21997C8.96984 4.21997 5.67984 6.29997 3.38984 9.89997C2.48984 11.31 2.48984 13.68 3.38984 15.09C5.67984 18.69 8.96984 20.77 12.4998 20.77Z`,`stroke-width`,`1.5`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,1,`stroke-primary-500`,`group-hover:stroke-white`],[`mat-flat-button`,``,1,`p-2`,`!text-[14px]`,`items-center`,`!justify-end`],[`src`,`./assets/icons/annotations-page/like-active.svg`,`width`,`35`,`height`,`35`,`matTooltip`,`إلغاء الإعجاب`,`alt`,`إلغاء الإعجاب`,1,`cursor-pointer`,`ml-1`,3,`click`]],template:function(i,t){if(i&1&&(ma(0,`section`,1),Fy(1,`app-library-list`,2),Rd(),vy(2,En,7,1,`ng-template`,null,0,vM),K_(4,Pn,6,0,`p`,3),K_(5,In,16,0,`div`,4)),i&2){let r=IS(3);NT(),ky(`cards`,t.cards)(`actions`,r)(`sortKeys`,rM(5,yn)),NT(3),X_(t.countFavouriteBooks==0?4:-1),NT(),X_(t.countFavouriteBooks>0?5:-1)}},dependencies:[na,$t,H,Ct,Ve],styles:[`.card-action[_ngcontent-%COMP%]{position:relative;display:grid;place-items:center;width:26px;height:26px;border-radius:8px;border:1px solid #d1cdef;background:#fff;color:#6154b8;transition:background-color .15s ease}.card-action[_ngcontent-%COMP%]:after{content:"";position:absolute;inset-block:-8px;inset-inline:-1px}.card-action[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{width:16px;height:16px}.card-action[_ngcontent-%COMP%]:active{background:#f0effa}.card-action[_ngcontent-%COMP%]:disabled{opacity:.45}
1.card-action[_ngcontent-%COMP%]:focus-visible{outline:2px solid #6c5dcc;outline-offset:2px}.dark[_nghost-%COMP%]   .card-action[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .card-action[_ngcontent-%COMP%]{background:#282828;border-color:#3f3f3f;color:#fff}.dark[_nghost-%COMP%]   .card-action[_ngcontent-%COMP%]:active, .dark   [_nghost-%COMP%]   .card-action[_ngcontent-%COMP%]:active{background:#3f3f3f}@media(prefers-reduced-motion:reduce){.card-action[_ngcontent-%COMP%]{transition:none}}@media screen and (max-width:599px){.bookImageContainer[_ngcontent-%COMP%]{max-height:100%;width:200px}}[_nghost-%COMP%]  .mat-mdc-card{margin:4px auto!important;box-shadow:0 15px 10px #3c3a5803!important;border-radius:20px}[_nghost-%COMP%]  .mat-mdc-card:first-of-type{margin-top:0!important}.btn_show[_ngcontent-%COMP%]:hover   .x[_ngcontent-%COMP%]{filter:brightness(0) invert(1)}[_nghost-%COMP%]  .mat-button-toggle-checked{background:#6c5dcc!important;color:#fff!important;border-radius:10px!important;font-weight:600}  .dark .my_class mat-dialog-container{background:#1d1c1e!important}[_nghost-%COMP%]  .mat-button-toggle-group{box-shadow:none!important;border-radius:10px!important}mat-button-toggle[_ngcontent-%COMP%]:not(.mat-button-toggle-checked)   .list_cat[_ngcontent-%COMP%]:hover{--%NS%tw-text-opacity: 1;color:rgb(0 0 0 / var(--%NS%tw-text-opacity, 1))}mat-button-toggle[_ngcontent-%COMP%]:not(.mat-button-toggle-checked)   .list_cat[_ngcontent-%COMP%]:hover:is(.dark *){--%NS%tw-text-opacity: 1;color:rgb(255 255 255 / var(--%NS%tw-text-opacity, 1))}.mat-button-toggle-checked[_ngcontent-%COMP%]{background:#6c5dcc;border-radius:10px;color:#fff}a.mat-mdc-unelevated-button[_ngcontent-%COMP%], .show_copies_options[_ngcontent-%COMP%]{padding:0 15px;border-radius:5px;background-color:#626a89c4;color:#fff;font-size:17px;height:31px;transition:all .4s}a.mat-mdc-unelevated-button[_ngcontent-%COMP%]:hover, .show_copies_options[_ngcontent-%COMP%]:hover{background-color:#1cbecccc}.add_group_btn[_ngcontent-%COMP%]{margin-top:25px}.table-header[_ngcontent-%COMP%]{margin-bottom:8px!important}.mdc-button.operation-btn[_ngcontent-%COMP%]{border:1px solid #6154b8!important;min-width:30px!important;max-width:30px!important;height:30px!important}@media screen and (min-width:768px){.mdc-button.operation-btn[_ngcontent-%COMP%]{min-width:40px!important;max-width:40px!important;height:40px!important}}`],changeDetection:1})}return o})();var On=(o,l)=>({"mt-28":o,"mt-9":l});var Bn=()=>[`/books`];var Dn=(o,l)=>l.value;function Fn(o,l){o&1&&(dh(),ma(0,`svg`,29),Fy(1,`path`,31),Rd())}function Ln(o,l){if(o&1){let e=cS();ma(0,`button`,28),$y(`click`,function(){let t=Jp(e).$implicit;return eh(pS().selectTab(t.value))}),K_(1,Fn,2,0,`:svg:svg`,29),$S(2),ma(3,`span`,30),$S(4),Rd()()}if(o&2){let e=l.$implicit,i=pS();Jy(`is-active`,i.toggle_index==e.index),Oy(`aria-current`,i.toggle_index==e.index?`true`:null),NT(),X_(i.toggle_index==e.index?1:-1),NT(),Ld(` `,e.label,` `),NT(2),cv(e.count())}}function Vn(o,l){o&1&&(ma(0,`div`,24),Fy(1,`mat-spinner`,32),ma(2,`p`,33),$S(3,`جاري تحميل البيانات...`),Rd()())}function jn(o,l){o&1&&(ma(0,`div`,34),Fy(1,`i`,36),$S(2,`أهلًا بك في مكتبتك على منصة إثراء.. تفضل بزيارة صفحة الكتب، وإضافة ما تشاء منها إلى مكتبتك `),Fy(3,`br`)(4,`br`),ma(5,`p`)(6,`a`,37),$S(7,` تصفح الكتب الآن `),Rd()()()),o&2&&(NT(6),ky(`routerLink`,rM(1,Bn)))}function Rn(o,l){if(o&1){let e=cS();ma(0,`app-copy-item`,38),$y(`increaseCopiesNumbers`,function(t){Jp(e);return eh(pS(2).increaseCopiesNumbers(t))}),Rd()}if(o&2){let e=pS(2);ky(`userCopys`,e.userCopys)(`userType`,e.userType)(`expandedPanel`,e.expandedPanel)(`userType`,e.userType)}}function $n(o,l){if(o&1&&(K_(0,jn,8,2,`div`,34),K_(1,Rn,1,4,`app-copy-item`,35)),o&2){let e=pS();X_(e.allcopiesNumber==0?0:-1),NT(),X_(e.allcopiesNumber>0?1:-1)}}function Nn(o,l){if(o&1&&Fy(0,`app-contribution-copies`,25),o&2){let e=pS();ky(`booksContributedOn`,e.booksContributedOn)(`publicCopiesCount`,e.publicCopiesCount)(`privateCopiesCount`,e.privateCopiesCount)}}function Hn(o,l){if(o&1&&Fy(0,`app-archived-books`,26),o&2){let e=pS();ky(`books`,e.archivedBooks)(`countArchivedBooks`,e.countArchivedBooks)}}function zn(o,l){if(o&1&&Fy(0,`app-favourite-books`,27),o&2)ky(`userId`,pS().userId)}var Un=[{path:``,component:(()=>{class o{dashboardService;userService;titleService;cdr;dialog;introService;route;router;utilisService;routerService;userId;userBooks=[];userCopys=[];allcopiesNumber=0;userType;userSlug;booksContributedOn=[];copiesContributedOnCount;publicCopiesCount=0;privateCopiesCount=0;scrolledBookId;introFlag;steps;pageNumber=4;introState;expandedPanel;subscription;auditSub;partNum;IsPwaUrl$;toggle_index=0;
1isLoading=!0;archivedBooks=[];countArchivedBooks=0;favouriteBooks=[];countFavouriteBooks=0;mobileTabs=[{index:0,value:`my_copies`,label:`نسخي`,count:()=>this.allcopiesNumber},{index:1,value:`contributions`,label:`شاركت`,count:()=>this.publicCopiesCount},{index:2,value:`archived`,label:`المؤرشفة`,count:()=>this.countArchivedBooks},{index:3,value:`favorites`,label:`المفضلة`,count:()=>this.countFavouriteBooks}];constructor(e,i,t,r,d,A,f,T,W,q){this.dashboardService=e,this.userService=i,this.titleService=t,this.cdr=r,this.dialog=d,this.introService=A,this.route=f,this.router=T,this.utilisService=W,this.routerService=q,this.titleService.setTitle(`إثراء | مكتبتي`),this.copiesContributedOnCount=0,this.userId=this.userService.userPayload?this.userService.userPayload.user_id:null,this.userSlug=this.userService.userPayload?this.userService.userPayload.slug:null,this.partNum=this.route.snapshot.paramMap.get(`part`),this.partNum&&this.partNum>0?this.toggle_index=this.partNum:this.toggle_index=0}addCopyDialog(){this.dialog.open(Yt,{data:{state:0},width:`500px`,panelClass:`my_class`}).afterClosed().subscribe(i=>{i&&i?.data&&i.data?.state==3&&this.dashboardService.getBooksCopiedByUser(this.userId).subscribe(t=>{this.dashboardService.asyncCopiesOfAbook.next(t.message),++this.allcopiesNumber})})}ngOnInit(){this.dashboardService.asyncArchivedBooks.subscribe(e=>{e&&(this.userCopys=e,this.userCopys.forEach(i=>{let t=U({},i);i.archived===!0&&!this.archivedBooks.some(r=>r.copy_id==i.copy_id)&&this.archivedBooks.push(t),i.panelOpenState=!1}))}),this.IsPwaUrl$=this.routerService.getIsPwaUrl(),this.getDashboardData(),this.dashboardService.asyncCountArchivedBooks.subscribe(e=>{this.countArchivedBooks=e,this.allcopiesNumber=Math.max(0,this.allcopiesNumber-1)}),this.dashboardService.asyncCountFavouriteBooks.subscribe(e=>{this.countFavouriteBooks=e}),this.scrolledBookId=localStorage.getItem(`scrolledBookId`)?JSON.parse(localStorage.getItem(`scrolledBookId`)):null,localStorage.removeItem(`scrolledBookId`),this.userSlug!=null&&this.userService.getUser(this.userSlug).subscribe(e=>{this.userType=e.userType}),setTimeout(()=>{this.scrolledBookId&&document.getElementById(`book${this.scrolledBookId}`).scrollIntoView({behavior:`smooth`,block:`center`})},2e3),this.getContributionCopies(),this.dashboardService.getUserFavourites(this.userId).subscribe(e=>{this.countFavouriteBooks=e.length})}getDashboardData(){this.dashboardService.getBooksCopiedByUser(this.userId).subscribe(e=>{this.copiesContributedOnCount=e.copiesContributedOnCount,this.allcopiesNumber=e?.allCopiesCount,this.userCopys=e?.userCopys,this.userCopys.forEach(i=>{if(i.archived==!0&&!this.archivedBooks.some(t=>t.copy_id==i.copy_id)){this.countArchivedBooks+=1;let t=U({},i);i.archived===!0&&this.archivedBooks.push(t)}i.panelOpenState=!1}),this.allcopiesNumber=this.allcopiesNumber-this.countArchivedBooks,this.isLoading=!1},()=>{this.isLoading=!1})}getContributionCopies(){this.dashboardService.getContributionCopies(this.userId).subscribe(e=>{if(e.status==0){let i=e.message;this.publicCopiesCount=e.publicCopiesCount,this.privateCopiesCount=e.privateCopiesCount;let t={},r={};for(let d=0;d<i.length;d++){let A=i.filter(f=>f.book_name==i[d].book_name);if(!r[i[d].book_name]){r[i[d].book_name]={},t=r[i[d].book_name],t.bookName=i[d].book_name,t.authorName=i[d].autor_name,t.book_id=i[d].book_id,t.book_slug=i[d].book_slug,t.book_type=i[d].book_type,t.copies=[];for(let f=0;f<A.length;f++){let T={};T=A[f],t.copies.push(T)}this.booksContributedOn.push(t)}e?.status==-1&&this.utilisService.logger(e,21),e?.status==-2&&this.utilisService.logger(e,22),e?.status==-3&&this.utilisService.logger(e,23)}}})}handleBallons(){screen.width>980&&(this.subscription=this.introService.flagBehoviourObs.subscribe(e=>{!e&&this.userId&&this.getPageIntroState()}))}increaseCopiesNumbers(e){this.allcopiesNumber++}ngOnDestroy(){this.subscription&&(this.subscription.unsubscribe(),this.introService.flagBehoviour.next(null)),this.auditSub&&this.auditSub.unsubscribe()}getPageIntroState(){this.userId&&this.userService.getUserintroState(this.userId,this.pageNumber).subscribe(e=>{if(this.introService.introBehoviour.next(e.old_introState>0),this.introState=e.introState,this.introFlag=e.introFlag,this.introFlag){if(document.getElementById(`dashIntro15`)!=null){let i=document.getElementById(`dashIntro15`);for(;i.parentElement!=null;){if(i.tagName==`MAT-EXPANSION-PANEL`){this.expandedPanel=i.id,this.cdr.detectChanges();break}i=i.parentElement}}this.introService.getBalloons(this.pageNumber).subscribe(i=>{this.introService.steps=i,this.introService.getUserLastSteps(this.pageNumber,this.introState)})}})}selectTab(e){this.changeToggle({value:e})}changeToggle(e){e.value==`my_copies`?(this.toggle_index=0,this.router.navigate([`/dashboard`])):e.value==`contributions`?(this.toggle_index=1,this.router.navigate([`/dashboard/`,{part:1}])):e.value==`archived`?(this.toggle_index=2,this.router.navigate([`/dashboard/`,{part:2}])):e.value==`favorites`&&(this.toggle_index=3,this.router.navigate([`/dashboard/`,{part:3}]))}static ɵfac=function(i){return new(i||o)(q(Me),q(Ha),q(Az),q(Qd),q(ee),q(Bo$1),q(Y),q(F),q(Pn$1),q(zn$1))};static ɵcmp=t_({type:o,selectors:[[`app-dashboard`]],decls:42,vars:21,consts:[[1,`px-4`,3,`ngClass`],[`dir`,`rtl`,1,`container`,`mx-auto`,`md:hidden`],[1,`flex`,`items-center`,`gap-3`],[1,`grid`,`h-12`,`w-12`,`shrink-0`,`place-items-center`,`rounded-2xl`,`bg-primary-100`,`dark:bg-dark-200`],[`src`,`./assets/images/icons/my-library.svg`,`alt`,``,1,`h-6`,`w-6`],[1,`min-w-0`],[1,`text-[26px]`,`font-bold`,`leading-tight`,`text-color-15`,`dark:text-white`],[1,`mt-1`,`text-[13px]`,`leading-[1.7]`,`text-gray-700`,`dark:text-gray-400`],[`aria-label`,`أقسام مكتبتي`,1,`mb-1`,`mt-4`,`grid`,`grid-cols-2`,`gap-2`,`sm:flex`,`sm:flex-wrap`],[`type`,`button`,1,`chip`,3,`is-active`],[1,`container`,`mx-auto`,`mb-3`,`hidden`,`flex-col`,`flex-wrap`,`justify-start`,`gap-5`,`sm:justify-between`,`sm:gap-0`,`md:flex`,`md:flex-row`],[`id`,`dashIntro1`,1,`flex`,`items-center`,`dark:text-white`,`text-color-15`,`text-[32px]`,`font-semibold`],[1,`bg-color-1`,`me-3`,`bg-opacity-10`,`w-12`,`h-12`,`flex`,`items-center`,`justify-center`,`rounded-full`],[`src`,`./assets/images/icons/my-library.svg`,`alt`,`مكتبتي`],[1,`flex`,`flex-row`,`flex-wrap`,`w-full`,`lg:w-4/10`,`justify-center`,`mt-2`,`sm:justify-end`],[1,`flex`,`flex-row`,`flex-wrap`,`justify-start`,`w-full`,`mt-2`],[`name`,`fontStyle`,`aria-label`,`Font Style`,`appearance`,`legacy`,1,`shadow-none`,`rounded-lg`,`bg-color-5`,`dark:bg-dark-200`,`flex-wrap`,3,`change`],[`value`,`my_copies`,1,`flex`,`flex-row`,`flex-wrap`,3,`checked`],[1,`list_cat`,`text-[14px]`,`dark:text-white`],[`value`,`contributions`,1,`flex`,`flex-row`,`flex-wrap`,`list_c
1at`,`text-[14px]`,3,`checked`],[`value`,`archived`,1,`flex`,`flex-row`,`flex-wrap`,`list_cat`,`text-[14px]`,3,`checked`],[`value`,`favorites`,1,`flex`,`flex-row`,`flex-wrap`,`list_cat`,`text-[14px]`,3,`checked`],[1,`flex`,`flex-row`,`flex-wrap`,`justify-center`,`mb-8`,`px-4`,`py-4`],[1,`container`,`mx-auto`],[1,`flex`,`flex-col`,`w-full`,`justify-center`,`items-center`,2,`min-height`,`50vh`],[3,`booksContributedOn`,`publicCopiesCount`,`privateCopiesCount`],[3,`books`,`countArchivedBooks`],[3,`userId`],[`type`,`button`,1,`chip`,3,`click`],[`viewBox`,`0 0 24 24`,`fill`,`none`,`aria-hidden`,`true`],[1,`chip-count`],[`d`,`M5 13l4 4L19 7`,`stroke`,`currentColor`,`stroke-width`,`2.4`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`],[`diameter`,`30`],[1,`mt-3`,`text-[16px]`,`text-[#a7a7a7]`,`dark:text-white`],[`dir`,`rtl`,1,`w-full`,`text-[#a7a7a7]`,`p-7`,`text-center`,`bg-color-5`,`dark:bg-dark-200`,`dark:text-white`,`text-[20px]`,`rounded-lg`],[3,`userCopys`,`userType`,`expandedPanel`],[1,`fa`,`fa-exclamation-circle`,`ml-1`],[`routerLinkActive`,`router-link-active`,1,`bg-color-1`,`p-3`,`cursor-pointer`,`rounded-lg`,`text-color-6`,`font-medium`,`text-[14px]`,`hover:bg-[#6055A3]`,3,`routerLink`],[3,`increaseCopiesNumbers`,`userCopys`,`userType`,`expandedPanel`]],template:function(i,t){i&1&&(ma(0,`section`,0),fM(1,`async`),fM(2,`async`),ma(3,`div`,1)(4,`div`,2)(5,`div`,3),Fy(6,`img`,4),Rd(),ma(7,`div`,5)(8,`h2`,6),$S(9,`مكتبتي`),Rd(),ma(10,`p`,7),$S(11,`إدارة نسخك وإثراءاتك من الكتب`),Rd()()(),ma(12,`nav`,8),tS(13,Ln,5,6,`button`,9,Dn),Rd()(),ma(15,`div`,10)(16,`h2`,11)(17,`div`,12),Fy(18,`img`,13),Rd(),$S(19,` مكتبتي `),Rd(),ma(20,`div`,14)(21,`div`,15)(22,`mat-button-toggle-group`,16),$y(`change`,function(d){return t.changeToggle(d)}),ma(23,`mat-button-toggle`,17)(24,`span`,18),$S(25),Rd()(),ma(26,`mat-button-toggle`,19)(27,`span`,18),$S(28),Rd()(),ma(29,`mat-button-toggle`,20)(30,`span`,18),$S(31),Rd()(),ma(32,`mat-button-toggle`,21)(33,`span`,18),$S(34),Rd()()()()()()(),ma(35,`div`,22)(36,`div`,23),K_(37,Vn,4,0,`div`,24),K_(38,$n,2,2),K_(39,Nn,1,3,`app-contribution-copies`,25),K_(40,Hn,1,2,`app-archived-books`,26),K_(41,zn,1,1,`app-favourite-books`,27),Rd()()),i&2&&(ky(`ngClass`,iM(18,On,!hM(1,14,t.IsPwaUrl$),hM(2,16,t.IsPwaUrl$))),NT(13),nS(t.mobileTabs),NT(10),ky(`checked`,t.toggle_index==0),NT(2),Ld(`نسخي (`,t.allcopiesNumber,`) `),NT(),ky(`checked`,t.toggle_index==1),NT(2),Ld(` نسخ شاركت في إثرائها (`,t.publicCopiesCount,`) `),NT(),ky(`checked`,t.toggle_index==2),NT(2),Ld(` نسخي المؤرشفة (`,t.countArchivedBooks,`) `),NT(),ky(`checked`,t.toggle_index==3),NT(2),Ld(` النسخ المفضلة (`,t.countFavouriteBooks,`) `),NT(3),X_(t.isLoading?37:-1),NT(),X_(t.toggle_index==0&&!t.isLoading?38:-1),NT(),X_(t.toggle_index==1&&!t.isLoading?39:-1),NT(),X_(t.toggle_index==2&&!t.isLoading?40:-1),NT(),X_(t.toggle_index==3&&!t.isLoading?41:-1))},dependencies:[Vi,Dt,Eo$1,bt,nt$1,Hi,na,$t,Jo$1,uf,SN,Ui,Gi,J,Z,kN],styles:[`@charset "UTF-8";[_nghost-%COMP%]  .mat-button-toggle-checked{background:#6c5dcc!important;color:#fff!important;border-radius:10px!important;font-weight:600}  .dark .my_class mat-dialog-container{background:#1d1c1e!important}[_nghost-%COMP%]  .mat-button-toggle-group{box-shadow:none!important;border-radius:10px!important}mat-button-toggle[_ngcontent-%COMP%]:not(.mat-button-toggle-checked)   .list_cat[_ngcontent-%COMP%]:hover{--%NS%tw-text-opacity: 1;color:rgb(0 0 0 / var(--%NS%tw-text-opacity, 1))}mat-button-toggle[_ngcontent-%COMP%]:not(.mat-button-toggle-checked)   .list_cat[_ngcontent-%COMP%]:hover:is(.dark *){--%NS%tw-text-opacity: 1;color:rgb(255 255 255 / var(--%NS%tw-text-opacity, 1))}.mat-button-toggle-checked[_ngcontent-%COMP%]{background:#6c5dcc;border-radius:10px;color:#fff}a.mat-mdc-unelevated-button[_ngcontent-%COMP%], .show_copies_options[_ngcontent-%COMP%]{padding:0 15px;border-radius:5px;background-color:#626a89c4;color:#fff;font-size:17px;height:31px;transition:all .4s}a.mat-mdc-unelevated-button[_ngcontent-%COMP%]:hover, .show_copies_options[_ngcontent-%COMP%]:hover{background-color:#1cbecccc}.add_group_btn[_ngcontent-%COMP%]{margin-top:25px}  .mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked:after, .mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate[_ngcontent-%COMP%]:after{color:#fff!important}.chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:42px;padding:0 12px;border:1px solid #d1cdef;border-radius:999px;background:#fff;color:#403c58;font-size:13px;font-weight:500;white-space:nowrap}.chip[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{width:14px;
1height:14px;flex-shrink:0}.chip-count[_ngcontent-%COMP%]{display:inline-grid;place-items:center;min-width:20px;height:18px;padding:0 5px;border-radius:999px;background:#f0effa;color:#6154b8;font-size:11px;font-weight:700;font-variant-numeric:tabular-nums}.chip.is-active[_ngcontent-%COMP%]{background:#6c5dcc;border-color:#6c5dcc;color:#fff;font-weight:600}.chip.is-active[_ngcontent-%COMP%]   .chip-count[_ngcontent-%COMP%]{background:#ffffff38;color:#fff}.chip[_ngcontent-%COMP%]:focus-visible{outline:2px solid #6c5dcc;outline-offset:2px}.dark[_nghost-%COMP%]   .chip[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .chip[_ngcontent-%COMP%]{background:#282828;border-color:#3f3f3f;color:#fff}.dark[_nghost-%COMP%]   .chip-count[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .chip-count[_ngcontent-%COMP%]{background:#3f3f3f;color:#fff}.dark[_nghost-%COMP%]   .chip.is-active[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .chip.is-active[_ngcontent-%COMP%]{background:#6c5dcc;border-color:#6c5dcc}.dark[_nghost-%COMP%]   .chip.is-active[_ngcontent-%COMP%]   .chip-count[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .chip.is-active[_ngcontent-%COMP%]   .chip-count[_ngcontent-%COMP%]{background:#ffffff38}`],changeDetection:1})}return o})(),canActivate:[I$1]}];var s0=(()=>{class o{static ɵfac=function(i){return new(i||o)};static ɵmod=cr({type:o});static ɵinj=nn$1({imports:[na.forChild(Un)]})}return o})();export{s0 as DashboardModule};

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.