const e=require("../../../../compute-scroll-into-view@3.1.1/node_modules/compute-scroll-into-view/dist/index.js");var t=e=>!1===e?{block:`end`,inline:`nearest`}:(e=>e===Object(e)&&Object.keys(e).length!==0)(e)?e:{block:`start`,inline:`nearest`};function n(n,r){if(!n.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(n))return;let i=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(n);if((e=>typeof e==`object`&&typeof e.behavior==`function`)(r))return r.behavior(e.compute(n,r));let a=typeof r==`boolean`||r==null?void 0:r.behavior;for(let{el:o,top:s,left:c}of e.compute(n,t(r))){let e=s-i.top+i.bottom,t=c-i.left+i.right;o.scroll({top:e,left:t,behavior:a})}}exports.default=n;