"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@apollo/client/react/components"),r=require("@evo/errcatch"),n=require("@prom-ui/core/Box"),o=require("@prom-ui/core/Button"),a=require("@prom-ui/core/Text"),l=require("@prom-ui/core/useBodyTTag");function u(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var i=u(e);function c(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function f(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,l,u=[],i=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;i=!1}else for(;!(i=(n=a.call(r)).done)&&(u.push(n.value),u.length!==t);i=!0);}catch(f){c=!0,o=f}finally{try{if(!i&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw o}}return u}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var m,p,b,h="RWb3q",y=function(t){var r=t.componentErrorName,u=t.onReload,c=l.useBodyTTag().t,d=s(e.useState(!1),2),y=d[0],g=d[1];return y?null:"production"!==process.env.NODE_ENV?"undefined"==typeof window?null:i.default.createElement(n.Box,{className:h,"box-background":"red-500","box-padding":["s m","m@large l@large"],"box-position":"relative","box-round":"m","data-qaid":"err_catch_trace"},i.default.createElement(n.Box,{"box-margin-right":"5xl"},i.default.createElement(a.Text,{"text-color":"white"},c(m||(m=f(["Возникла ошибка:"])))," ",i.default.createElement(a.Text,{"text-weight":"bold",style:{fontFamily:'Consolas, "Liberation Mono", Menlo, monospace',userSelect:"all"}},r))),i.default.createElement(n.Box,{"box-position":"absolute center-right","box-margin-right":"s"},i.default.createElement(o.Button,{"button-padding":"xxs","button-theme":"white-inherit",onClick:u,title:c(p||(p=f(["Обновить"])))},i.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",width:18,height:18},i.default.createElement("path",{fill:"#fff",d:"M9 13.5c-2.49 0-4.5-2.01-4.5-4.5S6.51 4.5 9 4.5c1.24 0 2.36.52 3.17 1.33L10 8h5V3l-1.76 1.76C12.15 3.68 10.66 3 9 3 5.69 3 3.01 5.69 3.01 9S5.69 15 9 15c2.97 0 5.43-2.16 5.9-5h-1.52c-.46 2-2.24 3.5-4.38 3.5z"}))),i.default.createElement(o.Button,{"button-padding":"xxs","button-theme":"white-inherit",onClick:function(){return g(!0)},title:c(b||(b=f(["Скрыть"])))},i.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:18,height:18},i.default.createElement("path",{fill:"#fff",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}))))):null},g=["componentErrorName","children"],v=function(e){var n=e.componentErrorName,o=void 0===n?"SafeQuery":n,a=e.children,l=c(e,g),u=s(i.useState(!1),2),f=u[0],d=u[1];if(i.useEffect((function(){f&&d(!1)}),[f]),f)return null;var m=i.createElement(y,{componentErrorName:o,onReload:function(){return d(!0)}});return i.createElement(r.ErrCatch,{name:o,errorComponent:m},i.createElement(t.Query,l,(function(e){var t=e.error;if(t)throw t;return a(e)})))};v.displayName="SafeQuery",exports.SafeQuery=v,require("./style.production.css");
