1import{a as A,b as Pe,c as Me,d as Te,e as Se,f as De,g as ke,h as Oe,i as K,j as T}from"./chunk-6IUMXNO4.js";import{b as q}from"./chunk-GWLNEQOE.js";import"./chunk-QDIB6PHW.js";import{c as we,e as X}from"./chunk-ZZPGO4VR.js";import{a as M}from"./chunk-W2SSIP3E.js";import{Eb as he,Gb as ve,Hb as be,Ib as Ce,Jb as xe,Lb as ye,Pb as Y,Rb as S,f as _e,mb as ge,ra as me,s as fe}from"./chunk-H4VL7ERE.js";import{M as G,ca as k,ja as ue,ka as V,u as pe}from"./chunk-3QLFRG4T.js";import{Ac as _,Cb as w,Cc as d,Ea as u,Eb as oe,Fa as f,Gc as H,Hc as z,Ic as j,Ja as ee,Ka as te,Nc as de,Oa as y,Ob as C,Oc as x,Rc as p,Sc as O,Tc as le,Ua as ie,a as J,ab as ne,dc as P,dd as $,ec as h,gc as v,jc as ae,kc as se,lc as m,mc as o,nc as a,oc as l,rb as D,rd as ce,sa as Z,sd as W,vc as b,wb as re,xa as g,xb as s,zd as U}from"./chunk-6E4BK3UV.js";var Ee=["click","keydown"],R=class i{_document=g(ee);_videos=new Set;_isMuted=y(!1);_awaitingGesture=!1;_unmuteEvent=null;isMuted=this._isMuted.asReadonly();attach(e){e.muted=this._isMuted(),this._videos.add(e)}detach(e){this._videos.delete(e)}toggleMuted(){this._stopAwaitingGesture(),this._setMuted(!this._isMuted())}muteUntilGesture(){this._setMuted(!0),!this._awaitingGesture&&(this._awaitingGesture=!0,Ee.forEach(e=>this._document.addEventListener(e,this._onGesture,!0)))}isUnmutedBy(e){return this._unmuteEvent===e}_onGesture=e=>{e.isTrusted&&this._document.defaultView?.navigator.userActivation?.isActive!==!1&&(this._stopAwaitingGesture(),this._unmuteEvent=e,setTimeout(()=>this._unmuteEvent=null),this._setMuted(!1))};_stopAwaitingGesture(){this._awaitingGesture&&(this._awaitingGesture=!1,Ee.forEach(e=>this._document.removeEventListener(e,this._onGesture,!0)))}_setMuted(e){this._isMuted.set(e),this._videos.forEach(t=>t.muted=e)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=Z({token:i,factory:i.\u0275fac,providedIn:"root"})};var Re=["progressBar"],Ie=i=>["/chats",i],Be=i=>["/characters",i];function Le(i,e){if(i&1&&l(0,"img",3),i&2){let t=d();m("src",t.imageUrl,D)("alt",t.characterFullName)}}function Ne(i,e){if(i&1){let t=b();o(0,"inf-model-video",11),_("click",function(r){u(t);let c=d();return f(c.togglePlayback(r))}),a()}if(i&2){let t=d();x("inf-feed-card__media-video--active",t.isActive),m("controls",!1)("disableDownload",!0)("loop",!0)("preservePauseTime",!0)("videoUrl",t.videoUrl)("posterUrl",t.videoPoster)}}function He(i,e){i&1&&l(0,"svg-icon",13)}function ze(i,e){if(i&1){let t=b();o(0,"button",12),_("click",function(r){u(t);let c=d();return f(c.copyPublisherId(r))}),p(1),h(2,He,1,0,"svg-icon",13),a()}if(i&2){let t=d();x("inf-feed-card__shared-id--copied",t.copiedId()),m("title",t.copiedId()?"Copied":"Copy publisher id: "+t.item.shared_by_user_id),s(),le(" ",t.item.shared_by_user_id.slice(0,8)," "),s(),v(t.copiedId()?2:-1)}}function je(i,e){if(i&1){let t=b();o(0,"button",14),_("click",function(r){u(t);let c=d();return f(c.toggleMute(r))}),l(1,"svg-icon",15),a()}if(i&2){let t=d();P("aria-label",t.isMuted()?"Unmute video":"Mute video"),s(),m("name",t.isMuted()?"sound-off-white":"sound-on-white")}}function $e(i,e){i&1&&(o(0,"div",9),l(1,"div",16,0),a())}function We(i,e){if(i&1&&l(0,"img",18),i&2){let t=d(),n=d();m("src",t.avatar,D)("alt",n.characterFullName)}}function Ye(i,e){i&1&&l(0,"div",19)}function qe(i,e){if(i&1&&(o(0,"div",10)(1,"div",17),h(2,We,1,2,"img",18)(3,Ye,1,0,"div",19),o(4,"div",20)(5,"span",21),p(6),a(),o(7,"span",22),p(8,"by Infatuated"),a()()(),o(9,"div",23)(10,"a",24),l(11,"svg-icon",25),o(12,"span",26),p(13,"Chat"),a()(),o(14,"a",27),l(15,"svg-icon",28),o(16,"span",26),p(17,"Gallery"),a()()()()),i&2){let t=e,n=d();s(2),v(t.avatar?2:3),s(4),O(n.characterFullName),s(4),m("routerLink",$(4,Ie,t.slug)),s(4),m("routerLink",$(6,Be,t.slug))}}var I=class i{item;isActive=!1;isDevMode=g(k).selectSignal(S.isDevMode);copiedId=y(!1);_video;_progressBar;hasAudio=!1;_audioService=g(R);isMuted=this._audioService.isMuted;_cdr=g(U);_viewInitialized=!1;_rafHandle=null;_pendingCanPlay=null;_audioProbed=!1;_audioProbeAttempts=0;_audioProbeTimer=null;constructor(){oe(()=>{this._viewInitialized=!0;let e=this._videoEl;
1e&&(this._audioService.attach(e),e.playsInline=!0,e.addEventListener("play",this._onVideoPlay),e.addEventListener("playing",this._onVideoPlaying),e.addEventListener("pause",this._onVideoPause)),this._syncVideoPlayback()})}ngOnChanges(e){"item"in e&&!e.item.firstChange&&this._resetAudioDetection(),this._viewInitialized&&"isActive"in e&&this.item?.media_type==="video"&&this._syncVideoPlayback()}_resetAudioDetection(){this._clearAudioProbeTimer(),this._audioProbed=!1,this._audioProbeAttempts=0,this.hasAudio=!1}ngOnDestroy(){let e=this._videoEl;e&&(this._audioService.detach(e),e.removeEventListener("play",this._onVideoPlay),e.removeEventListener("playing",this._onVideoPlaying),e.removeEventListener("pause",this._onVideoPause)),this._clearPendingCanPlay(),this._stopProgressLoop(),this._clearAudioProbeTimer()}get _videoEl(){return this._video?.videoRef?.nativeElement}_onVideoPlay=()=>{this._startProgressLoop()};_onVideoPlaying=()=>{this._scheduleAudioProbe()};_onVideoPause=()=>{this._stopProgressLoop(),this._renderProgress()};_startProgressLoop(){if(this._rafHandle!==null)return;let e=()=>{this._renderProgress(),this._rafHandle=requestAnimationFrame(e)};this._rafHandle=requestAnimationFrame(e)}_stopProgressLoop(){this._rafHandle!==null&&(cancelAnimationFrame(this._rafHandle),this._rafHandle=null)}_renderProgress(){let e=this._progressBar?.nativeElement,t=this._videoEl;if(!e||!t)return;let n=t.duration,r=n>0&&isFinite(n)?t.currentTime/n*100:0;e.style.width=`${r}%`}togglePlayback(e){if(this.item?.media_type!=="video"||this._audioService.isUnmutedBy(e))return;let t=e.target;if(t?.closest("inf-play-icon")||t?.closest(".inf-feed-card__mute-btn"))return;let n=this._videoEl;n&&(n.paused?this._tryPlay(n):(this._clearPendingCanPlay(),n.pause()))}toggleMute(e){e.stopPropagation(),!this._audioService.isUnmutedBy(e)&&this._audioService.toggleMuted()}_scheduleAudioProbe(){this._audioProbed||this._audioProbeTimer===null&&(this._audioProbeTimer=window.setTimeout(()=>{this._audioProbeTimer=null,this._probeAudio()},400))}_probeAudio(){if(this._audioProbed)return;let e=this._videoEl;if(e){if(typeof e.mozHasAudio=="boolean"){this._finishAudioProbe(e.mozHasAudio);return}if(typeof e.webkitAudioDecodedByteCount=="number"){if(e.webkitAudioDecodedByteCount>0){this._finishAudioProbe(!0);return}if(this._audioProbeAttempts++,this._audioProbeAttempts<3){this._audioProbeTimer=window.setTimeout(()=>{this._audioProbeTimer=null,this._probeAudio()},600);return}this._finishAudioProbe(!1);return}if(e.audioTracks&&typeof e.audioTracks.length=="number"){this._finishAudioProbe(e.audioTracks.length>0);return}}}_finishAudioProbe(e){this._audioProbed=!0,this.hasAudio=e,this._cdr.markForCheck()}_clearAudioProbeTimer(){this._audioProbeTimer!==null&&(clearTimeout(this._audioProbeTimer),this._audioProbeTimer=null)}_syncVideoPlayback(){if(this.item?.media_type!=="video")return;let e=this._videoEl;e&&(this._clearPendingCanPlay(),this.isActive?this._tryPlay(e):(e.pause(),e.currentTime=0))}_tryPlay(e){let t=e.play();!t||typeof t.catch!="function"||t.catch(n=>{if(!this.isActive)return;if(n instanceof DOMException&&n.name==="NotAllowedError"&&!e.muted){this._audioService.muteUntilGesture(),e.muted=!0,this._tryPlay(e);return}let r=()=>{this._pendingCanPlay=null,this.isActive&&this._tryPlay(e)};e.addEventListener("canplay",r,{once:!0}),this._pendingCanPlay={el:e,handler:r}})}_clearPendingCanPlay(){this._pendingCanPlay&&(this._pendingCanPlay.el.removeEventListener("canplay",this._pendingCanPlay.handler),this._pendingCanPlay=null)}get imageUrl(){return this.item.media_type==="image"?this.item.media.url:""}get videoUrl(){return this.item.media_type==="video"?this.item.media.url:""}get videoPoster(){if(this.item.media_type!=="video")return"";let e=this.item.media;return e.poster?.original??e.poster?.medium??""}copyPublisherId(e){e.stopPropagation();let t=this.item.shared_by_user_id;!t||typeof navigator>"u"||!navigator.clipboard||navigator.clipboard.writeText(t).then(()=>{this.copiedId.set(!0),setTimeout(()=>this.copiedId.set(!1),1200)})}get characterFullName(){let e=this.item.character;return e?`${e.first_name} ${e.last_name}`.trim():""}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=C({type:i,selectors:[["inf-feed-card"]],viewQuery:function(t,n){if(t&1&&(H(X,5),H(Re,5)),t&2){let r;z(r=j())&&(n._video=r.first),z(r=j())&&(n._progressBar=r.first)}},inputs:{item:"item",isActive:"isActive"},features:[ie],decls:11,vars:6,consts:[["progressBar",""],[1,"inf-feed-card"],[1,"inf-feed-card__media"],["infProtectMedia","",1,"inf-feed-card__media-img",3,"src","alt"],[1,"inf-feed-card__media-video",3,"controls","disableDownload","loop","preservePauseTime","videoUrl","posterUrl","inf-feed-card__media-video--active"],[1,"inf-feed-card__shared-badge"],["name","share",1,"inf-feed-card__badge-icon"],["type","button",1,"inf-feed-card__shared-id",3,"inf-feed-card__shared-id--copied","title"],["type","button",1,"inf-feed-card__mute-btn"],[1,"inf-feed-card__timeline"],[1,"inf-feed-card__bottom"],[1,"inf-feed-card__media-video",3,"click","controls","disableDownload","loop","preservePauseTime","videoUrl","posterUrl"],["type","button",1,"inf-feed-card__shared-id",3,"click","title"],["name","check",1,"inf-feed-card__shared-id-icon"],["type","button",1,"inf-feed-card__mute-btn",3,"click"],[1,"inf-feed-card__mute-icon",3,"name"],[1,"inf-feed-card__timeline-progress"],[1,"inf-feed-card__character"],[1,"inf-feed-card__avatar",3,"src","alt"],[1,"inf-feed-card__avatar","inf-feed-card__avatar--placeholder"],[1,"inf-feed-card__character-text"],[1,"inf-feed-card__character-name"],[1,"inf-feed-card__character-by"],[1,"inf-feed-card__actions"],[1,"btn","btn--secondary","small",3,"routerLink"],["name","chat-white",1,"inf-feed-card__btn-icon"],[1,"inf-feed-card__btn-text"],[1,"btn","btn--gradient","small",3,"routerLink"],["name","crown-white",1,"inf-feed-card__btn-icon"]],template:function(t,n){if(t&1&&(o(0,"article",1)(1,"div",2),h(2,Le,1,2,"img",3)(3,Ne,1,8,"inf-model-video",4),o(4,"div",5),l(5,"svg-icon",6),p(6," Shared by fan "),h(7,ze,3,5,"button",7),a(),h(8,je,2,2,"button",8),h(9,$e,3,0,"div",9),h(10,qe,18,8,"div",10),a()()),t&2){let r;P("data-feed-id",n.item.id),s(2),v(n.item.media_type==="image"?2:3),s(5),v(n.isDevMode()&&n.item.shared_by_user_id?7:-1),s(),v(n.item.media_type==="video"&&n.hasAudio?8:-1),s(),v(n.item.media_type==="video"?9:-1),s(),v((r=n.item.character)?10:-1,r)}},dependencies:[_e,X,we,M],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}@media (min-width: 751px){[_nghost-%COMP%]{width:auto;height:100%;flex:0 1 auto}}.inf-feed-card[_ngcontent-%COMP%]{padding:0;width:100%;height:100%;display:flex;position:relative;align-items:stretch;box-sizing:border-box;justify-content:center}@media (min-width: 760px){.inf-feed-card[_ngcontent-%COMP%]{padding:var(--feed-card-pad)}}.inf-feed-card__media[_ngcontent-%COMP%]{width:100%;height:100%;margin:0 auto;overflow:hidden;position:relative}@media (min-width: 760px){.inf-feed-card__media[_ngcontent-%COMP%]{width:var(--feed-media-w);border-radius:24px}}.inf-feed-card__media-img[_ngcontent-%COMP%], .inf-feed-card__media-video[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;display:block}.inf-feed-card__media-video[_ngcontent-%COMP%] .model-video-container__video{border-radius:0}.inf-feed-card__shared-badge[_ngcontent-%COMP%]{gap:8px;top:16px;z-index:3;left:16px;color:#fff;font-size:14px;line-height:20px;padding:8px 16px;position:absolute;align-items:center;display:inline-flex;border-radius:999px;background:#8bba2399}.inf-feed-card__shared-id[_ngcontent-%COMP%]{gap:4px;color:#fff;border:none;cursor:pointer;font-size:14px;align-items:center;display:inline-flex;padding:0 0 0 8px;font-family:monospace;background:transparent;border-left:1px solid rgba(255,255,255,.3019607843);opacity:.85}.inf-feed-card__shared-id[_ngcontent-%COMP%]:hover{opacity:1;text-decoration:underline}.inf-feed-card__shared-id--copied[_ngcontent-%COMP%]{opacity:1;text-decoration:none}.inf-feed-card__shared-id-icon[_ngcontent-%COMP%]{font-size:14px}.inf-feed-card__bottom[_ngcontent-%COMP%]{gap:12px;bottom:0;z-index:3;width:100%;display:flex;position:absolute;align-items:center;padding:0 16px 16px;justify-content:space-between;background:linear-gradient(180deg,#0000,#000000e6)}.inf-feed-card__character[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;color:#fff;min-width:0;flex:1 1 auto}
1.inf-feed-card__avatar[_ngcontent-%COMP%]{width:36px;height:36px;border-radius:50%;flex:0 0 36px;object-fit:cover;display:block}.inf-feed-card__avatar--placeholder[_ngcontent-%COMP%]{background:#ffffff29}.inf-feed-card__character-text[_ngcontent-%COMP%]{display:flex;flex-direction:column;line-height:1.2;min-width:0}.inf-feed-card__character-name[_ngcontent-%COMP%]{font-size:18px;color:#fff;font-weight:600;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.inf-feed-card__character-by[_ngcontent-%COMP%]{font-size:14px;overflow:hidden;white-space:nowrap;color:var(--primary);text-overflow:ellipsis}.inf-feed-card__actions[_ngcontent-%COMP%]{gap:8px;display:flex;flex:0 0 auto}.inf-feed-card__actions[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{gap:8px;height:40px;padding:0 16px;text-decoration:none}.inf-feed-card__btn-icon[_ngcontent-%COMP%]{font-size:16px}@media (max-width: 750px){.inf-feed-card__btn-text[_ngcontent-%COMP%]{display:none}}.inf-feed-card__badge-icon[_ngcontent-%COMP%]{font-size:16px}.inf-feed-card__mute-btn[_ngcontent-%COMP%]{top:16px;right:16px;z-index:5;width:36px;height:36px;padding:0;display:flex;color:#fff;cursor:pointer;position:absolute;border-radius:50%;align-items:center;justify-content:center;background:#0009;border:1px solid rgba(255,255,255,.4)}.inf-feed-card__mute-icon[_ngcontent-%COMP%]{font-size:22px;filter:drop-shadow(0 0 2px rgba(0,0,0,.6))}.inf-feed-card__timeline[_ngcontent-%COMP%]{left:0;right:0;bottom:0;z-index:4;height:4px;position:absolute;background:#e0ebf233}.inf-feed-card__timeline-progress[_ngcontent-%COMP%]{width:0;height:100%;background:#fff}"],changeDetection:0})};function Xe(i,e){if(i&1&&l(0,"img",2),i&2){let t=d();m("src",t.teaserBlurUrl,D)}}function Ke(i,e){if(i&1&&l(0,"img",3),i&2){let t=d();m("src",t.fallbackBlurUrl,D)}}function Qe(i,e){if(i&1){let t=b();o(0,"h2",7),p(1,"Sign Up to View"),a(),o(2,"button",8),_("click",function(){u(t);let r=d();return f(r.signUp.emit())}),p(3,"Sign Up"),a()}}function Je(i,e){if(i&1){let t=b();o(0,"h2",7),p(1," Upgrade to Pro for unlimited access to Discover. "),a(),o(2,"button",8),_("click",function(){u(t);let r=d();return f(r.upgrade.emit())}),p(3,"Upgrade to Pro"),a()}}var L=class i{reason;teaserBlurUrl=null;fallbackBlurUrl=null;signUp=new w;logIn=new w;upgrade=new w;static \u0275fac=function(t){return new(t||i)};static \u0275cmp=C({type:i,selectors:[["inf-feed-card-gated"]],inputs:{reason:"reason",teaserBlurUrl:"teaserBlurUrl",fallbackBlurUrl:"fallbackBlurUrl"},outputs:{signUp:"signUp",logIn:"logIn",upgrade:"upgrade"},decls:9,vars:2,consts:[[1,"inf-feed-card-gated"],[1,"inf-feed-card-gated__backdrop"],["alt","",1,"inf-feed-card-gated__backdrop-img",3,"src"],["alt","",1,"inf-feed-card-gated__backdrop-img","inf-feed-card-gated__backdrop-img--blurred",3,"src"],[1,"inf-feed-card-gated__overlay"],[1,"inf-feed-card-gated__content"],["name","lock"],[1,"inf-feed-card-gated__title"],["type","button",1,"btn","btn--gradient",3,"click"]],template:function(t,n){t&1&&(o(0,"article",0)(1,"div",1),h(2,Xe,1,1,"img",2)(3,Ke,1,1,"img",3),l(4,"div",4),a(),o(5,"div",5),l(6,"svg-icon",6),h(7,Qe,4,0)(8,Je,4,0),a()()),t&2&&(s(2),v(n.teaserBlurUrl?2:n.fallbackBlurUrl?3:-1),s(5),v(n.reason==="register_required"?7:8))},dependencies:[M],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.inf-feed-card-gated[_ngcontent-%COMP%]{width:100%;height:100%;margin:0 auto;overflow:hidden;position:relative}@media (min-width: 760px){.inf-feed-card-gated[_ngcontent-%COMP%]{max-width:var(--feed-media-w);border-radius:24px}}.inf-feed-card-gated__backdrop[_ngcontent-%COMP%]{inset:0;position:absolute}.inf-feed-card-gated__backdrop-img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;display:block}.inf-feed-card-gated__overlay[_ngcontent-%COMP%]{position:absolute;inset:0;background:linear-gradient(to bottom,#0006,#000000b3)}.inf-feed-card-gated__content[_ngcontent-%COMP%]{gap:16px;z-index:2;height:100%;padding:32px;color:#fff;display:flex;position:relative;align-items:center;flex-direction:column;justify-content:center}.inf-feed-card-gated__content[_ngcontent-%COMP%] svg-icon[_ngcontent-%COMP%]{font-size:48px}.inf-feed-card-gated__title[_ngcontent-%COMP%]{font-size:20px;max-width:320px;font-weight:600;text-align:center;margin:4px 0 16px}"],changeDetection:0})};function Ze(i,e){if(i&1){let t=b();o(0,"div",1)(1,"div",5),l(2,"svg-icon",6),a(),o(3,"span",4),p(4),a()(),o(5,"div",1)(6,"button",7),_("click",function(){u(t);let r=d();return f(r.removePost.emit())}),l(7,"svg-icon",8),a(),o(8,"span",4),p(9,"Remove"),a()()}if(i&2){let t=d();s(4),O(t.reportsDisplay)}}function et(i,e){if(i&1){let t=b();o(0,"div",1)(1,"button",9),_("click",function(){u(t);let r=d();return f(r.reportToggle.emit())}),l(2,"svg-icon",6),a(),o(3,"span",10)(4,"span",11),p(5,"Report"),a(),o(6,"span",12),p(7,"Reported"),a()()()}if(i&2){let t=d();s(),x("inf-feed-actions-rail__btn--reported",t.item.is_reported),P("aria-label",t.item.is_reported?"Reported":"Report")("aria-pressed",t.item.is_reported),s(2),x("inf-feed-actions-rail__label--reported",t.item.is_reported)}}var N=class i{item;likeToggle=new w;reportToggle=new w;removePost=new w;isDevMode=g(k).selectSignal(S.isDevMode);get likesDisplay(){return this._formatCount(this.item.likes_count)}get reportsDisplay(){return this._formatCount(this.item.reports_count??0)}_formatCount(e){return e>=1e6?`${(e/1e6).toFixed(1).replace(/\.0$/,"")}M`:e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}K`:String(e)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=C({type:i,selectors:[["inf-feed-actions-rail"]],inputs:{item:"item"},outputs:{likeToggle:"likeToggle",reportToggle:"reportToggle",removePost:"removePost"},decls:8,vars:4,consts:[[1,"inf-feed-actions-rail"],[1,"inf-feed-actions-rail__action-wrapper"],["type","button","aria-label","Like",1,"inf-feed-actions-rail__btn",3,"click"],["name","like",1,"inf-feed-actions-rail__icon"],[1,"inf-feed-actions-rail__label"],["aria-label","Reports",1,"inf-feed-actions-rail__btn","inf-feed-actions-rail__btn--static"],["name","alert-hex",1,"inf-feed-actions-rail__icon"],["type","button","aria-label","Remove post",1,"inf-feed-actions-rail__btn",3,"click"],["name","delete",1,"inf-feed-actions-rail__icon"],["type","button",1,"inf-feed-actions-rail__btn",3,"click"],[1,"inf-feed-actions-rail__label","inf-feed-actions-rail__label--toggle"],[1,"inf-feed-actions-rail__label-idle"],[1,"inf-feed-actions-rail__label-active"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"div",1)(2,"button",2),_("click",function(){return n.likeToggle.emit()}),l(3,"svg-icon",3),a(),o(4,"span",4),p(5),a()(),h(6,Ze,10,1)(7,et,8,6,"div",1),a()),t&2&&(s(2),x("inf-feed-actions-rail__btn--liked",n.item.is_liked),s(3),O(n.likesDisplay),s(),v(n.isDevMode()?6:7))},dependencies:[M],styles:["[_nghost-%COMP%]{display:block}@media (max-width: 750px){[_nghost-%COMP%]{position:absolute;top:50%;right:8px;z-index:4;transform:translateY(-50%)}}@media (min-width: 751px){[_nghost-%COMP%]{position:absolute;top:50%;left:calc(50% + var(--feed-media-w) / 2 + var(--feed-card-pad) + var(--feed-rail-gap));z-index:4;transform:translateY(-50%)}}.inf-feed-actions-rail[_ngcontent-%COMP%]{gap:16px;display:flex;align-items:center;flex-direction:column}@media (max-width: 750px){.inf-feed-actions-rail[_ngcontent-%COMP%]{gap:24px}}.inf-feed-actions-rail__action-wrapper[_ngcontent-%COMP%]{gap:4px;display:flex;align-items:center;flex-direction:column}.inf-feed-actions-rail__btn[_ngcontent-%COMP%]{width:60px;height:60px;color:#fff;cursor:pointer;border-radius:50%;align-items:center;display:inline-flex;text-decoration:none;justify-content:center;background:var(--neutral-70);border:2px solid var(--neutral-60)}.inf-feed-actions-rail__btn[_ngcontent-%COMP%]:hover{background:var(--neutral-60)}.inf-feed-actions-rail__btn--liked[_ngcontent-%COMP%]{color:#f9685d}.inf-feed-actions-rail__btn--reported[_ngcontent-%COMP%]{color:var(--error)}.inf-feed-actions-rail__btn--static[_ngcontent-%COMP%]{cursor:default;pointer-events:none}@media (max-width: 750px){.inf-feed-actions-rail__btn[_ngcontent-%COMP%]{width:40px;height:40px}}.inf-feed-actions-rail__icon[_ngcontent-%COMP%]{font-size:20px}.inf-feed-actions-rail__label[_ngcontent-%COMP%]{font-weight:400}.inf-feed-actions-rail__label--toggle[_ngcontent-%COMP%]{display:grid;justify-items:center}.inf-feed-actions-rail__label--toggle[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{grid-area:1/1;white-space:nowrap}.inf-feed-actions-rail__label-active[_ngcontent-%COMP%]{visibility:hidden}@media (max-width: 750px){.inf-feed-actions-rail__label-active[_ngcontent-%COMP%]{display:none}}@media (min-width: 751px){.inf-feed-actions-rail__label--reported[_ngcontent-%COMP%] .inf-feed-actions-rail__label-idle[_ngcontent-%COMP%]{visibility:hidden}.inf-feed-actions-rail__label--reported[_ngcontent-%COMP%] .inf-feed-actions-rail__label-active[_ngcontent-%COMP%]{visibility:visible}}"],changeDetection:0})};var F=class i{static DialogWidth="408px";_dialogRef=g(he);onConfirm(){this._dialogRef.close(!0)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=C({type:i,selectors:[["inf-confirm-remove-post-dialog"]],decls:9,vars:0,consts:[["title","Remove post?"],[1,"inf-paragraph"],["mat-dialog-close","",1,"btn","btn--secondary"],[1,"btn","btn--red",3,"click"]],template:function(t,n){t&1&&(l(0,"app-dialog-header",0),o(1,"mat-dialog-content")(2,"p",1),p(3," This post will be removed from Discover immediately. The owner can repost it later. "),a()(),o(4,"mat-dialog-actions")(5,"button",2),p(6,"Cancel"),a(),o(7,"button",3),_("click",function(){return n.onConfirm()}),p(8,"Remove"),a()())},dependencies:[ye,Ce,xe,be],encapsulation:2,changeDetection:0})};var Q="discover_guest_gated";function Fe(){let i=new Date,e=`${i.getMonth()+1}`.padStart(2,"0"),t=`${i.getDate()}`.padStart(2,"0");return`${i.getFullYear()}-${e}-${t}`}function Ue(i){try{let e=J({date:Fe()},i);localStorage.setItem(Q,JSON.stringify(e))}catch{}}function Ge(){try{let i=localStorage.getItem(Q);if(!i)return null;let e=JSON.parse(i);return e?.date!==Fe()?(localStorage.removeItem(Q),null):{date:e.date,teaserBlurUrl:e.teaserBlurUrl??null,fallbackBlurUrl:e.fallbackBlurUrl??null}}catch{return null}}var tt=(i,e)=>(e.item==null?null:e.item.id)??(e.isGated?"gated-slot":"empty-"+e.offset);function it(i,e){if(i&1){let t=b();l(0,"inf-feed-card",10),o(1,"inf-feed-actions-rail",11),_("likeToggle",function(){let r=u(t),c=d(2);return f(c.onLikeToggle(r))})("reportToggle",function(){let r=u(t),c=d(2);return f(c.onReportToggle(r))})("removePost",function(){let r=u(t),c=d(2);return f(c.onRemovePost(r))}),a()}if(i&2){let t=e,n=d().$implicit;m("item",t)("isActive",n.offset===0),s(),m("item",t)}}function nt(i,e){if(i&1){let t=b();o(0,"inf-feed-card-gated",12),_("signUp",function(){u(t);let r=d(2);return f(r.onSignUp())})("logIn",function(){u(t);let r=d(2);return f(r.onLogIn())})("upgrade",function(){u(t);let r=d(2);return f(r.onUpgrade())}),a()}if(i&2){let t=d(2);m("reason",t.effectiveGatedReason)("teaserBlurUrl",t.gateTeaserBlurUrl)("fallbackBlurUrl",t.gateFallbackBlurUrl)}}function rt(i,e){i&1&&l(0,"div",9)}function ot(i,e){if(i&1&&(o(0,"div",2),h(1,it,2,3)(2,nt,1,3,"inf-feed-card-gated",8)(3,rt,1,0,"div",9),a()),i&2){let t,n=e.$implicit;P("data-offset",n.offset),s(),v((t=n.item)?1:n.isGated?2:3,t)}}var Ve=class i{_store=g(k);_cdr=g(U);_destroyRef=g(te);_dialog=g(ve);_isBrowser=pe(g(ne));items=this._store.selectSignal(T.items);isLimitReached=this._store.selectSignal(T.isLimitReached);gatedReason=this._store.selectSignal(T.gatedReason);teaserBlurUrl=this._store.selectSignal(T.teaserBlurUrl);_hasMore=this._store.selectSignal(T.hasMore);_isAuthed=this._store.selectSignal(Y.isAuthenticated);_isPro=this._store.selectSignal(S.isPremiumSubscription);_isUserLoading=this._store.selectSignal(S.isLoading);tier=ce(()=>this._isAuthed()?this._isPro()?"pro":"registered":"guest");static VISIBLE_OFFSETS=[-2,-1,0,1,2];currentIndex=0;slideState="idle";dragOffset=0;isDragging=!1;_activeViewTimer=null;_firedThisSession=new Set;_lastTier=null;_guestGated=y(!1);_guestGatedTeaserBlurUrl=y(null);_guestGatedFallbackBlurUrl=y(null);_guestGatePersisted=!1;_guestGateWatcher=W(()=>{this._isBrowser&&this.tier()==="guest"&&this._isServerGated&&(this._guestGatePersisted||(this._guestGatePersisted=!0,Ue({teaserBlurUrl:this.teaserBlurUrl(),fallbackBlurUrl:this.lastViewedImageUrl})))});_tierWatcher=W(()=>{let e=this.tier();if(!this._isBrowser){this._lastTier=e;return}this._isAuthed()&&this._isUserLoading()||(this._lastTier!==null&&this._lastTier!==e&&(this.currentIndex=0,this._firedThisSession.clear(),this._store.dispatch(new K),this._store.dispatch(new A)),this._lastTier=e)}
1);get _isServerGated(){return this.isLimitReached()?!0:this.tier()==="pro"?!1:!this._hasMore()}get isGatedRendered(){return this._guestGated()&&this.tier()==="guest"?!0:this._isServerGated}get gateTeaserBlurUrl(){return this.teaserBlurUrl()??this._guestGatedTeaserBlurUrl()}get gateFallbackBlurUrl(){return this.lastViewedImageUrl??this._guestGatedFallbackBlurUrl()}get effectiveGatedReason(){let e=this.gatedReason();return e||(this.tier()==="guest"?"register_required":"upgrade_required")}get totalSlots(){return this.items().length+(this.isGatedRendered?1:0)}get lastViewedImageUrl(){let e=this.items();for(let t=e.length-1;t>=0;t--)if(e[t].media_type==="image")return e[t].media.url;return null}get visibleSlots(){let e=this.items(),t=this.isGatedRendered;return i.VISIBLE_OFFSETS.map(n=>{let r=this.currentIndex+n,c=e[r]??null,Ae=t&&c===null&&r===e.length;return{offset:n,item:c,isGated:Ae}})}get trackTransform(){let e="calc(var(--slot-h) * -2)",t="calc(var(--slot-h) * -3)",n="calc(var(--slot-h) * -1)";return this.isDragging?`translate3d(0, calc(${e} + ${this.dragOffset}px), 0)`:this.slideState==="sliding-next"?`translate3d(0, ${t}, 0)`:this.slideState==="sliding-prev"?`translate3d(0, ${n}, 0)`:`translate3d(0, ${e}, 0)`}get isAnimating(){return this.slideState!=="idle"}_touchStartY=0;_touchStartX=0;_gestureAxis=null;_axisLockThreshold=8;_swipeThreshold=100;_slideDuration=300;_pendingDirection=null;get hasPrev(){return this.currentIndex>0}get hasNext(){return this.currentIndex<this.totalSlots-1}nextSlide(){this._runSlide("next")}prevSlide(){this._runSlide("prev")}onTouchStart(e){this.isAnimating||(this._touchStartY=e.touches[0].clientY,this._touchStartX=e.touches[0].clientX,this._gestureAxis=null,this.isDragging=!1)}onTouchMove(e){if(this.isAnimating)return;let t=e.touches[0].clientY-this._touchStartY,n=e.touches[0].clientX-this._touchStartX;if(this._gestureAxis===null){if(Math.abs(n)<this._axisLockThreshold&&Math.abs(t)<this._axisLockThreshold||(this._gestureAxis=Math.abs(n)>Math.abs(t)?"x":"y",this._gestureAxis!=="y"))return;this.isDragging=!0}this.isDragging&&(this.dragOffset=t,this._cdr.detectChanges())}onTouchEnd(){let e=this.isDragging;this.isDragging=!1,this._gestureAxis=null,e&&(this.dragOffset<-this._swipeThreshold&&this.hasNext?(this.dragOffset=0,this._runSlide("next")):this.dragOffset>this._swipeThreshold&&this.hasPrev?(this.dragOffset=0,this._runSlide("prev")):(this.dragOffset=0,this._cdr.detectChanges()))}_runSlide(e){if(this.isAnimating){this._pendingDirection=e;return}if(e==="next"&&!this.hasNext||e==="prev"&&!this.hasPrev)return;this.slideState=e==="next"?"sliding-next":"sliding-prev",this._cdr.detectChanges();let t=!1,r=setTimeout(()=>{t||(t=!0,clearTimeout(r),this._commitSlide(e))},this._slideDuration+100)}_commitSlide(e){if(this.currentIndex+=e==="next"?1:-1,this.slideState="idle",this._cdr.detectChanges(),this._scheduleViewForCurrent(),this._maybePrefetch(),this._pendingDirection){let t=this._pendingDirection;this._pendingDirection=null,queueMicrotask(()=>this._runSlide(t))}}_maybePrefetch(){let e=this.items();if(this._store.selectSnapshot(T.isLoading)||e.length-1-this.currentIndex>2)return;this._store.selectSnapshot(T.hasMore)?this._store.dispatch(new A):this.tier()==="pro"&&this._store.dispatch(new Pe)}onKeydown(e){let t=e.target;t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)||(e.key==="ArrowDown"?(e.preventDefault(),this.nextSlide()):e.key==="ArrowUp"&&(e.preventDefault(),this.prevSlide()))}_wheelCooldownUntil=0;static WHEEL_THRESHOLD=30;static WHEEL_COOLDOWN_MS=600;onWheel(e){if(!(Math.abs(e.deltaY)<Math.abs(e.deltaX))){if(e.cancelable)try{e.preventDefault()}catch{}this.isAnimating||Date.now()<this._wheelCooldownUntil||Math.abs(e.deltaY)<i.WHEEL_THRESHOLD||(this._wheelCooldownUntil=Date.now()+i.WHEEL_COOLDOWN_MS,e.deltaY>0?this.nextSlide():this.prevSlide())}}onLikeToggle(e){if(this.tier()==="guest"){this._store.dispatch(new V);return}this._store.dispatch(e.is_liked?new Te(e.id):new Me(e.id))}onReportToggle(e){if(this.tier()==="guest"){this._store.dispatch(new V);return}this._store.dispatch(e.is_reported?new ke(e.id):new De(e.id))}onRemovePost(e){this._dialog.open(F,{width:F.DialogWidth}).afterClosed().pipe(G(this._destroyRef)).subscribe(t=>{t&&this._store.dispatch(new Oe(e.id))})}ngOnInit(){if(!this._isBrowser)return;this._store.selectSnapshot(Y.isAuthenticated)&&this._store.dispatch(new fe({useCache:!0}));let e=this.tier()==="guest"?Ge():null;if(e){this._guestGated.set(!0),this._guestGatedTeaserBlurUrl.set(e.teaserBlurUrl),this._guestGatedFallbackBlurUrl.set(e.fallbackBlurUrl),this._guestGatePersisted=!0;return}this._store.dispatch(new A).pipe(G(this._destroyRef)).subscribe(()=>this._scheduleViewForCurrent())}_scheduleViewForCurrent(){this._activeViewTimer!==null&&(clearTimeout(this._activeViewTimer),this._activeViewTimer=null);let e=this.items()[this.currentIndex];if(!e||this._firedThisSession.has(e.id))return;let t=e.id;this._activeViewTimer=window.setTimeout(()=>{this._activeViewTimer=null,!this._firedThisSession.has(t)&&this.items()[this.currentIndex]?.id===t&&(this._firedThisSession.add(t),this._fireView(t))},500)}_fireView(e){this.tier()!=="guest"&&this._store.dispatch(new Se(e))}onSignUp(){this._store.dispatch(new V)}onLogIn(){this._store.dispatch(new ue)}onUpgrade(){this._store.dispatch(new me).pipe(G(this._destroyRef)).subscribe(()=>{this._dialog.open(q,{width:q.DialogWidth,height:"100%",maxHeight:"551px",data:{plan:null},panelClass:"inf-profile-change-plan-dialog",scrollStrategy:new ge})})}ngOnDestroy(){this._activeViewTimer!==null&&clearTimeout(this._activeViewTimer),this._activeViewTimer=null,this._isBrowser&&this._store.dispatch(new K)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=C({type:i,selectors:[["inf-discover-page"]],hostBindings:function(t,n){t&1&&_("keydown",function(c){return n.onKeydown(c)},re)},decls:9,vars:7,consts:[[1,"inf-discover-page",3,"touchstart","touchmove","touchend","wheel"],[1,"inf-discover-page__track"],[1,"inf-discover-page__slot"],[1,"inf-discover-page__desktop-controls"],["type","button","aria-label","Previous post",1,"inf-discover-page__nav-btn",3,"click","disabled"],["name","arrow-down",1,"inf-discover-page__nav-icon","inf-discover-page__nav-icon--flip"],["type","button","aria-label","Next post",1,"inf-discover-page__nav-btn",3,"click","disabled"],["name","arrow-down",1,"inf-discover-page__nav-icon"],[3,"reason","teaserBlurUrl","fallbackBlurUrl"],[1,"inf-discover-page__slot-empty"],[3,"item","isActive"],[3,"likeToggle","reportToggle","removePost","item"],[3,"signUp","logIn","upgrade","reason","teaserBlurUrl","fallbackBlurUrl"]],template:function(t,n){t&1&&(o(0,"section",0),_("touchstart",function(c){return n.onTouchStart(c)})("touchmove",function(c){return n.onTouchMove(c)})("touchend",function(){return n.onTouchEnd()})("wheel",function(c){return n.onWheel(c)}),o(1,"div",1),ae(2,ot,4,2,"div",2,tt),a(),o(4,"div",3)(5,"button",4),_("click",function(){return n.prevSlide()}),l(6,"svg-icon",5),a(),o(7,"button",6),_("click",function(){return n.nextSlide()}),l(8,"svg-icon",7),a()()()),t&2&&(P("data-tier",n.tier()),s(),de("transform",n.trackTransform),x("inf-discover-page__track--animating",n.isAnimating),s(),se(n.visibleSlots),s(3),m("disabled",!n.hasPrev||n.isAnimating),s(2),m("disabled",!n.hasNext||n.isAnimating))},dependencies:[M,I,L,N],styles:["[_ngcontent-%COMP%]:root{--sidebar-height: 648px;--sidebar-left: 16px;--sidebar-mobile-border-bottom-right-radius: 40px;--sidebar-mobile-box-shadow: none}[_nghost-%COMP%]{display:block;width:100%;height:100dvh;padding:16px 0;box-sizing:border-box;--slot-h: calc(100dvh - 32px) ;--feed-media-w: 420px;--feed-card-pad: 16px;--feed-rail-gap: 24px}@media (max-width: 1140px){[_nghost-%COMP%]{padding:0;height:calc(100dvh - 80px);--slot-h: calc(100dvh - 80px) }}@media (min-width: 1441px){[_nghost-%COMP%]{--feed-media-w: 520px}} :root{--sidebar-mobile-border-bottom-right-radius: 0px;--sidebar-mobile-box-shadow: inset 0 -1px 0 0 var(--primary)} .inf-layout__content{padding:0!important} inf-footer{display:none}@media (max-width: 1140px){ inf-header{display:none}}.inf-discover-page[_ngcontent-%COMP%]{width:100%;color:#fff;height:100%;overflow:hidden;position:relative;touch-action:none;background:#0b1429b2;border:1px solid var(--neutral-70);box-shadow:1px 0 #00000014;border-radius:20px}@media (max-width: 1140px){.inf-discover-page[_ngcontent-%COMP%]{border-radius:0;border:none}}.inf-discover-page__track[_ngcontent-%COMP%]{display:flex;flex-direction:column;will-change:transform}.inf-discover-page__track--animating[_ngcontent-%COMP%]{transition:transform .3s ease-out}.inf-discover-page__slot[_ngcontent-%COMP%]{width:100%;display:flex;position:relative;align-items:center;height:var(--slot-h);box-sizing:border-box;flex:0 0 var(--slot-h);justify-content:center}@media (min-width: 751px){.inf-discover-page__slot[_ngcontent-%COMP%]{padding:24px 0}}.inf-discover-page__desktop-controls[_ngcontent-%COMP%]{top:50%;gap:16px;z-index:4;right:32px;display:none;position:absolute;flex-direction:column;transform:translateY(-50%)}@media (min-width: 751px){.inf-discover-page__desktop-controls[_ngcontent-%COMP%]{display:flex}}.inf-discover-page__nav-btn[_ngcontent-%COMP%]{width:60px;height:60px;color:#fff;cursor:pointer;border-radius:50%;align-items:center;display:inline-flex;justify-content:center;background:var(--neutral-70);border:2px solid var(--neutral-60)}.inf-discover-page__nav-btn[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.inf-discover-page__nav-btn[_ngcontent-%COMP%]:not(:disabled):hover{background:var(--neutral-60)}.inf-discover-page__nav-icon[_ngcontent-%COMP%]{font-size:20px}.inf-discover-page__nav-icon--flip[_ngcontent-%COMP%]{transform:rotate(180deg)}"],changeDetection:0})};export{Ve as DiscoverPageComponent};
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.