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