1var WPRecipeMaker; 2/******/ (() => { // webpackBootstrap 3/******/ var __webpack_modules__ = ({ 4 5/***/ 3524: 6/***/ (() => { 7 8window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 9window.WPRecipeMaker.analytics = { 10 init: () => { 11 if (wprm_public.settings.analytics_enabled || wprm_public.settings.google_analytics_enabled) { 12 document.addEventListener('click', function (e) { 13 const target = e.target.closest ? e.target.closest('.wprm-recipe-jump, .wprm-recipe-jump-video, .wprm-recipe-pin, .wprm-recipe-facebook-share, .wprm-recipe-messenger-share, .wprm-recipe-twitter-share, .wprm-recipe-bluesky-share, .wprm-recipe-mastodon-share, .wprm-recipe-tumblr-share, .wprm-recipe-text-share, .wprm-recipe-whatsapp-share, .wprm-recipe-email-share, .wprm-recipe-favorite, .wprm-recipe-add-to-collection-recipe, .wprm-recipe-add-to-shopping-list, .wprm-recipe-cook-mode, .wprm-recipe-equipment a, .wprm-recipe-ingredient a, .wprm-recipe-instruction a') : false; 14 if (target) { 15 window.WPRecipeMaker.analytics.checkClick(target, e); 16 } 17 }, false); 18 } 19 }, 20 checkClick: (target, e) => { 21 if (target.matches('.wprm-recipe-jump')) { 22 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 23 if (recipeId) { 24 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'jump-to-recipe'); 25 } 26 return true; 27 } else if (target.matches('.wprm-recipe-jump-video')) { 28 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 29 if (recipeId) { 30 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'jump-to-video'); 31 } 32 return true; 33 } else if (target.matches('.wprm-recipe-pin')) { 34 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 35 if (recipeId) { 36 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'pin-button'); 37 } 38 return true; 39 } else if (target.matches('.wprm-recipe-facebook-share')) { 40 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 41 if (recipeId) { 42 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'facebook-share-button'); 43 } 44 return true; 45 } else if (target.matches('.wprm-recipe-messenger-share')) { 46 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 47 if (recipeId) { 48 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'messenger-share-button'); 49 } 50 return true; 51 } else if (target.matches('.wprm-recipe-twitter-share')) { 52 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 53 if (recipeId) { 54 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'twitter-share-button'); 55 } 56 return true; 57 } else if (target.matches('.wprm-recipe-bluesky-share')) { 58 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 59 if (recipeId) { 60 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'bluesky-share-button'); 61 } 62 return true; 63 } else if (target.matches('.wprm-recipe-mastodon-share')) { 64 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 65 if (recipeId) { 66 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'mastodon-share-button'); 67 } 68 return true; 69 } else if (target.matches('.wprm-recipe-tumblr-share')) { 70 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 71 if (recipeId) { 72 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'tumblr-share-button'); 73 } 74 return true; 75 } else if (target.matches('.wprm-recipe-text-share')) { 76 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false;
77 if (recipeId) { 78 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'text-share-button'); 79 } 80 return true; 81 } else if (target.matches('.wprm-recipe-whatsapp-share')) { 82 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 83 if (recipeId) { 84 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'whatsapp-share-button'); 85 } 86 return true; 87 } else if (target.matches('.wprm-recipe-email-share')) { 88 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 89 if (recipeId) { 90 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'email-share-button'); 91 } 92 return true; 93 } else if (target.matches('.wprm-recipe-favorite')) { 94 const recipeId = target.dataset.hasOwnProperty('recipeId') ? target.dataset.recipeId : false; 95 if (recipeId) { 96 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'favorite-button', { 97 action: target.classList.contains('wprm-recipe-favorite-active') ? 'remove' : 'add' 98 }); 99 } 100 return true; 101 } else if (target.matches('.wprm-recipe-add-to-collection-recipe')) { 102 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipeId : false; 103 if (recipeId) { 104 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'add-to-collections-button'); 105 } 106 return true; 107 } else if (target.matches('.wprm-recipe-add-to-shopping-list')) { 108 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipeId : false; 109 if (recipeId) { 110 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'add-to-shopping-list-button'); 111 } 112 return true; 113 } else if (target.matches('.wprm-recipe-cook-mode')) { 114 const recipeId = target.dataset.hasOwnProperty('recipeId') ? target.dataset.recipeId : false; 115 if (recipeId) { 116 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'cook-mode-button'); 117 } 118 return true; 119 } else if (target.matches('.wprm-recipe-equipment a')) { 120 const container = target.closest('.wprm-recipe-equipment-container'); 121 if (container) { 122 const item = target.closest('.wprm-recipe-equipment-item'); 123 const type = item && item.classList.contains('wprm-recipe-equipment-item-has-image') ? 'image' : 'text'; 124 const name = item ? item.querySelector('.wprm-recipe-equipment-name') : target; 125 const recipeId = container.dataset.recipe; 126 if (recipeId) { 127 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'equipment-link', { 128 url: target.href, 129 type, 130 name: name ? name.innerText : 'unknown' 131 }); 132 } 133 } 134 return true; 135 } else if (target.matches('.wprm-recipe-ingredient a')) { 136 const container = target.closest('.wprm-recipe-ingredients-container'); 137 138 // Get ingredient name. 139 let name = false; 140 const parent = target.closest('.wprm-recipe-ingredient'); 141 if (parent) { 142 name = parent.querySelector('.wprm-recipe-ingredient-name'); 143 } 144 if (container) { 145 const recipeId = container.dataset.recipe; 146 if (recipeId) { 147 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'ingredient-link', { 148 url: target.href, 149 name: name ? name.innerText : 'unknown' 150 }); 151 } 152 } 153 return true; 154 } else if (target.matches('.wprm-recipe-instruction a')) { 155 const container = target.closest('.wprm-recipe-instructions-container'); 156 if (container) { 157 const recipeId = container.dataset.recipe; 158 if (recipeId) { 159 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'instruction-link', { 160 url: target.href 161 }); 162 } 163 } 164 return true; 165 } 166 return false;
167 }, 168 registerAction: (recipeId, postId, type, meta = {}) => { 169 window.WPRecipeMaker.analytics.registerActionLocal(recipeId, postId, type, meta); 170 window.WPRecipeMaker.analytics.registerActionGoogleAnalytics(recipeId, postId, type, meta); 171 }, 172 registerActionOnce: (recipeId, postId, type, meta = {}) => { 173 if (window.WPRecipeMaker.analytics.registeredActions.hasOwnProperty(`recipe-${recipeId}`) && window.WPRecipeMaker.analytics.registeredActions[`recipe-${recipeId}`].hasOwnProperty(type)) { 174 // Already tracked this action for this recipe on this pageload, ignore. 175 return; 176 } 177 178 // Track action as already registered for this recipe. 179 if (!window.WPRecipeMaker.analytics.registeredActions.hasOwnProperty(`recipe-${recipeId}`)) { 180 window.WPRecipeMaker.analytics.registeredActions[`recipe-${recipeId}`] = {}; 181 } 182 window.WPRecipeMaker.analytics.registeredActions[`recipe-${recipeId}`][type] = true; 183 184 // Hadn't been tracked yet, so do it now. 185 window.WPRecipeMaker.analytics.registerAction(recipeId, postId, type, meta); 186 }, 187 registerActionLocal: (recipeId, postId, type, meta = {}) => { 188 if (wprm_public.settings.analytics_enabled) { 189 // Ignore these for local tracking, tracked in PHP. 190 if ('comment-rating' === type || 'user-rating' === type) { 191 return; 192 } 193 let headers = { 194 'Accept': 'application/json', 195 'Content-Type': 'application/json' 196 }; 197 198 // Only require nonce when logged in to prevent caching problems for regular visitors. 199 if (0 < parseInt(wprm_public.user)) { 200 headers['X-WP-Nonce'] = wprm_public.api_nonce; 201 } 202 203 // Register action through API. 204 fetch(wprm_public.endpoints.analytics, { 205 method: 'POST', 206 headers, 207 credentials: 'same-origin', 208 body: JSON.stringify({ 209 recipeId, 210 postId, 211 type, 212 meta, 213 uid: getAnalyticsVisitorId(), 214 nonce: wprm_public.nonce 215 }) 216 }); 217 } 218 }, 219 registerActionGoogleAnalytics: (recipeId, postId, type, meta = {}) => { 220 if (wprm_public.settings.google_analytics_enabled && window.hasOwnProperty('gtag')) { 221 const event = 'wprm_' + type.replace(/-/g, '_'); 222 const label = type.replace(/-/g, ' '); 223 let eventData = { 224 event_category: 'wprecipemaker', 225 event_label: 'WPRM ' + label.charAt(0).toUpperCase() + label.slice(1), 226 wprm_recipe_id: '' + recipeId, 227 wprm_post_id: '' + postId 228 }; 229 230 // Check if recipe object is available. 231 const recipe = window.WPRecipeMaker.manager.getRecipeImmediately(recipeId); 232 if (recipe) { 233 if (recipe.data.hasOwnProperty('name')) { 234 eventData.wprm_recipe_name = recipe.data.name; 235 } 236 if (recipe.data.hasOwnProperty('slug')) { 237 eventData.wprm_recipe_slug = recipe.data.slug; 238 } 239 } 240 241 // Special case for ratings. 242 if (('comment-rating' === type || 'user-rating' === type) && meta.hasOwnProperty('rating')) { 243 eventData.value = meta.rating; 244 delete meta.rating; 245 } 246 247 // Pass along other meta. 248 if (meta && 'object' === typeof meta) { 249 Object.keys(meta).forEach(key => { 250 if ('' !== meta[key] && null !== meta[key] && typeof meta[key] !== 'undefined') { 251 eventData[`wprm_event_${key}`] = '' + meta[key]; 252 } 253 }); 254 } 255 window.gtag('event', event, eventData); 256 } 257 }, 258 registeredActions: {} 259}; 260ready(() => { 261 window.WPRecipeMaker.analytics.init(); 262}); 263function ready(fn) { 264 if (document.readyState != 'loading') { 265 fn(); 266 } else { 267 document.addEventListener('DOMContentLoaded', fn); 268 } 269} 270function getCookieValue(a) { 271 var b = document.cookie.match('(^|;)\\s*' + a + '\\s*=\\s*([^;]+)'); 272 return b ? b.pop() : ''; 273} 274function getAnalyticsVisitorId() { 275 let visitorId = getCookieValue('wprm_analytics_visitor'); 276 if (!visitorId) { 277 visitorId = generateAnalyticsVisitorId();
278 setCookieValue('wprm_analytics_visitor', visitorId); 279 } 280 return visitorId; 281} 282function generateAnalyticsVisitorId() { 283 if (window.crypto && window.crypto.getRandomValues) { 284 const values = new Uint32Array(2); 285 window.crypto.getRandomValues(values); 286 return Date.now().toString(36) + values[0].toString(36) + values[1].toString(36); 287 } 288 return Date.now().toString(36) + Math.random().toString(36).substring(2, 12); 289} 290function setCookieValue(name, value) { 291 let cookie = name + '=' + encodeURIComponent(value) + '; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/; SameSite=Lax'; 292 if ('https:' === window.location.protocol) { 293 cookie += '; Secure'; 294 } 295 document.cookie = cookie; 296} 297 298/***/ }), 299 300/***/ 8455: 301/***/ (() => { 302 303window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 304window.WPRecipeMaker.manager = { 305 init: () => {}, 306 recipes: {}, 307 findRecipesOnPage: () => { 308 let recipes = []; 309 const potentialRecipes = document.querySelectorAll('*[data-recipe-id]'); 310 for (let potentialRecipe of potentialRecipes) { 311 const id = parseInt(potentialRecipe.dataset.recipeId); 312 if (id) { 313 recipes.push(id); 314 } 315 } 316 317 // Return unique IDs. 318 return [...new Set(recipes)]; 319 }, 320 resetRecipe: id => { 321 if (window.WPRecipeMaker.manager.recipes.hasOwnProperty(`recipe-${id}`)) { 322 delete window.WPRecipeMaker.manager.recipes[`recipe-${id}`]; 323 } 324 }, 325 getRecipe: (id, loadDifferentId = false) => { 326 id = 'preview' === id ? id : parseInt(id); 327 if (!window.WPRecipeMaker.manager.recipes.hasOwnProperty(`recipe-${id}`)) { 328 return window.WPRecipeMaker.manager.loadRecipe(id, loadDifferentId); 329 } 330 return Promise.resolve(window.WPRecipeMaker.manager.recipes[`recipe-${id}`]); 331 }, 332 getRecipeImmediately: id => { 333 id = 'preview' === id ? id : parseInt(id); 334 let recipe = window.WPRecipeMaker.manager.recipes.hasOwnProperty(`recipe-${id}`) ? window.WPRecipeMaker.manager.recipes[`recipe-${id}`] : false; 335 336 // Check if data does not need to be loaded through API. 337 if (!recipe) { 338 if (window.hasOwnProperty('wprm_recipes') && window.wprm_recipes.hasOwnProperty(`recipe-${id}`)) { 339 const recipeData = window.wprm_recipes[`recipe-${id}`]; 340 recipe = window.WPRecipeMaker.manager.loadRecipeObject(id, recipeData); 341 window.WPRecipeMaker.manager.recipes[`recipe-${id}`] = recipe; 342 } 343 } 344 return recipe; 345 }, 346 loadRecipe: (id, loadDifferentId = false) => { 347 return new Promise((resolveRecipe, rejectRecipe) => { 348 // Check for data added in PHP of try loading through API. 349 const getRecipeData = new Promise((resolveData, rejectData) => { 350 const idToGetDataFor = loadDifferentId ? loadDifferentId : id; 351 if (window.hasOwnProperty('wprm_recipes') && window.wprm_recipes.hasOwnProperty(`recipe-${idToGetDataFor}`)) { 352 resolveData(window.wprm_recipes[`recipe-${idToGetDataFor}`]); 353 } else { 354 window.WPRecipeMaker.manager.loadRecipeDataFromAPI(idToGetDataFor).then(result => { 355 resolveData(result); 356 }); 357 } 358 }); 359 getRecipeData.then(recipeData => { 360 // Create recipe object from recipe data. 361 let recipe = false; 362 if (recipeData) { 363 recipe = window.WPRecipeMaker.manager.loadRecipeObject(id, recipeData); 364 } 365 window.WPRecipeMaker.manager.recipes[`recipe-${id}`] = recipe; 366 resolveRecipe(recipe); 367 }); 368 }); 369 }, 370 loadRecipeDataFromAPI: id => { 371 let headers = { 372 'Accept': 'application/json', 373 'Content-Type': 'application/json' 374 }; 375 376 // Only require nonce when logged in to prevent caching problems for regular visitors. 377 if (0 < parseInt(wprm_public.user)) { 378 headers['X-WP-Nonce'] = wprm_public.api_nonce; 379 } 380 return new Promise((resolve, reject) => { 381 fetch(`${wprm_public.endpoints.manage}/recipe/${id}`, { 382 method: 'POST', 383 headers, 384 credentials: 'same-origin', 385 body: JSON.stringify({ 386 format: 'frontend' 387 }) 388 }).then(response => { 389 if (response.ok) { 390 return response.json(); 391 } 392 return false;
393 }).then(result => { 394 resolve(result); 395 }); 396 }); 397 }, 398 loadRecipeObject: (id, data) => { 399 let recipe = { 400 id, 401 data, 402 // Functions to be overwritten. Define here to prevent errors. 403 setServings: (...args) => {}, 404 setAdvancedServings: (...args) => {}, 405 setUnitSystem: (...args) => {}, 406 addRating: (...args) => {} 407 }; 408 409 // Check if premium is active and should add functionality. 410 if (window.WPRecipeMaker.hasOwnProperty('managerPremium')) { 411 recipe = window.WPRecipeMaker.managerPremium.loadRecipeObject(id, recipe); 412 } 413 return recipe; 414 }, 415 triggerChangeEvent: (id, type) => { 416 document.dispatchEvent(new CustomEvent('wprm-recipe-change', { 417 detail: { 418 id, 419 type 420 } 421 })); 422 }, 423 changeRecipeData: (id, data) => { 424 if (window.WPRecipeMaker.manager.recipes.hasOwnProperty(`recipe-${id}`)) { 425 window.WPRecipeMaker.manager.recipes[`recipe-${id}`].data = { 426 ...window.WPRecipeMaker.manager.recipes[`recipe-${id}`].data, 427 ...data 428 }; 429 430 // Raw data change event. 431 document.dispatchEvent(new CustomEvent('wprm-recipe-change-data', { 432 detail: { 433 id 434 } 435 })); 436 } 437 } 438}; 439ready(() => { 440 window.WPRecipeMaker.manager.init(); 441}); 442function ready(fn) { 443 if (document.readyState != 'loading') { 444 fn(); 445 } else { 446 document.addEventListener('DOMContentLoaded', fn); 447 } 448} 449 450/***/ }), 451 452/***/ 3579: 453/***/ (() => { 454 455window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 456window.WPRecipeMaker.print = { 457 hasAccess: () => { 458 if (wprm_public.settings.hasOwnProperty('print_access_allowed')) { 459 return !!wprm_public.settings.print_access_allowed; 460 } 461 const access = wprm_public.settings.hasOwnProperty('print_access') ? wprm_public.settings.print_access : 'everyone'; 462 if ('disabled' === access) { 463 return false; 464 } 465 if ('logged_in' === access && 0 >= parseInt(wprm_public.user)) { 466 return false; 467 } 468 return true; 469 }, 470 init: () => { 471 document.addEventListener('click', function (e) { 472 const target = e.target.closest ? e.target.closest('.wprm-recipe-print, .wprm-print-recipe-shortcode') : false; 473 if (target) { 474 WPRecipeMaker.print.onClick(target, e); 475 } 476 }, false); 477 }, 478 onClick: (el, e) => { 479 if (!WPRecipeMaker.print.hasAccess()) { 480 e.preventDefault(); 481 return; 482 } 483 let recipeId = el.dataset.recipeId; 484 485 // Backwards compatibility. 486 if (!recipeId) { 487 const container = el.closest('.wprm-recipe-container'); 488 if (container) { 489 recipeId = container.dataset.recipeId; 490 } 491 } 492 493 // Still no recipe ID? Just follow the link. Override otherwise. 494 if (recipeId) { 495 e.preventDefault(); 496 recipeId = parseInt(recipeId); 497 498 // Optional template to print. 499 const template = el.dataset.hasOwnProperty('template') ? el.dataset.template : ''; 500 501 // Analytics. 502 let location = 'other'; 503 const parent = el.closest('.wprm-recipe'); 504 if (parent) { 505 if (parent.classList.contains('wprm-recipe-snippet')) { 506 location = 'snippet'; 507 } else if (parent.classList.contains('wprm-recipe-roundup-item')) { 508 location = 'roundup'; 509 } else { 510 location = 'recipe'; 511 } 512 } 513 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'print', { 514 location 515 }); 516 517 // Actually print. 518 WPRecipeMaker.print.recipeAsIs(recipeId, template); 519 } 520 }, 521 recipeAsIs: (id, template = '') => { 522 let servings = false, 523 system = 1, 524 advancedServings = false; 525 window.WPRecipeMaker.manager.getRecipe(id).then(recipe => { 526 if (recipe) { 527 // Unit System. 528 if (recipe.data.hasOwnProperty('currentSystem')) { 529 system = recipe.data.currentSystem; 530 } 531 532 // Only if servings changed. 533 if (recipe.data.currentServingsParsed !== recipe.data.originalServingsParsed) { 534 servings = recipe.data.currentServingsParsed; 535 } 536 537 // Advanced Servings. 538 advancedServings = recipe.data.currentAdvancedServings; 539 } 540 WPRecipeMaker.print.recipe(id, servings, system, advancedServings, template); 541 }); 542 }, 543 recipe: (id, servings = false, system = 1, advancedServings = false, template = '') => { 544 let slug = false;
545 if ('slug' === wprm_public.settings.print_recipe_identifier) { 546 const recipe = window.WPRecipeMaker.manager.getRecipeImmediately(id); 547 if (recipe && recipe.data.slug) { 548 slug = recipe.data.slug; 549 550 // Remove optional wprm- prefix. 551 if (slug.startsWith('wprm-')) { 552 slug = slug.substring(5); 553 } 554 } 555 } 556 557 // Use slug in print URL if set. 558 let urlArgs = slug ? slug : id; 559 if (template) { 560 urlArgs += `/${template}`; 561 } 562 const url = WPRecipeMaker.print.getUrl(urlArgs); 563 if (!url) { 564 return; 565 } 566 const target = wprm_public.settings.print_new_tab ? '_blank' : '_self'; 567 568 // Pass along data to print window before opening it. 569 const printArgs = { 570 id, 571 system, 572 servings, 573 advancedServings 574 }; 575 localStorage.setItem('wprmPrintArgs', JSON.stringify(printArgs)); 576 577 // Open print window. 578 const printWindow = window.open(url, target); 579 580 // Focus on print window when opening in new tab. 581 if ('_blank' === target) { 582 printWindow.onload = () => { 583 printWindow.focus(); 584 if (printWindow.hasOwnProperty('WPRMPrint')) { 585 printWindow.WPRMPrint.setArgs(printArgs); 586 } 587 }; 588 } 589 }, 590 getUrl: args => { 591 if (!WPRecipeMaker.print.hasAccess()) { 592 return false; 593 } 594 const urlParts = wprm_public.home_url.split(/\?(.+)/); 595 596 // Ensure base URL always has a trailing slash before appending the slug. 597 let printUrl = urlParts[0]; 598 if (!printUrl.endsWith('/')) { 599 printUrl += '/'; 600 } 601 if (wprm_public.permalinks) { 602 printUrl += wprm_public.print_slug + '/' + args; 603 if (urlParts[1]) { 604 printUrl += '?' + urlParts[1]; 605 } 606 } else { 607 printUrl += '?' + wprm_public.print_slug + '=' + args; 608 if (urlParts[1]) { 609 printUrl += '&' + urlParts[1]; 610 } 611 } 612 return printUrl; 613 } 614}; 615ready(() => { 616 window.WPRecipeMaker.print.init(); 617}); 618function ready(fn) { 619 if (document.readyState != 'loading') { 620 fn(); 621 } else { 622 document.addEventListener('DOMContentLoaded', fn); 623 } 624} 625 626/***/ }), 627 628/***/ 1104: 629/***/ (() => { 630 631window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 632window.WPRecipeMaker.recipe = { 633 init: () => { 634 window.addEventListener('wpupgInitReady', function (e) { 635 const grid = e.detail; 636 window.WPRecipeMaker.recipe.wpupgGridCompatibility(grid); 637 }); 638 }, 639 wpupgGridCompatibility: grid => { 640 if (grid) { 641 grid.on('itemsLoaded', () => { 642 window.WPRecipeMaker.recipe.initFeatures(); 643 }); 644 } 645 }, 646 initFeatures: (args = {}) => { 647 // If we're initting a specific recipe, reset it first. 648 if (args.hasOwnProperty('id')) { 649 window.WPRecipeMaker.manager.resetRecipe(args.id); 650 } 651 if (window.WPRecipeMaker) { 652 if (window.WPRecipeMaker.hasOwnProperty('advancedServings')) { 653 window.WPRecipeMaker.advancedServings.init(); 654 } 655 if (window.WPRecipeMaker.hasOwnProperty('quantities')) { 656 window.WPRecipeMaker.quantities.init(); 657 if (args.hasOwnProperty('id')) { 658 if (args.hasOwnProperty('servings')) { 659 const servings = parseInt(args.servings); 660 if (servings) { 661 setTimeout(() => { 662 window.WPRecipeMaker.quantities.setServings(args.id, servings); 663 }, 100); 664 } 665 } 666 } 667 } 668 if (window.WPRecipeMaker.hasOwnProperty('instacart')) { 669 window.WPRecipeMaker.instacart.init(); 670 } 671 if (window.WPRecipeMaker.hasOwnProperty('jumpToSection')) { 672 window.WPRecipeMaker.jumpToSection.init(); 673 } 674 if (window.WPRecipeMaker.hasOwnProperty('timer')) { 675 window.WPRecipeMaker.timer.init(); 676 } 677 if (window.WPRecipeMaker.hasOwnProperty('preventSleep')) { 678 window.WPRecipeMaker.preventSleep.init(); 679 } 680 if (window.WPRecipeMaker.hasOwnProperty('privateNotes')) { 681 window.WPRecipeMaker.privateNotes.init(); 682 } 683 if (window.WPRecipeMaker.hasOwnProperty('tooltip')) { 684 window.WPRecipeMaker.tooltip.init(); 685 } 686 if (window.WPRecipeMaker.hasOwnProperty('video')) { 687 if (wprm_public.settings.video_force_ratio) { 688 window.WPRecipeMaker.video.init(); 689 } 690 } 691 } 692 document.dispatchEvent(new CustomEvent('wprmRecipeInit', { 693 detail: args 694 })); 695 } 696}; 697 698// Don't wait for DOMContentLoaded. Listener needs to be added as soon as possible. 699window.WPRecipeMaker.recipe.init(); 700 701/***/ }), 702 703/***/ 9002: 704/***/ (() => { 705 706window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 707window.WPRecipeMaker.temperature = { 708 getTemperatures() { 709 let temperatures = []; 710 const containers = document.querySelectorAll('.wprm-temperature-container');
vendor: 9,884 bytes, lines 711-1044
711 for (let container of containers) { 712 temperatures.push(WPRecipeMaker.temperature.getData(container)); 713 } 714 return temperatures; 715 }, 716 getData(container) { 717 return { 718 container, 719 value: container.dataset.value, 720 unit: container.dataset.unit, 721 help: container.dataset.tooltip 722 }; 723 } 724}; 725 726/***/ }), 727 728/***/ 4181: 729/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 730 731"use strict"; 732 733// EXPORTS 734__webpack_require__.d(__webpack_exports__, { 735 Ay: () => (/* binding */ tippy_esm), 736 DX: () => (/* binding */ inlinePositioning) 737}); 738 739// UNUSED EXPORTS: animateFill, createSingleton, delegate, followCursor, hideAll, roundArrow, sticky 740 741;// ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js 742function getWindow(node) { 743 if (node == null) { 744 return window; 745 } 746 747 if (node.toString() !== '[object Window]') { 748 var ownerDocument = node.ownerDocument; 749 return ownerDocument ? ownerDocument.defaultView || window : window; 750 } 751 752 return node; 753} 754;// ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js 755 756 757function isElement(node) { 758 var OwnElement = getWindow(node).Element; 759 return node instanceof OwnElement || node instanceof Element; 760} 761 762function isHTMLElement(node) { 763 var OwnElement = getWindow(node).HTMLElement; 764 return node instanceof OwnElement || node instanceof HTMLElement; 765} 766 767function isShadowRoot(node) { 768 // IE 11 has no ShadowRoot 769 if (typeof ShadowRoot === 'undefined') { 770 return false; 771 } 772 773 var OwnElement = getWindow(node).ShadowRoot; 774 return node instanceof OwnElement || node instanceof ShadowRoot; 775} 776 777 778;// ./node_modules/@popperjs/core/lib/utils/math.js 779var math_max = Math.max; 780var math_min = Math.min; 781var round = Math.round; 782;// ./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js 783 784 785function getBoundingClientRect(element, includeScale) { 786 if (includeScale === void 0) { 787 includeScale = false; 788 } 789 790 var rect = element.getBoundingClientRect(); 791 var scaleX = 1; 792 var scaleY = 1; 793 794 if (isHTMLElement(element) && includeScale) { 795 var offsetHeight = element.offsetHeight; 796 var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale 797 // Fallback to 1 in case both values are `0` 798 799 if (offsetWidth > 0) { 800 scaleX = round(rect.width) / offsetWidth || 1; 801 } 802 803 if (offsetHeight > 0) { 804 scaleY = round(rect.height) / offsetHeight || 1; 805 } 806 } 807 808 return { 809 width: rect.width / scaleX, 810 height: rect.height / scaleY, 811 top: rect.top / scaleY, 812 right: rect.right / scaleX, 813 bottom: rect.bottom / scaleY, 814 left: rect.left / scaleX, 815 x: rect.left / scaleX, 816 y: rect.top / scaleY 817 }; 818} 819;// ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js 820 821function getWindowScroll(node) { 822 var win = getWindow(node); 823 var scrollLeft = win.pageXOffset; 824 var scrollTop = win.pageYOffset; 825 return { 826 scrollLeft: scrollLeft, 827 scrollTop: scrollTop 828 }; 829} 830;// ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js 831function getHTMLElementScroll(element) { 832 return { 833 scrollLeft: element.scrollLeft, 834 scrollTop: element.scrollTop 835 }; 836} 837;// ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js 838 839 840 841 842function getNodeScroll(node) { 843 if (node === getWindow(node) || !isHTMLElement(node)) { 844 return getWindowScroll(node); 845 } else { 846 return getHTMLElementScroll(node); 847 } 848} 849;// ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js 850function getNodeName(element) { 851 return element ? (element.nodeName || '').toLowerCase() : null; 852} 853;// ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js 854 855function getDocumentElement(element) { 856 // $FlowFixMe[incompatible-return]: assume body is always available 857 return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] 858 element.document) || window.document).documentElement; 859} 860;// ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js 861 862 863 864function getWindowScrollBarX(element) { 865 // If <html> has a CSS width greater than the viewport, then this will be 866 // incorrect for RTL. 867 // Popper 1 is broken in this case and never had a bug report so let's assume 868 // it's not an issue. I don't think anyone ever specifies width on <html> 869 // anyway. 870 // Browsers where the left scrollbar doesn't cause an issue report `0` for 871 // this (e.g. Edge 2019, IE11, Safari) 872 return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; 873} 874;// ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js 875 876function getComputedStyle(element) { 877 return getWindow(element).getComputedStyle(element); 878} 879;// ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js 880 881function isScrollParent(element) { 882 // Firefox wants us to check `-x` and `-y` variations as well 883 var _getComputedStyle = getComputedStyle(element), 884 overflow = _getComputedStyle.overflow, 885 overflowX = _getComputedStyle.overflowX, 886 overflowY = _getComputedStyle.overflowY; 887 888 return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); 889} 890;// ./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js 891 892 893 894 895 896 897 898 899 900function isElementScaled(element) { 901 var rect = element.getBoundingClientRect(); 902 var scaleX = round(rect.width) / element.offsetWidth || 1; 903 var scaleY = round(rect.height) / element.offsetHeight || 1; 904 return scaleX !== 1 || scaleY !== 1; 905} // Returns the composite rect of an element relative to its offsetParent. 906// Composite means it takes into account transforms as well as layout. 907 908 909function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { 910 if (isFixed === void 0) { 911 isFixed = false; 912 } 913 914 var isOffsetParentAnElement = isHTMLElement(offsetParent); 915 var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); 916 var documentElement = getDocumentElement(offsetParent); 917 var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled); 918 var scroll = { 919 scrollLeft: 0, 920 scrollTop: 0 921 }; 922 var offsets = { 923 x: 0, 924 y: 0 925 }; 926 927 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 928 if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 929 isScrollParent(documentElement)) { 930 scroll = getNodeScroll(offsetParent); 931 } 932 933 if (isHTMLElement(offsetParent)) { 934 offsets = getBoundingClientRect(offsetParent, true); 935 offsets.x += offsetParent.clientLeft; 936 offsets.y += offsetParent.clientTop; 937 } else if (documentElement) { 938 offsets.x = getWindowScrollBarX(documentElement); 939 } 940 } 941 942 return { 943 x: rect.left + scroll.scrollLeft - offsets.x, 944 y: rect.top + scroll.scrollTop - offsets.y, 945 width: rect.width, 946 height: rect.height 947 }; 948} 949;// ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js 950 // Returns the layout rect of an element relative to its offsetParent. Layout 951// means it doesn't take into account transforms. 952 953function getLayoutRect(element) { 954 var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. 955 // Fixes https://github.com/popperjs/popper-core/issues/1223 956 957 var width = element.offsetWidth; 958 var height = element.offsetHeight; 959 960 if (Math.abs(clientRect.width - width) <= 1) { 961 width = clientRect.width; 962 } 963 964 if (Math.abs(clientRect.height - height) <= 1) { 965 height = clientRect.height; 966 } 967 968 return { 969 x: element.offsetLeft, 970 y: element.offsetTop, 971 width: width, 972 height: height 973 }; 974} 975;// ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js 976 977 978 979function getParentNode(element) { 980 if (getNodeName(element) === 'html') { 981 return element; 982 } 983 984 return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle 985 // $FlowFixMe[incompatible-return] 986 // $FlowFixMe[prop-missing] 987 element.assignedSlot || // step into the shadow DOM of the parent of a slotted node 988 element.parentNode || ( // DOM Element detected 989 isShadowRoot(element) ? element.host : null) || // ShadowRoot detected 990 // $FlowFixMe[incompatible-call]: HTMLElement is a Node 991 getDocumentElement(element) // fallback 992 993 ); 994} 995;// ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js 996 997 998 999 1000function getScrollParent(node) { 1001 if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { 1002 // $FlowFixMe[incompatible-return]: assume body is always available 1003 return node.ownerDocument.body; 1004 } 1005 1006 if (isHTMLElement(node) && isScrollParent(node)) { 1007 return node; 1008 } 1009 1010 return getScrollParent(getParentNode(node)); 1011} 1012;// ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js 1013 1014 1015 1016 1017/* 1018given a DOM element, return the list of all scroll parents, up the list of ancesors 1019until we get to the top window object. This list is what we attach scroll listeners 1020to, because if any of these parent elements scroll, we'll need to re-calculate the 1021reference element's position. 1022*/ 1023 1024function listScrollParents(element, list) { 1025 var _element$ownerDocumen; 1026 1027 if (list === void 0) { 1028 list = []; 1029 } 1030 1031 var scrollParent = getScrollParent(element); 1032 var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); 1033 var win = getWindow(scrollParent); 1034 var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; 1035 var updatedList = list.concat(target); 1036 return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here 1037 updatedList.concat(listScrollParents(getParentNode(target))); 1038} 1039;// ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js 1040 1041function isTableElement(element) { 1042 return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; 1043} 1044;
vendor: 4,129 bytes, lines 1044-1158
1044// ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js 1045 1046 1047 1048 1049 1050 1051 1052function getTrueOffsetParent(element) { 1053 if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 1054 getComputedStyle(element).position === 'fixed') { 1055 return null; 1056 } 1057 1058 return element.offsetParent; 1059} // `.offsetParent` reports `null` for fixed elements, while absolute elements 1060// return the containing block 1061 1062 1063function getContainingBlock(element) { 1064 var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1; 1065 var isIE = navigator.userAgent.indexOf('Trident') !== -1; 1066 1067 if (isIE && isHTMLElement(element)) { 1068 // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport 1069 var elementCss = getComputedStyle(element); 1070 1071 if (elementCss.position === 'fixed') { 1072 return null; 1073 } 1074 } 1075 1076 var currentNode = getParentNode(element); 1077 1078 if (isShadowRoot(currentNode)) { 1079 currentNode = currentNode.host; 1080 } 1081 1082 while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { 1083 var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that 1084 // create a containing block. 1085 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 1086 1087 if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { 1088 return currentNode; 1089 } else { 1090 currentNode = currentNode.parentNode; 1091 } 1092 } 1093 1094 return null; 1095} // Gets the closest ancestor positioned element. Handles some edge cases, 1096// such as table ancestors and cross browser bugs. 1097 1098 1099function getOffsetParent(element) { 1100 var window = getWindow(element); 1101 var offsetParent = getTrueOffsetParent(element); 1102 1103 while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') { 1104 offsetParent = getTrueOffsetParent(offsetParent); 1105 } 1106 1107 if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) { 1108 return window; 1109 } 1110 1111 return offsetParent || getContainingBlock(element) || window; 1112} 1113;// ./node_modules/@popperjs/core/lib/enums.js 1114var enums_top = 'top'; 1115var bottom = 'bottom'; 1116var right = 'right'; 1117var left = 'left'; 1118var auto = 'auto'; 1119var basePlacements = [enums_top, bottom, right, left]; 1120var start = 'start'; 1121var end = 'end'; 1122var clippingParents = 'clippingParents'; 1123var viewport = 'viewport'; 1124var popper = 'popper'; 1125var reference = 'reference'; 1126var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { 1127 return acc.concat([placement + "-" + start, placement + "-" + end]); 1128}, []); 1129var enums_placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { 1130 return acc.concat([placement, placement + "-" + start, placement + "-" + end]); 1131}, []); // modifiers that need to read the DOM 1132 1133var beforeRead = 'beforeRead'; 1134var read = 'read'; 1135var afterRead = 'afterRead'; // pure-logic modifiers 1136 1137var beforeMain = 'beforeMain'; 1138var main = 'main'; 1139var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) 1140 1141var beforeWrite = 'beforeWrite'; 1142var write = 'write'; 1143var afterWrite = 'afterWrite'; 1144var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; 1145;// ./node_modules/@popperjs/core/lib/utils/orderModifiers.js 1146 // source: https://stackoverflow.com/questions/49875255 1147 1148function order(modifiers) { 1149 var map = new Map(); 1150 var visited = new Set(); 1151 var result = []; 1152 modifiers.forEach(function (modifier) { 1153 map.set(modifier.name, modifier); 1154 }); // On visiting object, check for its dependencies and visit them recursively 1155 1156 function sort(modifier) { 1157 visited.add(modifier.name); 1158 var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
vendor: 8,477 bytes, lines 1159-1408
1159 requires.forEach(function (dep) { 1160 if (!visited.has(dep)) { 1161 var depModifier = map.get(dep); 1162 1163 if (depModifier) { 1164 sort(depModifier); 1165 } 1166 } 1167 }); 1168 result.push(modifier); 1169 } 1170 1171 modifiers.forEach(function (modifier) { 1172 if (!visited.has(modifier.name)) { 1173 // check for visited object 1174 sort(modifier); 1175 } 1176 }); 1177 return result; 1178} 1179 1180function orderModifiers(modifiers) { 1181 // order based on dependencies 1182 var orderedModifiers = order(modifiers); // order based on phase 1183 1184 return modifierPhases.reduce(function (acc, phase) { 1185 return acc.concat(orderedModifiers.filter(function (modifier) { 1186 return modifier.phase === phase; 1187 })); 1188 }, []); 1189} 1190;// ./node_modules/@popperjs/core/lib/utils/debounce.js 1191function debounce(fn) { 1192 var pending; 1193 return function () { 1194 if (!pending) { 1195 pending = new Promise(function (resolve) { 1196 Promise.resolve().then(function () { 1197 pending = undefined; 1198 resolve(fn()); 1199 }); 1200 }); 1201 } 1202 1203 return pending; 1204 }; 1205} 1206;// ./node_modules/@popperjs/core/lib/utils/mergeByName.js 1207function mergeByName(modifiers) { 1208 var merged = modifiers.reduce(function (merged, current) { 1209 var existing = merged[current.name]; 1210 merged[current.name] = existing ? Object.assign({}, existing, current, { 1211 options: Object.assign({}, existing.options, current.options), 1212 data: Object.assign({}, existing.data, current.data) 1213 }) : current; 1214 return merged; 1215 }, {}); // IE11 does not support Object.values 1216 1217 return Object.keys(merged).map(function (key) { 1218 return merged[key]; 1219 }); 1220} 1221;// ./node_modules/@popperjs/core/lib/createPopper.js 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; 1237var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; 1238var DEFAULT_OPTIONS = { 1239 placement: 'bottom', 1240 modifiers: [], 1241 strategy: 'absolute' 1242}; 1243 1244function areValidElements() { 1245 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 1246 args[_key] = arguments[_key]; 1247 } 1248 1249 return !args.some(function (element) { 1250 return !(element && typeof element.getBoundingClientRect === 'function'); 1251 }); 1252} 1253 1254function popperGenerator(generatorOptions) { 1255 if (generatorOptions === void 0) { 1256 generatorOptions = {}; 1257 } 1258 1259 var _generatorOptions = generatorOptions, 1260 _generatorOptions$def = _generatorOptions.defaultModifiers, 1261 defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, 1262 _generatorOptions$def2 = _generatorOptions.defaultOptions, 1263 defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; 1264 return function createPopper(reference, popper, options) { 1265 if (options === void 0) { 1266 options = defaultOptions; 1267 } 1268 1269 var state = { 1270 placement: 'bottom', 1271 orderedModifiers: [], 1272 options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), 1273 modifiersData: {}, 1274 elements: { 1275 reference: reference, 1276 popper: popper 1277 }, 1278 attributes: {}, 1279 styles: {} 1280 }; 1281 var effectCleanupFns = []; 1282 var isDestroyed = false; 1283 var instance = { 1284 state: state, 1285 setOptions: function setOptions(setOptionsAction) { 1286 var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; 1287 cleanupModifierEffects(); 1288 state.options = Object.assign({}, defaultOptions, state.options, options); 1289 state.scrollParents = { 1290 reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], 1291 popper: listScrollParents(popper) 1292 }; // Orders the modifiers based on their dependencies and `phase` 1293 // properties 1294 1295 var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers 1296 1297 state.orderedModifiers = orderedModifiers.filter(function (m) { 1298 return m.enabled; 1299 }); // Validate the provided modifiers so that the consumer will get warned 1300 // if one of the modifiers is invalid for any reason 1301 1302 if (false) { var _getComputedStyle, marginTop, marginRight, marginBottom, marginLeft, flipModifier, modifiers; } 1303 1304 runModifierEffects(); 1305 return instance.update(); 1306 }, 1307 // Sync update â it will always be executed, even if not necessary. This 1308 // is useful for low frequency updates where sync behavior simplifies the 1309 // logic. 1310 // For high frequency updates (e.g. `resize` and `scroll` events), always 1311 // prefer the async Popper#update method 1312 forceUpdate: function forceUpdate() { 1313 if (isDestroyed) { 1314 return; 1315 } 1316 1317 var _state$elements = state.elements, 1318 reference = _state$elements.reference, 1319 popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements 1320 // anymore 1321 1322 if (!areValidElements(reference, popper)) { 1323 if (false) {} 1324 1325 return; 1326 } // Store the reference and popper rects to be read by modifiers 1327 1328 1329 state.rects = { 1330 reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), 1331 popper: getLayoutRect(popper) 1332 }; // Modifiers have the ability to reset the current update cycle. The 1333 // most common use case for this is the `flip` modifier changing the 1334 // placement, which then needs to re-run all the modifiers, because the 1335 // logic was previously ran for the previous placement and is therefore 1336 // stale/incorrect 1337 1338 state.reset = false; 1339 state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier 1340 // is filled with the initial data specified by the modifier. This means 1341 // it doesn't persist and is fresh on each update. 1342 // To ensure persistent data, use `${name}#persistent` 1343 1344 state.orderedModifiers.forEach(function (modifier) { 1345 return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); 1346 }); 1347 var __debug_loops__ = 0; 1348 1349 for (var index = 0; index < state.orderedModifiers.length; index++) { 1350 if (false) {} 1351 1352 if (state.reset === true) { 1353 state.reset = false; 1354 index = -1; 1355 continue; 1356 } 1357 1358 var _state$orderedModifie = state.orderedModifiers[index], 1359 fn = _state$orderedModifie.fn, 1360 _state$orderedModifie2 = _state$orderedModifie.options, 1361 _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, 1362 name = _state$orderedModifie.name; 1363 1364 if (typeof fn === 'function') { 1365 state = fn({ 1366 state: state, 1367 options: _options, 1368 name: name, 1369 instance: instance 1370 }) || state; 1371 } 1372 } 1373 }, 1374 // Async and optimistically optimized update â it will not be executed if 1375 // not necessary (debounced to run at most once-per-tick) 1376 update: debounce(function () { 1377 return new Promise(function (resolve) { 1378 instance.forceUpdate(); 1379 resolve(state); 1380 }); 1381 }), 1382 destroy: function destroy() { 1383 cleanupModifierEffects(); 1384 isDestroyed = true; 1385 } 1386 }; 1387 1388 if (!areValidElements(reference, popper)) { 1389 if (false) {} 1390 1391 return instance; 1392 } 1393 1394 instance.setOptions(options).then(function (state) { 1395 if (!isDestroyed && options.onFirstUpdate) { 1396 options.onFirstUpdate(state); 1397 } 1398 }); // Modifiers have the ability to execute arbitrary code before the first 1399 // update cycle runs. They will be executed in the same order as the update 1400 // cycle. This is useful when a modifier adds some persistent data that 1401 // other modifiers need to use, but the modifier is run after the dependent 1402 // one. 1403 1404 function runModifierEffects() { 1405 state.orderedModifiers.forEach(function (_ref3) { 1406 var name = _ref3.name, 1407 _ref3$options = _ref3.options, 1408 options = _ref3$options === void 0 ? {}
vendor: 14,756 bytes, lines 1408-1925
1408 : _ref3$options, 1409 effect = _ref3.effect; 1410 1411 if (typeof effect === 'function') { 1412 var cleanupFn = effect({ 1413 state: state, 1414 name: name, 1415 instance: instance, 1416 options: options 1417 }); 1418 1419 var noopFn = function noopFn() {}; 1420 1421 effectCleanupFns.push(cleanupFn || noopFn); 1422 } 1423 }); 1424 } 1425 1426 function cleanupModifierEffects() { 1427 effectCleanupFns.forEach(function (fn) { 1428 return fn(); 1429 }); 1430 effectCleanupFns = []; 1431 } 1432 1433 return instance; 1434 }; 1435} 1436var createPopper = /*#__PURE__*/(/* unused pure expression or super */ null && (popperGenerator())); // eslint-disable-next-line import/no-unused-modules 1437 1438 1439;// ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js 1440 // eslint-disable-next-line import/no-unused-modules 1441 1442var passive = { 1443 passive: true 1444}; 1445 1446function effect(_ref) { 1447 var state = _ref.state, 1448 instance = _ref.instance, 1449 options = _ref.options; 1450 var _options$scroll = options.scroll, 1451 scroll = _options$scroll === void 0 ? true : _options$scroll, 1452 _options$resize = options.resize, 1453 resize = _options$resize === void 0 ? true : _options$resize; 1454 var window = getWindow(state.elements.popper); 1455 var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); 1456 1457 if (scroll) { 1458 scrollParents.forEach(function (scrollParent) { 1459 scrollParent.addEventListener('scroll', instance.update, passive); 1460 }); 1461 } 1462 1463 if (resize) { 1464 window.addEventListener('resize', instance.update, passive); 1465 } 1466 1467 return function () { 1468 if (scroll) { 1469 scrollParents.forEach(function (scrollParent) { 1470 scrollParent.removeEventListener('scroll', instance.update, passive); 1471 }); 1472 } 1473 1474 if (resize) { 1475 window.removeEventListener('resize', instance.update, passive); 1476 } 1477 }; 1478} // eslint-disable-next-line import/no-unused-modules 1479 1480 1481/* harmony default export */ const eventListeners = ({ 1482 name: 'eventListeners', 1483 enabled: true, 1484 phase: 'write', 1485 fn: function fn() {}, 1486 effect: effect, 1487 data: {} 1488}); 1489;// ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js 1490 1491function getBasePlacement(placement) { 1492 return placement.split('-')[0]; 1493} 1494;// ./node_modules/@popperjs/core/lib/utils/getVariation.js 1495function getVariation(placement) { 1496 return placement.split('-')[1]; 1497} 1498;// ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js 1499function getMainAxisFromPlacement(placement) { 1500 return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; 1501} 1502;// ./node_modules/@popperjs/core/lib/utils/computeOffsets.js 1503 1504 1505 1506 1507function computeOffsets(_ref) { 1508 var reference = _ref.reference, 1509 element = _ref.element, 1510 placement = _ref.placement; 1511 var basePlacement = placement ? getBasePlacement(placement) : null; 1512 var variation = placement ? getVariation(placement) : null; 1513 var commonX = reference.x + reference.width / 2 - element.width / 2; 1514 var commonY = reference.y + reference.height / 2 - element.height / 2; 1515 var offsets; 1516 1517 switch (basePlacement) { 1518 case enums_top: 1519 offsets = { 1520 x: commonX, 1521 y: reference.y - element.height 1522 }; 1523 break; 1524 1525 case bottom: 1526 offsets = { 1527 x: commonX, 1528 y: reference.y + reference.height 1529 }; 1530 break; 1531 1532 case right: 1533 offsets = { 1534 x: reference.x + reference.width, 1535 y: commonY 1536 }; 1537 break; 1538 1539 case left: 1540 offsets = { 1541 x: reference.x - element.width, 1542 y: commonY 1543 }; 1544 break; 1545 1546 default: 1547 offsets = { 1548 x: reference.x, 1549 y: reference.y 1550 }; 1551 } 1552 1553 var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; 1554 1555 if (mainAxis != null) { 1556 var len = mainAxis === 'y' ? 'height' : 'width'; 1557 1558 switch (variation) { 1559 case start: 1560 offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); 1561 break; 1562 1563 case end: 1564 offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); 1565 break; 1566 1567 default: 1568 } 1569 } 1570 1571 return offsets; 1572} 1573;// ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js 1574 1575 1576function popperOffsets(_ref) { 1577 var state = _ref.state, 1578 name = _ref.name; 1579 // Offsets are the actual position the popper needs to have to be 1580 // properly positioned near its reference element 1581 // This is the most basic placement, and will be adjusted by 1582 // the modifiers in the next step 1583 state.modifiersData[name] = computeOffsets({ 1584 reference: state.rects.reference, 1585 element: state.rects.popper, 1586 strategy: 'absolute', 1587 placement: state.placement 1588 }); 1589} // eslint-disable-next-line import/no-unused-modules 1590 1591 1592/* harmony default export */ const modifiers_popperOffsets = ({ 1593 name: 'popperOffsets', 1594 enabled: true, 1595 phase: 'read', 1596 fn: popperOffsets, 1597 data: {} 1598}); 1599;// ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js 1600 1601 1602 1603 1604 1605 1606 1607 // eslint-disable-next-line import/no-unused-modules 1608 1609var unsetSides = { 1610 top: 'auto', 1611 right: 'auto', 1612 bottom: 'auto', 1613 left: 'auto' 1614}; // Round the offsets to the nearest suitable subpixel based on the DPR. 1615// Zooming can change the DPR, but it seems to report a value that will 1616// cleanly divide the values into the appropriate subpixels. 1617 1618function roundOffsetsByDPR(_ref) { 1619 var x = _ref.x, 1620 y = _ref.y; 1621 var win = window; 1622 var dpr = win.devicePixelRatio || 1; 1623 return { 1624 x: round(x * dpr) / dpr || 0, 1625 y: round(y * dpr) / dpr || 0 1626 }; 1627} 1628 1629function mapToStyles(_ref2) { 1630 var _Object$assign2; 1631 1632 var popper = _ref2.popper, 1633 popperRect = _ref2.popperRect, 1634 placement = _ref2.placement, 1635 variation = _ref2.variation, 1636 offsets = _ref2.offsets, 1637 position = _ref2.position, 1638 gpuAcceleration = _ref2.gpuAcceleration, 1639 adaptive = _ref2.adaptive, 1640 roundOffsets = _ref2.roundOffsets, 1641 isFixed = _ref2.isFixed; 1642 var _offsets$x = offsets.x, 1643 x = _offsets$x === void 0 ? 0 : _offsets$x, 1644 _offsets$y = offsets.y, 1645 y = _offsets$y === void 0 ? 0 : _offsets$y; 1646 1647 var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ 1648 x: x, 1649 y: y 1650 }) : { 1651 x: x, 1652 y: y 1653 }; 1654 1655 x = _ref3.x; 1656 y = _ref3.y; 1657 var hasX = offsets.hasOwnProperty('x'); 1658 var hasY = offsets.hasOwnProperty('y'); 1659 var sideX = left; 1660 var sideY = enums_top; 1661 var win = window; 1662 1663 if (adaptive) { 1664 var offsetParent = getOffsetParent(popper); 1665 var heightProp = 'clientHeight'; 1666 var widthProp = 'clientWidth'; 1667 1668 if (offsetParent === getWindow(popper)) { 1669 offsetParent = getDocumentElement(popper); 1670 1671 if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { 1672 heightProp = 'scrollHeight'; 1673 widthProp = 'scrollWidth'; 1674 } 1675 } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it 1676 1677 1678 offsetParent = offsetParent; 1679 1680 if (placement === enums_top || (placement === left || placement === right) && variation === end) { 1681 sideY = bottom; 1682 var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] 1683 offsetParent[heightProp]; 1684 y -= offsetY - popperRect.height; 1685 y *= gpuAcceleration ? 1 : -1; 1686 } 1687 1688 if (placement === left || (placement === enums_top || placement === bottom) && variation === end) { 1689 sideX = right; 1690 var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] 1691 offsetParent[widthProp]; 1692 x -= offsetX - popperRect.width; 1693 x *= gpuAcceleration ? 1 : -1; 1694 } 1695 } 1696 1697 var commonStyles = Object.assign({ 1698 position: position 1699 }, adaptive && unsetSides); 1700 1701 var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ 1702 x: x, 1703 y: y 1704 }) : { 1705 x: x, 1706 y: y 1707 }; 1708 1709 x = _ref4.x; 1710 y = _ref4.y; 1711 1712 if (gpuAcceleration) { 1713 var _Object$assign; 1714 1715 return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); 1716 } 1717 1718 return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); 1719} 1720 1721function computeStyles(_ref5) { 1722 var state = _ref5.state, 1723 options = _ref5.options; 1724 var _options$gpuAccelerat = options.gpuAcceleration, 1725 gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, 1726 _options$adaptive = options.adaptive, 1727 adaptive = _options$adaptive === void 0 ? true : _options$adaptive, 1728 _options$roundOffsets = options.roundOffsets, 1729 roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; 1730 1731 if (false) { var transitionProperty; } 1732 1733 var commonStyles = { 1734 placement: getBasePlacement(state.placement), 1735 variation: getVariation(state.placement), 1736 popper: state.elements.popper, 1737 popperRect: state.rects.popper, 1738 gpuAcceleration: gpuAcceleration, 1739 isFixed: state.options.strategy === 'fixed' 1740 }; 1741 1742 if (state.modifiersData.popperOffsets != null) { 1743 state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { 1744 offsets: state.modifiersData.popperOffsets, 1745 position: state.options.strategy, 1746 adaptive: adaptive, 1747 roundOffsets: roundOffsets 1748 }))); 1749 } 1750 1751 if (state.modifiersData.arrow != null) { 1752 state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { 1753 offsets: state.modifiersData.arrow, 1754 position: 'absolute', 1755 adaptive: false, 1756 roundOffsets: roundOffsets 1757 }))); 1758 } 1759 1760 state.attributes.popper = Object.assign({}, state.attributes.popper, { 1761 'data-popper-placement': state.placement 1762 }); 1763} // eslint-disable-next-line import/no-unused-modules 1764 1765 1766/* harmony default export */ const modifiers_computeStyles = ({ 1767 name: 'computeStyles', 1768 enabled: true, 1769 phase: 'beforeWrite', 1770 fn: computeStyles, 1771 data: {} 1772}); 1773;// ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js 1774 1775 // This modifier takes the styles prepared by the `computeStyles` modifier 1776// and applies them to the HTMLElements such as popper and arrow 1777 1778function applyStyles(_ref) { 1779 var state = _ref.state; 1780 Object.keys(state.elements).forEach(function (name) { 1781 var style = state.styles[name] || {}; 1782 var attributes = state.attributes[name] || {}; 1783 var element = state.elements[name]; // arrow is optional + virtual elements 1784 1785 if (!isHTMLElement(element) || !getNodeName(element)) { 1786 return; 1787 } // Flow doesn't support to extend this property, but it's the most 1788 // effective way to apply styles to an HTMLElement 1789 // $FlowFixMe[cannot-write] 1790 1791 1792 Object.assign(element.style, style); 1793 Object.keys(attributes).forEach(function (name) { 1794 var value = attributes[name]; 1795 1796 if (value === false) { 1797 element.removeAttribute(name); 1798 } else { 1799 element.setAttribute(name, value === true ? '' : value); 1800 } 1801 }); 1802 }); 1803} 1804 1805function applyStyles_effect(_ref2) { 1806 var state = _ref2.state; 1807 var initialStyles = { 1808 popper: { 1809 position: state.options.strategy, 1810 left: '0', 1811 top: '0', 1812 margin: '0' 1813 }, 1814 arrow: { 1815 position: 'absolute' 1816 }, 1817 reference: {} 1818 }; 1819 Object.assign(state.elements.popper.style, initialStyles.popper); 1820 state.styles = initialStyles; 1821 1822 if (state.elements.arrow) { 1823 Object.assign(state.elements.arrow.style, initialStyles.arrow); 1824 } 1825 1826 return function () { 1827 Object.keys(state.elements).forEach(function (name) { 1828 var element = state.elements[name]; 1829 var attributes = state.attributes[name] || {}; 1830 var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them 1831 1832 var style = styleProperties.reduce(function (style, property) { 1833 style[property] = ''; 1834 return style; 1835 }, {}); // arrow is optional + virtual elements 1836 1837 if (!isHTMLElement(element) || !getNodeName(element)) { 1838 return; 1839 } 1840 1841 Object.assign(element.style, style); 1842 Object.keys(attributes).forEach(function (attribute) { 1843 element.removeAttribute(attribute); 1844 }); 1845 }); 1846 }; 1847} // eslint-disable-next-line import/no-unused-modules 1848 1849 1850/* harmony default export */ const modifiers_applyStyles = ({ 1851 name: 'applyStyles', 1852 enabled: true, 1853 phase: 'write', 1854 fn: applyStyles, 1855 effect: applyStyles_effect, 1856 requires: ['computeStyles'] 1857}); 1858;// ./node_modules/@popperjs/core/lib/modifiers/offset.js 1859 1860 // eslint-disable-next-line import/no-unused-modules 1861 1862function distanceAndSkiddingToXY(placement, rects, offset) { 1863 var basePlacement = getBasePlacement(placement); 1864 var invertDistance = [left, enums_top].indexOf(basePlacement) >= 0 ? -1 : 1; 1865 1866 var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { 1867 placement: placement 1868 })) : offset, 1869 skidding = _ref[0], 1870 distance = _ref[1]; 1871 1872 skidding = skidding || 0; 1873 distance = (distance || 0) * invertDistance; 1874 return [left, right].indexOf(basePlacement) >= 0 ? { 1875 x: distance, 1876 y: skidding 1877 } : { 1878 x: skidding, 1879 y: distance 1880 }; 1881} 1882 1883function offset(_ref2) { 1884 var state = _ref2.state, 1885 options = _ref2.options, 1886 name = _ref2.name; 1887 var _options$offset = options.offset, 1888 offset = _options$offset === void 0 ? [0, 0] : _options$offset; 1889 var data = enums_placements.reduce(function (acc, placement) { 1890 acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); 1891 return acc; 1892 }, {}); 1893 var _data$state$placement = data[state.placement], 1894 x = _data$state$placement.x, 1895 y = _data$state$placement.y; 1896 1897 if (state.modifiersData.popperOffsets != null) { 1898 state.modifiersData.popperOffsets.x += x; 1899 state.modifiersData.popperOffsets.y += y; 1900 } 1901 1902 state.modifiersData[name] = data; 1903} // eslint-disable-next-line import/no-unused-modules 1904 1905 1906/* harmony default export */ const modifiers_offset = ({ 1907 name: 'offset', 1908 enabled: true, 1909 phase: 'main', 1910 requires: ['popperOffsets'], 1911 fn: offset 1912}); 1913;// ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js 1914var hash = { 1915 left: 'right', 1916 right: 'left', 1917 bottom: 'top', 1918 top: 'bottom' 1919}; 1920function getOppositePlacement(placement) { 1921 return placement.replace(/left|right|bottom|top/g, function (matched) { 1922 return hash[matched]; 1923 }); 1924} 1925;
1925// ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js 1926var getOppositeVariationPlacement_hash = { 1927 start: 'end', 1928 end: 'start' 1929}; 1930function getOppositeVariationPlacement(placement) { 1931 return placement.replace(/start|end/g, function (matched) { 1932 return getOppositeVariationPlacement_hash[matched]; 1933 }); 1934} 1935;// ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js 1936 1937 1938 1939function getViewportRect(element) { 1940 var win = getWindow(element); 1941 var html = getDocumentElement(element); 1942 var visualViewport = win.visualViewport; 1943 var width = html.clientWidth; 1944 var height = html.clientHeight; 1945 var x = 0; 1946 var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper 1947 // can be obscured underneath it. 1948 // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even 1949 // if it isn't open, so if this isn't available, the popper will be detected 1950 // to overflow the bottom of the screen too early. 1951 1952 if (visualViewport) { 1953 width = visualViewport.width;
vendor: 4,436 bytes, lines 1954-2091
1954 height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently) 1955 // In Chrome, it returns a value very close to 0 (+/-) but contains rounding 1956 // errors due to floating point numbers, so we need to check precision. 1957 // Safari returns a number <= 0, usually < -1 when pinch-zoomed 1958 // Feature detection fails in mobile emulation mode in Chrome. 1959 // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) < 1960 // 0.001 1961 // Fallback here: "Not Safari" userAgent 1962 1963 if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { 1964 x = visualViewport.offsetLeft; 1965 y = visualViewport.offsetTop; 1966 } 1967 } 1968 1969 return { 1970 width: width, 1971 height: height, 1972 x: x + getWindowScrollBarX(element), 1973 y: y 1974 }; 1975} 1976;// ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js 1977 1978 1979 1980 1981 // Gets the entire size of the scrollable document area, even extending outside 1982// of the `<html>` and `<body>` rect bounds if horizontally scrollable 1983 1984function getDocumentRect(element) { 1985 var _element$ownerDocumen; 1986 1987 var html = getDocumentElement(element); 1988 var winScroll = getWindowScroll(element); 1989 var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; 1990 var width = math_max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); 1991 var height = math_max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); 1992 var x = -winScroll.scrollLeft + getWindowScrollBarX(element); 1993 var y = -winScroll.scrollTop; 1994 1995 if (getComputedStyle(body || html).direction === 'rtl') { 1996 x += math_max(html.clientWidth, body ? body.clientWidth : 0) - width; 1997 } 1998 1999 return { 2000 width: width, 2001 height: height, 2002 x: x, 2003 y: y 2004 }; 2005} 2006;// ./node_modules/@popperjs/core/lib/dom-utils/contains.js 2007 2008function contains(parent, child) { 2009 var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method 2010 2011 if (parent.contains(child)) { 2012 return true; 2013 } // then fallback to custom implementation with Shadow DOM support 2014 else if (rootNode && isShadowRoot(rootNode)) { 2015 var next = child; 2016 2017 do { 2018 if (next && parent.isSameNode(next)) { 2019 return true; 2020 } // $FlowFixMe[prop-missing]: need a better way to handle this... 2021 2022 2023 next = next.parentNode || next.host; 2024 } while (next); 2025 } // Give up, the result is false 2026 2027 2028 return false; 2029} 2030;// ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js 2031function rectToClientRect(rect) { 2032 return Object.assign({}, rect, { 2033 left: rect.x, 2034 top: rect.y, 2035 right: rect.x + rect.width, 2036 bottom: rect.y + rect.height 2037 }); 2038} 2039;// ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055function getInnerBoundingClientRect(element) { 2056 var rect = getBoundingClientRect(element); 2057 rect.top = rect.top + element.clientTop; 2058 rect.left = rect.left + element.clientLeft; 2059 rect.bottom = rect.top + element.clientHeight; 2060 rect.right = rect.left + element.clientWidth; 2061 rect.width = element.clientWidth; 2062 rect.height = element.clientHeight; 2063 rect.x = rect.left; 2064 rect.y = rect.top; 2065 return rect; 2066} 2067 2068function getClientRectFromMixedType(element, clippingParent) { 2069 return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); 2070} // A "clipping parent" is an overflowable container with the characteristic of 2071// clipping (or hiding) overflowing elements with a position different from 2072// `initial` 2073 2074 2075function getClippingParents(element) { 2076 var clippingParents = listScrollParents(getParentNode(element)); 2077 var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0; 2078 var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; 2079 2080 if (!isElement(clipperElement)) { 2081 return []; 2082 } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 2083 2084 2085 return clippingParents.filter(function (clippingParent) { 2086 return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; 2087 }); 2088} // Gets the maximum area that the element is visible in due to any number of 2089// clipping parents 2090 2091
vendor: 4,106 bytes, lines 2092-2185
2092function getClippingRect(element, boundary, rootBoundary) { 2093 var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); 2094 var clippingParents = [].concat(mainClippingParents, [rootBoundary]); 2095 var firstClippingParent = clippingParents[0]; 2096 var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { 2097 var rect = getClientRectFromMixedType(element, clippingParent); 2098 accRect.top = math_max(rect.top, accRect.top); 2099 accRect.right = math_min(rect.right, accRect.right); 2100 accRect.bottom = math_min(rect.bottom, accRect.bottom); 2101 accRect.left = math_max(rect.left, accRect.left); 2102 return accRect; 2103 }, getClientRectFromMixedType(element, firstClippingParent)); 2104 clippingRect.width = clippingRect.right - clippingRect.left; 2105 clippingRect.height = clippingRect.bottom - clippingRect.top; 2106 clippingRect.x = clippingRect.left; 2107 clippingRect.y = clippingRect.top; 2108 return clippingRect; 2109} 2110;// ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js 2111function getFreshSideObject() { 2112 return { 2113 top: 0, 2114 right: 0, 2115 bottom: 0, 2116 left: 0 2117 }; 2118} 2119;// ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js 2120 2121function mergePaddingObject(paddingObject) { 2122 return Object.assign({}, getFreshSideObject(), paddingObject); 2123} 2124;// ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js 2125function expandToHashMap(value, keys) { 2126 return keys.reduce(function (hashMap, key) { 2127 hashMap[key] = value; 2128 return hashMap; 2129 }, {}); 2130} 2131;// ./node_modules/@popperjs/core/lib/utils/detectOverflow.js 2132 2133 2134 2135 2136 2137 2138 2139 2140 // eslint-disable-next-line import/no-unused-modules 2141 2142function detectOverflow(state, options) { 2143 if (options === void 0) { 2144 options = {}; 2145 } 2146 2147 var _options = options, 2148 _options$placement = _options.placement, 2149 placement = _options$placement === void 0 ? state.placement : _options$placement, 2150 _options$boundary = _options.boundary, 2151 boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, 2152 _options$rootBoundary = _options.rootBoundary, 2153 rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, 2154 _options$elementConte = _options.elementContext, 2155 elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, 2156 _options$altBoundary = _options.altBoundary, 2157 altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, 2158 _options$padding = _options.padding, 2159 padding = _options$padding === void 0 ? 0 : _options$padding; 2160 var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); 2161 var altContext = elementContext === popper ? reference : popper; 2162 var popperRect = state.rects.popper; 2163 var element = state.elements[altBoundary ? altContext : elementContext]; 2164 var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary); 2165 var referenceClientRect = getBoundingClientRect(state.elements.reference); 2166 var popperOffsets = computeOffsets({ 2167 reference: referenceClientRect, 2168 element: popperRect, 2169 strategy: 'absolute', 2170 placement: placement 2171 }); 2172 var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); 2173 var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect 2174 // 0 or negative = within the clipping rect 2175 2176 var overflowOffsets = { 2177 top: clippingClientRect.top - elementClientRect.top + paddingObject.top, 2178 bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, 2179 left: clippingClientRect.left - elementClientRect.left + paddingObject.left, 2180 right: elementClientRect.right - clippingClientRect.right + paddingObject.right 2181 }; 2182 var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element 2183 2184 if (elementContext === popper && offsetData) { 2185 var offset = offsetData[placement];
vendor: 1,315 bytes, lines 2186-2224
2186 Object.keys(overflowOffsets).forEach(function (key) { 2187 var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; 2188 var axis = [enums_top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; 2189 overflowOffsets[key] += offset[axis] * multiply; 2190 }); 2191 } 2192 2193 return overflowOffsets; 2194} 2195;// ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js 2196 2197 2198 2199 2200function computeAutoPlacement(state, options) { 2201 if (options === void 0) { 2202 options = {}; 2203 } 2204 2205 var _options = options, 2206 placement = _options.placement, 2207 boundary = _options.boundary, 2208 rootBoundary = _options.rootBoundary, 2209 padding = _options.padding, 2210 flipVariations = _options.flipVariations, 2211 _options$allowedAutoP = _options.allowedAutoPlacements, 2212 allowedAutoPlacements = _options$allowedAutoP === void 0 ? enums_placements : _options$allowedAutoP; 2213 var variation = getVariation(placement); 2214 var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { 2215 return getVariation(placement) === variation; 2216 }) : basePlacements; 2217 var allowedPlacements = placements.filter(function (placement) { 2218 return allowedAutoPlacements.indexOf(placement) >= 0; 2219 }); 2220 2221 if (allowedPlacements.length === 0) { 2222 allowedPlacements = placements; 2223 2224 if (false) {}
vendor: 11,540 bytes, lines 2224-2553
2224 2225 } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... 2226 2227 2228 var overflows = allowedPlacements.reduce(function (acc, placement) { 2229 acc[placement] = detectOverflow(state, { 2230 placement: placement, 2231 boundary: boundary, 2232 rootBoundary: rootBoundary, 2233 padding: padding 2234 })[getBasePlacement(placement)]; 2235 return acc; 2236 }, {}); 2237 return Object.keys(overflows).sort(function (a, b) { 2238 return overflows[a] - overflows[b]; 2239 }); 2240} 2241;// ./node_modules/@popperjs/core/lib/modifiers/flip.js 2242 2243 2244 2245 2246 2247 2248 // eslint-disable-next-line import/no-unused-modules 2249 2250function getExpandedFallbackPlacements(placement) { 2251 if (getBasePlacement(placement) === auto) { 2252 return []; 2253 } 2254 2255 var oppositePlacement = getOppositePlacement(placement); 2256 return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; 2257} 2258 2259function flip(_ref) { 2260 var state = _ref.state, 2261 options = _ref.options, 2262 name = _ref.name; 2263 2264 if (state.modifiersData[name]._skip) { 2265 return; 2266 } 2267 2268 var _options$mainAxis = options.mainAxis, 2269 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, 2270 _options$altAxis = options.altAxis, 2271 checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, 2272 specifiedFallbackPlacements = options.fallbackPlacements, 2273 padding = options.padding, 2274 boundary = options.boundary, 2275 rootBoundary = options.rootBoundary, 2276 altBoundary = options.altBoundary, 2277 _options$flipVariatio = options.flipVariations, 2278 flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, 2279 allowedAutoPlacements = options.allowedAutoPlacements; 2280 var preferredPlacement = state.options.placement; 2281 var basePlacement = getBasePlacement(preferredPlacement); 2282 var isBasePlacement = basePlacement === preferredPlacement; 2283 var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); 2284 var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { 2285 return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { 2286 placement: placement, 2287 boundary: boundary, 2288 rootBoundary: rootBoundary, 2289 padding: padding, 2290 flipVariations: flipVariations, 2291 allowedAutoPlacements: allowedAutoPlacements 2292 }) : placement); 2293 }, []); 2294 var referenceRect = state.rects.reference; 2295 var popperRect = state.rects.popper; 2296 var checksMap = new Map(); 2297 var makeFallbackChecks = true; 2298 var firstFittingPlacement = placements[0]; 2299 2300 for (var i = 0; i < placements.length; i++) { 2301 var placement = placements[i]; 2302 2303 var _basePlacement = getBasePlacement(placement); 2304 2305 var isStartVariation = getVariation(placement) === start; 2306 var isVertical = [enums_top, bottom].indexOf(_basePlacement) >= 0; 2307 var len = isVertical ? 'width' : 'height'; 2308 var overflow = detectOverflow(state, { 2309 placement: placement, 2310 boundary: boundary, 2311 rootBoundary: rootBoundary, 2312 altBoundary: altBoundary, 2313 padding: padding 2314 }); 2315 var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : enums_top; 2316 2317 if (referenceRect[len] > popperRect[len]) { 2318 mainVariationSide = getOppositePlacement(mainVariationSide); 2319 } 2320 2321 var altVariationSide = getOppositePlacement(mainVariationSide); 2322 var checks = []; 2323 2324 if (checkMainAxis) { 2325 checks.push(overflow[_basePlacement] <= 0); 2326 } 2327 2328 if (checkAltAxis) { 2329 checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); 2330 } 2331 2332 if (checks.every(function (check) { 2333 return check; 2334 })) { 2335 firstFittingPlacement = placement; 2336 makeFallbackChecks = false; 2337 break; 2338 } 2339 2340 checksMap.set(placement, checks); 2341 } 2342 2343 if (makeFallbackChecks) { 2344 // `2` may be desired in some cases â research later 2345 var numberOfChecks = flipVariations ? 3 : 1; 2346 2347 var _loop = function _loop(_i) { 2348 var fittingPlacement = placements.find(function (placement) { 2349 var checks = checksMap.get(placement); 2350 2351 if (checks) { 2352 return checks.slice(0, _i).every(function (check) { 2353 return check; 2354 }); 2355 } 2356 }); 2357 2358 if (fittingPlacement) { 2359 firstFittingPlacement = fittingPlacement; 2360 return "break"; 2361 } 2362 }; 2363 2364 for (var _i = numberOfChecks; _i > 0; _i--) { 2365 var _ret = _loop(_i); 2366 2367 if (_ret === "break") break; 2368 } 2369 } 2370 2371 if (state.placement !== firstFittingPlacement) { 2372 state.modifiersData[name]._skip = true; 2373 state.placement = firstFittingPlacement; 2374 state.reset = true; 2375 } 2376} // eslint-disable-next-line import/no-unused-modules 2377 2378 2379/* harmony default export */ const modifiers_flip = ({ 2380 name: 'flip', 2381 enabled: true, 2382 phase: 'main', 2383 fn: flip, 2384 requiresIfExists: ['offset'], 2385 data: { 2386 _skip: false 2387 } 2388}); 2389;// ./node_modules/@popperjs/core/lib/utils/getAltAxis.js 2390function getAltAxis(axis) { 2391 return axis === 'x' ? 'y' : 'x'; 2392} 2393;// ./node_modules/@popperjs/core/lib/utils/within.js 2394 2395function within(min, value, max) { 2396 return math_max(min, math_min(value, max)); 2397} 2398function withinMaxClamp(min, value, max) { 2399 var v = within(min, value, max); 2400 return v > max ? max : v; 2401} 2402;// ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415function preventOverflow(_ref) { 2416 var state = _ref.state, 2417 options = _ref.options, 2418 name = _ref.name; 2419 var _options$mainAxis = options.mainAxis, 2420 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, 2421 _options$altAxis = options.altAxis, 2422 checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, 2423 boundary = options.boundary, 2424 rootBoundary = options.rootBoundary, 2425 altBoundary = options.altBoundary, 2426 padding = options.padding, 2427 _options$tether = options.tether, 2428 tether = _options$tether === void 0 ? true : _options$tether, 2429 _options$tetherOffset = options.tetherOffset, 2430 tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; 2431 var overflow = detectOverflow(state, { 2432 boundary: boundary, 2433 rootBoundary: rootBoundary, 2434 padding: padding, 2435 altBoundary: altBoundary 2436 }); 2437 var basePlacement = getBasePlacement(state.placement); 2438 var variation = getVariation(state.placement); 2439 var isBasePlacement = !variation; 2440 var mainAxis = getMainAxisFromPlacement(basePlacement); 2441 var altAxis = getAltAxis(mainAxis); 2442 var popperOffsets = state.modifiersData.popperOffsets; 2443 var referenceRect = state.rects.reference; 2444 var popperRect = state.rects.popper; 2445 var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { 2446 placement: state.placement 2447 })) : tetherOffset; 2448 var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { 2449 mainAxis: tetherOffsetValue, 2450 altAxis: tetherOffsetValue 2451 } : Object.assign({ 2452 mainAxis: 0, 2453 altAxis: 0 2454 }, tetherOffsetValue); 2455 var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; 2456 var data = { 2457 x: 0, 2458 y: 0 2459 }; 2460 2461 if (!popperOffsets) { 2462 return; 2463 } 2464 2465 if (checkMainAxis) { 2466 var _offsetModifierState$; 2467 2468 var mainSide = mainAxis === 'y' ? enums_top : left; 2469 var altSide = mainAxis === 'y' ? bottom : right; 2470 var len = mainAxis === 'y' ? 'height' : 'width'; 2471 var offset = popperOffsets[mainAxis]; 2472 var min = offset + overflow[mainSide]; 2473 var max = offset - overflow[altSide]; 2474 var additive = tether ? -popperRect[len] / 2 : 0; 2475 var minLen = variation === start ? referenceRect[len] : popperRect[len]; 2476 var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go 2477 // outside the reference bounds 2478 2479 var arrowElement = state.elements.arrow; 2480 var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { 2481 width: 0, 2482 height: 0 2483 }; 2484 var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); 2485 var arrowPaddingMin = arrowPaddingObject[mainSide]; 2486 var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want 2487 // to include its full size in the calculation. If the reference is small 2488 // and near the edge of a boundary, the popper can overflow even if the 2489 // reference is not overflowing as well (e.g. virtual elements with no 2490 // width or height) 2491 2492 var arrowLen = within(0, referenceRect[len], arrowRect[len]); 2493 var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; 2494 var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; 2495 var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); 2496 var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; 2497 var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; 2498 var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; 2499 var tetherMax = offset + maxOffset - offsetModifierValue; 2500 var preventedOffset = within(tether ? math_min(min, tetherMin) : min, offset, tether ? math_max(max, tetherMax) : max); 2501 popperOffsets[mainAxis] = preventedOffset; 2502 data[mainAxis] = preventedOffset - offset; 2503 } 2504 2505 if (checkAltAxis) { 2506 var _offsetModifierState$2; 2507 2508 var _mainSide = mainAxis === 'x' ? enums_top : left; 2509 2510 var _altSide = mainAxis === 'x' ? bottom : right; 2511 2512 var _offset = popperOffsets[altAxis]; 2513 2514 var _len = altAxis === 'y' ? 'height' : 'width'; 2515 2516 var _min = _offset + overflow[_mainSide]; 2517 2518 var _max = _offset - overflow[_altSide]; 2519 2520 var isOriginSide = [enums_top, left].indexOf(basePlacement) !== -1; 2521 2522 var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; 2523 2524 var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; 2525 2526 var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; 2527 2528 var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); 2529 2530 popperOffsets[altAxis] = _preventedOffset; 2531 data[altAxis] = _preventedOffset - _offset; 2532 } 2533 2534 state.modifiersData[name] = data; 2535} // eslint-disable-next-line import/no-unused-modules 2536 2537 2538/* harmony default export */ const modifiers_preventOverflow = ({ 2539 name: 'preventOverflow', 2540 enabled: true, 2541 phase: 'main', 2542 fn: preventOverflow, 2543 requiresIfExists: ['offset'] 2544}); 2545;// ./node_modules/@popperjs/core/lib/modifiers/arrow.js 2546 2547 2548 2549 2550 2551 2552 2553
vendor: 879 bytes, lines 2554-2580
2554 2555 // eslint-disable-next-line import/no-unused-modules 2556 2557var toPaddingObject = function toPaddingObject(padding, state) { 2558 padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { 2559 placement: state.placement 2560 })) : padding; 2561 return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); 2562}; 2563 2564function arrow(_ref) { 2565 var _state$modifiersData$; 2566 2567 var state = _ref.state, 2568 name = _ref.name, 2569 options = _ref.options; 2570 var arrowElement = state.elements.arrow; 2571 var popperOffsets = state.modifiersData.popperOffsets; 2572 var basePlacement = getBasePlacement(state.placement); 2573 var axis = getMainAxisFromPlacement(basePlacement); 2574 var isVertical = [left, right].indexOf(basePlacement) >= 0; 2575 var len = isVertical ? 'height' : 'width'; 2576 2577 if (!arrowElement || !popperOffsets) { 2578 return; 2579 } 2580
vendor: 5,682 bytes, lines 2581-2760
2581 var paddingObject = toPaddingObject(options.padding, state); 2582 var arrowRect = getLayoutRect(arrowElement); 2583 var minProp = axis === 'y' ? enums_top : left; 2584 var maxProp = axis === 'y' ? bottom : right; 2585 var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; 2586 var startDiff = popperOffsets[axis] - state.rects.reference[axis]; 2587 var arrowOffsetParent = getOffsetParent(arrowElement); 2588 var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; 2589 var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is 2590 // outside of the popper bounds 2591 2592 var min = paddingObject[minProp]; 2593 var max = clientSize - arrowRect[len] - paddingObject[maxProp]; 2594 var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; 2595 var offset = within(min, center, max); // Prevents breaking syntax highlighting... 2596 2597 var axisProp = axis; 2598 state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); 2599} 2600 2601function arrow_effect(_ref2) { 2602 var state = _ref2.state, 2603 options = _ref2.options; 2604 var _options$element = options.element, 2605 arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; 2606 2607 if (arrowElement == null) { 2608 return; 2609 } // CSS selector 2610 2611 2612 if (typeof arrowElement === 'string') { 2613 arrowElement = state.elements.popper.querySelector(arrowElement); 2614 2615 if (!arrowElement) { 2616 return; 2617 } 2618 } 2619 2620 if (false) {} 2621 2622 if (!contains(state.elements.popper, arrowElement)) { 2623 if (false) {} 2624 2625 return; 2626 } 2627 2628 state.elements.arrow = arrowElement; 2629} // eslint-disable-next-line import/no-unused-modules 2630 2631 2632/* harmony default export */ const modifiers_arrow = ({ 2633 name: 'arrow', 2634 enabled: true, 2635 phase: 'main', 2636 fn: arrow, 2637 effect: arrow_effect, 2638 requires: ['popperOffsets'], 2639 requiresIfExists: ['preventOverflow'] 2640}); 2641;// ./node_modules/@popperjs/core/lib/modifiers/hide.js 2642 2643 2644 2645function getSideOffsets(overflow, rect, preventedOffsets) { 2646 if (preventedOffsets === void 0) { 2647 preventedOffsets = { 2648 x: 0, 2649 y: 0 2650 }; 2651 } 2652 2653 return { 2654 top: overflow.top - rect.height - preventedOffsets.y, 2655 right: overflow.right - rect.width + preventedOffsets.x, 2656 bottom: overflow.bottom - rect.height + preventedOffsets.y, 2657 left: overflow.left - rect.width - preventedOffsets.x 2658 }; 2659} 2660 2661function isAnySideFullyClipped(overflow) { 2662 return [enums_top, right, bottom, left].some(function (side) { 2663 return overflow[side] >= 0; 2664 }); 2665} 2666 2667function hide(_ref) { 2668 var state = _ref.state, 2669 name = _ref.name; 2670 var referenceRect = state.rects.reference; 2671 var popperRect = state.rects.popper; 2672 var preventedOffsets = state.modifiersData.preventOverflow; 2673 var referenceOverflow = detectOverflow(state, { 2674 elementContext: 'reference' 2675 }); 2676 var popperAltOverflow = detectOverflow(state, { 2677 altBoundary: true 2678 }); 2679 var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); 2680 var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); 2681 var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); 2682 var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); 2683 state.modifiersData[name] = { 2684 referenceClippingOffsets: referenceClippingOffsets, 2685 popperEscapeOffsets: popperEscapeOffsets, 2686 isReferenceHidden: isReferenceHidden, 2687 hasPopperEscaped: hasPopperEscaped 2688 }; 2689 state.attributes.popper = Object.assign({}, state.attributes.popper, { 2690 'data-popper-reference-hidden': isReferenceHidden, 2691 'data-popper-escaped': hasPopperEscaped 2692 }); 2693} // eslint-disable-next-line import/no-unused-modules 2694 2695 2696/* harmony default export */ const modifiers_hide = ({ 2697 name: 'hide', 2698 enabled: true, 2699 phase: 'main', 2700 requiresIfExists: ['preventOverflow'], 2701 fn: hide 2702}); 2703;// ./node_modules/@popperjs/core/lib/popper.js 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714var defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles, modifiers_offset, modifiers_flip, modifiers_preventOverflow, modifiers_arrow, modifiers_hide]; 2715var popper_createPopper = /*#__PURE__*/popperGenerator({ 2716 defaultModifiers: defaultModifiers 2717}); // eslint-disable-next-line import/no-unused-modules 2718 2719 // eslint-disable-next-line import/no-unused-modules 2720 2721 // eslint-disable-next-line import/no-unused-modules 2722 2723 2724;// ./node_modules/tippy.js/dist/tippy.esm.js 2725/**! 2726* tippy.js v6.3.7 2727* (c) 2017-2021 atomiks 2728* MIT License 2729*/ 2730 2731 2732var ROUND_ARROW = '<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>'; 2733var BOX_CLASS = "tippy-box"; 2734var CONTENT_CLASS = "tippy-content"; 2735var BACKDROP_CLASS = "tippy-backdrop"; 2736var ARROW_CLASS = "tippy-arrow"; 2737var SVG_ARROW_CLASS = "tippy-svg-arrow"; 2738var TOUCH_OPTIONS = { 2739 passive: true, 2740 capture: true 2741}; 2742var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() { 2743 return document.body; 2744}; 2745 2746function tippy_esm_hasOwnProperty(obj, key) { 2747 return {}.hasOwnProperty.call(obj, key); 2748} 2749function getValueAtIndexOrReturn(value, index, defaultValue) { 2750 if (Array.isArray(value)) { 2751 var v = value[index]; 2752 return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v; 2753 } 2754 2755 return value; 2756} 2757function isType(value, type) { 2758 var str = {}.toString.call(value); 2759 return str.indexOf('[object') === 0 && str.indexOf(type + "]") > -1; 2760}
vendor: 1,997 bytes, lines 2761-2849
2761function invokeWithArgsOrReturn(value, args) { 2762 return typeof value === 'function' ? value.apply(void 0, args) : value; 2763} 2764function tippy_esm_debounce(fn, ms) { 2765 // Avoid wrapping in `setTimeout` if ms is 0 anyway 2766 if (ms === 0) { 2767 return fn; 2768 } 2769 2770 var timeout; 2771 return function (arg) { 2772 clearTimeout(timeout); 2773 timeout = setTimeout(function () { 2774 fn(arg); 2775 }, ms); 2776 }; 2777} 2778function removeProperties(obj, keys) { 2779 var clone = Object.assign({}, obj); 2780 keys.forEach(function (key) { 2781 delete clone[key]; 2782 }); 2783 return clone; 2784} 2785function splitBySpaces(value) { 2786 return value.split(/\s+/).filter(Boolean); 2787} 2788function normalizeToArray(value) { 2789 return [].concat(value); 2790} 2791function pushIfUnique(arr, value) { 2792 if (arr.indexOf(value) === -1) { 2793 arr.push(value); 2794 } 2795} 2796function unique(arr) { 2797 return arr.filter(function (item, index) { 2798 return arr.indexOf(item) === index; 2799 }); 2800} 2801function tippy_esm_getBasePlacement(placement) { 2802 return placement.split('-')[0]; 2803} 2804function arrayFrom(value) { 2805 return [].slice.call(value); 2806} 2807function removeUndefinedProps(obj) { 2808 return Object.keys(obj).reduce(function (acc, key) { 2809 if (obj[key] !== undefined) { 2810 acc[key] = obj[key]; 2811 } 2812 2813 return acc; 2814 }, {}); 2815} 2816 2817function div() { 2818 return document.createElement('div'); 2819} 2820function tippy_esm_isElement(value) { 2821 return ['Element', 'Fragment'].some(function (type) { 2822 return isType(value, type); 2823 }); 2824} 2825function isNodeList(value) { 2826 return isType(value, 'NodeList'); 2827} 2828function isMouseEvent(value) { 2829 return isType(value, 'MouseEvent'); 2830} 2831function isReferenceElement(value) { 2832 return !!(value && value._tippy && value._tippy.reference === value); 2833} 2834function getArrayOfElements(value) { 2835 if (tippy_esm_isElement(value)) { 2836 return [value]; 2837 } 2838 2839 if (isNodeList(value)) { 2840 return arrayFrom(value); 2841 } 2842 2843 if (Array.isArray(value)) { 2844 return value; 2845 } 2846 2847 return arrayFrom(document.querySelectorAll(value)); 2848} 2849function setTransitionDuration(els, value) {
vendor: 4,523 bytes, lines 2850-2990
2850 els.forEach(function (el) { 2851 if (el) { 2852 el.style.transitionDuration = value + "ms"; 2853 } 2854 }); 2855} 2856function setVisibilityState(els, state) { 2857 els.forEach(function (el) { 2858 if (el) { 2859 el.setAttribute('data-state', state); 2860 } 2861 }); 2862} 2863function getOwnerDocument(elementOrElements) { 2864 var _element$ownerDocumen; 2865 2866 var _normalizeToArray = normalizeToArray(elementOrElements), 2867 element = _normalizeToArray[0]; // Elements created via a <template> have an ownerDocument with no reference to the body 2868 2869 2870 return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document; 2871} 2872function isCursorOutsideInteractiveBorder(popperTreeData, event) { 2873 var clientX = event.clientX, 2874 clientY = event.clientY; 2875 return popperTreeData.every(function (_ref) { 2876 var popperRect = _ref.popperRect, 2877 popperState = _ref.popperState, 2878 props = _ref.props; 2879 var interactiveBorder = props.interactiveBorder; 2880 var basePlacement = tippy_esm_getBasePlacement(popperState.placement); 2881 var offsetData = popperState.modifiersData.offset; 2882 2883 if (!offsetData) { 2884 return true; 2885 } 2886 2887 var topDistance = basePlacement === 'bottom' ? offsetData.top.y : 0; 2888 var bottomDistance = basePlacement === 'top' ? offsetData.bottom.y : 0; 2889 var leftDistance = basePlacement === 'right' ? offsetData.left.x : 0; 2890 var rightDistance = basePlacement === 'left' ? offsetData.right.x : 0; 2891 var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder; 2892 var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder; 2893 var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder; 2894 var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder; 2895 return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight; 2896 }); 2897} 2898function updateTransitionEndListener(box, action, listener) { 2899 var method = action + "EventListener"; // some browsers apparently support `transition` (unprefixed) but only fire 2900 // `webkitTransitionEnd`... 2901 2902 ['transitionend', 'webkitTransitionEnd'].forEach(function (event) { 2903 box[method](event, listener); 2904 }); 2905} 2906/** 2907 * Compared to xxx.contains, this function works for dom structures with shadow 2908 * dom 2909 */ 2910 2911function actualContains(parent, child) { 2912 var target = child; 2913 2914 while (target) { 2915 var _target$getRootNode; 2916 2917 if (parent.contains(target)) { 2918 return true; 2919 } 2920 2921 target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host; 2922 } 2923 2924 return false; 2925} 2926 2927var currentInput = { 2928 isTouch: false 2929}; 2930var lastMouseMoveTime = 0; 2931/** 2932 * When a `touchstart` event is fired, it's assumed the user is using touch 2933 * input. We'll bind a `mousemove` event listener to listen for mouse input in 2934 * the future. This way, the `isTouch` property is fully dynamic and will handle 2935 * hybrid devices that use a mix of touch + mouse input. 2936 */ 2937 2938function onDocumentTouchStart() { 2939 if (currentInput.isTouch) { 2940 return; 2941 } 2942 2943 currentInput.isTouch = true; 2944 2945 if (window.performance) { 2946 document.addEventListener('mousemove', onDocumentMouseMove); 2947 } 2948} 2949/** 2950 * When two `mousemove` event are fired consecutively within 20ms, it's assumed 2951 * the user is using mouse input again. `mousemove` can fire on touch devices as 2952 * well, but very rarely that quickly. 2953 */ 2954 2955function onDocumentMouseMove() { 2956 var now = performance.now(); 2957 2958 if (now - lastMouseMoveTime < 20) { 2959 currentInput.isTouch = false; 2960 document.removeEventListener('mousemove', onDocumentMouseMove); 2961 } 2962 2963 lastMouseMoveTime = now; 2964} 2965/** 2966 * When an element is in focus and has a tippy, leaving the tab/window and 2967 * returning causes it to show again. For mouse users this is unexpected, but 2968 * for keyboard use it makes sense. 2969 * TODO: find a better technique to solve this problem 2970 */ 2971 2972function onWindowBlur() { 2973 var activeElement = document.activeElement; 2974 2975 if (isReferenceElement(activeElement)) { 2976 var instance = activeElement._tippy; 2977 2978 if (activeElement.blur && !instance.state.isVisible) { 2979 activeElement.blur(); 2980 } 2981 } 2982} 2983function bindGlobalEventListeners() { 2984 document.addEventListener('touchstart', onDocumentTouchStart, TOUCH_OPTIONS); 2985 window.addEventListener('blur', onWindowBlur); 2986} 2987 2988var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'; 2989var isIE11 = isBrowser ? // @ts-ignore 2990!!window.msCrypto : false;
vendor: 10,148 bytes, lines 2991-3322
2991 2992function createMemoryLeakWarning(method) { 2993 var txt = method === 'destroy' ? 'n already-' : ' '; 2994 return [method + "() was called on a" + txt + "destroyed instance. This is a no-op but", 'indicates a potential memory leak.'].join(' '); 2995} 2996function clean(value) { 2997 var spacesAndTabs = /[ \t]{2,}/g; 2998 var lineStartWithSpaces = /^[ \t]*/gm; 2999 return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim(); 3000} 3001 3002function getDevMessage(message) { 3003 return clean("\n %ctippy.js\n\n %c" + clean(message) + "\n\n %c\uD83D\uDC77\u200D This is a development-only message. It will be removed in production.\n "); 3004} 3005 3006function getFormattedMessage(message) { 3007 return [getDevMessage(message), // title 3008 'color: #00C584; font-size: 1.3em; font-weight: bold;', // message 3009 'line-height: 1.5', // footer 3010 'color: #a6a095;']; 3011} // Assume warnings and errors never have the same message 3012 3013var visitedMessages; 3014 3015if (false) {} 3016 3017function resetVisitedMessages() { 3018 visitedMessages = new Set(); 3019} 3020function warnWhen(condition, message) { 3021 if (condition && !visitedMessages.has(message)) { 3022 var _console; 3023 3024 visitedMessages.add(message); 3025 3026 (_console = console).warn.apply(_console, getFormattedMessage(message)); 3027 } 3028} 3029function errorWhen(condition, message) { 3030 if (condition && !visitedMessages.has(message)) { 3031 var _console2; 3032 3033 visitedMessages.add(message); 3034 3035 (_console2 = console).error.apply(_console2, getFormattedMessage(message)); 3036 } 3037} 3038function validateTargets(targets) { 3039 var didPassFalsyValue = !targets; 3040 var didPassPlainObject = Object.prototype.toString.call(targets) === '[object Object]' && !targets.addEventListener; 3041 errorWhen(didPassFalsyValue, ['tippy() was passed', '`' + String(targets) + '`', 'as its targets (first) argument. Valid types are: String, Element,', 'Element[], or NodeList.'].join(' ')); 3042 errorWhen(didPassPlainObject, ['tippy() was passed a plain object which is not supported as an argument', 'for virtual positioning. Use props.getReferenceClientRect instead.'].join(' ')); 3043} 3044 3045var pluginProps = { 3046 animateFill: false, 3047 followCursor: false, 3048 inlinePositioning: false, 3049 sticky: false 3050}; 3051var renderProps = { 3052 allowHTML: false, 3053 animation: 'fade', 3054 arrow: true, 3055 content: '', 3056 inertia: false, 3057 maxWidth: 350, 3058 role: 'tooltip', 3059 theme: '', 3060 zIndex: 9999 3061}; 3062var defaultProps = Object.assign({ 3063 appendTo: TIPPY_DEFAULT_APPEND_TO, 3064 aria: { 3065 content: 'auto', 3066 expanded: 'auto' 3067 }, 3068 delay: 0, 3069 duration: [300, 250], 3070 getReferenceClientRect: null, 3071 hideOnClick: true, 3072 ignoreAttributes: false, 3073 interactive: false, 3074 interactiveBorder: 2, 3075 interactiveDebounce: 0, 3076 moveTransition: '', 3077 offset: [0, 10], 3078 onAfterUpdate: function onAfterUpdate() {}, 3079 onBeforeUpdate: function onBeforeUpdate() {}, 3080 onCreate: function onCreate() {}, 3081 onDestroy: function onDestroy() {}, 3082 onHidden: function onHidden() {}, 3083 onHide: function onHide() {}, 3084 onMount: function onMount() {}, 3085 onShow: function onShow() {}, 3086 onShown: function onShown() {}, 3087 onTrigger: function onTrigger() {}, 3088 onUntrigger: function onUntrigger() {}, 3089 onClickOutside: function onClickOutside() {}, 3090 placement: 'top', 3091 plugins: [], 3092 popperOptions: {}, 3093 render: null, 3094 showOnCreate: false, 3095 touch: true, 3096 trigger: 'mouseenter focus', 3097 triggerTarget: null 3098}, pluginProps, renderProps); 3099var defaultKeys = Object.keys(defaultProps); 3100var setDefaultProps = function setDefaultProps(partialProps) { 3101 /* istanbul ignore else */ 3102 if (false) {} 3103 3104 var keys = Object.keys(partialProps); 3105 keys.forEach(function (key) { 3106 defaultProps[key] = partialProps[key]; 3107 }); 3108}; 3109function getExtendedPassedProps(passedProps) { 3110 var plugins = passedProps.plugins || []; 3111 var pluginProps = plugins.reduce(function (acc, plugin) { 3112 var name = plugin.name, 3113 defaultValue = plugin.defaultValue; 3114 3115 if (name) { 3116 var _name; 3117 3118 acc[name] = passedProps[name] !== undefined ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue; 3119 } 3120 3121 return acc; 3122 }, {}); 3123 return Object.assign({}, passedProps, pluginProps); 3124} 3125function getDataAttributeProps(reference, plugins) { 3126 var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, { 3127 plugins: plugins 3128 }))) : defaultKeys; 3129 var props = propKeys.reduce(function (acc, key) { 3130 var valueAsString = (reference.getAttribute("data-tippy-" + key) || '').trim(); 3131 3132 if (!valueAsString) { 3133 return acc; 3134 } 3135 3136 if (key === 'content') { 3137 acc[key] = valueAsString; 3138 } else { 3139 try { 3140 acc[key] = JSON.parse(valueAsString); 3141 } catch (e) { 3142 acc[key] = valueAsString; 3143 } 3144 } 3145 3146 return acc; 3147 }, {}); 3148 return props; 3149} 3150function evaluateProps(reference, props) { 3151 var out = Object.assign({}, props, { 3152 content: invokeWithArgsOrReturn(props.content, [reference]) 3153 }, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins)); 3154 out.aria = Object.assign({}, defaultProps.aria, out.aria); 3155 out.aria = { 3156 expanded: out.aria.expanded === 'auto' ? props.interactive : out.aria.expanded, 3157 content: out.aria.content === 'auto' ? props.interactive ? null : 'describedby' : out.aria.content 3158 }; 3159 return out; 3160} 3161function validateProps(partialProps, plugins) { 3162 if (partialProps === void 0) { 3163 partialProps = {}; 3164 } 3165 3166 if (plugins === void 0) { 3167 plugins = []; 3168 } 3169 3170 var keys = Object.keys(partialProps); 3171 keys.forEach(function (prop) { 3172 var nonPluginProps = removeProperties(defaultProps, Object.keys(pluginProps)); 3173 var didPassUnknownProp = !tippy_esm_hasOwnProperty(nonPluginProps, prop); // Check if the prop exists in `plugins` 3174 3175 if (didPassUnknownProp) { 3176 didPassUnknownProp = plugins.filter(function (plugin) { 3177 return plugin.name === prop; 3178 }).length === 0; 3179 } 3180 3181 warnWhen(didPassUnknownProp, ["`" + prop + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", 'a plugin, forgot to pass it in an array as props.plugins.', '\n\n', 'All props: https://atomiks.github.io/tippyjs/v6/all-props/\n', 'Plugins: https://atomiks.github.io/tippyjs/v6/plugins/'].join(' ')); 3182 }); 3183} 3184 3185var innerHTML = function innerHTML() { 3186 return 'innerHTML'; 3187}; 3188 3189function dangerouslySetInnerHTML(element, html) { 3190 element[innerHTML()] = html; 3191} 3192 3193function createArrowElement(value) { 3194 var arrow = div(); 3195 3196 if (value === true) { 3197 arrow.className = ARROW_CLASS; 3198 } else { 3199 arrow.className = SVG_ARROW_CLASS; 3200 3201 if (tippy_esm_isElement(value)) { 3202 arrow.appendChild(value); 3203 } else { 3204 dangerouslySetInnerHTML(arrow, value); 3205 } 3206 } 3207 3208 return arrow; 3209} 3210 3211function setContent(content, props) { 3212 if (tippy_esm_isElement(props.content)) { 3213 dangerouslySetInnerHTML(content, ''); 3214 content.appendChild(props.content); 3215 } else if (typeof props.content !== 'function') { 3216 if (props.allowHTML) { 3217 dangerouslySetInnerHTML(content, props.content); 3218 } else { 3219 content.textContent = props.content; 3220 } 3221 } 3222} 3223function getChildren(popper) { 3224 var box = popper.firstElementChild; 3225 var boxChildren = arrayFrom(box.children); 3226 return { 3227 box: box, 3228 content: boxChildren.find(function (node) { 3229 return node.classList.contains(CONTENT_CLASS); 3230 }), 3231 arrow: boxChildren.find(function (node) { 3232 return node.classList.contains(ARROW_CLASS) || node.classList.contains(SVG_ARROW_CLASS); 3233 }), 3234 backdrop: boxChildren.find(function (node) { 3235 return node.classList.contains(BACKDROP_CLASS); 3236 }) 3237 }; 3238} 3239function render(instance) { 3240 var popper = div(); 3241 var box = div(); 3242 box.className = BOX_CLASS; 3243 box.setAttribute('data-state', 'hidden'); 3244 box.setAttribute('tabindex', '-1'); 3245 var content = div(); 3246 content.className = CONTENT_CLASS; 3247 content.setAttribute('data-state', 'hidden'); 3248 setContent(content, instance.props); 3249 popper.appendChild(box); 3250 box.appendChild(content); 3251 onUpdate(instance.props, instance.props); 3252 3253 function onUpdate(prevProps, nextProps) { 3254 var _getChildren = getChildren(popper), 3255 box = _getChildren.box, 3256 content = _getChildren.content, 3257 arrow = _getChildren.arrow; 3258 3259 if (nextProps.theme) { 3260 box.setAttribute('data-theme', nextProps.theme); 3261 } else { 3262 box.removeAttribute('data-theme'); 3263 } 3264 3265 if (typeof nextProps.animation === 'string') { 3266 box.setAttribute('data-animation', nextProps.animation); 3267 } else { 3268 box.removeAttribute('data-animation'); 3269 } 3270 3271 if (nextProps.inertia) { 3272 box.setAttribute('data-inertia', ''); 3273 } else { 3274 box.removeAttribute('data-inertia'); 3275 } 3276 3277 box.style.maxWidth = typeof nextProps.maxWidth === 'number' ? nextProps.maxWidth + "px" : nextProps.maxWidth; 3278 3279 if (nextProps.role) { 3280 box.setAttribute('role', nextProps.role); 3281 } else { 3282 box.removeAttribute('role'); 3283 } 3284 3285 if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) { 3286 setContent(content, instance.props); 3287 } 3288 3289 if (nextProps.arrow) { 3290 if (!arrow) { 3291 box.appendChild(createArrowElement(nextProps.arrow)); 3292 } else if (prevProps.arrow !== nextProps.arrow) { 3293 box.removeChild(arrow); 3294 box.appendChild(createArrowElement(nextProps.arrow)); 3295 } 3296 } else if (arrow) { 3297 box.removeChild(arrow); 3298 } 3299 } 3300 3301 return { 3302 popper: popper, 3303 onUpdate: onUpdate 3304 }; 3305} // Runtime check to identify if the render function is the default one; this 3306// way we can apply default CSS transitions logic and it can be tree-shaken away 3307 3308render.$$tippy = true; 3309 3310var idCounter = 1; 3311var mouseMoveListeners = []; // Used by `hideAll()` 3312 3313var mountedInstances = []; 3314function createTippy(reference, passedProps) { 3315 var props = evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); // =========================================================================== 3316 // ð Private members 3317 // =========================================================================== 3318 3319 var showTimeout; 3320 var hideTimeout; 3321 var scheduleHideAnimationFrame; 3322 var isVisibleFromClick = false;
vendor: 1,637 bytes, lines 3323-3376
3323 var didHideDueToDocumentMouseDown = false; 3324 var didTouchMove = false; 3325 var ignoreOnFirstUpdate = false; 3326 var lastTriggerEvent; 3327 var currentTransitionEndListener; 3328 var onFirstUpdate; 3329 var listeners = []; 3330 var debouncedOnMouseMove = tippy_esm_debounce(onMouseMove, props.interactiveDebounce); 3331 var currentTarget; // =========================================================================== 3332 // ð Public members 3333 // =========================================================================== 3334 3335 var id = idCounter++; 3336 var popperInstance = null; 3337 var plugins = unique(props.plugins); 3338 var state = { 3339 // Is the instance currently enabled? 3340 isEnabled: true, 3341 // Is the tippy currently showing and not transitioning out? 3342 isVisible: false, 3343 // Has the instance been destroyed? 3344 isDestroyed: false, 3345 // Is the tippy currently mounted to the DOM? 3346 isMounted: false, 3347 // Has the tippy finished transitioning in? 3348 isShown: false 3349 }; 3350 var instance = { 3351 // properties 3352 id: id, 3353 reference: reference, 3354 popper: div(), 3355 popperInstance: popperInstance, 3356 props: props, 3357 state: state, 3358 plugins: plugins, 3359 // methods 3360 clearDelayTimeouts: clearDelayTimeouts, 3361 setProps: setProps, 3362 setContent: setContent, 3363 show: show, 3364 hide: hide, 3365 hideWithInteractivity: hideWithInteractivity, 3366 enable: enable, 3367 disable: disable, 3368 unmount: unmount, 3369 destroy: destroy 3370 }; // TODO: Investigate why this early return causes a TDZ error in the tests â 3371 // it doesn't seem to happen in the browser 3372 3373 /* istanbul ignore if */ 3374 3375 if (!props.render) { 3376 if (false) {
vendor: 14,960 bytes, lines 3376-3885
3376} 3377 3378 return instance; 3379 } // =========================================================================== 3380 // Initial mutations 3381 // =========================================================================== 3382 3383 3384 var _props$render = props.render(instance), 3385 popper = _props$render.popper, 3386 onUpdate = _props$render.onUpdate; 3387 3388 popper.setAttribute('data-tippy-root', ''); 3389 popper.id = "tippy-" + instance.id; 3390 instance.popper = popper; 3391 reference._tippy = instance; 3392 popper._tippy = instance; 3393 var pluginsHooks = plugins.map(function (plugin) { 3394 return plugin.fn(instance); 3395 }); 3396 var hasAriaExpanded = reference.hasAttribute('aria-expanded'); 3397 addListeners(); 3398 handleAriaExpandedAttribute(); 3399 handleStyles(); 3400 invokeHook('onCreate', [instance]); 3401 3402 if (props.showOnCreate) { 3403 scheduleShow(); 3404 } // Prevent a tippy with a delay from hiding if the cursor left then returned 3405 // before it started hiding 3406 3407 3408 popper.addEventListener('mouseenter', function () { 3409 if (instance.props.interactive && instance.state.isVisible) { 3410 instance.clearDelayTimeouts(); 3411 } 3412 }); 3413 popper.addEventListener('mouseleave', function () { 3414 if (instance.props.interactive && instance.props.trigger.indexOf('mouseenter') >= 0) { 3415 getDocument().addEventListener('mousemove', debouncedOnMouseMove); 3416 } 3417 }); 3418 return instance; // =========================================================================== 3419 // ð Private methods 3420 // =========================================================================== 3421 3422 function getNormalizedTouchSettings() { 3423 var touch = instance.props.touch; 3424 return Array.isArray(touch) ? touch : [touch, 0]; 3425 } 3426 3427 function getIsCustomTouchBehavior() { 3428 return getNormalizedTouchSettings()[0] === 'hold'; 3429 } 3430 3431 function getIsDefaultRenderFn() { 3432 var _instance$props$rende; 3433 3434 // @ts-ignore 3435 return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy); 3436 } 3437 3438 function getCurrentTarget() { 3439 return currentTarget || reference; 3440 } 3441 3442 function getDocument() { 3443 var parent = getCurrentTarget().parentNode; 3444 return parent ? getOwnerDocument(parent) : document; 3445 } 3446 3447 function getDefaultTemplateChildren() { 3448 return getChildren(popper); 3449 } 3450 3451 function getDelay(isShow) { 3452 // For touch or keyboard input, force `0` delay for UX reasons 3453 // Also if the instance is mounted but not visible (transitioning out), 3454 // ignore delay 3455 if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === 'focus') { 3456 return 0; 3457 } 3458 3459 return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay); 3460 } 3461 3462 function handleStyles(fromHide) { 3463 if (fromHide === void 0) { 3464 fromHide = false; 3465 } 3466 3467 popper.style.pointerEvents = instance.props.interactive && !fromHide ? '' : 'none'; 3468 popper.style.zIndex = "" + instance.props.zIndex; 3469 } 3470 3471 function invokeHook(hook, args, shouldInvokePropsHook) { 3472 if (shouldInvokePropsHook === void 0) { 3473 shouldInvokePropsHook = true; 3474 } 3475 3476 pluginsHooks.forEach(function (pluginHooks) { 3477 if (pluginHooks[hook]) { 3478 pluginHooks[hook].apply(pluginHooks, args); 3479 } 3480 }); 3481 3482 if (shouldInvokePropsHook) { 3483 var _instance$props; 3484 3485 (_instance$props = instance.props)[hook].apply(_instance$props, args); 3486 } 3487 } 3488 3489 function handleAriaContentAttribute() { 3490 var aria = instance.props.aria; 3491 3492 if (!aria.content) { 3493 return; 3494 } 3495 3496 var attr = "aria-" + aria.content; 3497 var id = popper.id; 3498 var nodes = normalizeToArray(instance.props.triggerTarget || reference); 3499 nodes.forEach(function (node) { 3500 var currentValue = node.getAttribute(attr); 3501 3502 if (instance.state.isVisible) { 3503 node.setAttribute(attr, currentValue ? currentValue + " " + id : id); 3504 } else { 3505 var nextValue = currentValue && currentValue.replace(id, '').trim(); 3506 3507 if (nextValue) { 3508 node.setAttribute(attr, nextValue); 3509 } else { 3510 node.removeAttribute(attr); 3511 } 3512 } 3513 }); 3514 } 3515 3516 function handleAriaExpandedAttribute() { 3517 if (hasAriaExpanded || !instance.props.aria.expanded) { 3518 return; 3519 } 3520 3521 var nodes = normalizeToArray(instance.props.triggerTarget || reference); 3522 nodes.forEach(function (node) { 3523 if (instance.props.interactive) { 3524 node.setAttribute('aria-expanded', instance.state.isVisible && node === getCurrentTarget() ? 'true' : 'false'); 3525 } else { 3526 node.removeAttribute('aria-expanded'); 3527 } 3528 }); 3529 } 3530 3531 function cleanupInteractiveMouseListeners() { 3532 getDocument().removeEventListener('mousemove', debouncedOnMouseMove); 3533 mouseMoveListeners = mouseMoveListeners.filter(function (listener) { 3534 return listener !== debouncedOnMouseMove; 3535 }); 3536 } 3537 3538 function onDocumentPress(event) { 3539 // Moved finger to scroll instead of an intentional tap outside 3540 if (currentInput.isTouch) { 3541 if (didTouchMove || event.type === 'mousedown') { 3542 return; 3543 } 3544 } 3545 3546 var actualTarget = event.composedPath && event.composedPath()[0] || event.target; // Clicked on interactive popper 3547 3548 if (instance.props.interactive && actualContains(popper, actualTarget)) { 3549 return; 3550 } // Clicked on the event listeners target 3551 3552 3553 if (normalizeToArray(instance.props.triggerTarget || reference).some(function (el) { 3554 return actualContains(el, actualTarget); 3555 })) { 3556 if (currentInput.isTouch) { 3557 return; 3558 } 3559 3560 if (instance.state.isVisible && instance.props.trigger.indexOf('click') >= 0) { 3561 return; 3562 } 3563 } else { 3564 invokeHook('onClickOutside', [instance, event]); 3565 } 3566 3567 if (instance.props.hideOnClick === true) { 3568 instance.clearDelayTimeouts(); 3569 instance.hide(); // `mousedown` event is fired right before `focus` if pressing the 3570 // currentTarget. This lets a tippy with `focus` trigger know that it 3571 // should not show 3572 3573 didHideDueToDocumentMouseDown = true; 3574 setTimeout(function () { 3575 didHideDueToDocumentMouseDown = false; 3576 }); // The listener gets added in `scheduleShow()`, but this may be hiding it 3577 // before it shows, and hide()'s early bail-out behavior can prevent it 3578 // from being cleaned up 3579 3580 if (!instance.state.isMounted) { 3581 removeDocumentPress(); 3582 } 3583 } 3584 } 3585 3586 function onTouchMove() { 3587 didTouchMove = true; 3588 } 3589 3590 function onTouchStart() { 3591 didTouchMove = false; 3592 } 3593 3594 function addDocumentPress() { 3595 var doc = getDocument(); 3596 doc.addEventListener('mousedown', onDocumentPress, true); 3597 doc.addEventListener('touchend', onDocumentPress, TOUCH_OPTIONS); 3598 doc.addEventListener('touchstart', onTouchStart, TOUCH_OPTIONS); 3599 doc.addEventListener('touchmove', onTouchMove, TOUCH_OPTIONS); 3600 } 3601 3602 function removeDocumentPress() { 3603 var doc = getDocument(); 3604 doc.removeEventListener('mousedown', onDocumentPress, true); 3605 doc.removeEventListener('touchend', onDocumentPress, TOUCH_OPTIONS); 3606 doc.removeEventListener('touchstart', onTouchStart, TOUCH_OPTIONS); 3607 doc.removeEventListener('touchmove', onTouchMove, TOUCH_OPTIONS); 3608 } 3609 3610 function onTransitionedOut(duration, callback) { 3611 onTransitionEnd(duration, function () { 3612 if (!instance.state.isVisible && popper.parentNode && popper.parentNode.contains(popper)) { 3613 callback(); 3614 } 3615 }); 3616 } 3617 3618 function onTransitionedIn(duration, callback) { 3619 onTransitionEnd(duration, callback); 3620 } 3621 3622 function onTransitionEnd(duration, callback) { 3623 var box = getDefaultTemplateChildren().box; 3624 3625 function listener(event) { 3626 if (event.target === box) { 3627 updateTransitionEndListener(box, 'remove', listener); 3628 callback(); 3629 } 3630 } // Make callback synchronous if duration is 0 3631 // `transitionend` won't fire otherwise 3632 3633 3634 if (duration === 0) { 3635 return callback(); 3636 } 3637 3638 updateTransitionEndListener(box, 'remove', currentTransitionEndListener); 3639 updateTransitionEndListener(box, 'add', listener); 3640 currentTransitionEndListener = listener; 3641 } 3642 3643 function on(eventType, handler, options) { 3644 if (options === void 0) { 3645 options = false; 3646 } 3647 3648 var nodes = normalizeToArray(instance.props.triggerTarget || reference); 3649 nodes.forEach(function (node) { 3650 node.addEventListener(eventType, handler, options); 3651 listeners.push({ 3652 node: node, 3653 eventType: eventType, 3654 handler: handler, 3655 options: options 3656 }); 3657 }); 3658 } 3659 3660 function addListeners() { 3661 if (getIsCustomTouchBehavior()) { 3662 on('touchstart', onTrigger, { 3663 passive: true 3664 }); 3665 on('touchend', onMouseLeave, { 3666 passive: true 3667 }); 3668 } 3669 3670 splitBySpaces(instance.props.trigger).forEach(function (eventType) { 3671 if (eventType === 'manual') { 3672 return; 3673 } 3674 3675 on(eventType, onTrigger); 3676 3677 switch (eventType) { 3678 case 'mouseenter': 3679 on('mouseleave', onMouseLeave); 3680 break; 3681 3682 case 'focus': 3683 on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut); 3684 break; 3685 3686 case 'focusin': 3687 on('focusout', onBlurOrFocusOut); 3688 break; 3689 } 3690 }); 3691 } 3692 3693 function removeListeners() { 3694 listeners.forEach(function (_ref) { 3695 var node = _ref.node, 3696 eventType = _ref.eventType, 3697 handler = _ref.handler, 3698 options = _ref.options; 3699 node.removeEventListener(eventType, handler, options); 3700 }); 3701 listeners = []; 3702 } 3703 3704 function onTrigger(event) { 3705 var _lastTriggerEvent; 3706 3707 var shouldScheduleClickHide = false; 3708 3709 if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) { 3710 return; 3711 } 3712 3713 var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === 'focus'; 3714 lastTriggerEvent = event; 3715 currentTarget = event.currentTarget; 3716 handleAriaExpandedAttribute(); 3717 3718 if (!instance.state.isVisible && isMouseEvent(event)) { 3719 // If scrolling, `mouseenter` events can be fired if the cursor lands 3720 // over a new target, but `mousemove` events don't get fired. This 3721 // causes interactive tooltips to get stuck open until the cursor is 3722 // moved 3723 mouseMoveListeners.forEach(function (listener) { 3724 return listener(event); 3725 }); 3726 } // Toggle show/hide when clicking click-triggered tooltips 3727 3728 3729 if (event.type === 'click' && (instance.props.trigger.indexOf('mouseenter') < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) { 3730 shouldScheduleClickHide = true; 3731 } else { 3732 scheduleShow(event); 3733 } 3734 3735 if (event.type === 'click') { 3736 isVisibleFromClick = !shouldScheduleClickHide; 3737 } 3738 3739 if (shouldScheduleClickHide && !wasFocused) { 3740 scheduleHide(event); 3741 } 3742 } 3743 3744 function onMouseMove(event) { 3745 var target = event.target; 3746 var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper.contains(target); 3747 3748 if (event.type === 'mousemove' && isCursorOverReferenceOrPopper) { 3749 return; 3750 } 3751 3752 var popperTreeData = getNestedPopperTree().concat(popper).map(function (popper) { 3753 var _instance$popperInsta; 3754 3755 var instance = popper._tippy; 3756 var state = (_instance$popperInsta = instance.popperInstance) == null ? void 0 : _instance$popperInsta.state; 3757 3758 if (state) { 3759 return { 3760 popperRect: popper.getBoundingClientRect(), 3761 popperState: state, 3762 props: props 3763 }; 3764 } 3765 3766 return null; 3767 }).filter(Boolean); 3768 3769 if (isCursorOutsideInteractiveBorder(popperTreeData, event)) { 3770 cleanupInteractiveMouseListeners(); 3771 scheduleHide(event); 3772 } 3773 } 3774 3775 function onMouseLeave(event) { 3776 var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf('click') >= 0 && isVisibleFromClick; 3777 3778 if (shouldBail) { 3779 return; 3780 } 3781 3782 if (instance.props.interactive) { 3783 instance.hideWithInteractivity(event); 3784 return; 3785 } 3786 3787 scheduleHide(event); 3788 } 3789 3790 function onBlurOrFocusOut(event) { 3791 if (instance.props.trigger.indexOf('focusin') < 0 && event.target !== getCurrentTarget()) { 3792 return; 3793 } // If focus was moved to within the popper 3794 3795 3796 if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) { 3797 return; 3798 } 3799 3800 scheduleHide(event); 3801 } 3802 3803 function isEventListenerStopped(event) { 3804 return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf('touch') >= 0 : false; 3805 } 3806 3807 function createPopperInstance() { 3808 destroyPopperInstance(); 3809 var _instance$props2 = instance.props, 3810 popperOptions = _instance$props2.popperOptions, 3811 placement = _instance$props2.placement, 3812 offset = _instance$props2.offset, 3813 getReferenceClientRect = _instance$props2.getReferenceClientRect, 3814 moveTransition = _instance$props2.moveTransition; 3815 var arrow = getIsDefaultRenderFn() ? getChildren(popper).arrow : null; 3816 var computedReference = getReferenceClientRect ? { 3817 getBoundingClientRect: getReferenceClientRect, 3818 contextElement: getReferenceClientRect.contextElement || getCurrentTarget() 3819 } : reference; 3820 var tippyModifier = { 3821 name: '$$tippy', 3822 enabled: true, 3823 phase: 'beforeWrite', 3824 requires: ['computeStyles'], 3825 fn: function fn(_ref2) { 3826 var state = _ref2.state; 3827 3828 if (getIsDefaultRenderFn()) { 3829 var _getDefaultTemplateCh = getDefaultTemplateChildren(), 3830 box = _getDefaultTemplateCh.box; 3831 3832 ['placement', 'reference-hidden', 'escaped'].forEach(function (attr) { 3833 if (attr === 'placement') { 3834 box.setAttribute('data-placement', state.placement); 3835 } else { 3836 if (state.attributes.popper["data-popper-" + attr]) { 3837 box.setAttribute("data-" + attr, ''); 3838 } else { 3839 box.removeAttribute("data-" + attr); 3840 } 3841 } 3842 }); 3843 state.attributes.popper = {}; 3844 } 3845 } 3846 }; 3847 var modifiers = [{ 3848 name: 'offset', 3849 options: { 3850 offset: offset 3851 } 3852 }, { 3853 name: 'preventOverflow', 3854 options: { 3855 padding: { 3856 top: 2, 3857 bottom: 2, 3858 left: 5, 3859 right: 5 3860 } 3861 } 3862 }, { 3863 name: 'flip', 3864 options: { 3865 padding: 5 3866 } 3867 }, { 3868 name: 'computeStyles', 3869 options: { 3870 adaptive: !moveTransition 3871 } 3872 }, tippyModifier]; 3873 3874 if (getIsDefaultRenderFn() && arrow) { 3875 modifiers.push({ 3876 name: 'arrow', 3877 options: { 3878 element: arrow, 3879 padding: 3 3880 } 3881 }); 3882 } 3883 3884 modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []); 3885 instance.popperInstance =
vendor: 3,654 bytes, lines 3885-4004
3885popper_createPopper(computedReference, popper, Object.assign({}, popperOptions, { 3886 placement: placement, 3887 onFirstUpdate: onFirstUpdate, 3888 modifiers: modifiers 3889 })); 3890 } 3891 3892 function destroyPopperInstance() { 3893 if (instance.popperInstance) { 3894 instance.popperInstance.destroy(); 3895 instance.popperInstance = null; 3896 } 3897 } 3898 3899 function mount() { 3900 var appendTo = instance.props.appendTo; 3901 var parentNode; // By default, we'll append the popper to the triggerTargets's parentNode so 3902 // it's directly after the reference element so the elements inside the 3903 // tippy can be tabbed to 3904 // If there are clipping issues, the user can specify a different appendTo 3905 // and ensure focus management is handled correctly manually 3906 3907 var node = getCurrentTarget(); 3908 3909 if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') { 3910 parentNode = node.parentNode; 3911 } else { 3912 parentNode = invokeWithArgsOrReturn(appendTo, [node]); 3913 } // The popper element needs to exist on the DOM before its position can be 3914 // updated as Popper needs to read its dimensions 3915 3916 3917 if (!parentNode.contains(popper)) { 3918 parentNode.appendChild(popper); 3919 } 3920 3921 instance.state.isMounted = true; 3922 createPopperInstance(); 3923 /* istanbul ignore else */ 3924 3925 if (false) {} 3926 } 3927 3928 function getNestedPopperTree() { 3929 return arrayFrom(popper.querySelectorAll('[data-tippy-root]')); 3930 } 3931 3932 function scheduleShow(event) { 3933 instance.clearDelayTimeouts(); 3934 3935 if (event) { 3936 invokeHook('onTrigger', [instance, event]); 3937 } 3938 3939 addDocumentPress(); 3940 var delay = getDelay(true); 3941 3942 var _getNormalizedTouchSe = getNormalizedTouchSettings(), 3943 touchValue = _getNormalizedTouchSe[0], 3944 touchDelay = _getNormalizedTouchSe[1]; 3945 3946 if (currentInput.isTouch && touchValue === 'hold' && touchDelay) { 3947 delay = touchDelay; 3948 } 3949 3950 if (delay) { 3951 showTimeout = setTimeout(function () { 3952 instance.show(); 3953 }, delay); 3954 } else { 3955 instance.show(); 3956 } 3957 } 3958 3959 function scheduleHide(event) { 3960 instance.clearDelayTimeouts(); 3961 invokeHook('onUntrigger', [instance, event]); 3962 3963 if (!instance.state.isVisible) { 3964 removeDocumentPress(); 3965 return; 3966 } // For interactive tippies, scheduleHide is added to a document.body handler 3967 // from onMouseLeave so must intercept scheduled hides from mousemove/leave 3968 // events when trigger contains mouseenter and click, and the tip is 3969 // currently shown as a result of a click. 3970 3971 3972 if (instance.props.trigger.indexOf('mouseenter') >= 0 && instance.props.trigger.indexOf('click') >= 0 && ['mouseleave', 'mousemove'].indexOf(event.type) >= 0 && isVisibleFromClick) { 3973 return; 3974 } 3975 3976 var delay = getDelay(false); 3977 3978 if (delay) { 3979 hideTimeout = setTimeout(function () { 3980 if (instance.state.isVisible) { 3981 instance.hide(); 3982 } 3983 }, delay); 3984 } else { 3985 // Fixes a `transitionend` problem when it fires 1 frame too 3986 // late sometimes, we don't want hide() to be called. 3987 scheduleHideAnimationFrame = requestAnimationFrame(function () { 3988 instance.hide(); 3989 }); 3990 } 3991 } // =========================================================================== 3992 // ð Public methods 3993 // =========================================================================== 3994 3995 3996 function enable() { 3997 instance.state.isEnabled = true; 3998 } 3999 4000 function disable() { 4001 // Disabling the instance should also hide it 4002 // https://github.com/atomiks/tippy.js-react/issues/106 4003 instance.hide(); 4004 instance.state.isEnabled = false;
vendor: 1,565 bytes, lines 4005-4054
4005 } 4006 4007 function clearDelayTimeouts() { 4008 clearTimeout(showTimeout); 4009 clearTimeout(hideTimeout); 4010 cancelAnimationFrame(scheduleHideAnimationFrame); 4011 } 4012 4013 function setProps(partialProps) { 4014 /* istanbul ignore else */ 4015 if (false) {} 4016 4017 if (instance.state.isDestroyed) { 4018 return; 4019 } 4020 4021 invokeHook('onBeforeUpdate', [instance, partialProps]); 4022 removeListeners(); 4023 var prevProps = instance.props; 4024 var nextProps = evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), { 4025 ignoreAttributes: true 4026 })); 4027 instance.props = nextProps; 4028 addListeners(); 4029 4030 if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) { 4031 cleanupInteractiveMouseListeners(); 4032 debouncedOnMouseMove = tippy_esm_debounce(onMouseMove, nextProps.interactiveDebounce); 4033 } // Ensure stale aria-expanded attributes are removed 4034 4035 4036 if (prevProps.triggerTarget && !nextProps.triggerTarget) { 4037 normalizeToArray(prevProps.triggerTarget).forEach(function (node) { 4038 node.removeAttribute('aria-expanded'); 4039 }); 4040 } else if (nextProps.triggerTarget) { 4041 reference.removeAttribute('aria-expanded'); 4042 } 4043 4044 handleAriaExpandedAttribute(); 4045 handleStyles(); 4046 4047 if (onUpdate) { 4048 onUpdate(prevProps, nextProps); 4049 } 4050 4051 if (instance.popperInstance) { 4052 createPopperInstance(); // Fixes an issue with nested tippies if they are all getting re-rendered, 4053 // and the nested ones get re-rendered first. 4054 // https://github.com/atomiks/tippyjs-react/issues/177
vendor: 5,494 bytes, lines 4055-4244
4055 // TODO: find a cleaner / more efficient solution(!) 4056 4057 getNestedPopperTree().forEach(function (nestedPopper) { 4058 // React (and other UI libs likely) requires a rAF wrapper as it flushes 4059 // its work in one 4060 requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate); 4061 }); 4062 } 4063 4064 invokeHook('onAfterUpdate', [instance, partialProps]); 4065 } 4066 4067 function setContent(content) { 4068 instance.setProps({ 4069 content: content 4070 }); 4071 } 4072 4073 function show() { 4074 /* istanbul ignore else */ 4075 if (false) {} // Early bail-out 4076 4077 4078 var isAlreadyVisible = instance.state.isVisible; 4079 var isDestroyed = instance.state.isDestroyed; 4080 var isDisabled = !instance.state.isEnabled; 4081 var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch; 4082 var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration); 4083 4084 if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) { 4085 return; 4086 } // Normalize `disabled` behavior across browsers. 4087 // Firefox allows events on disabled elements, but Chrome doesn't. 4088 // Using a wrapper element (i.e. <span>) is recommended. 4089 4090 4091 if (getCurrentTarget().hasAttribute('disabled')) { 4092 return; 4093 } 4094 4095 invokeHook('onShow', [instance], false); 4096 4097 if (instance.props.onShow(instance) === false) { 4098 return; 4099 } 4100 4101 instance.state.isVisible = true; 4102 4103 if (getIsDefaultRenderFn()) { 4104 popper.style.visibility = 'visible'; 4105 } 4106 4107 handleStyles(); 4108 addDocumentPress(); 4109 4110 if (!instance.state.isMounted) { 4111 popper.style.transition = 'none'; 4112 } // If flipping to the opposite side after hiding at least once, the 4113 // animation will use the wrong placement without resetting the duration 4114 4115 4116 if (getIsDefaultRenderFn()) { 4117 var _getDefaultTemplateCh2 = getDefaultTemplateChildren(), 4118 box = _getDefaultTemplateCh2.box, 4119 content = _getDefaultTemplateCh2.content; 4120 4121 setTransitionDuration([box, content], 0); 4122 } 4123 4124 onFirstUpdate = function onFirstUpdate() { 4125 var _instance$popperInsta2; 4126 4127 if (!instance.state.isVisible || ignoreOnFirstUpdate) { 4128 return; 4129 } 4130 4131 ignoreOnFirstUpdate = true; // reflow 4132 4133 void popper.offsetHeight; 4134 popper.style.transition = instance.props.moveTransition; 4135 4136 if (getIsDefaultRenderFn() && instance.props.animation) { 4137 var _getDefaultTemplateCh3 = getDefaultTemplateChildren(), 4138 _box = _getDefaultTemplateCh3.box, 4139 _content = _getDefaultTemplateCh3.content; 4140 4141 setTransitionDuration([_box, _content], duration); 4142 setVisibilityState([_box, _content], 'visible'); 4143 } 4144 4145 handleAriaContentAttribute(); 4146 handleAriaExpandedAttribute(); 4147 pushIfUnique(mountedInstances, instance); // certain modifiers (e.g. `maxSize`) require a second update after the 4148 // popper has been positioned for the first time 4149 4150 (_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate(); 4151 invokeHook('onMount', [instance]); 4152 4153 if (instance.props.animation && getIsDefaultRenderFn()) { 4154 onTransitionedIn(duration, function () { 4155 instance.state.isShown = true; 4156 invokeHook('onShown', [instance]); 4157 }); 4158 } 4159 }; 4160 4161 mount(); 4162 } 4163 4164 function hide() { 4165 /* istanbul ignore else */ 4166 if (false) {} // Early bail-out 4167 4168 4169 var isAlreadyHidden = !instance.state.isVisible; 4170 var isDestroyed = instance.state.isDestroyed; 4171 var isDisabled = !instance.state.isEnabled; 4172 var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration); 4173 4174 if (isAlreadyHidden || isDestroyed || isDisabled) { 4175 return; 4176 } 4177 4178 invokeHook('onHide', [instance], false); 4179 4180 if (instance.props.onHide(instance) === false) { 4181 return; 4182 } 4183 4184 instance.state.isVisible = false; 4185 instance.state.isShown = false; 4186 ignoreOnFirstUpdate = false; 4187 isVisibleFromClick = false; 4188 4189 if (getIsDefaultRenderFn()) { 4190 popper.style.visibility = 'hidden'; 4191 } 4192 4193 cleanupInteractiveMouseListeners(); 4194 removeDocumentPress(); 4195 handleStyles(true); 4196 4197 if (getIsDefaultRenderFn()) { 4198 var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), 4199 box = _getDefaultTemplateCh4.box, 4200 content = _getDefaultTemplateCh4.content; 4201 4202 if (instance.props.animation) { 4203 setTransitionDuration([box, content], duration); 4204 setVisibilityState([box, content], 'hidden'); 4205 } 4206 } 4207 4208 handleAriaContentAttribute(); 4209 handleAriaExpandedAttribute(); 4210 4211 if (instance.props.animation) { 4212 if (getIsDefaultRenderFn()) { 4213 onTransitionedOut(duration, instance.unmount); 4214 } 4215 } else { 4216 instance.unmount(); 4217 } 4218 } 4219 4220 function hideWithInteractivity(event) { 4221 /* istanbul ignore else */ 4222 if (false) {} 4223 4224 getDocument().addEventListener('mousemove', debouncedOnMouseMove); 4225 pushIfUnique(mouseMoveListeners, debouncedOnMouseMove); 4226 debouncedOnMouseMove(event); 4227 } 4228 4229 function unmount() { 4230 /* istanbul ignore else */ 4231 if (false) {} 4232 4233 if (instance.state.isVisible) { 4234 instance.hide(); 4235 } 4236 4237 if (!instance.state.isMounted) { 4238 return; 4239 } 4240 4241 destroyPopperInstance(); // If a popper is not interactive, it will be appended outside the popper 4242 // tree by default. This seems mainly for interactive tippies, but we should 4243 // find a workaround if possible 4244
vendor: 4,142 bytes, lines 4245-4401
4245 getNestedPopperTree().forEach(function (nestedPopper) { 4246 nestedPopper._tippy.unmount(); 4247 }); 4248 4249 if (popper.parentNode) { 4250 popper.parentNode.removeChild(popper); 4251 } 4252 4253 mountedInstances = mountedInstances.filter(function (i) { 4254 return i !== instance; 4255 }); 4256 instance.state.isMounted = false; 4257 invokeHook('onHidden', [instance]); 4258 } 4259 4260 function destroy() { 4261 /* istanbul ignore else */ 4262 if (false) {} 4263 4264 if (instance.state.isDestroyed) { 4265 return; 4266 } 4267 4268 instance.clearDelayTimeouts(); 4269 instance.unmount(); 4270 removeListeners(); 4271 delete reference._tippy; 4272 instance.state.isDestroyed = true; 4273 invokeHook('onDestroy', [instance]); 4274 } 4275} 4276 4277function tippy(targets, optionalProps) { 4278 if (optionalProps === void 0) { 4279 optionalProps = {}; 4280 } 4281 4282 var plugins = defaultProps.plugins.concat(optionalProps.plugins || []); 4283 /* istanbul ignore else */ 4284 4285 if (false) {} 4286 4287 bindGlobalEventListeners(); 4288 var passedProps = Object.assign({}, optionalProps, { 4289 plugins: plugins 4290 }); 4291 var elements = getArrayOfElements(targets); 4292 /* istanbul ignore else */ 4293 4294 if (false) { var isMoreThanOneReferenceElement, isSingleContentElement; } 4295 4296 var instances = elements.reduce(function (acc, reference) { 4297 var instance = reference && createTippy(reference, passedProps); 4298 4299 if (instance) { 4300 acc.push(instance); 4301 } 4302 4303 return acc; 4304 }, []); 4305 return tippy_esm_isElement(targets) ? instances[0] : instances; 4306} 4307 4308tippy.defaultProps = defaultProps; 4309tippy.setDefaultProps = setDefaultProps; 4310tippy.currentInput = currentInput; 4311var hideAll = function hideAll(_temp) { 4312 var _ref = _temp === void 0 ? {} : _temp, 4313 excludedReferenceOrInstance = _ref.exclude, 4314 duration = _ref.duration; 4315 4316 mountedInstances.forEach(function (instance) { 4317 var isExcluded = false; 4318 4319 if (excludedReferenceOrInstance) { 4320 isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance.reference === excludedReferenceOrInstance : instance.popper === excludedReferenceOrInstance.popper; 4321 } 4322 4323 if (!isExcluded) { 4324 var originalDuration = instance.props.duration; 4325 instance.setProps({ 4326 duration: duration 4327 }); 4328 instance.hide(); 4329 4330 if (!instance.state.isDestroyed) { 4331 instance.setProps({ 4332 duration: originalDuration 4333 }); 4334 } 4335 } 4336 }); 4337}; 4338 4339// every time the popper is destroyed (i.e. a new target), removing the styles 4340// and causing transitions to break for singletons when the console is open, but 4341// most notably for non-transform styles being used, `gpuAcceleration: false`. 4342 4343var applyStylesModifier = Object.assign({}, modifiers_applyStyles, { 4344 effect: function effect(_ref) { 4345 var state = _ref.state; 4346 var initialStyles = { 4347 popper: { 4348 position: state.options.strategy, 4349 left: '0', 4350 top: '0', 4351 margin: '0' 4352 }, 4353 arrow: { 4354 position: 'absolute' 4355 }, 4356 reference: {} 4357 }; 4358 Object.assign(state.elements.popper.style, initialStyles.popper); 4359 state.styles = initialStyles; 4360 4361 if (state.elements.arrow) { 4362 Object.assign(state.elements.arrow.style, initialStyles.arrow); 4363 } // intentionally return no cleanup function 4364 // return () => { ... } 4365 4366 } 4367}); 4368 4369var createSingleton = function createSingleton(tippyInstances, optionalProps) { 4370 var _optionalProps$popper; 4371 4372 if (optionalProps === void 0) { 4373 optionalProps = {}; 4374 } 4375 4376 /* istanbul ignore else */ 4377 if (false) {} 4378 4379 var individualInstances = tippyInstances; 4380 var references = []; 4381 var triggerTargets = []; 4382 var currentTarget; 4383 var overrides = optionalProps.overrides; 4384 var interceptSetPropsCleanups = []; 4385 var shownOnCreate = false; 4386 4387 function setTriggerTargets() { 4388 triggerTargets = individualInstances.map(function (instance) { 4389 return normalizeToArray(instance.props.triggerTarget || instance.reference); 4390 }).reduce(function (acc, item) { 4391 return acc.concat(item); 4392 }, []); 4393 } 4394 4395 function setReferences() { 4396 references = individualInstances.map(function (instance) { 4397 return instance.reference; 4398 }); 4399 } 4400 4401 function enableInstances(isEnabled) {
vendor: 4,960 bytes, lines 4402-4570
4402 individualInstances.forEach(function (instance) { 4403 if (isEnabled) { 4404 instance.enable(); 4405 } else { 4406 instance.disable(); 4407 } 4408 }); 4409 } 4410 4411 function interceptSetProps(singleton) { 4412 return individualInstances.map(function (instance) { 4413 var originalSetProps = instance.setProps; 4414 4415 instance.setProps = function (props) { 4416 originalSetProps(props); 4417 4418 if (instance.reference === currentTarget) { 4419 singleton.setProps(props); 4420 } 4421 }; 4422 4423 return function () { 4424 instance.setProps = originalSetProps; 4425 }; 4426 }); 4427 } // have to pass singleton, as it maybe undefined on first call 4428 4429 4430 function prepareInstance(singleton, target) { 4431 var index = triggerTargets.indexOf(target); // bail-out 4432 4433 if (target === currentTarget) { 4434 return; 4435 } 4436 4437 currentTarget = target; 4438 var overrideProps = (overrides || []).concat('content').reduce(function (acc, prop) { 4439 acc[prop] = individualInstances[index].props[prop]; 4440 return acc; 4441 }, {}); 4442 singleton.setProps(Object.assign({}, overrideProps, { 4443 getReferenceClientRect: typeof overrideProps.getReferenceClientRect === 'function' ? overrideProps.getReferenceClientRect : function () { 4444 var _references$index; 4445 4446 return (_references$index = references[index]) == null ? void 0 : _references$index.getBoundingClientRect(); 4447 } 4448 })); 4449 } 4450 4451 enableInstances(false); 4452 setReferences(); 4453 setTriggerTargets(); 4454 var plugin = { 4455 fn: function fn() { 4456 return { 4457 onDestroy: function onDestroy() { 4458 enableInstances(true); 4459 }, 4460 onHidden: function onHidden() { 4461 currentTarget = null; 4462 }, 4463 onClickOutside: function onClickOutside(instance) { 4464 if (instance.props.showOnCreate && !shownOnCreate) { 4465 shownOnCreate = true; 4466 currentTarget = null; 4467 } 4468 }, 4469 onShow: function onShow(instance) { 4470 if (instance.props.showOnCreate && !shownOnCreate) { 4471 shownOnCreate = true; 4472 prepareInstance(instance, references[0]); 4473 } 4474 }, 4475 onTrigger: function onTrigger(instance, event) { 4476 prepareInstance(instance, event.currentTarget); 4477 } 4478 }; 4479 } 4480 }; 4481 var singleton = tippy(div(), Object.assign({}, removeProperties(optionalProps, ['overrides']), { 4482 plugins: [plugin].concat(optionalProps.plugins || []), 4483 triggerTarget: triggerTargets, 4484 popperOptions: Object.assign({}, optionalProps.popperOptions, { 4485 modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier]) 4486 }) 4487 })); 4488 var originalShow = singleton.show; 4489 4490 singleton.show = function (target) { 4491 originalShow(); // first time, showOnCreate or programmatic call with no params 4492 // default to showing first instance 4493 4494 if (!currentTarget && target == null) { 4495 return prepareInstance(singleton, references[0]); 4496 } // triggered from event (do nothing as prepareInstance already called by onTrigger) 4497 // programmatic call with no params when already visible (do nothing again) 4498 4499 4500 if (currentTarget && target == null) { 4501 return; 4502 } // target is index of instance 4503 4504 4505 if (typeof target === 'number') { 4506 return references[target] && prepareInstance(singleton, references[target]); 4507 } // target is a child tippy instance 4508 4509 4510 if (individualInstances.indexOf(target) >= 0) { 4511 var ref = target.reference; 4512 return prepareInstance(singleton, ref); 4513 } // target is a ReferenceElement 4514 4515 4516 if (references.indexOf(target) >= 0) { 4517 return prepareInstance(singleton, target); 4518 } 4519 }; 4520 4521 singleton.showNext = function () { 4522 var first = references[0]; 4523 4524 if (!currentTarget) { 4525 return singleton.show(0); 4526 } 4527 4528 var index = references.indexOf(currentTarget); 4529 singleton.show(references[index + 1] || first); 4530 }; 4531 4532 singleton.showPrevious = function () { 4533 var last = references[references.length - 1]; 4534 4535 if (!currentTarget) { 4536 return singleton.show(last); 4537 } 4538 4539 var index = references.indexOf(currentTarget); 4540 var target = references[index - 1] || last; 4541 singleton.show(target); 4542 }; 4543 4544 var originalSetProps = singleton.setProps; 4545 4546 singleton.setProps = function (props) { 4547 overrides = props.overrides || overrides; 4548 originalSetProps(props); 4549 }; 4550 4551 singleton.setInstances = function (nextInstances) { 4552 enableInstances(true); 4553 interceptSetPropsCleanups.forEach(function (fn) { 4554 return fn(); 4555 }); 4556 individualInstances = nextInstances; 4557 enableInstances(false); 4558 setReferences(); 4559 setTriggerTargets(); 4560 interceptSetPropsCleanups = interceptSetProps(singleton); 4561 singleton.setProps({ 4562 triggerTarget: triggerTargets 4563 }); 4564 }; 4565 4566 interceptSetPropsCleanups = interceptSetProps(singleton); 4567 return singleton; 4568}; 4569 4570var BUBBLING_EVENTS_MAP = {
vendor: 4,399 bytes, lines 4571-4738
4571 mouseover: 'mouseenter', 4572 focusin: 'focus', 4573 click: 'click' 4574}; 4575/** 4576 * Creates a delegate instance that controls the creation of tippy instances 4577 * for child elements (`target` CSS selector). 4578 */ 4579 4580function delegate(targets, props) { 4581 /* istanbul ignore else */ 4582 if (false) {} 4583 4584 var listeners = []; 4585 var childTippyInstances = []; 4586 var disabled = false; 4587 var target = props.target; 4588 var nativeProps = removeProperties(props, ['target']); 4589 var parentProps = Object.assign({}, nativeProps, { 4590 trigger: 'manual', 4591 touch: false 4592 }); 4593 var childProps = Object.assign({ 4594 touch: defaultProps.touch 4595 }, nativeProps, { 4596 showOnCreate: true 4597 }); 4598 var returnValue = tippy(targets, parentProps); 4599 var normalizedReturnValue = normalizeToArray(returnValue); 4600 4601 function onTrigger(event) { 4602 if (!event.target || disabled) { 4603 return; 4604 } 4605 4606 var targetNode = event.target.closest(target); 4607 4608 if (!targetNode) { 4609 return; 4610 } // Get relevant trigger with fallbacks: 4611 // 1. Check `data-tippy-trigger` attribute on target node 4612 // 2. Fallback to `trigger` passed to `delegate()` 4613 // 3. Fallback to `defaultProps.trigger` 4614 4615 4616 var trigger = targetNode.getAttribute('data-tippy-trigger') || props.trigger || defaultProps.trigger; // @ts-ignore 4617 4618 if (targetNode._tippy) { 4619 return; 4620 } 4621 4622 if (event.type === 'touchstart' && typeof childProps.touch === 'boolean') { 4623 return; 4624 } 4625 4626 if (event.type !== 'touchstart' && trigger.indexOf(BUBBLING_EVENTS_MAP[event.type]) < 0) { 4627 return; 4628 } 4629 4630 var instance = tippy(targetNode, childProps); 4631 4632 if (instance) { 4633 childTippyInstances = childTippyInstances.concat(instance); 4634 } 4635 } 4636 4637 function on(node, eventType, handler, options) { 4638 if (options === void 0) { 4639 options = false; 4640 } 4641 4642 node.addEventListener(eventType, handler, options); 4643 listeners.push({ 4644 node: node, 4645 eventType: eventType, 4646 handler: handler, 4647 options: options 4648 }); 4649 } 4650 4651 function addEventListeners(instance) { 4652 var reference = instance.reference; 4653 on(reference, 'touchstart', onTrigger, TOUCH_OPTIONS); 4654 on(reference, 'mouseover', onTrigger); 4655 on(reference, 'focusin', onTrigger); 4656 on(reference, 'click', onTrigger); 4657 } 4658 4659 function removeEventListeners() { 4660 listeners.forEach(function (_ref) { 4661 var node = _ref.node, 4662 eventType = _ref.eventType, 4663 handler = _ref.handler, 4664 options = _ref.options; 4665 node.removeEventListener(eventType, handler, options); 4666 }); 4667 listeners = []; 4668 } 4669 4670 function applyMutations(instance) { 4671 var originalDestroy = instance.destroy; 4672 var originalEnable = instance.enable; 4673 var originalDisable = instance.disable; 4674 4675 instance.destroy = function (shouldDestroyChildInstances) { 4676 if (shouldDestroyChildInstances === void 0) { 4677 shouldDestroyChildInstances = true; 4678 } 4679 4680 if (shouldDestroyChildInstances) { 4681 childTippyInstances.forEach(function (instance) { 4682 instance.destroy(); 4683 }); 4684 } 4685 4686 childTippyInstances = []; 4687 removeEventListeners(); 4688 originalDestroy(); 4689 }; 4690 4691 instance.enable = function () { 4692 originalEnable(); 4693 childTippyInstances.forEach(function (instance) { 4694 return instance.enable(); 4695 }); 4696 disabled = false; 4697 }; 4698 4699 instance.disable = function () { 4700 originalDisable(); 4701 childTippyInstances.forEach(function (instance) { 4702 return instance.disable(); 4703 }); 4704 disabled = true; 4705 }; 4706 4707 addEventListeners(instance); 4708 } 4709 4710 normalizedReturnValue.forEach(applyMutations); 4711 return returnValue; 4712} 4713 4714var animateFill = { 4715 name: 'animateFill', 4716 defaultValue: false, 4717 fn: function fn(instance) { 4718 var _instance$props$rende; 4719 4720 // @ts-ignore 4721 if (!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy)) { 4722 if (false) {} 4723 4724 return {}; 4725 } 4726 4727 var _getChildren = getChildren(instance.popper), 4728 box = _getChildren.box, 4729 content = _getChildren.content; 4730 4731 var backdrop = instance.props.animateFill ? createBackdropElement() : null; 4732 return { 4733 onCreate: function onCreate() { 4734 if (backdrop) { 4735 box.insertBefore(backdrop, box.firstElementChild); 4736 box.setAttribute('data-animatefill', ''); 4737 box.style.overflow = 'hidden'; 4738 instance.setProps({
vendor: 11,711 bytes, lines 4739-5139
4739 arrow: false, 4740 animation: 'shift-away' 4741 }); 4742 } 4743 }, 4744 onMount: function onMount() { 4745 if (backdrop) { 4746 var transitionDuration = box.style.transitionDuration; 4747 var duration = Number(transitionDuration.replace('ms', '')); // The content should fade in after the backdrop has mostly filled the 4748 // tooltip element. `clip-path` is the other alternative but is not 4749 // well-supported and is buggy on some devices. 4750 4751 content.style.transitionDelay = Math.round(duration / 10) + "ms"; 4752 backdrop.style.transitionDuration = transitionDuration; 4753 setVisibilityState([backdrop], 'visible'); 4754 } 4755 }, 4756 onShow: function onShow() { 4757 if (backdrop) { 4758 backdrop.style.transitionDuration = '0ms'; 4759 } 4760 }, 4761 onHide: function onHide() { 4762 if (backdrop) { 4763 setVisibilityState([backdrop], 'hidden'); 4764 } 4765 } 4766 }; 4767 } 4768}; 4769 4770function createBackdropElement() { 4771 var backdrop = div(); 4772 backdrop.className = BACKDROP_CLASS; 4773 setVisibilityState([backdrop], 'hidden'); 4774 return backdrop; 4775} 4776 4777var mouseCoords = { 4778 clientX: 0, 4779 clientY: 0 4780}; 4781var activeInstances = []; 4782 4783function storeMouseCoords(_ref) { 4784 var clientX = _ref.clientX, 4785 clientY = _ref.clientY; 4786 mouseCoords = { 4787 clientX: clientX, 4788 clientY: clientY 4789 }; 4790} 4791 4792function addMouseCoordsListener(doc) { 4793 doc.addEventListener('mousemove', storeMouseCoords); 4794} 4795 4796function removeMouseCoordsListener(doc) { 4797 doc.removeEventListener('mousemove', storeMouseCoords); 4798} 4799 4800var followCursor = { 4801 name: 'followCursor', 4802 defaultValue: false, 4803 fn: function fn(instance) { 4804 var reference = instance.reference; 4805 var doc = getOwnerDocument(instance.props.triggerTarget || reference); 4806 var isInternalUpdate = false; 4807 var wasFocusEvent = false; 4808 var isUnmounted = true; 4809 var prevProps = instance.props; 4810 4811 function getIsInitialBehavior() { 4812 return instance.props.followCursor === 'initial' && instance.state.isVisible; 4813 } 4814 4815 function addListener() { 4816 doc.addEventListener('mousemove', onMouseMove); 4817 } 4818 4819 function removeListener() { 4820 doc.removeEventListener('mousemove', onMouseMove); 4821 } 4822 4823 function unsetGetReferenceClientRect() { 4824 isInternalUpdate = true; 4825 instance.setProps({ 4826 getReferenceClientRect: null 4827 }); 4828 isInternalUpdate = false; 4829 } 4830 4831 function onMouseMove(event) { 4832 // If the instance is interactive, avoid updating the position unless it's 4833 // over the reference element 4834 var isCursorOverReference = event.target ? reference.contains(event.target) : true; 4835 var followCursor = instance.props.followCursor; 4836 var clientX = event.clientX, 4837 clientY = event.clientY; 4838 var rect = reference.getBoundingClientRect(); 4839 var relativeX = clientX - rect.left; 4840 var relativeY = clientY - rect.top; 4841 4842 if (isCursorOverReference || !instance.props.interactive) { 4843 instance.setProps({ 4844 // @ts-ignore - unneeded DOMRect properties 4845 getReferenceClientRect: function getReferenceClientRect() { 4846 var rect = reference.getBoundingClientRect(); 4847 var x = clientX; 4848 var y = clientY; 4849 4850 if (followCursor === 'initial') { 4851 x = rect.left + relativeX; 4852 y = rect.top + relativeY; 4853 } 4854 4855 var top = followCursor === 'horizontal' ? rect.top : y; 4856 var right = followCursor === 'vertical' ? rect.right : x; 4857 var bottom = followCursor === 'horizontal' ? rect.bottom : y; 4858 var left = followCursor === 'vertical' ? rect.left : x; 4859 return { 4860 width: right - left, 4861 height: bottom - top, 4862 top: top, 4863 right: right, 4864 bottom: bottom, 4865 left: left 4866 }; 4867 } 4868 }); 4869 } 4870 } 4871 4872 function create() { 4873 if (instance.props.followCursor) { 4874 activeInstances.push({ 4875 instance: instance, 4876 doc: doc 4877 }); 4878 addMouseCoordsListener(doc); 4879 } 4880 } 4881 4882 function destroy() { 4883 activeInstances = activeInstances.filter(function (data) { 4884 return data.instance !== instance; 4885 }); 4886 4887 if (activeInstances.filter(function (data) { 4888 return data.doc === doc; 4889 }).length === 0) { 4890 removeMouseCoordsListener(doc); 4891 } 4892 } 4893 4894 return { 4895 onCreate: create, 4896 onDestroy: destroy, 4897 onBeforeUpdate: function onBeforeUpdate() { 4898 prevProps = instance.props; 4899 }, 4900 onAfterUpdate: function onAfterUpdate(_, _ref2) { 4901 var followCursor = _ref2.followCursor; 4902 4903 if (isInternalUpdate) { 4904 return; 4905 } 4906 4907 if (followCursor !== undefined && prevProps.followCursor !== followCursor) { 4908 destroy(); 4909 4910 if (followCursor) { 4911 create(); 4912 4913 if (instance.state.isMounted && !wasFocusEvent && !getIsInitialBehavior()) { 4914 addListener(); 4915 } 4916 } else { 4917 removeListener(); 4918 unsetGetReferenceClientRect(); 4919 } 4920 } 4921 }, 4922 onMount: function onMount() { 4923 if (instance.props.followCursor && !wasFocusEvent) { 4924 if (isUnmounted) { 4925 onMouseMove(mouseCoords); 4926 isUnmounted = false; 4927 } 4928 4929 if (!getIsInitialBehavior()) { 4930 addListener(); 4931 } 4932 } 4933 }, 4934 onTrigger: function onTrigger(_, event) { 4935 if (isMouseEvent(event)) { 4936 mouseCoords = { 4937 clientX: event.clientX, 4938 clientY: event.clientY 4939 }; 4940 } 4941 4942 wasFocusEvent = event.type === 'focus'; 4943 }, 4944 onHidden: function onHidden() { 4945 if (instance.props.followCursor) { 4946 unsetGetReferenceClientRect(); 4947 removeListener(); 4948 isUnmounted = true; 4949 } 4950 } 4951 }; 4952 } 4953}; 4954 4955function getProps(props, modifier) { 4956 var _props$popperOptions; 4957 4958 return { 4959 popperOptions: Object.assign({}, props.popperOptions, { 4960 modifiers: [].concat((((_props$popperOptions = props.popperOptions) == null ? void 0 : _props$popperOptions.modifiers) || []).filter(function (_ref) { 4961 var name = _ref.name; 4962 return name !== modifier.name; 4963 }), [modifier]) 4964 }) 4965 }; 4966} 4967 4968var inlinePositioning = { 4969 name: 'inlinePositioning', 4970 defaultValue: false, 4971 fn: function fn(instance) { 4972 var reference = instance.reference; 4973 4974 function isEnabled() { 4975 return !!instance.props.inlinePositioning; 4976 } 4977 4978 var placement; 4979 var cursorRectIndex = -1; 4980 var isInternalUpdate = false; 4981 var triedPlacements = []; 4982 var modifier = { 4983 name: 'tippyInlinePositioning', 4984 enabled: true, 4985 phase: 'afterWrite', 4986 fn: function fn(_ref2) { 4987 var state = _ref2.state; 4988 4989 if (isEnabled()) { 4990 if (triedPlacements.indexOf(state.placement) !== -1) { 4991 triedPlacements = []; 4992 } 4993 4994 if (placement !== state.placement && triedPlacements.indexOf(state.placement) === -1) { 4995 triedPlacements.push(state.placement); 4996 instance.setProps({ 4997 // @ts-ignore - unneeded DOMRect properties 4998 getReferenceClientRect: function getReferenceClientRect() { 4999 return _getReferenceClientRect(state.placement); 5000 } 5001 }); 5002 } 5003 5004 placement = state.placement; 5005 } 5006 } 5007 }; 5008 5009 function _getReferenceClientRect(placement) { 5010 return getInlineBoundingClientRect(tippy_esm_getBasePlacement(placement), reference.getBoundingClientRect(), arrayFrom(reference.getClientRects()), cursorRectIndex); 5011 } 5012 5013 function setInternalProps(partialProps) { 5014 isInternalUpdate = true; 5015 instance.setProps(partialProps); 5016 isInternalUpdate = false; 5017 } 5018 5019 function addModifier() { 5020 if (!isInternalUpdate) { 5021 setInternalProps(getProps(instance.props, modifier)); 5022 } 5023 } 5024 5025 return { 5026 onCreate: addModifier, 5027 onAfterUpdate: addModifier, 5028 onTrigger: function onTrigger(_, event) { 5029 if (isMouseEvent(event)) { 5030 var rects = arrayFrom(instance.reference.getClientRects()); 5031 var cursorRect = rects.find(function (rect) { 5032 return rect.left - 2 <= event.clientX && rect.right + 2 >= event.clientX && rect.top - 2 <= event.clientY && rect.bottom + 2 >= event.clientY; 5033 }); 5034 var index = rects.indexOf(cursorRect); 5035 cursorRectIndex = index > -1 ? index : cursorRectIndex; 5036 } 5037 }, 5038 onHidden: function onHidden() { 5039 cursorRectIndex = -1; 5040 } 5041 }; 5042 } 5043}; 5044function getInlineBoundingClientRect(currentBasePlacement, boundingRect, clientRects, cursorRectIndex) { 5045 // Not an inline element, or placement is not yet known 5046 if (clientRects.length < 2 || currentBasePlacement === null) { 5047 return boundingRect; 5048 } // There are two rects and they are disjoined 5049 5050 5051 if (clientRects.length === 2 && cursorRectIndex >= 0 && clientRects[0].left > clientRects[1].right) { 5052 return clientRects[cursorRectIndex] || boundingRect; 5053 } 5054 5055 switch (currentBasePlacement) { 5056 case 'top': 5057 case 'bottom': 5058 { 5059 var firstRect = clientRects[0]; 5060 var lastRect = clientRects[clientRects.length - 1]; 5061 var isTop = currentBasePlacement === 'top'; 5062 var top = firstRect.top; 5063 var bottom = lastRect.bottom; 5064 var left = isTop ? firstRect.left : lastRect.left; 5065 var right = isTop ? firstRect.right : lastRect.right; 5066 var width = right - left; 5067 var height = bottom - top; 5068 return { 5069 top: top, 5070 bottom: bottom, 5071 left: left, 5072 right: right, 5073 width: width, 5074 height: height 5075 }; 5076 } 5077 5078 case 'left': 5079 case 'right': 5080 { 5081 var minLeft = Math.min.apply(Math, clientRects.map(function (rects) { 5082 return rects.left; 5083 })); 5084 var maxRight = Math.max.apply(Math, clientRects.map(function (rects) { 5085 return rects.right; 5086 })); 5087 var measureRects = clientRects.filter(function (rect) { 5088 return currentBasePlacement === 'left' ? rect.left === minLeft : rect.right === maxRight; 5089 }); 5090 var _top = measureRects[0].top; 5091 var _bottom = measureRects[measureRects.length - 1].bottom; 5092 var _left = minLeft; 5093 var _right = maxRight; 5094 5095 var _width = _right - _left; 5096 5097 var _height = _bottom - _top; 5098 5099 return { 5100 top: _top, 5101 bottom: _bottom, 5102 left: _left, 5103 right: _right, 5104 width: _width, 5105 height: _height 5106 }; 5107 } 5108 5109 default: 5110 { 5111 return boundingRect; 5112 } 5113 } 5114} 5115 5116var sticky = { 5117 name: 'sticky', 5118 defaultValue: false, 5119 fn: function fn(instance) { 5120 var reference = instance.reference, 5121 popper = instance.popper; 5122 5123 function getReference() { 5124 return instance.popperInstance ? instance.popperInstance.state.elements.reference : reference; 5125 } 5126 5127 function shouldCheck(value) { 5128 return instance.props.sticky === true || instance.props.sticky === value; 5129 } 5130 5131 var prevRefRect = null; 5132 var prevPopRect = null; 5133 5134 function updatePosition() { 5135 var currentRefRect = shouldCheck('reference') ? getReference().getBoundingClientRect() : null; 5136 var currentPopRect = shouldCheck('popper') ? popper.getBoundingClientRect() : null; 5137 5138 if (currentRefRect && areRectsDifferent(prevRefRect, currentRefRect) || currentPopRect && areRectsDifferent(prevPopRect, currentPopRect)) { 5139 if (instance.popperInstance) {
5140 instance.popperInstance.update(); 5141 } 5142 } 5143 5144 prevRefRect = currentRefRect; 5145 prevPopRect = currentPopRect; 5146 5147 if (instance.state.isMounted) { 5148 requestAnimationFrame(updatePosition); 5149 } 5150 } 5151 5152 return { 5153 onMount: function onMount() { 5154 if (instance.props.sticky) { 5155 updatePosition(); 5156 } 5157 } 5158 }; 5159 } 5160}; 5161 5162function areRectsDifferent(rectA, rectB) { 5163 if (rectA && rectB) { 5164 return rectA.top !== rectB.top || rectA.right !== rectB.right || rectA.bottom !== rectB.bottom || rectA.left !== rectB.left; 5165 } 5166 5167 return true; 5168} 5169 5170tippy.setDefaultProps({ 5171 render: render 5172}); 5173 5174/* harmony default export */ const tippy_esm = (tippy); 5175 5176 5177 5178/***/ }), 5179 5180/***/ 5266: 5181/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 5182 5183"use strict"; 5184/* harmony export */ __webpack_require__.d(__webpack_exports__, { 5185/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__) 5186/* harmony export */ }); 5187var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { 5188 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 5189 return new (P || (P = Promise))(function (resolve, reject) { 5190 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 5191 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 5192 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 5193 step((generator = generator.apply(thisArg, _arguments || [])).next()); 5194 }); 5195}; 5196// --------- HELPERS 5197function getElementOffset(el) { 5198 let top = 0; 5199 let left = 0; 5200 let element = el; 5201 // Loop through the DOM tree 5202 // and add it's parent's offset to get page offset 5203 do { 5204 top += element.offsetTop || 0; 5205 left += element.offsetLeft || 0; 5206 element = element.offsetParent; 5207 } while (element); 5208 return { 5209 top, 5210 left, 5211 }; 5212} 5213// --------- SCROLL INTERFACES 5214// ScrollDomElement and ScrollWindow have identical interfaces 5215class ScrollDomElement { 5216 constructor(element) { 5217 this.element = element; 5218 } 5219 getHorizontalScroll() { 5220 return this.element.scrollLeft; 5221 } 5222 getVerticalScroll() { 5223 return this.element.scrollTop; 5224 } 5225 getMaxHorizontalScroll() { 5226 return this.element.scrollWidth - this.element.clientWidth; 5227 } 5228 getMaxVerticalScroll() { 5229 return this.element.scrollHeight - this.element.clientHeight; 5230 } 5231 getHorizontalElementScrollOffset(elementToScrollTo, elementToScroll) { 5232 return (getElementOffset(elementToScrollTo).left - 5233 getElementOffset(elementToScroll).left); 5234 } 5235 getVerticalElementScrollOffset(elementToScrollTo, elementToScroll) { 5236 return (getElementOffset(elementToScrollTo).top - 5237 getElementOffset(elementToScroll).top); 5238 } 5239 scrollTo(x, y) { 5240 this.element.scrollLeft = x; 5241 this.element.scrollTop = y; 5242 } 5243} 5244class ScrollWindow { 5245 constructor() { 5246 this.element = window; 5247 } 5248 getHorizontalScroll() { 5249 return window.scrollX || document.documentElement.scrollLeft; 5250 } 5251 getVerticalScroll() { 5252 return window.scrollY || document.documentElement.scrollTop; 5253 } 5254 getMaxHorizontalScroll() { 5255 return (Math.max(document.body.scrollWidth, document.documentElement.scrollWidth, document.body.offsetWidth, document.documentElement.offsetWidth, document.body.clientWidth, document.documentElement.clientWidth) - window.innerWidth); 5256 } 5257 getMaxVerticalScroll() { 5258 return (Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight) - window.innerHeight); 5259 } 5260 getHorizontalElementScrollOffset(elementToScrollTo) { 5261 const scrollLeft = window.scrollX || document.documentElement.scrollLeft; 5262 return scrollLeft + elementToScrollTo.getBoundingClientRect().left; 5263 } 5264 getVerticalElementScrollOffset(elementToScrollTo) { 5265 const scrollTop = window.scrollY || document.documentElement.scrollTop; 5266 return scrollTop + elementToScrollTo.getBoundingClientRect().top; 5267 } 5268 scrollTo(x, y) { 5269 window.scrollTo(x, y); 5270 } 5271} 5272const activeAnimations = { 5273 elements: [], 5274 cancelMethods: [], 5275 add: (element, cancelAnimation) => { 5276 activeAnimations.elements.push(element); 5277 activeAnimations.cancelMethods.push(cancelAnimation); 5278 }, 5279 remove: (element, shouldStop) => { 5280 const index = activeAnimations.elements.indexOf(element); 5281 if (index > -1) { 5282 // Stop animation 5283 if (shouldStop) { 5284 activeAnimations.cancelMethods[index](); 5285 } 5286 // Remove it 5287 activeAnimations.elements.splice(index, 1); 5288 activeAnimations.cancelMethods.splice(index, 1); 5289 } 5290 }, 5291}; 5292// --------- CHECK IF CODE IS RUNNING IN A BROWSER 5293const WINDOW_EXISTS = typeof window !== 'undefined';
5294// --------- ANIMATE SCROLL TO 5295const defaultOptions = { 5296 cancelOnUserAction: true, 5297 easing: (t) => --t * t * t + 1, 5298 elementToScroll: WINDOW_EXISTS ? window : null, 5299 horizontalOffset: 0, 5300 maxDuration: 3000, 5301 minDuration: 250, 5302 speed: 500, 5303 verticalOffset: 0, 5304}; 5305function animateScrollTo(numberOrCoordsOrElement, userOptions = {}) { 5306 return __awaiter(this, void 0, void 0, function* () { 5307 // Check for server rendering 5308 if (!WINDOW_EXISTS) { 5309 // @ts-ignore 5310 // If it still gets called on server, return Promise for API consistency 5311 return new Promise((resolve) => { 5312 resolve(false); // Returning false on server 5313 }); 5314 } 5315 else if (!window.Promise) { 5316 throw "Browser doesn't support Promises, and animated-scroll-to depends on it, please provide a polyfill."; 5317 } 5318 let x; 5319 let y; 5320 let scrollToElement; 5321 let options = Object.assign(Object.assign({}, defaultOptions), userOptions); 5322 const isWindow = options.elementToScroll === window; 5323 const isElement = !!options.elementToScroll.nodeName; 5324 if (!isWindow && !isElement) { 5325 throw 'Element to scroll needs to be either window or DOM element.'; 5326 } 5327 // Check for "scroll-behavior: smooth" as it can break the animation 5328 // https://github.com/Stanko/animated-scroll-to/issues/55 5329 const scrollBehaviorElement = isWindow 5330 ? document.documentElement 5331 : options.elementToScroll; 5332 const scrollBehavior = getComputedStyle(scrollBehaviorElement).getPropertyValue('scroll-behavior'); 5333 if (scrollBehavior === 'smooth') { 5334 console.warn(`${scrollBehaviorElement.tagName} has "scroll-behavior: smooth" which can mess up with animated-scroll-to's animations`); 5335 } 5336 // Select the correct scrolling interface 5337 const elementToScroll = isWindow 5338 ? new ScrollWindow() 5339 : new ScrollDomElement(options.elementToScroll); 5340 if (numberOrCoordsOrElement instanceof Element) { 5341 scrollToElement = numberOrCoordsOrElement; 5342 // If "elementToScroll" is not a parent of "scrollToElement" 5343 if (isElement && 5344 (!options.elementToScroll.contains(scrollToElement) || 5345 options.elementToScroll.isSameNode(scrollToElement))) { 5346 throw 'options.elementToScroll has to be a parent of scrollToElement'; 5347 } 5348 x = elementToScroll.getHorizontalElementScrollOffset(scrollToElement, options.elementToScroll); 5349 y = elementToScroll.getVerticalElementScrollOffset(scrollToElement, options.elementToScroll); 5350 } 5351 else if (typeof numberOrCoordsOrElement === 'number') { 5352 x = elementToScroll.getHorizontalScroll(); 5353 y = numberOrCoordsOrElement; 5354 } 5355 else if (Array.isArray(numberOrCoordsOrElement) && 5356 numberOrCoordsOrElement.length === 2) { 5357 x = 5358 numberOrCoordsOrElement[0] === null 5359 ? elementToScroll.getHorizontalScroll() 5360 : numberOrCoordsOrElement[0]; 5361 y = 5362 numberOrCoordsOrElement[1] === null 5363 ? elementToScroll.getVerticalScroll() 5364 : numberOrCoordsOrElement[1]; 5365 } 5366 else { 5367 // ERROR 5368 throw ('Wrong function signature. Check documentation.\n' + 5369 'Available method signatures are:\n' + 5370 ' animateScrollTo(y:number, options)\n' + 5371 ' animateScrollTo([x:number | null, y:number | null], options)\n' + 5372 ' animateScrollTo(scrollToElement:Element, options)'); 5373 } 5374 // Add offsets 5375 x += options.horizontalOffset; 5376 y += options.verticalOffset; 5377 // Horizontal scroll distance 5378 const maxHorizontalScroll = elementToScroll.getMaxHorizontalScroll(); 5379 const initialHorizontalScroll = elementToScroll.getHorizontalScroll(); 5380 // If user specified scroll position is greater than maximum available scroll 5381 if (x > maxHorizontalScroll) { 5382 x = maxHorizontalScroll; 5383 } 5384 // Calculate distance to scroll 5385 const horizontalDistanceToScroll = x - initialHorizontalScroll; 5386 // Vertical scroll distance distance 5387 const maxVerticalScroll = elementToScroll.getMaxVerticalScroll(); 5388 const initialVerticalScroll = elementToScroll.getVerticalScroll(); 5389 // If user specified scroll position is greater than maximum available scroll 5390 if (y > maxVerticalScroll) { 5391 y = maxVerticalScroll; 5392 } 5393 // Calculate distance to scroll 5394 const verticalDistanceToScroll = y - initialVerticalScroll; 5395 // Calculate duration of the scroll
5396 const horizontalDuration = Math.abs(Math.round((horizontalDistanceToScroll / 1000) * options.speed)); 5397 const verticalDuration = Math.abs(Math.round((verticalDistanceToScroll / 1000) * options.speed)); 5398 let duration = horizontalDuration > verticalDuration 5399 ? horizontalDuration 5400 : verticalDuration; 5401 // Set minimum and maximum duration 5402 if (duration < options.minDuration) { 5403 duration = options.minDuration; 5404 } 5405 else if (duration > options.maxDuration) { 5406 duration = options.maxDuration; 5407 } 5408 // @ts-ignore 5409 return new Promise((resolve, reject) => { 5410 // Scroll is already in place, nothing to do 5411 if (horizontalDistanceToScroll === 0 && verticalDistanceToScroll === 0) { 5412 // Resolve promise with a boolean hasScrolledToPosition set to true 5413 resolve(true); 5414 } 5415 // Cancel existing animation if it is already running on the same element 5416 activeAnimations.remove(elementToScroll.element, true); 5417 // To cancel animation we have to store request animation frame ID 5418 let requestID; 5419 // Cancel animation handler 5420 const cancelAnimation = () => { 5421 removeListeners(); 5422 cancelAnimationFrame(requestID); 5423 // Resolve promise with a boolean hasScrolledToPosition set to false 5424 resolve(false); 5425 }; 5426 // Registering animation so it can be canceled if function 5427 // gets called again on the same element 5428 activeAnimations.add(elementToScroll.element, cancelAnimation); 5429 // Prevent user actions handler 5430 const preventDefaultHandler = (e) => e.preventDefault(); 5431 const handler = options.cancelOnUserAction 5432 ? cancelAnimation 5433 : preventDefaultHandler; 5434 // If animation is not cancelable by the user, we can't use passive events 5435 const eventOptions = options.cancelOnUserAction 5436 ? { passive: true } 5437 : { passive: false }; 5438 const events = ['wheel', 'touchstart', 'keydown', 'mousedown']; 5439 // Function to remove listeners after animation is finished 5440 const removeListeners = () => { 5441 events.forEach((eventName) => { 5442 elementToScroll.element.removeEventListener(eventName, handler, eventOptions); 5443 }); 5444 }; 5445 // Add listeners 5446 events.forEach((eventName) => { 5447 elementToScroll.element.addEventListener(eventName, handler, eventOptions); 5448 }); 5449 // Animation 5450 const startingTime = Date.now(); 5451 const step = () => { 5452 var timeDiff = Date.now() - startingTime; 5453 var t = timeDiff / duration; 5454 const horizontalScrollPosition = Math.round(initialHorizontalScroll + 5455 horizontalDistanceToScroll * options.easing(t)); 5456 const verticalScrollPosition = Math.round(initialVerticalScroll + verticalDistanceToScroll * options.easing(t)); 5457 if (timeDiff < duration && 5458 (horizontalScrollPosition !== x || verticalScrollPosition !== y)) { 5459 // If scroll didn't reach desired position or time is not elapsed 5460 // Scroll to a new position 5461 elementToScroll.scrollTo(horizontalScrollPosition, verticalScrollPosition); 5462 // And request a new step 5463 requestID = requestAnimationFrame(step); 5464 } 5465 else { 5466 // If the time elapsed or we reached the desired offset 5467 // Set scroll to the desired offset (when rounding made it to be off a pixel or two) 5468 // Clear animation frame to be sure 5469 elementToScroll.scrollTo(x, y); 5470 cancelAnimationFrame(requestID); 5471 // Remove listeners 5472 removeListeners(); 5473 // Remove animation from the active animations coordinator 5474 activeAnimations.remove(elementToScroll.element, false); 5475 // Resolve promise with a boolean hasScrolledToPosition set to true 5476 resolve(true); 5477 } 5478 }; 5479 // Start animating scroll 5480 requestID = requestAnimationFrame(step); 5481 }); 5482 }); 5483} 5484/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (animateScrollTo); 5485 5486 5487/***/ }) 5488 5489/******/ }); 5490/************************************************************************/ 5491/******/ // The module cache 5492/******/ var __webpack_module_cache__ = {}; 5493/******/ 5494/******/ // The require function 5495/******/ function __webpack_require__(moduleId) { 5496/******/ // Check if module is in cache 5497/******/ var cachedModule = __webpack_module_cache__[moduleId]; 5498/******/ if (cachedModule !== undefined) { 5499/******/ return cachedModule.exports; 5500/******/ } 5501/******/ // Create a new module (and put it into the cache) 5502/******/ var module = __webpack_module_cache__[moduleId] = { 5503/******/ // no module.id needed 5504/******/ // no module.loaded needed 5505/******/ exports: {} 5506/******/ }; 5507/******/ 5508/******/ // Execute the module function 5509/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 5510/******/ 5511/******/ // Return the exports of the module 5512/******/ return module.exports; 5513/******/ } 5514/******/ 5515/******/ // expose the modules object (__webpack_modules__) 5516/******/ __webpack_require__.m = __webpack_modules__; 5517/******/ 5518/************************************************************************/ 5519/******/ /* webpack/runtime/chunk loaded */ 5520/******/ (() => { 5521/******/ var deferred = []; 5522/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { 5523/******/ if(chunkIds) { 5524/******/ priority = priority || 0; 5525/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 5526/******/ deferred[i] = [chunkIds, fn, priority]; 5527/******/ return; 5528/******/ } 5529/******/ var notFulfilled = Infinity; 5530/******/ for (var i = 0; i < deferred.length; i++) { 5531/******/ var [chunkIds, fn, priority] = deferred[i]; 5532/******/ var fulfilled = true; 5533/******/ for (var j = 0; j < chunkIds.length; j++) { 5534/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { 5535/******/ chunkIds.splice(j--, 1); 5536/******/ } else { 5537/******/ fulfilled = false;
5538/******/ if(priority < notFulfilled) notFulfilled = priority; 5539/******/ } 5540/******/ } 5541/******/ if(fulfilled) { 5542/******/ deferred.splice(i--, 1) 5543/******/ var r = fn(); 5544/******/ if (r !== undefined) result = r; 5545/******/ } 5546/******/ } 5547/******/ return result; 5548/******/ }; 5549/******/ })(); 5550/******/ 5551/******/ /* webpack/runtime/compat get default export */ 5552/******/ (() => { 5553/******/ // getDefaultExport function for compatibility with non-harmony modules 5554/******/ __webpack_require__.n = (module) => { 5555/******/ var getter = module && module.__esModule ? 5556/******/ () => (module['default']) : 5557/******/ () => (module); 5558/******/ __webpack_require__.d(getter, { a: getter }); 5559/******/ return getter; 5560/******/ }; 5561/******/ })(); 5562/******/ 5563/******/ /* webpack/runtime/create fake namespace object */ 5564/******/ (() => { 5565/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); 5566/******/ var leafPrototypes; 5567/******/ // create a fake namespace object 5568/******/ // mode & 1: value is a module id, require it 5569/******/ // mode & 2: merge all properties of value into the ns 5570/******/ // mode & 4: return value when already ns object 5571/******/ // mode & 16: return value when it's Promise-like 5572/******/ // mode & 8|1: behave like require 5573/******/ __webpack_require__.t = function(value, mode) { 5574/******/ if(mode & 1) value = this(value); 5575/******/ if(mode & 8) return value; 5576/******/ if(typeof value === 'object' && value) { 5577/******/ if((mode & 4) && value.__esModule) return value; 5578/******/ if((mode & 16) && typeof value.then === 'function') return value; 5579/******/ } 5580/******/ var ns = Object.create(null); 5581/******/ __webpack_require__.r(ns); 5582/******/ var def = {}; 5583/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; 5584/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { 5585/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); 5586/******/ } 5587/******/ def['default'] = () => (value); 5588/******/ __webpack_require__.d(ns, def); 5589/******/ return ns; 5590/******/ }; 5591/******/ })(); 5592/******/ 5593/******/ /* webpack/runtime/define property getters */ 5594/******/ (() => { 5595/******/ // define getter functions for harmony exports 5596/******/ __webpack_require__.d = (exports, definition) => { 5597/******/ for(var key in definition) { 5598/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 5599/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 5600/******/ } 5601/******/ } 5602/******/ }; 5603/******/ })(); 5604/******/ 5605/******/ /* webpack/runtime/ensure chunk */ 5606/******/ (() => { 5607/******/ __webpack_require__.f = {}; 5608/******/ // This file contains only the entry chunk. 5609/******/ // The chunk loading function for additional chunks 5610/******/ __webpack_require__.e = (chunkId) => { 5611/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { 5612/******/ __webpack_require__.f[key](chunkId, promises); 5613/******/ return promises; 5614/******/ }, [])); 5615/******/ }; 5616/******/ })(); 5617/******/ 5618/******/ /* webpack/runtime/get javascript chunk filename */ 5619/******/ (() => { 5620/******/ // This function allow to reference async chunks 5621/******/ __webpack_require__.u = (chunkId) => { 5622/******/ // return url for filenames based on template 5623/******/ return "" + {"1":"../../wp-recipe-maker-premium/dist/public-feature-add-to-collection","10":"../../wp-recipe-maker-premium/dist/public-feature-add-to-shopping-list","83":"../../wp-recipe-maker-premium/dist/public-feature-saved-collection","215":"public-feature-media-toggle","292":"../../wp-recipe-maker-premium/dist/public-feature-recipe-collections-jump-to-section","297":"public-feature-instacart","349":"../../wp-recipe-maker-premium/dist/public-feature-recipe-collections-app","576":"../../wp-recipe
vendor: 9,970 bytes, lines 5623-5828
5623-maker-premium/dist/public-feature-recipe-submission","582":"../../wp-recipe-maker-premium/dist/public-feature-product-modal","615":"public-feature-debug","631":"public-feature-my-shopping-help","765":"public-feature-cookpal","790":"public-feature-slickstream","794":"public-feature-jump-to-section","796":"public-feature-pinterest","830":"../../wp-recipe-maker-premium/dist/public-feature-shopping-list","864":"../../wp-recipe-maker-premium/dist/public-feature-unit-conversion","868":"../../wp-recipe-maker-premium/dist/public-feature-product-icon","911":"public-feature-grow","929":"../../wp-recipe-maker-premium/dist/public-feature-recipe-collections-print","939":"public-feature-video","990":"public-feature-expandable"}[chunkId] + ".js"; 5624/******/ }; 5625/******/ })(); 5626/******/ 5627/******/ /* webpack/runtime/get mini-css chunk filename */ 5628/******/ (() => { 5629/******/ // This function allow to reference async chunks 5630/******/ __webpack_require__.miniCssF = (chunkId) => { 5631/******/ // return url for filenames based on template 5632/******/ return undefined; 5633/******/ }; 5634/******/ })(); 5635/******/ 5636/******/ /* webpack/runtime/global */ 5637/******/ (() => { 5638/******/ __webpack_require__.g = (function() { 5639/******/ if (typeof globalThis === 'object') return globalThis; 5640/******/ try { 5641/******/ return this || new Function('return this')(); 5642/******/ } catch (e) { 5643/******/ if (typeof window === 'object') return window; 5644/******/ } 5645/******/ })(); 5646/******/ })(); 5647/******/ 5648/******/ /* webpack/runtime/hasOwnProperty shorthand */ 5649/******/ (() => { 5650/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 5651/******/ })(); 5652/******/ 5653/******/ /* webpack/runtime/load script */ 5654/******/ (() => { 5655/******/ var inProgress = {}; 5656/******/ var dataWebpackPrefix = "WPRecipeMaker:"; 5657/******/ // loadScript function to load a script via script tag 5658/******/ __webpack_require__.l = (url, done, key, chunkId) => { 5659/******/ if(inProgress[url]) { inProgress[url].push(done); return; } 5660/******/ var script, needAttach; 5661/******/ if(key !== undefined) { 5662/******/ var scripts = document.getElementsByTagName("script"); 5663/******/ for(var i = 0; i < scripts.length; i++) { 5664/******/ var s = scripts[i]; 5665/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; } 5666/******/ } 5667/******/ } 5668/******/ if(!script) { 5669/******/ needAttach = true; 5670/******/ script = document.createElement('script'); 5671/******/ 5672/******/ script.charset = 'utf-8'; 5673/******/ script.timeout = 120; 5674/******/ if (__webpack_require__.nc) { 5675/******/ script.setAttribute("nonce", __webpack_require__.nc); 5676/******/ } 5677/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key); 5678/******/ 5679/******/ script.src = url; 5680/******/ } 5681/******/ inProgress[url] = [done]; 5682/******/ var onScriptComplete = (prev, event) => { 5683/******/ // avoid mem leaks in IE. 5684/******/ script.onerror = script.onload = null; 5685/******/ clearTimeout(timeout); 5686/******/ var doneFns = inProgress[url]; 5687/******/ delete inProgress[url]; 5688/******/ script.parentNode && script.parentNode.removeChild(script); 5689/******/ doneFns && doneFns.forEach((fn) => (fn(event))); 5690/******/ if(prev) return prev(event); 5691/******/ } 5692/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); 5693/******/ script.onerror = onScriptComplete.bind(null, script.onerror); 5694/******/ script.onload = onScriptComplete.bind(null, script.onload); 5695/******/ needAttach && document.head.appendChild(script); 5696/******/ }; 5697/******/ })(); 5698/******/ 5699/******/ /* webpack/runtime/make namespace object */ 5700/******/ (() => { 5701/******/ // define __esModule on exports 5702/******/ __webpack_require__.r = (exports) => { 5703/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 5704/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 5705/******/ } 5706/******/ Object.defineProperty(exports, '__esModule', { value: true }); 5707/******/ }; 5708/******/ })(); 5709/******/ 5710/******/ /* webpack/runtime/publicPath */ 5711/******/ (() => { 5712/******/ var scriptUrl; 5713/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; 5714/******/ var document = __webpack_require__.g.document; 5715/******/ if (!scriptUrl && document) { 5716/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') 5717/******/ scriptUrl = document.currentScript.src; 5718/******/ if (!scriptUrl) { 5719/******/ var scripts = document.getElementsByTagName("script"); 5720/******/ if(scripts.length) { 5721/******/ var i = scripts.length - 1; 5722/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; 5723/******/ } 5724/******/ } 5725/******/ } 5726/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration 5727/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic. 5728/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); 5729/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); 5730/******/ __webpack_require__.p = scriptUrl; 5731/******/ })(); 5732/******/ 5733/******/ /* webpack/runtime/jsonp chunk loading */ 5734/******/ (() => { 5735/******/ // no baseURI 5736/******/ 5737/******/ // object to store loaded and loading chunks 5738/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 5739/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 5740/******/ var installedChunks = { 5741/******/ 607: 0 5742/******/ }; 5743/******/ 5744/******/ __webpack_require__.f.j = (chunkId, promises) => { 5745/******/ // JSONP chunk loading for javascript 5746/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; 5747/******/ if(installedChunkData !== 0) { // 0 means "already installed". 5748/******/ 5749/******/ // a Promise means "currently loading". 5750/******/ if(installedChunkData) { 5751/******/ promises.push(installedChunkData[2]); 5752/******/ } else { 5753/******/ if(true) { // all chunks have JS 5754/******/ // setup Promise in chunk cache 5755/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); 5756/******/ promises.push(installedChunkData[2] = promise); 5757/******/ 5758/******/ // start chunk loading 5759/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); 5760/******/ // create error before stack unwound to get useful stacktrace later 5761/******/ var error = new Error(); 5762/******/ var loadingEnded = (event) => { 5763/******/ if(__webpack_require__.o(installedChunks, chunkId)) { 5764/******/ installedChunkData = installedChunks[chunkId]; 5765/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; 5766/******/ if(installedChunkData) { 5767/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); 5768/******/ var realSrc = event && event.target && event.target.src; 5769/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; 5770/******/ error.name = 'ChunkLoadError'; 5771/******/ error.type = errorType; 5772/******/ error.request = realSrc; 5773/******/ installedChunkData[1](error); 5774/******/ } 5775/******/ } 5776/******/ }; 5777/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); 5778/******/ } 5779/******/ } 5780/******/ } 5781/******/ }; 5782/******/ 5783/******/ // no prefetching 5784/******/ 5785/******/ // no preloaded 5786/******/ 5787/******/ // no HMR 5788/******/ 5789/******/ // no HMR manifest 5790/******/ 5791/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); 5792/******/ 5793/******/ // install a JSONP callback for chunk loading 5794/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { 5795/******/ var [chunkIds, moreModules, runtime] = data; 5796/******/ // add "moreModules" to the modules object, 5797/******/ // then flag all "chunkIds" as loaded and fire callback 5798/******/ var moduleId, chunkId, i = 0; 5799/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { 5800/******/ for(moduleId in moreModules) { 5801/******/ if(__webpack_require__.o(moreModules, moduleId)) { 5802/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 5803/******/ } 5804/******/ } 5805/******/ if(runtime) var result = runtime(__webpack_require__); 5806/******/ } 5807/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 5808/******/ for(;i < chunkIds.length; i++) { 5809/******/ chunkId = chunkIds[i]; 5810/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 5811/******/ installedChunks[chunkId][0](); 5812/******/ } 5813/******/ installedChunks[chunkId] = 0; 5814/******/ } 5815/******/ return __webpack_require__.O(result); 5816/******/ } 5817/******/ 5818/******/ var chunkLoadingGlobal = self["webpackChunkWPRecipeMakerPublicSplit"] = self["webpackChunkWPRecipeMakerPublicSplit"] || []; 5819/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 5820/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 5821/******/ })(); 5822/******/ 5823/************************************************************************/ 5824var __webpack_exports__ = {}; 5825// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. 5826(() => { 5827"use strict"; 5828
5829// EXTERNAL MODULE: ./wp-recipe-maker/assets/js/public/analytics.js 5830var analytics = __webpack_require__(3524); 5831;// ./wp-recipe-maker/assets/js/public/comment-rating.js 5832 5833window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 5834window.WPRecipeMaker.rating = { 5835 init() { 5836 const ratingFormElem = document.querySelector('.comment-form-wprm-rating'); 5837 if (ratingFormElem) { 5838 const recipes = document.querySelectorAll('.wprm-recipe-container'); 5839 const admin = document.querySelector('body.wp-admin'); 5840 if (recipes.length > 0 || admin) { 5841 ratingFormElem.style.display = ''; 5842 } else { 5843 // Hide when no recipe is found. 5844 ratingFormElem.style.display = 'none'; 5845 } 5846 } 5847 }, 5848 settings: { 5849 enabled: typeof window.wprm_public !== 'undefined' ? wprm_public.settings.features_comment_ratings : wprm_admin.settings.features_comment_ratings 5850 }, 5851 onClick(el) { 5852 const container = el.closest('.wprm-comment-ratings-container, .wprm-user-ratings-modal-stars'); 5853 const oldValue = container ? parseInt(container.dataset.currentRating) : 0; 5854 const newValue = parseInt(el.value); 5855 if (newValue === oldValue) { 5856 el.checked = false; 5857 document.querySelector('input[name="' + el.name + '"][value="0"]').checked = true; 5858 container.dataset.currentRating = 0; 5859 } else { 5860 container.dataset.currentRating = newValue; 5861 5862 // Maybe track via analytics. 5863 if (window.WPRecipeMaker.hasOwnProperty('analytics')) { 5864 let recipeId = 0; 5865 const recipe = document.querySelector('.wprm-recipe-container'); 5866 if (recipe && recipe.dataset.hasOwnProperty('recipeId')) { 5867 recipeId = parseInt(recipe.dataset.recipeId); 5868 } 5869 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'comment-rating', { 5870 rating: newValue 5871 }); 5872 } 5873 } 5874 5875 // Optionally update admin rating. 5876 if (window.WPRecipeMaker.hasOwnProperty('comments') && window.WPRecipeMaker.comments.hasOwnProperty('change')) { 5877 window.WPRecipeMaker.comments.change(container); 5878 } 5879 5880 // Trigger stars change event. 5881 document.dispatchEvent(new CustomEvent('wprm-comment-rating-change', { 5882 detail: { 5883 el, 5884 container, 5885 rating: newValue 5886 } 5887 })); 5888 } 5889}; 5890ready(() => { 5891 window.WPRecipeMaker.rating.init(); 5892}); 5893function ready(fn) { 5894 if (document.readyState != 'loading') { 5895 fn(); 5896 } else { 5897 document.addEventListener('DOMContentLoaded', fn); 5898 } 5899} 5900// EXTERNAL MODULE: ./wp-recipe-maker/assets/js/public/manager.js 5901var manager = __webpack_require__(8455); 5902;// ./node_modules/micromodal/dist/micromodal.es.js 5903function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}var n,i,a,r,s,l=(n=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],i=function(){function o(e){var n=e.targetModal,i=e.triggers,a=void 0===i?[]:i,r=e.onShow,s=void 0===r?function(){}:r,l=e.onClose,c=void 0===l?function(){}:l,d=e.openTrigger,u=void 0===d?"data-micromodal-trigger":d,f=e.closeTrigger,h=void 0===f?"data-micromodal-close":f,v=e.openClass,g=void 0===v?"is-open":v,m=e.disableScroll,b=void 0!==m&&m,y=e.disableFocus,p=void 0!==y&&y,w=e.awaitCloseAnimation,E=void 0!==w&&w,k=e.awaitOpenAnimation,M=void 0!==k&&k,A=e.debugMode,C=void 0!==A&&A;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this.modal=document.getElementById(n),this.config={debugMode:C,disableScroll:b,openTrigger:u,closeTrigger:h,openClass:g,onShow:s,onClose:c,awaitCloseAnimation:E,awaitOpenAnimation:M,disableFocus:p},a.length>0&&this.registerTriggers.apply(this,t(a)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var i,a,r;return i=o,(a=[{key:"registerTriggers",value:function(){for(var e=this,t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];
5903o.filter(Boolean).forEach((function(t){t.addEventListener("click",(function(t){return e.showModal(t)}))}))}},{key:"showModal",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation){var o=function t(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()};this.modal.addEventListener("animationend",o,!1)}else this.setFocusToFirstNode();this.config.onShow(this.modal,this.activeElement,t)}},{key:"closeModal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var o=this.config.openClass;this.modal.addEventListener("animationend",(function e(){t.classList.remove(o),t.removeEventListener("animationend",e,!1)}),!1)}else t.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){(e.target.hasAttribute(this.config.closeTrigger)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}},{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){var e=this.modal.querySelectorAll(n);return Array.apply(void 0,t(e))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var t=this.getFocusableNodes();if(0!==t.length){var o=t.filter((function(t){return!t.hasAttribute(e.config.closeTrigger)}));o.length>0&&o[0].focus(),0===o.length&&t[0].focus()}}}},{key:"retainFocus",value:function(e){var t=this.getFocusableNodes();if(0!==t.length)if(t=t.filter((function(e){return null!==e.offsetParent})),this.modal.contains(document.activeElement)){var o=t.indexOf(document.activeElement);e.shiftKey&&0===o&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&o===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}}])&&e(i.prototype,a),r&&e(i,r),o}(),a=null,r=function(e){if(!document.getElementById(e))return console.warn("MicroModal: âSeems like you have missed %c'".concat(e,"'"),"background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'<div class="modal" id="'.concat(e,'"></div>')),!1},s=function(e,t){if(function(e){e.length<=0&&(console.warn("MicroModal: âPlease specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'<a href="#" data-micromodal-trigger="my-modal"></a>'))}(e),!t)return!0;for(var o in t)r(o);return!0},{init:function(e){var o=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),n=t(document.querySelectorAll("[".concat(o.openTrigger,"]"))),r=function(e,t){var o=[];return e.forEach((function(e){var n=e.attributes[t].value;void 0===o[n]&&(o[n]=[]),o[n].push(e)})),o}(n,o.openTrigger);if(!0!==o.debugMode||!1!==s(n,r))for(var l in r){var c=r[l];o.targetModal=l,o.triggers=t(c),a=new i(o)}},show:function(e,t){var o=t||{};o.targetModal=e,!0===o.debugMode&&!1===r(e)||(a&&a.removeEventListeners(),(a=new i(o)).showModal())},close:function(e){e?a.closeModalById(e):a.closeModal()}});"undefined"!=typeof window&&(window.MicroModal=l);/* harmony default export */ const micromodal_es = (l); 5904 5905;
5905// ./wp-recipe-maker/assets/js/public/modal.js 5906 5907 5908window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 5909window.WPRecipeMaker.modal = { 5910 savedScrollPosition: 0, 5911 currentOpenUid: null, 5912 htmlMarginTopValue: null, 5913 getHtmlMarginTopValue() { 5914 if (null !== this.htmlMarginTopValue) { 5915 return this.htmlMarginTopValue; 5916 } 5917 5918 // Check if html has a margin-top (e.g., from WordPress admin bar). 5919 const htmlStyle = window.getComputedStyle(document.documentElement); 5920 const htmlMarginTop = htmlStyle.marginTop; 5921 const parsedMarginTop = htmlMarginTop && htmlMarginTop !== '0px' ? parseFloat(htmlMarginTop) : 0; 5922 this.htmlMarginTopValue = isNaN(parsedMarginTop) ? 0 : parsedMarginTop; 5923 return this.htmlMarginTopValue; 5924 }, 5925 resetHtmlMarginTopValue() { 5926 this.htmlMarginTopValue = null; 5927 }, 5928 open(uid, data = {}) { 5929 // Close currently open modal if there is one 5930 if (this.currentOpenUid && this.currentOpenUid !== uid) { 5931 this.close(this.currentOpenUid); 5932 } 5933 const modalId = `wprm-popup-modal-${uid}`; 5934 if (!document.getElementById(modalId)) { 5935 console.warn(`WPRM modal "${modalId}" could not be found in the DOM.`); 5936 return; 5937 } 5938 5939 // Prevent body scroll by fixing it in place 5940 this.savedScrollPosition = window.pageYOffset || document.documentElement.scrollTop; 5941 const htmlMarginTopValue = this.getHtmlMarginTopValue(); 5942 document.body.classList.add('wprm-popup-modal-open'); 5943 // Adjust body top position to account for html margin-top 5944 document.body.style.top = `-${this.savedScrollPosition - htmlMarginTopValue}px`; 5945 micromodal_es.show(modalId, { 5946 onShow: modal => { 5947 // Track this as the currently open modal 5948 this.currentOpenUid = uid; 5949 const type = modal.dataset.type; 5950 document.dispatchEvent(new CustomEvent('wprm-modal-open', { 5951 detail: { 5952 type, 5953 uid, 5954 modal, 5955 data 5956 } 5957 })); 5958 }, 5959 onClose: modal => { 5960 // Clear the currently open modal tracking 5961 if (this.currentOpenUid === uid) { 5962 this.currentOpenUid = null; 5963 } 5964 const type = modal.dataset.type; 5965 document.dispatchEvent(new CustomEvent('wprm-modal-close', { 5966 detail: { 5967 type, 5968 uid, 5969 modal, 5970 data 5971 } 5972 })); 5973 5974 // Re-enable body scroll and restore scroll position 5975 const scrollPosition = this.savedScrollPosition; 5976 document.body.classList.remove('wprm-popup-modal-open'); 5977 document.body.style.top = ''; 5978 this.savedScrollPosition = 0; 5979 5980 // Restore scroll position with instant behavior 5981 window.scrollTo({ 5982 top: scrollPosition, 5983 behavior: 'instant' 5984 }); 5985 }, 5986 awaitCloseAnimation: true 5987 }); 5988 }, 5989 close(uid) { 5990 // Ignore duplicate close requests for modals that are no longer open. 5991 if (`${this.currentOpenUid}` !== `${uid}`) { 5992 return; 5993 } 5994 micromodal_es.close('wprm-popup-modal-' + uid); 5995 // Clear the currently open modal tracking if this was the open one 5996 if (this.currentOpenUid === uid) { 5997 this.currentOpenUid = null; 5998 } 5999 } 6000}; 6001window.addEventListener('resize', () => window.WPRecipeMaker.modal.resetHtmlMarginTopValue()); 6002window.addEventListener('orientationchange', () => window.WPRecipeMaker.modal.resetHtmlMarginTopValue()); 6003// EXTERNAL MODULE: ./wp-recipe-maker/assets/js/public/print.js 6004var print = __webpack_require__(3579); 6005// EXTERNAL MODULE: ./wp-recipe-maker/assets/js/public/recipe.js 6006var recipe = __webpack_require__(1104); 6007// EXTERNAL MODULE: ./node_modules/animated-scroll-to/dist/esm/index.js 6008var esm = __webpack_require__(5266); 6009;// ./wp-recipe-maker/assets/js/public/smooth-scroll.js 6010 6011window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 6012window.WPRecipeMaker.jump = { 6013 init: () => { 6014 document.addEventListener('click', function (e) { 6015 const target = e.target.closest ? e.target.closest('.wprm-recipe-jump, .wprm-recipe-jump-to-comments, .wprm-recipe-jump-video, .wprm-jump-smooth-scroll, .wprm-recipe-jump-to-section') : false;
6016 if (target) { 6017 WPRecipeMaker.jump.onClick(target, e); 6018 } 6019 }, false); 6020 }, 6021 onClick: (el, e) => { 6022 const target = el.getAttribute('href'); 6023 6024 // Maybe uses smooth scroll. 6025 if (el.matches('.wprm-jump-smooth-scroll')) { 6026 e.preventDefault(); 6027 let speed = parseInt(el.dataset.smoothScroll); 6028 if (speed < 0) { 6029 speed = 500; 6030 } 6031 (0,esm/* default */.A)(document.querySelector(target), { 6032 verticalOffset: -100, 6033 speed 6034 }); 6035 } else { 6036 // Check if hash should not be shown. 6037 if (!wprm_public.settings.jump_output_hash) { 6038 const elementToJumpTo = document.querySelector(target); 6039 if (elementToJumpTo) { 6040 e.preventDefault(); 6041 elementToJumpTo.scrollIntoView(); 6042 } 6043 } 6044 } 6045 } 6046}; 6047smooth_scroll_ready(() => { 6048 window.WPRecipeMaker.jump.init(); 6049}); 6050function smooth_scroll_ready(fn) { 6051 if (document.readyState != 'loading') { 6052 fn(); 6053 } else { 6054 document.addEventListener('DOMContentLoaded', fn); 6055 } 6056} 6057// EXTERNAL MODULE: ./wp-recipe-maker/assets/js/public/temperature.js 6058var temperature = __webpack_require__(9002); 6059// EXTERNAL MODULE: ./node_modules/tippy.js/dist/tippy.esm.js + 52 modules 6060var tippy_esm = __webpack_require__(4181); 6061;// ./wp-recipe-maker/assets/js/public/tooltip.js 6062 6063 6064 6065window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 6066window.WPRecipeMaker.tooltip = { 6067 init() { 6068 WPRecipeMaker.tooltip.addTooltips(); 6069 }, 6070 addTooltips(root = document) { 6071 let containers = []; 6072 if (root && root.classList && root.classList.contains('wprm-tooltip')) { 6073 containers.push(root); 6074 } 6075 if (root && 'function' === typeof root.querySelectorAll) { 6076 containers = containers.concat([...root.querySelectorAll('.wprm-tooltip')]); 6077 } 6078 for (let container of containers) { 6079 // Remove any existing tippy. 6080 const existingTippy = container._tippy; 6081 if (existingTippy) { 6082 existingTippy.destroy(); 6083 } 6084 6085 // Check for tooltip. 6086 const tooltip = container.dataset.hasOwnProperty('tooltip') ? c
6086ontainer.dataset.tooltip : false; 6087 if (tooltip) { 6088 container.role = "button"; // Needed for accessibility. 6089 6090 const hasHtml = container.dataset.hasOwnProperty('tooltipHtml') && '1' === container.dataset.tooltipHtml; 6091 let content = tooltip; 6092 if (hasHtml) { 6093 // Strip HTML tags. 6094 content = content.replace(/<[^>]*>/g, ''); 6095 } 6096 (0,tippy_esm/* default */.Ay)(container, { 6097 theme: 'wprm', 6098 content, 6099 allowHTML: false, 6100 interactive: true, 6101 onCreate(instance) { 6102 // Prevents the tooltip from breaking ingredients into multiple lines. 6103 instance.popper.style.display = 'inline-block'; 6104 6105 // State of fetching. 6106 instance._isFetching = false; 6107 instance._fetchedContent = false; 6108 }, 6109 onShow(instance) { 6110 if (instance._isFetching || instance._fetchedContent) { 6111 return; 6112 } 6113 if (hasHtml) { 6114 instance._isFetching = true; 6115 fetch(`${wprm_public.endpoints.utilities}/sanitize`, { 6116 method: 'POST', 6117 headers: { 6118 'Accept': 'application/json', 6119 'Content-Type': 'application/json' 6120 }, 6121 credentials: 'same-origin', 6122 body: JSON.stringify({ 6123 text: tooltip 6124 }) 6125 }).then(response => { 6126 if (response.ok) { 6127 return response.json(); 6128 } else { 6129 return false; 6130 } 6131 }).then(html => { 6132 instance._isFetching = false; 6133 instance._fetchedContent = true; 6134 if (html) { 6135 instance.setContent(html); 6136 6137 // Change allowHTML to true to show HTML. 6138 instance.setProps({ 6139 allowHTML: true 6140 }); 6141 } 6142 }); 6143 } 6144 } 6145 }); 6146 } 6147 } 6148 } 6149}; 6150tooltip_ready(() => { 6151 window.WPRecipeMaker.tooltip.init(); 6152}); 6153function tooltip_ready(fn) { 6154 if (document.readyState != 'loading') { 6155 fn(); 6156 } else { 6157 document.addEventListener('DOMContentLoaded', fn); 6158 } 6159} 6160;// ./wp-recipe-maker/assets/js/public-modern-split.js 6161window.WPRecipeMaker = typeof window.WPRecipeMaker === 'undefined' ? {} : window.WPRecipeMaker; 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171const featurePromises = {}; 6172const public_modern_split_ready = fn => { 6173 if (document.readyState !== 'loading') { 6174 fn(); 6175 } else { 6176 document.addEventListener('DOMContentLoaded', fn); 6177 } 6178}; 6179const hasElement = (selector, root = document) => { 6180 if (!root) { 6181 return false; 6182 } 6183 if (root !== document && root.matches && root.matches(selector)) { 6184 return true; 6185 } 6186 return !!(root.querySelector && root.querySelector(selector)); 6187}; 6188const loadFeature = (key, importer) => { 6189 if (!featurePromises[key]) { 6190 featurePromises[key] = importer().catch(error => { 6191 delete featurePromises[key]; 6192 console.error(`WP Recipe Maker could not load the ${key} feature.`, error); 6193 }); 6194 } 6195 return featurePromises[key]; 6196}; 6197const loaders = { 6198 commentRating: () => Promise.resolve(), 6199 cookpal: () => loadFeature('cookpal', () => __webpack_require__.e(/* import() | public-feature-cookpal */ 765).then(__webpack_require__.t.bind(__webpack_require__, 3621, 23))), 6200 debug: () => loadFeature('debug', () => __webpack_require__.e(/* import() | public-feature-debug */ 615).then(__webpack_require__.t.bind(__webpack_require__, 2811, 23))), 6201 expandable: () => loadFeature('expandable', () => __webpack_require__.e(/* import() | public-feature-expandable */ 990).then(__webpack_require__.t.bind(__webpack_require__, 2942, 23))), 6202 grow: () => loadFeature('grow', () => __webpack_require__.e(/* import() | public-feature-grow */ 911).then(__webpack_require__.t.bind(__webpack_require__, 385, 23))), 6203 instacart: () => loadFeature('instacart', () => __webpack_require__.e(/* import() | public-feature-instacart */ 297).then(__webpack_require__.t.bind(__webpack_require__, 1157, 23))), 6204 jump: () => Promise.resolve(), 6205 jumpToSection: () => loadFeature('jumpToSection', () => __webpack_require__.e(/* import() | public-feature-jump-to-section */ 794).then(__webpack_require__.t.bind(__webpack_require__, 68, 23))), 6206 media: () => loadFeature('media', () => __webpack_require__.e(/* import() | public-feature-media-toggle */ 215).then(__webpack_require__.t.bind(__webpack_require__, 7561, 23))), 6207 modal: () => Promise.resolve(), 6208 myShoppingHelp: () => loadFeature('myShoppingHelp', () => __webpack_require__.e(/* import() | public-feature-my-shopping-help */ 631).then(__webpack_require__.t.bind(__webpack_require__, 4253, 23))), 6209 pinterest: () => loadFeature('pinterest', () => __webpack_require__.e(/* import() | public-feature-pinterest */ 796).then(__webpack_require__.t.bind(__webpack_require__, 9854, 23))), 6210 print: () => Promise.resolve(), 6211 slickstream: () => loadFeature('slickstream', () => __webpack_require__.e(/* import() | public-feature-slickstream */ 790).then(__webpack_require__.t.bind(__webpack_require__, 6944, 23))), 6212 tooltip: () => Promise.resolve(), 6213 video: () => loadFeature('video', () => __webpack_require__.e(/* import() | public-feature-video */ 939).then(__webpack_require__.t.bind(__webpack_require__, 9047, 23))) 6214}; 6215const detectFeatures = (root = document) => { 6216 if (wprm_public.settings.features_comment_ratings || hasElement('.comment-form-wprm-rating, .wprm-comment-ratings-container, .wprm-user-ratings-modal-stars', root)) { 6217 loaders.commentRating(); 6218 } 6219 if (hasElement('#wp-admin-bar-wprm-debug, [id^="wp-admin-bar-wprm-debug-entry"]', root)) { 6220 loaders.debug(); 6221 } 6222 if (hasElement('.wprm-expandable-button', root)) { 6223 loaders.expandable(); 6224 } 6225 if (hasElement('.wprm-recipe-grow', root)) { 6226 loaders.grow(); 6227 } 6228 if (hasElement('.wprm-recipe-shop-instacart', root)) { 6229 loaders.instacart(); 6230 } 6231 if (hasElement('.wprm-recipe-jump, .wprm-recipe-jump-to-comments, .wprm-recipe-jump-video, .wprm-jump-smooth-scroll, .wprm-recipe-jump-to-section', root)) { 6232 loaders.jump(); 6233 } 6234 if (hasElement('.wprm-recipe-jump-to-section-container-scroll', root)) { 6235 loaders.jumpToSection(); 6236 } 6237 if (hasElement('.wprm-recipe-media-toggle, .wprm-media-toggle-checkbox', root)) { 6238 loaders.media(); 6239 } 6240 if (hasElement('.wprm-popup-modal, [data-modal-uid]', root)) { 6241 loaders.modal(); 6242 } 6243 if (hasElement('.wprm-recipe-my-shopping-help', root)) { 6244 loaders.myShoppingHelp(); 6245 } 6246 if (hasElement('.wprm-recipe-cookpal', root)) { 6247 loaders.cookpal(); 6248 } 6249 if (hasElement('.wprm-recipe-pin', root)) { 6250 loaders.pinterest(); 6251 } 6252 if (hasElement('.wprm-recipe-print, .wprm-print-recipe-shortcode', root)) { 6253 loaders.print(); 6254 } 6255 if (hasElement('.wprm-recipe-slickstream', root)) { 6256 loaders.slickstream(); 6257 } 6258 if (hasElement('.wprm-tooltip', root)) { 6259 loaders.tooltip(); 6260 } 6261 if (wprm_public.settings.video_force_ratio && hasElement('.wprm-recipe iframe, .wprm-recipe object, .wprm-recipe video, .wprm-recipe-video-container iframe, .wprm-recipe-video-container object, .wprm-recipe-video-container video', root)) { 6262 loaders.video(); 6263 } 6264}; 6265let detectScheduled = false;
6266const scheduleFeatureDetection = (root = document) => { 6267 if (detectScheduled) { 6268 return; 6269 } 6270 detectScheduled = true; 6271 window.setTimeout(() => { 6272 detectScheduled = false; 6273 detectFeatures(root); 6274 }, 0); 6275}; 6276const observeFeatureDom = () => { 6277 if (!window.MutationObserver || !document.body) { 6278 return; 6279 } 6280 const observer = new MutationObserver(mutations => { 6281 for (const mutation of mutations) { 6282 for (const node of mutation.addedNodes) { 6283 if (node.nodeType === 1) { 6284 scheduleFeatureDetection(node); 6285 return; 6286 } 6287 } 6288 } 6289 }); 6290 observer.observe(document.body, { 6291 childList: true, 6292 subtree: true 6293 }); 6294}; 6295window.WPRecipeMaker.publicLoader = { 6296 detect: scheduleFeatureDetection, 6297 has: hasElement, 6298 load: key => loaders[key] ? loaders[key]() : Promise.resolve() 6299}; 6300public_modern_split_ready(() => { 6301 detectFeatures(); 6302 observeFeatureDom(); 6303}); 6304document.addEventListener('wprmRecipeInit', () => { 6305 scheduleFeatureDetection(); 6306}); 6307})(); 6308 6309__webpack_exports__ = __webpack_require__.O(__webpack_exports__); 6310(WPRecipeMaker = typeof WPRecipeMaker === "undefined" ? {} : WPRecipeMaker)["public-modern-split"] = __webpack_exports__; 6311/******/ })() 6312;
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.