1import{b}from"./chunk-J5ZQLXXU.js";import{a as D}from"./chunk-MUUVZFYQ.js";import{a as O}from"./chunk-RMFEZUNF.js";import"./chunk-32B64V2R.js";import"./chunk-3XLVKQRY.js";import"./chunk-DJ5AJG3T.js";import"./chunk-SLPC3Y4V.js";import"./chunk-XIRWNEM2.js";import"./chunk-AAORKXGN.js";import"./chunk-KDGXQRVY.js";import"./chunk-JICM7NVH.js";import{a as c}from"./chunk-AB6CKZTE.js";import"./chunk-DIGPPQJE.js";import{o as S,r as A}from"./chunk-EU6HCBUP.js";import{h as _}from"./chunk-KAJMKXZ6.js";import{D as k,m as C}from"./chunk-ZAQTNZYS.js";import{c as a}from"./chunk-SRTXE2HR.js";import{F as d,Fa as h,Jb as p,Wb as v,Xb as w,ac as I,da as r,gc as g,hc as n,l as m,la as l,ma as u,sb as f,yb as y}from"./chunk-NTTV6FWH.js";import"./chunk-W7GRJBO5.js";function P(s,t){if(s&1){let e=I();v(0,"app-story-viewer",1),g("closed",function(){l(e);let i=n();return u(i.onClosed())}),w()}if(s&2){let e=n();p("startWorkspaceId",e.workspaceId)("monoAuthor",!0)}}var B=class s{route=r(S);router=r(A);http=r(_);platformId=r(h);device=r(D);seo=r(O);isBrowser=a(this.platformId);workspaceId="";constructor(){let t=this.route.snapshot.paramMap,e=t.get("workspaceId");if(e){this.workspaceId=e,this.maybeAutoOpenInApp();return}let o=t.get("username");o&&this.isBrowser&&this.http.get(`/api/workspaces/public/${o}`).pipe(d(()=>m(null))).subscribe(i=>{i?.id?(this.workspaceId=i.id,this.maybeAutoOpenInApp()):this.router.navigateByUrl("/@"+o)})}ngOnInit(){this.seo.setSeoFromSnapshop(this.route.snapshot);let t=this.route.snapshot.paramMap,e=t.get("username"),o=t.get("workspaceId");e?this.seo.updateOgUrl(`${c.app}/@${encodeURIComponent(e)}/story`):o&&this.seo.updateOgUrl(`${c.app}/story/${encodeURIComponent(o)}`)}get appDeepLinkHost(){return`story/${encodeURIComponent(this.workspaceId)}`}openInApp(){!a(this.platformId)||!this.workspaceId||this.device.openAppOrStore(this.appDeepLinkHost,"https://hou.la/app-store","https://hou.la/play-store")}maybeAutoOpenInApp(){if(!this.isBrowser||!this.device.isMobile()||!location.pathname.includes("/story"))return;let t="houla_app_autoopen";try{if(sessionStorage.getItem(t))return;sessionStorage.setItem(t,"1")}catch{}this.device.tryOpenApp(this.appDeepLinkHost)}onClosed(){if(this.isBrowser&&window.history.length>1){window.history.back();return}this.router.navigateByUrl("/a/for-you")}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=f({type:s,selectors:[["app-story-page"]],decls:1,vars:1,consts:[[3,"startWorkspaceId","monoAuthor","closed",4,"ngIf"],[3,"closed","startWorkspaceId","monoAuthor"]],template:function(e,o){e&1&&y(0,P,1,2,"app-story-viewer",0),e&2&&p("ngIf",o.isBrowser&&o.workspaceId)},dependencies:[k,C,b],encapsulation:2})};export{B as StoryPageComponent};
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.