PageSourceSearch

https://kapl.org.sa/chunk-H5COEYVU.js

js kapl.org.sa collected 2026-10-02 11:51:49 UTC 8,145 bytes, 1 lines download raw bytes

1import{a as B}from"./chunk-QYB2QC75.js";import{a as I}from"./chunk-ZMCX562Y.js";import{a as $}from"./chunk-HR6N2JU4.js";import"./chunk-J4HJR42N.js";import{d as j}from"./chunk-SHOMHIY5.js";import{a as N}from"./chunk-PZHHH6CS.js";import{Bb as y,Bd as R,Cc as T,Db as U,Dc as D,Eb as b,Fb as f,Ib as O,Jb as L,Kb as h,Lb as r,Mb as a,Mc as z,Nb as C,Ra as M,Sa as k,Ub as _,Wa as s,Wb as m,Yb as l,ca as u,hc as v,ia as p,ic as V,ja as g,lb as S,nd as E,oa as w,sa as c,yd as P}from"./chunk-4ZWULVLN.js";import"./chunk-KAVETMHO.js";function K(i,t){i&1&&(r(0,"div",2)(1,"div",4)(2,"span",5),v(3,"Loading..."),a()()())}function Y(i,t){i&1&&(r(0,"div",6)(1,"h2",7),v(2),T(3,"translate"),a()()),i&2&&(s(2),V(D(3,1,"no_data_found")))}function A(i,t){if(i&1){let e=_();r(0,"button",11),m("click",function(){let o=p(e).$implicit,d=l(3);return g(d.openVideo(o))}),r(1,"span",12),C(2,"img",13)(3,"span",14),a(),r(4,"span",15)(5,"span",16),v(6),a()()()}if(i&2){let e=t.$implicit;y("aria-label",e.title),s(2),h("src",e.thumbnail,M)("alt",e.title)("title",e.title),s(4),V(e.title)}}function G(i,t){if(i&1){let e=_();r(0,"div",8),O(1,A,7,5,"button",9,U().trackVideo,!0),a(),r(3,"app-pagination",10),m("pageChange",function(o){p(e);let d=l(2);return g(d.goToPage(o))}),a()}if(i&2){let e=l(2);s(),L(e.videos()),s(2),h("currentPage",e.currentPage())("totalPages",e.totalPages())}}function H(i,t){if(i&1&&b(0,Y,4,3,"div",6)(1,G,4,2),i&2){let e=l();f(e.videos().length===0?0:1)}}function J(i,t){if(i&1){let e=_();r(0,"div",17),m("click",function(){p(e);let o=l();return g(o.closeVideo())}),r(1,"div",18),m("click",function(o){return p(e),g(o.stopPropagation())}),r(2,"button",19),m("click",function(){p(e);let o=l();return g(o.closeVideo())}),v(3," \xD7 "),a(),r(4,"div",20),C(5,"iframe",21),a()()()}if(i&2){let e=l();s(5),h("src",e.activeVideoUrl(),k)}}var F=class i{data;kaplService=u(I);langService=u(R);destroyRef=u(w);sanitizer=u(j);videos=c([]);isLoading=c(!0);currentPage=c(1);totalPages=c(1);pages=c([]);activeVideoUrl=c(null);pageSize=6;constructor(){z(()=>{this.langService.lang(),this.loadVideos(1)})}loadVideos(t){this.isLoading.set(!0),this.kaplService.getMediaCenterVideos(t,this.pageSize,"id","desc").pipe(N(this.destroyRef)).subscribe({next:e=>{this.currentPage.set(e.page||t),this.totalPages.set(e.totalPages||1),this.pages.set(this.buildPages(e.page||t,e.totalPages||1));let o=(e?.data||[]).map(d=>this.mapVideo(d));this.videos.set(o),this.isLoading.set(!1)},error:e=>{console.error("Failed to load videos",e),this.videos.set([]),this.totalPages.set(1),this.pages.set([]),this.isLoading.set(!1)}})}goToPage(t){if(t>=1&&t<=this.totalPages()){this.loadVideos(t);let e=document.querySelector(".videos-library");e&&e.scrollIntoView({behavior:"smooth"})}}trackVideo(t,e){return e.id}openVideo(t){t.videoUrl&&this.activeVideoUrl.set(this.getSafeVideoUrl(t.videoUrl))}closeVideo(){this.activeVideoUrl.set(null)}mapVideo(t){return{id:t.guid||"",title:t.title||"",description:t.description||"",videoUrl:t.videoUrl||"",thumbnail:this.getThumbnailUrl(t.videoUrl)}}getThumbnailUrl(t){if(!t)return`${P.mediaBaseUrl}/uploads/Pictures/placeholder-cards.jpg`;let e=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/,n=t.match(e);return n&&n[2].length===11?`https://img.youtube.com/vi/${n[2]}/hqdefault.jpg`:`${P.mediaBaseUrl}/uploads/Pictures/placeholder-cards.jpg`}getSafeVideoUrl(t){if(!t)return null;let e="",n=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/,o=t.match(n);if(o&&o[2].length===11)e=o[2];else return this.sanitizer.bypassSecurityTrustResourceUrl(t);let d=`https://www.youtube.com/embed/${e}?autoplay=1&rel=0`;return this.sanitizer.bypassSecurityTrustResourceUrl(d)}buildPages(t,e){if(e<=1)return[];let n=[],o=Math.max(1,t-2),d=Math.min(e,o+4),q=Math.max(1,d-4);for(let x=q;x<=d;x++)n.push(x);return n}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["app-videos-library"]],inputs:{data:"data"},decls:5,vars:3,consts:[[1,"videos-library"],[1,"container"],[1,"d-flex","justify-content-center","py-5"],[1,"video-modal"],["role","status",1,"spinner-border","text-primary"],[1,"visually-hidden"],[1,"text-center","py-5"],[1,"h4","text-muted"],[1,"videos-grid"],["type","button",1,"video-card"],[3,"pageChange","currentPage","totalPages"],["type","button",1,"video-card",3,"click"],["aria-hidden","true",1,"video-thumb"],["loading","lazy",3,"src","alt","title"],["aria-hidden","true",1,"play-icon"],[1,"video-body"],[1,"video-title"],[1,"video-modal",3,"click"],[1,"video-modal-content",3,"click"],["type","button","aria-label","Close",1,"video-modal-close",3,"click"],[1,"video-frame"],["allowfullscreen","",3,"src"]],template:function(e,n){e&1&&(r(0,"section",0)(1,"div",1),b(2,K,4,0,"div",2)(3,H,2,1),a(),b(4,J,6,1,"div",3),a()),e&2&&(y("dir",n.langService.dir()),s(2),f(n.isLoading()?2:3),s(2),f(n.activeVideoUrl()?4:-1))},dependencies:[E,B,$],styles:['.videos-library[_ngcontent-%COMP%]{padding-block:var(--spacing-8)}.videos-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:24px}@media(max-width:1024px){.videos-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}}@media(max-width:768px){.videos-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.video-card[_ngcontent-%COMP%]{background:#fff;border-radius:8px;border:1px solid #D2D6DB;box-shadow:0 6px 18px #00000014;display:flex;flex-direction:column;padding:16px;text-align:start;cursor:pointer;width:100%;font:inherit;color:inherit;appearance:none;height:350px;overflow:hidden;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}.video-card[_ngcontent-%COMP%]:hover{transform:translateY(-2px);border-color:#e2e6ea;box-shadow:0 10px 20px #0000001f}.video-card[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--primary, #1b8354);outline-offset:2px}.video-thumb[_ngcontent-%COMP%]{position:relative;display:block;width:100%;background:#f5f6f7;overflow:hidden;text-decoration:none;height:80%;border-radius:8px}.video-thumb[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;display:block}.video-thumb[_ngcontent-%COMP%]   .play-icon[_ngcontent-%COMP%]{position:absolute;inset:0;margin:auto;width:72px;height:48px;border-radius:12px;background:red;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 18px #00000040;transition:transform .2s ease,background .2s ease}.video-thumb[_ngcontent-%COMP%]   .play-icon[_ngcontent-%COMP%]:before{content:"";display:block;margin-left:4px;border-style:solid;border-width:9px 0 9px 14px;border-color:transparent transparent transparent #fff}.video-thumb[_ngcontent-%COMP%]:hover   .play-icon[_ngcontent-%COMP%]{transform:scale(1.05);background:#ff1a1a}.video-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;width:100%;height:20%;box-sizing:border-box}.video-title[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:700;color:#161616;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-align:start}.video-desc[_ngcontent-%COMP%]{font-size:13px;color:#6b7280;line-height:1.5;margin-top:4px;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-align:start}.video-modal[_ngcontent-%COMP%]{position:fixed;inset:0;background:#000000bf;display:flex;align-items:center;justify-content:center;z-index:1050;padding:20px}.video-modal-content[_ngcontent-%COMP%]{position:relative;width:min(960px,92vw)}.video-modal-close[_ngcontent-%COMP%]{position:absolute;top:-44px;right:0;width:40px;height:40px;border-radius:50%;border:none;background:#fff;color:#111;font-size:28px;line-height:1;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 8px 18px #0003}.video-modal-close[_ngcontent-%COMP%]:hover{background:#f2f2f2}.video-frame[_ngcontent-%COMP%]{width:100%;aspect-ratio:16/9;background:#000;border-radius:12px;overflow:hidden;box-shadow:0 12px 30px #00000059}.video-frame[_ngcontent-%COMP%]   iframe[_ngcontent-%COMP%]{width:100%;height:100%;border:0;display:block}'],changeDetection:0})};export{F as VideosLibrary};

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.