<!DOCTYPE html><html><head><title>Web App - Unavailable</title><style type="text/css">html{height:100%;width:100%;}#feature{width:960px;margin:95px auto 0 auto;overflow:auto;}#content{font-family:"Segoe UI";font-weight:normal;font-size:22px;color:#fff;float:left;width:460px;margin-top:68px;margin-left:0px;vertical-align:middle;}#content h1{font-family:"Segoe UI Light";color:#fff;font-weight:normal;font-size:60px;line-height:48pt;width:800px;}p a,p a:visited,p a:active,p a:hover{color:#fff;}</style></head><body bgcolor="#00abec"><div id="feature"><div id="content"><h1 id="unavailable">Error 403 - This web app is stopped.</h1><p id="tryAgain">The web app you have attempted to reach is currently stopped and does not accept any requests. Please try to reload the page or visit it again soon.</p><p id="toAdmin">If you are the web app administrator, please find the common 403 error scenarios and resolution <a href="https://go.microsoft.com/fwlink/?linkid=2095007" target="_blank">here</a>. For further troubleshooting tools and recommendations, please visit <a href="https://portal.azure.com/">Azure Portal</a>.</p></div></div>
            <script>
              (function() {
                console.log('Debug: MutationObserver script injected early.');

                const debugMode = true;
                const iframeExclusionsSrc = ["https://*.r2.cloudflarestorage.com","https://*.storage.littech.ai","blob:https://lcm.demo.littech.ai","blob:https://casemanager.*.littech.ai"];
                const iframeSandboxArray = ["allow-scripts","allow-modals","allow-same-origin","allow-forms","allow-popups","allow-popups-to-escape-sandbox"];
                const iframeAllowAttributes = "autoplay 'none'; camera 'none'; microphone 'none'; geolocation 'none'; fullscreen 'none'; payment 'none'; accelerometer 'none'; ambient-light-sensor 'none'; display-capture 'none'; gyroscope 'none'; magnetometer 'none'; midi 'none'; speaker-selection 'none'; usb 'none'; screen-wake-lock 'none'";

                const logDebug = (message, ...args) => {
                  if (debugMode) {
                    console.log('[Response Ranger] Debug:', message, ...args);
                  }
                };

                const shouldSkipIframeInjection = (iframeSrc) => {
                  if (!iframeSrc) return false;
                  return iframeExclusionsSrc.some((exclusion) => iframeSrc.includes(exclusion));
                };

                const applyIframeAttributes = (iframe) => {
                  const src = iframe.getAttribute('src') || '';
                  if (!src.trim()) {
                    logDebug('Skipping iframe with empty or missing src:', iframe);
                    return false;
                  }

                  if (shouldSkipIframeInjection(src)) {
                    logDebug(`Skipping iframe injection for src: ${src} as it matches exclusionsSrc`);
                    return false;
                  }

                  const desiredSandbox = iframeSandboxArray.length > 0 ? iframeSandboxArray.join(' ') : '';
                  const desiredAllow = iframeAllowAttributes;

                  iframe.setAttribute('sandbox', desiredSandbox);
                  iframe.setAttribute('allow', desiredAllow);

                  logDebug('Updated iframe attributes:', {
                    src,
                    sandbox: iframe.getAttribute('sandbox'),
                    allow: iframe.getAttribute('allow'),
                  });
                };

                const processAllIframesAndHead = () => {
                  const iframes = Array.from(document.querySelectorAll('iframe'));
                  const head = document.head;

                  logDebug('Scanning entire page for iframes and head:', { iframes, head });

                  if (head) {
                    logDebug('Processing <head> element:', head);
                    // Add any additional processing for <head> if needed
                  }

                  iframes.forEach((iframe) => {
                    if (iframe instanceof HTMLElement) {
                      applyIframeAttributes(iframe);
                    }
                  });
                };

                const observePageChanges = () => {
                  const observer = new MutationObserver((mutations) => {
                    logDebug('MutationObserver triggered:', mutations);

                    mutations.forEach((mutation) => {
                      const addedIframes = Array.from(mutation.addedNodes).filter(
                        (node) => node instanceof HTMLElement && node.tagName === 'IFRAME'
                      );

                      if (addedIframes.length > 0) {
                        logDebug('New iframes detected:', addedIframes);
                        addedIframes.forEach((iframe) => {
                          applyIframeAttributes(iframe);
                        });
                      }
                    });

                    processAllIframesAndHead();
                  });

                  observer.observe(document.body, { childList: true, subtree: true });
                  logDebug('MutationObserver initialized and observing DOM changes.');
                };

                const initializeIframeProcessing = () => {
                  if (document.readyState === 'loading') {
                    document.addEventListener('DOMContentLoaded', () => {
                      logDebug('DOMContentLoaded event fired, starting iframe processing.');
                      processAllIframesAndHead();
                      observePageChanges();
                    });
                  } else {
                    logDebug('Document already loaded, starting iframe processing immediately.');
                    processAllIframesAndHead();
                    observePageChanges();
                  }

                  window.addEventListener('load', () => {
                    logDebug('Window load event fired, ensuring all iframes and head are processed.');
                    processAllIframesAndHead();
                  });
                };

                initializeIframeProcessing();
              })();
            </script>
          </body></html>