mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-11 01:20:06 -04:00
1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
import{S as ae,i as oe,s as ie,e as b,c as E,b as u,Q as ge,f as H,g as U,d as h,t as q,k as R,a as g,h as G,m as A,I as i,j as Y,K as ve,R as ce,L as K,l as te,M as W,J as se,q as O,w as Pe,x as Se,y as Me,T as $,o as F,B as Re,n as le,p as ne,U as x,V as ee,W as be,X as Ae,Y as Oe,v as qe,_ as Ee}from"../chunks/vendor-dedc54d0.js";function ye(n,e,l){const t=n.slice();return t[1]=e[l],t}function ke(n){let e,l,t;return{c(){e=b("img"),this.h()},l(r){e=E(r,"IMG",{loading:!0,referrerpolicy:!0,src:!0,alt:!0,style:!0}),this.h()},h(){u(e,"loading","lazy"),u(e,"referrerpolicy","no-referrer"),ge(e.src,l=n[0].logo)||u(e,"src",l),u(e,"alt",t=n[0].name),H(e,"max-width","100px"),H(e,"max-height","50px"),H(e,"vertical-align","middle")},m(r,s){U(r,e,s)},p(r,s){s&1&&!ge(e.src,l=r[0].logo)&&u(e,"src",l),s&1&&t!==(t=r[0].name)&&u(e,"alt",t)},d(r){r&&h(e)}}}function we(n){let e,l,t=n[1].url+"",r,s;return{c(){e=b("p"),l=b("code"),r=q(t),s=R(),this.h()},l(c){e=E(c,"P",{});var _=g(e);l=E(_,"CODE",{style:!0});var p=g(l);r=G(p,t),p.forEach(h),s=A(_),_.forEach(h),this.h()},h(){H(l,"white-space","nowrap"),H(l,"user-select","all")},m(c,_){U(c,e,_),i(e,l),i(l,r),i(e,s)},p(c,_){_&1&&t!==(t=c[1].url+"")&&Y(r,t)},d(c){c&&h(e)}}}function Ge(n){let e,l,t,r,s,c=n[0].name+"",_,p,T,f,B=n[0].id+"",I,N,C,k=n[0]&&n[0].logo&&ke(n),w=n[0].guides,D=[];for(let o=0;o<w.length;o+=1)D[o]=we(ye(n,w,o));return{c(){e=b("tr"),l=b("td"),k&&k.c(),t=R(),r=b("td"),s=b("p"),_=q(c),p=R(),T=b("td"),f=b("code"),I=q(B),N=R(),C=b("td");for(let o=0;o<D.length;o+=1)D[o].c();this.h()},l(o){e=E(o,"TR",{});var d=g(e);l=E(d,"TD",{class:!0,style:!0});var a=g(l);k&&k.l(a),a.forEach(h),t=A(d),r=E(d,"TD",{class:!0,nowrap:!0});var j=g(r);s=E(j,"P",{});var v=g(s);_=G(v,c),v.forEach(h),j.forEach(h),p=A(d),T=E(d,"TD",{class:!0,nowrap:!0});var y=g(T);f=E(y,"CODE",{style:!0});var m=g(f);I=G(m,B),m.forEach(h),y.forEach(h),N=A(d),C=E(d,"TD",{class:!0});var P=g(C);for(let V=0;V<D.length;V+=1)D[V].l(P);P.forEach(h),d.forEach(h),this.h()},h(){u(l,"class","is-vcentered"),H(l,"min-width","150px"),H(l,"text-align","center"),u(r,"class","is-vcentered"),u(r,"nowrap",""),H(f,"user-select","all"),u(T,"class","is-vcentered"),u(T,"nowrap",""),u(C,"class","is-vcentered")},m(o,d){U(o,e,d),i(e,l),k&&k.m(l,null),i(e,t),i(e,r),i(r,s),i(s,_),i(e,p),i(e,T),i(T,f),i(f,I),i(e,N),i(e,C);for(let a=0;a<D.length;a+=1)D[a].m(C,null)},p(o,[d]){if(o[0]&&o[0].logo?k?k.p(o,d):(k=ke(o),k.c(),k.m(l,null)):k&&(k.d(1),k=null),d&1&&c!==(c=o[0].name+"")&&Y(_,c),d&1&&B!==(B=o[0].id+"")&&Y(I,B),d&1){w=o[0].guides;let a;for(a=0;a<w.length;a+=1){const j=ye(o,w,a);D[a]?D[a].p(j,d):(D[a]=we(j),D[a].c(),D[a].m(C,null))}for(;a<D.length;a+=1)D[a].d(1);D.length=w.length}},i:ve,o:ve,d(o){o&&h(e),k&&k.d(),ce(D,o)}}}function He(n,e,l){let{channel:t}=e;return n.$$set=r=>{"channel"in r&&l(0,t=r.channel)},[t]}class Ue extends ae{constructor(e){super();oe(this,e,He,Ge,ie,{channel:0})}}function De(n,e,l){const t=n.slice();return t[5]=e[l],t[6]=e,t[7]=l,t}function Ie(n){let e,l,t,r=n[0].flag+"",s,c,_=n[0].name+"",p,T,f,B,I,N,C,k,w,D,o=!n[0].expanded&&Te(),d=n[0].expanded&&Ve(),a=(n[0].expanded||n[1]&&n[1].length>0&&n[2].length)&&Be(n);return{c(){e=b("div"),l=b("div"),t=b("span"),s=q(r),c=q("\xA0"),p=q(_),T=R(),f=b("button"),B=b("span"),I=K("svg"),o&&o.c(),N=te(),d&&d.c(),C=R(),a&&a.c(),this.h()},l(j){e=E(j,"DIV",{class:!0,style:!0});var v=g(e);l=E(v,"DIV",{class:!0});var y=g(l);t=E(y,"SPAN",{class:!0});var m=g(t);s=G(m,r),c=G(m,"\xA0"),p=G(m,_),m.forEach(h),T=A(y),f=E(y,"BUTTON",{class:!0,"aria-label":!0});var P=g(f);B=E(P,"SPAN",{class:!0});var V=g(B);I=W(V,"svg",{xmlns:!0,class:!0,viewBox:!0});var M=g(I);o&&o.l(M),N=te(),d&&d.l(M),M.forEach(h),V.forEach(h),P.forEach(h),y.forEach(h),C=A(v),a&&a.l(v),v.forEach(h),this.h()},h(){u(t,"class","card-header-title"),u(I,"xmlns","http://www.w3.org/2000/svg"),u(I,"class","ionicon"),u(I,"viewBox","0 0 512 512"),u(B,"class","icon"),u(f,"class","card-header-icon"),u(f,"aria-label","more options"),u(l,"class","card-header is-shadowless is-clickable"),u(e,"class","card mb-3 is-shadowless"),H(e,"border","1px solid #dbdbdb")},m(j,v){U(j,e,v),i(e,l),i(l,t),i(t,s),i(t,c),i(t,p),i(l,T),i(l,f),i(f,B),i(B,I),o&&o.m(I,null),i(I,N),d&&d.m(I,null),i(e,C),a&&a.m(e,null),k=!0,w||(D=se(l,"click",n[3]),w=!0)},p(j,v){(!k||v&1)&&r!==(r=j[0].flag+"")&&Y(s,r),(!k||v&1)&&_!==(_=j[0].name+"")&&Y(p,_),j[0].expanded?o&&(o.d(1),o=null):o||(o=Te(),o.c(),o.m(I,N)),j[0].expanded?d||(d=Ve(),d.c(),d.m(I,null)):d&&(d.d(1),d=null),j[0].expanded||j[1]&&j[1].length>0&&j[2].length?a?(a.p(j,v),v&7&&O(a,1)):(a=Be(j),a.c(),O(a,1),a.m(e,null)):a&&(le(),F(a,1,1,()=>{a=null}),ne())},i(j){k||(O(a),k=!0)},o(j){F(a),k=!1},d(j){j&&h(e),o&&o.d(),d&&d.d(),a&&a.d(),w=!1,D()}}}function Te(n){let e;return{c(){e=K("path"),this.h()},l(l){e=W(l,"path",{fill:!0,stroke:!0,"stroke-linecap":!0,"stroke-linejoin":!0,"stroke-width":!0,d:!0}),g(e).forEach(h),this.h()},h(){u(e,"fill","none"),u(e,"stroke","currentColor"),u(e,"stroke-linecap","round"),u(e,"stroke-linejoin","round"),u(e,"stroke-width","48"),u(e,"d","M112 184l144 144 144-144")},m(l,t){U(l,e,t)},d(l){l&&h(e)}}}function Ve(n){let e;return{c(){e=K("path"),this.h()},l(l){e=W(l,"path",{fill:!0,stroke:!0,"stroke-linecap":!0,"stroke-linejoin":!0,"stroke-width":!0,d:!0}),g(e).forEach(h),this.h()},h(){u(e,"fill","none"),u(e,"stroke","currentColor"),u(e,"stroke-linecap","round"),u(e,"stroke-linejoin","round"),u(e,"stroke-width","48"),u(e,"d","M112 328l144-144 144 144")},m(l,t){U(l,e,t)},d(l){l&&h(e)}}}function Be(n){let e,l,t,r,s,c,_,p,T,f,B,I,N,C,k,w,D,o,d=n[1],a=[];for(let v=0;v<d.length;v+=1)a[v]=Qe(De(n,d,v));const j=v=>F(a[v],1,1,()=>{a[v]=null});return{c(){e=b("div"),l=b("div"),t=b("table"),r=b("thead"),s=b("tr"),c=b("th"),_=R(),p=b("th"),T=q("Name"),f=R(),B=b("th"),I=q("TVG-ID"),N=R(),C=b("th"),k=q("EPG"),w=R(),D=b("tbody");for(let v=0;v<a.length;v+=1)a[v].c();this.h()},l(v){e=E(v,"DIV",{class:!0});var y=g(e);l=E(y,"DIV",{class:!0});var m=g(l);t=E(m,"TABLE",{class:!0,style:!0});var P=g(t);r=E(P,"THEAD",{});var V=g(r);s=E(V,"TR",{});var M=g(s);c=E(M,"TH",{}),g(c).forEach(h),_=A(M),p=E(M,"TH",{});var Q=g(p);T=G(Q,"Name"),Q.forEach(h),f=A(M),B=E(M,"TH",{});var S=g(B);I=G(S,"TVG-ID"),S.forEach(h),N=A(M),C=E(M,"TH",{});var L=g(C);k=G(L,"EPG"),L.forEach(h),M.forEach(h),V.forEach(h),w=A(P),D=E(P,"TBODY",{});var J=g(D);for(let z=0;z<a.length;z+=1)a[z].l(J);J.forEach(h),P.forEach(h),m.forEach(h),y.forEach(h),this.h()},h(){u(t,"class","table"),H(t,"min-width","100%"),u(l,"class","table-container"),u(e,"class","card-content")},m(v,y){U(v,e,y),i(e,l),i(l,t),i(t,r),i(r,s),i(s,c),i(s,_),i(s,p),i(p,T),i(s,f),i(s,B),i(B,I),i(s,N),i(s,C),i(C,k),i(t,w),i(t,D);for(let m=0;m<a.length;m+=1)a[m].m(D,null);o=!0},p(v,y){if(y&2){d=v[1];let m;for(m=0;m<d.length;m+=1){const P=De(v,d,m);a[m]?(a[m].p(P,y),O(a[m],1)):(a[m]=Qe(P),a[m].c(),O(a[m],1),a[m].m(D,null))}for(le(),m=d.length;m<a.length;m+=1)j(m);ne()}},i(v){if(!o){for(let y=0;y<d.length;y+=1)O(a[y]);o=!0}},o(v){a=a.filter(Boolean);for(let y=0;y<a.length;y+=1)F(a[y]);o=!1},d(v){v&&h(e),ce(a,v)}}}function Qe(n){let e,l,t;function r(c){n[4](c,n[5],n[6],n[7])}let s={};return n[5]!==void 0&&(s.channel=n[5]),e=new Ue({props:s}),x.push(()=>ee(e,"channel",r)),{c(){Pe(e.$$.fragment)},l(c){Se(e.$$.fragment,c)},m(c,_){Me(e,c,_),t=!0},p(c,_){n=c;const p={};!l&&_&2&&(l=!0,p.channel=n[5],$(()=>l=!1)),e.$set(p)},i(c){t||(O(e.$$.fragment,c),t=!0)},o(c){F(e.$$.fragment,c),t=!1},d(c){Re(e,c)}}}function ze(n){let e,l,t=n[1]&&n[1].length>0&&Ie(n);return{c(){t&&t.c(),e=te()},l(r){t&&t.l(r),e=te()},m(r,s){t&&t.m(r,s),U(r,e,s),l=!0},p(r,[s]){r[1]&&r[1].length>0?t?(t.p(r,s),s&2&&O(t,1)):(t=Ie(r),t.c(),O(t,1),t.m(e.parentNode,e)):t&&(le(),F(t,1,1,()=>{t=null}),ne())},i(r){l||(O(t),l=!0)},o(r){F(t),l=!1},d(r){t&&t.d(r),r&&h(e)}}}function Fe(n,e,l){let{country:t}=e,{channels:r=[]}=e,{normQuery:s}=e;function c(){l(0,t.expanded=!t.expanded,t)}function _(p,T,f,B){f[B]=p,l(1,r)}return n.$$set=p=>{"country"in p&&l(0,t=p.country),"channels"in p&&l(1,r=p.channels),"normQuery"in p&&l(2,s=p.normQuery)},[t,r,s,c,_]}class Je extends ae{constructor(e){super();oe(this,e,Fe,ze,ie,{country:0,channels:1,normQuery:2})}}function je(n,e,l){const t=n.slice();return t[13]=e[l],t[14]=e,t[15]=l,t}function Ce(n){let e,l,t=n[0].length.toLocaleString()+"",r,s;return{c(){e=b("p"),l=q("Found "),r=q(t),s=q(" channels"),this.h()},l(c){e=E(c,"P",{class:!0});var _=g(e);l=G(_,"Found "),r=G(_,t),s=G(_," channels"),_.forEach(h),this.h()},h(){u(e,"class","help")},m(c,_){U(c,e,_),i(e,l),i(e,r),i(e,s)},p(c,_){_&1&&t!==(t=c[0].length.toLocaleString()+"")&&Y(r,t)},d(c){c&&h(e)}}}function Le(n){let e,l,t;return{c(){e=b("div"),l=b("div"),t=q("Loading..."),this.h()},l(r){e=E(r,"DIV",{class:!0});var s=g(e);l=E(s,"DIV",{class:!0});var c=g(l);t=G(c,"Loading..."),c.forEach(h),s.forEach(h),this.h()},h(){u(l,"class","level-item"),u(e,"class","level")},m(r,s){U(r,e,s),i(e,l),i(l,t)},d(r){r&&h(e)}}}function Ne(n){let e,l,t,r,s;function c(f){n[8](f,n[13],n[14],n[15])}function _(f){n[9](f,n[13])}function p(f){n[10](f)}let T={};return n[13]!==void 0&&(T.country=n[13]),n[5][n[13].code]!==void 0&&(T.channels=n[5][n[13].code]),n[2]!==void 0&&(T.normQuery=n[2]),e=new Je({props:T}),x.push(()=>ee(e,"country",c)),x.push(()=>ee(e,"channels",_)),x.push(()=>ee(e,"normQuery",p)),{c(){Pe(e.$$.fragment)},l(f){Se(e.$$.fragment,f)},m(f,B){Me(e,f,B),s=!0},p(f,B){n=f;const I={};!l&&B&16&&(l=!0,I.country=n[13],$(()=>l=!1)),!t&&B&48&&(t=!0,I.channels=n[5][n[13].code],$(()=>t=!1)),!r&&B&4&&(r=!0,I.normQuery=n[2],$(()=>r=!1)),e.$set(I)},i(f){s||(O(e.$$.fragment,f),s=!0)},o(f){F(e.$$.fragment,f),s=!1},d(f){Re(e,f)}}}function Ye(n){let e,l,t,r,s,c,_,p,T,f,B,I,N,C,k,w,D,o,d,a,j,v,y=!n[3]&&Ce(n),m=n[3]&&Le(),P=n[4],V=[];for(let Q=0;Q<P.length;Q+=1)V[Q]=Ne(je(n,P,Q));const M=Q=>F(V[Q],1,1,()=>{V[Q]=null});return{c(){e=b("div"),l=b("div"),t=b("div"),r=b("div"),s=b("form"),c=b("div"),_=b("div"),p=b("div"),T=b("div"),f=b("input"),B=R(),I=b("div"),N=b("button"),C=b("span"),k=K("svg"),w=K("path"),D=R(),y&&y.c(),o=R(),m&&m.c(),d=R();for(let Q=0;Q<V.length;Q+=1)V[Q].c();this.h()},l(Q){e=E(Q,"DIV",{class:!0});var S=g(e);l=E(S,"DIV",{class:!0});var L=g(l);t=E(L,"DIV",{class:!0});var J=g(t);r=E(J,"DIV",{class:!0});var z=g(r);s=E(z,"FORM",{class:!0});var ue=g(s);c=E(ue,"DIV",{class:!0});var fe=g(c);_=E(fe,"DIV",{class:!0});var X=g(_);p=E(X,"DIV",{class:!0});var Z=g(p);T=E(Z,"DIV",{class:!0});var he=g(T);f=E(he,"INPUT",{class:!0,type:!0,placeholder:!0}),he.forEach(h),B=A(Z),I=E(Z,"DIV",{class:!0});var de=g(I);N=E(de,"BUTTON",{class:!0,type:!0});var _e=g(N);C=E(_e,"SPAN",{class:!0});var me=g(C);k=W(me,"svg",{xmlns:!0,style:!0,viewBox:!0});var pe=g(k);w=W(pe,"path",{fill:!0,d:!0}),g(w).forEach(h),pe.forEach(h),me.forEach(h),_e.forEach(h),de.forEach(h),Z.forEach(h),D=A(X),y&&y.l(X),X.forEach(h),fe.forEach(h),ue.forEach(h),o=A(z),m&&m.l(z),d=A(z);for(let re=0;re<V.length;re+=1)V[re].l(z);z.forEach(h),J.forEach(h),L.forEach(h),S.forEach(h),this.h()},h(){u(f,"class","input"),u(f,"type","search"),u(f,"placeholder","Search by channel name..."),u(T,"class","control is-expanded"),u(w,"fill","#ffffff"),u(w,"d","M456.69 421.39L362.6 327.3a173.81 173.81 0 0034.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 00327.3 362.6l94.09 94.09a25 25 0 0035.3-35.3zM97.92 222.72a124.8 124.8 0 11124.8 124.8 124.95 124.95 0 01-124.8-124.8z"),u(k,"xmlns","http://www.w3.org/2000/svg"),H(k,"width","1.25rem"),H(k,"height","1.25rem"),u(k,"viewBox","0 0 512 512"),u(C,"class","icon is-small is-right"),u(N,"class","button is-info"),u(N,"type","submit"),u(I,"class","control"),u(p,"class","field has-addons"),u(_,"class","field is-expanded"),u(c,"class","field-body"),u(s,"class","mb-5"),u(r,"class","column is-9"),u(t,"class","columns is-centered"),u(l,"class","container"),u(e,"class","section")},m(Q,S){U(Q,e,S),i(e,l),i(l,t),i(t,r),i(r,s),i(s,c),i(c,_),i(_,p),i(p,T),i(T,f),be(f,n[1]),i(p,B),i(p,I),i(I,N),i(N,C),i(C,k),i(k,w),i(_,D),y&&y.m(_,null),i(r,o),m&&m.m(r,null),i(r,d);for(let L=0;L<V.length;L+=1)V[L].m(r,null);a=!0,j||(v=[se(f,"input",n[7]),se(s,"submit",Ae(n[6]))],j=!0)},p(Q,[S]){if(S&2&&be(f,Q[1]),Q[3]?y&&(y.d(1),y=null):y?y.p(Q,S):(y=Ce(Q),y.c(),y.m(_,null)),Q[3]?m||(m=Le(),m.c(),m.m(r,d)):m&&(m.d(1),m=null),S&52){P=Q[4];let L;for(L=0;L<P.length;L+=1){const J=je(Q,P,L);V[L]?(V[L].p(J,S),O(V[L],1)):(V[L]=Ne(J),V[L].c(),O(V[L],1),V[L].m(r,null))}for(le(),L=P.length;L<V.length;L+=1)M(L);ne()}},i(Q){if(!a){for(let S=0;S<P.length;S+=1)O(V[S]);a=!0}},o(Q){V=V.filter(Boolean);for(let S=0;S<V.length;S+=1)F(V[S]);a=!1},d(Q){Q&&h(e),y&&y.d(),m&&m.d(),ce(V,Q),j=!1,Oe(v)}}}function Ke(n,e,l){let t,r="",s="",c="",_=!0,p=[],T=[],f=[];function B(){l(2,s=r.replace(/\s/g,"").toLowerCase()),c=new RegExp(r),s||l(0,f=T),l(0,f=T.filter(w=>{const D=w.key.includes(s),o=c?c.test(w.name)||c.test(w.id):!1;return D||o}))}qe(async()=>{let w=await fetch("https://iptv-org.github.io/api/guides.json").then(o=>o.json()).catch(console.log);w=w.length?w:[],w=Ee.groupBy(w,"channel"),T=await fetch("https://iptv-org.github.io/api/channels.json").then(o=>o.json()).then(o=>o.map(d=>(d.key=`${d.id}_${d.name}`.replace(/\s/g,"").toLowerCase(),d.guides=w[d.id]||[],d))).catch(o=>(console.log(o),[]));const D=await fetch("https://iptv-org.github.io/api/countries.json").then(o=>o.json()).catch(console.log);l(4,p=D.map(o=>(o.expanded=!1,o))),l(0,f=T),l(3,_=!1)});function I(){r=this.value,l(1,r)}function N(w,D,o,d){o[d]=w,l(4,p)}function C(w,D){n.$$.not_equal(t[D.code],w)&&(t[D.code]=w,l(5,t),l(0,f))}function k(w){s=w,l(2,s)}return n.$$.update=()=>{n.$$.dirty&1&&l(5,t=Ee.groupBy(f,"country"))},[f,r,s,_,p,t,B,I,N,C,k]}class Xe extends ae{constructor(e){super();oe(this,e,Ke,Ye,ie,{})}}export{Xe as default};
|