import{b as e}from"./p-B1u-Mq75.js";import{h as a,i as n,j as t,k as s,l as o,m as i,n as r,p as l,q as c,r as u,s as m,t as f,v as w,w as b,x as I,y as d,z as p,A as T,B as v,g as P}from"./p-D7M-7v58.js";const y=(a,n=32)=>{let t=!1;const s=()=>{t||(t=!0,a())};if(e.hasWindow){const e=setTimeout(s,n);window.addEventListener("load",(()=>{clearTimeout(e),s()}))}else setTimeout(s,32)},A=(a,n=5e3)=>{e.hasWindow&&"requestIdleCallback"in window?window.requestIdleCallback(a,{timeout:n}):setTimeout(a,32)},_=(e=0)=>new Promise((a=>{setTimeout((()=>a()),e)})),C=(e,a)=>{const n=e._original||e;return{_original:e,emit:q(n.emit.bind(n),a)}},q=(e,a=0)=>{let n;return(...t)=>{clearTimeout(n),n=setTimeout(e,a,...t)}},g=(e,a)=>e&&e.tagName&&e.tagName===a.toUpperCase(),h=(e,a)=>{let n=a.parentNode;for(;null!=n;){if(n==e)return!0;n=n.parentNode}return!1},k=(e,a)=>{let n=a.parentNode;for(;null!=n;){if(n.tagName===e.toUpperCase())return!0;n=n.parentNode}return!1},B=e=>e.querySelector("bal-app")||e.body,D=(e,a)=>{null!=e.componentOnReady?e.componentOnReady().then((e=>a(e))):N((()=>a(e)))},N=e=>"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(e):"function"==typeof requestAnimationFrame?requestAnimationFrame(e):setTimeout(e),j=(e,a=0)=>new Promise((n=>{M(e,a,n)})),M=(e,a=0,n)=>{let t,s;const o={passive:!0},i=()=>{t&&t()},r=a=>{void 0!==a&&e!==a.target||(i(),n(a))};return e&&(e.addEventListener("webkitTransitionEnd",r,o),e.addEventListener("transitionend",r,o),s=setTimeout(r,a+500),t=()=>{s&&(clearTimeout(s),s=void 0),e.removeEventListener("webkitTransitionEnd",r,o),e.removeEventListener("transitionend",r,o)}),i},F=(a,n,t,s)=>{if(e.hasWindow){const e=P();if(e){const o=e._ael;if(o)return o(a,n,t,s);if(e._ael)return e._ael(a,n,t,s)}}return a.addEventListener(n,t,s)},G=(a,n,t,s)=>{if(e.hasWindow){const e=P();if(e){const o=e._rel;if(o)return o(a,n,t,s);if(e._rel)return e._rel(a,n,t,s)}}return a.removeEventListener(n,t,s)},R=e=>e?new Promise((a=>D(e,a))):Promise.resolve(),z=async(e,a=!1)=>{const n=e;if(n){if(null!=n.componentOnReady){const e=await n.componentOnReady();if(!a&&null!=e)return}await Promise.all(Array.from(n.children).map((e=>z(e,a))))}},E=async e=>{await z(e,!0),await U(),await x()},L=async(e,a,n)=>{if(e&&e.target&&a&&a!==e.target){let t=e.target;"BAL-NAVBAR-BRAND"===e.target.nodeName&&(t=t.closest("bal-navbar")),t&&h(t,a)&&n(t)}},O=async(e,P)=>{const y=Object.assign({animated:!1,icons:{balIconClose:v,balIconInfoCircle:T,balIconPlus:p,balIconMinus:d,balIconEdit:I,balIconTrash:b,balIconNavGoLeft:w,balIconNavGoRight:f,balIconNavGoDown:m,balIconNavGoUp:u,balIconCaretUp:c,balIconCaretDown:l,balIconCaretLeft:r,balIconCaretRight:i,balIconCheck:o,balIconDate:s,balIconDocument:t,balIconUpload:n,balIconMenuBars:a}},P),A=e;if(null!=A){await z(A,!0);const e=Array.prototype.slice.call(A.querySelectorAll("*")).filter((e=>e.tagName.match(/^bal/i)));await Promise.all(e.map((e=>{if(null!=e.configChanged)return e.configChanged(y)})))}await Promise.all([U(),V(),x()])},U=()=>new Promise((e=>N((()=>J(e))))),x=()=>new Promise((e=>A((()=>J(e))))),V=()=>new Promise((a=>((a,n=3e3)=>{let t=!1;if(e.isSafari||!e.hasWindow||!("PerformanceObserver"in window))return setTimeout(a,32);{const e=new PerformanceObserver((n=>{const s=n.getEntries();s[s.length-1]&&(e.disconnect(),t=!0,A((()=>a())))}));e.observe({type:"largest-contentful-paint",buffered:!0}),setTimeout((()=>{t||(e.disconnect(),a())}),n)}})((()=>J(a))))),H=()=>new Promise((e=>y((()=>J(e))))),J=a=>{if(e.hasWindow&&"MessageChannel"in window){const e=new window.MessageChannel;e.port1.onmessage=a,e.port2.postMessage(void 0)}else setTimeout(a,32)};export{U as a,x as b,D as c,z as d,V as e,E as f,B as g,O as h,h as i,H as j,q as k,y as l,N as m,C as n,F as o,G as p,k as q,A as r,R as s,j as t,L as u,g as v,_ as w}