var __decorate=this&&this.__decorate||function(t,e,i,r){var s,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(o<3?s(a):o>3?s(e,i,a):s(e,i))||a);return o>3&&a&&Object.defineProperty(e,i,a),a};import{css,customElement,html,LitElement,property,svg}from"lit-element";import"./lit-draggable";import{fireEvent}from"./util/fire-event";let LitResizable=class extends LitElement{constructor(){super(...arguments),this.disabled=!1}render(){return html`
${this.disabled?"":html`
${this.handle?html`${this.handle}`:svg`
`}
`}
`}_resizeStart(t){t.preventDefault(),t.stopPropagation(),this.startWidth=this.clientWidth,this.startHeight=this.clientHeight,fireEvent(this,"resizeStart")}_resize(t){if(t.preventDefault(),t.stopPropagation(),void 0===this.startWidth||void 0===this.startHeight)return;const{deltaX:e,deltaY:i}=t.detail;if(0===i&&0===e)return;const r=this.startWidth+e,s=this.startHeight+i;fireEvent(this,"resize",{width:r,height:s,deltaX:e,deltaY:i})}_resizeEnd(t){t.preventDefault(),t.stopPropagation(),this.startWidth=void 0,this.startHeight=void 0,fireEvent(this,"resizeEnd")}static get styles(){return css`
:host {
position: relative;
display: block;
}
lit-draggable {
position: absolute;
left: var(--resize-handle-position-left, unset);
top: var(--resize-handle-postion-top, unset);
bottom: var(--resize-handle-position-bottom, 0);
right: var(--resize-handle-postion-right, 0);
width: var(--resize-handle-size, 18px);
height: var(--resize-handle-size, 18px);
z-index: var(--resize-handle-z-index, 5);
opacity: var(--resize-handle-opacity, 1);
user-select: none;
}
.icon-tabler-arrows-diagonal-2 {
width: 100%;
height: 100%;
stroke-width: 1.5;
stroke: #607d8b;
fill: none;
stroke-linecap: round;
stroke-linejoin: round;
cursor: se-resize;
}
`}};__decorate([property({attribute:!1})],LitResizable.prototype,"handle",void 0),__decorate([property({type:Boolean})],LitResizable.prototype,"disabled",void 0),LitResizable=__decorate([customElement("lit-resizable")],LitResizable);export{LitResizable};