2 lines
No EOL
179 KiB
JavaScript
2 lines
No EOL
179 KiB
JavaScript
module.exports=function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=115)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("react-redux")},function(e,t){e.exports=require("winston")},function(e,t,n){"use strict";function r(){var e=this;this.analytics={googleId:"default"},this.assetDefaults={description:"An asset published on Spee.ch",thumbnail:"https://spee.ch/assets/img/video_thumb_default.png",title:"Spee.ch"},this.auth={sessionKey:"default"},this.componentsConfig={components:{},containers:{},pages:{}},this.details={description:"Open-source, decentralized image and video sharing.",host:"default",port:3e3,title:"Spee.ch",twitter:"@spee_ch"},this.publishing={additionalClaimAddresses:[],disabled:!1,disabledMessage:"Please check back soon.",primaryClaimAddress:"default",thumbnailChannel:"default",thumbnailChannelId:"default",uploadDirectory:"/home/lbry/Uploads"},this.configure=function(t){if(!t)return console.log("No site config received.");var n=t.analytics,r=t.assetDefaults,a=t.auth,l=t.componentsConfig,o=t.details,i=t.publishing;e.analytics=n,e.assetDefaults=r,e.auth=a,e.details=o,e.publishing=i,e.componentsConfig=l}}e.exports=new r},function(e,t){e.exports=require("react-router-dom")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(64),l=n(6),o=n(65),i=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(e){var t=e.channel,n=e.site;return{channelName:t.loggedInChannel.name,channelShortId:t.loggedInChannel.shortId,channelLongId:t.loggedInChannel.longId,siteDescription:n.description}},s=function(e){return{onChannelLogin:function(t,n,r){e((0,a.updateLoggedInChannel)(t,n,r)),e((0,l.updateSelectedChannel)(t))},onChannelLogout:function(){e((0,a.updateLoggedInChannel)(null,null,null))}}};t.default=(0,r.connect)(u,s)(i.default)},function(e,t,n){"use strict";function r(e){return{type:m.FILE_SELECTED,data:e}}function a(){return{type:m.FILE_CLEAR}}function l(e,t){return{type:m.METADATA_UPDATE,data:{name:e,value:t}}}function o(e){return{type:m.CLAIM_UPDATE,data:e}}function i(e){return{type:m.SET_PUBLISH_IN_CHANNEL,channel:e}}function u(e,t){return{type:m.PUBLISH_STATUS_UPDATE,data:{status:e,message:t}}}function s(e,t){return{type:m.ERROR_UPDATE,data:{name:e,value:t}}}function c(e){return{type:m.SELECTED_CHANNEL_UPDATE,data:e}}function d(e){return{type:m.TOGGLE_METADATA_INPUTS,data:e}}function f(e){return{type:m.THUMBNAIL_NEW,data:e}}function p(e){return{type:m.PUBLISH_START,data:{history:e}}}Object.defineProperty(t,"__esModule",{value:!0}),t.selectFile=r,t.clearFile=a,t.updateMetadata=l,t.updateClaim=o,t.setPublishInChannel=i,t.updatePublishStatus=u,t.updateError=s,t.updateSelectedChannel=c,t.toggleMetadataInputs=d,t.onNewThumbnail=f,t.startPublish=p;var h=n(104),m=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(h)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(66),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){var t=e.site;return{defaultDescription:t.defaultDescription,defaultThumbnail:t.defaultThumbnail,siteDescription:t.description,siteHost:t.host,siteTitle:t.title,siteTwitter:t.twitter}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";function r(e){return 204===e.status||205===e.status?null:e.json()}function a(e,t){if(e.status>=200&&e.status<300)return t;var n=new Error(t.message);throw n.response=e,n}function l(e,t){return fetch(e,t).then(function(e){return Promise.all([e,r(e)])}).then(function(e){var t=o(e,2);return a(t[0],t[1])})}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.default=l,n(152)},function(e,t,n){"use strict";var r=n(95),a=n(2);console.log("exporting sequelize models");var l=n(92),o=l.database,i=l.username,u=l.password,s={},c=new r(o,i,u,{host:"localhost",dialect:"mysql",dialectOptions:{decimalNumbers:!0},logging:!1,pool:{max:5,min:0,idle:1e4,acquire:1e4}});c.authenticate().then(function(){a.info("Sequelize has established mysql connection successfully.")}).catch(function(e){a.error("Sequelize was unable to connect to the database:",e)});var d=n(132),f=n(133),p=n(134),h=n(135),m=n(136),b=n(137);s.Certificate=c.import("Certificate",d),s.Channel=c.import("Channel",f),s.Claim=c.import("Claim",p),s.File=c.import("File",h),s.Request=c.import("Request",m),s.User=c.import("User",b),Object.keys(s).forEach(function(e){s[e].associate&&(a.info("Associating model:",e),s[e].associate(s))}),s.sequelize=c,s.Sequelize=r,s.upsert=function(e,t,n,r){return e.findOne({where:n}).then(function(n){return n?(a.debug("updating record in db."+r),n.update(t)):(a.debug("creating record in db."+r),e.create(t))}).catch(function(e){throw a.error(r+".upsert error",e),e})},e.exports=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(14),d=r(c),f=n(24),p=r(f),h=n(25),m=r(h),b=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={bars:[],index:0,incrementer:1},n.createBars=n.createBars.bind(n),n.startProgressBar=n.startProgressBar.bind(n),n.updateProgressBar=n.updateProgressBar.bind(n),n.stopProgressBar=n.stopProgressBar.bind(n),n}return o(t,e),i(t,[{key:"componentDidMount",value:function(){this.createBars(),this.startProgressBar()}},{key:"componentWillUnmount",value:function(){this.stopProgressBar()}},{key:"createBars",value:function(){for(var e=[],t=0;t<=this.props.size;t++)e.push({isActive:!1});this.setState({bars:e})}},{key:"startProgressBar",value:function(){this.updateInterval=setInterval(this.updateProgressBar.bind(this),300)}},{key:"updateProgressBar",value:function(){var e=this.state.index,t=this.state.incrementer,n=this.state.bars;(e<0||e>this.props.size)&&(t*=-1,e+=t),n[e].isActive=t>0,e+=t,this.setState({bars:n,incrementer:t,index:e})}},{key:"stopProgressBar",value:function(){clearInterval(this.updateInterval)}},{key:"render",value:function(){return s.default.createElement("div",null,this.state.bars.map(function(e,t){return e.isActive?s.default.createElement(p.default,{key:t}):s.default.createElement(m.default,{key:t})}))}}]),t}(s.default.Component);b.propTypes={size:d.default.number.isRequired},t.default=b},function(e,t,n){"use strict";function r(e){return{type:v.HANDLE_SHOW_URI,data:e}}function a(e){return{type:v.REQUEST_ERROR,data:e}}function l(e,t){var n=g.CHANNEL,r="cr#"+e+"#"+t;return{type:v.CHANNEL_REQUEST_NEW,data:{requestType:n,requestId:r,channelName:e,channelId:t}}}function o(e,t,n,r,a){var l=a?g.ASSET_LITE:g.ASSET_DETAILS,o="ar#"+e+"#"+t+"#"+n+"#"+r;return{type:v.ASSET_REQUEST_NEW,data:{requestType:l,requestId:o,name:e,modifier:{id:t,channel:{name:n,id:r}}}}}function i(e,t){return{type:v.REQUEST_UPDATE,data:{requestType:e,requestId:t}}}function u(e,t,n){return{type:v.REQUEST_LIST_ADD,data:{id:e,error:t,key:n}}}function s(e,t,n,r,a,l){return{type:v.ASSET_ADD,data:{id:e,error:t,name:n,claimId:r,shortId:a,claimData:l}}}function c(e,t,n,r,a){return{type:v.CHANNEL_ADD,data:{id:e,name:t,shortId:n,longId:r,claimsData:a}}}function d(e,t,n,r){return{type:v.CHANNEL_CLAIMS_UPDATE_ASYNC,data:{channelKey:e,name:t,longId:n,page:r}}}function f(e,t){return{type:v.CHANNEL_CLAIMS_UPDATE_SUCCESS,data:{channelListId:e,claimsData:t}}}function p(e,t){return{type:v.FILE_REQUESTED,data:{name:e,claimId:t}}}function h(e){return{type:v.FILE_AVAILABILITY_UPDATE,data:e}}function m(e){return{type:v.DISPLAY_ASSET_ERROR,data:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.onHandleShowPageUri=r,t.onRequestError=a,t.onNewChannelRequest=l,t.onNewAssetRequest=o,t.onRequestUpdate=i,t.addRequestToRequestList=u,t.addAssetToAssetList=s,t.addNewChannelToChannelList=c,t.onUpdateChannelClaims=d,t.updateChannelClaims=f,t.fileRequested=p,t.updateFileAvailability=h,t.updateDisplayAssetError=m;var b=n(19),v=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(b),g=n(112)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(14),d=r(c),f=n(5),p=r(f),h=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props.error;return s.default.createElement("div",null,s.default.createElement(p.default,null),s.default.createElement("div",{className:"row row--padded"},s.default.createElement("p",null,e)))}}]),t}(s.default.Component);h.propTypes={error:d.default.string.isRequired},t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(151),d=r(c),f=n(4),p=n(3),h=p.analytics.googleId;d.default.initialize(h);var m=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"componentDidMount",value:function(){this.sendPageView(this.props.history.location),this.props.history.listen(this.sendPageView)}},{key:"sendPageView",value:function(e){d.default.set({page:e.pathname}),d.default.pageview(e.pathname)}},{key:"render",value:function(){return this.props.children}}]),t}(s.default.Component);t.default=(0,f.withRouter)(m)},function(e,t){e.exports=require("prop-types")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(64),l=n(68),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=n(6),u=function(e){return{onChannelLogin:function(t,n,r){e((0,a.updateLoggedInChannel)(t,n,r)),e((0,i.updateSelectedChannel)(t))}}};t.default=(0,r.connect)(null,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(64),l=n(69),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=n(6),u=function(e){return{onChannelLogin:function(t,n,r){e((0,a.updateLoggedInChannel)(t,n,r)),e((0,i.updateSelectedChannel)(t))}}};t.default=(0,r.connect)(null,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(72),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=n(11),i=n(28),u=function(e){var t=e.show;return{error:t.displayAsset.error,status:t.displayAsset.status,asset:(0,i.selectAsset)(t)}},s=function(e){return{onFileRequest:function(t,n){e((0,o.fileRequested)(t,n))}}};t.default=(0,r.connect)(u,s)(l.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(6),l=n(82),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){var t=e.publish;return{file:t.file,thumbnail:t.thumbnail,fileError:t.error.file}},u=function(e){return{selectFile:function(t){e((0,a.selectFile)(t))},setFileError:function(t){e((0,a.clearFile)()),e((0,a.updateError)("file",t))}}};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.HANDLE_SHOW_URI="HANDLE_SHOW_URI",t.REQUEST_ERROR="REQUEST_ERROR",t.REQUEST_UPDATE="REQUEST_UPDATE",t.ASSET_REQUEST_NEW="ASSET_REQUEST_NEW",t.CHANNEL_REQUEST_NEW="CHANNEL_REQUEST_NEW",t.REQUEST_LIST_ADD="REQUEST_LIST_ADD",t.ASSET_ADD="ASSET_ADD",t.CHANNEL_ADD="CHANNEL_ADD",t.CHANNEL_CLAIMS_UPDATE_ASYNC="CHANNEL_CLAIMS_UPDATE_ASYNC",t.CHANNEL_CLAIMS_UPDATE_SUCCESS="CHANNEL_CLAIMS_UPDATE_SUCCESS",t.FILE_REQUESTED="FILE_REQUESTED",t.FILE_AVAILABILITY_UPDATE="FILE_AVAILABILITY_UPDATE",t.DISPLAY_ASSET_ERROR="DISPLAY_ASSET_ERROR"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(5),d=r(c),f=n(7),p=r(f),h=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){return s.default.createElement("div",null,s.default.createElement(p.default,{pageTitle:"About",pageUri:"about"}),s.default.createElement(d.default,null),s.default.createElement("div",{className:"row row--padded"},s.default.createElement("div",{className:"column column--5 column--med-10 align-content-top"},s.default.createElement("div",{className:"column column--8 column--med-10"},s.default.createElement("p",{className:"pull-quote"},"Spee.ch is an open-source project. Please contribute to the existing site, or fork it and make your own."),s.default.createElement("p",null,s.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://twitter.com/spee_ch"},"TWITTER")),s.default.createElement("p",null,s.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://github.com/lbryio/spee.ch"},"GITHUB")),s.default.createElement("p",null,s.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://discord.gg/YjYbwhS"},"DISCORD CHANNEL")),s.default.createElement("p",null,s.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://github.com/lbryio/spee.ch/blob/master/README.md"},"DOCUMENTATION")))),s.default.createElement("div",{className:"column column--5 column--med-10 align-content-top"},s.default.createElement("div",{className:"column column--8 column--med-10"},s.default.createElement("p",null,"Spee.ch is a media-hosting site that reads from and publishes content to the ",s.default.createElement("a",{className:"link--primary",href:"https://lbry.io"},"LBRY")," blockchain."),s.default.createElement("p",null,"Spee.ch is a hosting service, but with the added benefit that it stores your content on a decentralized network of computers -- the ",s.default.createElement("a",{className:"link--primary",href:"https://lbry.io/get"},"LBRY")," network. This means that your images are stored in multiple locations without a single point of failure."),s.default.createElement("h3",null,"Contribute"),s.default.createElement("p",null,"If you have an idea for your own spee.ch-like site on top of LBRY, fork our ",s.default.createElement("a",{className:"link--primary",href:"https://github.com/lbryio/spee.ch"},"github repo")," and go to town!"),s.default.createElement("p",null,"If you want to improve spee.ch, join our ",s.default.createElement("a",{className:"link--primary",href:"https://discord.gg/YjYbwhS"},"discord channel")," or solve one of our ",s.default.createElement("a",{className:"link--primary",href:"https://github.com/lbryio/spee.ch/issues"},"github issues"),".")))))}}]),t}(s.default.Component);t.default=h},function(e,t,n){"use strict";function r(){return l.default.createElement("svg",{version:"1.1",id:"Layer_1",x:"0px",y:"0px",height:"24px",viewBox:"0 0 80 31",enableBackground:"new 0 0 80 31",className:"nav-bar-logo"},l.default.createElement(o.Link,{to:"/"},l.default.createElement("title",null,"Logo"),l.default.createElement("desc",null,"Spee.ch logo"),l.default.createElement("g",{id:"About"},l.default.createElement("g",{id:"Publish-Form-V2-_x28_filled_x29_",transform:"translate(-42.000000, -23.000000)"},l.default.createElement("g",{id:"Group-17",transform:"translate(42.000000, 22.000000)"},l.default.createElement("text",{transform:"matrix(1 0 0 1 0 20)",fontSize:"25",fontFamily:"Roboto"},"Spee<h"),l.default.createElement("g",{id:"Group-16",transform:"translate(0.000000, 30.000000)"},l.default.createElement("path",{id:"Line-8",fill:"none",stroke:"#09F911",strokeWidth:"1",strokeLinecap:"square",d:"M0.5,1.5h15"}),l.default.createElement("path",{id:"Line-8-Copy",fill:"none",stroke:"#029D74",strokeWidth:"1",strokeLinecap:"square",d:"M16.5,1.5h15"}),l.default.createElement("path",{id:"Line-8-Copy-2",fill:"none",stroke:"#E35BD8",strokeWidth:"1",strokeLinecap:"square",d:"M32.5,1.5h15"}),l.default.createElement("path",{id:"Line-8-Copy-3",fill:"none",stroke:"#4156C5",strokeWidth:"1",strokeLinecap:"square",d:"M48.5,1.5h15"}),l.default.createElement("path",{id:"Line-8-Copy-4",fill:"none",stroke:"#635688",strokeWidth:"1",strokeLinecap:"square",d:"M64.5,1.5h15"})))))))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=n(4);t.default=r},function(e,t,n){"use strict";function r(e){var t=e.channelName,n=e.handleSelection,r=e.defaultSelection,a=e.VIEW,o=e.LOGOUT;return l.default.createElement("select",{type:"text",id:"nav-bar-channel-select",className:"select select--arrow link--nav",onChange:n,value:r},l.default.createElement("option",{id:"nav-bar-channel-select-channel-option"},t),l.default.createElement("option",{value:a},"View"),l.default.createElement("option",{value:o},"Logout"))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),l=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(67),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){return{loggedInChannelName:e.channel.loggedInChannel.name}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),l=function(){return a.default.createElement("span",{className:"progress-bar progress-bar--active"},"| ")};t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),l=function(){return a.default.createElement("span",{className:"progress-bar progress-bar--inactive"},"| ")};t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(11),l=n(70),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){var t=e.show;return{error:t.request.error,requestType:t.request.type}},u={onHandleShowPageUri:a.onHandleShowPageUri};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(71),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){var t=e.show,n=t.request.id,r=void 0,a=t.requestList[n]||null,l=t.assetList;if(a&&l){r=l[a.key]||null}return{asset:r}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.selectAsset=function(e){var t=e.requestList[e.request.id],n=t.key;return e.assetList[n]},t.selectShowState=function(e){return e.show}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(73),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){var t=e.show,n=t.request.id,r=void 0,a=t.requestList[n]||null,l=t.assetList;if(a&&l){r=l[a.key]||null}return{asset:r}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(74),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=n(28),i=function(e){var t=e.show;return{title:(0,o.selectAsset)(t).claimData.title}};t.default=(0,r.connect)(i,null)(l.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(75),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=n(28),i=function(e){var t=e.show;return{asset:(0,o.selectAsset)(t)}};t.default=(0,r.connect)(i,null)(l.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(76),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){var t=e.show,n=t.request.id,r=t.requestList[n]||null,a=void 0;if(r){var l=r.key;a=t.channelList[l]||null}return{channel:a}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(11),l=n(77),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){var t=e.show,n=t.requestList[t.request.id],r=n.key;return{channelKey:r,channel:t.channelList[r]||null}},u={onUpdateChannelClaims:a.onUpdateChannelClaims};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(78),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){return{defaultThumbnail:e.site.defaults.defaultThumbnail}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(79),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){var t=e.site;return{host:t.host,title:t.title}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),d=r(c),f=n(14),p=r(f),h=function(e){function t(e){l(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._handleChange=n._handleChange.bind(n),n}return i(t,e),s(t,[{key:"componentDidMount",value:function(){this.adjustTextarea({})}},{key:"_handleChange",value:function(e){var t=this.props.onChange;t&&t(e),this.adjustTextarea(e)}},{key:"adjustTextarea",value:function(e){var t=e.target,n=void 0===t?this.el:t;n.style.height=0,n.style.height=n.scrollHeight+"px"}},{key:"render",value:function(){var e=this,t=a(this.props,[]);return d.default.createElement("textarea",u({},t,{ref:function(t){return e.el=t},onChange:this._handleChange}))}}]),t}(c.Component);h.propTypes={onChange:p.default.func},t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(14),d=r(c),f=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={imgSource:"",defaultThumbnail:"/assets/img/video_thumb_default.png"},n}return o(t,e),i(t,[{key:"componentDidMount",value:function(){this.setPreviewImageSource(this.props.file)}},{key:"componentWillReceiveProps",value:function(e){e.file!==this.props.file&&this.setPreviewImageSource(e.file),e.thumbnail!==this.props.thumbnail&&(e.thumbnail?this.setPreviewImageSourceFromFile(e.thumbnail):this.setState({imgSource:this.state.defaultThumbnail}))}},{key:"setPreviewImageSourceFromFile",value:function(e){var t=this,n=new FileReader;n.readAsDataURL(e),n.onloadend=function(){t.setState({imgSource:n.result})}}},{key:"setPreviewImageSource",value:function(e){"video/mp4"!==e.type?this.setPreviewImageSourceFromFile(e):(this.props.thumbnail&&this.setPreviewImageSourceFromFile(this.props.thumbnail),this.setState({imgSource:this.state.defaultThumbnail}))}},{key:"render",value:function(){return s.default.createElement("img",{id:"dropzone-preview",src:this.state.imgSource,className:this.props.dimPreview?"dim":"",alt:"publish preview"})}}]),t}(s.default.Component);f.propTypes={dimPreview:d.default.bool.isRequired,file:d.default.object.isRequired,thumbnail:d.default.object},t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=e.publishInChannel,n=e.selectedChannel,r=e.loggedInChannelName,a=e.loggedInChannelShortId;return t?n===r?o.default.createElement("span",{id:"url-channel",className:"url-text--secondary"},r,":",a," /"):o.default.createElement("span",{id:"url-channel-placeholder",className:"url-text--secondary tooltip"},"@channel",o.default.createElement("span",{className:"tooltip-text"},"Select a channel below")," /"):o.default.createElement("span",{id:"url-no-channel-placeholder",className:"url-text--secondary tooltip"},"xyz",o.default.createElement("span",{className:"tooltip-text"},"This will be a random id")," /")}Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),o=r(l),i=n(14),u=r(i);a.propTypes={publishInChannel:u.default.bool.isRequired,loggedInChannelName:u.default.string,loggedInChannelShortId:u.default.string},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(6),l=n(81),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){var t=e.channel,n=e.publish;return{loggedInChannelName:t.loggedInChannel.name,publishInChannel:n.publishInChannel,selectedChannel:n.selectedChannel,channelError:n.error.channel}},u=function(e){return{onPublishInChannelChange:function(t){e((0,a.updateError)("channel",null)),e((0,a.setPublishInChannel)(t))},onChannelSelect:function(t){e((0,a.updateError)("channel",null)),e((0,a.updateSelectedChannel)(t))}}};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(6),l=n(83),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){e.channel;return{file:e.publish.file}},u={clearFile:a.clearFile,startPublish:a.startPublish};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(6),l=n(84),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){return{title:e.publish.metadata.title}},u=function(e){return{onMetadataChange:function(t,n){e((0,a.updateMetadata)(t,n))}}};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),a=n(1),l=n(85),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){var t=e.channel,n=e.publish;return{loggedInChannelName:t.loggedInChannel.name,loggedInChannelShortId:t.loggedInChannel.shortId,fileName:n.file.name,publishInChannel:n.publishInChannel,selectedChannel:n.selectedChannel,claim:n.claim,urlError:n.error.url}},u=function(e){return{onClaimChange:function(t){e((0,r.updateClaim)(t)),e((0,r.updateError)("publishSubmit",null))},onUrlError:function(t){e((0,r.updateError)("url",t))}}};t.default=(0,a.connect)(i,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(6),l=n(86),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){return{file:e.publish.file}},u={onNewThumbnail:a.onNewThumbnail};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(6),l=n(87),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){var t=e.publish;return{showMetadataInputs:t.showMetadataInputs,description:t.metadata.description,license:t.metadata.license,nsfw:t.metadata.nsfw}},u=function(e){return{onMetadataChange:function(t,n){e((0,a.updateMetadata)(t,n))},onToggleMetadataInputs:function(t){e((0,a.toggleMetadataInputs)(t))}}};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(88),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){return{message:e.publish.disabledMessage}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(6),l=n(89),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){var t=e.publish;return{status:t.status.status,message:t.status.message}},u={clearFile:a.clearFile};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(90),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){var t=e.publish;return{disabled:t.disabled,file:t.file,status:t.status.status}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t){e.exports=require("react-helmet")},function(e,t){e.exports=require("redux-saga/effects")},function(e,t,n){"use strict";var r=n(51),a=n(80),l=a.getSubDirectoryNames,o=r.resolve(__dirname,"client/components/"),i={};l(o).forEach(function(e){i[e]=n(168)("./"+e).default}),e.exports=i},function(e,t){e.exports=require("path")},function(e,t,n){"use strict";var r=n(51),a=n(80),l=a.getSubDirectoryNames,o=r.resolve(__dirname,"client/containers/"),i={};l(o).forEach(function(e){i[e]=n(169)("./"+e).default}),e.exports=i},function(e,t,n){"use strict";var r=n(51),a=n(80),l=a.getSubDirectoryNames,o=r.resolve(__dirname,"client/pages/"),i={};l(o).forEach(function(e){i[e]=n(171)("./"+e).default}),e.exports=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(7),d=r(c),f=n(5),p=r(f),h=n(47),m=r(h),b=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){return s.default.createElement("div",{className:"row row--tall flex-container--column"},s.default.createElement(d.default,null),s.default.createElement(p.default,null),s.default.createElement("div",{className:"row row--tall row--padded flex-container--column"},s.default.createElement(m.default,null)))}}]),t}(s.default.Component);t.default=b},function(e,t,n){"use strict";var r=n(129),a=n(2),l=n(130),o=l.api,i=o.apiHost,u=o.apiPort,s="http://"+i+":"+u,c=n(56),d=c.chooseGaLbrynetPublishLabel,f=c.sendGATimingEvent,p=function(e,t,n){var r=e.data;if(a.debug("lbry api data:",r),r.result)return r.result.error?(a.debug("Lbrynet api error:",r.result.error),void n(new Error(r.result.error))):void t(r.result);n(JSON.stringify(r))};e.exports={publishClaim:function(e){a.debug('lbryApi >> Publishing claim to "'+e.name+'"');var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"publish",params:e}).then(function(r){f("lbrynet","publish",d(e),t,Date.now()),p(r,n,a)}).catch(function(e){a(e)})})},getClaim:function(e){a.debug('lbryApi >> Getting Claim for "'+e+'"');var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"get",params:{uri:e,timeout:20}}).then(function(e){f("lbrynet","getClaim","GET",t,Date.now()),p(e,n,a)}).catch(function(e){a(e)})})},getClaimList:function(e){a.debug('lbryApi >> Getting claim_list for "'+e+'"');var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"claim_list",params:{name:e}}).then(function(e){f("lbrynet","getClaimList","CLAIM_LIST",t,Date.now()),p(e,n,a)}).catch(function(e){a(e)})})},resolveUri:function(e){a.debug('lbryApi >> Resolving URI for "'+e+'"');var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"resolve",params:{uri:e}}).then(function(r){var l=r.data;f("lbrynet","resolveUri","RESOLVE",t,Date.now()),l.result[e].error?a(l.result[e].error):n(l.result[e])}).catch(function(e){a(e)})})},getDownloadDirectory:function(){a.debug("lbryApi >> Retrieving the download directory path from lbry daemon...");var e=Date.now();return new Promise(function(t,n){r.post(s,{method:"settings_get"}).then(function(n){var r=n.data;if(f("lbrynet","getDownloadDirectory","SETTINGS_GET",e,Date.now()),!r.result)return new Error("Successfully connected to lbry daemon, but unable to retrieve the download directory.");t(r.result.download_directory)}).catch(function(e){a.error("Lbrynet Error:",e),t("/home/lbry/Downloads/")})})},createChannel:function(e){a.debug("lbryApi >> Creating channel for "+e+"...");var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"channel_new",params:{channel_name:e,amount:.1}}).then(function(e){f("lbrynet","createChannel","CHANNEL_NEW",t,Date.now()),p(e,n,a)}).catch(function(e){a(e)})})}}},function(e,t,n){"use strict";function r(e,t,n){return{eventCategory:"client requests",eventAction:"serve request",eventLabel:n,ipOverride:t,userAgentOverride:e["user-agent"]}}function a(e,t,n,r,a){return{userTimingCategory:e,userTimingVariableName:t,userTimingTime:a-r,userTimingLabel:n}}function l(e,t){var n=e.replace(/\./g,"-");u(c,n,{strictCidFormat:!1,https:!0}).event(t,function(e){e&&i.error("Google Analytics Event Error >>",e)})}function o(e,t){u(c,e,{strictCidFormat:!1,https:!0}).timing(t,function(e){e&&i.error("Google Analytics Event Error >>",e),i.debug("Timing event successfully sent to google analytics")})}var i=n(2),u=n(131),s=n(3),c=s.analytics.googleId,d=s.details.title;e.exports={sendGAServeEvent:function(e,t,n){l(t,r(e,t,n))},sendGATimingEvent:function(e,t,n,r,l){var i=a(e,t,n,r,l);o(d,i)},chooseGaLbrynetPublishLabel:function(e){var t=e.channel_name,n=e.channel_id;return t||n?"PUBLISH_IN_CHANNEL_CLAIM":"PUBLISH_ANONYMOUS_CLAIM"}}},function(e,t){e.exports=require("redux")},function(e,t,n){"use strict";function r(e,t){var n=t.shift(),a=e[n];return t.length>=1?r(a,t):a}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=n(3),o=l.componentsConfig;t.dynamicImport=function(e){if(!e)throw new Error("no file path provided to dynamicImport()");if("string"!=typeof e)throw console.log("dynamicImport > filePath:",e),console.log("dynamicImport > filePath type:",void 0===e?"undefined":a(e)),new Error("file path provided to dynamicImport() must be a string");if(!o)return console.log("no componentsConfig found in siteConfig.js"),n(109)(""+e);var t=e.split("/").filter(function(e){return e.replace(/\s/g,"").length}),l=r(o,t);return l||n(109)(""+e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){return t+"/"+e},a=function(e,t){var n=void 0,r=void 0,a=void 0,l=void 0;if(e.claimData){var o=e.claimData;n=o.channelName,r=o.certificateId,a=o.name,l=o.claimId}return n?t+"/"+n+":"+r+"/"+a:t+"/"+l+"/"+a},l=function(e,t){return t+"/"+e.name+":"+e.longId};t.createCanonicalLink=function(e,t,n,o){return e?a(e,o):t?l(t,o):r(n,o)}},function(e,t,n){"use strict";e.exports={validateFile:function(e){if(!e)throw new Error("no file provided");if(/'/.test(e.name))throw new Error("apostrophes are not allowed in the file name");switch(e.type){case"image/jpeg":case"image/jpg":case"image/png":if(e.size>1e7)throw new Error("Sorry, images are limited to 10 megabytes.");break;case"image/gif":if(e.size>5e7)throw new Error("Sorry, GIFs are limited to 50 megabytes.");break;case"video/mp4":if(e.size>5e7)throw new Error("Sorry, videos are limited to 50 megabytes.");break;default:throw new Error(e.type+" is not a supported file type. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.")}}}},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.exports={REGEXP_INVALID_CLAIM:/[^A-Za-z0-9-]/g,REGEXP_INVALID_CHANNEL:/[^A-Za-z0-9-@]/g,REGEXP_ADDRESS:/^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/,CHANNEL_CHAR:"@",parseIdentifier:function(t){var n=new RegExp("([^:$#/]*)([:$#]?)([^/]*)"),a=n.exec(t).map(function(e){return e||null}),l=r(a,4),o=(l[0],l[1]),i=l[2],u=l[3];if(!o)throw new Error('Check your URL. No channel name provided before "'+i+'"');var s=o.startsWith(e.exports.CHANNEL_CHAR),c=s?o:null,d=void 0;if(s){if(!c)throw new Error('Check your URL. No channel name after "@".');var f=c.match(e.exports.REGEXP_INVALID_CHANNEL);if(f)throw new Error('Check your URL. Invalid characters in channel name: "'+f.join(", ")+'".')}else d=o;var p=void 0;if(i){if(!u)throw new Error('Check your URL. No modifier provided after separator "'+i+'"');if(":"!==i)throw new Error('Check your URL. The "'+i+'" modifier is not currently supported');p=u}return{isChannel:s,channelName:c,channelClaimId:p||null,claimId:d||null}},parseClaim:function(t){var n=new RegExp("([^:$#/.]*)([:$#.]?)([^/]*)"),a=n.exec(t).map(function(e){return e||null}),l=r(a,4),o=(l[0],l[1]),i=l[2],u=l[3];if(!o)throw new Error('Check your URL. No claim name provided before "."');var s=o.match(e.exports.REGEXP_INVALID_CLAIM);if(s)throw new Error('Check your URL. Invalid characters in claim name: "'+s.join(", ")+'".');if(i){if(!u)throw new Error('Check your URL. No file extension provided after separator "'+i+'".');if("."!==i)throw new Error('Check your URL. The "'+i+'" separator is not supported in the claim name.')}return{claimName:o,extension:u||null}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){if(e){switch(e.substring(e.lastIndexOf("."))){case"jpeg":case"jpg":return"image/jpeg";case"png":return"image/png";case"gif":return"image/gif";case"mp4":return"video/mp4";default:return"image/jpeg"}}return""},a=function(e,t,n,r){return[{property:"og:title",content:n},{property:"og:url",content:e},{property:"og:site_name",content:n},{property:"og:description",content:t},{property:"twitter:site",content:r},{property:"twitter:card",content:"summary"}]},l=function(e,t,n,r){var a=r.name;return[{property:"og:title",content:a+" on "+e},{property:"og:url",content:t+"/"+a+":"+r.longId},{property:"og:site_name",content:e},{property:"og:description",content:a+", a channel on "+e},{property:"twitter:site",content:n},{property:"twitter:card",content:"summary"}]},o=function(e,t,n,a,l,o){var i=a.claimData,u=i.contentType,s=e+"/"+i.claimId+"/"+i.name,c=e+"/"+i.claimId+"/"+i.name,d=e+"/"+i.claimId+"/"+i.name+"."+i.fileExt,f=i.title||i.name,p=i.description||l,h=r(i.thumbnail),m=i.thumbnail||o,b=[{property:"og:title",content:f},{property:"og:url",content:c},{property:"og:site_name",content:t},{property:"og:description",content:p},{property:"og:image:width",content:600},{property:"og:image:height",content:315},{property:"twitter:site",content:n}];return"video/mp4"===u||"video/webm"===u?(b.push({property:"og:video",content:d}),b.push({property:"og:video:secure_url",content:d}),b.push({property:"og:video:type",content:u}),b.push({property:"og:image",content:m}),b.push({property:"og:image:type",content:h}),b.push({property:"og:type",content:"video"}),b.push({property:"twitter:card",content:"player"}),b.push({property:"twitter:player",content:s}),b.push({property:"twitter:player:width",content:600}),b.push({property:"twitter:text:player_width",content:600}),b.push({property:"twitter:player:height",content:337}),b.push({property:"twitter:player:stream",content:d}),b.push({property:"twitter:player:stream:content_type",content:u})):(b.push({property:"og:image",content:d}),b.push({property:"og:image:type",content:u}),b.push({property:"og:type",content:"article"}),b.push({property:"twitter:card",content:"summary_large_image"})),b};t.createMetaTags=function(e,t,n,r,i,u,s,c){return i?o(t,n,r,i,s,c):u?l(t,n,r,u):a(e,t,n,r)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.createPageTitle=function(e,t){return t?e+" - "+t:""+e}},function(e,t,n){"use strict";function r(e,t,n){return{type:l.CHANNEL_UPDATE,data:{name:e,shortId:t,longId:n}}}Object.defineProperty(t,"__esModule",{value:!0}),t.updateLoggedInChannel=r;var a=n(106),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(4),d=n(21),f=r(d),p=n(22),h=r(p),m=n(8),b=r(m),v=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.checkForLoggedInUser=n.checkForLoggedInUser.bind(n),n.logoutUser=n.logoutUser.bind(n),n.handleSelection=n.handleSelection.bind(n),n}return o(t,e),i(t,[{key:"componentDidMount",value:function(){this.checkForLoggedInUser()}},{key:"checkForLoggedInUser",value:function(){var e=this,t={credentials:"include"};(0,b.default)("/user",t).then(function(t){var n=t.data;e.props.onChannelLogin(n.channelName,n.shortChannelId,n.channelClaimId)}).catch(function(e){console.log("/user error:",e.message)})}},{key:"logoutUser",value:function(){var e=this,t={credentials:"include"};(0,b.default)("/logout",t).then(function(){e.props.onChannelLogout()}).catch(function(e){console.log("/logout error",e.message)})}},{key:"handleSelection",value:function(e){switch(e.target.selectedOptions[0].value){case"LOGOUT":this.logoutUser();break;case"VIEW":this.props.history.push("/"+this.props.channelName+":"+this.props.channelLongId)}}},{key:"render",value:function(){var e=this.props.siteDescription;return s.default.createElement("div",{className:"row row--wide nav-bar"},s.default.createElement("div",{className:"row row--padded row--short flex-container--row flex-container--space-between-center"},s.default.createElement(f.default,null),s.default.createElement("div",{className:"nav-bar--center"},s.default.createElement("span",{className:"nav-bar-tagline"},e)),s.default.createElement("div",{className:"nav-bar--right"},s.default.createElement(c.NavLink,{className:"nav-bar-link link--nav",activeClassName:"link--nav-active",to:"/",exact:!0},"Publish"),s.default.createElement(c.NavLink,{className:"nav-bar-link link--nav",activeClassName:"link--nav-active",to:"/about"},"About"),this.props.channelName?s.default.createElement(h.default,{channelName:this.props.channelName,handleSelection:this.handleSelection,defaultSelection:this.props.channelName,VIEW:"VIEW",LOGOUT:"LOGOUT"}):s.default.createElement(c.NavLink,{id:"nav-bar-login-link",className:"nav-bar-link link--nav",activeClassName:"link--nav-active",to:"/login"},"Channel"))))}}]),t}(s.default.Component);t.default=(0,c.withRouter)(v)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(48),d=r(c),f=n(14),p=r(f),h=n(63),m=n(62),b=n(59),v=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props,t=e.defaultDescription,n=e.defaultThumbnail,r=e.siteDescription,a=e.siteHost,l=e.siteTitle,o=e.siteTwitter,i=this.props,u=i.asset,c=i.channel,f=i.pageUri,p=this.props.pageTitle;p=(0,h.createPageTitle)(l,p);var v=(0,m.createMetaTags)(r,a,l,o,u,c,t,n),g=(0,b.createCanonicalLink)(u,c,f,a);return s.default.createElement(d.default,{title:p,meta:v,link:[{rel:"canonical",href:g}]})}}]),t}(s.default.Component);v.propTypes={pageTitle:p.default.string,pageUri:p.default.string,channel:p.default.object,asset:p.default.object},t.default=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(4),d=n(7),f=r(d),p=n(5),h=r(p),m=n(15),b=r(m),v=n(16),g=r(v),y=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"componentWillReceiveProps",value:function(e){e.loggedInChannelName!==this.props.loggedInChannelName&&this.props.history.push("/")}},{key:"render",value:function(){return s.default.createElement("div",null,s.default.createElement(f.default,{pageTitle:"Login",pageUri:"login"}),s.default.createElement(h.default,null),s.default.createElement("div",{className:"row row--padded"},s.default.createElement("div",{className:"column column--5 column--med-10 align-content-top"},s.default.createElement("div",{className:"column column--8 column--med-10"},s.default.createElement("p",null,"Channels allow you to publish and group content under an identity. You can create a channel for yourself, or share one with like-minded friends. You can create 1 channel, or 100, so whether you're ",s.default.createElement("a",{className:"link--primary",target:"_blank",href:"/@catalonia2017:43dcf47163caa21d8404d9fe9b30f78ef3e146a8"},"documenting important events"),", or making a public repository for ",s.default.createElement("a",{className:"link--primary",target:"_blank",href:"/@catGifs"},"cat gifs")," (password: '1234'), try creating a channel for it!"))),s.default.createElement("div",{className:"column column--5 column--med-10 align-content-top"},s.default.createElement("div",{className:"column column--8 column--med-10"},s.default.createElement("h3",{className:"h3--no-bottom"},"Log in to an existing channel:"),s.default.createElement(b.default,null),s.default.createElement("h3",{className:"h3--no-bottom"},"Create a brand new channel:"),s.default.createElement(g.default,null)))))}}]),t}(s.default.Component);t.default=(0,c.withRouter)(y)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),d=n(8),f=r(d),p=function(e){function t(e){l(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={error:null,name:"",password:""},n.handleInput=n.handleInput.bind(n),n.loginToChannel=n.loginToChannel.bind(n),n}return i(t,e),u(t,[{key:"handleInput",value:function(e){var t=e.target.name,n=e.target.value;this.setState(a({},t,n))}},{key:"loginToChannel",value:function(e){var t=this;e.preventDefault();var n={method:"POST",body:JSON.stringify({username:this.state.name,password:this.state.password}),headers:new Headers({"Content-Type":"application/json"}),credentials:"include"};(0,f.default)("login",n).then(function(e){var n=e.success,r=e.channelName,a=e.shortChannelId,l=e.channelClaimId,o=e.message;n?t.props.onChannelLogin(r,a,l):t.setState({error:o})}).catch(function(e){e.message?t.setState({error:e.message}):t.setState({error:e})})}},{key:"render",value:function(){return c.default.createElement("form",{id:"channel-login-form"},c.default.createElement("div",{className:"row row--wide row--short"},c.default.createElement("div",{className:"column column--3 column--sml-10"},c.default.createElement("label",{className:"label",htmlFor:"channel-login-name-input"},"Name:")),c.default.createElement("div",{className:"column column--6 column--sml-10"},c.default.createElement("div",{className:"input-text--primary flex-container--row flex-container--left-bottom"},c.default.createElement("span",null,"@"),c.default.createElement("input",{type:"text",id:"channel-login-name-input",className:"input-text",name:"name",placeholder:"Your Channel Name",value:this.state.channelName,onChange:this.handleInput})))),c.default.createElement("div",{className:"row row--wide row--short"},c.default.createElement("div",{className:"column column--3 column--sml-10"},c.default.createElement("label",{className:"label",htmlFor:"channel-login-password-input"},"Password:")),c.default.createElement("div",{className:"column column--6 column--sml-10"},c.default.createElement("div",{className:"input-text--primary"},c.default.createElement("input",{type:"password",id:"channel-login-password-input",name:"password",className:"input-text",placeholder:"",value:this.state.channelPassword,onChange:this.handleInput})))),this.state.error?c.default.createElement("p",{className:"info-message--failure"},this.state.error):c.default.createElement("p",{className:"info-message"},"Enter the name and password for your channel"),c.default.createElement("div",{className:"row row--wide"},c.default.createElement("button",{className:"button--primary",onClick:this.loginToChannel},"Authenticate")))}}]),t}(c.default.Component);t.default=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),d=n(10),f=r(d),p=n(8),h=r(p),m=function(e){function t(e){l(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={error:null,channel:"",password:"",status:null},n.handleChannelInput=n.handleChannelInput.bind(n),n.handleInput=n.handleInput.bind(n),n.createChannel=n.createChannel.bind(n),n}return i(t,e),u(t,[{key:"cleanseChannelInput",value:function(e){return e=e.replace(/\s+/g,"-"),e=e.replace(/[^A-Za-z0-9-]/g,"")}},{key:"handleChannelInput",value:function(e){var t=e.target.value;t=this.cleanseChannelInput(t),this.setState({channel:t}),t?this.updateIsChannelAvailable(t):this.setState({error:"Please enter a channel name"})}},{key:"handleInput",value:function(e){var t=e.target.name,n=e.target.value;this.setState(a({},t,n))}},{key:"updateIsChannelAvailable",value:function(e){var t=this,n="@"+e;(0,h.default)("/api/channel/availability/"+n).then(function(){t.setState({error:null})}).catch(function(e){t.setState({error:e.message})})}},{key:"checkIsChannelAvailable",value:function(e){var t="@"+e;return(0,h.default)("/api/channel/availability/"+t)}},{key:"checkIsPasswordProvided",value:function(e){return new Promise(function(t,n){if(!e||e.length<1)return n(new Error("Please provide a password"));t()})}},{key:"makePublishChannelRequest",value:function(e,t){var n={method:"POST",body:JSON.stringify({username:e,password:t}),headers:new Headers({"Content-Type":"application/json"}),credentials:"include"};return new Promise(function(e,t){(0,h.default)("/signup",n).then(function(t){return e(t)}).catch(function(e){t(new Error("Unfortunately, we encountered an error while creating your channel. Please let us know in Discord! "+e.message))})})}},{key:"createChannel",value:function(e){var t=this;e.preventDefault(),this.checkIsPasswordProvided(this.state.password).then(function(){return t.checkIsChannelAvailable(t.state.channel)}).then(function(){return t.setState({status:"We are publishing your new channel. Sit tight..."}),t.makePublishChannelRequest(t.state.channel,t.state.password)}).then(function(e){t.setState({status:null}),t.props.onChannelLogin(e.channelName,e.shortChannelId,e.channelClaimId)}).catch(function(e){e.message?t.setState({error:e.message,status:null}):t.setState({error:e,status:null})})}},{key:"render",value:function(){return c.default.createElement("div",null,this.state.status?c.default.createElement("div",null,c.default.createElement("p",{className:"fine-print"},this.state.status),c.default.createElement(f.default,{size:12})):c.default.createElement("form",{id:"publish-channel-form"},c.default.createElement("div",{className:"row row--wide row--short"},c.default.createElement("div",{className:"column column--3 column--sml-10"},c.default.createElement("label",{className:"label",htmlFor:"new-channel-name"},"Name:")),c.default.createElement("div",{className:"column column--6 column--sml-10"},c.default.createElement("div",{className:"input-text--primary flex-container--row flex-container--left-bottom span--relative"},c.default.createElement("span",null,"@"),c.default.createElement("input",{type:"text",name:"channel",id:"new-channel-name",className:"input-text",placeholder:"exampleChannelName",value:this.state.channel,onChange:this.handleChannelInput}),this.state.channel&&!this.state.error&&c.default.createElement("span",{id:"input-success-channel-name",className:"info-message--success span--absolute"},"✓"),this.state.error&&c.default.createElement("span",{id:"input-success-channel-name",className:"info-message--failure span--absolute"},"✖")))),c.default.createElement("div",{className:"row row--wide row--short"},c.default.createElement("div",{className:"column column--3 column--sml-10"},c.default.createElement("label",{className:"label",htmlFor:"new-channel-password"},"Password:")),c.default.createElement("div",{className:"column column--6 column--sml-10"},c.default.createElement("div",{className:"input-text--primary"},c.default.createElement("input",{type:"password",name:"password",id:"new-channel-password",className:"input-text",placeholder:"",value:this.state.password,onChange:this.handleInput})))),this.state.error?c.default.createElement("p",{className:"info-message--failure"},this.state.error):c.default.createElement("p",{className:"info-message"},"Choose a name and password for your channel"),c.default.createElement("div",{className:"row row--wide"},c.default.createElement("button",{className:"button--primary",onClick:this.createChannel},"Create Channel"))))}}]),t}(c.default.Component);t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(12),d=r(c),f=n(27),p=r(f),h=n(29),m=r(h),b=n(32),v=r(b),g=n(112),y=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.onHandleShowPageUri(this.props.match.params)}},{key:"componentWillReceiveProps",value:function(e){e.match.params!==this.props.match.params&&this.props.onHandleShowPageUri(e.match.params)}},{key:"render",value:function(){var e=this.props,t=e.error,n=e.requestType;if(t)return s.default.createElement(d.default,{error:t});switch(n){case g.CHANNEL:return s.default.createElement(v.default,null);case g.ASSET_LITE:return s.default.createElement(p.default,null);case g.ASSET_DETAILS:return s.default.createElement(m.default,null);default:return s.default.createElement("p",null,"loading...")}}}]),t}(s.default.Component);t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(7),d=r(c),f=n(4),p=n(17),h=r(p),m=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props.asset;if(e){var t=e.claimData,n=t.name,r=t.claimId;return s.default.createElement("div",{className:"row row--tall flex-container--column flex-container--center-center show-lite-container"},s.default.createElement(d.default,{pageTitle:n,asset:e}),s.default.createElement(h.default,null),s.default.createElement(f.Link,{id:"asset-boilerpate",className:"link--primary fine-print",to:"/"+r+"/"+n},"hosted via Spee.ch"))}return s.default.createElement("div",{className:"row row--tall row--padded flex-container--column flex-container--center-center"},s.default.createElement("p",null,"loading asset data..."))}}]),t}(s.default.Component);t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(10),d=r(c),f=n(107),p=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.props.asset.claimData,t=e.name,n=e.claimId;this.props.onFileRequest(t,n)}},{key:"render",value:function(){var e=this.props,t=e.status,n=e.error,r=e.asset.claimData,a=r.name,l=r.claimId,o=r.contentType,i=r.fileExt,u=r.thumbnail;return s.default.createElement("div",{id:"asset-display-component"},t===f.LOCAL_CHECK&&s.default.createElement("div",null,s.default.createElement("p",null,"Checking to see if Spee.ch has your asset locally...")),t===f.UNAVAILABLE&&s.default.createElement("div",null,s.default.createElement("p",null,"Sit tight, we're searching the LBRY blockchain for your asset!"),s.default.createElement(d.default,{size:12}),s.default.createElement("p",null,"Curious what magic is happening here? ",s.default.createElement("a",{className:"link--primary",target:"blank",href:"https://lbry.io/faq/what-is-lbry"},"Learn more."))),t===f.ERROR&&s.default.createElement("div",null,s.default.createElement("p",null,"Unfortunately, we couldn't download your asset from LBRY. You can help us out by sharing the below error message in the ",s.default.createElement("a",{className:"link--primary",href:"https://discord.gg/YjYbwhS",target:"_blank"},"LBRY discord"),"."),s.default.createElement("i",null,s.default.createElement("p",{id:"error-message"},n))),t===f.AVAILABLE&&function(){switch(o){case"image/jpeg":case"image/jpg":case"image/png":case"image/gif":return s.default.createElement("img",{className:"asset",src:"/"+l+"/"+a+"."+i,alt:a});case"video/mp4":return s.default.createElement("video",{className:"asset video",controls:!0,poster:u},s.default.createElement("source",{src:"/"+l+"/"+a+"."+i}),s.default.createElement("p",null,"Your browser does not support the ",s.default.createElement("code",null,"video")," element."));default:return s.default.createElement("p",null,"Unsupported file type")}}())}}]),t}(s.default.Component);t.default=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(7),d=r(c),f=n(5),p=r(f),h=n(12),m=r(h),b=n(30),v=r(b),g=n(17),y=r(g),w=n(31),E=r(w),_=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props.asset;if(e){var t=e.claimData.name;return s.default.createElement("div",null,s.default.createElement(d.default,{pageTitle:t+" - details",asset:e}),s.default.createElement(p.default,null),s.default.createElement("div",{className:"row row--tall row--padded"},s.default.createElement("div",{className:"column column--10"},s.default.createElement(v.default,null)),s.default.createElement("div",{className:"column column--5 column--sml-10 align-content-top"},s.default.createElement("div",{className:"row row--padded show-details-container"},s.default.createElement(y.default,null))),s.default.createElement("div",{className:"column column--5 column--sml-10 align-content-top"},s.default.createElement("div",{className:"row row--padded"},s.default.createElement(E.default,null)))))}return s.default.createElement(m.default,{error:"loading asset data..."})}}]),t}(s.default.Component);t.default=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),l=function(e){var t=e.title;return a.default.createElement("div",null,a.default.createElement("span",{className:"text--large"},t))};t.default=l},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(i),s=n(4),c=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.copyToClipboard=n.copyToClipboard.bind(n),n}return l(t,e),o(t,[{key:"copyToClipboard",value:function(e){var t=e.target.dataset.elementtocopy;document.getElementById(t).select();try{document.execCommand("copy")}catch(e){this.setState({error:"Oops, unable to copy"})}}},{key:"render",value:function(){var e=this.props.asset,t=e.shortId,n=e.claimData,r=n.channelName,a=n.certificateId,l=n.description,o=n.name,i=n.claimId,c=n.fileExt,d=n.contentType,f=n.thumbnail,p=n.host;return u.default.createElement("div",null,r&&u.default.createElement("div",{className:"row row--padded row--wide row--no-top"},u.default.createElement("div",{className:"column column--2 column--med-10"},u.default.createElement("span",{className:"text"},"Channel:")),u.default.createElement("div",{className:"column column--8 column--med-10"},u.default.createElement("span",{className:"text"},u.default.createElement(s.Link,{to:"/"+r+":"+a},r)))),l&&u.default.createElement("div",{className:"row row--padded row--wide row--no-top"},u.default.createElement("span",{className:"text"},l)),u.default.createElement("div",{id:"show-share-buttons"},u.default.createElement("div",{className:"row row--padded row--wide row--no-top"},u.default.createElement("div",{className:"column column--2 column--med-10"},u.default.createElement("span",{className:"text"},"Share:")),u.default.createElement("div",{className:"column column--8 column--med-10"},u.default.createElement("div",{className:"row row--short row--wide flex-container--row flex-container--space-between-bottom flex-container--wrap"},u.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://twitter.com/intent/tweet?text="+p+"/"+t+"/"+o},"twitter"),u.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://www.facebook.com/sharer/sharer.php?u="+p+"/"+t+"/"+o},"facebook"),u.default.createElement("a",{className:"link--primary",target:"_blank",href:"http://tumblr.com/widgets/share/tool?canonicalUrl="+p+"/"+t+"/"+o},"tumblr"),u.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://www.reddit.com/submit?url="+p+"/"+t+"/"+o+"&title="+o},"reddit"))))),u.default.createElement("div",{className:"row row--padded row--wide row--no-top"},u.default.createElement("div",{id:"show-short-link"},u.default.createElement("div",{className:"column column--2 column--med-10"},u.default.createElement("span",{className:"text"},"Link:")),u.default.createElement("div",{className:"column column--8 column--med-10"},u.default.createElement("div",{className:"row row--short row--wide"},u.default.createElement("div",{className:"column column--7"},u.default.createElement("div",{className:"input-error",id:"input-error-copy-short-link",hidden:"true"},"error here"),u.default.createElement("input",{type:"text",id:"short-link",className:"input-disabled input-text--full-width",readOnly:!0,spellCheck:"false",value:p+"/"+t+"/"+o+"."+c,onClick:this.select})),u.default.createElement("div",{className:"column column--1"}),u.default.createElement("div",{className:"column column--2"},u.default.createElement("button",{className:"button--primary button--wide","data-elementtocopy":"short-link",onClick:this.copyToClipboard},"copy"))))),u.default.createElement("div",{id:"show-embed-code"},u.default.createElement("div",{className:"column column--2 column--med-10"},u.default.createElement("span",{className:"text"},"Embed:")),u.default.createElement("div",{className:"column column--8 column--med-10"},u.default.createElement("div",{className:"row row--short row--wide"},u.default.createElement("div",{className:"column column--7"},u.default.createElement("div",{className:"input-error",id:"input-error-copy-embed-text",hidden:"true"},"error here"),"video/mp4"===d?u.default.createElement("input",{type:"text",id:"embed-text",className:"input-disabled input-text--full-width",readOnly:!0,onClick:this.select,spellCheck:"false",value:'<video width="100%" controls poster="'+f+'" src="'+p+"/"+i+"/"+o+"."+c+'"/></video>'}):u.default.createElement("input",{type:"text",id:"embed-text",className:"input-disabled input-text--full-width",readOnly:!0,onClick:this.select,spellCheck:"false",value:'<img src="'+p+"/"+i+"/"+o+"."+c+'"/>'})),u.default.createElement("div",{className:"column column--1"}),u.default.createElement("div",{className:"column column--2"},u.default.createElement("button",{className:"button--primary button--wide","data-elementtocopy":"embed-text",onClick:this.copyToClipboard},"copy")))))),u.default.createElement("div",{className:"flex-container--row flex-container--space-between-bottom"},u.default.createElement(s.Link,{className:"link--primary",to:"/"+t+"/"+o+"."+c},u.default.createElement("span",{className:"text"},"Direct Link")),u.default.createElement("a",{className:"link--primary",href:p+"/"+i+"/"+o+"."+c,download:o},"Download"),u.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://lbry.io/dmca"},"Report")))}}]),t}(u.default.Component);t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(7),d=r(c),f=n(12),p=r(f),h=n(5),m=r(h),b=n(33),v=r(b),g=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props.channel;if(e){var t=e.name,n=e.longId,r=e.shortId;return s.default.createElement("div",null,s.default.createElement(d.default,{pageTitle:t,channel:e}),s.default.createElement(m.default,null),s.default.createElement("div",{className:"row row--tall row--padded"},s.default.createElement("div",{className:"column column--10"},s.default.createElement("h2",null,"channel name: ",t),s.default.createElement("p",{className:"fine-print"},"full channel id: ",n),s.default.createElement("p",{className:"fine-print"},"short channel id: ",r)),s.default.createElement("div",{className:"column column--10"},s.default.createElement(v.default,null))))}return s.default.createElement(p.default,{error:"loading channel data..."})}}]),t}(s.default.Component);t.default=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(34),d=r(c),f=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.showNextResultsPage=n.showNextResultsPage.bind(n),n.showPreviousResultsPage=n.showPreviousResultsPage.bind(n),n}return o(t,e),i(t,[{key:"showPreviousResultsPage",value:function(){var e=this.props.channel.claimsData.currentPage,t=parseInt(e)-1;this.showNewPage(t)}},{key:"showNextResultsPage",value:function(){var e=this.props.channel.claimsData.currentPage,t=parseInt(e)+1;this.showNewPage(t)}},{key:"showNewPage",value:function(e){var t=this.props,n=t.channelKey,r=t.channel,a=r.name,l=r.longId;this.props.onUpdateChannelClaims(n,a,l,e)}},{key:"render",value:function(){var e=this.props.channel.claimsData,t=e.claims,n=e.currentPage,r=e.totalPages;return s.default.createElement("div",{className:"row row--tall"},t.length>0?s.default.createElement("div",null,t.map(function(e,t){return s.default.createElement(d.default,{claimData:e,key:e.name+"-"+t})}),s.default.createElement("div",null,n>1&&s.default.createElement("button",{className:"button--secondary",onClick:this.showPreviousResultsPage},"Previous Page"),n<r&&s.default.createElement("button",{className:"button--secondary",onClick:this.showNextResultsPage},"Next Page"))):s.default.createElement("p",null,"There are no claims in this channel"))}}]),t}(s.default.Component);t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),l=n(4),o=function(e){var t=e.defaultThumbnail,n=e.claimData,r=n.name,o=n.claimId,i=n.fileExt,u=n.contentType,s=n.thumbnail,c=o+"/"+r+"."+i,d="/"+o+"/"+r;return a.default.createElement("div",{className:"asset-holder"},a.default.createElement(l.Link,{to:d},function(){switch(u){case"image/jpeg":case"image/jpg":case"image/png":case"image/gif":return a.default.createElement("img",{className:"asset-preview",src:c,alt:r});case"video/mp4":return a.default.createElement("img",{className:"asset-preview video",src:s||t,alt:r});default:return a.default.createElement("p",null,"unsupported file type")}}()))};t.default=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(5),d=r(c),f=n(48),p=r(f),h=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.host;return s.default.createElement("div",null,s.default.createElement(p.default,null,s.default.createElement("title",null,t," - 404"),s.default.createElement("link",{rel:"canonical",href:n+"/404"})),s.default.createElement(d.default,null),s.default.createElement("div",{className:"row row--padded"},s.default.createElement("h2",null,"404"),s.default.createElement("p",null,"That page does not exist")))}}]),t}(s.default.Component);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(98),a=r.lstatSync,l=r.readdirSync,o=n(51),i=o.join;t.getSubDirectoryNames=function(e){return l(e).filter(function(t){var n=i(e,t);return a(n).isDirectory()})}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(15),d=r(c),f=n(16),p=r(f),h=n(105),m=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(h),b=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.toggleAnonymousPublish=n.toggleAnonymousPublish.bind(n),n.handleSelection=n.handleSelection.bind(n),n}return o(t,e),i(t,[{key:"toggleAnonymousPublish",value:function(e){"anonymous"===e.target.value?this.props.onPublishInChannelChange(!1):this.props.onPublishInChannelChange(!0)}},{key:"handleSelection",value:function(e){var t=e.target.selectedOptions[0].value;this.props.onChannelSelect(t)}},{key:"render",value:function(){return s.default.createElement("div",null,s.default.createElement("form",null,s.default.createElement("div",{className:"column column--3 column--med-10"},s.default.createElement("input",{type:"radio",name:"anonymous-or-channel",id:"anonymous-radio",className:"input-radio",value:"anonymous",checked:!this.props.publishInChannel,onChange:this.toggleAnonymousPublish}),s.default.createElement("label",{className:"label label--pointer",htmlFor:"anonymous-radio"},"Anonymous")),s.default.createElement("div",{className:"column column--7 column--med-10"},s.default.createElement("input",{type:"radio",name:"anonymous-or-channel",id:"channel-radio",className:"input-radio",value:"in a channel",checked:this.props.publishInChannel,onChange:this.toggleAnonymousPublish}),s.default.createElement("label",{className:"label label--pointer",htmlFor:"channel-radio"},"In a channel")),this.props.channelError?s.default.createElement("p",{className:"info-message--failure"},this.props.channelError):s.default.createElement("p",{className:"info-message"},"Publish anonymously or in a channel")),this.props.publishInChannel&&s.default.createElement("div",null,s.default.createElement("div",{className:"column column--3"},s.default.createElement("label",{className:"label",htmlFor:"channel-name-select"},"Channel:")),s.default.createElement("div",{className:"column column--7"},s.default.createElement("select",{type:"text",id:"channel-name-select",className:"select select--arrow",value:this.props.selectedChannel,onChange:this.handleSelection},this.props.loggedInChannelName&&s.default.createElement("option",{value:this.props.loggedInChannelName,id:"publish-channel-select-channel-option"},this.props.loggedInChannelName),s.default.createElement("option",{value:m.LOGIN},"Existing"),s.default.createElement("option",{value:m.CREATE},"New"))),this.props.selectedChannel===m.LOGIN&&s.default.createElement(d.default,null),this.props.selectedChannel===m.CREATE&&s.default.createElement(p.default,null)))}}]),t}(s.default.Component);t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(60),d=n(37),f=r(d),p=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={dragOver:!1,mouseOver:!1,dimPreview:!1},n.handleDrop=n.handleDrop.bind(n),n.handleDragOver=n.handleDragOver.bind(n),n.handleDragEnd=n.handleDragEnd.bind(n),n.handleDragEnter=n.handleDragEnter.bind(n),n.handleDragLeave=n.handleDragLeave.bind(n),n.handleMouseEnter=n.handleMouseEnter.bind(n),n.handleMouseLeave=n.handleMouseLeave.bind(n),n.handleClick=n.handleClick.bind(n),n.handleFileInput=n.handleFileInput.bind(n),n.chooseFile=n.chooseFile.bind(n),n}return o(t,e),i(t,[{key:"handleDrop",value:function(e){e.preventDefault(),this.setState({dragOver:!1});var t=e.dataTransfer;if(t.items&&"file"===t.items[0].kind){var n=t.items[0].getAsFile();this.chooseFile(n)}}},{key:"handleDragOver",value:function(e){e.preventDefault()}},{key:"handleDragEnd",value:function(e){var t=e.dataTransfer;if(t.items)for(var n=0;n<t.items.length;n++)t.items.remove(n);else e.dataTransfer.clearData()}},{key:"handleDragEnter",value:function(){this.setState({dragOver:!0,dimPreview:!0})}},{key:"handleDragLeave",value:function(){this.setState({dragOver:!1,dimPreview:!1})}},{key:"handleMouseEnter",value:function(){this.setState({mouseOver:!0,dimPreview:!0})}},{key:"handleMouseLeave",value:function(){this.setState({mouseOver:!1,dimPreview:!1})}},{key:"handleClick",value:function(e){e.preventDefault(),document.getElementById("file_input").click()}},{key:"handleFileInput",value:function(e){e.preventDefault();var t=e.target.files;this.chooseFile(t[0])}},{key:"chooseFile",value:function(e){if(e){try{(0,c.validateFile)(e)}catch(e){return this.props.setFileError(e.message)}this.props.selectFile(e)}}},{key:"render",value:function(){return s.default.createElement("div",{className:"row row--tall flex-container--column"},s.default.createElement("form",null,s.default.createElement("input",{className:"input-file",type:"file",id:"file_input",name:"file_input",accept:"video/*,image/*",onChange:this.handleFileInput,encType:"multipart/form-data"})),s.default.createElement("div",{id:"preview-dropzone",className:"row row--padded row--tall dropzone"+(this.state.dragOver?" dropzone--drag-over":""),onDrop:this.handleDrop,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDragEnter:this.handleDragEnter,onDragLeave:this.handleDragLeave,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onClick:this.handleClick},this.props.file?s.default.createElement("div",null,s.default.createElement(f.default,{dimPreview:this.state.dimPreview,file:this.props.file,thumbnail:this.props.thumbnail}),s.default.createElement("div",{id:"dropzone-text-holder",className:"flex-container--column flex-container--center-center"},this.state.dragOver?s.default.createElement("div",{id:"dropzone-dragover"},s.default.createElement("p",{className:"blue"},"Drop it.")):null,this.state.mouseOver?s.default.createElement("div",{id:"dropzone-instructions"},s.default.createElement("p",{className:"info-message-placeholder info-message--failure",id:"input-error-file-selection"},this.props.fileError),s.default.createElement("p",null,"Drag & drop image or video here to publish"),s.default.createElement("p",{className:"fine-print"},"OR"),s.default.createElement("p",{className:"blue--underlined"},"CHOOSE FILE")):null)):s.default.createElement("div",{id:"dropzone-text-holder",className:"flex-container--column flex-container--center-center"},this.state.dragOver?s.default.createElement("div",{id:"dropzone-dragover"},s.default.createElement("p",{className:"blue"},"Drop it.")):s.default.createElement("div",{id:"dropzone-instructions"},s.default.createElement("p",{className:"info-message-placeholder info-message--failure",id:"input-error-file-selection"},this.props.fileError),s.default.createElement("p",null,"Drag & drop image or video here to publish"),s.default.createElement("p",{className:"fine-print"},"OR"),s.default.createElement("p",{className:"blue--underlined"},"CHOOSE FILE")))))}}]),t}(s.default.Component);t.default=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(4),d=n(18),f=r(d),p=n(41),h=r(p),m=n(42),b=r(m),v=n(43),g=r(v),y=n(44),w=r(y),E=n(39),_=r(E),C=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onPublishSubmit=n.onPublishSubmit.bind(n),n}return o(t,e),i(t,[{key:"onPublishSubmit",value:function(){this.props.startPublish(this.props.history)}},{key:"render",value:function(){return s.default.createElement("div",{className:"row row--no-bottom"},s.default.createElement("div",{className:"column column--10"},s.default.createElement(h.default,null)),s.default.createElement("div",{className:"column column--5 column--sml-10"},s.default.createElement("div",{className:"row row--padded"},s.default.createElement(f.default,null))),s.default.createElement("div",{className:"column column--5 column--sml-10 align-content-top"},s.default.createElement("div",{id:"publish-active-area",className:"row row--padded"},s.default.createElement("div",{className:"row row--padded row--no-top row--wide"},s.default.createElement(b.default,null)),s.default.createElement("div",{className:"row row--padded row--no-top row--wide"},s.default.createElement(_.default,null)),"video/mp4"===this.props.file.type&&s.default.createElement("div",{className:"row row--padded row--no-top row--wide "},s.default.createElement(g.default,null)),s.default.createElement("div",{className:"row row--padded row--no-top row--no-bottom row--wide"},s.default.createElement(w.default,null)),s.default.createElement("div",{className:"row row--wide align-content-center"},s.default.createElement("button",{id:"publish-submit",className:"button--primary button--large",onClick:this.onPublishSubmit},"Publish")),s.default.createElement("div",{className:"row row--padded row--no-bottom align-content-center"},s.default.createElement("button",{className:"button--cancel",onClick:this.props.clearFile},"Cancel")),s.default.createElement("div",{className:"row row--short align-content-center"},s.default.createElement("p",{className:"fine-print"},"By clicking 'Publish', you affirm that you have the rights to publish this content to the LBRY network, and that you understand the properties of publishing it to a decentralized, user-controlled network. ",s.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://lbry.io/learn"},"Read more."))))))}}]),t}(s.default.Component);t.default=(0,c.withRouter)(C)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(i),s=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleInput=n.handleInput.bind(n),n}return l(t,e),o(t,[{key:"handleInput",value:function(e){var t=e.target.name,n=e.target.value;this.props.onMetadataChange(t,n)}},{key:"render",value:function(){return u.default.createElement("input",{type:"text",id:"publish-title",className:"input-text text--large input-text--full-width",name:"title",placeholder:"Give your post a title...",onChange:this.handleInput,value:this.props.title})}}]),t}(u.default.Component);t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(8),d=r(c),f=n(38),p=r(f),h=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleInput=n.handleInput.bind(n),n}return o(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.claim,n=e.fileName;t||this.setClaimName(n)}},{key:"componentWillReceiveProps",value:function(e){var t=e.claim,n=e.fileName;if(n!==this.props.fileName)return this.setClaimName(n);t!==this.props.claim&&this.validateClaim(t)}},{key:"handleInput",value:function(e){var t=e.target.value;t=this.cleanseInput(t),this.props.onClaimChange(t)}},{key:"cleanseInput",value:function(e){return e=e.replace(/\s+/g,"-"),e=e.replace(/[^A-Za-z0-9-]/g,"")}},{key:"setClaimName",value:function(e){var t=e.substring(0,e.lastIndexOf(".")),n=this.cleanseInput(t);this.props.onClaimChange(n)}},{key:"validateClaim",value:function(e){var t=this;if(!e)return this.props.onUrlError("Enter a url above");(0,d.default)("/api/claim/availability/"+e).then(function(){t.props.onUrlError(null)}).catch(function(e){t.props.onUrlError(e.message)})}},{key:"render",value:function(){var e=this.props,t=e.claim,n=e.loggedInChannelName,r=e.loggedInChannelShortId,a=e.publishInChannel,l=e.selectedChannel,o=e.urlError;return s.default.createElement("div",{className:"column column--10 column--sml-10"},s.default.createElement("div",{className:"input-text--primary span--relative"},s.default.createElement("span",{className:"url-text--secondary"},"spee.ch / "),s.default.createElement(p.default,{publishInChannel:a,selectedChannel:l,loggedInChannelName:n,loggedInChannelShortId:r}),s.default.createElement("input",{type:"text",id:"claim-name-input",className:"input-text",name:"claim",placeholder:"your-url-here",onChange:this.handleInput,value:t}),t&&!o&&s.default.createElement("span",{id:"input-success-claim-name",className:"info-message--success span--absolute"},"✓"),o&&s.default.createElement("span",{id:"input-success-channel-name",className:"info-message--failure span--absolute"},"✖")),s.default.createElement("div",null,o?s.default.createElement("p",{id:"input-error-claim-name",className:"info-message--failure"},o):s.default.createElement("p",{className:"info-message"},"Choose a custom url")))}}]),t}(s.default.Component);t.default=h},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new Uint8Array(t.length),a=0;a<t.length;a++)r[a]=t.charCodeAt(a);return new Blob([r],{type:n})}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={videoSource:null,error:null,sliderMinRange:1,sliderMaxRange:null,sliderValue:null},n.handleVideoLoadedData=n.handleVideoLoadedData.bind(n),n.handleSliderChange=n.handleSliderChange.bind(n),n.createThumbnail=n.createThumbnail.bind(n),n}return l(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.props.file;this.setVideoSource(e)}},{key:"componentWillReceiveProps",value:function(e){if(e.file&&e.file!==this.props.file){var t=e.file;this.setVideoSource(t)}}},{key:"setVideoSource",value:function(e){var t=this,n=new FileReader;n.readAsDataURL(e),n.onloadend=function(){var e=n.result,r=o(e),a=URL.createObjectURL(r);t.setState({videoSource:a})}}},{key:"handleVideoLoadedData",value:function(e){var t=e.target.duration,n=Math.floor(t/60),r=Math.floor(t%60);this.setState({sliderMaxRange:100*t,sliderValue:100*t/2,totalMinutes:n,totalSeconds:r}),document.getElementById("video-thumb-player").currentTime=t/2}},{key:"handleSliderChange",value:function(e){var t=parseInt(e.target.value);this.setState({sliderValue:t}),document.getElementById("video-thumb-player").currentTime=t/100}},{key:"createThumbnail",value:function(){var e=document.getElementById("video-thumb-player"),t=document.createElement("canvas");t.width=e.videoWidth,t.height=e.videoHeight,t.getContext("2d").drawImage(e,0,0,t.width,t.height);var n=t.toDataURL(),r=o(n),a=new File([r],"thumbnail.png",{type:"image/png"});a&&this.props.onNewThumbnail(a)}},{key:"render",value:function(){var e=this.state,t=e.error,n=e.videoSource,r=e.sliderMinRange,a=e.sliderMaxRange,l=e.sliderValue,o=e.totalMinutes,i=e.totalSeconds;return s.default.createElement("div",null,s.default.createElement("label",{className:"label"},"Thumbnail:"),s.default.createElement("video",{id:"video-thumb-player",preload:"metadata",muted:!0,style:{display:"none"},playsInline:!0,onLoadedData:this.handleVideoLoadedData,src:n,onSeeked:this.createThumbnail}),l?s.default.createElement("div",null,s.default.createElement("div",{className:"flex-container--row flex-container--space-between-center",style:{width:"100%"}},s.default.createElement("span",{className:"info-message"},"0'00\""),s.default.createElement("span",{className:"info-message"},o,"'",i,'"')),s.default.createElement("div",null,s.default.createElement("input",{type:"range",min:r,max:a,value:l,className:"slider",onChange:this.handleSliderChange}))):s.default.createElement("p",{className:"info-message"},"loading... "),t?s.default.createElement("p",{className:"info-message--failure"},t):s.default.createElement("p",{className:"info-message"},"Use slider to set thumbnail"))}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(36),d=r(c),f=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.toggleShowInputs=n.toggleShowInputs.bind(n),n.handleInput=n.handleInput.bind(n),n.handleSelect=n.handleSelect.bind(n),n}return o(t,e),i(t,[{key:"toggleShowInputs",value:function(){this.props.onToggleMetadataInputs(!this.props.showMetadataInputs)}},{key:"handleInput",value:function(e){var t=e.target,n="checkbox"===t.type?t.checked:t.value,r=t.name;this.props.onMetadataChange(r,n)}},{key:"handleSelect",value:function(e){var t=e.target.name,n=e.target.selectedOptions[0].value;this.props.onMetadataChange(t,n)}},{key:"render",value:function(){return s.default.createElement("div",{id:"publish-details",className:"row row--padded row--no-top row--wide"},this.props.showMetadataInputs&&s.default.createElement("div",null,s.default.createElement("div",{className:"row row--no-top"},s.default.createElement("div",{className:"column column--3 column--med-10 align-content-top"},s.default.createElement("label",{htmlFor:"publish-license",className:"label"},"Description:")),s.default.createElement("div",{className:"column column--7 column--sml-10"},s.default.createElement(d.default,{id:"publish-description",className:"textarea textarea--primary textarea--full-width",rows:1,maxLength:2e3,style:{maxHeight:200},name:"description",placeholder:"Optional description",value:this.props.description,onChange:this.handleInput}))),s.default.createElement("div",{className:"row row--no-top"},s.default.createElement("div",{className:"column column--3 column--med-10"},s.default.createElement("label",{htmlFor:"publish-license",className:"label"},"License:")),s.default.createElement("div",{className:"column column--7 column--sml-10"},s.default.createElement("select",{type:"text",name:"license",id:"publish-license",className:"select select--primary",onChange:this.handleSelect},s.default.createElement("option",{value:" "},"Unspecified"),s.default.createElement("option",{value:"Public Domain"},"Public Domain"),s.default.createElement("option",{value:"Creative Commons"},"Creative Commons")))),s.default.createElement("div",{className:"row row--no-top"},s.default.createElement("div",{className:"column column--3"},s.default.createElement("label",{htmlFor:"publish-nsfw",className:"label"},"Mature:")),s.default.createElement("div",{className:"column column--7"},s.default.createElement("input",{className:"input-checkbox",type:"checkbox",id:"publish-nsfw",name:"nsfw",value:this.props.nsfw,onChange:this.handleInput})))),s.default.createElement("button",{className:"button--secondary",onClick:this.toggleShowInputs},this.props.showMetadataInputs?"less":"more"))}}]),t}(s.default.Component);t.default=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(i),s=function(e){function t(){return r(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),o(t,[{key:"render",value:function(){var e=this.props.message;return console.log("this.props.message:",e),u.default.createElement("div",{className:"row dropzone--disabled row--tall flex-container--column flex-container--center-center"},u.default.createElement("p",{className:"text--disabled"},"Publishing is currently disabled."),u.default.createElement("p",{className:"text--disabled"},e))}}]),t}(u.default.Component);t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(10),d=r(c),f=n(170),p=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(f),h=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props,t=e.status,n=e.message,r=e.clearFile;return s.default.createElement("div",{className:"row row--tall flex-container--column flex-container--center-center"},t===p.LOAD_START&&s.default.createElement("div",{className:"row align-content-center"},s.default.createElement("p",null,"File is loading to server"),s.default.createElement("p",{className:"blue"},"0%")),t===p.LOADING&&s.default.createElement("div",null,s.default.createElement("div",{className:"row align-content-center"},s.default.createElement("p",null,"File is loading to server"),s.default.createElement("p",{className:"blue"},n))),t===p.PUBLISHING&&s.default.createElement("div",{className:"row align-content-center"},s.default.createElement("p",null,"Upload complete. Your file is now being published on the blockchain..."),s.default.createElement(d.default,{size:12}),s.default.createElement("p",null,"Curious what magic is happening here? ",s.default.createElement("a",{className:"link--primary",target:"blank",href:"https://lbry.io/faq/what-is-lbry"},"Learn more."))),t===p.SUCCESS&&s.default.createElement("div",{className:"row align-content-center"},s.default.createElement("p",null,"Your publish is complete! You are being redirected to it now."),s.default.createElement("p",null,"If you are not automatically redirected, ",s.default.createElement("a",{className:"link--primary",target:"_blank",href:n},"click here."))),t===p.FAILED&&s.default.createElement("div",{className:"row align-content-center"},s.default.createElement("p",null,"Something went wrong..."),s.default.createElement("p",null,s.default.createElement("strong",null,n)),s.default.createElement("p",null,"For help, post the above error text in the #speech channel on the ",s.default.createElement("a",{className:"link--primary",href:"https://discord.gg/YjYbwhS",target:"_blank"},"lbry discord")),s.default.createElement("button",{className:"button--secondary",onClick:r},"Reset")))}}]),t}(s.default.Component);t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(18),d=r(c),f=n(40),p=r(f),h=n(46),m=r(h),b=n(45),v=r(b),g=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){return this.props.disabled?(console.log("publish is disabled"),s.default.createElement(v.default,null)):(console.log("publish is not disabled"),this.props.file?this.props.status?s.default.createElement(m.default,null):s.default.createElement(p.default,null):s.default.createElement(d.default,null))}}]),t}(s.default.Component);t.default=g},function(e,t){e.exports=require("passport")},function(e,t,n){"use strict";function r(){var e=this;this.database="default",this.username="default",this.password="default",this.configure=function(t){if(!t)return console.log("No MySQL config received.");var n=t.database,r=t.username,a=t.password;e.database=n,e.username=r,e.password=a}}e.exports=new r},function(e,t,n){"use strict";function r(){var e=this;this.slackWebHook="default",this.slackErrorChannel="default",this.slackInfoChannel="default",this.configure=function(t){if(!t)return console.log("No slack config received.");var n=t.slackWebHook,r=t.slackErrorChannel,a=t.slackInfoChannel;e.slackWebHook=n,e.slackErrorChannel=r,e.slackInfoChannel=a}}e.exports=new r},function(e,t){e.exports=require("passport-local")},function(e,t){e.exports=require("sequelize")},function(e,t,n){"use strict";e.exports={returnShortId:function(e,t){var n=void 0,r=t.substring(0,1),a=0;if((n=e.findIndex(function(e){return e.claimId===t}))<0)throw new Error("claim id not found in claims list");for(var l=e.slice(0,n);l.length>0;)a+=1,r=t.substring(0,a),l=l.filter(function(e){return e.claimId&&e.claimId.substring(0,a)===r});return r}}},function(e,t,n){"use strict";var r=n(2),a=n(98),l=n(3),o=l.details,i=l.publishing;e.exports={parsePublishApiRequestBody:function(e){var t=e.name,n=e.nsfw,r=e.license,a=e.title,l=e.description,o=e.thumbnail;if(!t)throw new Error("no name field found in request");if(/[^A-Za-z0-9,-]/.exec(t))throw new Error('The claim name you provided is not allowed. Only the following characters are allowed: A-Z, a-z, 0-9, and "-"');return n="true"===n,r=r||null,a=a||null,l=l||null,o=o||null,{name:t,nsfw:n,license:r,title:a,description:l,thumbnail:o}},parsePublishApiRequestFiles:function(t){var n=t.file,r=t.thumbnail;if(!n)throw new Error("no file with key of [file] found in request");if(!n.path)throw new Error("no file path found");if(!n.type)throw new Error("no file type found");if(!n.size)throw new Error("no file type found");if(/'/.test(n.name))throw new Error("apostrophes are not allowed in the file name");return e.exports.validateFileTypeAndSize(n),{fileName:n.name,filePath:n.path,fileType:n.type,thumbnailFileName:r?r.name:null,thumbnailFilePath:r?r.path:null,thumbnailFileType:r?r.type:null}},validateFileTypeAndSize:function(e){switch(e.type){case"image/jpeg":case"image/jpg":case"image/png":if(e.size>1e7)throw r.debug("publish > file validation > .jpeg/.jpg/.png was too big"),new Error("Sorry, images are limited to 10 megabytes.");break;case"image/gif":if(e.size>5e7)throw r.debug("publish > file validation > .gif was too big"),new Error("Sorry, .gifs are limited to 50 megabytes.");break;case"video/mp4":if(e.size>5e7)throw r.debug("publish > file validation > .mp4 was too big"),new Error("Sorry, videos are limited to 50 megabytes.");break;default:throw r.debug("publish > file validation > unrecognized file type"),new Error("The "+e.type+" content type is not supported. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.")}return e},createBasicPublishParams:function(e,t,n,a,l,u,s){r.debug("Creating Publish Parameters"),null!==n&&""!==n.trim()||(n=t),null!==a&&""!==a.trim()||(a=""),null!==l&&""!==l.trim()||(l=" ");var c={name:t,file_path:e,bid:.01,metadata:{description:a,title:n,author:o.title,language:"en",license:l,nsfw:u},claim_address:i.primaryClaimAddress};return s&&(c.metadata.thumbnail=s),c},createThumbnailPublishParams:function(e,t,n,a){if(e)return r.debug("Creating Thumbnail Publish Parameters"),{name:t+"-thumb",file_path:e,bid:.01,metadata:{title:t+" thumbnail",description:"a thumbnail for "+t,author:o.title,language:"en",license:n,nsfw:a},claim_address:i.primaryClaimAddress,channel_name:i.thumbnailChannel,channel_id:i.thumbnailChannelId}},deleteTemporaryFile:function(e){a.unlink(e,function(t){if(t)throw r.error("error deleting temporary file "+e),t;r.debug("successfully deleted "+e)})},addGetResultsToFileData:function(e,t){return e.fileName=t.file_name,e.filePath=t.download_path,e},createFileData:function(e){var t=e.name,n=e.claimId,r=e.outpoint,a=e.height,l=e.address,o=e.nsfw;return{name:t,claimId:n,outpoint:r,height:a,address:l,fileName:"",filePath:"",fileType:e.contentType,nsfw:o}}}},function(e,t){e.exports=require("fs")},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(2);e.exports={handleErrorResponse:function(t,n,l,o){a.error("Error on "+t,e.exports.useObjectPropertiesIfNoKeys(l));var i=e.exports.returnErrorMessageAndStatus(l),u=r(i,2),s=u[0],c=u[1];o.status(s).json(e.exports.createErrorResponsePayload(s,c))},returnErrorMessageAndStatus:function(e){var t=void 0,n=void 0;return"ECONNREFUSED"===e.code?(t=503,n="Connection refused. The daemon may not be running."):(t=400,n=e.message?e.message:e),[t,n]},useObjectPropertiesIfNoKeys:function(e){if(0===Object.keys(e).length){var t={};return Object.getOwnPropertyNames(e).forEach(function(n){t[n]=e[n]}),t}return e},createErrorResponsePayload:function(e,t){return{status:e,success:!1,message:t}}}},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(9),l=n(2),o=n(145),i=o.returnPaginatedChannelClaims;e.exports={getClaimId:function(t,n,r,a){return t?e.exports.getClaimIdByChannel(t,n,r):e.exports.getClaimIdByClaim(r,a)},getClaimIdByClaim:function(e,t){return l.debug("getClaimIdByClaim("+e+", "+t+")"),new Promise(function(n,r){a.Claim.getLongClaimId(e,t).then(function(e){e||n("NO_CLAIM"),n(e)}).catch(function(e){r(e)})})},getClaimIdByChannel:function(e,t,n){return l.debug("getClaimIdByChannel("+e+", "+t+", "+n+")"),new Promise(function(l,o){a.Certificate.getLongChannelId(e,t).then(function(e){return e?Promise.all([e,a.Claim.getClaimIdByLongChannelId(e,n)]):[null,null]}).then(function(e){var t=r(e,2),n=t[0],a=t[1];return n?a?void l(a):l("NO_CLAIM"):l("NO_CHANNEL")}).catch(function(e){o(e)})})},getChannelData:function(e,t,n){return new Promise(function(n,l){a.Certificate.getLongChannelId(e,t).then(function(t){return t?Promise.all([t,a.Certificate.getShortChannelIdFromLongChannelId(t,e)]):[null,null,null]}).then(function(t){var a=r(t,2),l=a[0],o=a[1];if(!l)return n("NO_CHANNEL");n({channelName:e,longChannelClaimId:l,shortChannelClaimId:o})}).catch(function(e){l(e)})})},getChannelClaims:function(e,t,n){return new Promise(function(l,o){a.Certificate.getLongChannelId(e,t).then(function(e){return e?Promise.all([e,a.Claim.getAllChannelClaims(e)]):[null,null,null]}).then(function(t){var a=r(t,2),o=a[0],u=a[1];if(!o)return l("NO_CHANNEL");var s=i(e,o,u,n);l(s)}).catch(function(e){o(e)})})},getLocalFileRecord:function(e,t){return a.File.findOne({where:{claimId:e,name:t}}).then(function(e){return e?e.dataValues:"NO_FILE"})}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var a=n(0),l=r(a),o=n(102),i=n(57),u=n(103),s=r(u),c=n(1),d=n(4),f=n(13),p=r(f),h=n(108),m=r(h),b=n(113),v=r(b),g=n(48),y=r(g);e.exports=function(e,t){var n={},r=(0,i.createStore)(s.default),a=(0,o.renderToString)(l.default.createElement(c.Provider,{store:r},l.default.createElement(d.StaticRouter,{location:e.url,context:n},l.default.createElement(p.default,null,l.default.createElement(m.default,null))))),u=y.default.renderStatic();if(n.url)return t.redirect(301,n.url);var f=r.getState();t.send((0,v.default)(u,a,f))}},function(e,t){e.exports=require("react-dom/server")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(57),l=n(147),o=r(l),i=n(148),u=r(i),s=n(149),c=r(s),d=n(150),f=r(d);t.default=(0,a.combineReducers)({channel:u.default,publish:o.default,show:c.default,site:f.default})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FILE_SELECTED="FILE_SELECTED",t.FILE_CLEAR="FILE_CLEAR",t.METADATA_UPDATE="METADATA_UPDATE",t.CLAIM_UPDATE="CLAIM_UPDATE",t.SET_PUBLISH_IN_CHANNEL="SET_PUBLISH_IN_CHANNEL",t.PUBLISH_STATUS_UPDATE="PUBLISH_STATUS_UPDATE",t.ERROR_UPDATE="ERROR_UPDATE",t.SELECTED_CHANNEL_UPDATE="SELECTED_CHANNEL_UPDATE",t.TOGGLE_METADATA_INPUTS="TOGGLE_METADATA_INPUTS",t.THUMBNAIL_NEW="THUMBNAIL_NEW",t.PUBLISH_START="PUBLISH_START"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LOGIN="Existing",t.CREATE="New"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CHANNEL_UPDATE="CHANNEL_UPDATE"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LOCAL_CHECK="LOCAL_CHECK",t.UNAVAILABLE="UNAVAILABLE",t.ERROR="ERROR",t.AVAILABLE="AVAILABLE"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),l=r(a),o=n(4),i=n(58),u=n(20),s=r(u),c=n(23),d=r(c),f=n(26),p=r(f),h=n(35),m=r(h),b=(0,i.dynamicImport)("pages/HomePage"),v=function(){return l.default.createElement(o.Switch,null,l.default.createElement(o.Route,{exact:!0,path:"/",component:b}),l.default.createElement(o.Route,{exact:!0,path:"/about",component:s.default}),l.default.createElement(o.Route,{exact:!0,path:"/login",component:d.default}),l.default.createElement(o.Route,{exact:!0,path:"/:identifier/:claim",component:p.default}),l.default.createElement(o.Route,{exact:!0,path:"/:claim",component:p.default}),l.default.createElement(o.Route,{component:m.default}))};t.default=v},function(e,t,n){function r(e){return n(a(e))}function a(e){var t=l[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var l={"./canonicalLink":59,"./canonicalLink.js":59,"./dynamicImport":58,"./dynamicImport.js":58,"./file":60,"./file.js":60,"./lbryUri":61,"./lbryUri.js":61,"./metaTags":62,"./metaTags.js":62,"./pageTitle":63,"./pageTitle.js":63,"./publish":110,"./publish.js":110,"./request":8,"./request.js":8,"./validate":111,"./validate.js":111};r.keys=function(){return Object.keys(l)},r.resolve=a,e.exports=r,r.id=109},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.createPublishMetadata=function(e,t,n,r,a){var l=t.type,o=n.title,i=n.description,u=n.license,s=n.nsfw,c={name:e,title:o,description:i,license:u,nsfw:s,type:l};return r&&(c.channelName=a),c},t.createPublishFormData=function(e,t,n){var r=new FormData;r.append("file",e),t&&r.append("thumbnail",t);for(var a in n)n.hasOwnProperty(a)&&r.append(a,n[a]);return r},t.createThumbnailUrl=function(e,t,n,r){return r+"/"+e+":"+t+"/"+n+"-thumb.png"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.validateChannelSelection=function(e,t,n){if(e&&t!==n.name)throw new Error("Log in to a channel or select Anonymous")},t.validatePublishParams=function(e,t,n){if(!e)throw new Error("Please choose a file");if(!t)throw new Error("Please enter a URL");if(n)throw new Error("Fix the url")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CHANNEL="CHANNEL",t.ASSET_LITE="ASSET_LITE",t.ASSET_DETAILS="ASSET_DETAILS"},function(e,t,n){"use strict";e.exports=function(e,t,n){return'\n <!DOCTYPE html>\n <html lang="en" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">\n <meta http-equiv="X-UA-Compatible" content="ie=edge">\n \x3c!--helmet--\x3e\n '+e.title.toString()+"\n "+e.meta.toString()+"\n "+e.link.toString()+'\n \x3c!--style sheets--\x3e\n <link rel="stylesheet" href="/assets/css/reset.css" type="text/css">\n <link rel="stylesheet" href="/assets/css/general.css" type="text/css">\n <link rel="stylesheet" href="/assets/css/mediaQueries.css" type="text/css">\n \x3c!--google font--\x3e\n <link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet">\n </head>\n <body id="main-body">\n <div class="row row--tall flex-container--column">\n <div id="react-app" class="row row--tall flex-container--column">'+t+"</div>\n </div>\n <script>\n window.__PRELOADED_STATE__ = "+JSON.stringify(n).replace(/</g,"\\<")+'\n <\/script>\n <script src="/bundle/bundle.js"><\/script>\n </body>\n </html>\n '}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.selectSiteState=function(e){return e.site},t.selectSiteHost=function(e){return e.site.host}},function(e,t,n){n(116),n(117),e.exports=n(118)},function(e,t){e.exports=require("babel-polyfill")},function(e,t){e.exports=require("whatwg-fetch")},function(e,t,n){"use strict";var r=n(119),a=n(50),l=n(52),o=n(53),i={Server:r,Components:a,Containers:l,Pages:o};e.exports=i},function(e,t,n){"use strict";function r(){var e=this;this.configureMysql=function(e){n(92).configure(e)},this.configureSite=function(t){n(3).configure(t),e.sessionKey=t.auth.sessionKey,e.PORT=t.details.port},this.configureSlack=function(e){n(93).configure(e)},this.createApp=function(){var t=a();t.enable("trust proxy"),t.use(u()),t.use(a.static(__dirname+"/public")),t.use(l.json()),t.use(l.urlencoded({extended:!0})),t.use(function(e,t,n){m.verbose("Request on "+e.originalUrl+" from "+e.ip),n()}),s.serializeUser(d),s.deserializeUser(f);var r=n(128),c=n(139);s.use("local-signup",r),s.use("local-login",c),t.use(p({name:"session",keys:[e.sessionKey],maxAge:864e5})),t.use(s.initialize()),t.use(s.session());var h=o.create({defaultLayout:"embed",handlebars:i});t.engine("handlebars",h.engine),t.set("view engine","handlebars"),n(140)(t),n(141)(t),n(146)(t),n(153)(t),n(163)(t),e.app=t},this.initialize=function(){n(164)(m),n(166)(m),e.createApp(),e.server=h.Server(e.app)},this.start=function(){n(9).sequelize.sync().then(function(){e.server.listen(e.PORT,function(){m.info("Server is listening on PORT "+e.PORT)})}).catch(function(e){m.error("Startup Error:",e)})}}var a=n(120),l=n(121),o=n(122),i=n(123),u=n(124),s=n(91),c=n(125),d=c.serializeSpeechUser,f=c.deserializeSpeechUser,p=n(126),h=n(127),m=n(2);e.exports=r},function(e,t){e.exports=require("express")},function(e,t){e.exports=require("body-parser")},function(e,t){e.exports=require("express-handlebars")},function(e,t){e.exports=require("handlebars")},function(e,t){e.exports=require("helmet")},function(e,t,n){"use strict";var r=n(2);e.exports={serializeSpeechUser:function(e,t){r.debug("serializing user"),t(null,e)},deserializeSpeechUser:function(e,t){r.debug("deserializing user"),t(null,e)}}},function(e,t){e.exports=require("cookie-session")},function(e,t){e.exports=require("http")},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(94).Strategy,l=n(55),o=n(2),i=n(9);e.exports=new a({usernameField:"username",passwordField:"password"},function(e,t,n){o.verbose("new channel signup request. user: "+e+" pass: "+t+" .");var a={};return l.createChannel("@"+e).then(function(n){var r={userName:e,password:t};o.verbose("userData >",r);var a={channelName:"@"+e,channelClaimId:n.claim_id};o.verbose("channelData >",a);var l={claimId:n.claim_id,name:"@"+e};return o.verbose("certificateData >",l),Promise.all([i.User.create(r),i.Channel.create(a),i.Certificate.create(l)])}).then(function(e){var t=r(e,3),n=t[0],l=t[1],i=t[2];return o.verbose("user and certificate successfully created"),a.id=n.id,a.userName=n.userName,a.channelName=l.channelName,a.channelClaimId=l.channelClaimId,Promise.all([i.setChannel(l),l.setUser(n)])}).then(function(){return o.verbose("user and certificate successfully associated"),i.Certificate.getShortChannelIdFromLongChannelId(a.channelClaimId,a.channelName)}).then(function(e){return a.shortChannelId=e,n(null,a)}).catch(function(e){return o.error("signup error",e),n(e)})})},function(e,t){e.exports=require("axios")},function(e,t,n){"use strict";var r={api:{apiHost:"localhost",apiPort:"5279"}};e.exports=r},function(e,t){e.exports=require("universal-analytics")},function(e,t,n){"use strict";var r=n(2),a=n(96),l=a.returnShortId;e.exports=function(e,t){var n=t.STRING,a=t.BOOLEAN,o=t.INTEGER,i=t.TEXT,u=t.DECIMAL,s=e.define("Certificate",{address:{type:n,default:null},amount:{type:u(19,8),default:null},claimId:{type:n,default:null},claimSequence:{type:o,default:null},decodedClaim:{type:a,default:null},depth:{type:o,default:null},effectiveAmount:{type:u(19,8),default:null},hasSignature:{type:a,default:null},height:{type:o,default:null},hex:{type:i("long"),default:null},name:{type:n,default:null},nout:{type:o,default:null},txid:{type:n,default:null},validAtHeight:{type:o,default:null},outpoint:{type:n,default:null},valueVersion:{type:n,default:null},claimType:{type:n,default:null},certificateVersion:{type:n,default:null},keyType:{type:n,default:null},publicKey:{type:i("long"),default:null}},{freezeTableName:!0});return s.associate=function(e){s.belongsTo(e.Channel,{foreignKey:{allowNull:!0}})},s.getShortChannelIdFromLongChannelId=function(e,t){var n=this;return r.debug("getShortChannelIdFromLongChannelId "+t+":"+e),new Promise(function(r,a){n.findAll({where:{name:t},order:[["height","ASC"]]}).then(function(t){switch(t.length){case 0:throw new Error("No channel(s) found with that channel name");default:return r(l(t,e))}}).catch(function(e){a(e)})})},s.getLongChannelIdFromShortChannelId=function(e,t){var n=this;return r.debug("getLongChannelIdFromShortChannelId("+e+", "+t+")"),new Promise(function(r,a){n.findAll({where:{name:e,claimId:{$like:t+"%"}},order:[["height","ASC"]]}).then(function(e){switch(e.length){case 0:return r(null);default:return r(e[0].claimId)}}).catch(function(e){a(e)})})},s.getLongChannelIdFromChannelName=function(e){var t=this;return r.debug("getLongChannelIdFromChannelName("+e+")"),new Promise(function(n,r){t.findAll({where:{name:e},order:[["effectiveAmount","DESC"],["height","ASC"]]}).then(function(e){switch(e.length){case 0:return n(null);default:return n(e[0].claimId)}}).catch(function(e){r(e)})})},s.validateLongChannelId=function(e,t){var n=this;return r.debug("validateLongChannelId("+e+", "+t+")"),new Promise(function(r,a){n.findOne({where:{name:e,claimId:t}}).then(function(e){if(!e)return r(null);r(t)}).catch(function(e){a(e)})})},s.getLongChannelId=function(e,t){return r.debug("getLongChannelId("+e+", "+t+")"),t&&40===t.length?this.validateLongChannelId(e,t):t&&t.length<40?this.getLongChannelIdFromShortChannelId(e,t):this.getLongChannelIdFromChannelName(e)},s}},function(e,t,n){"use strict";e.exports=function(e,t){var n=t.STRING,r=e.define("Channel",{channelName:{type:n,allowNull:!1},channelClaimId:{type:n,allowNull:!1}},{freezeTableName:!0});return r.associate=function(e){r.belongsTo(e.User),r.hasOne(e.Certificate)},r}},function(e,t,n){"use strict";function r(e){switch(e){case"image/jpeg":case"image/jpg":return"jpeg";case"image/png":return"png";case"image/gif":return"gif";case"video/mp4":return"mp4";default:return o.debug("setting unknown file type as file extension jpeg"),"jpeg"}}function a(e,t){return""===e?t:e}function l(e){return e.thumbnail=a(e.thumbnail,c),e.fileExt=r(e.contentType),e.host=d,e}var o=n(2),i=n(96),u=i.returnShortId,s=n(3),c=s.assetDefaults.thumbnail,d=s.details.host;e.exports=function(e,t){var n=t.STRING,i=t.BOOLEAN,s=t.INTEGER,d=t.TEXT,f=t.DECIMAL,p=e.define("Claim",{address:{type:n,default:null},amount:{type:f(19,8),default:null},claimId:{type:n,default:null},claimSequence:{type:s,default:null},decodedClaim:{type:i,default:null},depth:{type:s,default:null},effectiveAmount:{type:f(19,8),default:null},hasSignature:{type:i,default:null},height:{type:s,default:null},hex:{type:d("long"),default:null},name:{type:n,default:null},nout:{type:s,default:null},txid:{type:n,default:null},validAtHeight:{type:s,default:null},outpoint:{type:n,default:null},claimType:{type:n,default:null},certificateId:{type:n,default:null},author:{type:n,default:null},description:{type:d("long"),default:null},language:{type:n,default:null},license:{type:n,default:null},licenseUrl:{type:n,default:null},nsfw:{type:i,default:null},preview:{type:n,default:null},thumbnail:{type:n,default:null},title:{type:n,default:null},metadataVersion:{type:n,default:null},contentType:{type:n,default:null},source:{type:n,default:null},sourceType:{type:n,default:null},sourceVersion:{type:n,default:null},streamVersion:{type:n,default:null},valueVersion:{type:n,default:null},channelName:{type:n,allowNull:!0,default:null}},{freezeTableName:!0});return p.associate=function(e){p.belongsTo(e.File,{foreignKey:{allowNull:!0}})},p.getShortClaimIdFromLongClaimId=function(e,t){var n=this;return o.debug("Claim.getShortClaimIdFromLongClaimId for "+t+"#"+e),new Promise(function(r,a){n.findAll({where:{name:t},order:[["height","ASC"]]}).then(function(t){switch(t.length){case 0:throw new Error("No claim(s) found with that claim name");default:r(u(t,e))}}).catch(function(e){a(e)})})},p.getAllChannelClaims=function(e){var t=this;return o.debug("Claim.getAllChannelClaims for "+e),new Promise(function(n,l){t.findAll({where:{certificateId:e},order:[["height","ASC"]],raw:!0}).then(function(e){switch(e.length){case 0:return n(null);default:return e.forEach(function(e){return e.fileExt=r(e.contentType),e.thumbnail=a(e.thumbnail,c),e}),n(e)}}).catch(function(e){l(e)})})},p.getClaimIdByLongChannelId=function(e,t){var n=this;return o.debug("finding claim id for claim "+t+" from channel "+e),new Promise(function(r,a){n.findAll({where:{name:t,certificateId:e},order:[["id","ASC"]]}).then(function(n){switch(n.length){case 0:return r(null);case 1:return r(n[0].claimId);default:return o.error(n.length+' records found for "'+t+'" in channel "'+e+'"'),r(n[0].claimId)}}).catch(function(e){a(e)})})},p.getLongClaimIdFromShortClaimId=function(e,t){var n=this;return new Promise(function(r,a){n.findAll({where:{name:e,claimId:{$like:t+"%"}},order:[["height","ASC"]]}).then(function(e){switch(e.length){case 0:return r(null);default:return r(e[0].claimId)}}).catch(function(e){a(e)})})},p.getTopFreeClaimIdByClaimName=function(e){var t=this;return new Promise(function(n,r){t.findAll({where:{name:e},order:[["effectiveAmount","DESC"],["height","ASC"]]}).then(function(e){switch(o.debug("length of result",e.length),e.length){case 0:return n(null);default:return n(e[0].dataValues.claimId)}}).catch(function(e){r(e)})})},p.validateLongClaimId=function(e,t){var n=this;return new Promise(function(r,a){n.findOne({where:{name:e,claimId:t}}).then(function(e){if(!e)return r(null);r(t)}).catch(function(e){a(e)})})},p.getLongClaimId=function(e,t){return o.debug("getLongClaimId("+e+", "+t+")"),t&&40===t.length?this.validateLongClaimId(e,t):t&&t.length<40?this.getLongClaimIdFromShortClaimId(e,t):this.getTopFreeClaimIdByClaimName(e)},p.resolveClaim=function(e,t){var n=this;return o.debug("Claim.resolveClaim: "+e+" "+t),new Promise(function(r,a){n.findAll({where:{name:e,claimId:t}}).then(function(n){switch(n.length){case 0:return r(null);case 1:return r(l(n[0].dataValues));default:return o.error("more than one record matches "+e+"#"+t+" in db.Claim"),r(l(n[0].dataValues))}}).catch(function(e){a(e)})})},p}},function(e,t,n){"use strict";e.exports=function(e,t){var n=t.STRING,r=t.BOOLEAN,a=t.INTEGER,l=e.define("File",{name:{type:n,allowNull:!1},claimId:{type:n,allowNull:!1},address:{type:n,allowNull:!1},outpoint:{type:n,allowNull:!1},height:{type:a,allowNull:!1,default:0},fileName:{type:n,allowNull:!1},filePath:{type:n,allowNull:!1},fileType:{type:n},nsfw:{type:r,allowNull:!1,defaultValue:!1},trendingEligible:{type:r,allowNull:!1,defaultValue:!0}},{freezeTableName:!0});return l.associate=function(e){l.hasMany(e.Request),l.hasOne(e.Claim)},l.getRecentClaims=function(){return this.findAll({where:{nsfw:!1,trendingEligible:!0},order:[["createdAt","DESC"]],limit:25})},l}},function(e,t,n){"use strict";e.exports=function(e,t){var n=t.STRING,r=(t.BOOLEAN,t.TEXT),a=e.define("Request",{action:{type:n,allowNull:!1},url:{type:n,allowNull:!1},ipAddress:{type:n,allowNull:!0},result:{type:r("long"),allowNull:!0,default:null}},{freezeTableName:!0});return a.associate=function(e){a.belongsTo(e.File,{foreignKey:{allowNull:!0}})},a}},function(e,t,n){"use strict";var r=n(138),a=n(2);e.exports=function(e,t){var n=t.STRING,l=e.define("User",{userName:{type:n,allowNull:!1},password:{type:n,allowNull:!1}},{freezeTableName:!0});return l.associate=function(e){l.hasOne(e.Channel)},l.prototype.comparePassword=function(e){return r.compare(e,this.password)},l.prototype.changePassword=function(e){var t=this;return new Promise(function(n,l){r.genSalt(function(o,i){if(o)return a.error("salt error",o),void l(o);r.hash(e,i,function(e,r){if(e)return a.error("hash error",e),void l(e);t.update({password:r}).then(function(){n()}).catch(function(e){l(e)})})})})},l.hook("beforeCreate",function(e,t){return a.debug("User.beforeCreate hook..."),new Promise(function(t,n){r.genSalt(function(l,o){if(l)return a.error("salt error",l),void n(l);r.hash(e.password,o,function(r,l){if(r)return a.error("hash error",r),void n(r);e.password=l,t()})})})}),l}},function(e,t){e.exports=require("bcrypt")},function(e,t,n){"use strict";var r=n(94).Strategy,a=n(2),l=n(9),o=function(e){return new Promise(function(t,n){var r={};r.id=e.id,r.userName=e.userName,e.getChannel().then(function(e){var t=e.channelName,n=e.channelClaimId;return r.channelName=t,r.channelClaimId=n,l.Certificate.getShortChannelIdFromLongChannelId(n,t)}).then(function(e){r.shortChannelId=e,t(r)}).catch(function(e){n(e)})})};e.exports=new r({usernameField:"username",passwordField:"password"},function(e,t,n){return l.User.findOne({where:{userName:e}}).then(function(e){return e?e.comparePassword(t).then(function(t){return t?(a.debug("Password was a match, returning User"),o(e).then(function(e){return n(null,e)}).catch(function(e){return e})):(a.debug("incorrect password"),n(null,!1,{message:"Incorrect username or password"}))}).catch(function(e){return e}):(a.debug("no user found"),n(null,!1,{message:"Incorrect username or password"}))}).catch(function(e){return n(e)})})},function(e,t,n){"use strict";var r=n(2),a=n(91);e.exports=function(e){e.post("/signup",a.authenticate("local-signup"),function(e,t){r.verbose("successful signup for "+e.user.channelName),t.status(200).json({success:!0,channelName:e.user.channelName,channelClaimId:e.user.channelClaimId,shortChannelId:e.user.shortChannelId})}),e.post("/login",function(e,t,n){a.authenticate("local-login",function(a,l,o){return a?n(a):l?(r.debug("successful login"),void e.logIn(l,function(r){return r?n(r):t.status(200).json({success:!0,channelName:e.user.channelName,channelClaimId:e.user.channelClaimId,shortChannelId:e.user.shortChannelId})})):t.status(400).json({success:!1,message:o.message})})(e,t,n)}),e.get("/logout",function(e,t){e.logout(),t.status(200).json({success:!0,message:"you successfully logged out"})}),e.get("/user",function(e,t){e.user?t.status(200).json({success:!0,data:e.user}):t.status(401).json({success:!1,message:"user is not logged in"})})}},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(2),l=n(142),o=n(3),i=o.publishing.uploadDirectory,u=o.details.host,s=l({uploadDir:i}),c=n(9),d=n(143),f=d.claimNameIsAvailable,p=d.checkChannelAvailability,h=d.publish,m=n(55),b=m.getClaimList,v=m.resolveUri,g=m.getClaim,y=n(97),w=y.addGetResultsToFileData,E=y.createBasicPublishParams,_=y.createThumbnailPublishParams,C=y.parsePublishApiRequestBody,N=y.parsePublishApiRequestFiles,P=y.createFileData,I=n(99),O=n(56),x=O.sendGATimingEvent,S=n(144),j=S.authenticateUser,A=n(100),T=A.getChannelData,L=A.getChannelClaims,k=A.getClaimId;e.exports=function(e){e.get("/api/channel/availability/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params.name,l=Date.now();p(a).then(function(e){t.status(200).json(e),x("end-to-end","claim name availability",a,l,Date.now())}).catch(function(e){I.handleErrorResponse(r,n,e,t)})}),e.get("/api/channel/short-id/:longId/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params;c.Certificate.getShortChannelIdFromLongChannelId(a.longId,a.name).then(function(e){t.status(200).json(e)}).catch(function(e){I.handleErrorResponse(r,n,e,t)})}),e.get("/api/channel/data/:channelName/:channelClaimId",function(e,t){var n=e.ip,r=e.originalUrl,a=(e.body,e.params),l=a.channelName,o=a.channelClaimId;"none"===o&&(o=null),T(l,o,0).then(function(e){if("NO_CHANNEL"===e)return t.status(404).json({success:!1,message:"No matching channel was found"});t.status(200).json({success:!0,data:e})}).catch(function(e){I.handleErrorResponse(r,n,e,t)})}),e.get("/api/channel/claims/:channelName/:channelClaimId/:page",function(e,t){var n=e.ip,r=e.originalUrl,a=(e.body,e.params),l=a.channelName,o=a.channelClaimId;"none"===o&&(o=null);var i=a.page;L(l,o,i).then(function(e){if("NO_CHANNEL"===e)return t.status(404).json({success:!1,message:"No matching channel was found"});t.status(200).json({success:!0,data:e})}).catch(function(e){I.handleErrorResponse(r,n,e,t)})}),e.get("/api/claim/list/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params;b(a.name).then(function(e){t.status(200).json(e)}).catch(function(e){I.handleErrorResponse(r,n,e,t)})}),e.get("/api/claim/get/:name/:claimId",function(e,t){var n=e.ip,a=e.originalUrl,l=e.params,o=l.name,i=l.claimId;c.Claim.resolveClaim(o,i).then(function(e){if(!e)throw new Error("No matching uri found in Claim table");var t=P(e);return Promise.all([t,g(o+"#"+i)])}).then(function(e){var t=r(e,2),n=t[0],a=t[1];return n=w(n,a),Promise.all([c.upsert(c.File,n,{name:o,claimId:i},"File"),a])}).then(function(e){var n=r(e,2),a=(n[0],n[1]),l=a.message,o=a.completed;t.status(200).json({success:!0,message:l,completed:o})}).catch(function(e){I.handleErrorResponse(a,n,e,t)})}),e.get("/api/claim/availability/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params.name,l=Date.now();f(a).then(function(e){t.status(200).json(e),x("end-to-end","claim name availability",a,l,Date.now())}).catch(function(e){I.handleErrorResponse(r,n,e,t)})}),e.get("/api/claim/resolve/:name/:claimId",function(e,t){var n=(e.headers,e.ip),r=e.originalUrl,a=e.params;v(a.name+"#"+a.claimId).then(function(e){t.status(200).json(e)}).catch(function(e){I.handleErrorResponse(r,n,e,t)})}),e.post("/api/claim/publish",s,function(e,t){var n=e.body,a=e.files,l=(e.headers,e.ip),o=e.originalUrl,i=e.user,s=void 0,c=void 0,d=void 0,p=void 0,m=void 0,b=void 0,v=void 0,g=void 0,y=void 0,w=void 0,P=void 0,O=void 0,S=void 0,A=void 0,T=void 0,L=void 0;g=Date.now();try{var k=C(n);w=k.name,P=k.nsfw,y=k.license,L=k.title,p=k.description,O=k.thumbnail;var R=N(a);m=R.fileName,b=R.filePath,v=R.fileType,S=R.thumbnailFileName,A=R.thumbnailFilePath,T=R.thumbnailFileType,s=n.channelName,c=n.channelId,d=n.channelPassword}catch(e){return t.status(400).json({success:!1,message:e.message})}Promise.all([j(s,c,d,i),f(w),E(b,w,L,p,y,P,O),_(A,w,y,P)]).then(function(e){var t=r(e,4),n=t[0],a=n.channelName,l=n.channelClaimId,o=(t[1],t[2]),i=t[3];return a&&l&&(o.channel_name=a,o.channel_id=l),i&&h(i,S,T),h(o,m,v)}).then(function(e){t.status(200).json({success:!0,message:"publish completed successfully",data:{name:w,claimId:e.claim_id,url:u+"/"+e.claim_id+"/"+w,lbryTx:e}}),x("end-to-end","publish",v,g,Date.now())}).catch(function(e){I.handleErrorResponse(o,l,e,t)})}),e.get("/api/claim/short-id/:longId/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=(e.body,e.params);c.Claim.getShortClaimIdFromLongClaimId(a.longId,a.name).then(function(e){t.status(200).json({success:!0,data:e})}).catch(function(e){I.handleErrorResponse(r,n,e,t)})}),e.post("/api/claim/long-id",function(e,t){var n=e.ip,r=e.originalUrl,l=e.body;e.params;a.debug("body:",l);var o=l.channelName,i=l.channelClaimId,u=l.claimName,s=l.claimId;k(o,i,u,s).then(function(e){return"NO_CHANNEL"===e?t.status(404).json({success:!1,message:"No matching channel could be found"}):"NO_CLAIM"===e?t.status(404).json({success:!1,message:"No matching claim id could be found"}):void t.status(200).json({success:!0,data:e})}).catch(function(e){I.handleErrorResponse(r,n,e,t)})}),e.get("/api/claim/data/:claimName/:claimId",function(e,t){var n=e.ip,r=e.originalUrl,a=(e.body,e.params),l=a.claimName,o=a.claimId;"none"===o&&(o=null),c.Claim.resolveClaim(l,o).then(function(e){if(!e)return t.status(404).json({success:!1,message:"No claim could be found"});t.status(200).json({success:!0,data:e})}).catch(function(e){I.handleErrorResponse(r,n,e,t)})}),e.get("/api/file/availability/:name/:claimId",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params,l=a.name,o=a.claimId;c.File.findOne({where:{name:l,claimId:o}}).then(function(e){if(e)return t.status(200).json({success:!0,data:!0});t.status(200).json({success:!0,data:!1})}).catch(function(e){I.handleErrorResponse(r,n,e,t)})})}},function(e,t){e.exports=require("connect-multiparty")},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=n(2),o=n(9),i=n(55),u=n(97),s=n(3),c=s.publishing,d=c.primaryClaimAddress,f=c.additionalClaimAddresses,p=n(95),h=p.Op;e.exports={publish:function(e,t,n){return new Promise(function(r,s){var c=void 0,d=void 0,f=void 0;return i.publishClaim(e).then(function(n){return l.info("Successfully published "+e.name+" "+t,n),c=n,e.channel_name?(l.debug("this claim was published in channel: "+e.channel_name),o.Channel.findOne({where:{channelName:e.channel_name}})):(l.debug("this claim was not published in a channel"),null)}).then(function(e){d=null,f=null,e&&(d=e.channelClaimId,f=e.channelName),l.debug("certificateId: "+d)}).then(function(){var r={name:e.name,claimId:c.claim_id,title:e.metadata.title,description:e.metadata.description,address:e.claim_address,outpoint:c.txid+":"+c.nout,height:0,fileName:t,filePath:e.file_path,fileType:n,nsfw:e.metadata.nsfw},a={name:e.name,claimId:c.claim_id,title:e.metadata.title,description:e.metadata.description,address:e.claim_address,thumbnail:e.metadata.thumbnail,outpoint:c.txid+":"+c.nout,height:0,contentType:n,nsfw:e.metadata.nsfw,amount:e.bid,certificateId:d,channelName:f},l={name:e.name,claimId:c.claim_id};return Promise.all([o.upsert(o.File,r,l,"File"),o.upsert(o.Claim,a,l,"Claim")])}).then(function(e){var t=a(e,2),n=t[0],r=t[1];return l.debug("File and Claim records successfully created"),Promise.all([n.setClaim(r),r.setFile(n)])}).then(function(){l.debug("File and Claim records successfully associated"),r(c)}).catch(function(t){l.error("PUBLISH ERROR",t),u.deleteTemporaryFile(e.file_path),s(t)})})},claimNameIsAvailable:function(e){var t=f||[];return t.push(d),o.Claim.findAll({attributes:["address"],where:{name:e,address:r({},h.or,t)}}).then(function(t){if(t.length>=1)throw new Error("That claim is already in use");return e}).catch(function(e){throw e})},checkChannelAvailability:function(e){return o.Channel.findAll({where:{channelName:e}}).then(function(t){if(t.length>=1)throw new Error("That channel has already been claimed");return e}).catch(function(e){throw e})}}},function(e,t,n){"use strict";var r=n(9),a=n(2);e.exports={authenticateUser:function(t,n,r,a){if(!t&&!n)return{channelName:null,channelClaimId:null};if(a){if(t&&t!==a.channelName)throw new Error("the provided channel name does not match user credentials");if(n&&n!==a.channelClaimId)throw new Error("the provided channel id does not match user credentials");return{channelName:a.channelName,channelClaimId:a.channelClaimId}}if(!r)throw new Error("no channel password provided");return e.exports.authenticateChannelCredentials(t,n,r)},authenticateChannelCredentials:function(e,t,n){return new Promise(function(l,o){var i=void 0,u={};e&&(u.channelName=e),t&&(u.channelClaimId=t),r.Channel.findOne({where:u}).then(function(e){if(!e)throw a.debug("no channel found"),new Error("Authentication failed, you do not have access to that channel");return i=e.get(),a.debug("channel data:",i),r.User.findOne({where:{userName:i.channelName.substring(1)}})}).then(function(e){if(!e)throw a.debug("no user found"),new Error("Authentication failed, you do not have access to that channel");return e.comparePassword(n)}).then(function(e){if(!e)throw a.debug("incorrect password"),new Error("Authentication failed, you do not have access to that channel");a.debug("...password was a match..."),l(i)}).catch(function(e){o(e)})})}}},function(e,t,n){"use strict";e.exports={returnPaginatedChannelClaims:function(t,n,r,a){var l=e.exports.determineTotalPages(r),o=e.exports.getPageFromQuery(a);return{channelName:t,longChannelClaimId:n,claims:e.exports.extractPageFromClaims(r,o),previousPage:e.exports.determinePreviousPage(o),currentPage:o,nextPage:e.exports.determineNextPage(l,o),totalPages:l,totalResults:e.exports.determineTotalClaims(r)}},getPageFromQuery:function(e){return e?parseInt(e):1},extractPageFromClaims:function(e,t){if(!e)return[];var n=12*(t-1),r=n+12;return e.slice(n,r)},determineTotalPages:function(e){if(e){var t=e.length;if(t<12)return 1;var n=Math.floor(t/12);return 0===t%12?n:n+1}return 0},determinePreviousPage:function(e){return 1===e?null:e-1},determineNextPage:function(e,t){return t===e?null:t+1},determineTotalClaims:function(e){return e?e.length:0}}},function(e,t,n){"use strict";var r=n(3),a=r.details,l=n(101);e.exports=function(e){e.get("/",function(e,t){l(e,t)}),e.get("/login",function(e,t){l(e,t)}),e.get("/about",function(e,t){l(e,t)}),e.get("/trending",function(e,t){t.status(301).redirect("/popular")}),e.get("/popular",function(e,t){l(e,t)}),e.get("/new",function(e,t){l(e,t)}),e.get("/embed/:claimId/:name",function(e,t){var n=e.params,r=n.claimId,l=n.name;t.status(200).render("embed",{layout:"embed",host:a,claimId:r,name:l})})}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments[1];switch(t.type){case l.FILE_SELECTED:return Object.assign({},s,{file:t.data});case l.FILE_CLEAR:return s;case l.METADATA_UPDATE:return Object.assign({},e,{metadata:Object.assign({},e.metadata,r({},t.data.name,t.data.value))});case l.CLAIM_UPDATE:return Object.assign({},e,{claim:t.data});case l.SET_PUBLISH_IN_CHANNEL:return Object.assign({},e,{publishInChannel:t.channel});case l.PUBLISH_STATUS_UPDATE:return Object.assign({},e,{status:t.data});case l.ERROR_UPDATE:return Object.assign({},e,{error:Object.assign({},e.error,r({},t.data.name,t.data.value))});case l.SELECTED_CHANNEL_UPDATE:return Object.assign({},e,{selectedChannel:t.data});case l.TOGGLE_METADATA_INPUTS:return Object.assign({},e,{showMetadataInputs:t.data});case l.THUMBNAIL_NEW:return Object.assign({},e,{thumbnail:t.data});default:return e}};var a=n(104),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),o=n(105),i=n(3),u=i.publishing,s={disabled:u.disabled,disabledMessage:u.disabledMessage,publishInChannel:!1,selectedChannel:o.LOGIN,showMetadataInputs:!1,status:{status:null,message:null},error:{file:null,url:null,channel:null,publishSubmit:null},file:null,claim:"",metadata:{title:"",description:"",license:"",nsfw:!1},thumbnail:null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments[1];switch(t.type){case a.CHANNEL_UPDATE:return Object.assign({},e,{loggedInChannel:t.data});default:return e}};var r=n(106),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(r),l={loggedInChannel:{name:null,shortId:null,longId:null}}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments[1];switch(t.type){case l.REQUEST_ERROR:return Object.assign({},e,{request:Object.assign({},e.request,{error:t.data})});case l.REQUEST_UPDATE:return Object.assign({},e,{request:Object.assign({},e.request,{type:t.data.requestType,id:t.data.requestId})});case l.REQUEST_LIST_ADD:return Object.assign({},e,{requestList:Object.assign({},e.requestList,r({},t.data.id,{error:t.data.error,key:t.data.key}))});case l.ASSET_ADD:return Object.assign({},e,{assetList:Object.assign({},e.assetList,r({},t.data.id,{error:t.data.error,name:t.data.name,claimId:t.data.claimId,shortId:t.data.shortId,claimData:t.data.claimData}))});case l.CHANNEL_ADD:return Object.assign({},e,{channelList:Object.assign({},e.channelList,r({},t.data.id,{name:t.data.name,longId:t.data.longId,shortId:t.data.shortId,claimsData:t.data.claimsData}))});case l.CHANNEL_CLAIMS_UPDATE_SUCCESS:return Object.assign({},e,{channelList:Object.assign({},e.channelList,r({},t.data.channelListId,Object.assign({},e.channelList[t.data.channelListId],{claimsData:t.data.claimsData})))});case l.FILE_AVAILABILITY_UPDATE:return Object.assign({},e,{displayAsset:Object.assign({},e.displayAsset,{status:t.data})});case l.DISPLAY_ASSET_ERROR:return Object.assign({},e,{displayAsset:Object.assign({},e.displayAsset,{error:t.data,status:o.ERROR})});default:return e}};var a=n(19),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),o=n(107),i={request:{error:null,type:null,id:null},requestList:{},channelList:{},assetList:{},displayAsset:{error:null,status:o.LOCAL_CHECK}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;return arguments[1].type,e};var r=n(3),a=r.analytics.googleId,l=r.assetDefaults,o=l.thumbnail,i=l.description,u=r.details,s=u.description,c=u.host,d=u.title,f=u.twitter,p={description:s,googleAnalyticsId:a,host:c,title:d,twitter:f,defaultDescription:i,defaultThumbnail:o}},function(e,t){e.exports=require("react-ga")},function(e,t){e.exports=require("cross-fetch/polyfill")},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(56),l=a.sendGAServeEvent,o=n(154),i=o.determineResponseType,u=o.flipClaimNameAndIdForBackwardsCompatibility,s=o.logRequestData,c=o.getClaimIdAndServeAsset,d=n(155),f=n(156);e.exports=function(e){e.get("/:identifier/:claim",function(e,t){var n=e.headers,a=e.ip,o=e.originalUrl,p=e.params,h=void 0;try{h=d.parseModifier(p.claim).hasFileExtension}catch(e){return t.status(400).json({success:!1,message:e.message})}var m=i(h,n);if("SERVE"!==m)return f(e,t);l(n,a,o);var b=void 0;try{b=d.parseClaim(p.claim).claimName}catch(e){return t.status(400).json({success:!1,message:e.message})}var v=void 0,g=void 0,y=void 0,w=void 0;try{var E=d.parseIdentifier(p.identifier);v=E.isChannel,g=E.channelName,y=E.channelClaimId,w=E.claimId}catch(e){return t.status(400).json({success:!1,message:e.message})}if(!v){var _=u(w,b),C=r(_,2);w=C[0],b=C[1]}s(m,b,g,w),c(g,y,b,w,o,a,t)}),e.get("/:claim",function(e,t){var n=e.headers,r=e.ip,a=e.originalUrl,o=e.params,u=void 0;try{u=d.parseModifier(o.claim).hasFileExtension}catch(e){return t.status(400).json({success:!1,message:e.message})}var p=i(u,n);if("SERVE"!==p)return f(e,t);l(n,r,a);var h=void 0;try{h=d.parseClaim(o.claim).claimName}catch(e){return t.status(400).json({success:!1,message:e.message})}s(p,h,null,null),c(null,null,h,null,a,r,t)})}},function(e,t,n){"use strict";function r(e){var t=e.accept;return t&&t.match(/text\/html/)}function a(e){return e["user-agent"]&&e["user-agent"].match(/Mozilla/)}function l(e){var t=e.accept,n=e.range,r=t&&t.match(/image\/.*/)&&!t.match(/text\/html/)&&!t.match(/text\/\*/),a=t&&n;return r||a}function o(e){return 40===e.length&&!/[^A-Za-z0-9]/g.test(e)}function i(e){return 1===e.length}function u(e){return o(e)||i(e)}function s(e,t,n){return p(e,t).then(function(r){if(r===b)return n.status(307).redirect("/api/claim/get/"+t+"/"+e);var a=r.filePath,l=r.fileType;c.verbose("serving file: "+a);var o={headers:{"X-Content-Type-Options":"nosniff","Content-Type":l||"image/jpeg"}};n.status(200).sendFile(a,o)}).catch(function(e){throw e})}var c=n(2),d=n(100),f=d.getClaimId,p=d.getLocalFileRecord,h=n(99),m=h.handleErrorResponse,b="NO_FILE";e.exports={getClaimIdAndServeAsset:function(e,t,n,r,a,l,o){f(e,t,n,r).then(function(e){return"NO_CLAIM"===e?o.status(404).json({success:!1,message:"no claim id could be found"}):"NO_CHANNEL"===e?o.status(404).json({success:!1,message:"no channel id could be found"}):void s(e,n,o)}).catch(function(e){m(a,l,e,o)})},determineResponseType:function(e,t){var n=void 0;return e?(n="SERVE",r(t)&&(n="SHOW")):(n="SHOW",l(t)&&a(t)&&(c.debug("Show request came from browser but wants an image/video. Changing response to serve..."),n="SERVE")),n},flipClaimNameAndIdForBackwardsCompatibility:function(e,t){if(u(t)&&!u(e)){var n=t;t=e,e=n}return[e,t]},logRequestData:function(e,t,n,r){c.debug("responseType ===",e),c.debug("claim name === ",t),c.debug("channel name ===",n),c.debug("claim id ===",r)}}},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(2);e.exports={REGEXP_INVALID_CLAIM:/[^A-Za-z0-9-]/g,REGEXP_INVALID_CHANNEL:/[^A-Za-z0-9-@]/g,REGEXP_ADDRESS:/^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/,CHANNEL_CHAR:"@",parseIdentifier:function(t){a.debug("parsing identifier:",t);var n=new RegExp("([^:$#/]*)([:$#]?)([^/]*)"),l=n.exec(t).map(function(e){return e||null}),o=r(l,4),i=o[0],u=o[1],s=o[2],c=o[3];if(a.debug(i+", "+u+", "+s+", "+c),!u)throw new Error('Check your url. No channel name provided before "'+s+'"');var d=u.startsWith(e.exports.CHANNEL_CHAR),f=d?u:null,p=void 0;if(d){if(!f)throw new Error("No channel name after @.");var h=f.match(e.exports.REGEXP_INVALID_CHANNEL);if(h)throw new Error("Invalid characters in channel name: "+h.join(", ")+".")}else p=u;var m=void 0;if(s){if(!c)throw new Error('No modifier provided after separator "'+s+'"');if(":"!==s)throw new Error('The "'+s+'" modifier is not currently supported');m=c}return{isChannel:d,channelName:f,channelClaimId:m,claimId:p}},parseClaim:function(t){a.debug("parsing name:",t);var n=new RegExp("([^:$#/.]*)([:$#.]?)([^/]*)"),l=n.exec(t).map(function(e){return e||null}),o=r(l,4),i=o[0],u=o[1],s=o[2],c=o[3];if(a.debug(i+", "+u+", "+s+", "+c),!u)throw new Error("No claim name provided before .");var d=u.match(e.exports.REGEXP_INVALID_CLAIM);if(d)throw new Error("Invalid characters in claim name: "+d.join(", ")+".");if(s){if(!c)throw new Error("No file extension provided after separator "+s+".");if("."!==s)throw new Error("The "+s+" modifier is not supported in the claim name")}return{claimName:u}},parseModifier:function(e){a.debug("parsing modifier:",e);var t=new RegExp("([^:$#/.]*)([:$#.]?)([^/]*)"),n=t.exec(e).map(function(e){return e||null}),l=r(n,4),o=l[0],i=l[1],u=l[2],s=l[3];a.debug(o+", "+i+", "+u+", "+s);var c=!1;return u&&(c=!0),{hasFileExtension:c}}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var a=n(0),l=r(a),o=n(102),i=n(57),u=n(103),s=r(u),c=n(1),d=n(4),f=n(13),p=r(f),h=n(108),m=r(h),b=n(113),v=r(b),g=n(157),y=r(g),w=n(49),E=n(158),_=n(11),C=n(48),N=r(C),P=function(e,t){return regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.call)(e,t);case 2:case"end":return n.stop()}},n,this)})};e.exports=function(e,t){var n={},r=(0,y.default)(),a=(0,i.applyMiddleware)(r),u=(0,i.createStore)(s.default,a),f=(0,_.onHandleShowPageUri)(e.params),h=P(E.handleShowPageUri,f);r.run(h).done.then(function(){var r=(0,o.renderToString)(l.default.createElement(c.Provider,{store:u},l.default.createElement(d.StaticRouter,{location:e.url,context:n},l.default.createElement(p.default,null,l.default.createElement(m.default,null))))),a=N.default.renderStatic();if(n.url)return t.redirect(301,n.url);var i=u.getState();t.send((0,v.default)(a,r,i))})}},function(e,t){e.exports=require("redux-saga")},function(e,t,n){"use strict";function r(e,t){var n,r,a,l,o,u,s,f;return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:n=void 0,r=void 0,a=void 0,l=void 0,o=void 0,u=void 0,p.prev=1,s=h.default.parseIdentifier(e),n=s.isChannel,r=s.channelName,a=s.channelClaimId,l=s.claimId,f=h.default.parseClaim(t),o=f.claimName,u=f.extension,p.next=17;break;case 12:return p.prev=12,p.t0=p.catch(1),p.next=16,(0,i.put)((0,c.onRequestError)(p.t0.message));case 16:return p.abrupt("return",p.sent);case 17:if(!n){p.next=21;break}return p.next=20,(0,i.call)(d.newAssetRequest,(0,c.onNewAssetRequest)(o,null,r,a,u));case 20:return p.abrupt("return",p.sent);case 21:return p.next=24,(0,i.call)(d.newAssetRequest,(0,c.onNewAssetRequest)(o,l,null,null,u));case 24:case"end":return p.stop()}},m,this,[[1,12]])}function a(e){var t,n,r,a,l,o,u;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:t=void 0,n=void 0,r=void 0,s.prev=1,a=h.default.parseIdentifier(e),t=a.isChannel,n=a.channelName,r=a.channelClaimId,s.next=13;break;case 8:return s.prev=8,s.t0=s.catch(1),s.next=12,(0,i.put)((0,c.onRequestError)(s.t0.message));case 12:return s.abrupt("return",s.sent);case 13:if(!t){s.next=17;break}return s.next=16,(0,i.call)(f.newChannelRequest,(0,c.onNewChannelRequest)(n,r));case 16:return s.abrupt("return",s.sent);case 17:l=void 0,o=void 0,s.prev=18,u=h.default.parseClaim(e),l=u.claimName,o=u.extension,s.next=29;break;case 24:return s.prev=24,s.t1=s.catch(18),s.next=28,(0,i.put)((0,c.onRequestError)(s.t1.message));case 28:return s.abrupt("return",s.sent);case 29:return s.next=31,(0,i.call)(d.newAssetRequest,(0,c.onNewAssetRequest)(l,null,null,null,o));case 31:case"end":return s.stop()}},b,this,[[1,8],[18,24]])}function l(e){var t,n,l;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(t=e.data,n=t.identifier,l=t.claim,!n){o.next=5;break}return o.next=4,(0,i.call)(r,n,l);case 4:return o.abrupt("return",o.sent);case 5:return o.next=7,(0,i.call)(a,l);case 7:case"end":return o.stop()}},v,this)}function o(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.takeLatest)(s.HANDLE_SHOW_URI,l);case 2:case"end":return e.stop()}},g,this)}Object.defineProperty(t,"__esModule",{value:!0}),t.handleShowPageUri=l,t.watchHandleShowPageUri=o;var i=n(49),u=n(19),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(u),c=n(11),d=n(159),f=n(161),p=n(61),h=function(e){return e&&e.__esModule?e:{default:e}}(p),m=regeneratorRuntime.mark(r),b=regeneratorRuntime.mark(a),v=regeneratorRuntime.mark(l),g=regeneratorRuntime.mark(o)},function(e,t,n){"use strict";function r(e){var t,n,r,a,o,i,p,h,m,b,v,g,y,w;return regeneratorRuntime.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return t=e.data,n=t.requestType,r=t.requestId,a=t.name,o=t.modifier,f.next=3,(0,l.put)((0,u.onRequestUpdate)(n,r));case 3:return f.next=5,(0,l.select)(c.selectShowState);case 5:return i=f.sent,f.next=8,(0,l.select)(d.selectSiteHost);case 8:if(p=f.sent,!i.requestList[r]){f.next=11;break}return f.abrupt("return",null);case 11:return h=void 0,f.prev=12,f.next=15,(0,l.call)(s.getLongClaimId,p,a,o);case 15:m=f.sent,h=m.data,f.next=24;break;case 19:return f.prev=19,f.t0=f.catch(12),f.next=23,(0,l.put)((0,u.onRequestError)(f.t0.message));case 23:return f.abrupt("return",f.sent);case 24:return b="a#"+a+"#"+h,f.next=27,(0,l.put)((0,u.addRequestToRequestList)(r,null,b));case 27:if(!i.assetList[b]){f.next=29;break}return f.abrupt("return",null);case 29:return v=void 0,f.prev=30,f.next=33,(0,l.call)(s.getShortId,p,a,h);case 33:g=f.sent,v=g.data,f.next=42;break;case 37:return f.prev=37,f.t1=f.catch(30),f.next=41,(0,l.put)((0,u.onRequestError)(f.t1.message));case 41:return f.abrupt("return",f.sent);case 42:return y=void 0,f.prev=43,f.next=46,(0,l.call)(s.getClaimData,p,a,h);case 46:w=f.sent,y=w.data,f.next=55;break;case 50:return f.prev=50,f.t2=f.catch(43),f.next=54,(0,l.put)((0,u.onRequestError)(f.t2.message));case 54:return f.abrupt("return",f.sent);case 55:return f.next=57,(0,l.put)((0,u.addAssetToAssetList)(b,null,a,h,v,y));case 57:return f.next=59,(0,l.put)((0,u.onRequestError)(null));case 59:case"end":return f.stop()}},f,this,[[12,19],[30,37],[43,50]])}function a(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,l.takeLatest)(i.ASSET_REQUEST_NEW,r);case 2:case"end":return e.stop()}},p,this)}Object.defineProperty(t,"__esModule",{value:!0}),t.newAssetRequest=r,t.watchNewAssetRequest=a;var l=n(49),o=n(19),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(o),u=n(11),s=n(160),c=n(28),d=n(114),f=regeneratorRuntime.mark(r),p=regeneratorRuntime.mark(a)},function(e,t,n){"use strict";function r(e,t,n){var r={};n&&(n.id?r.claimId=n.id:(r.channelName=n.channel.name,r.channelClaimId=n.channel.id)),r.claimName=t;var a={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},l=e+"/api/claim/long-id";return(0,i.default)(l,a)}function a(e,t,n){var r=e+"/api/claim/short-id/"+n+"/"+t;return(0,i.default)(r)}function l(e,t,n){var r=e+"/api/claim/data/"+t+"/"+n;return(0,i.default)(r)}Object.defineProperty(t,"__esModule",{value:!0}),t.getLongClaimId=r,t.getShortId=a,t.getClaimData=l;var o=n(8),i=function(e){return e&&e.__esModule?e:{default:e}}(o)},function(e,t,n){"use strict";function r(e){var t,n,r,a,l,o,u,s,m,b,v,g,y,w;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return t=e.data,n=t.requestType,r=t.requestId,a=t.channelName,l=t.channelId,h.next=3,(0,i.put)((0,c.onRequestUpdate)(n,r));case 3:return h.next=5,(0,i.select)(f.selectShowState);case 5:return o=h.sent,h.next=8,(0,i.select)(p.selectSiteHost);case 8:if(u=h.sent,!o.requestList[r]){h.next=11;break}return h.abrupt("return",null);case 11:return s=void 0,m=void 0,h.prev=12,h.next=15,(0,i.call)(d.getChannelData,u,a,l);case 15:b=h.sent,v=b.data,s=v.longChannelClaimId,m=v.shortChannelClaimId,h.next=26;break;case 21:return h.prev=21,h.t0=h.catch(12),h.next=25,(0,i.put)((0,c.onRequestError)(h.t0.message));case 25:return h.abrupt("return",h.sent);case 26:return g="c#"+a+"#"+s,h.next=29,(0,i.put)((0,c.addRequestToRequestList)(r,null,g));case 29:if(!o.channelList[g]){h.next=31;break}return h.abrupt("return",null);case 31:return y=void 0,h.prev=32,h.next=35,(0,i.call)(d.getChannelClaims,u,s,a,1);case 35:w=h.sent,y=w.data,h.next=44;break;case 39:return h.prev=39,h.t1=h.catch(32),h.next=43,(0,i.put)((0,c.onRequestError)(h.t1.message));case 43:return h.abrupt("return",h.sent);case 44:return h.next=46,(0,i.put)((0,c.addNewChannelToChannelList)(g,a,m,s,y));case 46:return h.next=48,(0,i.put)((0,c.onRequestError)(null));case 48:case"end":return h.stop()}},h,this,[[12,21],[32,39]])}function a(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.takeLatest)(s.CHANNEL_REQUEST_NEW,r);case 2:case"end":return e.stop()}},m,this)}function l(e){var t,n,r,a,l,o,u,s;return regeneratorRuntime.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return t=e.data,n=t.channelKey,r=t.name,a=t.longId,l=t.page,f.next=3,(0,i.select)(p.selectSiteHost);case 3:return o=f.sent,u=void 0,f.prev=5,f.next=8,(0,i.call)(d.getChannelClaims,o,a,r,l);case 8:s=f.sent,u=s.data,f.next=17;break;case 12:return f.prev=12,f.t0=f.catch(5),f.next=16,(0,i.put)((0,c.onRequestError)(f.t0.message));case 16:return f.abrupt("return",f.sent);case 17:return f.next=19,(0,i.put)((0,c.updateChannelClaims)(n,u));case 19:case"end":return f.stop()}},b,this,[[5,12]])}function o(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.takeLatest)(s.CHANNEL_CLAIMS_UPDATE_ASYNC,l);case 2:case"end":return e.stop()}},v,this)}Object.defineProperty(t,"__esModule",{value:!0}),t.newChannelRequest=r,t.watchNewChannelRequest=a,t.watchUpdateChannelClaims=o;var i=n(49),u=n(19),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(u),c=n(11),d=n(162),f=n(28),p=n(114),h=regeneratorRuntime.mark(r),m=regeneratorRuntime.mark(a),b=regeneratorRuntime.mark(l),v=regeneratorRuntime.mark(o)},function(e,t,n){"use strict";function r(e,t,n){t||(t="none");var r=e+"/api/channel/data/"+n+"/"+t;return(0,o.default)(r)}function a(e,t,n,r){r||(r=1);var a=e+"/api/channel/claims/"+n+"/"+t+"/"+r;return(0,o.default)(a)}Object.defineProperty(t,"__esModule",{value:!0}),t.getChannelData=r,t.getChannelClaims=a;var l=n(8),o=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";var r=n(101);e.exports=function(e){e.use("*",function(e,t){r(e,t)})}},function(e,t,n){"use strict";var r=n(165),a=r.logLevel;e.exports=function(e){e.configure({transports:[new e.transports.Console({level:a,timestamp:!1,colorize:!0,prettyPrint:!0,handleExceptions:!0,humanReadableUnhandledException:!0})]}),e.error("Level 0"),e.warn("Level 1"),e.info("Level 2"),e.verbose("Level 3"),e.debug("Level 4"),e.silly("Level 5")}},function(e,t,n){"use strict";var r={logLevel:"debug"};e.exports=r},function(e,t,n){"use strict";var r=n(167).SlackWebHook,a=n(93);e.exports=function(e){var t=a.slackWebHook,n=a.slackErrorChannel,l=a.slackInfoChannel;t?(n&&e.add(r,{name:"slack-errors-transport",level:"warn",webhookUrl:t,channel:n,username:"spee.ch",iconEmoji:":face_with_head_bandage:"}),l&&e.add(r,{name:"slack-info-transport",level:"info",webhookUrl:t,channel:l,username:"spee.ch",iconEmoji:":nerd_face:"}),e.error('Slack "error" logging is online.'),e.info('Slack "info" logging is online.')):e.warn("Slack logging is not enabled because no slackWebHook config var provided.")}},function(e,t){e.exports=require("winston-slack-webhook")},function(e,t,n){function r(e){return n(a(e))}function a(e){var t=l[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var l={"./":50,"./ActiveStatusBar":24,"./ActiveStatusBar/":24,"./ActiveStatusBar/index":24,"./ActiveStatusBar/index.jsx":24,"./AssetPreview":34,"./AssetPreview/":34,"./AssetPreview/index":34,"./AssetPreview/index.js":34,"./AssetPreview/view":78,"./AssetPreview/view.jsx":78,"./ExpandingTextArea":36,"./ExpandingTextArea/":36,"./ExpandingTextArea/index":36,"./ExpandingTextArea/index.jsx":36,"./GAListener":13,"./GAListener/":13,"./GAListener/index":13,"./GAListener/index.jsx":13,"./InactiveStatusBar":25,"./InactiveStatusBar/":25,"./InactiveStatusBar/index":25,"./InactiveStatusBar/index.jsx":25,"./Logo":21,"./Logo/":21,"./Logo/index":21,"./Logo/index.jsx":21,"./NavBarChannelOptionsDropdown":22,"./NavBarChannelOptionsDropdown/":22,"./NavBarChannelOptionsDropdown/index":22,"./NavBarChannelOptionsDropdown/index.jsx":22,"./ProgressBar":10,"./ProgressBar/":10,"./ProgressBar/index":10,"./ProgressBar/index.jsx":10,"./PublishPreview":37,"./PublishPreview/":37,"./PublishPreview/index":37,"./PublishPreview/index.jsx":37,"./PublishUrlMiddleDisplay":38,"./PublishUrlMiddleDisplay/":38,"./PublishUrlMiddleDisplay/index":38,"./PublishUrlMiddleDisplay/index.jsx":38,"./SEO":7,"./SEO/":7,"./SEO/index":7,"./SEO/index.js":7,"./SEO/view":66,"./SEO/view.jsx":66,"./index":50,"./index.js":50};r.keys=function(){return Object.keys(l)},r.resolve=a,e.exports=r,r.id=168},function(e,t,n){function r(e){return n(a(e))}function a(e){var t=l[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var l={"./":52,"./AssetDisplay":17,"./AssetDisplay/":17,"./AssetDisplay/index":17,"./AssetDisplay/index.js":17,"./AssetDisplay/view":72,"./AssetDisplay/view.jsx":72,"./AssetInfo":31,"./AssetInfo/":31,"./AssetInfo/index":31,"./AssetInfo/index.js":31,"./AssetInfo/view":75,"./AssetInfo/view.jsx":75,"./AssetTitle":30,"./AssetTitle/":30,"./AssetTitle/index":30,"./AssetTitle/index.js":30,"./AssetTitle/view":74,"./AssetTitle/view.jsx":74,"./ChannelClaimsDisplay":33,"./ChannelClaimsDisplay/":33,"./ChannelClaimsDisplay/index":33,"./ChannelClaimsDisplay/index.js":33,"./ChannelClaimsDisplay/view":77,"./ChannelClaimsDisplay/view.jsx":77,"./ChannelCreateForm":16,"./ChannelCreateForm/":16,"./ChannelCreateForm/index":16,"./ChannelCreateForm/index.js":16,"./ChannelCreateForm/view":69,"./ChannelCreateForm/view.jsx":69,"./ChannelLoginForm":15,"./ChannelLoginForm/":15,"./ChannelLoginForm/index":15,"./ChannelLoginForm/index.js":15,"./ChannelLoginForm/view":68,"./ChannelLoginForm/view.jsx":68,"./ChannelSelect":39,"./ChannelSelect/":39,"./ChannelSelect/index":39,"./ChannelSelect/index.js":39,"./ChannelSelect/view":81,"./ChannelSelect/view.jsx":81,"./Dropzone":18,"./Dropzone/":18,"./Dropzone/index":18,"./Dropzone/index.js":18,"./Dropzone/view":82,"./Dropzone/view.jsx":82,"./FourOhFourPage":35,"./FourOhFourPage/":35,"./FourOhFourPage/index":35,"./FourOhFourPage/index.jsx":35,"./FourOhFourPage/view":79,"./FourOhFourPage/view.jsx":79,"./NavBar":5,"./NavBar/":5,"./NavBar/index":5,"./NavBar/index.js":5,"./NavBar/view":65,"./NavBar/view.jsx":65,"./PublishDetails":40,"./PublishDetails/":40,"./PublishDetails/index":40,"./PublishDetails/index.js":40,"./PublishDetails/view":83,"./PublishDetails/view.jsx":83,"./PublishDisabledMessage":45,"./PublishDisabledMessage/":45,"./PublishDisabledMessage/index":45,"./PublishDisabledMessage/index.js":45,"./PublishDisabledMessage/view":88,"./PublishDisabledMessage/view.jsx":88,"./PublishMetadataInputs":44,"./PublishMetadataInputs/":44,"./PublishMetadataInputs/index":44,"./PublishMetadataInputs/index.js":44,"./PublishMetadataInputs/view":87,"./PublishMetadataInputs/view.jsx":87,"./PublishStatus":46,"./PublishStatus/":46,"./PublishStatus/index":46,"./PublishStatus/index.js":46,"./PublishStatus/view":89,"./PublishStatus/view.jsx":89,"./PublishThumbnailInput":43,"./PublishThumbnailInput/":43,"./PublishThumbnailInput/index":43,"./PublishThumbnailInput/index.js":43,"./PublishThumbnailInput/view":86,"./PublishThumbnailInput/view.jsx":86,"./PublishTitleInput":41,"./PublishTitleInput/":41,"./PublishTitleInput/index":41,"./PublishTitleInput/index.js":41,"./PublishTitleInput/view":84,"./PublishTitleInput/view.jsx":84,"./PublishTool":47,"./PublishTool/":47,"./PublishTool/index":47,"./PublishTool/index.js":47,"./PublishTool/view":90,"./PublishTool/view.jsx":90,"./PublishUrlInput":42,"./PublishUrlInput/":42,"./PublishUrlInput/index":42,"./PublishUrlInput/index.js":42,"./PublishUrlInput/view":85,"./PublishUrlInput/view.jsx":85,"./ShowAssetDetails":29,"./ShowAssetDetails/":29,"./ShowAssetDetails/index":29,"./ShowAssetDetails/index.js":29,"./ShowAssetDetails/view":73,"./ShowAssetDetails/view.jsx":73,"./ShowAssetLite":27,"./ShowAssetLite/":27,"./ShowAssetLite/index":27,"./ShowAssetLite/index.js":27,"./ShowAssetLite/view":71,"./ShowAssetLite/view.jsx":71,"./ShowChannel":32,"./ShowChannel/":32,"./ShowChannel/index":32,"./ShowChannel/index.js":32,"./ShowChannel/view":76,"./ShowChannel/view.jsx":76,"./index":52,"./index.js":52};r.keys=function(){return Object.keys(l)},r.resolve=a,e.exports=r,r.id=169},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LOAD_START="LOAD_START",t.LOADING="LOADING",t.PUBLISHING="PUBLISHING",t.SUCCESS="SUCCESS",t.FAILED="FAILED"},function(e,t,n){function r(e){return n(a(e))}function a(e){var t=l[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var l={"./":53,"./AboutPage":20,"./AboutPage/":20,"./AboutPage/index":20,"./AboutPage/index.jsx":20,"./ErrorPage":12,"./ErrorPage/":12,"./ErrorPage/index":12,"./ErrorPage/index.jsx":12,"./HomePage":54,"./HomePage/":54,"./HomePage/index":54,"./HomePage/index.jsx":54,"./LoginPage":23,"./LoginPage/":23,"./LoginPage/index":23,"./LoginPage/index.js":23,"./LoginPage/view":67,"./LoginPage/view.jsx":67,"./ShowPage":26,"./ShowPage/":26,"./ShowPage/index":26,"./ShowPage/index.js":26,"./ShowPage/view":70,"./ShowPage/view.jsx":70,"./index":53,"./index.js":53};r.keys=function(){return Object.keys(l)},r.resolve=a,e.exports=r,r.id=171}]);
|
|
//# sourceMappingURL=index.js.map
|