<!doctype html><html><head><title>Snowflake</title><link rel="icon" type="image/png" href="/static/favicon-16.png" sizes="16x16"/><link rel="icon" type="image/png" href="/static/favicon-32.png" sizes="32x32"/><link rel="icon" type="image/png" href="/static/favicon-48.png" sizes="48x48"/><link rel="icon" type="image/png" href="/static/favicon-96.png" sizes="96x96"/><link rel="icon" type="image/png" href="/static/favicon-144.png" sizes="144x144"/><link rel="icon" href="/static/favicon.ico"/><meta name="numeracy-build-version" content="main-84497-2c132c98afcc"><style>body {
        margin: 0px;
        padding: 0px;
        box-sizing: border-box;
        width: 100%;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: stretch;
      }

      body *,
      body *::before,
      body *::after {
        box-sizing: inherit;
      }
      #reactRoot {
        display: flex;
        flex: 1;
        flex-direction: column;
        align-items: stretch;
      }

      .rootLoading {
        width: 100%;
        height: 100vh;
        display: flex;
      }

      .rootLoading > svg {
        display: inline-block;
        margin: auto;
        width: 128px;
        height: 128px;
        animation: rootLoading 2s ease infinite;
      }

      @keyframes rootLoading {
        0% {
          opacity: 1;
          transform: scale(1);
        }
        50% {
          opacity: 0.3;
          transform: scale(0.95);
        }
      }</style><meta name="viewport" content="width=device-width"/><link rel="preload" href="/static/Inter-Bold-ff699d3134c17db1.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="/static/Inter-SemiBold-6ea51c0eff654c89.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="/static/Inter-Medium-94afb4f3993a225e.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="/static/Inter-Black-1bfc4037b6caea3e.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="/static/Inter-Regular-358200361080fccb.woff2" as="font" type="font/woff2" crossorigin><meta name="bootloader-src" content="/static/bootloader.488849a9.js"></head><body><div id="reactRoot"><div class="rootLoading"><svg aria-label="Loading" role="progressbar" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"><defs><style>.cls-1 {
                fill: none;
              }
              .cls-1,
              .cls-2 {
                stroke-width: 0px;
              }
              .cls-2 {
                fill: #29b5e8;
              }</style></defs><path class="cls-1" d="M6.09,5.54s-.13-.05-.18,0l-.37.37s-.05.13,0,.18l.37.37s.13.05.18,0l.37-.37s.05-.13,0-.18l-.37-.37Z"/><path class="cls-2" d="M7.23,5.63l-.85-.85c-.21-.21-.54-.21-.75,0l-.85.85c-.21.21-.21.54,0,.75l.85.85c.21.21.54.21.75,0l.85-.85c.21-.21.21-.54,0-.75ZM6.46,6.09l-.37.37s-.13.05-.18,0l-.37-.37s-.05-.13,0-.18l.37-.37s.13-.05.18,0l.37.37s.05.13,0,.18Z"/><path class="cls-2" d="M1.68,2.85l2.42,1.39c.13.11.3.17.48.17.42,0,.76-.34.76-.76V.76c0-.42-.34-.76-.76-.76s-.76.34-.76.76v1.57l-1.38-.79c-.36-.21-.83-.09-1.04.28-.21.36-.09.83.28,1.04Z"/><path class="cls-2" d="M3.67,6.65s.03-.02.04-.03c0,0,.01,0,.02-.02.01,0,.02-.02.04-.03,0,0,.02-.01.02-.02,0,0,.02-.02.03-.03s.02-.02.03-.03c0,0,.01-.02.02-.02,0-.01.02-.02.03-.04,0,0,.01-.01.01-.02,0-.01.02-.03.03-.04,0,0,0,0,0,0,0,0,0-.01,0-.02,0-.01.01-.03.02-.04,0-.01,0-.02.01-.03,0-.01,0-.02.01-.03,0-.01,0-.03.01-.04,0-.01,0-.02,0-.03,0-.01,0-.03,0-.04,0-.01,0-.02,0-.03,0-.01,0-.03,0-.04,0-.01,0-.02,0-.03,0-.01,0-.03,0-.04s0-.03,0-.04c0-.01,0-.02,0-.03,0-.01,0-.03,0-.04,0-.01,0-.02,0-.03,0-.01,0-.03,0-.04,0-.01,0-.02,0-.03,0-.01,0-.03-.01-.04,0-.01,0-.02-.01-.03,0-.01,0-.02-.01-.03,0-.01-.01-.03-.02-.04,0,0,0-.01,0-.02,0,0,0,0,0,0,0-.01-.02-.03-.03-.04,0,0,0-.01-.02-.02,0-.01-.02-.02-.03-.04,0,0-.01-.02-.02-.02,0,0-.02-.02-.03-.03,0,0-.02-.02-.03-.03,0,0-.02-.01-.02-.02-.01,0-.02-.02-.04-.03,0,0-.01-.01-.02-.02-.01,0-.03-.02-.04-.03,0,0,0,0,0,0l-2.52-1.45c-.36-.21-.83-.09-1.04.28-.21.36-.09.83.28,1.04l1.38.79-1.38.79c-.36.21-.49.67-.28,1.04.21.36.68.49,1.04.28l2.52-1.45s0,0,0,0Z"/><path class="cls-2" d="M4.58,7.59c-.18,0-.35.06-.48.17l-2.42,1.39c-.36.21-.49.67-.28,1.04.21.36.68.49,1.04.28l1.38-.79v1.57c0,.42.34.76.76.76s.76-.34.76-.76v-2.9c0-.42-.34-.76-.76-.76Z"/><path class="cls-2" d="M10.32,9.15l-2.42-1.39c-.13-.11-.3-.17-.48-.17-.42,0-.76.34-.76.76v2.9c0,.42.34.76.76.76s.76-.34.76-.76v-1.57l1.38.79c.36.21.83.09,1.04-.28.21-.36.09-.83-.28-1.04Z"/><path class="cls-2" d="M11.62,6.79l-1.38-.79,1.38-.79c.36-.21.49-.67.28-1.04-.21-.36-.68-.49-1.04-.28l-2.52,1.45s0,0,0,0c-.01,0-.03.02-.04.03,0,0-.01,0-.02.01-.01,0-.02.02-.04.03,0,0-.02.01-.02.02,0,0-.02.02-.03.03,0,0-.02.02-.03.03,0,0-.01.02-.02.02,0,.01-.02.02-.03.04,0,0,0,.01-.02.02,0,.01-.02.03-.03.04,0,0,0,0,0,0,0,0,0,.01,0,.02,0,.01-.01.03-.02.04,0,.01,0,.02-.01.03,0,.01,0,.02-.01.03,0,.01,0,.03-.01.04,0,.01,0,.02,0,.03,0,.01,0,.03,0,.04,0,.01,0,.02,0,.03,0,.01,0,.03,0,.04,0,.01,0,.02,0,.03,0,.01,0,.03,0,.04s0,.03,0,.04c0,.01,0,.02,0,.03,0,.01,0,.03,0,.04,0,.01,0,.02,0,.03,0,.01,0,.03,0,.04,0,.01,0,.02,0,.03,0,.01,0,.03.01.04,0,.01,0,.02.01.03,0,.01,0,.02.01.03,0,.01.01.03.02.04,0,0,0,.01,0,.02,0,0,0,0,0,0,0,.01.02.03.03.04,0,0,0,.01.02.02,0,.01.02.02.03.04,0,0,.01.02.02.02,0,0,.02.02.03.03,0,0,.02.02.03.03,0,0,.02.01.02.02.01,0,.02.02.04.03,0,0,.01,0,.02.01.01,0,.03.02.04.03,0,0,0,0,0,0l2.52,1.45c.36.21.83.09,1.04-.28.21-.36.09-.83-.28-1.04Z"/><path class="cls-2" d="M7.42,4.41c.18,0,.35-.06.48-.17l2.42-1.39c.36-.21.49-.67.28-1.04-.21-.36-.68-.49-1.04-.28l-1.38.79V.76c0-.42-.34-.76-.76-.76s-.76.34-.76.76v2.9c0,.42.34.76.76.76Z"/></svg></div></div><script>(()=>{var e={129:function(e,t){t.defaults={},t.set=function(e,r,n){var a=n||{},o=t.defaults,i=a.expires||o.expires,l=a.domain||o.domain,s=void 0!==a.path?a.path:void 0!==o.path?o.path:"/",c=void 0!==a.secure?a.secure:o.secure,u=void 0!==a.httponly?a.httponly:o.httponly,d=void 0!==a.samesite?a.samesite:o.samesite,f=i?new Date("number"==typeof i?new Date().getTime()+864e5*i:i):0;document.cookie=e.replace(/[^+#$&^`|]/g,encodeURIComponent).replace("(","%28").replace(")","%29")+"="+r.replace(/[^+#$&/:<-\[\]-}]/g,encodeURIComponent)+(f&&f.getTime()>=0?";expires="+f.toUTCString():"")+(l?";domain="+l:"")+(s?";path="+s:"")+(c?";secure":"")+(u?";httponly":"")+(d?";samesite="+d:"")},t.get=function(e){for(var t=document.cookie.split(";");t.length;){var r=t.pop(),n=r.indexOf("=");if(n=n<0?r.length:n,decodeURIComponent(r.slice(0,n).replace(/^\s+/,""))===e)return decodeURIComponent(r.slice(n+1))}return null},t.erase=function(e,r){t.set(e,"",{expires:-1,domain:r&&r.domain,path:r&&r.path,secure:0,httponly:0})},t.all=function(){for(var e={},t=document.cookie.split(";");t.length;){var r=t.pop(),n=r.indexOf("=");n=n<0?r.length:n,e[decodeURIComponent(r.slice(0,n).replace(/^\s+/,""))]=decodeURIComponent(r.slice(n+1))}return e}},112:function(e,t,r){"use strict";var n,a=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(a,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(i,l)}s((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){var s=[o,l];if(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&s[0]?n.return:s[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;switch(n=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}};Object.defineProperty(t,"__esModule",{value:!0}),t.NotRetryableError=t.RetryError=t.notEmpty=t.customizeRetry=t.customizeDecorator=t.retryDecorator=t.retry=t.wait=t.defaultRetryConfig=void 0;var l=r(741),s=function(e,t){return t},c=function(e,t){return e*t},u=function(e,t){return Math.pow(t,e)};function d(e){return o(this,void 0,void 0,function(){return i(this,function(t){return[2,new Promise(function(t){return setTimeout(t,e)})]})})}function f(e,r){return o(this,void 0,void 0,function(){var n;return i(this,function(a){return n=Object.assign({},t.defaultRetryConfig,r),[2,l.timeout(n.timeout,function(t){return function(e,t,r){return o(this,void 0,void 0,function(){var n,a,o,l,f,p,m;return i(this,function(i){switch(i.label){case 0:switch(t.backoff){case"EXPONENTIAL":a=u;break;case"FIXED":a=s;break;case"LINEAR":a=c;break;default:a=t.backoff}o="INFINITELY"===t.retries?Number.MAX_SAFE_INTEGER:t.retries,l=0,i.label=1;case 1:if(!(l<=o))return[3,8];i.label=2;case 2:return i.trys.push([2,4,,5]),[4,e()];case 3:if(f=i.sent(),t.until(f))return[2,f];return t.logger("Until condition not met by "+f),[3,5];case 4:if(p=i.sent(),!t.retryIf(p))throw p;if(p.name===w.name)throw new h("Met not retryable error. Last error: "+p,p);return n=p,t.logger("Retry failed: "+p.message),[3,5];case 5:return[4,d((m=a(l+1,t.delay))>t.maxBackOff?t.maxBackOff:m)];case 6:if(i.sent(),r())return[3,8];i.label=7;case 7:return l++,[3,1];case 8:throw new h("All retries failed. Last error: "+n,n)}})})}(e,n,t)})]})})}function p(e,t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return f(function(){return e.apply(void 0,r)},t)}}t.defaultRetryConfig={backoff:"FIXED",delay:100,logger:function(){},maxBackOff:3e5,retries:10,timeout:6e4,until:function(){return!0},retryIf:function(){return!0}},t.wait=d,t.retry=f,t.retryDecorator=p,t.customizeDecorator=function(e){return function(t,r){return p(t,Object.assign({},e,r))}},t.customizeRetry=function(e){return function(t,r){return f(t,Object.assign({},e,r))}},t.notEmpty=function(e){return Array.isArray(e)?e.length>0:null!=e};var h=function(e){function t(t,r){var n=e.call(this,t)||this;return n.lastError=r,n}return a(t,e),t}(Error);t.RetryError=h;var m=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.message=e,Error.apply(this,t)};m.prototype=Error();var w=function(e){function t(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"name",{value:r.constructor.name}),r}return a(t,e),t}(m);t.NotRetryableError=w},741:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeout=void 0,t.timeout=function(e,t){if("INFINITELY"===e)return t(function(){return!1});var r=!1,n=function(){return r};return new Promise(function(a,o){var i=setTimeout(function(){r=!0,o(Error("Timeout after "+e+"ms"))},e);t(n).then(function(e){a(e),clearTimeout(i)},function(e){o(e),clearTimeout(i)})})}}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.rv=()=>"1.3.12",r.ruid="bundler=rspack@1.3.12",(()=>{"use strict";let e,t,n,a=Symbol.for("snapps.numeracy.nestedShell");function o(){return!!window[a]}let i="_LS_",l=new Set(["workspacesVersion","pepBeachFrontendManifestVersion","pepBeachBackendVersion"]),s="X-Snowflake-Beach",c=Symbol.for("SNOWSIGHT_PEP_VERSION_CACHE"),u=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/pep.versions",n=arguments.length>3?arguments[3]:void 0;try{var a;(a=window)[c]||(a[c]=new Map);let o=window[c],i=function(e,t){let r=[];return e&&r.push("manifests=true"),(null==t?void 0:t.length)&&r.push(`manifest_keys=${encodeURIComponent(t.join(","))}`),r.length>0?`?${r.join("&")}`:""}(t,n),l=o.get(r),d=null==l?void 0:l.get(i);if(d)try{return await d}catch(a){return null==l||l.delete(i),u(e,t,r,n)}let f=e.appServerUrl,p={},h=function(){try{let e=localStorage.getItem("pepBeachBackendVersion");if(e)return{header:s,value:`beach-${e}`};if(localStorage.getItem("pepBeachCanary"))return{header:s,value:"canary"};return null}catch{return null}}();h&&(p[h.header]=h.value);let m=fetch(`${f}${r}${i}`,{method:"GET",headers:p,credentials:"omit"}).then(async e=>{if(!e.ok)throw Error(`Failed to fetch module versions: ${e.status} ${e.statusText}`);let t=await e.json();if(!(null==t?void 0:t["pe-platform"]))throw Error("Missing pe-platform version in response");return t}),w=o.get(r)??new Map;return w.set(i,m),o.set(r,w),m}catch(e){throw e instanceof Error?e:Error(`Failed to fetch module versions: ${String(e)}`)}},d=Symbol.for("snowsight.urls.appPath.value");function f(e){void 0===e?delete window[d]:window[d]=e}function p(e){var t,r;let n=function(){let e=function(){if("undefined"==typeof localStorage)return{};try{let e=localStorage.getItem("snowflake-internal-client-overrides");if(!e)return{};let t=JSON.parse(e),r={};for(let[e,n]of Object.entries(t))"boolean"==typeof n&&(r[e]=n);return r}catch(e){return{}}}(),t=function(){let e=new URLSearchParams(window.location.search).get("flags");if(null===e)return{};let t={};try{for(let r of e.split(","))r.startsWith("-")?t[r.substring(1)]=!1:r&&(t[r]=!0)}catch(e){}return t}();return{...e,...t}}()[e];if(void 0!==n)return n;let a=null==(r=window.numeracy)||null==(t=r.featureFlags)?void 0:t[e];return"object"==typeof a&&null!==a&&"value"in a?a.value:a}function h(e){return!0===p(e)}function m(e){var t;return null==(t=document.cookie.split("; ").find(t=>t.startsWith(`${e}=`)))?void 0:t.split("=")[1]}function w(e){let t=m("experiment.shell"),r=!1===e?"false":void 0;return t!==r&&(void 0===r?document.cookie="experiment.shell=; path=/; max-age=0":!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"true";document.cookie=`${e}=${t}; path=/`}("experiment.shell","false"),!0)}Symbol.for("snowsight.urls.appPath.shape");var g=r(112);function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let v=[".privatelink.testdns.snowflakecomputing.com",".privatelink.snowflakecomputing.com",".privatelink.int.snowflakecomputing.com",".privatelink.int.snowflake.local",".privatelink.snowflake.local",".privatelink.snowflake.snowsaas.cn",".privatelink.snowflakecomputing.com.cn",".privatelink.snowflakecomputing.cn"];function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:location.hostname;return v.some(t=>e.endsWith(t))}let _="x-snowflake-beach";function S(e){let t=localStorage.getItem("pepBeachBackendVersion"),r=localStorage.getItem("pepBeachCanary");t?e.set(_,`beach-${t}`):r&&e.set(_,"canary")}let b=window.numeracy||{};Object.defineProperty(window,"numeracy",{get:()=>b,set:e=>(Object.assign(b,e),b),configurable:!0});let O=window.pageParams||{};Object.defineProperty(window,"pageParams",{get:()=>O,set:e=>(Object.assign(O,e),O),configurable:!0});let I={num:-1,version:"main-84497-2c132c98afcc",appServerUrl:""};window.build=I,b.clientVersion=I.version,b.appServerUrl=I.appServerUrl,b.injectableAfterLoad=!0;let T=e=>`1#${encodeURIComponent(e)}`,A=e=>!/[^\u0000-\u00ff]/g.test(e),R={userId:"X-Numeracy-UserId",clientVersion:"X-Numeracy-Client-Version",privateLinkHost:"X-Snowflake-Privatelink-Host",snowflakeContext:"X-Snowflake-Context",encodedSnowflakeContext:"X-Snowflake-Context-Encoded",snowflakeRole:"X-Snowflake-Role",encodedSnowflakeRole:"X-Snowflake-Role-Encoded",csrfToken:"X-CSRF-Token",encodedSnowflakeSecondaryRoles:"X-Snowflake-Secondary-Roles-Encoded"};function C(e,t,r,n){let a={...r??{}},o={...a.headers??{}};if(a.credentials="include",null!=t&&(o[R.userId]=`${t}`),b.clientVersion&&(o[R.clientVersion]=b.clientVersion),y(window.location.hostname)&&(o[R.privateLinkHost]=window.location.origin),e.userKey&&(o[R.snowflakeContext]=e.userKey),e.csrfToken&&(o[R.csrfToken]=e.csrfToken),e.decodedUserKey)try{o[R.encodedSnowflakeContext]=T(e.decodedUserKey)}catch(e){null==n||n.error(e,{message:"Failed to generate x-snowflake-context-encoded"})}if(e.role){A(e.role)&&(o[R.snowflakeRole]=e.role);try{o[R.encodedSnowflakeRole]=T(e.role)}catch(e){null==n||n.error(e,{message:"Failed to generate x-snowflake-role-encoded"})}}if(e.secondaryRoles)try{o[R.encodedSnowflakeSecondaryRoles]=T(e.secondaryRoles)}catch(e){null==n||n.error(e,{message:"Failed to generate X-Snowflake-Secondary-Roles-Encoded"})}return[a,o]}let N=Symbol.for("_sf_rumBuffer_consumer");class P{static getInstance(){return P._instance||(P._instance=new P),P._instance}getDatadogRum(){return window.DD_RUM}prefixDatadogName(e){return`bootstrap__${e}`}runOrEnqueue(e){let t=this.getDatadogRum();if(t)try{e(t)}catch(e){console.error("Error invoking Datadog RUM method immediately",e)}else this.buffer.length<P.MAX_BUFFER_SIZE?this.buffer.push(e):console.warn("Datadog rum buffer size exceeded, dropping event")}static _resetForTest(){delete window[N],P._instance=void 0}constructor(){E(this,"buffer",[]),E(this,"addAction",(e,t)=>{this.runOrEnqueue(r=>r.addAction(this.prefixDatadogName(e),t))}),E(this,"addError",(e,t)=>{this.runOrEnqueue(r=>r.addError(e,t))}),E(this,"addTiming",(e,t)=>{this.runOrEnqueue(r=>r.addTiming(this.prefixDatadogName(e),t))}),E(this,"addDurationVital",(e,t)=>{this.runOrEnqueue(r=>r.addDurationVital(this.prefixDatadogName(e),t))}),E(this,"flush",()=>{let e=this.getDatadogRum();if(e)try{this.buffer&&this.buffer.length>0&&(this.buffer.forEach(t=>{t(e)}),this.buffer.length=0)}catch(t){e.addError(t,{bootloaderError:"rum_buffer_consumer_flush"})}else console.error("Datadog RUM instance not available")}),window[N]={flush:this.flush}}}E(P,"_instance",void 0),E(P,"MAX_BUFFER_SIZE",1e3);let k=P.getInstance();function U(){var t,r;if("undefined"==typeof performance||"function"!=typeof performance.now)return Date.now();let n=void 0!==e?e:"number"==typeof performance.timeOrigin&&"number"==typeof(null==(t=performance.timing)?void 0:t.navigationStart)&&5e3>Math.abs(performance.timeOrigin-performance.timing.navigationStart)?e=performance.timeOrigin:"number"==typeof(null==(r=performance.timing)?void 0:r.navigationStart)?e=performance.timing.navigationStart:null;return null===n?Date.now():n+performance.now()}function D(e){let{args:t,observableName:r}=e;b.bootstrapFetches=b.bootstrapFetches||{},b.bootstrapFetches.observableFetches=b.bootstrapFetches.observableFetches||{fetches:[]};let n=window.localStorage.getItem("pinnedVersion");if(n){(1===t.length||null==t[1])&&(t[1]={});let e=t[1],r=new Headers(e.headers);r.set("X-Pinned-Version",n),e.headers=r}let a=U(),o=fetch(...t).then(e=>(k.addDurationVital(r,{startTime:a,duration:U()-a}),e.ok||k.addError(Error(`Fetch returned non-200 status for ${r}`),{bootloaderError:`fetch_not_ok_${r}`,bootloaderFetchStatus:e.status}),e)).catch(e=>{throw k.addError(e,{bootloaderError:`fetch_${r}`}),e});return b.bootstrapFetches.observableFetches.fetches.push({args:t,response:o,datadogName:`prefetch_bootstrap__${r}`,absolutePath:new URL(t[0].toString(),document.baseURI).href}),o}class L extends Error{constructor(e,t,r=[],n=0){super(e),E(this,"code",void 0),E(this,"details",void 0),E(this,"httpStatus",void 0),this.name="ConnectError",this.code=t,this.details=r,this.httpStatus=n}}class F{static create(e){return F.instance||(F.instance=new F(e)),F.instance}static getInstance(){if(!F.instance)throw Error("BootloaderConnectFetchTransport not initialized. Call create() first.");return F.instance}async call(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{observableName:n,method:a="POST",credentials:o="include",includeSnowflakeContext:i=!0}=r,l=async()=>{let r={headers:"POST"===a?new Headers({"Content-Type":"application/json","Connect-Protocol-Version":"1"}):new Headers};this.beachInterceptor(r),"POST"===a&&this.requestIdInterceptor(r),"undefined"!=typeof window&&y(window.location.hostname)&&r.headers.set(R.privateLinkHost,window.location.origin);let l=new URL((0,this.getRequestContext)().appServerUrl);if(l.pathname&&"/"!==l.pathname){let t=l.pathname.endsWith("/")?l.pathname.slice(0,-1):l.pathname;l.pathname=`${t}${e}`}else l.pathname=e;if("GET"===a&&(l.searchParams.set("connect","v1"),l.searchParams.set("encoding","json"),l.searchParams.set("message",JSON.stringify(t??{}))),i){let e=this.getRequestContext();e.decodedUserKey?"GET"===a?l.searchParams.set("contextToken",btoa(JSON.stringify({version:1,context:T(e.decodedUserKey),expiration:Math.floor((Date.now()+9e5)/1e3)})).replace(/\+/gu,"-").replace(/\//gu,"_")):this.snowflakeContextInterceptor(r):k.addError(Error("No decoded user key in request context"),{bootloaderError:"decoded-user-key-missing"})}return await D({args:[l.toString(),{method:a,headers:r.headers,body:"POST"===a?JSON.stringify(t):null,credentials:o}],observableName:"pep_connect_fetch_"+(n?`_${n}`:"")})},s=await l();if(s.ok)return s.json();{let e={};try{e=await s.json()}catch{await s.text().catch(()=>void 0)}throw new L(e.message||`HTTP error ${s.status}`,e.code||"unknown",e.details||[],s.status)}}static _resetForTests(){F.instance=void 0}constructor(e){E(this,"getRequestContext",void 0),E(this,"snowflakeContextInterceptor",void 0),E(this,"requestIdInterceptor",void 0),E(this,"beachInterceptor",void 0),this.getRequestContext=e,this.snowflakeContextInterceptor=e=>{let t=this.getRequestContext();t.decodedUserKey&&e.headers.set(R.encodedSnowflakeContext,T(t.decodedUserKey))},this.requestIdInterceptor=e=>{let t="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():null;t&&e.headers.set("x-snowflake-request-id",t)},this.beachInterceptor=e=>{S(e.headers)}}}E(F,"instance",void 0);let x={retries:1,delay:10,timeout:"INFINITELY"};async function B(e,t){let r=e.length>0?{manifestKeys:e}:{},n=(F.create(()=>({appServerUrl:(null==t?void 0:t.appServerUrl)||window.location.origin,userKey:"",decodedUserKey:""})),F.getInstance());return(0,g.retry)(()=>n.call("/pep.manifests.v1.ManifestsService/GetManifests",r,{method:"GET",includeSnowflakeContext:!1,observableName:"fetch_manifests"}),x)}let M=Symbol.for("_sf_fetchLaunchDataPromise");function j(e){var t,r;if("undefined"==typeof window||!y(window.location.hostname))return e;if((null==(t=e.pageParams)?void 0:t.appServerUrl)&&!e.pageParams.appServerUrl.includes(".privatelink.")&&(k.addError(Error("privatelink launch response mismatch: appServerUrl"),{bootloaderError:"privatelink_app_server_url_override",from:e.pageParams.appServerUrl,to:window.location.origin}),e.pageParams.appServerUrl=window.location.origin),"user"in e&&(null==(r=e.user)?void 0:r.avatar))try{let t=new URL(e.user.avatar);if(!t.hostname.includes(".privatelink.")){let r=e.user.avatar;t.protocol=window.location.protocol,t.host=window.location.host,e.user.avatar=t.toString(),k.addError(Error("privatelink launch response mismatch: avatar"),{bootloaderError:"privatelink_avatar_url_override",from:r,to:e.user.avatar})}}catch{}return e}function $(e,t){let r=new URL((null==e?void 0:e.appServerUrl)||window.location.origin),n=t.indexOf("?"),a=-1===n?t:t.slice(0,n),o=-1===n?"":t.slice(n);if(r.pathname&&"/"!==r.pathname){let e=r.pathname.endsWith("/")?r.pathname.slice(0,-1):r.pathname;r.pathname=`${e}${a}`}else r.pathname=a;return o&&(r.search=o),r.toString()}async function G(e){let t=$(e,"/pep.guest.v1.GuestService/GetGuestLaunchData"),r=new Headers({"Content-Type":"application/json","Connect-Protocol-Version":"1"});S(r);let n=await D({args:[t,{method:"POST",headers:r,body:JSON.stringify({}),credentials:"include"}],observableName:"pep_connect_fetch__fetch_guest_launch_data"});if(!n.ok){let e=null;try{e=await n.json()}catch{}throw new L((null==e?void 0:e.message)||`Guest launch data fetch failed: ${n.status}`,(null==e?void 0:e.code)||"unknown",(null==e?void 0:e.details)||[],n.status)}return n.json()}async function V(){return F.getInstance().call("/pep.launch.v1.LaunchService/GetLaunchData",{},{observableName:"fetch_launch_data"})}function W(e,t){return`${e}::${t}`}function H(e){return W(e.decodedUsername??function(e){try{if(![...e].every(e=>255>=e.charCodeAt(0)))return;let t=new Uint8Array([...e].map(e=>e.charCodeAt(0))),r=new TextDecoder("utf-8",{fatal:!0}).decode(t);if(r!==e)return r}catch{}}(e.username)??e.username,e.url)}let K=e=>W(e.username,e.url);function Y(e,t){var r,n;return{appServerUrl:(null==t||null==(r=t.PageParams)?void 0:r.appServerUrl)||e.appServerUrl,userKey:K(e),decodedUserKey:H(e),role:sessionStorage.getItem("currentrole")??void 0,csrfToken:null==t||null==(n=t.PageParams)?void 0:n.csrfToken}}async function J(e){let t=$(e,"/pep.versions?manifests=true"),r=await D({args:[t,{method:"GET",headers:{"Content-Type":"application/json","Connect-Protocol-Version":"1"},credentials:"omit"}],observableName:"pep_connect_fetch__fetch_versions"});if(!r.ok)throw Error(`Versions fetch failed: ${r.status}`);return r.json()}function X(e){return e instanceof L&&401===e.httpStatus}async function q(e){let t;e&&F.create(()=>Y(e));try{if(e){let e=await V();return k.addTiming("launch_data_loaded",U()),e.session={kind:"authenticated"},j(e)}{let t=await G(e);return k.addTiming("guest_launch_data_loaded",U()),t.session={kind:"guest"},j(t)}}catch(a){let r=!e,n=r&&X(a);if(X(a)&&(t={kind:"unauthenticated",isBlockedFromInterface:!1},k.addAction(n?"bootloader_guest_unauthorized":"bootloader_session_expired",{source:"getLaunchDataFromPep"})),!r&&a instanceof L&&403===a.httpStatus&&a.details.some(e=>{var t;return(null==e||null==(t=e.debug)?void 0:t.errorDetail)==="ERROR_DETAIL_BLOCKED_FROM_INTERFACE"})&&(t={kind:"unauthenticated",isBlockedFromInterface:!0},k.addAction("bootloader_blocked_from_interface",{source:"getLaunchDataFromPep"})),!r&&!t&&function(e){if(!(e instanceof L))return!1;let t=e.httpStatus;return 404===t||405===t||t>=500}(a)&&(t={kind:"failed",error:a}),e)try{let r=await G(e);return k.addTiming("guest_launch_data_loaded",U()),r.session=t??{kind:"guest"},j(r)}catch{}n||(k.addError(a,{bootloaderError:"launch_data_fetch"}),console.error(`Failed to get launch data: ${a}`));try{return{manifests:(await J(e)).manifests,parameters:{},session:t??{kind:"failed",error:a}}}catch(e){throw k.addError(e,{bootloaderError:"launch_data_fetch_versions"}),console.error(`Failed to get versions: ${e}`),e}}}function z(e){let t=q(e);window[M]=t}async function Z(e){if(!window[M])for(z(e);!window[M];)await new Promise(e=>setTimeout(e,10));return window[M]}let Q=e=>{let{src:t,fetchPriority:r}=e;return(0,g.retry)(async()=>{let e=document.createElement("script"),n=new Promise((t,r)=>{e.onload=e=>t(e),e.onerror=(t,n,a,o,i)=>r(i||Error("string"==typeof t?t:`Error loading ${e.src}`))});e.src=t,e.defer=!0,r&&(e.fetchPriority=r),document.body.appendChild(e);try{await n}catch(t){var a;throw null==e||null==(a=e.parentNode)||a.removeChild(e),t}},{...x,logger:e=>{k.addError(e,{bootloaderError:"script_asset_load"})}})},ee=e=>{let{href:t,as:r,crossOrigin:n,fetchPriority:a}=e,o=document.createElement("link");o.rel="preload",o.href=t,o.as=r,n&&(o.crossOrigin=n),a&&(o.fetchPriority=a),document.head.appendChild(o)},et=e=>{let{src:t}=e;return(0,g.retry)(async()=>{let e=document.createElement("link"),r=new Promise((t,r)=>{e.onload=t,e.onerror=(t,n,a,o,i)=>r(i||Error("string"==typeof t?t:`Error loading ${e.href}`))});e.rel="stylesheet",e.href=t,document.body.appendChild(e);try{await r}catch(t){var n;throw null==e||null==(n=e.parentNode)||n.removeChild(e),t}},{...x,logger:e=>{k.addError(e,{bootloaderError:"css_asset_load"})}})};function er(e){let{ddRumDisabled:t,ddAppId:r,ddClientToken:n,sprigEnvironmentId:a}=e;void 0!==t&&window.sessionStorage.setItem("ddRumDisabled",t.toString()),void 0!==r&&window.sessionStorage.setItem("ddAppId",r),void 0!==n&&window.sessionStorage.setItem("ddClientToken",n),void 0!==a&&window.sessionStorage.setItem("sprigEnvironmentId",a)}let en=Symbol.for("snowsight.launchData"),ea=Symbol.for("snowsight.pagePreloads"),eo=Symbol.for("snowsight.launchDataReady"),ei=["NETWORK_POLICY_DENIED","SOMETHING_WENT_WRONG"];function el(e){let t=new URLSearchParams(e.search??"").get("error");return null!==t&&ei.includes(t)}let es="blockedFromInterface";function ec(){let e=localStorage.getItem(es);if(!e)return null;try{let t=JSON.parse(e);if(t&&"object"==typeof t&&Object.getPrototypeOf(t)===Object.prototype)return t}catch(e){console.error("Error parsing blocked from interface cache data:",e)}return localStorage.removeItem(es),null}function eu(e){localStorage.setItem(es,JSON.stringify(e)),window.dispatchEvent(new StorageEvent("storage",{key:es}))}let ed="bootstrapData",ef=new class{set(e){this.data=e;try{sessionStorage.setItem(ed,JSON.stringify(e))}catch(e){console.error(`Failed to store bootstrap data in session storage: ${e}`)}}get(){if(!this.data){let e=sessionStorage.getItem(ed);e&&(this.data=JSON.parse(e))}return structuredClone(this.data)}setUser(e){let t=this.get();t&&(t.User=e,this.set(t))}constructor(){E(this,"data",void 0)}},ep=e=>{var t,r;return(null==(t=e.Org)?void 0:t.url)&&e.User?W(e.User.username,e.Org.url):(null==(r=e.PageParams)?void 0:r.appServerUrl)?`_::${e.PageParams.appServerUrl}`:null};class eh{}E(eh,"Namespace","cachedBootstrapData");var em=r(129);class ew{async get(e){let t=ew.getCacheKey(e),r=await this.cachedBoostrapDataStorage.get(t);return r?ew.isCacheable(r)?r:(await this.cachedBoostrapDataStorage.delete(t),null):null}async set(e){let t=ep(e);if(t&&ew.isCacheable(e))try{await this.cachedBoostrapDataStorage.set(ew.getCacheKey(t),this.createCachedBootstrapResponse(e))}catch(e){console.error(`Failed to store bootstrap data in storage: ${e}`)}finally{await this.cachedBoostrapDataStorage.garbageCollect()}}static isCacheable(e){var t,r;return null==(r=e.Org)||null==(t=r.settings)||!t.isPolaris}static getCacheKey(e){return[eh.Namespace,em.get("snowflake_apps_channel")||"main",em.get("snowflake_apps_channel_staging")||"_",e].join("::")}createCachedBootstrapResponse(e){let t={UpdatedAt:Date.now()};if(void 0!==e.BuildVersion&&(t.BuildVersion=e.BuildVersion),void 0!==e.PageParams&&(t.PageParams=e.PageParams),e.Org){let r={settings:{isPolaris:e.Org.settings.isPolaris,snowflakeFeatures:e.Org.settings.snowflakeFeatures,snowflakeParametersWithMetadata:e.Org.settings.snowflakeParametersWithMetadata,deploymentGroup:e.Org.settings.deploymentGroup,trialStatus:e.Org.settings.trialStatus,blockPolarisAccountCreationForNewCustomers:e.Org.settings.blockPolarisAccountCreationForNewCustomers,orgHasExistingPolarisAccount:e.Org.settings.orgHasExistingPolarisAccount,accountCreatedOn:e.Org.settings.accountCreatedOn,edition:e.Org.settings.edition,snowflakeOrgName:e.Org.settings.snowflakeOrgName}};void 0!==e.Org.account&&(r.account=e.Org.account),void 0!==e.Org.url&&(r.url=e.Org.url),void 0!==e.Org.privatelinkUrl&&(r.privatelinkUrl=e.Org.privatelinkUrl),void 0!==e.Org.appPath&&(r.appPath=e.Org.appPath),t.Org=r}return e.User&&(t.User={availableRoles:e.User.availableRoles,avatar:e.User.avatar,canModifyParameters:e.User.canModifyParameters,email:e.User.email,id:e.User.id,name:e.User.name,settings:e.User.settings,username:e.User.username,gsCreatedOn:e.User.gsCreatedOn,firstName:e.User.firstName,lastName:e.User.lastName}),t}constructor(e){E(this,"cachedBoostrapDataStorage",void 0),this.cachedBoostrapDataStorage=e}}let eg=e=>W(e.username,e.url);class eE extends eh{async set(e,t){try{await this.executeInDatabase(async r=>{let n=r.transaction(eE.ObjectStoreName,"readwrite").objectStore(eE.ObjectStoreName);await this.requestToPromise(n.put({key:e,response:t}))})}catch(e){console.error("Unable to add data to the database.",e)}}async get(e){try{return await this.executeInDatabase(async t=>{let r=t.transaction(eE.ObjectStoreName,"readonly").objectStore(eE.ObjectStoreName),n=await this.requestToPromise(r.get(e));return n&&n.response.UpdatedAt>this.twoWeeksAgo()?n.response:null})}catch(e){return console.error("Unable to retrieve data from the database.",e),null}}async delete(e){try{await this.executeInDatabase(async t=>{let r=t.transaction(eE.ObjectStoreName,"readwrite").objectStore(eE.ObjectStoreName);await this.requestToPromise(r.delete(e))})}catch(e){console.error("Unable to delete data from the database.",e)}}async garbageCollect(){try{await this.executeInDatabase(async e=>{let t=e.transaction(eE.ObjectStoreName,"readwrite").objectStore(eE.ObjectStoreName);for(let e of(await this.requestToPromise(t.getAll())))e.key.startsWith(eh.Namespace)&&e.response.UpdatedAt<=this.twoWeeksAgo()&&await this.requestToPromise(t.delete(e.key))}),this.cleanUpLocalStorage()}catch(e){console.log("Failed to invalidate stale caches.",e)}}cleanUpLocalStorage(){for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);null!=t&&t.startsWith(eh.Namespace)&&localStorage.removeItem(t)}}async executeInDatabase(e){let t=null;try{return t=await this.openDatabase(),await e(t)}finally{t&&t.close()}}openDatabase(){return new Promise((e,t)=>{let r=indexedDB.open(eE.DatabaseName,eE.DatabaseVersion);r.onerror=e=>{t(e)},r.onsuccess=t=>{e(t.target.result)},r.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(eE.ObjectStoreName)||t.createObjectStore(eE.ObjectStoreName,{keyPath:"key"})}})}requestToPromise(e){return new Promise((t,r)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>r(e.error)})}twoWeeksAgo(){return Date.now()-12096e5}}E(eE,"DatabaseName","CachedBootstrapData"),E(eE,"DatabaseVersion",1),E(eE,"ObjectStoreName","responses");let ev={NOT_FOUND:"404: Not Found"},ey=new Map,e_=e=>{let{version:t}=e,r=ey.get(t);if(r)return r;let n=(async()=>{let e;try{e=await (0,g.retry)(async()=>{let e=await D({args:[`/static/manifest-${t}.json`],observableName:"manifest"});if(!e.ok){if(404===e.status)throw new g.NotRetryableError(ev.NOT_FOUND);throw Error(e.statusText)}return await e.json()},{...x,logger:e=>{k.addError(e,{bootloaderError:"build_manifest_load"})}})}catch(e){console.warn(`Failed to fetch build manifest: ${e}`)}return e})();return ey.set(t,n),n.then(e=>{e||ey.get(t)!==n||ey.delete(t)}),n};function eS(e,t){return/^\/?$/iu.test(t.pathname)&&!e}function eb(e,t){return!!("#/accounts"===t.hash||!e&&el(t))||eS(e,t)}async function eO(e){if(!e)return;F.create(()=>Y(e));let t=F.getInstance().call("/pep.cortex.intelligence.v1.AppService/GetLaunchData",{},{observableName:"fetch_intelligence_launch_data"}),r=await t,n={};for(let[e,t]of Object.entries(r.parameters)){let{longValue:r,integerValue:a,doubleValue:o,booleanValue:i,stringValue:l,...s}=t,c=r?Number(r):a??o??i??l;n[e]={value:c,...s}}return b.featureFlags=n,r}async function eI(e){var t,r,n,a;if(e){if(null==(r=window.snowflakeIntelligence)||null==(t=r.initialAppData)?void 0:t.launchDataPromise)return window.snowflakeIntelligence.initialAppData.launchDataPromise;(n=window).snowflakeIntelligence||(n.snowflakeIntelligence={}),(a=window.snowflakeIntelligence).initialAppData||(a.initialAppData={}),window.snowflakeIntelligence.initialAppData.launchDataPromise=eO(e);try{let e=await window.snowflakeIntelligence.initialAppData.launchDataPromise;return k.addTiming("intelligence_launch_data_loaded",U()),e}catch(e){throw k.addError(e,{bootloaderError:"intelligence_launch_data_fetch"}),e}}}function eT(){let e=window.location.hostname;return e.startsWith("ai.snowflake.")||e.startsWith("preprod.ai.snowflake.")||e.endsWith("ai-proxy.app.snowflake.local")||e.endsWith("ai-proxy.app.snowflake.localhost")||e.startsWith("si-")&&y(e)}function eA(e){return{devtools:{dataType:"track-entry",track:"Cowork Performance",color:"primary",tooltipText:e}}}async function eR(e,t){let r;try{r=performance.now()}catch{r=void 0}try{return await t()}finally{try{void 0!==r&&performance.measure(e,{start:r,detail:eA(e)})}catch{}}}let eC="intelligence-standalone";async function eN(e){let t="/static/pep/intelligence/".replace(/\/$/,""),r=`${t}/standalone/intelligence-standalone-manifest-${e}.json`,n=await fetch(r);if(!n.ok)throw Error(`Failed to fetch intelligence manifest: ${n.statusText}`);let a=await n.json();if(!a)throw Error("Failed to parse intelligence manifest");return a}async function eP(e){let t=await u({appServerUrl:e},!1,"/pep.cortex.intelligence.versions",[eC]);return function(e){let t=null==e?void 0:e[eC];return t&&"object"==typeof t?t:void 0}(t.manifests)??eN(t["pe-platform"])}async function ek(e){var t,r;return(t=window).snowflakeIntelligence||(t.snowflakeIntelligence={}),(r=window.snowflakeIntelligence).initialAppData||(r.initialAppData={}),window.snowflakeIntelligence.initialAppData.standaloneManifestPromise||(window.snowflakeIntelligence.initialAppData.standaloneManifestPromise=eR("cowork.bootloader.manifest",()=>eP(e))),window.snowflakeIntelligence.initialAppData.standaloneManifestPromise}let eU=async e=>{var t,r;let n=null==(r=(await ek((null==(t=e.PageParams)?void 0:t.appServerUrl)??"")).entrypoints)?void 0:r.index;if(!n||0===n.length)throw Error("No intelligence entrypoints found in manifest");return await eR("cowork.bootloader.assets",()=>{let e=[];for(let t of n)if(t.endsWith(".css")){let r=et({src:t});e.push(r)}else if(t.endsWith(".js")){let r=Q({src:t});e.push(r)}return Promise.all(e)})};function eD(){return"true"===m("cowork.own_session_flows")||"true"===new URLSearchParams(window.location.search).get("cowork_session")}function eL(){return"true"===m("cowork.own_login_page")}async function eF(e){if(!eT())return!1;let t=eS(e,window.location);if((t?eL():eD())&&(t||e))return ek((null==e?void 0:e.appServerUrl)??""),e&&eI(e).catch(()=>void 0),!0;if(!e)return!1;ek(e.appServerUrl);try{let t=await eI(e);if(null==t?void 0:t.parameters)return!0;return ex(),!1}catch(t){return ex(),k.addError(t,{message:"failed_to_initialize_intelligence_app",isAccountExpired:!!((null==e?void 0:e.expiresAt)&&e.expiresAt<Date.now()),isAccountDefined:!!e,appServerUrlFromAccount:(null==e?void 0:e.appServerUrl)??""}),console.error(`Failed to initialize Intelligence app: ${t}`),!1}}function ex(){(null==(e=window.snowflakeIntelligence)?void 0:e.initialAppData)&&delete window.snowflakeIntelligence.initialAppData.standaloneManifestPromise;var e,t,r="/pep.cortex.intelligence.versions";void 0!==r?null==(t=window[c])||t.delete(r):delete window[c]}let eB=null,eM=e=>`${e.appServerUrl}|${e.account}|${e.username}`,ej=e=>{let t=eM(e);if(eB&&eB.key===t)return eB.promise;let r=(async()=>{let t=await e$(e);if(t){var r;er((null==(r=t.bootstrapResponse)?void 0:r.PageParams)??{})}return t})(),n={key:t,promise:r};return eB=n,r.then(e=>{eB===n&&(e&&e.bootstrapResponse||(eB=null))}),r};async function e$(e){var t;let r=new ew(new eE),n=await r.get(eg(e));return n?(ef.set(n),b.bootstrapFetches||(b.bootstrapFetches={}),b.bootstrapFetches.bootstrapResponse=n,t=e,setTimeout(async()=>{await eV(t)},0),{bootstrapResponse:n,fromCache:!0}):{bootstrapResponse:await eV(e),fromCache:!1}}async function eG(e){let t=await eW(e);return t&&(ef.set(t),b.bootstrapFetches||(b.bootstrapFetches={}),b.bootstrapFetches.bootstrapResponse=t),t}async function eV(e){let t=await eG(e);if(t){let e=new ew(new eE);await e.set(t)}return t}async function eW(e){let t=e.appServerUrl,r=Y(e);try{return await (0,g.retry)(async()=>{let e=await D({args:[`${t}/bootstrap?deferSync=true`,{credentials:"include",headers:{...C(r)[1]}}],observableName:"deployment_bootstrap"});if(!e.ok)throw Error(e.statusText);let n=await e.json();if(!n.BuildVersion)throw Error("No build version specified");let a=e.headers.get("X-Pinned-Version");return window.localStorage.setItem("pinnedVersion",a??""),n},{...x,logger:e=>{k.addError(e,{bootloaderError:"deployment_bootstrap_fetch"})}})}catch(e){return console.error(`Failed to get version from deployment: ${e}`),null}}function eH(){return"preprod.app.snowflake.com"===window.location.hostname||window.location.hostname.includes("qa6.us-west-2")||window.location.hostname.includes("snowflake.local")}function eK(e){var t,r,n,a;return!!b.featureFlags||null!=(r=e.Org)&&null!=(t=r.settings)&&!!t.snowflakeFeatures&&null!=(a=e.User)&&null!=(n=a.settings)&&!!n.snowflakeFeatures&&(b.featureFlags={...e.Org.settings.snowflakeFeatures,...e.User.settings.snowflakeFeatures,...e.Org.settings.snowflakeParametersWithMetadata,...e.User.settings.snowflakeParametersWithMetadata},!0)}async function eY(e,r){var a,o,i;if((null==(a=e.PageParams)?void 0:a.enableBootstrapParametersPreloading)===!1||(b.bootstrapFetches||(b.bootstrapFetches={}),b.bootstrapFetches.extendedBootstrapData=t,b.bootstrapFetches.guestBootstrapData=n,eK(e)||!t&&!n))return;let l=performance.now(),s=new AbortController;try{for(let e of r)fetch(e,{signal:s.signal}).catch(()=>{});let e=t?await t:await n;return b.featureFlags=(null==e||null==(o=e.clientParameters)?void 0:o.reduce((e,t)=>(e[t.name]=t,e),{}))??{},e}finally{let e=performance.now()-l;(null==(i=window.bootloaderAnalytics)?void 0:i.extendedBootstrapCall)&&(window.bootloaderAnalytics.extendedBootstrapCall.blockingTime=e),s.abort("Received an initial bootstrap response, no need to preload scripts anymore")}}async function eJ(e,t){try{return await (0,g.retry)(async()=>{var r;let n=(null==t||null==(r=t.PageParams)?void 0:r.appServerUrl)||(null==e?void 0:e.appServerUrl)||(null==b?void 0:b.appServerUrl)||window.location.origin,a=await D({args:[`${n}/v0/guest/session/request/console/bootstrap-data-request?desc=parameters`,{credentials:"include",body:JSON.stringify({dataKinds:["CLIENT_PARAMS_INFO"]}),headers:{"x-snowflake-role":"PUBLIC","Content-Type":"application/json"},method:"POST"}],observableName:"deployment_extended_bootstrap_guest"});if(!a.ok)throw Error(a.statusText);return{clientParameters:(await a.json()).data.clientParamsInfo}},x)}catch(e){return console.error(`Failed to get extended bootstrap data from deployment: ${e}`),null}}async function eX(e,t){if(await eF(e))return null;try{let r=Y(e,t);return await (0,g.retry)(async()=>{let e=await D({args:[`${r.appServerUrl}/v0/fetch-extended-bootstrap-data`,{credentials:"include",headers:{...C(r)[1]},method:"POST"}],observableName:"deployment_extended_bootstrap"});if(!e.ok){if(await eq(e,r.userKey))return null;throw Error(e.statusText)}return await e.json()},x)}catch(e){return console.error(`Failed to get extended bootstrap data from deployment: ${e}`),null}}async function eq(e,t){let r=!1;if(403==e.status)try{let n=await e.json();r=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Unknown error";return!!function(e){if("object"==typeof e&&null!==e&&"error"in e){var t;return(null==(t=e.error)?void 0:t.code)==="USER_BLOCKED_FROM_INTERFACE"}return!1}(e)&&(!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Unknown error";!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Unknown error",r={restricted:!0,timestamp:Date.now(),reasonMessage:t},n=ec()||{};n[e]=r,eu(n),setTimeout(()=>{!function(){let e=ec();if(!e)return;let t=Date.now()-144e5;if(Object.entries(e).forEach(r=>{let[n,a]=r;(void 0===a.timestamp||a.timestamp<t)&&delete e[n]}),0===Object.keys(e).length)return localStorage.removeItem(es),window.dispatchEvent(new StorageEvent("storage",{key:es}));eu(e)}()},0)}(e,t)}(t,r),!0)}(n,t,"Error in bootloader v0/fetch-extended-bootstrap-data")}catch(e){console.error(`Failed to inspect extended bootstrap data error response: ${e}`)}return r}function ez(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{baseUrl:r="",includeAsync:n=!1,skipCss:a=!1,moduleNames:o}=t,i=[],l=new Set,s=(e,t)=>{let n=r+e;l.has(n)||(l.add(n),i.push(function(e,t,r){let n=document.createElement("link");return n.rel="preload",n.as=t,n.href=r+e,document.head.appendChild(n),n}(e,t,r)))};for(let t of e.exposes){if(o&&!o.includes(t.name))continue;let{assets:e}=t;for(let t of e.js.sync)s(t,"script");if(!a)for(let t of e.css.sync)s(t,"style");if(n){for(let t of e.js.async)s(t,"script");if(!a)for(let t of e.css.async)s(t,"style")}}return s(e.metaData.remoteEntry.name,"script"),i}function eZ(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.every(t=>t(e))}function eQ(e){return t=>{let{checkFlag:r}=t;return r(e)}}function e0(){return e=>{let{sessionKind:t}=e;return"authenticated"===t}}let e1={name:"ai_homepage",matchesRoute:e=>{let{hash:t}=e;return function(e){let t=e.replace(/^#/,"").split("?")[0].toLowerCase();return""===t||"/"===t||"/homepage"===t}(t)},isEnabled:eZ(eQ("SNOWSIGHT__PRELOAD_HOMEPAGE_AI_MFE"),e0()),initiate:async e=>{let{getMFEManifest:t}=e,r=await t("ai");r&&ez(r,{baseUrl:"/static/pep/ai/",moduleNames:["CocoExperienceWidget"],skipCss:!0})}};var e2=function(e){return e.ACCOUNT="ACCOUNT",e.ACCOUNTS_HISTORY="ACCOUNTS_HISTORY",e.AGENT="AGENT",e.ALERT="ALERT",e.API_INTEGRATION="API_INTEGRATION",e.APPLICATION="APPLICATION",e.APPLICATION_PACKAGE="APPLICATION_PACKAGE",e.APPLICATION_ROLE="APPLICATION_ROLE",e.DATABASE="DATABASE",e.DATABASE_OBJECTS="DATABASE_OBJECTS",e.DATABASE_ROLE="DATABASE_ROLE",e.DYNAMIC_TABLE="DYNAMIC_TABLE",e.INTERACTIVE_TABLE="INTERACTIVE_TABLE",e.EVENT_TABLE="EVENT_TABLE",e.ONLINE_FEATURE_TABLE="ONLINE_FEATURE_TABLE",e.EXTERNAL_ACCESS_INTEGRATION="EXTERNAL_ACCESS_INTEGRATION",e.EXTERNAL_TABLE="EXTERNAL_TABLE",e.FEATURE_POLICY="FEATURE_POLICY",e.FILE_FORMAT="FILE_FORMAT",e.FUNCTION="FUNCTION",e.GIT_REPOSITORY="GIT_REPOSITORY",e.GIT_BRANCH="GIT_BRANCH",e.GIT_TAG="GIT_TAG",e.ICEBERG_TABLE="ICEBERG_TABLE",e.INTEGRATION="INTEGRATION",e.MANAGED_ACCOUNT="MANAGED_ACCOUNT",e.MATERIALIZED_VIEW="MATERIALIZED_VIEW",e.NETWORK_POLICY="NETWORK_POLICY",e.OBJECT="OBJECT",e.ORG_EMAIL="ORG_EMAIL",e.ACCOUNT_EMAIL="ACCOUNT_EMAIL",e.PIPE="PIPE",e.PROCEDURE="PROCEDURE",e.QUERY="QUERY",e.RESOURCE_MONITOR="RESOURCE_MONITOR",e.ROLE="ROLE",e.SCHEMA="SCHEMA",e.SEMANTIC_VIEW="SEMANTIC_VIEW",e.SEQUENCE="SEQUENCE",e.SESSION="SESSION",e.SHARE="SHARE",e.STAGE="STAGE",e.STREAM="STREAM",e.TABLE="TABLE",e.TASK="TASK",e.TASK_GRAPH="TASK_GRAPH",e.USER="USER",e.VIEW="VIEW",e.WAREHOUSE="WAREHOUSE",e.LISTING="LISTING",e.CURRENT_USER="CURRENT_USER",e.TAG="TAG",e.BUDGET_BUNDLE="SNOWFLAKE.CORE.BUDGET",e.ROW_ACCESS_POLICY="ROW_ACCESS_POLICY",e.MASKING_POLICY="MASKING_POLICY",e.ML_MODEL="MODEL",e.ML_MODEL_VERSION="VERSION",e.ML_MODEL_VERSION_FUNCTION="VERSION_FUNCTION",e.ML_MODULE="MODULE",e.EXPERIMENT="EXPERIMENT",e.DATASET="DATASET",e.SEARCH_SERVICE="SEARCH_SERVICE",e.PROJECTION_POLICY="PROJECTION_POLICY",e.AGGREGATION_POLICY="AGGREGATION_POLICY",e.PRIVACY_POLICY="PRIVACY_POLICY",e.CONSUMER_LISTING="CONSUMER_LISTING",e.PROVIDER_LISTING="PROVIDER_LISTING",e.CATEGORY="CATEGORY",e.FEATURED_SECTION="FEATURED_SECTION",e.DATA_EXCHANGE="DATA_EXCHANGE",e.REPLICATION_GROUP="REPLICATION_GROUP",e.CONNECTION="CONNECTION",e.CONSUMER_DATA_DICTIONARY_OBJECT="CONSUMER_DATA_DICTIONARY_OBJECT",e.PROVIDER_DATA_DICTIONARY_OBJECT="PROVIDER_DATA_DICTIONARY_OBJECT",e.STREAMLIT="STREAMLIT",e.REGION="REGION",e.NOTEBOOK="NOTEBOOK",e.NOTEBOOK_PROJECT="NOTEBOOK_PROJECT",e.COMPUTE_POOL="COMPUTE_POOL",e.WORKFLOW_REQUEST="WORKFLOW_REQUEST",e.SECRET="SECRET",e.ORGANIZATION_PROFILE="ORGANIZATION_PROFILE",e.CORTEX_SEARCH_SERVICE="CORTEX_SEARCH_SERVICE",e.RELEASE_CHANNEL="RELEASE_CHANNEL",e.SERVICE="SERVICE",e.WORKSPACE="WORKSPACE",e.CONTACT="CONTACT",e.DBT_PROJECT="DBT_PROJECT",e.DCM_PROJECT="DCM_PROJECT",e.IMAGE_REPOSITORY="IMAGE_REPOSITORY",e.IMAGE="IMAGE",e}({});function e4(e){var t;return(t=e)&&/^"([^"]|"")*"$/.test(t)?e.slice(1,-1).replace(/""/g,'"'):e}let e3="#/streamlit-apps/";function e8(e){if(!e.startsWith(e3))return null;let t=e.slice(e3.length),r=t.length;for(let e=0;e<t.length;e++){let n=t[e];if("/"===n)return null;if("?"===n||"#"===n){r=e;break}}let n=t.slice(0,r);if(!n)return null;try{return decodeURIComponent(n)}catch{return null}}let e9=/^[A-Za-z0-9_-]+$/u,e5=e=>null!==e8(e),e7={name:"streamlit_render_critical",matchesRoute:e=>e5(e.hash),isEnabled:eZ(eQ("STREAMLIT__PRELOAD_RENDER_CRITICAL_DEPLOYED"),e0()),initiate:e=>{!function(e){try{let r,n=e8(window.location.hash);if(!n)return null;let a=function(e){try{let t=function(e,t){let r=e.split(/((?:[^."]|"(?:[^"]|"")*")+)/u);if(7!==r.length)throw Error(`Invalid identifier: '${e}'`);let n=r[1],a=r[3],o=r[5];return{type:t,database:e4(n),schema:e4(a),name:e4(o)}}(e,e2.STREAMLIT);return{databaseName:t.database,schemaName:t.schema,name:t.name}}catch{return{urlId:e}}}(n);if("urlId"in a?!e9.test(a.urlId):!(a.databaseName.length>0)||!(a.schemaName.length>0)||!(a.name.length>0))return null;try{r=F.getInstance()}catch{return null}var t=r;let o={streamlitIdentifier:"urlId"in a?{urlId:a}:{fullyQualifiedName:a},withSecondaryRolesAll:!1,isPrivatelink:y(window.location.hostname),appViewRequestId:""},i=t.call("/pep.streamlit.v2.StreamlitService/RenderCriticalStreamlitApp",o,{observableName:"streamlit_render_critical"});i.then(()=>{k.addTiming("streamlit_render_critical_loaded",U())}).catch(e=>{k.addError(e,{bootloaderError:"prefetch_streamlit_render_critical_rpc"})}),null!==e&&function(e,t){let{promise:r,identity:n,meta:a}=t,o=function(){let e=window.numeracy;return e?(e[ea]??(e[ea]=new Map),e[ea]):new Map}();o.has(e)||o.set(e,{promise:r,identity:n,meta:a,storedAt:Date.now()})}("streamlit_render_critical",{promise:i,identity:e,meta:{appId:n}})}catch(e){return k.addError(e,{bootloaderError:"prefetch_streamlit_render_critical_setup"}),null}}(e.sessionIdentity)}},e6=[e1,e7];function te(){return"undefined"!=typeof IS_SNOWSHELL_BUNDLE&&!0===IS_SNOWSHELL_BUNDLE}function tt(e){return null==e?"_default":"number"==typeof e?e.toString():e}function tr(e){let t=tt(e);return window.localStorage.getItem(`_clientVersionOverride_${t}`)}let tn=e=>{let{version:t,shouldLoadSignin:r}=e,n=["/static/generated-styles.local.css"];return te()&&n.push(`/static/runtime.${t}.js`),n.push(r?`/static/signin.${t}.js`:`/static/numeracy.${t}.js`),n};async function ta(e){var t,r,n;if("main-84497-2c132c98afcc".startsWith("PR-"))return;let a=await ej(e),o=null==a?void 0:a.bootstrapResponse;if((null==o?void 0:o.BuildVersion)&&(null==(r=o.Org)||null==(t=r.settings)||!t.isPolaris))return tr(null==(n=o.User)?void 0:n.id)||o.BuildVersion}async function to(e){try{let r,n,a=eb(e,window.location);if(null==e?void 0:e.appServerUrl)r=await ta(e);else{if(a)return;r=tr(void 0)||"main-84497-2c132c98afcc"}if(!r)return;if("local"===r)n=tn({version:r,shouldLoadSignin:a});else{var t;let e=await e_({version:r});if(!e)return;let o=a?"signin":"numeracy";n=(e.entrypoints[o]||[]).map(e=>`/static/${e}`),(null==(t=e.localization)?void 0:t["en-US"])&&ee({href:e.localization["en-US"],as:"fetch",crossOrigin:"anonymous",fetchPriority:"low"})}for(let e of n)e.endsWith(".js")?ee({href:e,as:"script",fetchPriority:"low"}):e.endsWith(".css")&&ee({href:e,as:"style",fetchPriority:"low"})}catch(e){k.addError(e,{bootloaderError:"preload_legacy_assets"})}}let ti=[/data\/databases/,/\/[\w-]+\/query(?:[/?#]|$)/,/\/streamlit-apps\/?(?:[?#]|$)/,/\/streamlit-apps\/[^/]+\/edit(?:[/?#]|$)/,/\/provider-studio/,/\/marketplace/],tl=["snowshell","ai","devtools","snowsight","trustcenter"],ts=["snowshell"];function tc(){let{isPolaris:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return!e}class tu extends Error{constructor(){super("shell experiment disabled"),this.name="ShellDisabledError"}}async function td(e,t){var r,n,a,o,i,l,s,c,u,d,f,p,h,m;let w;try{w=await e}catch(e){k.addError(e,{bootloaderError:"fetch_manifests_failed"})}let g=null==w||null==(r=w.manifests)?void 0:r.snowshell;if(g&&"local"!==g)try{let e=JSON.parse(g),t=(null==e||null==(f=e.entries)||null==(d=f.snowshell)||null==(u=d.initial)?void 0:u.js)??[],r=(null==e||null==(m=e.entries)||null==(h=m.snowshell)||null==(p=h.initial)?void 0:p.css)??[];for(let e of t)ee({href:e,as:"script",fetchPriority:"high"});for(let e of r)ee({href:e,as:"style"})}catch(e){k.addError(e,{bootloaderError:"preload_shell_assets"})}if(!(function(){try{return window.location.host.includes("snowflake.local")||!1}catch(e){return!1}}()||"undefined"!=typeof window&&("preprod.app.snowflake.com"===window.location.host||"preprod.ai.snowflake.com"===window.location.host)||function(){try{let e=window.localStorage.getItem("injectSnowshellAssetsOnAssetReady");return"1"===e||"true"===e}catch{return!1}}()))try{await t}catch{return!1}let E=null==w||null==(n=w.manifests)?void 0:n.snowshell;if("local"===E)return await Q({src:"/static/pep/snowshell/static/js/snowshell.js",fetchPriority:"high"}),!0;if(!E)return k.addError(Error("No snowshell manifest for a deployed build"),{bootloaderError:"missing_snowshell_manifest"}),!1;let v=JSON.parse(E),y=null==(i=v.entries)||null==(o=i.snowshell)||null==(a=o.initial)?void 0:a.js;if(!y)throw Error("No snowshell entrypoints found in shell manifest");let _=[];for(let e of y)_.push(Q({src:e,fetchPriority:"high"}));for(let e of(null==(c=v.entries)||null==(s=c.snowshell)||null==(l=s.initial)?void 0:l.css)||[])_.push(et({src:e}));return await Promise.all(_),!0}async function tf(e){try{let t=(await e).manifests;if(!t)return;window.numeracy.manifests=Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return"local"!==t}).map(e=>{let[t,r]=e;return[t,"string"==typeof r?JSON.parse(r):r]}))}catch(e){k.addError(e,{bootloaderError:"populate_window_manifests"})}}async function tp(e,t){let[r,n]=await Promise.allSettled([e,t]);if("rejected"===r.status)throw r.reason;let a=r.value;if("rejected"===n.status)return a;let o=a.pePlatform,i=n.value.pePlatform;return o&&i&&o!==i?(k.addError(Error("GetManifests responses used different PEP versions"),{bootloaderError:"manifest_version_mismatch",catalogVersion:o,snowshellVersion:i}),{pePlatform:o}):a}async function th(e){if("false"===m("experiment.shell"))return!1;let t=window.location.hostname.endsWith("proxy.app.snowflake.local")||window.location.hostname.endsWith("proxy.app.snowflake.localhost");if(!e&&!function(e){let t=e.replace(/^\/bootstrap/,"");return!(!t.startsWith("/marketplace")||/^\/marketplace\/internal(\/|$)/.test(t)||/^\/marketplace\/listing\/[^/]+\/offer\//.test(t)||/^\/marketplace\/listing\/[^/]+\/[^/]+\/offer\//.test(t))}(window.location.pathname)&&!t&&!el(window.location))return!1;let r=!1;(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=`${e.pathname}${e.hash}`;return ti.some(e=>e.test(t))})()&&(r=!0,to(e));try{let t,s=Z(e),c=B(tl,e),u=B(ts,e),d=tp(c,u),p=s.then(t=>{var r,n;if(t.parameters){if(window.numeracy.featureFlags=function(e){try{let t={};for(let[r,{stringValue:n,integerValue:a,longValue:o,doubleValue:i,booleanValue:l,...s}]of Object.entries(e.parameters))t[r]={value:n??a??o??i??l,...s};return t}catch(e){return console.error("Failed to get flags data:",e),{}}}(t),!tc(null==(n=t.org)?void 0:n.settings))throw w(!1),new tu}else window.numeracy.featureFlags={};return e&&er({ddRumDisabled:e.ddRumDisabled,ddAppId:e.ddAppId,ddClientToken:e.ddClientToken}),window.numeracy.org=t.org,window.numeracy[en]=t,f((null==(r=t.org)?void 0:r.appPath)??"/"),t});window[eo]=p;let m=td(u,p);m.catch(e=>{k.addError(e,{bootloaderError:"load_manifest_assets_unawaited"})}),tf(d);try{t=await p}catch(e){if(e instanceof tu)return!1;throw e}try{var n,a,o,i,l;!function(e,t){for(let r of e){let e,n,a=e=>k.addError(e,{bootloaderError:`page_preload_${r.name}`});try{e=r.matchesRoute(t.location)}catch(e){a(e);continue}if(e){try{n=r.isEnabled(t)}catch(e){a(e);continue}if(n){try{Promise.resolve(r.initiate(t)).catch(a)}catch(e){a(e)}return}}}}(e6,{location:window.location,sessionKind:null==(n=t.session)?void 0:n.kind,sessionIdentity:(i=null==(a=t.user)?void 0:a.username,l=null==(o=t.org)?void 0:o.url,i&&l?`${i}::${l}`:null),checkFlag:h,getMFEManifest:async e=>{var t;let r=null==(t=(await d).manifests)?void 0:t[e];if(r&&"local"!==r)return JSON.parse(r)}})}catch(e){k.addError(e,{bootloaderError:"page_preload_runner"})}return!r&&h("_DP_UI_SHELL_PRELOAD_NUMERACY")&&to(e),await m}catch(e){return k.addError(e,{bootloaderError:"bootstrap_shell_experiment"}),!1}}let tm=Symbol.for("_sf_ttvc_docHiddenDuration"),tw=Symbol.for("snapps.bootloaderInlineExecuted"),tg=Symbol.for("snapps.bootloaderFallbackFired"),tE=Symbol.for("snapps.invokeBootstrap"),tv="csrfToken",{setCsrfToken:ty,getCsrfToken:t_}=function(){let e=(()=>{try{let e=sessionStorage.getItem(tv);if(!e)return{};return JSON.parse(e)}catch{return{}}})();return{setCsrfToken:function(t,r){e[t]=r,sessionStorage.setItem(tv,JSON.stringify(e))},getCsrfToken:function(t){return e[t]}}}(),tS=()=>{let e=`
  <style>
    body {
      margin: 0;
    }

    .global-app-error {
      font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      text-align: center;
      height: 100vh;
      background-color: #f7f7f7ff;
    }

    .primary-error-message {
      color: #1e252fff;
      font-size: 28px;
      font-weight: 700;
      margin-bottom: 0.5em;
    }

    .subtitle-error-message {
      color: #5d6a85ff;
      font-size: 16px;
      font-weight: 300;
      margin-top: 0;
      margin-bottom: 2em;
    }
  </style>
  <div class="global-app-error">
    <h1 class="primary-error-message">Something went wrong</h1>
    <h3 class="subtitle-error-message">Please refresh the page</h3>
  </div>
  `,t=document.getElementById("reactRoot");t?t.innerHTML=e:document.body.innerHTML=e},tb="snowflakeContext",tO="authparams",tI="snowflake_oauth_pkce";function tT(){localStorage.removeItem(tI)}async function tA(e){let{appServerUrl:t,authToken:r}=e;try{let e={};r&&(e["X-Coldbrew-User-Token"]=r);let n=new URL(`${t}/v1/set-cookie`),a=await fetch(n.toString(),{method:"GET",credentials:"include",headers:e});if(!a.ok)return!1;let o=await a.json();return!0===o.success}catch(e){return!1}}async function tR(e,t,r){try{let n=function(){try{let e=localStorage.getItem(tI);if(!e)return null;return JSON.parse(e)}catch{return tT(),null}}();if(!n)return!1;let a={oauthNonce:t,codeVerifier:n.codeVerifier,codeChallengeMethod:n.codeChallengeMethod,sessionExchangeCode:e},o=await fetch(`${r}/v1/session-exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!o.ok)return!1;if((await o.json()).success)return tT(),function(){let e=new URL(window.location.href),t=new URLSearchParams(e.hash.substring(1));t.delete("sessionExchangeCode"),t.delete("oauthNonce"),t.delete("appServerUrl");let r=t.toString();r?e.hash=r:e.hash="",window.history.replaceState(null,"",e.toString())}(),!0;return!1}catch{return!1}finally{tT()}}let tC=async e=>{let t=function(e){try{let t=e.hash.substring(1),r=new URLSearchParams(t),n=r.get("sessionExchangeCode"),a=r.get("oauthNonce"),o=r.get("appServerUrl");if(n&&a&&o)return{sessionExchangeCode:n,oauthNonce:a,appServerUrl:o};return null}catch{return null}}(e);if(t&&await tR(t.sessionExchangeCode,t.oauthNonce,t.appServerUrl))return window.location.reload(),null;let r=e.searchParams.get(tO),n=em.get(r||tO),a=new URLSearchParams(e.hash.replace(/^#/u,"")).get(tO),o=null;if(n)try{o=JSON.parse(atob(n))}catch(e){o=null}if(null===o&&a)try{o=JSON.parse(atob(a))}catch(e){return null}return null===o&&(o=function(){try{let e=sessionStorage.getItem("sf_authparams");if(!e)return null;return JSON.parse(atob(e))}catch(e){return null}}()),(null==o?void 0:o.authToken)&&(null==o?void 0:o.appServerUrl)&&!t&&await tA({appServerUrl:o.appServerUrl,authToken:o.authToken}),o},tN=e=>{let t=sessionStorage.getItem(tb)??em.get(tb);return t?e[t]??null:null},tP=e=>{let[t,r,n]=e.pathname.split("/").map(e=>e.toLowerCase());return[n,r]},tk=(e,t)=>{let[r,n]=tP(e),a=null;for(let e in t){var o,i;let l=t[e],s=null==(o=l.account)?void 0:o.toLowerCase(),c=null==(i=l.region)?void 0:i.toLowerCase();s===r&&c===n&&(!a||l.updated&&l.updated>(a.updated??0))&&(a=l)}return a},tU=e=>{let[t,r,n]=e.pathname.split("/").map(e=>e.toLowerCase());return[r,n]},tD=(e,t)=>{let[r,n]=tU(e),a=null;for(let e in t){var o,i;let l=t[e],s=null==(o=l.snowflakeOrgName)?void 0:o.toLowerCase(),c=null==(i=l.accountAlias)?void 0:i.toLowerCase();s===r&&c===n&&(!a||l.updated&&l.updated>(a.updated??0))&&(a=l)}return a},tL=(e,t)=>tD(e,t)??tk(e,t),tF=async e=>{if("LOGIN_FAILED"===new URLSearchParams(window.location.search).get("error")||"#/session-expired"===e.hash)return null;let t=JSON.parse(localStorage.getItem("loggedInAccounts")??"{}"),r=tN(t),n=await tC(e)??function(e,t){return!e||t&&(e.region===t.region&&e.account===t.account||e.snowflakeOrgName===t.snowflakeOrgName&&e.accountAlias===t.accountAlias)?t:e}(tL(e,t),r);if(n){r!==n&&(sessionStorage.removeItem("currentrole"),sessionStorage.removeItem("currentsecondaryroles"));let e=K(n);sessionStorage.setItem(tb,e),em.set(tb,e)}return n};async function tx(e,t){try{var r,n;if((r=window).snowflakeIntelligence||(r.snowflakeIntelligence={}),(n=window.snowflakeIntelligence).initialAppData||(n.initialAppData={}),window.snowflakeIntelligence.initialAppData.legacyBootstrapData=t,window.snowflakeIntelligence.isStandaloneApp=!0,eS(e,window.location)?eL():eD())e&&(ek(e.appServerUrl),eI(e).catch(()=>void 0)),await eU(t);else{await eI(e);let r=eU(t);await Promise.all([window.snowflakeIntelligence.initialAppData.launchDataPromise,r])}}finally{try{performance.measure("cowork.bootloader.total",{start:"bootloader.start",detail:eA("cowork.bootloader.total")})}catch{}}}let tB=/^([0-9a-z_]*[\w-]*-)?([df][0-9a-zA-Z]+(?::[^@]+)?)$/u,tM=e=>(e||"").split("-").slice(-1)[0],tj=()=>!!window.location.hash&&window.location.hash.startsWith("#/");window[tw]=!0;let t$=e=>{let{buildManifest:t,entrypoint:r}=e;return(t.entrypoints[r]||[]).map(e=>`/static/${e}`)},tG=(e,t)=>{if("main-84497-2c132c98afcc"===e.BuildVersion&&null!==t)return Promise.resolve(function(e){let t={appServerUrl:e.appServerUrl,userKey:K(e),decodedUserKey:H(e),role:sessionStorage.getItem("currentrole")??void 0},r=function(){let e=window.location.pathname;if(e.endsWith("/")&&(e=e.slice(0,-1)),!tj())return e;let t=window.location.hash.split("/");if(2!==t.length)return e;let[r,n]=t,a=new Set(["data","dashboards","datastream"]);return n&&!a.has(n)&&tB.test(n)&&(e=e+"/"+tM(n)),e}()+window.location.search,n=`/bootstrap${r}`,[a,o]=C(t,void 0,void 0,console);return{fetchResponse:D({args:[`${t.appServerUrl}${n}`,{...a,headers:o}],observableName:"app_bootstrap"}),path:n,requestContext:t}}(t))},tV=async(e,t)=>{var r,n;let a=tr(null==e||null==(r=e.User)?void 0:r.id)||e.BuildVersion,o=function(e){var t;return(null==(t=e.Org)?void 0:t.settings.isPolaris)?"polaris":"numeracy"}(e),i=eb(t,window.location);b.bootstrapFetches=b.bootstrapFetches||{};try{i||(b.bootstrapFetches.application=tG(e,t))}catch(e){b.bootstrapFetches.application=void 0,console.warn(`Failed to run bootstrap fetches: ${e}`)}let l=document.createComment(`License information for included third-party packages can be found at ${window.location.origin}/static/oss-licenses-${a}.json`);if(document.body.appendChild(l),"local"===a){await eY(e,[]);let r=document.createElement("link");r.rel="stylesheet",r.href="/static/generated-styles.local.css",document.head.appendChild(r);let n=te()?`/static/runtime.${a}.js`:void 0;return await eF(t)?void await tx(t,e):i?void await Promise.all([n?Q({src:n}):void 0,Q({src:`/static/signin.${a}.js`})].filter(Boolean)):void("polaris"===o?await Q({src:`/static/polaris.${a}.js`}):await Promise.all([n?Q({src:n}):void 0,Q({src:`/static/numeracy.${a}.js`})].filter(Boolean)))}if(await eF(t))return void await tx(t,e);let s=await e_({version:a});if(k.addTiming("build_manifest_loaded",U()),void 0===s)throw Error("Failed to load application");let c=[],u=t$({buildManifest:s,entrypoint:i?"signin":o}),d=[];for(let e of((null==(n=s.localization)?void 0:n["en-US"])&&ee({href:s.localization["en-US"],as:"fetch",crossOrigin:"anonymous"}),u))if(e.endsWith(".js")&&d.push(e),e.endsWith(".css")){let t=et({src:e});c.push(t)}for(let t of(await eY(e,d),k.addTiming("parameters_loaded",U()),d)){let e=Q({src:t});c.push(e)}let f=await Promise.all(c);return k.addTiming("assets_loaded",U()),f};function tW(e){return async function(t,r){try{await e(t,r)}catch(e){console.error(`Failed to load application: ${e}`),tS()}}}let tH=async e=>{var r,a,i,l,s,c,d;let{includedVersion:g,loader:E,url:v}=e,y=await tF(v??new URL(window.location.href));if(performance.mark("bootloader.accountResolved"),!o()&&!eT()&&await th(y))return;let _=(null==y?void 0:y.appServerUrl)?await ej(y):null;k.addTiming("deployment_bootstrap_loaded",U());let S=(null==_?void 0:_.bootstrapResponse)||null,b=null==S||null==(r=S.PageParams)?void 0:r.appServerUrl;S&&(eK(S),o()||eT()||(tc(null==(s=S.Org)?void 0:s.settings)?"false"===m("experiment.shell")&&(w(void 0),window.location.reload()):w(!1))),(null==S||null==(a=S.Org)?void 0:a.appPath)&&f(S.Org.appPath),b&&function(e){if(null===e)return eH();let t=p("_DP_UI_ENABLE_MFE_VERSION_PREFETCH");return!!(!0===t||eH()&&!1!==t)}(S)&&u({appServerUrl:b},!0).then(e=>{var t,r;((r=window).numeracy||(r.numeracy={})).manifests=e.manifests||{};let n=null==(t=e.manifests)?void 0:t.ai;n&&h("_DP_UI_ENABLE_MFE_AI_PREFETCH")&&ez(n,{baseUrl:"/pep/ui/ai/"})}),o()||eT()||z(y),b&&(null==S||null==(i=S.PageParams)?void 0:i.csrfToken)&&ty(b,S.PageParams.csrfToken),function(e,r){var a,o;e&&(null==r||null==(a=r.PageParams)?void 0:a.csrfToken)&&(null==r||null==(o=r.PageParams)?void 0:o.enableBootstrapParametersPreloading)?(t=eX(e,r),n=void 0):eH()&&.2>Math.random()?(n=eJ(e,r),t=void 0):(t=void 0,n=void 0)}(y,S),window.NUMERACY_VERSION_OVERRIDE&&function(e,t){let r=tt(e);window.localStorage.setItem(`_clientVersionOverride_${r}`,t)}(null==S||null==(c=S.User)?void 0:c.id,window.NUMERACY_VERSION_OVERRIDE);let O=tr(null==S||null==(l=S.User)?void 0:l.id);if(window.bootloaderAnalytics={versionAnalytics:{bootstrapAndBuiltinVersionMatch:(null==S?void 0:S.BuildVersion)===g,calledBootstrap:null!==S,versionOverrideEnabled:null!==O},bootstrapCall:{cacheHit:!!(null==_?void 0:_.fromCache)},extendedBootstrapCall:{blockingTime:void 0}},g.startsWith("PR-")){!function(e){let t=tt(e);window.localStorage.removeItem(`_clientVersionOverride_${t}`)}(null==S||null==(d=S.User)?void 0:d.id),await E({...S,BuildVersion:g},y);return}return(null==S?void 0:S.BuildVersion)?void await E(S,y):await E({BuildVersion:g},y)};(async()=>{k.addTiming("start",U()),performance.mark("bootloader.start"),function(){try{let e=0,t=document.hidden?0:null;document.addEventListener("visibilitychange",()=>{document.hidden?null===t&&(t=performance.now()):null!==t&&(e+=performance.now()-t,t=null)}),window[tm]={getHiddenDurationMs(){let r=null!==t?performance.now()-t:0;return Math.round(e+r)},reset(){e=0,t=document.hidden?performance.now():null}}}catch{}}(),window[tg]&&k.addError(Error("Inline bootloader was CSP-blocked; loaded via external fallback script"),{bootloaderError:"csp_inline_fallback_fired"});let e=Object.fromEntries(new URLSearchParams(window.location.search));eT()&&(document.title="Snowflake CoWork"),(e.numeracy_version_override||e._nv)&&(window.NUMERACY_VERSION_OVERRIDE=e.numeracy_version_override||e._nv);try{Object.entries(e).forEach(e=>{let[t,r]=e;if(t.startsWith(i)){let e=t.slice(i.length);l.has(e)&&localStorage.setItem(e,r)}})}catch(e){console.warn("Failed to write query params to localStorage",e)}if("entrypoint_version_override"in e&&"main-84497-2c132c98afcc"!==e.entrypoint_version_override){let t=await e_({version:e.entrypoint_version_override});if(void 0===t)throw Error("Failed to load application");let r=Object.keys(t).find(e=>e.startsWith("bootloader."));await Q({src:t[r].file});return}tH({includedVersion:"main-84497-2c132c98afcc",loader:tW(tV)})})(),window[tE]=async()=>{let e=tW(tV);await tH({includedVersion:"main-84497-2c132c98afcc",loader:e})}})()})();
//# sourceURL=bootloader.488849a9.js
//# sourceMappingURL=https://s3-us-west-2.amazonaws.com/sfc-eng-static-web-ui-dev.snowflakecomputing.com/snapps/static/bootloader.488849a9.js.map</script><script>var w=window,f=Symbol.for;if(!(w[f('snapps.bootloaderInlineExecuted')]||typeof w[f('snapps.invokeBootstrap')]==='function'||(typeof performance!=='undefined'&&performance.getEntriesByName&&performance.getEntriesByName('bootloader.start').length))){var m=document.querySelector('meta[name=bootloader-src]');if(m&&m.content){var s=document.createElement('script');s.src=m.content;s.async=false;document.head.appendChild(s);w[f('snapps.bootloaderFallbackFired')]=true;}}</script></body></html>