"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/slicedToArray"),t=require("react"),i=require("react-dom"),u=require("lodash"),n=require("@material-ui/core/styles"),s=require("../utils.js"),o=require("../constants.js"),c=require("../../../config/theme/index.js");require("@babel/runtime/helpers/typeof"),require("highcharts"),require("highcharts/highcharts-more"),require("highcharts-multicolor-series"),require("highcharts/modules/solid-gauge"),require("highcharts/modules/heatmap"),require("highcharts/modules/boost"),require("highcharts/modules/exporting"),require("highcharts/modules/xrange"),require("highcharts/modules/dumbbell"),require("highcharts/modules/pattern-fill"),require("dompurify"),require("../../../config/mapbox/index.js");var a=require("react/jsx-runtime");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=l(e),f=l(r),d=l(i);function g(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,i)}return t}function p(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?g(Object(t),!0).forEach((function(r){h.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):g(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}exports.useComonentsWidth=function(e){var r=t.useRef({}),i=t.useState(null),o=f.default(i,2),l=o[0],g=o[1],y=t.useRef({});return t.useEffect((function(){var t=e.filter((function(e){return!!e}));if(!u.isEqual(t,y.current)){var i=s.getOffsetPicker(e),o=u.get(i,"key");r.current=o?h.default({},o,36):{},t.forEach((function(e){var i=document.createElement("div");i.style.position="absolute",i.style.visibility="hidden",document.body.appendChild(i),e&&e.key!==o&&d.default.render(a.jsx(n.MuiThemeProvider,{theme:c.darkTheme,children:e}),i,(function(){var n=i.getBoundingClientRect();i.remove(),r.current=p(p({},r.current),{},h.default({},e.key,n.width)),Object.values(r.current).length===t.length&&(u.isEqual(l,r.current)||g(r.current))}))})),y.current=t}})),l},exports.useFilterLayout=function(e,r,i){var n=t.useState(null),c=f.default(n,2),a=c[0],l=c[1];return t.useEffect((function(){if(i&&r){var t=s.getAppTitle(e),n=s.getExpander(e),c=s.getOffsetPicker(e),a=s.getSecondaryAsset(e),h=s.getModeSelect(e),f=s.getPrimaryAsset(e),d=r[u.get(t,"key")]||0,g=r[u.get(n,"key")]||0,p=r[u.get(c,"key")]||0,y=r[u.get(a,"key")]||0,m=r[u.get(h,"key")]||0,b=r[u.get(f,"key")]||0;l(d+(g+p+y+m+b)<=i?o.LARGE_SIZE_LAYOUT:d+b<=i?o.MEDIUM_SIZE_LAYOUT:o.SMALL_SIZE_LAYOUT)}}),[r,i]),a};
