PageSourceSearch

https://www.codechef.com/build/react2/assets/HTMLOutput-f3xtspmi.js

js codechef.com collected 2026-10-01 10:26:25 UTC 5,515 bytes, 1 lines download raw bytes

1import{r as a,a1 as j,Z as o,a2 as U,a3 as i,d7 as A,ay as G,a4 as Y}from"./vendor-mui-BWh-6WAH.js";import{bT as Z,U as z,cs as Q,Z as m,$ as _,cv as V,cw as q,s as N}from"./index-Df_dD346.js";import"./__commonjsHelpers__-BosuxZz1.js";import"./vendor-sweetalert2-CokzRhbv.js";const J="_dark_gb9wo_31",X="_inputField_gb9wo_40",ee="_iframeContainer_gb9wo_96",oe="_loginForm_gb9wo_111",re="_iframeHead_gb9wo_117",ae="_rightSideIcons_gb9wo_134",ne="_close_gb9wo_139",se="_openInNew_gb9wo_143",te="_iframeUrlEditor_gb9wo_147",le="_refresh_gb9wo_153",ie="_loaderContainer_gb9wo_161",ce="_previewHeading_gb9wo_167",de="_urlContent_gb9wo_171",me="_url_gb9wo_171",fe="_expand_gb9wo_193",he="_fullscreen__icon_gb9wo_204",we="_exitFullscreen__icon_gb9wo_210",pe="_iframePanel_gb9wo_216",_e="_codechefIdeIframeContainer_gb9wo_221",ue="_codechefIdeIframePanel_gb9wo_221",ge="_fullScreen_gb9wo_245",e={dark:J,inputField:X,iframeContainer:ee,loginForm:oe,iframeHead:re,rightSideIcons:ae,close:ne,openInNew:se,iframeUrlEditor:te,refresh:le,loaderContainer:ie,previewHeading:ce,urlContent:de,url:me,expand:fe,fullscreen__icon:he,exitFullscreen__icon:we,iframePanel:pe,codechefIdeIframeContainer:_e,codechefIdeIframePanel:ue,fullScreen:ge};function Ue(k){const{htmlCode:F,srcUrl:c,iframeRef:u,browserUrlKey:g,setBrowserUrlKey:f,setOpenBrowser:y=()=>{},isCodechefIde:t=!1,allowUrlEdit:n=!1,showBrowserConsole:S=!1,showLoginForm:R=!0,iframeParentDomain:B=Z(),reserveNextButtonSpace:E=!0,showOpenInNewTab:P=!0,restrictToCodeChefDomain:D=!1}=k,[s,b]=a.useState(c||""),[l,C]=a.useState(c||""),[h,$]=a.useState(!1),T=j("@media (max-width:960px)"),{state:I}=a.useContext(z),[d,H]=a.useState(!1),O=o("div",{className:e.loginForm,children:o(V,{redirectUrl:window.location.href})}),L=()=>{if(n){const r=new URL(`${B}/iframe.html`);return r.searchParams.append("open",S?"1":"0"),r.searchParams.append("iframe",s),r.toString()}return s},w=r=>r?!r.startsWith("https://")&&!r.startsWith("http://")?`${window.location.protocol}//${r}`:r:"",p=async()=>{const r=await q(s);$(r)};a.useEffect(()=>{const r=w(c||"");b(r),C(r),f(r),p()},[c]),a.useEffect(()=>{p()},[s]),a.useEffect(()=>{let r;return n&&!h&&(r=setInterval(p,2e3)),()=>{r&&clearInterval(r)}},[n,h]);const M=r=>{C(r.target.value)},K=r=>{if(r.preventDefault(),D)try{const x=w(l),v=new URL(x).hostname.toLowerCase();if(v!=="codechef-apps.com"&&!v.endsWith(".codechef-apps.com")){N("You are not allowed to open this link");return}}catch{N("Invalid URL");return}b(w(l)),f(l+Date.now())},W=()=>s?h?o("div",{className:e.iframePanel,style:{height:E?"":"calc(100vh - 94px)"},children:o("iframe",{ref:u,src:L(),title:"output",allow:"cross-origin-isolated; camera; microphone; geolocation",sandbox:"allow-scripts allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups allow-presentation allow-same-origin",frameBorder:"0",width:"100%",height:"100%"},g)}):o("div",{className:e.iframePanel,children:o("iframe",{srcDoc:`<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><style>body{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100vh;margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;background-color:#fff;color:#5f6368}.spinner{width:24px;height:24px;border:3px solid #dadce0;border-radius:50%;border-top-color:#4285f4;animation:spin 1s linear infinite;margin-bottom:20px}@keyframes spin{to{transform:rotate(360deg)}}.message{font-size:14px;letter-spacing:.2px}</style></head><body><div class="spinner"></div><div class="message">Connecting...</div></body></html>`,title:"output",allow:"cross-origin-isolated; camera; microphone; geolocation",sandbox:"allow-scripts allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups allow-presentation allow-same-origin",frameBorder:"0",width:"100%",height:"100%",ref:u},g)}):o("div",{className:`${e.iframePanel} ${t?e.codechefIdeIframePanel:""}`,children:o("iframe",{srcDoc:F,title:"output",sandbox:"allow-scripts allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups allow-presentation allow-same-origin",frameBorder:"0",width:"100%",height:"100%"})});return o(U,{children:o("div",{className:`${e.iframeContainer} ${d?e.fullScreen:""} ${t?e.codechefIdeIframeContainer:""}`,style:{background:`${I?.theme==="dark"?Q:""}`},children:!I?.isLoggedIn&&!t&&R?O:i(U,{children:[!t&&i("div",{className:m(e.iframeHead,e.dark),children:[n?i("div",{className:e.iframeUrlEditor,children:[o(A,{className:e.refresh,onClick:()=>f(l+Date.now())}),o("form",{onSubmit:K,children:o("input",{placeholder:"https://www.codechef.com",onChange:M,value:l,className:`${m(e.inputField,e.dark)}`,style:{borderRadius:"20px"}})})]}):i("div",{className:e.loaderContainer,children:[o("div",{className:e.previewHeading,children:"PREVIEW"}),o("div",{className:e.urlContent,children:o("div",{className:e.url,children:"https://www.codechef-apps.com"})})]}),!n&&!T&&!t&&o(_,{title:`${d?"Exit Fullscreen":"Go Fullscreen"}`,children:o("div",{className:e.expand,onClick:()=>H(()=>!d),children:o("i",{className:`${d?m(e.exitFullscreen__icon,e.dark):m(e.fullscreen__icon,e.dark)}`})})}),n?i("div",{className:e.rightSideIcons,children:[P&&o(_,{title:"Open in new tab",children:o("div",{className:e.expand,onClick:()=>{window.open(s,"_blank")},children:o(G,{className:e.openInNew})})}),o(_,{title:"Close Browser",children:o("div",{className:e.expand,onClick:()=>y(!1),children:o(Y,{className:e.close})})})]}):null]}),W()]})})})}export{Ue as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.