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