pixelfed/public/js/stories.js

1 line
35 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{22:function(t,e,s){t.exports=s("2Jj/")},"2Jj/":function(t,e,s){Vue.component("story-viewer",s("Zhjo").default)},"4DwN":function(t,e,s){var n=s("RWQ7");"string"==typeof n&&(n=[[t.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};s("aET+")(n,i);n.locals&&(t.exports=n.locals)},"7YaD":function(t,e,s){"use strict";s("4DwN")},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var s=e.protocol+"//"+e.host,n=s+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var i,o=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?t:(i=0===o.indexOf("//")?o:0===o.indexOf("/")?s+o:n+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var s=function(t,e){var s=t[1]||"",n=t[3];if(!n)return s;if(e&&"function"==typeof btoa){var i=(r=n,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),o=n.sources.map((function(t){return"/*# sourceURL="+n.sourceRoot+t+" */"}));return[s].concat(o).concat([i]).join("\n")}var r;return[s].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+s+"}":s})).join("")},e.i=function(t,s){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(n[o]=!0)}for(i=0;i<t.length;i++){var r=t[i];"number"==typeof r[0]&&n[r[0]]||(s&&!r[2]?r[2]=s:s&&(r[2]="("+r[2]+") and ("+s+")"),e.push(r))}},e}},"KHd+":function(t,e,s){"use strict";function n(t,e,s,n,i,o,r,a){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=s,c._compiled=!0),n&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),r?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},c._ssrRegister=l):i&&(l=a?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var d=c.render;c.render=function(t,e){return l.call(e),d(t,e)}}else{var u=c.beforeCreate;c.beforeCreate=u?[].concat(u,l):[l]}return{exports:t,options:c}}s.d(e,"a",(function(){return n}))},RWQ7:function(t,e,s){(t.exports=s("I1BE")(!1)).push([t.i,"#content[data-v-1bff5ab6] {\n width: 100%;\n height: 100vh !important;\n overflow: hidden;\n background-color: #262626;\n}\n.story-viewer-component-card[data-v-1bff5ab6] {\n height: 100vh;\n}\n@media (min-width: 768px) {\n.story-viewer-component-card[data-v-1bff5ab6] {\n height: 90vh;\n}\n}\n.story-viewer-component.bg-black[data-v-1bff5ab6] {\n background-color: #262626;\n}\n.story-viewer-component .option-green[data-v-1bff5ab6] {\n font-size: 20px;\n font-weight: 600;\n background: #11998e;\n /* fallback for old browsers */\n background: linear-gradient(180deg, #38ef7d, #11998e);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n}\n.story-viewer-component .option-red[data-v-1bff5ab6] {\n font-weight: 600;\n background: linear-gradient(to right, #F27121, #E94057, #8A2387);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n}\n.story-viewer-component .bg-black[data-v-1bff5ab6] {\n background-color: #262626;\n}\n.story-viewer-component .fade-enter-active[data-v-1bff5ab6], .story-viewer-component .fade-leave-active[data-v-1bff5ab6] {\n transition: opacity 0.5s;\n}\n.story-viewer-component .fade-enter[data-v-1bff5ab6], .story-viewer-component .fade-leave-to[data-v-1bff5ab6] {\n opacity: 0;\n}\n.story-viewer-component .progress[data-v-1bff5ab6] {\n background-color: #979a9a;\n}\n.story-viewer-component .media-slot[data-v-1bff5ab6] {\n border-radius: 0;\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n background: #000;\n background-size: cover !important;\n z-index: 0;\n}\n.story-viewer-component .card-body .top-overlay[data-v-1bff5ab6] {\n height: 100px;\n margin-left: -35px;\n margin-right: -35px;\n margin-top: -20px;\n padding-bottom: 20px;\n border-radius: 5px;\n background: linear-gradient(180deg, rgba(38, 38, 38, 0.8) 0%, rgba(38, 38, 38, 0) 100%);\n}\n.story-viewer-component .card-footer[data-v-1bff5ab6] ::-moz-placeholder {\n color: #fff;\n opacity: 1;\n}\n.story-viewer-component .card-footer[data-v-1bff5ab6] :-ms-input-placeholder {\n color: #fff;\n opacity: 1;\n}\n.story-viewer-component .card-footer[data-v-1bff5ab6] ::placeholder {\n color: #fff;\n opacity: 1;\n}\n.story-viewer-component .card-footer .bottom-overlay[data-v-1bff5ab6] {\n margin-left: -35px;\n margin-right: -35px;\n margin-bottom: -20px;\n border-radius: 5px;\n background: linear-gradient(0deg, rgba(38, 38, 38, 0.8) 0%, rgba(38, 38, 38, 0) 100%);\n}\n.story-viewer-component .card-footer .bottom-overlay .form-group[data-v-1bff5ab6] {\n padding-top: 40px;\n padding-bottom: 20px;\n margin-bottom: 0;\n}",""])},Zhjo:function(t,e,s){"use strict";s.r(e);function n(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);"Object"===s&&t.constructor&&(s=t.constructor.name);if("Map"===s||"Set"===s)return Array.from(t);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,n=new Array(e);s<e;s++)n[s]=t[s];return n}var o={props:{pid:{type:String},selfProfile:{type:Object},redirectUrl:{type:String,default:"/"}},data:function(){return{loading:!0,profile:null,account:{local:!1},owner:!1,stories:[],username:"loading...",avatar:"/storage/avatars/default.jpg",storyIndex:0,progress:0,constInterval:383,progressInterval:void 0,composeText:null,paused:!1,muted:!0,reactionEmoji:["❤️","🔥","💯","😂","😎","👀"],activeReactionEmoji:!1,activeReply:!1,showProgress:!1,redirectOnEnd:"/",viewerSid:!1,viewerPage:1,loadingViewers:!1,viewersHasMore:!0,viewers:[],viewWarning:!1,showingPollResults:!1,loadingPollResults:!1,pollResults:[],pollTotalVotes:0}},watch:{composeText:function(t){0==t.length?this.paused&&this.pause():this.paused||this.pause(),event.currentTarget.focus()}},beforeMount:function(){this.redirectOnEnd=this.redirectUrl},mounted:function(){var t=this,e=new URLSearchParams(window.location.search);if(e.has("t"))switch(e.get("t")){case"1":this.redirectOnEnd="/";break;case"2":this.redirectOnEnd="/timeline/public";break;case"3":this.redirectOnEnd="/timeline/network";break;case"4":this.redirectOnEnd="/"+window.location.pathname.split("/").slice(-1).pop()}else this.viewWarning=!0;this.selfProfile&&this.selfProfile.hasOwnProperty("avatar")?this.profile=this.selfProfile:axios.get("/api/pixelfed/v1/accounts/verify_credentials").then((function(e){t.profile=e.data,t.fetchStories()}));var s=document.querySelector("body");s.style.width="100%",s.style.height="100vh !important",s.style.overflow="hidden",s.style.backgroundColor="#262626"},methods:{init:function(){var t=this;clearInterval(this.progressInterval),this.loading=!1,this.constInterval=Math.ceil(38.3*this.stories[this.storyIndex].duration),this.progressInterval=setInterval((function(){t.do()}),this.constInterval)},do:function(){this.loading=!1,100!=this.stories[this.storyIndex].progress?this.stories[this.storyIndex].progress=this.stories[this.storyIndex].progress+4:(clearInterval(this.progressInterval),this.next())},prev:function(){0!=this.storyIndex&&(this.pollResults=[],this.progress=0,this.gotoSlide(this.storyIndex-1))},next:function(){if(axios.post("/api/web/stories/v1/viewed",{id:this.stories[this.storyIndex].id}),this.stories[this.storyIndex].progress=100,this.storyIndex!=this.stories.length-1)this.pollResults=[],this.progress=0,this.muted=!0,this.storyIndex=this.storyIndex+1,this.init();else{if(this.composeText&&this.composeText.length)return;window.location.href=this.redirectOnEnd}},pause:function(){if(event&&event.currentTarget.blur(),this.paused){if(this.paused=!1,"video"==this.stories[this.storyIndex].type)document.getElementById("playr").play();this.init()}else{if(clearInterval(this.progressInterval),"video"==this.stories[this.storyIndex].type)document.getElementById("playr").pause();this.paused=!0}},toggleMute:function(){(event&&event.currentTarget.blur(),"video"==this.stories[this.storyIndex].type)&&(this.muted=!this.muted,document.getElementById("playr").muted=this.muted)},gotoSlide:function(t){this.paused=!1,clearInterval(this.progressInterval),this.progressInterval=null,this.stories=this.stories.map((function(e,s){return e.progress=s<t?100:0,e})),this.storyIndex=t,this.stories[t].progress=0,this.init()},showMenu:function(){this.paused||this.pause(),event.currentTarget.blur(),this.$refs.ctxMenu.show()},react:function(t){var e=this;this.$refs.ctxMenu.hide(),this.activeReactionEmoji=!0,axios.post("/api/web/stories/v1/react",{sid:this.stories[this.storyIndex].id,reaction:t}).then((function(t){setTimeout((function(){e.activeReactionEmoji=!1,e.pause()}),2e3)})).catch((function(t){e.activeReactionEmoji=!1,swal("Error","An error occured when attempting to react to this story. Please try again later.","error")}))},comment:function(){var t=this;this.composeText.length<2||(this.paused||this.pause(),this.activeReply=!0,axios.post("/api/web/stories/v1/comment",{sid:this.stories[this.storyIndex].id,caption:this.composeText}).then((function(e){t.composeText=null,setTimeout((function(){t.activeReply=!1,t.pause()}),2e3)})).catch((function(e){t.activeReply=!1,swal("Error","An error occured when attempting to reply to this story. Please try again later.","error")})))},closeCtxMenu:function(){this.$refs.ctxMenu.hide()},backToFeed:function(){var t=this;this.composeText?swal("Are you sure you want to leave without sending this reply?").then((function(e){e&&(window.location.href=t.redirectOnEnd)})):window.location.href=this.redirectOnEnd},timeago:function(t){return App.util.format.timeAgo(t)},timeahead:function(t){var e=new Date(t);return App.util.format.timeAhead(e.toUTCString())},fetchStories:function(){var t=this,e=this;axios.get("/api/web/stories/v1/profile/"+this.pid).then((function(s){if(0==s.data.length&&(window.location.href=t.redirectOnEnd),e.account=s.data[0].account,0==e.account.local&&(e.account.domain=e.account.acct.split("@")[1]),e.stories=s.data[0].nodes.map((function(t,e){var s={id:t.id,created_at:t.created_at,expires_at:t.expires_at,progress:t.progress,view_count:t.view_count,url:t.src,type:t.type,duration:t.duration,can_reply:t.can_reply,can_react:t.can_react};return"poll"==s.type&&(s.question=t.question,s.options=t.options,s.voted=t.voted,s.voted_index=t.voted_index),s})),e.username=s.data[0].account.username,e.avatar=s.data[0].account.avatar,e.profile.id==s.data[0].account.id&&(t.viewWarning=!1),t.viewWarning)t.loading=!1;else{var n=s.data[0].nodes.filter((function(t,e){return 1==t.seen})).map((function(t,e){return e}));if(n.length&&t.pid!=t.profile.id){var i=n[n.length-1]+1==e.stories.length?n[n.length-1]:n[n.length-1]+1;e.gotoSlide(i)}t.pid==t.profile.id&&e.gotoSlide(e.stories.length-1),e.showProgress=!0,e.profile.id==e.account.id&&(e.owner=!0),0!=s.data.length?t.init():window.location.href=t.redirectOnEnd}})).catch((function(t){}))},fetchViewers:function(){var t=this;this.closeCtxMenu(),this.$refs.viewersModal.show(),this.stories[this.storyIndex].id!=this.viewerSid&&(this.loadingViewers=!0,axios.get("/api/web/stories/v1/viewers",{params:{sid:this.stories[this.storyIndex].id}}).then((function(e){t.viewerSid=t.stories[t.storyIndex].id,t.viewers=e.data,t.loadingViewers=!1,t.viewerPage=2,10==t.viewers.length?t.viewersHasMore=!0:t.viewersHasMore=!1})).catch((function(t){swal("Cannot load viewers","Cannot load viewers of this story, please try again later.","error")})))},viewersLoadMore:function(){var t=this;axios.get("/api/web/stories/v1/viewers",{params:{sid:this.stories[this.storyIndex].id,page:this.viewerPage}}).then((function(e){var s;e.data&&0!=e.data.length?(10!=e.data.length&&(t.viewersHasMore=!1),(s=t.viewers).push.apply(s,n(e.data)),t.viewerPage++):t.viewersHasMore=!1})).catch((function(t){swal("Cannot load viewers","Cannot load viewers of this story, please try again later.","error")}))},closeViewersModal:function(){this.$refs.viewersModal.hide()},deleteStory:function(){var t=this;this.closeCtxMenu(),window.confirm("Are you sure you want to delete this story?")?axios.delete("/api/web/stories/v1/delete/"+this.stories[this.storyIndex].id).then((function(e){t.storyIndex;1!=t.stories.length?window.location.reload():window.location.href="/"})):this.pause()},selectPollOption:function(t){var e=this;this.paused||this.pause(),axios.post("/i/stories/viewed",{id:this.stories[this.storyIndex].id}),axios.post("/api/web/stories/v1/poll/vote",{sid:this.stories[this.storyIndex].id,ci:t}).then((function(s){e.stories[e.storyIndex].voted=!0,e.stories[e.storyIndex].voted_index=t,e.next()}))},ctxMenuReport:function(){this.$refs.ctxMenu.hide(),this.$refs.ctxReport.show()},openCtxReportOtherMenu:function(){this.closeCtxMenu(),this.$refs.ctxReport.hide(),this.$refs.ctxReportOther.show()},ctxReportMenuGoBack:function(){this.closeMenus()},ctxReportOtherMenuGoBack:function(){this.closeMenus()},closeMenus:function(){this.$refs.ctxReportOther.hide(),this.$refs.ctxReport.hide(),this.$refs.ctxMenu.hide()},sendReport:function(t){var e=this,s=this.stories[this.storyIndex].id;swal({title:"Confirm Report",text:"Are you sure you want to report this post?",icon:"warning",buttons:!0,dangerMode:!0}).then((function(n){n?axios.post("/api/web/stories/v1/report",{type:t,id:s}).then((function(t){e.closeMenus(),swal("Report Sent!","We have successfully received your report","success")})).catch((function(t){409===t.response.status?swal("Already reported","You have already reported this story","info"):swal("Oops!","There was an issue reporting this story","error")})):e.closeMenus()}))},cancelViewStory:function(){event.currentTarget.blur(),location.href="/i/web"},confirmViewStory:function(){var t=this.stories.filter((function(t,e){return 1==t.seen})).map((function(t,e){return e}));if(t.length&&this.pid!=this.profile.id){var e=t[t.length-1]+1==this.stories.length?t[t.length-1]:t[t.length-1]+1;this.gotoSlide(e)}this.pid==this.profile.id&&this.gotoSlide(this.stories.length-1),this.showProgress=!0,this.profile.username==this.username&&(this.owner=!0),this.viewWarning=!1,this.init()},showPollResults:function(){var t=this;this.loadingPollResults=!0,this.paused||this.pause(),axios.get("/api/web/stories/v1/poll/results",{params:{sid:this.stories[this.storyIndex].id}}).then((function(e){t.loadingPollResults=!1,t.pollResults=e.data;t.pollTotalVotes=t.pollResults.reduce((function(t,e){return t+e}))}))},addToStory:function(){window.location.href="/i/stories/new"},pollPercent:function(t){return 0==this.pollTotalVotes?0:Math.round(this.pollResults[t]/this.pollTotalVotes*100)}}},r=(s("7YaD"),s("KHd+")),a=Object(r.a)(o,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"story-viewer-component container mt-0 mt-md-5 bg-black"},[s("button",{staticClass:"d-none d-md-block btn btn-link fixed-top",staticStyle:{left:"auto",right:"0"},attrs:{type:"button"},on:{click:t.backToFeed}},[s("i",{staticClass:"fal fa-times-circle fa-2x text-lighter"})]),t._v(" "),t.viewWarning?s("div",{staticClass:"row d-flex justify-content-center align-items-center"},[t.loading?t._e():s("div",{staticClass:"col-12 col-md-6 rounded-lg p-0"},["photo"==t.stories[t.storyIndex].type?s("div",{key:"msl:"+t.storyIndex,staticClass:"media-slot rounded-lg",style:{backgroundImage:"url("+t.stories[t.storyIndex].url+")"}}):t._e(),t._v(" "),s("div",{staticClass:"story-viewer-component-card card bg-transparent border-0 shadow-none d-flex justify-content-center",staticStyle:{"backdrop-filter":"blur(40px) brightness(0.3)","-webkit-backdrop-filter":"blur(10px)"}},[s("div",{staticClass:"card-body"},[s("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center"},[s("div",{staticClass:"text-center"},[s("img",{staticClass:"rounded-circle border mb-3 shadow",attrs:{src:t.profile.avatar,width:"120",height:"120"}}),t._v(" "),s("p",{staticClass:"lead text-lighter mb-1"},[t._v("View as "),s("span",{staticClass:"text-white"},[t._v(t._s(t.profile.username))])]),t._v(" "),s("p",{staticClass:"text-lighter font-weight-lighter px-md-5 py-3"},[s("span",{staticClass:"text-white font-weight-bold"},[t._v(t._s(t.account.acct))]),t._v(" will be able to see that you viewed their story.\n\t\t\t\t\t\t\t")]),t._v(" "),s("button",{staticClass:"btn btn-outline-lighter rounded-pill py-1 font-weight-bold",on:{click:t.confirmViewStory}},[t._v("View Story")]),t._v(" "),s("button",{staticClass:"btn btn-outline-lighter rounded-pill py-1 font-weight-bold",on:{click:t.cancelViewStory}},[t._v("Cancel")])])])])])])]):s("div",{staticClass:"row d-flex justify-content-center align-items-center"},[s("div",{staticClass:"d-none d-md-block col-md-1 cursor-pointer text-center",on:{click:t.prev}},[t.storyIndex>0?s("div",[s("i",{staticClass:"fas fa-chevron-circle-left text-muted fa-2x"})]):t._e()]),t._v(" "),t.loading?t._e():s("div",{staticClass:"col-12 col-md-6 rounded-lg"},[t.activeReactionEmoji?s("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center",staticStyle:{position:"absolute","z-index":"999"}},[t._m(0)]):t._e(),t._v(" "),t.activeReply?s("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center",staticStyle:{position:"absolute","z-index":"999"}},[t._m(1)]):t._e(),t._v(" "),s("transition",{attrs:{name:"fade"}},["photo"==t.stories[t.storyIndex].type?s("div",{key:"msl:"+t.storyIndex,staticClass:"media-slot rounded-lg",style:{background:"url("+t.stories[t.storyIndex].url+")"}}):t._e(),t._v(" "),"poll"==t.stories[t.storyIndex].type?s("div",{key:"msl:"+t.storyIndex,staticClass:"media-slot rounded-lg",style:{background:"linear-gradient(to right, #F27121, #E94057, #8A2387)"}}):t._e(),t._v(" "),"video"==t.stories[t.storyIndex].type?s("video",{key:"plyr"+t.stories[t.storyIndex].id,staticClass:"media-slot rounded-lg",staticStyle:{"object-fit":"contain"},attrs:{id:"playr",loop:"",autoplay:"","no-controls":""},domProps:{muted:t.muted}},[s("source",{attrs:{src:t.stories[t.storyIndex].url,type:"video/mp4"}})]):t._e()]),t._v(" "),s("div",{staticClass:"story-viewer-component-card card bg-transparent border-0 shadow-none d-flex justify-content-center"},[s("div",{staticClass:"card-body"},[s("div",{staticClass:"px-0 top-overlay"},[s("div",{staticClass:"pt-4 pt-md-3 px-4 d-flex"},[s("div",{staticClass:"d-none bg-muted",staticStyle:{width:"100%",height:"5px"}}),t._v(" "),t._l(t.stories,(function(e,n){return s("div",{key:"sp:s"+n,staticClass:"w-100 cursor-pointer",class:{"mr-2":n!=t.stories.length-1},on:{click:function(e){return t.gotoSlide(n)}}},[s("div",{staticClass:"progress w-100",staticStyle:{"z-index":"3",height:"4px"},style:{opacity:0==e.progress?.7:.8}},[s("div",{key:"sp:si"+n,staticClass:"progress-bar bg-light",style:{width:e.progress+"%",transition:"none !important"},attrs:{role:"progressbar","aria-valuenow":e.progress,"aria-valuemin":"0","aria-valuemax":"100"}})])])}))],2),t._v(" "),s("div",{staticClass:"pt-4 px-4 media align-items-center"},[s("img",{staticClass:"rounded-circle mr-2",attrs:{src:t.avatar,width:"32",height:"32",onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=2'"}}),t._v(" "),s("div",{staticClass:"media-body d-flex justify-content-between align-items-center"},[s("div",{staticClass:"user-select-none d-flex align-items-center"},[t.account.local?s("span",{staticClass:"text-white font-weight-bold mr-2"},[t._v("\n\t\t\t\t\t\t\t\t\t\t"+t._s(t.username)+"\n\t\t\t\t\t\t\t\t\t")]):s("span",{staticClass:"text-white font-weight-bold mr-3 text-truncate",staticStyle:{"max-width":"200px"}},[s("span",{staticClass:"d-block mb-n2"},[t._v(t._s(t.account.username))]),t._v(" "),s("span",{staticClass:"small"},[t._v(t._s(t.account.domain))])]),t._v(" "),s("span",{staticClass:"text-white font-weight-light",staticStyle:{"font-size":"14px"}},[t._v(t._s(t.timeago(t.stories[t.storyIndex].created_at)))]),t._v(" "),"poll"==t.stories[t.storyIndex].type?s("span",[s("span",{staticClass:"btn btn-outline-light font-weight-light btn-sm px-1 rounded py-0 ml-2"},[t._v("POLL")])]):t._e()]),t._v(" "),s("div",[s("button",{staticClass:"btn btn-link btn-sm text-white mr-0 px-1",on:{click:function(e){return e.preventDefault(),t.pause.apply(null,arguments)}}},[s("i",{staticClass:"fas fa-lg",class:[t.paused?"fa-play":"fa-pause"]})]),t._v(" "),"video"==t.stories[t.storyIndex].type?s("button",{staticClass:"btn btn-link text-white px-2",on:{click:t.toggleMute}},[s("i",{staticClass:"fas fa-lg",class:[t.muted?"fa-volume-mute":"fa-volume-up"]})]):t._e(),t._v(" "),s("button",{staticClass:"btn btn-link text-white px-1",on:{click:t.showMenu}},[s("i",{staticClass:"fas fa-ellipsis-h fa-lg"})]),t._v(" "),s("button",{staticClass:"d-inline-block d-md-none btn btn-link text-white pl-1 pr-0",on:{click:t.backToFeed}},[s("i",{staticClass:"far fa-times-circle fa-lg"})])])])])]),t._v(" "),s("div",{staticStyle:{height:"70vh"},on:{click:t.pause}},["poll"==t.stories[t.storyIndex].type?s("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center"},[s("div",[s("p",{staticClass:"text-white pb-5 text-break font-weight-lighter",class:[t.stories[t.storyIndex].question.length<60?"h1":"h3"]},[t._v("\n\t\t\t\t\t\t\t\t\t"+t._s(t.stories[t.storyIndex].question)+"\n\t\t\t\t\t\t\t\t")]),t._v(" "),s("div",{staticClass:"text-center mt-3"},t._l(t.stories[t.storyIndex].options,(function(e,n){return s("div",{staticClass:"mb-3"},[s("button",{staticClass:"btn border px-4 py-3 text-uppercase btn-block",class:[e.length<14?"btn-lg":"",n==t.stories[t.storyIndex].voted_index?"btn-light":"btn-outline-light"],staticStyle:{"min-width":"300px"},attrs:{disabled:t.stories[t.storyIndex].voted||t.owner},on:{click:function(e){return t.selectPollOption(n)}}},[s("span",{staticClass:"text-break",class:[n==t.stories[t.storyIndex].voted_index?"option-red":""]},[t._v("\n\t\t\t\t\t\t\t\t\t\t\t\t"+t._s(e)+"\n\t\t\t\t\t\t\t\t\t\t\t")])]),t._v(" "),t.owner&&t.pollResults.length?s("p",{staticClass:"small text-left mt-1 text-light"},[t._v("\n\t\t\t\t\t\t\t\t\t\t\t\t"+t._s(t.pollPercent(n))+"% - "+t._s(t.pollResults[n])+" "+t._s(1==t.pollResults[n]?"vote":"votes")+"\n\t\t\t\t\t\t\t\t\t\t")]):t._e()])})),0),t._v(" "),t.owner&&!t.showingPollResults&&0==t.pollResults.length?s("div",{staticClass:"mt-3 text-center"},[s("button",{staticClass:"btn btn-light font-weight-bold",attrs:{disabled:t.loadingPollResults},on:{click:t.showPollResults}},[t._v("\n\t\t\t\t\t\t\t\t\t\t"+t._s(t.loadingPollResults?"Loading...":"View Results")+"\n\t\t\t\t\t\t\t\t\t")])]):t._e()])]):t._e()])]),t._v(" "),!t.owner&&t.stories[t.storyIndex]&&t.stories[t.storyIndex].can_reply?s("div",{staticClass:"card-footer bg-transparent border-0"},[s("div",{staticClass:"px-0 bottom-overlay"},[s("div",{staticClass:"px-3 form-group d-flex"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control bg-transparent border border-white rounded-pill text-white",attrs:{placeholder:"Reply to "+t.username+"..."},domProps:{value:t.composeText},on:{input:function(e){e.target.composing||(t.composeText=e.target.value)}}}),t._v(" "),s("button",{staticClass:"btn btn-outline-light rounded-pill ml-2",on:{click:t.comment}},[t._v("\n\t\t\t\t\t\t\t\tSEND\n\t\t\t\t\t\t\t")])])])]):t._e()])],1),t._v(" "),s("div",{staticClass:"d-none d-md-block col-md-1 cursor-pointer text-center"},[t.storyIndex+1<t.stories.length?s("div",{on:{click:t.next}},[s("i",{staticClass:"fas fa-chevron-circle-right text-muted fa-2x"})]):t._e(),t._v(" "),t.storyIndex+1==t.stories.length&&t.owner?s("div",{on:{click:t.addToStory}},[s("i",{staticClass:"fal fa-plus-circle text-muted fa-2x"})]):t._e()]),t._v(" "),t.loading?s("div",{staticClass:"col-12 col-md-6 rounded-lg"},[t._m(2)]):t._e()]),t._v(" "),s("div",{staticClass:"modal-stack"},[s("b-modal",{ref:"ctxMenu",attrs:{id:"ctx-modal","hide-header":"","hide-footer":"",centered:"",rounded:"",size:"sm","body-class":"list-group-flush p-0 rounded"}},[s("div",{staticClass:"list-group text-center"},[t.owner?s("div",{staticClass:"list-group-item rounded py-3"},[s("div",{staticClass:"d-flex justify-content-between align-items-center font-weight-light"},[s("span",[t._v("Expires in "+t._s(t.timeahead(t.stories[t.storyIndex].expires_at)))]),t._v(" "),s("span",[s("span",{staticClass:"btn btn-light btn-sm font-weight-bold"},[s("i",{staticClass:"fas fa-eye"}),t._v("\n\t\t\t\t\t\t\t\t"+t._s(t.stories[t.storyIndex].view_count)+"\n\t\t\t\t\t\t\t")])])])]):t._e(),t._v(" "),!t.owner&&t.stories[t.storyIndex]&&t.stories[t.storyIndex].can_react?s("div",{staticClass:"list-group-item rounded d-flex justify-content-between"},t._l(t.reactionEmoji,(function(e){return s("button",{staticClass:"btn btn-light rounded-pill py-1 px-2",staticStyle:{"font-size":"20px"},on:{click:function(s){return t.react(e)}}},[t._v("\n\t\t\t\t\t\t"+t._s(e)+"\n\t\t\t\t\t")])})),0):t._e(),t._v(" "),t.owner?s("div",{staticClass:"list-group-item rounded cursor-pointer",on:{click:t.fetchViewers}},[t._v("Viewers")]):t._e(),t._v(" "),t.owner?t._e():s("div",{staticClass:"list-group-item rounded cursor-pointer",on:{click:t.ctxMenuReport}},[t._v("Report")]),t._v(" "),t.owner?s("div",{staticClass:"list-group-item rounded cursor-pointer",on:{click:t.deleteStory}},[t._v("Delete")]):t._e(),t._v(" "),s("div",{staticClass:"list-group-item rounded cursor-pointer text-muted",on:{click:t.closeCtxMenu}},[t._v("Close")])])]),t._v(" "),s("b-modal",{ref:"viewersModal",attrs:{id:"viewers",title:"Viewers","header-class":"border-0","hide-footer":"",centered:"",rounded:"",scrollable:"",lazy:"",size:"sm","body-class":"list-group-flush p-0 rounded"}},[s("div",{staticClass:"list-group",staticStyle:{"max-height":"40vh"}},[t._l(t.viewers,(function(e,n){return s("div",{staticClass:"list-group-item"},[s("div",{staticClass:"media align-items-center"},[s("img",{staticClass:"rounded-circle border mr-2",attrs:{src:e.avatar,width:"32",height:"32"}}),t._v(" "),e.local?s("div",{staticClass:"media-body user-select-none"},[s("p",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(e.username))])]):s("div",{staticClass:"media-body user-select-none"},[s("p",{staticClass:"font-weight-bold mb-0"},[t._v(t._s(e.username))]),t._v(" "),s("p",{staticClass:"mb-0 small mt-n1 text-muted"},[t._v(t._s(e.acct.split("@")[1]))])])])])})),t._v(" "),0==t.viewers.length?s("div",{staticClass:"list-group-item text-center text-dark font-weight-light py-5"},[t._v("\n\t\t\t\t\tNo viewers yet\n\t\t\t\t")]):t._e(),t._v(" "),t.viewersHasMore?s("div",{staticClass:"list-group-item text-center border-bottom-0"},[s("button",{staticClass:"btn btn-light font-weight-bold border rounded-pill",on:{click:t.viewersLoadMore}},[t._v("Load More")])]):t._e(),t._v(" "),s("div",{staticClass:"list-group-item text-center rounded cursor-pointer text-muted",on:{click:t.closeViewersModal}},[t._v("Close")])],2)]),t._v(" "),s("b-modal",{ref:"ctxReport",attrs:{id:"ctx-report","hide-header":"","hide-footer":"",centered:"",rounded:"",size:"sm","body-class":"list-group-flush p-0 rounded"}},[s("p",{staticClass:"py-2 px-3 mb-0"}),s("div",{staticClass:"text-center font-weight-bold text-danger"},[t._v("Report")]),t._v(" "),s("div",{staticClass:"small text-center text-muted"},[t._v("Select one of the following options")]),t._v(" "),s("p"),t._v(" "),s("div",{staticClass:"list-group text-center"},[s("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.sendReport("spam")}}},[t._v("Spam")]),t._v(" "),s("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.sendReport("sensitive")}}},[t._v("Sensitive Content")]),t._v(" "),s("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.sendReport("abusive")}}},[t._v("Abusive or Harmful")]),t._v(" "),s("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.openCtxReportOtherMenu()}}},[t._v("Other")]),t._v(" "),s("div",{staticClass:"list-group-item rounded cursor-pointer text-lighter",on:{click:function(e){return t.ctxReportMenuGoBack()}}},[t._v("Cancel")])])]),t._v(" "),s("b-modal",{ref:"ctxReportOther",attrs:{id:"ctx-report-other","hide-header":"","hide-footer":"",centered:"",rounded:"",size:"sm","body-class":"list-group-flush p-0 rounded"}},[s("p",{staticClass:"py-2 px-3 mb-0"}),s("div",{staticClass:"text-center font-weight-bold text-danger"},[t._v("Report")]),t._v(" "),s("div",{staticClass:"small text-center text-muted"},[t._v("Select one of the following options")]),t._v(" "),s("p"),t._v(" "),s("div",{staticClass:"list-group text-center"},[s("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.sendReport("underage")}}},[t._v("Underage Account")]),t._v(" "),s("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.sendReport("copyright")}}},[t._v("Copyright Infringement")]),t._v(" "),s("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.sendReport("impersonation")}}},[t._v("Impersonation")]),t._v(" "),s("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.sendReport("scam")}}},[t._v("Scam or Fraud")]),t._v(" "),s("div",{staticClass:"list-group-item rounded cursor-pointer text-lighter",on:{click:function(e){return t.ctxReportOtherMenuGoBack()}}},[t._v("Cancel")])])])],1)])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"d-flex justify-content-center align-items-center rounded-pill shadow-lg",staticStyle:{width:"120px",height:"30px","font-size":"13px","background-color":"rgba(0, 0, 0, 0.6)"}},[e("span",{staticClass:"text-lighter"},[this._v("Reaction sent")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"d-flex justify-content-center align-items-center rounded-pill shadow-lg",staticStyle:{width:"120px",height:"30px","font-size":"13px","background-color":"rgba(0, 0, 0, 0.6)"}},[e("span",{staticClass:"text-lighter"},[this._v("Reply sent")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"card border-0 shadow-none d-flex justify-content-center",staticStyle:{background:"#000",height:"90vh"}},[e("div",{staticClass:"card-body d-flex justify-content-center align-items-center"},[e("div",{staticClass:"spinner-border text-lighter",attrs:{role:"status"}},[e("span",{staticClass:"sr-only"},[this._v("Loading...")])])])])}],!1,null,"1bff5ab6",null);e.default=a.exports},"aET+":function(t,e,s){var n,i,o={},r=(n=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=n.apply(this,arguments)),i}),a=function(t,e){return e?e.querySelector(t):document.querySelector(t)},l=function(t){var e={};return function(t,s){if("function"==typeof t)return t();if(void 0===e[t]){var n=a.call(this,t,s);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}}(),c=null,d=0,u=[],p=s("9tPo");function h(t,e){for(var s=0;s<t.length;s++){var n=t[s],i=o[n.id];if(i){i.refs++;for(var r=0;r<i.parts.length;r++)i.parts[r](n.parts[r]);for(;r<n.parts.length;r++)i.parts.push(y(n.parts[r],e))}else{var a=[];for(r=0;r<n.parts.length;r++)a.push(y(n.parts[r],e));o[n.id]={id:n.id,refs:1,parts:a}}}}function f(t,e){for(var s=[],n={},i=0;i<t.length;i++){var o=t[i],r=e.base?o[0]+e.base:o[0],a={css:o[1],media:o[2],sourceMap:o[3]};n[r]?n[r].parts.push(a):s.push(n[r]={id:r,parts:[a]})}return s}function v(t,e){var s=l(t.insertInto);if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var n=u[u.length-1];if("top"===t.insertAt)n?n.nextSibling?s.insertBefore(e,n.nextSibling):s.appendChild(e):s.insertBefore(e,s.firstChild),u.push(e);else if("bottom"===t.insertAt)s.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=l(t.insertAt.before,s);s.insertBefore(e,i)}}function g(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=u.indexOf(t);e>=0&&u.splice(e,1)}function m(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var n=function(){0;return s.nc}();n&&(t.attrs.nonce=n)}return b(e,t.attrs),v(t,e),e}function b(t,e){Object.keys(e).forEach((function(s){t.setAttribute(s,e[s])}))}function y(t,e){var s,n,i,o;if(e.transform&&t.css){if(!(o="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=o}if(e.singleton){var r=d++;s=c||(c=m(e)),n=_.bind(null,s,r,!1),i=_.bind(null,s,r,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(s=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",b(e,t.attrs),v(t,e),e}(e),n=k.bind(null,s,e),i=function(){g(s),s.href&&URL.revokeObjectURL(s.href)}):(s=m(e),n=C.bind(null,s),i=function(){g(s)});return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=r()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var s=f(t,e);return h(s,e),function(t){for(var n=[],i=0;i<s.length;i++){var r=s[i];(a=o[r.id]).refs--,n.push(a)}t&&h(f(t,e),e);for(i=0;i<n.length;i++){var a;if(0===(a=n[i]).refs){for(var l=0;l<a.parts.length;l++)a.parts[l]();delete o[a.id]}}}};var w,x=(w=[],function(t,e){return w[t]=e,w.filter(Boolean).join("\n")});function _(t,e,s,n){var i=s?"":n.css;if(t.styleSheet)t.styleSheet.cssText=x(e,i);else{var o=document.createTextNode(i),r=t.childNodes;r[e]&&t.removeChild(r[e]),r.length?t.insertBefore(o,r[e]):t.appendChild(o)}}function C(t,e){var s=e.css,n=e.media;if(n&&t.setAttribute("media",n),t.styleSheet)t.styleSheet.cssText=s;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(s))}}function k(t,e,s){var n=s.css,i=s.sourceMap,o=void 0===e.convertToAbsoluteUrls&&i;(e.convertToAbsoluteUrls||o)&&(n=p(n)),i&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var r=new Blob([n],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(r),a&&URL.revokeObjectURL(a)}}},[[22,0]]]);