From 8850e41b3c51a5d90ca6c1667d6c1b1cebae6ad0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 7 Jun 2018 23:45:31 +0200 Subject: "after" tasks working --- app/client/dataset/dataset.loader.js | 7 +- app/client/modules/pix2pix/pix2pix.tasks.js | 29 +- app/client/system/system.component.js | 10 + app/relay/modules/test.js | 12 + app/relay/runner.js | 6 +- public/bundle.js | 67513 +++++++++++++++++++++++++- public/bundle.js.map | 2 +- test/module/test.pl | 10 + 8 files changed, 67565 insertions(+), 24 deletions(-) diff --git a/app/client/dataset/dataset.loader.js b/app/client/dataset/dataset.loader.js index f068bdb..3887e69 100644 --- a/app/client/dataset/dataset.loader.js +++ b/app/client/dataset/dataset.loader.js @@ -74,7 +74,12 @@ export const load = module => { ungeneratedFiles.reduce((datasetLookup, file) => { fileLookup[file.id] = file if (! file.name) { - file.name = (file.opt || {}).token || file.url + if (file.opt && file.opt.media && file.opt.media.token) { + file.name = file.opt.media.token + } + else { + file.name = file.url.replace(/^https?:\/\/(www.)?/,'').replace(/[^a-zA-Z0-9_]/g, '_').replace(/_+/g, '_') || 'unknown_' + Math.floor(1000*Math.random()) + } } const name = (file.name || 'unsorted').split('.')[0] const folder = folderLookup[file.folder_id] || unsortedFolder(module) diff --git a/app/client/modules/pix2pix/pix2pix.tasks.js b/app/client/modules/pix2pix/pix2pix.tasks.js index db7d4b1..7bfc09f 100644 --- a/app/client/modules/pix2pix/pix2pix.tasks.js +++ b/app/client/modules/pix2pix/pix2pix.tasks.js @@ -5,6 +5,21 @@ import types from '../../types' import actions from '../../actions' +export const fetch_task = (url, file_id, dataset) => dispatch => { + if (! url) return console.log('input file inaccessible (no url)') + const task = { + module: 'pix2pix', + activity: 'fetch', + dataset: dataset, + opt: { + url, + file_id, + dataset, + } + } + return actions.queue.add_task(task) +} + export const live_task = (sequence, checkpoint) => dispatch => { const task = { module: 'pix2pix', @@ -33,20 +48,6 @@ export const live_task = (sequence, checkpoint) => dispatch => { // console.log(task) // return actions.queue.add_task(task) // } -// export const fetch_task = (url, file_id, dataset) => dispatch => { -// if (! url) return console.log('input file inaccessible (no url)') -// const task = { -// module: 'samplernn', -// activity: 'fetch', -// dataset: dataset, -// opt: { -// url, -// file_id, -// dataset, -// } -// } -// return actions.queue.add_task(task) -// } // export const log_task = (dataset) => dispatch => { // const task = { // module: 'samplernn', diff --git a/app/client/system/system.component.js b/app/client/system/system.component.js index 216c7cc..aaa10d6 100644 --- a/app/client/system/system.component.js +++ b/app/client/system/system.component.js @@ -30,6 +30,13 @@ const live_test_task = { epochs: 1, opt: {} } +const wait_test_task = { + activity: 'wait', + module: 'test', + dataset: 'test', + epochs: 1, + opt: {} +} const fruits = ["apple","pear","orange","strawberry"] function choice(a){ return a[Math.floor(Math.random()*a.length)]} @@ -105,6 +112,9 @@ class System extends Component { + + + {this.renderCommandOutput()} diff --git a/app/relay/modules/test.js b/app/relay/modules/test.js index 8876f7c..259e817 100644 --- a/app/relay/modules/test.js +++ b/app/relay/modules/test.js @@ -33,10 +33,22 @@ const live = { return null } } +const wait = { + type: 'perl', + script: 'test.pl', + params: '--wait', + after: 'buzz', +} +const buzz = { + type: 'perl', + script: 'test.pl', + params: '--buzz', +} export default { name, cwd, activities: { cpu, gpu, live, + wait, buzz, } } diff --git a/app/relay/runner.js b/app/relay/runner.js index 1c98977..2459996 100644 --- a/app/relay/runner.js +++ b/app/relay/runner.js @@ -318,8 +318,12 @@ export function run_task_with_activity(task, module, activity, preempt=false, wa set_connected(false) // remove task from queue // queue.remove_task(task) + console.log('success?', task.success, activity) if (task.success && activity.after) { - return run_task_with_activity(task, module, activity.after, preempt, watch) + if (activity.after in modules[task.module].activities) { + const after_activity = modules[task.module].activities[activity.after] + return run_task_with_activity(task, module, after_activity, preempt, watch) + } } return run_next_task() } diff --git a/public/bundle.js b/public/bundle.js index ecb4c8e..ee79f6d 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -1,16 +1,67515 @@ -!function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=255)}([function(t,e,n){t.exports=n(254)()},function(t,e,n){"use strict";n.r(e),n.d(e,"h",function(){return s}),n.d(e,"createElement",function(){return s}),n.d(e,"cloneElement",function(){return l}),n.d(e,"Component",function(){return F}),n.d(e,"render",function(){return N}),n.d(e,"rerender",function(){return f}),n.d(e,"options",function(){return i});var i={},r=[],o=[];function s(t,e){var n,s,a,u,l=o;for(u=arguments.length;u-- >2;)r.push(arguments[u]);for(e&&null!=e.children&&(r.length||r.push(e.children),delete e.children);r.length;)if((s=r.pop())&&void 0!==s.pop)for(u=s.length;u--;)r.push(s[u]);else"boolean"==typeof s&&(s=null),(a="function"!=typeof t)&&(null==s?s="":"number"==typeof s?s=String(s):"string"!=typeof s&&(a=!1)),a&&n?l[l.length-1]+=s:l===o?l=[s]:l.push(s),n=a;var c=new function(){};return c.nodeName=t,c.children=l,c.attributes=null==e?void 0:e,c.key=null==e?void 0:e.key,void 0!==i.vnode&&i.vnode(c),c}function a(t,e){for(var n in e)t[n]=e[n];return t}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function l(t,e){return s(t.nodeName,a(a({},t.attributes),e),arguments.length>2?[].slice.call(arguments,2):t.children)}var c=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,h=[];function p(t){!t._dirty&&(t._dirty=!0)&&1==h.push(t)&&(i.debounceRendering||u)(f)}function f(){var t,e=h;for(h=[];t=e.pop();)t._dirty&&R(t)}function d(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function y(t){var e=a({},t.attributes);e.children=t.children;var n=t.nodeName.defaultProps;if(void 0!==n)for(var i in n)void 0===e[i]&&(e[i]=n[i]);return e}function _(t){var e=t.parentNode;e&&e.removeChild(t)}function m(t,e,n,i,r){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)n&&n(null),i&&i(t);else if("class"!==e||r)if("style"===e){if(i&&"string"!=typeof i&&"string"!=typeof n||(t.style.cssText=i||""),i&&"object"==typeof i){if("string"!=typeof n)for(var o in n)o in i||(t.style[o]="");for(var o in i)t.style[o]="number"==typeof i[o]&&!1===c.test(o)?i[o]+"px":i[o]}}else if("dangerouslySetInnerHTML"===e)i&&(t.innerHTML=i.__html||"");else if("o"==e[0]&&"n"==e[1]){var s=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),i?n||t.addEventListener(e,v,s):t.removeEventListener(e,v,s),(t._listeners||(t._listeners={}))[e]=i}else if("list"!==e&&"type"!==e&&!r&&e in t)!function(t,e,n){try{t[e]=n}catch(t){}}(t,e,null==i?"":i),null!=i&&!1!==i||t.removeAttribute(e);else{var a=r&&e!==(e=e.replace(/^xlink:?/,""));null==i||!1===i?a?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof i&&(a?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),i):t.setAttribute(e,i))}else t.className=i||""}function v(t){return this._listeners[t.type](i.event&&i.event(t)||t)}var g=[],b=0,w=!1,S=!1;function k(){for(var t;t=g.pop();)i.afterMount&&i.afterMount(t),t.componentDidMount&&t.componentDidMount()}function T(t,e,n,i,r,o){b++||(w=null!=r&&void 0!==r.ownerSVGElement,S=null!=t&&!("__preactattr_"in t));var s=O(t,e,n,i,o);return r&&s.parentNode!==r&&r.appendChild(s),--b||(S=!1,o||k()),s}function O(t,e,n,i,r){var o=t,s=w;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||r)?t.nodeValue!=e&&(t.nodeValue=e):(o=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(o,t),x(t,!0))),o.__preactattr_=!0,o;var a,u,l=e.nodeName;if("function"==typeof l)return function(t,e,n,i){var r=t&&t._component,o=r,s=t,a=r&&t._componentConstructor===e.nodeName,u=a,l=y(e);for(;r&&!u&&(r=r._parentComponent);)u=r.constructor===e.nodeName;r&&u&&(!i||r._component)?(M(r,l,3,n,i),t=r.base):(o&&!a&&(j(o),t=s=null),r=E(e.nodeName,l,n),t&&!r.nextBase&&(r.nextBase=t,s=null),M(r,l,1,n,i),t=r.base,s&&t!==s&&(s._component=null,x(s,!1)));return t}(t,e,n,i);if(w="svg"===l||"foreignObject"!==l&&w,l=String(l),(!t||!d(t,l))&&(a=l,(u=w?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a)).normalizedNodeName=a,o=u,t)){for(;t.firstChild;)o.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(o,t),x(t,!0)}var c=o.firstChild,h=o.__preactattr_,p=e.children;if(null==h){h=o.__preactattr_={};for(var f=o.attributes,v=f.length;v--;)h[f[v].name]=f[v].value}return!S&&p&&1===p.length&&"string"==typeof p[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=p[0]&&(c.nodeValue=p[0]):(p&&p.length||null!=c)&&function(t,e,n,i,r){var o,s,a,u,l,c=t.childNodes,h=[],p={},f=0,y=0,m=c.length,v=0,g=e?e.length:0;if(0!==m)for(var b=0;b0;)n[i]=arguments[i+2];if(!A(t))return t;var r=t.attributes||t.props,s=[Object(o.h)(t.nodeName||t.type,C({},r),t.children||r&&r.children),e];return n&&n.length?s.push(n):e&&e.children&&s.push(e.children),P(o.cloneElement.apply(void 0,s))},isValidElement:A,findDOMNode:function(t){return t&&t.base||t},unmountComponentAtNode:function(t){var e=t._preactCompatRendered&&t._preactCompatRendered.base;return!(!e||e.parentNode!==t||(Object(o.render)(Object(o.h)(f),t,e),0))},Component:B,PureComponent:U,unstable_renderSubtreeIntoContainer:function(t,e,n,i){var r=m(Object(o.h)(v,{context:t.context},e),n),s=r._component||r.base;return i&&i.call(s,r),s},__spread:C};e.d=z}).call(this,n(38))},function(t,e,n){"use strict";t.exports=function(){}},function(t,e,n){"use strict";n.r(e),n.d(e,"createStore",function(){return u}),n.d(e,"combineReducers",function(){return c}),n.d(e,"bindActionCreators",function(){return p}),n.d(e,"applyMiddleware",function(){return d}),n.d(e,"compose",function(){return f}),n.d(e,"__DO_NOT_USE__ActionTypes",function(){return r});var i=n(78),r={INIT:"@@redux/INIT"+Math.random().toString(36).substring(7).split("").join("."),REPLACE:"@@redux/REPLACE"+Math.random().toString(36).substring(7).split("").join(".")},o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];if(a)throw a;for(var i=!1,r={},o=0;o0&&void 0!==arguments[0]?arguments[0]:"store",n=arguments[1]||e+"Subscription",r=function(t){function r(n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n,i));return o[e]=n.store,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),r.prototype.getChildContext=function(){var t;return(t={})[e]=this[e],t[n]=null,t},r.prototype.render=function(){return i.a.only(this.props.children)},r}(i.b);return r.propTypes={store:a.isRequired,children:o.a.element.isRequired},r.childContextTypes=((t={})[e]=a.isRequired,t[n]=s,t),r}var l=u(),c=n(50),h=n.n(c),p=n(8),f=n.n(p);var d=null,y={notify:function(){}};var _=function(){function t(e,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.store=e,this.parentSub=n,this.onStateChange=i,this.unsubscribe=null,this.listeners=y}return t.prototype.addNestedSub=function(t){return this.trySubscribe(),this.listeners.subscribe(t)},t.prototype.notifyNestedSubs=function(){this.listeners.notify()},t.prototype.isSubscribed=function(){return Boolean(this.unsubscribe)},t.prototype.trySubscribe=function(){var t,e;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=(t=[],e=[],{clear:function(){e=d,t=d},notify:function(){for(var n=t=e,i=0;i1&&void 0!==arguments[1]?arguments[1]:{},o=r.getDisplayName,u=void 0===o?function(t){return"ConnectAdvanced("+t+")"}:o,l=r.methodName,c=void 0===l?"connectAdvanced":l,p=r.renderCountProp,d=void 0===p?void 0:p,y=r.shouldHandleStateChanges,w=void 0===y||y,S=r.storeKey,k=void 0===S?"store":S,T=r.withRef,O=void 0!==T&&T,x=function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(r,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),P=k+"Subscription",A=v++,E=((e={})[k]=a,e[P]=s,e),C=((n={})[P]=s,n);return function(e){f()("function"==typeof e,"You must pass a component to the function returned by "+c+". Instead received "+JSON.stringify(e));var n=e.displayName||e.name||"Component",r=u(n),o=m({},x,{getDisplayName:u,methodName:c,renderCountProp:d,shouldHandleStateChanges:w,storeKey:k,withRef:O,displayName:r,wrappedComponentName:n,WrappedComponent:e}),s=function(n){function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,n.call(this,t,e));return i.version=A,i.state={},i.renderCount=0,i.store=t[k]||e[k],i.propsMode=Boolean(t[k]),i.setWrappedInstance=i.setWrappedInstance.bind(i),f()(i.store,'Could not find "'+k+'" in either the context or props of "'+r+'". Either wrap the root component in a , or explicitly pass "'+k+'" as a prop to "'+r+'".'),i.initSelector(),i.initSubscription(),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,n),s.prototype.getChildContext=function(){var t,e=this.propsMode?null:this.subscription;return(t={})[P]=e||this.context[P],t},s.prototype.componentDidMount=function(){w&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},s.prototype.componentWillReceiveProps=function(t){this.selector.run(t)},s.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},s.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=b,this.store=null,this.selector.run=b,this.selector.shouldComponentUpdate=!1},s.prototype.getWrappedInstance=function(){return f()(O,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+c+"() call."),this.wrappedInstance},s.prototype.setWrappedInstance=function(t){this.wrappedInstance=t},s.prototype.initSelector=function(){var e=t(this.store.dispatch,o);this.selector=function(t,e){var n={run:function(i){try{var r=t(e.getState(),i);(r!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=r,n.error=null)}catch(t){n.shouldComponentUpdate=!0,n.error=t}}};return n}(e,this.store),this.selector.run(this.props)},s.prototype.initSubscription=function(){if(w){var t=(this.propsMode?this.props:this.context)[P];this.subscription=new _(this.store,t,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},s.prototype.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(g)):this.notifyNestedSubs()},s.prototype.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},s.prototype.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},s.prototype.addExtraProps=function(t){if(!(O||d||this.propsMode&&this.subscription))return t;var e=m({},t);return O&&(e.ref=this.setWrappedInstance),d&&(e[d]=this.renderCount++),this.propsMode&&this.subscription&&(e[P]=this.subscription),e},s.prototype.render=function(){var t=this.selector;if(t.shouldComponentUpdate=!1,t.error)throw t.error;return Object(i.c)(e,this.addExtraProps(t.props))},s}(i.b);return s.WrappedComponent=e,s.displayName=r,s.childContextTypes=C,s.contextTypes=E,s.propTypes=E,h()(s,e)}}var S=Object.prototype.hasOwnProperty;function k(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function T(t,e){if(k(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(var r=0;r=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(e,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),s=n(t,o),a=i(t,o),u=r(t,o);return(o.pure?z:U)(s,a,u,t,o)}var W=Object.assign||function(t){for(var e=1;e=0;i--){var r=e[i](t);if(r)return r}return function(e,i){throw new Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+i.wrappedComponentName+".")}}function G(t,e){return t===e}var H=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.connectHOC,n=void 0===e?w:e,i=t.mapStateToPropsFactories,r=void 0===i?L:i,o=t.mapDispatchToPropsFactories,s=void 0===o?D:o,a=t.mergePropsFactories,u=void 0===a?B:a,l=t.selectorFactory,c=void 0===l?Y:l;return function(t,e,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=o.pure,l=void 0===a||a,h=o.areStatesEqual,p=void 0===h?G:h,f=o.areOwnPropsEqual,d=void 0===f?T:f,y=o.areStatePropsEqual,_=void 0===y?T:y,m=o.areMergedPropsEqual,v=void 0===m?T:m,g=function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(o,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),b=V(t,r,"mapStateToProps"),w=V(e,s,"mapDispatchToProps"),S=V(i,u,"mergeProps");return n(c,W({methodName:"connect",getDisplayName:function(t){return"Connect("+t+")"},shouldHandleStateChanges:Boolean(t),initMapStateToProps:b,initMapDispatchToProps:w,initMergeProps:S,pure:l,areStatesEqual:p,areOwnPropsEqual:d,areStatePropsEqual:_,areMergedPropsEqual:v},g))}}();n.d(e,"Provider",function(){return l}),n.d(e,"createProvider",function(){return u}),n.d(e,"connectAdvanced",function(){return w}),n.d(e,"connect",function(){return H})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(72);e.default={system:{load_site:"SYSTEM_LOAD_SITE",running_command:"SYSTEM_RUNNING_COMMAND",command_output:"SYSTEM_COMMAND_OUTPUT",relay_connected:"SYSTEM_RELAY_CONNECTED",relay_disconnected:"SYSTEM_RELAY_DISCONNECTED",rpc_connected:"SYSTEM_RPC_CONNECTED",rpc_disconnected:"SYSTEM_RPC_DISCONNECTED",list_directory:"SYSTEM_LIST_DIRECTORY",listing_directory:"SYSTEM_LISTING_DIRECTORY",stdout:"SYSTEM_STDOUT",stderr:"SYSTEM_STDERR"},app:{change_tool:"APP_CHANGE_TOOL",load_progress:"APP_LOAD_PROGRESS"},folder:(0,i.crud_type)("folder",[]),file:(0,i.crud_type)("file",[]),task:(0,i.crud_type)("task",["starting_task","stopping_task","task_begin","task_finish","start_queue","stop_queue","starting_queue","stopping_queue","progress","epoch"]),socket:{connect:"SOCKET_CONNECT",connect_error:"SOCKET_CONNECT_ERROR",reconnect:"SOCKET_RECONNECT",reconnecting:"SOCKET_RECONNECTING",reconnect_error:"SOCKET_RECONNECT_ERROR",reconnect_failed:"SOCKET_RECONNECT_FAILED",disconnect:"SOCKET_DISCONNECT",error:"SOCKET_ERROR",status:"SOCKET_STATUS",load_params:"SOCKET_LOAD_PARAMS",list_checkpoints:"SOCKET_LIST_CHECKPOINTS",list_sequences:"SOCKET_LIST_SEQUENCES",list_epochs:"SOCKET_LIST_EPOCHS"},player:{get_params:"GET_PARAMS",set_param:"SET_PARAM",loading_checkpoints:"LOADING_CHECKPOINTS",loading_checkpoint:"LOADING_CHECKPOINT",list_checkpoints:"LIST_CHECKPOINTS",loading_sequences:"LOADING_SEQUENCES",loading_sequence:"LOADING_SEQUENCE",load_sequence:"LOAD_SEQUENCE",loading_epochs:"LOADING_EPOCHS",load_epoch:"LOAD_EPOCH",set_fps:"SET_FPS",seeking:"SEEKING",pausing:"PAUSING",playing:"PLAYING",current_frame:"CURRENT_FRAME",start_recording:"START_RECORDING",add_record_frame:"ADD_RECORD_FRAME",save_frame:"SAVE_FRAME",saving_video:"SAVING_VIDEO",save_video:"SAVE_VIDEO"},audioPlayer:{play:"AUDIO_PLAY",pause:"AUDIO_PAUSE",resume:"AUDIO_RESUME",enqueue:"AUDIO_ENQUEUE"},dataset:{load:"DATASET_LOAD",set_folder:"DATASET_SET_FOLDER",upload_files:"DATASET_UPLOAD_FILES",file_progress:"DATASET_FILE_PROGRESS",file_uploaded:"DATASET_FILE_UPLOADED",fetch_url:"DATASET_FETCH_URL",fetch_progress:"DATASET_FETCH_PROGRESS"},samplernn:{init:"SAMPLERNN_INIT",set_folder:"SAMPLERNN_SET_FOLDER",load_loss:"SAMPLERNN_LOAD_LOSS"},pix2pix:(0,i.with_type)("pix2pix",["init","set_folder"]),pix2wav:(0,i.with_type)("pix2wav",["init","set_folder"]),wav2pix:(0,i.with_type)("wav2pix",["load","progress","finish","zip","uploading"])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e1;)try{return c.stringifyByChunk(t,i,n)}catch(t){n=Math.floor(n/2)}return c.stringifyByChar(t)}function p(t,e){for(var n=0;n "+t:t}},t.exports=i},function(t,e,n){"use strict";n.r(e);var i=n(3),r=n.n(i),o=n(2),s=n(0),a=n.n(s),u=n(77),l=n.n(u),c=n(8),h=n.n(c),p=Object.assign||function(t){for(var e=1;e may have only one child element"),this.unlisten=i.listen(function(){t.setState({match:t.computeMatch(i.location.pathname)})})},e.prototype.componentWillReceiveProps=function(t){r()(this.props.history===t.history,"You cannot change ")},e.prototype.componentWillUnmount=function(){this.unlisten()},e.prototype.render=function(){var t=this.props.children;return t?o.d.Children.only(t):null},e}(o.d.Component);d.propTypes={history:a.a.object.isRequired,children:a.a.node},d.contextTypes={router:a.a.object},d.childContextTypes={router:a.a.object.isRequired};var y=d,_=y;function m(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var v=function(t){function e(){var n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s ignores the history prop. To use a custom history, use `import { Router }` instead of `import { BrowserRouter as Router }`.")},e.prototype.render=function(){return o.d.createElement(_,{history:this.history,children:this.props.children})},e}(o.d.Component);v.propTypes={basename:a.a.string,forceRefresh:a.a.bool,getUserConfirmation:a.a.func,keyLength:a.a.number,children:a.a.node};var g=v,b=n(126),w=n.n(b);function S(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var k=function(t){function e(){var n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s ignores the history prop. To use a custom history, use `import { Router }` instead of `import { HashRouter as Router }`.")},e.prototype.render=function(){return o.d.createElement(_,{history:this.history,children:this.props.children})},e}(o.d.Component);k.propTypes={basename:a.a.string,getUserConfirmation:a.a.func,hashType:a.a.oneOf(["hashbang","noslash","slash"]),children:a.a.node};var T=k,O=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(t,["replace","to","innerRef"]);h()(this.context.router,"You should not use outside a ");var r=this.context.router.history.createHref("string"==typeof e?{pathname:e}:e);return o.d.createElement("a",O({},i,{onClick:this.handleClick,href:r,ref:n}))},e}(o.d.Component);A.propTypes={onClick:a.a.func,target:a.a.string,replace:a.a.bool,to:a.a.oneOfType([a.a.string,a.a.object]).isRequired,innerRef:a.a.oneOfType([a.a.string,a.a.func])},A.defaultProps={replace:!1},A.contextTypes={router:a.a.shape({history:a.a.shape({push:a.a.func.isRequired,replace:a.a.func.isRequired,createHref:a.a.func.isRequired}).isRequired}).isRequired};var E=A,C=n(125),M=n.n(C);function R(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var j=function(t){function e(){var n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s ignores the history prop. To use a custom history, use `import { Router }` instead of `import { MemoryRouter as Router }`.")},e.prototype.render=function(){return o.d.createElement(y,{history:this.history,children:this.props.children})},e}(o.d.Component);j.propTypes={initialEntries:a.a.array,initialIndex:a.a.number,getUserConfirmation:a.a.func,keyLength:a.a.number,children:a.a.node};var F=j,N=n(124),D=n.n(N),L={},q=0,I=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof e&&(e={path:e});var n=e,i=n.path,r=void 0===i?"/":i,o=n.exact,s=void 0!==o&&o,a=n.strict,u=void 0!==a&&a,l=n.sensitive,c=function(t,e){var n=""+e.end+e.strict+e.sensitive,i=L[n]||(L[n]={});if(i[t])return i[t];var r=[],o={re:D()(t,r,e),keys:r};return q<1e4&&(i[t]=o,q++),o}(r,{end:s,strict:u,sensitive:void 0!==l&&l}),h=c.re,p=c.keys,f=h.exec(t);if(!f)return null;var d=f[0],y=f.slice(1),_=t===d;return s&&!_?null:{path:r,url:"/"===r&&""===d?"/":d,isExact:_,params:p.reduce(function(t,e,n){return t[e.name]=y[n],t},{})}},B=Object.assign||function(t){for(var e=1;e or withRouter() outside a ");var u=e.route,l=(i||u.location).pathname;return r?I(l,{path:r,strict:o,exact:s,sensitive:a}):u.match},e.prototype.componentWillMount=function(){r()(!(this.props.component&&this.props.render),"You should not use and in the same route; will be ignored"),r()(!(this.props.component&&this.props.children&&!z(this.props.children)),"You should not use and in the same route; will be ignored"),r()(!(this.props.render&&this.props.children&&!z(this.props.children)),"You should not use and in the same route; will be ignored")},e.prototype.componentWillReceiveProps=function(t,e){r()(!(t.location&&!this.props.location),' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),r()(!(!t.location&&this.props.location),' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'),this.setState({match:this.computeMatch(t,e.router)})},e.prototype.render=function(){var t=this.state.match,e=this.props,n=e.children,i=e.component,r=e.render,s=this.context.router,a=s.history,u=s.route,l=s.staticContext,c={match:t,location:this.props.location||u.location,history:a,staticContext:l};return i?t?o.d.createElement(i,c):null:r?t?r(c):null:n?"function"==typeof n?n(c):z(n)?null:o.d.Children.only(n):null},e}(o.d.Component);Y.propTypes={computedMatch:a.a.object,path:a.a.string,exact:a.a.bool,strict:a.a.bool,sensitive:a.a.bool,component:a.a.func,render:a.a.func,children:a.a.oneOfType([a.a.func,a.a.node]),location:a.a.object},Y.contextTypes={router:a.a.shape({history:a.a.object.isRequired,route:a.a.object.isRequired,staticContext:a.a.object})},Y.childContextTypes={router:a.a.object.isRequired};var W=Y,V=W,G=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(t,["to","exact","strict","location","activeClassName","className","activeStyle","style","isActive","ariaCurrent"]);return o.d.createElement(V,{path:"object"===(void 0===e?"undefined":H(e))?e.pathname:e,exact:n,strict:i,location:r,children:function(t){var n=t.location,i=t.match,r=!!(c?c(i,n):i);return o.d.createElement(E,G({to:e,className:r?[a,s].filter(function(t){return t}).join(" "):a,style:r?G({},l,u):l,"aria-current":r&&h},p))}})};Z.propTypes={to:E.propTypes.to,exact:a.a.bool,strict:a.a.bool,location:a.a.object,activeClassName:a.a.string,className:a.a.string,activeStyle:a.a.object,style:a.a.object,isActive:a.a.func,ariaCurrent:a.a.oneOf(["page","step","location","true"])},Z.defaultProps={activeClassName:"active",ariaCurrent:"true"};var Q=Z;var X=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.enable=function(t){this.unblock&&this.unblock(),this.unblock=this.context.router.history.block(t)},e.prototype.disable=function(){this.unblock&&(this.unblock(),this.unblock=null)},e.prototype.componentWillMount=function(){h()(this.context.router,"You should not use outside a "),this.props.when&&this.enable(this.props.message)},e.prototype.componentWillReceiveProps=function(t){t.when?this.props.when&&this.props.message===t.message||this.enable(t.message):this.disable()},e.prototype.componentWillUnmount=function(){this.disable()},e.prototype.render=function(){return null},e}(o.d.Component);X.propTypes={when:a.a.bool,message:a.a.oneOfType([a.a.func,a.a.string]).isRequired},X.defaultProps={when:!0},X.contextTypes={router:a.a.shape({history:a.a.shape({block:a.a.func.isRequired}).isRequired}).isRequired};var $=X,K=n(76),J=n(75),tt=Object.assign||function(t){for(var e=1;e outside a "),this.isStatic()&&this.perform()},e.prototype.componentDidMount=function(){this.isStatic()||this.perform()},e.prototype.componentDidUpdate=function(t){var e=et(t.to),n=et(this.props.to);nt(e,n)?r()(!1,"You tried to redirect to the same route you're currently on: \""+n.pathname+n.search+'"'):this.perform()},e.prototype.perform=function(){var t=this.context.router.history,e=this.props,n=e.push,i=e.to;n?t.push(i):t.replace(i)},e.prototype.render=function(){return null},e}(o.d.Component);it.propTypes={push:a.a.bool,from:a.a.string,to:a.a.oneOfType([a.a.string,a.a.object]).isRequired},it.defaultProps={push:!1},it.contextTypes={router:a.a.shape({history:a.a.shape({push:a.a.func.isRequired,replace:a.a.func.isRequired}).isRequired,staticContext:a.a.object}).isRequired};var rt=it,ot=n(15),st=Object.assign||function(t){for(var e=1;e",t)}},pt=function(){},ft=function(t){function e(){var n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s ignores the history prop. To use a custom history, use `import { Router }` instead of `import { StaticRouter as Router }`.")},e.prototype.render=function(){var t=this.props,e=t.basename,n=(t.context,t.location),i=function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(t,["basename","context","location"]),r={createHref:this.createHref,action:"POP",location:function(t,e){if(!t)return e;var n=Object(ot.addLeadingSlash)(t);return 0!==e.pathname.indexOf(n)?e:st({},e,{pathname:e.pathname.substr(n.length)})}(e,lt(n)),push:this.handlePush,replace:this.handleReplace,go:ht("go"),goBack:ht("goBack"),goForward:ht("goForward"),listen:this.handleListen,block:this.handleBlock};return o.d.createElement(y,st({},i,{history:r}))},e}(o.d.Component);ft.propTypes={basename:a.a.string,context:a.a.object.isRequired,location:a.a.oneOfType([a.a.string,a.a.object])},ft.defaultProps={basename:"",location:"/"},ft.childContextTypes={router:a.a.object.isRequired};var dt=ft;var yt=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentWillMount=function(){h()(this.context.router,"You should not use outside a ")},e.prototype.componentWillReceiveProps=function(t){r()(!(t.location&&!this.props.location),' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),r()(!(!t.location&&this.props.location),' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.')},e.prototype.render=function(){var t=this.context.router.route,e=this.props.children,n=this.props.location||t.location,i=void 0,r=void 0;return o.d.Children.forEach(e,function(e){if(o.d.isValidElement(e)){var s=e.props,a=s.path,u=s.exact,l=s.strict,c=s.sensitive,h=s.from,p=a||h;null==i&&(r=e,i=p?I(n.pathname,{path:p,exact:u,strict:l,sensitive:c}):t.match)}}),i?o.d.cloneElement(r,{location:n,computedMatch:i}):null},e}(o.d.Component);yt.contextTypes={router:a.a.shape({route:a.a.object.isRequired}).isRequired},yt.propTypes={children:a.a.node,location:a.a.object};var _t=yt,mt=I,vt=n(50),gt=n.n(vt),bt=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(e,["wrappedComponentRef"]);return o.d.createElement(W,{render:function(e){return o.d.createElement(t,bt({},i,e,{ref:n}))}})};return e.displayName="withRouter("+(t.displayName||t.name)+")",e.WrappedComponent=t,e.propTypes={wrappedComponentRef:a.a.func},gt()(e,t)};n.d(e,"BrowserRouter",function(){return g}),n.d(e,"HashRouter",function(){return T}),n.d(e,"Link",function(){return E}),n.d(e,"MemoryRouter",function(){return F}),n.d(e,"NavLink",function(){return Q}),n.d(e,"Prompt",function(){return $}),n.d(e,"Redirect",function(){return rt}),n.d(e,"Route",function(){return V}),n.d(e,"Router",function(){return _}),n.d(e,"StaticRouter",function(){return dt}),n.d(e,"Switch",function(){return _t}),n.d(e,"matchPath",function(){return mt}),n.d(e,"withRouter",function(){return wt})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.progress;return(0,r.h)("div",{className:"loading"},"Loading",(0,r.h)("br",null),e&&(0,r.h)(s.default,{progress:e}))};var i,r=n(1),o=n(109),s=(i=o)&&i.__esModule?i:{default:i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=Object.assign||function(t){for(var e=1;e0?"ep. "+_:""),f.has("date")&&(0,i.h)("div",{className:"date "+o.default.carbon_date(y)},(0,r.default)(y).format("YYYY-MM-DD")),f.has("datetime")&&(0,i.h)("div",{className:"datetime "+o.default.carbon_date(y)},(0,r.default)(y).format("YYYY-MM-DD h:mm a")),f.has("size")&&(0,i.h)("div",{className:"size "+d[0]},d[1]),(f.has("activity")||f.has("module"))&&(0,i.h)("div",{className:"activity"},f.has("activity")&&e.activity,f.has("module")&&e.module),f.has("delete")&&s&&e.id&&(0,i.h)("div",{className:"destroy",onClick:function(t){return s(e)}},"x"),t.options&&t.options(e))})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.dispatch=e.store=e.history=void 0;var i=n(4),r=n(248),o=d(n(245)),s=d(n(77)),a=d(n(244)),u=d(n(240)),l=d(n(239)),c=d(n(238)),h=d(n(237)),p=d(n(232)),f=n(231);function d(t){return t&&t.__esModule?t:{default:t}}var y=(0,i.combineReducers)({system:a.default,dashboard:u.default,live:l.default,upload:c.default,queue:h.default,router:r.routerReducer,module:f.moduleReducer,audioPlayer:p.default}),_=e.history=(0,s.default)(),m=e.store=(0,i.createStore)(y,(0,i.compose)((0,i.applyMiddleware)(o.default,(0,r.routerMiddleware)(_))));e.dispatch=m.dispatch},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(t[i]=n[i])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var o={arraySet:function(t,e,n,i,r){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+i),r);else for(var o=0;oa)&&void 0===t.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=d,u=y,r=p;var m=(1e4*(268435455&(d+=122192928e5))+y)%4294967296;c[l++]=m>>>24&255,c[l++]=m>>>16&255,c[l++]=m>>>8&255,c[l++]=255&m;var v=d/4294967296*1e4&268435455;c[l++]=v>>>8&255,c[l++]=255&v,c[l++]=v>>>24&15|16,c[l++]=v>>>16&255,c[l++]=p>>>8|128,c[l++]=255&p;for(var g=0;g<6;++g)c[l+g]=h[g];return e||s(c)}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){"use strict";for(var i=n(9),r=n(20),o=n(40),s=n(11),a=new Array(256),u=0;u<256;u++)a[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;a[254]=a[254]=1;function l(){s.call(this,"utf-8 decode"),this.leftOver=null}function c(){s.call(this,"utf-8 encode")}e.utf8encode=function(t){return r.nodebuffer?o.newBufferFrom(t,"utf-8"):function(t){var e,n,i,o,s,a=t.length,u=0;for(o=0;o>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e}(t)},e.utf8decode=function(t){return r.nodebuffer?i.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,n,r,o,s=t.length,u=new Array(2*s);for(n=0,e=0;e4)u[n++]=65533,e+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&e1?u[n++]=65533:r<65536?u[n++]=r:(r-=65536,u[n++]=55296|r>>10&1023,u[n++]=56320|1023&r)}return u.length!==n&&(u.subarray?u=u.subarray(0,n):u.length=n),i.applyFromCharCode(u)}(t=i.transformTo(r.uint8array?"uint8array":"array",t))},i.inherits(l,s),l.prototype.processChunk=function(t){var n=i.transformTo(r.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var o=n;(n=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),n.set(o,this.leftOver.length)}else n=this.leftOver.concat(n);this.leftOver=null}var s=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128==(192&t[n]);)n--;return n<0?e:0===n?e:n+a[t[n]]>e?n:e}(n),u=n;s!==n.length&&(r.uint8array?(u=n.subarray(0,s),this.leftOver=n.subarray(s,n.length)):(u=n.slice(0,s),this.leftOver=n.slice(s,n.length))),this.push({data:e.utf8decode(u),meta:t.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:e.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},e.Utf8DecodeWorker=l,i.inherits(c,s),c.prototype.processChunk=function(t){this.push({data:e.utf8encode(t.data),meta:t.meta})},e.Utf8EncodeWorker=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.socket=void 0;var i,r=n(17),o=n(6),s=(i=o)&&i.__esModule?i:{default:i};var a=e.socket=io.connect("/client");a.on("connect",function(){return r.store.dispatch({type:s.default.socket.connect})}),a.on("connect_error",function(t){return r.store.dispatch({type:s.default.socket.connect_error,error:t})}),a.on("reconnect",function(t){return r.store.dispatch({type:s.default.socket.reconnect,attempt:t})}),a.on("reconnecting",function(){return r.store.dispatch({type:s.default.socket.reconnecting})}),a.on("reconnect_error",function(t){return r.store.dispatch({type:s.default.socket.reconnect_error,error:t})}),a.on("reconnect_failed",function(t){return r.store.dispatch({type:s.default.socket.reconnect_failed,error:t})}),a.on("disconnect",function(){return r.store.dispatch({type:s.default.socket.disconnect})}),a.on("error",function(t){return r.store.dispatch({type:s.default.socket.error,error:t})})},function(t,e,n){(function(t){t.exports=function(){"use strict";var e,n;function i(){return e.apply(null,arguments)}function r(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function o(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){return void 0===t}function a(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function u(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function l(t,e){var n,i=[];for(n=0;n>>0,i=0;iTt(t)?(o=t+1,s=a-Tt(t)):(o=t,s=a),{year:o,dayOfYear:s}}function Yt(t,e,n){var i,r,o=Ut(t.year(),e,n),s=Math.floor((t.dayOfYear()-o-1)/7)+1;return s<1?i=s+Wt(r=t.year()-1,e,n):s>Wt(t.year(),e,n)?(i=s-Wt(t.year(),e,n),r=t.year()+1):(r=t.year(),i=s),{week:i,year:r}}function Wt(t,e,n){var i=Ut(t,e,n),r=Ut(t+1,e,n);return(Tt(t)-i+r)/7}Y("w",["ww",2],"wo","week"),Y("W",["WW",2],"Wo","isoWeek"),j("week","w"),j("isoWeek","W"),L("week",5),L("isoWeek",5),lt("w",$),lt("ww",$,H),lt("W",$),lt("WW",$,H),dt(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=S(t)}),Y("d",0,"do","day"),Y("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),Y("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),Y("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),Y("e",0,0,"weekday"),Y("E",0,0,"isoWeekday"),j("day","d"),j("weekday","e"),j("isoWeekday","E"),L("day",11),L("weekday",11),L("isoWeekday",11),lt("d",$),lt("e",$),lt("E",$),lt("dd",function(t,e){return e.weekdaysMinRegex(t)}),lt("ddd",function(t,e){return e.weekdaysShortRegex(t)}),lt("dddd",function(t,e){return e.weekdaysRegex(t)}),dt(["dd","ddd","dddd"],function(t,e,n,i){var r=n._locale.weekdaysParse(t,i,n._strict);null!=r?e.d=r:f(n).invalidWeekday=t}),dt(["d","e","E"],function(t,e,n,i){e[i]=S(t)});var Vt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Gt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ht="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Zt=at,Qt=at,Xt=at;function $t(){function t(t,e){return e.length-t.length}var e,n,i,r,o,s=[],a=[],u=[],l=[];for(e=0;e<7;e++)n=p([2e3,1]).day(e),i=this.weekdaysMin(n,""),r=this.weekdaysShort(n,""),o=this.weekdays(n,""),s.push(i),a.push(r),u.push(o),l.push(i),l.push(r),l.push(o);for(s.sort(t),a.sort(t),u.sort(t),l.sort(t),e=0;e<7;e++)a[e]=ht(a[e]),u[e]=ht(u[e]),l[e]=ht(l[e]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Kt(){return this.hours()%12||12}function Jt(t,e){Y(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function te(t,e){return e._meridiemParse}Y("H",["HH",2],0,"hour"),Y("h",["hh",2],0,Kt),Y("k",["kk",2],0,function(){return this.hours()||24}),Y("hmm",0,0,function(){return""+Kt.apply(this)+q(this.minutes(),2)}),Y("hmmss",0,0,function(){return""+Kt.apply(this)+q(this.minutes(),2)+q(this.seconds(),2)}),Y("Hmm",0,0,function(){return""+this.hours()+q(this.minutes(),2)}),Y("Hmmss",0,0,function(){return""+this.hours()+q(this.minutes(),2)+q(this.seconds(),2)}),Jt("a",!0),Jt("A",!1),j("hour","h"),L("hour",13),lt("a",te),lt("A",te),lt("H",$),lt("h",$),lt("k",$),lt("HH",$,H),lt("hh",$,H),lt("kk",$,H),lt("hmm",K),lt("hmmss",J),lt("Hmm",K),lt("Hmmss",J),ft(["H","HH"],vt),ft(["k","kk"],function(t,e,n){var i=S(t);e[vt]=24===i?0:i}),ft(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),ft(["h","hh"],function(t,e,n){e[vt]=S(t),f(n).bigHour=!0}),ft("hmm",function(t,e,n){var i=t.length-2;e[vt]=S(t.substr(0,i)),e[gt]=S(t.substr(i)),f(n).bigHour=!0}),ft("hmmss",function(t,e,n){var i=t.length-4,r=t.length-2;e[vt]=S(t.substr(0,i)),e[gt]=S(t.substr(i,2)),e[bt]=S(t.substr(r)),f(n).bigHour=!0}),ft("Hmm",function(t,e,n){var i=t.length-2;e[vt]=S(t.substr(0,i)),e[gt]=S(t.substr(i))}),ft("Hmmss",function(t,e,n){var i=t.length-4,r=t.length-2;e[vt]=S(t.substr(0,i)),e[gt]=S(t.substr(i,2)),e[bt]=S(t.substr(r))});var ee,ne=At("Hours",!0),ie={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:jt,monthsShort:Ft,week:{dow:0,doy:6},weekdays:Vt,weekdaysMin:Ht,weekdaysShort:Gt,meridiemParse:/[ap]\.?m?\.?/i},re={},oe={};function se(t){return t?t.toLowerCase().replace("_","-"):t}function ae(e){var n=null;if(!re[e]&&void 0!==t&&t&&t.exports)try{n=ee._abbr,function(){var t=new Error('Cannot find module "undefined"');throw t.code="MODULE_NOT_FOUND",t}(),ue(n)}catch(e){}return re[e]}function ue(t,e){var n;return t&&((n=s(e)?ce(t):le(t,e))?ee=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),ee._abbr}function le(t,e){if(null!==e){var n,i=ie;if(e.abbr=t,null!=re[t])A("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=re[t]._config;else if(null!=e.parentLocale)if(null!=re[e.parentLocale])i=re[e.parentLocale]._config;else{if(null==(n=ae(e.parentLocale)))return oe[e.parentLocale]||(oe[e.parentLocale]=[]),oe[e.parentLocale].push({name:t,config:e}),null;i=n._config}return re[t]=new M(C(i,e)),oe[t]&&oe[t].forEach(function(t){le(t.name,t.config)}),ue(t),re[t]}return delete re[t],null}function ce(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return ee;if(!r(t)){if(e=ae(t))return e;t=[t]}return function(t){for(var e,n,i,r,o=0;o=e&&k(r,n,!0)>=e-1)break;e--}o++}return ee}(t)}function he(t){var e,n=t._a;return n&&-2===f(t).overflow&&(e=n[_t]<0||11Mt(n[yt],n[_t])?mt:n[vt]<0||24Wt(n,o,s)?f(t)._overflowWeeks=!0:null!=u?f(t)._overflowWeekday=!0:(a=zt(n,i,r,o,s),t._a[yt]=a.year,t._dayOfYear=a.dayOfYear)}(t),null!=t._dayOfYear&&(s=pe(t._a[yt],r[yt]),(t._dayOfYear>Tt(s)||0===t._dayOfYear)&&(f(t)._overflowDayOfYear=!0),n=Bt(s,0,t._dayOfYear),t._a[_t]=n.getUTCMonth(),t._a[mt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=r[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[vt]&&0===t._a[gt]&&0===t._a[bt]&&0===t._a[wt]&&(t._nextDay=!0,t._a[vt]=0),t._d=(t._useUTC?Bt:function(t,e,n,i,r,o,s){var a=new Date(t,e,n,i,r,o,s);return t<100&&0<=t&&isFinite(a.getFullYear())&&a.setFullYear(t),a}).apply(null,a),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[vt]=24),t._w&&void 0!==t._w.d&&t._w.d!==o&&(f(t).weekdayMismatch=!0)}}var de=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ye=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_e=/Z|[+-]\d\d(?::?\d\d)?/,me=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],ve=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ge=/^\/?Date\((\-?\d+)/i;function be(t){var e,n,i,r,o,s,a=t._i,u=de.exec(a)||ye.exec(a);if(u){for(f(t).iso=!0,e=0,n=me.length;en.valueOf():n.valueOf()this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ln.isLocal=function(){return!!this.isValid()&&!this._isUTC},ln.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ln.isUtc=Be,ln.isUTC=Be,ln.zoneAbbr=function(){return this._isUTC?"UTC":""},ln.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ln.dates=O("dates accessor is deprecated. Use date instead.",nn),ln.months=O("months accessor is deprecated. Use month instead",Dt),ln.years=O("years accessor is deprecated. Use year instead",Pt),ln.zone=O("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}),ln.isDSTShifted=O("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var t={};if(m(t,this),(t=Oe(t))._a){var e=t._isUTC?p(t._a):Pe(t._a);this._isDSTShifted=this.isValid()&&0 1 && arguments[1] !== undefined ? arguments[1] : []; + return with_type(type, actions.concat(['index_loading', 'index', 'index_error', 'show_loading', 'show', 'show_error', 'create_loading', 'create', 'create_error', 'update_loading', 'update', 'update_error', 'destroy_loading', 'destroy', 'destroy_error', 'upload_loading', 'upload_progress', 'upload_waiting', 'upload_complete', 'upload_error', 'sort'])); +}; + +/***/ }), + +/***/ "./app/client/api/crud.upload.js": +/*!***************************************!*\ + !*** ./app/client/api/crud.upload.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.upload_action = undefined; +exports.crud_upload = crud_upload; + +var _crud = __webpack_require__(/*! ./crud.types */ "./app/client/api/crud.types.js"); + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function crud_upload(type, fd, data, dispatch) { + return new Promise(function (resolve, reject) { + var id = data.id; + + Object.keys(data).forEach(function (key) { + if (key !== 'id') { + fd.append(key, data[key]); + } + }); + + console.log('/api/' + type + '/' + id + '/upload/'); + + var xhr = new XMLHttpRequest(); + xhr.upload.addEventListener("progress", uploadProgress, false); + xhr.addEventListener("load", uploadComplete, false); + xhr.addEventListener("error", uploadFailed, false); + xhr.addEventListener("abort", uploadCancelled, false); + xhr.open("POST", '/api/' + type + '/' + id + '/upload/'); + xhr.send(fd); + + dispatch && dispatch({ type: (0, _crud.as_type)(type, 'upload_loading') }); + + var complete = false; + + function uploadProgress(e) { + if (e.lengthComputable) { + var percent = Math.round(e.loaded * 100 / e.total) || 0; + if (percent > 99) { + dispatch && dispatch(_defineProperty({ + type: (0, _crud.as_type)(type, 'upload_waiting'), + percent: percent + }, type, id)); + } else { + dispatch && dispatch(_defineProperty({ + type: (0, _crud.as_type)(type, 'upload_progress'), + percent: percent + }, type, id)); + } + } else { + dispatch && dispatch(_defineProperty({ + type: (0, _crud.as_type)(type, 'upload_error'), + error: 'unable to compute upload progress' + }, type, id)); + } + } + + function uploadComplete(e) { + var parsed = void 0; + try { + parsed = JSON.parse(e.target.responseText); + } catch (e) { + dispatch && dispatch(_defineProperty({ + type: (0, _crud.as_type)(type, 'upload_error'), + error: 'upload failed' + }, type, id)); + reject(e); + return; + } + dispatch && dispatch(_defineProperty({ + type: (0, _crud.as_type)(type, 'upload_complete'), + data: parsed + }, type, id)); + if (parsed.files && parsed.files.length) { + parsed.files.forEach(function (file) { + console.log(file); + dispatch && dispatch({ + type: (0, _crud.as_type)('file', 'create'), + data: file + }); + }); + } + resolve(parsed); + } + + function uploadFailed(evt) { + dispatch && dispatch(_defineProperty({ + type: (0, _crud.as_type)(type, 'upload_error'), + error: 'upload failed' + }, type, id)); + reject(evt); + } + + function uploadCancelled(evt) { + dispatch && dispatch(_defineProperty({ + type: (0, _crud.as_type)(type, 'upload_error'), + error: 'upload cancelled' + }, type, id)); + reject(evt); + } + }); +} + +var upload_action = exports.upload_action = function upload_action(type, id, fd) { + return function (dispatch) { + return crud_upload(type, id, fd, dispatch); + }; +}; + +/***/ }), + +/***/ "./app/client/api/index.js": +/*!*********************************!*\ + !*** ./app/client/api/index.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.actions = exports.parser = exports.util = undefined; + +var _crud = __webpack_require__(/*! ./crud.actions */ "./app/client/api/crud.actions.js"); + +var _util = __webpack_require__(/*! ../util */ "./app/client/util/index.js"); + +var _util2 = _interopRequireDefault(_util); + +var _parser = __webpack_require__(/*! ./parser */ "./app/client/api/parser.js"); + +var parser = _interopRequireWildcard(_parser); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* +for our crud events, create corresponding actions +the actions fire a 'loading' event, call the underlying api method, and then resolve. +so you can do ... + import { folderActions } from '../../api' + folderActions.index({ module: 'samplernn' }) + folderActions.show(12) + folderActions.create({ module: 'samplernn', name: 'foo' }) + folderActions.update(12, { module: 'pix2pix' }) + folderActions.destroy(12, { confirm: true }) + folderActions.upload(12, form_data) +*/ + +exports.util = _util2.default; +exports.parser = parser; +var actions = exports.actions = ['folder', 'file', 'dataset', 'task', 'user'].reduce(function (a, b) { + return (a[b] = (0, _crud.crud_actions)(b)) && a; +}, {}); + +/***/ }), + +/***/ "./app/client/api/parser.js": +/*!**********************************!*\ + !*** ./app/client/api/parser.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.tumblr = exports.thumbnail = exports.loadImage = exports.tag = exports.parse = exports.lookup = exports.integrations = undefined; + +var _nodeFetch = __webpack_require__(/*! node-fetch */ "./node_modules/node-fetch/browser.js"); + +var _nodeFetch2 = _interopRequireDefault(_nodeFetch); + +var _fetchJsonp = __webpack_require__(/*! fetch-jsonp */ "./node_modules/fetch-jsonp/build/fetch-jsonp.js"); + +var _fetchJsonp2 = _interopRequireDefault(_fetchJsonp); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var integrations = exports.integrations = [{ + type: 'image', + regex: /\.(jpeg|jpg|gif|png|svg)(\?.*)?$/i, + fetch: function fetch(url, done) { + var img = new Image(); + img.onload = function () { + if (!img) return; + var width = img.naturalWidth, + height = img.naturalHeight; + img = null; + done({ + url: url, + type: "image", + token: "", + thumbnail: "", + title: "", + width: width, + height: height + }); + }; + img.src = url; + if (img.complete) { + img.onload(); + } + }, + tag: function tag(media) { + return ''; + } +}, { + type: 'video', + regex: /\.(mp4|webm)(\?.*)?$/i, + fetch: function fetch(url, done) { + var video = document.createElement("video"); + var url_parts = url.replace(/\?.*$/, "").split("/"); + var filename = url_parts[url_parts.length - 1]; + video.addEventListener("loadedmetadata", function () { + var width = video.videoWidth, + height = video.videoHeight; + video = null; + done({ + url: url, + type: "video", + token: url, + thumbnail: "/public/assets/img/video-thumbnail.png", + title: filename, + width: width, + height: height + }); + }); + video.src = url; + video.load(); + }, + tag: function tag(media) { + return '