-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomponent---src-pages-chat-js-aaa221667baecdec8ecb.js
2 lines (2 loc) · 7.34 KB
/
component---src-pages-chat-js-aaa221667baecdec8ecb.js
1
2
(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{QQwb:function(e,r,t){"use strict";t.r(r);var n=t("q1tI"),a=t.n(n),o=t("YwZP"),i=t("vOnD"),c=t("/Rk8"),u=t("18Yj"),l=t("+Wdg"),s={center:"center",end:"flex-end",start:"flex-start",stretch:"stretch"},f=Object(i.css)(["align-items:",";"],(function(e){return s[e.align]})),m={around:"space-around",between:"space-between",center:"center",end:"flex-end",start:"flex-start",stretch:"stretch"},d=Object(i.css)(["align-content:",";"],(function(e){return m[e.alignContent]})),p={center:"center",end:"flex-end",start:"flex-start",stretch:"stretch"},g=Object(i.css)(["justify-items:",";"],(function(e){return p[e.justify]})),b={around:"space-around",between:"space-between",center:"center",end:"flex-end",start:"flex-start",stretch:"stretch"},h=Object(i.css)(["justify-content:",";"],(function(e){return b[e.justifyContent]})),w={flex:"1fr",full:"100%","1/2":"50%","1/4":"25%","2/4":"50%","3/4":"75%","1/3":"33.33%","2/3":"66.66%"},y=function(e,r){return Array.isArray(e)?"minmax("+(r.global.size[e[0]]||e[0])+", "+(r.global.size[e[1]]||e[1])+")":"flex"===e?"1fr":"minmax("+(r.global.size[e]||e)+", 1fr)"},j=function(e,r,t){var n=w[e];return!t||!n||r.fillContainer&&"horizontal"!==r.fillContainer||console.warn("Grid needs `fill` when using fractional row sizes"),n||r.theme.global.size[e]||e},v=i.default.div.attrs((function(e){return{"aria-label":e.a11yTitleProp}})).withConfig({displayName:"StyledGrid",componentId:"sc-1wofa1l-0"})(["display:grid;box-sizing:border-box;"," "," "," "," "," "," "," "," "," "," "," "," ",""],c.g,(function(e){return e.border&&(Array.isArray(e.border)?e.border.map((function(r){return Object(u.a)(r,e.responsive,e.theme)})):Object(u.a)(e.border,e.responsive,e.theme))}),(function(e){return(r=e.fillContainer)?"horizontal"===r?"width: 100%;":"vertical"===r?"height: 100%;":"\n width: 100%;\n height: 100%;\n ":r;var r}),(function(e){return e.align&&f}),(function(e){return e.alignContent&&d}),(function(e){return e.areas&&function(e){if(Array.isArray(e.rowsProp)&&Array.isArray(e.columns)||console.warn("Grid `areas` requires `rows` and `columns` to be arrays."),Array.isArray(e.areas)&&e.areas.every((function(e){return Array.isArray(e)})))return"grid-template-areas: "+e.areas.map((function(e){return'"'+e.join(" ")+'"'})).join(" ")+";";var r=e.rowsProp.map((function(){return e.columns.map((function(){return"."}))}));return e.areas.forEach((function(e){for(var t=e.start[1];t<=e.end[1];t+=1)for(var n=e.start[0];n<=e.end[0];n+=1)r[t][n]=e.name})),"grid-template-areas: "+r.map((function(e){return'"'+e.join(" ")+'"'})).join(" ")+";"}(e)}),(function(e){return e.columns&&function(e){return Array.isArray(e.columns)?Object(i.css)(["grid-template-columns:",";"],e.columns.map((function(r){return Array.isArray(r)?"minmax("+j(r[0],e)+", "+j(r[1],e)+")":j(r,e)})).join(" ")):"object"==typeof e.columns?Object(i.css)(["grid-template-columns:repeat( ",","," );"],"number"==typeof(r=e.columns.count)?r:"auto-"+r,y(e.columns.size,e.theme)):Object(i.css)(["grid-template-columns:repeat( auto-fill,"," );"],y(e.columns,e.theme));var r}(e)}),(function(e){return e.gap&&function(e){if("string"==typeof e.gap){var r=e.theme.global.edgeSize[e.gap]||e.gap;return"grid-gap: "+r+" "+r+";"}return e.gap.row&&e.gap.column?"\n grid-row-gap: "+(e.theme.global.edgeSize[e.gap.row]||e.gap.row)+";\n grid-column-gap: "+(e.theme.global.edgeSize[e.gap.column]||e.gap.column)+";\n ":e.gap.row?"\n grid-row-gap: "+(e.theme.global.edgeSize[e.gap.row]||e.gap.row)+";\n ":e.gap.column?"\n grid-column-gap: "+(e.theme.global.edgeSize[e.gap.column]||e.gap.column)+";\n ":""}(e)}),(function(e){return e.justify&&g}),(function(e){return e.justifyContent&&h}),(function(e){return e.pad&&Object(c.d)("padding",e.pad,e.responsive,e.theme.global.edgeSize.responsiveBreakpoint,e.theme)}),(function(e){return e.rowsProp&&function(e){return Array.isArray(e.rowsProp)?Object(i.css)(["grid-template-rows:",";"],e.rowsProp.map((function(r){return Array.isArray(r)?"minmax("+j(r[0],e,!0)+", "+j(r[1],e,!0)+")":j(r,e,!0)})).join(" ")):Object(i.css)(["grid-auto-rows:",";"],e.theme.global.size[e.rowsProp])}(e)}),(function(e){return e.theme.grid&&e.theme.grid.extend}));function O(){return(O=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}v.defaultProps={},Object.setPrototypeOf(v.defaultProps,l.a);var A=Object(n.forwardRef)((function(e,r){var t=e.a11yTitle,n=e.border,o=e.fill,i=e.responsive,c=void 0===i||i,u=e.rows,l=e.tag,s=e.as,f=function(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,["a11yTitle","border","fill","responsive","rows","tag","as"]);return a.a.createElement(v,O({ref:r,a11yTitleProp:t,as:!s&&l?l:s,border:n,fillContainer:o,responsive:c,rowsProp:u},f))}));A.displayName="Grid";var x=A;x.available="undefined"!=typeof window&&window.CSS&&window.CSS.supports&&window.CSS.supports("display","grid");var P=t("otPn"),E=t("6Rr0"),S=t("LXcg"),z=t("o0o1"),N=t.n(z),R=(t("ls82"),t("HaE+")),C=t("IcFT"),k=t("463D"),q=function(e){var r=e.initialActiveId,t=e.senderRoleName,o=Object(n.useState)([]),i=o[0],c=o[1],u=Object(n.useState)(r||0)[0],l=Object(n.useState)({}),s=l[0],f=l[1];return Object(n.useEffect)((function(){(function(){var e=Object(R.a)(N.a.mark((function e(){var r,n,a,o;return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(S.j)(t);case 2:return r=e.sent,c(r),n=r.reduce((function(e,r){return e.concat(r.get("uniqueName").split("_"))}),[]),e.next=7,Object(S.v)(n);case 7:a=e.sent,o=r.reduce((function(e,r){var n=r.get("uniqueName").split("_").filter((function(e){return e!==t}));return e[r.id]=n.map((function(e){var r=a.find((function(r){return r.role&&r.role.get("name")===e}));return r?r&&r.rolePublicProfile&&r.rolePublicProfile.get("name"):""})).join(" "),e}),{}),f(o);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}})()()}),[t]),a.a.createElement(a.a.Fragment,null,a.a.createElement(P.a,{fill:!0,direction:"row"},a.a.createElement(C.a,{width:"100%",children:function(e){var r=s[e.id],n=e.get("uniqueName").split("_").filter((function(e){return e!==t}));return a.a.createElement(P.a,{pad:"small",background:u===e.objectId?"light-2":"white"},a.a.createElement(k.a,{href:"/chat/r/"+t+"/c/"+n},r))},pad:"0",primaryKey:"name",data:i})))},I=function(e){var r=e.senderRoleName,t=e.recipientRoleName,o=Object(n.useState)(null),i=o[0],c=o[1];return Object(n.useEffect)((function(){Object(S.v)([t]).then((function(e){e&&e.length&&c(e[0].rolePublicProfile)}))}),[t]),a.a.createElement(a.a.Fragment,null,a.a.createElement(x,{gap:"small",pad:"small",fill:!0,areas:[{name:"chat",start:[0,0],end:[0,0]},{name:"room",start:[1,0],end:[1,0]}],columns:["3/4","1/4"],rows:["auto"]},a.a.createElement(P.a,{fill:!0,gridArea:"room",direction:"row"},a.a.createElement(q,{senderRoleName:r})),a.a.createElement(P.a,{gridArea:"chat",pad:"medium",height:"405px"},r&&a.a.createElement(E.a,{chatroomName:i&&i.get("name"),senderRoleName:r,recipientRoleName:t,publicRoom:!1}))))};r.default=function(){return a.a.createElement(a.a.Fragment,null,a.a.createElement(o.Router,{basepath:"/chat"},a.a.createElement(I,{path:"/r/:senderRoleName/c/:recipientRoleName"})))}}}]);
//# sourceMappingURL=component---src-pages-chat-js-aaa221667baecdec8ecb.js.map