D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafdxji
/
shihty.com
/
wp-content
/
plugins
/
surecart
/
dist
/
components
/
surecart
/
Filename :
p-e132352e.entry.js
back
Copy
import{r as e,c as a,h as t,a as i}from"./p-e97fde0a.js";import{s as o,g as s,b as r,a as l}from"./p-94f536d6.js";const d=new Set;function n(e){d.add(e);document.body.classList.add("sc-scroll-lock")}function c(e){d.delete(e);if(d.size===0){document.body.classList.remove("sc-scroll-lock")}}const h=":host{--width:31rem;--header-spacing:var(--sc-spacing-large);--body-spacing:var(--sc-spacing-large);--footer-spacing:var(--sc-spacing-large);display:contents}[hidden]{display:none !important}.dialog{display:flex;align-items:center;justify-content:center;position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--sc-z-index-dialog);box-sizing:border-box;text-align:left}.dialog__panel{display:flex;flex-direction:column;z-index:2;width:var(--width);max-width:100vw;max-height:100vh;background-color:var(--sc-panel-background-color);border-radius:var(--sc-border-radius-medium);box-shadow:var(--sc-shadow-x-large);position:relative}.dialog__panel:focus{outline:none}@media screen and (max-width: 420px){.dialog__panel{max-height:80vh}}.dialog--open .dialog__panel{display:flex;opacity:1;transform:none}.dialog__header{flex:0 0 auto;display:flex;border-bottom:1px solid var(--sc-color-gray-300)}.dialog__title{flex:1 1 auto;font:inherit;font-size:var(--sc-font-size-large);line-height:var(--sc-line-height-dense);padding:var(--header-spacing);margin:0}.dialog__close{flex:0 0 auto;display:flex;align-items:center;font-size:var(--sc-font-size-x-large);padding:0 calc(var(--header-spacing) / 2);z-index:2}.dialog__body{flex:1 1 auto;padding:var(--body-spacing);overflow:var(--dialog-body-overflow, auto);-webkit-overflow-scrolling:touch}.dialog__footer{flex:0 0 auto;text-align:right;padding:var(--footer-spacing)}.dialog__footer ::slotted(sl-button:not(:first-of-type)){margin-left:var(--sc-spacing-x-small)}.dialog:not(.dialog--has-footer) .dialog__footer{display:none}.dialog__overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--sc-overlay-background-color)}";const f=h;const g=class{constructor(t){e(this,t);this.scRequestClose=a(this,"scRequestClose",7);this.scShow=a(this,"scShow",7);this.scAfterShow=a(this,"scAfterShow",7);this.scHide=a(this,"scHide",7);this.scAfterHide=a(this,"scAfterHide",7);this.scInitialFocus=a(this,"scInitialFocus",7);this.open=false;this.label="";this.noHeader=false;this.hasFooter=false}async show(){if(this.open){return undefined}this.open=true}async hide(){if(!this.open){return undefined}this.open=false}requestClose(e){const a=this.scRequestClose.emit(e);if(a.defaultPrevented){const e=s(this.el,"dialog.denyClose");r(this.panel,e.keyframes,e.options);return}this.hide()}handleKeyDown(e){if(e.key==="Escape"){e.stopPropagation();this.requestClose("keyboard")}}async handleOpenChange(){if(this.open){this.scShow.emit();n(this.el);const e=this.el.querySelector("[autofocus]");if(e){e.removeAttribute("autofocus")}await Promise.all([l(this.dialog),l(this.overlay)]);this.dialog.hidden=false;requestAnimationFrame((()=>{const a=this.scInitialFocus.emit();if(!a.defaultPrevented){if(e){e.focus({preventScroll:true})}else{this.panel.focus({preventScroll:true})}}if(e){e.setAttribute("autofocus","")}}));const a=s(this.el,"dialog.show");const t=s(this.el,"dialog.overlay.show");await Promise.all([r(this.panel,a.keyframes,a.options),r(this.overlay,t.keyframes,t.options)]);this.scAfterShow.emit()}else{this.scHide.emit();await Promise.all([l(this.dialog),l(this.overlay)]);const e=s(this.el,"dialog.hide");const a=s(this.el,"dialog.overlay.hide");await Promise.all([r(this.panel,e.keyframes,e.options),r(this.overlay,a.keyframes,a.options)]);this.dialog.hidden=true;c(this.el);const t=this.originalTrigger;if(typeof(t===null||t===void 0?void 0:t.focus)==="function"){setTimeout((()=>t.focus()))}this.scAfterHide.emit()}}componentDidLoad(){this.hasFooter=!!this.el.querySelector('[slot="footer"]');this.dialog.hidden=!this.open;if(this.open){n(this.el)}}disconnectedCallback(){c(this.el)}render(){return t("div",{key:"e3d2957deb0ce0e6e9496c4f11ee015065dc7a3b",part:"base",ref:e=>this.dialog=e,class:{dialog:true,"dialog--open":this.open,"dialog--has-footer":this.hasFooter},onKeyDown:e=>this.handleKeyDown(e)},t("div",{key:"8e23876797a2625f511512fe1e0e90cc3dd05676",part:"overlay",class:"dialog__overlay",onClick:e=>{e.preventDefault();e.stopImmediatePropagation();this.requestClose("overlay")},ref:e=>this.overlay=e,tabindex:"-1"}),t("div",{key:"acf4d7b1091477670ec36b6e850b15802f39ceb1",part:"panel",class:"dialog__panel",role:"dialog","aria-modal":"true","aria-hidden":this.open?"false":"true","aria-label":this.noHeader||this.label,"aria-labelledby":!this.noHeader||"title",ref:e=>this.panel=e,tabindex:"0"},!this.noHeader&&t("header",{key:"dd9cccab7e4651a4451898f7e8d18bbb1597e133",part:"header",class:"dialog__header"},t("h2",{key:"5180cf403fc5e66f5c7e326891b5d27f8347003b",part:"title",class:"dialog__title",id:"title"},t("slot",{key:"f68d10d477490eda4a429c77c09fffe149118fe7",name:"label"}," ",this.label.length>0?this.label:String.fromCharCode(65279)," ")),t("sc-button",{key:"d05cd2c7dccdb4483b7641fb514bc37f326db05e",class:"dialog__close",type:"text",circle:true,part:"close-button",exportparts:"base:close-button__base",onClick:e=>{e.preventDefault();e.stopImmediatePropagation();this.requestClose("close-button")}},t("sc-icon",{key:"019009a95b15db94bc23705d3304e11782241abd",name:"x",label:wp.i18n.__("Close","surecart")}))),t("div",{key:"3b9824a9835cec274032e0f1c6a5fa693263b059",part:"body",class:"dialog__body"},t("slot",{key:"5fa374e7808b7dfbfc39167dd65b9b589325c914"})),t("footer",{key:"806411698ae12c422c736e137aeb193e5d48f34d",part:"footer",class:"dialog__footer"},t("slot",{key:"6efcb9a4060af5c943a7f47e2c3efa3c001a4cb7",name:"footer"}))))}get el(){return i(this)}static get watchers(){return{open:["handleOpenChange"]}}};o("dialog.show",{keyframes:[{opacity:0,transform:"scale(0.8)"},{opacity:1,transform:"scale(1)"}],options:{duration:150,easing:"ease"}});o("dialog.hide",{keyframes:[{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.8)"}],options:{duration:150,easing:"ease"}});o("dialog.denyClose",{keyframes:[{transform:"scale(1)"},{transform:"scale(1.02)"},{transform:"scale(1)"}],options:{duration:150}});o("dialog.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:150}});o("dialog.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:150}});g.style=f;export{g as sc_dialog}; //# sourceMappingURL=p-e132352e.entry.js.map