"use strict";var e=require("react"),s=require("prop-types"),i=require("react-sizeme"),r=require("@material-ui/core"),t=require("./effects/index.js"),l=require("./utils.js"),a=require("./constants.js"),n=require("./HeaderLayout.css.js"),d=require("react/jsx-runtime");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(s);function o(s,i){var r,t,l,n;return s===a.SMALL_SIZE_LAYOUT&&i?e.cloneElement(i,i.props,(r=i.props.children,t=r.split(" "),l=r[0],n=t[t.length-1],"".concat(l," ").concat(n))):i}function h(s){var i=s.children,c=s.appWidth,u=t.useComonentsWidth(i),h=t.useFilterLayout(i,u,c),p=l.getAppTitle(i),f=l.getAppSubTitle(i),m=l.getExpander(i),j=l.getOffsetPicker(i),x=l.getSecondaryAsset(i),v=l.getModeSelect(i),y=l.getPadChip(i),L=l.getPrimaryAsset(i),S=l.getOffsetWellsChip(i),A=e.useMemo((function(){return o(h,L)}),[h,L]),g=e.useMemo((function(){return o(h,y)}),[h,y]);return d.jsxs("div",{style:{width:"100%"},children:[d.jsx(r.Collapse,{timeout:10,in:h===a.LARGE_SIZE_LAYOUT,children:d.jsxs("div",{className:n.layoutContainer,children:[d.jsxs("div",{className:n.layoutTopLarge,children:[d.jsx("div",{children:p}),d.jsxs("div",{className:n.layoutTopRightLarge,children:[x,v,d.jsxs("div",{className:n.layoutOffsetpicker,children:[m,j]}),y,L]})]}),d.jsx("div",{children:f}),d.jsx("div",{className:n.layoutOffsetwellChipsLarge,children:S})]})}),d.jsx(r.Collapse,{timeout:10,in:[a.MEDIUM_SIZE_LAYOUT,a.SMALL_SIZE_LAYOUT].includes(h),children:d.jsxs("div",{className:n.layoutContainer,children:[d.jsxs("div",{className:n.layoutTopSmall,children:[d.jsx("div",{children:p}),d.jsxs("div",{className:n.assetChips,children:[h===a.MEDIUM_SIZE_LAYOUT&&d.jsxs(d.Fragment,{children:[y,L]}),h===a.SMALL_SIZE_LAYOUT&&A]})]}),d.jsx("div",{children:f}),d.jsxs("div",{className:n.layoutBottomSmall,children:[x,v,h===a.SMALL_SIZE_LAYOUT&&g,d.jsxs("div",{className:n.layoutOffsetpicker,children:[m,j]})]}),d.jsx("div",{className:n.layoutOffsetwellChipsSmall,children:S})]})})]})}function p(e){return d.jsx(i.SizeMe,{monitorWidth:!0,children:function(s){var i=s.size;return d.jsx(h,{appWidth:i.width-21,children:e.children})}})}h.propTypes={appWidth:u.default.func.isRequired,children:u.default.arrayOf(u.default.node).isRequired},p.propTypes={children:u.default.arrayOf(u.default.node).isRequired},module.exports=p;
