PageSourceSearch

https://ratner-tv.lovable.app/assets/ClubTV-CRV9QWLn.js

js ratner-tv.lovable.app collected 2026-10-03 03:42:15 UTC 6,288 bytes, 1 lines download raw bytes

1import{j as e}from"./markdown-CAb8WmfO.js";import{r as o}from"./charts-Cpw4WycC.js";import{u as T,a as q,e as L,d as h,s as i,x as S,S as E,B as a,y as R,J as V,i as p}from"./index-DX4lcBd_.js";import{L as z}from"./router-CKbXuuze.js";import{T as A}from"./textarea-CZYhhlb0.js";import{az as D,R as g,u as j,aC as I}from"./icons-D71SFH7y.js";import"./radix-mkhwvnnH.js";import"./supabase-Dizu_ZNU.js";import"./date-DTmnPEgw.js";const b="club_tv_24_7",J=()=>{const{user:r,isAdmin:l}=T(),{openAuthDialog:N}=q(),v=L(),[w,n]=o.useState(!1),[d,u]=o.useState(""),[c,m]=o.useState(""),{data:y,isLoading:_}=h({queryKey:["club-access",r==null?void 0:r.id],queryFn:async()=>{if(!r)return!1;if(l)return!0;const{data:t}=await i.from("user_entitlements").select("id").eq("user_id",r.id).eq("entitlement_type","club").or("expires_at.is.null,expires_at.gt."+new Date().toISOString()).limit(1);return t&&t.length>0||!1},enabled:!!r}),{data:s}=h({queryKey:["club-tv-settings"],queryFn:async()=>{const{data:t,error:f}=await i.from("live_settings").select("*").eq("title",b).maybeSingle();if(f)throw f;return t}}),x=()=>{u((s==null?void 0:s.stream_url)||""),m((s==null?void 0:s.description)||""),n(!0)},k=async()=>{try{s?await i.from("live_settings").update({stream_url:d,description:c,updated_at:new Date().toISOString()}).eq("id",s.id):await i.from("live_settings").insert({title:b,stream_url:d,description:c,is_live:!0}),v.invalidateQueries({queryKey:["club-tv-settings"]}),n(!1),p.success("Сохранено")}catch{p.error("Ошибка сохранения")}},C=y||l;return e.jsxs(S,{children:[e.jsx(E,{title:"ТВ по подписке",description:"Прямые эфиры и записи для подписчиков Ratner-TV. Доступно по активной подписке."}),e.jsxs("div",{className:"px-4 md:px-6 lg:px-10 py-6 space-y-6",children:[e.jsxs(z,{to:"/podpiska",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground",children:[e.jsx(D,{className:"w-3.5 h-3.5"})," Подписка Ратнера"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-interactive/20 flex items-center justify-center",children:e.jsx(g,{className:"w-5 h-5 text-interactive animate-pulse",strokeWidth:1.5})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-[22px] font-normal text-foreground",children:"Биоэнергетика TV 24/7"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Круглосуточное вещание для подписчиков"})]})]}),r?_?e.jsx("div",{className:"w-full bg-muted rounded-lg flex items-center justify-center py-20",children:e.jsx("p",{className:"text-muted-foreground text-sm",children:"Проверка доступа…"})}):C?e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[s!=null&&s.stream_url?e.jsx("div",{className:"relative w-full bg-black rounded-lg overflow-hidden",style:{aspectRatio:"16/9"},children:e.jsx("iframe",{src:R(s.stream_url)||s.stream_url,title:"Биоэнергетика TV 24/7",className:"absolute inset-0 w-full h-full",frameBorder:"0",allowFullScreen:!0,sandbox:"allow-same-origin allow-scripts allow-popups allow-forms"})}):e.jsxs("div",{className:"w-full bg-muted rounded-lg flex flex-col items-center justify-center gap-3",style:{aspectRatio:"16/9"},children:[e.jsx(g,{className:"w-10 h-10 text-muted-foreground/40",strokeWidth:1}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Трансляция не настроена"}),l&&e.jsx(a,{variant:"outline",size:"sm",onClick:x,children:"Настроить"})]}),l&&e.jsx("div",{className:"mt-3",children:w?e.jsxs("div",{className:"space-y-3 rounded-xl border border-border/40 bg-card p-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"Ссылка на плеер (embed URL)"}),e.jsx(V,{value:d,onChange:t=>u(t.target.value),placeholder:"https://peertube.example.com/videos/embed/..."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"Описание"}),e.jsx(A,{value:c,onChange:t=>m(t.target.value),placeholder:"Описание трансляции для подписчиков",rows:4})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(a,{size:"sm",onClick:k,children:"Сохранить"}),e.jsx(a,{size:"sm",variant:"ghost",onClick:()=>n(!1),children:"Отмена"})]})]}):e.jsxs(a,{variant:"outline",size:"sm",onClick:x,className:"gap-1.5",children:[e.jsx(I,{className:"w-3 h-3"})," Редактировать"]})})]}),e.jsx("div",{className:"w-full lg:w-[340px] flex-shrink-0",children:e.jsxs("div",{className:"rounded-xl border border-border/40 bg-card p-5 space-y-3",children:[e.jsx("h2",{className:"text-base font-semibold text-foreground",children:"О трансляции"}),s!=null&&s.description?e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed whitespace-pre-line",children:s.description}):e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:"Круглосуточное вещание практик и медитаций для подписчиков Ратнера. Включайте в любое время для фоновой практики, медитации или обучения."})]})})]}):e.jsxs("div",{className:"w-full bg-muted rounded-lg flex flex-col items-center justify-center gap-4 py-20",children:[e.jsx(j,{className:"w-10 h-10 text-muted-foreground
1/40",strokeWidth:1.5}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Доступ только для подписчиков"}),e.jsx(a,{variant:"outline",asChild:!0,children:e.jsx("a",{href:"/podpiska",children:"Узнать о подписке"})})]}):e.jsxs("div",{className:"w-full bg-muted rounded-lg flex flex-col items-center justify-center gap-4 py-20",children:[e.jsx(j,{className:"w-10 h-10 text-muted-foreground/40",strokeWidth:1.5}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Этот раздел доступен только подписчикам"}),e.jsx(a,{onClick:N,children:"Войти"})]})]})]})};export{J as default};

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.