import r from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/extends";import t from"@babel/runtime/helpers/defineProperty";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useRef as a,useState as i,useCallback as c,useEffect as p}from"react";import{isEqual as s}from"lodash";import{Iterable as l,is as u}from"immutable";import f from"../../LoadingIndicator/LoadingIndicator.js";import m from"./IsolatedPage.module.css.js";var d;function b(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,o)}return t}function y(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?b(Object(o),!0).forEach((function(e){t(r,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):b(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var O=function(r,e){if(r===e)return!0;if("function"==typeof r&&"function"==typeof e)return!0;var t=l.isIterable(r),o=l.isIterable(e);return t&&o?u(r,e):t===o&&s(r,e)},v="data-corva-app-iframe",g=(t(d={},"data-corva-app-iframe",!0),t(d,"data-testid","isolatedAppContainer"),d);function P(t){var s=e({},t),l=a(null),u=a(null),d=i(!0),b=r(d,2),v=b[0],P=b[1],h=c((function(){P(!1)}),[]),j=function(r,e){if(r){var t=!r.xprops,o=!function(r,e){if(r===e)return!0;if(!r)return!1;var t=Object.keys(r),o=Object.keys(e);if(t.length!==o.length)return!1;for(var n=0,a=o;n<a.length;n++){var i=a[n];if(!Object.prototype.hasOwnProperty.call(r,i))return!1;if(!O(r[i],e[i]))return!1}return!0}(u.current||{},e);if(r.xprops=y({},e),u.current=e,(t||o)&&r.xpropsOnProps)try{r.xpropsOnProps(e)}catch(r){console.debug("[IsolatedPage] xpropsOnProps was not set yet:",r)}}};return p((function(){try{var r,e=null===(r=l.current)||void 0===r?void 0:r.contentWindow;j(e,s)}catch(r){console.error("[IsolatedPage] Error accessing iframe contentWindow:",r)}})),p((function(){return function(){try{var r,e=null===(r=l.current)||void 0===r?void 0:r.contentWindow;e&&e.xprops&&delete e.xprops}catch(r){console.error("[IsolatedPage] Error cleaning up xprops:",r)}u.current=null;var t=l.current;if(t)try{t.src="about:blank"}catch(r){console.error("[IsolatedPage] Error setting iframe src to about:blank:",r)}l.current=null}}),[]),o("div",{className:m.container,children:[v&&n(f,{}),n("iframe",y({ref:l,src:"/DevCenterIsolatedAppPage.html",onLoad:h,className:m.iframe},g))]})}export{v as APP_IFRAME_ATTRIBUTE,P as IsolatedPage};
//# sourceMappingURL=IsolatedPage.js.map
