import{f as e}from"../client-Ddi3i8XR.js";import{i as t}from"../ssr-C2pjZzfv.js";import"../observable-tloG64m6.js";import"../i18n-B98kiI7M.js";import"../empty_html-CjXB8rB4.js";import"@kdcloudjs/kwc";const n="kingdeeroutingservicegetlinkinfo",r=new WeakMap,s={standard:"standard_webPage"};class o{constructor(e,t){this.url=e,this.dispatcher=t,Object.freeze(this)}}function i(e){let{parentNode:t}=e;for(;t;){if(r.has(t))return!0;t=t.parentNode}return!1}function a(e){return r.has(e)}function d(e,t){let s=r.get(e);void 0===s&&(s=new Set,r.set(e,s)),s.add(t),e.addEventListener(n,t)}function c(e,t){const s=r.get(e);s&&(s.delete(t),s.size||r.delete(e)),e.removeEventListener(n,t)}function l(e,t){return new Promise((r,s)=>{const o=new CustomEvent(n,{detail:{stateRef:t,callback:(e,t)=>{e?s(e):r(t)}},bubbles:!0,composed:!0,cancelable:!0});e.dispatchEvent(o)})}function u(n,{url:r,target:o}){return t&&function(e,t){return!e||"_self"===e||"Small"===t||"_top"===e&&window.top===window||"_parent"===e&&window.parent===window}(o,e)?l(n,{stateType:s.standard,attributes:{url:r,target:o}}):new Promise(e=>{e({url:r,dispatcher:()=>{}})})}export{o as LinkInfo,l as getLinkInfo,i as hasLinkProvider,a as isLinkProvider,d as registerLinkProvider,c as unregisterLinkProvider,u as updateRawLinkInfo,s as urlTypes};
