1import{G as H,v as O,c as b,ae as B,E as R,d as T}from"./vue-runtimeBHGad_ZB.js";import{b as A,m as k}from"./adminsite.storeDFHoYU-A.js";function _(a){return!a.nextPath||a.nextPath===a.previousPath||a.applyingHistory||a.landedStackSize>0?!1:a.hasOpenModal}const c=H(null),u=H(null),w=O(new Map);let C=null;function L(){const a=n=>{const o={...n,component:B(n.component)};w.value.set(o.id,o)},m=n=>w.value.has(n),h=(n,o={},s)=>{const i=w.value.get(n);if(!i){console.warn(`Modal with id "${n}" not found in registry`);return}c.value={definition:i,props:o,options:s}},d=(n,o)=>{var i,p,M;if(n&&((i=c.value)==null?void 0:i.definition.id)!==n)return;const s=(M=(p=c.value)==null?void 0:p.options)==null?void 0:M.onClose;c.value=null,s&&s(o)},f=(n,o={},s)=>{const i=w.value.get(n);if(!i){console.warn(`Modal with id "${n}" not found in registry`);return}u.value={definition:i,props:o,options:s}},y=(n,o)=>{var i,p,M;if(n&&((i=u.value)==null?void 0:i.definition.id)!==n)return;const s=(M=(p=u.value)==null?void 0:p.options)==null?void 0:M.onClose;u.value=null,s&&s(o)},v=n=>{var o;return((o=u.value)==null?void 0:o.definition.id)===n},t=b(()=>u.value),r=n=>{var o;return((o=c.value)==null?void 0:o.definition.id)===n},e=b(()=>c.value),l=(n,o)=>{if(!(n!=null&&n.definition.history))return null;const s=n.definition.history.serialize(n.props);return s?{id:n.definition.id,level:o,props:s}:null};return{registerModal:a,hasModal:m,openModal:h,closeModal:d,isModalOpen:r,currentModal:e,getHistorySnapshot:()=>{const n=l(c.value,"primary");if(!n)return[];const o=[n],s=l(u.value,"secondary");return s&&o.push(s),o},restoreHistorySnapshot:n=>{y(),d();const o=n.find(i=>i.level==="primary");if(!o)return;h(o.id,o.props);const s=n.find(i=>i.level==="secondary");s&&f(s.id,s.props)},activeModal:c,openSecondaryModal:f,closeSecondaryModal:y,isSecondaryModalOpen:v,currentSecondaryModal:t,secondaryModal:u}}function x(){return C||(C=L()),C}let E=null;function P(){const a=R(),m=(t,r)=>{v(t),f(r)},h=async(t="Are you sure you want to do this?",r={},e=!1)=>{const l={title:"Confirm",okTitle:"OK",cancelTitle:"Cancel",okVariant:"danger",hideHeaderClose:!1,...r};return await d("msgBoxConfirm").show(t,l,e)},d=t=>{var e;let r=a;for(;r;){if((e=r.refs)!=null&&e[t])return r.refs[t];r=r.parent}return t==="msgBoxConfirm"?k():void 0},f=(t,r=null)=>{if(r){setTimeout(()=>{f(t)},r);return}try{const{hasModal:l,isModalOpen:g,closeModal:S}=x();if(l(t)){g(t)&&S(t);return}}catch{}const e=document.getElementById(t);if(e!==null){let l=!1;e!=null&&e.classList.contains("show")&&(l=!0),e!=null&&e.classList.contains("closing")&&(l=!1),l&&e.dispatchEvent(new Event("bv-toggle"))}},y=()=>{const t=document.querySelectorAll(".modal.show");for(const r of t)r.dispatchEvent(new Event("bv-toggle"))},v=(t,r)=>{try{const{hasModal:l,openModal:g}=x();if(l(t)){g(t,r||{});return}}catch{}const e=document.getElementById(t);if(e!==null){let l=!1;e!=null&&e.classList.contains("show")&&(l=!0),e!=null&&e.classList.contains("closing")&&(l=!1),l||e.dispatchEvent(new Event("bv-toggle"))}};return{openCloseModal:m,confirmModal:h,showToast:A,closeModal:f,closeAllModals:y,showModal:v,getRef:d}}function $(){return E||(E=P()),E}const j=T({components:{},data:function(){const a=$();return{confirmModal:a.confirmModal,closeModal:a.closeModal,showModal:a.showModal,showToast:a.showToast,getRef:a.getRef,openCloseModal:a.openCloseModal,closeAllModals:a.closeAllModals}},computed:{},methods:{},created(){}});export{$ as a,j as m,_ as s,x as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.