"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/extends"),r=require("@babel/runtime/helpers/objectWithoutProperties"),t=require("react"),i=require("@prom-ui/core/ErrorCatch"),a=require("@prom-ui/core/useInView");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&"object"==typeof e&&"default"in e)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var u=n(e),c=n(r),l=o(t),f=["isActive","children","fallback","onChange","rootMargin"],d=["errorCatchName"],p=function(e){var r=e.isActive,t=void 0===r||r,i=e.children,n=e.fallback,o=e.onChange,d=e.rootMargin,p=void 0===d?"40% 0px":d,s=c.default(e,f),b=a.useInView({triggerOnce:!0,skip:!t,rootMargin:p,onChange:o}),v=b.ref,h=b.inView;return!t||h?i:l.createElement("div",u.default({style:{minHeight:1},"data-qaid":"viewport","data-testid":"viewport"},s,{ref:v}),n)},s=function(e){var r=e.errorCatchName,t=void 0===r?"Viewport":r,a=c.default(e,d);return l.createElement(i.ErrorCatch,{name:t},l.createElement(p,a))};s.displayName="Viewport",exports.Viewport=s;
