text: (this.webpackJsonpripple=this.webpackJsonpripple||[]).push([[0],{11:function(e,t,n){e.exports={Window:"Window_Window__3LwvP",WindowTitle:"Window_WindowTitle__BInoL",WindowContent:"Window_WindowContent__1Ls4_"}},115:function(e,t){},13:function(e,t,n){e.exports={Panel:"Panel_Panel__3MTlv",PanelTitle:"Panel_PanelTitle__3tYPw",IconActive:"Panel_IconActive__2VByb",PanelContent:"Panel_PanelContent__2JHYQ"}},133:function(e,t,n){},134:function(e,t,n){"use strict";n.r(t);var a={};n.r(a),n.d(a,"TriangleIcon",(function(){return ae})),n.d(a,"NetworkIcon",(function(){return re})),n.d(a,"TextIcon",(function(){return ie})),n.d(a,"ChartIcon",(function(){return oe})),n.d(a,"CircleIcon",(function(){return ce}));var r=n(0),i=n.n(r),o=n(10),c=n.n(o),l=(n(65),n(1)),u=Object(r.createContext)(),s=function(e){var t=e.children,n=Object(r.useState)((new Date).toString()),a=Object(l.a)(n,2),o=a[0],c=a[1];return i.a.createElement(u.Provider,{value:{lastUpdate:o,forceUpdate:function(){c((new Date).toString())}}},t)},d=n(2),m=function(e){return void 0==e?Math.random().toString(36).substr(2,9):new Array(e).fill(0).map((function(){return Math.random().toString(36).substr(2,9)}))},f=function(e,t){return e[t.key].map((function(e){return e.id==t.id&&(Object.assign(e,Object(d.a)({},t.data)),e.version=m()),e})),e},v=function(e,t){return e.views=e.views.filter((function(e){return e.id!=t.id})),e.viewList=e.views.map((function(e){return"".concat(e.type,".").concat(e.id)})),e},p=function(e,t){return e.views.push({type:t.data.type,title:t.data.title,subTitle:t.data.subtitle,id:m(),view:t.data.view}),e},g=function(e,t){switch(e.timestamp=(new Date).toString(),t.type){case"CHANGE":return f(e,t);case"DELETE":return v(e,t);case"CREATE":return p(e,t);default:return e}},b={views:[{type:"network",title:"Friendship network",subTitle:"Based on aggregation II",id:m(),view:"aggregate"},{type:"text",title:"Text Example",subTitle:"Description of process",id:m(),view:"textbox"},{type:"time",title:"Connection Timeseries",subTitle:"Based on aggregation III",id:m(),view:"timeplot"}],annotations:{},allIds:[]};b.allIds=b.views.map((function(e){return"".concat(e.type,".").concat(e.id)}));var E=Object(r.createContext)(),y=function(e){var t=e.children,n=Object(r.useReducer)(g,b),a=Object(l.a)(n,2),o=a[0],c=a[1],s=Object(r.useContext)(u).forceUpdate;return i.a.createElement(E.Provider,{value:{ram:o,ramUpdate:function(e){c(e),s()}}},t)},w=n(3),h=function(e,t){if(!(t="number"===typeof t?t:1/0))return Array.isArray(e)?e.map((function(e){return e})):e;return function e(n,a){return n.reduce((function(n,r){return Array.isArray(r)&&a<t?n.concat(e(r,a+1)):n.concat(r)}),[])}(e,1)},O=function e(t){return 1===t.length&&Array.isArray(t[0])?e(t[0]):Array.isArray(t)?t.map(e):t},j=function(e){return e=function e(t){if(t.length<=2)return t;for(var n=[];t.length>0;)n.push(t.splice(0,2));return e(n)}(e)},x=function(e,t){var n=t.view,a=Object(w.a)(h(e));return a.push(n),O(j(a))},C=function(e,t){var n=t.view,a=Object(w.a)(h(e));return a=a.filter((function(e){return e!==n})),O(j(a))},_=function e(t){var n=[];return t.forEach((function(t){if(Array.isArray(t)&&0!==t.length){var a=e(t);a.length>0&&n.push(a)}else"undefined"!==typeof t&&""!==t&&null!==t&&n.push(t)})),n},A=function(e){e=JSON.stringify(e);for(var t=/\[\[(\["\w+\.\d+","\w+\.\d+"\])\]\]/;t.test(e);)e=e.replace(t,"$1");for(var n=/\[(\["\w+\.\d+")\]/;n.test(e);)e=e.replace(n,"$1");for(var a=JSON.parse(e);Array.isArray(a[0])&&Array.isArray(a[0][0])&&1===a.length&&1===a[0].length;)a=a[0][0];return a},T=function(e,t){var n=t.dragged,a=t.to,r=t.pos,i=t.vertical,o=JSON.stringify(e).replace(/\s/,"").replace('"'.concat(n,'"'),"$from").replace('"'.concat(a,'"'),"$to");if("center"===r)return o=o.replace("$from",'"'.concat(a,'"')).replace("$to",'"'.concat(n,'"')),JSON.parse(o);var c=[];return c="left"===r||"top"===r?[n,a]:[a,n],(!i||"left"!==r&&"right"!==r)&&(i||"top"!==r&&"bottom"!==r)||(c=[c]),o=(o=o.replace("$from","null")).replace("$to",JSON.stringify(c)),e=_(JSON.parse(o)),A(e)},k=function(e,t){switch(t.type){case"ADD_VIEW":return x(e,t);case"REMOVE_VIEW":return C(e,t);case"MOVE_VIEW":return T(e,t);default:return e}},I=Object(r.createContext)(),N=function(e){var t=e.children,n=Object(r.useContext)(E).ram,a=Object(r.useReducer)(k,j(j(n.allIds))),o=Object(l.a)(a,2),c=o[0],u=o[1];return i.a.createElement(I.Provider,{value:{grid:c,dispatch:u,getVersion:function(e){var t=e.split("."),a=Object(l.a)(t,2),r=(a[0],a[1]);return n.views.find((function(e){return e.id==r})).version}}},t)},S=function(e){return JSON.parse(JSON.stringify(e))};var D=function(e,t){var n,a=m(),r="N"==(n=t.data.property)?["[{id,node}]","node"]:"S"==n?["[{time,value}]","time"]:"E"==n?["[{id,source,target}]","network"]:"A"==n?["","annotation"]:["",null],i=Object(l.a)(r,2),o=i[0],c=i[1];if(null==c)return e;if("annotation"==c){if("all_annotations"==t.data.label)return t.data.data.forEach((function(t){L(t);var n=m();e.annotations[n]=Object(d.a)({},t,{dbId:t.id,id:n}),e.annotations.allIds.push(n)})),e;t.data.data.forEach((function(n){L(n);var a=m();e.annotations[a]=Object(d.a)({},n,{id:a,collection:t.data.treeLocation,series:t.data.label,property:t.data.property,type:t.data.type}),e.annotations.allIds.push(a)}))}else e.dataset[c][a]={id:a,type:c,format:o,label:t.data.label,data:t.data.data,treeLocation:t.data.treeLocation},e.dataset[c].allIds.push(a);return e.dbversion=m(),e};function L(e){Object.keys(e).forEach((function(t){null===e[t]&&(e[t]="")}))}var P=function(e,t){return e.annotations[t.data.id]=Object(d.a)({},t.data,{isSynced:!1}),-1==e.annotations.allIds.indexOf(t.data.id)&&e.annotations.allIds.push(t.data.id),e.dbversion=m(),e};var V=function(e,t){t.id in e.annotations&&delete e.annotations[t.id];var n=e.annotations.allIds.indexOf(t.id);return n>-1&&e.annotations.allIds.splice(n,1),e.dbversion=m(),e};var B=function(e,t){console.log("SYNC",t.data);var n=S(e.annotations[t.data.id]);return e.annotations[t.data.id]=Object(d.a)({},n,{isSynced:!0}),"dbId"in t.data&&(e.annotations[t.data.id].dbId=t.data.dbId),e},R=function(e,t){switch(t.type){case"load":return D(e,t);case"add annotation":return P(e,t);case"delete annotation":return V(e,t);case"add sync":return B(e,t);default:throw new Error("WRONG ACTION FOR MEMORY")}},W=n(5),M=n.n(W),U=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=Object(r.useState)({loading:!0,data:null,error:null}),i=Object(l.a)(a,2),o=i[0],c=i[1];Object(r.useEffect)((function(){var n=new AbortController,a=n.signal;return function(){var n,r;M.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,M.a.awrap(fetch(e,Object(d.a)({},t,{signal:a})));case 3:return n=i.sent,i.next=6,M.a.awrap(n.json());case 6:r=i.sent,c({loading:!1,data:r,error:null}),i.next=16;break;case 10:if(i.prev=10,i.t0=i.catch(0),"AbortError"!==i.t0.name){i.next=14;break}return i.abrupt("return");case 14:throw c({loading:!1,data:null,error:i.t0}),i.t0;case 16:case"end":return i.stop()}}),null,null,[[0,10]])}(),function(){return n.abort()}}),Object(w.a)(n));var u=function(e){return o.data instanceof Array||"object"!==typeof o.data?c(Object(d.a)({},o,{data:e})):c(Object(d.a)({},o,{data:Object(d.a)({},o.data,{},e)}))};return[o.loading,o.data,o.error,u]};var F=Object(r.memo)((function(e){var t=e.loading,n=e.setLoading,a=Object(r.useContext)($).memoryUpdate,o=Object(r.useContext)(u).forceUpdate,c=U("./datasets"),s=Object(l.a)(c,4),d=s[0],m=s[1],f=s[2];s[3];return d?i.a.createElement("div",{id:"DataLayer",className:"loading"}):f?i.a.createElement("div",{id:"DataLayer",className:"error"}):(t&&(m.map((function(e){a({type:"load",data:{id:e.id,type:e.type,label:e.label,data:e.data,format:"",treeLocation:e.treeLocation,property:e.property}})})),n(!1)),setTimeout(o,300),i.a.createElement("div",{id:"DataLayer",className:"loaded"}))}),(function(e,t){return e.loading==t.loading})),H=n(50),z=n.n(H);function J(e,t){var n;return M.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:n=0;case 1:if(!(n<e.length)){a.next=7;break}return a.next=4,M.a.awrap(t(e[n],n,e));case 4:n++,a.next=1;break;case 7:case"end":return a.stop()}}))}var Y=Object(r.memo)((function(e){var t=e.memory,n=e.memoryUpdate,a=(Object(r.useContext)(u).lastUpdate,function(e){return new Promise((function(t,n){z.a.post("./annotation",JSON.stringify(e),{headers:{"Content-Type":"application/json"}}).then((function(e){return t(e.data)})).catch(n)}))});return function(){var e;M.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return e=t.annotations.allIds.map((function(e){return t.annotations[e]})),r.next=3,M.a.awrap(J(e,(function(e){var t;return M.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,M.a.awrap(a({type:"dbId"in e&&0!=e.isSynced?"update":"insert",data:e}));case 2:t=r.sent,n({type:"add sync",data:Object(d.a)({},t,{id:e.id})});case 4:case"end":return r.stop()}}))})));case 3:console.log("DB Synced...");case 4:case"end":return r.stop()}}))}(),i.a.createElement("div",{className:"db-messenger"})}),(function(e,t){return e.dbversion==t.dbversion})),G={dbversion:null,text:{allIds:[]},dataset:{network:{allIds:[]},time:{allIds:[]},node:{allIds:[]}},annotations:{allIds:[]}},$=Object(r.createContext)(),q=function(e){var t=e.children,n=Object(r.useReducer)(R,G),a=Object(l.a)(n,2),o=a[0],c=a[1],u=Object(r.useState)(!0),s=Object(l.a)(u,2),d=s[0],m=s[1],f=Object(r.useState)(new Date),v=Object(l.a)(f,2),p=v[0],g=v[1];return i.a.createElement($.Provider,{value:{memory:o,memoryUpdate:c,getDatasetList:function(){return[].concat(Object(w.a)(o.dataset.network.allIds.map((function(e){var t=o.dataset.network[e];return{label:t.label,type:t.type,id:t.id}}))),Object(w.a)(o.dataset.time.allIds.map((function(e){var t=o.dataset.time[e];return{label:t.label,type:t.type,id:t.id}}))))},getDataset:function(e,t){return S(o.dataset[e][t])},makeSync:function(){return g(new Date)}}},i.a.createElement(F,{loading:d,setLoading:m}),i.a.createElement(Y,{memory:o,memoryUpdate:c,lastSync:p}),t)},X={id:"",title:"",time_from:"",time_to:"",collection:"",series:"",source:"",target:"",description:"",type:""},Z=Object(r.createContext)(),K=function(e){var t=e.children,n=Object(r.useState)(X),a=Object(l.a)(n,2),o=a[0],c=a[1],u=Object(r.useContext)($),s=u.memory,f=u.memoryUpdate;return i.a.createElement(Z.Provider,{value:{annotation:o,updateAnnotation:function(e){var t=s.annotations.allIds.map((function(e){return s.annotations[e]})).find((function(t){return t.id==e.id})),n=t?Object(d.a)({},t):{};c(Object(d.a)({id:m()},X,{},e,{},n))},setAnnotationField:function(e,t){var n=S(o);n[e]=t,c(n),Object.keys(n).length>0&&f({type:"add annotation",data:n})}}},t)},Q=n(51),ee=n.n(Q),te=n(18),ne=n.n(te),ae=Object(r.memo)((function(e){return i.a.createElement("svg",Object.assign({height:"6",viewBox:"0 0 415.346 415.346"},e),i.a.createElement("path",{d:"M41.712,415.346c-11.763,0-21.3-9.537-21.3-21.3V21.299C20.412,9.536,29.949,0,41.712,0l346.122,191.697c0,0,15.975,15.975,0,31.951C371.859,239.622,41.712,415.346,41.712,415.346z"}))})),re=Object(r.memo)((function(e){return i.a.createElement("svg",Object.assign({height:"16",viewBox:"0 0 96.666 96.666"},e),i.a.createElement("rect",{x:"36",y:"6",width:"24.666",height:"24.666"}),i.a.createElement("rect",{y:"66",width:"24.666",height:"24.666"}),i.a.createElement("rect",{x:"72",y:"66",width:"24.666",height:"24.666"}),i.a.createElement("polygon",{points:"15.311,51.333 82.105,51.333 82.105,63.066 86.561,63.066 86.561,46.4 84.334,46.4 84.334,46.333 50.833,46.333 50.833,35 45.833,35 45.833,46.333 12.334,46.333 12.334,46.4 10.855,46.4 10.855,63.066 15.311,63.066"}))})),ie=Object(r.memo)((function(e){return i.a.createElement("svg",Object.assign({height:"16",x:"0px",y:"0px",viewBox:"0 0 218 218"},e),i.a.createElement("polygon",{points:"103,41 133,41 133,73 167,73 167,7 0,7 0,73 34,73 34,41 64,41 64,177 48,177 48,211 120,211 120,177 103,177 \t"}),i.a.createElement("polygon",{points:"118,90 118,132 142,132 142,114 155,114 155,187 145,187 145,211 191,211 191,187 182,187 182,114 194,114 \r 194,132 218,132 218,90 \t"}))})),oe=Object(r.memo)((function(e){return i.a.createElement("svg",Object.assign({height:"16",viewBox:"0 0 276.232 276.232"},e),i.a.createElement("path",{d:"M56.505,195.714c1.719,1.001,3.601,1.474,5.455,1.474c3.748,0,7.397-1.936,9.415-5.412l18.792-32.319c4.525-7.794,13.44-9.013,19.896-2.725l28.631,27.859c2.643,2.573,6.402,3.633,10.019,2.807c3.601-0.827,6.532-3.421,7.794-6.897l32.014-66.563c3.073-8.474,11.531-17.149,18.895-19.374c7.37-2.23,15.273,2.355,17.655,10.231l4.319,14.272c0.87,2.872,2.725,3.057,4.139,0.408l25.727-48.076c1.414-2.649,0.419-5.945-2.23-7.364l-48.076-25.743c-2.649-1.42-4.085-0.234-3.22,2.638c0,0,1.947,6.44,4.357,14.386c2.404,7.946-2.638,16.502-11.259,19.113l-16.274,4.928c-3.285,0.995-5.907,3.481-7.076,6.706l-28.131,55.848c-3.073,8.474-10.797,10.247-17.258,3.965l-26.543-25.825c-2.399-2.339-5.76-3.432-9.061-2.981c-3.318,0.451-6.244,2.415-7.925,5.309l-33.994,58.47C49.548,186.038,51.31,192.695,56.505,195.714z"}),i.a.createElement("path",{d:"M262.139,217.073c0,0-5.575-0.125-11.819-0.125H37.256c-9.013,0-16.344-7.299-16.393-16.317c-0.163-33.059-0.533-104.843-0.533-104.843c0-2.91-0.408-5.472-1.202-7.609c-1.305-3.503-4.803-5.765-8.915-5.765c-4.204,0-7.734,2.322-8.991,5.912c-0.74,2.105-1.115,4.618-1.115,7.468v111.805c0,1.588-0.027,3.242-0.054,4.917c-0.185,11.34-0.092,18.482,3.916,22.278c2.616,2.491,6.233,3.747,10.742,3.747h246.966c7.272-0.158,14.555-3.617,14.555-10.992C276.232,226.581,276.341,217.073,262.139,217.073z"}))})),ce=Object(r.memo)((function(e){return i.a.createElement("svg",Object.assign({height:"16",viewBox:"0 0 512 512"},e),i.a.createElement("path",{d:"M256,0C114.837,0,0,114.837,0,256s114.837,256,256,256s256-114.837,256-256S397.163,0,256,0z"}))})),le=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Object(r.useState)(e),n=Object(l.a)(t,2),a=n[0],i=n[1],o=function(e){e.preventDefault(),i(!a)};return[a,o,i]},ue=Object(r.memo)((function(e){var t=e.children,n=le(),a=Object(l.a)(n,2),r=a[0],o=a[1],c=r?void 0:{width:0,minWidth:0};return i.a.createElement("div",{className:ne.a.PanelsList},i.a.createElement("div",{className:ne.a.Panels+" customScrollBar",style:c},t),i.a.createElement("div",{className:ne.a.PanelsToggle,onClick:o},i.a.createElement(ae,{transform:"rotate(".concat(r?"180":"0",")")})))})),se=n(17),de=n(13),me=n.n(de),fe=function(e){var t=e.view_type,n=e.view_id,a=Object(r.useContext)(I),i=a.grid,o=a.dispatch,c="".concat(t,".").concat(n),l=h(i).find((function(e){return e===c}));return[l,function(){return o({type:l?"REMOVE_VIEW":"ADD_VIEW",view:c})}]},ve=function(e){return{draggable:!0,onDragStart:function(t){var n=document.getElementById("MainView"),a=t.target;setTimeout((function(){n.classList.add("drag"),a.classList.add("drag")}),1),t.dataTransfer.setData("text",e)},onDragEnd:function(e){var t=document.getElementById("MainView"),n=e.target;setTimeout((function(){t.classList.remove("drag"),n.classList.remove("drag")}),1)}}},pe=Object(r.memo)((function(e){var t=e.title,n=e.subTitle,r=e.flexOpen,o=e.icon,c=e.open,u=Object(se.a)(e,["title","subTitle","flexOpen","icon","open"]),s=le(c),m=Object(l.a)(s,2),f=m[0],v=m[1],p=fe(u),g=Object(l.a)(p,2),b=g[0],E=g[1],y=r&&f?{flex:1,minHeight:0}:void 0,w=f?{}:{height:0};w=r&&f?Object(d.a)({height:"calc(100% - 1.25rem)"},w):w;var h=a[o];return i.a.createElement("div",{className:me.a.Panel,style:y},i.a.createElement("div",{className:me.a.PanelTitle,onClick:h?null:v},i.a.createElement(ae,{transform:"rotate(".concat(f?"90":"0",")"),onClick:h?v:null}),i.a.createElement("span",{onClick:h?v:null},i.a.createElement("h5",null,t),i.a.createElement("h6",null,n)),h&&i.a.createElement("div",Object.assign({},ve("".concat(u.view_type,".").concat(u.view_id)),{onClick:E,draggable:!b}),i.a.createElement(h,{className:b?me.a.IconActive:""}))),i.a.createElement("div",{className:me.a.PanelContent,style:w},u.children))})),ge=n(15),be=n(7),Ee=n.n(be),ye=n(52),we=n.n(ye),he=Object(r.memo)((function(e){var t=e.children,n=Object(se.a)(e,["children"]);return i.a.createElement("form",Object.assign({onSubmit:function(e){e.preventDefault()},className:we.a.Form},n),t)})),Oe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=Object(r.useState)(t),a=Object(l.a)(n,2),i=a[0],o=a[1],c=function(e){return o(e.target.value)};return{name:e,value:i,onChange:c}},je=function(e){switch(e){case"Network":return["network","aggregate"];case"Timeseries":return["time","timeplot"];case"Text":return["text","textbox"];default:return["network","aggregate"]}},xe=function(){var e=Object(r.useContext)(E).ramUpdate;return function(t,n,a){var r=je(a),i=Object(l.a)(r,2),o=i[0],c=i[1];e({type:"CREATE",data:{title:t,subtitle:n,type:o,view:c}})}},Ce=function(e){var t=e.toggle,n=U("api/add_view.json"),a=Object(l.a)(n,4),o=a[0],c=a[1],u=a[2],s=a[3],d=Object(r.useRef)(),m=Oe("title"),f=Oe("subtitle"),v=xe();if(o)return i.a.createElement("p",null,"Loading...");if(u)return i.a.createElement("p",null,"Error: ",u.message);var p={autoComplete:"off",autoCorrect:"off"};return i.a.createElement(he,{autoComplete:!1},i.a.createElement("label",null,"Title"),i.a.createElement("input",Object.assign({},m,p,{ref:d})),i.a.createElement("label",null,"Subtitle"),i.a.createElement("input",Object.assign({},f,p)),i.a.createElement("label",null,"Type"),i.a.createElement("select",{required:!0,value:c.type,onChange:function(e){var t=e.target,n=t.name,a=t.value;return s(Object(ge.a)({},n,a))},name:"type",style:{marginTop:"0.125rem"}},c.type_options.map((function(e,t){return i.a.createElement("option",{key:t,value:e,disabled:""===e},""===e?"No Selection":e)}))),i.a.createElement("div",{className:Ee.a.AddButton,onClick:function(){""!=m.value?(v(m.value,f.value,c.type),t({preventDefault:function(){}}),m.onChange({target:{value:""}}),f.onChange({target:{value:""}})):d.current.focus()}},"Add"))},_e=Object(r.memo)((function(){var e=le(!1),t=Object(l.a)(e,2),n=t[0],a=t[1],r=n?void 0:{height:0,minHeight:0};return i.a.createElement("div",{className:Ee.a.AddContainer},i.a.createElement("div",{className:Ee.a.AddPanel,onClick:a},n?"-":"+"),i.a.createElement("div",{className:Ee.a.PanelContent},i.a.createElement("div",{className:Ee.a.AddForm,style:r},i.a.createElement(Ce,{toggle:a}))))})),Ae=n(19),Te=n.n(Ae),ke=Object(r.memo)((function(){var e=Object(r.useContext)(Z),t=e.annotation,n=e.setAnnotationField,a=e.updateAnnotation,o=Object(r.useContext)($),c=o.memoryUpdate,l=o.makeSync,u=function(e){var t=e.target,a=t.name,r=t.value;null==r&&(r=""),n(a,r)};return i.a.createElement(he,{onBlur:l},i.a.createElement("div",{className:Te.a.Controls},i.a.createElement("div",{className:Te.a.Status,onClick:function(){c({type:"delete annotation",id:t.id}),a({id:m()})}},"DELETE"),i.a.createElement("div",{className:Te.a.NewAnnotation,onClick:function(){a({id:m()})}},"NEW ANNOTATION")),i.a.createElement("label",null,"From Time"),i.a.createElement("input",{type:"text",value:t.time_from,onChange:u,name:"time_from"}),i.a.createElement("label",null,"To Time"),i.a.createElement("input",{type:"text",value:t.time_to,onChange:u,name:"time_to"}),i.a.createElement("label",null,"Collection"),i.a.createElement("input",{type:"text",value:t.collection,onChange:u,name:"collection"}),i.a.createElement("label",null,"Series"),i.a.createElement("input",{type:"text",value:t.series,onChange:u,name:"series"}),i.a.createElement("label",null,"From Node"),i.a.createElement("input",{type:"text",value:t.source,onChange:u,name:"source"}),i.a.createElement("label",null,"To Node"),i.a.createElement("input",{type:"text",value:t.target,onChange:u,name:"target"}),i.a.createElement("label",null,"Title"),i.a.createElement("input",{type:"text",value:t.title,onChange:u,name:"title"}),i.a.createElement("label",null,"Description"),i.a.createElement("textarea",{className:"customScrollBar",rows:"5",name:"description",value:t.description,onChange:u}))}),(function(e,t){return e.id==t.id})),Ie=n(21),Ne=n.n(Ie),Se=function(e){var t=e.isSuggestions,n=e.setToggle,a=e.suggestions,r=e.children,o=e.value,c=e.onChange,l=e.onBlur;return i.a.createElement("div",{className:Ne.a.Autocomplete,onBlur:l},r,t&&i.a.createElement("div",{className:Ne.a.AutocompleteItems},a.filter((function(e){return e.startsWith(o)})).map((function(e){return i.a.createElement("div",{onMouseDown:(t=e,function(e){n(!1),c({target:{value:t}})})},e);var t}))))},De=function(e,t){var n=Object(r.useContext)($).getDatasetList,a=Object(r.useContext)(E),i=a.ram,o=a.ramUpdate;return function(a){var r=i.views.find((function(t){return t.id==e}));r.inputs=n().filter((function(e){return e.type===t})).filter((function(e){return a.includes(e.label)})),o({type:"CHANGE",key:"views",id:e,data:r})}},Le=function(e){var t=e.viewId,n=(0,Object(r.useContext)($).getDatasetList)().filter((function(e){return"network"===e.type})).map((function(e){return e.label})),a=le(!1),c=Object(l.a)(a,3),u=c[0],s=c[2],d=Oe("datasetInput",""),m=De(t,"network"),f=Object(r.useRef)(),v=function(e){d.onChange(e);var t,a=Object(o.findDOMNode)(f.current).classList;t=e.target.value,(n.includes(t)||""==t)&&a.contains("invalid")?a.remove("invalid"):a.contains("invalid")||a.add("invalid")};return i.a.createElement(i.a.Fragment,null,i.a.createElement(Se,Object.assign({},d,{onChange:v,suggestions:n,isSuggestions:u,setToggle:s,onBlur:function(e){if(n.includes(d.value)||""==d.value)return s(!1),Object(o.findDOMNode)(f.current).classList.remove("invalid"),void m([d.value]);setTimeout((function(){f.current.focus()}),1)}}),i.a.createElement("label",null,"Dataset"),i.a.createElement("input",Object.assign({type:"text"},d,{onChange:v,onFocus:function(){s(!0)},ref:f}))))},Pe=function(e,t){var n=Object(r.useContext)(I),a=n.grid,i=n.dispatch,o=Object(r.useContext)(E).ramUpdate,c="".concat(e,".").concat(t),l=h(a).find((function(e){return e===c}));return function(){i({type:l?"REMOVE_VIEW":"",view:c}),o({type:"DELETE",id:t})}},Ve=function(e,t){var n=e.split("."),a=Object(l.a)(n,2),r=(a[0],a[1]);return t.views.find((function(e){return e.id===r}))},Be=function(e,t,n,a){var r=Ve(".".concat(t),e).fields;return r[n].value=a,{type:"CHANGE",key:"views",id:t,data:{fields:r}}},Re=function(e){var t=e.value,n=e.handleChange,a=e.defaultValue,o=e.name,c=Oe(o,t),l=Object(r.useRef)();return i.a.createElement("input",Object.assign({},c,{onChange:function(e){var t=e.target.value;c.onChange({target:{value:t}})},placeholder:""==a?"DD/MM/YYYY":a,onBlur:function(){!function(e){if(""==e)return!0;var t=e.split("/").reverse().join("-");return!isNaN(new Date(t).getTime())}(c.value)?setTimeout((function(){l.current.focus()}),1):c.value!=t&&n({target:{name:o,value:c.value.split("/").reverse().join()}})},ref:l}))};var We=function(e){var t=e.fields,n=e.id,a=Object(r.useContext)(E),o=a.ram,c=a.ramUpdate,u=U("api/field_options.json"),s=Object(l.a)(u,3),d=s[0],m=s[1],f=s[2];if(d)return i.a.createElement("p",null,"Loading...");if(f)return i.a.createElement("p",null,"Error: ",f.message);var v=function(e){var t=e.target,a=t.name,r=t.value,i=Be(o,n,a,r);c(i)};return Object.values(t).map((function(e){return"time"==e.type?i.a.createElement(i.a.Fragment,null,i.a.createElement("label",null,e.label),i.a.createElement(Re,Object.assign({},e,{name:e.key,defaultValue:e.default,handleChange:v}))):i.a.createElement(i.a.Fragment,null,i.a.createElement("label",null,e.label),i.a.createElement("select",{required:!0,value:e.value,onChange:v,name:e.key},(t=e.type,m[t].options.map((function(e,t){return i.a.createElement("option",{key:t,value:e,disabled:""===e},""===e?"No Selection":e)})))));var t}))},Me=function(e){var t=e.view_id,n=e.view_type,a=Object(r.useContext)(E).ram,o=Ve(".".concat(t),a),c=Pe(n,t);return"fields"in o?i.a.createElement(he,null,i.a.createElement(Le,{viewId:t}),i.a.createElement(We,o),i.a.createElement("div",{onClick:c,className:"delete-button"},"DELETE VIEW")):i.a.createElement("p",{style:{fontSize:".7rem"}},"Click the icon to display...")},Ue=n(22),Fe=n.n(Ue),He=n(23),ze=n.n(He),Je=n(16),Ye=n.n(Je),Ge=function(e){var t=e.item,n=e.i,a=e.id,r=e.remove;return i.a.createElement("div",{className:Ye.a.PlotItem},i.a.createElement("b",{onClick:function(){return r(a,n)}},"X"),i.a.createElement("span",null,t))},$e=n(24),qe=n.n($e),Xe=function(e){var t=e.id,n=e.suggestions,a=e.children,r=e.value,o=e.addData,c=e.setInputActivity,u=le(!0),s=Object(l.a)(u,3),d=s[0],m=(s[1],s[2]);return i.a.createElement("form",{autoComplete:!1},i.a.createElement("div",{className:qe.a.Autocomplete,onBlur:function(){return c(!1)}},a,d&&i.a.createElement("div",{className:qe.a.AutocompleteItems},n.filter((function(e){return e.startsWith(r)})).map((function(e){return i.a.createElement("div",{onMouseDown:(n=e,function(e){e.preventDefault(),m(!1),c(!1),o(t,n)})},e);var n})))))},Ze=function(e){var t=e.setInputActivity,n=e.content,a=e.addData,o=e.id,c=(0,Object(r.useContext)($).getDatasetList)().filter((function(e){return"time"===e.type})).map((function(e){return e.label})),l=Object(r.useRef)(),u=Oe("datasetInput"),s=Object(w.a)(c).filter((function(e){return!n.includes(e)}));return Object(r.useEffect)((function(){s.length?l.current.focus():t(!1)})),i.a.createElement(Xe,Object.assign({},u,{id:o,addData:a,suggestions:s,setInputActivity:t}),i.a.createElement("div",{className:Ye.a.PlotItem},i.a.createElement("b",{onClick:function(){return t(!1)}},"X"),i.a.createElement("input",Object.assign({},u,{onChange:function(e){(function(e){var t=e.target.value;return s.filter((function(e){return e.startsWith(t)})).length})(e)&&u.onChange(e)},ref:l}))))},Ke=function(e){var t=e.id,n=e.label,a=e.content,r=e.remove,o=e.addData,c=e.isInputActive,l=e.setInputActivity;return i.a.createElement("div",{className:ze.a.Plot},i.a.createElement("h5",null,n),i.a.createElement("div",{className:ze.a.PlotContent,onDoubleClick:function(){return c?null:l(!0)}},c&&i.a.createElement(Ze,{id:t,content:a,setInputActivity:l,addData:o}),a.map((function(e,n){return i.a.createElement(Ge,{item:e,i:n,remove:r,id:t,key:e})}))))},Qe=function(e){var t=e.view_type,n=e.view_id,a=le(!1),o=Object(l.a)(a,3),c=o[0],u=o[1],s=o[2],d=Pe(t,n),m=Object(r.useContext)(E),f=m.ram,v=(m.ramUpdate,Ve(".".concat(n),f)),p=De(n,"time"),g=Object(r.useState)([{id:"mainplot",label:"Main Plot",content:v.inputs?v.inputs.map((function(e){return e.label})):[]}]),b=Object(l.a)(g,2),y=b[0],h=b[1],O=function(e){var t;h(e);var n=(t=[]).concat.apply(t,Object(w.a)(e.map((function(e){return e.content}))));p(n)};if(!("fields"in v))return i.a.createElement("p",{style:{fontSize:".7rem"}},"Click the icon to display...");var j=function(e,t){var n=Object(w.a)(y);e=n.findIndex((function(t){return t.id===e})),n[e].content.splice(t,1),O(n)},x=function(e,t){var n=Object(w.a)(y);e=n.findIndex((function(t){return t.id===e})),n[e].content.unshift(t),O(n)};return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:Fe.a.TimeSeriesView},i.a.createElement("div",{className:Fe.a.AddPlot,onClick:u},"+"),y.map((function(e){return i.a.createElement(Ke,Object.assign({},e,{remove:j,addData:x,isInputActive:c,setInputActivity:s,key:e.id}))}))),i.a.createElement(he,null,i.a.createElement(We,v),i.a.createElement("div",{onClick:d,className:"delete-button"},"DELETE VIEW")))},et=(n(83),function(e){var t=e.view_id,n=e.view_type,a=Object(r.useContext)(E).ram,o=Ve(".".concat(t),a),c=Pe(n,t);return"fields"in o?i.a.createElement(he,null,i.a.createElement(We,o),i.a.createElement("div",{onClick:c,className:"delete-button"},"DELETE VIEW")):i.a.createElement("p",{style:{fontSize:".7rem"}},"Drag the view icon to the desired location...")});function tt(e,t){(function e(t,n){var a=t.split("/"),r=Object(l.a)(a,1)[0];if(""==r)return n;var i=t.split("/").slice(1).join("/"),o=n.find((function(e){return e.label==r}));if(o)return""==i?o.content:e(i,o.content);return n.push({open:!0,label:r,content:[]}),e(i,n.find((function(e){return e.label==r})).content)})(e.collection,t).push({open:!0,id:e.id,label:nt(e)})}function nt(e){if(e.title)return e.title;switch(e.type){case"TS":return e.time_from+"| untitled";case"TN":return"from:"+e.source+" to:"+e.target+"| untitled"}return e.id+"| untitled"}var at=function(e){for(var t=[],n=0;n<e.length;n++){tt(e[n],t)}return t},rt=n(53),it=n.n(rt),ot=function e(t){var n=t.label,a=t.id,o=t.content,c=t.open,u=Object(r.useContext)(Z).updateAnnotation,s=o&&o.length>0,d=le(c),m=Object(l.a)(d,2),f=m[0],v=m[1],p=s?f?"b":"span":"i";return i.a.createElement("li",null,i.a.createElement("div",{onClick:function(e){v(e),s||(console.log("Looking for id:",a),u({id:a}))}},s?i.a.createElement(ae,{transform:"rotate(".concat(f?"90":"0",")")}):i.a.createElement("u",null,"A"),i.a.createElement(p,null,n)),s?i.a.createElement("ul",{style:{display:f?"block":"none"}},o.map((function(t){return i.a.createElement(e,Object.assign({key:t.id},t))}))):null)},ct=function(){var e=Object(r.useContext)($).memory,t=at(e.annotations.allIds.map((function(t){return e.annotations[t]})).sort((function(e,t){return e.collection<t.collection?-1:1})));return i.a.createElement("ul",{className:it.a.TreeView+" customScrollBar"},t.map((function(e){return i.a.createElement(ot,Object.assign({key:e.id},e))})))},lt=Object(r.memo)((function(){var e=Oe("from_time"),t=Oe("to_time");return i.a.createElement(he,null,i.a.createElement("label",null,"From Time"),i.a.createElement("input",e),i.a.createElement("label",null,"To Time"),i.a.createElement("input",t))})),ut=function(e){var t=e.views;return t.filter((function(e){return"text"===e.type})).map((function(e){return i.a.createElement(pe,{title:"".concat(e.title),subTitle:"".concat(e.subTitle),icon:"TextIcon",open:!1,view_type:"text",view_id:e.id,key:e.id},i.a.createElement(et,{views:t,view_type:"text",view_id:e.id}))}))},st=function(e){var t=e.views;return t.filter((function(e){return"time"===e.type})).map((function(e){return i.a.createElement(pe,{title:"".concat(e.title),subTitle:"".concat(e.subTitle),icon:"ChartIcon",open:!1,view_type:"time",view_id:e.id,key:e.id},i.a.createElement(Qe,{views:t,view_type:"time",view_id:e.id}))}))},dt=function(e){var t=e.views;return t.filter((function(e){return"network"===e.type})).map((function(e){return i.a.createElement(pe,{title:"".concat(e.title),subTitle:"".concat(e.subTitle),icon:"NetworkIcon",open:!1,view_type:"network",view_id:e.id,key:e.id},i.a.createElement(Me,{views:t,view_type:"network",view_id:e.id}))}))},mt=function(){var e=Object(r.useContext)(E),t=e.ram,n=(e.ramUpdate,Object(r.useContext)(I).grid,Object(r.useContext)(u).lastUpdate,Object(r.useContext)(Z)),a=(n.active,n.annotation);return i.a.createElement("div",{className:ee.a.Sidebar},i.a.createElement(ue,null,i.a.createElement(pe,{title:"DATA",flexOpen:!0},i.a.createElement(ct,null)),i.a.createElement(pe,{title:"ANNOTATION"},i.a.createElement(ke,a))),i.a.createElement(ue,null,i.a.createElement(pe,{title:"SYNCHRONIZE ALL"},i.a.createElement(lt,null)),i.a.createElement(ut,t),i.a.createElement(st,t),i.a.createElement(dt,t),i.a.createElement(_e,null)))},ft=n(11),vt=n.n(ft),pt=Object(r.memo)((function(e){var t=e.view,n=e.vertical,a=Object(r.useContext)(I).dispatch,o=function(e){e.preventDefault()},c=function(e){var t=e.target;setTimeout((function(){return t.classList.add("active")}),1)},l=function(e){var t=e.target;setTimeout((function(){return t.classList.remove("active")}),1)},u=function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation();var t=e.dataTransfer.getData("text"),r=e.target.getAttribute("view"),i=e.target.getAttribute("pos");t&&r&&i&&(setTimeout((function(){var e=document.getElementById("MainView");e.classList.remove("drag"),e.querySelectorAll(".drop-zone div").forEach((function(e){return e.classList.remove("active")})),e.querySelectorAll(".drag").forEach((function(e){return e.classList.remove("drag")}))}),1),a({type:"MOVE_VIEW",dragged:t,to:r,pos:i,vertical:n}))};return i.a.createElement("div",{className:"drop-zone"},["center","top","right","bottom","left"].map((function(e){return i.a.createElement("div",{className:e,key:e,view:t,pos:e,onDragOver:o,onDragEnter:c,onDragLeave:l,onDrop:u})})))})),gt=function(e,t){return e[t.key]=Object.assign(e[t.key],t.data),e},bt=function(e,t){return delete e[t.key],e=e.filter((function(e){return e!==t.key}))},Et=function(e,t){return e[t.key]={timestamp:(new Date).toString()},e.allIds.push(t.key),e},yt=function(e,t){switch(e.timestamp=(new Date).toString(),t.type){case"SET":return Et(e,t);case"CHANGE":return gt(e,t);case"CLEAR":return bt(e,t);default:throw new Error("CACHE ERROR - Action: ".concat(t.type," is not available!"))}},wt=Object(r.createContext)(),ht=function(e){var t=e.children,n=Object(r.useReducer)(yt,{allIds:[]}),a=Object(l.a)(n,2),o=a[0],c=a[1];return i.a.createElement(wt.Provider,{value:{cache:o,cacheUpdate:c}},t)};Date.prototype.getTimeStamp=function(){return this.getDate()+"/"+(this.getMonth()+1)+"/"+this.getFullYear()};var Ot=function(e,t){var n=t.map((function(e){return e.id})).join("-"),a={startTime:function(){var e;return t.forEach((function(t){var n=t.data,a=new Date(n[0].time);e=void 0==e?a:e<a?e:a})),void 0==e?"":e.getTimeStamp()},endTime:function(){var e;return t.forEach((function(t){var n=t.data,a=new Date(n[n.length-1].time);e=void 0==e?a:e<a?e:a})),void 0==e?"":e.getTimeStamp()},startAggregateTime:function(){var e=Object(l.a)(t,1)[0];return void 0==e?"":new Date(e.data[0].time_from).getTimeStamp()},endAggregateTime:function(){var e=Object(l.a)(t,1)[0];return void 0==e?"":new Date(e.data[e.data.length-1].time_from).getTimeStamp()}},r={};return Object.keys(e.fields).filter((function(t){return"time"==e.fields[t].type})).map((function(t){var n=e.fields[t];return n.default=a[t](),n})).forEach((function(e){r[e.key]=e})),{type:"CHANGE",key:"views",id:e.id,data:{fields:Object(d.a)({},e.fields,{},r),rendered:n}}},jt=function(e,t,n,a,r){e.dataset;var i=t.split("."),o=Object(l.a)(i,2);o[0];return{type:"CHANGE",key:"views",id:o[1],data:{fields:S(a).map((function(e){return e.value=e.default,e})).reduce((function(e,t){return e[t.key]=t,e}),{}),inputs:n,rendered:r}}},xt={responsive:!0,maintainAspectRatio:!1,animation:!1,events:["click"],onClick:function(e){console.log(e)}},Ct=["#A8322D","#5B4E77","#218380","#FBB13C","#2E5EAA","#73D2DE"],_t=n(54),At=n.n(_t),Tt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=JSON.parse(JSON.stringify(e)).map((function(e){return e.time=new Date(e.time).getTime(),e}));return t=null==t||""==t?0:new Date(t).getTime(),n=null==n||""==n?Math.max.apply(Math,Object(w.a)(a.map((function(e){return e.time}))))+1:new Date(n).getTime(),a.filter((function(e){return e.time>=t&&e.time<=n}))},kt={chart:function(e){e.title;var t=e.inputs,n=e.fields,a=e.updateAnnotation,o=i.a.createRef(),c=S(t).map((function(e){return e.data=Tt(e.data,n.startTime.value,n.endTime.value),e}));return Object(r.useEffect)((function(){var e=new At.a(o.current,{type:"line",data:{labels:c[0].data.map((function(e){return new Date(e.time).toDateString()})),datasets:c.map((function(e,t){return{id:e.id,treeLocation:e.treeLocation,label:e.label,data:e.data.map((function(e){return e.value})),ids:e.data.map((function(e){return e.id})),borderColor:Ct[t]}}))},options:Object(d.a)({},xt,{onClick:function(t){var n=e.getElementAtEvent(t)[0];if(n){var r=e.data.labels[n._index],i=e.data.datasets[n._datasetIndex],o=i.data[n._index];i.ids[n._index];a({id:m(),title:"",time_from:r,collection:i.treeLocation,series:i.label,description:"Value: ".concat(o),type:"TS",property:"A"})}}})})})),i.a.createElement("div",{style:{margin:"auto",height:"100%",width:"100%"}},i.a.createElement("canvas",{ref:o}))},inputs:[{type:"time",format:"[{t,y}]",maxCurves:null}],fields:[{label:"Start time",type:"time",key:"startTime",default:""},{label:"End time",type:"time",key:"endTime",default:""}]},It=n(12),Nt=n.n(It),St=function(e){return Object(w.a)(new Set([].concat(Object(w.a)(e.map((function(e){return e.source}))),Object(w.a)(e.map((function(e){return e.target})))))).map((function(e){return{data:{id:e}}}))},Dt=function(e){return{edges:e.map((function(e){return e.id=e.source+"-"+e.target,{data:e}})),nodes:St(e)}},Lt={chart:function(e){e.title,e.inputs;var t=e.fields,n=i.a.createRef();return Object(r.useEffect)((function(){Nt()({container:n.current,elements:Dt([{id:"ab",source:"a",target:"b"}]),style:[{selector:"node",style:{"background-color":t.nodeBackgroundColor.value,label:"data(id)"}},{selector:"edge",style:{width:t.edgeWidth.value,"line-color":t.edgeColor.value,"target-arrow-color":"#ccc","target-arrow-shape":"triangle"}}],layout:{name:"grid",rows:1}}).on("tap","node",(function(e){var t=e.target;console.log("tapped "+t.id())}))})),i.a.createElement("div",{style:{width:"100%",height:"100%",overflow:"hidden"},ref:n})},inputs:[{type:"network",format:"[{data:{id,source,target}}]"}],fields:[{label:"Node color",type:"color",key:"nodeBackgroundColor",default:"green"},{label:"Edge color",type:"color",key:"edgeColor",default:"grey"},{label:"Edge width",type:"number",key:"edgeWidth",default:3}]},Pt=n(55),Vt=n.n(Pt),Bt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null!=t&&""!=t||(t=e[0].time_from),null!=n&&""!=n||(n=e[e.length-1].time_from);for(var a=e.filter((function(e){return new Date(e.time_from)>=new Date(t)&&new Date(e.time_from)<=new Date(n)})),r={},i=0;i<a.length;i++){var o=a[i],c=o.source,l=o.target,u=o.weight;void 0==r[c]&&(r[c]={}),void 0==r[c][l]&&(r[c][l]=0),r[c][l]+=+u?+u:1}var s=[];return Object.keys(r).forEach((function(e){Object.keys(r[e]).forEach((function(t){s.push({source:e,target:t,weight:r[e][t]})}))})),s};Nt.a.use(Vt.a);var Rt={chart:function(e){e.title;var t=e.inputs,n=e.fields,a=e.updateAnnotation,o=i.a.createRef();return Object(r.useEffect)((function(){var e="time_from"in t[0].data[0]?Bt(t[0].data,n.startAggregateTime.value,n.endAggregateTime.value):t[0].data,r=Dt(e),i=Nt()({container:o.current,elements:r,style:[{selector:"node",style:{"background-color":n.nodeBackgroundColor.value,label:"data(id)",height:1.5*n.nodeSize.value,width:1.5*n.nodeSize.value,color:n.textColor.value,"font-size":n.textSize.value}},{selector:"edge",style:{width:n.edgeWidth.value/1.5,"line-color":n.edgeColor.value,"target-arrow-color":"#ccc","target-arrow-shape":"triangle"}}],layout:{name:"grid",rows:1}});i.layout({name:n.cytoRender.value,ready:function(){},stop:function(){},animate:!1,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1}).run(),i.on("tap","node",(function(e){var n=e.target.id();a({id:t[0].id+"_node_"+n,source:n,collection:t[0].treeLocation,series:t[0].label})})),i.on("tap","edge",(function(e){var n=e.target._private.data;a({id:m(),source:n.source,target:n.target,collection:t[0].treeLocation,description:"weight : ".concat(n.weight),series:t[0].label,type:"TN",property:"A"})}))})),i.a.createElement("div",{style:{width:"100%",height:"100%",overflow:"hidden"},ref:o})},inputs:[{type:"network",format:"[{weight,source,target,time}]"}],fields:[{label:"Start time",type:"time",key:"startAggregateTime",default:""},{label:"End time",type:"time",key:"endAggregateTime",default:""},{label:"Node size",type:"number",key:"nodeSize",default:3},{label:"Node color",type:"color",key:"nodeBackgroundColor",default:"green"},{label:"Text size",type:"number",key:"textSize",default:3},{label:"Text color",type:"color",key:"textColor",default:"white"},{label:"Edge color",type:"color",key:"edgeColor",default:"grey"},{label:"Edge width",type:"number",key:"edgeWidth",default:1},{label:"Layout",type:"cyto_render",key:"cytoRender",default:"cose"}]},Wt=n(56),Mt=n.n(Wt),Ut=n(57),Ft=n.n(Ut),Ht=n(25),zt=n.n(Ht),Jt={chart:function(e){var t=e.id,n=(e.title,e.inputs,e.fields,Object(r.useContext)(wt)),a=n.cache,o=n.cacheUpdate,c=i.a.createRef(),u=le(!1),s=Object(l.a)(u,3),d=s[0],m=s[1],f=s[2],v=Object(r.useState)(a[t].text?a[t].text:"# Welcome to Ripple\n\n*Ripple* is a platform to allow data experts and domain experts to share insights. \ud83d\ude00\n"),p=Object(l.a)(v,2),g=p[0],b=p[1],E=function(e){o({type:"CHANGE",key:t,data:{text:e}})},y=function(e){b(e.target.value)},w=function(e){d&&E(g),f(!1)};return Object(r.useEffect)((function(){d&&c.current.focus()})),i.a.createElement("div",{style:{height:"100%",width:"100%"},onDoubleClick:function(e){d&&E(g),m(e)}},d?i.a.createElement("textarea",{className:zt.a.textboxInput+" customScrollBar",rows:"5",name:"textBox",value:g,onChange:y,placeholder:"Please enter your text...",onBlur:w,ref:c}):i.a.createElement("div",{className:zt.a.textboxContainer+" customScrollBar"},Ft()(Mt()(g))))},inputs:[{type:"text",format:"string",editable:!0}],fields:[],isInputRequired:!1},Yt=function(e,t){return console.log("ReRender?:",e.version==t.version),e.version==t.version},Gt=function(e){var t=function(e,t){switch("".concat(e,"|").concat(t)){case"time|timeplot":return kt;case"network|simple":return Lt;case"network|aggregate":return Rt;case"text|textbox":return Jt;default:return{chart:function(){return i.a.createElement("div",null,"Template name ",t," for a ",e," chart was not found")},inputs:[],fields:[]}}}(e.type,e.view);return[Object(r.memo)((function(e){var n=!("isInputRequired"in t)||t.isInputRequired;return n&&e.inputs.length&&"data"in e.inputs[0]||!n?t.chart(e):i.a.createElement("div",null,"Please select an input...")}),Yt),t.inputs,t.fields]},$t=Object(r.memo)((function(e){var t=e.view,n=(e.version,e.updateAnnotation),a=Object(r.useContext)($),o=a.memory,c=a.getDataset,s=Object(r.useContext)(E),d=s.ram,m=s.ramUpdate,f=Object(r.useContext)(wt),v=f.cache,p=f.cacheUpdate,g=Object(r.useContext)(u).forceUpdate,b=Ve(t,d),y=Gt(b),w=Object(l.a)(y,3),h=w[0],O=w[1],j=w[2],x=b.id;(x in v||p({type:"SET",key:x}),"rendered"in b)||(m(jt(o,t,O,j,b.view)),g());var C=b.inputs.filter((function(e){return"id"in e})).map((function(e){return c(e.type,e.id)}));b.rendered!=C.map((function(e){return e.id})).join("-")&&m(Ot(b,C));return i.a.createElement(h,Object.assign({},b,{inputs:C,updateAnnotation:n}))}),(function(e,t){return e.version==t.version})),qt=function(e){var t="".concat(e.type,": ").concat(e.title);return t.charAt(0).toUpperCase()+t.substring(1)},Xt=Object(r.memo)((function(e){var t=e.view,n=Object(r.useContext)(E).ram,a=Ve(t,n),o=qt(a);return i.a.createElement("div",Object.assign({className:"WindowTitle "+vt.a.WindowTitle,view:t},ve(t)),i.a.createElement(ce,{height:"8"}),i.a.createElement("h5",null,o))})),Zt=function(e){var t=e.view,n=e.vertical,a=e.isViewActive,o=Object(r.useContext)(I).getVersion,c=Object(r.useContext)(Z).updateAnnotation;Object(r.useContext)(u).lastUpdate;return i.a.createElement("div",{className:"Window "+vt.a.Window,view:t},i.a.createElement(Xt,{view:t}),i.a.createElement("div",{className:vt.a.WindowContent},a&&i.a.createElement($t,{view:t,version:o(t),key:t,updateAnnotation:c})),i.a.createElement(pt,{view:t,vertical:n}))},Kt=n(58),Qt=n.n(Kt),en=function(e){var t=e.setViewsActivity,n=e.vertical,a=Object(r.useRef)(null),o=Object(r.useRef)(null),c=Object(r.useRef)(null);return Object(r.useEffect)((function(){document.getElementById("MainView").classList.remove("drag");var e=c.current,r=e.parentElement,i=e.previousElementSibling,l=n?r.clientWidth:r.clientHeight,u=function(e){a.current=n?e.clientX:e.clientY,o.current=n?i.clientWidth:i.clientHeight,setTimeout((function(){return document.getElementById("MainView").classList.add("drag")}),1),t(!1)},s=function(e){if(null!==a.current){var t=(n?e.clientX:e.clientY)-a.current,i=o.current+t,c=.3*l,u=.7*l;i<c&&(i=c),i>u&&(i=u);var s="minmax(min-content, ".concat(i,"px) 4px auto");r.style.gridTemplate="".concat(s," / ").concat(s)}},d=function(){setTimeout((function(){return document.getElementById("MainView").classList.remove("drag")}),1),a.current=null,o.current=null,t(!0)};return e.addEventListener("mousedown",u),window.addEventListener("mousemove",s),window.addEventListener("mouseup",d),function(){e.removeEventListener("mousedown",u),window.removeEventListener("mousemove",s),window.removeEventListener("allmouseup",d)}})),i.a.createElement("div",{className:"".concat(Qt.a.Handler," handler-").concat(n?"cols":"rows"),ref:c})},tn=n(59),nn=n.n(tn),an=function e(t){var n=t.grid,a=t.vertical,r=t.areViewsActive,o=t.setViewsActivity,c=n.filter(Boolean).map((function(){return"1fr"})).join(" 4px "),l={gridTemplate:"".concat(c," / ").concat(c)};if(1===n.length){if(Array.isArray(n[0]))return i.a.createElement(e,{grid:n[0],vertical:!a,areViewsActive:r,setViewsActivity:o});if("string"===typeof n[0])return i.a.createElement(Zt,{view:n[0],vertical:a,isViewActive:r})}return i.a.createElement("div",{className:"".concat(nn.a.Grid," grid-").concat(a?"cols":"rows"),style:l},"string"===typeof n[0]&&i.a.createElement(Zt,{view:n[0],vertical:a,isViewActive:r}),Array.isArray(n[0])&&i.a.createElement(e,{grid:n[0],vertical:!a,areViewsActive:r,setViewsActivity:o}),n[1]&&i.a.createElement(en,{setViewsActivity:o,view:n[0],vertical:a}),"string"===typeof n[1]&&i.a.createElement(Zt,{view:n[1],vertical:a,isViewActive:r}),Array.isArray(n[1])&&i.a.createElement(e,{grid:n[1],vertical:!a,areViewsActive:r,setViewsActivity:o}))},rn=(n(133),function(){var e=Object(r.useContext)(I).grid,t=Object(r.useContext)($).memory,n=(Object(r.useContext)(E).ram,le(!0)),a=Object(l.a)(n,3),o=a[0],c=(a[1],a[2]);console.log("memory:",t);var u=function(){var e=new Event("allmouseup");window.dispatchEvent(e)};return Object(r.useEffect)((function(){return window.addEventListener("mouseup",u),window.removeEventListener("allmouseup",u)})),i.a.createElement("div",{id:"MainView"},i.a.createElement(an,{grid:e,areViewsActive:o,setViewsActivity:c,vertical:!0}))}),on=function(e){var t=e.children;return i.a.createElement(s,null,i.a.createElement(q,null,i.a.createElement(y,null,i.a.createElement(N,null,i.a.createElement(ht,null,i.a.createElement(K,null,t))))))},cn=function(){return i.a.createElement("div",{className:"App"},i.a.createElement(on,null,i.a.createElement(mt,null),i.a.createElement(rn,null)))};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));c.a.render(i.a.createElement(cn,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))},16:function(e,t,n){e.exports={PlotItem:"PlotItem_PlotItem__2GNUg"}},18:function(e,t,n){e.exports={PanelsList:"PanelsList_PanelsList__rb-Pb",Panels:"PanelsList_Panels__2etY7",PanelsToggle:"PanelsList_PanelsToggle__3822R"}},19:function(e,t,n){e.exports={Controls:"Annotation_Controls__12rrE",NewAnnotation:"Annotation_NewAnnotation__3UYlz",Status:"Annotation_Status__BPcIw"}},21:function(e,t,n){e.exports={Autocomplete:"Autocomplete_Autocomplete__3htHv",AutocompleteItems:"Autocomplete_AutocompleteItems__3MS2c"}},22:function(e,t,n){e.exports={TimeSeriesView:"TimeSeriesView_TimeSeriesView__354Zn",AddPlot:"TimeSeriesView_AddPlot__H5Rer"}},23:function(e,t,n){e.exports={Plot:"Plot_Plot__SjKEj",PlotContent:"Plot_PlotContent__3Slwn"}},24:function(e,t,n){e.exports={Autocomplete:"Autocomplete_Autocomplete__1Ny7x",AutocompleteItems:"Autocomplete_AutocompleteItems__3bPd5"}},25:function(e,t,n){e.exports={textboxContainer:"TextBox_textboxContainer__1_Cxt",textboxInput:"TextBox_textboxInput__3n0MT"}},51:function(e,t,n){e.exports={Sidebar:"Sidebar_Sidebar__2ajNT"}},52:function(e,t,n){e.exports={Form:"Form_Form__2boAo"}},53:function(e,t,n){e.exports={TreeView:"TreeView_TreeView__2oCx5"}},58:function(e,t,n){e.exports={Handler:"Handler_Handler__3uFNB"}},59:function(e,t,n){e.exports={Grid:"Grid_Grid__3ySV2"}},60:function(e,t,n){e.exports=n(134)},65:function(e,t,n){},7:function(e,t,n){e.exports={AddPanel:"AddPanel_AddPanel__1e6pW",AddForm:"AddPanel_AddForm__3h1b-",AddButton:"AddPanel_AddButton__tCCdE",PanelContent:"AddPanel_PanelContent__XhLfX"}},83:function(e,t,n){}},[[60,1,2]]]);
  //# sourceMappingURL=main.8fdeef89.chunk.js.map