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EAASmC,EAAK,CAAEI,YAAY,EAAM5B,IAAKuB,EAAWC,IAE1E,ECNDX,EAAoBY,EAAI,CAACI,EAAKC,IAAUJ,OAAOK,UAAUC,eAAeC,KAAKJ,EAAKC,G,yCCClF,MAAMI,UAA0BC,eAC/BC,cACCC,OACD,CAEAC,gCACO,IAAeC,MACrB,IAAK,MAAMC,KAAiBD,KAAKE,eAChCD,EAAcE,iBAAiB,QAASH,KAAKI,mBAE/C,CAEIF,qBACH,OAAOF,KAAKK,iBAAiB,eAC9B,CAEAD,mBAAsBE,IAGrBA,EAAMC,iBACN,MAAMN,EAAgBK,EAAME,OAE5B,GADAC,QAAQC,IAAIT,GACRA,EAAe,CAClB,MAAMU,EAAMV,EAAcW,aAAa,YACnCD,IACHF,QAAQC,IAAIC,GACZE,OAAOC,KAAKH,EATK,SACG,6CAUtB,CACA,OAAO,CAAK,EA0BdI,eAAeC,OAAO,qBAAsBrB,EAAmB,CAC9DsB,QAAS,O","sources":["webpack://easternstandard/./node_modules/@alexspirgel/children-loaded/src/index.js","webpack://easternstandard/webpack/bootstrap","webpack://easternstandard/webpack/runtime/compat get default export","webpack://easternstandard/webpack/runtime/define property getters","webpack://easternstandard/webpack/runtime/hasOwnProperty shorthand","webpack://easternstandard/./custom-blocks/locked/blog-info/scripts/src/script.js"],"sourcesContent":["module.exports = (function () {\n\n\t// Initialize a weak map to hold promises.\n\tconst childrenLoadedPromises = new WeakMap();\n\n\t/**\n\t * Checks to see if children elements are loaded.\n\t * @param {object} element - Element to look for children within.\n\t * @return {boolean} Whether the children elements are loaded or not.\n\t */\n\n\tconst childrenLoadedSynchronous = (element) => {\n\n\t\t// Document ready states reference: https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState\n\t\tif (document.readyState === 'interactive' || document.readyState === 'complete') {\n\t\t\t// Children elements are assumed to be loaded.\n\t\t\treturn true;\n\t\t}\n\n\t\t// While the element exists.\n\t\twhile (element) {\n\t\t\t// If the next sibling element exists.\n\t\t\tif (element.nextSibling) {\n\t\t\t\t// The original passed element and its children have been loaded.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// Set the element to the parent element.\n\t\t\telement = element.parentNode;\n\t\t}\n\n\t\t// If code execution gets here, it's assumed children elements are not loaded.\n\t\treturn false;\n\n\t};\n\n\t/**\n\t * An asynchronous wrapper for the childrenLoadedSynchronous function.\n\t * @param {object} element - Element to look for children within.\n\t * @param {boolean} [forceNewPromise=false] - Option to invalidate existing promises.\n\t * @return {*} True if children are loaded, otherwise a promise.\n\t */\n\n\tconst childrenLoaded = (element, forceNewPromise = false) => {\n\n\t\t// If children are loaded immediately.\n\t\tif (childrenLoadedSynchronous(element)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// If an existing promise for the passed element does not exist yet or if a new promise is being forced.\n\t\telse if (!childrenLoadedPromises.get(element) || forceNewPromise) {\n\t\t\t// Create a new promise.\n\t\t\tconst childrenLoadedPromise = new Promise((resolve) => {\n\t\t\t\t// Create a new mutation observer.\n\t\t\t\tconst observer = new MutationObserver(() => {\n\t\t\t\t\t// When children are loaded.\n\t\t\t\t\tif (childrenLoadedSynchronous(element)) {\n\t\t\t\t\t\t// Disconnect the mutation observer.\n\t\t\t\t\t\tobserver.disconnect();\n\t\t\t\t\t\t// Resolve the promise.\n\t\t\t\t\t\tresolve(true);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t// Watch for child element updates.\n\t\t\t\tobserver.observe(element, {\n\t\t\t\t\tchildList: true\n\t\t\t\t});\n\t\t\t});\n\t\t\t// Set the promise weak map entry for the passed element.\n\t\t\tchildrenLoadedPromises.set(element, childrenLoadedPromise);\n\t\t}\n\n\t\t// Return the promise for the passed element.\n\t\t// Multiple asynchronous calls of childrenLoaded for the same element should return the same promise.\n\t\treturn childrenLoadedPromises.get(element);\n\n\t};\n\n\t// Attach the synchronous function to the export for optional use.\n\tchildrenLoaded.synchronous = childrenLoadedSynchronous;\n\t// Add shorthand alias for synchronous.\n\tchildrenLoaded.sync = childrenLoaded.synchronous;\n\t// Return the asynchronous function as the export.\n\treturn childrenLoaded;\n\n})();","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import childrenLoaded from \"@alexspirgel/children-loaded\";\nclass BlocksSocialShare extends HTMLDivElement {\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tasync connectedCallback() {\n\t\tawait childrenLoaded(this);\n\t\tfor (const buttonElement of this.buttonElements) {\n\t\t\tbuttonElement.addEventListener(\"click\", this.buttonClickHandler);\n\t\t}\n\t}\n\n\tget buttonElements() {\n\t\treturn this.querySelectorAll(\".btn--social\");\n\t}\n\n\tbuttonClickHandler = (event) => {\n\t\tconst linkTarget = \"_blank\"; // try '_blank' here as well\n\t\tconst windowOptions = \"menubar=no,status=no,height=450,width=500\";\n\t\tevent.preventDefault();\n\t\tconst buttonElement = event.target;\n\t\tconsole.log(buttonElement);\n\t\tif (buttonElement) {\n\t\t\tconst url = buttonElement.getAttribute(\"data-url\");\n\t\t\tif (url) {\n\t\t\t\tconsole.log(url);\n\t\t\t\twindow.open(url, linkTarget, windowOptions);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t};\n}\n\n// function extractWindowLink() {\n// \treturn window.location.href;\n// }\n\n// function openSocialWindow(url) {\n// \tconst twitterQuery = `text=${text}&url=${link}`;\n// \treturn window.open(`${url}&`, linkTarget, windowOptions);\n// }\n\n// function registerShareButtons() {\n// \tconst buttons = Array.from(document.querySelectorAll(\"button\"));\n// \tconsole.log(buttons);\n// \tbuttons.map((button) => {\n// \t\t// const link = extractAnchorLink();\n// \t\tconsole.log(button);\n// \t});\n// \t// twitterButton.addEventListener(\"click\", () => openTwitterWindow(text, link));\n// }\n\n// console.log(\"this is working\");\n// registerShareButtons();\n\ncustomElements.define(\"block-social-share\", BlocksSocialShare, {\n\textends: \"div\",\n});\n"],"names":["module","exports","childrenLoadedPromises","WeakMap","childrenLoadedSynchronous","element","document","readyState","nextSibling","parentNode","childrenLoaded","forceNewPromise","get","childrenLoadedPromise","Promise","resolve","observer","MutationObserver","disconnect","observe","childList","set","sync","synchronous","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","obj","prop","prototype","hasOwnProperty","call","BlocksSocialShare","HTMLDivElement","constructor","super","async","this","buttonElement","buttonElements","addEventListener","buttonClickHandler","querySelectorAll","event","preventDefault","target","console","log","url","getAttribute","window","open","customElements","define","extends"],"sourceRoot":""}