var WPRecipeMaker;
(()=> {
var __webpack_modules__=({
3524:
(()=> {
window.WPRecipeMaker=typeof window.WPRecipeMaker==="undefined" ? {}:window.WPRecipeMaker;
window.WPRecipeMaker.analytics={
init: ()=> {
if(wprm_public.settings.analytics_enabled||wprm_public.settings.google_analytics_enabled){
document.addEventListener('click', function (e){
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;
if(target){
window.WPRecipeMaker.analytics.checkClick(target, e);
}}, false);
}},
checkClick: (target, e)=> {
if(target.matches('.wprm-recipe-jump')){
const recipeId=target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'jump-to-recipe');
}
return true;
}else if(target.matches('.wprm-recipe-jump-video')){
const recipeId=target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'jump-to-video');
}
return true;
}else if(target.matches('.wprm-recipe-pin')){
const recipeId=target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'pin-button');
}
return true;
}else if(target.matches('.wprm-recipe-facebook-share')){
const recipeId=target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'facebook-share-button');
}
return true;
}else if(target.matches('.wprm-recipe-messenger-share')){
const recipeId=target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'messenger-share-button');
}
return true;
}else if(target.matches('.wprm-recipe-twitter-share')){
const recipeId=target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'twitter-share-button');
}
return true;
}else if(target.matches('.wprm-recipe-bluesky-share')){
const recipeId=target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'bluesky-share-button');
}
return true;
}else if(target.matches('.wprm-recipe-mastodon-share')){
const recipeId=target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'mastodon-share-button');
}
return true;
}else if(target.matches('.wprm-recipe-tumblr-share')){
const recipeId=target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'tumblr-share-button');
}
return true;
}else if(target.matches('.wprm-recipe-text-share')){
const recipeId=target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'text-share-button');
}
return true;
}else if(target.matches('.wprm-recipe-whatsapp-share')){
const recipeId=target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'whatsapp-share-button');
}
return true;
}else if(target.matches('.wprm-recipe-email-share')){
const recipeId=target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'email-share-button');
}
return true;
}else if(target.matches('.wprm-recipe-favorite')){
const recipeId=target.dataset.hasOwnProperty('recipeId') ? target.dataset.recipeId:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'favorite-button', {
action: target.classList.contains('wprm-recipe-favorite-active') ? 'remove':'add'
});
}
return true;
}else if(target.matches('.wprm-recipe-add-to-collection-recipe')){
const recipeId=target.dataset.hasOwnProperty('recipe') ? target.dataset.recipeId:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'add-to-collections-button');
}
return true;
}else if(target.matches('.wprm-recipe-add-to-shopping-list')){
const recipeId=target.dataset.hasOwnProperty('recipe') ? target.dataset.recipeId:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'add-to-shopping-list-button');
}
return true;
}else if(target.matches('.wprm-recipe-cook-mode')){
const recipeId=target.dataset.hasOwnProperty('recipeId') ? target.dataset.recipeId:false;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'cook-mode-button');
}
return true;
}else if(target.matches('.wprm-recipe-equipment a')){
const container=target.closest('.wprm-recipe-equipment-container');
if(container){
const item=target.closest('.wprm-recipe-equipment-item');
const type=item&&item.classList.contains('wprm-recipe-equipment-item-has-image') ? 'image':'text';
const name=item ? item.querySelector('.wprm-recipe-equipment-name'):target;
const recipeId=container.dataset.recipe;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'equipment-link', {
url: target.href,
type,
name: name ? name.innerText:'unknown'
});
}}
return true;
}else if(target.matches('.wprm-recipe-ingredient a')){
const container=target.closest('.wprm-recipe-ingredients-container');
let name=false;
const parent=target.closest('.wprm-recipe-ingredient');
if(parent){
name=parent.querySelector('.wprm-recipe-ingredient-name');
}
if(container){
const recipeId=container.dataset.recipe;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'ingredient-link', {
url: target.href,
name: name ? name.innerText:'unknown'
});
}}
return true;
}else if(target.matches('.wprm-recipe-instruction a')){
const container=target.closest('.wprm-recipe-instructions-container');
if(container){
const recipeId=container.dataset.recipe;
if(recipeId){
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'instruction-link', {
url: target.href
});
}}
return true;
}
return false;
},
registerAction: (recipeId, postId, type, meta={})=> {
window.WPRecipeMaker.analytics.registerActionLocal(recipeId, postId, type, meta);
window.WPRecipeMaker.analytics.registerActionGoogleAnalytics(recipeId, postId, type, meta);
},
registerActionOnce: (recipeId, postId, type, meta={})=> {
if(window.WPRecipeMaker.analytics.registeredActions.hasOwnProperty(`recipe-${recipeId}`)&&window.WPRecipeMaker.analytics.registeredActions[`recipe-${recipeId}`].hasOwnProperty(type)){
return;
}
if(!window.WPRecipeMaker.analytics.registeredActions.hasOwnProperty(`recipe-${recipeId}`)){
window.WPRecipeMaker.analytics.registeredActions[`recipe-${recipeId}`]={};}
window.WPRecipeMaker.analytics.registeredActions[`recipe-${recipeId}`][type]=true;
window.WPRecipeMaker.analytics.registerAction(recipeId, postId, type, meta);
},
registerActionLocal: (recipeId, postId, type, meta={})=> {
if(wprm_public.settings.analytics_enabled){
if('comment-rating'===type||'user-rating'===type){
return;
}
let headers={
'Accept': 'application/json',
'Content-Type': 'application/json'
};
if(0 < parseInt(wprm_public.user)){
headers['X-WP-Nonce']=wprm_public.api_nonce;
}
fetch(wprm_public.endpoints.analytics, {
method: 'POST',
headers,
credentials: 'same-origin',
body: JSON.stringify({
recipeId,
postId,
type,
meta,
uid: getAnalyticsVisitorId(),
nonce: wprm_public.nonce
})
});
}},
registerActionGoogleAnalytics: (recipeId, postId, type, meta={})=> {
if(wprm_public.settings.google_analytics_enabled&&window.hasOwnProperty('gtag')){
const event='wprm_' + type.replace(/-/g, '_');
const label=type.replace(/-/g, ' ');
let eventData={
event_category: 'wprecipemaker',
event_label: 'WPRM ' + label.charAt(0).toUpperCase() + label.slice(1),
wprm_recipe_id: '' + recipeId,
wprm_post_id: '' + postId
};
const recipe=window.WPRecipeMaker.manager.getRecipeImmediately(recipeId);
if(recipe){
if(recipe.data.hasOwnProperty('name')){
eventData.wprm_recipe_name=recipe.data.name;
}
if(recipe.data.hasOwnProperty('slug')){
eventData.wprm_recipe_slug=recipe.data.slug;
}}
if(('comment-rating'===type||'user-rating'===type)&&meta.hasOwnProperty('rating')){
eventData.value=meta.rating;
delete meta.rating;
}
if(meta&&'object'===typeof meta){
Object.keys(meta).forEach(key=> {
if(''!==meta[key]&&null!==meta[key]&&typeof meta[key]!=='undefined'){
eventData[`wprm_event_${key}`]='' + meta[key];
}});
}
window.gtag('event', event, eventData);
}},
registeredActions: {}};
ready(()=> {
window.WPRecipeMaker.analytics.init();
});
function ready(fn){
if(document.readyState!='loading'){
fn();
}else{
document.addEventListener('DOMContentLoaded', fn);
}}
function getCookieValue(a){
var b=document.cookie.match('(^|;)\\s*' + a + '\\s*=\\s*([^;]+)');
return b ? b.pop():'';
}
function getAnalyticsVisitorId(){
let visitorId=getCookieValue('wprm_analytics_visitor');
if(!visitorId){
visitorId=generateAnalyticsVisitorId();
setCookieValue('wprm_analytics_visitor', visitorId);
}
return visitorId;
}
function generateAnalyticsVisitorId(){
if(window.crypto&&window.crypto.getRandomValues){
const values=new Uint32Array(2);
window.crypto.getRandomValues(values);
return Date.now().toString(36) + values[0].toString(36) + values[1].toString(36);
}
return Date.now().toString(36) + Math.random().toString(36).substring(2, 12);
}
function setCookieValue(name, value){
let cookie=name + '=' + encodeURIComponent(value) + '; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/; SameSite=Lax';
if('https:'===window.location.protocol){
cookie +='; Secure';
}
document.cookie=cookie;
}
}),
8455:
(()=> {
window.WPRecipeMaker=typeof window.WPRecipeMaker==="undefined" ? {}:window.WPRecipeMaker;
window.WPRecipeMaker.manager={
init: ()=> {},
recipes: {},
findRecipesOnPage: ()=> {
let recipes=[];
const potentialRecipes=document.querySelectorAll('*[data-recipe-id]');
for (let potentialRecipe of potentialRecipes){
const id=parseInt(potentialRecipe.dataset.recipeId);
if(id){
recipes.push(id);
}}
return [...new Set(recipes)];
},
resetRecipe: id=> {
if(window.WPRecipeMaker.manager.recipes.hasOwnProperty(`recipe-${id}`)){
delete window.WPRecipeMaker.manager.recipes[`recipe-${id}`];
}},
getRecipe: (id, loadDifferentId=false)=> {
id='preview'===id ? id:parseInt(id);
if(!window.WPRecipeMaker.manager.recipes.hasOwnProperty(`recipe-${id}`)){
return window.WPRecipeMaker.manager.loadRecipe(id, loadDifferentId);
}
return Promise.resolve(window.WPRecipeMaker.manager.recipes[`recipe-${id}`]);
},
getRecipeImmediately: id=> {
id='preview'===id ? id:parseInt(id);
let recipe=window.WPRecipeMaker.manager.recipes.hasOwnProperty(`recipe-${id}`) ? window.WPRecipeMaker.manager.recipes[`recipe-${id}`]:false;
if(!recipe){
if(window.hasOwnProperty('wprm_recipes')&&window.wprm_recipes.hasOwnProperty(`recipe-${id}`)){
const recipeData=window.wprm_recipes[`recipe-${id}`];
recipe=window.WPRecipeMaker.manager.loadRecipeObject(id, recipeData);
window.WPRecipeMaker.manager.recipes[`recipe-${id}`]=recipe;
}}
return recipe;
},
loadRecipe: (id, loadDifferentId=false)=> {
return new Promise((resolveRecipe, rejectRecipe)=> {
const getRecipeData=new Promise((resolveData, rejectData)=> {
const idToGetDataFor=loadDifferentId ? loadDifferentId:id;
if(window.hasOwnProperty('wprm_recipes')&&window.wprm_recipes.hasOwnProperty(`recipe-${idToGetDataFor}`)){
resolveData(window.wprm_recipes[`recipe-${idToGetDataFor}`]);
}else{
window.WPRecipeMaker.manager.loadRecipeDataFromAPI(idToGetDataFor).then(result=> {
resolveData(result);
});
}});
getRecipeData.then(recipeData=> {
let recipe=false;
if(recipeData){
recipe=window.WPRecipeMaker.manager.loadRecipeObject(id, recipeData);
}
window.WPRecipeMaker.manager.recipes[`recipe-${id}`]=recipe;
resolveRecipe(recipe);
});
});
},
loadRecipeDataFromAPI: id=> {
let headers={
'Accept': 'application/json',
'Content-Type': 'application/json'
};
if(0 < parseInt(wprm_public.user)){
headers['X-WP-Nonce']=wprm_public.api_nonce;
}
return new Promise((resolve, reject)=> {
fetch(`${wprm_public.endpoints.manage}/recipe/${id}`, {
method: 'POST',
headers,
credentials: 'same-origin',
body: JSON.stringify({
format: 'frontend'
})
}).then(response=> {
if(response.ok){
return response.json();
}
return false;
}).then(result=> {
resolve(result);
});
});
},
loadRecipeObject: (id, data)=> {
let recipe={
id,
data,
setServings: (...args)=> {},
setAdvancedServings: (...args)=> {},
setUnitSystem: (...args)=> {},
addRating: (...args)=> {}};
if(window.WPRecipeMaker.hasOwnProperty('managerPremium')){
recipe=window.WPRecipeMaker.managerPremium.loadRecipeObject(id, recipe);
}
return recipe;
},
triggerChangeEvent: (id, type)=> {
document.dispatchEvent(new CustomEvent('wprm-recipe-change', {
detail: {
id,
type
}}));
},
changeRecipeData: (id, data)=> {
if(window.WPRecipeMaker.manager.recipes.hasOwnProperty(`recipe-${id}`)){
window.WPRecipeMaker.manager.recipes[`recipe-${id}`].data={
...window.WPRecipeMaker.manager.recipes[`recipe-${id}`].data,
...data
};
document.dispatchEvent(new CustomEvent('wprm-recipe-change-data', {
detail: {
id
}}));
}}
};
ready(()=> {
window.WPRecipeMaker.manager.init();
});
function ready(fn){
if(document.readyState!='loading'){
fn();
}else{
document.addEventListener('DOMContentLoaded', fn);
}}
}),
3579:
(()=> {
window.WPRecipeMaker=typeof window.WPRecipeMaker==="undefined" ? {}:window.WPRecipeMaker;
window.WPRecipeMaker.print={
hasAccess: ()=> {
if(wprm_public.settings.hasOwnProperty('print_access_allowed')){
return !!wprm_public.settings.print_access_allowed;
}
const access=wprm_public.settings.hasOwnProperty('print_access') ? wprm_public.settings.print_access:'everyone';
if('disabled'===access){
return false;
}
if('logged_in'===access&&0 >=parseInt(wprm_public.user)){
return false;
}
return true;
},
init: ()=> {
document.addEventListener('click', function (e){
const target=e.target.closest ? e.target.closest('.wprm-recipe-print, .wprm-print-recipe-shortcode'):false;
if(target){
WPRecipeMaker.print.onClick(target, e);
}}, false);
},
onClick: (el, e)=> {
if(!WPRecipeMaker.print.hasAccess()){
e.preventDefault();
return;
}
let recipeId=el.dataset.recipeId;
if(!recipeId){
const container=el.closest('.wprm-recipe-container');
if(container){
recipeId=container.dataset.recipeId;
}}
if(recipeId){
e.preventDefault();
recipeId=parseInt(recipeId);
const template=el.dataset.hasOwnProperty('template') ? el.dataset.template:'';
let location='other';
const parent=el.closest('.wprm-recipe');
if(parent){
if(parent.classList.contains('wprm-recipe-snippet')){
location='snippet';
}else if(parent.classList.contains('wprm-recipe-roundup-item')){
location='roundup';
}else{
location='recipe';
}}
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'print', {
location
});
WPRecipeMaker.print.recipeAsIs(recipeId, template);
}},
recipeAsIs: (id, template='')=> {
let servings=false,
system=1,
advancedServings=false;
window.WPRecipeMaker.manager.getRecipe(id).then(recipe=> {
if(recipe){
if(recipe.data.hasOwnProperty('currentSystem')){
system=recipe.data.currentSystem;
}
if(recipe.data.currentServingsParsed!==recipe.data.originalServingsParsed){
servings=recipe.data.currentServingsParsed;
}
advancedServings=recipe.data.currentAdvancedServings;
}
WPRecipeMaker.print.recipe(id, servings, system, advancedServings, template);
});
},
recipe: (id, servings=false, system=1, advancedServings=false, template='')=> {
let slug=false;
if('slug'===wprm_public.settings.print_recipe_identifier){
const recipe=window.WPRecipeMaker.manager.getRecipeImmediately(id);
if(recipe&&recipe.data.slug){
slug=recipe.data.slug;
if(slug.startsWith('wprm-')){
slug=slug.substring(5);
}}
}
let urlArgs=slug ? slug:id;
if(template){
urlArgs +=`/${template}`;
}
const url=WPRecipeMaker.print.getUrl(urlArgs);
if(!url){
return;
}
const target=wprm_public.settings.print_new_tab ? '_blank':'_self';
const printArgs={
id,
system,
servings,
advancedServings
};
localStorage.setItem('wprmPrintArgs', JSON.stringify(printArgs));
const printWindow=window.open(url, target);
if('_blank'===target){
printWindow.onload=()=> {
printWindow.focus();
if(printWindow.hasOwnProperty('WPRMPrint')){
printWindow.WPRMPrint.setArgs(printArgs);
}};}},
getUrl: args=> {
if(!WPRecipeMaker.print.hasAccess()){
return false;
}
const urlParts=wprm_public.home_url.split(/\?(.+)/);
let printUrl=urlParts[0];
if(!printUrl.endsWith('/')){
printUrl +='/';
}
if(wprm_public.permalinks){
printUrl +=wprm_public.print_slug + '/' + args;
if(urlParts[1]){
printUrl +='?' + urlParts[1];
}}else{
printUrl +='?' + wprm_public.print_slug + '=' + args;
if(urlParts[1]){
printUrl +='&' + urlParts[1];
}}
return printUrl;
}};
ready(()=> {
window.WPRecipeMaker.print.init();
});
function ready(fn){
if(document.readyState!='loading'){
fn();
}else{
document.addEventListener('DOMContentLoaded', fn);
}}
}),
1104:
(()=> {
window.WPRecipeMaker=typeof window.WPRecipeMaker==="undefined" ? {}:window.WPRecipeMaker;
window.WPRecipeMaker.recipe={
init: ()=> {
window.addEventListener('wpupgInitReady', function (e){
const grid=e.detail;
window.WPRecipeMaker.recipe.wpupgGridCompatibility(grid);
});
},
wpupgGridCompatibility: grid=> {
if(grid){
grid.on('itemsLoaded', ()=> {
window.WPRecipeMaker.recipe.initFeatures();
});
}},
initFeatures: (args={})=> {
if(args.hasOwnProperty('id')){
window.WPRecipeMaker.manager.resetRecipe(args.id);
}
if(window.WPRecipeMaker){
if(window.WPRecipeMaker.hasOwnProperty('advancedServings')){
window.WPRecipeMaker.advancedServings.init();
}
if(window.WPRecipeMaker.hasOwnProperty('quantities')){
window.WPRecipeMaker.quantities.init();
if(args.hasOwnProperty('id')){
if(args.hasOwnProperty('servings')){
const servings=parseInt(args.servings);
if(servings){
setTimeout(()=> {
window.WPRecipeMaker.quantities.setServings(args.id, servings);
}, 100);
}}
}}
if(window.WPRecipeMaker.hasOwnProperty('instacart')){
window.WPRecipeMaker.instacart.init();
}
if(window.WPRecipeMaker.hasOwnProperty('jumpToSection')){
window.WPRecipeMaker.jumpToSection.init();
}
if(window.WPRecipeMaker.hasOwnProperty('timer')){
window.WPRecipeMaker.timer.init();
}
if(window.WPRecipeMaker.hasOwnProperty('preventSleep')){
window.WPRecipeMaker.preventSleep.init();
}
if(window.WPRecipeMaker.hasOwnProperty('privateNotes')){
window.WPRecipeMaker.privateNotes.init();
}
if(window.WPRecipeMaker.hasOwnProperty('tooltip')){
window.WPRecipeMaker.tooltip.init();
}
if(window.WPRecipeMaker.hasOwnProperty('video')){
if(wprm_public.settings.video_force_ratio){
window.WPRecipeMaker.video.init();
}}
}
document.dispatchEvent(new CustomEvent('wprmRecipeInit', {
detail: args
}));
}};
window.WPRecipeMaker.recipe.init();
}),
9002:
(()=> {
window.WPRecipeMaker=typeof window.WPRecipeMaker==="undefined" ? {}:window.WPRecipeMaker;
window.WPRecipeMaker.temperature={
getTemperatures(){
let temperatures=[];
const containers=document.querySelectorAll('.wprm-temperature-container');
for (let container of containers){
temperatures.push(WPRecipeMaker.temperature.getData(container));
}
return temperatures;
},
getData(container){
return {
container,
value: container.dataset.value,
unit: container.dataset.unit,
help: container.dataset.tooltip
};}};
}),
4181:
((__unused_webpack_module, __webpack_exports__, __webpack_require__)=> {
"use strict";
__webpack_require__.d(__webpack_exports__, {
Ay: ()=> ( tippy_esm),
DX: ()=> ( inlinePositioning)
});
;
function getWindow(node){
if(node==null){
return window;
}
if(node.toString()!=='[object Window]'){
var ownerDocument=node.ownerDocument;
return ownerDocument ? ownerDocument.defaultView||window:window;
}
return node;
}
;
function isElement(node){
var OwnElement=getWindow(node).Element;
return node instanceof OwnElement||node instanceof Element;
}
function isHTMLElement(node){
var OwnElement=getWindow(node).HTMLElement;
return node instanceof OwnElement||node instanceof HTMLElement;
}
function isShadowRoot(node){
if(typeof ShadowRoot==='undefined'){
return false;
}
var OwnElement=getWindow(node).ShadowRoot;
return node instanceof OwnElement||node instanceof ShadowRoot;
}
;
var math_max=Math.max;
var math_min=Math.min;
var round=Math.round;
;
function getBoundingClientRect(element, includeScale){
if(includeScale===void 0){
includeScale=false;
}
var rect=element.getBoundingClientRect();
var scaleX=1;
var scaleY=1;
if(isHTMLElement(element)&&includeScale){
var offsetHeight=element.offsetHeight;
var offsetWidth=element.offsetWidth;
if(offsetWidth > 0){
scaleX=round(rect.width) / offsetWidth||1;
}
if(offsetHeight > 0){
scaleY=round(rect.height) / offsetHeight||1;
}}
return {
width: rect.width / scaleX,
height: rect.height / scaleY,
top: rect.top / scaleY,
right: rect.right / scaleX,
bottom: rect.bottom / scaleY,
left: rect.left / scaleX,
x: rect.left / scaleX,
y: rect.top / scaleY
};}
;
function getWindowScroll(node){
var win=getWindow(node);
var scrollLeft=win.pageXOffset;
var scrollTop=win.pageYOffset;
return {
scrollLeft: scrollLeft,
scrollTop: scrollTop
};}
;
function getHTMLElementScroll(element){
return {
scrollLeft: element.scrollLeft,
scrollTop: element.scrollTop
};}
;
function getNodeScroll(node){
if(node===getWindow(node)||!isHTMLElement(node)){
return getWindowScroll(node);
}else{
return getHTMLElementScroll(node);
}}
;
function getNodeName(element){
return element ? (element.nodeName||'').toLowerCase():null;
}
;
function getDocumentElement(element){
return ((isElement(element) ? element.ownerDocument :
element.document)||window.document).documentElement;
}
;
function getWindowScrollBarX(element){
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
}
;
function getComputedStyle(element){
return getWindow(element).getComputedStyle(element);
}
;
function isScrollParent(element){
var _getComputedStyle=getComputedStyle(element),
overflow=_getComputedStyle.overflow,
overflowX=_getComputedStyle.overflowX,
overflowY=_getComputedStyle.overflowY;
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
}
;
function isElementScaled(element){
var rect=element.getBoundingClientRect();
var scaleX=round(rect.width) / element.offsetWidth||1;
var scaleY=round(rect.height) / element.offsetHeight||1;
return scaleX!==1||scaleY!==1;
}
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed){
if(isFixed===void 0){
isFixed=false;
}
var isOffsetParentAnElement=isHTMLElement(offsetParent);
var offsetParentIsScaled=isHTMLElement(offsetParent)&&isElementScaled(offsetParent);
var documentElement=getDocumentElement(offsetParent);
var rect=getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
var scroll={
scrollLeft: 0,
scrollTop: 0
};
var offsets={
x: 0,
y: 0
};
if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){
if(getNodeName(offsetParent)!=='body'||// https://github.com/popperjs/popper-core/issues/1078
isScrollParent(documentElement)){
scroll=getNodeScroll(offsetParent);
}
if(isHTMLElement(offsetParent)){
offsets=getBoundingClientRect(offsetParent, true);
offsets.x +=offsetParent.clientLeft;
offsets.y +=offsetParent.clientTop;
}else if(documentElement){
offsets.x=getWindowScrollBarX(documentElement);
}}
return {
x: rect.left + scroll.scrollLeft - offsets.x,
y: rect.top + scroll.scrollTop - offsets.y,
width: rect.width,
height: rect.height
};}
;
function getLayoutRect(element){
var clientRect=getBoundingClientRect(element);
var width=element.offsetWidth;
var height=element.offsetHeight;
if(Math.abs(clientRect.width - width) <=1){
width=clientRect.width;
}
if(Math.abs(clientRect.height - height) <=1){
height=clientRect.height;
}
return {
x: element.offsetLeft,
y: element.offsetTop,
width: width,
height: height
};}
;
function getParentNode(element){
if(getNodeName(element)==='html'){
return element;
}
return (
element.assignedSlot ||
element.parentNode||(
isShadowRoot(element) ? element.host:null) ||
getDocumentElement(element)
);
}
;
function getScrollParent(node){
if(['html', 'body', '#document'].indexOf(getNodeName(node)) >=0){
return node.ownerDocument.body;
}
if(isHTMLElement(node)&&isScrollParent(node)){
return node;
}
return getScrollParent(getParentNode(node));
}
;
function listScrollParents(element, list){
var _element$ownerDocumen;
if(list===void 0){
list=[];
}
var scrollParent=getScrollParent(element);
var isBody=scrollParent===((_element$ownerDocumen=element.ownerDocument)==null ? void 0:_element$ownerDocumen.body);
var win=getWindow(scrollParent);
var target=isBody ? [win].concat(win.visualViewport||[], isScrollParent(scrollParent) ? scrollParent:[]):scrollParent;
var updatedList=list.concat(target);
return isBody ? updatedList :
updatedList.concat(listScrollParents(getParentNode(target)));
}
;
function isTableElement(element){
return ['table', 'td', 'th'].indexOf(getNodeName(element)) >=0;
}
;
function getTrueOffsetParent(element){
if(!isHTMLElement(element)||// https://github.com/popperjs/popper-core/issues/837
getComputedStyle(element).position==='fixed'){
return null;
}
return element.offsetParent;
}
function getContainingBlock(element){
var isFirefox=navigator.userAgent.toLowerCase().indexOf('firefox')!==-1;
var isIE=navigator.userAgent.indexOf('Trident')!==-1;
if(isIE&&isHTMLElement(element)){
var elementCss=getComputedStyle(element);
if(elementCss.position==='fixed'){
return null;
}}
var currentNode=getParentNode(element);
if(isShadowRoot(currentNode)){
currentNode=currentNode.host;
}
while (isHTMLElement(currentNode)&&['html', 'body'].indexOf(getNodeName(currentNode)) < 0){
var css=getComputedStyle(currentNode);
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'){
return currentNode;
}else{
currentNode=currentNode.parentNode;
}}
return null;
}
function getOffsetParent(element){
var window=getWindow(element);
var offsetParent=getTrueOffsetParent(element);
while (offsetParent&&isTableElement(offsetParent)&&getComputedStyle(offsetParent).position==='static'){
offsetParent=getTrueOffsetParent(offsetParent);
}
if(offsetParent&&(getNodeName(offsetParent)==='html'||getNodeName(offsetParent)==='body'&&getComputedStyle(offsetParent).position==='static')){
return window;
}
return offsetParent||getContainingBlock(element)||window;
}
;
var enums_top='top';
var bottom='bottom';
var right='right';
var left='left';
var auto='auto';
var basePlacements=[enums_top, bottom, right, left];
var start='start';
var end='end';
var clippingParents='clippingParents';
var viewport='viewport';
var popper='popper';
var reference='reference';
var variationPlacements=basePlacements.reduce(function (acc, placement){
return acc.concat([placement + "-" + start, placement + "-" + end]);
}, []);
var enums_placements=[].concat(basePlacements, [auto]).reduce(function (acc, placement){
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
}, []);
var beforeRead='beforeRead';
var read='read';
var afterRead='afterRead';
var beforeMain='beforeMain';
var main='main';
var afterMain='afterMain';
var beforeWrite='beforeWrite';
var write='write';
var afterWrite='afterWrite';
var modifierPhases=[beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
;
function order(modifiers){
var map=new Map();
var visited=new Set();
var result=[];
modifiers.forEach(function (modifier){
map.set(modifier.name, modifier);
});
function sort(modifier){
visited.add(modifier.name);
var requires=[].concat(modifier.requires||[], modifier.requiresIfExists||[]);
requires.forEach(function (dep){
if(!visited.has(dep)){
var depModifier=map.get(dep);
if(depModifier){
sort(depModifier);
}}
});
result.push(modifier);
}
modifiers.forEach(function (modifier){
if(!visited.has(modifier.name)){
sort(modifier);
}});
return result;
}
function orderModifiers(modifiers){
var orderedModifiers=order(modifiers);
return modifierPhases.reduce(function (acc, phase){
return acc.concat(orderedModifiers.filter(function (modifier){
return modifier.phase===phase;
}));
}, []);
}
;
function debounce(fn){
var pending;
return function (){
if(!pending){
pending=new Promise(function (resolve){
Promise.resolve().then(function (){
pending=undefined;
resolve(fn());
});
});
}
return pending;
};}
;
function mergeByName(modifiers){
var merged=modifiers.reduce(function (merged, current){
var existing=merged[current.name];
merged[current.name]=existing ? Object.assign({}, existing, current, {
options: Object.assign({}, existing.options, current.options),
data: Object.assign({}, existing.data, current.data)
}):current;
return merged;
}, {});
return Object.keys(merged).map(function (key){
return merged[key];
});
}
;
var INVALID_ELEMENT_ERROR='Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
var INFINITE_LOOP_ERROR='Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';
var DEFAULT_OPTIONS={
placement: 'bottom',
modifiers: [],
strategy: 'absolute'
};
function areValidElements(){
for (var _len=arguments.length, args=new Array(_len), _key=0; _key < _len; _key++){
args[_key]=arguments[_key];
}
return !args.some(function (element){
return !(element&&typeof element.getBoundingClientRect==='function');
});
}
function popperGenerator(generatorOptions){
if(generatorOptions===void 0){
generatorOptions={};}
var _generatorOptions=generatorOptions,
_generatorOptions$def=_generatorOptions.defaultModifiers,
defaultModifiers=_generatorOptions$def===void 0 ? []:_generatorOptions$def,
_generatorOptions$def2=_generatorOptions.defaultOptions,
defaultOptions=_generatorOptions$def2===void 0 ? DEFAULT_OPTIONS:_generatorOptions$def2;
return function createPopper(reference, popper, options){
if(options===void 0){
options=defaultOptions;
}
var state={
placement: 'bottom',
orderedModifiers: [],
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
modifiersData: {},
elements: {
reference: reference,
popper: popper
},
attributes: {},
styles: {}};
var effectCleanupFns=[];
var isDestroyed=false;
var instance={
state: state,
setOptions: function setOptions(setOptionsAction){
var options=typeof setOptionsAction==='function' ? setOptionsAction(state.options):setOptionsAction;
cleanupModifierEffects();
state.options=Object.assign({}, defaultOptions, state.options, options);
state.scrollParents={
reference: isElement(reference) ? listScrollParents(reference):reference.contextElement ? listScrollParents(reference.contextElement):[],
popper: listScrollParents(popper)
};
var orderedModifiers=orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers)));
state.orderedModifiers=orderedModifiers.filter(function (m){
return m.enabled;
});
if(false){ var _getComputedStyle, marginTop, marginRight, marginBottom, marginLeft, flipModifier, modifiers; }
runModifierEffects();
return instance.update();
},
forceUpdate: function forceUpdate(){
if(isDestroyed){
return;
}
var _state$elements=state.elements,
reference=_state$elements.reference,
popper=_state$elements.popper;
if(!areValidElements(reference, popper)){
if(false){}
return;
}
state.rects={
reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy==='fixed'),
popper: getLayoutRect(popper)
};
state.reset=false;
state.placement=state.options.placement;
state.orderedModifiers.forEach(function (modifier){
return state.modifiersData[modifier.name]=Object.assign({}, modifier.data);
});
var __debug_loops__=0;
for (var index=0; index < state.orderedModifiers.length; index++){
if(false){}
if(state.reset===true){
state.reset=false;
index=-1;
continue;
}
var _state$orderedModifie=state.orderedModifiers[index],
fn=_state$orderedModifie.fn,
_state$orderedModifie2=_state$orderedModifie.options,
_options=_state$orderedModifie2===void 0 ? {}:_state$orderedModifie2,
name=_state$orderedModifie.name;
if(typeof fn==='function'){
state=fn({
state: state,
options: _options,
name: name,
instance: instance
})||state;
}}
},
update: debounce(function (){
return new Promise(function (resolve){
instance.forceUpdate();
resolve(state);
});
}),
destroy: function destroy(){
cleanupModifierEffects();
isDestroyed=true;
}};
if(!areValidElements(reference, popper)){
if(false){}
return instance;
}
instance.setOptions(options).then(function (state){
if(!isDestroyed&&options.onFirstUpdate){
options.onFirstUpdate(state);
}});
function runModifierEffects(){
state.orderedModifiers.forEach(function (_ref3){
var name=_ref3.name,
_ref3$options=_ref3.options,
options=_ref3$options===void 0 ? {}:_ref3$options,
effect=_ref3.effect;
if(typeof effect==='function'){
var cleanupFn=effect({
state: state,
name: name,
instance: instance,
options: options
});
var noopFn=function noopFn(){};
effectCleanupFns.push(cleanupFn||noopFn);
}});
}
function cleanupModifierEffects(){
effectCleanupFns.forEach(function (fn){
return fn();
});
effectCleanupFns=[];
}
return instance;
};}
var createPopper=( null&&(popperGenerator()));
;
var passive={
passive: true
};
function effect(_ref){
var state=_ref.state,
instance=_ref.instance,
options=_ref.options;
var _options$scroll=options.scroll,
scroll=_options$scroll===void 0 ? true:_options$scroll,
_options$resize=options.resize,
resize=_options$resize===void 0 ? true:_options$resize;
var window=getWindow(state.elements.popper);
var scrollParents=[].concat(state.scrollParents.reference, state.scrollParents.popper);
if(scroll){
scrollParents.forEach(function (scrollParent){
scrollParent.addEventListener('scroll', instance.update, passive);
});
}
if(resize){
window.addEventListener('resize', instance.update, passive);
}
return function (){
if(scroll){
scrollParents.forEach(function (scrollParent){
scrollParent.removeEventListener('scroll', instance.update, passive);
});
}
if(resize){
window.removeEventListener('resize', instance.update, passive);
}};}
const eventListeners=({
name: 'eventListeners',
enabled: true,
phase: 'write',
fn: function fn(){},
effect: effect,
data: {}});
;
function getBasePlacement(placement){
return placement.split('-')[0];
}
;
function getVariation(placement){
return placement.split('-')[1];
}
;
function getMainAxisFromPlacement(placement){
return ['top', 'bottom'].indexOf(placement) >=0 ? 'x':'y';
}
;
function computeOffsets(_ref){
var reference=_ref.reference,
element=_ref.element,
placement=_ref.placement;
var basePlacement=placement ? getBasePlacement(placement):null;
var variation=placement ? getVariation(placement):null;
var commonX=reference.x + reference.width / 2 - element.width / 2;
var commonY=reference.y + reference.height / 2 - element.height / 2;
var offsets;
switch (basePlacement){
case enums_top:
offsets={
x: commonX,
y: reference.y - element.height
};
break;
case bottom:
offsets={
x: commonX,
y: reference.y + reference.height
};
break;
case right:
offsets={
x: reference.x + reference.width,
y: commonY
};
break;
case left:
offsets={
x: reference.x - element.width,
y: commonY
};
break;
default:
offsets={
x: reference.x,
y: reference.y
};}
var mainAxis=basePlacement ? getMainAxisFromPlacement(basePlacement):null;
if(mainAxis!=null){
var len=mainAxis==='y' ? 'height':'width';
switch (variation){
case start:
offsets[mainAxis]=offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
break;
case end:
offsets[mainAxis]=offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
break;
default:
}}
return offsets;
}
;
function popperOffsets(_ref){
var state=_ref.state,
name=_ref.name;
state.modifiersData[name]=computeOffsets({
reference: state.rects.reference,
element: state.rects.popper,
strategy: 'absolute',
placement: state.placement
});
}
const modifiers_popperOffsets=({
name: 'popperOffsets',
enabled: true,
phase: 'read',
fn: popperOffsets,
data: {}});
;
var unsetSides={
top: 'auto',
right: 'auto',
bottom: 'auto',
left: 'auto'
};
function roundOffsetsByDPR(_ref){
var x=_ref.x,
y=_ref.y;
var win=window;
var dpr=win.devicePixelRatio||1;
return {
x: round(x * dpr) / dpr||0,
y: round(y * dpr) / dpr||0
};}
function mapToStyles(_ref2){
var _Object$assign2;
var popper=_ref2.popper,
popperRect=_ref2.popperRect,
placement=_ref2.placement,
variation=_ref2.variation,
offsets=_ref2.offsets,
position=_ref2.position,
gpuAcceleration=_ref2.gpuAcceleration,
adaptive=_ref2.adaptive,
roundOffsets=_ref2.roundOffsets,
isFixed=_ref2.isFixed;
var _offsets$x=offsets.x,
x=_offsets$x===void 0 ? 0:_offsets$x,
_offsets$y=offsets.y,
y=_offsets$y===void 0 ? 0:_offsets$y;
var _ref3=typeof roundOffsets==='function' ? roundOffsets({
x: x,
y: y
}):{
x: x,
y: y
};
x=_ref3.x;
y=_ref3.y;
var hasX=offsets.hasOwnProperty('x');
var hasY=offsets.hasOwnProperty('y');
var sideX=left;
var sideY=enums_top;
var win=window;
if(adaptive){
var offsetParent=getOffsetParent(popper);
var heightProp='clientHeight';
var widthProp='clientWidth';
if(offsetParent===getWindow(popper)){
offsetParent=getDocumentElement(popper);
if(getComputedStyle(offsetParent).position!=='static'&&position==='absolute'){
heightProp='scrollHeight';
widthProp='scrollWidth';
}}
offsetParent=offsetParent;
if(placement===enums_top||(placement===left||placement===right)&&variation===end){
sideY=bottom;
var offsetY=isFixed&&offsetParent===win&&win.visualViewport ? win.visualViewport.height :
offsetParent[heightProp];
y -=offsetY - popperRect.height;
y *=gpuAcceleration ? 1:-1;
}
if(placement===left||(placement===enums_top||placement===bottom)&&variation===end){
sideX=right;
var offsetX=isFixed&&offsetParent===win&&win.visualViewport ? win.visualViewport.width :
offsetParent[widthProp];
x -=offsetX - popperRect.width;
x *=gpuAcceleration ? 1:-1;
}}
var commonStyles=Object.assign({
position: position
}, adaptive&&unsetSides);
var _ref4=roundOffsets===true ? roundOffsetsByDPR({
x: x,
y: y
}):{
x: x,
y: y
};
x=_ref4.x;
y=_ref4.y;
if(gpuAcceleration){
var _Object$assign;
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));
}
return Object.assign({}, commonStyles, (_Object$assign2={}, _Object$assign2[sideY]=hasY ? y + "px":'', _Object$assign2[sideX]=hasX ? x + "px":'', _Object$assign2.transform='', _Object$assign2));
}
function computeStyles(_ref5){
var state=_ref5.state,
options=_ref5.options;
var _options$gpuAccelerat=options.gpuAcceleration,
gpuAcceleration=_options$gpuAccelerat===void 0 ? true:_options$gpuAccelerat,
_options$adaptive=options.adaptive,
adaptive=_options$adaptive===void 0 ? true:_options$adaptive,
_options$roundOffsets=options.roundOffsets,
roundOffsets=_options$roundOffsets===void 0 ? true:_options$roundOffsets;
if(false){ var transitionProperty; }
var commonStyles={
placement: getBasePlacement(state.placement),
variation: getVariation(state.placement),
popper: state.elements.popper,
popperRect: state.rects.popper,
gpuAcceleration: gpuAcceleration,
isFixed: state.options.strategy==='fixed'
};
if(state.modifiersData.popperOffsets!=null){
state.styles.popper=Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
offsets: state.modifiersData.popperOffsets,
position: state.options.strategy,
adaptive: adaptive,
roundOffsets: roundOffsets
})));
}
if(state.modifiersData.arrow!=null){
state.styles.arrow=Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
offsets: state.modifiersData.arrow,
position: 'absolute',
adaptive: false,
roundOffsets: roundOffsets
})));
}
state.attributes.popper=Object.assign({}, state.attributes.popper, {
'data-popper-placement': state.placement
});
}
const modifiers_computeStyles=({
name: 'computeStyles',
enabled: true,
phase: 'beforeWrite',
fn: computeStyles,
data: {}});
;
function applyStyles(_ref){
var state=_ref.state;
Object.keys(state.elements).forEach(function (name){
var style=state.styles[name]||{};
var attributes=state.attributes[name]||{};
var element=state.elements[name];
if(!isHTMLElement(element)||!getNodeName(element)){
return;
}
Object.assign(element.style, style);
Object.keys(attributes).forEach(function (name){
var value=attributes[name];
if(value===false){
element.removeAttribute(name);
}else{
element.setAttribute(name, value===true ? '':value);
}});
});
}
function applyStyles_effect(_ref2){
var state=_ref2.state;
var initialStyles={
popper: {
position: state.options.strategy,
left: '0',
top: '0',
margin: '0'
},
arrow: {
position: 'absolute'
},
reference: {}};
Object.assign(state.elements.popper.style, initialStyles.popper);
state.styles=initialStyles;
if(state.elements.arrow){
Object.assign(state.elements.arrow.style, initialStyles.arrow);
}
return function (){
Object.keys(state.elements).forEach(function (name){
var element=state.elements[name];
var attributes=state.attributes[name]||{};
var styleProperties=Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name]:initialStyles[name]);
var style=styleProperties.reduce(function (style, property){
style[property]='';
return style;
}, {});
if(!isHTMLElement(element)||!getNodeName(element)){
return;
}
Object.assign(element.style, style);
Object.keys(attributes).forEach(function (attribute){
element.removeAttribute(attribute);
});
});
};}
const modifiers_applyStyles=({
name: 'applyStyles',
enabled: true,
phase: 'write',
fn: applyStyles,
effect: applyStyles_effect,
requires: ['computeStyles']
});
;
function distanceAndSkiddingToXY(placement, rects, offset){
var basePlacement=getBasePlacement(placement);
var invertDistance=[left, enums_top].indexOf(basePlacement) >=0 ? -1:1;
var _ref=typeof offset==='function' ? offset(Object.assign({}, rects, {
placement: placement
})):offset,
skidding=_ref[0],
distance=_ref[1];
skidding=skidding||0;
distance=(distance||0) * invertDistance;
return [left, right].indexOf(basePlacement) >=0 ? {
x: distance,
y: skidding
}:{
x: skidding,
y: distance
};}
function offset(_ref2){
var state=_ref2.state,
options=_ref2.options,
name=_ref2.name;
var _options$offset=options.offset,
offset=_options$offset===void 0 ? [0, 0]:_options$offset;
var data=enums_placements.reduce(function (acc, placement){
acc[placement]=distanceAndSkiddingToXY(placement, state.rects, offset);
return acc;
}, {});
var _data$state$placement=data[state.placement],
x=_data$state$placement.x,
y=_data$state$placement.y;
if(state.modifiersData.popperOffsets!=null){
state.modifiersData.popperOffsets.x +=x;
state.modifiersData.popperOffsets.y +=y;
}
state.modifiersData[name]=data;
}
const modifiers_offset=({
name: 'offset',
enabled: true,
phase: 'main',
requires: ['popperOffsets'],
fn: offset
});
;
var hash={
left: 'right',
right: 'left',
bottom: 'top',
top: 'bottom'
};
function getOppositePlacement(placement){
return placement.replace(/left|right|bottom|top/g, function (matched){
return hash[matched];
});
}
;
var getOppositeVariationPlacement_hash={
start: 'end',
end: 'start'
};
function getOppositeVariationPlacement(placement){
return placement.replace(/start|end/g, function (matched){
return getOppositeVariationPlacement_hash[matched];
});
}
;
function getViewportRect(element){
var win=getWindow(element);
var html=getDocumentElement(element);
var visualViewport=win.visualViewport;
var width=html.clientWidth;
var height=html.clientHeight;
var x=0;
var y=0;
if(visualViewport){
width=visualViewport.width;
height=visualViewport.height;
if(!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)){
x=visualViewport.offsetLeft;
y=visualViewport.offsetTop;
}}
return {
width: width,
height: height,
x: x + getWindowScrollBarX(element),
y: y
};}
;
function getDocumentRect(element){
var _element$ownerDocumen;
var html=getDocumentElement(element);
var winScroll=getWindowScroll(element);
var body=(_element$ownerDocumen=element.ownerDocument)==null ? void 0:_element$ownerDocumen.body;
var width=math_max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth:0, body ? body.clientWidth:0);
var height=math_max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight:0, body ? body.clientHeight:0);
var x=-winScroll.scrollLeft + getWindowScrollBarX(element);
var y=-winScroll.scrollTop;
if(getComputedStyle(body||html).direction==='rtl'){
x +=math_max(html.clientWidth, body ? body.clientWidth:0) - width;
}
return {
width: width,
height: height,
x: x,
y: y
};}
;
function contains(parent, child){
var rootNode=child.getRootNode&&child.getRootNode();
if(parent.contains(child)){
return true;
}
else if(rootNode&&isShadowRoot(rootNode)){
var next=child;
do {
if(next&&parent.isSameNode(next)){
return true;
}
next=next.parentNode||next.host;
} while (next);
}
return false;
}
;
function rectToClientRect(rect){
return Object.assign({}, rect, {
left: rect.x,
top: rect.y,
right: rect.x + rect.width,
bottom: rect.y + rect.height
});
}
;
function getInnerBoundingClientRect(element){
var rect=getBoundingClientRect(element);
rect.top=rect.top + element.clientTop;
rect.left=rect.left + element.clientLeft;
rect.bottom=rect.top + element.clientHeight;
rect.right=rect.left + element.clientWidth;
rect.width=element.clientWidth;
rect.height=element.clientHeight;
rect.x=rect.left;
rect.y=rect.top;
return rect;
}
function getClientRectFromMixedType(element, clippingParent){
return clippingParent===viewport ? rectToClientRect(getViewportRect(element)):isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent):rectToClientRect(getDocumentRect(getDocumentElement(element)));
}
function getClippingParents(element){
var clippingParents=listScrollParents(getParentNode(element));
var canEscapeClipping=['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >=0;
var clipperElement=canEscapeClipping&&isHTMLElement(element) ? getOffsetParent(element):element;
if(!isElement(clipperElement)){
return [];
} // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
return clippingParents.filter(function (clippingParent){
return isElement(clippingParent)&&contains(clippingParent, clipperElement)&&getNodeName(clippingParent)!=='body';
});
}
function getClippingRect(element, boundary, rootBoundary){
var mainClippingParents=boundary==='clippingParents' ? getClippingParents(element):[].concat(boundary);
var clippingParents=[].concat(mainClippingParents, [rootBoundary]);
var firstClippingParent=clippingParents[0];
var clippingRect=clippingParents.reduce(function (accRect, clippingParent){
var rect=getClientRectFromMixedType(element, clippingParent);
accRect.top=math_max(rect.top, accRect.top);
accRect.right=math_min(rect.right, accRect.right);
accRect.bottom=math_min(rect.bottom, accRect.bottom);
accRect.left=math_max(rect.left, accRect.left);
return accRect;
}, getClientRectFromMixedType(element, firstClippingParent));
clippingRect.width=clippingRect.right - clippingRect.left;
clippingRect.height=clippingRect.bottom - clippingRect.top;
clippingRect.x=clippingRect.left;
clippingRect.y=clippingRect.top;
return clippingRect;
}
;
function getFreshSideObject(){
return {
top: 0,
right: 0,
bottom: 0,
left: 0
};}
;
function mergePaddingObject(paddingObject){
return Object.assign({}, getFreshSideObject(), paddingObject);
}
;
function expandToHashMap(value, keys){
return keys.reduce(function (hashMap, key){
hashMap[key]=value;
return hashMap;
}, {});
}
;
function detectOverflow(state, options){
if(options===void 0){
options={};}
var _options=options,
_options$placement=_options.placement,
placement=_options$placement===void 0 ? state.placement:_options$placement,
_options$boundary=_options.boundary,
boundary=_options$boundary===void 0 ? clippingParents:_options$boundary,
_options$rootBoundary=_options.rootBoundary,
rootBoundary=_options$rootBoundary===void 0 ? viewport:_options$rootBoundary,
_options$elementConte=_options.elementContext,
elementContext=_options$elementConte===void 0 ? popper:_options$elementConte,
_options$altBoundary=_options.altBoundary,
altBoundary=_options$altBoundary===void 0 ? false:_options$altBoundary,
_options$padding=_options.padding,
padding=_options$padding===void 0 ? 0:_options$padding;
var paddingObject=mergePaddingObject(typeof padding!=='number' ? padding:expandToHashMap(padding, basePlacements));
var altContext=elementContext===popper ? reference:popper;
var popperRect=state.rects.popper;
var element=state.elements[altBoundary ? altContext:elementContext];
var clippingClientRect=getClippingRect(isElement(element) ? element:element.contextElement||getDocumentElement(state.elements.popper), boundary, rootBoundary);
var referenceClientRect=getBoundingClientRect(state.elements.reference);
var popperOffsets=computeOffsets({
reference: referenceClientRect,
element: popperRect,
strategy: 'absolute',
placement: placement
});
var popperClientRect=rectToClientRect(Object.assign({}, popperRect, popperOffsets));
var elementClientRect=elementContext===popper ? popperClientRect:referenceClientRect;
var overflowOffsets={
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
};
var offsetData=state.modifiersData.offset;
if(elementContext===popper&&offsetData){
var offset=offsetData[placement];
Object.keys(overflowOffsets).forEach(function (key){
var multiply=[right, bottom].indexOf(key) >=0 ? 1:-1;
var axis=[enums_top, bottom].indexOf(key) >=0 ? 'y':'x';
overflowOffsets[key] +=offset[axis] * multiply;
});
}
return overflowOffsets;
}
;
function computeAutoPlacement(state, options){
if(options===void 0){
options={};}
var _options=options,
placement=_options.placement,
boundary=_options.boundary,
rootBoundary=_options.rootBoundary,
padding=_options.padding,
flipVariations=_options.flipVariations,
_options$allowedAutoP=_options.allowedAutoPlacements,
allowedAutoPlacements=_options$allowedAutoP===void 0 ? enums_placements:_options$allowedAutoP;
var variation=getVariation(placement);
var placements=variation ? flipVariations ? variationPlacements:variationPlacements.filter(function (placement){
return getVariation(placement)===variation;
}):basePlacements;
var allowedPlacements=placements.filter(function (placement){
return allowedAutoPlacements.indexOf(placement) >=0;
});
if(allowedPlacements.length===0){
allowedPlacements=placements;
if(false){}}
var overflows=allowedPlacements.reduce(function (acc, placement){
acc[placement]=detectOverflow(state, {
placement: placement,
boundary: boundary,
rootBoundary: rootBoundary,
padding: padding
})[getBasePlacement(placement)];
return acc;
}, {});
return Object.keys(overflows).sort(function (a, b){
return overflows[a] - overflows[b];
});
}
;
function getExpandedFallbackPlacements(placement){
if(getBasePlacement(placement)===auto){
return [];
}
var oppositePlacement=getOppositePlacement(placement);
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
}
function flip(_ref){
var state=_ref.state,
options=_ref.options,
name=_ref.name;
if(state.modifiersData[name]._skip){
return;
}
var _options$mainAxis=options.mainAxis,
checkMainAxis=_options$mainAxis===void 0 ? true:_options$mainAxis,
_options$altAxis=options.altAxis,
checkAltAxis=_options$altAxis===void 0 ? true:_options$altAxis,
specifiedFallbackPlacements=options.fallbackPlacements,
padding=options.padding,
boundary=options.boundary,
rootBoundary=options.rootBoundary,
altBoundary=options.altBoundary,
_options$flipVariatio=options.flipVariations,
flipVariations=_options$flipVariatio===void 0 ? true:_options$flipVariatio,
allowedAutoPlacements=options.allowedAutoPlacements;
var preferredPlacement=state.options.placement;
var basePlacement=getBasePlacement(preferredPlacement);
var isBasePlacement=basePlacement===preferredPlacement;
var fallbackPlacements=specifiedFallbackPlacements||(isBasePlacement||!flipVariations ? [getOppositePlacement(preferredPlacement)]:getExpandedFallbackPlacements(preferredPlacement));
var placements=[preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement){
return acc.concat(getBasePlacement(placement)===auto ? computeAutoPlacement(state, {
placement: placement,
boundary: boundary,
rootBoundary: rootBoundary,
padding: padding,
flipVariations: flipVariations,
allowedAutoPlacements: allowedAutoPlacements
}):placement);
}, []);
var referenceRect=state.rects.reference;
var popperRect=state.rects.popper;
var checksMap=new Map();
var makeFallbackChecks=true;
var firstFittingPlacement=placements[0];
for (var i=0; i < placements.length; i++){
var placement=placements[i];
var _basePlacement=getBasePlacement(placement);
var isStartVariation=getVariation(placement)===start;
var isVertical=[enums_top, bottom].indexOf(_basePlacement) >=0;
var len=isVertical ? 'width':'height';
var overflow=detectOverflow(state, {
placement: placement,
boundary: boundary,
rootBoundary: rootBoundary,
altBoundary: altBoundary,
padding: padding
});
var mainVariationSide=isVertical ? isStartVariation ? right:left:isStartVariation ? bottom:enums_top;
if(referenceRect[len] > popperRect[len]){
mainVariationSide=getOppositePlacement(mainVariationSide);
}
var altVariationSide=getOppositePlacement(mainVariationSide);
var checks=[];
if(checkMainAxis){
checks.push(overflow[_basePlacement] <=0);
}
if(checkAltAxis){
checks.push(overflow[mainVariationSide] <=0, overflow[altVariationSide] <=0);
}
if(checks.every(function (check){
return check;
})){
firstFittingPlacement=placement;
makeFallbackChecks=false;
break;
}
checksMap.set(placement, checks);
}
if(makeFallbackChecks){
var numberOfChecks=flipVariations ? 3:1;
var _loop=function _loop(_i){
var fittingPlacement=placements.find(function (placement){
var checks=checksMap.get(placement);
if(checks){
return checks.slice(0, _i).every(function (check){
return check;
});
}});
if(fittingPlacement){
firstFittingPlacement=fittingPlacement;
return "break";
}};
for (var _i=numberOfChecks; _i > 0; _i--){
var _ret=_loop(_i);
if(_ret==="break") break;
}}
if(state.placement!==firstFittingPlacement){
state.modifiersData[name]._skip=true;
state.placement=firstFittingPlacement;
state.reset=true;
}}
const modifiers_flip=({
name: 'flip',
enabled: true,
phase: 'main',
fn: flip,
requiresIfExists: ['offset'],
data: {
_skip: false
}});
;
function getAltAxis(axis){
return axis==='x' ? 'y':'x';
}
;
function within(min, value, max){
return math_max(min, math_min(value, max));
}
function withinMaxClamp(min, value, max){
var v=within(min, value, max);
return v > max ? max:v;
}
;
function preventOverflow(_ref){
var state=_ref.state,
options=_ref.options,
name=_ref.name;
var _options$mainAxis=options.mainAxis,
checkMainAxis=_options$mainAxis===void 0 ? true:_options$mainAxis,
_options$altAxis=options.altAxis,
checkAltAxis=_options$altAxis===void 0 ? false:_options$altAxis,
boundary=options.boundary,
rootBoundary=options.rootBoundary,
altBoundary=options.altBoundary,
padding=options.padding,
_options$tether=options.tether,
tether=_options$tether===void 0 ? true:_options$tether,
_options$tetherOffset=options.tetherOffset,
tetherOffset=_options$tetherOffset===void 0 ? 0:_options$tetherOffset;
var overflow=detectOverflow(state, {
boundary: boundary,
rootBoundary: rootBoundary,
padding: padding,
altBoundary: altBoundary
});
var basePlacement=getBasePlacement(state.placement);
var variation=getVariation(state.placement);
var isBasePlacement = !variation;
var mainAxis=getMainAxisFromPlacement(basePlacement);
var altAxis=getAltAxis(mainAxis);
var popperOffsets=state.modifiersData.popperOffsets;
var referenceRect=state.rects.reference;
var popperRect=state.rects.popper;
var tetherOffsetValue=typeof tetherOffset==='function' ? tetherOffset(Object.assign({}, state.rects, {
placement: state.placement
})):tetherOffset;
var normalizedTetherOffsetValue=typeof tetherOffsetValue==='number' ? {
mainAxis: tetherOffsetValue,
altAxis: tetherOffsetValue
}:Object.assign({
mainAxis: 0,
altAxis: 0
}, tetherOffsetValue);
var offsetModifierState=state.modifiersData.offset ? state.modifiersData.offset[state.placement]:null;
var data={
x: 0,
y: 0
};
if(!popperOffsets){
return;
}
if(checkMainAxis){
var _offsetModifierState$;
var mainSide=mainAxis==='y' ? enums_top:left;
var altSide=mainAxis==='y' ? bottom:right;
var len=mainAxis==='y' ? 'height':'width';
var offset=popperOffsets[mainAxis];
var min=offset + overflow[mainSide];
var max=offset - overflow[altSide];
var additive=tether ? -popperRect[len] / 2:0;
var minLen=variation===start ? referenceRect[len]:popperRect[len];
var maxLen=variation===start ? -popperRect[len]:-referenceRect[len];
var arrowElement=state.elements.arrow;
var arrowRect=tether&&arrowElement ? getLayoutRect(arrowElement):{
width: 0,
height: 0
};
var arrowPaddingObject=state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding:getFreshSideObject();
var arrowPaddingMin=arrowPaddingObject[mainSide];
var arrowPaddingMax=arrowPaddingObject[altSide];
var arrowLen=within(0, referenceRect[len], arrowRect[len]);
var minOffset=isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis:minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
var maxOffset=isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis:maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
var arrowOffsetParent=state.elements.arrow&&getOffsetParent(state.elements.arrow);
var clientOffset=arrowOffsetParent ? mainAxis==='y' ? arrowOffsetParent.clientTop||0:arrowOffsetParent.clientLeft||0:0;
var offsetModifierValue=(_offsetModifierState$=offsetModifierState==null ? void 0:offsetModifierState[mainAxis])!=null ? _offsetModifierState$:0;
var tetherMin=offset + minOffset - offsetModifierValue - clientOffset;
var tetherMax=offset + maxOffset - offsetModifierValue;
var preventedOffset=within(tether ? math_min(min, tetherMin):min, offset, tether ? math_max(max, tetherMax):max);
popperOffsets[mainAxis]=preventedOffset;
data[mainAxis]=preventedOffset - offset;
}
if(checkAltAxis){
var _offsetModifierState$2;
var _mainSide=mainAxis==='x' ? enums_top:left;
var _altSide=mainAxis==='x' ? bottom:right;
var _offset=popperOffsets[altAxis];
var _len=altAxis==='y' ? 'height':'width';
var _min=_offset + overflow[_mainSide];
var _max=_offset - overflow[_altSide];
var isOriginSide=[enums_top, left].indexOf(basePlacement)!==-1;
var _offsetModifierValue=(_offsetModifierState$2=offsetModifierState==null ? void 0:offsetModifierState[altAxis])!=null ? _offsetModifierState$2:0;
var _tetherMin=isOriginSide ? _min:_offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
var _tetherMax=isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis:_max;
var _preventedOffset=tether&&isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax):within(tether ? _tetherMin:_min, _offset, tether ? _tetherMax:_max);
popperOffsets[altAxis]=_preventedOffset;
data[altAxis]=_preventedOffset - _offset;
}
state.modifiersData[name]=data;
}
const modifiers_preventOverflow=({
name: 'preventOverflow',
enabled: true,
phase: 'main',
fn: preventOverflow,
requiresIfExists: ['offset']
});
;
var toPaddingObject=function toPaddingObject(padding, state){
padding=typeof padding==='function' ? padding(Object.assign({}, state.rects, {
placement: state.placement
})):padding;
return mergePaddingObject(typeof padding!=='number' ? padding:expandToHashMap(padding, basePlacements));
};
function arrow(_ref){
var _state$modifiersData$;
var state=_ref.state,
name=_ref.name,
options=_ref.options;
var arrowElement=state.elements.arrow;
var popperOffsets=state.modifiersData.popperOffsets;
var basePlacement=getBasePlacement(state.placement);
var axis=getMainAxisFromPlacement(basePlacement);
var isVertical=[left, right].indexOf(basePlacement) >=0;
var len=isVertical ? 'height':'width';
if(!arrowElement||!popperOffsets){
return;
}
var paddingObject=toPaddingObject(options.padding, state);
var arrowRect=getLayoutRect(arrowElement);
var minProp=axis==='y' ? enums_top:left;
var maxProp=axis==='y' ? bottom:right;
var endDiff=state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
var startDiff=popperOffsets[axis] - state.rects.reference[axis];
var arrowOffsetParent=getOffsetParent(arrowElement);
var clientSize=arrowOffsetParent ? axis==='y' ? arrowOffsetParent.clientHeight||0:arrowOffsetParent.clientWidth||0:0;
var centerToReference=endDiff / 2 - startDiff / 2;
var min=paddingObject[minProp];
var max=clientSize - arrowRect[len] - paddingObject[maxProp];
var center=clientSize / 2 - arrowRect[len] / 2 + centerToReference;
var offset=within(min, center, max);
var axisProp=axis;
state.modifiersData[name]=(_state$modifiersData$={}, _state$modifiersData$[axisProp]=offset, _state$modifiersData$.centerOffset=offset - center, _state$modifiersData$);
}
function arrow_effect(_ref2){
var state=_ref2.state,
options=_ref2.options;
var _options$element=options.element,
arrowElement=_options$element===void 0 ? '[data-popper-arrow]':_options$element;
if(arrowElement==null){
return;
}
if(typeof arrowElement==='string'){
arrowElement=state.elements.popper.querySelector(arrowElement);
if(!arrowElement){
return;
}}
if(false){}
if(!contains(state.elements.popper, arrowElement)){
if(false){}
return;
}
state.elements.arrow=arrowElement;
}
const modifiers_arrow=({
name: 'arrow',
enabled: true,
phase: 'main',
fn: arrow,
effect: arrow_effect,
requires: ['popperOffsets'],
requiresIfExists: ['preventOverflow']
});
;
function getSideOffsets(overflow, rect, preventedOffsets){
if(preventedOffsets===void 0){
preventedOffsets={
x: 0,
y: 0
};}
return {
top: overflow.top - rect.height - preventedOffsets.y,
right: overflow.right - rect.width + preventedOffsets.x,
bottom: overflow.bottom - rect.height + preventedOffsets.y,
left: overflow.left - rect.width - preventedOffsets.x
};}
function isAnySideFullyClipped(overflow){
return [enums_top, right, bottom, left].some(function (side){
return overflow[side] >=0;
});
}
function hide(_ref){
var state=_ref.state,
name=_ref.name;
var referenceRect=state.rects.reference;
var popperRect=state.rects.popper;
var preventedOffsets=state.modifiersData.preventOverflow;
var referenceOverflow=detectOverflow(state, {
elementContext: 'reference'
});
var popperAltOverflow=detectOverflow(state, {
altBoundary: true
});
var referenceClippingOffsets=getSideOffsets(referenceOverflow, referenceRect);
var popperEscapeOffsets=getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
var isReferenceHidden=isAnySideFullyClipped(referenceClippingOffsets);
var hasPopperEscaped=isAnySideFullyClipped(popperEscapeOffsets);
state.modifiersData[name]={
referenceClippingOffsets: referenceClippingOffsets,
popperEscapeOffsets: popperEscapeOffsets,
isReferenceHidden: isReferenceHidden,
hasPopperEscaped: hasPopperEscaped
};
state.attributes.popper=Object.assign({}, state.attributes.popper, {
'data-popper-reference-hidden': isReferenceHidden,
'data-popper-escaped': hasPopperEscaped
});
}
const modifiers_hide=({
name: 'hide',
enabled: true,
phase: 'main',
requiresIfExists: ['preventOverflow'],
fn: hide
});
;
var defaultModifiers=[eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles, modifiers_offset, modifiers_flip, modifiers_preventOverflow, modifiers_arrow, modifiers_hide];
var popper_createPopper=popperGenerator({
defaultModifiers: defaultModifiers
});
;
var 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>';
var BOX_CLASS="tippy-box";
var CONTENT_CLASS="tippy-content";
var BACKDROP_CLASS="tippy-backdrop";
var ARROW_CLASS="tippy-arrow";
var SVG_ARROW_CLASS="tippy-svg-arrow";
var TOUCH_OPTIONS={
passive: true,
capture: true
};
var TIPPY_DEFAULT_APPEND_TO=function TIPPY_DEFAULT_APPEND_TO(){
return document.body;
};
function tippy_esm_hasOwnProperty(obj, key){
return {}.hasOwnProperty.call(obj, key);
}
function getValueAtIndexOrReturn(value, index, defaultValue){
if(Array.isArray(value)){
var v=value[index];
return v==null ? Array.isArray(defaultValue) ? defaultValue[index]:defaultValue:v;
}
return value;
}
function isType(value, type){
var str={}.toString.call(value);
return str.indexOf('[object')===0&&str.indexOf(type + "]") > -1;
}
function invokeWithArgsOrReturn(value, args){
return typeof value==='function' ? value.apply(void 0, args):value;
}
function tippy_esm_debounce(fn, ms){
if(ms===0){
return fn;
}
var timeout;
return function (arg){
clearTimeout(timeout);
timeout=setTimeout(function (){
fn(arg);
}, ms);
};}
function removeProperties(obj, keys){
var clone=Object.assign({}, obj);
keys.forEach(function (key){
delete clone[key];
});
return clone;
}
function splitBySpaces(value){
return value.split(/\s+/).filter(Boolean);
}
function normalizeToArray(value){
return [].concat(value);
}
function pushIfUnique(arr, value){
if(arr.indexOf(value)===-1){
arr.push(value);
}}
function unique(arr){
return arr.filter(function (item, index){
return arr.indexOf(item)===index;
});
}
function tippy_esm_getBasePlacement(placement){
return placement.split('-')[0];
}
function arrayFrom(value){
return [].slice.call(value);
}
function removeUndefinedProps(obj){
return Object.keys(obj).reduce(function (acc, key){
if(obj[key]!==undefined){
acc[key]=obj[key];
}
return acc;
}, {});
}
function div(){
return document.createElement('div');
}
function tippy_esm_isElement(value){
return ['Element', 'Fragment'].some(function (type){
return isType(value, type);
});
}
function isNodeList(value){
return isType(value, 'NodeList');
}
function isMouseEvent(value){
return isType(value, 'MouseEvent');
}
function isReferenceElement(value){
return !!(value&&value._tippy&&value._tippy.reference===value);
}
function getArrayOfElements(value){
if(tippy_esm_isElement(value)){
return [value];
}
if(isNodeList(value)){
return arrayFrom(value);
}
if(Array.isArray(value)){
return value;
}
return arrayFrom(document.querySelectorAll(value));
}
function setTransitionDuration(els, value){
els.forEach(function (el){
if(el){
el.style.transitionDuration=value + "ms";
}});
}
function setVisibilityState(els, state){
els.forEach(function (el){
if(el){
el.setAttribute('data-state', state);
}});
}
function getOwnerDocument(elementOrElements){
var _element$ownerDocumen;
var _normalizeToArray=normalizeToArray(elementOrElements),
element=_normalizeToArray[0];
return element!=null&&(_element$ownerDocumen=element.ownerDocument)!=null&&_element$ownerDocumen.body ? element.ownerDocument:document;
}
function isCursorOutsideInteractiveBorder(popperTreeData, event){
var clientX=event.clientX,
clientY=event.clientY;
return popperTreeData.every(function (_ref){
var popperRect=_ref.popperRect,
popperState=_ref.popperState,
props=_ref.props;
var interactiveBorder=props.interactiveBorder;
var basePlacement=tippy_esm_getBasePlacement(popperState.placement);
var offsetData=popperState.modifiersData.offset;
if(!offsetData){
return true;
}
var topDistance=basePlacement==='bottom' ? offsetData.top.y:0;
var bottomDistance=basePlacement==='top' ? offsetData.bottom.y:0;
var leftDistance=basePlacement==='right' ? offsetData.left.x:0;
var rightDistance=basePlacement==='left' ? offsetData.right.x:0;
var exceedsTop=popperRect.top - clientY + topDistance > interactiveBorder;
var exceedsBottom=clientY - popperRect.bottom - bottomDistance > interactiveBorder;
var exceedsLeft=popperRect.left - clientX + leftDistance > interactiveBorder;
var exceedsRight=clientX - popperRect.right - rightDistance > interactiveBorder;
return exceedsTop||exceedsBottom||exceedsLeft||exceedsRight;
});
}
function updateTransitionEndListener(box, action, listener){
var method=action + "EventListener";
['transitionend', 'webkitTransitionEnd'].forEach(function (event){
box[method](event, listener);
});
}
function actualContains(parent, child){
var target=child;
while (target){
var _target$getRootNode;
if(parent.contains(target)){
return true;
}
target=target.getRootNode==null ? void 0:(_target$getRootNode=target.getRootNode())==null ? void 0:_target$getRootNode.host;
}
return false;
}
var currentInput={
isTouch: false
};
var lastMouseMoveTime=0;
function onDocumentTouchStart(){
if(currentInput.isTouch){
return;
}
currentInput.isTouch=true;
if(window.performance){
document.addEventListener('mousemove', onDocumentMouseMove);
}}
function onDocumentMouseMove(){
var now=performance.now();
if(now - lastMouseMoveTime < 20){
currentInput.isTouch=false;
document.removeEventListener('mousemove', onDocumentMouseMove);
}
lastMouseMoveTime=now;
}
function onWindowBlur(){
var activeElement=document.activeElement;
if(isReferenceElement(activeElement)){
var instance=activeElement._tippy;
if(activeElement.blur&&!instance.state.isVisible){
activeElement.blur();
}}
}
function bindGlobalEventListeners(){
document.addEventListener('touchstart', onDocumentTouchStart, TOUCH_OPTIONS);
window.addEventListener('blur', onWindowBlur);
}
var isBrowser=typeof window!=='undefined'&&typeof document!=='undefined';
var isIE11=isBrowser ?
!!window.msCrypto:false;
function createMemoryLeakWarning(method){
var txt=method==='destroy' ? 'n already-':' ';
return [method + "() was called on a" + txt + "destroyed instance. This is a no-op but", 'indicates a potential memory leak.'].join(' ');
}
function clean(value){
var spacesAndTabs=/[ \t]{2,}/g;
var lineStartWithSpaces=/^[ \t]*/gm;
return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();
}
function getDevMessage(message){
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  ");
}
function getFormattedMessage(message){
return [getDevMessage(message),
'color: #00C584; font-size: 1.3em; font-weight: bold;',
'line-height: 1.5',
'color: #a6a095;'];
}
var visitedMessages;
if(false){}
function resetVisitedMessages(){
visitedMessages=new Set();
}
function warnWhen(condition, message){
if(condition&&!visitedMessages.has(message)){
var _console;
visitedMessages.add(message);
(_console=console).warn.apply(_console, getFormattedMessage(message));
}}
function errorWhen(condition, message){
if(condition&&!visitedMessages.has(message)){
var _console2;
visitedMessages.add(message);
(_console2=console).error.apply(_console2, getFormattedMessage(message));
}}
function validateTargets(targets){
var didPassFalsyValue = !targets;
var didPassPlainObject=Object.prototype.toString.call(targets)==='[object Object]'&&!targets.addEventListener;
errorWhen(didPassFalsyValue, ['tippy() was passed', '`' + String(targets) + '`', 'as its targets (first) argument. Valid types are: String, Element,', 'Element[], or NodeList.'].join(' '));
errorWhen(didPassPlainObject, ['tippy() was passed a plain object which is not supported as an argument', 'for virtual positioning. Use props.getReferenceClientRect instead.'].join(' '));
}
var pluginProps={
animateFill: false,
followCursor: false,
inlinePositioning: false,
sticky: false
};
var renderProps={
allowHTML: false,
animation: 'fade',
arrow: true,
content: '',
inertia: false,
maxWidth: 350,
role: 'tooltip',
theme: '',
zIndex: 9999
};
var defaultProps=Object.assign({
appendTo: TIPPY_DEFAULT_APPEND_TO,
aria: {
content: 'auto',
expanded: 'auto'
},
delay: 0,
duration: [300, 250],
getReferenceClientRect: null,
hideOnClick: true,
ignoreAttributes: false,
interactive: false,
interactiveBorder: 2,
interactiveDebounce: 0,
moveTransition: '',
offset: [0, 10],
onAfterUpdate: function onAfterUpdate(){},
onBeforeUpdate: function onBeforeUpdate(){},
onCreate: function onCreate(){},
onDestroy: function onDestroy(){},
onHidden: function onHidden(){},
onHide: function onHide(){},
onMount: function onMount(){},
onShow: function onShow(){},
onShown: function onShown(){},
onTrigger: function onTrigger(){},
onUntrigger: function onUntrigger(){},
onClickOutside: function onClickOutside(){},
placement: 'top',
plugins: [],
popperOptions: {},
render: null,
showOnCreate: false,
touch: true,
trigger: 'mouseenter focus',
triggerTarget: null
}, pluginProps, renderProps);
var defaultKeys=Object.keys(defaultProps);
var setDefaultProps=function setDefaultProps(partialProps){
if(false){}
var keys=Object.keys(partialProps);
keys.forEach(function (key){
defaultProps[key]=partialProps[key];
});
};
function getExtendedPassedProps(passedProps){
var plugins=passedProps.plugins||[];
var pluginProps=plugins.reduce(function (acc, plugin){
var name=plugin.name,
defaultValue=plugin.defaultValue;
if(name){
var _name;
acc[name]=passedProps[name]!==undefined ? passedProps[name]:(_name=defaultProps[name])!=null ? _name:defaultValue;
}
return acc;
}, {});
return Object.assign({}, passedProps, pluginProps);
}
function getDataAttributeProps(reference, plugins){
var propKeys=plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {
plugins: plugins
}))):defaultKeys;
var props=propKeys.reduce(function (acc, key){
var valueAsString=(reference.getAttribute("data-tippy-" + key)||'').trim();
if(!valueAsString){
return acc;
}
if(key==='content'){
acc[key]=valueAsString;
}else{
try {
acc[key]=JSON.parse(valueAsString);
} catch (e){
acc[key]=valueAsString;
}}
return acc;
}, {});
return props;
}
function evaluateProps(reference, props){
var out=Object.assign({}, props, {
content: invokeWithArgsOrReturn(props.content, [reference])
}, props.ignoreAttributes ? {}:getDataAttributeProps(reference, props.plugins));
out.aria=Object.assign({}, defaultProps.aria, out.aria);
out.aria={
expanded: out.aria.expanded==='auto' ? props.interactive:out.aria.expanded,
content: out.aria.content==='auto' ? props.interactive ? null:'describedby':out.aria.content
};
return out;
}
function validateProps(partialProps, plugins){
if(partialProps===void 0){
partialProps={};}
if(plugins===void 0){
plugins=[];
}
var keys=Object.keys(partialProps);
keys.forEach(function (prop){
var nonPluginProps=removeProperties(defaultProps, Object.keys(pluginProps));
var didPassUnknownProp = !tippy_esm_hasOwnProperty(nonPluginProps, prop);
if(didPassUnknownProp){
didPassUnknownProp=plugins.filter(function (plugin){
return plugin.name===prop;
}).length===0;
}
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(' '));
});
}
var innerHTML=function innerHTML(){
return 'innerHTML';
};
function dangerouslySetInnerHTML(element, html){
element[innerHTML()]=html;
}
function createArrowElement(value){
var arrow=div();
if(value===true){
arrow.className=ARROW_CLASS;
}else{
arrow.className=SVG_ARROW_CLASS;
if(tippy_esm_isElement(value)){
arrow.appendChild(value);
}else{
dangerouslySetInnerHTML(arrow, value);
}}
return arrow;
}
function setContent(content, props){
if(tippy_esm_isElement(props.content)){
dangerouslySetInnerHTML(content, '');
content.appendChild(props.content);
}else if(typeof props.content!=='function'){
if(props.allowHTML){
dangerouslySetInnerHTML(content, props.content);
}else{
content.textContent=props.content;
}}
}
function getChildren(popper){
var box=popper.firstElementChild;
var boxChildren=arrayFrom(box.children);
return {
box: box,
content: boxChildren.find(function (node){
return node.classList.contains(CONTENT_CLASS);
}),
arrow: boxChildren.find(function (node){
return node.classList.contains(ARROW_CLASS)||node.classList.contains(SVG_ARROW_CLASS);
}),
backdrop: boxChildren.find(function (node){
return node.classList.contains(BACKDROP_CLASS);
})
};}
function render(instance){
var popper=div();
var box=div();
box.className=BOX_CLASS;
box.setAttribute('data-state', 'hidden');
box.setAttribute('tabindex', '-1');
var content=div();
content.className=CONTENT_CLASS;
content.setAttribute('data-state', 'hidden');
setContent(content, instance.props);
popper.appendChild(box);
box.appendChild(content);
onUpdate(instance.props, instance.props);
function onUpdate(prevProps, nextProps){
var _getChildren=getChildren(popper),
box=_getChildren.box,
content=_getChildren.content,
arrow=_getChildren.arrow;
if(nextProps.theme){
box.setAttribute('data-theme', nextProps.theme);
}else{
box.removeAttribute('data-theme');
}
if(typeof nextProps.animation==='string'){
box.setAttribute('data-animation', nextProps.animation);
}else{
box.removeAttribute('data-animation');
}
if(nextProps.inertia){
box.setAttribute('data-inertia', '');
}else{
box.removeAttribute('data-inertia');
}
box.style.maxWidth=typeof nextProps.maxWidth==='number' ? nextProps.maxWidth + "px":nextProps.maxWidth;
if(nextProps.role){
box.setAttribute('role', nextProps.role);
}else{
box.removeAttribute('role');
}
if(prevProps.content!==nextProps.content||prevProps.allowHTML!==nextProps.allowHTML){
setContent(content, instance.props);
}
if(nextProps.arrow){
if(!arrow){
box.appendChild(createArrowElement(nextProps.arrow));
}else if(prevProps.arrow!==nextProps.arrow){
box.removeChild(arrow);
box.appendChild(createArrowElement(nextProps.arrow));
}}else if(arrow){
box.removeChild(arrow);
}}
return {
popper: popper,
onUpdate: onUpdate
};}
render.$$tippy=true;
var idCounter=1;
var mouseMoveListeners=[];
var mountedInstances=[];
function createTippy(reference, passedProps){
var props=evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps))));
var showTimeout;
var hideTimeout;
var scheduleHideAnimationFrame;
var isVisibleFromClick=false;
var didHideDueToDocumentMouseDown=false;
var didTouchMove=false;
var ignoreOnFirstUpdate=false;
var lastTriggerEvent;
var currentTransitionEndListener;
var onFirstUpdate;
var listeners=[];
var debouncedOnMouseMove=tippy_esm_debounce(onMouseMove, props.interactiveDebounce);
var currentTarget;
var id=idCounter++;
var popperInstance=null;
var plugins=unique(props.plugins);
var state={
isEnabled: true,
isVisible: false,
isDestroyed: false,
isMounted: false,
isShown: false
};
var instance={
id: id,
reference: reference,
popper: div(),
popperInstance: popperInstance,
props: props,
state: state,
plugins: plugins,
clearDelayTimeouts: clearDelayTimeouts,
setProps: setProps,
setContent: setContent,
show: show,
hide: hide,
hideWithInteractivity: hideWithInteractivity,
enable: enable,
disable: disable,
unmount: unmount,
destroy: destroy
};
if(!props.render){
if(false){}
return instance;
}
var _props$render=props.render(instance),
popper=_props$render.popper,
onUpdate=_props$render.onUpdate;
popper.setAttribute('data-tippy-root', '');
popper.id="tippy-" + instance.id;
instance.popper=popper;
reference._tippy=instance;
popper._tippy=instance;
var pluginsHooks=plugins.map(function (plugin){
return plugin.fn(instance);
});
var hasAriaExpanded=reference.hasAttribute('aria-expanded');
addListeners();
handleAriaExpandedAttribute();
handleStyles();
invokeHook('onCreate', [instance]);
if(props.showOnCreate){
scheduleShow();
}
popper.addEventListener('mouseenter', function (){
if(instance.props.interactive&&instance.state.isVisible){
instance.clearDelayTimeouts();
}});
popper.addEventListener('mouseleave', function (){
if(instance.props.interactive&&instance.props.trigger.indexOf('mouseenter') >=0){
getDocument().addEventListener('mousemove', debouncedOnMouseMove);
}});
return instance;
function getNormalizedTouchSettings(){
var touch=instance.props.touch;
return Array.isArray(touch) ? touch:[touch, 0];
}
function getIsCustomTouchBehavior(){
return getNormalizedTouchSettings()[0]==='hold';
}
function getIsDefaultRenderFn(){
var _instance$props$rende;
return !!((_instance$props$rende=instance.props.render)!=null&&_instance$props$rende.$$tippy);
}
function getCurrentTarget(){
return currentTarget||reference;
}
function getDocument(){
var parent=getCurrentTarget().parentNode;
return parent ? getOwnerDocument(parent):document;
}
function getDefaultTemplateChildren(){
return getChildren(popper);
}
function getDelay(isShow){
if(instance.state.isMounted&&!instance.state.isVisible||currentInput.isTouch||lastTriggerEvent&&lastTriggerEvent.type==='focus'){
return 0;
}
return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0:1, defaultProps.delay);
}
function handleStyles(fromHide){
if(fromHide===void 0){
fromHide=false;
}
popper.style.pointerEvents=instance.props.interactive&&!fromHide ? '':'none';
popper.style.zIndex="" + instance.props.zIndex;
}
function invokeHook(hook, args, shouldInvokePropsHook){
if(shouldInvokePropsHook===void 0){
shouldInvokePropsHook=true;
}
pluginsHooks.forEach(function (pluginHooks){
if(pluginHooks[hook]){
pluginHooks[hook].apply(pluginHooks, args);
}});
if(shouldInvokePropsHook){
var _instance$props;
(_instance$props=instance.props)[hook].apply(_instance$props, args);
}}
function handleAriaContentAttribute(){
var aria=instance.props.aria;
if(!aria.content){
return;
}
var attr="aria-" + aria.content;
var id=popper.id;
var nodes=normalizeToArray(instance.props.triggerTarget||reference);
nodes.forEach(function (node){
var currentValue=node.getAttribute(attr);
if(instance.state.isVisible){
node.setAttribute(attr, currentValue ? currentValue + " " + id:id);
}else{
var nextValue=currentValue&&currentValue.replace(id, '').trim();
if(nextValue){
node.setAttribute(attr, nextValue);
}else{
node.removeAttribute(attr);
}}
});
}
function handleAriaExpandedAttribute(){
if(hasAriaExpanded||!instance.props.aria.expanded){
return;
}
var nodes=normalizeToArray(instance.props.triggerTarget||reference);
nodes.forEach(function (node){
if(instance.props.interactive){
node.setAttribute('aria-expanded', instance.state.isVisible&&node===getCurrentTarget() ? 'true':'false');
}else{
node.removeAttribute('aria-expanded');
}});
}
function cleanupInteractiveMouseListeners(){
getDocument().removeEventListener('mousemove', debouncedOnMouseMove);
mouseMoveListeners=mouseMoveListeners.filter(function (listener){
return listener!==debouncedOnMouseMove;
});
}
function onDocumentPress(event){
if(currentInput.isTouch){
if(didTouchMove||event.type==='mousedown'){
return;
}}
var actualTarget=event.composedPath&&event.composedPath()[0]||event.target;
if(instance.props.interactive&&actualContains(popper, actualTarget)){
return;
}
if(normalizeToArray(instance.props.triggerTarget||reference).some(function (el){
return actualContains(el, actualTarget);
})){
if(currentInput.isTouch){
return;
}
if(instance.state.isVisible&&instance.props.trigger.indexOf('click') >=0){
return;
}}else{
invokeHook('onClickOutside', [instance, event]);
}
if(instance.props.hideOnClick===true){
instance.clearDelayTimeouts();
instance.hide();
didHideDueToDocumentMouseDown=true;
setTimeout(function (){
didHideDueToDocumentMouseDown=false;
});
if(!instance.state.isMounted){
removeDocumentPress();
}}
}
function onTouchMove(){
didTouchMove=true;
}
function onTouchStart(){
didTouchMove=false;
}
function addDocumentPress(){
var doc=getDocument();
doc.addEventListener('mousedown', onDocumentPress, true);
doc.addEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);
doc.addEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);
doc.addEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);
}
function removeDocumentPress(){
var doc=getDocument();
doc.removeEventListener('mousedown', onDocumentPress, true);
doc.removeEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);
doc.removeEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);
doc.removeEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);
}
function onTransitionedOut(duration, callback){
onTransitionEnd(duration, function (){
if(!instance.state.isVisible&&popper.parentNode&&popper.parentNode.contains(popper)){
callback();
}});
}
function onTransitionedIn(duration, callback){
onTransitionEnd(duration, callback);
}
function onTransitionEnd(duration, callback){
var box=getDefaultTemplateChildren().box;
function listener(event){
if(event.target===box){
updateTransitionEndListener(box, 'remove', listener);
callback();
}}
if(duration===0){
return callback();
}
updateTransitionEndListener(box, 'remove', currentTransitionEndListener);
updateTransitionEndListener(box, 'add', listener);
currentTransitionEndListener=listener;
}
function on(eventType, handler, options){
if(options===void 0){
options=false;
}
var nodes=normalizeToArray(instance.props.triggerTarget||reference);
nodes.forEach(function (node){
node.addEventListener(eventType, handler, options);
listeners.push({
node: node,
eventType: eventType,
handler: handler,
options: options
});
});
}
function addListeners(){
if(getIsCustomTouchBehavior()){
on('touchstart', onTrigger, {
passive: true
});
on('touchend', onMouseLeave, {
passive: true
});
}
splitBySpaces(instance.props.trigger).forEach(function (eventType){
if(eventType==='manual'){
return;
}
on(eventType, onTrigger);
switch (eventType){
case 'mouseenter':
on('mouseleave', onMouseLeave);
break;
case 'focus':
on(isIE11 ? 'focusout':'blur', onBlurOrFocusOut);
break;
case 'focusin':
on('focusout', onBlurOrFocusOut);
break;
}});
}
function removeListeners(){
listeners.forEach(function (_ref){
var node=_ref.node,
eventType=_ref.eventType,
handler=_ref.handler,
options=_ref.options;
node.removeEventListener(eventType, handler, options);
});
listeners=[];
}
function onTrigger(event){
var _lastTriggerEvent;
var shouldScheduleClickHide=false;
if(!instance.state.isEnabled||isEventListenerStopped(event)||didHideDueToDocumentMouseDown){
return;
}
var wasFocused=((_lastTriggerEvent=lastTriggerEvent)==null ? void 0:_lastTriggerEvent.type)==='focus';
lastTriggerEvent=event;
currentTarget=event.currentTarget;
handleAriaExpandedAttribute();
if(!instance.state.isVisible&&isMouseEvent(event)){
mouseMoveListeners.forEach(function (listener){
return listener(event);
});
}
if(event.type==='click'&&(instance.props.trigger.indexOf('mouseenter') < 0||isVisibleFromClick)&&instance.props.hideOnClick!==false&&instance.state.isVisible){
shouldScheduleClickHide=true;
}else{
scheduleShow(event);
}
if(event.type==='click'){
isVisibleFromClick = !shouldScheduleClickHide;
}
if(shouldScheduleClickHide&&!wasFocused){
scheduleHide(event);
}}
function onMouseMove(event){
var target=event.target;
var isCursorOverReferenceOrPopper=getCurrentTarget().contains(target)||popper.contains(target);
if(event.type==='mousemove'&&isCursorOverReferenceOrPopper){
return;
}
var popperTreeData=getNestedPopperTree().concat(popper).map(function (popper){
var _instance$popperInsta;
var instance=popper._tippy;
var state=(_instance$popperInsta=instance.popperInstance)==null ? void 0:_instance$popperInsta.state;
if(state){
return {
popperRect: popper.getBoundingClientRect(),
popperState: state,
props: props
};}
return null;
}).filter(Boolean);
if(isCursorOutsideInteractiveBorder(popperTreeData, event)){
cleanupInteractiveMouseListeners();
scheduleHide(event);
}}
function onMouseLeave(event){
var shouldBail=isEventListenerStopped(event)||instance.props.trigger.indexOf('click') >=0&&isVisibleFromClick;
if(shouldBail){
return;
}
if(instance.props.interactive){
instance.hideWithInteractivity(event);
return;
}
scheduleHide(event);
}
function onBlurOrFocusOut(event){
if(instance.props.trigger.indexOf('focusin') < 0&&event.target!==getCurrentTarget()){
return;
}
if(instance.props.interactive&&event.relatedTarget&&popper.contains(event.relatedTarget)){
return;
}
scheduleHide(event);
}
function isEventListenerStopped(event){
return currentInput.isTouch ? getIsCustomTouchBehavior()!==event.type.indexOf('touch') >=0:false;
}
function createPopperInstance(){
destroyPopperInstance();
var _instance$props2=instance.props,
popperOptions=_instance$props2.popperOptions,
placement=_instance$props2.placement,
offset=_instance$props2.offset,
getReferenceClientRect=_instance$props2.getReferenceClientRect,
moveTransition=_instance$props2.moveTransition;
var arrow=getIsDefaultRenderFn() ? getChildren(popper).arrow:null;
var computedReference=getReferenceClientRect ? {
getBoundingClientRect: getReferenceClientRect,
contextElement: getReferenceClientRect.contextElement||getCurrentTarget()
}:reference;
var tippyModifier={
name: '$$tippy',
enabled: true,
phase: 'beforeWrite',
requires: ['computeStyles'],
fn: function fn(_ref2){
var state=_ref2.state;
if(getIsDefaultRenderFn()){
var _getDefaultTemplateCh=getDefaultTemplateChildren(),
box=_getDefaultTemplateCh.box;
['placement', 'reference-hidden', 'escaped'].forEach(function (attr){
if(attr==='placement'){
box.setAttribute('data-placement', state.placement);
}else{
if(state.attributes.popper["data-popper-" + attr]){
box.setAttribute("data-" + attr, '');
}else{
box.removeAttribute("data-" + attr);
}}
});
state.attributes.popper={};}}
};
var modifiers=[{
name: 'offset',
options: {
offset: offset
}}, {
name: 'preventOverflow',
options: {
padding: {
top: 2,
bottom: 2,
left: 5,
right: 5
}}
}, {
name: 'flip',
options: {
padding: 5
}}, {
name: 'computeStyles',
options: {
adaptive: !moveTransition
}}, tippyModifier];
if(getIsDefaultRenderFn()&&arrow){
modifiers.push({
name: 'arrow',
options: {
element: arrow,
padding: 3
}});
}
modifiers.push.apply(modifiers, (popperOptions==null ? void 0:popperOptions.modifiers)||[]);
instance.popperInstance=popper_createPopper(computedReference, popper, Object.assign({}, popperOptions, {
placement: placement,
onFirstUpdate: onFirstUpdate,
modifiers: modifiers
}));
}
function destroyPopperInstance(){
if(instance.popperInstance){
instance.popperInstance.destroy();
instance.popperInstance=null;
}}
function mount(){
var appendTo=instance.props.appendTo;
var parentNode;
var node=getCurrentTarget();
if(instance.props.interactive&&appendTo===TIPPY_DEFAULT_APPEND_TO||appendTo==='parent'){
parentNode=node.parentNode;
}else{
parentNode=invokeWithArgsOrReturn(appendTo, [node]);
}
if(!parentNode.contains(popper)){
parentNode.appendChild(popper);
}
instance.state.isMounted=true;
createPopperInstance();
if(false){}}
function getNestedPopperTree(){
return arrayFrom(popper.querySelectorAll('[data-tippy-root]'));
}
function scheduleShow(event){
instance.clearDelayTimeouts();
if(event){
invokeHook('onTrigger', [instance, event]);
}
addDocumentPress();
var delay=getDelay(true);
var _getNormalizedTouchSe=getNormalizedTouchSettings(),
touchValue=_getNormalizedTouchSe[0],
touchDelay=_getNormalizedTouchSe[1];
if(currentInput.isTouch&&touchValue==='hold'&&touchDelay){
delay=touchDelay;
}
if(delay){
showTimeout=setTimeout(function (){
instance.show();
}, delay);
}else{
instance.show();
}}
function scheduleHide(event){
instance.clearDelayTimeouts();
invokeHook('onUntrigger', [instance, event]);
if(!instance.state.isVisible){
removeDocumentPress();
return;
}
if(instance.props.trigger.indexOf('mouseenter') >=0&&instance.props.trigger.indexOf('click') >=0&&['mouseleave', 'mousemove'].indexOf(event.type) >=0&&isVisibleFromClick){
return;
}
var delay=getDelay(false);
if(delay){
hideTimeout=setTimeout(function (){
if(instance.state.isVisible){
instance.hide();
}}, delay);
}else{
scheduleHideAnimationFrame=requestAnimationFrame(function (){
instance.hide();
});
}}
function enable(){
instance.state.isEnabled=true;
}
function disable(){
instance.hide();
instance.state.isEnabled=false;
}
function clearDelayTimeouts(){
clearTimeout(showTimeout);
clearTimeout(hideTimeout);
cancelAnimationFrame(scheduleHideAnimationFrame);
}
function setProps(partialProps){
if(false){}
if(instance.state.isDestroyed){
return;
}
invokeHook('onBeforeUpdate', [instance, partialProps]);
removeListeners();
var prevProps=instance.props;
var nextProps=evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {
ignoreAttributes: true
}));
instance.props=nextProps;
addListeners();
if(prevProps.interactiveDebounce!==nextProps.interactiveDebounce){
cleanupInteractiveMouseListeners();
debouncedOnMouseMove=tippy_esm_debounce(onMouseMove, nextProps.interactiveDebounce);
}
if(prevProps.triggerTarget&&!nextProps.triggerTarget){
normalizeToArray(prevProps.triggerTarget).forEach(function (node){
node.removeAttribute('aria-expanded');
});
}else if(nextProps.triggerTarget){
reference.removeAttribute('aria-expanded');
}
handleAriaExpandedAttribute();
handleStyles();
if(onUpdate){
onUpdate(prevProps, nextProps);
}
if(instance.popperInstance){
createPopperInstance();
getNestedPopperTree().forEach(function (nestedPopper){
requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);
});
}
invokeHook('onAfterUpdate', [instance, partialProps]);
}
function setContent(content){
instance.setProps({
content: content
});
}
function show(){
if(false){}
var isAlreadyVisible=instance.state.isVisible;
var isDestroyed=instance.state.isDestroyed;
var isDisabled = !instance.state.isEnabled;
var isTouchAndTouchDisabled=currentInput.isTouch&&!instance.props.touch;
var duration=getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration);
if(isAlreadyVisible||isDestroyed||isDisabled||isTouchAndTouchDisabled){
return;
}
if(getCurrentTarget().hasAttribute('disabled')){
return;
}
invokeHook('onShow', [instance], false);
if(instance.props.onShow(instance)===false){
return;
}
instance.state.isVisible=true;
if(getIsDefaultRenderFn()){
popper.style.visibility='visible';
}
handleStyles();
addDocumentPress();
if(!instance.state.isMounted){
popper.style.transition='none';
}
if(getIsDefaultRenderFn()){
var _getDefaultTemplateCh2=getDefaultTemplateChildren(),
box=_getDefaultTemplateCh2.box,
content=_getDefaultTemplateCh2.content;
setTransitionDuration([box, content], 0);
}
onFirstUpdate=function onFirstUpdate(){
var _instance$popperInsta2;
if(!instance.state.isVisible||ignoreOnFirstUpdate){
return;
}
ignoreOnFirstUpdate=true;
void popper.offsetHeight;
popper.style.transition=instance.props.moveTransition;
if(getIsDefaultRenderFn()&&instance.props.animation){
var _getDefaultTemplateCh3=getDefaultTemplateChildren(),
_box=_getDefaultTemplateCh3.box,
_content=_getDefaultTemplateCh3.content;
setTransitionDuration([_box, _content], duration);
setVisibilityState([_box, _content], 'visible');
}
handleAriaContentAttribute();
handleAriaExpandedAttribute();
pushIfUnique(mountedInstances, instance);
(_instance$popperInsta2=instance.popperInstance)==null ? void 0:_instance$popperInsta2.forceUpdate();
invokeHook('onMount', [instance]);
if(instance.props.animation&&getIsDefaultRenderFn()){
onTransitionedIn(duration, function (){
instance.state.isShown=true;
invokeHook('onShown', [instance]);
});
}};
mount();
}
function hide(){
if(false){}
var isAlreadyHidden = !instance.state.isVisible;
var isDestroyed=instance.state.isDestroyed;
var isDisabled = !instance.state.isEnabled;
var duration=getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration);
if(isAlreadyHidden||isDestroyed||isDisabled){
return;
}
invokeHook('onHide', [instance], false);
if(instance.props.onHide(instance)===false){
return;
}
instance.state.isVisible=false;
instance.state.isShown=false;
ignoreOnFirstUpdate=false;
isVisibleFromClick=false;
if(getIsDefaultRenderFn()){
popper.style.visibility='hidden';
}
cleanupInteractiveMouseListeners();
removeDocumentPress();
handleStyles(true);
if(getIsDefaultRenderFn()){
var _getDefaultTemplateCh4=getDefaultTemplateChildren(),
box=_getDefaultTemplateCh4.box,
content=_getDefaultTemplateCh4.content;
if(instance.props.animation){
setTransitionDuration([box, content], duration);
setVisibilityState([box, content], 'hidden');
}}
handleAriaContentAttribute();
handleAriaExpandedAttribute();
if(instance.props.animation){
if(getIsDefaultRenderFn()){
onTransitionedOut(duration, instance.unmount);
}}else{
instance.unmount();
}}
function hideWithInteractivity(event){
if(false){}
getDocument().addEventListener('mousemove', debouncedOnMouseMove);
pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
debouncedOnMouseMove(event);
}
function unmount(){
if(false){}
if(instance.state.isVisible){
instance.hide();
}
if(!instance.state.isMounted){
return;
}
destroyPopperInstance();
getNestedPopperTree().forEach(function (nestedPopper){
nestedPopper._tippy.unmount();
});
if(popper.parentNode){
popper.parentNode.removeChild(popper);
}
mountedInstances=mountedInstances.filter(function (i){
return i!==instance;
});
instance.state.isMounted=false;
invokeHook('onHidden', [instance]);
}
function destroy(){
if(false){}
if(instance.state.isDestroyed){
return;
}
instance.clearDelayTimeouts();
instance.unmount();
removeListeners();
delete reference._tippy;
instance.state.isDestroyed=true;
invokeHook('onDestroy', [instance]);
}}
function tippy(targets, optionalProps){
if(optionalProps===void 0){
optionalProps={};}
var plugins=defaultProps.plugins.concat(optionalProps.plugins||[]);
if(false){}
bindGlobalEventListeners();
var passedProps=Object.assign({}, optionalProps, {
plugins: plugins
});
var elements=getArrayOfElements(targets);
if(false){ var isMoreThanOneReferenceElement, isSingleContentElement; }
var instances=elements.reduce(function (acc, reference){
var instance=reference&&createTippy(reference, passedProps);
if(instance){
acc.push(instance);
}
return acc;
}, []);
return tippy_esm_isElement(targets) ? instances[0]:instances;
}
tippy.defaultProps=defaultProps;
tippy.setDefaultProps=setDefaultProps;
tippy.currentInput=currentInput;
var hideAll=function hideAll(_temp){
var _ref=_temp===void 0 ? {}:_temp,
excludedReferenceOrInstance=_ref.exclude,
duration=_ref.duration;
mountedInstances.forEach(function (instance){
var isExcluded=false;
if(excludedReferenceOrInstance){
isExcluded=isReferenceElement(excludedReferenceOrInstance) ? instance.reference===excludedReferenceOrInstance:instance.popper===excludedReferenceOrInstance.popper;
}
if(!isExcluded){
var originalDuration=instance.props.duration;
instance.setProps({
duration: duration
});
instance.hide();
if(!instance.state.isDestroyed){
instance.setProps({
duration: originalDuration
});
}}
});
};
var applyStylesModifier=Object.assign({}, modifiers_applyStyles, {
effect: function effect(_ref){
var state=_ref.state;
var initialStyles={
popper: {
position: state.options.strategy,
left: '0',
top: '0',
margin: '0'
},
arrow: {
position: 'absolute'
},
reference: {}};
Object.assign(state.elements.popper.style, initialStyles.popper);
state.styles=initialStyles;
if(state.elements.arrow){
Object.assign(state.elements.arrow.style, initialStyles.arrow);
}}
});
var createSingleton=function createSingleton(tippyInstances, optionalProps){
var _optionalProps$popper;
if(optionalProps===void 0){
optionalProps={};}
if(false){}
var individualInstances=tippyInstances;
var references=[];
var triggerTargets=[];
var currentTarget;
var overrides=optionalProps.overrides;
var interceptSetPropsCleanups=[];
var shownOnCreate=false;
function setTriggerTargets(){
triggerTargets=individualInstances.map(function (instance){
return normalizeToArray(instance.props.triggerTarget||instance.reference);
}).reduce(function (acc, item){
return acc.concat(item);
}, []);
}
function setReferences(){
references=individualInstances.map(function (instance){
return instance.reference;
});
}
function enableInstances(isEnabled){
individualInstances.forEach(function (instance){
if(isEnabled){
instance.enable();
}else{
instance.disable();
}});
}
function interceptSetProps(singleton){
return individualInstances.map(function (instance){
var originalSetProps=instance.setProps;
instance.setProps=function (props){
originalSetProps(props);
if(instance.reference===currentTarget){
singleton.setProps(props);
}};
return function (){
instance.setProps=originalSetProps;
};});
}
function prepareInstance(singleton, target){
var index=triggerTargets.indexOf(target);
if(target===currentTarget){
return;
}
currentTarget=target;
var overrideProps=(overrides||[]).concat('content').reduce(function (acc, prop){
acc[prop]=individualInstances[index].props[prop];
return acc;
}, {});
singleton.setProps(Object.assign({}, overrideProps, {
getReferenceClientRect: typeof overrideProps.getReferenceClientRect==='function' ? overrideProps.getReferenceClientRect:function (){
var _references$index;
return (_references$index=references[index])==null ? void 0:_references$index.getBoundingClientRect();
}}));
}
enableInstances(false);
setReferences();
setTriggerTargets();
var plugin={
fn: function fn(){
return {
onDestroy: function onDestroy(){
enableInstances(true);
},
onHidden: function onHidden(){
currentTarget=null;
},
onClickOutside: function onClickOutside(instance){
if(instance.props.showOnCreate&&!shownOnCreate){
shownOnCreate=true;
currentTarget=null;
}},
onShow: function onShow(instance){
if(instance.props.showOnCreate&&!shownOnCreate){
shownOnCreate=true;
prepareInstance(instance, references[0]);
}},
onTrigger: function onTrigger(instance, event){
prepareInstance(instance, event.currentTarget);
}};}};
var singleton=tippy(div(), Object.assign({}, removeProperties(optionalProps, ['overrides']), {
plugins: [plugin].concat(optionalProps.plugins||[]),
triggerTarget: triggerTargets,
popperOptions: Object.assign({}, optionalProps.popperOptions, {
modifiers: [].concat(((_optionalProps$popper=optionalProps.popperOptions)==null ? void 0:_optionalProps$popper.modifiers)||[], [applyStylesModifier])
})
}));
var originalShow=singleton.show;
singleton.show=function (target){
originalShow();
if(!currentTarget&&target==null){
return prepareInstance(singleton, references[0]);
}
if(currentTarget&&target==null){
return;
}
if(typeof target==='number'){
return references[target]&&prepareInstance(singleton, references[target]);
}
if(individualInstances.indexOf(target) >=0){
var ref=target.reference;
return prepareInstance(singleton, ref);
}
if(references.indexOf(target) >=0){
return prepareInstance(singleton, target);
}};
singleton.showNext=function (){
var first=references[0];
if(!currentTarget){
return singleton.show(0);
}
var index=references.indexOf(currentTarget);
singleton.show(references[index + 1]||first);
};
singleton.showPrevious=function (){
var last=references[references.length - 1];
if(!currentTarget){
return singleton.show(last);
}
var index=references.indexOf(currentTarget);
var target=references[index - 1]||last;
singleton.show(target);
};
var originalSetProps=singleton.setProps;
singleton.setProps=function (props){
overrides=props.overrides||overrides;
originalSetProps(props);
};
singleton.setInstances=function (nextInstances){
enableInstances(true);
interceptSetPropsCleanups.forEach(function (fn){
return fn();
});
individualInstances=nextInstances;
enableInstances(false);
setReferences();
setTriggerTargets();
interceptSetPropsCleanups=interceptSetProps(singleton);
singleton.setProps({
triggerTarget: triggerTargets
});
};
interceptSetPropsCleanups=interceptSetProps(singleton);
return singleton;
};
var BUBBLING_EVENTS_MAP={
mouseover: 'mouseenter',
focusin: 'focus',
click: 'click'
};
function delegate(targets, props){
if(false){}
var listeners=[];
var childTippyInstances=[];
var disabled=false;
var target=props.target;
var nativeProps=removeProperties(props, ['target']);
var parentProps=Object.assign({}, nativeProps, {
trigger: 'manual',
touch: false
});
var childProps=Object.assign({
touch: defaultProps.touch
}, nativeProps, {
showOnCreate: true
});
var returnValue=tippy(targets, parentProps);
var normalizedReturnValue=normalizeToArray(returnValue);
function onTrigger(event){
if(!event.target||disabled){
return;
}
var targetNode=event.target.closest(target);
if(!targetNode){
return;
}
var trigger=targetNode.getAttribute('data-tippy-trigger')||props.trigger||defaultProps.trigger;
if(targetNode._tippy){
return;
}
if(event.type==='touchstart'&&typeof childProps.touch==='boolean'){
return;
}
if(event.type!=='touchstart'&&trigger.indexOf(BUBBLING_EVENTS_MAP[event.type]) < 0){
return;
}
var instance=tippy(targetNode, childProps);
if(instance){
childTippyInstances=childTippyInstances.concat(instance);
}}
function on(node, eventType, handler, options){
if(options===void 0){
options=false;
}
node.addEventListener(eventType, handler, options);
listeners.push({
node: node,
eventType: eventType,
handler: handler,
options: options
});
}
function addEventListeners(instance){
var reference=instance.reference;
on(reference, 'touchstart', onTrigger, TOUCH_OPTIONS);
on(reference, 'mouseover', onTrigger);
on(reference, 'focusin', onTrigger);
on(reference, 'click', onTrigger);
}
function removeEventListeners(){
listeners.forEach(function (_ref){
var node=_ref.node,
eventType=_ref.eventType,
handler=_ref.handler,
options=_ref.options;
node.removeEventListener(eventType, handler, options);
});
listeners=[];
}
function applyMutations(instance){
var originalDestroy=instance.destroy;
var originalEnable=instance.enable;
var originalDisable=instance.disable;
instance.destroy=function (shouldDestroyChildInstances){
if(shouldDestroyChildInstances===void 0){
shouldDestroyChildInstances=true;
}
if(shouldDestroyChildInstances){
childTippyInstances.forEach(function (instance){
instance.destroy();
});
}
childTippyInstances=[];
removeEventListeners();
originalDestroy();
};
instance.enable=function (){
originalEnable();
childTippyInstances.forEach(function (instance){
return instance.enable();
});
disabled=false;
};
instance.disable=function (){
originalDisable();
childTippyInstances.forEach(function (instance){
return instance.disable();
});
disabled=true;
};
addEventListeners(instance);
}
normalizedReturnValue.forEach(applyMutations);
return returnValue;
}
var animateFill={
name: 'animateFill',
defaultValue: false,
fn: function fn(instance){
var _instance$props$rende;
if(!((_instance$props$rende=instance.props.render)!=null&&_instance$props$rende.$$tippy)){
if(false){}
return {};}
var _getChildren=getChildren(instance.popper),
box=_getChildren.box,
content=_getChildren.content;
var backdrop=instance.props.animateFill ? createBackdropElement():null;
return {
onCreate: function onCreate(){
if(backdrop){
box.insertBefore(backdrop, box.firstElementChild);
box.setAttribute('data-animatefill', '');
box.style.overflow='hidden';
instance.setProps({
arrow: false,
animation: 'shift-away'
});
}},
onMount: function onMount(){
if(backdrop){
var transitionDuration=box.style.transitionDuration;
var duration=Number(transitionDuration.replace('ms', ''));
content.style.transitionDelay=Math.round(duration / 10) + "ms";
backdrop.style.transitionDuration=transitionDuration;
setVisibilityState([backdrop], 'visible');
}},
onShow: function onShow(){
if(backdrop){
backdrop.style.transitionDuration='0ms';
}},
onHide: function onHide(){
if(backdrop){
setVisibilityState([backdrop], 'hidden');
}}
};}};
function createBackdropElement(){
var backdrop=div();
backdrop.className=BACKDROP_CLASS;
setVisibilityState([backdrop], 'hidden');
return backdrop;
}
var mouseCoords={
clientX: 0,
clientY: 0
};
var activeInstances=[];
function storeMouseCoords(_ref){
var clientX=_ref.clientX,
clientY=_ref.clientY;
mouseCoords={
clientX: clientX,
clientY: clientY
};}
function addMouseCoordsListener(doc){
doc.addEventListener('mousemove', storeMouseCoords);
}
function removeMouseCoordsListener(doc){
doc.removeEventListener('mousemove', storeMouseCoords);
}
var followCursor={
name: 'followCursor',
defaultValue: false,
fn: function fn(instance){
var reference=instance.reference;
var doc=getOwnerDocument(instance.props.triggerTarget||reference);
var isInternalUpdate=false;
var wasFocusEvent=false;
var isUnmounted=true;
var prevProps=instance.props;
function getIsInitialBehavior(){
return instance.props.followCursor==='initial'&&instance.state.isVisible;
}
function addListener(){
doc.addEventListener('mousemove', onMouseMove);
}
function removeListener(){
doc.removeEventListener('mousemove', onMouseMove);
}
function unsetGetReferenceClientRect(){
isInternalUpdate=true;
instance.setProps({
getReferenceClientRect: null
});
isInternalUpdate=false;
}
function onMouseMove(event){
var isCursorOverReference=event.target ? reference.contains(event.target):true;
var followCursor=instance.props.followCursor;
var clientX=event.clientX,
clientY=event.clientY;
var rect=reference.getBoundingClientRect();
var relativeX=clientX - rect.left;
var relativeY=clientY - rect.top;
if(isCursorOverReference||!instance.props.interactive){
instance.setProps({
getReferenceClientRect: function getReferenceClientRect(){
var rect=reference.getBoundingClientRect();
var x=clientX;
var y=clientY;
if(followCursor==='initial'){
x=rect.left + relativeX;
y=rect.top + relativeY;
}
var top=followCursor==='horizontal' ? rect.top:y;
var right=followCursor==='vertical' ? rect.right:x;
var bottom=followCursor==='horizontal' ? rect.bottom:y;
var left=followCursor==='vertical' ? rect.left:x;
return {
width: right - left,
height: bottom - top,
top: top,
right: right,
bottom: bottom,
left: left
};}});
}}
function create(){
if(instance.props.followCursor){
activeInstances.push({
instance: instance,
doc: doc
});
addMouseCoordsListener(doc);
}}
function destroy(){
activeInstances=activeInstances.filter(function (data){
return data.instance!==instance;
});
if(activeInstances.filter(function (data){
return data.doc===doc;
}).length===0){
removeMouseCoordsListener(doc);
}}
return {
onCreate: create,
onDestroy: destroy,
onBeforeUpdate: function onBeforeUpdate(){
prevProps=instance.props;
},
onAfterUpdate: function onAfterUpdate(_, _ref2){
var followCursor=_ref2.followCursor;
if(isInternalUpdate){
return;
}
if(followCursor!==undefined&&prevProps.followCursor!==followCursor){
destroy();
if(followCursor){
create();
if(instance.state.isMounted&&!wasFocusEvent&&!getIsInitialBehavior()){
addListener();
}}else{
removeListener();
unsetGetReferenceClientRect();
}}
},
onMount: function onMount(){
if(instance.props.followCursor&&!wasFocusEvent){
if(isUnmounted){
onMouseMove(mouseCoords);
isUnmounted=false;
}
if(!getIsInitialBehavior()){
addListener();
}}
},
onTrigger: function onTrigger(_, event){
if(isMouseEvent(event)){
mouseCoords={
clientX: event.clientX,
clientY: event.clientY
};}
wasFocusEvent=event.type==='focus';
},
onHidden: function onHidden(){
if(instance.props.followCursor){
unsetGetReferenceClientRect();
removeListener();
isUnmounted=true;
}}
};}};
function getProps(props, modifier){
var _props$popperOptions;
return {
popperOptions: Object.assign({}, props.popperOptions, {
modifiers: [].concat((((_props$popperOptions=props.popperOptions)==null ? void 0:_props$popperOptions.modifiers)||[]).filter(function (_ref){
var name=_ref.name;
return name!==modifier.name;
}), [modifier])
})
};}
var inlinePositioning={
name: 'inlinePositioning',
defaultValue: false,
fn: function fn(instance){
var reference=instance.reference;
function isEnabled(){
return !!instance.props.inlinePositioning;
}
var placement;
var cursorRectIndex=-1;
var isInternalUpdate=false;
var triedPlacements=[];
var modifier={
name: 'tippyInlinePositioning',
enabled: true,
phase: 'afterWrite',
fn: function fn(_ref2){
var state=_ref2.state;
if(isEnabled()){
if(triedPlacements.indexOf(state.placement)!==-1){
triedPlacements=[];
}
if(placement!==state.placement&&triedPlacements.indexOf(state.placement)===-1){
triedPlacements.push(state.placement);
instance.setProps({
getReferenceClientRect: function getReferenceClientRect(){
return _getReferenceClientRect(state.placement);
}});
}
placement=state.placement;
}}
};
function _getReferenceClientRect(placement){
return getInlineBoundingClientRect(tippy_esm_getBasePlacement(placement), reference.getBoundingClientRect(), arrayFrom(reference.getClientRects()), cursorRectIndex);
}
function setInternalProps(partialProps){
isInternalUpdate=true;
instance.setProps(partialProps);
isInternalUpdate=false;
}
function addModifier(){
if(!isInternalUpdate){
setInternalProps(getProps(instance.props, modifier));
}}
return {
onCreate: addModifier,
onAfterUpdate: addModifier,
onTrigger: function onTrigger(_, event){
if(isMouseEvent(event)){
var rects=arrayFrom(instance.reference.getClientRects());
var cursorRect=rects.find(function (rect){
return rect.left - 2 <=event.clientX&&rect.right + 2 >=event.clientX&&rect.top - 2 <=event.clientY&&rect.bottom + 2 >=event.clientY;
});
var index=rects.indexOf(cursorRect);
cursorRectIndex=index > -1 ? index:cursorRectIndex;
}},
onHidden: function onHidden(){
cursorRectIndex=-1;
}};}};
function getInlineBoundingClientRect(currentBasePlacement, boundingRect, clientRects, cursorRectIndex){
if(clientRects.length < 2||currentBasePlacement===null){
return boundingRect;
}
if(clientRects.length===2&&cursorRectIndex >=0&&clientRects[0].left > clientRects[1].right){
return clientRects[cursorRectIndex]||boundingRect;
}
switch (currentBasePlacement){
case 'top':
case 'bottom':
{
var firstRect=clientRects[0];
var lastRect=clientRects[clientRects.length - 1];
var isTop=currentBasePlacement==='top';
var top=firstRect.top;
var bottom=lastRect.bottom;
var left=isTop ? firstRect.left:lastRect.left;
var right=isTop ? firstRect.right:lastRect.right;
var width=right - left;
var height=bottom - top;
return {
top: top,
bottom: bottom,
left: left,
right: right,
width: width,
height: height
};}
case 'left':
case 'right':
{
var minLeft=Math.min.apply(Math, clientRects.map(function (rects){
return rects.left;
}));
var maxRight=Math.max.apply(Math, clientRects.map(function (rects){
return rects.right;
}));
var measureRects=clientRects.filter(function (rect){
return currentBasePlacement==='left' ? rect.left===minLeft:rect.right===maxRight;
});
var _top=measureRects[0].top;
var _bottom=measureRects[measureRects.length - 1].bottom;
var _left=minLeft;
var _right=maxRight;
var _width=_right - _left;
var _height=_bottom - _top;
return {
top: _top,
bottom: _bottom,
left: _left,
right: _right,
width: _width,
height: _height
};}
default:
{
return boundingRect;
}}
}
var sticky={
name: 'sticky',
defaultValue: false,
fn: function fn(instance){
var reference=instance.reference,
popper=instance.popper;
function getReference(){
return instance.popperInstance ? instance.popperInstance.state.elements.reference:reference;
}
function shouldCheck(value){
return instance.props.sticky===true||instance.props.sticky===value;
}
var prevRefRect=null;
var prevPopRect=null;
function updatePosition(){
var currentRefRect=shouldCheck('reference') ? getReference().getBoundingClientRect():null;
var currentPopRect=shouldCheck('popper') ? popper.getBoundingClientRect():null;
if(currentRefRect&&areRectsDifferent(prevRefRect, currentRefRect)||currentPopRect&&areRectsDifferent(prevPopRect, currentPopRect)){
if(instance.popperInstance){
instance.popperInstance.update();
}}
prevRefRect=currentRefRect;
prevPopRect=currentPopRect;
if(instance.state.isMounted){
requestAnimationFrame(updatePosition);
}}
return {
onMount: function onMount(){
if(instance.props.sticky){
updatePosition();
}}
};}};
function areRectsDifferent(rectA, rectB){
if(rectA&&rectB){
return rectA.top!==rectB.top||rectA.right!==rectB.right||rectA.bottom!==rectB.bottom||rectA.left!==rectB.left;
}
return true;
}
tippy.setDefaultProps({
render: render
});
const tippy_esm=(tippy);
}),
5266:
((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__)=> {
"use strict";
__webpack_require__.d(__webpack_exports__, {
A: ()=> (__WEBPACK_DEFAULT_EXPORT__)
});
var __awaiter=(undefined&&undefined.__awaiter)||function (thisArg, _arguments, P, generator){
function adopt(value){ return value instanceof P ? value:new P(function (resolve){ resolve(value); });}
return new (P||(P=Promise))(function (resolve, reject){
function fulfilled(value){ try { step(generator.next(value)); } catch (e){ reject(e); }}
function rejected(value){ try { step(generator["throw"](value)); } catch (e){ reject(e); }}
function step(result){ result.done ? resolve(result.value):adopt(result.value).then(fulfilled, rejected); }
step((generator=generator.apply(thisArg, _arguments||[])).next());
});
};
function getElementOffset(el){
let top=0;
let left=0;
let element=el;
do {
top +=element.offsetTop||0;
left +=element.offsetLeft||0;
element=element.offsetParent;
} while (element);
return {
top,
left,
};}
class ScrollDomElement {
constructor(element){
this.element=element;
}
getHorizontalScroll(){
return this.element.scrollLeft;
}
getVerticalScroll(){
return this.element.scrollTop;
}
getMaxHorizontalScroll(){
return this.element.scrollWidth - this.element.clientWidth;
}
getMaxVerticalScroll(){
return this.element.scrollHeight - this.element.clientHeight;
}
getHorizontalElementScrollOffset(elementToScrollTo, elementToScroll){
return (getElementOffset(elementToScrollTo).left -
getElementOffset(elementToScroll).left);
}
getVerticalElementScrollOffset(elementToScrollTo, elementToScroll){
return (getElementOffset(elementToScrollTo).top -
getElementOffset(elementToScroll).top);
}
scrollTo(x, y){
this.element.scrollLeft=x;
this.element.scrollTop=y;
}}
class ScrollWindow {
constructor(){
this.element=window;
}
getHorizontalScroll(){
return window.scrollX||document.documentElement.scrollLeft;
}
getVerticalScroll(){
return window.scrollY||document.documentElement.scrollTop;
}
getMaxHorizontalScroll(){
return (Math.max(document.body.scrollWidth, document.documentElement.scrollWidth, document.body.offsetWidth, document.documentElement.offsetWidth, document.body.clientWidth, document.documentElement.clientWidth) - window.innerWidth);
}
getMaxVerticalScroll(){
return (Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight) - window.innerHeight);
}
getHorizontalElementScrollOffset(elementToScrollTo){
const scrollLeft=window.scrollX||document.documentElement.scrollLeft;
return scrollLeft + elementToScrollTo.getBoundingClientRect().left;
}
getVerticalElementScrollOffset(elementToScrollTo){
const scrollTop=window.scrollY||document.documentElement.scrollTop;
return scrollTop + elementToScrollTo.getBoundingClientRect().top;
}
scrollTo(x, y){
window.scrollTo(x, y);
}}
const activeAnimations={
elements: [],
cancelMethods: [],
add: (element, cancelAnimation)=> {
activeAnimations.elements.push(element);
activeAnimations.cancelMethods.push(cancelAnimation);
},
remove: (element, shouldStop)=> {
const index=activeAnimations.elements.indexOf(element);
if(index > -1){
if(shouldStop){
activeAnimations.cancelMethods[index]();
}
activeAnimations.elements.splice(index, 1);
activeAnimations.cancelMethods.splice(index, 1);
}},
};
const WINDOW_EXISTS=typeof window!=='undefined';
const defaultOptions={
cancelOnUserAction: true,
easing: (t)=> --t * t * t + 1,
elementToScroll: WINDOW_EXISTS ? window:null,
horizontalOffset: 0,
maxDuration: 3000,
minDuration: 250,
speed: 500,
verticalOffset: 0,
};
function animateScrollTo(numberOrCoordsOrElement, userOptions={}){
return __awaiter(this, void 0, void 0, function* (){
if(!WINDOW_EXISTS){
return new Promise((resolve)=> {
resolve(false);
});
}
else if(!window.Promise){
throw "Browser doesn't support Promises, and animated-scroll-to depends on it, please provide a polyfill.";
}
let x;
let y;
let scrollToElement;
let options=Object.assign(Object.assign({}, defaultOptions), userOptions);
const isWindow=options.elementToScroll===window;
const isElement = !!options.elementToScroll.nodeName;
if(!isWindow&&!isElement){
throw 'Element to scroll needs to be either window or DOM element.';
}
const scrollBehaviorElement=isWindow
? document.documentElement
: options.elementToScroll;
const scrollBehavior=getComputedStyle(scrollBehaviorElement).getPropertyValue('scroll-behavior');
if(scrollBehavior==='smooth'){
console.warn(`${scrollBehaviorElement.tagName} has "scroll-behavior: smooth" which can mess up with animated-scroll-to's animations`);
}
const elementToScroll=isWindow
? new ScrollWindow()
: new ScrollDomElement(options.elementToScroll);
if(numberOrCoordsOrElement instanceof Element){
scrollToElement=numberOrCoordsOrElement;
if(isElement &&
(!options.elementToScroll.contains(scrollToElement) ||
options.elementToScroll.isSameNode(scrollToElement))){
throw 'options.elementToScroll has to be a parent of scrollToElement';
}
x=elementToScroll.getHorizontalElementScrollOffset(scrollToElement, options.elementToScroll);
y=elementToScroll.getVerticalElementScrollOffset(scrollToElement, options.elementToScroll);
}
else if(typeof numberOrCoordsOrElement==='number'){
x=elementToScroll.getHorizontalScroll();
y=numberOrCoordsOrElement;
}
else if(Array.isArray(numberOrCoordsOrElement) &&
numberOrCoordsOrElement.length===2){
x =
numberOrCoordsOrElement[0]===null
? elementToScroll.getHorizontalScroll()
: numberOrCoordsOrElement[0];
y =
numberOrCoordsOrElement[1]===null
? elementToScroll.getVerticalScroll()
: numberOrCoordsOrElement[1];
}else{
throw ('Wrong function signature. Check documentation.\n' +
'Available method signatures are:\n' +
'  animateScrollTo(y:number, options)\n' +
'  animateScrollTo([x:number | null, y:number | null], options)\n' +
'  animateScrollTo(scrollToElement:Element, options)');
}
x +=options.horizontalOffset;
y +=options.verticalOffset;
const maxHorizontalScroll=elementToScroll.getMaxHorizontalScroll();
const initialHorizontalScroll=elementToScroll.getHorizontalScroll();
if(x > maxHorizontalScroll){
x=maxHorizontalScroll;
}
const horizontalDistanceToScroll=x - initialHorizontalScroll;
const maxVerticalScroll=elementToScroll.getMaxVerticalScroll();
const initialVerticalScroll=elementToScroll.getVerticalScroll();
if(y > maxVerticalScroll){
y=maxVerticalScroll;
}
const verticalDistanceToScroll=y - initialVerticalScroll;
const horizontalDuration=Math.abs(Math.round((horizontalDistanceToScroll / 1000) * options.speed));
const verticalDuration=Math.abs(Math.round((verticalDistanceToScroll / 1000) * options.speed));
let duration=horizontalDuration > verticalDuration
? horizontalDuration
: verticalDuration;
if(duration < options.minDuration){
duration=options.minDuration;
}
else if(duration > options.maxDuration){
duration=options.maxDuration;
}
return new Promise((resolve, reject)=> {
if(horizontalDistanceToScroll===0&&verticalDistanceToScroll===0){
resolve(true);
}
activeAnimations.remove(elementToScroll.element, true);
let requestID;
const cancelAnimation=()=> {
removeListeners();
cancelAnimationFrame(requestID);
resolve(false);
};
activeAnimations.add(elementToScroll.element, cancelAnimation);
const preventDefaultHandler=(e)=> e.preventDefault();
const handler=options.cancelOnUserAction
? cancelAnimation
: preventDefaultHandler;
const eventOptions=options.cancelOnUserAction
? { passive: true }
: { passive: false };
const events=['wheel', 'touchstart', 'keydown', 'mousedown'];
const removeListeners=()=> {
events.forEach((eventName)=> {
elementToScroll.element.removeEventListener(eventName, handler, eventOptions);
});
};
events.forEach((eventName)=> {
elementToScroll.element.addEventListener(eventName, handler, eventOptions);
});
const startingTime=Date.now();
const step=()=> {
var timeDiff=Date.now() - startingTime;
var t=timeDiff / duration;
const horizontalScrollPosition=Math.round(initialHorizontalScroll +
horizontalDistanceToScroll * options.easing(t));
const verticalScrollPosition=Math.round(initialVerticalScroll + verticalDistanceToScroll * options.easing(t));
if(timeDiff < duration &&
(horizontalScrollPosition!==x||verticalScrollPosition!==y)){
elementToScroll.scrollTo(horizontalScrollPosition, verticalScrollPosition);
requestID=requestAnimationFrame(step);
}else{
elementToScroll.scrollTo(x, y);
cancelAnimationFrame(requestID);
removeListeners();
activeAnimations.remove(elementToScroll.element, false);
resolve(true);
}};
requestID=requestAnimationFrame(step);
});
});
}
const __WEBPACK_DEFAULT_EXPORT__=(animateScrollTo);
})
});
var __webpack_module_cache__={};
function __webpack_require__(moduleId){
var cachedModule=__webpack_module_cache__[moduleId];
if(cachedModule!==undefined){
return cachedModule.exports;
}
var module=__webpack_module_cache__[moduleId]={
exports: {}
};
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
return module.exports;
}
__webpack_require__.m=__webpack_modules__;
(()=> {
var deferred=[];
__webpack_require__.O=(result, chunkIds, fn, priority)=> {
if(chunkIds){
priority=priority||0;
for(var i=deferred.length; i > 0&&deferred[i - 1][2] > priority; i--) deferred[i]=deferred[i - 1];
deferred[i]=[chunkIds, fn, priority];
return;
}
var notFulfilled=Infinity;
for (var i=0; i < deferred.length; i++){
var [chunkIds, fn, priority]=deferred[i];
var fulfilled=true;
for (var j=0; j < chunkIds.length; j++){
if((priority & 1===0||notFulfilled >=priority)&&Object.keys(__webpack_require__.O).every((key)=> (__webpack_require__.O[key](chunkIds[j])))){
chunkIds.splice(j--, 1);
}else{
fulfilled=false;
if(priority < notFulfilled) notFulfilled=priority;
}
}
if(fulfilled){
deferred.splice(i--, 1)
var r=fn();
if(r!==undefined) result=r;
}
}
return result;
};
})();
(()=> {
__webpack_require__.n=(module)=> {
var getter=module&&module.__esModule ?
()=> (module['default']) :
()=> (module);
__webpack_require__.d(getter, { a: getter });
return getter;
};
})();
(()=> {
var getProto=Object.getPrototypeOf ? (obj)=> (Object.getPrototypeOf(obj)):(obj)=> (obj.__proto__);
var leafPrototypes;
__webpack_require__.t=function(value, mode){
if(mode & 1) value=this(value);
if(mode & 8) return value;
if(typeof value==='object'&&value){
if((mode & 4)&&value.__esModule) return value;
if((mode & 16)&&typeof value.then==='function') return value;
}
var ns=Object.create(null);
__webpack_require__.r(ns);
var def={};
leafPrototypes=leafPrototypes||[null, getProto({}), getProto([]), getProto(getProto)];
for(var current=mode & 2&&value; typeof current=='object'&&!~leafPrototypes.indexOf(current); current=getProto(current)){
Object.getOwnPropertyNames(current).forEach((key)=> (def[key]=()=> (value[key])));
}
def['default']=()=> (value);
__webpack_require__.d(ns, def);
return ns;
};
})();
(()=> {
__webpack_require__.d=(exports, definition)=> {
for(var key in definition){
if(__webpack_require__.o(definition, key)&&!__webpack_require__.o(exports, key)){
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
}
}
};
})();
(()=> {
__webpack_require__.f={};
__webpack_require__.e=(chunkId)=> {
return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key)=> {
__webpack_require__.f[key](chunkId, promises);
return promises;
}, []));
};
})();
(()=> {
__webpack_require__.u=(chunkId)=> {
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-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";
};
})();
(()=> {
__webpack_require__.miniCssF=(chunkId)=> {
return undefined;
};
})();
(()=> {
__webpack_require__.g=(function(){
if(typeof globalThis==='object') return globalThis;
try {
return this||new Function('return this')();
} catch (e){
if(typeof window==='object') return window;
}
})();
})();
(()=> {
__webpack_require__.o=(obj, prop)=> (Object.prototype.hasOwnProperty.call(obj, prop))
})();
(()=> {
var inProgress={};
var dataWebpackPrefix="WPRecipeMaker:";
__webpack_require__.l=(url, done, key, chunkId)=> {
if(inProgress[url]){ inProgress[url].push(done); return; }
var script, needAttach;
if(key!==undefined){
var scripts=document.getElementsByTagName("script");
for(var i=0; i < scripts.length; i++){
var s=scripts[i];
if(s.getAttribute("src")==url||s.getAttribute("data-webpack")==dataWebpackPrefix + key){ script=s; break; }
}
}
if(!script){
needAttach=true;
script=document.createElement('script');
script.charset='utf-8';
script.timeout=120;
if(__webpack_require__.nc){
script.setAttribute("nonce", __webpack_require__.nc);
}
script.setAttribute("data-webpack", dataWebpackPrefix + key);
script.src=url;
}
inProgress[url]=[done];
var onScriptComplete=(prev, event)=> {
script.onerror=script.onload=null;
clearTimeout(timeout);
var doneFns=inProgress[url];
delete inProgress[url];
script.parentNode&&script.parentNode.removeChild(script);
doneFns&&doneFns.forEach((fn)=> (fn(event)));
if(prev) return prev(event);
}
var timeout=setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
script.onerror=onScriptComplete.bind(null, script.onerror);
script.onload=onScriptComplete.bind(null, script.onload);
needAttach&&document.head.appendChild(script);
};
})();
(()=> {
__webpack_require__.r=(exports)=> {
if(typeof Symbol!=='undefined'&&Symbol.toStringTag){
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
}
Object.defineProperty(exports, '__esModule', { value: true });
};
})();
(()=> {
var scriptUrl;
if(__webpack_require__.g.importScripts) scriptUrl=__webpack_require__.g.location + "";
var document=__webpack_require__.g.document;
if(!scriptUrl&&document){
if(document.currentScript&&document.currentScript.tagName.toUpperCase()==='SCRIPT')
scriptUrl=document.currentScript.src;
if(!scriptUrl){
var scripts=document.getElementsByTagName("script");
if(scripts.length){
var i=scripts.length - 1;
while (i > -1&&(!scriptUrl||!/^http(s?):/.test(scriptUrl))) scriptUrl=scripts[i--].src;
}
}
}
if(!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
scriptUrl=scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
__webpack_require__.p=scriptUrl;
})();
(()=> {
var installedChunks={
607: 0
};
__webpack_require__.f.j=(chunkId, promises)=> {
var installedChunkData=__webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId]:undefined;
if(installedChunkData!==0){
if(installedChunkData){
promises.push(installedChunkData[2]);
}else{
if(true){
var promise=new Promise((resolve, reject)=> (installedChunkData=installedChunks[chunkId]=[resolve, reject]));
promises.push(installedChunkData[2]=promise);
var url=__webpack_require__.p + __webpack_require__.u(chunkId);
var error=new Error();
var loadingEnded=(event)=> {
if(__webpack_require__.o(installedChunks, chunkId)){
installedChunkData=installedChunks[chunkId];
if(installedChunkData!==0) installedChunks[chunkId]=undefined;
if(installedChunkData){
var errorType=event&&(event.type==='load' ? 'missing':event.type);
var realSrc=event&&event.target&&event.target.src;
error.message='Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
error.name='ChunkLoadError';
error.type=errorType;
error.request=realSrc;
installedChunkData[1](error);
}
}
};
__webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
}
}
}
};
__webpack_require__.O.j=(chunkId)=> (installedChunks[chunkId]===0);
var webpackJsonpCallback=(parentChunkLoadingFunction, data)=> {
var [chunkIds, moreModules, runtime]=data;
var moduleId, chunkId, i=0;
if(chunkIds.some((id)=> (installedChunks[id]!==0))){
for(moduleId in moreModules){
if(__webpack_require__.o(moreModules, moduleId)){
__webpack_require__.m[moduleId]=moreModules[moduleId];
}
}
if(runtime) var result=runtime(__webpack_require__);
}
if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
for(;i < chunkIds.length; i++){
chunkId=chunkIds[i];
if(__webpack_require__.o(installedChunks, chunkId)&&installedChunks[chunkId]){
installedChunks[chunkId][0]();
}
installedChunks[chunkId]=0;
}
return __webpack_require__.O(result);
}
var chunkLoadingGlobal=self["webpackChunkWPRecipeMakerPublicSplit"]=self["webpackChunkWPRecipeMakerPublicSplit"]||[];
chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
chunkLoadingGlobal.push=webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
})();
var __webpack_exports__={};
(()=> {
"use strict";
var analytics=__webpack_require__(3524);
;
window.WPRecipeMaker=typeof window.WPRecipeMaker==="undefined" ? {}:window.WPRecipeMaker;
window.WPRecipeMaker.rating={
init(){
const ratingFormElem=document.querySelector('.comment-form-wprm-rating');
if(ratingFormElem){
const recipes=document.querySelectorAll('.wprm-recipe-container');
const admin=document.querySelector('body.wp-admin');
if(recipes.length > 0||admin){
ratingFormElem.style.display='';
}else{
ratingFormElem.style.display='none';
}}
},
settings: {
enabled: typeof window.wprm_public!=='undefined' ? wprm_public.settings.features_comment_ratings:wprm_admin.settings.features_comment_ratings
},
onClick(el){
const container=el.closest('.wprm-comment-ratings-container, .wprm-user-ratings-modal-stars');
const oldValue=container ? parseInt(container.dataset.currentRating):0;
const newValue=parseInt(el.value);
if(newValue===oldValue){
el.checked=false;
document.querySelector('input[name="' + el.name + '"][value="0"]').checked=true;
container.dataset.currentRating=0;
}else{
container.dataset.currentRating=newValue;
if(window.WPRecipeMaker.hasOwnProperty('analytics')){
let recipeId=0;
const recipe=document.querySelector('.wprm-recipe-container');
if(recipe&&recipe.dataset.hasOwnProperty('recipeId')){
recipeId=parseInt(recipe.dataset.recipeId);
}
window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'comment-rating', {
rating: newValue
});
}}
if(window.WPRecipeMaker.hasOwnProperty('comments')&&window.WPRecipeMaker.comments.hasOwnProperty('change')){
window.WPRecipeMaker.comments.change(container);
}
document.dispatchEvent(new CustomEvent('wprm-comment-rating-change', {
detail: {
el,
container,
rating: newValue
}}));
}};
ready(()=> {
window.WPRecipeMaker.rating.init();
});
function ready(fn){
if(document.readyState!='loading'){
fn();
}else{
document.addEventListener('DOMContentLoaded', fn);
}}
var manager=__webpack_require__(8455);
;
function 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];o.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); const micromodal_es=(l);
;
window.WPRecipeMaker=typeof window.WPRecipeMaker==="undefined" ? {}:window.WPRecipeMaker;
window.WPRecipeMaker.modal={
savedScrollPosition: 0,
currentOpenUid: null,
htmlMarginTopValue: null,
getHtmlMarginTopValue(){
if(null!==this.htmlMarginTopValue){
return this.htmlMarginTopValue;
}
const htmlStyle=window.getComputedStyle(document.documentElement);
const htmlMarginTop=htmlStyle.marginTop;
const parsedMarginTop=htmlMarginTop&&htmlMarginTop!=='0px' ? parseFloat(htmlMarginTop):0;
this.htmlMarginTopValue=isNaN(parsedMarginTop) ? 0:parsedMarginTop;
return this.htmlMarginTopValue;
},
resetHtmlMarginTopValue(){
this.htmlMarginTopValue=null;
},
open(uid, data={}){
if(this.currentOpenUid&&this.currentOpenUid!==uid){
this.close(this.currentOpenUid);
}
const modalId=`wprm-popup-modal-${uid}`;
if(!document.getElementById(modalId)){
console.warn(`WPRM modal "${modalId}" could not be found in the DOM.`);
return;
}
this.savedScrollPosition=window.pageYOffset||document.documentElement.scrollTop;
const htmlMarginTopValue=this.getHtmlMarginTopValue();
document.body.classList.add('wprm-popup-modal-open');
document.body.style.top=`-${this.savedScrollPosition - htmlMarginTopValue}px`;
micromodal_es.show(modalId, {
onShow: modal=> {
this.currentOpenUid=uid;
const type=modal.dataset.type;
document.dispatchEvent(new CustomEvent('wprm-modal-open', {
detail: {
type,
uid,
modal,
data
}}));
},
onClose: modal=> {
if(this.currentOpenUid===uid){
this.currentOpenUid=null;
}
const type=modal.dataset.type;
document.dispatchEvent(new CustomEvent('wprm-modal-close', {
detail: {
type,
uid,
modal,
data
}}));
const scrollPosition=this.savedScrollPosition;
document.body.classList.remove('wprm-popup-modal-open');
document.body.style.top='';
this.savedScrollPosition=0;
window.scrollTo({
top: scrollPosition,
behavior: 'instant'
});
},
awaitCloseAnimation: true
});
},
close(uid){
if(`${this.currentOpenUid}`!==`${uid}`){
return;
}
micromodal_es.close('wprm-popup-modal-' + uid);
if(this.currentOpenUid===uid){
this.currentOpenUid=null;
}}
};
window.addEventListener('resize', ()=> window.WPRecipeMaker.modal.resetHtmlMarginTopValue());
window.addEventListener('orientationchange', ()=> window.WPRecipeMaker.modal.resetHtmlMarginTopValue());
var print=__webpack_require__(3579);
var recipe=__webpack_require__(1104);
var esm=__webpack_require__(5266);
;
window.WPRecipeMaker=typeof window.WPRecipeMaker==="undefined" ? {}:window.WPRecipeMaker;
window.WPRecipeMaker.jump={
init: ()=> {
document.addEventListener('click', function (e){
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;
if(target){
WPRecipeMaker.jump.onClick(target, e);
}}, false);
},
onClick: (el, e)=> {
const target=el.getAttribute('href');
if(el.matches('.wprm-jump-smooth-scroll')){
e.preventDefault();
let speed=parseInt(el.dataset.smoothScroll);
if(speed < 0){
speed=500;
}
(0,esm.A)(document.querySelector(target), {
verticalOffset: -100,
speed
});
}else{
if(!wprm_public.settings.jump_output_hash){
const elementToJumpTo=document.querySelector(target);
if(elementToJumpTo){
e.preventDefault();
elementToJumpTo.scrollIntoView();
}}
}}
};
smooth_scroll_ready(()=> {
window.WPRecipeMaker.jump.init();
});
function smooth_scroll_ready(fn){
if(document.readyState!='loading'){
fn();
}else{
document.addEventListener('DOMContentLoaded', fn);
}}
var temperature=__webpack_require__(9002);
var tippy_esm=__webpack_require__(4181);
;
window.WPRecipeMaker=typeof window.WPRecipeMaker==="undefined" ? {}:window.WPRecipeMaker;
window.WPRecipeMaker.tooltip={
init(){
WPRecipeMaker.tooltip.addTooltips();
},
addTooltips(root=document){
let containers=[];
if(root&&root.classList&&root.classList.contains('wprm-tooltip')){
containers.push(root);
}
if(root&&'function'===typeof root.querySelectorAll){
containers=containers.concat([...root.querySelectorAll('.wprm-tooltip')]);
}
for (let container of containers){
const existingTippy=container._tippy;
if(existingTippy){
existingTippy.destroy();
}
const tooltip=container.dataset.hasOwnProperty('tooltip') ? container.dataset.tooltip:false;
if(tooltip){
container.role="button";
const hasHtml=container.dataset.hasOwnProperty('tooltipHtml')&&'1'===container.dataset.tooltipHtml;
let content=tooltip;
if(hasHtml){
content=content.replace(/<[^>]*>/g, '');
}
(0,tippy_esm.Ay)(container, {
theme: 'wprm',
content,
allowHTML: false,
interactive: true,
onCreate(instance){
instance.popper.style.display='inline-block';
instance._isFetching=false;
instance._fetchedContent=false;
},
onShow(instance){
if(instance._isFetching||instance._fetchedContent){
return;
}
if(hasHtml){
instance._isFetching=true;
fetch(`${wprm_public.endpoints.utilities}/sanitize`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
credentials: 'same-origin',
body: JSON.stringify({
text: tooltip
})
}).then(response=> {
if(response.ok){
return response.json();
}else{
return false;
}}).then(html=> {
instance._isFetching=false;
instance._fetchedContent=true;
if(html){
instance.setContent(html);
instance.setProps({
allowHTML: true
});
}});
}}
});
}}
}};
tooltip_ready(()=> {
window.WPRecipeMaker.tooltip.init();
});
function tooltip_ready(fn){
if(document.readyState!='loading'){
fn();
}else{
document.addEventListener('DOMContentLoaded', fn);
}}
;
window.WPRecipeMaker=typeof window.WPRecipeMaker==='undefined' ? {}:window.WPRecipeMaker;
const featurePromises={};
const public_modern_split_ready=fn=> {
if(document.readyState!=='loading'){
fn();
}else{
document.addEventListener('DOMContentLoaded', fn);
}};
const hasElement=(selector, root=document)=> {
if(!root){
return false;
}
if(root!==document&&root.matches&&root.matches(selector)){
return true;
}
return !!(root.querySelector&&root.querySelector(selector));
};
const loadFeature=(key, importer)=> {
if(!featurePromises[key]){
featurePromises[key]=importer().catch(error=> {
delete featurePromises[key];
console.error(`WP Recipe Maker could not load the ${key} feature.`, error);
});
}
return featurePromises[key];
};
const loaders={
commentRating: ()=> Promise.resolve(),
cookpal: ()=> loadFeature('cookpal', ()=> __webpack_require__.e( 765).then(__webpack_require__.t.bind(__webpack_require__, 3621, 23))),
debug: ()=> loadFeature('debug', ()=> __webpack_require__.e( 615).then(__webpack_require__.t.bind(__webpack_require__, 2811, 23))),
expandable: ()=> loadFeature('expandable', ()=> __webpack_require__.e( 990).then(__webpack_require__.t.bind(__webpack_require__, 2942, 23))),
grow: ()=> loadFeature('grow', ()=> __webpack_require__.e( 911).then(__webpack_require__.t.bind(__webpack_require__, 385, 23))),
instacart: ()=> loadFeature('instacart', ()=> __webpack_require__.e( 297).then(__webpack_require__.t.bind(__webpack_require__, 1157, 23))),
jump: ()=> Promise.resolve(),
jumpToSection: ()=> loadFeature('jumpToSection', ()=> __webpack_require__.e( 794).then(__webpack_require__.t.bind(__webpack_require__, 68, 23))),
media: ()=> loadFeature('media', ()=> __webpack_require__.e( 215).then(__webpack_require__.t.bind(__webpack_require__, 7561, 23))),
modal: ()=> Promise.resolve(),
myShoppingHelp: ()=> loadFeature('myShoppingHelp', ()=> __webpack_require__.e( 631).then(__webpack_require__.t.bind(__webpack_require__, 4253, 23))),
pinterest: ()=> loadFeature('pinterest', ()=> __webpack_require__.e( 796).then(__webpack_require__.t.bind(__webpack_require__, 9854, 23))),
print: ()=> Promise.resolve(),
slickstream: ()=> loadFeature('slickstream', ()=> __webpack_require__.e( 790).then(__webpack_require__.t.bind(__webpack_require__, 6944, 23))),
tooltip: ()=> Promise.resolve(),
video: ()=> loadFeature('video', ()=> __webpack_require__.e( 939).then(__webpack_require__.t.bind(__webpack_require__, 9047, 23)))
};
const detectFeatures=(root=document)=> {
if(wprm_public.settings.features_comment_ratings||hasElement('.comment-form-wprm-rating, .wprm-comment-ratings-container, .wprm-user-ratings-modal-stars', root)){
loaders.commentRating();
}
if(hasElement('#wp-admin-bar-wprm-debug, [id^="wp-admin-bar-wprm-debug-entry"]', root)){
loaders.debug();
}
if(hasElement('.wprm-expandable-button', root)){
loaders.expandable();
}
if(hasElement('.wprm-recipe-grow', root)){
loaders.grow();
}
if(hasElement('.wprm-recipe-shop-instacart', root)){
loaders.instacart();
}
if(hasElement('.wprm-recipe-jump, .wprm-recipe-jump-to-comments, .wprm-recipe-jump-video, .wprm-jump-smooth-scroll, .wprm-recipe-jump-to-section', root)){
loaders.jump();
}
if(hasElement('.wprm-recipe-jump-to-section-container-scroll', root)){
loaders.jumpToSection();
}
if(hasElement('.wprm-recipe-media-toggle, .wprm-media-toggle-checkbox', root)){
loaders.media();
}
if(hasElement('.wprm-popup-modal, [data-modal-uid]', root)){
loaders.modal();
}
if(hasElement('.wprm-recipe-my-shopping-help', root)){
loaders.myShoppingHelp();
}
if(hasElement('.wprm-recipe-cookpal', root)){
loaders.cookpal();
}
if(hasElement('.wprm-recipe-pin', root)){
loaders.pinterest();
}
if(hasElement('.wprm-recipe-print, .wprm-print-recipe-shortcode', root)){
loaders.print();
}
if(hasElement('.wprm-recipe-slickstream', root)){
loaders.slickstream();
}
if(hasElement('.wprm-tooltip', root)){
loaders.tooltip();
}
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)){
loaders.video();
}};
let detectScheduled=false;
const scheduleFeatureDetection=(root=document)=> {
if(detectScheduled){
return;
}
detectScheduled=true;
window.setTimeout(()=> {
detectScheduled=false;
detectFeatures(root);
}, 0);
};
const observeFeatureDom=()=> {
if(!window.MutationObserver||!document.body){
return;
}
const observer=new MutationObserver(mutations=> {
for (const mutation of mutations){
for (const node of mutation.addedNodes){
if(node.nodeType===1){
scheduleFeatureDetection(node);
return;
}}
}});
observer.observe(document.body, {
childList: true,
subtree: true
});
};
window.WPRecipeMaker.publicLoader={
detect: scheduleFeatureDetection,
has: hasElement,
load: key=> loaders[key] ? loaders[key]():Promise.resolve()
};
public_modern_split_ready(()=> {
detectFeatures();
observeFeatureDom();
});
document.addEventListener('wprmRecipeInit', ()=> {
scheduleFeatureDetection();
});
})();
__webpack_exports__=__webpack_require__.O(__webpack_exports__);
(WPRecipeMaker=typeof WPRecipeMaker==="undefined" ? {}:WPRecipeMaker)["public-modern-split"]=__webpack_exports__;
})()
;
!function(){const o=window.navigator.userAgent;Object.entries({android:/android/i,iphone:/iPhone/i,ipad:/iPad/i}).forEach((([n,i])=>{o.match(i)&&document.body.classList.add(`tec-is-${n}`)}))}(),window.tec=window.tec||{},window.tec.common=window.tec.common||{},window.tec.common.userAgent={};