import{r as o,c as t,h as i}from"./p-a6030c6e.js";const e='.modal__dialog{opacity:0;visibility:hidden;width:100%;height:100%;position:fixed;top:0;left:0;-webkit-transition:opacity 0.3s ease-in-out;transition:opacity 0.3s ease-in-out;z-index:80000;display:none}.modal__dialog .outzone{position:absolute;inset:0;background-color:var(--color-content-din, #000000);opacity:0.7}.modal__dialog--dynamic{overflow-y:auto;padding-top:40px;padding-bottom:40px;height:-webkit-fill-available}.modal__dialog .modal{position:relative;margin:auto;width:592px;height:368px;border-radius:8px;background:var(--color-surface-1, #F6F6F6);-webkit-box-shadow:0px 4px 10px var(--color-shadow-1, rgba(0, 0, 0, 0.16));box-shadow:0px 4px 10px var(--color-shadow-1, rgba(0, 0, 0, 0.16));padding:32px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between}.modal__dialog .modal--dynamic{height:auto;width:auto;max-width:1000px}.modal__dialog .modal .close-button{position:relative;color:var(--color-content-default, #454545);-ms-flex-item-align:end;align-self:flex-end;margin-bottom:16px;cursor:pointer}.modal__dialog .modal .close-button::before{content:"";position:absolute;inset:-4px;border:2px solid transparent;border-radius:4px}.modal__dialog .modal .close-button:focus-visible{outline:none}.modal__dialog .modal .close-button:focus-visible::before{border-color:var(--color-focus, #c226fb)}.modal__dialog .modal .slot--dynamic{-ms-flex:1 1 auto;flex:1 1 auto}.modal__dialog--open{opacity:1;visibility:visible;display:-ms-flexbox;display:flex}';const a=e;const s=class{constructor(i){o(this,i);this.bdsModalChanged=t(this,"bdsModalChanged",7);this.listener=o=>{if(o.key=="Enter"||o.key=="Escape"){this.toggle()}};this.handleMouseClick=()=>{this.open=false;this.bdsModalChanged.emit({modalStatus:"closed"})};this.onClickCloseButtom=()=>{if(this.outzoneClose===true){this.open=false;this.bdsModalChanged.emit({modalStatus:"closed"})}};this.open=false;this.closeButton=true;this.size="fixed";this.outzoneClose=true;this.dtOutzone=null;this.dtButtonClose=null}async toggle(){this.open=!this.open;if(this.open){this.bdsModalChanged.emit({modalStatus:"opened"})}else{this.bdsModalChanged.emit({modalStatus:"closed"})}}isOpenChanged(){if(this.open){document.addEventListener("keydown",this.listener,false)}else document.removeEventListener("keydown",this.listener,false)}handleKeyDown(o){if(o.key=="Enter"){this.open=false}}render(){return i("div",{key:"57385f6ac227e78dcd905cfe6a5d222558876dd3",class:{modal__dialog:true,"modal__dialog--open":this.open,[`modal__dialog--${this.size}`]:true}},i("div",{key:"a0f0fbb837ca330912a29689af85a6a5fc58993d",class:{outzone:true},onClick:()=>this.onClickCloseButtom(),"data-test":this.dtOutzone}),i("div",{key:"b4b25c3d146531800700b7775258f47170402ac4",class:{modal:true,[`modal--${this.size}`]:true}},this.closeButton&&i("bds-icon",{key:"f8d6186feb427756d3f9cbd7d6b55ae78ad12654",size:"medium",class:"close-button",name:"close",tabindex:"0",onKeyDown:this.handleKeyDown.bind(this),onClick:this.handleMouseClick,dataTest:this.dtButtonClose}),this.size=="fixed"&&i("slot",{key:"28b338d03064cef603a4cdf447b253d271c61b54"}),this.size!=="fixed"&&i("div",{key:"b692e708de8e4983077f38e2cd4d5607ccf9e613",class:{slot:true,[`slot--${this.size}`]:true}},i("slot",{key:"f231e5e855992990a9568ae4546f7aa35b31d579"}))))}static get watchers(){return{open:["isOpenChanged"]}}};s.style=a;export{s as bds_modal};
//# sourceMappingURL=p-f6b3d866.entry.js.map