1/**! 2 * Easy Popup v1.0.0 3 * @author phucbm 4 * @homepage https://github.com/viivue/easy-popup 5 * @license MIT 2023 6 */ 7!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o=e();for(var s in o)("object"==typeof exports?exports:t)[s]=o[s]}}(this,(()=>(()=>{"use strict";var t={r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e);const o=class{constructor(t){const e=t.options.cookie;if(!e)return null;if("undefined"==typeof Pia)return console.warn("PiaJs not found."),null;let o=t.options.cookieName;o="string"==typeof o&&o.length>0?o:t.id,this.key="easy-popup-"+o.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/Ä/g,"d").replace(/Ä/g,"D").toLowerCase().replace(/[^\w ]+/g,"").replace(/ +/g,"-"),this.popupId=t.id,this.piaOptions={expires:e};const s=parseInt(t.options.showingTimes)??1;null===this.getVal()&&e&&this.setVal(s)}isShow(){const t=this.getVal();return"number"==typeof t&&t>0}onPopupOpen(){const t=this.getVal();"number"==typeof t&&this.updateVal(t-1)}getVal(){return Pia.get(this.key)}setVal(t){Pia.set(this.key,t,this.piaOptions)}updateVal(t){Pia.update(this.key,t)}remove(){Pia.remove(this.key)}},s={master:"easy-popup-master",processed:"easy-popup-enabled",triggerEnabled:"ep-trigger-enabled",content:"easy-popup-content",outer:"easy-popup",inner:"easy-popup-inner",center:"easy-popup-center",overflow:"easy-popup-overflow",container:"easy-popup-container",open:"open",rootOpen:"easy-popup-open",closeButton:"ep-close-button",hasCustomClose:"ep-has-custom-close-button",preventScroll:"ep-prevent-scroll",preventScrollLenis:"ep-prevent-scroll-lenis"},i={id:"data-easy-popup-id",toggle:"data-ep-toggle",theme:"data-ep-theme",init:"data-easy-popup"},n={outerClass:"",activeHtmlClass:"",closeButtonInnerText:"",triggerSelector:"",hasMobileLayout:!1,mobileBreakpoint:768,theme:"default",keyboard:!0,clickOutsideToClose:!0,autoShow:!1,cookie:void 0,showingTimes:1,cookieName:"",preventScroll:!0},r='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>';class a{constructor(t,e){t&&(this.context=t,this.options={names:[],...e},this.eventNames=this.options.names,this.eventsList=[])}fire(t,e={}){if(!this.eventNames.includes(t))return void console.warn(`Cannot fire unrecognized event "${t}"`,this,e);const o={instance:this.context,eventName:t,...e},s=this.context.config?this.context.config:this.context.options;if(s){const e=s[t];"function"==typeof e&&e(o)}const i=this.eventsList[t];i?.length&&i.forEach((t=>{"function"==typeof t&&t(o)}))}add(t,e){t=function(t){let e=t;"on"!==t.slice(0,2)&&(e=e.charAt(0).toUpperCase()+e.slice(1),e="on"+e);return e}(t);this.eventNames.includes(t)?(void 0===this.eventsList[t]&&(this.eventsList[t]=[]),this.eventsList[t].push(e)):console.warn(`Cannot add unrecognized event "${t}"`)}}function c({target:t,attributeName:e="",defaultOptions:o={},numericValues:s=[],onIsString:i,dev:n=!1}){if(!t)return n&&console.warn("Target not found!",t),o;if(!t.hasAttribute(e))return n&&console.warn("Attribute not found from target",e),o;const r=t.getAttribute(e);if(!r.length)return o;if(!function(t){try{return JSON.parse(t)&&!!t}catch(t){return!1}}(r))return"function"==typeof i?i(r):console.warn("Not a JSON string",r),o;let a=JSON.parse(r);for(const[t,e]of Object.entries(a))"false"===e?a[t]=!1:"true"===e?a[t]=!0:s.includes(t)&&"string"==typeof e&&e.length>0?a[t]=parseFloat(e):a[t]=e;return{...o,...a}}const p=class{constructor(t){this.root=t.root}enabled(){return"undefined"!=typeof lenis&&"undefined"!==lenis}stop(){this.enabled()&&lenis.stop()}start(){this.enabled()&&lenis.start()}};function l(t,e){e.forEach((e=>{e.classList.contains(s.triggerEnabled)||(e.addEventListener("click",(e=>
7{e.preventDefault(),t.toggle()})),e.classList.add(s.triggerEnabled))}))}function u(t,e=document.createElement("div")){return t.parentNode.insertBefore(e,t),e.appendChild(t),e} 8/**! 9 * Match Media Screen v0.0.3 10 * @author phucbm 11 * @homepage https://github.com/phucbm/match-media-screen 12 * @license MIT 2022 13 */ 14var d={d:(t,e)=>{for(var o in e)d.o(e,o)&&!d.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},h={};function b(t,e=!0){const o=[...t];return e?o.sort(((t,e)=>t.breakpoint<e.breakpoint?1:-1)):o.sort(((t,e)=>t.breakpoint>e.breakpoint?1:-1)),o}function f(t,e=150){let o;return(...s)=>{clearTimeout(o),o=setTimeout((()=>{t.apply(this,s)}),e)}}d.d(h,{o:()=>v});class v{constructor(t){if(this.dev=!0===t.dev,this.object=t.object||void 0,this.object){if(this.onMatched=t.onMatched,this.onUpdate=t.onUpdate,window.addEventListener("resize",f((()=>{"function"==typeof this.onUpdate&&this.onUpdate(this.currentObject)}),this.debounce)),!this.object.responsive)return this.currentObject={type:"no-responsive",lastBreakpoint:void 0,breakpoint:-1,object:this.mergeObject(-1,this.object)},"function"==typeof this.onMatched&&this.onMatched(this.currentObject),this.dev&&console.warn("Property object must have responsive array."),!1;this.isInherit=void 0===t.isInherit||t.isInherit,this.debounce=t.debounce||100,this.currentObject={breakpoint:void 0,object:{}},this.object.responsive=b(this.object.responsive),this.match(),window.addEventListener("resize",f((()=>this.match()),this.debounce))}else console.error("Property object:{} must be provided.")}match(){let t=!1;for(let e=0;e<this.object.responsive.length;e++){const o=this.object.responsive[e];if(t=matchMedia(this.getQuery(e)).matches,t){this.currentObject.breakpoint!==o.breakpoint&&(this.currentObject={type:"responsive",lastBreakpoint:this.currentObject.breakpoint,breakpoint:o.breakpoint,object:this.mergeObject(o.breakpoint,o.settings)},"function"==typeof this.onMatched&&this.onMatched(this.currentObject));break}}t||-1===this.currentObject.breakpoint||(this.currentObject={type:"default",lastBreakpoint:this.currentObject.breakpoint,breakpoint:-1,object:this.mergeObject(-1,this.object)},"function"==typeof this.onMatched&&this.onMatched(this.currentObject))}getQuery(t){let e=`screen and (max-width:${this.object.responsive[t].breakpoint}px)`;const o=this.object.responsive[t+1];return o&&(e+=` and (min-width:${o.breakpoint+1}px)`),e}mergeObject(t,e){let o={...e};if(this.isInherit&&-1!==t){const e=b(this.object.responsive,!1);for(let s=0;s<e.length;s++)e[s].breakpoint>t&&(o={...e[s].settings,...o})}return o={...this.object,...o},delete o.responsive,o}}var m=h.o;function y(t,e=!1){e?t.outer.removeAttribute(i.theme):t.outer.setAttribute(i.theme,t.options.theme)}function g(t){t.el.classList.contains(s.processed)||(t.masterContainer||(t.masterContainer=document.createElement("div"),t.masterContainer.classList.add(s.master)),document.querySelector("body").appendChild(t.masterContainer),t.masterContainer.appendChild(t.el),t.inner=u(t.el),t.inner.classList.add(s.inner),t.container=u(t.inner),t.container.classList.add(s.container),t.overflow=u(t.container),t.overflow.classList.add(s.overflow),t.outer=u(t.overflow),t.outer.classList.add(s.outer),t.options.outerClass&&t.outer.classList.add(t.options.outerClass),t.outer.setAttribute(i.id,t.id),function(t){t.outer.addEventListener("click",(e=>{(function(t,e){return!t.inner.contains(e.target)})(t,e)&&t.options.clickOutsideToClose&&t.close()}))}(t),function(t){t.options.keyboard&&document.addEventListener("keyup",(e=>{t.isOpen&&"Escape"===e.key&&t.close()}))}(t),function(t){t.options.theme.length&&"default"!==t.options.theme&&y(t)}(t),function(t){t.options.hasMobileLayout&&new m({object:{isMobile:!1,responsive:[{breakpoint:t.options.mobileBreakpoint,settings:{isMobile:!0}}]},debounce:100,onMatched:e=>{e.object.isMobile?(t.outer.classList.add("ep-mobile-layout"),y(t,!0)):(t.outer.classList.remove("ep-mobile-layout"),y(t))}})}(t),function(t){let e=r;t.options.closeButtonInnerText&&(t.outer.classList.add(s.hasCustomClose),e=t.options.closeButtonInnerText);const o=(t=s.closeButton,o=i.toggle)=>`<button class="${t}" ${o}>\n ${e}\n </button>`;t.inner.insertAdjacentHTML("beforeend",o()),t.container.insertAdjacentHTML("beforebegin",o(s.closeButton+" for-mobile-layout"))}(t),function(t){let e=`a[href="#${t.id}"], [${i.toggle}="${t.id}"]`;t.options.triggerSelector&&t.options.triggerSelector.length&&(e+=`, ${t.options.triggerSelector}`),l(t,document.querySelectorAll(e)),l(t,t.outer.querySelectorAll(`[${i.toggle}]`))}(t),t.el.classList.add(s.processed,s.content))}class w{constructor(t,e){if(!t)return void console.warn("Init popup fail due to empty input!");if(this.root=document.querySelector(":root"),this.el=t,this.selector=i.init,this.innerHTML=this.el.
14innerHTML,this.isOpen=!1,this.id=function(t=""){return t+(+new Date).toString(16)+(1e8*Math.random()|0).toString(16)}("easy-popup-"),this.idType="auto-id",this.el.classList.contains(s.processed))return;this.events=new a(this,{names:["onClose","onOpen"]}),this.options=c({target:this.el,attributeName:i.init,defaultOptions:{...n,...e},numericValues:["autoShow","showingTimes"],onIsString:t=>{this.idType="attr-id",this.id=t}}),this.options.id&&(this.id=this.options.id,this.idType="attr-id"!==this.idType?"json-id":this.idType);const r=this.el.getAttribute(i.init);if(null===r||isNaN(r)||(this.id=`${r}`,this.idType="attr-id",console.warn("Popup ID should be a string, consider adding a prefix to your ID to avoid unexpected issue, your ID:",this.id)),this.cookie=this.options.cookie?new o(this):null,this.masterContainer=document.querySelector(`.${s.master}`),this.outer=void 0,g(this),!1!==this.options.autoShow){if(!this.cookie||this.cookie.isShow()){const t=!0===this.options.autoShow?1e3:this.options.autoShow;setTimeout((()=>this.open()),t)}}this.lenis=new p(this)}on(t,e){this.events.add(t,e)}open(){this.isOpen||(window.EasyPopupData.active&&EasyPopup.get(window.EasyPopupData.active).close(),window.EasyPopupData.active=this.id,this.outer.classList.add(s.open),this.isOpen=!0,this.root.classList.add(s.rootOpen),this.options.activeHtmlClass&&this.root.classList.add(this.options.activeHtmlClass),this.options.preventScroll&&(this.lenis.enabled()?(this.root.classList.add(s.preventScrollLenis),this.lenis.stop()):(this.root.classList.add(s.preventScroll),this.root.style.setProperty("--ep-scroll-bar-w",`${function(){const t=document.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",document.body.appendChild(t);const e=document.createElement("div");t.appendChild(e);const o=t.offsetWidth-e.offsetWidth;return t.parentNode.removeChild(t),o}()}px`))),this.cookie?.onPopupOpen(),this.events.fire("onOpen"))}close(){this.isOpen&&(window.EasyPopupData.active="",this.outer.classList.remove(s.open),this.isOpen=!1,this.root.classList.remove(s.rootOpen),this.options.activeHtmlClass&&this.root.classList.remove(this.options.activeHtmlClass),setTimeout((()=>{window.EasyPopupData.active||this.options.preventScroll&&(this.lenis.enabled()?(this.root.classList.remove(s.preventScrollLenis),this.lenis.start()):this.root.classList.remove(s.preventScroll)),this.events.fire("onClose")}),300))}toggle(){this.isOpen?this.close():this.open()}}return window.EasyPopupData=new class{constructor(){this.active="",this.popups=[]}add(t){this.popups.push(t)}get(t){return this.popups.filter((e=>e.id===t))[0]}},window.EasyPopup={init:(t=`[${i.init}]`,e={})=>{document.querySelectorAll(t).forEach((t=>window.EasyPopupData.add(new w(t,e))))},get:t=>window.EasyPopupData.get(t)},window.EasyPopup.init(),e})()));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.