1(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?factory(exports):typeof define==='function'&&define.amd?define(['exports'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,factory(global.wpbc_Popper={}));}(this,(function(exports){'use strict';function getWindow(node){if(node==null){return window;} 2if(node.toString()!=='[object Window]'){var ownerDocument=node.ownerDocument;return ownerDocument?ownerDocument.defaultView||window:window;} 3return node;} 4function isElement(node){var OwnElement=getWindow(node).Element;return node instanceof OwnElement||node instanceof Element;} 5function isHTMLElement(node){var OwnElement=getWindow(node).HTMLElement;return node instanceof OwnElement||node instanceof HTMLElement;} 6function isShadowRoot(node){if(typeof ShadowRoot==='undefined'){return false;} 7var OwnElement=getWindow(node).ShadowRoot;return node instanceof OwnElement||node instanceof ShadowRoot;} 8var max=Math.max;var min=Math.min;var round=Math.round;function getBoundingClientRect(element,includeScale){if(includeScale===void 0){includeScale=false;} 9var 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;} 10if(offsetHeight>0){scaleY=round(rect.height)/offsetHeight||1;}} 11return{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};} 12function getWindowScroll(node){var win=getWindow(node);var scrollLeft=win.pageXOffset;var scrollTop=win.pageYOffset;return{scrollLeft:scrollLeft,scrollTop:scrollTop};} 13function getHTMLElementScroll(element){return{scrollLeft:element.scrollLeft,scrollTop:element.scrollTop};} 14function getNodeScroll(node){if(node===getWindow(node)||!isHTMLElement(node)){return getWindowScroll(node);}else{return getHTMLElementScroll(node);}} 15function getNodeName(element){return element?(element.nodeName||'').toLowerCase():null;} 16function getDocumentElement(element){return((isElement(element)?element.ownerDocument:element.document)||window.document).documentElement;} 17function getWindowScrollBarX(element){return getBoundingClientRect(getDocumentElement(element)).left+getWindowScroll(element).scrollLeft;} 18function getComputedStyle(element){return getWindow(element).getComputedStyle(element);} 19function isScrollParent(element){var _getComputedStyle=getComputedStyle(element),overflow=_getComputedStyle.overflow,overflowX=_getComputedStyle.overflowX,overflowY=_getComputedStyle.overflowY;return/auto|scroll|overlay|hidden/.test(overflow+overflowY+overflowX);} 20function 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;} 21function getCompositeRect(elementOrVirtualElement,offsetParent,isFixed){if(isFixed===void 0){isFixed=false;} 22var 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'||isScrollParent(documentElement)){scroll=getNodeScroll(offsetParent);} 23if(isHTMLElement(offsetParent)){offsets=getBoundingClientRect(offsetParent,true);offsets.x+=offsetParent.clientLeft;offsets.y+=offsetParent.clientTop;}else if(documentElement){offsets.x=getWindowScrollBarX(documentElement);}} 24return{x:rect.left+scroll.scrollLeft-offsets.x,y:rect.top+scroll.scrollTop-offsets.y,width:rect.width,height:rect.height};} 25function getLayoutRect(element){var clientRect=getBoundingClientRect(element);var width=element.offsetWidth;var height=element.offsetHeight;if(Math.abs(clientRect.width-width)<=1){width=clientRect.width;} 26if(Math.abs(clientRect.height-height)<=1){height=clientRect.height;} 27return{x:element.offsetLeft,y:element.offsetTop,width:width,height:height};}
vendor: 4,537 bytes, lines 28-51
28function getParentNode(element){if(getNodeName(element)==='html'){return element;} 29return(element.assignedSlot||element.parentNode||(isShadowRoot(element)?element.host:null)||getDocumentElement(element));} 30function getScrollParent(node){if(['html','body','#document'].indexOf(getNodeName(node))>=0){return node.ownerDocument.body;} 31if(isHTMLElement(node)&&isScrollParent(node)){return node;} 32return getScrollParent(getParentNode(node));} 33function listScrollParents(element,list){var _element$ownerDocumen;if(list===void 0){list=[];} 34var 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)));} 35function isTableElement(element){return['table','td','th'].indexOf(getNodeName(element))>=0;} 36function getTrueOffsetParent(element){if(!isHTMLElement(element)||getComputedStyle(element).position==='fixed'){return null;} 37return element.offsetParent;} 38function 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;}} 39var currentNode=getParentNode(element);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;}} 40return null;} 41function getOffsetParent(element){var window=getWindow(element);var offsetParent=getTrueOffsetParent(element);while(offsetParent&&isTableElement(offsetParent)&&getComputedStyle(offsetParent).position==='static'){offsetParent=getTrueOffsetParent(offsetParent);} 42if(offsetParent&&(getNodeName(offsetParent)==='html'||getNodeName(offsetParent)==='body'&&getComputedStyle(offsetParent).position==='static')){return window;} 43return offsetParent||getContainingBlock(element)||window;} 44var top='top';var bottom='bottom';var right='right';var left='left';var auto='auto';var basePlacements=[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 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);} 45modifiers.forEach(function(modifier){if(!visited.has(modifier.name)){sort(modifier);}});return result;} 46function orderModifiers(modifiers){var orderedModifiers=order(modifiers);return modifierPhases.reduce(function(acc,phase){return acc.concat(orderedModifiers.filter(function(modifier){return modifier.phase===phase;}));},[]);} 47function debounce(fn){var pending;return function(){if(!pending){pending=new Promise(function(resolve){Promise.resolve().then(function(){pending=undefined;resolve(fn());});});} 48return pending;};} 49function format(str){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];} 50return[].concat(args).reduce(function(p,c){return p.replace(/%s/,c);},str);} 51var INVALID_MODIFIER_ERROR='Popper: modifier "%s" provided an invali
vendor: 4,776 bytes, lines 51-72
51d %s property, expected %s but got %s';var MISSING_DEPENDENCY_ERROR='Popper: modifier "%s" requires "%s", but "%s" modifier is not available';var VALID_PROPERTIES=['name','enabled','phase','fn','effect','requires','options'];function validateModifiers(modifiers){modifiers.forEach(function(modifier){[].concat(Object.keys(modifier),VALID_PROPERTIES).filter(function(value,index,self){return self.indexOf(value)===index;}).forEach(function(key){switch(key){case'name':if(typeof modifier.name!=='string'){console.error(format(INVALID_MODIFIER_ERROR,String(modifier.name),'"name"','"string"',"\""+String(modifier.name)+"\""));} 52break;case'enabled':if(typeof modifier.enabled!=='boolean'){console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"enabled"','"boolean"',"\""+String(modifier.enabled)+"\""));} 53break;case'phase':if(modifierPhases.indexOf(modifier.phase)<0){console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"phase"',"either "+modifierPhases.join(', '),"\""+String(modifier.phase)+"\""));} 54break;case'fn':if(typeof modifier.fn!=='function'){console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"fn"','"function"',"\""+String(modifier.fn)+"\""));} 55break;case'effect':if(modifier.effect!=null&&typeof modifier.effect!=='function'){console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"effect"','"function"',"\""+String(modifier.fn)+"\""));} 56break;case'requires':if(modifier.requires!=null&&!Array.isArray(modifier.requires)){console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"requires"','"array"',"\""+String(modifier.requires)+"\""));} 57break;case'requiresIfExists':if(!Array.isArray(modifier.requiresIfExists)){console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"requiresIfExists"','"array"',"\""+String(modifier.requiresIfExists)+"\""));} 58break;case'options':case'data':break;default:console.error("PopperJS: an invalid property has been provided to the \""+modifier.name+"\" modifier, valid properties are "+VALID_PROPERTIES.map(function(s){return"\""+s+"\"";}).join(', ')+"; but \""+key+"\" was provided.");} 59modifier.requires&&modifier.requires.forEach(function(requirement){if(modifiers.find(function(mod){return mod.name===requirement;})==null){console.error(format(MISSING_DEPENDENCY_ERROR,String(modifier.name),requirement,requirement));}});});});} 60function uniqueBy(arr,fn){var identifiers=new Set();return arr.filter(function(item){var identifier=fn(item);if(!identifiers.has(identifier)){identifiers.add(identifier);return true;}});} 61function getBasePlacement(placement){return placement.split('-')[0];} 62function 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];});} 63function 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;}} 64return{width:width,height:height,x:x+getWindowScrollBarX(element),y:y};} 65function 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=max(html.scrollWidth,html.clientWidth,body?body.scrollWidth:0,body?body.clientWidth:0);var height=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+=max(html.clientWidth,body?body.clientWidth:0)-width;} 66return{width:width,height:height,x:x,y:y};} 67function contains(parent,child){var rootNode=child.getRootNode&&child.getRootNode();if(parent.contains(child)){return true;} 68else if(rootNode&&isShadowRoot(rootNode)){var next=child;do{if(next&&parent.isSameNode(next)){return true;} 69next=next.parentNode||next.host;}while(next);} 70return false;} 71function rectToClientRect(rect){return Object.assign({},rect,{left:rect.x,top:rect.y,right:rect.x+rect.width,bottom:rect.y+rect.height});} 72function 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;
vendor: 4,223 bytes, lines 72-86
72rect.width=element.clientWidth;rect.height=element.clientHeight;rect.x=rect.left;rect.y=rect.top;return rect;} 73function getClientRectFromMixedType(element,clippingParent){return clippingParent===viewport?rectToClientRect(getViewportRect(element)):isElement(clippingParent)?getInnerBoundingClientRect(clippingParent):rectToClientRect(getDocumentRect(getDocumentElement(element)));} 74function 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[];} 75return clippingParents.filter(function(clippingParent){return isElement(clippingParent)&&contains(clippingParent,clipperElement)&&getNodeName(clippingParent)!=='body';});} 76function 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=max(rect.top,accRect.top);accRect.right=min(rect.right,accRect.right);accRect.bottom=min(rect.bottom,accRect.bottom);accRect.left=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;} 77function getVariation(placement){return placement.split('-')[1];} 78function getMainAxisFromPlacement(placement){return['top','bottom'].indexOf(placement)>=0?'x':'y';} 79function 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 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};} 80var 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;}} 81return offsets;} 82function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0};} 83function mergePaddingObject(paddingObject){return Object.assign({},getFreshSideObject(),paddingObject);} 84function expandToHashMap(value,keys){return keys.reduce(function(hashMap,key){hashMap[key]=value;return hashMap;},{});} 85function detectOverflow(state,options){if(options===void 0){options={};} 86var _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];
vendor: 5,990 bytes, lines 86-101
86var 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=[top,bottom].indexOf(key)>=0?'y':'x';overflowOffsets[key]+=offset[axis]*multiply;});} 87return overflowOffsets;} 88var 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];} 89return!args.some(function(element){return!(element&&typeof element.getBoundingClientRect==='function');});} 90function popperGenerator(generatorOptions){if(generatorOptions===void 0){generatorOptions={};} 91var _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;} 92var 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;});{var modifiers=uniqueBy([].concat(orderedModifiers,state.options.modifiers),function(_ref){var name=_ref.name;return name;});validateModifiers(modifiers);if(getBasePlacement(state.options.placement)===auto){var flipModifier=state.orderedModifiers.find(function(_ref2){var name=_ref2.name;return name==='flip';});if(!flipModifier){console.error(['Popper: "auto" placements require the "flip" modifier be','present and enabled to work.'].join(' '));}} 93var _getComputedStyle=getComputedStyle(popper),marginTop=_getComputedStyle.marginTop,marginRight=_getComputedStyle.marginRight,marginBottom=_getComputedStyle.marginBottom,marginLeft=_getComputedStyle.marginLeft;if([marginTop,marginRight,marginBottom,marginLeft].some(function(margin){return parseFloat(margin);})){console.warn(['Popper: CSS "margin" styles cannot be used to apply padding','between the popper and its reference element or boundary.','To replicate margin, use the `offset` modifier, as well as','the `padding` option in the `preventOverflow` and `flip`','modifiers.'].join(' '));}} 94runModifierEffects();return instance.update();},forceUpdate:function forceUpdate(){if(isDestroyed){return;} 95var _state$elements=state.elements,reference=_state$elements.reference,popper=_state$elements.popper;if(!areValidElements(reference,popper)){{console.error(INVALID_ELEMENT_ERROR);} 96return;} 97state.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++){{__debug_loops__+=1;if(__debug_loops__>100){console.error(INFINITE_LOOP_ERROR);break;}} 98if(state.reset===true){state.reset=false;index=-1;continue;} 99var _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)){{console.error(INVALID_ELEMENT_ERROR);} 100return instance;} 101instance.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;
vendor: 4,398 bytes, lines 101-115
101if(typeof effect==='function'){var cleanupFn=effect({state:state,name:name,instance:instance,options:options});var noopFn=function noopFn(){};effectCleanupFns.push(cleanupFn||noopFn);}});} 102function cleanupModifierEffects(){effectCleanupFns.forEach(function(fn){return fn();});effectCleanupFns=[];} 103return instance;};} 104var passive={passive:true};function effect$2(_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);});} 105if(resize){window.addEventListener('resize',instance.update,passive);} 106return function(){if(scroll){scrollParents.forEach(function(scrollParent){scrollParent.removeEventListener('scroll',instance.update,passive);});} 107if(resize){window.removeEventListener('resize',instance.update,passive);}};} 108var eventListeners={name:'eventListeners',enabled:true,phase:'write',fn:function fn(){},effect:effect$2,data:{}};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});} 109var popperOffsets$1={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};} 110function 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=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';}} 111offsetParent=offsetParent;if(placement===top||(placement===left||placement===right)&&variation===end){sideY=bottom;var offsetY=isFixed&&win.visualViewport?win.visualViewport.height:offsetParent[heightProp];y-=offsetY-popperRect.height;y*=gpuAcceleration?1:-1;} 112if(placement===left||(placement===top||placement===bottom)&&variation===end){sideX=right;var offsetX=isFixed&&win.visualViewport?win.visualViewport.width:offsetParent[widthProp];x-=offsetX-popperRect.width;x*=gpuAcceleration?1:-1;}} 113var 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));} 114return Object.assign({},commonStyles,(_Object$assign2={},_Object$assign2[sideY]=hasY?y+"px":'',_Object$assign2[sideX]=hasX?x+"px":'',_Object$assign2.transform='',_Object$assign2));} 115function 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;{var transitionProperty=getComputedStyle(state.elements.popper).transitionProperty||'';
115if(adaptive&&['transform','top','right','bottom','left'].some(function(property){return transitionProperty.indexOf(property)>=0;})){console.warn(['Popper: Detected CSS transitions on at least one of the following','CSS properties: "transform", "top", "right", "bottom", "left".','\n\n','Disable the "computeStyles" modifier\'s `adaptive` option to allow','for smooth transitions, or remove these properties from the CSS','transition declaration on the popper element if only transitioning','opacity or background-color for example.','\n\n','We recommend using the popper element as a wrapper around an inner','element that can have any CSS property transitioned for animations.'].join(' '));}} 116var 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.o
vendor: 1,047 bytes, lines 116-121
116ptions.strategy,adaptive:adaptive,roundOffsets:roundOffsets})));} 117if(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})));} 118state.attributes.popper=Object.assign({},state.attributes.popper,{'data-popper-placement':state.placement});} 119var computeStyles$1={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;} 120Object.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);}});});} 121function effect$1(_ref2){var state=_ref2.state;
vendor: 9,205 bytes, lines 121-146
121var 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);} 122return 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;} 123Object.assign(element.style,style);Object.keys(attributes).forEach(function(attribute){element.removeAttribute(attribute);});});};} 124var applyStyles$1={name:'applyStyles',enabled:true,phase:'write',fn:applyStyles,effect:effect$1,requires:['computeStyles']};function distanceAndSkiddingToXY(placement,rects,offset){var basePlacement=getBasePlacement(placement);var invertDistance=[left,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};} 125function 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=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;} 126state.modifiersData[name]=data;} 127var offset$1={name:'offset',enabled:true,phase:'main',requires:['popperOffsets'],fn:offset};var hash$1={left:'right',right:'left',bottom:'top',top:'bottom'};function getOppositePlacement(placement){return placement.replace(/left|right|bottom|top/g,function(matched){return hash$1[matched];});} 128var hash={start:'end',end:'start'};function getOppositeVariationPlacement(placement){return placement.replace(/start|end/g,function(matched){return hash[matched];});} 129function computeAutoPlacement(state,options){if(options===void 0){options={};} 130var _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?placements:_options$allowedAutoP;var variation=getVariation(placement);var placements$1=variation?flipVariations?variationPlacements:variationPlacements.filter(function(placement){return getVariation(placement)===variation;}):basePlacements;var allowedPlacements=placements$1.filter(function(placement){return allowedAutoPlacements.indexOf(placement)>=0;});if(allowedPlacements.length===0){allowedPlacements=placements$1;{console.error(['Popper: The `allowedAutoPlacements` option did not allow any','placements. Ensure the `placement` option matches the variation','of the allowed placements.','For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(' '));}} 131var 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];});} 132function getExpandedFallbackPlacements(placement){if(getBasePlacement(placement)===auto){return[];} 133var oppositePlacement=getOppositePlacement(placement);return[getOppositeVariationPlacement(placement),oppositePlacement,getOppositeVariationPlacement(oppositePlacement)];} 134function flip(_ref){var state=_ref.state,options=_ref.options,name=_ref.name;if(state.modifiersData[name]._skip){return;} 135var _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=[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:top;if(referenceRect[len]>popperRect[len]){mainVariationSide=getOppositePlacement(mainVariationSide);} 136var altVariationSide=getOppositePlacement(mainVariationSide);var checks=[];if(checkMainAxis){checks.push(overflow[_basePlacement]<=0);} 137if(checkAltAxis){checks.push(overflow[mainVariationSide]<=0,overflow[altVariationSide]<=0);} 138if(checks.every(function(check){return check;})){firstFittingPlacement=placement;makeFallbackChecks=false;break;} 139checksMap.set(placement,checks);} 140if(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;}} 141if(state.placement!==firstFittingPlacement){state.modifiersData[name]._skip=true;state.placement=firstFittingPlacement;state.reset=true;}} 142var flip$1={name:'flip',enabled:true,phase:'main',fn:flip,requiresIfExists:['offset'],data:{_skip:false}};function getAltAxis(axis){return axis==='x'?'y':'x';} 143function within(min$1,value,max$1){return max(min$1,min(value,max$1));} 144function withinMaxClamp(min,value,max){var v=within(min,value,max);return v>max?max:v;} 145function 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;} 146if(checkMainAxis){var _offsetModifierState$;var mainSide=mainAxis==='y'?top:left;var altSide=mainAxis==='y'?bottom:right;var len=mainAxis==='y'?'height':'width';var offset=popperOffsets[mainAxis];var min$1=offset+overflow[mainSide];
vendor: 6,869 bytes, lines 146-161
146var max$1=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?min(min$1,tetherMin):min$1,offset,tether?max(max$1,tetherMax):max$1);popperOffsets[mainAxis]=preventedOffset;data[mainAxis]=preventedOffset-offset;} 147if(checkAltAxis){var _offsetModifierState$2;var _mainSide=mainAxis==='x'?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=[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;} 148state.modifiersData[name]=data;} 149var preventOverflow$1={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;} 150var paddingObject=toPaddingObject(options.padding,state);var arrowRect=getLayoutRect(arrowElement);var minProp=axis==='y'?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$);} 151function 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;} 152if(typeof arrowElement==='string'){arrowElement=state.elements.popper.querySelector(arrowElement);if(!arrowElement){return;}} 153{if(!isHTMLElement(arrowElement)){console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).','To use an SVG arrow, wrap it in an HTMLElement that will be used as','the arrow.'].join(' '));}} 154if(!contains(state.elements.popper,arrowElement)){{console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper','element.'].join(' '));} 155return;} 156state.elements.arrow=arrowElement;} 157var arrow$1={name:'arrow',enabled:true,phase:'main',fn:arrow,effect:effect,requires:['popperOffsets'],requiresIfExists:['preventOverflow']};function getSideOffsets(overflow,rect,preventedOffsets){if(preventedOffsets===void 0){preventedOffsets={x:0,y:0};} 158return{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};} 159function isAnySideFullyClipped(overflow){return[top,right,bottom,left].some(function(side){return overflow[side]>=0;});} 160function 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});} 161var hide$1={name:'hide',enabled:true,phase:'main',requiresIfExists:['preventOverflow'],fn:hide};var defaultModifiers$1=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1];
vendor: 19,668 bytes, lines 161-250
161var createPopper$1=popperGenerator({defaultModifiers:defaultModifiers$1});var defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1];var createPopper=popperGenerator({defaultModifiers:defaultModifiers});exports.applyStyles=applyStyles$1;exports.arrow=arrow$1;exports.computeStyles=computeStyles$1;exports.createPopper=createPopper;exports.createPopperLite=createPopper$1;exports.defaultModifiers=defaultModifiers;exports.detectOverflow=detectOverflow;exports.eventListeners=eventListeners;exports.flip=flip$1;exports.hide=hide$1;exports.offset=offset$1;exports.popperGenerator=popperGenerator;exports.popperOffsets=popperOffsets$1;exports.preventOverflow=preventOverflow$1;Object.defineProperty(exports,'__esModule',{value:true});})));;(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('@popperjs/core')):typeof define==='function'&&define.amd?define(['@popperjs/core'],factory):(global=global||self,global.wpbc_tippy=factory(global.wpbc_Popper));}(this,(function(core){'use strict';var css=".tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:\"\";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}";function injectCSS(css){var style=document.createElement('style');style.textContent=css;style.setAttribute('data-tippy-stylesheet','');var head=document.head;var firstStyleOrLinkTag=document.querySelector('head>style,head>link');if(firstStyleOrLinkTag){head.insertBefore(style,firstStyleOrLinkTag);}else{head.appendChild(style);}} 162var isBrowser=typeof window!=='undefined'&&typeof document!=='undefined';var isIE11=isBrowser?!!window.msCrypto:false;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 hasOwnProperty(obj,key){return{}.hasOwnProperty.call(obj,key);} 163function getValueAtIndexOrReturn(value,index,defaultValue){if(Array.isArray(value)){var v=value[index];return v==null?Array.isArray(defaultValue)?defaultValue[index]:defaultValue:v;} 164return value;} 165function isType(value,type){var str={}.toString.call(value);return str.indexOf('[object')===0&&str.indexOf(type+"]")>-1;} 166function invokeWithArgsOrReturn(value,args){return typeof value==='function'?value.apply(void 0,args):value;} 167function debounce(fn,ms){if(ms===0){return fn;} 168var timeout;return function(arg){clearTimeout(timeout);timeout=setTimeout(function(){fn(arg);},ms);};} 169function removeProperties(obj,keys){var clone=Object.assign({},obj);keys.forEach(function(key){delete clone[key];});return clone;} 170function splitBySpaces(value){return value.split(/\s+/).filter(Boolean);} 171function normalizeToArray(value){return[].concat(value);} 172function pushIfUnique(arr,value){if(arr.indexOf(value)===-1){arr.push(value);}} 173function unique(arr){return arr.filter(function(item,index){return arr.indexOf(item)===index;});} 174function getBasePlacement(placement){return placement.split('-')[0];} 175function arrayFrom(value){return[].slice.call(value);} 176function removeUndefinedProps(obj){return Object.keys(obj).reduce(function(acc,key){if(obj[key]!==undefined){acc[key]=obj[key];} 177return acc;},{});} 178function div(){return document.createElement('div');} 179function isElement(value){return['Element','Fragment'].some(function(type){return isType(value,type);});} 180function isNodeList(value){return isType(value,'NodeList');} 181function isMouseEvent(value){return isType(value,'MouseEvent');} 182function isReferenceElement(value){return!!(value&&value._tippy&&value._tippy.reference===value);} 183function getArrayOfElements(value){if(isElement(value)){return[value];} 184if(isNodeList(value)){return arrayFrom(value);} 185if(Array.isArray(value)){return value;} 186return arrayFrom(document.querySelectorAll(value));} 187function setTransitionDuration(els,value){els.forEach(function(el){if(el){el.style.transitionDuration=value+"ms";}});} 188function setVisibilityState(els,state){els.forEach(function(el){if(el){el.setAttribute('data-state',state);}});} 189function 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;} 190function 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=getBasePlacement(popperState.placement);var offsetData=popperState.modifiersData.offset;if(!offsetData){return true;} 191var 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;});} 192function updateTransitionEndListener(box,action,listener){var method=action+"EventListener";['transitionend','webkitTransitionEnd'].forEach(function(event){box[method](event,listener);});} 193function actualContains(parent,child){var target=child;while(target){var _target$getRootNode;if(parent.contains(target)){return true;} 194target=target.getRootNode==null?void 0:(_target$getRootNode=target.getRootNode())==null?void 0:_target$getRootNode.host;} 195return false;} 196var currentInput={isTouch:false};var lastMouseMoveTime=0;function onDocumentTouchStart(){if(currentInput.isTouch){return;} 197currentInput.isTouch=true;if(window.performance){document.addEventListener('mousemove',onDocumentMouseMove);}} 198function onDocumentMouseMove(){var now=performance.now();if(now-lastMouseMoveTime<20){currentInput.isTouch=false;document.removeEventListener('mousemove',onDocumentMouseMove);} 199lastMouseMoveTime=now;} 200function onWindowBlur(){var activeElement=document.activeElement;if(isReferenceElement(activeElement)){var instance=activeElement._tippy;if(activeElement.blur&&!instance.state.isVisible){activeElement.blur();}}} 201function bindGlobalEventListeners(){document.addEventListener('touchstart',onDocumentTouchStart,TOUCH_OPTIONS);window.addEventListener('blur',onWindowBlur);} 202function 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(' ');} 203function clean(value){var spacesAndTabs=/[ \t]{2,}/g;var lineStartWithSpaces=/^[ \t]*/gm;return value.replace(spacesAndTabs,' ').replace(lineStartWithSpaces,'').trim();} 204function 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 ");} 205function getFormattedMessage(message){return[getDevMessage(message),'color: #00C584; font-size: 1.3em; font-weight: bold;','line-height: 1.5','color: #a6a095;'];} 206var visitedMessages;{resetVisitedMessages();} 207function resetVisitedMessages(){visitedMessages=new Set();} 208function warnWhen(condition,message){if(condition&&!visitedMessages.has(message)){var _console;visitedMessages.add(message);(_console=console).warn.apply(_console,getFormattedMessage(message));}} 209function errorWhen(condition,message){if(condition&&!visitedMessages.has(message)){var _console2;visitedMessages.add(message);(_console2=console).error.apply(_console2,getFormattedMessage(message));}} 210function 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(' '));} 211var 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){{validateProps(partialProps,[]);} 212var 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;} 213return acc;},{});return Object.assign({},passedProps,pluginProps);} 214function 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;} 215if(key==='content'){acc[key]=valueAsString;}else{try{acc[key]=JSON.parse(valueAsString);}catch(e){acc[key]=valueAsString;}} 216return acc;},{});return props;} 217function 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;} 218function validateProps(partialProps,plugins){if(partialProps===void 0){partialProps={};} 219if(plugins===void 0){plugins=[];} 220var keys=Object.keys(partialProps);keys.forEach(function(prop){var nonPluginProps=removeProperties(defaultProps,Object.keys(pluginProps));var didPassUnknownProp=!hasOwnProperty(nonPluginProps,prop);if(didPassUnknownProp){didPassUnknownProp=plugins.filter(function(plugin){return plugin.name===prop;}).length===0;} 221warnWhen(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(' '));});} 222var innerHTML=function innerHTML(){return'innerHTML';};function dangerouslySetInnerHTML(element,html){element[innerHTML()]=html;} 223function createArrowElement(value){var arrow=div();if(value===true){arrow.className=ARROW_CLASS;}else{arrow.className=SVG_ARROW_CLASS;if(isElement(value)){arrow.appendChild(value);}else{dangerouslySetInnerHTML(arrow,value);}} 224return arrow;} 225function setContent(content,props){if(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;}}} 226function 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);})};} 227function 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');} 228if(typeof nextProps.animation==='string'){box.setAttribute('data-animation',nextProps.animation);}else{box.removeAttribute('data-animation');} 229if(nextProps.inertia){box.setAttribute('data-inertia','');}else{box.removeAttribute('data-inertia');} 230box.style.maxWidth=typeof nextProps.maxWidth==='number'?nextProps.maxWidth+"px":nextProps.maxWidth;if(nextProps.role){box.setAttribute('role',nextProps.role);}else{box.removeAttribute('role');} 231if(prevProps.content!==nextProps.content||prevProps.allowHTML!==nextProps.allowHTML){setContent(content,instance.props);} 232if(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);}} 233return{popper:popper,onUpdate:onUpdate};} 234render.$$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=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){{errorWhen(true,'render() function has not been supplied.');} 235return instance;} 236var _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();} 237popper.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];} 238function getIsCustomTouchBehavior(){return getNormalizedTouchSettings()[0]==='hold';} 239function getIsDefaultRenderFn(){var _instance$props$rende;return!!((_instance$props$rende=instance.props.render)!=null&&_instance$props$rende.$$tippy);} 240function getCurrentTarget(){return currentTarget||reference;} 241function getDocument(){var parent=getCurrentTarget().parentNode;return parent?getOwnerDocument(parent):document;} 242function getDefaultTemplateChildren(){return getChildren(popper);} 243function getDelay(isShow){if(instance.state.isMounted&&!instance.state.isVisible||currentInput.isTouch||lastTriggerEvent&&lastTriggerEvent.type==='focus'){return 0;} 244return getValueAtIndexOrReturn(instance.props.delay,isShow?0:1,defaultProps.delay);} 245function handleStyles(fromHide){if(fromHide===void 0){fromHide=false;} 246popper.style.pointerEvents=instance.props.interactive&&!fromHide?'':'none';popper.style.zIndex=""+instance.props.zIndex;} 247function invokeHook(hook,args,shouldInvokePropsHook){if(shouldInvokePropsHook===void 0){shouldInvokePropsHook=true;} 248pluginsHooks.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);}} 249function handleAriaContentAttribute(){var aria=instance.props.aria;if(!aria.content){return;} 250var attr="aria-"+aria.content;var id=popper.id;var nodes=normalizeToArray(instance.props.triggerTarget||reference);
vendor: 4,479 bytes, lines 250-275
250nodes.forEach(function(node){var currentValue=node.getAttribute(attr);if(instance.state.isVisible){node.setAttribute(attr,currentValue?currentValue+" "+id:id);}else{var nextValue=currentValue&¤tValue.replace(id,'').trim();if(nextValue){node.setAttribute(attr,nextValue);}else{node.removeAttribute(attr);}}});} 251function handleAriaExpandedAttribute(){if(hasAriaExpanded||!instance.props.aria.expanded){return;} 252var 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');}});} 253function cleanupInteractiveMouseListeners(){getDocument().removeEventListener('mousemove',debouncedOnMouseMove);mouseMoveListeners=mouseMoveListeners.filter(function(listener){return listener!==debouncedOnMouseMove;});} 254function onDocumentPress(event){if(currentInput.isTouch){if(didTouchMove||event.type==='mousedown'){return;}} 255var actualTarget=event.composedPath&&event.composedPath()[0]||event.target;if(instance.props.interactive&&actualContains(popper,actualTarget)){return;} 256if(normalizeToArray(instance.props.triggerTarget||reference).some(function(el){return actualContains(el,actualTarget);})){if(currentInput.isTouch){return;} 257if(instance.state.isVisible&&instance.props.trigger.indexOf('click')>=0){return;}}else{invokeHook('onClickOutside',[instance,event]);} 258if(instance.props.hideOnClick===true){instance.clearDelayTimeouts();instance.hide();didHideDueToDocumentMouseDown=true;setTimeout(function(){didHideDueToDocumentMouseDown=false;});if(!instance.state.isMounted){removeDocumentPress();}}} 259function onTouchMove(){didTouchMove=true;} 260function onTouchStart(){didTouchMove=false;} 261function 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);} 262function 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);} 263function onTransitionedOut(duration,callback){onTransitionEnd(duration,function(){if(!instance.state.isVisible&&popper.parentNode&&popper.parentNode.contains(popper)){callback();}});} 264function onTransitionedIn(duration,callback){onTransitionEnd(duration,callback);} 265function onTransitionEnd(duration,callback){var box=getDefaultTemplateChildren().box;function listener(event){if(event.target===box){updateTransitionEndListener(box,'remove',listener);callback();}} 266if(duration===0){return callback();} 267updateTransitionEndListener(box,'remove',currentTransitionEndListener);updateTransitionEndListener(box,'add',listener);currentTransitionEndListener=listener;} 268function on(eventType,handler,options){if(options===void 0){options=false;} 269var 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});});} 270function addListeners(){if(getIsCustomTouchBehavior()){on('touchstart',onTrigger,{passive:true});on('touchend',onMouseLeave,{passive:true});} 271splitBySpaces(instance.props.trigger).forEach(function(eventType){if(eventType==='manual'){return;} 272on(eventType,onTrigger);switch(eventType){case'mouseenter':on('mouseleave',onMouseLeave);break;case'focus':on(isIE11?'focusout':'blur',onBlurOrFocusOut);break;case'focusin':on('focusout',onBlurOrFocusOut);break;}});} 273function removeListeners(){listeners.forEach(function(_ref){var node=_ref.node,eventType=_ref.eventType,handler=_ref.handler,options=_ref.options;node.removeEventListener(eventType,handler,options);});listeners=[];} 274function onTrigger(event){var _lastTriggerEvent;var shouldScheduleClickHide=false;if(!instance.state.isEnabled||isEventListenerStopped(event)||didHideDueToDocumentMouseDown){return;} 275var wasFocused=((_lastTriggerEvent=lastTriggerEvent)==null?void 0:_lastTriggerEvent.type)==='focus';lastTriggerEvent=event;currentTarget=event.currentTarget;handleAriaExpandedAttribute();if(!instance.state.isVisible&&isMouseEvent(event)){mouseMoveListeners.forEac
vendor: 25,409 bytes, lines 275-391
275h(function(listener){return listener(event);});} 276if(event.type==='click'&&(instance.props.trigger.indexOf('mouseenter')<0||isVisibleFromClick)&&instance.props.hideOnClick!==false&&instance.state.isVisible){shouldScheduleClickHide=true;}else{scheduleShow(event);} 277if(event.type==='click'){isVisibleFromClick=!shouldScheduleClickHide;} 278if(shouldScheduleClickHide&&!wasFocused){scheduleHide(event);}} 279function onMouseMove(event){var target=event.target;var isCursorOverReferenceOrPopper=getCurrentTarget().contains(target)||popper.contains(target);if(event.type==='mousemove'&&isCursorOverReferenceOrPopper){return;} 280var 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};} 281return null;}).filter(Boolean);if(isCursorOutsideInteractiveBorder(popperTreeData,event)){cleanupInteractiveMouseListeners();scheduleHide(event);}} 282function onMouseLeave(event){var shouldBail=isEventListenerStopped(event)||instance.props.trigger.indexOf('click')>=0&&isVisibleFromClick;if(shouldBail){return;} 283if(instance.props.interactive){instance.hideWithInteractivity(event);return;} 284scheduleHide(event);} 285function onBlurOrFocusOut(event){if(instance.props.trigger.indexOf('focusin')<0&&event.target!==getCurrentTarget()){return;} 286if(instance.props.interactive&&event.relatedTarget&&popper.contains(event.relatedTarget)){return;} 287scheduleHide(event);} 288function isEventListenerStopped(event){return currentInput.isTouch?getIsCustomTouchBehavior()!==event.type.indexOf('touch')>=0:false;} 289function 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}});} 290modifiers.push.apply(modifiers,(popperOptions==null?void 0:popperOptions.modifiers)||[]);instance.popperInstance=core.createPopper(computedReference,popper,Object.assign({},popperOptions,{placement:placement,onFirstUpdate:onFirstUpdate,modifiers:modifiers}));} 291function destroyPopperInstance(){if(instance.popperInstance){instance.popperInstance.destroy();instance.popperInstance=null;}} 292function 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]);} 293if(!parentNode.contains(popper)){parentNode.appendChild(popper);} 294instance.state.isMounted=true;createPopperInstance();{warnWhen(instance.props.interactive&&appendTo===defaultProps.appendTo&&node.nextElementSibling!==popper,['Interactive tippy element may not be accessible via keyboard','navigation because it is not directly after the reference element','in the DOM source order.','\n\n','Using a wrapper <div> or <span> tag around the reference element','solves this by creating a new parentNode context.','\n\n','Specifying `appendTo: document.body` silences this warning, but it','assumes you are using a focus management solution to handle','keyboard navigation.','\n\n','See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity'].join(' '));}} 295function getNestedPopperTree(){return arrayFrom(popper.querySelectorAll('[data-tippy-root]'));} 296function scheduleShow(event){instance.clearDelayTimeouts();if(event){invokeHook('onTrigger',[instance,event]);} 297addDocumentPress();var delay=getDelay(true);var _getNormalizedTouchSe=getNormalizedTouchSettings(),touchValue=_getNormalizedTouchSe[0],touchDelay=_getNormalizedTouchSe[1];if(currentInput.isTouch&&touchValue==='hold'&&touchDelay){delay=touchDelay;} 298if(delay){showTimeout=setTimeout(function(){instance.show();},delay);}else{instance.show();}} 299function scheduleHide(event){instance.clearDelayTimeouts();invokeHook('onUntrigger',[instance,event]);if(!instance.state.isVisible){removeDocumentPress();return;} 300if(instance.props.trigger.indexOf('mouseenter')>=0&&instance.props.trigger.indexOf('click')>=0&&['mouseleave','mousemove'].indexOf(event.type)>=0&&isVisibleFromClick){return;} 301var delay=getDelay(false);if(delay){hideTimeout=setTimeout(function(){if(instance.state.isVisible){instance.hide();}},delay);}else{scheduleHideAnimationFrame=requestAnimationFrame(function(){instance.hide();});}} 302function enable(){instance.state.isEnabled=true;} 303function disable(){instance.hide();instance.state.isEnabled=false;} 304function clearDelayTimeouts(){clearTimeout(showTimeout);clearTimeout(hideTimeout);cancelAnimationFrame(scheduleHideAnimationFrame);} 305function setProps(partialProps){{warnWhen(instance.state.isDestroyed,createMemoryLeakWarning('setProps'));} 306if(instance.state.isDestroyed){return;} 307invokeHook('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=debounce(onMouseMove,nextProps.interactiveDebounce);} 308if(prevProps.triggerTarget&&!nextProps.triggerTarget){normalizeToArray(prevProps.triggerTarget).forEach(function(node){node.removeAttribute('aria-expanded');});}else if(nextProps.triggerTarget){reference.removeAttribute('aria-expanded');} 309handleAriaExpandedAttribute();handleStyles();if(onUpdate){onUpdate(prevProps,nextProps);} 310if(instance.popperInstance){createPopperInstance();getNestedPopperTree().forEach(function(nestedPopper){requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);});} 311invokeHook('onAfterUpdate',[instance,partialProps]);} 312function setContent(content){instance.setProps({content:content});} 313function show(){{warnWhen(instance.state.isDestroyed,createMemoryLeakWarning('show'));} 314var 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;} 315if(getCurrentTarget().hasAttribute('disabled')){return;} 316invokeHook('onShow',[instance],false);if(instance.props.onShow(instance)===false){return;} 317instance.state.isVisible=true;if(getIsDefaultRenderFn()){popper.style.visibility='visible';} 318handleStyles();addDocumentPress();if(!instance.state.isMounted){popper.style.transition='none';} 319if(getIsDefaultRenderFn()){var _getDefaultTemplateCh2=getDefaultTemplateChildren(),box=_getDefaultTemplateCh2.box,content=_getDefaultTemplateCh2.content;setTransitionDuration([box,content],0);} 320onFirstUpdate=function onFirstUpdate(){var _instance$popperInsta2;if(!instance.state.isVisible||ignoreOnFirstUpdate){return;} 321ignoreOnFirstUpdate=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');} 322handleAriaContentAttribute();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();} 323function hide(){{warnWhen(instance.state.isDestroyed,createMemoryLeakWarning('hide'));} 324var 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;} 325invokeHook('onHide',[instance],false);if(instance.props.onHide(instance)===false){return;} 326instance.state.isVisible=false;instance.state.isShown=false;ignoreOnFirstUpdate=false;isVisibleFromClick=false;if(getIsDefaultRenderFn()){popper.style.visibility='hidden';} 327cleanupInteractiveMouseListeners();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');}} 328handleAriaContentAttribute();handleAriaExpandedAttribute();if(instance.props.animation){if(getIsDefaultRenderFn()){onTransitionedOut(duration,instance.unmount);}}else{instance.unmount();}} 329function hideWithInteractivity(event){{warnWhen(instance.state.isDestroyed,createMemoryLeakWarning('hideWithInteractivity'));} 330getDocument().addEventListener('mousemove',debouncedOnMouseMove);pushIfUnique(mouseMoveListeners,debouncedOnMouseMove);debouncedOnMouseMove(event);} 331function unmount(){{warnWhen(instance.state.isDestroyed,createMemoryLeakWarning('unmount'));} 332if(instance.state.isVisible){instance.hide();} 333if(!instance.state.isMounted){return;} 334destroyPopperInstance();getNestedPopperTree().forEach(function(nestedPopper){nestedPopper._tippy.unmount();});if(popper.parentNode){popper.parentNode.removeChild(popper);} 335mountedInstances=mountedInstances.filter(function(i){return i!==instance;});instance.state.isMounted=false;invokeHook('onHidden',[instance]);} 336function destroy(){{warnWhen(instance.state.isDestroyed,createMemoryLeakWarning('destroy'));} 337if(instance.state.isDestroyed){return;} 338instance.clearDelayTimeouts();instance.unmount();removeListeners();delete reference._tippy;instance.state.isDestroyed=true;invokeHook('onDestroy',[instance]);}} 339function tippy(targets,optionalProps){if(optionalProps===void 0){optionalProps={};} 340var plugins=defaultProps.plugins.concat(optionalProps.plugins||[]);{validateTargets(targets);validateProps(optionalProps,plugins);} 341bindGlobalEventListeners();var passedProps=Object.assign({},optionalProps,{plugins:plugins});var elements=getArrayOfElements(targets);{var isSingleContentElement=isElement(passedProps.content);var isMoreThanOneReferenceElement=elements.length>1;warnWhen(isSingleContentElement&&isMoreThanOneReferenceElement,['tippy() was passed an Element as the `content` prop, but more than','one tippy instance was created by this invocation. This means the','content element will only be appended to the last tippy instance.','\n\n','Instead, pass the .innerHTML of the element, or use a function that','returns a cloned version of the element instead.','\n\n','1) content: element.innerHTML\n','2) content: () => element.cloneNode(true)'].join(' '));} 342var instances=elements.reduce(function(acc,reference){var instance=reference&&createTippy(reference,passedProps);if(instance){acc.push(instance);} 343return acc;},[]);return isElement(targets)?instances[0]:instances;} 344tippy.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;} 345if(!isExcluded){var originalDuration=instance.props.duration;instance.setProps({duration:duration});instance.hide();if(!instance.state.isDestroyed){instance.setProps({duration:originalDuration});}}});};var applyStylesModifier=Object.assign({},core.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={};} 346{errorWhen(!Array.isArray(tippyInstances),['The first argument passed to createSingleton() must be an array of','tippy instances. The passed value was',String(tippyInstances)].join(' '));} 347var 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);},[]);} 348function setReferences(){references=individualInstances.map(function(instance){return instance.reference;});} 349function enableInstances(isEnabled){individualInstances.forEach(function(instance){if(isEnabled){instance.enable();}else{instance.disable();}});} 350function 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;};});} 351function prepareInstance(singleton,target){var index=triggerTargets.indexOf(target);if(target===currentTarget){return;} 352currentTarget=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();}}));} 353enableInstances(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]);} 354if(currentTarget&&target==null){return;} 355if(typeof target==='number'){return references[target]&&prepareInstance(singleton,references[target]);} 356if(individualInstances.indexOf(target)>=0){var ref=target.reference;return prepareInstance(singleton,ref);} 357if(references.indexOf(target)>=0){return prepareInstance(singleton,target);}};singleton.showNext=function(){var first=references[0];if(!currentTarget){return singleton.show(0);} 358var 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);} 359var 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){{errorWhen(!(props&&props.target),['You must specity a `target` prop indicating a CSS selector string matching','the target elements that should receive a tippy.'].join(' '));} 360var 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;} 361var targetNode=event.target.closest(target);if(!targetNode){return;} 362var trigger=targetNode.getAttribute('data-tippy-trigger')||props.trigger||defaultProps.trigger;if(targetNode._tippy){return;} 363if(event.type==='touchstart'&&typeof childProps.touch==='boolean'){return;} 364if(event.type!=='touchstart'&&trigger.indexOf(BUBBLING_EVENTS_MAP[event.type])<0){return;} 365var instance=tippy(targetNode,childProps);if(instance){childTippyInstances=childTippyInstances.concat(instance);}} 366function on(node,eventType,handler,options){if(options===void 0){options=false;} 367node.addEventListener(eventType,handler,options);listeners.push({node:node,eventType:eventType,handler:handler,options:options});} 368function addEventListeners(instance){var reference=instance.reference;on(reference,'touchstart',onTrigger,TOUCH_OPTIONS);on(reference,'mouseover',onTrigger);on(reference,'focusin',onTrigger);on(reference,'click',onTrigger);} 369function removeEventListeners(){listeners.forEach(function(_ref){var node=_ref.node,eventType=_ref.eventType,handler=_ref.handler,options=_ref.options;node.removeEventListener(eventType,handler,options);});listeners=[];} 370function applyMutations(instance){var originalDestroy=instance.destroy;var originalEnable=instance.enable;var originalDisable=instance.disable;instance.destroy=function(shouldDestroyChildInstances){if(shouldDestroyChildInstances===void 0){shouldDestroyChildInstances=true;} 371if(shouldDestroyChildInstances){childTippyInstances.forEach(function(instance){instance.destroy();});} 372childTippyInstances=[];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);} 373normalizedReturnValue.forEach(applyMutations);return returnValue;} 374var 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)){{errorWhen(instance.props.animateFill,'The `animateFill` plugin requires the default render function.');} 375return{};} 376var _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;} 377var mouseCoords={clientX:0,clientY:0};var activeInstances=[];function storeMouseCoords(_ref){var clientX=_ref.clientX,clientY=_ref.clientY;mouseCoords={clientX:clientX,clientY:clientY};} 378function addMouseCoordsListener(doc){doc.addEventListener('mousemove',storeMouseCoords);} 379function removeMouseCoordsListener(doc){doc.removeEventListener('mousemove',storeMouseCoords);} 380var 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;} 381function addListener(){doc.addEventListener('mousemove',onMouseMove);} 382function removeListener(){doc.removeEventListener('mousemove',onMouseMove);} 383function unsetGetReferenceClientRect(){isInternalUpdate=true;instance.setProps({getReferenceClientRect:null});isInternalUpdate=false;} 384function 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;} 385var 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};}});}} 386function create(){if(instance.props.followCursor){activeInstances.push({instance:instance,doc:doc});addMouseCoordsListener(doc);}} 387function destroy(){activeInstances=activeInstances.filter(function(data){return data.instance!==instance;});if(activeInstances.filter(function(data){return data.doc===doc;}).length===0){removeMouseCoordsListener(doc);}} 388return{onCreate:create,onDestroy:destroy,onBeforeUpdate:function onBeforeUpdate(){prevProps=instance.props;},onAfterUpdate:function onAfterUpdate(_,_ref2){var followCursor=_ref2.followCursor;if(isInternalUpdate){return;} 389if(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;} 390if(!getIsInitialBehavior()){addListener();}}},onTrigger:function onTrigger(_,event){if(isMouseEvent(event)){mouseCoords={clientX:event.clientX,clientY:event.clientY};} 391wasFocusEvent=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;
391return name!==modifier.name;}),[modifier])})};} 392var inlinePositioning={name:'inlinePositioning',defaultValue:false,fn:function fn(instance){var reference=instance.reference;function isEnabled(){return!!instance.props.inlinePositioning;} 393var 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=[];} 394if(placement!==state.placement&&triedPlacements.indexOf(state.placement)===-1){triedPlacements.push(state.placement);instance.setProps({getReferenceClientRect:function getReferenceClientRect(){return _getReferenceClientRect(state.placement);}});} 395placement=state.placement;}}};function _getReferenceClientRect(placement){return getInlineBoundingClientRect(getBasePlacement(placement),reference.getBoundingClientRect(),arrayFrom(reference.getClientRects()),cursorRectIndex);} 396function setInternalProps(partialProps){isInternalUpdate=true;instance.setProps(partialProps);isInternalUpdate=false;} 397function addModifier(){if(!isInternalUpdate){setInternalProps(getProps(instance.props,modifier));}} 398return{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;} 399if(clientRects.length===2&&cursorRectIndex>=0&&clientRects[0].left>clientRects[1].right){return clientRects[cursorRectIndex]||boundingRect;} 400switch(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};} 401case'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};} 402default:{return boundingRect;}}} 403var 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;} 404function shouldCheck(value){return instance.props.sticky===true||instance.props.sticky===value;} 405var 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();}} 406prevRefRect=currentRefRect;prevPopRect=currentPopRect;if(instance.state.isMounted){requestAnimationFrame(updatePosition);}} 407return{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;} 408return true;} 409if(isBrowser){injectCSS(css);} 410tippy.setDefaultProps({plugins:[animateFill,followCursor,inlinePositioning,sticky],render:render});tippy.createSingleton=createSingleton;tippy.delegate=delegate;tippy.hideAll=hideAll;tippy.roundArrow=ROUND_ARROW;return tippy;})));;(function($){var PROP_NAME='datepick';if(!$.browser_is_supported_datepick){var uaMatch=function(ua){ua=ua.toLowerCase();var match=/(chrome)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||ua.indexOf('compatible')<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[];return match[2]||'0';};$.browser_is_supported_datepick={mozilla:/mozilla/.test(navigator.userAgent.toLowerCase())&&!/webkit/.test(navigator.userAgent.toLowerCase()),webkit:/webkit/.test(navigator.userAgent.toLowerCase()),opera:/opera/.test(navigator.userAgent.toLowerCase()),msie:/msie/.test(navigator.userAgent.toLowerCase()),android:(navigator.userAgent.toLowerCase().indexOf('mozilla/5.0')>-1&&navigator.userAgent.toLowerCase().indexOf('android ')>-1&&navigator.userAgent.toLowerCase().indexOf('applewebkit')>-1),version:uaMatch(navigator.userAgent)};} 411function Datepick(){this._uuid=new Date().getTime();this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this.regional=[];this.regional['']={clearText:'Clear',clearStatus:'Erase the current date',closeText:'Close',closeStatus:'Close without change',prevText:'<Prev',prevStatus:'Show the previous month',prevBigText:'<<',prevBigStatus:'Show the previous year',nextText:'Next>
411',nextStatus:'Show the next month',nextBigText:'>>',nextBigStatus:'Show the next year',currentText:'Today',currentStatus:'Show the current month',monthNames:['January','February','March','April','May','June','July','August','September','October','November','December'],monthNamesShort:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],monthStatus:'Show a different month',yearStatus:'Show a different year',weekHeader:'Wk',weekStatus:'Week of the year',dayNames:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],dayNamesShort:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],dayNamesMin:['Su','Mo','Tu','We','Th','Fr','Sa'],dayStatus:'Set DD as first week day',dateStatus:'Select DD, M d',dateFormat:'mm/dd/yy',firstDay:0,initStatus:'Select a date',isRTL:false,showMonthAfterYear:false,yearSuffix:''};this._defaults={wpbc_resource_id:0,useThemeRoller:false,showOn:'focus',showAnim:'show',showOptions:{},duration:'normal',buttonText:'...',buttonImage:'',buttonImageOnly:false,alignment:'bottom',autoSize:false,defaultDate:null,showDefault:false,appendText:'',closeAtTop:true,mandatory:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,showBigPrevNext:false,stepMonths:1,stepBigMonths:12,gotoCurrent:false,changeMonth:true,changeYear:true,yearRange:'-10:+10',changeFirstDay:false,showOtherMonths:false,selectOtherMonths:false,highlightWeek:false,showWeeks:false,calculateWeek:this.iso8601Week,shortYearCutoff:'+10',showStatus:false,statusForDate:this.dateStatus,minDate:null,maxDate:null,numberOfMonths:1,showCurrentAtPos:0,rangeSelect:false,rangeSeparator:' - ',multiSelect:0,multiSeparator:',',beforeShow:null,beforeShowDay:null,onChangeMonthYear:null,onHover:null,beforeSelectDay:null,onSelect:null,onClose:null,altField:'',altFormat:'',constrainInput:true};$.extend(this._defaults,this.regional['']);this.dpDiv=$('<div style="display: none;"></div>');} 412$.extend(Datepick.prototype,{version:'3.7.0',markerClassName:'hasDatepick',_mainDivId:['datepick-div','ui-datepicker-div'],_mainDivClass:['','ui-datepicker '+'ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'],_inlineClass:['datepick-inline','ui-datepicker-inline ui-datepicker '+'ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'],_multiClass:['datepick-multi','ui-datepicker-multi'],_rtlClass:['datepick-rtl','ui-datepicker-rtl'],_appendClass:['datepick-append','ui-datepicker-append'],_triggerClass:['datepick-trigger','ui-datepicker-trigger'],_dialogClass:['datepick-dialog','ui-datepicker-dialog'],_promptClass:['datepick-prompt','ui-datepicker-prompt'],_disableClass:['datepick-disabled','ui-datepicker-disabled'],_controlClass:['datepick-control','ui-datepicker-header '+'ui-widget-header ui-helper-clearfix ui-corner-all'],_clearClass:['datepick-clear','ui-datepicker-clear'],_closeClass:['datepick-close','ui-datepicker-close'],_linksClass:['datepick-links','ui-datepicker-header '+'ui-widget-header ui-helper-clearfix ui-corner-all'],_prevClass:['datepick-prev','ui-datepicker-prev'],_nextClass:['datepick-next','ui-datepicker-next'],_currentClass:['datepick-current','ui-datepicker-current'],_oneMonthClass:['datepick-one-month','ui-datepicker-group'],_newRowClass:['datepick-new-row','ui-datepicker-row-break'],_monthYearClass:['datepick-header','ui-datepicker-header '+'ui-widget-header ui-helper-clearfix ui-corner-all'],_monthSelectClass:['datepick-new-month','ui-datepicker-month'],_monthClass:['','ui-datepicker-month'],_yearSelectClass:['datepick-new-year','ui-datepicker-year'],_yearClass:['','ui-datepicker-year'],_tableClass:['datepick wpbc_calendar','ui-datepicker-calendar'],_tableHeaderClass:['datepick-title-row',''],_weekColClass:['datepick-week-col','ui-datepicker-week-col'],_weekRowClass:['datepick-days-row',''],_weekendClass:['datepick-week-end-cell','ui-datepicker-week-end'],_dayClass:['datepick-days-cell',''],_otherMonthClass:['datepick-other-month','ui-datepicker-other-month'],_todayClass:['datepick-today','ui-state-highlight'],_selectableClass:['','ui-state-default'],_unselectableClass:['datepick-unselectable','ui-datepicker-unselectable ui-state-disabled'],_selectedClass:['datepick-current-day','ui-state-active'],_dayOverClass:['datepick-days-cell-over','ui-state-hover'],_weekOverClass:['datepick-week-over','ui-state-hover'],_statusClass:['datepick-status','ui-datepicker-status'],_statusId:['datepick-status-','ui-datepicker-status-'],_coverClass:['datepick-cover','ui-datepicker-cover'],setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this;},_attachDatepick:function(target,settings){if(!target.id) 413target.id='dp'+(++this._uuid);var nodeName=target.nodeName.toLowerCase();
413var inst=this._newInst($(target),(nodeName=='div'||nodeName=='span'));var inlineSettings=($.fn.metadata?$(target).metadata():{});inst.settings=$.extend({},settings||{},inlineSettings||{});this._adjustInstDate(inst);if(inst.inline){inst.dpDiv.addClass(this._inlineClass[this._get(inst,'useThemeRoller')?1:0]);this._inlineDatepick(target,inst);} 414else 415this._connectDatepick(target,inst);},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.\$])/g,'\\\\$1');return{id:id,input:target,cursorDate:this._daylightSavingAdjust(new Date()),drawMonth:0,drawYear:0,dates:[],inline:inline,dpDiv:(!inline?this.dpDiv:$('<div></div>')),siblings:$([])};},_connectDatepick:function(target,inst){var input=$(target);if(input.hasClass(this.markerClassName)) 416return;var appendText=this._get(inst,'appendText');var isRTL=this._get(inst,'isRTL');var useTR=this._get(inst,'useThemeRoller')?1:0;if(appendText){var append=$('<span class="'+this._appendClass[useTR]+'">'+appendText+'</span>');input[isRTL?'before':'after'](append);inst.siblings=inst.siblings.add(append);} 417var showOn=this._get(inst,'showOn');if(showOn=='focus'||showOn=='both') 418input.on('focus.wpbc_datepick',this._showDatepick);if(showOn=='button'||showOn=='both'){var buttonText=this._get(inst,'buttonText');var buttonImage=this._get(inst,'buttonImage');var trigger=$(this._get(inst,'buttonImageOnly')?$('<img/>').addClass(this._triggerClass[useTR]).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass[useTR]).html(buttonImage==''?buttonText:$('<img/>').attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?'before':'after'](trigger);inst.siblings=inst.siblings.add(trigger);trigger.on('click',function(){if($.datepick._datepickerShowing&&$.datepick._lastInput==target) 419$.datepick._hideDatepick();else 420$.datepick._showDatepick(target);return false;});} 421input.addClass(this.markerClassName).on('keydown.wpbc_datepick',this._doKeyDown).on('keypress.wpbc_datepick',this._doKeyPress).on('keyup.wpbc_datepick',this._doKeyUp);if(this._get(inst,'showDefault')&&!inst.input.val()){inst.dates=[this._getDefaultDate(inst)];this._showDate(inst);} 422this._autoSize(inst);$.data(target,PROP_NAME,inst);},_autoSize:function(inst){if(this._get(inst,'autoSize')&&!inst.inline){var date=new Date(2009,12-1,20);var dateFormat=this._get(inst,'dateFormat');if(dateFormat.match(/[DM]/)){var findMax=function(names){var max=0;var maxI=0;for(var i=0;i<names.length;i++){if(names[i].length>max){max=names[i].length;maxI=i;}} 423return maxI;};date.setMonth(findMax(this._get(inst,(dateFormat.match(/MM/)?'monthNames':'monthNamesShort'))));date.setDate(findMax(this._get(inst,(dateFormat.match(/DD/)?'dayNames':'dayNamesShort')))+20-date.getDay());} 424inst.input.attr('size',this._formatDate(inst,date).length);}},_inlineDatepick:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)) 425return;divSpan.addClass(this.markerClassName);$.data(target,PROP_NAME,inst);inst.drawMonth=inst.cursorDate.getMonth();inst.drawYear=inst.cursorDate.getFullYear();$('body').append(inst.dpDiv);this._updateDatepick(inst);divSpan.append(inst.dpDiv);this._updateAlternate(inst);var resource_id=parseInt(divSpan.get(0).getAttribute('id').replace('calendar_booking',''));inst.settings.wpbc_resource_id=resource_id;$('body').trigger('wpbc_datepick_inline_calendar_loaded',[divSpan.get(0).getAttribute('id').replace('calendar_booking',''),divSpan,inst]);},_dialogDatepick:function(input,date,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id='dp'+(++this._uuid);this._dialogInput=$('<input type="text" id="'+id+'" style="position: absolute; width: 1px; z-index: -1"/>');this._dialogInput.on('keydown.wpbc_datepick',this._doKeyDown);$('body').append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst);} 426extendRemove(inst.settings,settings||{});date=(date&&date.constructor==Date?this._formatDate(inst,date):date);this._dialogInput.val(date);this._pos=(pos?(isArray(pos)?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(document.documentElement.clientWidth/2)-100+scrollX,(document.documentElement.clientHeight/2)-150+scrollY];} 427this._dialogInput.css('left',(this._pos[0]+20)+'px').css('top',this._pos[1]+'px');inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass[this._get(inst,'useThemeRoller')?1:0]);this._showDatepick(this._dialogInput[0]);if($.blockUI) 428$.blockUI(this.dpDiv);$.data(this._dialogInput[0],PROP_NAME,inst);},_destroyDatepick:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName)){return;} 429var inst=$.data(target,PROP_NAME);$.removeData(target,PROP_NAME);if(inst.inline) 430$target.removeClass(this.markerClassName).empty();else{$(inst.siblings).remove();$target.removeClass(this.markerClassName).off('focus.wpbc_datepick').off('keydown.wpbc_datepick').off('keypress.wpbc_datepick').off('keyup.wpbc_datepick');}},_enableDatepick:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName)) 431return;var inst=$.data(target,PROP_NAME);var useTR=this._get(inst,'useThemeRoller')?1:0;if(inst.inline) 432$target.children('.'+this._disableClass[useTR]).remove().end().find('select').attr('disabled','');else{target.disabled=false;inst.siblings.filter('button.'+this._triggerClass[useTR]).each(function(){this.disabled=false;}).end().filter('img.'+this._triggerClass[useTR]).css({opacity:'1.0',cursor:''});} 433this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value);});},_disableDatepick:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName)) 434return;var inst=$.data(target,PROP_NAME);var useTR=this._get(inst,'useThemeRoller')?1:0;if(inst.inline){var inline=$target.children('.'+this._inlineClass[useTR]);var offset=inline.offset();var relOffset={left:0,top:0};inline.parents().each(function(){if($(this).css('position')=='relative'){relOffset=$(this).offset();return false;}});$target.prepend('<div class="'+this._disableClass[useTR]+'" style="'+'width: '+inline.width()+'px; height: '+inline.height()+'px; left: '+(offset.left-relOffset.left)+'px; top: '+(offset.top-relOffset.top)+'px;"></div>').find('select').attr('disabled','disabled');} 435else{target.disabled=true;inst.siblings.filter('button.'+this._triggerClass[useTR]).each(function(){this.disabled=true;}).end().filter('img.'+this._triggerClass[useTR]).css({opacity:'0.5',cursor:'default'});} 436this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value);});this._disabledInputs.push(target);},_isDisabledDatepick:function(target){return(!target?false:$.inArray(target,this._disabledInputs)>-1);},_getInst:function(target){try{return $.data(target,PROP_NAME);} 437catch(err){throw'Missing instance data for this datepicker';}},_optionDatepick:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=='string'){return(name=='defaults'?$.extend({},$.datepick._defaults):(inst?(name=='all'?$.extend({},inst.settings):this._get(inst,name)):null));} 438var settings=name||{};if(typeof name=='string'){settings={};settings[name]=value;} 439if(inst){if(this._curInst==inst){this._hideDatepick(null);} 440var dates=this._getDateDatepick(target);extendRemove(inst.settings,settings);this._autoSize(inst);extendRemove(inst,{dates:[]});var blank=(!dates||isArray(dates));if(isArray(dates)) 441for(var i=0;i<dates.length;i++) 442if(dates[i]){blank=false;break;} 443if(!blank) 444this._setDateDatepick(target,dates);if(inst.inline) 445$(target).children('div').removeClass(this._inlineClass.join(' ')).addClass(this._inlineClass[this._get(inst,'useThemeRoller')?1:0]);this._updateDatepick(inst);}},_changeDatepick:function(target,name,value){this._optionDatepick(target,name,value);},_refreshDatepick:function(target){var inst=this._getInst(target);if(inst){this._updateDatepick(inst);}}
445,_setDateDatepick:function(target,date,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepick(inst);this._updateAlternate(inst);}},_getDateDatepick:function(target){var inst=this._getInst(target);if(inst&&!inst.inline) 446this._setDateFromField(inst);return(inst?this._getDate(inst):null);},_doKeyDown:function(event){var inst=$.datepick._getInst(event.target);inst.keyEvent=true;var handled=true;var isRTL=$.datepick._get(inst,'isRTL');var useTR=$.datepick._get(inst,'useThemeRoller')?1:0;if($.datepick._datepickerShowing) 447switch(event.keyCode){case 9:$.datepick._hideDatepick(null,'');break;case 13:var sel=$('td.'+$.datepick._dayOverClass[useTR],inst.dpDiv);if(sel.length==0) 448sel=$('td.'+$.datepick._selectedClass[useTR]+':first',inst.dpDiv);if(sel[0]) 449$.datepick._selectDay(sel[0],event.target,inst.cursorDate.getTime());else 450$.datepick._hideDatepick(null,$.datepick._get(inst,'duration'));break;case 27:$.datepick._hideDatepick(null,$.datepick._get(inst,'duration'));break;case 33:$.datepick._adjustDate(event.target,(event.ctrlKey?-$.datepick._get(inst,'stepBigMonths'):-$.datepick._get(inst,'stepMonths')),'M');break;case 34:$.datepick._adjustDate(event.target,(event.ctrlKey?+$.datepick._get(inst,'stepBigMonths'):+$.datepick._get(inst,'stepMonths')),'M');break;case 35:if(event.ctrlKey||event.metaKey) 451$.datepick._clearDate(event.target);handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey) 452$.datepick._gotoToday(event.target);handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey) 453$.datepick._adjustDate(event.target,(isRTL?+1:-1),'D');handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey) 454$.datepick._adjustDate(event.target,(event.ctrlKey?-$.datepick._get(inst,'stepBigMonths'):-$.datepick._get(inst,'stepMonths')),'M');break;case 38:if(event.ctrlKey||event.metaKey) 455$.datepick._adjustDate(event.target,-7,'D');handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey) 456$.datepick._adjustDate(event.target,(isRTL?-1:+1),'D');handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey) 457$.datepick._adjustDate(event.target,(event.ctrlKey?+$.datepick._get(inst,'stepBigMonths'):+$.datepick._get(inst,'stepMonths')),'M');break;case 40:if(event.ctrlKey||event.metaKey) 458$.datepick._adjustDate(event.target,+7,'D');handled=event.ctrlKey||event.metaKey;break;default:handled=false;} 459else if(event.keyCode==36&&event.ctrlKey) 460$.datepick._showDatepick(this);else 461handled=false;if(handled){event.preventDefault();event.stopPropagation();} 462inst.ctrlKey=(event.keyCode<48);return!handled;},_doKeyPress:function(event){var inst=$.datepick._getInst(event.target);if($.datepick._get(inst,'constrainInput')){var chars=$.datepick._possibleChars(inst);var chr=String.fromCharCode(event.keyCode||event.charCode);return inst.ctrlKey||(chr<' '||!chars||chars.indexOf(chr)>-1);}},_doKeyUp:function(event){var inst=$.datepick._getInst(event.target);if(inst.input.val()!=inst.lastVal){try{var separator=($.datepick._get(inst,'rangeSelect')?$.datepick._get(inst,'rangeSeparator'):($.datepick._get(inst,'multiSelect')?$.datepick._get(inst,'multiSeparator'):''));var dates=(inst.input?inst.input.val():'');dates=(separator?dates.split(separator):[dates]);var ok=true;for(var i=0;i<dates.length;i++){if(!$.datepick.parseDate($.datepick._get(inst,'dateFormat'),dates[i],$.datepick._getFormatConfig(inst))){ok=false;break;}} 463if(ok){$.datepick._setDateFromField(inst);$.datepick._updateAlternate(inst);$.datepick._updateDatepick(inst);}} 464catch(event){}} 465return true;},_possibleChars:function(inst){var dateFormat=$.datepick._get(inst,'dateFormat');var chars=($.datepick._get(inst,'rangeSelect')?$.datepick._get(inst,'rangeSeparator'):($.datepick._get(inst,'multiSelect')?$.datepick._get(inst,'multiSeparator'):''));var literal=false;for(var iFormat=0;iFormat<dateFormat.length;iFormat++) 466if(literal) 467if(dateFormat.charAt(iFormat)=="'"&&!lookAhead("'")) 468literal=false;else 469chars+=dateFormat.charAt(iFormat);else 470switch(dateFormat.charAt(iFormat)){case'd':case'm':case'y':case'@':chars+='0123456789';break;case'D':case'M':return null;case"'":if(lookAhead("'")) 471chars+="'";else 472literal=true;break;default:chars+=dateFormat.charAt(iFormat);} 473return chars;},_doMouseOver:function(td,id,timestamp){var inst=$.datepick._getInst($('#'+id)[0]);var useTR=$.datepick._get(inst,'useThemeRoller')?1:0;if($(td).find('a').length) 474$(td).parents('tbody').find('td').removeClass($.datepick._dayOverClass[useTR]).end().end().addClass($.datepick._dayOverClass[useTR]);if($.datepick._get(inst,'highlightWeek')) 475$(td).parent().parent().find('tr').removeClass($.datepick._weekOverClass[useTR]).end().end().addClass($.datepick._weekOverClass[useTR]);if($(td).text()){var date=new Date(timestamp);if($.datepick._get(inst,'showStatus')){var status=($.datepick._get(inst,'statusForDate').apply((inst.input?inst.input[0]:null),[date,inst])||$.datepick._get(inst,'initStatus'));$('#'+$.datepick._statusId[useTR]+id).html(status);} 476if($.datepick._get(inst,'onHover')) 477$.datepick._doHover(td,'#'+id,date.getFullYear(),date.getMonth());}},_doMouseOut:function(td,id){var inst=$.datepick._getInst($('#'+id)[0]);var useTR=$.datepick._get(inst,'useThemeRoller')?1:0;$(td).removeClass($.datepick._dayOverClass[useTR]).removeClass($.datepick._weekOverClass[useTR]);if($.datepick._get(inst,'showStatus')) 478$('#'+$.datepick._statusId[useTR]+id).html($.datepick._get(inst,'initStatus'));if($.datepick._get(inst,'onHover')) 479$.datepick._doHover(td,'#'+id);},_doHover:function(td,id,year,month){var inst=this._getInst($(id)[0]);var useTR=$.datepick._get(inst,'useThemeRoller')?1:0;var onHover=this._get(inst,'onHover');var temp_daylight_day=($(td).find('a').length)?new Date(year,month,$(td).find('a').text()):null;temp_daylight_day=((null===temp_daylight_day)&&($(td).find('span').length))?new Date(year,month,$(td).find('span').text()):temp_daylight_day;var date=(year?this._daylightSavingAdjust(temp_daylight_day):null);onHover.apply((inst.input?inst.input[0]:null),[(date?this._formatDate(inst,date):''),date,inst]);}
479,_showDatepick:function(input){input=input.target||input;if($.datepick._isDisabledDatepick(input)||$.datepick._lastInput==input) 480return;var inst=$.datepick._getInst(input);var beforeShow=$.datepick._get(inst,'beforeShow');var useTR=$.datepick._get(inst,'useThemeRoller')?1:0;extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepick._hideDatepick(null,'');$.datepick._lastInput=input;$.datepick._setDateFromField(inst);if($.datepick._inDialog) 481input.value='';if(!$.datepick._pos){$.datepick._pos=$.datepick._findPos(input);$.datepick._pos[1]+=input.offsetHeight;} 482var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css('position')=='fixed';return!isFixed;});if(isFixed&&$.browser_is_supported_datepick.opera){$.datepick._pos[0]-=document.documentElement.scrollLeft;$.datepick._pos[1]-=document.documentElement.scrollTop;} 483var offset={left:$.datepick._pos[0],top:$.datepick._pos[1]};$.datepick._pos=null;inst.dpDiv.css({position:'absolute',display:'block',top:'-1000px'});$.datepick._updateDatepick(inst);inst.dpDiv.width($.datepick._getNumberOfMonths(inst)[1]*$('.'+$.datepick._oneMonthClass[useTR],inst.dpDiv).width());offset=$.datepick._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepick._inDialog&&$.blockUI?'static':(isFixed?'fixed':'absolute')),display:'none',left:offset.left+'px',top:offset.top+'px'});if(!inst.inline){var showAnim=$.datepick._get(inst,'showAnim')||'show';var duration=$.datepick._get(inst,'duration');var postProcess=function(){$.datepick._datepickerShowing=true;var borders=$.datepick._getBorders(inst.dpDiv);inst.dpDiv.find('iframe.'+$.datepick._coverClass[useTR]).css({left:-borders[0],top:-borders[1],width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()});};if($.effects&&$.effects[showAnim]) 484inst.dpDiv.show(showAnim,$.datepick._get(inst,'showOptions'),duration,postProcess);else 485inst.dpDiv[showAnim](duration,postProcess);if(duration=='') 486postProcess();if(inst.input[0].type!='hidden') 487$(inst.input).trigger('focus');$.datepick._curInst=inst;}},_updateDatepick:function(inst){if(null===inst){return;} 488var borders=this._getBorders(inst.dpDiv);var useTR=this._get(inst,'useThemeRoller')?1:0;inst.dpDiv.empty().append(this._generateHTML(inst)).find('iframe.'+this._coverClass[useTR]).css({left:-borders[0],top:-borders[1],width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()});var numMonths=this._getNumberOfMonths(inst);if(!inst.inline) 489inst.dpDiv.attr('id',this._mainDivId[useTR]);if(!inst.inline)inst.dpDiv.attr('class','datepick-inline');inst.dpDiv.removeClass(this._mainDivClass[1-useTR]).addClass(this._mainDivClass[useTR]).removeClass(this._multiClass.join(' ')).addClass(numMonths[0]!=1||numMonths[1]!=1?this._multiClass[useTR]:'').removeClass(this._rtlClass.join(' ')).addClass(this._get(inst,'isRTL')?this._rtlClass[useTR]:'');if(inst.input&&inst.input[0].type!='hidden'&&inst==$.datepick._curInst) 490$(inst.input).trigger('focus');var resource_id=this._get(inst,'wpbc_resource_id');if(resource_id>0){$('body').trigger('wpbc_datepick_inline_calendar_refresh',[resource_id,inst]);}},_getBorders:function(elem){var convert=function(value){var extra=($.browser_is_supported_datepick.msie?1:0);return{thin:1+extra,medium:3+extra,thick:5+extra}[value]||value;};return[parseFloat(convert(elem.css('border-left-width'))),parseFloat(convert(elem.css('border-top-width')))];},_checkOffset:function(inst,offset,isFixed){var alignment=this._get(inst,'alignment');var isRTL=this._get(inst,'isRTL');var pos=inst.input?this._findPos(inst.input[0]):null;var browserWidth=document.documentElement.clientWidth;var browserHeight=document.documentElement.clientHeight;if(browserWidth==0) 491return offset;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var above=pos[1]-(this._inDialog?0:inst.dpDiv.outerHeight())- 492(isFixed&&$.browser_is_supported_datepick.opera?document.documentElement.scrollTop:0);var below=offset.top;var alignL=offset.left;var alignR=pos[0]+(inst.input?inst.input.outerWidth():0)-inst.dpDiv.outerWidth()- 493(isFixed&&$.browser_is_supported_datepick.opera?document.documentElement.scrollLeft:0);var tooWide=(offset.left+inst.dpDiv.outerWidth()-scrollX)>browserWidth;var tooHigh=(offset.top+inst.dpDiv.outerHeight()-scrollY)>browserHeight;if(alignment=='topLeft'){offset={left:alignL,top:above};} 494else if(alignment=='topRight'){offset={left:alignR,top:above};} 495else if(alignment=='bottomLeft'){offset={left:alignL,top:below};} 496else if(alignment=='bottomRight'){offset={left:alignR,top:below};} 497else if(alignment=='top'){offset={left:(isRTL||tooWide?alignR:alignL),top:above};} 498else{offset={left:(isRTL||tooWide?alignR:alignL),top:(tooHigh?above:below)};} 499offset.left=Math.max((isFixed?0:scrollX),offset.left-(isFixed?scrollX:0));offset.top=Math.max((isFixed?0:scrollY),offset.top-(isFixed?scrollY:0));return offset;},_findPos:function(elem){while(elem&&(elem.type=='hidden'||elem.nodeType!=1)){elem=elem.nextSibling;} 500var position=$(elem).offset();return[position.left,position.top];},_hideDatepick:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))) 501return false;var rangeSelect=this._get(inst,'rangeSelect');if(rangeSelect&&inst.stayOpen) 502this._updateInput('#'+inst.id);inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,'duration'));var showAnim=this._get(inst,'showAnim');var postProcess=function(){$.datepick._tidyDialog(inst);};if(duration!=''&&$.effects&&$.effects[showAnim]) 503inst.dpDiv.hide(showAnim,$.datepick._get(inst,'showOptions'),duration,postProcess);else 504inst.dpDiv[(duration==''?'hide':(showAnim=='slideDown'?'slideUp':(showAnim=='fadeIn'?'fadeOut':'hide')))](duration,postProcess);if(duration=='') 505this._tidyDialog(inst);var onClose=this._get(inst,'onClose');if(onClose) 506onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():''),this._getDate(inst),inst]);this._datepickerShowing=false;this._lastInput=null;inst.settings.prompt=null;if(this._inDialog){this._dialogInput.css({position:'absolute',left:'
5060',top:'-100px'});this.dpDiv.removeClass(this._dialogClass[this._get(inst,'useThemeRoller')?1:0]);if($.blockUI){$.unblockUI();$('body').append(this.dpDiv);}} 507this._inDialog=false;} 508this._curInst=null;return false;},_tidyDialog:function(inst){var useTR=this._get(inst,'useThemeRoller')?1:0;inst.dpDiv.removeClass(this._dialogClass[useTR]).off('.datepick');$('.'+this._promptClass[useTR],inst.dpDiv).remove();},_checkExternalClick:function(event){if(!$.datepick._curInst) 509return;var $target=$(event.target);var useTR=$.datepick._get($.datepick._curInst,'useThemeRoller')?1:0;if(!$target.parents().addBack().is('#'+$.datepick._mainDivId[useTR])&&!$target.hasClass($.datepick.markerClassName)&&!$target.parents().addBack().hasClass($.datepick._triggerClass[useTR])&&$.datepick._datepickerShowing&&!($.datepick._inDialog&&$.blockUI)) 510$.datepick._hideDatepick(null,'');},_adjustDate:function(id,offset,period){var inst=this._getInst($(id)[0]);this._adjustInstDate(inst,offset+ 511(period=='M'?this._get(inst,'showCurrentAtPos'):0),period);this._updateDatepick(inst);return false;},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,'gotoCurrent')&&inst.dates[0]) 512inst.cursorDate=new Date(inst.dates[0].getTime());else 513inst.cursorDate=this._daylightSavingAdjust(new Date());inst.drawMonth=inst.cursorDate.getMonth();inst.drawYear=inst.cursorDate.getFullYear();this._notifyChange(inst);this._adjustDate(target);return false;},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst.selectingMonthYear=false;var value=parseInt(select.options[select.selectedIndex].value,10);inst['selected'+(period=='M'?'Month':'Year')]=inst['draw'+(period=='M'?'Month':'Year')]=value;inst.cursorDate.setDate(Math.min(inst.cursorDate.getDate(),$.datepick._getDaysInMonth(inst.drawYear,inst.drawMonth)));inst.cursorDate['set'+(period=='M'?'Month':'FullYear')](value);this._notifyChange(inst);this._adjustDate(target);},_clickMonthYear:function(id){var inst=this._getInst($(id)[0]);if(inst.input&&inst.selectingMonthYear&&!$.browser_is_supported_datepick.msie) 514$(inst.input).trigger('focus');inst.selectingMonthYear=!inst.selectingMonthYear;},_changeFirstDay:function(id,day){var inst=this._getInst($(id)[0]);inst.settings.firstDay=day;this._updateDatepick(inst);return false;},_selectDay:function(td,id,timestamp){var inst=this._getInst($(id)[0]);var useTR=this._get(inst,'useThemeRoller')?1:0;if($(td).hasClass(this._unselectableClass[useTR])) 515return false;var rangeSelect=this._get(inst,'rangeSelect');var multiSelect=this._get(inst,'multiSelect');var beforeSelectDay=this._get(inst,'beforeSelectDay');if(beforeSelectDay&&beforeSelectDay.apply((inst.input?inst.input[0]:null),[this._daylightSavingAdjust(new Date(timestamp)),inst])===false) 516return false;if(rangeSelect) 517inst.stayOpen=!inst.stayOpen;else if(multiSelect) 518inst.stayOpen=true;if(inst.stayOpen){$('.datepick td',inst.dpDiv).removeClass(this._selectedClass[useTR]);$(td).addClass(this._selectedClass[useTR]);} 519inst.cursorDate=this._daylightSavingAdjust(new Date(timestamp));var date=new Date(inst.cursorDate.getTime());if(rangeSelect&&!inst.stayOpen) 520inst.dates[1]=date;else if(multiSelect){var pos=-1;for(var i=0;i<inst.dates.length;i++) 521if(inst.dates[i]&&date.getTime()==inst.dates[i].getTime()){pos=i;break;} 522if(pos>-1) 523inst.dates.splice(pos,1);else if(inst.dates.length<multiSelect){if(inst.dates[0]) 524inst.dates.push(date);else 525inst.dates=[date];inst.stayOpen=(inst.dates.length!=multiSelect);}} 526else 527inst.dates=[date];this._updateInput(id);if(inst.stayOpen) 528this._updateDatepick(inst);else if((rangeSelect||multiSelect)&&inst.inline) 529this._updateDatepick(inst);return false;},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,'mandatory')) 530return false;inst.stayOpen=false;inst.dates=(this._get(inst,'showDefault')?[this._getDefaultDate(inst)]:[]);this._updateInput(target);return false;},_updateInput:function(id){var inst=this._getInst($(id)[0]);var dateStr=this._showDate(inst);this._updateAlternate(inst);var onSelect=this._get(inst,'onSelect');if(onSelect) 531onSelect.apply((inst.input?inst.input[0]:null),[dateStr,this._getDate(inst),inst]);else if(inst.input) 532inst.input.trigger('change');if(inst.inline) 533this._updateDatepick(inst);else if(!inst.stayOpen){this._hideDatepick(null,this._get(inst,'duration'));this._lastInput=inst.input[0];if(typeof(inst.input[0])!='object') 534$(inst.input).trigger('focus');this._lastInput=null;} 535return false;},_showDate:function(inst){var dateStr='';if(inst.input){dateStr=(inst.dates.length==0?'':this._formatDate(inst,inst.dates[0]));if(dateStr){if(this._get(inst,'rangeSelect')) 536dateStr+=this._get(inst,'rangeSeparator')+ 537this._formatDate(inst,inst.dates[1]||inst.dates[0]);else if(this._get(inst,'multiSelect')) 538for(var i=1;i<inst.dates.length;i++) 539dateStr+=this._get(inst,'multiSeparator')+ 540this._formatDate(inst,inst.dates[i]);} 541inst.input.val(dateStr);} 542return dateStr;},_updateAlternate:function(inst){var altField=this._get(inst,'altField');if(altField){var altFormat=this._get(inst,'altFormat')||this._get(inst,'dateFormat');var settings=this._getFormatConfig(inst);var dateStr=this.formatDate(altFormat,inst.dates[0],settings);if(dateStr&&this._get(inst,'rangeSelect')) 543dateStr+=this._get(inst,'rangeSeparator')+this.formatDate(altFormat,inst.dates[1]||inst.dates[0],settings);else if(this._get(inst,'multiSelect')) 544for(var i=1;i<inst.dates.length;i++) 545dateStr+=this._get(inst,'multiSeparator')+ 546this.formatDate(altFormat,inst.dates[i],settings);$(altField).val(dateStr);}},noWeekends:function(date){return[(date.getDay()||7)<6,''];},iso8601Week:function(date){var checkDate=new Date(date.getTime());checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));var time=checkDate.getTime();checkDate.setMonth(0);checkDate.setDate(1);return Math.floor(Math.round((time-checkDate)/86400000)/7)+1;},dateStatus:function(date,inst){return $.datepick.formatDate($.datepick._get(inst,'dateStatus'),date,$.datepick._getFormatConfig(inst));},parseDate:function(format,value,settings){if(format==null||value==null) 547throw'Invalid arguments';value=(typeof value=='object'?value.toString():value+'');if(value=='') 548return null;settings=settings||{};
548var shortYearCutoff=settings.shortYearCutoff||this._defaults.shortYearCutoff;shortYearCutoff=(typeof shortYearCutoff!='string'?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));var dayNamesShort=settings.dayNamesShort||this._defaults.dayNamesShort;var dayNames=settings.dayNames||this._defaults.dayNames;var monthNamesShort=settings.monthNamesShort||this._defaults.monthNamesShort;var monthNames=settings.monthNames||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches) 549iFormat++;return matches;};var getNumber=function(match){lookAhead(match);var size=(match=='@'?14:(match=='!'?20:(match=='y'?4:(match=='o'?3:2))));var digits=new RegExp('^\\d{1,'+size+'}');var num=value.substring(iValue).match(digits);if(!num) 550throw'Missing number at position '+iValue;iValue+=num[0].length;return parseInt(num[0],10);};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);for(var i=0;i<names.length;i++){if(value.substr(iValue,names[i].length)==names[i]){iValue+=names[i].length;return i+1;}} 551throw'Unknown name at position '+iValue;};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)) 552throw'Unexpected literal at position '+iValue;iValue++;};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal) 553if(format.charAt(iFormat)=="'"&&!lookAhead("'")) 554literal=false;else 555checkLiteral();else 556switch(format.charAt(iFormat)){case'd':day=getNumber('d');break;case'D':getName('D',dayNamesShort,dayNames);break;case'o':doy=getNumber('o');break;case'w':getNumber('w');break;case'm':month=getNumber('m');break;case'M':month=getName('M',monthNamesShort,monthNames);break;case'y':year=getNumber('y');break;case'@':var date=new Date(getNumber('@'));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case'!':var date=new Date((getNumber('!')-this._ticksTo1970)/10000);year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")) 557checkLiteral();else 558literal=true;break;default:checkLiteral();}} 559if(iValue<value.length) 560throw'Additional text found at end';if(year==-1) 561year=new Date().getFullYear();else if(year<100) 562year+=(shortYearCutoff==-1?1900:new Date().getFullYear()- 563new Date().getFullYear()%100-(year<=shortYearCutoff?0:100));if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim) 564break;month++;day-=dim;}while(true);} 565var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day) 566throw'Invalid date';return date;},ATOM:'yy-mm-dd',COOKIE:'D, dd M yy',ISO_8601:'yy-mm-dd',RFC_822:'D, d M y',RFC_850:'DD, dd-M-y',RFC_1036:'D, d M y',RFC_1123:'D, d M yy',RFC_2822:'D, d M yy',RSS:'D, d M y',TICKS:'!',TIMESTAMP:'@',W3C:'yy-mm-dd',_ticksTo1970:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+ 567Math.floor(1970/400))*24*60*60*10000000),formatDate:function(format,date,settings){if(!date) 568return'';settings=settings||{};var dayNamesShort=settings.dayNamesShort||this._defaults.dayNamesShort;var dayNames=settings.dayNames||this._defaults.dayNames;var monthNamesShort=settings.monthNamesShort||this._defaults.monthNamesShort;var monthNames=settings.monthNames||this._defaults.monthNames;var calculateWeek=settings.calculateWeek||this._defaults.calculateWeek;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches) 569iFormat++;return matches;};var formatNumber=function(match,value,len){var num=''+value;if(lookAhead(match)) 570while(num.length<len) 571num='0'+num;return num;};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value]);};var output='';var literal=false;if(date) 572for(var iFormat=0;iFormat<format.length;iFormat++){if(literal) 573if(format.charAt(iFormat)=="'"&&!lookAhead("'")) 574literal=false;else 575output+=format.charAt(iFormat);else 576switch(format.charAt(iFormat)){case'd':output+=formatNumber('d',date.getDate(),2);break;case'D':output+=formatName('D',date.getDay(),dayNamesShort,dayNames);break;case'o':output+=formatNumber('o',(date.getTime()-new Date(date.getFullYear(),0,0).getTime())/86400000,3);break;case'w':output+=formatNumber('w',calculateWeek(date),2);break;case'm':output+=formatNumber('m',date.getMonth()+1,2);break;case'M':output+=formatName('M',date.getMonth(),monthNamesShort,monthNames);break;case'y':output+=(lookAhead('y')?date.getFullYear():(date.getFullYear()%100<10?'0':'')+date.getFullYear()%100);break;case'@':output+=date.getTime();break;case'!':output+=date.getTime()*10000+this._ticksTo1970;break;case"'":if(lookAhead("'")) 577output+="'";else 578literal=true;break;default:output+=format.charAt(iFormat);}} 579return output;},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name];},_setDateFromField:function(inst){var dateFormat=this._get(inst,'dateFormat');var rangeSelect=this._get(inst,'rangeSelect');var multiSelect=this._get(inst,'multiSelect');inst.lastVal=(inst.input?inst.input.val():'');var dates=inst.lastVal;dates=(rangeSelect?dates.split(this._get(inst,'rangeSeparator')):(multiSelect?dates.split(this._get(inst,'multiSeparator')):[dates]));inst.dates=[];var settings=this._getFormatConfig(inst);for(var i=0;i<dates.length;i++) 580try{inst.dates[i]=this.parseDate(dateFormat,dates[i],settings);} 581catch(event){inst.dates[i]=null;} 582for(var i=inst.dates.length-1;i>=0;i--) 583if(!inst.dates[i]) 584inst.dates.splice(i,1);if(rangeSelect&&inst.dates.length<2) 585inst.dates[1]=inst.dates[0];if(multiSelect&&inst.dates.length>multiSelect) 586inst.dates.splice(multiSelect,inst.dates.length);inst.cursorDate=new Date((inst.dates[0]||this._getDefaultDate(inst)).getTime());inst.drawMonth=inst.cursorDate.getMonth();inst.drawYear=inst.cursorDate.getFullYear();this._adjustInstDate(inst);},_getDefaultDate:function(inst){return this._restrictMinMax(inst,this._determineDate(inst,this._get(inst,'defaultDate'),new Date()));},_determineDate:function(inst,date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date;};var offsetString=function(offset){try{return $.datepick.parseDate($.datepick._get(inst,'dateFormat'),offset,$.datepick._getFormatConfig(inst));} 587catch(e){} 588var date=(offset.toLowerCase().match(/^c/)?$.datepick._getDate(inst):null)||new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|w|m|y)?/g;var matches=pattern.exec(offset.toLowerCase());while(matches){switch(matches[2]||'d'){case'd':day+=parseInt(matches[1],10);break;case'w':day+=parseInt(matches[1],10)*7;break;case'm':month+=parseInt(matches[1],10);day=Math.min(day,$.datepick._getDaysInMonth(year,month));break;case'y':year+=parseInt(matches[1],10);day=Math.min(day,$.datepick._getDaysInMonth(year,month));break;} 589matches=pattern.exec(offset.toLowerCase());} 590return new Date(year,month,day);};date=(date==null?defaultDate:(typeof date=='string'?offsetString(date):(typeof date=='number'?(isNaN(date)||date==Infinity||date==-Infinity?defaultDate:offsetNumeric(date)):date)));date=(date&&(date.toString()=='Invalid Date'||date.toString()=='NaN')?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0);} 591return this._daylightSavingAdjust(date);},_daylightSavingAdjust:function(date){if(!date)return null;date.setHours(date.getHours()>12?date.getHours()+2:0);return date;}
591,_setDate:function(inst,date,endDate){date=(!date?[]:(isArray(date)?date:[date]));if(endDate) 592date.push(endDate);var clear=(date.length==0);var origMonth=inst.cursorDate.getMonth();var origYear=inst.cursorDate.getFullYear();inst.dates=[this._restrictMinMax(inst,this._determineDate(inst,date[0],new Date()))];inst.cursorDate=new Date(inst.dates[0].getTime());inst.drawMonth=inst.cursorDate.getMonth();inst.drawYear=inst.cursorDate.getFullYear();if(this._get(inst,'rangeSelect')) 593inst.dates[1]=(date.length<1?inst.dates[0]:this._restrictMinMax(inst,this._determineDate(inst,date[1],null)));else if(this._get(inst,'multiSelect')) 594for(var i=1;i<date.length;i++) 595inst.dates[i]=this._restrictMinMax(inst,this._determineDate(inst,date[i],null));if(origMonth!=inst.cursorDate.getMonth()||origYear!=inst.cursorDate.getFullYear()) 596this._notifyChange(inst);this._adjustInstDate(inst);this._showDate(inst);},_getDate:function(inst){var startDate=(inst.input&&inst.input.val()==''?null:inst.dates[0]);if(this._get(inst,'rangeSelect')) 597return(startDate?[inst.dates[0],inst.dates[1]||inst.dates[0]]:[null,null]);else if(this._get(inst,'multiSelect')) 598return inst.dates.slice(0,inst.dates.length);else 599return startDate;},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var showStatus=this._get(inst,'showStatus');var initStatus=this._get(inst,'initStatus')||' ';var isRTL=this._get(inst,'isRTL');var useTR=this._get(inst,'useThemeRoller')?1:0;var clear=(this._get(inst,'mandatory')?'':'<div class="'+this._clearClass[useTR]+'"><a href="javascript:void(0)" '+'onclick="jQuery.datepick._clearDate(\'#'+inst.id+'\');"'+ 600this._addStatus(useTR,showStatus,inst.id,this._get(inst,'clearStatus'),initStatus)+'>'+this._get(inst,'clearText')+'</a></div>');var controls='<div class="'+this._controlClass[useTR]+'">'+(isRTL?'':clear)+'<div class="'+this._closeClass[useTR]+'"><a href="javascript:void(0)" '+'onclick="jQuery.datepick._hideDatepick();"'+ 601this._addStatus(useTR,showStatus,inst.id,this._get(inst,'closeStatus'),initStatus)+'>'+this._get(inst,'closeText')+'</a></div>'+(isRTL?clear:'')+'</div>';var prompt=this._get(inst,'prompt');var closeAtTop=this._get(inst,'closeAtTop');var hideIfNoPrevNext=this._get(inst,'hideIfNoPrevNext');var navigationAsDateFormat=this._get(inst,'navigationAsDateFormat');var showBigPrevNext=this._get(inst,'showBigPrevNext');var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,'showCurrentAtPos');var stepMonths=this._get(inst,'stepMonths');var stepBigMonths=this._get(inst,'stepBigMonths');var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var minDate=this._getMinMaxDate(inst,'min',true);var maxDate=this._getMinMaxDate(inst,'max');var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--;} 602if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-(numMonths[0]*numMonths[1])+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--;}}} 603inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,'prevText');prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prevBigText=(showBigPrevNext?this._get(inst,'prevBigText'):'');prevBigText=(!navigationAsDateFormat?prevBigText:this.formatDate(prevBigText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepBigMonths,1)),this._getFormatConfig(inst)));var prev='<div class="'+this._prevClass[useTR]+'">'+ 604(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?(showBigPrevNext?'<a href="javascript:void(0)" onclick="jQuery.datepick._adjustDate(\'#'+ 605inst.id+'\', -'+stepBigMonths+', \'M\');"'+ 606this._addStatus(useTR,showStatus,inst.id,this._get(inst,'prevBigStatus'),initStatus)+'>'+prevBigText+'</a>':'')+'<a href="javascript:void(0)" onclick="jQuery.datepick._adju
606stDate(\'#'+ 607inst.id+'\', -'+stepMonths+', \'M\');"'+ 608this._addStatus(useTR,showStatus,inst.id,this._get(inst,'prevStatus'),initStatus)+'>'+prevText+'</a>':(hideIfNoPrevNext?' ':(showBigPrevNext?'<label>'+prevBigText+'</label>':'')+'<label>'+prevText+'</label>'))+'</div>';var nextText=this._get(inst,'nextText');nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var nextBigText=(showBigPrevNext?this._get(inst,'nextBigText'):'');nextBigText=(!navigationAsDateFormat?nextBigText:this.formatDate(nextBigText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepBigMonths,1)),this._getFormatConfig(inst)));var next='<div class="'+this._nextClass[useTR]+'">'+ 609(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a href="javascript:void(0)" onclick="jQuery.datepick._adjustDate(\'#'+ 610inst.id+'\', +'+stepMonths+', \'M\');"'+ 611this._addStatus(useTR,showStatus,inst.id,this._get(inst,'nextStatus'),initStatus)+'>'+nextText+'</a>'+ 612(showBigPrevNext?'<a href="javascript:void(0)" onclick="jQuery.datepick._adjustDate(\'#'+ 613inst.id+'\', +'+stepBigMonths+', \'M\');"'+ 614this._addStatus(useTR,showStatus,inst.id,this._get(inst,'nextBigStatus'),initStatus)+'>'+nextBigText+'</a>':''):(hideIfNoPrevNext?' ':'<label>'+nextText+'</label>'+ 615(showBigPrevNext?'<label>'+nextBigText+'</label>':'')))+'</div>';var currentText=this._get(inst,'currentText');var gotoDate=(this._get(inst,'gotoCurrent')&&inst.dates[0]?inst.dates[0]:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var html=(closeAtTop&&!inst.inline?controls:'');html+='<div class="calendar-links">'+(isRTL?next:prev);html+=(isRTL?prev:next)+'</div>';var firstDay=parseInt(this._get(inst,'firstDay'),10);firstDay=(isNaN(firstDay)?0:firstDay);var changeFirstDay=this._get(inst,'changeFirstDay');var dayNames=this._get(inst,'dayNames');var dayNamesShort=this._get(inst,'dayNamesShort');var dayNamesMin=this._get(inst,'dayNamesMin');var monthNames=this._get(inst,'monthNames');var beforeShowDay=this._get(inst,'beforeShowDay');var showOtherMonths=this._get(inst,'showOtherMonths');var selectOtherMonths=this._get(inst,'selectOtherMonths');var showWeeks=this._get(inst,'showWeeks');var calculateWeek=this._get(inst,'calculateWeek')||this.iso8601Week;var weekStatus=this._get(inst,'weekStatus');var status=(showStatus?this._get(inst,'dayStatus')||initStatus:'');var dateStatus=this._get(inst,'statusForDate')||this.dateStatus;var defaultDate=this._getDefaultDate(inst);for(var row=0;row<numMonths[0];row++){for(var col=0;col<numMonths[1];col++){var cursorDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.cursorDate.getDate()));html+='<div class="'+this._oneMonthClass[useTR]+ 616(col==0&&!useTR?' '+this._newRowClass[useTR]:'')+'">'+ 617this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,cursorDate,row>0||col>0,useTR,showStatus,initStatus,monthNames)+'<table class="'+this._tableClass[useTR]+'" cellpadding="0" cellspacing="0"><thead>'+'<tr class="'+this._tableHeaderClass[useTR]+'">'+(showWeeks?'<th'+ 618this._addStatus(useTR,showStatus,inst.id,weekStatus,initStatus)+'>'+ 619this._get(inst,'weekHeader')+'</th>':'');for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;var dayStatus=(!showStatus||!changeFirstDay?'':status.replace(/DD/,dayNames[day]).replace(/D/,dayNamesShort[day]));html+='<th'+((dow+firstDay+6)%7<5?'':' class="'+this._weekendClass[useTR]+'"')+'>'+ 620(!changeFirstDay?'<span'+ 621this._addStatus(useTR,showStatus,inst.id,dayNames[day],initStatus):'<a href="javascript:void(0)" onclick="jQuery.datepick._changeFirstDay(\'#'+ 622inst.id+'\', '+day+');"'+ 623this._addStatus(useTR,showStatus,inst.id,dayStatus,initStatus))+' title="'+dayNames[day]+'">'+ 624dayNamesMin[day]+(changeFirstDay?'</a>':'</span>')+'</th>';} 625html+='</tr></thead><tbody>';var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.cursorDate.getFullYear()&&drawMonth==inst.cursorDate.getMonth()) 626inst.cursorDate.setDate(Math.min(inst.cursorDate.getDate(),daysInMonth));var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){html+='<tr class="'+this._weekRowClass[useTR]+'">'+ 627(showWeeks?'<td class="'+this._weekColClass[useTR]+'"'+ 628this._addStatus(useTR,showStatus,inst.id,weekStatus,initStatus)+'>'+ 629calculateWeek(printDate)+'</td>':'');for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,'']);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);var selected=(this._get(inst,'rangeSelect')&&inst.dates[0]&&printDate.getTime()>=inst.dates[0].getTime()&&printDate.getTime()<=(inst.dates[1]||inst.dates[0]).getTime());for(var i=0;i<inst.dates.length;i++) 630selected=selected||(inst.dates[i]&&printDate.getTime()==inst.dates[i].getTime());var empty=otherMonth&&!showOtherMonths;html+='<td data-content="" class="'+this._dayClass[useTR]+ 631((dow+firstDay+6)%7>=5?' '+this._weekendClass[useTR]:'')+ 632(otherMonth?' '+this._otherMonthClass[useTR]:'')+ 633((printDate.getTime()==cursorDate.getTime()&&drawMonth==inst.cursorDate.getMonth()&&inst.keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==cursorDate.getTime())?' ':'')+ 634(unselectable?' '+this._unselectableClass[useTR]:' '+this._selectableClass[useTR])+ 635(empty?'':' '+daySettings[1]+ 636(selected?' '+this._selectedClass[useTR]:'')+ 637(printDate.getTime()==today.getTime()?' '+this._todayClass[useTR]:''))+'"'+ 638(!empty&&daySettings[2]?' title="'+daySettings[2]+'"':'')+ 639(false?'':' onmouseover="'+'jQuery.datepick._doMouseOver(this,\''+ 640inst.id+'\','+printDate.getTime()+')"'+' onmouseout="jQuery.datepick._doMouseOut(this,\''+inst.id+'\')"'+' onclick="jQuery.datepick._selectDay(this,\'#'+ 641inst.id+'\','+printDate.getTime()+')"')+'>';html+='<div class="wpbc-cell-box">'+'<div class="wpbc-diagonal-el">'+'<div class="wpbc-co-out">
641'+'<svg height="100%" width="100%" viewBox="0 0 100 100" preserveAspectRatio="none">'+'<polygon points="0,0 0,99 99,0"></polygon>'+'<polygon points="0,0 0,100 49,100 49,0"></polygon>'+'</svg>'+'</div>'+'<div class="wpbc-co-in">'+'<svg height="100%" width="100%" viewBox="0 0 98 98" preserveAspectRatio="none">'+'<polygon points="0,99 99,99 99,0"></polygon>'+'<polygon points="50,98 98,98 98,0 50,0"></polygon>'+'</svg>'+'</div>'+'</div>'+'<div class="date-cell-content">'+'<div class="date-content-top">'+ 642(unselectable?'':((typeof(wpbc_show_date_info_top)=='function')?wpbc_show_date_info_top(inst.id,printDate.getTime()):''))+'</div>'+ 643(empty?' ':(unselectable?'<span>'+printDate.getDate()+'</span>':'<a href="javascript:void(0)" >'+printDate.getDate()+'</a>'))+'<div class="date-content-bottom">'+ 644(unselectable?'':((typeof(wpbc_show_date_info_bottom)=='function')?wpbc_show_date_info_bottom(inst.id,printDate.getTime()):''))+'</div>'+'</div>'+'</div>';html+='</td>';printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate);} 645html+='</tr>';} 646drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++;} 647html+='</tbody></table></div>';} 648if(useTR) 649html+='<div class="'+this._newRowClass[useTR]+'"></div>';} 650html+=(showStatus?'<div style="clear: both;"></div><div id="'+this._statusId[useTR]+ 651inst.id+'" class="'+this._statusClass[useTR]+'">'+initStatus+'</div>':'')+ 652(!closeAtTop&&!inst.inline?controls:'')+'<div style="clear: both;"></div>'+ 653($.browser_is_supported_datepick.msie&&parseInt($.browser_is_supported_datepick.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="'+this._coverClass[useTR]+'"></iframe>':'');inst.keyEvent=false;return html;},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,cursorDate,secondary,useTR,showStatus,initStatus,monthNames){var minDraw=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1));minDate=(minDate&&minDraw<minDate?minDraw:minDate);var changeMonth=this._get(inst,'changeMonth');var changeYear=this._get(inst,'changeYear');var showMonthAfterYear=this._get(inst,'showMonthAfterYear');var html='<div class="'+this._monthYearClass[useTR]+'">';var monthHtml='';if(secondary||!changeMonth) 654monthHtml+='<span class="'+this._monthClass[useTR]+'">'+ 655monthNames[drawMonth]+'</span>';else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="'+this._monthSelectClass[useTR]+'" '+'onchange="jQuery.datepick._selectMonthYear(\'#'+inst.id+'\', this, \'M\');" '+'onclick="jQuery.datepick._clickMonthYear(\'#'+inst.id+'\');"'+ 656this._addStatus(useTR,showStatus,inst.id,this._get(inst,'monthStatus'),initStatus)+'>';for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())) 657monthHtml+='<option value="'+month+'"'+ 658(month==drawMonth?' selected="selected"':'')+'>'+monthNames[month]+'</option>';} 659monthHtml+='</select>';} 660if(!showMonthAfterYear) 661html+=monthHtml+(secondary||!changeMonth||!changeYear?' ':'');if(secondary||!changeYear) 662html+='<span class="'+this._yearClass[useTR]+'">'+drawYear+'</span>';else{var years=this._get(inst,'yearRange').split(':');var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10;}else if(years[0].charAt(0)=='+'||years[0].charAt(0)=='-'){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10);}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10);} 663year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="'+this._yearSelectClass[useTR]+'" '+'onchange="jQuery.datepick._selectMonthYear(\'#'+inst.id+'\', this, \'Y\');" '+'onclick="jQuery.datepick._clickMonthYear(\'#'+inst.id+'\');"'+ 664this._addStatus(useTR,showStatus,inst.id,this._get(inst,'yearStatus'),initStatus)+'>';for(;year<=endYear;year++){html+='<option value="'+year+'"'+ 665(year==drawYear?' selected="selected"':'')+'>'+year+'</option>';} 666html+='</select>';} 667html+=this._get(inst,'yearSuffix');if(showMonthAfterYear) 668html+=(secondary||!changeMonth||!changeYear?' ':'')+monthHtml;html+='</div>';return html;},_addStatus:function(useTR,showStatus,id,text,initStatus){return(showStatus?' onmouseover="jQuery(\'#'+this._statusId[useTR]+id+'\').html(\''+(text||initStatus)+'\');" '+'onmouseout="jQuery(\'#'+this._statusId[useTR]+id+'\').html(\''+initStatus+'\');"':'');},_adjustInstDate:function(inst,offset,period){var yearMonth=inst.drawYear+'/'+inst.drawMonth;var year=inst.drawYear+(period=='Y'?offset:0);var month=inst.drawMonth+(period=='M'?offset:0);var day=Math.min(inst.cursorDate.getDate(),this._getDaysInMonth(year,month))+ 669(period=='D'?offset:0);inst.cursorDate=this._restrictMinMax(inst,this._daylightSavingAdjust(new Date(year,month,day)));inst.drawMonth=inst.cursorDate.getMonth();inst.drawYear=inst.cursorDate.getFullYear();if(yearMonth!=inst.drawYear+'/'+inst.drawMonth) 670this._notifyChange(inst);},_restrictMinMax:function(inst,date){var minDate=this._getMinMaxDate(inst,'min',true);var maxDate=this._getMinMaxDate(inst,'max');date=(minDate&&date<minDate?new Date(minDate.getTime()):date);date=(maxDate&&date>maxDate?new Date(maxDate.getTime()):date);return date;},_notifyChange:function(inst){var onChange=this._get(inst,'onChangeMonthYear');if(onChange) 671onChange.apply((inst.input?inst.input[0]:null),[inst.cursorDate.getFullYear(),inst.cursorDate.getMonth()+1,this._daylightSavingAdjust(new Date(inst.cursorDate.getFullYear(),inst.cursorDate.getMonth(),1)),inst]);},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,'numberOfMonths');return(numMonths==null?[1,1]:(typeof numMonths=='number'?[1,numMonths]:numMonths));},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(inst,this._get(inst,minMax+'Date'),null);var rangeMin=this._getRangeMin(inst);return(checkRange&&rangeMin&&(!date||rangeMin>date)?rangeMin:date);},_getRangeMin:function(inst){return(this._get(inst,'rangeSelect')&&inst.dates[0]&&
671!inst.dates[1]?inst.dates[0]:null);},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate();},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay();},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[0]*numMonths[1]),1));if(offset<0) 672date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()));return this._isInRange(inst,date);},_isInRange:function(inst,date){var minDate=this._getRangeMin(inst)||this._getMinMaxDate(inst,'min');var maxDate=this._getMinMaxDate(inst,'max');return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate));},_getFormatConfig:function(inst){return{shortYearCutoff:this._get(inst,'shortYearCutoff'),dayNamesShort:this._get(inst,'dayNamesShort'),dayNames:this._get(inst,'dayNames'),monthNamesShort:this._get(inst,'monthNamesShort'),monthNames:this._get(inst,'monthNames')};},_formatDate:function(inst,year,month,day){if(!year) 673inst.dates[0]=new Date(inst.cursorDate.getTime());var date=(year?(typeof year=='object'?year:this._daylightSavingAdjust(new Date(year,month,day))):inst.dates[0]);return this.formatDate(this._get(inst,'dateFormat'),date,this._getFormatConfig(inst));}});function extendRemove(target,props){$.extend(target,props);for(var name in props) 674if(props[name]==null||props[name]==undefined) 675target[name]=props[name];return target;};function isArray(a){return(a&&a.constructor==Array);};$.fn.datepick=function(options){var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=='string'&&(options=='isDisabled'||options=='getDate'||options=='settings')) 676return $.datepick['_'+options+'Datepick'].apply($.datepick,[this[0]].concat(otherArgs));if(options=='option'&&arguments.length==2&&typeof arguments[1]=='string') 677return $.datepick['_'+options+'Datepick'].apply($.datepick,[this[0]].concat(otherArgs));return this.each(function(){typeof options=='string'?$.datepick['_'+options+'Datepick'].apply($.datepick,[this].concat(otherArgs)):$.datepick._attachDatepick(this,options);});};$.datepick=new Datepick();$(function(){$(document).on('mousedown',$.datepick._checkExternalClick).find('body').append($.datepick.dpDiv);});})(jQuery);;(function($){$.datepick.regional['de']={clearText:'löschen',clearStatus:'aktuelles Datum löschen',closeText:'schließen',closeStatus:'ohne Änderungen schließen',prevText:'<zurück',prevStatus:'letzten Monat zeigen',prevBigText:'<<',prevBigStatus:'',nextText:'Vor>',nextStatus:'nächsten Monat zeigen',nextBigText:'>>',nextBigStatus:'',currentText:'heute',currentStatus:'',monthNames:['Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'],monthNamesShort:['Jan','Feb','Mär','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'],monthStatus:'anderen Monat anzeigen',yearStatus:'anderes Jahr anzeigen',weekHeader:'Wo',weekStatus:'Woche des Monats',dayNames:['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],dayNamesShort:['So','Mo','Di','Mi','Do','Fr','Sa'],dayNamesMin:['So','Mo','Di','Mi','Do','Fr','Sa'],dayStatus:'Setze DD als ersten Wochentag',dateStatus:'Wähle D, M d',dateFormat:'dd.mm.yy',firstDay:1,initStatus:'Wähle ein Datum',isRTL:false,showMonthAfterYear:false,yearSuffix:''};$.datepick.setDefaults($.datepick.regional['de']);})(jQuery);;function wpbc_check_errors_in_booking_form(resource_id){var $form=jQuery('#booking_form'+resource_id);var fields_with_errors_arr=[];var is_error_in_field=false;var skip_element_types=['hidden','button'];if(!$form.length){return false;} 678function add_validation_error(field,target,message){wpbc_front_end__show_message__warning(target,message,'text');is_error_in_field=true;if(field){fields_with_errors_arr.push(field);}} 679function validate_required_field(field,$field,field_type){var warning_target;if(!$field.hasClass('wpdev-validates-as-required')){return;} 680if('checkbox'===field_type){if(!$field.is(':checked')&&!jQuery(':checkbox[name="'+field.name+'"]',$form).is(':checked')){warning_target=$field.parents('.wpdev-form-control-wrap').last();if(!warning_target.length){warning_target=$field.parents('.controls').last();} 681if(!warning_target.length){warning_target=$field;} 682add_validation_error(field,warning_target,_wpbc.get_message('message_check_required_for_check_box'));} 683return;} 684if('radio'===field_type){if(!jQuery(':radio[name="'+field.name+'"]',$form).is(':checked')){add_validation_error(field,$field.parents('.wpdev-form-control-wrap'),_wpbc.get_message('message_check_required_for_radio_box'));} 685return;} 686if(''===wpbc_trim($field.val())){add_validation_error(field,field,_wpbc.get_message('message_check_required'));}} 687function validate_email_field(field,$field){var email_value=String($field.val()||'').replace(/^\s+|\s+$/gm,'');var email_regex=/^([A-Za-z0-9_\-\.\+])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,})$/;if(''!==email_value&&!email_regex.test(email_value)){add_validation_error(field,field,_wpbc.get_message('message_check_email'));} 688return email_value;} 689function validate_confirmation_email_field(field,email_value){var primary_email_match;var primary_email_name;var $primary_email_field;if(field.className.indexOf('same_as_')===-1){return;} 690primary_email_match=field.className.match(/same_as_([^\s])+/gi);if(null===primary_email_match){return;} 691primary_email_name=primary_email_match[0].substr(8);$primary_email_field=$form.find('[name="'+primary_email_name+resource_id+'"]');if($primary_email_field.length&&$primary_email_field.val()!==email_value){add_validation_error(field,field,_wpbc.get_message('message_check_same_email'));}} 692function validate_custom_field_classes(field,$field){var class_list=$field.attr('class');var field_value;if(!class_list){return;} 693field_value=$field.val();jQuery.each(class_list.split(/\s+/),function(class_index,class_name){var digits_to_check;var message;
693var validation_regex;if('validate_as_date'===class_name){validation_regex=new RegExp('^[0-3]?\\d{1}[\\/\\.\\-]+[0-3]?\\d{1}[\\/\\.\\-]+[0-2]+\\d{3}$');message=_wpbc.get_message('message_check_valid_date').replace('{date_example}','09/25/2018');if(''!==field_value&&!validation_regex.test(field_value)){add_validation_error(field,field,message);} 694return;} 695if('validate_as_digit'===class_name){validation_regex=new RegExp('^[0-9]+\\.?[0-9]*$');if(''!==field_value&&!validation_regex.test(field_value)){add_validation_error(field,field,_wpbc.get_message('message_check_digits_only'));} 696return;} 697if('validate_digit_'!==class_name.substring(0,15)){return;} 698digits_to_check=parseInt(class_name.substring(15),10);if(isNaN(digits_to_check)){return;} 699validation_regex=new RegExp('^\\d{'+digits_to_check+'}$');message=_wpbc.get_message('message_check_digits_count').replace('{digits}',digits_to_check);if(''!==field_value&&!validation_regex.test(field_value)){add_validation_error(field,field,message);}});} 700$form.find(':input').each(function(){var field=this;var $field=jQuery(field);var field_type=$field.attr('type');var email_value;if(-1!==skip_element_types.indexOf(field_type)){return;} 701if('1'===String($field.attr('data-wpbc-booking-submit-ignore')||'')){return;} 702if(('date_booking'+resource_id===$field.attr('name'))&&jQuery('#calendar_booking'+resource_id).is(':visible')&&(''===$field.val())&&(0===wpbc_get_arr_of_selected_additional_calendars(resource_id).length)){add_validation_error(null,'#booking_form_div'+resource_id+' .bk_calendar_frame',_wpbc.get_message('message_check_no_selected_dates'));} 703if(!$field.is(':visible')){return;} 704validate_required_field(field,$field,field_type);if($field.hasClass('wpdev-validates-as-email')){email_value=validate_email_field(field,$field);validate_confirmation_email_field(field,email_value);}
705validate_custom_field_classes(field,$field);});if(fields_with_errors_arr.length){jQuery(fields_with_errors_arr[0]).trigger('focus');} 706return is_error_in_field;} 707jQuery(document).ready(function(){jQuery('div.inside_hint').on('click',function(){jQuery(this).css('visibility','hidden').siblings('.has-inside-hint').trigger('focus');});jQuery('input.has-inside-hint').on('blur',function(){if(''===this.value){jQuery(this).siblings('.inside_hint').css('visibility','');}}).on('focus',function(){jQuery(this).siblings('.inside_hint').css('visibility','hidden');});jQuery('.booking_form_div input[type=button]').prop("disabled",false);});function wpbc_wizard_step(el,step_num,step_from){var br_id=jQuery(el).closest('form').find('input[name^="bk_type"]').val();if((undefined==step_from)||(step_num>step_from)){if(1!=step_num){var is_error=wpbc_check_errors_in_booking_form(br_id);if(is_error){return false;}}} 708if(wpbc_is_some_elements_visible(br_id,['rangetime','durationtime','starttime','endtime'])){if(wpbc_is_this_time_selection_not_available(br_id,document.getElementById('booking_form'+br_id))){return false;}} 709if(br_id!=undefined){jQuery("#booking_form"+br_id+" .wpbc_wizard_step").css({"display":"none"}).removeClass('wpbc_wizard_step_hidden');jQuery("#booking_form"+br_id+" .wpbc_wizard_step"+step_num).css({"display":"block"});return jQuery("#booking_form"+br_id+" .wpbc_wizard_step"+step_num);}} 710function wpbc_hook__init_booking_form_wizard_buttons(){jQuery('.wpbc_wizard_step_button').attr({href:'javascript:void(0)',});jQuery('.wpbc_wizard_step_button').off('click.wpbc_booking_form_wizard').on('click.wpbc_booking_form_wizard',function(event){var found_steps_arr=jQuery(this).attr('class').match(/wpbc\_wizard\_step\_([\d]+)([\s'"]+|$)/);if((null!==found_steps_arr)&&(found_steps_arr.length>2)){var step=parseInt(found_steps_arr[1]);if(step>0){var jq_step_element;var this_formsteps_arr=jQuery(this).parents('.wpbc_wizard_step').attr('class').match(/wpbc\_wizard\_step([\d]+)([\s'"]+|$)/);if((null!==this_formsteps_arr)&&(this_formsteps_arr.length>2)){var step_from=parseInt(this_formsteps_arr[1]);jq_step_element=wpbc_wizard_step(this,step,step_from);}else{jq_step_element=wpbc_wizard_step(this,step);} 711if(false!==jq_step_element){wpbc_do_scroll(jq_step_element);}}}});} 712function wpbc_is_some_elements_visible(resource_id,elements_names){var my_form=jQuery('#booking_form'+resource_id);if(!my_form.length){return false;} 713var is_some_elements_visible=false;my_form.find(':input').each(function(index,el){var skip_elements=['hidden','button'];if(-1==skip_elements.indexOf(jQuery(el).attr('type'))){for(var ei=0;ei<(elements_names.length-1);ei++){if((elements_names[ei]+resource_id)==jQuery(el).attr('name')){if(jQuery(el).is(':visible')){is_some_elements_visible=true;}}}}});return is_some_elements_visible;} 714jQuery(document).ready(function(){wpbc_hook__init_booking_form_wizard_buttons();});function get_first_day_of_selection(dates){if(dates.indexOf(',')!=-1){var dates_array=dates.split(/,\s*/);var length=dates_array.length;var element=null;var new_dates_array=[];for(var i=0;i<length;i++){element=dates_array[i].split(/\./);new_dates_array[new_dates_array.length]=element[2]+'.'+element[1]+'.'+element[0];} 715new_dates_array.sort();element=new_dates_array[0].split(/\./);return element[2]+'.'+element[1]+'.'+element[0];} 716if(dates.indexOf(' - ')!=-1){var start_end_date=dates.split(" - ");return start_end_date[0];} 717return dates;} 718function get_last_day_of_selection(dates){if(dates.indexOf(',')!=-1){var dates_array=dates.split(/,\s*/);var length=dates_array.length;var element=null;var new_dates_array=[];for(var i=0;i<length;i++){element=dates_array[i].split(/\./);new_dates_array[new_dates_array.length]=element[2]+'.'+element[1]+'.'+element[0];} 719new_dates_array.sort();element=new_dates_array[(new_dates_array.length-1)].split(/\./);return element[2]+'.'+element[1]+'.'+element[0];} 720if(dates.indexOf(' - ')!=-1){var start_end_date=dates.split(" - ");return start_end_date[(start_end_date.length-1)];} 721return dates;} 722function wpbc_get_arr_of_selected_additional_calendars(bk_type){var selected_additionl_calendars=[];if(document.getElementById('additional_calendars'+bk_type)!=null){var id_additional_str=document.getElementById('additional_calendars'+bk_type).value;var id_additional_arr=id_additional_str.split(',');for(var ia=0;ia<id_additional_arr.length;ia++){if(document.getElementById('date_booking'+id_additional_arr[ia]).value!=''){selected_additionl_calendars.push(id_additional_arr[ia]);}}} 723return selected_additionl_calendars;} 724jQuery(function($){if((window.elementorFrontend)&&('undefined'!==typeof(elementorFrontend.hooks))){elementorFrontend.hooks.addAction('frontend/element_ready/wpbc_widget_booking_form_1.default',function($scope){jQuery(document).trigger('wpbc_elementor_ready');});}});
724jQuery(document).on('wpbc_elementor_ready',function(){wpbc_hook__init_booking_form_wizard_buttons();if('function'===typeof(wpbc_hook__init_timeselector)){wpbc_hook__init_timeselector();} 725if('function'===typeof(wpbc_update_capacity_hint)){jQuery('.booking_form_div').on('wpbc_booking_date_or_option_selected',function(event,resource_id){wpbc_update_capacity_hint(resource_id);});}});;"use strict";function wpbc_ajx_booking__create(params){console.groupCollapsed('WPBC_AJX_BOOKING__CREATE');console.groupCollapsed('== Before Ajax Send ==');console.log(params);console.groupEnd();params=wpbc_captcha__simple__maybe_remove_in_ajx_params(params);jQuery('body').trigger('wpbc_before_booking_create',[params['resource_id'],params]);jQuery.post(wpbc_url_ajax,{action:'WPBC_AJX_BOOKING__CREATE',wpbc_ajx_user_id:_wpbc.get_secure_param('user_id'),nonce:_wpbc.get_secure_param('nonce'),wpbc_ajx_locale:_wpbc.get_secure_param('locale'),calendar_request_params:params},function(response_data,textStatus,jqXHR){var is_valid_response=typeof response_data==='object'&&response_data!==null&&!Array.isArray(response_data)&&Object.prototype.hasOwnProperty.call(response_data,'resource_id')&&typeof response_data['ajx_data']==='object'&&response_data['ajx_data']!==null&&!Array.isArray(response_data['ajx_data'])&&typeof response_data['ajx_data']['status']==='string';if(!is_valid_response){var calendar_id=wpbc_get_resource_id__from_ajx_post_data_url(this.data);var jq_node='#booking_form'+calendar_id;var response_error_message=_wpbc.get_message('message_unexpected_server_response')||'The server returned an unexpected response. Please reload the page and try again.';wpbc_front_end__log_unexpected_ajax_response('WPBC_AJX_BOOKING__CREATE',response_data,jqXHR,textStatus,'Invalid response structure');wpbc_front_end__show_message(response_error_message,{'type':'error','show_here':{'jq_node':jq_node,'where':'after'},'is_append':true,'style':'text-align:left;','content_mode':'text','delay':0});wpbc_booking_form__on_response__ui_elements_enable(calendar_id);return;} 726console.log(' == Response WPBC_AJX_BOOKING__CREATE == ');for(var obj_key in response_data){console.groupCollapsed('=='+obj_key+'==');console.log(' : '+obj_key+' : ',response_data[obj_key]);console.groupEnd();} 727console.groupEnd();if('ok'!=response_data['ajx_data']['status']){switch(response_data['ajx_data']['status_error']){case'captcha_simple_wrong':wpbc_captcha__simple__update({'resource_id':response_data['resource_id'],'url':response_data['ajx_data']['captcha__simple']['url'],'challenge':response_data['ajx_data']['captcha__simple']['challenge'],'message':response_data['ajx_data']['ajx_after_action_message']});break;case'resource_id_incorrect':var message_id=wpbc_front_end__show_message(response_data['ajx_data']['ajx_after_action_message'].replace(/\n/g,"<br />"),{'type':'undefined'!==typeof response_data['ajx_data']['ajx_after_action_message_status']?response_data['ajx_data']['ajx_after_action_message_status']:'warning','delay':0,'show_here':{'where':'after','jq_node':'#booking_form'+params['resource_id']}});break;case'booking_can_not_save':var message_id=wpbc_front_end__show_message(response_data['ajx_data']['ajx_after_action_message'].replace(/\n/g,"<br />"),{'type':'undefined'!==typeof response_data['ajx_data']['ajx_after_action_message_status']?response_data['ajx_data']['ajx_after_action_message_status']:'warning','delay':0,'show_here':{'where':'after','jq_node':'#booking_form'+params['resource_id']}});wpbc_booking_form__on_response__ui_elements_enable(response_data['resource_id']);break;default:if('undefined'!==typeof response_data['ajx_data']['ajx_after_action_message']&&''!=response_data['ajx_data']['ajx_after_action_message'].replace(/\n/g,"<br />")){var calendar_id=wpbc_get_resource_id__from_ajx_post_data_url(this.data);var jq_node='#booking_form'+calendar_id;var ajx_after_booking_message=response_data['ajx_data']['ajx_after_action_message'].replace(/\n/g,"<br />");console.log(ajx_after_booking_message);wpbc_front_end__show_message(ajx_after_booking_message,{'type':'undefined'!==typeof response_data['ajx_data']['ajx_after_action_message_status']?response_data['ajx_data']['ajx_after_action_message_status']:'warning','delay':0,'show_here':{'jq_node':jq_node,'where':'after'}});}} 728wpbc_booking_form__on_response__ui_elements_enable(response_data['resource_id']);wpbc_calendar__unselect_all_dates(response_data['resource_id']);wpbc_calendar__load_data__ajx({'resource_id':response_data['resource_id'],'booking_hash':response_data['ajx_cleaned_params']['booking_hash'],'request_uri':response_data['ajx_cleaned_params']['request_uri'],'custom_form':response_data['ajx_cleaned_params']['custom_form'],'aggregate_resource_id_str':_wpbc.booking__get_param_value(response_data['resource_id'],'aggregate_resource_id_arr').join(',')});return;} 729wpbc_booking_form__spin_loader__hide(response_data['resource_id']);wpbc_booking_form__animated__hide(response_data['resource_id']);wpbc_show_thank_you_message_after_booking(response_data);jQuery('body').trigger('wpbc_booking_form_submit_success',[response_data['resource_id'],response_data,params]);
729setTimeout(function(){wpbc_do_scroll('#wpbc_scroll_point_'+response_data['resource_id'],10);},500);}).fail(function(jqXHR,textStatus,errorThrown){wpbc_front_end__log_unexpected_ajax_response('WPBC_AJX_BOOKING__CREATE',jqXHR.responseText||'',jqXHR,textStatus,errorThrown);var fallback_error_message=_wpbc.get_message('message_unexpected_server_response')||'The server returned an unexpected response. Please reload the page and try again.';var error_message=wpbc_front_end__get_ajax_error_message(jqXHR,fallback_error_message,'');var calendar_id=wpbc_get_resource_id__from_ajx_post_data_url(this.data);var jq_node='#booking_form'+calendar_id;wpbc_front_end__show_message(error_message,{'type':'error','show_here':{'jq_node':jq_node,'where':'after'},'is_append':true,'style':'text-align:left;','content_mode':'text','delay':0});wpbc_booking_form__on_response__ui_elements_enable(calendar_id);});return true;} 730function wpbc_captcha__simple__update(params){document.getElementById('captcha_input'+params['resource_id']).value='';document.getElementById('captcha_img'+params['resource_id']).src=params['url'];document.getElementById('wpdev_captcha_challenge_'+params['resource_id']).value=params['challenge'];var message_id=wpbc_front_end__show_message__warning('#captcha_input'+params['resource_id']+' + img',params['message'],'text');jQuery('#'+message_id+', '+'#captcha_input'+params['resource_id']).fadeOut(350).fadeIn(300).fadeOut(350).fadeIn(400).animate({opacity:1},4000);jQuery('#captcha_input'+params['resource_id']).trigger('focus');wpbc_booking_form__on_response__ui_elements_enable(params['resource_id']);} 731function wpbc_captcha__simple__maybe_remove_in_ajx_params(params){if(!wpbc_captcha__simple__is_exist_in_form(params['resource_id'])){delete params['captcha_chalange'];delete params['captcha_user_input'];} 732return params;} 733function wpbc_captcha__simple__is_exist_in_form(resource_id){return 0!==jQuery('#wpdev_captcha_challenge_'+resource_id).length||0!==jQuery('#captcha_input'+resource_id).length;} 734function wpbc_booking_form__on_submit__ui_elements_disable(resource_id){wpbc_booking_form__send_button__disable(resource_id);wpbc_booking_form__spin_loader__show(resource_id);} 735function wpbc_booking_form__on_response__ui_elements_enable(resource_id){wpbc_booking_form__send_button__enable(resource_id);wpbc_booking_form__spin_loader__hide(resource_id);} 736function wpbc_booking_form__send_button__enable(resource_id){jQuery('#booking_form_div'+resource_id+' input[type=button]').prop("disabled",false);jQuery('#booking_form_div'+resource_id+' button').prop("disabled",false);} 737function wpbc_booking_form__send_button__disable(resource_id){jQuery('#booking_form_div'+resource_id+' input[type=button]').prop("disabled",true);jQuery('#booking_form_div'+resource_id+' button').prop("disabled",true);} 738function wpbc_booking_form__this_button__disable(_this){jQuery(_this).prop("disabled",true);} 739function wpbc_booking_form__spin_loader__show(resource_id){var $form_container=jQuery('#booking_form_div'+resource_id);var loader_text='Saving';if('undefined'!==typeof _wpbc&&_wpbc.get_message){loader_text=_wpbc.get_message('message_booking_saving')||loader_text;} 740var loader_html='<div id="wpbc_booking_form_spin_loader'+resource_id+'" class="wpbc_booking_form_spin_loader wpbc_booking_form_submit_overlay" aria-live="polite" aria-hidden="false">'+'<div class="wpbc_spins_loading_container">'+'<div class="wpbc_booking_form_spin_loader"><div class="wpbc_spins_loader_wrapper"><div class="wpbc_spin_loader_one_new"></div></div></div>'+'<span>'+loader_text+'...</span>'+'</div>'+'</div>';jQuery('#wpbc_booking_form_spin_loader'+resource_id).remove();if($form_container.length&&$form_container.is(':visible')){$form_container.addClass('wpbc_booking_form_is_submitting');$form_container.prepend(loader_html);return;} 741jQuery('#booking_form'+resource_id).after('<div id="wpbc_booking_form_spin_loader'+resource_id+'" class="wpbc_booking_form_spin_loader" style="position: relative;"><div class="wpbc_spins_loader_wrapper"><div class="wpbc_spin_loader_one_new"></div></div></div>');} 742function wpbc_booking_form__spin_loader__hide(resource_id){jQuery('#wpbc_booking_form_spin_loader'+resource_id).remove();jQuery('#booking_form_div'+resource_id).removeClass('wpbc_booking_form_is_submitting');}
743function wpbc_booking_form__animated__hide(resource_id){jQuery('#booking_form'+resource_id).hide();} 744function wpbc__spin_loader__micro__show__inside(id,jq_node_where_insert){wpbc__spin_loader__mini__show(id,{'color':'#444','show_here':{'where':'inside','jq_node':jq_node_where_insert},'style':'position: relative;display: inline-flex;flex-flow: column nowrap;justify-content: center;align-items: center;margin: 7px 12px;','class':'wpbc_one_spin_loader_micro'});} 745function wpbc__spin_loader__micro__hide(id){wpbc__spin_loader__mini__hide(id);} 746function wpbc__spin_loader__mini__show(parent_html_id,params={}){var params_default={'color':'#0071ce','show_here':{'jq_node':'','where':'after'},'style':'position: relative;min-height: 2.8rem;','class':'wpbc_one_spin_loader_mini 0wpbc_spin_loader_one_new'};for(var p_key in params){params_default[p_key]=params[p_key];} 747params=params_default;if('undefined'!==typeof params['color']&&''!=params['color']){params['color']='border-color:'+params['color']+';';} 748var spinner_html='<div id="wpbc_mini_spin_loader'+parent_html_id+'" class="wpbc_booking_form_spin_loader" style="'+params['style']+'"><div class="wpbc_spins_loader_wrapper"><div class="'+params['class']+'" style="'+params['color']+'"></div></div></div>';if(''==params['show_here']['jq_node']){params['show_here']['jq_node']='#'+parent_html_id;} 749if('after'==params['show_here']['where']){jQuery(params['show_here']['jq_node']).after(spinner_html);}else{jQuery(params['show_here']['jq_node']).html(spinner_html);}} 750function wpbc__spin_loader__mini__hide(parent_html_id){jQuery('#wpbc_mini_spin_loader'+parent_html_id).remove();} 751function wpbc_show_thank_you_message_after_booking(response_data){if('undefined'!==typeof response_data['ajx_confirmation']['ty_is_redirect']&&'undefined'!==typeof response_data['ajx_confirmation']['ty_url']&&'page'==response_data['ajx_confirmation']['ty_is_redirect']&&''!=response_data['ajx_confirmation']['ty_url']){jQuery('body').trigger('wpbc_booking_created',[response_data['resource_id'],response_data]);window.location.href=response_data['ajx_confirmation']['ty_url'];return;} 752var resource_id=response_data['resource_id'];var confirm_content='';if('undefined'===typeof response_data['ajx_confirmation']['ty_message']){response_data['ajx_confirmation']['ty_message']='';} 753if('undefined'===typeof response_data['ajx_confirmation']['ty_payment_payment_description']){response_data['ajx_confirmation']['ty_payment_payment_description']='';} 754if('undefined'===typeof response_data['ajx_confirmation']['payment_cost']){response_data['ajx_confirmation']['payment_cost']='';} 755if('undefined'===typeof response_data['ajx_confirmation']['ty_payment_gateways']){response_data['ajx_confirmation']['ty_payment_gateways']='';} 756var ty_message_hide=''==response_data['ajx_confirmation']['ty_message']?'wpbc_ty_hide':'';var ty_payment_payment_description_hide=''==response_data['ajx_confirmation']['ty_payment_payment_description'].replace(/\\n
756/g,'')?'wpbc_ty_hide':'';var ty_booking_costs_hide=''==response_data['ajx_confirmation']['payment_cost']?'wpbc_ty_hide':'';var ty_payment_gateways_hide=''==response_data['ajx_confirmation']['ty_payment_gateways'].replace(/\\n/g,'')?'wpbc_ty_hide':'';if('wpbc_ty_hide'!=ty_payment_gateways_hide){jQuery('.wpbc_ty__content_text.wpbc_ty__content_gateways').html('');} 757confirm_content+=`<div id="wpbc_scroll_point_${resource_id}"></div>`;confirm_content+=` <div class="wpbc_after_booking_thank_you_section">`;confirm_content+=` <div class="wpbc_ty__message ${ty_message_hide}">${response_data['ajx_confirmation']['ty_message']}</div>`;confirm_content+=` <div class="wpbc_ty__container">`;if(''!==response_data['ajx_confirmation']['ty_message_booking_id']){confirm_content+=` <div class="wpbc_ty__header">${response_data['ajx_confirmation']['ty_message_booking_id']}</div>`;} 758confirm_content+=` <div class="wpbc_ty__content">`;confirm_content+=` <div class="wpbc_ty__content_text wpbc_ty__payment_description ${ty_payment_payment_description_hide}">${response_data['ajx_confirmation']['ty_payment_payment_description'].replace(/\\n
758/g, '')}</div>`;if(''!==response_data['ajx_confirmation']['ty_customer_details']){confirm_content+=` <div class="wpbc_ty__content_text wpbc_cols_2">${response_data['ajx_confirmation']['ty_customer_details']}</div>`;} 759if(''!==response_data['ajx_confirmation']['ty_booking_details']){confirm_content+=` <div class="wpbc_ty__content_text wpbc_cols_2">${response_data['ajx_confirmation']['ty_booking_details']}</div>`;} 760confirm_content+=` <div class="wpbc_ty__content_text wpbc_ty__content_costs ${ty_booking_costs_hide}">${response_data['ajx_confirmation']['ty_booking_costs']}</div>`;confirm_content+=` <div class="wpbc_ty__content_text wpbc_ty__content_gateways ${ty_payment_gateways_hide}">${response_data['ajx_confirmation']['ty_payment_gateways'].replace(/\\n/g, '').replace(/ajax_script/gi, 'script')}</div>`;confirm_content+=` </div>`;confirm_content+=` </div>`;confirm_content+=`</div>`;jQuery('#booking_form'+resource_id).after(confirm_content);jQuery('body').trigger('wpbc_booking_created',[resource_id,response_data]);};var start_time_checking_index;function wpbc_is_date_has_only_working_time_limits_for_dots(date_bookings_obj,child_resources_arr){var has_working_time_limits=false;var has_real_time_limits=false;var resource_day_obj;var time_details_obj;var time_details;var source_type;if((!date_bookings_obj)||(null===child_resources_arr)){return false;} 761if((date_bookings_obj['summary'])&&(date_bookings_obj['summary']['status_for_bookings'])&&(''!==date_bookings_obj['summary']['status_for_bookings'])){return false;} 762for(var i=0;i<child_resources_arr.length;i++){resource_day_obj=date_bookings_obj[child_resources_arr[i]];if(!resource_day_obj){continue;} 763time_details_obj=resource_day_obj['__booked__times__details'];if(!time_details_obj){if((resource_day_obj.booked_time_slots)&&(resource_day_obj.booked_time_slots.merged_seconds)&&(resource_day_obj.booked_time_slots.merged_seconds.length>0)){has_real_time_limits=true;} 764continue;} 765for(var time_key in time_details_obj){if(!time_details_obj.hasOwnProperty(time_key)){continue;} 766time_details=time_details_obj[time_key];source_type=(time_details&&('undefined'!==typeof(time_details['source_type'])))?time_details['source_type']:'booking';if('working_time'===source_type){has_working_time_limits=true;}else{has_real_time_limits=true;}}} 767return(has_working_time_limits&&!has_real_time_limits);} 768function wpbc_show_date_info_top(param_calendar_id,my_thisDateTime){var resource_id=parseInt(param_calendar_id.replace("calendar_booking",''));if(isNaN(resource_id)){return'';} 769var child_resources_arr=wpbc_clone_obj(_wpbc.booking__get_param_value(resource_id,'resources_id_arr__in_dates'));var sql_date=wpbc__get__sql_class_date(new Date(my_thisDateTime));var date_bookings_obj=_wpbc.bookings_in_calendar__get_for_date(resource_id,sql_date);if(wpbc_is_date_has_only_working_time_limits_for_dots(date_bookings_obj,child_resources_arr)){return'';} 770var child_resource_id;var merged_seconds;var dots_count=0;var dots_in__resources=[];if(child_resources_arr!==null){for(child_resource_id of child_resources_arr){if(false!==date_bookings_obj){merged_seconds=date_bookings_obj[child_resource_id].booked_time_slots.merged_seconds;}else{merged_seconds=[];} 771if(0===merged_seconds.length){return'';} 772for(var i=0;i<merged_seconds.length;i++){if(!wpbc_is_this_timeslot__full_day_booked(merged_seconds[i])){dots_count++;}} 773dots_in__resources.push(dots_count);dots_count=0;}} 774var dots_count_max=Math.max.apply(Math,dots_in__resources);var dot_content='';for(var d=0;d<dots_count_max;d++){dot_content+='·';} 775dot_content=(''!==dot_content)?'<div class="wpbc_time_dots">'+dot_content+'</div>':'';return dot_content;} 776function wpbc_show_date_info_bottom(param_calendar_id,my_thisDateTime){var bottom_hint_arr=[];if(typeof(wpbc_show_day_cost_in_date_bottom)=='function'){var cost_hint=wpbc_show_day_cost_in_date_bottom(param_calendar_id,my_thisDateTime);if(''!==cost_hint){bottom_hint_arr.push(wpbc_show_day_cost_in_date_bottom(param_calendar_id,my_thisDateTime));}} 777var availability=wpbc_get_in_date_availability_hint(param_calendar_id,my_thisDateTime) 778if(''!==availability){bottom_hint_arr.push(availability);} 779var bottom_hint=bottom_hint_arr.join('');return bottom_hint;}
780function wpbc_get_in_date_availability_hint(param_calendar_id,my_thisDateTime){var resource_id=parseInt(param_calendar_id.replace("calendar_booking",''));var sql_date=wpbc__get__sql_class_date(new Date(my_thisDateTime));var hint__in_day__availability='';var get_for_date_obj=_wpbc.bookings_in_calendar__get_for_date(resource_id,sql_date);if(false!==get_for_date_obj){if((undefined!=get_for_date_obj['summary'])&&(undefined!=get_for_date_obj['summary'].hint__in_day__availability)){hint__in_day__availability=get_for_date_obj['summary'].hint__in_day__availability;}} 781return hint__in_day__availability;} 782jQuery(window).on('scroll',function(event){if('function'===typeof(wpbc_tippy)){wpbc_tippy.hideAll();}});function wpbc_is_time_field_in_booking_form(resource_id,form_elements){var count=form_elements.length;var start_time=false;var end_time=false;var duration=false;var element;for(var i=0;i<count;i++){element=form_elements[i];if(jQuery(element).closest('.booking_form_garbage').length){continue;} 783if((element.name!=undefined)&&(element.name.indexOf('hint')!==-1)){var my_element=element.name;if(my_element.indexOf('rangetime')!==-1){return true;} 784if((my_element.indexOf('durationtime')!==-1)){duration=element.value;} 785if(my_element.indexOf('starttime')!==-1){start_time=element.value;} 786if(my_element.indexOf('endtime')!==-1){end_time=element.value;}}} 787if((duration!==false)&&(start_time!==false)){return true;} 788if((start_time!==false)&&(end_time!==false)){return true;} 789return false;} 790function wpbc_is_change_over_enabled_for_resource(resource_id){if(('undefined'!==typeof resource_id)&&(null!==resource_id)){var resource_change_over=_wpbc.calendar__get_param_value(resource_id,'is_enabled_change_over');if(''!==resource_change_over){return(true===resource_change_over)||('true'===resource_change_over);}} 791return true===_wpbc.get_other_param('is_enabled_change_over');} 792function wpbc_is_time_in_the_past_for_today(myTime,sort_date_array,resource_id){var allow_past_context=_wpbc.get_other_param('this_page_allow_past');var edit_booking_hash_context=_wpbc.get_other_param('this_page_booking_hash');if(('1'===String(allow_past_context))||(1===allow_past_context)||(true===allow_past_context)||(''!==String(edit_booking_hash_context||''))||(location.href.indexOf('booking_hash')>-1)||(location.href.indexOf('allow_past')>-1)){return false;} 793if(true===wpbc_is_change_over_enabled_for_resource(resource_id)){return false;} 794var date_to_check=sort_date_array[0];if(parseInt(date_to_check[0])<parseInt(_wpbc.get_other_param('today_arr')[0])){return true;} 795if((parseInt(date_to_check[0])==parseInt(_wpbc.get_other_param('today_arr')[0]))&&(parseInt(date_to_check[1])<parseInt(_wpbc.get_other_param('today_arr')[1]))){return true;} 796if((parseInt(date_to_check[0])==parseInt(_wpbc.get_other_param('today_arr')[0]))&&(parseInt(date_to_check[1])==parseInt(_wpbc.get_other_param('today_arr')[1]))&&(parseInt(date_to_check[2])<parseInt(_wpbc.get_other_param('today_arr')[2]))){return true;} 797if((parseInt(date_to_check[0])==parseInt(_wpbc.get_other_param('today_arr')[0]))&&(parseInt(date_to_check[1])==parseInt(_wpbc.get_other_param('today_arr')[1]))&&(parseInt(date_to_check[2])==parseInt(_wpbc.get_other_param('today_arr')[2]))){var mytime_value=myTime.split(":");mytime_value=parseInt(mytime_value[0])*60+parseInt(mytime_value[1]);var current_time_value=parseInt(_wpbc.get_other_param('today_arr')[3])*60+parseInt(_wpbc.get_other_param('today_arr')[4]);if(current_time_value>mytime_value){return true;}} 798return false;} 799function wpbc_is_valid_time_string(time_str){if(typeof time_str!=='string'){return false;} 800const str=time_str.trim();if(str===''){return false;} 801const match=str.match(/^(\d{1,2}):(\d{2})(?:\s*([AaPp][Mm]))?$/);if(!match){return false;} 802const hour=Number(match[1]);const minute=Number(match[2]);const ampm=match[3]?match[3].toUpperCase():null;if(!Number.isInteger(hour)||!Number.isInteger(minute)){return false;} 803if(minute<0||minute>59){return false;} 804if(ampm){return hour>=1&&hour<=12;} 805if(hour<0||hour>24){return false;} 806if(hour===24&&minute!==0){return false;} 807return true;}
808function wpbc_is_this_time_selection_not_available(resource_id,form_elements){if((location.href.indexOf('page=wpbc')>0)&&(location.href.indexOf('tab=add-booking')>0)){return false;} 809var count=form_elements.length;var start_time=false;var end_time=false;var duration=false;var element;var element_start=false;var element_end=false;var element_duration=false;var element_rangetime=false;for(var i=0;i<count;i++){element=form_elements[i];if(jQuery(element).closest('.booking_form_garbage').length){continue;} 810if('1'===String(jQuery(element).attr('data-wpbc-booking-submit-ignore')||'')){continue;} 811if((element.name!=undefined)&&(element.name.indexOf('hint')===-1)){var my_element=element.name;if(my_element.indexOf('rangetime')!==-1){if(element.value==''){var notice_message_id=wpbc_front_end__show_message__warning(element,_wpbc.get_message('message_check_required'),'text');return true;} 812var my_rangetime=element.value.split('-');if(my_rangetime.length>1){start_time=my_rangetime[0].replace(/(^\s+)|(\s+$)/g,"");end_time=my_rangetime[1].replace(/(^\s+)|(\s+$)/g,"");element_rangetime=element;}} 813if((my_element.indexOf('durationtime')!==-1)){duration=element.value;element_duration=element;} 814if(my_element.indexOf('starttime')!==-1){start_time=element.value;element_start=element;} 815if(my_element.indexOf('endtime')!==-1){end_time=element.value;element_end=element;}}} 816if((duration!==false)&&(start_time!==false)){var mylocalstarttime=start_time.split(':');var d=new Date(1980,1,1,mylocalstarttime[0],mylocalstarttime[1],0);var my_duration=duration.split(':');my_duration=my_duration[0]*60*60*1000+my_duration[1]*60*1000;d.setTime(d.getTime()+my_duration);var my_hours=d.getHours();if(my_hours<10)my_hours='0'+(my_hours+'');var my_minutes=d.getMinutes();if(my_minutes<10)my_minutes='0'+(my_minutes+'');end_time=(my_hours+'')+':'+(my_minutes+'');
816if(end_time=='00:00')end_time='23:59';} 817if((start_time===false)||(end_time===false)){return false;}else{var valid_time=true;if((start_time=='')||(end_time==''))valid_time=false;if(!wpbc_is_valid_time_string(start_time))valid_time=false;if(!wpbc_is_valid_time_string(end_time))valid_time=false;if(valid_time===true) 818if((typeof(checkRecurentTimeInside)=='function')&&(_wpbc.get_other_param('is_enabled_booking_recurrent_time')==true)){valid_time=checkRecurentTimeInside([start_time,end_time],resource_id);}else{if(typeof(checkTimeInside)=='function'){valid_time=checkTimeInside(start_time,true,resource_id);} 819if(valid_time===true){if(typeof(checkTimeInside)=='function'){valid_time=checkTimeInside(end_time,false,resource_id);}}} 820if(valid_time!==true){if((wpbc_is_change_over_enabled_for_resource(resource_id))&&(element_start!==false)&&(element_end!==false)){wpbc_front_end__show_message__warning('#booking_form_div'+resource_id+' .bk_calendar_frame',_wpbc.get_message('message_check_no_selected_dates'),'text');} 821if(element_rangetime!==false){wpbc_front_end__show_message__warning_under_element(element_rangetime,_wpbc.get_message('message_error_range_time'),'text');} 822if(element_duration!==false){wpbc_front_end__show_message__warning_under_element(element_duration,_wpbc.get_message('message_error_duration_time'),'text');} 823if(element_start!==false){wpbc_front_end__show_message__warning_under_element(element_start,_wpbc.get_message('message_error_start_time'),'text');} 824if(element_end!==false){wpbc_front_end__show_message__warning_under_element(element_end,_wpbc.get_message('message_error_end_time'),'text');} 825return true;}else{return false;}}} 826function checkTimeInside(mytime,is_start_time,bk_type){var my_dates_str=document.getElementById('date_booking'+bk_type).value;if(my_dates_str.indexOf(' - ')!=0){my_dates_str=my_dates_str.replace(' - ',', ');} 827return checkTimeInsideProcess(mytime,is_start_time,bk_type,my_dates_str);} 828function checkRecurentTimeInside(my_rangetime,bk_type){var valid_time=true;var my_dates_str=document.getElementById('date_booking'+bk_type).value;var date_array=my_dates_str.split(", ");if(date_array.length==2){if(date_array[0]==date_array[1]){date_array=[date_array[0]];}} 829var temp_date_str='';for(var i=0;i<date_array.length;i++){temp_date_str=date_array[i];if(checkTimeInsideProcess(my_rangetime[0],true,bk_type,temp_date_str)==false)valid_time=false;if(checkTimeInsideProcess(my_rangetime[1],false,bk_type,temp_date_str)==false)valid_time=false;} 830return valid_time;} 831function checkTimeInsideProcess(mytime,is_start_time,bk_type,my_dates_str){var i,h,s,m;var date_array=my_dates_str.split(',');date_array=date_array.map(function(s){return s.trim();});if(date_array.length==2){if(date_array[0]==date_array[1]){date_array=[date_array[0]];}} 832var temp_elemnt;var td_class;var sort_date_array=[];var work_date_array=[];var times_array=[];var is_check_for_time;for(var i=0;i<date_array.length;i++){temp_elemnt=date_array[i].split(".");sort_date_array[i]=[temp_elemnt[2],temp_elemnt[1]+'',temp_elemnt[0]+''];} 833sort_date_array.sort();for(i=0;i<sort_date_array.length;i++){sort_date_array[i]=[parseInt(sort_date_array[i][0]*1),parseInt(sort_date_array[i][1]*1),parseInt(sort_date_array[i][2]*1)];} 834if(is_start_time){if(wpbc_is_time_in_the_past_for_today(mytime,sort_date_array,bk_type)){return false;}} 835work_date_array=sort_date_array;for(var j=0;j<work_date_array.length;j++){td_class=work_date_array[j][1]+'-'+work_date_array[j][2]+'-'+work_date_array[j][0];if((j==0)||(j==(work_date_array.length-1)))is_check_for_time=true;else is_check_for_time=false;} 836if(is_start_time)work_date_array=sort_date_array[0];else work_date_array=sort_date_array[sort_date_array.length-1];td_class=work_date_array[1]+'-'+work_date_array[2]+'-'+work_date_array[0];times_array.sort();var times_in_day=[];var times_in_day_interval_marks=[];for(i=0;i<times_array.length;i++){s=times_array[i][2];if((s==2)&&(i==0)){times_in_day[times_in_day.length]=0;times_in_day_interval_marks[times_in_day_interval_marks.length]=1;} 837times_in_day[times_in_day.length]=times_array[i][0]*60+parseInt(times_array[i][1]);times_in_day_interval_marks[times_in_day_interval_marks.length]=s;if((s==1)&&(i==(times_array.length-1))){times_in_day[times_in_day.length]=(24*60);times_in_day_interval_marks[times_in_day_interval_marks.length]=2;}} 838var mytime_value=mytime.split(":");mytime_value=mytime_value[0]*60+parseInt(mytime_value[1]);var start_i=0;if(start_time_checking_index!=undefined) 839if(start_time_checking_index[0]!=undefined) 840if((!is_start_time)&&(sort_date_array.length==1)){start_i=start_time_checking_index[0];} 841i=start_i;for(i=start_i;i<times_in_day.length;i++){times_in_day[i]=parseInt(times_in_day[i]);mytime_value=parseInt(mytime_value);if(is_start_time){if(mytime_value>times_in_day[i]){}
841else if(mytime_value==times_in_day[i]){if(times_in_day_interval_marks[i]==1){return false;}else{if((i+1)<=(times_in_day.length-1)){if(times_in_day[i+1]<=mytime_value)return false;else{if(sort_date_array.length>1) 842if((i+1)<=(times_in_day.length-1))return false;start_time_checking_index=[i,td_class,mytime_value];return true;}} 843if(sort_date_array.length>1) 844if((i+1)<=(times_in_day.length-1))return false;start_time_checking_index=[i,td_class,mytime_value];return true;}}else if(mytime_value<times_in_day[i]){if(times_in_day_interval_marks[i]==2){return false;}else{if(sort_date_array.length>1) 845if((i+1)<=(times_in_day.length-1))return false;start_time_checking_index=[i,td_class,mytime_value];return true;}}}else{if(sort_date_array.length==1){if(start_time_checking_index!=undefined) 846if(start_time_checking_index[2]!=undefined) 847if((start_time_checking_index[2]==times_in_day[i])&&(times_in_day_interval_marks[i]==2)){}else if(times_in_day[i]<mytime_value)return false;else{if(start_time_checking_index[2]>=mytime_value)return false;return true;}}else{if(times_in_day[i]<mytime_value)return false;else return true;}}} 848if(is_start_time)start_time_checking_index=[i,td_class,mytime_value];else{if(start_time_checking_index!=undefined) 849if(start_time_checking_index[2]!=undefined) 850if((sort_date_array.length==1)&&(start_time_checking_index[2]>=mytime_value))return false;} 851return true;};(function($){function wpbc_timeselector_normalize_options(option_records){var normalized_options=[];var selected_option_index=-1;$.each(Array.isArray(option_records)?option_records:[],function(index,option_record){var option_value=('undefined'===typeof option_record.value||null===option_record.value)?'':option_record.value;if(''===String(option_value).trim()){return;} 852normalized_options.push({title:('undefined'===typeof option_record.title||null===option_record.title)?'':option_record.title,value:option_value,disabled:!!option_record.disabled,selected:!!option_record.selected});if(-1===selected_option_index&&!option_record.disabled&&option_record.selected){selected_option_index=normalized_options.length-1;}});if(-1===selected_option_index){$.each(normalized_options,function(index,option_record){if(!option_record.disabled){selected_option_index=index;return false;}});} 853$.each(normalized_options,function(index,option_record){option_record.selected=index===selected_option_index;});return normalized_options;} 854$.fn.extend({wpbc_timeselector:function(){var times_options=[];this.each(function(){var el=$(this);var native_selected_option=el.find('option:selected').first();var native_selected_value=native_selected_option.length?String(native_selected_option.val()):'';var automatic_selection_value=el.attr('data-wpbc-time-picker-auto-value');var has_explicit_native_selection=(native_selected_option.length&&!native_selected_option.is(':disabled')&&''!==native_selected_value.trim()&&automatic_selection_value!==native_selected_value);if(el.parent().find('.wpbc_times_selector').length){el.parent().find('.wpbc_times_selector').remove();} 855el.find('option').each(function(ind){times_options.push({title:jQuery(this).text(),value:jQuery(this).val(),disabled:jQuery(this).is(':disabled'),selected:jQuery(this).is(':selected')});});times_options=wpbc_timeselector_normalize_options(times_options);$.each(times_options,function(index,option_record){if(option_record.selected){var selected_time_value=String(option_record.value);el.val(selected_time_value);if(has_explicit_native_selection){el.removeAttr('data-wpbc-time-picker-auto-value');}else{el.attr('data-wpbc-time-picker-auto-value',selected_time_value);} 856return false;}});var times_options_element=$.fn.wpbc_timeselector.format(times_options);el.after(times_options_element);el.next('.wpbc_times_selector').find('div').not('.wpbc_time_picker_disabled').on("click",function(){var selected_value=jQuery(this).attr('data-value');jQuery(this).parent('.wpbc_times_selector').find('.wpbc_time_selected').removeClass('wpbc_time_selected');jQuery(this).addClass('wpbc_time_selected');el.find('option').prop('selected',false);el.find('option').filter(function(){return selected_value===jQuery(this).val();}).prop('selected',true);el.removeAttr('data-wpbc-time-picker-auto-value');el.trigger('change');});el.next('.wpbc_times_selector').find('div').not('.wpbc_time_picker_disabled').on("keypress",function(event){if(13===event.which){event.preventDefault();console.log(jQuery(this));jQuery(this).trigger('click');}});el.hide();times_options=[];});return this;}});$.fn.wpbc_timeselector.format=function(el_arr){var times_selector=jQuery(document.createElement('div')).addClass('wpbc_times_selector');var has_available_times=false;
856var normalized_options=wpbc_timeselector_normalize_options(el_arr);$.each(normalized_options,function(index,el_item){if(!el_item.disabled){var time_option_value=('undefined'===typeof el_item.value||null===el_item.value)?'':el_item.value;var time_option_title=('undefined'===typeof el_item.title||null===el_item.title)?'':el_item.title;var time_option=jQuery(document.createElement('div')).attr('data-value',String(time_option_value)).attr('tabindex','0').text(String(time_option_title));if(el_item.selected){time_option.addClass('wpbc_time_selected');} 857times_selector.append(time_option);has_available_times=true;}else{}});if(!has_available_times){times_selector.append(jQuery(document.createElement('span')).addClass('wpbc_no_time_pickers').text('No available times'));} 858return times_selector;};})(jQuery);function wpbc_hook__destroy_timeselector(context){var selector='select[name^="rangetime"], select[name^="starttime"], select[name^="endtime"], select[name^="durationtime"]';var scope=context?jQuery(context):jQuery(document);scope.find('.wpbc_times_selector').remove();scope.find(selector).each(function(){var select_element=jQuery(this);var current_value=select_element.val();var automatic_value=select_element.attr('data-wpbc-time-picker-auto-value');current_value=('undefined'===typeof current_value||null===current_value)?'':String(current_value);if('undefined'!==typeof automatic_value&&automatic_value===current_value){var placeholder_option=select_element.find('option').filter(function(){var option_value=jQuery(this).val();return'undefined'===typeof option_value||null===option_value||''===String(option_value).trim();}).first();if(placeholder_option.length){select_element.val(placeholder_option.val());}} 859select_element.removeAttr('data-wpbc-time-picker-auto-value').show();});} 860function wpbc_hook__init_timeselector(){if(('object'!==typeof window._wpbc)||('function'!==typeof window._wpbc.get_other_param)){return false;} 861if(true!==window._wpbc.get_other_param('is_enabled_booking_timeslot_picker')){return true;} 862jQuery('select[name^="rangetime"]').wpbc_timeselector();jQuery('select[name^="starttime"]').wpbc_timeselector();jQuery('select[name^="endtime"]').wpbc_timeselector();jQuery('select[name^="durationtime"]').wpbc_timeselector();jQuery(".booking_form_div").on('wpbc_hook_timeslots_disabled',function(event,bk_type,all_dates){jQuery('#booking_form_div'+bk_type+' select[name^="rangetime"]').wpbc_timeselector();jQuery('#booking_form_div'+bk_type+' select[name^="starttime"]').wpbc_timeselector();jQuery('#booking_form_div'+bk_type+' select[name^="endtime"]').wpbc_timeselector();jQuery('#booking_form_div'+bk_type+' select[name^="durationtime"]').wpbc_timeselector();});return true;} 863function wpbc_init_timeselector_when_wpbc_ready(){if(wpbc_hook__init_timeselector()){return;} 864var wpbc_timeselector_ready_handler=function(){if(wpbc_hook__init_timeselector()){document.removeEventListener('wpbc-ready',wpbc_timeselector_ready_handler);}};document.addEventListener('wpbc-ready',wpbc_timeselector_ready_handler);} 865jQuery(document).ready(function(){wpbc_init_timeselector_when_wpbc_ready();});;(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?factory(exports):typeof define==='function'&&define.amd?define(['exports'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,factory(global.IMask={}));})(this,(function(exports){'use strict';function isString(str){return typeof str==='string'||str instanceof String;} 866function isObject(obj){var _obj$constructor;return typeof obj==='object'&&obj!=null&&(obj==null||(_obj$constructor=obj.constructor)==null?void 0:_obj$constructor.name)==='Object';} 867function pick(obj,keys){if(Array.isArray(keys))return pick(obj,(_,k)=>keys.includes(k));return Object.entries(obj).reduce((acc,_ref)=>{let[k,v]=_ref;if(keys(v,k))acc[k]=v;return acc;},{});} 868const DIRECTION={NONE:'NONE',LEFT:'LEFT',FORCE_LEFT:'FORCE_LEFT',RIGHT:'RIGHT',FORCE_RIGHT:'FORCE_RIGHT'};function forceDirection(direction){switch(direction){case DIRECTION.LEFT:return DIRECTION.FORCE_LEFT;case DIRECTION.RIGHT:return DIRECTION.FORCE_RIGHT;default:return direction;}} 869function escapeRegExp(str){return str.replace(/([.*+?^=!:${}()|[\]/\\])/g,'\\$1');} 870function objectIncludes(b,a){if(a===b)return true;const arrA=Array.isArray(a),arrB=Array.isArray(b);let i;if(arrA&&arrB){if(a.length!=b.length)return false;for(i=0;i<a.length;i++)if(!objectIncludes(a[i],b[i]))return false;return true;} 871if(arrA!=arrB)return false;if(a&&b&&typeof a==='object'&&typeof b==='object'){const dateA=a instanceof Date,dateB=b instanceof Date;if(dateA&&dateB)return a.getTime()==b.getTime();if(dateA!=dateB)return false;const regexpA=a instanceof RegExp,regexpB=b instanceof RegExp;if(regexpA&®expB)return a.toString()==b.toString();if(regexpA!=regexpB)return false;const keys=Object.keys(a);for(i=0;i<keys.length;i++)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return false;for(i=0;i<keys.length;i++)if(!objectIncludes(b[keys[i]],a[keys[i]]))return false;return true;}else if(a&&b&&typeof a==='function'&&typeof b==='function'){return a.toString()===b.toString();} 872return false;}
vendor: 7,045 bytes, lines 873-917
873class ActionDetails{constructor(opts){Object.assign(this,opts);while(this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos)){--this.oldSelection.start;} 874if(this.insertedCount){while(this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end)){if(this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end)++this.oldSelection.end;else++this.cursorPos;}}} 875get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start);} 876get insertedCount(){return this.cursorPos-this.startChangePos;} 877get inserted(){return this.value.substr(this.startChangePos,this.insertedCount);} 878get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0);} 879get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount);} 880get head(){return this.value.substring(0,this.startChangePos);} 881get tail(){return this.value.substring(this.startChangePos+this.insertedCount);} 882get removeDirection(){if(!this.removedCount||this.insertedCount)return DIRECTION.NONE;return(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?DIRECTION.RIGHT:DIRECTION.LEFT;}} 883function IMask(el,opts){return new IMask.InputMask(el,opts);} 884function maskedClass(mask){if(mask==null)throw new Error('mask property should be defined');if(mask instanceof RegExp)return IMask.MaskedRegExp;if(isString(mask))return IMask.MaskedPattern;if(mask===Date)return IMask.MaskedDate;if(mask===Number)return IMask.MaskedNumber;if(Array.isArray(mask)||mask===Array)return IMask.MaskedDynamic;if(IMask.Masked&&mask.prototype instanceof IMask.Masked)return mask;if(IMask.Masked&&mask instanceof IMask.Masked)return mask.constructor;if(mask instanceof Function)return IMask.MaskedFunction;console.warn('Mask not found for mask',mask);return IMask.Masked;} 885function normalizeOpts(opts){if(!opts)throw new Error('Options in not defined');if(IMask.Masked){if(opts.prototype instanceof IMask.Masked)return{mask:opts};const{mask=undefined,...instanceOpts}=opts instanceof IMask.Masked?{mask:opts}:isObject(opts)&&opts.mask instanceof IMask.Masked?opts:{};if(mask){const _mask=mask.mask;return{...pick(mask,(_,k)=>!k.startsWith('_')),mask:mask.constructor,_mask,...instanceOpts};}} 886if(!isObject(opts))return{mask:opts};return{...opts};} 887function createMask(opts){if(IMask.Masked&&opts instanceof IMask.Masked)return opts;const nOpts=normalizeOpts(opts);const MaskedClass=maskedClass(nOpts.mask);if(!MaskedClass)throw new Error("Masked class is not found for provided mask "+nOpts.mask+", appropriate module needs to be imported manually before creating mask.");if(nOpts.mask===MaskedClass)delete nOpts.mask;if(nOpts._mask){nOpts.mask=nOpts._mask;delete nOpts._mask;} 888return new MaskedClass(nOpts);} 889IMask.createMask=createMask;class MaskElement{get selectionStart(){let start;try{start=this._unsafeSelectionStart;}catch{} 890return start!=null?start:this.value.length;} 891get selectionEnd(){let end;try{end=this._unsafeSelectionEnd;}catch{} 892return end!=null?end:this.value.length;} 893select(start,end){if(start==null||end==null||start===this.selectionStart&&end===this.selectionEnd)return;try{this._unsafeSelect(start,end);}catch{}} 894get isActive(){return false;}} 895IMask.MaskElement=MaskElement;const KEY_Z=90;const KEY_Y=89;class HTMLMaskElement extends MaskElement{constructor(input){super();this.input=input;this._onKeydown=this._onKeydown.bind(this);this._onInput=this._onInput.bind(this);this._onBeforeinput=this._onBeforeinput.bind(this);this._onCompositionEnd=this._onCompositionEnd.bind(this);} 896get rootElement(){var _this$input$getRootNo,_this$input$getRootNo2,_this$input;return(_this$input$getRootNo=(_this$input$getRootNo2=(_this$input=this.input).getRootNode)==null?void 0:_this$input$getRootNo2.call(_this$input))!=null?_this$input$getRootNo:document;} 897get isActive(){return this.input===this.rootElement.activeElement;} 898bindEvents(handlers){this.input.addEventListener('keydown',this._onKeydown);this.input.addEventListener('input',this._onInput);this.input.addEventListener('beforeinput',this._onBeforeinput);this.input.addEventListener('compositionend',this._onCompositionEnd);this.input.addEventListener('drop',handlers.drop);this.input.addEventListener('click',handlers.click);this.input.addEventListener('focus',handlers.focus);this.input.addEventListener('blur',handlers.commit);this._handlers=handlers;} 899_onKeydown(e){if(this._handlers.redo&&(e.keyCode===KEY_Z&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===KEY_Y&&e.ctrlKey)){e.preventDefault();return this._handlers.redo(e);} 900if(this._handlers.undo&&e.keyCode===KEY_Z&&(e.metaKey||e.ctrlKey)){e.preventDefault();return this._handlers.undo(e);} 901if(!e.isComposing)this._handlers.selectionChange(e);} 902_onBeforeinput(e){if(e.inputType==='historyUndo'&&this._handlers.undo){e.preventDefault();return this._handlers.undo(e);} 903if(e.inputType==='historyRedo'&&this._handlers.redo){e.preventDefault();return this._handlers.redo(e);}} 904_onCompositionEnd(e){this._handlers.input(e);} 905_onInput(e){if(!e.isComposing)this._handlers.input(e);} 906unbindEvents(){this.input.removeEventListener('keydown',this._onKeydown);this.input.removeEventListener('input',this._onInput);this.input.removeEventListener('beforeinput',this._onBeforeinput);this.input.removeEventListener('compositionend',this._onCompositionEnd);this.input.removeEventListener('drop',this._handlers.drop);this.input.removeEventListener('click',this._handlers.click);this.input.removeEventListener('focus',this._handlers.focus);this.input.removeEventListener('blur',this._handlers.commit);this._handlers={};}} 907IMask.HTMLMaskElement=HTMLMaskElement;class HTMLInputMaskElement extends HTMLMaskElement{constructor(input){super(input);this.input=input;} 908get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length;} 909get _unsafeSelectionEnd(){return this.input.selectionEnd;} 910_unsafeSelect(start,end){this.input.setSelectionRange(start,end);} 911get value(){return this.input.value;} 912set value(value){this.input.value=value;}} 913IMask.HTMLMaskElement=HTMLMaskElement;class HTMLContenteditableMaskElement extends HTMLMaskElement{get _unsafeSelectionStart(){const root=this.rootElement;const selection=root.getSelection&&root.getSelection();const anchorOffset=selection&&selection.anchorOffset;const focusOffset=selection&&selection.focusOffset;if(focusOffset==null||anchorOffset==null||anchorOffset<focusOffset){return anchorOffset;} 914return focusOffset;} 915get _unsafeSelectionEnd(){const root=this.rootElement;const selection=root.getSelection&&root.getSelection();const anchorOffset=selection&&selection.anchorOffset;const focusOffset=selection&&selection.focusOffset;if(focusOffset==null||anchorOffset==null||anchorOffset>focusOffset){return anchorOffset;} 916return focusOffset;} 917_unsafeSelect(start,end){if(!this.rootElement.createRange)return;const range=this.rootElement.createRange();range.setStart(this.input.firstChild||this.input,start);
vendor: 5,252 bytes, lines 917-953
917range.setEnd(this.input.lastChild||this.input,end);const root=this.rootElement;const selection=root.getSelection&&root.getSelection();if(selection){selection.removeAllRanges();selection.addRange(range);}} 918get value(){return this.input.textContent||'';} 919set value(value){this.input.textContent=value;}} 920IMask.HTMLContenteditableMaskElement=HTMLContenteditableMaskElement;class InputHistory{constructor(){this.states=[];this.currentIndex=0;} 921get currentState(){return this.states[this.currentIndex];} 922get isEmpty(){return this.states.length===0;} 923push(state){if(this.currentIndex<this.states.length-1)this.states.length=this.currentIndex+1;this.states.push(state);if(this.states.length>InputHistory.MAX_LENGTH)this.states.shift();this.currentIndex=this.states.length-1;} 924go(steps){this.currentIndex=Math.min(Math.max(this.currentIndex+steps,0),this.states.length-1);return this.currentState;} 925undo(){return this.go(-1);} 926redo(){return this.go(+1);} 927clear(){this.states.length=0;this.currentIndex=0;}} 928InputHistory.MAX_LENGTH=100;class InputMask{constructor(el,opts){this.el=el instanceof MaskElement?el:el.isContentEditable&&el.tagName!=='INPUT'&&el.tagName!=='TEXTAREA'?new HTMLContenteditableMaskElement(el):new HTMLInputMaskElement(el);this.masked=createMask(opts);this._listeners={};this._value='';this._unmaskedValue='';this._rawInputValue='';this.history=new InputHistory();this._saveSelection=this._saveSelection.bind(this);this._onInput=this._onInput.bind(this);this._onChange=this._onChange.bind(this);this._onDrop=this._onDrop.bind(this);this._onFocus=this._onFocus.bind(this);this._onClick=this._onClick.bind(this);this._onUndo=this._onUndo.bind(this);this._onRedo=this._onRedo.bind(this);this.alignCursor=this.alignCursor.bind(this);this.alignCursorFriendly=this.alignCursorFriendly.bind(this);this._bindEvents();this.updateValue();this._onChange();} 929maskEquals(mask){var _this$masked;return mask==null||((_this$masked=this.masked)==null?void 0:_this$masked.maskEquals(mask));} 930get mask(){return this.masked.mask;} 931set mask(mask){if(this.maskEquals(mask))return;if(!(mask instanceof IMask.Masked)&&this.masked.constructor===maskedClass(mask)){this.masked.updateOptions({mask});return;} 932const masked=mask instanceof IMask.Masked?mask:createMask({mask});masked.unmaskedValue=this.masked.unmaskedValue;this.masked=masked;} 933get value(){return this._value;} 934set value(str){if(this.value===str)return;this.masked.value=str;this.updateControl('auto');} 935get unmaskedValue(){return this._unmaskedValue;} 936set unmaskedValue(str){if(this.unmaskedValue===str)return;this.masked.unmaskedValue=str;this.updateControl('auto');} 937get rawInputValue(){return this._rawInputValue;} 938set rawInputValue(str){if(this.rawInputValue===str)return;this.masked.rawInputValue=str;this.updateControl();this.alignCursor();} 939get typedValue(){return this.masked.typedValue;} 940set typedValue(val){if(this.masked.typedValueEquals(val))return;this.masked.typedValue=val;this.updateControl('auto');} 941get displayValue(){return this.masked.displayValue;} 942_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo});} 943_unbindEvents(){if(this.el)this.el.unbindEvents();} 944_fireEvent(ev,e){const listeners=this._listeners[ev];if(!listeners)return;listeners.forEach(l=>l(e));} 945get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart;} 946get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd;} 947set cursorPos(pos){if(!this.el||!this.el.isActive)return;this.el.select(pos,pos);this._saveSelection();} 948_saveSelection(){if(this.displayValue!==this.el.value){console.warn('Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly.');} 949this._selection={start:this.selectionStart,end:this.cursorPos};} 950updateValue(){this.masked.value=this.el.value;this._value=this.masked.value;this._unmaskedValue=this.masked.unmaskedValue;this._rawInputValue=this.masked.rawInputValue;} 951updateControl(cursorPos){const newUnmaskedValue=this.masked.unmaskedValue;const newValue=this.masked.value;const newRawInputValue=this.masked.rawInputValue;const newDisplayValue=this.displayValue;const isChanged=this.unmaskedValue!==newUnmaskedValue||this.value!==newValue||this._rawInputValue!==newRawInputValue;this._unmaskedValue=newUnmaskedValue;this._value=newValue;this._rawInputValue=newRawInputValue;if(this.el.value!==newDisplayValue)this.el.value=newDisplayValue;if(cursorPos==='auto')this.alignCursor();else if(cursorPos!=null)this.cursorPos=cursorPos;if(isChanged)this._fireChangeEvents();if(!this._historyChanging&&(isChanged||this.history.isEmpty))this.history.push({unmaskedValue:newUnmaskedValue,selection:{start:this.selectionStart,end:this.cursorPos}});} 952updateOptions(opts){const{mask,...restOpts}=opts;const updateMask=!this.maskEquals(mask);const updateOpts=this.masked.optionsIsChanged(restOpts);if(updateMask)this.mask=mask;if(updateOpts)this.masked.updateOptions(restOpts);if(updateMask||updateOpts)this.updateControl();} 953updateCursor(cursorPos){if(cursorPos==null)return;this.cursorPos=cursorPos;this._delayUpdateCursor(cursorPos);}
vendor: 62,359 bytes, lines 954-1392
954_delayUpdateCursor(cursorPos){this._abortUpdateCursor();this._changingCursorPos=cursorPos;this._cursorChanging=setTimeout(()=>{if(!this.el)return;this.cursorPos=this._changingCursorPos;this._abortUpdateCursor();},10);} 955_fireChangeEvents(){this._fireEvent('accept',this._inputEvent);if(this.masked.isComplete)this._fireEvent('complete',this._inputEvent);} 956_abortUpdateCursor(){if(this._cursorChanging){clearTimeout(this._cursorChanging);delete this._cursorChanging;}} 957alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,DIRECTION.LEFT));} 958alignCursorFriendly(){if(this.selectionStart!==this.cursorPos)return;this.alignCursor();} 959on(ev,handler){if(!this._listeners[ev])this._listeners[ev]=[];this._listeners[ev].push(handler);return this;} 960off(ev,handler){if(!this._listeners[ev])return this;if(!handler){delete this._listeners[ev];return this;} 961const hIndex=this._listeners[ev].indexOf(handler);if(hIndex>=0)this._listeners[ev].splice(hIndex,1);return this;} 962_onInput(e){this._inputEvent=e;this._abortUpdateCursor();const details=new ActionDetails({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection});const oldRawValue=this.masked.rawInputValue;const offset=this.masked.splice(details.startChangePos,details.removed.length,details.inserted,details.removeDirection,{input:true,raw:true}).offset;const removeDirection=oldRawValue===this.masked.rawInputValue?details.removeDirection:DIRECTION.NONE;let cursorPos=this.masked.nearestInputPos(details.startChangePos+offset,removeDirection);if(removeDirection!==DIRECTION.NONE)cursorPos=this.masked.nearestInputPos(cursorPos,DIRECTION.NONE);this.updateControl(cursorPos);delete this._inputEvent;} 963_onChange(){if(this.displayValue!==this.el.value)this.updateValue();this.masked.doCommit();this.updateControl();this._saveSelection();} 964_onDrop(ev){ev.preventDefault();ev.stopPropagation();} 965_onFocus(ev){this.alignCursorFriendly();} 966_onClick(ev){this.alignCursorFriendly();} 967_onUndo(){this._applyHistoryState(this.history.undo());} 968_onRedo(){this._applyHistoryState(this.history.redo());} 969_applyHistoryState(state){if(!state)return;this._historyChanging=true;this.unmaskedValue=state.unmaskedValue;this.el.select(state.selection.start,state.selection.end);this._saveSelection();this._historyChanging=false;} 970destroy(){this._unbindEvents();this._listeners.length=0;delete this.el;}} 971IMask.InputMask=InputMask;class ChangeDetails{static normalize(prep){return Array.isArray(prep)?prep:[prep,new ChangeDetails()];} 972constructor(details){Object.assign(this,{inserted:'',rawInserted:'',tailShift:0,skip:false},details);} 973aggregate(details){this.inserted+=details.inserted;this.rawInserted+=details.rawInserted;this.tailShift+=details.tailShift;this.skip=this.skip||details.skip;return this;} 974get offset(){return this.tailShift+this.inserted.length;} 975get consumed(){return Boolean(this.rawInserted)||this.skip;} 976equals(details){return this.inserted===details.inserted&&this.tailShift===details.tailShift&&this.rawInserted===details.rawInserted&&this.skip===details.skip;}} 977IMask.ChangeDetails=ChangeDetails;class ContinuousTailDetails{constructor(value,from,stop){if(value===void 0){value='';} 978if(from===void 0){from=0;} 979this.value=value;this.from=from;this.stop=stop;} 980toString(){return this.value;} 981extend(tail){this.value+=String(tail);} 982appendTo(masked){return masked.append(this.toString(),{tail:true}).aggregate(masked._appendPlaceholder());} 983get state(){return{value:this.value,from:this.from,stop:this.stop};} 984set state(state){Object.assign(this,state);} 985unshift(beforePos){if(!this.value.length||beforePos!=null&&this.from>=beforePos)return'';const shiftChar=this.value[0];this.value=this.value.slice(1);return shiftChar;} 986shift(){if(!this.value.length)return'';const shiftChar=this.value[this.value.length-1];this.value=this.value.slice(0,-1);return shiftChar;}} 987class Masked{constructor(opts){this._value='';this._update({...Masked.DEFAULTS,...opts});this._initialized=true;} 988updateOptions(opts){if(!this.optionsIsChanged(opts))return;this.withValueRefresh(this._update.bind(this,opts));} 989_update(opts){Object.assign(this,opts);} 990get state(){return{_value:this.value,_rawInputValue:this.rawInputValue};} 991set state(state){this._value=state._value;} 992reset(){this._value='';} 993get value(){return this._value;} 994set value(value){this.resolve(value,{input:true});} 995resolve(value,flags){if(flags===void 0){flags={input:true};} 996this.reset();this.append(value,flags,'');this.doCommit();} 997get unmaskedValue(){return this.value;} 998set unmaskedValue(value){this.resolve(value,{});} 999get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue;} 1000set typedValue(value){if(this.format){this.value=this.format(value,this);}else{this.unmaskedValue=String(value);}} 1001get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:true});} 1002set rawInputValue(value){this.resolve(value,{raw:true});} 1003get displayValue(){return this.value;} 1004get isComplete(){return true;} 1005get isFilled(){return this.isComplete;} 1006nearestInputPos(cursorPos,direction){return cursorPos;} 1007totalInputPositions(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1008if(toPos===void 0){toPos=this.displayValue.length;} 1009return Math.min(this.displayValue.length,toPos-fromPos);} 1010extractInput(fromPos,toPos,flags){if(fromPos===void 0){fromPos=0;} 1011if(toPos===void 0){toPos=this.displayValue.length;} 1012return this.displayValue.slice(fromPos,toPos);} 1013extractTail(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1014if(toPos===void 0){toPos=this.displayValue.length;} 1015return new ContinuousTailDetails(this.extractInput(fromPos,toPos),fromPos);} 1016appendTail(tail){if(isString(tail))tail=new ContinuousTailDetails(String(tail));return tail.appendTo(this);} 1017_appendCharRaw(ch,flags){if(!ch)return new ChangeDetails();this._value+=ch;return new ChangeDetails({inserted:ch,rawInserted:ch});} 1018_appendChar(ch,flags,checkTail){if(flags===void 0){flags={};} 1019const consistentState=this.state;let details;[ch,details]=this.doPrepareChar(ch,flags);if(ch){details=details.aggregate(this._appendCharRaw(ch,flags));if(!details.rawInserted&&this.autofix==='pad'){const noFixState=this.state;this.state=consistentState;let fixDetails=this.pad(flags);const chDetails=this._appendCharRaw(ch,flags);fixDetails=fixDetails.aggregate(chDetails);if(chDetails.rawInserted||fixDetails.equals(details)){details=fixDetails;}else{this.state=noFixState;}}} 1020if(details.inserted){let consistentTail;let appended=this.doValidate(flags)!==false;if(appended&&checkTail!=null){const beforeTailState=this.state;if(this.overwrite===true){consistentTail=checkTail.state;for(let i=0;i<details.rawInserted.length;++i){checkTail.unshift(this.displayValue.length-details.tailShift);}} 1021let tailDetails=this.appendTail(checkTail);appended=tailDetails.rawInserted.length===checkTail.toString().length;if(!(appended&&tailDetails.inserted)&&this.overwrite==='shift'){this.state=beforeTailState;consistentTail=checkTail.state;for(let i=0;i<details.rawInserted.length;++i){checkTail.shift();} 1022tailDetails=this.appendTail(checkTail);appended=tailDetails.rawInserted.length===checkTail.toString().length;} 1023if(appended&&tailDetails.inserted)this.state=beforeTailState;} 1024if(!appended){details=new ChangeDetails();this.state=consistentState;if(checkTail&&consistentTail)checkTail.state=consistentTail;}} 1025return details;} 1026_appendPlaceholder(){return new ChangeDetails();} 1027_appendEager(){return new ChangeDetails();} 1028append(str,flags,tail){if(!isString(str))throw new Error('value should be string');const checkTail=isString(tail)?new ContinuousTailDetails(String(tail)):tail;if(flags!=null&&flags.tail)flags._beforeTailState=this.state;let details;[str,details]=this.doPrepare(str,flags);for(let ci=0;ci<str.length;++ci){const d=this._appendChar(str[ci],flags,checkTail);if(!d.rawInserted&&!this.doSkipInvalid(str[ci],flags,checkTail))break;details.aggregate(d);} 1029if((this.eager===true||this.eager==='append')&&flags!=null&&flags.input&&str){details.aggregate(this._appendEager());} 1030if(checkTail!=null){details.tailShift+=this.appendTail(checkTail).tailShift;} 1031return details;} 1032remove(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1033if(toPos===void 0){toPos=this.displayValue.length;} 1034this._value=this.displayValue.slice(0,fromPos)+this.displayValue.slice(toPos);return new ChangeDetails();} 1035withValueRefresh(fn){if(this._refreshing||!this._initialized)return fn();this._refreshing=true;const rawInput=this.rawInputValue;const value=this.value;const ret=fn();this.rawInputValue=rawInput;if(this.value&&this.value!==value&&value.indexOf(this.value)===0){this.append(value.slice(this.displayValue.length),{},'');this.doCommit();} 1036delete this._refreshing;return ret;} 1037runIsolated(fn){if(this._isolated||!this._initialized)return fn(this);this._isolated=true;const state=this.state;const ret=fn(this);this.state=state;delete this._isolated;return ret;} 1038doSkipInvalid(ch,flags,checkTail){return Boolean(this.skipInvalid);} 1039doPrepare(str,flags){if(flags===void 0){flags={};} 1040return ChangeDetails.normalize(this.prepare?this.prepare(str,this,flags):str);} 1041doPrepareChar(str,flags){if(flags===void 0){flags={};} 1042return ChangeDetails.normalize(this.prepareChar?this.prepareChar(str,this,flags):str);} 1043doValidate(flags){return(!this.validate||this.validate(this.value,this,flags))&&(!this.parent||this.parent.doValidate(flags));} 1044doCommit(){if(this.commit)this.commit(this.value,this);} 1045splice(start,deleteCount,inserted,removeDirection,flags){if(inserted===void 0){inserted='';} 1046if(removeDirection===void 0){removeDirection=DIRECTION.NONE;} 1047if(flags===void 0){flags={input:true};} 1048const tailPos=start+deleteCount;const tail=this.extractTail(tailPos);const eagerRemove=this.eager===true||this.eager==='remove';let oldRawValue;if(eagerRemove){removeDirection=forceDirection(removeDirection);oldRawValue=this.extractInput(0,tailPos,{raw:true});} 1049let startChangePos=start;const details=new ChangeDetails();if(removeDirection!==DIRECTION.NONE){startChangePos=this.nearestInputPos(start,deleteCount>1&&start!==0&&!eagerRemove?DIRECTION.NONE:removeDirection);details.tailShift=startChangePos-start;} 1050details.aggregate(this.remove(startChangePos));if(eagerRemove&&removeDirection!==DIRECTION.NONE&&oldRawValue===this.rawInputValue){if(removeDirection===DIRECTION.FORCE_LEFT){let valLength;while(oldRawValue===this.rawInputValue&&(valLength=this.displayValue.length)){details.aggregate(new ChangeDetails({tailShift:-1})).aggregate(this.remove(valLength-1));}}else if(removeDirection===DIRECTION.FORCE_RIGHT){tail.unshift();}} 1051return details.aggregate(this.append(inserted,flags,tail));} 1052maskEquals(mask){return this.mask===mask;} 1053optionsIsChanged(opts){return!objectIncludes(this,opts);} 1054typedValueEquals(value){const tval=this.typedValue;return value===tval||Masked.EMPTY_VALUES.includes(value)&&Masked.EMPTY_VALUES.includes(tval)||(this.format?this.format(value,this)===this.format(this.typedValue,this):false);} 1055pad(flags){return new ChangeDetails();}} 1056Masked.DEFAULTS={skipInvalid:true};Masked.EMPTY_VALUES=[undefined,null,''];IMask.Masked=Masked;class ChunksTailDetails{constructor(chunks,from){if(chunks===void 0){chunks=[];} 1057if(from===void 0){from=0;} 1058this.chunks=chunks;this.from=from;} 1059toString(){return this.chunks.map(String).join('');} 1060extend(tailChunk){if(!String(tailChunk))return;tailChunk=isString(tailChunk)?new ContinuousTailDetails(String(tailChunk)):tailChunk;const lastChunk=this.chunks[this.chunks.length-1];const extendLast=lastChunk&&(lastChunk.stop===tailChunk.stop||tailChunk.stop==null)&&tailChunk.from===lastChunk.from+lastChunk.toString().length;if(tailChunk instanceof ContinuousTailDetails){if(extendLast){lastChunk.extend(tailChunk.toString());}else{this.chunks.push(tailChunk);}}else if(tailChunk instanceof ChunksTailDetails){if(tailChunk.stop==null){let firstTailChunk;while(tailChunk.chunks.length&&tailChunk.chunks[0].stop==null){firstTailChunk=tailChunk.chunks.shift();firstTailChunk.from+=tailChunk.from;this.extend(firstTailChunk);}} 1061if(tailChunk.toString()){tailChunk.stop=tailChunk.blockIndex;this.chunks.push(tailChunk);}}} 1062appendTo(masked){if(!(masked instanceof IMask.MaskedPattern)){const tail=new ContinuousTailDetails(this.toString());return tail.appendTo(masked);} 1063const details=new ChangeDetails();for(let ci=0;ci<this.chunks.length;++ci){const chunk=this.chunks[ci];const lastBlockIter=masked._mapPosToBlock(masked.displayValue.length);const stop=chunk.stop;let chunkBlock;if(stop!=null&&(!lastBlockIter||lastBlockIter.index<=stop)){if(chunk instanceof ChunksTailDetails||masked._stops.indexOf(stop)>=0){details.aggregate(masked._appendPlaceholder(stop));} 1064chunkBlock=chunk instanceof ChunksTailDetails&&masked._blocks[stop];} 1065if(chunkBlock){const tailDetails=chunkBlock.appendTail(chunk);details.aggregate(tailDetails);const remainChars=chunk.toString().slice(tailDetails.rawInserted.length);if(remainChars)details.aggregate(masked.append(remainChars,{tail:true}));}else{details.aggregate(masked.append(chunk.toString(),{tail:true}));}} 1066return details;} 1067get state(){return{chunks:this.chunks.map(c=>c.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex};} 1068set state(state){const{chunks,...props}=state;Object.assign(this,props);this.chunks=chunks.map(cstate=>{const chunk="chunks"in cstate?new ChunksTailDetails():new ContinuousTailDetails();chunk.state=cstate;return chunk;});} 1069unshift(beforePos){if(!this.chunks.length||beforePos!=null&&this.from>=beforePos)return'';const chunkShiftPos=beforePos!=null?beforePos-this.from:beforePos;let ci=0;while(ci<this.chunks.length){const chunk=this.chunks[ci];const shiftChar=chunk.unshift(chunkShiftPos);if(chunk.toString()){if(!shiftChar)break;++ci;}else{this.chunks.splice(ci,1);} 1070if(shiftChar)return shiftChar;} 1071return'';} 1072shift(){if(!this.chunks.length)return'';let ci=this.chunks.length-1;while(0<=ci){const chunk=this.chunks[ci];const shiftChar=chunk.shift();if(chunk.toString()){if(!shiftChar)break;--ci;}else{this.chunks.splice(ci,1);} 1073if(shiftChar)return shiftChar;} 1074return'';}} 1075class PatternCursor{constructor(masked,pos){this.masked=masked;this._log=[];const{offset,index}=masked._mapPosToBlock(pos)||(pos<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=offset;this.index=index;this.ok=false;} 1076get block(){return this.masked._blocks[this.index];} 1077get pos(){return this.masked._blockStartPos(this.index)+this.offset;} 1078get state(){return{index:this.index,offset:this.offset,ok:this.ok};} 1079set state(s){Object.assign(this,s);} 1080pushState(){this._log.push(this.state);} 1081popState(){const s=this._log.pop();if(s)this.state=s;return s;} 1082bindBlock(){if(this.block)return;if(this.index<0){this.index=0;this.offset=0;} 1083if(this.index>=this.masked._blocks.length){this.index=this.masked._blocks.length-1;this.offset=this.block.displayValue.length;}} 1084_pushLeft(fn){this.pushState();for(this.bindBlock();0<=this.index;--this.index,this.offset=((_this$block=this.block)==null?void 0:_this$block.displayValue.length)||0){var _this$block;if(fn())return this.ok=true;} 1085return this.ok=false;} 1086_pushRight(fn){this.pushState();for(this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0){if(fn())return this.ok=true;} 1087return this.ok=false;} 1088pushLeftBeforeFilled(){return this._pushLeft(()=>{if(this.block.isFixed||!this.block.value)return;this.offset=this.block.nearestInputPos(this.offset,DIRECTION.FORCE_LEFT);if(this.offset!==0)return true;});} 1089pushLeftBeforeInput(){return this._pushLeft(()=>{if(this.block.isFixed)return;this.offset=this.block.nearestInputPos(this.offset,DIRECTION.LEFT);return true;});} 1090pushLeftBeforeRequired(){return this._pushLeft(()=>{if(this.block.isFixed||this.block.isOptional&&!this.block.value)return;this.offset=this.block.nearestInputPos(this.offset,DIRECTION.LEFT);return true;});} 1091pushRightBeforeFilled(){return this._pushRight(()=>{if(this.block.isFixed||!this.block.value)return;this.offset=this.block.nearestInputPos(this.offset,DIRECTION.FORCE_RIGHT);if(this.offset!==this.block.value.length)return true;});} 1092pushRightBeforeInput(){return this._pushRight(()=>{if(this.block.isFixed)return;this.offset=this.block.nearestInputPos(this.offset,DIRECTION.NONE);return true;});} 1093pushRightBeforeRequired(){return this._pushRight(()=>{if(this.block.isFixed||this.block.isOptional&&!this.block.value)return;this.offset=this.block.nearestInputPos(this.offset,DIRECTION.NONE);return true;});}} 1094class PatternFixedDefinition{constructor(opts){Object.assign(this,opts);this._value='';this.isFixed=true;} 1095get value(){return this._value;} 1096get unmaskedValue(){return this.isUnmasking?this.value:'';} 1097get rawInputValue(){return this._isRawInput?this.value:'';} 1098get displayValue(){return this.value;} 1099reset(){this._isRawInput=false;this._value='';} 1100remove(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1101if(toPos===void 0){toPos=this._value.length;} 1102this._value=this._value.slice(0,fromPos)+this._value.slice(toPos);if(!this._value)this._isRawInput=false;return new ChangeDetails();} 1103nearestInputPos(cursorPos,direction){if(direction===void 0){direction=DIRECTION.NONE;} 1104const minPos=0;const maxPos=this._value.length;switch(direction){case DIRECTION.LEFT:case DIRECTION.FORCE_LEFT:return minPos;case DIRECTION.NONE:case DIRECTION.RIGHT:case DIRECTION.FORCE_RIGHT:default:return maxPos;}} 1105totalInputPositions(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1106if(toPos===void 0){toPos=this._value.length;} 1107return this._isRawInput?toPos-fromPos:0;} 1108extractInput(fromPos,toPos,flags){if(fromPos===void 0){fromPos=0;} 1109if(toPos===void 0){toPos=this._value.length;} 1110if(flags===void 0){flags={};} 1111return flags.raw&&this._isRawInput&&this._value.slice(fromPos,toPos)||'';} 1112get isComplete(){return true;} 1113get isFilled(){return Boolean(this._value);} 1114_appendChar(ch,flags){if(flags===void 0){flags={};} 1115if(this.isFilled)return new ChangeDetails();const appendEager=this.eager===true||this.eager==='append';const appended=this.char===ch;const isResolved=appended&&(this.isUnmasking||flags.input||flags.raw)&&(!flags.raw||!appendEager)&&!flags.tail;const details=new ChangeDetails({inserted:this.char,rawInserted:isResolved?this.char:''});this._value=this.char;this._isRawInput=isResolved&&(flags.raw||flags.input);return details;} 1116_appendEager(){return this._appendChar(this.char,{tail:true});} 1117_appendPlaceholder(){const details=new ChangeDetails();if(this.isFilled)return details;this._value=details.inserted=this.char;return details;} 1118extractTail(){return new ContinuousTailDetails('');} 1119appendTail(tail){if(isString(tail))tail=new ContinuousTailDetails(String(tail));return tail.appendTo(this);} 1120append(str,flags,tail){const details=this._appendChar(str[0],flags);if(tail!=null){details.tailShift+=this.appendTail(tail).tailShift;} 1121return details;} 1122doCommit(){} 1123get state(){return{_value:this._value,_rawInputValue:this.rawInputValue};} 1124set state(state){this._value=state._value;this._isRawInput=Boolean(state._rawInputValue);} 1125pad(flags){return this._appendPlaceholder();}} 1126class PatternInputDefinition{constructor(opts){const{parent,isOptional,placeholderChar,displayChar,lazy,eager,...maskOpts}=opts;this.masked=createMask(maskOpts);Object.assign(this,{parent,isOptional,placeholderChar,displayChar,lazy,eager});} 1127reset(){this.isFilled=false;this.masked.reset();} 1128remove(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1129if(toPos===void 0){toPos=this.value.length;} 1130if(fromPos===0&&toPos>=1){this.isFilled=false;return this.masked.remove(fromPos,toPos);} 1131return new ChangeDetails();} 1132get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:'');} 1133get unmaskedValue(){return this.masked.unmaskedValue;} 1134get rawInputValue(){return this.masked.rawInputValue;} 1135get displayValue(){return this.masked.value&&this.displayChar||this.value;} 1136get isComplete(){return Boolean(this.masked.value)||this.isOptional;} 1137_appendChar(ch,flags){if(flags===void 0){flags={};} 1138if(this.isFilled)return new ChangeDetails();const state=this.masked.state;let details=this.masked._appendChar(ch,this.currentMaskFlags(flags));if(details.inserted&&this.doValidate(flags)===false){details=new ChangeDetails();this.masked.state=state;} 1139if(!details.inserted&&!this.isOptional&&!this.lazy&&!flags.input){details.inserted=this.placeholderChar;} 1140details.skip=!details.inserted&&!this.isOptional;this.isFilled=Boolean(details.inserted);return details;} 1141append(str,flags,tail){return this.masked.append(str,this.currentMaskFlags(flags),tail);} 1142_appendPlaceholder(){if(this.isFilled||this.isOptional)return new ChangeDetails();this.isFilled=true;return new ChangeDetails({inserted:this.placeholderChar});} 1143_appendEager(){return new ChangeDetails();} 1144extractTail(fromPos,toPos){return this.masked.extractTail(fromPos,toPos);} 1145appendTail(tail){return this.masked.appendTail(tail);} 1146extractInput(fromPos,toPos,flags){if(fromPos===void 0){fromPos=0;} 1147if(toPos===void 0){toPos=this.value.length;} 1148return this.masked.extractInput(fromPos,toPos,flags);} 1149nearestInputPos(cursorPos,direction){if(direction===void 0){direction=DIRECTION.NONE;} 1150const minPos=0;const maxPos=this.value.length;const boundPos=Math.min(Math.max(cursorPos,minPos),maxPos);switch(direction){case DIRECTION.LEFT:case DIRECTION.FORCE_LEFT:return this.isComplete?boundPos:minPos;case DIRECTION.RIGHT:case DIRECTION.FORCE_RIGHT:return this.isComplete?boundPos:maxPos;case DIRECTION.NONE:default:return boundPos;}} 1151totalInputPositions(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1152if(toPos===void 0){toPos=this.value.length;} 1153return this.value.slice(fromPos,toPos).length;} 1154doValidate(flags){return this.masked.doValidate(this.currentMaskFlags(flags))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(flags)));} 1155doCommit(){this.masked.doCommit();} 1156get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled};} 1157set state(state){this.masked.state=state.masked;this.isFilled=state.isFilled;} 1158currentMaskFlags(flags){var _flags$_beforeTailSta;return{...flags,_beforeTailState:(flags==null||(_flags$_beforeTailSta=flags._beforeTailState)==null?void 0:_flags$_beforeTailSta.masked)||(flags==null?void 0:flags._beforeTailState)};} 1159pad(flags){return new ChangeDetails();}} 1160PatternInputDefinition.DEFAULT_DEFINITIONS={'0':/\d/,'a':/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,'*':/./};class MaskedRegExp extends Masked{updateOptions(opts){super.updateOptions(opts);} 1161_update(opts){const mask=opts.mask;if(mask)opts.validate=value=>value.search(mask)>=0;super._update(opts);}} 1162IMask.MaskedRegExp=MaskedRegExp;class MaskedPattern extends Masked{constructor(opts){super({...MaskedPattern.DEFAULTS,...opts,definitions:Object.assign({},PatternInputDefinition.DEFAULT_DEFINITIONS,opts==null?void 0:opts.definitions)});} 1163updateOptions(opts){super.updateOptions(opts);} 1164_update(opts){opts.definitions=Object.assign({},this.definitions,opts.definitions);super._update(opts);this._rebuildMask();} 1165_rebuildMask(){const defs=this.definitions;this._blocks=[];this.exposeBlock=undefined;this._stops=[];this._maskedBlocks={};const pattern=this.mask;if(!pattern||!defs)return;let unmaskingBlock=false;let optionalBlock=false;for(let i=0;i<pattern.length;++i){if(this.blocks){const p=pattern.slice(i);const bNames=Object.keys(this.blocks).filter(bName=>p.indexOf(bName)===0);bNames.sort((a,b)=>b.length-a.length);const bName=bNames[0];if(bName){const{expose,repeat,...bOpts}=normalizeOpts(this.blocks[bName]);const blockOpts={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...bOpts,repeat,parent:this};const maskedBlock=repeat!=null?new IMask.RepeatBlock(blockOpts):createMask(blockOpts);if(maskedBlock){this._blocks.push(maskedBlock);if(expose)this.exposeBlock=maskedBlock;if(!this._maskedBlocks[bName])this._maskedBlocks[bName]=[];this._maskedBlocks[bName].push(this._blocks.length-1);} 1166i+=bName.length-1;continue;}} 1167let char=pattern[i];let isInput=(char in defs);if(char===MaskedPattern.STOP_CHAR){this._stops.push(this._blocks.length);continue;} 1168if(char==='{'||char==='}'){unmaskingBlock=!unmaskingBlock;continue;} 1169if(char==='['||char===']'){optionalBlock=!optionalBlock;continue;} 1170if(char===MaskedPattern.ESCAPE_CHAR){++i;char=pattern[i];if(!char)break;isInput=false;} 1171const def=isInput?new PatternInputDefinition({isOptional:optionalBlock,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...normalizeOpts(defs[char]),parent:this}):new PatternFixedDefinition({char,eager:this.eager,isUnmasking:unmaskingBlock});this._blocks.push(def);}} 1172get state(){return{...super.state,_blocks:this._blocks.map(b=>b.state)};} 1173set state(state){if(!state){this.reset();return;} 1174const{_blocks,...maskedState}=state;this._blocks.forEach((b,bi)=>b.state=_blocks[bi]);super.state=maskedState;} 1175reset(){super.reset();this._blocks.forEach(b=>b.reset());} 1176get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(b=>b.isComplete);} 1177get isFilled(){return this._blocks.every(b=>b.isFilled);} 1178get isFixed(){return this._blocks.every(b=>b.isFixed);} 1179get isOptional(){return this._blocks.every(b=>b.isOptional);} 1180doCommit(){this._blocks.forEach(b=>b.doCommit());super.doCommit();} 1181get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((str,b)=>str+=b.unmaskedValue,'');} 1182set unmaskedValue(unmaskedValue){if(this.exposeBlock){const tail=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=unmaskedValue;this.appendTail(tail);this.doCommit();}else super.unmaskedValue=unmaskedValue;} 1183get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((str,b)=>str+=b.value,'');} 1184set value(value){if(this.exposeBlock){const tail=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=value;this.appendTail(tail);this.doCommit();}else super.value=value;} 1185get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue;} 1186set typedValue(value){if(this.exposeBlock){const tail=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=value;this.appendTail(tail);this.doCommit();}else super.typedValue=value;} 1187get displayValue(){return this._blocks.reduce((str,b)=>str+=b.displayValue,'');} 1188appendTail(tail){return super.appendTail(tail).aggregate(this._appendPlaceholder());} 1189_appendEager(){var _this$_mapPosToBlock;const details=new ChangeDetails();let startBlockIndex=(_this$_mapPosToBlock=this._mapPosToBlock(this.displayValue.length))==null?void 0:_this$_mapPosToBlock.index;if(startBlockIndex==null)return details;if(this._blocks[startBlockIndex].isFilled)++startBlockIndex;for(let bi=startBlockIndex;bi<this._blocks.length;++bi){const d=this._blocks[bi]._appendEager();if(!d.inserted)break;details.aggregate(d);} 1190return details;} 1191_appendCharRaw(ch,flags){if(flags===void 0){flags={};} 1192const blockIter=this._mapPosToBlock(this.displayValue.length);const details=new ChangeDetails();if(!blockIter)return details;for(let bi=blockIter.index,block;block=this._blocks[bi];++bi){var _flags$_beforeTailSta;const blockDetails=block._appendChar(ch,{...flags,_beforeTailState:(_flags$_beforeTailSta=flags._beforeTailState)==null||(_flags$_beforeTailSta=_flags$_beforeTailSta._blocks)==null?void 0:_flags$_beforeTailSta[bi]});details.aggregate(blockDetails);if(blockDetails.consumed)break;} 1193return details;} 1194extractTail(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1195if(toPos===void 0){toPos=this.displayValue.length;} 1196const chunkTail=new ChunksTailDetails();if(fromPos===toPos)return chunkTail;this._forEachBlocksInRange(fromPos,toPos,(b,bi,bFromPos,bToPos)=>{const blockChunk=b.extractTail(bFromPos,bToPos);blockChunk.stop=this._findStopBefore(bi);blockChunk.from=this._blockStartPos(bi);if(blockChunk instanceof ChunksTailDetails)blockChunk.blockIndex=bi;chunkTail.extend(blockChunk);});return chunkTail;} 1197extractInput(fromPos,toPos,flags){if(fromPos===void 0){fromPos=0;} 1198if(toPos===void 0){toPos=this.displayValue.length;} 1199if(flags===void 0){flags={};} 1200if(fromPos===toPos)return'';let input='';this._forEachBlocksInRange(fromPos,toPos,(b,_,fromPos,toPos)=>{input+=b.extractInput(fromPos,toPos,flags);});return input;} 1201_findStopBefore(blockIndex){let stopBefore;for(let si=0;si<this._stops.length;++si){const stop=this._stops[si];if(stop<=blockIndex)stopBefore=stop;else break;} 1202return stopBefore;} 1203_appendPlaceholder(toBlockIndex){const details=new ChangeDetails();if(this.lazy&&toBlockIndex==null)return details;const startBlockIter=this._mapPosToBlock(this.displayValue.length);if(!startBlockIter)return details;const startBlockIndex=startBlockIter.index;const endBlockIndex=toBlockIndex!=null?toBlockIndex:this._blocks.length;this._blocks.slice(startBlockIndex,endBlockIndex).forEach(b=>{if(!b.lazy||toBlockIndex!=null){var _blocks2;details.aggregate(b._appendPlaceholder((_blocks2=b._blocks)==null?void 0:_blocks2.length));}});return details;} 1204_mapPosToBlock(pos){let accVal='';for(let bi=0;bi<this._blocks.length;++bi){const block=this._blocks[bi];const blockStartPos=accVal.length;accVal+=block.displayValue;if(pos<=accVal.length){return{index:bi,offset:pos-blockStartPos};}}} 1205_blockStartPos(blockIndex){return this._blocks.slice(0,blockIndex).reduce((pos,b)=>pos+=b.displayValue.length,0);} 1206_forEachBlocksInRange(fromPos,toPos,fn){if(toPos===void 0){toPos=this.displayValue.length;} 1207const fromBlockIter=this._mapPosToBlock(fromPos);if(fromBlockIter){const toBlockIter=this._mapPosToBlock(toPos);const isSameBlock=toBlockIter&&fromBlockIter.index===toBlockIter.index;const fromBlockStartPos=fromBlockIter.offset;const fromBlockEndPos=toBlockIter&&isSameBlock?toBlockIter.offset:this._blocks[fromBlockIter.index].displayValue.length;fn(this._blocks[fromBlockIter.index],fromBlockIter.index,fromBlockStartPos,fromBlockEndPos);if(toBlockIter&&!isSameBlock){for(let bi=fromBlockIter.index+1;bi<toBlockIter.index;++bi){fn(this._blocks[bi],bi,0,this._blocks[bi].displayValue.length);} 1208fn(this._blocks[toBlockIter.index],toBlockIter.index,0,toBlockIter.offset);}}} 1209remove(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1210if(toPos===void 0){toPos=this.displayValue.length;} 1211const removeDetails=super.remove(fromPos,toPos);this._forEachBlocksInRange(fromPos,toPos,(b,_,bFromPos,bToPos)=>{removeDetails.aggregate(b.remove(bFromPos,bToPos));});return removeDetails;} 1212nearestInputPos(cursorPos,direction){if(direction===void 0){direction=DIRECTION.NONE;} 1213if(!this._blocks.length)return 0;const cursor=new PatternCursor(this,cursorPos);if(direction===DIRECTION.NONE){if(cursor.pushRightBeforeInput())return cursor.pos;cursor.popState();if(cursor.pushLeftBeforeInput())return cursor.pos;return this.displayValue.length;} 1214if(direction===DIRECTION.LEFT||direction===DIRECTION.FORCE_LEFT){if(direction===DIRECTION.LEFT){cursor.pushRightBeforeFilled();if(cursor.ok&&cursor.pos===cursorPos)return cursorPos;cursor.popState();} 1215cursor.pushLeftBeforeInput();cursor.pushLeftBeforeRequired();cursor.pushLeftBeforeFilled();if(direction===DIRECTION.LEFT){cursor.pushRightBeforeInput();cursor.pushRightBeforeRequired();if(cursor.ok&&cursor.pos<=cursorPos)return cursor.pos;cursor.popState();if(cursor.ok&&cursor.pos<=cursorPos)return cursor.pos;cursor.popState();} 1216if(cursor.ok)return cursor.pos;if(direction===DIRECTION.FORCE_LEFT)return 0;cursor.popState();if(cursor.ok)return cursor.pos;cursor.popState();if(cursor.ok)return cursor.pos;return 0;} 1217if(direction===DIRECTION.RIGHT||direction===DIRECTION.FORCE_RIGHT){cursor.pushRightBeforeInput();cursor.pushRightBeforeRequired();if(cursor.pushRightBeforeFilled())return cursor.pos;if(direction===DIRECTION.FORCE_RIGHT)return this.displayValue.length;cursor.popState();if(cursor.ok)return cursor.pos;cursor.popState();if(cursor.ok)return cursor.pos;return this.nearestInputPos(cursorPos,DIRECTION.LEFT);} 1218return cursorPos;} 1219totalInputPositions(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1220if(toPos===void 0){toPos=this.displayValue.length;} 1221let total=0;this._forEachBlocksInRange(fromPos,toPos,(b,_,bFromPos,bToPos)=>{total+=b.totalInputPositions(bFromPos,bToPos);});return total;} 1222maskedBlock(name){return this.maskedBlocks(name)[0];} 1223maskedBlocks(name){const indices=this._maskedBlocks[name];if(!indices)return[];return indices.map(gi=>this._blocks[gi]);} 1224pad(flags){const details=new ChangeDetails();this._forEachBlocksInRange(0,this.displayValue.length,b=>details.aggregate(b.pad(flags)));return details;}} 1225MaskedPattern.DEFAULTS={...Masked.DEFAULTS,lazy:true,placeholderChar:'_'};MaskedPattern.STOP_CHAR='`';MaskedPattern.ESCAPE_CHAR='\\';MaskedPattern.InputDefinition=PatternInputDefinition;MaskedPattern.FixedDefinition=PatternFixedDefinition;IMask.MaskedPattern=MaskedPattern;class MaskedRange extends MaskedPattern{get _matchFrom(){return this.maxLength-String(this.from).length;} 1226constructor(opts){super(opts);} 1227updateOptions(opts){super.updateOptions(opts);} 1228_update(opts){const{to=this.to||0,from=this.from||0,maxLength=this.maxLength||0,autofix=this.autofix,...patternOpts}=opts;this.to=to;this.from=from;this.maxLength=Math.max(String(to).length,maxLength);this.autofix=autofix;const fromStr=String(this.from).padStart(this.maxLength,'0');const toStr=String(this.to).padStart(this.maxLength,'0');let sameCharsCount=0;while(sameCharsCount<toStr.length&&toStr[sameCharsCount]===fromStr[sameCharsCount])++sameCharsCount;patternOpts.mask=toStr.slice(0,sameCharsCount).replace(/0/g,'\\0')+'0'.repeat(this.maxLength-sameCharsCount);super._update(patternOpts);} 1229get isComplete(){return super.isComplete&&Boolean(this.value);} 1230boundaries(str){let minstr='';let maxstr='';const[,placeholder,num]=str.match(/^(\D*)(\d*)(\D*)/)||[];if(num){minstr='0'.repeat(placeholder.length)+num;maxstr='9'.repeat(placeholder.length)+num;} 1231minstr=minstr.padEnd(this.maxLength,'0');maxstr=maxstr.padEnd(this.maxLength,'9');return[minstr,maxstr];} 1232doPrepareChar(ch,flags){if(flags===void 0){flags={};} 1233let details;[ch,details]=super.doPrepareChar(ch.replace(/\D/g,''),flags);if(!ch)details.skip=!this.isComplete;return[ch,details];} 1234_appendCharRaw(ch,flags){if(flags===void 0){flags={};} 1235if(!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(ch,flags);const fromStr=String(this.from).padStart(this.maxLength,'0');const toStr=String(this.to).padStart(this.maxLength,'0');const[minstr,maxstr]=this.boundaries(this.value+ch);if(Number(maxstr)<this.from)return super._appendCharRaw(fromStr[this.value.length],flags);if(Number(minstr)>this.to){if(!flags.tail&&this.autofix==='pad'&&this.value.length+1<this.maxLength){return super._appendCharRaw(fromStr[this.value.length],flags).aggregate(this._appendCharRaw(ch,flags));} 1236return super._appendCharRaw(toStr[this.value.length],flags);} 1237return super._appendCharRaw(ch,flags);} 1238doValidate(flags){const str=this.value;const firstNonZero=str.search(/[^0]/);if(firstNonZero===-1&&str.length<=this._matchFrom)return true;const[minstr,maxstr]=this.boundaries(str);return this.from<=Number(maxstr)&&Number(minstr)<=this.to&&super.doValidate(flags);} 1239pad(flags){const details=new ChangeDetails();if(this.value.length===this.maxLength)return details;const value=this.value;const padLength=this.maxLength-this.value.length;if(padLength){this.reset();for(let i=0;i<padLength;++i){details.aggregate(super._appendCharRaw('0',flags));} 1240value.split('').forEach(ch=>this._appendCharRaw(ch));} 1241return details;}} 1242IMask.MaskedRange=MaskedRange;const DefaultPattern='d{.}`m{.}`Y';class MaskedDate extends MaskedPattern{static extractPatternOptions(opts){const{mask,pattern,...patternOpts}=opts;return{...patternOpts,mask:isString(mask)?mask:pattern};} 1243constructor(opts){super(MaskedDate.extractPatternOptions({...MaskedDate.DEFAULTS,...opts}));} 1244updateOptions(opts){super.updateOptions(opts);} 1245_update(opts){const{mask,pattern,blocks,...patternOpts}={...MaskedDate.DEFAULTS,...opts};const patternBlocks=Object.assign({},MaskedDate.GET_DEFAULT_BLOCKS());if(opts.min)patternBlocks.Y.from=opts.min.getFullYear();if(opts.max)patternBlocks.Y.to=opts.max.getFullYear();if(opts.min&&opts.max&&patternBlocks.Y.from===patternBlocks.Y.to){patternBlocks.m.from=opts.min.getMonth()+1;patternBlocks.m.to=opts.max.getMonth()+1;if(patternBlocks.m.from===patternBlocks.m.to){patternBlocks.d.from=opts.min.getDate();patternBlocks.d.to=opts.max.getDate();}} 1246Object.assign(patternBlocks,this.blocks,blocks);super._update({...patternOpts,mask:isString(mask)?mask:pattern,blocks:patternBlocks});} 1247doValidate(flags){const date=this.date;return super.doValidate(flags)&&(!this.isComplete||this.isDateExist(this.value)&&date!=null&&(this.min==null||this.min<=date)&&(this.max==null||date<=this.max));} 1248isDateExist(str){return this.format(this.parse(str,this),this).indexOf(str)>=0;} 1249get date(){return this.typedValue;} 1250set date(date){this.typedValue=date;} 1251get typedValue(){return this.isComplete?super.typedValue:null;} 1252set typedValue(value){super.typedValue=value;} 1253maskEquals(mask){return mask===Date||super.maskEquals(mask);} 1254optionsIsChanged(opts){return super.optionsIsChanged(MaskedDate.extractPatternOptions(opts));}} 1255MaskedDate.GET_DEFAULT_BLOCKS=()=>({d:{mask:MaskedRange,from:1,to:31,maxLength:2},m:{mask:MaskedRange,from:1,to:12,maxLength:2},Y:{mask:MaskedRange,from:1900,to:9999}});MaskedDate.DEFAULTS={...MaskedPattern.DEFAULTS,mask:Date,pattern:DefaultPattern,format:(date,masked)=>{if(!date)return'';const day=String(date.getDate()).padStart(2,'0');const month=String(date.getMonth()+1).padStart(2,'0');const year=date.getFullYear();return[day,month,year].join('.');},parse:(str,masked)=>{const[day,month,year]=str.split('.').map(Number);return new Date(year,month-1,day);}};IMask.MaskedDate=MaskedDate;class MaskedDynamic extends Masked{constructor(opts){super({...MaskedDynamic.DEFAULTS,...opts});this.currentMask=undefined;} 1256updateOptions(opts){super.updateOptions(opts);} 1257_update(opts){super._update(opts);if('mask'in opts){this.exposeMask=undefined;this.compiledMasks=Array.isArray(opts.mask)?opts.mask.map(m=>{const{expose,...maskOpts}=normalizeOpts(m);const masked=createMask({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...maskOpts});if(expose)this.exposeMask=masked;return masked;}):[];}} 1258_appendCharRaw(ch,flags){if(flags===void 0){flags={};} 1259const details=this._applyDispatch(ch,flags);if(this.currentMask){details.aggregate(this.currentMask._appendChar(ch,this.currentMaskFlags(flags)));} 1260return details;} 1261_applyDispatch(appended,flags,tail){if(appended===void 0){appended='';} 1262if(flags===void 0){flags={};} 1263if(tail===void 0){tail='';} 1264const prevValueBeforeTail=flags.tail&&flags._beforeTailState!=null?flags._beforeTailState._value:this.value;const inputValue=this.rawInputValue;const insertValue=flags.tail&&flags._beforeTailState!=null?flags._beforeTailState._rawInputValue:inputValue;const tailValue=inputValue.slice(insertValue.length);const prevMask=this.currentMask;const details=new ChangeDetails();const prevMaskState=prevMask==null?void 0:prevMask.state;this.currentMask=this.doDispatch(appended,{...flags},tail);if(this.currentMask){if(this.currentMask!==prevMask){this.currentMask.reset();if(insertValue){this.currentMask.append(insertValue,{raw:true});details.tailShift=this.currentMask.value.length-prevValueBeforeTail.length;} 1265if(tailValue){details.tailShift+=this.currentMask.append(tailValue,{raw:true,tail:true}).tailShift;}}else if(prevMaskState){this.currentMask.state=prevMaskState;}} 1266return details;} 1267_appendPlaceholder(){const details=this._applyDispatch();if(this.currentMask){details.aggregate(this.currentMask._appendPlaceholder());} 1268return details;} 1269_appendEager(){const details=this._applyDispatch();if(this.currentMask){details.aggregate(this.currentMask._appendEager());} 1270return details;} 1271appendTail(tail){const details=new ChangeDetails();if(tail)details.aggregate(this._applyDispatch('',{},tail));return details.aggregate(this.currentMask?this.currentMask.appendTail(tail):super.appendTail(tail));} 1272currentMaskFlags(flags){var _flags$_beforeTailSta,_flags$_beforeTailSta2;return{...flags,_beforeTailState:((_flags$_beforeTailSta=flags._beforeTailState)==null?void 0:_flags$_beforeTailSta.currentMaskRef)===this.currentMask&&((_flags$_beforeTailSta2=flags._beforeTailState)==null?void 0:_flags$_beforeTailSta2.currentMask)||flags._beforeTailState};} 1273doDispatch(appended,flags,tail){if(flags===void 0){flags={};} 1274if(tail===void 0){tail='';} 1275return this.dispatch(appended,this,flags,tail);} 1276doValidate(flags){return super.doValidate(flags)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(flags)));} 1277doPrepare(str,flags){if(flags===void 0){flags={};} 1278let[s,details]=super.doPrepare(str,flags);if(this.currentMask){let currentDetails;[s,currentDetails]=super.doPrepare(s,this.currentMaskFlags(flags));details=details.aggregate(currentDetails);} 1279return[s,details];} 1280doPrepareChar(str,flags){if(flags===void 0){flags={};} 1281let[s,details]=super.doPrepareChar(str,flags);if(this.currentMask){let currentDetails;[s,currentDetails]=super.doPrepareChar(s,this.currentMaskFlags(flags));details=details.aggregate(currentDetails);} 1282return[s,details];} 1283reset(){var _this$currentMask;(_this$currentMask=this.currentMask)==null||_this$currentMask.reset();this.compiledMasks.forEach(m=>m.reset());} 1284get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:'';} 1285set value(value){if(this.exposeMask){this.exposeMask.value=value;this.currentMask=this.exposeMask;this._applyDispatch();}else super.value=value;} 1286get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:'';} 1287set unmaskedValue(unmaskedValue){if(this.exposeMask){this.exposeMask.unmaskedValue=unmaskedValue;this.currentMask=this.exposeMask;this._applyDispatch();}else super.unmaskedValue=unmaskedValue;} 1288get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:'';} 1289set typedValue(typedValue){if(this.exposeMask){this.exposeMask.typedValue=typedValue;this.currentMask=this.exposeMask;this._applyDispatch();return;} 1290let unmaskedValue=String(typedValue);if(this.currentMask){this.currentMask.typedValue=typedValue;unmaskedValue=this.currentMask.unmaskedValue;} 1291this.unmaskedValue=unmaskedValue;} 1292get displayValue(){return this.currentMask?this.currentMask.displayValue:'';} 1293get isComplete(){var _this$currentMask2;return Boolean((_this$currentMask2=this.currentMask)==null?void 0:_this$currentMask2.isComplete);} 1294get isFilled(){var _this$currentMask3;return Boolean((_this$currentMask3=this.currentMask)==null?void 0:_this$currentMask3.isFilled);} 1295remove(fromPos,toPos){const details=new ChangeDetails();if(this.currentMask){details.aggregate(this.currentMask.remove(fromPos,toPos)).aggregate(this._applyDispatch());} 1296return details;} 1297get state(){var _this$currentMask4;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(m=>m.state),currentMaskRef:this.currentMask,currentMask:(_this$currentMask4=this.currentMask)==null?void 0:_this$currentMask4.state};} 1298set state(state){const{compiledMasks,currentMaskRef,currentMask,...maskedState}=state;if(compiledMasks)this.compiledMasks.forEach((m,mi)=>m.state=compiledMasks[mi]);if(currentMaskRef!=null){this.currentMask=currentMaskRef;this.currentMask.state=currentMask;} 1299super.state=maskedState;} 1300extractInput(fromPos,toPos,flags){return this.currentMask?this.currentMask.extractInput(fromPos,toPos,flags):'';} 1301extractTail(fromPos,toPos){return this.currentMask?this.currentMask.extractTail(fromPos,toPos):super.extractTail(fromPos,toPos);} 1302doCommit(){if(this.currentMask)this.currentMask.doCommit();super.doCommit();} 1303nearestInputPos(cursorPos,direction){return this.currentMask?this.currentMask.nearestInputPos(cursorPos,direction):super.nearestInputPos(cursorPos,direction);} 1304get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite;} 1305set overwrite(overwrite){this._overwrite=overwrite;} 1306get eager(){return this.currentMask?this.currentMask.eager:this._eager;} 1307set eager(eager){this._eager=eager;} 1308get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid;} 1309set skipInvalid(skipInvalid){this._skipInvalid=skipInvalid;} 1310get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix;} 1311set autofix(autofix){this._autofix=autofix;} 1312maskEquals(mask){return Array.isArray(mask)?this.compiledMasks.every((m,mi)=>{if(!mask[mi])return;const{mask:oldMask,...restOpts}=mask[mi];return objectIncludes(m,restOpts)&&m.maskEquals(oldMask);}):super.maskEquals(mask);} 1313typedValueEquals(value){var _this$currentMask5;return Boolean((_this$currentMask5=this.currentMask)==null?void 0:_this$currentMask5.typedValueEquals(value));}} 1314MaskedDynamic.DEFAULTS={...Masked.DEFAULTS,dispatch:(appended,masked,flags,tail)=>{if(!masked.compiledMasks.length)return;const inputValue=masked.rawInputValue;const inputs=masked.compiledMasks.map((m,index)=>{const isCurrent=masked.currentMask===m;const startInputPos=isCurrent?m.displayValue.length:m.nearestInputPos(m.displayValue.length,DIRECTION.FORCE_LEFT);if(m.rawInputValue!==inputValue){m.reset();m.append(inputValue,{raw:true});}else if(!isCurrent){m.remove(startInputPos);} 1315m.append(appended,masked.currentMaskFlags(flags));m.appendTail(tail);return{index,weight:m.rawInputValue.length,totalInputPositions:m.totalInputPositions(0,Math.max(startInputPos,m.nearestInputPos(m.displayValue.length,DIRECTION.FORCE_LEFT)))};});inputs.sort((i1,i2)=>i2.weight-i1.weight||i2.totalInputPositions-i1.totalInputPositions);return masked.compiledMasks[inputs[0].index];}};IMask.MaskedDynamic=MaskedDynamic;class MaskedEnum extends MaskedPattern{constructor(opts){super({...MaskedEnum.DEFAULTS,...opts});} 1316updateOptions(opts){super.updateOptions(opts);} 1317_update(opts){const{enum:enum_,...eopts}=opts;if(enum_){const lengths=enum_.map(e=>e.length);const requiredLength=Math.min(...lengths);const optionalLength=Math.max(...lengths)-requiredLength;eopts.mask='*'.repeat(requiredLength);if(optionalLength)eopts.mask+='['+'*'.repeat(optionalLength)+']';this.enum=enum_;} 1318super._update(eopts);} 1319_appendCharRaw(ch,flags){if(flags===void 0){flags={};} 1320const matchFrom=Math.min(this.nearestInputPos(0,DIRECTION.FORCE_RIGHT),this.value.length);const matches=this.enum.filter(e=>this.matchValue(e,this.unmaskedValue+ch,matchFrom));if(matches.length){if(matches.length===1){this._forEachBlocksInRange(0,this.value.length,(b,bi)=>{const mch=matches[0][bi];if(bi>=this.value.length||mch===b.value)return;b.reset();b._appendChar(mch,flags);});} 1321const d=super._appendCharRaw(matches[0][this.value.length],flags);if(matches.length===1){matches[0].slice(this.unmaskedValue.length).split('').forEach(mch=>d.aggregate(super._appendCharRaw(mch)));} 1322return d;} 1323return new ChangeDetails({skip:!this.isComplete});} 1324extractTail(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1325if(toPos===void 0){toPos=this.displayValue.length;} 1326return new ContinuousTailDetails('',fromPos);} 1327remove(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1328if(toPos===void 0){toPos=this.displayValue.length;} 1329if(fromPos===toPos)return new ChangeDetails();const matchFrom=Math.min(super.nearestInputPos(0,DIRECTION.FORCE_RIGHT),this.value.length);let pos;for(pos=fromPos;pos>=0;--pos){const matches=this.enum.filter(e=>this.matchValue(e,this.value.slice(matchFrom,pos),matchFrom));if(matches.length>1)break;} 1330const details=super.remove(pos,toPos);details.tailShift+=pos-fromPos;return details;} 1331get isComplete(){return this.enum.indexOf(this.value)>=0;}} 1332MaskedEnum.DEFAULTS={...MaskedPattern.DEFAULTS,matchValue:(estr,istr,matchFrom)=>estr.indexOf(istr,matchFrom)===matchFrom};IMask.MaskedEnum=MaskedEnum;class MaskedFunction extends Masked{updateOptions(opts){super.updateOptions(opts);} 1333_update(opts){super._update({...opts,validate:opts.mask});}} 1334IMask.MaskedFunction=MaskedFunction;var _MaskedNumber;class MaskedNumber extends Masked{constructor(opts){super({...MaskedNumber.DEFAULTS,...opts});} 1335updateOptions(opts){super.updateOptions(opts);} 1336_update(opts){super._update(opts);this._updateRegExps();} 1337_updateRegExps(){const start='^'+(this.allowNegative?'[+|\\-]?':'');const mid='\\d*';const end=(this.scale?"("+escapeRegExp(this.radix)+"\\d{0,"+this.scale+"})?":'')+'$';this._numberRegExp=new RegExp(start+mid+end);this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(escapeRegExp).join('')+"]",'g');this._thousandsSeparatorRegExp=new RegExp(escapeRegExp(this.thousandsSeparator),'g');} 1338_removeThousandsSeparators(value){return value.replace(this._thousandsSeparatorRegExp,'');} 1339_insertThousandsSeparators(value){const parts=value.split(this.radix);parts[0]=parts[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator);return parts.join(this.radix);} 1340doPrepareChar(ch,flags){if(flags===void 0){flags={};} 1341const[prepCh,details]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(flags.input&&flags.raw||!flags.input&&!flags.raw)?ch.replace(this._mapToRadixRegExp,this.radix):ch),flags);if(ch&&!prepCh)details.skip=true;if(prepCh&&!this.allowPositive&&!this.value&&prepCh!=='-')details.aggregate(this._appendChar('-'));return[prepCh,details];} 1342_separatorsCount(to,extendOnSeparators){if(extendOnSeparators===void 0){extendOnSeparators=false;} 1343let count=0;for(let pos=0;pos<to;++pos){if(this._value.indexOf(this.thousandsSeparator,pos)===pos){++count;if(extendOnSeparators)to+=this.thousandsSeparator.length;}} 1344return count;} 1345_separatorsCountFromSlice(slice){if(slice===void 0){slice=this._value;} 1346return this._separatorsCount(this._removeThousandsSeparators(slice).length,true);} 1347extractInput(fromPos,toPos,flags){if(fromPos===void 0){fromPos=0;} 1348if(toPos===void 0){toPos=this.displayValue.length;} 1349[fromPos,toPos]=this._adjustRangeWithSeparators(fromPos,toPos);return this._removeThousandsSeparators(super.extractInput(fromPos,toPos,flags));} 1350_appendCharRaw(ch,flags){if(flags===void 0){flags={};} 1351const prevBeforeTailValue=flags.tail&&flags._beforeTailState?flags._beforeTailState._value:this._value;const prevBeforeTailSeparatorsCount=this._separatorsCountFromSlice(prevBeforeTailValue);this._value=this._removeThousandsSeparators(this.value);const oldValue=this._value;this._value+=ch;const num=this.number;let accepted=!isNaN(num);let skip=false;if(accepted){let fixedNum;if(this.min!=null&&this.min<0&&this.number<this.min)fixedNum=this.min;if(this.max!=null&&this.max>0&&this.number>this.max)fixedNum=this.max;if(fixedNum!=null){if(this.autofix){this._value=this.format(fixedNum,this).replace(MaskedNumber.UNMASKED_RADIX,this.radix);skip||(skip=oldValue===this._value&&!flags.tail);}else{accepted=false;}} 1352accepted&&(accepted=Boolean(this._value.match(this._numberRegExp)));} 1353let appendDetails;if(!accepted){this._value=oldValue;appendDetails=new ChangeDetails();}else{appendDetails=new ChangeDetails({inserted:this._value.slice(oldValue.length),rawInserted:skip?'':ch,skip});} 1354this._value=this._insertThousandsSeparators(this._value);const beforeTailValue=flags.tail&&flags._beforeTailState?flags._beforeTailState._value:this._value;const beforeTailSeparatorsCount=this._separatorsCountFromSlice(beforeTailValue);appendDetails.tailShift+=(beforeTailSeparatorsCount-prevBeforeTailSeparatorsCount)*this.thousandsSeparator.length;return appendDetails;} 1355_findSeparatorAround(pos){if(this.thousandsSeparator){const searchFrom=pos-this.thousandsSeparator.length+1;const separatorPos=this.value.indexOf(this.thousandsSeparator,searchFrom);if(separatorPos<=pos)return separatorPos;} 1356return-1;} 1357_adjustRangeWithSeparators(from,to){const separatorAroundFromPos=this._findSeparatorAround(from);if(separatorAroundFromPos>=0)from=separatorAroundFromPos;const separatorAroundToPos=this._findSeparatorAround(to);if(separatorAroundToPos>=0)to=separatorAroundToPos+this.thousandsSeparator.length;return[from,to];} 1358remove(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1359if(toPos===void 0){toPos=this.displayValue.length;} 1360[fromPos,toPos]=this._adjustRangeWithSeparators(fromPos,toPos);const valueBeforePos=this.value.slice(0,fromPos);const valueAfterPos=this.value.slice(toPos);const prevBeforeTailSeparatorsCount=this._separatorsCount(valueBeforePos.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(valueBeforePos+valueAfterPos));const beforeTailSeparatorsCount=this._separatorsCountFromSlice(valueBeforePos);return new ChangeDetails({tailShift:(beforeTailSeparatorsCount-prevBeforeTailSeparatorsCount)*this.thousandsSeparator.length});} 1361nearestInputPos(cursorPos,direction){if(!this.thousandsSeparator)return cursorPos;switch(direction){case DIRECTION.NONE:case DIRECTION.LEFT:case DIRECTION.FORCE_LEFT:{const separatorAtLeftPos=this._findSeparatorAround(cursorPos-1);if(separatorAtLeftPos>=0){const separatorAtLeftEndPos=separatorAtLeftPos+this.thousandsSeparator.length;if(cursorPos<separatorAtLeftEndPos||this.value.length<=separatorAtLeftEndPos||direction===DIRECTION.FORCE_LEFT){return separatorAtLeftPos;}} 1362break;} 1363case DIRECTION.RIGHT:case DIRECTION.FORCE_RIGHT:{const separatorAtRightPos=this._findSeparatorAround(cursorPos);if(separatorAtRightPos>=0){return separatorAtRightPos+this.thousandsSeparator.length;}}} 1364return cursorPos;} 1365doCommit(){if(this.value){const number=this.number;let validnum=number;if(this.min!=null)validnum=Math.max(validnum,this.min);if(this.max!=null)validnum=Math.min(validnum,this.max);if(validnum!==number)this.unmaskedValue=this.format(validnum,this);let formatted=this.value;if(this.normalizeZeros)formatted=this._normalizeZeros(formatted);if(this.padFractionalZeros&&this.scale>0)formatted=this._padFractionalZeros(formatted);this._value=formatted;} 1366super.doCommit();} 1367_normalizeZeros(value){const parts=this._removeThousandsSeparators(value).split(this.radix);parts[0]=parts[0].replace(/^(\D*)(0*)(\d*)/,(match,sign,zeros,num)=>sign+num);if(value.length&&!/\d$/.test(parts[0]))parts[0]=parts[0]+'0';if(parts.length>1){parts[1]=parts[1].replace(/0*$/,'');if(!parts[1].length)parts.length=1;} 1368return this._insertThousandsSeparators(parts.join(this.radix));} 1369_padFractionalZeros(value){if(!value)return value;const parts=value.split(this.radix);if(parts.length<2)parts.push('');parts[1]=parts[1].padEnd(this.scale,'0');return parts.join(this.radix);} 1370doSkipInvalid(ch,flags,checkTail){if(flags===void 0){flags={};} 1371const dropFractional=this.scale===0&&ch!==this.thousandsSeparator&&(ch===this.radix||ch===MaskedNumber.UNMASKED_RADIX||this.mapToRadix.includes(ch));return super.doSkipInvalid(ch,flags,checkTail)&&!dropFractional;} 1372get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,MaskedNumber.UNMASKED_RADIX);} 1373set unmaskedValue(unmaskedValue){super.unmaskedValue=unmaskedValue;} 1374get typedValue(){return this.parse(this.unmaskedValue,this);} 1375set typedValue(n){this.rawInputValue=this.format(n,this).replace(MaskedNumber.UNMASKED_RADIX,this.radix);} 1376get number(){return this.typedValue;} 1377set number(number){this.typedValue=number;} 1378get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0;} 1379get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0;} 1380typedValueEquals(value){return(super.typedValueEquals(value)||MaskedNumber.EMPTY_VALUES.includes(value)&&MaskedNumber.EMPTY_VALUES.includes(this.typedValue))&&!(value===0&&this.value==='');}} 1381_MaskedNumber=MaskedNumber;MaskedNumber.UNMASKED_RADIX='.';MaskedNumber.EMPTY_VALUES=[...Masked.EMPTY_VALUES,0];MaskedNumber.DEFAULTS={...Masked.DEFAULTS,mask:Number,radix:',',thousandsSeparator:'',mapToRadix:[_MaskedNumber.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:true,padFractionalZeros:false,parse:Number,format:n=>n.toLocaleString('en-US',{useGrouping:false,maximumFractionDigits:20})};IMask.MaskedNumber=MaskedNumber;const PIPE_TYPE={MASKED:'value',UNMASKED:'unmaskedValue',TYPED:'typedValue'};function createPipe(arg,from,to){if(from===void 0){from=PIPE_TYPE.MASKED;} 1382if(to===void 0){to=PIPE_TYPE.MASKED;} 1383const masked=createMask(arg);return value=>masked.runIsolated(m=>{m[from]=value;return m[to];});} 1384function pipe(value,mask,from,to){return createPipe(mask,from,to)(value);} 1385IMask.PIPE_TYPE=PIPE_TYPE;IMask.createPipe=createPipe;IMask.pipe=pipe;class RepeatBlock extends MaskedPattern{get repeatFrom(){var _ref;return(_ref=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===Infinity?0:this.repeat)!=null?_ref:0;} 1386get repeatTo(){var _ref2;return(_ref2=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?_ref2:Infinity;} 1387constructor(opts){super(opts);} 1388updateOptions(opts){super.updateOptions(opts);} 1389_update(opts){var _ref3,_ref4,_this$_blocks;const{repeat,...blockOpts}=normalizeOpts(opts);this._blockOpts=Object.assign({},this._blockOpts,blockOpts);const block=createMask(this._blockOpts);this.repeat=(_ref3=(_ref4=repeat!=null?repeat:block.repeat)!=null?_ref4:this.repeat)!=null?_ref3:Infinity;super._update({mask:'m'.repeat(Math.max(this.repeatTo===Infinity&&((_this$_blocks=this._blocks)==null?void 0:_this$_blocks.length)||0,this.repeatFrom)),blocks:{m:block},eager:block.eager,overwrite:block.overwrite,skipInvalid:block.skipInvalid,lazy:block.lazy,placeholderChar:block.placeholderChar,displayChar:block.displayChar});} 1390_allocateBlock(bi){if(bi<this._blocks.length)return this._blocks[bi];if(this.repeatTo===Infinity||this._blocks.length<this.repeatTo){this._blocks.push(createMask(this._blockOpts));this.mask+='m';return this._blocks[this._blocks.length-1];}} 1391_appendCharRaw(ch,flags){if(flags===void 0){flags={};} 1392const details=new ChangeDetails();for(let bi=(_this$_mapPosToBlock$=(_this$_mapPosToBlock=this._mapPosToBlock(this.displayValue.length))==null?void 0:_this$_mapPosToBlock.index)!=null?_this$_mapPosToBlock$:Math.max(this._blocks.length-1,0),block,allocated;block=(_this$_blocks$bi=this._blocks[bi])!=null?_this$_blocks$bi:allocated=!allocated&&this._allocateBlock(bi);++bi){var _this$_mapPosToBlock$,_this$_mapPosToBlock,_this$_blocks$bi,_flags$_beforeTailSta;
1392const blockDetails=block._appendChar(ch,{...flags,_beforeTailState:(_flags$_beforeTailSta=flags._beforeTailState)==null||(_flags$_beforeTailSta=_flags$_beforeTailSta._blocks)==null?void 0:_flags$_beforeTailSta[bi]});if(blockDetails.skip&&allocated){this._blocks.pop();this.mask=this.mask.slice(1);break;} 1393details.aggregate(blockDetails);if(blockDetails.consumed)break;} 1394return details;} 1395_trimEmptyTail(fromPos,toPos){var _this$_mapPosToBlock2,_this$_mapPosToBlock3;if(fromPos===void 0){fromPos=0;} 1396const firstBlockIndex=Math.max(((_this$_mapPosToBlock2=this._mapPosToBlock(fromPos))==null?void 0:_this$_mapPosToBlock2.index)||0,this.repeatFrom,0);let lastBlockIndex;if(toPos!=null)lastBlockIndex=(_this$_mapPosToBlock3=this._mapPosToBlock(toPos))==null?void 0:_this$_mapPosToBlock3.index;if(lastBlockIndex==null)lastBlockIndex=this._blocks.length-1;let removeCount=0;for(let blockIndex=lastBlockIndex;firstBlockIndex<=blockIndex;--blockIndex,++removeCount){if(this._blocks[blockIndex].unmaskedValue)break;} 1397if(removeCount){this._blocks.splice(lastBlockIndex-removeCount+1,removeCount);this.mask=this.mask.slice(removeCount);}} 1398reset(){super.reset();this._trimEmptyTail();} 1399remove(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1400if(toPos===void 0){toPos=this.displayValue.length;} 1401const removeDetails=super.remove(fromPos,toPos);this._trimEmptyTail(fromPos,toPos);return removeDetails;} 1402totalInputPositions(fromPos,toPos){if(fromPos===void 0){fromPos=0;} 1403if(toPos==null&&this.repeatTo===Infinity)return Infinity;return super.totalInputPositions(fromPos,toPos);} 1404get state(){return super.state;} 1405set state(state){this._blocks.length=state._blocks.length;this.mask=this.mask.slice(0,this._blocks.length);super.state=state;}} 1406IMask.RepeatBlock=RepeatBlock;try{globalThis.IMask=IMask;}catch{} 1407exports.ChangeDetails=ChangeDetails;exports.ChunksTailDetails=ChunksTailDetails;exports.DIRECTION=DIRECTION;exports.HTMLContenteditableMaskElement=HTMLContenteditableMaskElement;exports.HTMLInputMaskElement=HTMLInputMaskElement;exports.HTMLMaskElement=HTMLMaskElement;exports.InputMask=InputMask;exports.MaskElement=MaskElement;exports.Masked=Masked;exports.MaskedDate=MaskedDate;exports.MaskedDynamic=MaskedDynamic;exports.MaskedEnum=MaskedEnum;exports.MaskedFunction=MaskedFunction;exports.MaskedNumber=MaskedNumber;exports.MaskedPattern=MaskedPattern;exports.MaskedRange=MaskedRange;exports.MaskedRegExp=MaskedRegExp;exports.PIPE_TYPE=PIPE_TYPE;exports.PatternFixedDefinition=PatternFixedDefinition;exports.PatternInputDefinition=PatternInputDefinition;exports.RepeatBlock=RepeatBlock;exports.createMask=createMask;exports.createPipe=createPipe;exports.default=IMask;exports.forceDirection=forceDirection;exports.normalizeOpts=normalizeOpts;exports.pipe=pipe;Object.defineProperty(exports,'__esModule',{value:true});}));;(function(w,$){'use strict';var knownHints=['check_in_date_hint','check_out_date_hint','selected_dates_hint','days_number_hint','start_time_hint','end_time_hint'];w.wpbc_free_date_hints__apply=function(resourceId,hints){resourceId=parseInt(resourceId,10)||1;hints=hints||{};$.each(hints,function(hintName,hintValue){var valueText=$('<div />').html(hintValue).text();$('#'+hintName+'_tip'+resourceId+',.'+hintName+'_tip'+resourceId).html(hintValue);$('#'+hintName+resourceId).val(valueText);if(typeof w.wpbc__spin_loader__micro__hide==='function'){w.wpbc__spin_loader__micro__hide(hintName+'_tip'+resourceId);}});};if(typeof w.wpbc_send_ajax__show_cost_hints!=='function'){w.wpbc_send_ajax__show_cost_hints=function(resourceId){var allDates,formData,myBookingFormName='',nonceEl,inst;resourceId=parseInt(resourceId,10)||1;$('.booking_form_div').trigger('before_show_cost_hints',[resourceId]);if(document.getElementById('parent_of_additional_calendar'+resourceId)!==null){resourceId=parseInt(document.getElementById('parent_of_additional_calendar'+resourceId).value,10)||resourceId;} 1408if(0===$('#booking_form'+resourceId).find('.wpbc_free_date_hint').length){return false;} 1409allDates=$('#date_booking'+resourceId).val()||'';if('undefined'!==typeof _wpbc&&'dynamic'===_wpbc.calendar__get_param_value(resourceId,'days_select_mode')){inst=(typeof w.wpbc_calendar__get_inst==='function')?w.wpbc_calendar__get_inst(resourceId):null;if(null!==inst&&inst.stayOpen===true){$('.wpbc_free_date_hint').html('...');return false;}} 1410$.each(knownHints,function(index,hintName){var hintId=hintName+'_tip'+resourceId;if(typeof w.wpbc__spin_loader__micro__show__inside==='function'){w.wpbc__spin_loader__micro__show__inside(hintId,'#'+hintId+',.'+hintId);}else{$('#'+hintId+',.'+hintId).html('...');}});if(document.getElementById('booking_form_type'+resourceId)!==null){myBookingFormName=document.getElementById('booking_form_type'+resourceId).value;} 1411nonceEl=document.getElementById('wpbc_nonceCALCULATE_THE_COST'+resourceId);if(!nonceEl){return false;}
1412formData=wpbc_free_date_hints__get_form_fields_as_string(resourceId);$.ajax({url:w.wpbc_url_ajax,type:'POST',success:function(data,textStatus){if('success'===textStatus){$('#ajax_respond_insert'+resourceId).html(data);} 1413$('.booking_form_div').trigger('after_show_cost_hints',[resourceId]);},error:function(XMLHttpRequest,textStatus){w.status='Ajax sending Error status:'+textStatus;if(w.console&&w.console.error){w.console.error(XMLHttpRequest.status+' '+XMLHttpRequest.statusText);}},data:{action:'CALCULATE_THE_COST',form:formData,all_dates:allDates,bk_type:resourceId,booking_form_type:myBookingFormName,wpdev_active_locale:('undefined'!==typeof _wpbc)?_wpbc.get_other_param('locale_active'):'',wpbc_nonce:nonceEl.value}});$('.booking_form_div').trigger('show_cost_hints',[resourceId]);$('.booking_form_div').trigger('wpbc_booking_date_or_option_selected',[resourceId]);return false;};} 1414if(typeof w.wpbc_show_cost_hints_after_few_seconds!=='function'){w.wpbc_show_cost_hints_after_few_seconds=(function(){var closedTimer=0;return function(resourceId,timerDelay){timerDelay=typeof timerDelay!=='undefined'?timerDelay:250;clearTimeout(closedTimer);closedTimer=setTimeout(w.wpbc_send_ajax__show_cost_hints.bind(null,resourceId),timerDelay);};}());} 1415if(typeof w.showCostHintInsideBkForm!=='function'){w.showCostHintInsideBkForm=function(resourceId){w.wpbc_show_cost_hints_after_few_seconds(resourceId);};} 1416$(function(){$('body').on('wpbc_calendar_ajx__loaded_data',function(event,loadedResourceId){w.wpbc_show_cost_hints_after_few_seconds(loadedResourceId);});$(document).on('date_selected.wpbc_free_date_hints','.booking_form_div',function(event,resourceId){w.wpbc_show_cost_hints_after_few_seconds(resourceId);});$(document).on('change','.booking_form_div input, .booking_form_div select, .booking_form_div textarea',function(){var form=$(this).closest('form.booking_form'),resourceId;if(!form.length||/^date_booking/.test(this.name||'')){return;} 1417resourceId=parseInt(form.attr('id').replace('booking_form',''),10);if(resourceId>0){w.wpbc_show_cost_hints_after_few_seconds(resourceId);}});});function wpbc_free_date_hints__get_form_fields_as_string(resourceId){var form=document.getElementById('booking_form'+resourceId),formData='',count,i,element,elementType,inputValue;if(!form||!form.elements){return'';} 1418count=form.elements.length;for(i=0;i<count;i++){element=form.elements[i];if(!element||!element.name){continue;} 1419if('button'===element.type||'hidden'===element.type||element.name===('date_booking'+resourceId)||element.name===('captcha_input'+resourceId)
1419){continue;} 1420elementType=element.type;if('checkbox'===element.type){inputValue=element.checked?element.value:'';}else if('radio'===element.type){if(!element.checked){continue;} 1421inputValue=element.value;}else{inputValue=$(element).val();} 1422if('selectbox-multiple'===element.type||'select-multiple'===element.type){inputValue=$('[name="'+element.name+'"]').val();if(inputValue===null||inputValue.toString()===''){inputValue='';}} 1423elementType=(element.className.indexOf('wpdev-validates-as-email')!==-1)?'email':elementType;elementType=(element.className.indexOf('wpdev-validates-as-coupon')!==-1)?'coupon':elementType;elementType=('select-one'===elementType)?'selectbox-one':elementType;elementType=('select-multiple'===elementType)?'selectbox-multiple':elementType;if(formData!==''){formData+='~';} 1424formData+=elementType+'^'+element.name+'^'+inputValue;} 1425return formData;}}(window,jQuery));;"use strict";function wpbc_flextimeline_nav(timeline_obj,nav_step){jQuery(".wpbc_timeline_front_end").trigger("timeline_nav",[timeline_obj,nav_step]);jQuery('#'+timeline_obj.html_client_id+' .flex_tl_prev,#'+timeline_obj.html_client_id+' .flex_tl_next').remove();jQuery('#'+timeline_obj.html_client_id+' .flex_tl_title').html('<span class="wpbc_icn_rotate_right wpbc_spin"></span>   Loading...');jQuery.ajax({url:wpbc_url_ajax,type:'POST',success:function(data,textStatus){if(textStatus=='success'){jQuery('#'+timeline_obj.html_client_id+' .wpbc_timeline_ajax_replace').html(data);return true;}},error:function(XMLHttpRequest,textStatus,errorThrown){window.status='Ajax Error! Status: '+textStatus;alert('Ajax Error! Status: '+XMLHttpRequest.status+' '+XMLHttpRequest.statusText);},data:{action:'WPBC_FLEXTIMELINE_NAV',timeline_obj:timeline_obj,nav_step:nav_step,wpdev_active_locale:_wpbc.get_other_param('locale_active'),wpbc_nonce:document.getElementById('wpbc_nonce_'+timeline_obj.html_client_id).value}});}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.