akkoma/priv/static/packs/containers/media_container.js

3 lines
706 KiB
JavaScript
Raw Normal View History

2020-02-29 05:41:13 +00:00
/*! For license information please see media_container.js.LICENSE */
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{10:function(e,t,a){"use strict";a.d(t,"b",(function(){return s}));var n=a(61),r=a.n(n),i=a(195),o=a.n(i),s=function(e){var t=e.headers.link;return t?o.a.parse(t):{refs:[]}};t.a=function(e){return r.a.create({headers:e?{Authorization:"Bearer "+e().getIn(["meta","access_token"],"")}:{},transformResponse:[function(e){try{return JSON.parse(e)}catch(t){return e}}]})}},104:function(e,t,a){"use strict";a.r(t),a.d(t,"timeAgoString",(function(){return _})),a.d(t,"default",(function(){return v}));var n,r,i,o=a(0),s=a(2),l=a(7),f=a(1),c=a(8),u=a(3),d=a.n(u),h=a(6),p=Object(h.f)({just_now:{id:"relative_time.just_now",defaultMessage:"now"},seconds:{id:"relative_time.seconds",defaultMessage:"{number}s"},minutes:{id:"relative_time.minutes",defaultMessage:"{number}m"},hours:{id:"relative_time.hours",defaultMessage:"{number}h"},days:{id:"relative_time.days",defaultMessage:"{number}d"},moments_remaining:{id:"time_remaining.moments",defaultMessage:"Moments remaining"},seconds_remaining:{id:"time_remaining.seconds",defaultMessage:"{number, plural, one {# second} other {# seconds}} left"},minutes_remaining:{id:"time_remaining.minutes",defaultMessage:"{number, plural, one {# minute} other {# minutes}} left"},hours_remaining:{id:"time_remaining.hours",defaultMessage:"{number, plural, one {# hour} other {# hours}} left"},days_remaining:{id:"time_remaining.days",defaultMessage:"{number, plural, one {# day} other {# days}} left"}}),m={hour12:!1,year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"},g={month:"short",day:"numeric"},b=864e5,_=function(e,t,a,n){var r=a-t.getTime();return r<1e4?e.formatMessage(p.just_now):r<7*b?r<6e4?e.formatMessage(p.seconds,{number:Math.floor(r/1e3)}):r<36e5?e.formatMessage(p.minutes,{number:Math.floor(r/6e4)}):r<b?e.formatMessage(p.hours,{number:Math.floor(r/36e5)}):e.formatMessage(p.days,{number:Math.floor(r/b)}):t.getFullYear()===n?e.formatDate(t,g):e.formatDate(t,Object(c.default)({},g,{year:"numeric"}))},v=Object(h.g)((i=r=function(e){function t(){for(var t,a=arguments.length,n=new Array(a),r=0;r<a;r++)n[r]=arguments[r];return t=e.call.apply(e,[this].concat(n))||this,Object(f.a)(Object(s.a)(t),"state",{now:t.props.intl.now()}),t}Object(l.a)(t,e);var a=t.prototype;return a.shouldComponentUpdate=function(e,t){return this.props.timestamp!==e.timestamp||this.props.intl.locale!==e.intl.locale||this.state.now!==t.now},a.componentWillReceiveProps=function(e){this.props.timestamp!==e.timestamp&&this.setState({now:this.props.intl.now()})},a.componentDidMount=function(){this._scheduleNextUpdate(this.props,this.state)},a.componentWillUpdate=function(e,t){this._scheduleNextUpdate(e,t)},a.componentWillUnmount=function(){clearTimeout(this._timer)},a._scheduleNextUpdate=function(e,t){var a=this;clearTimeout(this._timer);var n=e.timestamp,r=new Date(n).getTime()-t.now,i=function(e){switch(e){case"second":return 1e3;case"minute":return 6e4;case"hour":return 36e5;case"day":return b;default:return 2147483647}}(function(e){var t=Math.abs(e);return t<6e4?"second":t<36e5?"minute":t<b?"hour":"day"}(r)),o=Math.abs(r%i),s=r<0?Math.max(1e4,i-o):Math.max(1e4,o);this._timer=setTimeout((function(){a.setState({now:a.props.intl.now()})}),s)},a.render=function(){var e=this.props,t=e.timestamp,a=e.intl,n=e.year,r=e.futureDate,i=new Date(t),s=r?function(e,t,a){var n=t.getTime()-a;return n<1e4?e.formatMessage(p.moments_remaining):n<6e4?e.formatMessage(p.seconds_remaining,{number:Math.floor(n/1e3)}):n<36e5?e.formatMessage(p.minutes_remaining,{number:Math.floor(n/6e4)}):n<b?e.formatMessage(p.hours_remaining,{number:Math.floor(n/36e5)}):e.formatMessage(p.days_remaining,{number:Math.floor(n/b)})}(a,i,this.state.now):_(a,i,this.state.now,n);return Object(o.a)("time",{dateTime:t,title:a.formatDate(i,m)},void 0,s)},t}(d.a.Component),Object(f.a)(r,"defaultProps",{year:(new Date).getFullYear()}),n=i))||n},106:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(
2018-08-12 13:29:30 +00:00
//# sourceMappingURL=media_container.js.map