"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,i)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return __setModuleDefault(t,e),t},__awaiter=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{s(o.next(e))}catch(e){n(e)}}function u(e){try{s(o.throw(e))}catch(e){n(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}s((o=o.apply(e,t||[])).next())}))},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.EmbeddedReplay=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),styled_components_1=__importDefault(require("styled-components")),jotai_1=require("jotai"),store_1=require("../../jotai/store"),app_1=require("../../jotai/app"),hooks_1=require("../../hooks"),utils_1=require("./utils"),EmbeddedReplayOrig=(0,react_1.lazy)((()=>__awaiter(void 0,void 0,void 0,(function*(){return Promise.resolve().then((()=>__importStar(require("@redocly/replay")))).then((e=>({default:e.EmbeddedReplay})))}))));function EmbeddedReplayComponent({activeOperationId:e,corsProxyUrl:t,fullOpenApi:r}){const o=(0,hooks_1.useTranslate)(),{mockServer:i}=(0,jotai_1.useAtomValue)(store_1.globalOptionsAtom),n=(0,jotai_1.useAtomValue)(app_1.appStore),a=(0,jotai_1.useAtomValue)(app_1.environmentsAtom),[u,s]=(0,react_1.useState)(!1);return(0,react_1.useEffect)((()=>{s(!0)}),[]),(0,jsx_runtime_1.jsx)(CompactWrapper,{children:u?(0,jsx_runtime_1.jsx)(react_1.Suspense,{fallback:(0,jsx_runtime_1.jsx)(LoadingWrapper,{children:o("openapi.loading","Loading...")}),children:(0,jsx_runtime_1.jsx)(EmbeddedReplayOrig,{activeOperationId:e,source:{data:r,type:"openapi"},settings:{environment:n.environment,predefinedEnvValues:a,corsProxyUrl:t,mockServer:i,disableCollectionsTab:!0,convertOperationToReplayValue:utils_1.convertOperationToReplayValue}})}):(0,jsx_runtime_1.jsx)(LoadingWrapper,{children:o("openapi.loading","Loading...")})})}exports.EmbeddedReplay=(0,react_1.memo)(EmbeddedReplayComponent);const LoadingWrapper=styled_components_1.default.div`
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
`,CompactWrapper=styled_components_1.default.div`
  border: 1px solid var(--border-color-primary);
  border-radius: var(--border-radius-lg);
  padding: 0;
`;
//# sourceMappingURL=EmbeddedReplay.js.map