112 lines
43 KiB
JavaScript
112 lines
43 KiB
JavaScript
|
import{u as t,v as e,M as i,_ as o,i as n,e as a,B as d,y as r,W as s,X as c,$ as l,o as m,r as h,a as u,Y as g,L as p,N as f,n as _,z as b}from"./main-ad130be7.js";import{o as v}from"./c.8e28b461.js";(()=>{var t,e,i;const o=Symbol(),n=Symbol(),a=Symbol(),d=Symbol(),r=Symbol(),s=Symbol(),c=Symbol(),l=Symbol(),m=Symbol(),h=Symbol(),u=Symbol(),g=Symbol(),p=Symbol();class f{constructor(){this[t]=[],this[e]=[],this[i]=new Set}destructor(){this[m](this[a]);const t=this;t[o]=null,t[a]=null,t[n]=null}get top(){const t=this[o];return t[t.length-1]||null}push(t){t&&t!==this.top&&(this.remove(t),this[s](t),this[o].push(t))}remove(t){const e=this[o].indexOf(t);return-1!==e&&(this[o].splice(e,1),e===this[o].length&&this[s](this.top),!0)}pop(){const t=this.top;return t&&this.remove(t),t}has(t){return-1!==this[o].indexOf(t)}[(t=o,e=a,i=n,s)](t){const e=this[n],i=this[a];if(!t)return this[m](i),e.clear(),void(this[a]=[]);const o=this[h](t);if(o[o.length-1].parentNode!==document.body)throw Error("Non-connected element cannot be a blocking element");this[a]=o;const d=this[u](t);if(!i.length)return void this[l](o,d,e);let r=i.length-1,s=o.length-1;for(;r>0&&s>0&&i[r]===o[s];)r--,s--;i[r]!==o[s]&&this[c](i[r],o[s]),r>0&&this[m](i.slice(0,r)),s>0&&this[l](o.slice(0,s),d,null)}[c](t,e){const i=t[d];this[g](t)&&!t.inert&&(t.inert=!0,i.add(t)),i.has(e)&&(e.inert=!1,i.delete(e)),e[r]=t[r],e[d]=i,t[r]=void 0,t[d]=void 0}[m](t){for(const e of t){e[r].disconnect(),e[r]=void 0;const t=e[d];for(const e of t)e.inert=!1;e[d]=void 0}}[l](t,e,i){for(const o of t){const t=o.parentNode,n=t.children,a=new Set;for(let t=0;t<n.length;t++){const d=n[t];d===o||!this[g](d)||e&&e.has(d)||(i&&d.inert?i.add(d):(d.inert=!0,a.add(d)))}o[d]=a;const s=new MutationObserver(this[p].bind(this));o[r]=s;let c=t;const l=c;l.__shady&&l.host&&(c=l.host),s.observe(c,{childList:!0})}}[p](t){const e=this[a],i=this[n];for(const o of t){const t=o.target.host||o.target,n=t===document.body?e.length:e.indexOf(t),a=e[n-1],r=a[d];for(let t=0;t<o.removedNodes.length;t++){const e=o.removedNodes[t];if(e===a)return console.info("Detected removal of the top Blocking Element."),void this.pop();r.has(e)&&(e.inert=!1,r.delete(e))}for(let t=0;t<o.addedNodes.length;t++){const e=o.addedNodes[t];this[g](e)&&(i&&e.inert?i.add(e):(e.inert=!0,r.add(e)))}}}[g](t){return!1===/^(style|template|script)$/.test(t.localName)}[h](t){const e=[];let i=t;for(;i&&i!==document.body;)if(i.nodeType===Node.ELEMENT_NODE&&e.push(i),i.assignedSlot){for(;i=i.assignedSlot;)e.push(i);i=e.pop()}else i=i.parentNode||i.host;return e}[u](t){const e=t.shadowRoot;if(!e)return null;const i=new Set;let o,n,a;const d=e.querySelectorAll("slot");if(d.length&&d[0].assignedNodes)for(o=0;o<d.length;o++)for(a=d[o].assignedNodes({flatten:!0}),n=0;n<a.length;n++)a[n].nodeType===Node.ELEMENT_NODE&&i.add(a[n]);return i}}document.$blockingElements=new f})();var y=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}();function x(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}!function(){if("undefined"!=typeof window){var t=Array.prototype.slice,e=Element.prototype.matches||Element.prototype.msMatchesSelector,i=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","[contenteditable]"].join(","),o=function(){function o(t,e){x(this,o),this._inertManager=e,this._rootElement=t,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}return y(o,[{key:"destructo
|
||
|
<div class="mdc-dialog ${m(t)}"
|
||
|
role="alertdialog"
|
||
|
aria-modal="true"
|
||
|
aria-labelledby="title"
|
||
|
aria-describedby="content">
|
||
|
<div class="mdc-dialog__container">
|
||
|
<div class="mdc-dialog__surface">
|
||
|
${e}
|
||
|
<div id="content" class="mdc-dialog__content">
|
||
|
<slot id="contentSlot"></slot>
|
||
|
</div>
|
||
|
<footer
|
||
|
id="actions"
|
||
|
class="${m(i)}">
|
||
|
<span>
|
||
|
<slot name="secondaryAction"></slot>
|
||
|
</span>
|
||
|
<span>
|
||
|
<slot name="primaryAction"></slot>
|
||
|
</span>
|
||
|
</footer>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="mdc-dialog__scrim"></div>
|
||
|
</div>`}renderHeading(){return l`
|
||
|
<h2 id="title" class="mdc-dialog__title">${this.heading}</h2>`}firstUpdated(){super.firstUpdated(),this.mdcFoundation.setAutoStackButtons(!0),this.initialSupressDefaultPressSelector?this.suppressDefaultPressSelector=this.initialSupressDefaultPressSelector:this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,"mwc-textarea","mwc-menu mwc-list-item","mwc-select mwc-list-item"].join(", "),this.boundHandleClick=this.mdcFoundation.handleClick.bind(this.mdcFoundation),this.boundHandleKeydown=this.mdcFoundation.handleKeydown.bind(this.mdcFoundation),this.boundHandleDocumentKeydown=this.mdcFoundation.handleDocumentKeydown.bind(this.mdcFoundation)}connectedCallback(){super.connectedCallback(),this.open&&this.mdcFoundation&&!this.mdcFoundation.isOpen()&&(this.setEventListeners(),this.mdcFoundation.open())}disconnectedCallback(){super.disconnectedCallback(),this.open&&this.mdcFoundation&&(this.removeEventListeners(),this.closingDueToDisconnect=!0,this.mdcFoundation.close(this.currentAction||this.defaultAction),this.closingDueToDisconnect=!1,this.currentAction=void 0,T.remove(this))}forceLayout(){this.mdcFoundation.layout()}focus(){const t=this.getInitialFocusEl();t&&t.focus()}blur(){if(!this.shadowRoot)return;const t=this.shadowRoot.activeElement;if(t)t instanceof HTMLElement&&t.blur();else{const t=this.getRootNode(),e=t instanceof Document?t.activeElement:null;e instanceof HTMLElement&&e.blur()}}setEventListeners(){this.boundHandleClick&&this.mdcRoot.addEventListener("click",this.boundHandleClick),this.boundHandleKeydown&&this.mdcRoot.addEventListener("keydown",this.boundHandleKeydown,k()),this.boundHandleDocumentKeydown&&document.addEventListener("keydown",this.boundHandleDocumentKeydown,k())}removeEventListeners(){this.boundHandleClick&&this.mdcRoot.removeEventListener("click",this.boundHandleClick),this.boundHandleKeydown&&this.mdcRoot.removeEventListener("keydown",this.boundHandleKeydown),this.boundHandleDocumentKeydown&&document.removeEventListener("keydown",this.boundHandleDocumentKeydown)}close(){this.open=!1}show(){this.open=!0}}o([n(".mdc-dialog")],I.prototype,"mdcRoot",void 0),o([n('slot[name="primaryAction"]')],I.prototype,"primarySlot",void 0),o([n('slot[name="secondaryAction"]')],I.prototype,"secondarySlot",void 0),o([n("#contentSlot")],I.prototype,"contentSlot",void 0),o([n(".mdc-dialog__content")],I.prototype,"contentElement",void 0),o([n(".mdc-container")],I.prototype,"conatinerElement",void 0),o([a({type:Boolean})],I.prototype,"hideActions",void 0),o([a({type:Boolean}),v((function(){this.forceLayout()}))],I.prototype,"stacked",void 0),o([a({type:String})],I.prototype,"heading",void 0),o([a({type:String}),v((function(t){this.mdcFoundation.setScrimClickAction(t)}))],I.prototype,"scrimClickAction",void 0),o([a({type:String}),v((function(t){this.mdcFoundation.setEscapeKeyAction(t)}))],I.prototype,"escapeKeyAction",void 0),o([a({type:Boolean,reflect:!0}),v((function(t){this.mdcFoundation&&this.isConnected&&(t?(this.setEventListeners(),this.mdcFoundation.open()):(this.removeEventListeners(),this.mdcFoundation.close(this.currentAction||this.defaultAction),this.currentAction=void 0))}))],I.prototype,"open",void 0),o([a()],I.prototype,"defaultAction",void 0),o([a()],I.prototype,"actionAttribute",void 0),o([a()],I.prototype,"initialFocusAttribute",void 0);const O=h`.mdc-dialog .mdc-dialog__surface{background-color:#fff;background-color:var(--mdc-theme-surface, #fff)}.mdc-dialog .mdc-dialog__scrim{background-color:rgba(0,0,0,.32)}.mdc-dialog .mdc-dialog__surface-scrim{background-color:rgba(0,0,0,.32)}.mdc-dialog .mdc-dialog__title{color:rgba(0,0,0,.87)}.mdc-dialog .mdc-dialog__content{color:rgba(0,0,0,.6)}.mdc-dialog .mdc-dialog__close{color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-dialog .mdc-dialog__close .mdc-icon-button__ripple::before,.mdc-dialog .mdc-dialog__close .mdc-icon-button__ripple::after{background-color:#000;background-color:var(--mdc-ripple-color, var(--mdc-theme-on-surface, #000))}.mdc-dialog .mdc-dialog__close:hover .mdc-icon-button__ripple::before,.mdc-dialog .mdc-dialog__clo
|
||
|
<div class="header_title">${e}</div>
|
||
|
<ha-icon-button
|
||
|
.label=${t.localize("ui.dialogs.generic.close")}
|
||
|
.path=${b}
|
||
|
dialogAction="close"
|
||
|
class="header_button"
|
||
|
></ha-icon-button>
|
||
|
`;u([_("ha-dialog")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",key:g,value:void 0},{kind:"method",key:"scrollToPos",value:function(t,e){var i;null===(i=this.contentElement)||void 0===i||i.scrollTo(t,e)}},{kind:"method",key:"renderHeading",value:function(){return l`<slot name="heading"> ${p(f(i.prototype),"renderHeading",this).call(this)} </slot>`}},{kind:"field",static:!0,key:"styles",value:()=>[O,h`
|
||
|
.mdc-dialog {
|
||
|
--mdc-dialog-scroll-divider-color: var(--divider-color);
|
||
|
z-index: var(--dialog-z-index, 7);
|
||
|
-webkit-backdrop-filter: var(--dialog-backdrop-filter, none);
|
||
|
backdrop-filter: var(--dialog-backdrop-filter, none);
|
||
|
--mdc-dialog-box-shadow: var(--dialog-box-shadow, none);
|
||
|
--mdc-typography-headline6-font-weight: 400;
|
||
|
--mdc-typography-headline6-font-size: 1.574rem;
|
||
|
}
|
||
|
.mdc-dialog__actions {
|
||
|
justify-content: var(--justify-action-buttons, flex-end);
|
||
|
padding-bottom: max(env(safe-area-inset-bottom), 24px);
|
||
|
}
|
||
|
.mdc-dialog__actions span:nth-child(1) {
|
||
|
flex: var(--secondary-action-button-flex, unset);
|
||
|
}
|
||
|
.mdc-dialog__actions span:nth-child(2) {
|
||
|
flex: var(--primary-action-button-flex, unset);
|
||
|
}
|
||
|
.mdc-dialog__container {
|
||
|
align-items: var(--vertial-align-dialog, center);
|
||
|
}
|
||
|
.mdc-dialog__title {
|
||
|
padding: 24px 24px 0 24px;
|
||
|
}
|
||
|
.mdc-dialog__actions {
|
||
|
padding: 0 24px 24px 24px;
|
||
|
}
|
||
|
.mdc-dialog__title::before {
|
||
|
display: block;
|
||
|
height: 0px;
|
||
|
}
|
||
|
.mdc-dialog .mdc-dialog__content {
|
||
|
position: var(--dialog-content-position, relative);
|
||
|
padding: var(--dialog-content-padding, 24px);
|
||
|
}
|
||
|
:host([hideactions]) .mdc-dialog .mdc-dialog__content {
|
||
|
padding-bottom: max(
|
||
|
var(--dialog-content-padding, 24px),
|
||
|
env(safe-area-inset-bottom)
|
||
|
);
|
||
|
}
|
||
|
.mdc-dialog .mdc-dialog__surface {
|
||
|
position: var(--dialog-surface-position, relative);
|
||
|
top: var(--dialog-surface-top);
|
||
|
min-height: var(--mdc-dialog-min-height, auto);
|
||
|
border-radius: var(--ha-dialog-border-radius, 28px);
|
||
|
}
|
||
|
:host([flexContent]) .mdc-dialog .mdc-dialog__content {
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
}
|
||
|
.header_button {
|
||
|
position: absolute;
|
||
|
right: 16px;
|
||
|
top: 10px;
|
||
|
text-decoration: none;
|
||
|
color: inherit;
|
||
|
}
|
||
|
.header_title {
|
||
|
margin-right: 32px;
|
||
|
margin-inline-end: 32px;
|
||
|
margin-inline-start: initial;
|
||
|
direction: var(--direction);
|
||
|
}
|
||
|
.header_button {
|
||
|
inset-inline-start: initial;
|
||
|
inset-inline-end: 16px;
|
||
|
direction: var(--direction);
|
||
|
}
|
||
|
.dialog-actions {
|
||
|
inset-inline-start: initial !important;
|
||
|
inset-inline-end: 0px !important;
|
||
|
direction: var(--direction);
|
||
|
}
|
||
|
`]}]}}),I);export{D as c};
|