import{__awaiter,__generator}from"tslib";import{r as registerInstance,h,H as Host,g as getElement}from"./index-4d3658f6.js";import{b as balBrowser}from"./browser-a623d3a0.js";import{b as balDevice}from"./device-85159a44.js";import{h as debounce,k as rIC}from"./helpers-b53ad333.js";import{L as Logger}from"./log-cf8e52ef.js";import{b as updateBalAnimated}from"./config.utils-8fe5be10.js";import"./icons.constant-47b0ca12.js";var balAppCss=":root{--bal-app-height:100%}.bal-app{position:relative;display:block}";var BalAppStyle0=balAppCss;var __decorate=undefined&&undefined.__decorate||function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)if(o=t[s])a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a;return n>3&&a&&Object.defineProperty(e,r,a),a};var App=function(){function t(t){var e=this;registerInstance(this,t);this.debouncedNotify=debounce((function(){return e.notifyResize()}),100);this.notifyResize=function(){return __awaiter(e,void 0,void 0,(function(){var t;return __generator(this,(function(e){if(balBrowser.hasDocument&&balBrowser.hasWindow){t=document.documentElement;t.style.setProperty("--bal-app-height","".concat(window.innerHeight,"px"))}return[2]}))}))};this.animated=true;this.ready=false}t.prototype.createLogger=function(t){this.log=t};t.prototype.connectedCallback=function(){updateBalAnimated(this.animated);if(balBrowser.hasWindow){window.addEventListener("resize",this.debouncedNotify);this.debouncedNotify()}};t.prototype.componentDidLoad=function(){var t=this;rIC((function(){return __awaiter(t,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.ready=true;import("./focus-visible-0d06bcc3.js").then((function(e){return t.focusVisible=e.startFocusVisible()}));return[2]}))}))}))};t.prototype.disconnectedCallback=function(){if(balBrowser.hasWindow){window.removeEventListener("resize",this.debouncedNotify)}};t.prototype.setFocus=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.focusVisible){this.focusVisible.setFocus(t)}return[2]}))}))};t.prototype.render=function(){return h(Host,{class:{"bal-app":true,"bal-app--safari":balBrowser.isSafari,"bal-app--touch":balDevice.hasTouchScreen}},h("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-app")],App.prototype,"createLogger",null);App.style=BalAppStyle0;export{App as bal_app};